diff -Nru juju-core-2.0.0/debian/changelog juju-core-2.0.2/debian/changelog --- juju-core-2.0.0/debian/changelog 2016-10-31 17:41:40.000000000 +0000 +++ juju-core-2.0.2/debian/changelog 2016-12-15 04:23:32.000000000 +0000 @@ -1,3 +1,10 @@ +juju-core (2.0.2-0ubuntu1) zesty; urgency=medium + + * New upstream release 2.0.2 (LP: #1648894) + * d/copyright Updated for 2.0.2 vendored packages. + + -- Curtis C. Hovey Thu, 15 Dec 2016 04:21:04 +0000 + juju-core (2.0.0-0ubuntu2) zesty; urgency=medium * Restore golang-github-coreos-go-systemd-dev diff -Nru juju-core-2.0.0/debian/copyright juju-core-2.0.2/debian/copyright --- juju-core-2.0.0/debian/copyright 2016-10-20 13:22:37.000000000 +0000 +++ juju-core-2.0.2/debian/copyright 2016-12-15 15:06:59.000000000 +0000 @@ -233,18 +233,7 @@ Files: src/github.com/juju/gomaasapi/* Copyright: 2012-2016, Canonical Ltd. License: LGPL-3+ -Comment: Last verified commit 8c484173e0870fc49c9214c56c6ae8dc9c26463d - -Files: src/github.com/juju/govmomi/* -Copyright: 2014-2015 VMware, Inc. All Rights Reserved. -License: Apache-2.0 -Comment: Last verified commit 4354a88d4b34abe467215f77c2fc1cb9f78b66f7 - -Files: src/github.com/juju/govmomi/vim25/xml/* -Copyright: 2011 The Go Authors. -License: BSD-3-clause -Comment: This is a fork of the upstream golang xml package that fixes - issues in golang 1.2.x. +Comment: Last verified commit f0300c96aa5e0deb3cc599ca8a8949097b955e60 Files: src/github.com/juju/httpprof/* Copyright: 2010-2012 The Go Authors. All rights reserved. @@ -288,8 +277,8 @@ The original Apache-2.0 license for the external source can be found inside src/github.com/juju/juju/cloudconfig/Apache-License.txt. -Files: src/github.com/juju/juju/etc/bash_completion.d/juju* -Copyright: 2013+ Canonical Ltd. +Files: src/github.com/juju/juju/etc/bash_completion.d/juju-2.0 +Copyright: 2016+ Canonical Ltd. License: GPL-3 Files: src/github.com/juju/juju/scripts/win-installer/modpath.iss @@ -366,9 +355,9 @@ License: BSD-3-clause Files: src/github.com/juju/txn/* -Copyright: 2014, 2015 Canonical Ltd. +Copyright: 2014, 2015, 2016 Canonical Ltd. License: LGPL-3 with linking exception -Comment: Last verified commit 18d812a45ffc407a4d5f849036b7d8d12febaf08 +Comment: Last verified commit af2fa2051800371a0272610882891a28c719c02c Files: src/github.com/juju/usso/* Copyright: 2015 Canonical Ltd. @@ -379,7 +368,7 @@ Copyright: 2011-2016 Canonical Ltd. 2014, 2015, 2016 Cloudbase Solutions SRL License: LGPL-3 with linking exception -Comment: Last verified commit 406e7197d0690a3f28c5a147138774eec4c1355e +Comment: Last verified commit 28c01ec2ad930d41fe5acd9969b96284eb61660b Files: src/github.com/juju/utils/du/diskusage.go src/github.com/juju/utils/du/diskusage_windows.go @@ -501,6 +490,17 @@ License: BSD-3-clause Comment: Last verified commit 6724a57986aff9bff1a1770e9347036def7c89f6 +Files: src/github.com/vmware/govmomi/* +Copyright: 2014-2016 VMware, Inc. All Rights Reserved. +License: Apache-2.0 +Comment: Last verified commit c0c7ce63df7edd78e713257b924c89d9a2dac119 + +Files: src/github.com/vmware/govmomi/vim25/xml/* +Copyright: 2012 The Go Authors. +License: BSD-3-clause +Comment: This is a fork of the upstream golang xml package that fixes + issues in golang 1.2.x. + Files: src/golang.org/x/crypto/* Copyright: 2009-2016 The Go Authors. All rights reserved. License: BSD-3-clause @@ -564,7 +564,7 @@ Files: src/gopkg.in/goose.v1/* Copyright: 2013-2015, Canonical Ltd. License: LGPL-3+ -Comment: Last verified commit 495e6fa2ab89bc5ed2c8e1bbcbc4c9e4a3c97d37 +Comment: Last verified commit 328e6b224fce7ab412f62b841757be1596f3b3a8 Files: src/gopkg.in/ini.v1/* Copyright: 2014, 2015 Unknwon diff -Nru juju-core-2.0.0/src/github.com/juju/gomaasapi/controller.go juju-core-2.0.2/src/github.com/juju/gomaasapi/controller.go --- juju-core-2.0.0/src/github.com/juju/gomaasapi/controller.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/gomaasapi/controller.go 2016-11-11 00:08:16.000000000 +0000 @@ -444,12 +444,12 @@ return strings.Join(values, ";") } -func (a *AllocateMachineArgs) notNetworks() string { +func (a *AllocateMachineArgs) notSubnets() []string { var values []string for _, v := range a.NotSpace { values = append(values, "space:"+v) } - return strings.Join(values, ",") + return values } // ConstraintMatches provides a way for the caller of AllocateMachine to determine @@ -480,7 +480,7 @@ params.MaybeAddMany("not_tags", args.NotTags) params.MaybeAdd("storage", args.storage()) params.MaybeAdd("interfaces", args.interfaces()) - params.MaybeAdd("not_networks", args.notNetworks()) + params.MaybeAddMany("not_subnets", args.notSubnets()) params.MaybeAdd("zone", args.Zone) params.MaybeAddMany("not_in_zone", args.NotInZone) params.MaybeAdd("agent_name", args.AgentName) diff -Nru juju-core-2.0.0/src/github.com/juju/gomaasapi/controller_test.go juju-core-2.0.2/src/github.com/juju/gomaasapi/controller_test.go --- juju-core-2.0.0/src/github.com/juju/gomaasapi/controller_test.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/gomaasapi/controller_test.go 2016-11-11 00:08:16.000000000 +0000 @@ -370,11 +370,11 @@ func (s *controllerSuite) TestAllocateMachineArgs(c *gc.C) { for i, test := range []struct { - args AllocateMachineArgs - err string - storage string - interfaces string - notNetworks string + args AllocateMachineArgs + err string + storage string + interfaces string + notSubnets []string }{{ args: AllocateMachineArgs{}, }, { @@ -425,7 +425,12 @@ args: AllocateMachineArgs{ NotSpace: []string{"foo"}, }, - notNetworks: "space:foo", + notSubnets: []string{"space:foo"}, + }, { + args: AllocateMachineArgs{ + NotSpace: []string{"foo", "bar"}, + }, + notSubnets: []string{"space:foo", "space:bar"}, }} { c.Logf("test %d", i) err := test.args.Validate() @@ -433,7 +438,7 @@ c.Check(err, jc.ErrorIsNil) c.Check(test.args.storage(), gc.Equals, test.storage) c.Check(test.args.interfaces(), gc.Equals, test.interfaces) - c.Check(test.args.notNetworks(), gc.Equals, test.notNetworks) + c.Check(test.args.notSubnets(), jc.DeepEquals, test.notSubnets) } else { c.Check(err, jc.Satisfies, errors.IsNotValid) c.Check(err.Error(), gc.Equals, test.err) @@ -568,7 +573,7 @@ // Positive space check. c.Assert(form.Get("interfaces"), gc.Equals, "default:space=magic") // Negative space check. - c.Assert(form.Get("not_networks"), gc.Equals, "space:special") + c.Assert(form.Get("not_subnets"), gc.Equals, "space:special") } func (s *controllerSuite) TestAllocateMachineNoMatch(c *gc.C) { diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/CHANGELOG.md juju-core-2.0.2/src/github.com/juju/govmomi/CHANGELOG.md --- juju-core-2.0.0/src/github.com/juju/govmomi/CHANGELOG.md 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/CHANGELOG.md 1970-01-01 00:00:00.000000000 +0000 @@ -1,21 +0,0 @@ -# changelog - -### (unreleased) - -... - -* Make optional boolean fields pointers (`vim25/types`). - - False is the zero value of a boolean field, which means they are not serialized - if the field is marked "omitempty". If the field is a pointer instead, the zero - value will be the nil pointer, and both true and false values are serialized. - -### 0.1.0 (2015-03-17) - -Prior to this version the API of this library was in flux. - -Notable changes w.r.t. the state of this library before March 2015 are: - -* All functions that may execute a request take a `context.Context` parameter. -* The `vim25` package contains a minimal client implementation. -* The property collector and its convenience functions live in the `property` package. diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/client.go juju-core-2.0.2/src/github.com/juju/govmomi/client.go --- juju-core-2.0.0/src/github.com/juju/govmomi/client.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/client.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,131 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -/* -This package is the root package of the govmomi library. - -The library is structured as follows: - -Package vim25 - -The minimal usable functionality is available through the vim25 package. -It contains subpackages that contain generated types, managed objects, and all -available methods. The vim25 package is entirely independent of the other -packages in the govmomi tree -- it has no dependencies on its peers. - -The vim25 package itself contains a client structure that is -passed around throughout the entire library. It abstracts a session and its -immutable state. See the vim25 package for more information. - -Package session - -The session package contains an abstraction for the session manager that allows -a user to login and logout. It also provides access to the current session -(i.e. to determine if the user is in fact logged in) - -Package object - -The object package contains wrappers for a selection of managed objects. The -constructors of these objects all take a *vim25.Client, which they pass along -to derived objects, if applicable. - -Package govc - -The govc package contains the govc CLI. The code in this tree is not intended -to be used as a library. Any functionality that govc contains that _could_ be -used as a library function but isn't, _should_ live in a root level package. - -Other packages - -Other packages, such as "event", "guest", or "license", provide wrappers for -the respective subsystems. They are typically not needed in normal workflows so -are kept outside the object package. -*/ -package govmomi - -import ( - "net/url" - - "github.com/juju/govmomi/property" - "github.com/juju/govmomi/session" - "github.com/juju/govmomi/vim25" - "github.com/juju/govmomi/vim25/soap" - "github.com/juju/govmomi/vim25/types" - "golang.org/x/net/context" -) - -type Client struct { - *vim25.Client - - SessionManager *session.Manager -} - -// NewClient creates a new client from a URL. The client authenticates with the -// server before returning if the URL contains user information. -func NewClient(ctx context.Context, u *url.URL, insecure bool) (*Client, error) { - soapClient := soap.NewClient(u, insecure) - vimClient, err := vim25.NewClient(ctx, soapClient) - if err != nil { - return nil, err - } - - c := &Client{ - Client: vimClient, - SessionManager: session.NewManager(vimClient), - } - - // Only login if the URL contains user information. - if u.User != nil { - err = c.Login(ctx, u.User) - if err != nil { - return nil, err - } - } - - return c, nil -} - -// Login dispatches to the SessionManager. -func (c *Client) Login(ctx context.Context, u *url.Userinfo) error { - return c.SessionManager.Login(ctx, u) -} - -// Logout dispatches to the SessionManager. -func (c *Client) Logout(ctx context.Context) error { - // Close any idle connections after logging out. - defer c.Client.CloseIdleConnections() - return c.SessionManager.Logout(ctx) -} - -// PropertyCollector returns the session's default property collector. -func (c *Client) PropertyCollector() *property.Collector { - return property.DefaultCollector(c.Client) -} - -// RetrieveOne dispatches to the Retrieve function on the default property collector. -func (c *Client) RetrieveOne(ctx context.Context, obj types.ManagedObjectReference, p []string, dst interface{}) error { - return c.PropertyCollector().RetrieveOne(ctx, obj, p, dst) -} - -// Retrieve dispatches to the Retrieve function on the default property collector. -func (c *Client) Retrieve(ctx context.Context, objs []types.ManagedObjectReference, p []string, dst interface{}) error { - return c.PropertyCollector().Retrieve(ctx, objs, p, dst) -} - -// Wait dispatches to property.Wait. -func (c *Client) Wait(ctx context.Context, obj types.ManagedObjectReference, ps []string, f func([]types.PropertyChange) bool) error { - return property.Wait(ctx, c.PropertyCollector(), obj, ps, f) -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/client_test.go juju-core-2.0.2/src/github.com/juju/govmomi/client_test.go --- juju-core-2.0.0/src/github.com/juju/govmomi/client_test.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/client_test.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,138 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package govmomi - -import ( - "errors" - "net/http" - "net/url" - "testing" - - "github.com/juju/govmomi/test" - "github.com/juju/govmomi/vim25/mo" - "github.com/juju/govmomi/vim25/types" - "golang.org/x/net/context" -) - -func TestNewClient(t *testing.T) { - u := test.URL() - if u == nil { - t.SkipNow() - } - - c, err := NewClient(context.Background(), u, true) - if err != nil { - t.Fatal(err) - } - - f := func() error { - var x mo.Folder - err = mo.RetrieveProperties(context.Background(), c, c.ServiceContent.PropertyCollector, c.ServiceContent.RootFolder, &x) - if err != nil { - return err - } - if len(x.Name) == 0 { - return errors.New("empty response") - } - return nil - } - - // check cookie is valid with an sdk request - if err := f(); err != nil { - t.Fatal(err) - } - - // check cookie is valid with a non-sdk request - u.User = nil // turn off Basic auth - u.Path = "/folder" - r, err := c.Client.Get(u.String()) - if err != nil { - t.Fatal(err) - } - if r.StatusCode != http.StatusOK { - t.Fatal(r) - } - - // sdk request should fail w/o a valid cookie - c.Client.Jar = nil - if err := f(); err == nil { - t.Fatal("should fail") - } - - // invalid login - u.Path = "/sdk" - u.User = url.UserPassword("ENOENT", "EINVAL") - _, err = NewClient(context.Background(), u, true) - if err == nil { - t.Fatal("should fail") - } -} - -func TestInvalidSdk(t *testing.T) { - u := test.URL() - if u == nil { - t.SkipNow() - } - - // a URL other than a valid /sdk should error, not panic - u.Path = "/mob" - _, err := NewClient(context.Background(), u, true) - if err == nil { - t.Fatal("should fail") - } -} - -func TestPropertiesN(t *testing.T) { - u := test.URL() - if u == nil { - t.SkipNow() - } - - c, err := NewClient(context.Background(), u, true) - if err != nil { - t.Fatal(err) - } - - var f mo.Folder - err = c.RetrieveOne(context.Background(), c.ServiceContent.RootFolder, nil, &f) - if err != nil { - t.Fatal(err) - } - - var dc mo.Datacenter - err = c.RetrieveOne(context.Background(), f.ChildEntity[0], nil, &dc) - if err != nil { - t.Fatal(err) - } - - var folderReferences = []types.ManagedObjectReference{ - dc.DatastoreFolder, - dc.HostFolder, - dc.NetworkFolder, - dc.VmFolder, - } - - var folders []mo.Folder - err = c.Retrieve(context.Background(), folderReferences, []string{"name"}, &folders) - if err != nil { - t.Fatal(err) - } - - if len(folders) != len(folderReferences) { - t.Fatalf("Expected %d, got %d", len(folderReferences), len(folders)) - } -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/contrib/debug-ls.sh juju-core-2.0.2/src/github.com/juju/govmomi/contrib/debug-ls.sh --- juju-core-2.0.0/src/github.com/juju/govmomi/contrib/debug-ls.sh 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/contrib/debug-ls.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,43 +0,0 @@ -#!/bin/bash - -# Copyright (c) 2014 VMware, Inc. All Rights Reserved. -# -# 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, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set -e - -# This script shows for every request in a debug trace how long it took -# and the name of the request body. - -function body-name { - ( - xmllint --shell $1 < ./metadata.json - -cd $dir - -tar -C $tmp -cvzf vcsa.box . - -vagrant box add --name vcsa vcsa.box diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/contrib/vagrant/vcsa/.gitignore juju-core-2.0.2/src/github.com/juju/govmomi/contrib/vagrant/vcsa/.gitignore --- juju-core-2.0.0/src/github.com/juju/govmomi/contrib/vagrant/vcsa/.gitignore 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/contrib/vagrant/vcsa/.gitignore 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -*.box -*.ova -.vagrant diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/contrib/vagrant/vcsa/Vagrantfile juju-core-2.0.2/src/github.com/juju/govmomi/contrib/vagrant/vcsa/Vagrantfile --- juju-core-2.0.0/src/github.com/juju/govmomi/contrib/vagrant/vcsa/Vagrantfile 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/contrib/vagrant/vcsa/Vagrantfile 1970-01-01 00:00:00.000000000 +0000 @@ -1,13 +0,0 @@ -# -*- mode: ruby -*- -# vi: set ft=ruby : - -# Using the VCSA base box, no provisioning, inventory will be empty. - -Vagrant.configure("2") do |config| - config.vm.hostname = "vcsa" - - config.vm.box = "vcsa" - config.vm.synced_folder ".", "/vagrant", disabled: true - - config.vm.network "forwarded_port", guest: 443, host: 16443 -end diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/contrib/vagrant/vcsa/vagrant.sh juju-core-2.0.2/src/github.com/juju/govmomi/contrib/vagrant/vcsa/vagrant.sh --- juju-core-2.0.0/src/github.com/juju/govmomi/contrib/vagrant/vcsa/vagrant.sh 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/contrib/vagrant/vcsa/vagrant.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,24 +0,0 @@ -#!/bin/sh - -useradd vagrant -m -s /bin/bash -groupmod -A vagrant wheel - -echo -e "vagrant ALL=(ALL) NOPASSWD: ALL\n" >> /etc/sudoers - -mkdir ~vagrant/.ssh -wget --no-check-certificate \ - https://raw.githubusercontent.com/mitchellh/vagrant/master/keys/vagrant.pub \ - -O ~vagrant/.ssh/authorized_keys -chown -R vagrant ~vagrant/.ssh -chmod -R go-rwsx ~vagrant/.ssh - -perl -pi -e 's/^#UseDNS yes/UseDNS no/' /etc/ssh/sshd_config -perl -pi -e 's/^AllowTcpForwarding no//' /etc/ssh/sshd_config -perl -pi -e 's/^PermitTunnel no//' /etc/ssh/sshd_config -perl -pi -e 's/^MaxSessions \d+//' /etc/ssh/sshd_config - -# disable password expiration -for uid in root vagrant -do - chage -I -1 -E -1 -m 0 -M -1 $uid -done diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/CONTRIBUTORS juju-core-2.0.2/src/github.com/juju/govmomi/CONTRIBUTORS --- juju-core-2.0.0/src/github.com/juju/govmomi/CONTRIBUTORS 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/CONTRIBUTORS 1970-01-01 00:00:00.000000000 +0000 @@ -1,14 +0,0 @@ -# People who can (and typically have) contributed to this repository. -# -# Please keep the list sorted. -# - -Bob Killen -Danny Lockard -Doug MacEachern -Gavin Gray -Gavrie Philipson -Pieter Noordhuis -Takaaki Furukawa -Yang Yang -Zee Yang diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/event/manager.go juju-core-2.0.2/src/github.com/juju/govmomi/event/manager.go --- juju-core-2.0.0/src/github.com/juju/govmomi/event/manager.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/event/manager.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,112 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package event - -import ( - "github.com/juju/govmomi/vim25" - "github.com/juju/govmomi/vim25/methods" - "github.com/juju/govmomi/vim25/types" - "golang.org/x/net/context" -) - -type Manager struct { - reference types.ManagedObjectReference - - c *vim25.Client -} - -func NewManager(c *vim25.Client) *Manager { - m := Manager{ - reference: *c.ServiceContent.EventManager, - - c: c, - } - - return &m -} - -func (m Manager) CreateCollectorForEvents(ctx context.Context, filter types.EventFilterSpec) (*types.ManagedObjectReference, error) { - req := types.CreateCollectorForEvents{ - This: m.reference, - Filter: filter, - } - - res, err := methods.CreateCollectorForEvents(ctx, m.c, &req) - if err != nil { - return nil, err - } - - return &res.Returnval, nil -} - -func (m Manager) LogUserEvent(ctx context.Context, entity types.ManagedObjectReference, msg string) error { - req := types.LogUserEvent{ - This: m.reference, - Entity: entity, - Msg: msg, - } - - _, err := methods.LogUserEvent(ctx, m.c, &req) - if err != nil { - return err - } - - return nil -} - -func (m Manager) PostEvent(ctx context.Context, eventToPost types.BaseEvent, taskInfo types.TaskInfo) error { - req := types.PostEvent{ - This: m.reference, - EventToPost: eventToPost, - TaskInfo: &taskInfo, - } - - _, err := methods.PostEvent(ctx, m.c, &req) - if err != nil { - return err - } - - return nil -} - -func (m Manager) QueryEvents(ctx context.Context, filter types.EventFilterSpec) ([]types.BaseEvent, error) { - req := types.QueryEvents{ - This: m.reference, - Filter: filter, - } - - res, err := methods.QueryEvents(ctx, m.c, &req) - if err != nil { - return nil, err - } - - return res.Returnval, nil -} - -func (m Manager) RetrieveArgumentDescription(ctx context.Context, eventTypeID string) ([]types.EventArgDesc, error) { - req := types.RetrieveArgumentDescription{ - This: m.reference, - EventTypeId: eventTypeID, - } - - res, err := methods.RetrieveArgumentDescription(ctx, m.c, &req) - if err != nil { - return nil, err - } - - return res.Returnval, nil -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/find/error.go juju-core-2.0.2/src/github.com/juju/govmomi/find/error.go --- juju-core-2.0.0/src/github.com/juju/govmomi/find/error.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/find/error.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,64 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package find - -import "fmt" - -type NotFoundError struct { - kind string - path string -} - -func (e *NotFoundError) Error() string { - return fmt.Sprintf("%s '%s' not found", e.kind, e.path) -} - -type MultipleFoundError struct { - kind string - path string -} - -func (e *MultipleFoundError) Error() string { - return fmt.Sprintf("path '%s' resolves to multiple %ss", e.path, e.kind) -} - -type DefaultNotFoundError struct { - kind string -} - -func (e *DefaultNotFoundError) Error() string { - return fmt.Sprintf("no default %s found", e.kind) -} - -type DefaultMultipleFoundError struct { - kind string -} - -func (e DefaultMultipleFoundError) Error() string { - return fmt.Sprintf("default %s resolves to multiple instances, please specify", e.kind) -} - -func toDefaultError(err error) error { - switch e := err.(type) { - case *NotFoundError: - return &DefaultNotFoundError{e.kind} - case *MultipleFoundError: - return &DefaultMultipleFoundError{e.kind} - default: - return err - } -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/find/finder.go juju-core-2.0.2/src/github.com/juju/govmomi/find/finder.go --- juju-core-2.0.0/src/github.com/juju/govmomi/find/finder.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/find/finder.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,487 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package find - -import ( - "errors" - "path" - - "github.com/juju/govmomi/list" - "github.com/juju/govmomi/object" - "github.com/juju/govmomi/property" - "github.com/juju/govmomi/vim25" - "github.com/juju/govmomi/vim25/mo" - "golang.org/x/net/context" -) - -type Finder struct { - client *vim25.Client - recurser list.Recurser - - dc *object.Datacenter - folders *object.DatacenterFolders -} - -func NewFinder(client *vim25.Client, all bool) *Finder { - f := &Finder{ - client: client, - recurser: list.Recurser{ - Collector: property.DefaultCollector(client), - All: all, - }, - } - - return f -} - -func (f *Finder) SetDatacenter(dc *object.Datacenter) *Finder { - f.dc = dc - f.folders = nil - return f -} - -type findRelativeFunc func(ctx context.Context) (object.Reference, error) - -func (f *Finder) find(ctx context.Context, fn findRelativeFunc, tl bool, path ...string) ([]list.Element, error) { - var out []list.Element - - for _, arg := range path { - es, err := f.list(ctx, fn, tl, arg) - if err != nil { - return nil, err - } - - out = append(out, es...) - } - - return out, nil -} - -func (f *Finder) list(ctx context.Context, fn findRelativeFunc, tl bool, arg string) ([]list.Element, error) { - root := list.Element{ - Path: "/", - Object: object.NewRootFolder(f.client), - } - - parts := list.ToParts(arg) - - if len(parts) > 0 { - switch parts[0] { - case "..": // Not supported; many edge case, little value - return nil, errors.New("cannot traverse up a tree") - case ".": // Relative to whatever - pivot, err := fn(ctx) - if err != nil { - return nil, err - } - - mes, err := mo.Ancestors(ctx, f.client, f.client.ServiceContent.PropertyCollector, pivot.Reference()) - if err != nil { - return nil, err - } - - for _, me := range mes { - // Skip root entity in building inventory path. - if me.Parent == nil { - continue - } - root.Path = path.Join(root.Path, me.Name) - } - - root.Object = pivot - parts = parts[1:] - } - } - - f.recurser.TraverseLeafs = tl - es, err := f.recurser.Recurse(ctx, root, parts) - if err != nil { - return nil, err - } - - return es, nil -} - -func (f *Finder) datacenter() (*object.Datacenter, error) { - if f.dc == nil { - return nil, errors.New("please specify a datacenter") - } - - return f.dc, nil -} - -func (f *Finder) dcFolders(ctx context.Context) (*object.DatacenterFolders, error) { - if f.folders != nil { - return f.folders, nil - } - - dc, err := f.datacenter() - if err != nil { - return nil, err - } - - folders, err := dc.Folders(ctx) - if err != nil { - return nil, err - } - - f.folders = folders - - return f.folders, nil -} - -func (f *Finder) dcReference(_ context.Context) (object.Reference, error) { - dc, err := f.datacenter() - if err != nil { - return nil, err - } - - return dc, nil -} - -func (f *Finder) vmFolder(ctx context.Context) (object.Reference, error) { - folders, err := f.dcFolders(ctx) - if err != nil { - return nil, err - } - - return folders.VmFolder, nil -} - -func (f *Finder) hostFolder(ctx context.Context) (object.Reference, error) { - folders, err := f.dcFolders(ctx) - if err != nil { - return nil, err - } - - return folders.HostFolder, nil -} - -func (f *Finder) datastoreFolder(ctx context.Context) (object.Reference, error) { - folders, err := f.dcFolders(ctx) - if err != nil { - return nil, err - } - - return folders.DatastoreFolder, nil -} - -func (f *Finder) networkFolder(ctx context.Context) (object.Reference, error) { - folders, err := f.dcFolders(ctx) - if err != nil { - return nil, err - } - - return folders.NetworkFolder, nil -} - -func (f *Finder) rootFolder(_ context.Context) (object.Reference, error) { - return object.NewRootFolder(f.client), nil -} - -func (f *Finder) ManagedObjectList(ctx context.Context, path ...string) ([]list.Element, error) { - fn := f.rootFolder - - if f.dc != nil { - fn = f.dcReference - } - - if len(path) == 0 { - path = []string{"."} - } - - return f.find(ctx, fn, true, path...) -} - -func (f *Finder) DatacenterList(ctx context.Context, path ...string) ([]*object.Datacenter, error) { - es, err := f.find(ctx, f.rootFolder, false, path...) - if err != nil { - return nil, err - } - - var dcs []*object.Datacenter - for _, e := range es { - ref := e.Object.Reference() - if ref.Type == "Datacenter" { - dcs = append(dcs, object.NewDatacenter(f.client, ref)) - } - } - - return dcs, nil -} - -func (f *Finder) Datacenter(ctx context.Context, path string) (*object.Datacenter, error) { - dcs, err := f.DatacenterList(ctx, path) - if err != nil { - return nil, err - } - - if len(dcs) == 0 { - return nil, &NotFoundError{"datacenter", path} - } - - if len(dcs) > 1 { - return nil, &MultipleFoundError{"datacenter", path} - } - - return dcs[0], nil -} - -func (f *Finder) DefaultDatacenter(ctx context.Context) (*object.Datacenter, error) { - dc, err := f.Datacenter(ctx, "*") - if err != nil { - return nil, toDefaultError(err) - } - - return dc, nil -} - -func (f *Finder) DatastoreList(ctx context.Context, path ...string) ([]*object.Datastore, error) { - es, err := f.find(ctx, f.datastoreFolder, false, path...) - if err != nil { - return nil, err - } - - var dss []*object.Datastore - for _, e := range es { - ref := e.Object.Reference() - if ref.Type == "Datastore" { - ds := object.NewDatastore(f.client, ref) - ds.InventoryPath = e.Path - - dss = append(dss, ds) - } - } - - return dss, nil -} - -func (f *Finder) Datastore(ctx context.Context, path string) (*object.Datastore, error) { - dss, err := f.DatastoreList(ctx, path) - if err != nil { - return nil, err - } - - if len(dss) == 0 { - return nil, &NotFoundError{"datastore", path} - } - - if len(dss) > 1 { - return nil, &MultipleFoundError{"datastore", path} - } - - return dss[0], nil -} - -func (f *Finder) DefaultDatastore(ctx context.Context) (*object.Datastore, error) { - ds, err := f.Datastore(ctx, "*") - if err != nil { - return nil, toDefaultError(err) - } - - return ds, nil -} - -func (f *Finder) HostSystemList(ctx context.Context, path ...string) ([]*object.HostSystem, error) { - es, err := f.find(ctx, f.hostFolder, false, path...) - if err != nil { - return nil, err - } - - var hss []*object.HostSystem - for _, e := range es { - var hs *object.HostSystem - - switch o := e.Object.(type) { - case mo.HostSystem: - hs = object.NewHostSystem(f.client, o.Reference()) - case mo.ComputeResource: - cr := object.NewComputeResource(f.client, o.Reference()) - hosts, err := cr.Hosts(ctx) - if err != nil { - return nil, err - } - hs = object.NewHostSystem(f.client, hosts[0]) - default: - continue - } - - hs.InventoryPath = e.Path - hss = append(hss, hs) - } - - return hss, nil -} - -func (f *Finder) HostSystem(ctx context.Context, path string) (*object.HostSystem, error) { - hss, err := f.HostSystemList(ctx, path) - if err != nil { - return nil, err - } - - if len(hss) == 0 { - return nil, &NotFoundError{"host", path} - } - - if len(hss) > 1 { - return nil, &MultipleFoundError{"host", path} - } - - return hss[0], nil -} - -func (f *Finder) DefaultHostSystem(ctx context.Context) (*object.HostSystem, error) { - hs, err := f.HostSystem(ctx, "*/*") - if err != nil { - return nil, toDefaultError(err) - } - - return hs, nil -} - -func (f *Finder) NetworkList(ctx context.Context, path ...string) ([]object.NetworkReference, error) { - es, err := f.find(ctx, f.networkFolder, false, path...) - if err != nil { - return nil, err - } - - var ns []object.NetworkReference - for _, e := range es { - ref := e.Object.Reference() - switch ref.Type { - case "Network": - r := object.NewNetwork(f.client, ref) - r.InventoryPath = e.Path - ns = append(ns, r) - case "DistributedVirtualPortgroup": - r := object.NewDistributedVirtualPortgroup(f.client, ref) - r.InventoryPath = e.Path - ns = append(ns, r) - } - } - - return ns, nil -} - -func (f *Finder) Network(ctx context.Context, path string) (object.NetworkReference, error) { - networks, err := f.NetworkList(ctx, path) - if err != nil { - return nil, err - } - - if len(networks) == 0 { - return nil, &NotFoundError{"network", path} - } - - if len(networks) > 1 { - return nil, &MultipleFoundError{"network", path} - } - - return networks[0], nil -} - -func (f *Finder) DefaultNetwork(ctx context.Context) (object.NetworkReference, error) { - network, err := f.Network(ctx, "*") - if err != nil { - return nil, toDefaultError(err) - } - - return network, nil -} - -func (f *Finder) ResourcePoolList(ctx context.Context, path ...string) ([]*object.ResourcePool, error) { - es, err := f.find(ctx, f.hostFolder, true, path...) - if err != nil { - return nil, err - } - - var rps []*object.ResourcePool - for _, e := range es { - var rp *object.ResourcePool - - switch o := e.Object.(type) { - case mo.ResourcePool: - rp = object.NewResourcePool(f.client, o.Reference()) - rp.InventoryPath = e.Path - rps = append(rps, rp) - } - } - - return rps, nil -} - -func (f *Finder) ResourcePool(ctx context.Context, path string) (*object.ResourcePool, error) { - rps, err := f.ResourcePoolList(ctx, path) - if err != nil { - return nil, err - } - - if len(rps) == 0 { - return nil, &NotFoundError{"resource pool", path} - } - - if len(rps) > 1 { - return nil, &MultipleFoundError{"resource pool", path} - } - - return rps[0], nil -} - -func (f *Finder) DefaultResourcePool(ctx context.Context) (*object.ResourcePool, error) { - rp, err := f.ResourcePool(ctx, "*/Resources") - if err != nil { - return nil, toDefaultError(err) - } - - return rp, nil -} - -func (f *Finder) VirtualMachineList(ctx context.Context, path ...string) ([]*object.VirtualMachine, error) { - es, err := f.find(ctx, f.vmFolder, false, path...) - if err != nil { - return nil, err - } - - var vms []*object.VirtualMachine - for _, e := range es { - switch o := e.Object.(type) { - case mo.VirtualMachine: - vm := object.NewVirtualMachine(f.client, o.Reference()) - vm.InventoryPath = e.Path - vms = append(vms, vm) - } - } - - return vms, nil -} - -func (f *Finder) VirtualMachine(ctx context.Context, path string) (*object.VirtualMachine, error) { - vms, err := f.VirtualMachineList(ctx, path) - if err != nil { - return nil, err - } - - if len(vms) == 0 { - return nil, &NotFoundError{"vm", path} - } - - if len(vms) > 1 { - return nil, &MultipleFoundError{"vm", path} - } - - return vms[0], nil -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/gen/Gemfile juju-core-2.0.2/src/github.com/juju/govmomi/gen/Gemfile --- juju-core-2.0.0/src/github.com/juju/govmomi/gen/Gemfile 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/gen/Gemfile 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -source "https://rubygems.org" - -gem "nokogiri" diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/gen/Gemfile.lock juju-core-2.0.2/src/github.com/juju/govmomi/gen/Gemfile.lock --- juju-core-2.0.0/src/github.com/juju/govmomi/gen/Gemfile.lock 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/gen/Gemfile.lock 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -GEM - remote: https://rubygems.org/ - specs: - mini_portile (0.6.0) - nokogiri (1.6.3.1) - mini_portile (= 0.6.0) - -PLATFORMS - ruby - -DEPENDENCIES - nokogiri diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/gen/gen_from_vmodl.rb juju-core-2.0.2/src/github.com/juju/govmomi/gen/gen_from_vmodl.rb --- juju-core-2.0.0/src/github.com/juju/govmomi/gen/gen_from_vmodl.rb 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/gen/gen_from_vmodl.rb 1970-01-01 00:00:00.000000000 +0000 @@ -1,216 +0,0 @@ -# Copyright (c) 2014 VMware, Inc. All Rights Reserved. -# -# 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, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -$:.unshift(File.expand_path(File.dirname(__FILE__))) - -require "vim_wsdl" - -require "test/unit" - -PATH = File.expand_path("../rbvmomi", __FILE__) - -def read(file) - File.open(File.join(PATH, file)) -end - -class Prop - def initialize(vmodl, data) - @vmodl = vmodl - @data = data - end - - def slice? - @data["is-array"] - end - - def optional? - @data["is-optional"] - end - - def name - @data["name"] - end - - def var_field - n = name - n[0].capitalize + n[1..-1] - end - - def var_type_prefix(base=false) - if slice? - "[]" - else - if optional? && !base - "*" - else - "" - end - end - end - - def var_type - type = @data["wsdl_type"] - if @vmodl.managed_hash.has_key?(type) - type = "ManagedObjectReference" - end - - # Fix up type from vmodl - case type - when "TypeName", "MethodName" - type = "xsd:string" - when "ManagedObject" - type = "ManagedObjectReference" - when "xsd:anyType" - type = "AnyType" - end - - if type =~ /^xsd:(.*)$/ - type = $1 - case type - when "string" - when "int" - when "boolean" - type ="bool" - when "long" - type ="int64" - when "dateTime" - type ="time.Time" - prefix += "*" if !slice? && optional? - when "byte" - when "double" - type ="float64" - when "float" - type ="float32" - when "short" - type ="int16" - when "base64Binary" - type ="[]byte" - else - raise "unknown type: %s" % type - end - else - if Peek.base?(type) - type = "Base" + type - base = true - end - type = "types." + type - end - - var_type_prefix(base) + type - end - - def var_tag - "mo:\"%s\"" % name - end - - def dump(io) - io.print "%s %s `%s`\n" % [var_field, var_type, var_tag] - end -end - -class Managed - def initialize(vmodl, name, data) - @vmodl = vmodl - @name = name - @data = data - end - - def name - @name - end - - def props - @data["props"].map do |p| - Prop.new(@vmodl, p) - end - end - - def dump(io) - include_ref_getter = false - - io.print "type %s struct {\n" % name - - case @data["wsdl_base"] - when nil, "ManagedObject", "View" - include_ref_getter = true - io.print "Self types.ManagedObjectReference\n\n" - else - io.print "%s\n\n" % @data["wsdl_base"] - end - - props.each do |p| - p.dump(io) - end - io.print "}\n\n" - - if include_ref_getter - io.print "func (m %s) Reference() types.ManagedObjectReference {\n" % [name] - io.print "return m.Self\n" - io.print "}\n\n" - end - end - - def dump_init(io) - io.print "func init() {\n" - io.print "t[\"%s\"] = reflect.TypeOf((*%s)(nil)).Elem()\n" % [name, name] - io.print "}\n\n" - end -end - -class Vmodl - def initialize(data) - @data = Marshal.load(data) - end - - def managed_hash - @managed_hash ||= begin - h = {} - managed.each do |m| - h[m.name] = m - end - h - end - end - - def managed - @data.map do |k,v| - next if !v.is_a?(Hash) - next if v["kind"] != "managed" - next if k =~ /^pbm/i - - Managed.new(self, k, v) - end.compact - end -end - -if !File.directory?(ARGV.first) - raise "first argument not a directory" -end - -wsdl = WSDL.new(WSDL.read "vim.wsdl") -wsdl.validate_assumptions! -wsdl.peek() - -File.open(File.join(ARGV.first, "mo/mo.go"), "w") do |io| - io.print WSDL.header("mo") - - vmodl = Vmodl.new(read "vmodl.db") - - vmodl. - managed. - sort_by { |m| m.name }. - each { |m| m.dump(io); m.dump_init(io); } -end - -exit(0) diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/gen/gen_from_wsdl.rb juju-core-2.0.2/src/github.com/juju/govmomi/gen/gen_from_wsdl.rb --- juju-core-2.0.0/src/github.com/juju/govmomi/gen/gen_from_wsdl.rb 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/gen/gen_from_wsdl.rb 1970-01-01 00:00:00.000000000 +0000 @@ -1,70 +0,0 @@ -# Copyright (c) 2014 VMware, Inc. All Rights Reserved. -# -# 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, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -$:.unshift(File.expand_path(File.dirname(__FILE__))) - -require "vim_wsdl" - -if !File.directory?(ARGV.first) - raise "first argument not a directory" -end - -wsdl = WSDL.new(WSDL.read "vim.wsdl") -wsdl.validate_assumptions! -wsdl.peek() - -ifs = Peek.types.keys.select { |name| Peek.base?(name) }.size() -puts "%d classes, %d interfaces" % [Peek.types.size(), ifs] - -File.open(File.join(ARGV.first, "types/enum.go"), "w") do |io| - io.print WSDL.header("types") - - wsdl. - types. - sort_by { |x| x.name }. - uniq { |x| x.name }. - select { |x| x.name[0] == x.name[0].upcase }. # Only capitalized methods for now... - select { |t| t.is_enum? }. - each { |e| e.dump(io); e.dump_init(io) } -end - -File.open(File.join(ARGV.first, "types/types.go"), "w") do |io| - io.print WSDL.header("types") - - wsdl. - types. - sort_by { |x| x.name }. - uniq { |x| x.name }. - select { |x| x.name[0] == x.name[0].upcase }. # Only capitalized methods for now... - select { |t| !t.is_enum? }. - each { |e| e.dump(io); e.dump_init(io) } -end - -File.open(File.join(ARGV.first, "types/if.go"), "w") do |io| - io.print WSDL.header("types") - - Peek.dump_interfaces(io) -end - -File.open(File.join(ARGV.first, "methods/methods.go"), "w") do |io| - io.print WSDL.header("methods") - - wsdl. - operations. - sort_by { |x| x.name }. - select { |x| x.name[0] == x.name[0].upcase }. # Only capitalized methods for now... - each { |e| e.dump(io) } -end - -exit(0) diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/gen/gen.sh juju-core-2.0.2/src/github.com/juju/govmomi/gen/gen.sh --- juju-core-2.0.0/src/github.com/juju/govmomi/gen/gen.sh 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/gen/gen.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,34 +0,0 @@ -#!/bin/bash - -# Copyright (c) 2014 VMware, Inc. All Rights Reserved. -# -# 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, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set -e - -dst=../vim25 - -pkgs=$(echo $dst/{types,methods,mo}) -mkdir -p $pkgs - -bundle exec ruby gen_from_wsdl.rb $dst -bundle exec ruby gen_from_vmodl.rb $dst - -for p in $pkgs -do - echo $p - cd $p - goimports -w *.go - go install - cd - -done diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/gen/vim_wsdl.rb juju-core-2.0.2/src/github.com/juju/govmomi/gen/vim_wsdl.rb --- juju-core-2.0.0/src/github.com/juju/govmomi/gen/vim_wsdl.rb 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/gen/vim_wsdl.rb 1970-01-01 00:00:00.000000000 +0000 @@ -1,759 +0,0 @@ -# Copyright (c) 2014 VMware, Inc. All Rights Reserved. -# -# 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, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "nokogiri" -require "test/unit" - -class Peek - class Type - attr_accessor :parent, :children, :klass - - def initialize(name) - @name = name - @children = [] - end - - def base? - return !children.empty? - end - end - - @@types = {} - @@refs = {} - @@enums = {} - - def self.types - return @@types - end - - def self.refs - return @@refs - end - - def self.enums - return @@enums - end - - def self.ref(type) - refs[type] = true - end - - def self.enum(type) - enums[type] = true - end - - def self.enum?(type) - enums[type] - end - - def self.register(name) - raise unless name - types[name] ||= Type.new(name) - end - - def self.base?(name) - return unless c = types[name] - c.base? - end - - def self.dump_interfaces(io) - types.keys.sort.each do |name| - next unless base?(name) - - types[name].klass.dump_interface(io, name) - end - end -end - -class EnumValue - def initialize(type, value) - @type = type - @value = value - end - - def type_name - @type.name - end - - def var_name - n = @type.name - v = var_value - if v == "" - n += "Null" - else - n += (v[0].capitalize + v[1..-1]) - end - - return n - end - - def var_value - @value - end - - def dump(io) - io.print "%s = %s(\"%s\")\n" % [var_name, type_name, var_value] - end -end - -class Simple - include Test::Unit::Assertions - - attr_accessor :name, :type - - def initialize(node) - @node = node - end - - def name - @name || @node["name"] - end - - def type - @type || @node["type"] - end - - def is_enum? - false - end - - def dump_init(io) - # noop - end - - def var_name - n = self.name - n = n[1..-1] if n[0] == "_" # Strip leading _ - n = n[0].capitalize + n[1..-1] # Capitalize - return n - end - - def vim_type? - ns, _ = self.type.split(":", 2) - ns == "vim25" - end - - def vim_type(t = self.type) - ns, t = t.split(":", 2) - raise if ns != "vim25" - t - end - - def base_type? - vim_type? && Peek.base?(vim_type) - end - - def enum_type? - vim_type? && Peek.enum?(vim_type) - end - - def any_type? - self.type == "xsd:anyType" - end - - def var_type - t = self.type - prefix = "" - - prefix += "[]" if slice? - - if t =~ /^xsd:(.*)$/ - t = $1 - case t - when "string" - when "int" - when "boolean" - t = "bool" - if !slice? && optional? - prefix += "*" - self.need_omitempty = false - end - when "long" - t = "int64" - when "dateTime" - t = "time.Time" - if !slice? && optional? - prefix += "*" - self.need_omitempty = false - end - when "anyType" - t = "AnyType" - when "byte" - when "double" - t = "float64" - when "float" - t = "float32" - when "short" - t = "int16" - when "base64Binary" - t = "[]byte" - else - raise "unknown type: %s" % t - end - else - t = vim_type - if base_type? - prefix += "Base" - else - prefix += "*" if !slice? && !enum_type? && optional? - end - end - - prefix + t - end - - def slice? - test_attr("maxOccurs", "unbounded") - end - - def optional? - test_attr("minOccurs", "0") - end - - def need_omitempty=(v) - @need_omitempty = v - end - - def need_omitempty? - var_type # HACK: trigger setting need_omitempty if necessary - if @need_omitempty.nil? - @need_omitempty = optional? - else - @need_omitempty - end - end - - def need_typeattr? - base_type? || any_type? - end - - protected - - def test_attr(attr, expected) - actual = @node.attr(attr) - if actual != nil - case actual - when expected - true - else - raise "%s=%s" % [value, type.attr(value)] - end - else - false - end - end -end - -class Element < Simple - def initialize(node) - super(node) - end - - def has_type? - !@node["type"].nil? - end - - def child - cs = @node.element_children - assert_equal 1, cs.length - assert_equal "complexType", cs.first.name - - t = ComplexType.new(cs.first) - t.name = self.name - t - end - - def dump(io) - if has_type? - io.print "type %s %s\n\n" % [name, var_type] - else - child.dump(io) - end - end - - def dump_init(io) - if has_type? - io.print "func init() {\n" - io.print "t[\"%s\"] = reflect.TypeOf((*%s)(nil)).Elem()\n" % [name, name] - io.print "}\n\n" - end - end - - def dump_field(io) - tag = name - tag += ",omitempty" if need_omitempty? - tag += ",typeattr" if need_typeattr? - io.print "%s %s `xml:\"%s\"`\n" % [var_name, var_type, tag] - end - - def peek(type=nil) - if has_type? - return if self.type =~ /^xsd:/ - - Peek.ref(vim_type) - else - child.peek() - end - end -end - -class Attribute < Simple - def dump_field(io) - tag = name - tag += ",omitempty" if need_omitempty? - tag += ",attr" - io.print "%s %s `xml:\"%s\"`\n" % [var_name, var_type, tag] - end -end - -class SimpleType < Simple - def is_enum? - true - end - - def dump(io) - enums = @node.xpath(".//xsd:enumeration").map do |n| - EnumValue.new(self, n["value"]) - end - - io.print "type %s string\n\n" % name - io.print "const (\n" - enums.each { |e| e.dump(io) } - io.print ")\n\n" - end - - def dump_init(io) - io.print "func init() {\n" - io.print "t[\"%s\"] = reflect.TypeOf((*%s)(nil)).Elem()\n" % [name, name] - io.print "}\n\n" - end - - def peek - Peek.enum(name) - end -end - -class ComplexType < Simple - class SimpleContent < Simple - def dump(io) - attr = Attribute.new(@node.at_xpath(".//xsd:attribute")) - attr.dump_field(io) - - # HACK DELUXE(PN) - extension = @node.at_xpath(".//xsd:extension") - type = extension["base"].split(":", 2)[1] - io.print "Value %s `xml:\",chardata\"`\n" % type - end - - def peek - end - end - - class ComplexContent < Simple - def base - extension = @node.at_xpath(".//xsd:extension") - assert_not_nil extension - - base = extension["base"] - assert_not_nil base - - vim_type(base) - end - - def dump(io) - Sequence.new(@node).dump(io, base) - end - - def dump_interface(io, name) - Sequence.new(@node).dump_interface(io, name) - end - - def peek - Sequence.new(@node).peek(base) - end - end - - class Sequence < Simple - def sequence - sequence = @node.at_xpath(".//xsd:sequence") - if sequence != nil - sequence.element_children.map do |n| - Element.new(n) - end - else - nil - end - end - - def dump(io, base = nil) - return unless elements = sequence - - io.print "%s\n\n" % base - - elements.each do |e| - e.dump_field(io) - end - end - - def dump_interface(io, name) - method = "Get%s() *%s" % [name, name] - io.print "func (b *%s) %s { return b }\n" % [name, method] - io.print "type Base%s interface {\n" % name - io.print "%s\n" % method - io.print "}\n\n" - io.print "func init() {\n" - io.print "t[\"Base%s\"] = reflect.TypeOf((*%s)(nil)).Elem()\n" % [name, name] - io.print "}\n\n" - end - - def peek(base = nil) - return unless elements = sequence - name = @node.attr("name") - return unless name - - elements.each do |e| - e.peek(name) - end - - c = Peek.register(name) - if base - c.parent = base - Peek.register(c.parent).children << name - end - end - end - - def klass - @klass ||= begin - cs = @node.element_children - if !cs.empty? - assert_equal 1, cs.length - - case cs.first.name - when "simpleContent" - SimpleContent.new(@node) - when "complexContent" - ComplexContent.new(@node) - when "sequence" - Sequence.new(@node) - else - raise "don't know what to do for element: %s..." % cs.first.name - end - end - end - end - - def dump_init(io) - io.print "func init() {\n" - io.print "t[\"%s\"] = reflect.TypeOf((*%s)(nil)).Elem()\n" % [name, name] - io.print "}\n\n" - end - - def dump(io) - io.print "type %s struct {\n" % name - klass.dump(io) if klass - io.print "}\n\n" - end - - def peek - Peek.register(name).klass = klass - klass.peek if klass - end -end - -class Schema - include Test::Unit::Assertions - - def initialize(xml, parent = nil) - @xml = Nokogiri::XML.parse(xml) - end - - def targetNamespace - @xml.root["targetNamespace"] - end - - # We have some assumptions about structure, make sure they hold. - def validate_assumptions! - # Every enumeration is part of a restriction - @xml.xpath(".//xsd:enumeration").each do |n| - assert_equal "restriction", n.parent.name - end - - # See type == enum - @xml.xpath(".//xsd:restriction").each do |n| - # Every restriction has type xsd:string (it's an enum) - assert_equal "xsd:string", n["base"] - - # Every restriction is part of a simpleType - assert_equal "simpleType", n.parent.name - - # Every restriction is alone - assert_equal 1, n.parent.element_children.size - end - - # See type == complex_content - @xml.xpath(".//xsd:complexContent").each do |n| - # complexContent is child of complexType - assert_equal "complexType", n.parent.name - - end - - # See type == complex_type - @xml.xpath(".//xsd:complexType").each do |n| - cc = n.element_children - - # OK to have an empty complexType - next if cc.size == 0 - - # Require 1 element otherwise - assert_equal 1, cc.size - - case cc.first.name - when "complexContent" - # complexContent has 1 "extension" element - cc = cc.first.element_children - assert_equal 1, cc.size - assert_equal "extension", cc.first.name - - # extension has 1 "sequence" element - ec = cc.first.element_children - assert_equal 1, ec.size - assert_equal "sequence", ec.first.name - - # sequence has N "element" elements - sc = ec.first.element_children - assert sc.all? { |e| e.name == "element" } - when "simpleContent" - # simpleContent has 1 "extension" element - cc = cc.first.element_children - assert_equal 1, cc.size - assert_equal "extension", cc.first.name - - # extension has 1 "attribute" element - ec = cc.first.element_children - assert_equal 1, ec.size - assert_equal "attribute", ec.first.name - when "sequence" - # sequence has N "element" elements - sc = cc.first.element_children - assert sc.all? { |e| e.name == "element" } - else - raise "unknown element: %s" % cc.first.name - end - end - - includes.each do |i| - i.validate_assumptions! - end - end - - def types - return to_enum(:types) unless block_given? - - includes.each do |i| - i.types do |t| - yield t - end - end - - @xml.root.children.each do |n| - case n.class.to_s - when "Nokogiri::XML::Text" - next - when "Nokogiri::XML::Element" - case n.name - when "include", "import" - next - when "element" - yield Element.new(n) - when "simpleType" - yield SimpleType.new(n) - when "complexType" - yield ComplexType.new(n) - else - raise "unknown child: %s" % n.name - end - else - raise "unknown type: %s" % n.class - end - end - end - - def includes - @includes ||= @xml.root.xpath(".//xmlns:include").map do |n| - Schema.new(WSDL.read n["schemaLocation"]) - end - end -end - - -class Operation - include Test::Unit::Assertions - - def initialize(wsdl, operation_node) - @wsdl = wsdl - @operation_node = operation_node - end - - def name - @operation_node["name"] - end - - def remove_ns(x) - ns, x = x.split(":", 2) - assert_equal "vim25", ns - x - end - - def find_type_for(type) - type = remove_ns(type) - - message = @wsdl.message(type) - assert_not_nil message - - part = message.at_xpath("./xmlns:part") - assert_not_nil message - - remove_ns(part["element"]) - end - - def input - type = @operation_node.at_xpath("./xmlns:input").attr("message") - find_type_for(type) - end - - def go_input - "types." + input - end - - def output - type = @operation_node.at_xpath("./xmlns:output").attr("message") - find_type_for(type) - end - - def go_output - "types." + output - end - - def dump(io) - io.print < /dev/null; then - echo "gox is not installed..." - exit 1 -fi - -git_version=$(git describe --tags) -if git_status=$(git status --porcelain 2>/dev/null) && [ -z "${git_status}" ]; then - git_version="${git_version}-dirty" -fi - -ldflags="-X github.com/vmware/govmomi/govc/version.gitVersion ${git_version}" -os="darwin linux windows freebsd" -arch="386 amd64" - -gox \ - -parallel=1 \ - -ldflags="${ldflags}" \ - -os="${os}" \ - -arch="${arch}" \ - github.com/vmware/govmomi/govc diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/govc/CHANGELOG.md juju-core-2.0.2/src/github.com/juju/govmomi/govc/CHANGELOG.md --- juju-core-2.0.0/src/github.com/juju/govmomi/govc/CHANGELOG.md 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/govc/CHANGELOG.md 1970-01-01 00:00:00.000000000 +0000 @@ -1,9 +0,0 @@ -# changelog - -### (unreleased) - -* Add `host.autostart` commands to manage VM autostart. - -### 0.1.0 (2015-03-17) - -Prior to this version the changes to govc's command set were not documented. diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/govc/cli/command.go juju-core-2.0.2/src/github.com/juju/govmomi/govc/cli/command.go --- juju-core-2.0.0/src/github.com/juju/govmomi/govc/cli/command.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/govc/cli/command.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,170 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package cli - -import ( - "flag" - "fmt" - "io/ioutil" - "os" - "reflect" - "sort" - "text/tabwriter" -) - -type HasFlags interface { - // Register may be called more than once and should be idempotent. - Register(f *flag.FlagSet) - - // Process may be called more than once and should be idempotent. - Process() error -} - -type Command interface { - HasFlags - - Run(f *flag.FlagSet) error -} - -var hasFlagsType = reflect.TypeOf((*HasFlags)(nil)).Elem() - -func RegisterCommand(h HasFlags, f *flag.FlagSet) { - visited := make(map[interface{}]struct{}) - Walk(h, hasFlagsType, func(v interface{}) error { - if _, ok := visited[v]; ok { - return nil - } - visited[v] = struct{}{} - v.(HasFlags).Register(f) - return nil - }) -} - -func ProcessCommand(h HasFlags) error { - visited := make(map[interface{}]struct{}) - err := Walk(h, hasFlagsType, func(v interface{}) error { - if _, ok := visited[v]; ok { - return nil - } - visited[v] = struct{}{} - err := v.(HasFlags).Process() - return err - }) - return err -} - -func generalHelp() { - fmt.Fprintf(os.Stderr, "Usage of %s:\n", os.Args[0]) - - cmds := []string{} - for name := range commands { - cmds = append(cmds, name) - } - - sort.Strings(cmds) - - for _, name := range cmds { - fmt.Fprintf(os.Stderr, " %s\n", name) - } -} - -func commandHelp(name string, cmd Command, f *flag.FlagSet) { - type HasUsage interface { - Usage() string - } - - fmt.Fprintf(os.Stderr, "Usage: %s %s [OPTIONS]", os.Args[0], name) - if u, ok := cmd.(HasUsage); ok { - fmt.Fprintf(os.Stderr, " %s", u.Usage()) - } - fmt.Fprintf(os.Stderr, "\n") - - type HasDescription interface { - Description() string - } - - if u, ok := cmd.(HasDescription); ok { - fmt.Fprintf(os.Stderr, "%s\n", u.Description()) - } - - n := 0 - f.VisitAll(func(_ *flag.Flag) { - n += 1 - }) - - if n > 0 { - fmt.Fprintf(os.Stderr, "\nOptions:\n") - tw := tabwriter.NewWriter(os.Stderr, 2, 0, 2, ' ', 0) - f.VisitAll(func(f *flag.Flag) { - fmt.Fprintf(tw, "\t-%s=%s\t%s\n", f.Name, f.DefValue, f.Usage) - }) - tw.Flush() - } -} - -func Run(args []string) int { - if len(args) == 0 { - generalHelp() - return 1 - } - - // Look up real command name in aliases table. - name, ok := aliases[args[0]] - if !ok { - name = args[0] - } - - cmd, ok := commands[name] - if !ok { - generalHelp() - return 1 - } - - f := flag.NewFlagSet("", flag.ContinueOnError) - f.SetOutput(ioutil.Discard) - - RegisterCommand(cmd, f) - - if err := f.Parse(args[1:]); err != nil { - if err == flag.ErrHelp { - commandHelp(args[0], cmd, f) - } else { - fmt.Fprintf(os.Stderr, "Error: %s\n", err) - } - return 1 - } - - if err := ProcessCommand(cmd); err != nil { - if err == flag.ErrHelp { - commandHelp(args[0], cmd, f) - } else { - fmt.Fprintf(os.Stderr, "Error: %s\n", err) - } - return 1 - } - - if err := cmd.Run(f); err != nil { - if err == flag.ErrHelp { - commandHelp(args[0], cmd, f) - } else { - fmt.Fprintf(os.Stderr, "Error: %s\n", err) - } - return 1 - } - - return 0 -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/govc/cli/register.go juju-core-2.0.2/src/github.com/juju/govmomi/govc/cli/register.go --- juju-core-2.0.0/src/github.com/juju/govmomi/govc/cli/register.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/govc/cli/register.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,29 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package cli - -var commands = map[string]Command{} - -var aliases = map[string]string{} - -func Register(name string, c Command) { - commands[name] = c -} - -func Alias(name string, alias string) { - aliases[alias] = name -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/govc/cli/walk.go juju-core-2.0.2/src/github.com/juju/govmomi/govc/cli/walk.go --- juju-core-2.0.0/src/github.com/juju/govmomi/govc/cli/walk.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/govc/cli/walk.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,108 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package cli - -import ( - "fmt" - "reflect" -) - -type WalkFn func(c interface{}) error - -// Walk recursively walks struct types that implement the specified interface. -// Fields that implement the specified interface are expected to be pointer -// values. This allows the function to cache pointer values on a per-type -// basis. If, during a recursive walk, the same type is encountered twice, the -// function creates a new value of that type the first time, and reuses that -// same value the second time. -// -// This function is used to make sure that a hierarchy of flags where multiple -// structs refer to the `Client` flag will not end up with more than one -// instance of the actual client. Rather, every struct referring to the -// `Client` flag will have a pointer to the same underlying `Client` struct. -// -func Walk(c interface{}, ifaceType reflect.Type, fn WalkFn) error { - var walker WalkFn - - visited := make(map[reflect.Type]reflect.Value) - walker = func(c interface{}) error { - v := reflect.ValueOf(c) - if v.Kind() == reflect.Interface { - v = v.Elem() - } - if v.Kind() == reflect.Ptr { - v = v.Elem() - } - - t := v.Type() - - // Call user specified function. - err := fn(c) - if err != nil { - return err - } - - for i := 0; i < t.NumField(); i++ { - ff := t.Field(i) - ft := ff.Type - fv := v.Field(i) - - // Check that a pointer to this field's type doesn't implement the - // specified interface. If it does, this field references the type as - // value. This is not allowed because it prohibits a value from being - // shared among multiple structs that reference it. - // - // For example: if a struct has two fields of the same type, they must - // both point to the same value after this routine has executed. If these - // fields are not a pointer type, the value cannot be shared. - // - if reflect.PtrTo(ft).Implements(ifaceType) { - panic(fmt.Sprintf(`field "%s" in struct "%s" must be a pointer`, ff.Name, v.Type())) - } - - // Type must implement specified interface. - if !ft.Implements(ifaceType) { - continue - } - - // Type must be a pointer. - if ft.Kind() != reflect.Ptr { - panic(fmt.Sprintf(`field "%s" in struct "%s" must be a pointer`, ff.Name, v.Type())) - } - - // Have not seen this type before, create a value. - if _, ok := visited[ft]; !ok { - visited[ft] = reflect.New(ft.Elem()) - } - - // Make sure current field is set. - if fv.IsNil() { - fv.Set(visited[ft]) - } - - // Recurse. - err := walker(fv.Interface()) - if err != nil { - return err - } - } - - return nil - } - - return walker(c) -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/govc/cli/walk_test.go juju-core-2.0.2/src/github.com/juju/govmomi/govc/cli/walk_test.go --- juju-core-2.0.0/src/github.com/juju/govmomi/govc/cli/walk_test.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/govc/cli/walk_test.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,144 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package cli - -import ( - "reflect" - "testing" -) - -type wC struct { - C string -} - -func (w *wC) Set() { - w.C = "C" -} - -type wB struct { - C *wC - - B string -} - -func (w *wB) Set() { - w.B = "B" -} - -type wA struct { - B *wB - C *wC - - A string -} - -func (w *wA) Set() { - w.A = "A" -} - -type wSet interface { - Set() -} - -func TestWalk(t *testing.T) { - var w wA - var wSetType = reflect.TypeOf((*wSet)(nil)).Elem() - - Walk(&w, wSetType, func(v interface{}) error { - v.(wSet).Set() - return nil - }) - - if w.A != "A" { - t.Errorf("x.A not set") - } - - if w.B.B != "B" { - t.Errorf("x.B not set") - } - - if w.C.C != "C" { - t.Errorf("x.C not set") - } - - if w.C != w.B.C { - t.Errorf("Expected Walk to remember value for type") - } -} - -type test2A struct { - V int -} - -func (t *test2A) Set() { - t.V++ -} - -type test2B struct { - t *testing.T - - F1 *test2A - F2 *test2A - F3 *test2A - F4 *test2A -} - -func (t *test2B) Set() { - // Assert that this function gets called before the walker recurses. - if t.F1 != nil || t.F3 != nil { - t.t.Errorf("Expected user function to be called before recursing") - } -} - -type test2Set interface { - Set() -} - -func TestWalkDoesntOverwrite(t *testing.T) { - var t2a test2A - var t2b test2B - var testSetType = reflect.TypeOf((*test2Set)(nil)).Elem() - - // Set elements 2 and 4 - t2b.t = t - t2b.F2 = &t2a - t2b.F4 = &t2a - - Walk(&t2b, testSetType, func(v interface{}) error { - v.(test2Set).Set() - return nil - }) - - // Set fields should remain untouched - if t2b.F2 != &t2a { - t.Errorf("Expected t2b.F2 to be left intact") - } - - if t2b.F4 != &t2a { - t.Errorf("Expected t2b.F4 to be left intact") - } - - // Unset fields should be filled in with the same value - if t2b.F1 != t2b.F3 { - t.Errorf("Expected t2b.F1 to be equal to t2b.F3") - } - - // All fields should be traversed. - if t2b.F1.V != 2 || t2b.F2.V != 2 { - t.Errorf("Expected all fields to be traversed") - } -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/govc/datacenter/create.go juju-core-2.0.2/src/github.com/juju/govmomi/govc/datacenter/create.go --- juju-core-2.0.0/src/github.com/juju/govmomi/govc/datacenter/create.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/govc/datacenter/create.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,73 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package datacenter - -import ( - "flag" - - "github.com/juju/govmomi/find" - "github.com/juju/govmomi/govc/cli" - "github.com/juju/govmomi/govc/flags" - "github.com/juju/govmomi/object" - "golang.org/x/net/context" -) - -type create struct { - *flags.ClientFlag -} - -func init() { - cli.Register("datacenter.create", &create{}) -} - -func (cmd *create) Register(f *flag.FlagSet) {} - -func (cmd *create) Usage() string { - return "[DATACENTER NAME]..." -} - -func (cmd *create) Process() error { return nil } - -func (cmd *create) Run(f *flag.FlagSet) error { - datacenters := f.Args() - if len(datacenters) < 1 { - return flag.ErrHelp - } - - client, err := cmd.ClientFlag.Client() - if err != nil { - return err - } - - finder := find.NewFinder(client, false) - rootFolder := object.NewRootFolder(client) - for _, datacenterToCreate := range datacenters { - foundDatacenters, err := finder.DatacenterList(context.TODO(), datacenterToCreate) - if err != nil { - return err - } - - if foundDatacenters == nil { - _, err = rootFolder.CreateDatacenter(context.TODO(), datacenterToCreate) - if err != nil { - return err - } - } - } - - return nil -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/govc/datacenter/destroy.go juju-core-2.0.2/src/github.com/juju/govmomi/govc/datacenter/destroy.go --- juju-core-2.0.0/src/github.com/juju/govmomi/govc/datacenter/destroy.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/govc/datacenter/destroy.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,73 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package datacenter - -import ( - "flag" - - "github.com/juju/govmomi/find" - "github.com/juju/govmomi/govc/cli" - "github.com/juju/govmomi/govc/flags" - "golang.org/x/net/context" -) - -type destroy struct { - *flags.ClientFlag -} - -func init() { - cli.Register("datacenter.destroy", &destroy{}) -} - -func (cmd *destroy) Register(f *flag.FlagSet) {} - -func (cmd *destroy) Usage() string { - return "[DATACENTER NAME]..." -} - -func (cmd *destroy) Process() error { return nil } - -func (cmd *destroy) Run(f *flag.FlagSet) error { - if len(f.Args()) < 1 { - return flag.ErrHelp - } - datacentersToDestroy := f.Args() - - client, err := cmd.ClientFlag.Client() - if err != nil { - return err - } - - finder := find.NewFinder(client, false) - for _, datacenterToDestroy := range datacentersToDestroy { - foundDatacenters, err := finder.DatacenterList(context.TODO(), datacenterToDestroy) - if err != nil { - return err - } - for _, foundDatacenter := range foundDatacenters { - task, err := foundDatacenter.Destroy(context.TODO()) - if err != nil { - return err - } - - if err := task.Wait(context.TODO()); err != nil { - return err - } - } - } - return nil -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/govc/datastore/cp.go juju-core-2.0.2/src/github.com/juju/govmomi/govc/datastore/cp.go --- juju-core-2.0.0/src/github.com/juju/govmomi/govc/datastore/cp.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/govc/datastore/cp.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,85 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package datastore - -import ( - "errors" - "flag" - - "github.com/juju/govmomi/govc/cli" - "github.com/juju/govmomi/govc/flags" - "github.com/juju/govmomi/object" - "golang.org/x/net/context" -) - -type cp struct { - *flags.OutputFlag - *flags.DatastoreFlag - - force bool -} - -func init() { - cli.Register("datastore.cp", &cp{}) -} - -func (cmd *cp) Register(f *flag.FlagSet) { - f.BoolVar(&cmd.force, "f", false, "If true, overwrite any identically named file at the destination") -} - -func (cmd *cp) Process() error { return nil } - -func (cmd *cp) Usage() string { - return "SRC DST" -} - -func (cmd *cp) Run(f *flag.FlagSet) error { - args := f.Args() - if len(args) != 2 { - return errors.New("SRC and DST arguments are required") - } - - c, err := cmd.Client() - if err != nil { - return err - } - - dc, err := cmd.Datacenter() - if err != nil { - return err - } - - // TODO: support cross-datacenter copy - - src, err := cmd.DatastorePath(args[0]) - if err != nil { - return err - } - - dst, err := cmd.DatastorePath(args[1]) - if err != nil { - return err - } - - m := object.NewFileManager(c) - task, err := m.CopyDatastoreFile(context.TODO(), src, dc, dst, dc, cmd.force) - if err != nil { - return err - } - - return task.Wait(context.TODO()) -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/govc/datastore/download.go juju-core-2.0.2/src/github.com/juju/govmomi/govc/datastore/download.go --- juju-core-2.0.0/src/github.com/juju/govmomi/govc/datastore/download.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/govc/datastore/download.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,68 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package datastore - -import ( - "errors" - "flag" - - "github.com/juju/govmomi/govc/cli" - "github.com/juju/govmomi/govc/flags" - "github.com/juju/govmomi/vim25/soap" -) - -type download struct { - *flags.DatastoreFlag -} - -func init() { - cli.Register("datastore.download", &download{}) -} - -func (cmd *download) Register(f *flag.FlagSet) {} - -func (cmd *download) Process() error { return nil } - -func (cmd *download) Usage() string { - return "REMOTE LOCAL" -} - -func (cmd *download) Run(f *flag.FlagSet) error { - args := f.Args() - if len(args) != 2 { - return errors.New("invalid arguments") - } - - c, err := cmd.Client() - if err != nil { - return err - } - - u, err := cmd.DatastoreURL(args[0]) - if err != nil { - return err - } - - p := soap.DefaultDownload - if cmd.OutputFlag.TTY { - logger := cmd.ProgressLogger("Downloading... ") - p.Progress = logger - defer logger.Wait() - } - - return c.Client.DownloadFile(args[1], u, &p) -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/govc/datastore/ls.go juju-core-2.0.2/src/github.com/juju/govmomi/govc/datastore/ls.go --- juju-core-2.0.0/src/github.com/juju/govmomi/govc/datastore/ls.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/govc/datastore/ls.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,196 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package datastore - -import ( - "encoding/json" - "flag" - "fmt" - "io" - "path" - "text/tabwriter" - - "github.com/juju/govmomi/govc/cli" - "github.com/juju/govmomi/govc/flags" - "github.com/juju/govmomi/object" - "github.com/juju/govmomi/vim25/types" - "golang.org/x/net/context" -) - -type ls struct { - *flags.DatastoreFlag - *flags.OutputFlag - - long bool -} - -func init() { - cli.Register("datastore.ls", &ls{}) -} - -func (cmd *ls) Register(f *flag.FlagSet) { - f.BoolVar(&cmd.long, "l", false, "Long listing format") -} - -func (cmd *ls) Process() error { return nil } - -func (cmd *ls) Usage() string { - return "[FILE]..." -} - -func (cmd *ls) Run(f *flag.FlagSet) error { - ds, err := cmd.Datastore() - if err != nil { - return err - } - - b, err := ds.Browser(context.TODO()) - if err != nil { - return err - } - - args := f.Args() - if len(args) == 0 { - args = []string{""} - } - - result := &listOutput{ - rs: make([]types.HostDatastoreBrowserSearchResults, 0), - long: cmd.long, - } - - for _, arg := range args { - spec := types.HostDatastoreBrowserSearchSpec{ - MatchPattern: []string{"*"}, - } - - if cmd.long { - spec.Details = &types.FileQueryFlags{ - FileType: true, - FileSize: true, - FileOwner: types.NewBool(true), // TODO: omitempty is generated, but seems to be required - Modification: true, - } - } - - for i := 0; ; i++ { - r, err := cmd.ListPath(b, arg, spec) - if err != nil { - // Treat the argument as a match pattern if not found as directory - if i == 0 && types.IsFileNotFound(err) { - spec.MatchPattern[0] = path.Base(arg) - arg = path.Dir(arg) - continue - } - - return err - } - - // Treat an empty result against match pattern as file not found - if i == 1 && len(r.File) == 0 { - return fmt.Errorf("File %s/%s was not found", r.FolderPath, spec.MatchPattern[0]) - } - - result.add(r) - break - } - } - - return cmd.WriteResult(result) -} - -func (cmd *ls) ListPath(b *object.HostDatastoreBrowser, path string, spec types.HostDatastoreBrowserSearchSpec) (types.HostDatastoreBrowserSearchResults, error) { - var res types.HostDatastoreBrowserSearchResults - - path, err := cmd.DatastorePath(path) - if err != nil { - return res, err - } - - task, err := b.SearchDatastore(context.TODO(), path, &spec) - if err != nil { - return res, err - } - - info, err := task.WaitForResult(context.TODO(), nil) - if err != nil { - return res, err - } - - res = info.Result.(types.HostDatastoreBrowserSearchResults) - return res, nil -} - -type listOutput struct { - rs []types.HostDatastoreBrowserSearchResults - long bool -} - -func (o *listOutput) add(r types.HostDatastoreBrowserSearchResults) { - o.rs = append(o.rs, r) -} - -// hasMultiplePaths returns whether or not the slice of search results contains -// results from more than one folder path. -func (o *listOutput) hasMultiplePaths() bool { - if len(o.rs) == 0 { - return false - } - - p := o.rs[0].FolderPath - - // Multiple paths if any entry is not equal to the first one. - for _, e := range o.rs { - if e.FolderPath != p { - return true - } - } - - return false -} - -func (o *listOutput) MarshalJSON() ([]byte, error) { - return json.Marshal(o.rs) -} - -func (o *listOutput) Write(w io.Writer) error { - // Only include path header if we're dealing with more than one path. - includeHeader := false - if o.hasMultiplePaths() { - includeHeader = true - } - - tw := tabwriter.NewWriter(w, 3, 0, 2, ' ', 0) - for i, r := range o.rs { - if includeHeader { - if i > 0 { - fmt.Fprintf(tw, "\n") - } - fmt.Fprintf(tw, "%s:\n", r.FolderPath) - } - for _, file := range r.File { - info := file.GetFileInfo() - if o.long { - fmt.Fprintf(tw, "%d\t%s\t%s\n", info.FileSize, info.Modification.Format("Mon Jan 2 15:04:05 2006"), info.Path) - } else { - fmt.Fprintf(tw, "%s\n", info.Path) - } - } - } - tw.Flush() - return nil -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/govc/datastore/mkdir.go juju-core-2.0.2/src/github.com/juju/govmomi/govc/datastore/mkdir.go --- juju-core-2.0.0/src/github.com/juju/govmomi/govc/datastore/mkdir.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/govc/datastore/mkdir.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,87 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package datastore - -import ( - "errors" - "flag" - - "github.com/juju/govmomi/govc/cli" - "github.com/juju/govmomi/govc/flags" - "github.com/juju/govmomi/object" - "github.com/juju/govmomi/vim25/soap" - "github.com/juju/govmomi/vim25/types" - "golang.org/x/net/context" -) - -type mkdir struct { - *flags.DatastoreFlag - - createParents bool -} - -func init() { - cli.Register("datastore.mkdir", &mkdir{}) -} - -func (cmd *mkdir) Register(f *flag.FlagSet) { - f.BoolVar(&cmd.createParents, "p", false, "Create intermediate directories as needed") -} - -func (cmd *mkdir) Process() error { return nil } - -func (cmd *mkdir) Usage() string { - return "DIRECTORY" -} - -func (cmd *mkdir) Run(f *flag.FlagSet) error { - args := f.Args() - if len(args) == 0 { - return errors.New("missing operand") - } - - c, err := cmd.Client() - if err != nil { - return err - } - - dc, err := cmd.Datacenter() - if err != nil { - return err - } - - // TODO(PN): Accept multiple args - path, err := cmd.DatastorePath(args[0]) - if err != nil { - return err - } - - m := object.NewFileManager(c) - err = m.MakeDirectory(context.TODO(), path, dc, cmd.createParents) - - // ignore EEXIST if -p flag is given - if err != nil && cmd.createParents { - if soap.IsSoapFault(err) { - soapFault := soap.ToSoapFault(err) - if _, ok := soapFault.VimFault().(types.FileAlreadyExists); ok { - return nil - } - } - } - - return err -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/govc/datastore/mv.go juju-core-2.0.2/src/github.com/juju/govmomi/govc/datastore/mv.go --- juju-core-2.0.0/src/github.com/juju/govmomi/govc/datastore/mv.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/govc/datastore/mv.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,84 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package datastore - -import ( - "errors" - "flag" - - "github.com/juju/govmomi/govc/cli" - "github.com/juju/govmomi/govc/flags" - "github.com/juju/govmomi/object" - "golang.org/x/net/context" -) - -type mv struct { - *flags.DatastoreFlag - - force bool -} - -func init() { - cli.Register("datastore.mv", &mv{}) -} - -func (cmd *mv) Register(f *flag.FlagSet) { - f.BoolVar(&cmd.force, "f", false, "If true, overwrite any identically named file at the destination") -} - -func (cmd *mv) Process() error { return nil } - -func (cmd *mv) Usage() string { - return "SRC DST" -} - -func (cmd *mv) Run(f *flag.FlagSet) error { - args := f.Args() - if len(args) != 2 { - return errors.New("SRC and DST arguments are required") - } - - c, err := cmd.Client() - if err != nil { - return err - } - - dc, err := cmd.Datacenter() - if err != nil { - return err - } - - // TODO: support cross-datacenter move - - src, err := cmd.DatastorePath(args[0]) - if err != nil { - return err - } - - dst, err := cmd.DatastorePath(args[1]) - if err != nil { - return err - } - - m := object.NewFileManager(c) - task, err := m.MoveDatastoreFile(context.TODO(), src, dc, dst, dc, cmd.force) - if err != nil { - return err - } - - return task.Wait(context.TODO()) -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/govc/datastore/rm.go juju-core-2.0.2/src/github.com/juju/govmomi/govc/datastore/rm.go --- juju-core-2.0.0/src/github.com/juju/govmomi/govc/datastore/rm.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/govc/datastore/rm.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,88 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package datastore - -import ( - "errors" - "flag" - - "github.com/juju/govmomi/govc/cli" - "github.com/juju/govmomi/govc/flags" - "github.com/juju/govmomi/object" - "github.com/juju/govmomi/vim25/types" - "golang.org/x/net/context" -) - -type rm struct { - *flags.DatastoreFlag - - force bool -} - -func init() { - cli.Register("datastore.rm", &rm{}) - cli.Alias("datastore.rm", "datastore.delete") -} - -func (cmd *rm) Register(f *flag.FlagSet) { - f.BoolVar(&cmd.force, "f", false, "Force; ignore nonexistent files and arguments") -} - -func (cmd *rm) Process() error { return nil } - -func (cmd *rm) Usage() string { - return "FILE" -} - -func (cmd *rm) Run(f *flag.FlagSet) error { - args := f.Args() - if len(args) == 0 { - return errors.New("missing operand") - } - - c, err := cmd.Client() - if err != nil { - return err - } - - dc, err := cmd.Datacenter() - if err != nil { - return err - } - - // TODO(PN): Accept multiple args - path, err := cmd.DatastorePath(args[0]) - if err != nil { - return err - } - - m := object.NewFileManager(c) - task, err := m.DeleteDatastoreFile(context.TODO(), path, dc) - if err != nil { - return err - } - - err = task.Wait(context.TODO()) - if err != nil { - if types.IsFileNotFound(err) && cmd.force { - // Ignore error - return nil - } - } - - return err -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/govc/datastore/upload.go juju-core-2.0.2/src/github.com/juju/govmomi/govc/datastore/upload.go --- juju-core-2.0.0/src/github.com/juju/govmomi/govc/datastore/upload.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/govc/datastore/upload.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,69 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package datastore - -import ( - "errors" - "flag" - - "github.com/juju/govmomi/govc/cli" - "github.com/juju/govmomi/govc/flags" - "github.com/juju/govmomi/vim25/soap" -) - -type upload struct { - *flags.OutputFlag - *flags.DatastoreFlag -} - -func init() { - cli.Register("datastore.upload", &upload{}) -} - -func (cmd *upload) Register(f *flag.FlagSet) {} - -func (cmd *upload) Process() error { return nil } - -func (cmd *upload) Usage() string { - return "LOCAL REMOTE" -} - -func (cmd *upload) Run(f *flag.FlagSet) error { - args := f.Args() - if len(args) != 2 { - return errors.New("invalid arguments") - } - - c, err := cmd.Client() - if err != nil { - return err - } - - u, err := cmd.DatastoreURL(args[1]) - if err != nil { - return err - } - - p := soap.DefaultUpload - if cmd.OutputFlag.TTY { - logger := cmd.ProgressLogger("Uploading... ") - p.Progress = logger - defer logger.Wait() - } - - return c.Client.UploadFile(args[0], u, &p) -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/govc/device/boot.go juju-core-2.0.2/src/github.com/juju/govmomi/govc/device/boot.go --- juju-core-2.0.0/src/github.com/juju/govmomi/govc/device/boot.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/govc/device/boot.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,75 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package device - -import ( - "flag" - "strings" - - "github.com/juju/govmomi/govc/cli" - "github.com/juju/govmomi/govc/flags" - "github.com/juju/govmomi/vim25/types" - "golang.org/x/net/context" -) - -type boot struct { - *flags.VirtualMachineFlag - - order string - types.VirtualMachineBootOptions -} - -func init() { - cli.Register("device.boot", &boot{}) -} - -func (cmd *boot) Register(f *flag.FlagSet) { - f.Int64Var(&cmd.BootDelay, "delay", 0, "Delay in ms before starting the boot sequence") - f.StringVar(&cmd.order, "order", "", "Boot device order") - f.Int64Var(&cmd.BootRetryDelay, "retry-delay", 0, "Delay in ms before a boot retry") - - cmd.BootRetryEnabled = types.NewBool(false) - f.BoolVar(cmd.BootRetryEnabled, "retry", false, "If true, retry boot after retry-delay") - - cmd.EnterBIOSSetup = types.NewBool(false) - f.BoolVar(cmd.EnterBIOSSetup, "setup", false, "If true, enter BIOS setup on next boot") -} - -func (cmd *boot) Process() error { return nil } - -func (cmd *boot) Run(f *flag.FlagSet) error { - vm, err := cmd.VirtualMachine() - if err != nil { - return err - } - - if vm == nil { - return flag.ErrHelp - } - - devices, err := vm.Device(context.TODO()) - if err != nil { - return err - } - - if cmd.order != "" { - o := strings.Split(cmd.order, ",") - cmd.BootOrder = devices.BootOrder(o) - } - - return vm.SetBootOptions(context.TODO(), &cmd.VirtualMachineBootOptions) -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/govc/device/cdrom/add.go juju-core-2.0.2/src/github.com/juju/govmomi/govc/device/cdrom/add.go --- juju-core-2.0.0/src/github.com/juju/govmomi/govc/device/cdrom/add.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/govc/device/cdrom/add.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,87 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package cdrom - -import ( - "flag" - "fmt" - - "github.com/juju/govmomi/govc/cli" - "github.com/juju/govmomi/govc/flags" - "golang.org/x/net/context" -) - -type add struct { - *flags.VirtualMachineFlag - - controller string -} - -func init() { - cli.Register("device.cdrom.add", &add{}) -} - -func (cmd *add) Register(f *flag.FlagSet) { - f.StringVar(&cmd.controller, "controller", "", "IDE controller name") -} - -func (cmd *add) Process() error { return nil } - -func (cmd *add) Run(f *flag.FlagSet) error { - vm, err := cmd.VirtualMachine() - if err != nil { - return err - } - - if vm == nil { - return flag.ErrHelp - } - - devices, err := vm.Device(context.TODO()) - if err != nil { - return err - } - - c, err := devices.FindIDEController(cmd.controller) - if err != nil { - return err - } - - d, err := devices.CreateCdrom(c) - if err != nil { - return err - } - - err = vm.AddDevice(context.TODO(), d) - if err != nil { - return err - } - - // output name of device we just created - devices, err = vm.Device(context.TODO()) - if err != nil { - return err - } - - devices = devices.SelectByType(d) - - name := devices.Name(devices[len(devices)-1]) - - fmt.Println(name) - - return nil -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/govc/device/cdrom/eject.go juju-core-2.0.2/src/github.com/juju/govmomi/govc/device/cdrom/eject.go --- juju-core-2.0.0/src/github.com/juju/govmomi/govc/device/cdrom/eject.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/govc/device/cdrom/eject.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,70 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package cdrom - -import ( - "flag" - - "github.com/juju/govmomi/govc/cli" - "github.com/juju/govmomi/govc/flags" - "golang.org/x/net/context" -) - -type eject struct { - *flags.VirtualMachineFlag - - device string -} - -func init() { - cli.Register("device.cdrom.eject", &eject{}) -} - -func (cmd *eject) Register(f *flag.FlagSet) { - f.StringVar(&cmd.device, "device", "", "CD-ROM device name") -} - -func (cmd *eject) Process() error { return nil } - -func (cmd *eject) Description() string { - return `Eject media from CD-ROM device. - -If device is not specified, the first CD-ROM device is used.` -} - -func (cmd *eject) Run(f *flag.FlagSet) error { - vm, err := cmd.VirtualMachine() - if err != nil { - return err - } - - if vm == nil { - return flag.ErrHelp - } - - devices, err := vm.Device(context.TODO()) - if err != nil { - return err - } - - c, err := devices.FindCdrom(cmd.device) - if err != nil { - return err - } - - return vm.EditDevice(context.TODO(), devices.EjectIso(c)) -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/govc/device/cdrom/insert.go juju-core-2.0.2/src/github.com/juju/govmomi/govc/device/cdrom/insert.go --- juju-core-2.0.0/src/github.com/juju/govmomi/govc/device/cdrom/insert.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/govc/device/cdrom/insert.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,80 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package cdrom - -import ( - "flag" - - "github.com/juju/govmomi/govc/cli" - "github.com/juju/govmomi/govc/flags" - "golang.org/x/net/context" -) - -type insert struct { - *flags.DatastoreFlag - *flags.VirtualMachineFlag - - device string -} - -func init() { - cli.Register("device.cdrom.insert", &insert{}) -} - -func (cmd *insert) Register(f *flag.FlagSet) { - f.StringVar(&cmd.device, "device", "", "CD-ROM device name") -} - -func (cmd *insert) Process() error { return nil } - -func (cmd *insert) Usage() string { - return "ISO" -} - -func (cmd *insert) Description() string { - return `Insert media on datastore into CD-ROM device. - -If device is not specified, the first CD-ROM device is used.` -} - -func (cmd *insert) Run(f *flag.FlagSet) error { - vm, err := cmd.VirtualMachine() - if err != nil { - return err - } - - if vm == nil || f.NArg() != 1 { - return flag.ErrHelp - } - - devices, err := vm.Device(context.TODO()) - if err != nil { - return err - } - - c, err := devices.FindCdrom(cmd.device) - if err != nil { - return err - } - - iso, err := cmd.DatastorePath(f.Arg(0)) - if err != nil { - return nil - } - - return vm.EditDevice(context.TODO(), devices.InsertIso(c, iso)) -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/govc/device/connect.go juju-core-2.0.2/src/github.com/juju/govmomi/govc/device/connect.go --- juju-core-2.0.0/src/github.com/juju/govmomi/govc/device/connect.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/govc/device/connect.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,75 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package device - -import ( - "flag" - "fmt" - - "github.com/juju/govmomi/govc/cli" - "github.com/juju/govmomi/govc/flags" - "golang.org/x/net/context" -) - -type connect struct { - *flags.VirtualMachineFlag -} - -func init() { - cli.Register("device.connect", &connect{}) -} - -func (cmd *connect) Register(f *flag.FlagSet) {} - -func (cmd *connect) Process() error { return nil } - -func (cmd *connect) Usage() string { - return "DEVICE..." -} - -func (cmd *connect) Run(f *flag.FlagSet) error { - vm, err := cmd.VirtualMachine() - if err != nil { - return err - } - - if vm == nil { - return flag.ErrHelp - } - - devices, err := vm.Device(context.TODO()) - if err != nil { - return err - } - - for _, name := range f.Args() { - device := devices.Find(name) - if device == nil { - return fmt.Errorf("device '%s' not found", name) - } - - if err = devices.Connect(device); err != nil { - return err - } - - if err = vm.EditDevice(context.TODO(), device); err != nil { - return err - } - } - - return nil -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/govc/device/disconnect.go juju-core-2.0.2/src/github.com/juju/govmomi/govc/device/disconnect.go --- juju-core-2.0.0/src/github.com/juju/govmomi/govc/device/disconnect.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/govc/device/disconnect.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,75 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package device - -import ( - "flag" - "fmt" - - "github.com/juju/govmomi/govc/cli" - "github.com/juju/govmomi/govc/flags" - "golang.org/x/net/context" -) - -type disconnect struct { - *flags.VirtualMachineFlag -} - -func init() { - cli.Register("device.disconnect", &disconnect{}) -} - -func (cmd *disconnect) Register(f *flag.FlagSet) {} - -func (cmd *disconnect) Process() error { return nil } - -func (cmd *disconnect) Usage() string { - return "DEVICE..." -} - -func (cmd *disconnect) Run(f *flag.FlagSet) error { - vm, err := cmd.VirtualMachine() - if err != nil { - return err - } - - if vm == nil { - return flag.ErrHelp - } - - devices, err := vm.Device(context.TODO()) - if err != nil { - return err - } - - for _, name := range f.Args() { - device := devices.Find(name) - if device == nil { - return fmt.Errorf("device '%s' not found", name) - } - - if err = devices.Disconnect(device); err != nil { - return err - } - - if err = vm.EditDevice(context.TODO(), device); err != nil { - return err - } - } - - return nil -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/govc/device/floppy/add.go juju-core-2.0.2/src/github.com/juju/govmomi/govc/device/floppy/add.go --- juju-core-2.0.0/src/github.com/juju/govmomi/govc/device/floppy/add.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/govc/device/floppy/add.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,78 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package floppy - -import ( - "flag" - "fmt" - - "github.com/juju/govmomi/govc/cli" - "github.com/juju/govmomi/govc/flags" - "golang.org/x/net/context" -) - -type add struct { - *flags.VirtualMachineFlag -} - -func init() { - cli.Register("device.floppy.add", &add{}) -} - -func (cmd *add) Register(f *flag.FlagSet) {} - -func (cmd *add) Process() error { return nil } - -func (cmd *add) Run(f *flag.FlagSet) error { - vm, err := cmd.VirtualMachine() - if err != nil { - return err - } - - if vm == nil { - return flag.ErrHelp - } - - devices, err := vm.Device(context.TODO()) - if err != nil { - return err - } - - d, err := devices.CreateFloppy() - if err != nil { - return err - } - - err = vm.AddDevice(context.TODO(), d) - if err != nil { - return err - } - - // output name of device we just created - devices, err = vm.Device(context.TODO()) - if err != nil { - return err - } - - devices = devices.SelectByType(d) - - name := devices.Name(devices[len(devices)-1]) - - fmt.Println(name) - - return nil -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/govc/device/floppy/eject.go juju-core-2.0.2/src/github.com/juju/govmomi/govc/device/floppy/eject.go --- juju-core-2.0.0/src/github.com/juju/govmomi/govc/device/floppy/eject.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/govc/device/floppy/eject.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,70 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package floppy - -import ( - "flag" - - "github.com/juju/govmomi/govc/cli" - "github.com/juju/govmomi/govc/flags" - "golang.org/x/net/context" -) - -type eject struct { - *flags.VirtualMachineFlag - - device string -} - -func init() { - cli.Register("device.floppy.eject", &eject{}) -} - -func (cmd *eject) Register(f *flag.FlagSet) { - f.StringVar(&cmd.device, "device", "", "Floppy device name") -} - -func (cmd *eject) Process() error { return nil } - -func (cmd *eject) Description() string { - return `Eject image from floppy device. - -If device is not specified, the first floppy device is used.` -} - -func (cmd *eject) Run(f *flag.FlagSet) error { - vm, err := cmd.VirtualMachine() - if err != nil { - return err - } - - if vm == nil { - return flag.ErrHelp - } - - devices, err := vm.Device(context.TODO()) - if err != nil { - return err - } - - c, err := devices.FindFloppy(cmd.device) - if err != nil { - return err - } - - return vm.EditDevice(context.TODO(), devices.EjectImg(c)) -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/govc/device/floppy/insert.go juju-core-2.0.2/src/github.com/juju/govmomi/govc/device/floppy/insert.go --- juju-core-2.0.0/src/github.com/juju/govmomi/govc/device/floppy/insert.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/govc/device/floppy/insert.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,80 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package floppy - -import ( - "flag" - - "github.com/juju/govmomi/govc/cli" - "github.com/juju/govmomi/govc/flags" - "golang.org/x/net/context" -) - -type insert struct { - *flags.DatastoreFlag - *flags.VirtualMachineFlag - - device string -} - -func init() { - cli.Register("device.floppy.insert", &insert{}) -} - -func (cmd *insert) Register(f *flag.FlagSet) { - f.StringVar(&cmd.device, "device", "", "Floppy device name") -} - -func (cmd *insert) Process() error { return nil } - -func (cmd *insert) Usage() string { - return "IMG" -} - -func (cmd *insert) Description() string { - return `Insert image on datastore into floppy device. - -If device is not specified, the first floppy device is used.` -} - -func (cmd *insert) Run(f *flag.FlagSet) error { - vm, err := cmd.VirtualMachine() - if err != nil { - return err - } - - if vm == nil || f.NArg() != 1 { - return flag.ErrHelp - } - - devices, err := vm.Device(context.TODO()) - if err != nil { - return err - } - - c, err := devices.FindFloppy(cmd.device) - if err != nil { - return err - } - - img, err := cmd.DatastorePath(f.Arg(0)) - if err != nil { - return nil - } - - return vm.EditDevice(context.TODO(), devices.InsertImg(c, img)) -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/govc/device/info.go juju-core-2.0.2/src/github.com/juju/govmomi/govc/device/info.go --- juju-core-2.0.0/src/github.com/juju/govmomi/govc/device/info.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/govc/device/info.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,114 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package device - -import ( - "flag" - "fmt" - "os" - "strings" - "text/tabwriter" - - "github.com/juju/govmomi/govc/cli" - "github.com/juju/govmomi/govc/flags" - "github.com/juju/govmomi/vim25/types" - "golang.org/x/net/context" -) - -type info struct { - *flags.VirtualMachineFlag -} - -func init() { - cli.Register("device.info", &info{}) -} - -func (cmd *info) Register(f *flag.FlagSet) {} - -func (cmd *info) Process() error { return nil } - -func (cmd *info) Usage() string { - return "DEVICE..." -} - -func (cmd *info) Run(f *flag.FlagSet) error { - vm, err := cmd.VirtualMachine() - if err != nil { - return err - } - - if vm == nil { - return flag.ErrHelp - } - - devices, err := vm.Device(context.TODO()) - if err != nil { - return err - } - - tw := tabwriter.NewWriter(os.Stdout, 2, 0, 2, ' ', 0) - - for _, name := range f.Args() { - device := devices.Find(name) - if device == nil { - return fmt.Errorf("device '%s' not found", name) - } - - d := device.GetVirtualDevice() - info := d.DeviceInfo.GetDescription() - - fmt.Fprintf(tw, "Name:\t%s\n", name) - fmt.Fprintf(tw, " Type:\t%s\n", devices.TypeName(device)) - fmt.Fprintf(tw, " Label:\t%s\n", info.Label) - fmt.Fprintf(tw, " Summary:\t%s\n", info.Summary) - fmt.Fprintf(tw, " Key:\t%d\n", d.Key) - - if c, ok := device.(types.BaseVirtualController); ok { - var attached []string - for _, key := range c.GetVirtualController().Device { - attached = append(attached, devices.Name(devices.FindByKey(key))) - } - fmt.Fprintf(tw, " Devices:\t%s\n", strings.Join(attached, ", ")) - } else { - if c := devices.FindByKey(d.ControllerKey); c != nil { - fmt.Fprintf(tw, " Controller:\t%s\n", devices.Name(c)) - fmt.Fprintf(tw, " Unit number:\t%d\n", d.UnitNumber) - } - } - - if ca := d.Connectable; ca != nil { - fmt.Fprintf(tw, " Connected:\t%t\n", ca.Connected) - fmt.Fprintf(tw, " Start connected:\t%t\n", ca.StartConnected) - fmt.Fprintf(tw, " Guest control:\t%t\n", ca.AllowGuestControl) - fmt.Fprintf(tw, " Status:\t%s\n", ca.Status) - } - - switch md := device.(type) { - case types.BaseVirtualEthernetCard: - fmt.Fprintf(tw, " MAC Address:\t%s\n", md.GetVirtualEthernetCard().MacAddress) - case *types.VirtualDisk: - if b, ok := md.Backing.(types.BaseVirtualDeviceFileBackingInfo); ok { - fmt.Fprintf(tw, " File:\t%s\n", b.GetVirtualDeviceFileBackingInfo().FileName) - } - if b, ok := md.Backing.(*types.VirtualDiskFlatVer2BackingInfo); ok && b.Parent != nil { - fmt.Fprintf(tw, " Parent:\t%s\n", b.Parent.GetVirtualDeviceFileBackingInfo().FileName) - } - } - } - - return tw.Flush() -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/govc/device/ls.go juju-core-2.0.2/src/github.com/juju/govmomi/govc/device/ls.go --- juju-core-2.0.0/src/github.com/juju/govmomi/govc/device/ls.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/govc/device/ls.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,78 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package device - -import ( - "flag" - "fmt" - "os" - "text/tabwriter" - - "github.com/juju/govmomi/govc/cli" - "github.com/juju/govmomi/govc/flags" - "golang.org/x/net/context" -) - -type ls struct { - *flags.VirtualMachineFlag - - boot bool -} - -func init() { - cli.Register("device.ls", &ls{}) -} - -func (cmd *ls) Register(f *flag.FlagSet) { - f.BoolVar(&cmd.boot, "boot", false, "List devices configured in the VM's boot options") -} - -func (cmd *ls) Process() error { return nil } - -func (cmd *ls) Run(f *flag.FlagSet) error { - vm, err := cmd.VirtualMachine() - if err != nil { - return err - } - - if vm == nil { - return flag.ErrHelp - } - - devices, err := vm.Device(context.TODO()) - if err != nil { - return err - } - - if cmd.boot { - options, err := vm.BootOptions(context.TODO()) - if err != nil { - return err - } - - devices = devices.SelectBootOrder(options.BootOrder) - } - - tw := tabwriter.NewWriter(os.Stdout, 3, 0, 2, ' ', 0) - - for _, device := range devices { - fmt.Fprintf(tw, "%s\t%s\t%s\n", devices.Name(device), devices.TypeName(device), - device.GetVirtualDevice().DeviceInfo.GetDescription().Summary) - } - - return tw.Flush() -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/govc/device/remove.go juju-core-2.0.2/src/github.com/juju/govmomi/govc/device/remove.go --- juju-core-2.0.0/src/github.com/juju/govmomi/govc/device/remove.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/govc/device/remove.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,71 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package device - -import ( - "flag" - "fmt" - - "github.com/juju/govmomi/govc/cli" - "github.com/juju/govmomi/govc/flags" - "golang.org/x/net/context" -) - -type remove struct { - *flags.VirtualMachineFlag -} - -func init() { - cli.Register("device.remove", &remove{}) -} - -func (cmd *remove) Register(f *flag.FlagSet) {} - -func (cmd *remove) Process() error { return nil } - -func (cmd *remove) Usage() string { - return "DEVICE..." -} - -func (cmd *remove) Run(f *flag.FlagSet) error { - vm, err := cmd.VirtualMachine() - if err != nil { - return err - } - - if vm == nil { - return flag.ErrHelp - } - - devices, err := vm.Device(context.TODO()) - if err != nil { - return err - } - - for _, name := range f.Args() { - device := devices.Find(name) - if device == nil { - return fmt.Errorf("device '%s' not found", name) - } - - if err = vm.RemoveDevice(context.TODO(), device); err != nil { - return err - } - } - - return nil -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/govc/device/scsi/add.go juju-core-2.0.2/src/github.com/juju/govmomi/govc/device/scsi/add.go --- juju-core-2.0.0/src/github.com/juju/govmomi/govc/device/scsi/add.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/govc/device/scsi/add.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,99 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package scsi - -import ( - "flag" - "fmt" - "strings" - - "github.com/juju/govmomi/govc/cli" - "github.com/juju/govmomi/govc/flags" - "github.com/juju/govmomi/object" - "github.com/juju/govmomi/vim25/types" - "golang.org/x/net/context" -) - -type add struct { - *flags.VirtualMachineFlag - - controller string - sharedBus string - hotAddRemove bool -} - -func init() { - cli.Register("device.scsi.add", &add{}) -} - -func (cmd *add) Register(f *flag.FlagSet) { - var ctypes []string - ct := object.SCSIControllerTypes() - for _, t := range ct { - ctypes = append(ctypes, ct.Type(t)) - } - f.StringVar(&cmd.controller, "type", ct.Type(ct[0]), - fmt.Sprintf("SCSI controller type (%s)", strings.Join(ctypes, "|"))) - f.StringVar(&cmd.sharedBus, "sharing", string(types.VirtualSCSISharingNoSharing), "SCSI sharing") - f.BoolVar(&cmd.hotAddRemove, "hot", false, "Enable hot-add/remove") -} - -func (cmd *add) Process() error { return nil } - -func (cmd *add) Run(f *flag.FlagSet) error { - vm, err := cmd.VirtualMachine() - if err != nil { - return err - } - - if vm == nil { - return flag.ErrHelp - } - - devices, err := vm.Device(context.TODO()) - if err != nil { - return err - } - - d, err := devices.CreateSCSIController(cmd.controller) - if err != nil { - return err - } - - c := d.(types.BaseVirtualSCSIController).GetVirtualSCSIController() - c.HotAddRemove = &cmd.hotAddRemove - c.SharedBus = types.VirtualSCSISharing(cmd.sharedBus) - - err = vm.AddDevice(context.TODO(), d) - if err != nil { - return err - } - - // output name of device we just created - devices, err = vm.Device(context.TODO()) - if err != nil { - return err - } - - devices = devices.SelectByType(d) - - name := devices.Name(devices[len(devices)-1]) - - fmt.Println(name) - - return nil -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/govc/device/serial/add.go juju-core-2.0.2/src/github.com/juju/govmomi/govc/device/serial/add.go --- juju-core-2.0.0/src/github.com/juju/govmomi/govc/device/serial/add.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/govc/device/serial/add.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,78 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package serial - -import ( - "flag" - "fmt" - - "github.com/juju/govmomi/govc/cli" - "github.com/juju/govmomi/govc/flags" - "golang.org/x/net/context" -) - -type add struct { - *flags.VirtualMachineFlag -} - -func init() { - cli.Register("device.serial.add", &add{}) -} - -func (cmd *add) Register(f *flag.FlagSet) {} - -func (cmd *add) Process() error { return nil } - -func (cmd *add) Run(f *flag.FlagSet) error { - vm, err := cmd.VirtualMachine() - if err != nil { - return err - } - - if vm == nil { - return flag.ErrHelp - } - - devices, err := vm.Device(context.TODO()) - if err != nil { - return err - } - - d, err := devices.CreateSerialPort() - if err != nil { - return err - } - - err = vm.AddDevice(context.TODO(), d) - if err != nil { - return err - } - - // output name of device we just created - devices, err = vm.Device(context.TODO()) - if err != nil { - return err - } - - devices = devices.SelectByType(d) - - name := devices.Name(devices[len(devices)-1]) - - fmt.Println(name) - - return nil -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/govc/device/serial/connect.go juju-core-2.0.2/src/github.com/juju/govmomi/govc/device/serial/connect.go --- juju-core-2.0.0/src/github.com/juju/govmomi/govc/device/serial/connect.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/govc/device/serial/connect.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,66 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package serial - -import ( - "flag" - - "github.com/juju/govmomi/govc/cli" - "github.com/juju/govmomi/govc/flags" - "golang.org/x/net/context" -) - -type connect struct { - *flags.VirtualMachineFlag - - device string - client bool -} - -func init() { - cli.Register("device.serial.connect", &connect{}) -} - -func (cmd *connect) Register(f *flag.FlagSet) { - f.StringVar(&cmd.device, "device", "", "serial port device name") - f.BoolVar(&cmd.client, "client", false, "Use client direction") -} - -func (cmd *connect) Process() error { return nil } - -func (cmd *connect) Run(f *flag.FlagSet) error { - vm, err := cmd.VirtualMachine() - if err != nil { - return err - } - - if vm == nil { - return flag.ErrHelp - } - - devices, err := vm.Device(context.TODO()) - if err != nil { - return err - } - - d, err := devices.FindSerialPort(cmd.device) - if err != nil { - return err - } - - return vm.EditDevice(context.TODO(), devices.ConnectSerialPort(d, f.Arg(0), cmd.client)) -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/govc/device/serial/disconnect.go juju-core-2.0.2/src/github.com/juju/govmomi/govc/device/serial/disconnect.go --- juju-core-2.0.0/src/github.com/juju/govmomi/govc/device/serial/disconnect.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/govc/device/serial/disconnect.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,64 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package serial - -import ( - "flag" - - "github.com/juju/govmomi/govc/cli" - "github.com/juju/govmomi/govc/flags" - "golang.org/x/net/context" -) - -type disconnect struct { - *flags.VirtualMachineFlag - - device string -} - -func init() { - cli.Register("device.serial.disconnect", &disconnect{}) -} - -func (cmd *disconnect) Register(f *flag.FlagSet) { - f.StringVar(&cmd.device, "device", "", "serial port device name") -} - -func (cmd *disconnect) Process() error { return nil } - -func (cmd *disconnect) Run(f *flag.FlagSet) error { - vm, err := cmd.VirtualMachine() - if err != nil { - return err - } - - if vm == nil { - return flag.ErrHelp - } - - devices, err := vm.Device(context.TODO()) - if err != nil { - return err - } - - d, err := devices.FindSerialPort(cmd.device) - if err != nil { - return err - } - - return vm.EditDevice(context.TODO(), devices.DisconnectSerialPort(d)) -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/govc/examples/lib/ssh.sh juju-core-2.0.2/src/github.com/juju/govmomi/govc/examples/lib/ssh.sh --- juju-core-2.0.0/src/github.com/juju/govmomi/govc/examples/lib/ssh.sh 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/govc/examples/lib/ssh.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,44 +0,0 @@ -function public-key { - local dir=${HOME}/.ssh - - for f in $HOME/.ssh/{id_{rsa,dsa},*}.pub; do - if [ -r $f ]; then - echo $f - return - fi - done - - echo "Can't find public key file..." - exit 1 -} - -PUBLIC_KEY_FILE=${PUBLIC_KEY_FILE-$(public-key)} -SSH_OPTS="-oStrictHostKeyChecking=no -oUserKnownHostsFile=/dev/null -oLogLevel=quiet" - -function upload-public-key { - local vm_name=$1 - local dir=$2 - - if [ -z "$dir" ] - then - uid=$(echo $GOVC_GUEST_LOGIN | awk -F: '{print $1}') - dir=$(govc guest.getenv -vm ${vm_name} HOME | awk -F= '{print $2}') - - if [ -z "$dir" ] - then - echo "Can't find ${uid}'s HOME dir..." - exit 1 - fi - fi - - govc guest.mkdir \ - -vm ${vm_name} \ - -p \ - ${dir}/.ssh - - govc guest.upload \ - -vm ${vm_name} \ - -f \ - ${PUBLIC_KEY_FILE} \ - ${dir}/.ssh/authorized_keys -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/govc/examples/vcsa.sh juju-core-2.0.2/src/github.com/juju/govmomi/govc/examples/vcsa.sh --- juju-core-2.0.0/src/github.com/juju/govmomi/govc/examples/vcsa.sh 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/govc/examples/vcsa.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,57 +0,0 @@ -#!/bin/bash -e - -lib=$(readlink -nf $(dirname $0))/lib -. $lib/ssh.sh - -ova=$1 - -if [ -z "$ova" ] -then - ova=./VMware-vCenter-Server-Appliance-5.5.0.10300-2000350_OVF10.ova -fi - -# default to local Vagrant esxbox for testing -export GOVC_URL=${GOVC_URL-"https://root:vagrant@localhost:8443/sdk"} - -# default VCSA credentials -export GOVC_GUEST_LOGIN=root:vmware - -# VM name as defined in the VCSA .ovf -vm_name=VMware_vCenter_Server_Appliance - -echo "Importing $ova..." -govc import.ova $ova - -echo "Powering on $vm_name..." -govc vm.power -on $vm_name - -echo "Waiting for $vm_name's IP address..." -vc=$(govc vm.ip $vm_name) - -govc vm.info $vm_name - -echo "Uploading ssh public key to $vm_name..." -upload-public-key $vm_name - -echo "Configuring vCenter Server Appliance..." - -# http://www.virtuallyghetto.com/2012/02/automating-vcenter-server-appliance.html -ssh ${SSH_OPTS} root@$vc < 1 - return nil, flag.err - } - - return flag.dc, err -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/govc/flags/datastore.go juju-core-2.0.2/src/github.com/juju/govmomi/govc/flags/datastore.go --- juju-core-2.0.0/src/github.com/juju/govmomi/govc/flags/datastore.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/govc/flags/datastore.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,151 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package flags - -import ( - "errors" - "flag" - "fmt" - "net/url" - "os" - "path" - "sync" - - "github.com/juju/govmomi/object" - "github.com/juju/govmomi/vim25/types" - "golang.org/x/net/context" -) - -var ( - ErrDatastoreDirNotExist = errors.New("datastore directory does not exist") - ErrDatastoreFileNotExist = errors.New("datastore file does not exist") -) - -type DatastoreFlag struct { - *DatacenterFlag - - register sync.Once - name string - ds *object.Datastore -} - -func (flag *DatastoreFlag) Register(f *flag.FlagSet) { - flag.register.Do(func() { - env := "GOVC_DATASTORE" - value := os.Getenv(env) - usage := fmt.Sprintf("Datastore [%s]", env) - f.StringVar(&flag.name, "ds", value, usage) - }) -} - -func (flag *DatastoreFlag) Process() error { - return nil -} - -func (flag *DatastoreFlag) Datastore() (*object.Datastore, error) { - if flag.ds != nil { - return flag.ds, nil - } - - finder, err := flag.Finder() - if err != nil { - return nil, err - } - - if flag.name == "" { - flag.ds, err = finder.DefaultDatastore(context.TODO()) - } else { - flag.ds, err = finder.Datastore(context.TODO(), flag.name) - } - - return flag.ds, err -} - -func (flag *DatastoreFlag) DatastorePath(name string) (string, error) { - ds, err := flag.Datastore() - if err != nil { - return "", err - } - - return ds.Path(name), nil -} - -func (flag *DatastoreFlag) DatastoreURL(path string) (*url.URL, error) { - dc, err := flag.Datacenter() - if err != nil { - return nil, err - } - - ds, err := flag.Datastore() - if err != nil { - return nil, err - } - - u, err := ds.URL(context.TODO(), dc, path) - if err != nil { - return nil, err - } - - return u, nil -} - -func (flag *DatastoreFlag) Stat(file string) (types.BaseFileInfo, error) { - ds, err := flag.Datastore() - if err != nil { - return nil, err - } - - b, err := ds.Browser(context.TODO()) - if err != nil { - return nil, err - } - - spec := types.HostDatastoreBrowserSearchSpec{ - Details: &types.FileQueryFlags{ - FileType: true, - FileOwner: types.NewBool(true), // TODO: omitempty is generated, but seems to be required - }, - MatchPattern: []string{path.Base(file)}, - } - - dsPath := ds.Path(path.Dir(file)) - task, err := b.SearchDatastore(context.TODO(), dsPath, &spec) - if err != nil { - return nil, err - } - - info, err := task.WaitForResult(context.TODO(), nil) - if err != nil { - if info != nil && info.Error != nil { - _, ok := info.Error.Fault.(*types.FileNotFound) - if ok { - // FileNotFound means the base path doesn't exist. - return nil, ErrDatastoreDirNotExist - } - } - - return nil, err - } - - res := info.Result.(types.HostDatastoreBrowserSearchResults) - if len(res.File) == 0 { - // File doesn't exist - return nil, ErrDatastoreFileNotExist - } - - return res.File[0], nil -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/govc/flags/debug.go juju-core-2.0.2/src/github.com/juju/govmomi/govc/flags/debug.go --- juju-core-2.0.0/src/github.com/juju/govmomi/govc/flags/debug.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/govc/flags/debug.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,72 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package flags - -import ( - "flag" - "fmt" - "os" - "path/filepath" - "strings" - "time" - - "github.com/juju/govmomi/vim25/debug" -) - -type DebugFlag struct { - enable bool -} - -func (flag *DebugFlag) Register(f *flag.FlagSet) { - env := "GOVC_DEBUG" - enable := false - switch env := strings.ToLower(os.Getenv(env)); env { - case "1", "true": - enable = true - } - - usage := fmt.Sprintf("Store debug logs [%s]", env) - f.BoolVar(&flag.enable, "debug", enable, usage) -} - -func (flag *DebugFlag) Process() error { - if flag.enable { - // Base path for storing debug logs. - r := os.Getenv("GOVC_DEBUG_PATH") - if r == "" { - r = filepath.Join(os.Getenv("HOME"), ".govmomi") - } - r = filepath.Join(r, "debug") - - // Path for this particular run. - now := time.Now().Format("2006-01-02T15-04-05.999999999") - r = filepath.Join(r, now) - - err := os.MkdirAll(r, 0700) - if err != nil { - return err - } - - p := debug.FileProvider{ - Path: r, - } - - debug.SetProvider(&p) - } - - return nil -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/govc/flags/empty.go juju-core-2.0.2/src/github.com/juju/govmomi/govc/flags/empty.go --- juju-core-2.0.0/src/github.com/juju/govmomi/govc/flags/empty.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/govc/flags/empty.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,25 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package flags - -import "flag" - -type EmptyFlag struct{} - -func (flag *EmptyFlag) Register(f *flag.FlagSet) {} - -func (flag *EmptyFlag) Process() error { return nil } diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/govc/flags/host_system.go juju-core-2.0.2/src/github.com/juju/govmomi/govc/flags/host_system.go --- juju-core-2.0.0/src/github.com/juju/govmomi/govc/flags/host_system.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/govc/flags/host_system.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,113 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package flags - -import ( - "flag" - "fmt" - "os" - "sync" - - "github.com/juju/govmomi/object" - "golang.org/x/net/context" -) - -type HostSystemFlag struct { - *ClientFlag - *DatacenterFlag - *SearchFlag - - register sync.Once - name string - host *object.HostSystem - pool *object.ResourcePool -} - -func (flag *HostSystemFlag) Register(f *flag.FlagSet) { - flag.SearchFlag = NewSearchFlag(SearchHosts) - - flag.register.Do(func() { - env := "GOVC_HOST" - value := os.Getenv(env) - usage := fmt.Sprintf("Host system [%s]", env) - f.StringVar(&flag.name, "host", value, usage) - }) -} - -func (flag *HostSystemFlag) Process() error { - return nil -} - -func (flag *HostSystemFlag) HostSystemIfSpecified() (*object.HostSystem, error) { - if flag.host != nil { - return flag.host, nil - } - - // Use search flags if specified. - if flag.SearchFlag.IsSet() { - host, err := flag.SearchFlag.HostSystem() - if err != nil { - return nil, err - } - - flag.host = host - return flag.host, nil - } - - // Never look for a default host system. - // A host system parameter is optional for vm creation. It uses a mandatory - // resource pool parameter to determine where the vm should be placed. - if flag.name == "" { - return nil, nil - } - - finder, err := flag.Finder() - if err != nil { - return nil, err - } - - flag.host, err = finder.HostSystem(context.TODO(), flag.name) - return flag.host, err -} - -func (flag *HostSystemFlag) HostSystem() (*object.HostSystem, error) { - host, err := flag.HostSystemIfSpecified() - if err != nil { - return nil, err - } - - if host != nil { - return host, nil - } - - finder, err := flag.Finder() - if err != nil { - return nil, err - } - - flag.host, err = finder.DefaultHostSystem(context.TODO()) - return flag.host, err -} - -func (flag *HostSystemFlag) HostNetworkSystem() (*object.HostNetworkSystem, error) { - host, err := flag.HostSystem() - if err != nil { - return nil, err - } - - return host.ConfigManager().NetworkSystem(context.TODO()) -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/govc/flags/network.go juju-core-2.0.2/src/github.com/juju/govmomi/govc/flags/network.go --- juju-core-2.0.0/src/github.com/juju/govmomi/govc/flags/network.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/govc/flags/network.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,103 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package flags - -import ( - "flag" - "fmt" - "os" - "sync" - - "github.com/juju/govmomi/object" - "github.com/juju/govmomi/vim25/types" - "golang.org/x/net/context" -) - -type NetworkFlag struct { - *DatacenterFlag - - register sync.Once - name string - net object.NetworkReference - adapter string -} - -func NewNetworkFlag() *NetworkFlag { - return &NetworkFlag{} -} - -func (flag *NetworkFlag) Register(f *flag.FlagSet) { - flag.register.Do(func() { - env := "GOVC_NETWORK" - value := os.Getenv(env) - flag.Set(value) - usage := fmt.Sprintf("Network [%s]", env) - f.Var(flag, "net", usage) - f.StringVar(&flag.adapter, "net.adapter", "e1000", "Network adapter type") - }) -} - -func (flag *NetworkFlag) Process() error { - return nil -} - -func (flag *NetworkFlag) String() string { - return flag.name -} - -func (flag *NetworkFlag) Set(name string) error { - flag.name = name - return nil -} - -func (flag *NetworkFlag) Network() (object.NetworkReference, error) { - if flag.net != nil { - return flag.net, nil - } - - finder, err := flag.Finder() - if err != nil { - return nil, err - } - - if flag.name == "" { - flag.net, err = finder.DefaultNetwork(context.TODO()) - } else { - flag.net, err = finder.Network(context.TODO(), flag.name) - } - - return flag.net, err -} - -func (flag *NetworkFlag) Device() (types.BaseVirtualDevice, error) { - net, err := flag.Network() - if err != nil { - return nil, err - } - - backing, err := net.EthernetCardBackingInfo(context.TODO()) - if err != nil { - return nil, err - } - - device, err := object.EthernetCardTypes().CreateEthernetCard(flag.adapter, backing) - if err != nil { - return nil, err - } - - return device, nil -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/govc/flags/output.go juju-core-2.0.2/src/github.com/juju/govmomi/govc/flags/output.go --- juju-core-2.0.0/src/github.com/juju/govmomi/govc/flags/output.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/govc/flags/output.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,191 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package flags - -import ( - "encoding/json" - "flag" - "fmt" - "io" - "os" - "sync" - "time" - - "github.com/juju/govmomi/vim25/progress" -) - -type OutputWriter interface { - Write(io.Writer) error -} - -type OutputFlag struct { - JSON bool - TTY bool -} - -func (flag *OutputFlag) Register(f *flag.FlagSet) { - f.BoolVar(&flag.JSON, "json", false, "Enable JSON output") -} - -func (flag *OutputFlag) Process() error { - if !flag.JSON { - // Assume we have a tty if not outputting JSON - flag.TTY = true - } - - return nil -} - -// Log outputs the specified string, prefixed with the current time. -// A newline is not automatically added. If the specified string -// starts with a '\r', the current line is cleared first. -func (flag *OutputFlag) Log(s string) (int, error) { - if len(s) > 0 && s[0] == '\r' { - flag.Write([]byte{'\r', 033, '[', 'K'}) - s = s[1:] - } - - return flag.WriteString(time.Now().Format("[02-01-06 15:04:05] ") + s) -} - -func (flag *OutputFlag) Write(b []byte) (int, error) { - if !flag.TTY { - return 0, nil - } - - n, err := os.Stdout.Write(b) - os.Stdout.Sync() - return n, err -} - -func (flag *OutputFlag) WriteString(s string) (int, error) { - return flag.Write([]byte(s)) -} - -func (flag *OutputFlag) WriteResult(result OutputWriter) error { - var err error - var out = os.Stdout - - if flag.JSON { - enc := json.NewEncoder(out) - err = enc.Encode(result) - } else { - err = result.Write(out) - } - - return err -} - -type progressLogger struct { - flag *OutputFlag - prefix string - - wg sync.WaitGroup - - sink chan chan progress.Report - done chan struct{} -} - -func newProgressLogger(flag *OutputFlag, prefix string) *progressLogger { - p := &progressLogger{ - flag: flag, - prefix: prefix, - - sink: make(chan chan progress.Report), - done: make(chan struct{}), - } - - p.wg.Add(1) - - go p.loopA() - - return p -} - -// loopA runs before Sink() has been called. -func (p *progressLogger) loopA() { - var err error - - defer p.wg.Done() - - tick := time.NewTicker(100 * time.Millisecond) - defer tick.Stop() - - for stop := false; !stop; { - select { - case ch := <-p.sink: - err = p.loopB(tick, ch) - stop = true - case <-p.done: - stop = true - case <-tick.C: - line := fmt.Sprintf("\r%s", p.prefix) - p.flag.Log(line) - } - } - - if err != nil && err != io.EOF { - p.flag.Log(fmt.Sprintf("\r%sError: %s\n", p.prefix, err)) - } else { - p.flag.Log(fmt.Sprintf("\r%sOK\n", p.prefix)) - } -} - -// loopA runs after Sink() has been called. -func (p *progressLogger) loopB(tick *time.Ticker, ch <-chan progress.Report) error { - var r progress.Report - var ok bool - var err error - - for ok = true; ok; { - select { - case r, ok = <-ch: - if !ok { - break - } - err = r.Error() - case <-tick.C: - line := fmt.Sprintf("\r%s", p.prefix) - if r != nil { - line += fmt.Sprintf("(%.0f%%", r.Percentage()) - detail := r.Detail() - if detail != "" { - line += fmt.Sprintf(", %s", detail) - } - line += ")" - } - p.flag.Log(line) - } - } - - return err -} - -func (p *progressLogger) Sink() chan<- progress.Report { - ch := make(chan progress.Report) - p.sink <- ch - return ch -} - -func (p *progressLogger) Wait() { - close(p.done) - p.wg.Wait() -} - -func (flag *OutputFlag) ProgressLogger(prefix string) *progressLogger { - return newProgressLogger(flag, prefix) -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/govc/flags/resource_pool.go juju-core-2.0.2/src/github.com/juju/govmomi/govc/flags/resource_pool.go --- juju-core-2.0.0/src/github.com/juju/govmomi/govc/flags/resource_pool.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/govc/flags/resource_pool.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,67 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package flags - -import ( - "flag" - "fmt" - "os" - "sync" - - "github.com/juju/govmomi/object" - "golang.org/x/net/context" -) - -type ResourcePoolFlag struct { - *DatacenterFlag - - register sync.Once - name string - pool *object.ResourcePool -} - -func (flag *ResourcePoolFlag) Register(f *flag.FlagSet) { - flag.register.Do(func() { - env := "GOVC_RESOURCE_POOL" - value := os.Getenv(env) - usage := fmt.Sprintf("Resource pool [%s]", env) - f.StringVar(&flag.name, "pool", value, usage) - }) -} - -func (flag *ResourcePoolFlag) Process() error { - return nil -} - -func (flag *ResourcePoolFlag) ResourcePool() (*object.ResourcePool, error) { - if flag.pool != nil { - return flag.pool, nil - } - - finder, err := flag.Finder() - if err != nil { - return nil, err - } - - if flag.name == "" { - flag.pool, err = finder.DefaultResourcePool(context.TODO()) - } else { - flag.pool, err = finder.ResourcePool(context.TODO(), flag.name) - } - - return flag.pool, err -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/govc/flags/search.go juju-core-2.0.2/src/github.com/juju/govmomi/govc/flags/search.go --- juju-core-2.0.0/src/github.com/juju/govmomi/govc/flags/search.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/govc/flags/search.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,285 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package flags - -import ( - "errors" - "flag" - "fmt" - "strings" - - "github.com/juju/govmomi/object" - "github.com/juju/govmomi/vim25" - "golang.org/x/net/context" -) - -const ( - SearchVirtualMachines = iota + 1 - SearchHosts -) - -type SearchFlag struct { - *ClientFlag - *DatacenterFlag - - t int - entity string - - byDatastorePath string - byDNSName string - byInventoryPath string - byIP string - byUUID string - - isset bool -} - -func NewSearchFlag(t int) *SearchFlag { - s := SearchFlag{ - t: t, - } - - switch t { - case SearchVirtualMachines: - s.entity = "VM" - case SearchHosts: - s.entity = "host" - default: - panic("invalid search type") - } - - return &s -} - -func (flag *SearchFlag) Register(fs *flag.FlagSet) { - register := func(v *string, f string, d string) { - f = fmt.Sprintf("%s.%s", strings.ToLower(flag.entity), f) - d = fmt.Sprintf(d, flag.entity) - fs.StringVar(v, f, "", d) - } - - switch flag.t { - case SearchVirtualMachines: - register(&flag.byDatastorePath, "path", "Find %s by path to .vmx file") - } - - switch flag.t { - case SearchVirtualMachines, SearchHosts: - register(&flag.byDNSName, "dns", "Find %s by FQDN") - register(&flag.byIP, "ip", "Find %s by IP address") - register(&flag.byUUID, "uuid", "Find %s by instance UUID") - } - - register(&flag.byInventoryPath, "ipath", "Find %s by inventory path") -} - -func (flag *SearchFlag) Process() error { - flags := []string{ - flag.byDatastorePath, - flag.byDNSName, - flag.byInventoryPath, - flag.byIP, - flag.byUUID, - } - - flag.isset = false - for _, f := range flags { - if f != "" { - if flag.isset { - return errors.New("cannot use more than one search flag") - } - flag.isset = true - } - } - - return nil -} - -func (flag *SearchFlag) IsSet() bool { - return flag.isset -} - -func (flag *SearchFlag) searchIndex(c *vim25.Client) *object.SearchIndex { - return object.NewSearchIndex(c) -} - -func (flag *SearchFlag) searchByDatastorePath(c *vim25.Client, dc *object.Datacenter) (object.Reference, error) { - switch flag.t { - case SearchVirtualMachines: - return flag.searchIndex(c).FindByDatastorePath(context.TODO(), dc, flag.byDatastorePath) - default: - panic("unsupported type") - } -} - -func (flag *SearchFlag) searchByDNSName(c *vim25.Client, dc *object.Datacenter) (object.Reference, error) { - switch flag.t { - case SearchVirtualMachines: - return flag.searchIndex(c).FindByDnsName(context.TODO(), dc, flag.byDNSName, true) - case SearchHosts: - return flag.searchIndex(c).FindByDnsName(context.TODO(), dc, flag.byDNSName, false) - default: - panic("unsupported type") - } -} - -func (flag *SearchFlag) searchByInventoryPath(c *vim25.Client, dc *object.Datacenter) (object.Reference, error) { - // TODO(PN): The datacenter flag should not be set because it is ignored. - return flag.searchIndex(c).FindByInventoryPath(context.TODO(), flag.byInventoryPath) -} - -func (flag *SearchFlag) searchByIP(c *vim25.Client, dc *object.Datacenter) (object.Reference, error) { - switch flag.t { - case SearchVirtualMachines: - return flag.searchIndex(c).FindByIp(context.TODO(), dc, flag.byIP, true) - case SearchHosts: - return flag.searchIndex(c).FindByIp(context.TODO(), dc, flag.byIP, false) - default: - panic("unsupported type") - } -} - -func (flag *SearchFlag) searchByUUID(c *vim25.Client, dc *object.Datacenter) (object.Reference, error) { - switch flag.t { - case SearchVirtualMachines: - return flag.searchIndex(c).FindByUuid(context.TODO(), dc, flag.byUUID, true) - case SearchHosts: - return flag.searchIndex(c).FindByUuid(context.TODO(), dc, flag.byUUID, false) - default: - panic("unsupported type") - } -} - -func (flag *SearchFlag) search() (object.Reference, error) { - var ref object.Reference - var err error - - c, err := flag.Client() - if err != nil { - return nil, err - } - - dc, err := flag.Datacenter() - if err != nil { - return nil, err - } - - switch { - case flag.byDatastorePath != "": - ref, err = flag.searchByDatastorePath(c, dc) - case flag.byDNSName != "": - ref, err = flag.searchByDNSName(c, dc) - case flag.byInventoryPath != "": - ref, err = flag.searchByInventoryPath(c, dc) - case flag.byIP != "": - ref, err = flag.searchByIP(c, dc) - case flag.byUUID != "": - ref, err = flag.searchByUUID(c, dc) - default: - err = errors.New("no search flag specified") - } - - if err != nil { - return nil, err - } - - if ref == nil { - return nil, fmt.Errorf("no such %s", flag.entity) - } - - return ref, nil -} - -func (flag *SearchFlag) VirtualMachine() (*object.VirtualMachine, error) { - ref, err := flag.search() - if err != nil { - return nil, err - } - - vm, ok := ref.(*object.VirtualMachine) - if !ok { - return nil, fmt.Errorf("expected VirtualMachine entity, got %s", ref.Reference().Type) - } - - return vm, nil -} - -func (flag *SearchFlag) VirtualMachines(args []string) ([]*object.VirtualMachine, error) { - var out []*object.VirtualMachine - - if flag.IsSet() { - vm, err := flag.VirtualMachine() - if err != nil { - return nil, err - } - - out = append(out, vm) - return out, nil - } - - // List virtual machines - if len(args) == 0 { - return nil, errors.New("no argument") - } - - finder, err := flag.Finder() - if err != nil { - return nil, err - } - - return finder.VirtualMachineList(context.TODO(), args...) -} - -func (flag *SearchFlag) HostSystem() (*object.HostSystem, error) { - ref, err := flag.search() - if err != nil { - return nil, err - } - - host, ok := ref.(*object.HostSystem) - if !ok { - return nil, fmt.Errorf("expected HostSystem entity, got %s", ref.Reference().Type) - } - - return host, nil -} - -func (flag *SearchFlag) HostSystems(args []string) ([]*object.HostSystem, error) { - var out []*object.HostSystem - - if flag.IsSet() { - host, err := flag.HostSystem() - if err != nil { - return nil, err - } - - out = append(out, host) - return out, nil - } - - // List host system - if len(args) == 0 { - return nil, errors.New("no argument") - } - - finder, err := flag.Finder() - if err != nil { - return nil, err - } - - return finder.HostSystemList(context.TODO(), args...) -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/govc/flags/version.go juju-core-2.0.2/src/github.com/juju/govmomi/govc/flags/version.go --- juju-core-2.0.0/src/github.com/juju/govmomi/govc/flags/version.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/govc/flags/version.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,61 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package flags - -import ( - "strconv" - "strings" -) - -type version []int - -func ParseVersion(s string) (version, error) { - v := make(version, 0) - ps := strings.Split(s, ".") - for _, p := range ps { - i, err := strconv.Atoi(p) - if err != nil { - return nil, err - } - - v = append(v, i) - } - - return v, nil -} - -func (v version) Lte(u version) bool { - lv := len(v) - lu := len(u) - - for i := 0; i < lv; i++ { - // Everything up to here has been equal and v has more elements than u. - if i >= lu { - return false - } - - // Move to next digit if equal. - if v[i] == u[i] { - continue - } - - return v[i] < u[i] - } - - // Equal. - return true -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/govc/flags/version_test.go juju-core-2.0.2/src/github.com/juju/govmomi/govc/flags/version_test.go --- juju-core-2.0.0/src/github.com/juju/govmomi/govc/flags/version_test.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/govc/flags/version_test.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,63 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package flags - -import "testing" - -func TestParseVersion(t *testing.T) { - var v version - var err error - - v, err = ParseVersion("5.5.5.5") - if err != nil { - t.Error(err) - } - - if len(v) != 4 { - t.Errorf("Expected %d elements, got %d", 4, len(v)) - } - - for i := 0; i < len(v); i++ { - if v[i] != 5 { - t.Errorf("Expected %d, got %d", 5, v[i]) - } - } -} - -func TestLte(t *testing.T) { - v1, err := ParseVersion("5.5") - if err != nil { - panic(err) - } - - v2, err := ParseVersion("5.6") - if err != nil { - panic(err) - } - - if !v1.Lte(v1) { - t.Errorf("Expected 5.5 <= 5.5") - } - - if !v1.Lte(v2) { - t.Errorf("Expected 5.5 <= 5.6") - } - - if v2.Lte(v1) { - t.Errorf("Expected not 5.6 <= 5.5") - } -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/govc/flags/virtual_machine.go juju-core-2.0.2/src/github.com/juju/govmomi/govc/flags/virtual_machine.go --- juju-core-2.0.0/src/github.com/juju/govmomi/govc/flags/virtual_machine.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/govc/flags/virtual_machine.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,82 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package flags - -import ( - "flag" - "fmt" - "os" - "sync" - - "github.com/juju/govmomi/object" - "golang.org/x/net/context" -) - -type VirtualMachineFlag struct { - *ClientFlag - *DatacenterFlag - *SearchFlag - - register sync.Once - name string - vm *object.VirtualMachine -} - -func (flag *VirtualMachineFlag) Register(f *flag.FlagSet) { - flag.SearchFlag = NewSearchFlag(SearchVirtualMachines) - - flag.register.Do(func() { - env := "GOVC_VM" - value := os.Getenv(env) - usage := fmt.Sprintf("Virtual machine [%s]", env) - f.StringVar(&flag.name, "vm", value, usage) - }) -} - -func (flag *VirtualMachineFlag) Process() error { - return nil -} - -func (flag *VirtualMachineFlag) VirtualMachine() (*object.VirtualMachine, error) { - if flag.vm != nil { - return flag.vm, nil - } - - // Use search flags if specified. - if flag.SearchFlag.IsSet() { - vm, err := flag.SearchFlag.VirtualMachine() - if err != nil { - return nil, err - } - - flag.vm = vm - return flag.vm, nil - } - - // Never look for a default virtual machine. - if flag.name == "" { - return nil, nil - } - - finder, err := flag.Finder() - if err != nil { - return nil, err - } - - flag.vm, err = finder.VirtualMachine(context.TODO(), flag.name) - return flag.vm, err -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/govc/.gitignore juju-core-2.0.2/src/github.com/juju/govmomi/govc/.gitignore --- juju-core-2.0.0/src/github.com/juju/govmomi/govc/.gitignore 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/govc/.gitignore 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -/govc* diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/govc/host/autostart/add.go juju-core-2.0.2/src/github.com/juju/govmomi/govc/host/autostart/add.go --- juju-core-2.0.0/src/github.com/juju/govmomi/govc/host/autostart/add.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/govc/host/autostart/add.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,53 +0,0 @@ -/* -Copyright (c) 2015 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package autostart - -import ( - "flag" - - "github.com/juju/govmomi/govc/cli" - "github.com/juju/govmomi/vim25/types" -) - -type add struct { - *AutostartFlag -} - -func init() { - cli.Register("host.autostart.add", &add{}) -} - -func (cmd *add) Register(f *flag.FlagSet) {} - -func (cmd *add) Process() error { return nil } - -func (cmd *add) Usage() string { - return "VM..." -} - -func (cmd *add) Run(f *flag.FlagSet) error { - var powerInfo = types.AutoStartPowerInfo{ - StartAction: "powerOn", - StartDelay: -1, - StartOrder: -1, - StopAction: "systemDefault", - StopDelay: -1, - WaitForHeartbeat: types.AutoStartWaitHeartbeatSettingSystemDefault, - } - - return cmd.ReconfigureVMs(f.Args(), powerInfo) -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/govc/host/autostart/autostart.go juju-core-2.0.2/src/github.com/juju/govmomi/govc/host/autostart/autostart.go --- juju-core-2.0.0/src/github.com/juju/govmomi/govc/host/autostart/autostart.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/govc/host/autostart/autostart.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,140 +0,0 @@ -/* -Copyright (c) 2015 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package autostart - -import ( - "errors" - "flag" - - "github.com/juju/govmomi/govc/flags" - "github.com/juju/govmomi/object" - "github.com/juju/govmomi/vim25/methods" - "github.com/juju/govmomi/vim25/mo" - "github.com/juju/govmomi/vim25/types" - "golang.org/x/net/context" -) - -type AutostartFlag struct { - *flags.ClientFlag - *flags.DatacenterFlag - *flags.HostSystemFlag -} - -func (f *AutostartFlag) Register(fs *flag.FlagSet) {} - -func (f *AutostartFlag) Process() error { return nil } - -// VirtualMachines returns list of virtual machine objects based on the -// arguments specified on the command line. This helper is defined in -// flags.SearchFlag as well, but that pulls in other virtual machine flags that -// are not relevant here. -func (f *AutostartFlag) VirtualMachines(args []string) ([]*object.VirtualMachine, error) { - if len(args) == 0 { - return nil, errors.New("no argument") - } - - finder, err := f.Finder() - if err != nil { - return nil, err - } - - return finder.VirtualMachineList(context.TODO(), args...) -} - -func (f *AutostartFlag) HostAutoStartManager() (*mo.HostAutoStartManager, error) { - h, err := f.HostSystem() - if err != nil { - return nil, err - } - - var mhs mo.HostSystem - err = h.Properties(context.TODO(), h.Reference(), []string{"configManager.autoStartManager"}, &mhs) - if err != nil { - return nil, err - } - - var mhas mo.HostAutoStartManager - err = h.Properties(context.TODO(), *mhs.ConfigManager.AutoStartManager, nil, &mhas) - if err != nil { - return nil, err - } - - return &mhas, nil -} - -func (f *AutostartFlag) ReconfigureDefaults(template types.AutoStartDefaults) error { - c, err := f.Client() - if err != nil { - return err - } - - mhas, err := f.HostAutoStartManager() - if err != nil { - return err - } - - req := types.ReconfigureAutostart{ - This: mhas.Reference(), - Spec: types.HostAutoStartManagerConfig{ - Defaults: &template, - }, - } - - _, err = methods.ReconfigureAutostart(context.TODO(), c, &req) - if err != nil { - return err - } - - return nil -} - -func (f *AutostartFlag) ReconfigureVMs(args []string, template types.AutoStartPowerInfo) error { - c, err := f.Client() - if err != nil { - return err - } - - mhas, err := f.HostAutoStartManager() - if err != nil { - return err - } - - req := types.ReconfigureAutostart{ - This: mhas.Reference(), - Spec: types.HostAutoStartManagerConfig{ - PowerInfo: make([]types.AutoStartPowerInfo, 0), - }, - } - - vms, err := f.VirtualMachines(args) - if err != nil { - return err - } - - for _, vm := range vms { - pi := template - pi.Key = vm.Reference() - req.Spec.PowerInfo = append(req.Spec.PowerInfo, pi) - } - - _, err = methods.ReconfigureAutostart(context.TODO(), c, &req) - if err != nil { - return err - } - - return nil -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/govc/host/autostart/configure.go juju-core-2.0.2/src/github.com/juju/govmomi/govc/host/autostart/configure.go --- juju-core-2.0.0/src/github.com/juju/govmomi/govc/host/autostart/configure.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/govc/host/autostart/configure.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,59 +0,0 @@ -/* -Copyright (c) 2015 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package autostart - -import ( - "flag" - - "github.com/juju/govmomi/govc/cli" - "github.com/juju/govmomi/vim25/types" -) - -type configure struct { - *AutostartFlag - - defaults types.AutoStartDefaults -} - -func init() { - cli.Register("host.autostart.configure", &configure{}) -} - -func (cmd *configure) Register(f *flag.FlagSet) { - cmd.defaults.Enabled = types.NewBool(false) - f.BoolVar(cmd.defaults.Enabled, "enabled", false, "") - - f.IntVar(&cmd.defaults.StartDelay, "start-delay", 0, "") - f.StringVar(&cmd.defaults.StopAction, "stop-action", "", "") - f.IntVar(&cmd.defaults.StopDelay, "stop-delay", 0, "") - - cmd.defaults.WaitForHeartbeat = types.NewBool(false) - f.BoolVar(cmd.defaults.WaitForHeartbeat, "wait-for-heartbeat", false, "") -} - -func (cmd *configure) Process() error { return nil } - -func (cmd *configure) Usage() string { - return "" -} - -func (cmd *configure) Run(f *flag.FlagSet) error { - // Note: this command cannot DISABLE autostart because the "Enabled" field is - // marked "omitempty", which means that it is not included when it is false. - // Also see: https://github.com/vmware/govmomi/issues/240 - return cmd.ReconfigureDefaults(cmd.defaults) -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/govc/host/autostart/info.go juju-core-2.0.2/src/github.com/juju/govmomi/govc/host/autostart/info.go --- juju-core-2.0.0/src/github.com/juju/govmomi/govc/host/autostart/info.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/govc/host/autostart/info.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,129 +0,0 @@ -/* -Copyright (c) 2015 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package autostart - -import ( - "encoding/json" - "flag" - "fmt" - "io" - "os" - "text/tabwriter" - - "github.com/juju/govmomi/govc/cli" - "github.com/juju/govmomi/govc/flags" - "github.com/juju/govmomi/vim25" - "github.com/juju/govmomi/vim25/mo" - "golang.org/x/net/context" -) - -type info struct { - *AutostartFlag - - *flags.OutputFlag -} - -func init() { - cli.Register("host.autostart.info", &info{}) -} - -func (cmd *info) Register(f *flag.FlagSet) {} - -func (cmd *info) Process() error { return nil } - -func (cmd *info) Usage() string { - return "" -} - -func (cmd *info) Run(f *flag.FlagSet) error { - client, err := cmd.Client() - if err != nil { - return err - } - - mhas, err := cmd.HostAutoStartManager() - if err != nil { - return err - } - - return cmd.WriteResult(&infoResult{client, mhas}) -} - -type infoResult struct { - client *vim25.Client - mhas *mo.HostAutoStartManager -} - -func (r *infoResult) MarshalJSON() ([]byte, error) { - return json.Marshal(r.mhas) -} - -// vmPaths resolves the paths for the VMs in the result. -func (r *infoResult) vmPaths() (map[string]string, error) { - paths := make(map[string]string) - for _, info := range r.mhas.Config.PowerInfo { - mes, err := mo.Ancestors(context.TODO(), r.client, r.client.ServiceContent.PropertyCollector, info.Key) - if err != nil { - return nil, err - } - - path := "" - for _, me := range mes { - // Skip root entity in building inventory path. - if me.Parent == nil { - continue - } - path += "/" + me.Name - } - - paths[info.Key.Value] = path - } - - return paths, nil -} - -func (r *infoResult) Write(w io.Writer) error { - paths, err := r.vmPaths() - if err != nil { - return err - } - - tw := tabwriter.NewWriter(os.Stdout, 2, 0, 2, ' ', 0) - - fmt.Fprintf(tw, "VM") - fmt.Fprintf(tw, "\tStartAction") - fmt.Fprintf(tw, "\tStartDelay") - fmt.Fprintf(tw, "\tStartOrder") - fmt.Fprintf(tw, "\tStopAction") - fmt.Fprintf(tw, "\tStopDelay") - fmt.Fprintf(tw, "\tWaitForHeartbeat") - fmt.Fprintf(tw, "\n") - - for _, info := range r.mhas.Config.PowerInfo { - fmt.Fprintf(tw, "%s", paths[info.Key.Value]) - fmt.Fprintf(tw, "\t%s", info.StartAction) - fmt.Fprintf(tw, "\t%d", info.StartDelay) - fmt.Fprintf(tw, "\t%d", info.StartOrder) - fmt.Fprintf(tw, "\t%s", info.StopAction) - fmt.Fprintf(tw, "\t%d", info.StopDelay) - fmt.Fprintf(tw, "\t%s", info.WaitForHeartbeat) - fmt.Fprintf(tw, "\n") - } - - _ = tw.Flush() - return nil -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/govc/host/autostart/remove.go juju-core-2.0.2/src/github.com/juju/govmomi/govc/host/autostart/remove.go --- juju-core-2.0.0/src/github.com/juju/govmomi/govc/host/autostart/remove.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/govc/host/autostart/remove.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,53 +0,0 @@ -/* -Copyright (c) 2015 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package autostart - -import ( - "flag" - - "github.com/juju/govmomi/govc/cli" - "github.com/juju/govmomi/vim25/types" -) - -type remove struct { - *AutostartFlag -} - -func init() { - cli.Register("host.autostart.remove", &remove{}) -} - -func (cmd *remove) Register(f *flag.FlagSet) {} - -func (cmd *remove) Process() error { return nil } - -func (cmd *remove) Usage() string { - return "VM..." -} - -func (cmd *remove) Run(f *flag.FlagSet) error { - var powerInfo = types.AutoStartPowerInfo{ - StartAction: "none", - StartDelay: -1, - StartOrder: -1, - StopAction: "none", - StopDelay: -1, - WaitForHeartbeat: types.AutoStartWaitHeartbeatSettingSystemDefault, - } - - return cmd.ReconfigureVMs(f.Args(), powerInfo) -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/govc/host/esxcli/command.go juju-core-2.0.2/src/github.com/juju/govmomi/govc/host/esxcli/command.go --- juju-core-2.0.0/src/github.com/juju/govmomi/govc/host/esxcli/command.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/govc/host/esxcli/command.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,149 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package esxcli - -import ( - "flag" - "fmt" - "strings" - - "github.com/juju/govmomi/vim25/types" -) - -type Command struct { - name []string - args []string -} - -type CommandInfoItem struct { - Name string `xml:"name"` - DisplayName string `xml:"displayName"` - Help string `xml:"help"` -} - -type CommandInfoParam struct { - CommandInfoItem - Aliases []string `xml:"aliases"` - Flag bool `xml:"flag"` -} - -type CommandInfoHint struct { - Key string `xml:"key"` - Value string `xml:"value"` -} - -type CommandInfoHints []CommandInfoHint - -type CommandInfoMethod struct { - CommandInfoItem - Param []CommandInfoParam `xml:"param"` - Hints CommandInfoHints `xml:"hints"` -} - -type CommandInfo struct { - CommandInfoItem - Method []*CommandInfoMethod `xml:"method"` -} - -func NewCommand(args []string) *Command { - c := &Command{} - - for i, arg := range args { - if strings.HasPrefix(arg, "-") { - c.args = args[i:] - break - } else { - c.name = append(c.name, arg) - } - } - - return c -} - -func (c *Command) Namespace() string { - return strings.Join(c.name[:len(c.name)-1], ".") -} - -func (c *Command) Name() string { - return c.name[len(c.name)-1] -} - -func (c *Command) Method() string { - return "vim.EsxCLI." + strings.Join(c.name, ".") -} - -func (c *Command) Moid() string { - return "ha-cli-handler-" + strings.Join(c.name[:len(c.name)-1], "-") -} - -// Parse generates a flag.FlagSet based on the given []CommandInfoParam and -// returns arguments for use with methods.ExecuteSoap -func (c *Command) Parse(params []CommandInfoParam) ([]types.ReflectManagedMethodExecuterSoapArgument, error) { - flags := flag.NewFlagSet(strings.Join(c.name, " "), flag.ExitOnError) - vals := make([]string, len(params)) - - for i, p := range params { - v := &vals[i] - for _, a := range p.Aliases { - a = strings.TrimPrefix(a[1:], "-") - flags.StringVar(v, a, "", p.Help) - } - } - - err := flags.Parse(c.args) - if err != nil { - return nil, err - } - - args := []types.ReflectManagedMethodExecuterSoapArgument{} - - for i, p := range params { - if vals[i] == "" { - continue - } - args = append(args, c.Argument(p.Name, vals[i])) - } - - return args, nil -} - -func (c *Command) Argument(name string, val string) types.ReflectManagedMethodExecuterSoapArgument { - return types.ReflectManagedMethodExecuterSoapArgument{ - Name: name, - Val: fmt.Sprintf("<%s>%s", name, val, name), - } -} - -func (h CommandInfoHints) Formatter() string { - for _, hint := range h { - if hint.Key == "formatter" { - return hint.Value - } - } - - return "simple" -} - -func (h CommandInfoHints) Fields() []string { - for _, hint := range h { - if strings.HasPrefix(hint.Key, "fields:") { - return strings.Split(hint.Value, ",") - } - } - - return nil -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/govc/host/esxcli/command_test.go juju-core-2.0.2/src/github.com/juju/govmomi/govc/host/esxcli/command_test.go --- juju-core-2.0.0/src/github.com/juju/govmomi/govc/host/esxcli/command_test.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/govc/host/esxcli/command_test.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,124 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package esxcli - -import ( - "reflect" - "testing" - - "github.com/juju/govmomi/vim25/types" -) - -func TestSystemSettingsAdvancedSetCommand(t *testing.T) { - c := NewCommand([]string{"system", "settings", "advanced", "set", "-o", "/Net/GuestIPHack", "-i", "1"}) - - tests := []struct { - f func() string - expect string - }{ - {c.Name, "set"}, - {c.Namespace, "system.settings.advanced"}, - {c.Method, "vim.EsxCLI.system.settings.advanced.set"}, - {c.Moid, "ha-cli-handler-system-settings-advanced"}, - } - - for _, test := range tests { - actual := test.f() - if actual != test.expect { - t.Errorf("%s != %s", actual, test.expect) - } - } - - params := []CommandInfoParam{ - { - CommandInfoItem: CommandInfoItem{Name: "default", DisplayName: "default", Help: "Reset the option to its default value."}, - Aliases: []string{"-d", "--default"}, - Flag: true, - }, - { - CommandInfoItem: CommandInfoItem{Name: "intvalue", DisplayName: "int-value", Help: "If the option is an integer value use this option."}, - Aliases: []string{"-i", "--int-value"}, - Flag: false, - }, - { - CommandInfoItem: CommandInfoItem{Name: "option", DisplayName: "option", Help: "The name of the option to set the value of. Example: \"/Misc/HostName\""}, - Aliases: []string{"-o", "--option"}, - Flag: false, - }, - { - CommandInfoItem: CommandInfoItem{Name: "stringvalue", DisplayName: "string-value", Help: "If the option is a string use this option."}, - Aliases: []string{"-s", "--string-value"}, - Flag: false, - }, - } - - args, err := c.Parse(params) - if err != nil { - t.Fatal(err) - } - - expect := []types.ReflectManagedMethodExecuterSoapArgument{ - { - DynamicData: types.DynamicData{}, - Name: "intvalue", - Val: "1", - }, - { - DynamicData: types.DynamicData{}, - Name: "option", - Val: "", - }, - } - - if !reflect.DeepEqual(args, expect) { - t.Errorf("%s != %s", args, expect) - } -} - -func TestNetworkVmListCommand(t *testing.T) { - c := NewCommand([]string{"network", "vm", "list"}) - - tests := []struct { - f func() string - expect string - }{ - {c.Name, "list"}, - {c.Namespace, "network.vm"}, - {c.Method, "vim.EsxCLI.network.vm.list"}, - {c.Moid, "ha-cli-handler-network-vm"}, - } - - for _, test := range tests { - actual := test.f() - if actual != test.expect { - t.Errorf("%s != %s", actual, test.expect) - } - } - - var params []CommandInfoParam - - args, err := c.Parse(params) - if err != nil { - t.Fatal(err) - } - - expect := []types.ReflectManagedMethodExecuterSoapArgument{} - - if !reflect.DeepEqual(args, expect) { - t.Errorf("%s != %s", args, expect) - } -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/govc/host/esxcli/esxcli.go juju-core-2.0.2/src/github.com/juju/govmomi/govc/host/esxcli/esxcli.go --- juju-core-2.0.0/src/github.com/juju/govmomi/govc/host/esxcli/esxcli.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/govc/host/esxcli/esxcli.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,130 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package esxcli - -import ( - "flag" - "fmt" - "os" - "sort" - "strings" - "text/tabwriter" - - "github.com/juju/govmomi/govc/cli" - "github.com/juju/govmomi/govc/flags" -) - -type esxcli struct { - *flags.HostSystemFlag -} - -func init() { - cli.Register("host.esxcli", &esxcli{}) -} - -func (cmd *esxcli) Register(f *flag.FlagSet) {} - -func (cmd *esxcli) Process() error { return nil } - -func (cmd *esxcli) Run(f *flag.FlagSet) error { - c, err := cmd.Client() - if err != nil { - return nil - } - - host, err := cmd.HostSystem() - if err != nil { - return err - } - - e, err := NewExecutor(c, host) - if err != nil { - return err - } - - res, err := e.Run(f.Args()) - if err != nil { - return err - } - - if len(res.Values) == 0 { - return nil - } - - // TODO: OutputFlag / format options - switch res.Info.Hints.Formatter() { - case "table": - cmd.formatTable(res) - default: - cmd.formatSimple(res) - } - - return nil -} - -func (cmd *esxcli) formatSimple(res *Response) { - var keys []string - for key := range res.Values[0] { - keys = append(keys, key) - } - sort.Strings(keys) - - tw := tabwriter.NewWriter(os.Stdout, 2, 0, 2, ' ', 0) - - for i, rv := range res.Values { - if i > 0 { - fmt.Fprintln(tw) - _ = tw.Flush() - } - for _, key := range keys { - fmt.Fprintf(tw, "%s:\t%s\n", key, strings.Join(rv[key], ", ")) - } - } - - _ = tw.Flush() -} - -func (cmd *esxcli) formatTable(res *Response) { - fields := res.Info.Hints.Fields() - - tw := tabwriter.NewWriter(os.Stdout, len(fields), 0, 2, ' ', 0) - - var hr []string - for _, name := range fields { - hr = append(hr, strings.Repeat("-", len(name))) - } - - fmt.Fprintln(tw, strings.Join(fields, "\t")) - fmt.Fprintln(tw, strings.Join(hr, "\t")) - - for _, vals := range res.Values { - var row []string - - for _, name := range fields { - key := strings.Replace(name, " ", "", -1) - if val, ok := vals[key]; ok { - row = append(row, strings.Join(val, ", ")) - } else { - row = append(row, "") - } - } - - fmt.Fprintln(tw, strings.Join(row, "\t")) - } - - _ = tw.Flush() -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/govc/host/esxcli/executor.go juju-core-2.0.2/src/github.com/juju/govmomi/govc/host/esxcli/executor.go --- juju-core-2.0.0/src/github.com/juju/govmomi/govc/host/esxcli/executor.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/govc/host/esxcli/executor.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,166 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package esxcli - -import ( - "errors" - "fmt" - - "github.com/juju/govmomi/object" - "github.com/juju/govmomi/vim25" - "github.com/juju/govmomi/vim25/methods" - "github.com/juju/govmomi/vim25/types" - "github.com/juju/govmomi/vim25/xml" - "golang.org/x/net/context" -) - -type Executor struct { - c *vim25.Client - host *object.HostSystem - mme *types.ReflectManagedMethodExecuter - dtm *types.InternalDynamicTypeManager - info map[string]*CommandInfo -} - -func NewExecutor(c *vim25.Client, host *object.HostSystem) (*Executor, error) { - e := &Executor{ - c: c, - host: host, - info: make(map[string]*CommandInfo), - } - - { - req := types.RetrieveManagedMethodExecuter{ - This: host.Reference(), - } - - res, err := methods.RetrieveManagedMethodExecuter(context.TODO(), c, &req) - if err != nil { - return nil, err - } - - e.mme = res.Returnval - } - - { - req := types.RetrieveDynamicTypeManager{ - This: host.Reference(), - } - - res, err := methods.RetrieveDynamicTypeManager(context.TODO(), c, &req) - if err != nil { - return nil, err - } - - e.dtm = res.Returnval - } - - return e, nil -} - -func (e *Executor) CommandInfo(c *Command) (*CommandInfoMethod, error) { - ns := c.Namespace() - var info *CommandInfo - var ok bool - - if info, ok = e.info[ns]; !ok { - req := types.ExecuteSoap{ - Moid: "ha-dynamic-type-manager-local-cli-cliinfo", - Method: "vim.CLIInfo.FetchCLIInfo", - Argument: []types.ReflectManagedMethodExecuterSoapArgument{ - c.Argument("typeName", "vim.EsxCLI."+ns), - }, - } - - info = new(CommandInfo) - if err := e.Execute(&req, info); err != nil { - return nil, err - } - - e.info[ns] = info - } - - name := c.Name() - for _, method := range info.Method { - if method.Name == name { - return method, nil - } - } - - return nil, fmt.Errorf("method '%s' not found in name space '%s'", name, c.Namespace()) -} - -func (e *Executor) NewRequest(args []string) (*types.ExecuteSoap, *CommandInfoMethod, error) { - c := NewCommand(args) - - info, err := e.CommandInfo(c) - if err != nil { - return nil, nil, err - } - - sargs, err := c.Parse(info.Param) - if err != nil { - return nil, nil, err - } - - sreq := types.ExecuteSoap{ - Moid: c.Moid(), - Method: c.Method(), - Argument: sargs, - } - - return &sreq, info, nil -} - -func (e *Executor) Execute(req *types.ExecuteSoap, res interface{}) error { - req.This = e.mme.ManagedObjectReference - req.Version = "urn:vim25/5.0" - - x, err := methods.ExecuteSoap(context.TODO(), e.c, req) - if err != nil { - return err - } - - if x.Returnval != nil { - if x.Returnval.Fault != nil { - return errors.New(x.Returnval.Fault.FaultMsg) - } - - if err := xml.Unmarshal([]byte(x.Returnval.Response), res); err != nil { - return err - } - } - - return nil -} - -func (e *Executor) Run(args []string) (*Response, error) { - req, info, err := e.NewRequest(args) - if err != nil { - return nil, err - } - - res := &Response{ - Info: info, - } - - if err := e.Execute(req, res); err != nil { - return nil, err - } - - return res, nil -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/govc/host/esxcli/fixtures/network_vm_list.xml juju-core-2.0.2/src/github.com/juju/govmomi/govc/host/esxcli/fixtures/network_vm_list.xml --- juju-core-2.0.0/src/github.com/juju/govmomi/govc/host/esxcli/fixtures/network_vm_list.xml 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/govc/host/esxcli/fixtures/network_vm_list.xml 1970-01-01 00:00:00.000000000 +0000 @@ -1,15 +0,0 @@ - - - foo - VM Network - dougm - 2 - 98842 - - - bar - VM Network - 1 - 236235 - - diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/govc/host/esxcli/fixtures/network_vm_port_list.xml juju-core-2.0.2/src/github.com/juju/govmomi/govc/host/esxcli/fixtures/network_vm_port_list.xml --- juju-core-2.0.0/src/github.com/juju/govmomi/govc/host/esxcli/fixtures/network_vm_port_list.xml 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/govc/host/esxcli/fixtures/network_vm_port_list.xml 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ - - - - 192.168.247.149 - 00:0c:29:12:b2:cf - 33554438 - VM Network - vmnic0 - 33554434 - vSwitch0 - - diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/govc/host/esxcli/fixtures/system_hostname_get.xml juju-core-2.0.2/src/github.com/juju/govmomi/govc/host/esxcli/fixtures/system_hostname_get.xml --- juju-core-2.0.0/src/github.com/juju/govmomi/govc/host/esxcli/fixtures/system_hostname_get.xml 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/govc/host/esxcli/fixtures/system_hostname_get.xml 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ - - localdomain - esxbox.localdomain - esxbox - diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/govc/host/esxcli/guest_info.go juju-core-2.0.2/src/github.com/juju/govmomi/govc/host/esxcli/guest_info.go --- juju-core-2.0.0/src/github.com/juju/govmomi/govc/host/esxcli/guest_info.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/govc/host/esxcli/guest_info.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,116 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package esxcli - -import ( - "strings" - - "github.com/juju/govmomi/object" - "github.com/juju/govmomi/property" - "github.com/juju/govmomi/vim25" - "github.com/juju/govmomi/vim25/mo" - "github.com/juju/govmomi/vim25/types" - "golang.org/x/net/context" -) - -type hostInfo struct { - *Executor - wids map[string]string -} - -type GuestInfo struct { - c *vim25.Client - hosts map[string]*hostInfo -} - -func NewGuestInfo(c *vim25.Client) *GuestInfo { - return &GuestInfo{ - c: c, - hosts: make(map[string]*hostInfo), - } -} - -func (g *GuestInfo) hostInfo(ref *types.ManagedObjectReference) (*hostInfo, error) { - // cache exectuor and uuid -> worldid map - if h, ok := g.hosts[ref.Value]; ok { - return h, nil - } - - host := object.NewHostSystem(g.c, *ref) - - e, err := NewExecutor(g.c, host) - if err != nil { - return nil, err - } - - res, err := e.Run([]string{"vm", "process", "list"}) - if err != nil { - return nil, err - } - - ids := make(map[string]string, len(res.Values)) - - for _, process := range res.Values { - // Normalize uuid, esxcli and mo.VirtualMachine have different formats - uuid := strings.Replace(process["UUID"][0], " ", "", -1) - uuid = strings.Replace(uuid, "-", "", -1) - - ids[uuid] = process["WorldID"][0] - } - - h := &hostInfo{e, ids} - g.hosts[ref.Value] = h - - return h, nil -} - -// IpAddress attempts to find the guest IP address using esxcli. -// ESX hosts must be configured with the /Net/GuestIPHack enabled. -// For example: -// $ govc host.esxcli -- system settings advanced set -o /Net/GuestIPHack -i 1 -func (g *GuestInfo) IpAddress(vm *object.VirtualMachine) (string, error) { - var mvm mo.VirtualMachine - - pc := property.DefaultCollector(g.c) - err := pc.RetrieveOne(context.TODO(), vm.Reference(), []string{"runtime.host", "config.uuid"}, &mvm) - if err != nil { - return "", err - } - - h, err := g.hostInfo(mvm.Runtime.Host) - if err != nil { - return "", err - } - - // Normalize uuid, esxcli and mo.VirtualMachine have different formats - uuid := strings.Replace(mvm.Config.Uuid, "-", "", -1) - - if wid, ok := h.wids[uuid]; ok { - res, err := h.Run([]string{"network", "vm", "port", "list", "--world-id", wid}) - if err != nil { - return "", err - } - - if len(res.Values) == 1 { - if ip, ok := res.Values[0]["IPAddress"]; ok { - return ip[0], nil - } - } - } - - return "", nil -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/govc/host/esxcli/response.go juju-core-2.0.2/src/github.com/juju/govmomi/govc/host/esxcli/response.go --- juju-core-2.0.0/src/github.com/juju/govmomi/govc/host/esxcli/response.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/govc/host/esxcli/response.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,82 +0,0 @@ -package esxcli - -import ( - "io" - - "github.com/juju/govmomi/vim25/xml" -) - -type Values map[string][]string - -type Response struct { - Info *CommandInfoMethod - Values []Values -} - -func (v Values) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { - for { - t, err := d.Token() - if err != nil { - if err == io.EOF { - return nil - } - return err - } - - if s, ok := t.(xml.StartElement); ok { - t, err = d.Token() - if err != nil { - return err - } - - key := s.Name.Local - var val string - if c, ok := t.(xml.CharData); ok { - val = string(c) - } - v[key] = append(v[key], val) - } - } -} - -func (r *Response) Type(start xml.StartElement) string { - for _, a := range start.Attr { - if a.Name.Local == "type" { - return a.Value - } - } - return "" -} - -func (r *Response) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { - stype := r.Type(start) - - if stype != "ArrayOfDataObject" { - v := Values{} - if err := d.DecodeElement(&v, &start); err != nil { - return err - } - r.Values = append(r.Values, v) - return nil - } - - for { - t, err := d.Token() - if err != nil { - if err == io.EOF { - return nil - } - return err - } - - if s, ok := t.(xml.StartElement); ok { - if s.Name.Local == "DataObject" { - v := Values{} - if err := d.DecodeElement(&v, &s); err != nil { - return err - } - r.Values = append(r.Values, v) - } - } - } -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/govc/host/esxcli/response_test.go juju-core-2.0.2/src/github.com/juju/govmomi/govc/host/esxcli/response_test.go --- juju-core-2.0.0/src/github.com/juju/govmomi/govc/host/esxcli/response_test.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/govc/host/esxcli/response_test.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,105 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package esxcli - -import ( - "os" - "reflect" - "testing" - - "github.com/juju/govmomi/vim25/types" - "github.com/juju/govmomi/vim25/xml" -) - -func load(name string) *Response { - f, err := os.Open(name) - if err != nil { - panic(err) - } - - defer f.Close() - - var b Response - - dec := xml.NewDecoder(f) - dec.TypeFunc = types.TypeFunc() - if err := dec.Decode(&b); err != nil { - panic(err) - } - - return &b -} - -func TestSystemHostnameGetResponse(t *testing.T) { - res := load("fixtures/system_hostname_get.xml") - - expect := []Values{ - { - "DomainName": {"localdomain"}, - "FullyQualifiedDomainName": {"esxbox.localdomain"}, - "HostName": {"esxbox"}, - }, - } - - if !reflect.DeepEqual(res.Values, expect) { - t.Errorf("%s != %s", res.Values, expect) - } -} - -func TestNetworkVmList(t *testing.T) { - res := load("fixtures/network_vm_list.xml") - - expect := []Values{ - { - "Name": {"foo"}, - "Networks": {"VM Network", "dougm"}, - "NumPorts": {"2"}, - "WorldID": {"98842"}, - }, - { - "Name": {"bar"}, - "Networks": {"VM Network"}, - "NumPorts": {"1"}, - "WorldID": {"236235"}, - }, - } - - if !reflect.DeepEqual(res.Values, expect) { - t.Errorf("%s != %s", res.Values, expect) - } -} - -func TestNetworkVmPortList(t *testing.T) { - r := load("fixtures/network_vm_port_list.xml") - - expect := []Values{ - { - "IPAddress": {"192.168.247.149"}, - "MACAddress": {"00:0c:29:12:b2:cf"}, - "PortID": {"33554438"}, - "Portgroup": {"VM Network"}, - "TeamUplink": {"vmnic0"}, - "UplinkPortID": {"33554434"}, - "vSwitch": {"vSwitch0"}, - "DVPortID": {""}, - }, - } - - if !reflect.DeepEqual(r.Values, expect) { - t.Errorf("%s != %s", r.Values, expect) - } -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/govc/host/info.go juju-core-2.0.2/src/github.com/juju/govmomi/govc/host/info.go --- juju-core-2.0.0/src/github.com/juju/govmomi/govc/host/info.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/govc/host/info.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,129 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package host - -import ( - "flag" - "fmt" - "io" - "os" - "text/tabwriter" - - "github.com/juju/govmomi/govc/cli" - "github.com/juju/govmomi/govc/flags" - "github.com/juju/govmomi/object" - "github.com/juju/govmomi/property" - "github.com/juju/govmomi/vim25/mo" - "golang.org/x/net/context" -) - -type info struct { - *flags.ClientFlag - *flags.OutputFlag - *flags.HostSystemFlag -} - -func init() { - cli.Register("host.info", &info{}) -} - -func (c *info) Register(f *flag.FlagSet) {} - -func (c *info) Process() error { return nil } - -func (c *info) Run(f *flag.FlagSet) error { - client, err := c.Client() - if err != nil { - return err - } - - var hosts []*object.HostSystem - - // We could do without the -host flag, leaving it for compat - host, err := c.HostSystemIfSpecified() - if err != nil { - return err - } - - // Default only if there is a single host - if host == nil && f.NArg() == 0 { - host, err = c.HostSystem() - if err != nil { - return err - } - } - - if host != nil { - hosts = append(hosts, host) - } else { - hosts, err = c.HostSystems(f.Args()) - if err != nil { - return err - } - } - - var res infoResult - var props []string - - if c.OutputFlag.JSON { - props = nil // Load everything - } else { - props = []string{"summary"} // Load summary - } - - for _, host := range hosts { - var h mo.HostSystem - - pc := property.DefaultCollector(client) - err = pc.RetrieveOne(context.TODO(), host.Reference(), props, &h) - if err != nil { - return err - } - - res.HostSystems = append(res.HostSystems, h) - } - - return c.WriteResult(&res) -} - -type infoResult struct { - HostSystems []mo.HostSystem -} - -func (r *infoResult) Write(w io.Writer) error { - tw := tabwriter.NewWriter(os.Stdout, 2, 0, 2, ' ', 0) - - for _, host := range r.HostSystems { - s := host.Summary - h := s.Hardware - z := s.QuickStats - ncpu := int(h.NumCpuPkgs * h.NumCpuCores) - cpuUsage := 100 * float64(z.OverallCpuUsage) / float64(ncpu*h.CpuMhz) - memUsage := 100 * float64(z.OverallMemoryUsage<<20) / float64(h.MemorySize) - - fmt.Fprintf(tw, "Name:\t%s\n", s.Config.Name) - fmt.Fprintf(tw, " Manufacturer:\t%s\n", h.Vendor) - fmt.Fprintf(tw, " Logical CPUs:\t%d CPUs @ %dMHz\n", ncpu, h.CpuMhz) - fmt.Fprintf(tw, " Processor type:\t%s\n", h.CpuModel) - fmt.Fprintf(tw, " CPU usage:\t%d MHz (%.1f%%)\n", z.OverallCpuUsage, cpuUsage) - fmt.Fprintf(tw, " Memory:\t%dMB\n", h.MemorySize/(1024*1024)) - fmt.Fprintf(tw, " Memory usage:\t%d MB (%.1f%%)\n", z.OverallMemoryUsage, memUsage) - fmt.Fprintf(tw, " Boot time:\t%s\n", s.Runtime.BootTime) - } - - return tw.Flush() -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/govc/host/portgroup/add.go juju-core-2.0.2/src/github.com/juju/govmomi/govc/host/portgroup/add.go --- juju-core-2.0.0/src/github.com/juju/govmomi/govc/host/portgroup/add.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/govc/host/portgroup/add.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,58 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package portgroup - -import ( - "flag" - - "github.com/juju/govmomi/govc/cli" - "github.com/juju/govmomi/govc/flags" - "github.com/juju/govmomi/vim25/types" - "golang.org/x/net/context" -) - -type add struct { - *flags.HostSystemFlag - - spec types.HostPortGroupSpec -} - -func init() { - cli.Register("host.portgroup.add", &add{}) -} - -func (cmd *add) Register(f *flag.FlagSet) { - f.StringVar(&cmd.spec.VswitchName, "vswitch", "", "vSwitch Name") - f.IntVar(&cmd.spec.VlanId, "vlan", 0, "VLAN ID") -} - -func (cmd *add) Process() error { return nil } - -func (cmd *add) Usage() string { - return "NAME" -} - -func (cmd *add) Run(f *flag.FlagSet) error { - ns, err := cmd.HostNetworkSystem() - if err != nil { - return err - } - - cmd.spec.Name = f.Arg(0) - - return ns.AddPortGroup(context.TODO(), cmd.spec) -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/govc/host/portgroup/remove.go juju-core-2.0.2/src/github.com/juju/govmomi/govc/host/portgroup/remove.go --- juju-core-2.0.0/src/github.com/juju/govmomi/govc/host/portgroup/remove.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/govc/host/portgroup/remove.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,50 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package portgroup - -import ( - "flag" - - "github.com/juju/govmomi/govc/cli" - "github.com/juju/govmomi/govc/flags" - "golang.org/x/net/context" -) - -type remove struct { - *flags.HostSystemFlag -} - -func init() { - cli.Register("host.portgroup.remove", &remove{}) -} - -func (cmd *remove) Register(f *flag.FlagSet) {} - -func (cmd *remove) Process() error { return nil } - -func (cmd *remove) Usage() string { - return "NAME" -} - -func (cmd *remove) Run(f *flag.FlagSet) error { - ns, err := cmd.HostNetworkSystem() - if err != nil { - return err - } - - return ns.RemovePortGroup(context.TODO(), f.Arg(0)) -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/govc/host/vswitch/add.go juju-core-2.0.2/src/github.com/juju/govmomi/govc/host/vswitch/add.go --- juju-core-2.0.0/src/github.com/juju/govmomi/govc/host/vswitch/add.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/govc/host/vswitch/add.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,64 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package vswitch - -import ( - "flag" - - "github.com/juju/govmomi/govc/cli" - "github.com/juju/govmomi/govc/flags" - "github.com/juju/govmomi/vim25/types" - "golang.org/x/net/context" -) - -type add struct { - *flags.HostSystemFlag - - nic string - spec types.HostVirtualSwitchSpec -} - -func init() { - cli.Register("host.vswitch.add", &add{}) -} - -func (cmd *add) Register(f *flag.FlagSet) { - f.IntVar(&cmd.spec.NumPorts, "ports", 128, "Number of ports") - f.IntVar(&cmd.spec.Mtu, "mtu", 0, "MTU") - f.StringVar(&cmd.nic, "nic", "", "Bridge nic device") -} - -func (cmd *add) Process() error { return nil } - -func (cmd *add) Usage() string { - return "NAME" -} - -func (cmd *add) Run(f *flag.FlagSet) error { - ns, err := cmd.HostNetworkSystem() - if err != nil { - return err - } - - if cmd.nic != "" { - cmd.spec.Bridge = &types.HostVirtualSwitchBondBridge{ - NicDevice: []string{cmd.nic}, - } - } - - return ns.AddVirtualSwitch(context.TODO(), f.Arg(0), &cmd.spec) -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/govc/host/vswitch/info.go juju-core-2.0.2/src/github.com/juju/govmomi/govc/host/vswitch/info.go --- juju-core-2.0.0/src/github.com/juju/govmomi/govc/host/vswitch/info.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/govc/host/vswitch/info.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,88 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package vswitch - -import ( - "flag" - "fmt" - "os" - "strings" - "text/tabwriter" - - "github.com/juju/govmomi/govc/cli" - "github.com/juju/govmomi/govc/flags" - "github.com/juju/govmomi/property" - "github.com/juju/govmomi/vim25/mo" - "golang.org/x/net/context" -) - -type info struct { - *flags.ClientFlag - *flags.OutputFlag - *flags.HostSystemFlag -} - -func init() { - cli.Register("host.vswitch.info", &info{}) -} - -func (cmd *info) Register(f *flag.FlagSet) {} - -func (cmd *info) Process() error { return nil } - -func (cmd *info) Run(f *flag.FlagSet) error { - client, err := cmd.Client() - if err != nil { - return err - } - - ns, err := cmd.HostNetworkSystem() - if err != nil { - return err - } - - var mns mo.HostNetworkSystem - - pc := property.DefaultCollector(client) - err = pc.RetrieveOne(context.TODO(), ns.Reference(), []string{"networkInfo.vswitch"}, &mns) - if err != nil { - return err - } - - tw := tabwriter.NewWriter(os.Stdout, 2, 0, 2, ' ', 0) - - for i, s := range mns.NetworkInfo.Vswitch { - if i > 0 { - fmt.Fprintln(tw) - } - fmt.Fprintf(tw, "Name:\t%s\n", s.Name) - fmt.Fprintf(tw, "Portgroup:\t%s\n", cmd.keys("key-vim.host.PortGroup-", s.Portgroup)) - fmt.Fprintf(tw, "Pnic:\t%s\n", cmd.keys("key-vim.host.PhysicalNic-", s.Pnic)) - fmt.Fprintf(tw, "MTU:\t%d\n", s.Mtu) - fmt.Fprintf(tw, "Ports:\t%d\n", s.NumPorts) - fmt.Fprintf(tw, "Ports Available:\t%d\n", s.NumPortsAvailable) - } - - return tw.Flush() -} - -func (cmd *info) keys(key string, vals []string) string { - for i, val := range vals { - vals[i] = strings.TrimPrefix(val, key) - } - return strings.Join(vals, ", ") -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/govc/host/vswitch/remove.go juju-core-2.0.2/src/github.com/juju/govmomi/govc/host/vswitch/remove.go --- juju-core-2.0.0/src/github.com/juju/govmomi/govc/host/vswitch/remove.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/govc/host/vswitch/remove.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,50 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package vswitch - -import ( - "flag" - - "github.com/juju/govmomi/govc/cli" - "github.com/juju/govmomi/govc/flags" - "golang.org/x/net/context" -) - -type remove struct { - *flags.HostSystemFlag -} - -func init() { - cli.Register("host.vswitch.remove", &remove{}) -} - -func (cmd *remove) Register(f *flag.FlagSet) {} - -func (cmd *remove) Process() error { return nil } - -func (cmd *remove) Usage() string { - return "NAME" -} - -func (cmd *remove) Run(f *flag.FlagSet) error { - ns, err := cmd.HostNetworkSystem() - if err != nil { - return err - } - - return ns.RemoveVirtualSwitch(context.TODO(), f.Arg(0)) -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/govc/importx/archive.go juju-core-2.0.2/src/github.com/juju/govmomi/govc/importx/archive.go --- juju-core-2.0.0/src/github.com/juju/govmomi/govc/importx/archive.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/govc/importx/archive.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,95 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package importx - -import ( - "archive/tar" - "io" - "os" - "path/filepath" -) - -type Archive interface { - Open(string) (io.ReadCloser, int64, error) -} - -type TapeArchive struct { - path string -} - -type TapeArchiveEntry struct { - io.Reader - f *os.File -} - -func (t *TapeArchiveEntry) Close() error { - return t.f.Close() -} - -func (t *TapeArchive) Open(name string) (io.ReadCloser, int64, error) { - f, err := os.Open(t.path) - if err != nil { - return nil, 0, err - } - - r := tar.NewReader(f) - - for { - h, err := r.Next() - - if err == io.EOF { - break - } - - matched, err := filepath.Match(name, h.Name) - if err != nil { - return nil, 0, err - } - - if matched { - return &TapeArchiveEntry{r, f}, h.Size, nil - } - } - - _ = f.Close() - - return nil, 0, os.ErrNotExist -} - -type FileArchive struct { - path string -} - -func (t *FileArchive) Open(name string) (io.ReadCloser, int64, error) { - fpath := name - - if name != t.path { - fpath = filepath.Join(filepath.Dir(t.path), name) - } - - s, err := os.Stat(fpath) - if err != nil { - return nil, 0, err - } - - f, err := os.Open(fpath) - if err != nil { - return nil, 0, err - } - - return f, s.Size(), nil -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/govc/importx/importable.go juju-core-2.0.2/src/github.com/juju/govmomi/govc/importx/importable.go --- juju-core-2.0.0/src/github.com/juju/govmomi/govc/importx/importable.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/govc/importx/importable.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,59 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package importx - -import ( - "fmt" - "path" -) - -type importable struct { - localPath string - remotePath string -} - -func (i importable) Ext() string { - return path.Ext(i.localPath) -} - -func (i importable) Base() string { - return path.Base(i.localPath) -} - -func (i importable) BaseClean() string { - b := i.Base() - e := i.Ext() - return b[:len(b)-len(e)] -} - -func (i importable) RemoteSrcVMDK() string { - file := fmt.Sprintf("%s-src.vmdk", i.BaseClean()) - return i.toRemotePath(file) -} - -func (i importable) RemoteDstVMDK() string { - file := fmt.Sprintf("%s.vmdk", i.BaseClean()) - return i.toRemotePath(file) -} - -func (i importable) toRemotePath(p string) string { - if i.remotePath == "" { - return p - } - - return path.Join(i.remotePath, p) -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/govc/importx/lease_updater.go juju-core-2.0.2/src/github.com/juju/govmomi/govc/importx/lease_updater.go --- juju-core-2.0.0/src/github.com/juju/govmomi/govc/importx/lease_updater.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/govc/importx/lease_updater.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,131 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package importx - -import ( - "fmt" - "net/url" - "sync" - "sync/atomic" - "time" - - "github.com/juju/govmomi/object" - "github.com/juju/govmomi/vim25" - "github.com/juju/govmomi/vim25/progress" - "github.com/juju/govmomi/vim25/types" - "golang.org/x/net/context" -) - -type ovfFileItem struct { - url *url.URL - item types.OvfFileItem - ch chan progress.Report -} - -func (o ovfFileItem) Sink() chan<- progress.Report { - return o.ch -} - -type leaseUpdater struct { - client *vim25.Client - lease *object.HttpNfcLease - - pos int64 // Number of bytes - total int64 // Total number of bytes - - done chan struct{} // When lease updater should stop - - wg sync.WaitGroup // Track when update loop is done -} - -func newLeaseUpdater(client *vim25.Client, lease *object.HttpNfcLease, items []ovfFileItem) *leaseUpdater { - l := leaseUpdater{ - client: client, - lease: lease, - - done: make(chan struct{}), - } - - for _, item := range items { - l.total += item.item.Size - go l.waitForProgress(item) - } - - // Kickstart update loop - l.wg.Add(1) - go l.run() - - return &l -} - -func (l *leaseUpdater) waitForProgress(item ovfFileItem) { - var pos, total int64 - - total = item.item.Size - - for { - select { - case <-l.done: - return - case p, ok := <-item.ch: - // Return in case of error - if ok && p.Error() != nil { - return - } - - if !ok { - // Last element on the channel, add to total - atomic.AddInt64(&l.pos, total-pos) - return - } - - // Approximate progress in number of bytes - x := int64(float32(total) * (p.Percentage() / 100.0)) - atomic.AddInt64(&l.pos, x-pos) - pos = x - } - } -} - -func (l *leaseUpdater) run() { - defer l.wg.Done() - - tick := time.NewTicker(2 * time.Second) - defer tick.Stop() - - for { - select { - case <-l.done: - return - case <-tick.C: - // From the vim api HttpNfcLeaseProgress(percent) doc, percent == - // "Completion status represented as an integer in the 0-100 range." - // Always report the current value of percent, as it will renew the - // lease even if the value hasn't changed or is 0. - percent := int(float32(100*atomic.LoadInt64(&l.pos)) / float32(l.total)) - err := l.lease.HttpNfcLeaseProgress(context.TODO(), percent) - if err != nil { - fmt.Printf("from lease updater: %s\n", err) - } - } - } -} - -func (l *leaseUpdater) Done() { - close(l.done) - l.wg.Wait() -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/govc/importx/ova.go juju-core-2.0.2/src/github.com/juju/govmomi/govc/importx/ova.go --- juju-core-2.0.0/src/github.com/juju/govmomi/govc/importx/ova.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/govc/importx/ova.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,56 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package importx - -import ( - "flag" - "path" - "strings" - - "github.com/juju/govmomi/govc/cli" -) - -type ova struct { - *ovf -} - -func init() { - cli.Register("import.ova", &ova{&ovf{}}) -} - -func (cmd *ova) Usage() string { - return "PATH_TO_OVA" -} - -func (cmd *ova) Run(f *flag.FlagSet) error { - file, err := cmd.Prepare(f) - - if err != nil { - return err - } - - cmd.Archive = &TapeArchive{file} - - return cmd.Import(file) -} - -func (cmd *ova) Import(fpath string) error { - // basename i | sed -e s/\.ova$/*.ovf/ - ovf := strings.TrimSuffix(path.Base(fpath), path.Ext(fpath)) + "*.ovf" - - return cmd.ovf.Import(ovf) -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/govc/importx/ovf.go juju-core-2.0.2/src/github.com/juju/govmomi/govc/importx/ovf.go --- juju-core-2.0.0/src/github.com/juju/govmomi/govc/importx/ovf.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/govc/importx/ovf.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,260 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package importx - -import ( - "encoding/xml" - "errors" - "flag" - "fmt" - "io/ioutil" - "path" - - "github.com/juju/govmomi/govc/cli" - "github.com/juju/govmomi/govc/flags" - "github.com/juju/govmomi/object" - "github.com/juju/govmomi/vim25" - "github.com/juju/govmomi/vim25/progress" - "github.com/juju/govmomi/vim25/soap" - "github.com/juju/govmomi/vim25/types" - "golang.org/x/net/context" -) - -type ovf struct { - *flags.DatastoreFlag - *flags.ResourcePoolFlag - *flags.HostSystemFlag - *flags.OutputFlag - - Client *vim25.Client - Datacenter *object.Datacenter - Datastore *object.Datastore - ResourcePool *object.ResourcePool - - Archive -} - -func init() { - cli.Register("import.ovf", &ovf{}) -} - -func (cmd *ovf) Register(f *flag.FlagSet) {} - -func (cmd *ovf) Process() error { return nil } - -func (cmd *ovf) Usage() string { - return "PATH_TO_OVF" -} - -func (cmd *ovf) Run(f *flag.FlagSet) error { - file, err := cmd.Prepare(f) - - if err != nil { - return err - } - - cmd.Archive = &FileArchive{file} - - return cmd.Import(file) -} - -func (cmd *ovf) Prepare(f *flag.FlagSet) (string, error) { - var err error - - args := f.Args() - if len(args) != 1 { - return "", errors.New("no file to import") - } - - cmd.Client, err = cmd.DatastoreFlag.Client() - if err != nil { - return "", err - } - - cmd.Datacenter, err = cmd.DatastoreFlag.Datacenter() - if err != nil { - return "", err - } - - cmd.Datastore, err = cmd.DatastoreFlag.Datastore() - if err != nil { - return "", err - } - - cmd.ResourcePool, err = cmd.ResourcePoolFlag.ResourcePool() - if err != nil { - return "", err - } - - return f.Arg(0), nil -} - -func (cmd *ovf) ReadAll(name string) ([]byte, error) { - f, _, err := cmd.Open(name) - if err != nil { - return nil, err - } - defer f.Close() - - return ioutil.ReadAll(f) -} - -func (cmd *ovf) Import(fpath string) error { - c := cmd.Client - - desc, err := cmd.ReadAll(fpath) - if err != nil { - return err - } - - // extract name from .ovf for use as VM name - ovf := struct { - VirtualSystem struct { - Name string - } - }{} - - if err := xml.Unmarshal(desc, &ovf); err != nil { - return fmt.Errorf("failed to parse ovf: %s", err.Error()) - } - - cisp := types.OvfCreateImportSpecParams{ - EntityName: ovf.VirtualSystem.Name, - OvfManagerCommonParams: types.OvfManagerCommonParams{ - Locale: "US", - }, - } - - m := object.NewOvfManager(c) - spec, err := m.CreateImportSpec(context.TODO(), string(desc), cmd.ResourcePool, cmd.Datastore, cisp) - if err != nil { - return err - } - - if spec.Error != nil { - return errors.New(spec.Error[0].LocalizedMessage) - } - - if spec.Warning != nil { - for _, w := range spec.Warning { - _, _ = cmd.Log(fmt.Sprintf("Warning: %s\n", w.LocalizedMessage)) - } - } - - // TODO: ImportSpec may have unitNumber==0, but this field is optional in the wsdl - // and hence omitempty in the struct tag; but unitNumber is required for certain devices. - s := &spec.ImportSpec.(*types.VirtualMachineImportSpec).ConfigSpec - for _, d := range s.DeviceChange { - n := &d.GetVirtualDeviceConfigSpec().Device.GetVirtualDevice().UnitNumber - if *n == 0 { - *n = -1 - } - } - - var host *object.HostSystem - if cmd.SearchFlag.IsSet() { - if host, err = cmd.HostSystem(); err != nil { - return err - } - } - - // TODO: need a folder option - folders, err := cmd.Datacenter.Folders(context.TODO()) - if err != nil { - return err - } - - lease, err := cmd.ResourcePool.ImportVApp(context.TODO(), spec.ImportSpec, folders.VmFolder, host) - if err != nil { - return err - } - - info, err := lease.Wait(context.TODO()) - if err != nil { - return err - } - - // Build slice of items and URLs first, so that the lease updater can know - // about every item that needs to be uploaded, and thereby infer progress. - var items []ovfFileItem - - for _, device := range info.DeviceUrl { - for _, item := range spec.FileItem { - if device.ImportKey != item.DeviceId { - continue - } - - u, err := c.Client.ParseURL(device.Url) - if err != nil { - return err - } - - i := ovfFileItem{ - url: u, - item: item, - ch: make(chan progress.Report), - } - - items = append(items, i) - } - } - - u := newLeaseUpdater(cmd.Client, lease, items) - defer u.Done() - - for _, i := range items { - err = cmd.Upload(lease, i) - if err != nil { - return err - } - } - - return lease.HttpNfcLeaseComplete(context.TODO()) -} - -func (cmd *ovf) Upload(lease *object.HttpNfcLease, ofi ovfFileItem) error { - item := ofi.item - file := item.Path - - f, size, err := cmd.Open(file) - if err != nil { - return err - } - defer f.Close() - - logger := cmd.ProgressLogger(fmt.Sprintf("Uploading %s... ", path.Base(file))) - defer logger.Wait() - - opts := soap.Upload{ - ContentLength: size, - Progress: progress.Tee(ofi, logger), - } - - // Non-disk files (such as .iso) use the PUT method. - // Overwrite: t header is also required in this case (ovftool does the same) - if item.Create { - opts.Method = "PUT" - opts.Headers = map[string]string{ - "Overwrite": "t", - } - } else { - opts.Method = "POST" - opts.Type = "application/x-vnd.vmware-streamVmdk" - } - - return cmd.Client.Client.Upload(f, ofi.url, &opts) -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/govc/importx/vmdk.go juju-core-2.0.2/src/github.com/juju/govmomi/govc/importx/vmdk.go --- juju-core-2.0.0/src/github.com/juju/govmomi/govc/importx/vmdk.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/govc/importx/vmdk.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,505 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package importx - -import ( - "errors" - "flag" - "fmt" - "path" - "reflect" - "regexp" - - "github.com/juju/govmomi/govc/cli" - "github.com/juju/govmomi/govc/flags" - "github.com/juju/govmomi/object" - "github.com/juju/govmomi/property" - "github.com/juju/govmomi/vim25" - "github.com/juju/govmomi/vim25/mo" - "github.com/juju/govmomi/vim25/progress" - "github.com/juju/govmomi/vim25/soap" - "github.com/juju/govmomi/vim25/types" - "golang.org/x/net/context" -) - -type vmdk struct { - *flags.DatastoreFlag - *flags.ResourcePoolFlag - *flags.OutputFlag - - upload bool - force bool - keep bool - - Client *vim25.Client - Datacenter *object.Datacenter - Datastore *object.Datastore - ResourcePool *object.ResourcePool -} - -func init() { - cli.Register("import.vmdk", &vmdk{}) - cli.Alias("import.vmdk", "datastore.import") -} - -func (cmd *vmdk) Register(f *flag.FlagSet) { - f.BoolVar(&cmd.upload, "upload", true, "Upload specified disk") - f.BoolVar(&cmd.force, "force", false, "Overwrite existing disk") - f.BoolVar(&cmd.keep, "keep", false, "Keep uploaded disk after import") -} - -func (cmd *vmdk) Process() error { return nil } - -func (cmd *vmdk) Usage() string { - return "PATH_TO_VMDK [REMOTE_DIRECTORY]" -} - -func (cmd *vmdk) Run(f *flag.FlagSet) error { - var err error - - args := f.Args() - if len(args) < 1 { - return errors.New("no file to import") - } - - file := importable{ - localPath: f.Arg(0), - } - - // Include remote path if specified - if len(args) >= 2 { - file.remotePath = f.Arg(1) - } - - cmd.Client, err = cmd.DatastoreFlag.Client() - if err != nil { - return err - } - - cmd.Datacenter, err = cmd.DatastoreFlag.Datacenter() - if err != nil { - return err - } - - cmd.Datastore, err = cmd.DatastoreFlag.Datastore() - if err != nil { - return err - } - - cmd.ResourcePool, err = cmd.ResourcePoolFlag.ResourcePool() - if err != nil { - return err - } - - err = cmd.PrepareDestination(file) - if err != nil { - return err - } - - if cmd.upload { - err = cmd.Upload(file) - if err != nil { - return err - } - } - - return cmd.Import(file) -} - -// PrepareDestination makes sure that the destination VMDK does not yet exist. -// If the force flag is passed, it removes the existing VMDK. This functions -// exists to give a meaningful error if the remote VMDK already exists. -// -// CopyVirtualDisk can return a " file does not exist" error while in fact -// the source file *does* exist and the *destination* file also exist. -// -func (cmd *vmdk) PrepareDestination(i importable) error { - vmdkPath := i.RemoteDstVMDK() - res, err := cmd.Stat(vmdkPath) - if err != nil { - switch err { - case flags.ErrDatastoreDirNotExist: - // The base path doesn't exist. Create it. - dsPath := cmd.Datastore.Path(path.Dir(vmdkPath)) - m := object.NewFileManager(cmd.Client) - return m.MakeDirectory(context.TODO(), dsPath, cmd.Datacenter, true) - case flags.ErrDatastoreFileNotExist: - // Destination path doesn't exist; all good to continue with import. - return nil - } - - return err - } - - // Check that the returned entry has the right type. - switch res.(type) { - case *types.VmDiskFileInfo: - default: - expected := "VmDiskFileInfo" - actual := reflect.TypeOf(res) - panic(fmt.Sprintf("Expected: %s, actual: %s", expected, actual)) - } - - if !cmd.force { - dsPath := cmd.Datastore.Path(vmdkPath) - err = fmt.Errorf("File %s already exists", dsPath) - return err - } - - // Delete existing disk. - err = cmd.DeleteDisk(vmdkPath) - if err != nil { - return err - } - - return nil -} - -func (cmd *vmdk) Upload(i importable) error { - u, err := cmd.Datastore.URL(context.TODO(), cmd.Datacenter, i.RemoteSrcVMDK()) - if err != nil { - return err - } - - p := soap.DefaultUpload - if cmd.OutputFlag.TTY { - logger := cmd.ProgressLogger("Uploading... ") - p.Progress = logger - defer logger.Wait() - } - - return cmd.Client.Client.UploadFile(i.localPath, u, &p) -} - -func (cmd *vmdk) Import(i importable) error { - err := cmd.Copy(i) - if err != nil { - return err - } - - if !cmd.keep { - err = cmd.DeleteDisk(i.RemoteSrcVMDK()) - if err != nil { - return err - } - } - - return nil -} - -func (cmd *vmdk) Copy(i importable) error { - var err error - - logger := cmd.ProgressLogger("Importing... ") - defer logger.Wait() - - agg := progress.NewAggregator(logger) - defer agg.Done() - - switch p := cmd.Client.ServiceContent.About.ApiType; p { - case "HostAgent": - err = cmd.CopyHostAgent(i, agg) - case "VirtualCenter": - err = cmd.CopyVirtualCenter(i, agg) - default: - return fmt.Errorf("unsupported ApiType: %s", p) - } - - return err -} - -func (cmd *vmdk) CopyHostAgent(i importable, s progress.Sinker) error { - spec := &types.VirtualDiskSpec{ - AdapterType: "lsiLogic", - DiskType: "thin", - } - - dc := cmd.Datacenter - src := cmd.Datastore.Path(i.RemoteSrcVMDK()) - dst := cmd.Datastore.Path(i.RemoteDstVMDK()) - vdm := object.NewVirtualDiskManager(cmd.Client) - task, err := vdm.CopyVirtualDisk(context.TODO(), src, dc, dst, dc, spec, false) - if err != nil { - return err - } - - ps := progress.Prefix(s, "copying disk") - _, err = task.WaitForResult(context.TODO(), ps) - if err != nil { - return err - } - - return nil -} - -func (cmd *vmdk) CopyVirtualCenter(i importable, s progress.Sinker) error { - var err error - - srcName := i.BaseClean() + "-srcvm" - dstName := i.BaseClean() + "-dstvm" - - spec := &configSpec{ - Name: srcName, - GuestId: "otherGuest", - Files: &types.VirtualMachineFileInfo{ - VmPathName: fmt.Sprintf("[%s]", cmd.Datastore.Name()), - }, - } - - spec.AddDisk(cmd.Datastore, i.RemoteSrcVMDK()) - - src, err := cmd.CreateVM(spec) - if err != nil { - return err - } - - dst, err := cmd.CloneVM(src, dstName) - if err != nil { - return err - } - - err = cmd.DestroyVM(src) - if err != nil { - return err - } - - vmdk, err := cmd.DetachDisk(dst) - if err != nil { - return err - } - - err = cmd.MoveDisk(vmdk, i.RemoteDstVMDK()) - if err != nil { - return err - } - - err = cmd.DestroyVM(dst) - if err != nil { - return err - } - - return nil -} - -func (cmd *vmdk) MoveDisk(src, dst string) error { - dsSrc := cmd.Datastore.Path(src) - dsDst := cmd.Datastore.Path(dst) - vdm := object.NewVirtualDiskManager(cmd.Client) - task, err := vdm.MoveVirtualDisk(context.TODO(), dsSrc, cmd.Datacenter, dsDst, cmd.Datacenter, true) - if err != nil { - return err - } - - return task.Wait(context.TODO()) -} - -func (cmd *vmdk) DeleteDisk(path string) error { - vdm := object.NewVirtualDiskManager(cmd.Client) - task, err := vdm.DeleteVirtualDisk(context.TODO(), cmd.Datastore.Path(path), cmd.Datacenter) - if err != nil { - return err - } - - return task.Wait(context.TODO()) -} - -func (cmd *vmdk) DetachDisk(vm *object.VirtualMachine) (string, error) { - var mvm mo.VirtualMachine - - pc := property.DefaultCollector(cmd.Client) - err := pc.RetrieveOne(context.TODO(), vm.Reference(), []string{"config.hardware"}, &mvm) - if err != nil { - return "", err - } - - spec := new(configSpec) - dsFile := spec.RemoveDisk(&mvm) - - task, err := vm.Reconfigure(context.TODO(), spec.ToSpec()) - if err != nil { - return "", err - } - - err = task.Wait(context.TODO()) - if err != nil { - return "", err - } - - return dsFile, nil -} - -func (cmd *vmdk) CreateVM(spec *configSpec) (*object.VirtualMachine, error) { - folders, err := cmd.Datacenter.Folders(context.TODO()) - if err != nil { - return nil, err - } - - task, err := folders.VmFolder.CreateVM(context.TODO(), spec.ToSpec(), cmd.ResourcePool, nil) - if err != nil { - return nil, err - } - - info, err := task.WaitForResult(context.TODO(), nil) - if err != nil { - return nil, err - } - - return object.NewVirtualMachine(cmd.Client, info.Result.(types.ManagedObjectReference)), nil -} - -func (cmd *vmdk) CloneVM(vm *object.VirtualMachine, name string) (*object.VirtualMachine, error) { - folders, err := cmd.Datacenter.Folders(context.TODO()) - if err != nil { - return nil, err - } - - spec := types.VirtualMachineCloneSpec{ - Config: &types.VirtualMachineConfigSpec{}, - Location: types.VirtualMachineRelocateSpec{}, - } - - task, err := vm.Clone(context.TODO(), folders.VmFolder, name, spec) - if err != nil { - return nil, err - } - - info, err := task.WaitForResult(context.TODO(), nil) - if err != nil { - return nil, err - } - - return object.NewVirtualMachine(cmd.Client, info.Result.(types.ManagedObjectReference)), nil -} - -func (cmd *vmdk) DestroyVM(vm *object.VirtualMachine) error { - _, err := cmd.DetachDisk(vm) - if err != nil { - return err - } - - task, err := vm.Destroy(context.TODO()) - if err != nil { - return err - } - - err = task.Wait(context.TODO()) - if err != nil { - return err - } - - return nil -} - -type configSpec types.VirtualMachineConfigSpec - -func (c *configSpec) ToSpec() types.VirtualMachineConfigSpec { - return types.VirtualMachineConfigSpec(*c) -} - -func (c *configSpec) AddChange(d types.BaseVirtualDeviceConfigSpec) { - c.DeviceChange = append(c.DeviceChange, d) -} - -func (c *configSpec) AddDisk(ds *object.Datastore, path string) { - controller := &types.VirtualLsiLogicController{ - VirtualSCSIController: types.VirtualSCSIController{ - SharedBus: types.VirtualSCSISharingNoSharing, - VirtualController: types.VirtualController{ - BusNumber: 0, - VirtualDevice: types.VirtualDevice{ - Key: -1, - }, - }, - }, - } - - controllerSpec := &types.VirtualDeviceConfigSpec{ - Device: controller, - Operation: types.VirtualDeviceConfigSpecOperationAdd, - } - - c.AddChange(controllerSpec) - - disk := &types.VirtualDisk{ - VirtualDevice: types.VirtualDevice{ - Key: -1, - ControllerKey: -1, - UnitNumber: -1, - Backing: &types.VirtualDiskFlatVer2BackingInfo{ - VirtualDeviceFileBackingInfo: types.VirtualDeviceFileBackingInfo{ - FileName: ds.Path(path), - }, - DiskMode: string(types.VirtualDiskModePersistent), - ThinProvisioned: types.NewBool(true), - }, - }, - } - - diskSpec := &types.VirtualDeviceConfigSpec{ - Device: disk, - Operation: types.VirtualDeviceConfigSpecOperationAdd, - } - - c.AddChange(diskSpec) -} - -var dsPathRegexp = regexp.MustCompile(`^\[.*\] (.*)$`) - -func (c *configSpec) RemoveDisk(vm *mo.VirtualMachine) string { - var file string - - for _, d := range vm.Config.Hardware.Device { - switch device := d.(type) { - case *types.VirtualDisk: - if file != "" { - panic("expected VM to have only one disk") - } - - switch backing := device.Backing.(type) { - case *types.VirtualDiskFlatVer1BackingInfo: - file = backing.FileName - case *types.VirtualDiskFlatVer2BackingInfo: - file = backing.FileName - case *types.VirtualDiskSeSparseBackingInfo: - file = backing.FileName - case *types.VirtualDiskSparseVer1BackingInfo: - file = backing.FileName - case *types.VirtualDiskSparseVer2BackingInfo: - file = backing.FileName - default: - name := reflect.TypeOf(device.Backing).String() - panic(fmt.Sprintf("unexpected backing type: %s", name)) - } - - // Remove [datastore] prefix - m := dsPathRegexp.FindStringSubmatch(file) - if len(m) != 2 { - panic(fmt.Sprintf("expected regexp match for %#v", file)) - } - file = m[1] - - removeOp := &types.VirtualDeviceConfigSpec{ - Operation: types.VirtualDeviceConfigSpecOperationRemove, - Device: device, - } - - c.AddChange(removeOp) - } - } - - return file -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/govc/license/add.go juju-core-2.0.2/src/github.com/juju/govmomi/govc/license/add.go --- juju-core-2.0.0/src/github.com/juju/govmomi/govc/license/add.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/govc/license/add.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,82 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package license - -import ( - "flag" - "fmt" - - "github.com/juju/govmomi/govc/cli" - "github.com/juju/govmomi/govc/flags" - "github.com/juju/govmomi/license" - "github.com/juju/govmomi/vim25/types" - "golang.org/x/net/context" -) - -type add struct { - *flags.ClientFlag - *flags.OutputFlag -} - -func init() { - cli.Register("license.add", &add{}) -} - -func (cmd *add) Register(f *flag.FlagSet) {} - -func (cmd *add) Process() error { return nil } - -func (cmd *add) Usage() string { - return "KEY..." -} - -func (cmd *add) Run(f *flag.FlagSet) error { - client, err := cmd.Client() - if err != nil { - return err - } - - m := license.NewManager(client) - - // From the vSphere 5.5 documentation: - // - // To specify the edition type and any optional functions, use - // updateLicense for ESX Server and addLicense follow by - // LicenseAssingmentManager.updateAssignedLicense for VirtualCenter. - // - var addFunc func(ctx context.Context, key string, labels map[string]string) (types.LicenseManagerLicenseInfo, error) - switch t := client.ServiceContent.About.ApiType; t { - case "HostAgent": - addFunc = m.Update - case "VirtualCenter": - addFunc = m.Add - default: - return fmt.Errorf("unsupported ApiType: %s", t) - } - - result := make(licenseOutput, 0) - for _, v := range f.Args() { - license, err := addFunc(context.TODO(), v, nil) - if err != nil { - return err - } - - result = append(result, license) - } - - return cmd.WriteResult(licenseOutput(result)) -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/govc/license/list.go juju-core-2.0.2/src/github.com/juju/govmomi/govc/license/list.go --- juju-core-2.0.0/src/github.com/juju/govmomi/govc/license/list.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/govc/license/list.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,54 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package license - -import ( - "flag" - - "github.com/juju/govmomi/govc/cli" - "github.com/juju/govmomi/govc/flags" - "github.com/juju/govmomi/license" - "golang.org/x/net/context" -) - -type list struct { - *flags.ClientFlag - *flags.OutputFlag -} - -func init() { - cli.Register("license.list", &list{}) -} - -func (cmd *list) Register(f *flag.FlagSet) {} - -func (cmd *list) Process() error { return nil } - -func (cmd *list) Run(f *flag.FlagSet) error { - client, err := cmd.Client() - if err != nil { - return err - } - - m := license.NewManager(client) - result, err := m.List(context.TODO()) - if err != nil { - return err - } - - return cmd.WriteResult(licenseOutput(result)) -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/govc/license/output.go juju-core-2.0.2/src/github.com/juju/govmomi/govc/license/output.go --- juju-core-2.0.0/src/github.com/juju/govmomi/govc/license/output.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/govc/license/output.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,41 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package license - -import ( - "fmt" - "io" - "os" - "text/tabwriter" - - "github.com/juju/govmomi/vim25/types" -) - -type licenseOutput []types.LicenseManagerLicenseInfo - -func (res licenseOutput) Write(w io.Writer) error { - tw := tabwriter.NewWriter(os.Stdout, 2, 0, 2, ' ', 0) - fmt.Fprintf(tw, "Key:\tEdition:\tUsed:\tTotal:\n") - for _, v := range res { - fmt.Fprintf(tw, "%s\t", v.LicenseKey) - fmt.Fprintf(tw, "%s\t", v.EditionKey) - fmt.Fprintf(tw, "%d\t", v.Used) - fmt.Fprintf(tw, "%d\t", v.Total) - fmt.Fprintf(tw, "\n") - } - return tw.Flush() -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/govc/license/remove.go juju-core-2.0.2/src/github.com/juju/govmomi/govc/license/remove.go --- juju-core-2.0.0/src/github.com/juju/govmomi/govc/license/remove.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/govc/license/remove.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,60 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package license - -import ( - "flag" - - "github.com/juju/govmomi/govc/cli" - "github.com/juju/govmomi/govc/flags" - "github.com/juju/govmomi/license" - "golang.org/x/net/context" -) - -type remove struct { - *flags.ClientFlag - *flags.OutputFlag -} - -func init() { - cli.Register("license.remove", &remove{}) -} - -func (cmd *remove) Register(f *flag.FlagSet) {} - -func (cmd *remove) Process() error { return nil } - -func (cmd *remove) Usage() string { - return "KEY..." -} - -func (cmd *remove) Run(f *flag.FlagSet) error { - client, err := cmd.Client() - if err != nil { - return err - } - - m := license.NewManager(client) - for _, v := range f.Args() { - err = m.Remove(context.TODO(), v) - if err != nil { - return err - } - } - - return nil -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/govc/ls/command.go juju-core-2.0.2/src/github.com/juju/govmomi/govc/ls/command.go --- juju-core-2.0.0/src/github.com/juju/govmomi/govc/ls/command.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/govc/ls/command.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,118 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package ls - -import ( - "flag" - "fmt" - "io" - - "github.com/juju/govmomi/govc/cli" - "github.com/juju/govmomi/govc/flags" - "github.com/juju/govmomi/list" - "github.com/juju/govmomi/vim25/mo" - "golang.org/x/net/context" -) - -type ls struct { - *flags.DatacenterFlag - - Long bool -} - -func init() { - cli.Register("ls", &ls{}) -} - -func (cmd *ls) Register(f *flag.FlagSet) { - f.BoolVar(&cmd.Long, "l", false, "Long listing format") -} - -func (cmd *ls) Process() error { return nil } - -func (cmd *ls) Usage() string { - return "[PATH]..." -} - -func (cmd *ls) Run(f *flag.FlagSet) error { - finder, err := cmd.Finder() - if err != nil { - return err - } - - es, err := finder.ManagedObjectList(context.TODO(), f.Args()...) - if err != nil { - return err - } - - lr := listResult{ - Elements: es, - Long: cmd.Long, - } - - return cmd.WriteResult(lr) -} - -type listResult struct { - Elements []list.Element `json:"elements"` - - Long bool `json:"-"` -} - -func (l listResult) Write(w io.Writer) error { - var err error - - for _, e := range l.Elements { - if !l.Long { - fmt.Fprintf(w, "%s\n", e.Path) - continue - } - - switch e.Object.(type) { - case mo.Folder: - if _, err = fmt.Fprintf(w, "%s/\n", e.Path); err != nil { - return err - } - case mo.Datacenter: - if _, err = fmt.Fprintf(w, "%s (Datacenter)\n", e.Path); err != nil { - return err - } - case mo.VirtualMachine: - if _, err = fmt.Fprintf(w, "%s (VirtualMachine)\n", e.Path); err != nil { - return err - } - case mo.Network: - if _, err = fmt.Fprintf(w, "%s (Network)\n", e.Path); err != nil { - return err - } - case mo.ComputeResource: - if _, err = fmt.Fprintf(w, "%s (ComputeResource)\n", e.Path); err != nil { - return err - } - case mo.Datastore: - if _, err = fmt.Fprintf(w, "%s (Datastore)\n", e.Path); err != nil { - return err - } - case mo.ResourcePool: - if _, err = fmt.Fprintf(w, "%s (ResourcePool)\n", e.Path); err != nil { - return err - } - } - } - - return nil -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/govc/main.go juju-core-2.0.2/src/github.com/juju/govmomi/govc/main.go --- juju-core-2.0.0/src/github.com/juju/govmomi/govc/main.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/govc/main.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,50 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package main - -import ( - "os" - - "github.com/juju/govmomi/govc/cli" - - _ "github.com/juju/govmomi/govc/about" - _ "github.com/juju/govmomi/govc/datacenter" - _ "github.com/juju/govmomi/govc/datastore" - _ "github.com/juju/govmomi/govc/device" - _ "github.com/juju/govmomi/govc/device/cdrom" - _ "github.com/juju/govmomi/govc/device/floppy" - _ "github.com/juju/govmomi/govc/device/scsi" - _ "github.com/juju/govmomi/govc/device/serial" - _ "github.com/juju/govmomi/govc/host" - _ "github.com/juju/govmomi/govc/host/autostart" - _ "github.com/juju/govmomi/govc/host/esxcli" - _ "github.com/juju/govmomi/govc/host/portgroup" - _ "github.com/juju/govmomi/govc/host/vswitch" - _ "github.com/juju/govmomi/govc/importx" - _ "github.com/juju/govmomi/govc/license" - _ "github.com/juju/govmomi/govc/ls" - _ "github.com/juju/govmomi/govc/pool" - _ "github.com/juju/govmomi/govc/version" - _ "github.com/juju/govmomi/govc/vm" - _ "github.com/juju/govmomi/govc/vm/disk" - _ "github.com/juju/govmomi/govc/vm/guest" - _ "github.com/juju/govmomi/govc/vm/network" -) - -func main() { - os.Exit(cli.Run(os.Args[1:])) -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/govc/pool/change.go juju-core-2.0.2/src/github.com/juju/govmomi/govc/pool/change.go --- juju-core-2.0.0/src/github.com/juju/govmomi/govc/pool/change.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/govc/pool/change.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,82 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package pool - -import ( - "flag" - - "github.com/juju/govmomi/govc/cli" - "github.com/juju/govmomi/govc/flags" - "github.com/juju/govmomi/vim25/types" - "golang.org/x/net/context" -) - -type change struct { - *flags.DatacenterFlag - *ResourceConfigSpecFlag - name string -} - -func init() { - spec := NewResourceConfigSpecFlag() - cli.Register("pool.change", &change{ResourceConfigSpecFlag: spec}) -} - -func (cmd *change) Register(f *flag.FlagSet) { - f.StringVar(&cmd.name, "name", "", "Resource pool name") -} - -func (cmd *change) Process() error { return nil } - -func (cmd *change) Usage() string { - return "POOL..." -} - -func (cmd *change) Description() string { - return "Change the configuration of one or more resource POOLs.\n" + poolNameHelp -} - -func (cmd *change) Run(f *flag.FlagSet) error { - if f.NArg() == 0 { - return flag.ErrHelp - } - - finder, err := cmd.Finder() - if err != nil { - return err - } - - cmd.SetAllocation(func(a *types.ResourceAllocationInfo) { - if a.Shares.Level == "" { - a.Shares = nil - } - }) - - pools, err := finder.ResourcePoolList(context.TODO(), f.Args()...) - if err != nil { - return err - } - - for _, pool := range pools { - err := pool.UpdateConfig(context.TODO(), cmd.name, &cmd.ResourceConfigSpec) - if err != nil { - return err - } - } - - return nil -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/govc/pool/create.go juju-core-2.0.2/src/github.com/juju/govmomi/govc/pool/create.go --- juju-core-2.0.0/src/github.com/juju/govmomi/govc/pool/create.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/govc/pool/create.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,88 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package pool - -import ( - "flag" - "fmt" - "path" - - "github.com/juju/govmomi/govc/cli" - "github.com/juju/govmomi/govc/flags" - "github.com/juju/govmomi/vim25/types" - "golang.org/x/net/context" -) - -type create struct { - *flags.DatacenterFlag - *ResourceConfigSpecFlag -} - -func init() { - spec := NewResourceConfigSpecFlag() - spec.SetAllocation(func(a *types.ResourceAllocationInfo) { - a.Shares.Level = types.SharesLevelNormal - a.ExpandableReservation = types.NewBool(true) - }) - - cli.Register("pool.create", &create{ResourceConfigSpecFlag: spec}) -} - -func (cmd *create) Register(f *flag.FlagSet) {} - -func (cmd *create) Process() error { return nil } - -func (cmd *create) Usage() string { - return "POOL..." -} - -func (cmd *create) Description() string { - return "Create one or more resource POOLs.\n" + poolCreateHelp -} - -func (cmd *create) Run(f *flag.FlagSet) error { - if f.NArg() == 0 { - return flag.ErrHelp - } - - finder, err := cmd.Finder() - if err != nil { - return err - } - - for _, arg := range f.Args() { - dir := path.Dir(arg) - base := path.Base(arg) - parents, err := finder.ResourcePoolList(context.TODO(), dir) - if err != nil { - return err - } - - if len(parents) == 0 { - return fmt.Errorf("cannot create resource pool '%s': parent not found", base) - } - - for _, parent := range parents { - _, err = parent.Create(context.TODO(), base, cmd.ResourceConfigSpec) - if err != nil { - return err - } - } - } - - return nil -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/govc/pool/destroy.go juju-core-2.0.2/src/github.com/juju/govmomi/govc/pool/destroy.go --- juju-core-2.0.0/src/github.com/juju/govmomi/govc/pool/destroy.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/govc/pool/destroy.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,84 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package pool - -import ( - "flag" - - "github.com/juju/govmomi/govc/cli" - "github.com/juju/govmomi/govc/flags" - "golang.org/x/net/context" -) - -type destroy struct { - *flags.DatacenterFlag - recursive bool -} - -func init() { - cli.Register("pool.destroy", &destroy{}) -} - -func (cmd *destroy) Register(f *flag.FlagSet) { - f.BoolVar(&cmd.recursive, "r", false, "Remove all child resource pools recursively") -} - -func (cmd *destroy) Process() error { return nil } - -func (cmd *destroy) Usage() string { - return "POOL..." -} - -func (cmd *destroy) Description() string { - return "Destroy one or more resource POOLs.\n" + poolNameHelp -} - -func (cmd *destroy) Run(f *flag.FlagSet) error { - if f.NArg() == 0 { - return flag.ErrHelp - } - - finder, err := cmd.Finder() - if err != nil { - return err - } - - pools, err := finder.ResourcePoolList(context.TODO(), f.Args()...) - if err != nil { - return err - } - - for _, pool := range pools { - if cmd.recursive { - err = pool.DestroyChildren(context.TODO()) - if err != nil { - return err - } - } - - task, err := pool.Destroy(context.TODO()) - if err != nil { - return err - } - err = task.Wait(context.TODO()) - if err != nil { - return err - } - } - - return nil -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/govc/pool/help.go juju-core-2.0.2/src/github.com/juju/govmomi/govc/pool/help.go --- juju-core-2.0.0/src/github.com/juju/govmomi/govc/pool/help.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/govc/pool/help.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,50 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package pool - -var poolNameHelp = ` -POOL may be an absolute or relative path to a resource pool or a (clustered) -compute host. If it resolves to a compute host, the associated root resource -pool is returned. If a relative path is specified, it is resolved with respect -to the current datacenter's "host" folder (i.e. /ha-datacenter/host). - -Paths to nested resource pools must traverse through the root resource pool of -the selected compute host, i.e. "compute-host/Resources/nested-pool". - -The same globbing rules that apply to the "ls" command apply here. For example, -POOL may be specified as "*/Resources/*" to expand to all resource pools that -are nested one level under the root resource pool, on all (clustered) compute -hosts in the current datacenter.` - -var poolCreateHelp = ` -POOL may be an absolute or relative path to a resource pool. The parent of the -specified POOL must be an existing resource pool. If a relative path is -specified, it is resolved with respect to the current datacenter's "host" -folder (i.e. /ha-datacenter/host). The basename of the specified POOL is used -as the name for the new resource pool. - -The same globbing rules that apply to the "ls" command apply here. For example, -the path to the parent resource pool in POOL may be specified as "*/Resources" -to expand to the root resource pools on all (clustered) compute hosts in the -current datacenter. - -For example: - */Resources/test Create resource pool "test" on all (clustered) - compute hosts in the current datacenter. - somehost/Resources/*/nested Create resource pool "nested" in every - resource pool that is a direct descendant of - the root resource pool on "somehost".` diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/govc/pool/info.go juju-core-2.0.2/src/github.com/juju/govmomi/govc/pool/info.go --- juju-core-2.0.0/src/github.com/juju/govmomi/govc/pool/info.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/govc/pool/info.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,138 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package pool - -import ( - "flag" - "fmt" - "io" - "text/tabwriter" - - "github.com/juju/govmomi/govc/cli" - "github.com/juju/govmomi/govc/flags" - "github.com/juju/govmomi/property" - "github.com/juju/govmomi/vim25/mo" - "github.com/juju/govmomi/vim25/types" - "golang.org/x/net/context" -) - -type info struct { - *flags.DatacenterFlag - *flags.OutputFlag -} - -func init() { - cli.Register("pool.info", &info{}) -} - -func (cmd *info) Register(f *flag.FlagSet) {} - -func (cmd *info) Process() error { return nil } - -func (cmd *info) Usage() string { - return "POOL..." -} - -func (cmd *info) Description() string { - return "Retrieve information about one or more resource POOLs.\n" + poolNameHelp -} - -func (cmd *info) Run(f *flag.FlagSet) error { - if f.NArg() == 0 { - return flag.ErrHelp - } - - c, err := cmd.Client() - if err != nil { - return err - } - - finder, err := cmd.Finder() - if err != nil { - return err - } - - pools, err := finder.ResourcePoolList(context.TODO(), f.Args()...) - if err != nil { - return err - } - - var res infoResult - var props []string - - if cmd.OutputFlag.JSON { - props = nil - } else { - props = []string{ - "name", - "config.cpuAllocation", - "config.memoryAllocation", - "runtime.cpu", - "runtime.memory", - } - } - - for _, pool := range pools { - var p mo.ResourcePool - - pc := property.DefaultCollector(c) - err = pc.RetrieveOne(context.TODO(), pool.Reference(), props, &p) - if err != nil { - return err - } - - res.ResourcePools = append(res.ResourcePools, p) - } - - return cmd.WriteResult(&res) -} - -type infoResult struct { - ResourcePools []mo.ResourcePool -} - -func (r *infoResult) Write(w io.Writer) error { - tw := tabwriter.NewWriter(w, 2, 0, 2, ' ', 0) - - for _, pool := range r.ResourcePools { - fmt.Fprintf(tw, "Name:\t%s\n", pool.Name) - - writeInfo(tw, "CPU", "MHz", &pool.Runtime.Cpu, &pool.Config.CpuAllocation) - writeInfo(tw, "Mem", "MB", &pool.Runtime.Memory, &pool.Config.MemoryAllocation) - } - - return tw.Flush() -} - -func writeInfo(w io.Writer, name string, units string, ru *types.ResourcePoolResourceUsage, ra *types.ResourceAllocationInfo) { - usage := 100.0 * float64(ru.OverallUsage) / float64(ru.MaxUsage) - shares := "" - limit := "unlimited" - - if ra.Shares.Level == types.SharesLevelCustom { - shares = fmt.Sprintf(" (%d)", ra.Shares.Shares) - } - - if ra.Limit != -1 { - limit = fmt.Sprintf("%d%s", ra.Limit, units) - } - - fmt.Fprintf(w, " %s Usage:\t%d%s (%0.1f%%)\n", name, ru.OverallUsage, units, usage) - fmt.Fprintf(w, " %s Shares:\t%s%s\n", name, ra.Shares.Level, shares) - fmt.Fprintf(w, " %s Reservation:\t%d%s (expandable=%v)\n", name, ra.Reservation, units, ra.ExpandableReservation) - fmt.Fprintf(w, " %s Limit:\t%s\n", name, limit) -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/govc/pool/resource_config_spec.go juju-core-2.0.2/src/github.com/juju/govmomi/govc/pool/resource_config_spec.go --- juju-core-2.0.0/src/github.com/juju/govmomi/govc/pool/resource_config_spec.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/govc/pool/resource_config_spec.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,94 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package pool - -import ( - "flag" - "strconv" - "strings" - - "github.com/juju/govmomi/vim25/types" -) - -type sharesInfo types.SharesInfo - -func (s *sharesInfo) String() string { - return string(s.Level) -} - -func (s *sharesInfo) Set(val string) error { - switch val { - case string(types.SharesLevelNormal), string(types.SharesLevelLow), string(types.SharesLevelHigh): - s.Level = types.SharesLevel(val) - default: - n, err := strconv.Atoi(val) - if err != nil { - return err - } - - s.Level = types.SharesLevelCustom - s.Shares = n - } - - return nil -} - -func NewResourceConfigSpecFlag() *ResourceConfigSpecFlag { - f := new(ResourceConfigSpecFlag) - f.SetAllocation(func(a *types.ResourceAllocationInfo) { - a.Shares = new(types.SharesInfo) - }) - return f -} - -type ResourceConfigSpecFlag struct { - types.ResourceConfigSpec -} - -func (s *ResourceConfigSpecFlag) Process() error { return nil } - -func (s *ResourceConfigSpecFlag) Register(f *flag.FlagSet) { - opts := []struct { - name string - units string - *types.ResourceAllocationInfo - }{ - {"CPU", "MHz", &s.CpuAllocation}, - {"Memory", "MB", &s.MemoryAllocation}, - } - - for _, opt := range opts { - prefix := strings.ToLower(opt.name)[:3] - shares := (*sharesInfo)(opt.Shares) - - expandableReservation := false - if v := opt.ExpandableReservation; v != nil { - expandableReservation = *v - } - - f.Int64Var(&opt.Limit, prefix+".limit", 0, opt.name+" limit in "+opt.units) - f.Int64Var(&opt.Reservation, prefix+".reservation", 0, opt.name+" reservation in "+opt.units) - f.BoolVar(opt.ExpandableReservation, prefix+".expandable", expandableReservation, opt.name+" expandable reservation") - f.Var(shares, prefix+".shares", opt.name+" shares level or number") - } -} - -func (s *ResourceConfigSpecFlag) SetAllocation(f func(*types.ResourceAllocationInfo)) { - for _, a := range []*types.ResourceAllocationInfo{&s.CpuAllocation, &s.MemoryAllocation} { - f(a) - } -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/govc/README.md juju-core-2.0.2/src/github.com/juju/govmomi/govc/README.md --- juju-core-2.0.0/src/github.com/juju/govmomi/govc/README.md 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/govc/README.md 1970-01-01 00:00:00.000000000 +0000 @@ -1,91 +0,0 @@ -# govc - -govc is a vSphere CLI built on top of govmomi. - -## Installation - -You can find prebuilt govc binaries on the [releases page](https://github.com/vmware/govmomi/releases). - -Download and install a binary locally like this: - -```sh -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. - -```sh -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_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`. - -* `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 - -* [Upload ssh public key to a VM](examples/lib/ssh.sh) - -* [Create and configure a vCenter VM](examples/vcsa.sh) - -## Projects using govc - -* [Kubernetes vSphere Provider](https://github.com/GoogleCloudPlatform/kubernetes/tree/master/cluster/vsphere) - -## License - -govc is available under the [Apache 2 license](../LICENSE). diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/govc/test/boot_order_test.sh juju-core-2.0.2/src/github.com/juju/govmomi/govc/test/boot_order_test.sh --- juju-core-2.0.0/src/github.com/juju/govmomi/govc/test/boot_order_test.sh 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/govc/test/boot_order_test.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,75 +0,0 @@ -#!/bin/bash -e - -# This test is not run via bats. -# A VNC session will be opened to observe the VM boot order: -# 1) from floppy (followed by: eject floppy, reboot) -# 2) from cdrom (followed by: eject cdrom, reboot) -# 3) from network (will timeout) -# 4) from disk - -. $(dirname $0)/test_helper.bash - -upload_img -upload_iso - -id=$(new_ttylinux_vm) - -function cleanup() { - quit_vnc $vnc - govc vm.destroy $id - pkill -TERM -g $$ ^nc -} - -trap cleanup EXIT - -govc device.cdrom.add -vm $id > /dev/null -govc device.cdrom.insert -vm $id $GOVC_TEST_ISO - -govc device.floppy.add -vm $id > /dev/null -govc device.floppy.insert -vm $id $GOVC_TEST_IMG - -govc device.boot -vm $id -delay 1000 -order floppy,cdrom,ethernet,disk - -vnc=$(govc vm.vnc -port 21122 -password govmomi -enable "${id}" | awk '{print $2}') - -echo "booting from floppy..." -govc vm.power -on $id - -open_vnc $vnc - -sleep 10 - -govc vm.power -off $id - -govc device.floppy.eject -vm $id - -# this is ttylinux-live, notice the 'boot:' prompt vs 'login:' prompt when booted from disk -echo "booting from cdrom..." -govc vm.power -on $id - -sleep 10 - -govc vm.power -off $id - -govc device.cdrom.eject -vm $id - -host_ip=$(echo $vnc | awk -F@ '{print $2}' | awk -F: '{print $1}') -serial_port=33233 -govc device.serial.add -vm $id > /dev/null -govc device.serial.connect -vm $id $uri telnet://:$serial_port - -echo "booting from network, will timeout then boot from disk..." -govc vm.power -on $id - -# capture serial console -echo | nc $host_ip $serial_port 2>/dev/null & - -ip=$(govc vm.ip $id) - -echo "VM booted from disk (ip=$ip)" - -sleep 5 - -govc vm.power -s $id - -sleep 5 diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/govc/test/clean.sh juju-core-2.0.2/src/github.com/juju/govmomi/govc/test/clean.sh --- juju-core-2.0.0/src/github.com/juju/govmomi/govc/test/clean.sh 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/govc/test/clean.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,24 +0,0 @@ -#!/bin/bash -# -# Cleanup any artifacts created by govc -# - -. $(dirname $0)/test_helper.bash - -teardown - -datastore_rm() { - name=$1 - govc datastore.rm $name 2> /dev/null -} - -datastore_rm $GOVC_TEST_IMG -datastore_rm $GOVC_TEST_ISO -datastore_rm $GOVC_TEST_VMDK -datastore_rm $(echo $GOVC_TEST_VMDK | sed 's/.vmdk/-flat.vmdk/') - -# Recursively destroy all resource pools created by the test suite -govc ls host/*/Resources/govc-test-* | \ - xargs -rt govc pool.destroy -r - -govc datastore.ls diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/govc/test/cli.bats juju-core-2.0.2/src/github.com/juju/govmomi/govc/test/cli.bats --- juju-core-2.0.0/src/github.com/juju/govmomi/govc/test/cli.bats 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/govc/test/cli.bats 1970-01-01 00:00:00.000000000 +0000 @@ -1,19 +0,0 @@ -#!/usr/bin/env bats - -load test_helper - -@test "about" { - run govc about - assert_success - assert_line "Vendor: VMware, Inc." -} - -@test "login attempt without credentials" { - run govc about -u $(echo $GOVC_URL | awk -F@ '{print $2}') - assert_failure "Error: ServerFaultCode: Cannot complete login due to an incorrect user name or password." -} - -@test "connect to an endpoint with a non-supported API version" { - run env GOVC_MIN_API_VERSION=24.4 govc about - assert grep -q "^Error: Require API version 24.4," <<<${output} -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/govc/test/datacenter.bats juju-core-2.0.2/src/github.com/juju/govmomi/govc/test/datacenter.bats --- juju-core-2.0.0/src/github.com/juju/govmomi/govc/test/datacenter.bats 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/govc/test/datacenter.bats 1970-01-01 00:00:00.000000000 +0000 @@ -1,85 +0,0 @@ -#!/usr/bin/env bats - -load test_helper - -@test "create and destroy datacenters" { - vcsim_env - dcs=(`uuidgen` `uuidgen`) - run govc datacenter.create ${dcs[0]} ${dcs[1]} - assert_success - - for dc in ${dcs[*]}; do - run govc ls /$dc - assert_success - # //{vm,network,host,datastore} - [ ${#lines[@]} -eq 4 ] - done - - run govc datacenter.destroy ${dcs[0]} ${dcs[1]} - assert_success - - for dc in ${dcs[*]}; do - run govc ls /$dc - assert_success - [ ${#lines[@]} -eq 0 ] - done -} - -@test "destroy datacenter using glob" { - vcsim_env - prefix=test-dc - dcs=(${prefix}-`uuidgen` ${prefix}-`uuidgen`) - run govc datacenter.create ${dcs[0]} ${dcs[1]} - assert_success - - run govc datacenter.destroy ${prefix}-* - assert_success - - for dc in ${dcs[*]}; do - run govc ls /$dc - assert_success - [ ${#lines[@]} -eq 0 ] - done -} - -@test "destroy datacenter that doesn't exist" { - vcsim_env - dc=$(uuidgen) - - run govc datacenter.destroy $dc - assert_success -} - -@test "create datacenter that already exists" { - vcsim_env - dc=$(uuidgen) - - run govc datacenter.create $dc - assert_success - - run govc datacenter.create $dc - assert_success - - run govc datacenter.destroy $dc - assert_success -} - -@test "fails when datacenter name not specified" { - run govc datacenter.create - assert_failure - - run govc datacenter.destroy - assert_failure -} - -@test "fails when operation attempted on standalone ESX host" { - run govc datacenter.create something - assert_failure - assert_output "Error: ServerFaultCode: The operation is not supported on the object." -} - -@test "fails when attempting to destroy ha-datacenter" { - run govc datacenter.destroy ha-datacenter - assert_failure - assert_output "Error: The operation is not supported on the object." -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/govc/test/datastore.bats juju-core-2.0.2/src/github.com/juju/govmomi/govc/test/datastore.bats --- juju-core-2.0.0/src/github.com/juju/govmomi/govc/test/datastore.bats 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/govc/test/datastore.bats 1970-01-01 00:00:00.000000000 +0000 @@ -1,66 +0,0 @@ -#!/usr/bin/env bats - -load test_helper - -upload_file() { - file=$(mktemp --tmpdir govc-test-XXXXX) - name=$(basename ${file}) - echo "Hello world!" > ${file} - - run govc datastore.upload "${file}" "${name}" - assert_success - - rm -f "${file}" - echo "${name}" -} - -@test "datastore.ls" { - name=$(upload_file) - - # Single argument - run govc datastore.ls "${name}" - assert_success - [ ${#lines[@]} -eq 1 ] - - # Multiple arguments - run govc datastore.ls "${name}" "${name}" - assert_success - [ ${#lines[@]} -eq 2 ] - - # Pattern argument - run govc datastore.ls "./govc-test-*" - assert_success - [ ${#lines[@]} -ge 1 ] - - # Long listing - run govc datastore.ls -l "./govc-test-*" - assert_success - assert_equal "13" $(awk '{ print $1 }' <<<${output}) -} - -@test "datastore.rm" { - name=$(upload_file) - - # Not found is a failure - run govc datastore.rm "${name}.notfound" - assert_failure - assert_matches "Error: File .* was not found" "${output}" - - # Not found is NOT a failure with the force flag - run govc datastore.rm -f "${name}.notfound" - assert_success - assert_empty "${output}" - - # Verify the file is present - run govc datastore.ls "${name}" - assert_success - - # Delete the file - run govc datastore.rm "${name}" - assert_success - assert_empty "${output}" - - # Verify the file is gone - run govc datastore.ls "${name}" - assert_failure -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/govc/test/device.bats juju-core-2.0.2/src/github.com/juju/govmomi/govc/test/device.bats --- juju-core-2.0.0/src/github.com/juju/govmomi/govc/test/device.bats 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/govc/test/device.bats 1970-01-01 00:00:00.000000000 +0000 @@ -1,199 +0,0 @@ -#!/usr/bin/env bats - -load test_helper - -@test "device.ls" { - vm=$(new_empty_vm) - - result=$(govc device.ls -vm $vm | grep ethernet-0 | wc -l) - [ $result -eq 1 ] -} - -@test "device.info" { - vm=$(new_empty_vm) - - run govc device.info -vm $vm ide-200 - assert_success - - run govc device.info -vm $vm ide-20000 - assert_failure -} - -@test "device.boot" { - vm=$(new_ttylinux_vm) - - result=$(govc device.ls -vm $vm -boot | wc -l) - [ $result -eq 0 ] - - run govc device.boot -vm $vm -order floppy,cdrom,ethernet,disk - assert_success - - result=$(govc device.ls -vm $vm -boot | wc -l) - [ $result -eq 2 ] - - run govc device.cdrom.add -vm $vm - assert_success - - run govc device.floppy.add -vm $vm - assert_success - - run govc device.boot -vm $vm -order floppy,cdrom,ethernet,disk - assert_success - - result=$(govc device.ls -vm $vm -boot | wc -l) - [ $result -eq 4 ] -} - -@test "device.cdrom" { - vm=$(new_empty_vm) - - result=$(govc device.ls -vm $vm | grep cdrom- | wc -l) - [ $result -eq 0 ] - - run govc device.cdrom.add -vm $vm - assert_success - id=$output - - result=$(govc device.ls -vm $vm | grep $id | wc -l) - [ $result -eq 1 ] - - run govc device.info -vm $vm $id - assert_success - - run govc device.cdrom.insert -vm $vm -device $id x.iso - assert_success - - run govc device.info -vm $vm $id - assert_line "Summary: ISO [${GOVC_DATASTORE}] x.iso" - - run govc device.disconnect -vm $vm $id - assert_success - - run govc device.connect -vm $vm $id - assert_success - - run govc device.remove -vm $vm $id - assert_success - - run govc device.disconnect -vm $vm $id - assert_failure "Error: device '$id' not found" - - run govc device.cdrom.insert -vm $vm -device $id x.iso - assert_failure "Error: device '$id' not found" - - run govc device.remove -vm $vm $id - assert_failure "Error: device '$id' not found" -} - -@test "device.floppy" { - vm=$(new_empty_vm) - - result=$(govc device.ls -vm $vm | grep floppy- | wc -l) - [ $result -eq 0 ] - - run govc device.floppy.add -vm $vm - assert_success - id=$output - - result=$(govc device.ls -vm $vm | grep $id | wc -l) - [ $result -eq 1 ] - - run govc device.info -vm $vm $id - assert_success - - run govc device.floppy.insert -vm $vm -device $id x.img - assert_success - - run govc device.info -vm $vm $id - assert_line "Summary: Image [${GOVC_DATASTORE}] x.img" - - run govc device.disconnect -vm $vm $id - assert_success - - run govc device.connect -vm $vm $id - assert_success - - run govc device.remove -vm $vm $id - assert_success - - run govc device.disconnect -vm $vm $id - assert_failure "Error: device '$id' not found" - - run govc device.floppy.insert -vm $vm -device $id x.img - assert_failure "Error: device '$id' not found" - - run govc device.remove -vm $vm $id - assert_failure "Error: device '$id' not found" -} - -@test "device.serial" { - vm=$(new_empty_vm) - - result=$(govc device.ls -vm $vm | grep serial- | wc -l) - [ $result -eq 0 ] - - run govc device.serial.add -vm $vm - assert_success - id=$output - - result=$(govc device.ls -vm $vm | grep $id | wc -l) - [ $result -eq 1 ] - - run govc device.info -vm $vm $id - assert_success - - uri=telnet://:33233 - run govc device.serial.connect -vm $vm -device $id $uri - assert_success - - run govc device.info -vm $vm $id - assert_line "Summary: Remote $uri" - - run govc device.serial.disconnect -vm $vm -device $id - assert_success - - run govc device.info -vm $vm $id - assert_line "Summary: Remote localhost:0" - - run govc device.disconnect -vm $vm $id - assert_success - - run govc device.connect -vm $vm $id - assert_success - - run govc device.remove -vm $vm $id - assert_success - - run govc device.disconnect -vm $vm $id - assert_failure "Error: device '$id' not found" - - run govc device.serial.connect -vm $vm -device $id $uri - assert_failure "Error: device '$id' not found" - - run govc device.remove -vm $vm $id - assert_failure "Error: device '$id' not found" -} - -@test "device.scsi" { - vm=$(new_empty_vm) - - result=$(govc device.ls -vm $vm | grep lsilogic- | wc -l) - [ $result -eq 1 ] - - run govc device.scsi.add -vm $vm - assert_success - id=$output - - result=$(govc device.ls -vm $vm | grep $id | wc -l) - [ $result -eq 1 ] - - result=$(govc device.ls -vm $vm | grep lsilogic- | wc -l) - [ $result -eq 2 ] - - run govc device.scsi.add -vm $vm -type pvscsi - assert_success - id=$output - - result=$(govc device.ls -vm $vm | grep $id | wc -l) - [ $result -eq 1 ] -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/govc/test/esxbox/Vagrantfile juju-core-2.0.2/src/github.com/juju/govmomi/govc/test/esxbox/Vagrantfile --- juju-core-2.0.0/src/github.com/juju/govmomi/govc/test/esxbox/Vagrantfile 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/govc/test/esxbox/Vagrantfile 1970-01-01 00:00:00.000000000 +0000 @@ -1,27 +0,0 @@ -# -*- mode: ruby -*- -# vi: set ft=ruby : - -Vagrant.configure("2") do |config| - config.ssh.insert_key = false - config.ssh.default.username = "root" - config.ssh.shell = "sh" - config.vm.hostname = "esxbox" - - config.vm.box = "esxi55" - config.vm.synced_folder ".", "/vagrant", disabled: true - config.vm.network "forwarded_port", guest: 443, host: 18443 - - [:vmware_fusion, :vmware_workstation].each do |name| - config.vm.provider name do |v,override| - v.vmx["memsize"] = "4096" - end - end - - config.vm.provision "shell", privileged: false, :inline => </dev/null - run govc import.ovf ./images/${TTYLINUX_NAME}.ovf - assert_success - popd >/dev/null - - run govc vm.destroy ${TTYLINUX_NAME} - assert_success -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/govc/test/license.bats juju-core-2.0.2/src/github.com/juju/govmomi/govc/test/license.bats --- juju-core-2.0.0/src/github.com/juju/govmomi/govc/test/license.bats 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/govc/test/license.bats 1970-01-01 00:00:00.000000000 +0000 @@ -1,33 +0,0 @@ -#!/usr/bin/env bats - -load test_helper - -get_key() { - jq ".[] | select(.LicenseKey == \"$1\")" -} - -get_property() { - jq -r ".Properties[] | select(.Key == \"$1\") | .Value" -} - -@test "license.add" { - run govc license.add -json 00000-00000-00000-00000-00001 00000-00000-00000-00000-00002 - assert_success - - # Expect to see an entry for both the first and the second key - assert_equal "License is not valid for this product" $(get_key 00000-00000-00000-00000-00001 <<<${output} | get_property diagnostic) - assert_equal "License is not valid for this product" $(get_key 00000-00000-00000-00000-00002 <<<${output} | get_property diagnostic) -} - -@test "license.remove" { - run govc license.remove -json 00000-00000-00000-00000-00001 - assert_success -} - -@test "license.list" { - run govc license.list -json - assert_success - - # Expect the test instance to run in evaluation mode - assert_equal "Evaluation Mode" $(get_key 00000-00000-00000-00000-00000 <<<$output | jq -r ".Name") -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/govc/test/ls.bats juju-core-2.0.2/src/github.com/juju/govmomi/govc/test/ls.bats --- juju-core-2.0.0/src/github.com/juju/govmomi/govc/test/ls.bats 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/govc/test/ls.bats 1970-01-01 00:00:00.000000000 +0000 @@ -1,93 +0,0 @@ -#!/usr/bin/env bats - -load test_helper - -@test "ls" { - run govc ls - assert_success - # /dc/{vm,network,host,datastore} - [ ${#lines[@]} -ge 4 ] - - run govc ls host - assert_success - [ ${#lines[@]} -ge 1 ] - - run govc ls enoent - assert_success - [ ${#lines[@]} -eq 0 ] -} - -@test "ls vm" { - vm=$(new_empty_vm) - - run govc ls vm - assert_success - [ ${#lines[@]} -ge 1 ] - - run govc ls vm/$vm - assert_success - [ ${#lines[@]} -eq 1 ] - - run govc ls /*/vm/$vm - assert_success - [ ${#lines[@]} -eq 1 ] -} - -@test "ls network" { - run govc ls network - assert_success - [ ${#lines[@]} -ge 1 ] - - local path=${lines[0]} - run govc ls $path - assert_success - [ ${#lines[@]} -eq 1 ] - - run govc ls network/$(basename $path) - assert_success - [ ${#lines[@]} -eq 1 ] - - run govc ls /*/network/$(basename $path) - assert_success - [ ${#lines[@]} -eq 1 ] -} - -@test "ls multi ds" { - vcsim_env - - run govc ls - assert_success - # /DC0/{vm,network,host,datastore} - [ ${#lines[@]} -eq 4 ] - - run govc ls /DC* - assert_success - # /DC[0,1]/{vm,network,host,datastore} - [ ${#lines[@]} -eq 8 ] - - # here 'vm' is relative to /DC0 - run govc ls vm - assert_success - [ ${#lines[@]} -gt 0 ] - - unset GOVC_DATACENTER - - run govc ls - assert_success - # /DC[0,1] - [ ${#lines[@]} -eq 2 ] - - run govc ls -dc enoent - assert_failure - [ ${#lines[@]} -gt 0 ] - - # here 'vm' is relative to '/' - so there are no matches - run govc ls vm - assert_success - [ ${#lines[@]} -eq 0 ] - - # ls all vms in all datacenters - run govc ls */vm - assert_success - [ ${#lines[@]} -gt 0 ] -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/govc/test/network.bats juju-core-2.0.2/src/github.com/juju/govmomi/govc/test/network.bats --- juju-core-2.0.0/src/github.com/juju/govmomi/govc/test/network.bats 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/govc/test/network.bats 1970-01-01 00:00:00.000000000 +0000 @@ -1,119 +0,0 @@ -#!/usr/bin/env bats - -load test_helper - -@test "network dvs backing" { - vcsim_env - - # DVS backed network by default (from vcsim_env) - vm=$(new_empty_vm) - - eth0=$(govc device.ls -vm $vm | grep ethernet- | awk '{print $1}') - run govc device.info -vm $vm $eth0 - assert_success - - summary=$(govc device.info -vm $vm $eth0 | grep Summary: | awk '{print $2}') - assert_equal "DVSwitch:" $summary - - run govc device.remove -vm $vm $eth0 - assert_success - - eth0=$(govc device.ls -vm $vm | grep ethernet- | awk '{print $1}') - [ -z "$eth0" ] - - # Standard network backing - run govc vm.network.add -vm $vm -net "VM Network" - assert_success - - eth0=$(govc device.ls -vm $vm | grep ethernet- | awk '{print $1}') - - run govc device.info -vm $vm $eth0 - assert_success - - summary=$(govc device.info -vm $vm $eth0 | grep Summary: | awk -F: '{print $2}') - assert_equal "VM Network" $(collapse_ws $summary) - - run govc device.remove -vm $vm $eth0 - assert_success - - run govc device.remove -vm $vm $eth0 - assert_failure "Error: device '$eth0' not found" -} - -@test "network change backing" { - vcsim_env - - vm=$(new_empty_vm) - - eth0=$(govc device.ls -vm $vm | grep ethernet- | awk '{print $1}') - run govc vm.network.change -vm $vm $eth0 enoent - assert_failure "Error: network 'enoent' not found" - - run govc vm.network.change -vm $vm enoent "VM Network" - assert_failure "Error: device 'enoent' not found" - - run govc vm.network.change -vm $vm $eth0 "VM Network" - assert_success - - run govc vm.network.change -vm $vm $eth0 - assert_success - - unset GOVC_NETWORK - run govc vm.network.change -vm $vm $eth0 - assert_failure "Error: please specify a network" - - run govc vm.network.change -vm $vm -net "VM Network" $eth0 - assert_success -} - -@test "network standard backing" { - vm=$(new_empty_vm) - - run govc device.info -vm $vm ethernet-0 - assert_success - - run govc device.remove -vm $vm ethernet-0 - assert_success - - run govc device.info -vm $vm ethernet-0 - assert_failure - - run govc vm.network.add -vm $vm enoent - assert_failure "Error: network 'enoent' not found" - - run govc vm.network.add -vm $vm "VM Network" - assert_success - - run govc device.info -vm $vm ethernet-0 - assert_success -} - -@test "network adapter" { - vm=$(new_id) - run govc vm.create -on=false -net.adapter=enoent $vm - assert_failure "Error: unknown ethernet card type 'enoent'" - - vm=$(new_id) - run govc vm.create -on=false -net.adapter=vmxnet3 $vm - assert_success - - eth0=$(govc device.ls -vm $vm | grep ethernet- | awk '{print $1}') - type=$(govc device.info -vm $vm $eth0 | grep Type: | awk -F: '{print $2}') - assert_equal "VirtualVmxnet3" $(collapse_ws $type) - - run govc vm.network.add -vm $vm -net.adapter e1000e "VM Network" - assert_success - - eth1=$(govc device.ls -vm $vm | grep ethernet- | grep -v $eth0 | awk '{print $1}') - type=$(govc device.info -vm $vm $eth1 | grep Type: | awk -F: '{print $2}') - assert_equal "VirtualE1000e" $(collapse_ws $type) -} - -@test "network flag required" { - vcsim_env - - # -net flag is required when there are multiple networks - unset GOVC_NETWORK - run govc vm.create -on=false $(new_id) - assert_failure "Error: please specify a network" -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/govc/test/pool.bats juju-core-2.0.2/src/github.com/juju/govmomi/govc/test/pool.bats --- juju-core-2.0.0/src/github.com/juju/govmomi/govc/test/pool.bats 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/govc/test/pool.bats 1970-01-01 00:00:00.000000000 +0000 @@ -1,232 +0,0 @@ -#!/usr/bin/env bats - -load test_helper - -@test "pool.create" { - path="*/Resources/$(new_id)/$(new_id)" - run govc pool.create $path - assert_failure - assert_line "Error: cannot create resource pool '$(basename ${path})': parent not found" - - id=$(new_id) - path="*/Resources/$id" - run govc pool.create -cpu.shares low -mem.reservation 500 $path - assert_success - - run govc pool.info $path - assert_success - - assert_line "Name: $id" - assert_line "CPU Shares: low" - assert_line "Mem Reservation: 500MB (expandable=true)" - - run govc pool.destroy $path - assert_success -} - -@test "pool.create multiple" { - id=$(new_id) - path="*/Resources/$id" - govc pool.create $path - - # Create multiple parent pools with multiple arguments (without globbing) - run govc pool.create $path/a $path/b - assert_success - result=$(govc ls "host/$path/*" | wc -l) - [ $result -eq 2 ] - - # Create multiple child pools with one argument (with globbing) - run govc pool.create $path/*/{a,b} - assert_success - result=$(govc ls "host/$path/*/*" | wc -l) - [ $result -eq 4 ] - - # Clean up - run govc pool.destroy $path/*/* $path/* $path - assert_success -} - -@test "pool.change" { - id=$(new_id) - path="*/Resources/$id" - govc pool.create $path - - run govc pool.change -mem.shares high $path - assert_success - run govc pool.info $path - assert_success - assert_line "Mem Shares: high" - assert_line "CPU Shares: normal" - - nid=$(new_id) - run govc pool.change -name $nid $path - assert_success - path="*/Resources/$nid" - - run govc pool.info $path - assert_success - assert_line "Name: $nid" - - run govc pool.destroy $path - assert_success -} - -@test "pool.change multiple" { - id=$(new_id) - path="*/Resources/$id" - govc pool.create $path - - # Create some nested pools so that we can test changing multiple in one call - govc pool.create $path/{a,b} $path/{a,b}/test - - # Test precondition - run govc pool.info $path/a/test - assert_success - assert_line "Name: test" - run govc pool.info $path/b/test - assert_success - assert_line "Name: test" - - # Change name of both test pools - run govc pool.change -name hello $path/*/test - assert_success - - # Test postcondition - run govc pool.info $path/a/hello - assert_success - assert_line "Name: hello" - run govc pool.info $path/b/hello - assert_success - assert_line "Name: hello" - - # Clean up - govc pool.destroy $path/a/hello - govc pool.destroy $path/a - govc pool.destroy $path/b/hello - govc pool.destroy $path/b - govc pool.destroy $path -} - -@test "pool.destroy" { - id=$(new_id) - - # should not be any existing test pools - result=$(govc ls "host/*/Resources/govc-test-*" | wc -l) - [ $result -eq 0 ] - - # parent pool - path="*/Resources/$id" - run govc pool.create $path - assert_success - - result=$(govc ls "host/$path/*" | wc -l) - [ $result -eq 0 ] - - # child pools - run govc pool.create $path/$(new_id) - assert_success - - run govc pool.create $path/$(new_id) - assert_success - - # 2 child pools - result=$(govc ls "host/$path/*" | wc -l) - [ $result -eq 2 ] - - # 1 parent pool - result=$(govc ls "host/*/Resources/govc-test-*" | wc -l) - [ $result -eq 1 ] - - run govc pool.destroy -r $path - assert_success - - # if we didn't -r, the child pools would end up here - result=$(govc ls "host/*/Resources/govc-test-*" | wc -l) - [ $result -eq 0 ] -} - -@test "pool.destroy multiple" { - id=$(new_id) - path="*/Resources/$id" - govc pool.create $path - - # Create some nested pools so that we can test destroying multiple in one call - govc pool.create $path/{a,b} - - # Test precondition - result=$(govc ls "host/$path/*" | wc -l) - [ $result -eq 2 ] - - # Destroy both pools - run govc pool.destroy $path/{a,b} - assert_success - - # Test postcondition - result=$(govc ls "host/$path/*" | wc -l) - [ $result -eq 0 ] - - # Clean up - govc pool.destroy $path -} - -@test "vm.create -pool" { - # test with full inventory path to pools - parent_path=$(govc ls 'host/*/Resources') - parent_name=$(basename $parent_path) - [ "$parent_name" = "Resources" ] - - child_name=$(new_id) - child_path="$parent_path/$child_name" - - grand_child_name=$(new_id) - grand_child_path="$child_path/$grand_child_name" - - run govc pool.create $parent_path/$child_name{,/$grand_child_name} - assert_success - - for path in $parent_path $child_path $grand_child_path - do - run govc vm.create -on=false -pool $path $(new_id) - assert_success - done - - # test with glob inventory path to pools - parent_path="*/$parent_name" - child_path="$parent_path/$child_name" - grand_child_path="$child_path/$grand_child_name" - - for path in $grand_child_path $child_path - do - run govc pool.destroy $path - assert_success - done -} - -@test "vm.create -pool host" { - id=$(new_id) - - path=$(govc ls host) - - run govc vm.create -on=false -pool enoent $id - assert_failure "Error: resource pool 'enoent' not found" - - run govc vm.create -on=false -pool $path $id - assert_success -} - -@test "vm.create -pool cluster" { - vcsim_env - - id=$(new_id) - - path=$(dirname $GOVC_HOST) - - unset GOVC_HOST - unset GOVC_RESOURCE_POOL - - run govc vm.create -on=false -pool enoent $id - assert_failure "Error: resource pool 'enoent' not found" - - run govc vm.create -on=false -pool $path $id - assert_success -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/govc/test/README.md juju-core-2.0.2/src/github.com/juju/govmomi/govc/test/README.md --- juju-core-2.0.0/src/github.com/juju/govmomi/govc/test/README.md 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/govc/test/README.md 1970-01-01 00:00:00.000000000 +0000 @@ -1,64 +0,0 @@ -# Functional tests for govc - -## Bats - -Install [Bats](https://github.com/sstephenson/bats/) - -## Download test images - -Some tests depend on [ttylinux](http://ttylinux.net) images, these can be downloaded by running: - -``` -./images/update.sh -``` - -These images are uploaded to the esxbox as needed by tests and can be -removed with the following command: - -``` -./clean.sh -``` - -## GOVC_TEST_URL - -The govc tests need an ESX instance to run against. The default -`GOVC_TEST_URL` is that of the vagrant box in the *esxbox* directory: - -``` -(cd esxbox && vagrant up) -``` - -Any other ESX box can be used by exporting the following variable: - -``` -export GOVC_TEST_URL=user:pass@hostname -``` - -## vCenter Simulator - -Some tests require vCenter and depend on the Vagrant box in the -*vcsim* directory. These tests are skipped if the vcsim box is not -running. To enable these tests: - -``` -(cd vcsim && vagrant up) -``` - -## Running tests - -The *govc* binary should be in your `PATH`; the test helper also prepends ../govc to `PATH`. - -The tests can be run from any directory, as *govc* is found related to -`PATH` and *images* are found relative to `$BATS_TEST_DIRNAME`. - -The entire suite can be run with the following command: - -``` -bats . -``` - -Or individually, for example: - -``` -./cli.bats -``` diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/govc/test/test_helper.bash juju-core-2.0.2/src/github.com/juju/govmomi/govc/test/test_helper.bash --- juju-core-2.0.0/src/github.com/juju/govmomi/govc/test/test_helper.bash 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/govc/test/test_helper.bash 1970-01-01 00:00:00.000000000 +0000 @@ -1,230 +0,0 @@ -GOVC_TEST_URL=${GOVC_TEST_URL-"https://root:vagrant@localhost:18443/sdk"} -export GOVC_URL=$GOVC_TEST_URL -export GOVC_DATASTORE=datastore1 -export GOVC_NETWORK="VM Network" -export GOVC_INSECURE=true - -if [ -z "$BATS_TEST_DIRNAME" ] -then - BATS_TEST_DIRNAME=$(dirname ${BASH_SOURCE}) -fi - -# canonicalize -readlink=$(type -p greadlink readlink | head -1) -BATS_TEST_DIRNAME=$($readlink -nf $BATS_TEST_DIRNAME) - -GOVC_IMAGES=$BATS_TEST_DIRNAME/images -TTYLINUX_NAME=ttylinux-pc_i486-16.1 - -GOVC_TEST_VMDK_SRC=$GOVC_IMAGES/${TTYLINUX_NAME}-disk1.vmdk -GOVC_TEST_VMDK=$(basename $GOVC_TEST_VMDK_SRC) - -GOVC_TEST_ISO_SRC=$GOVC_IMAGES/${TTYLINUX_NAME}.iso -GOVC_TEST_ISO=$(basename $GOVC_TEST_ISO_SRC) - -GOVC_TEST_IMG_SRC=$GOVC_IMAGES/floppybird.img -GOVC_TEST_IMG=$(basename $GOVC_TEST_IMG_SRC) - -PATH="$(dirname $BATS_TEST_DIRNAME):$PATH" - -teardown() { - govc ls vm | grep govc-test- | xargs -r govc vm.destroy - govc datastore.ls | grep govc-test- | awk '{print ($NF)}' | xargs -n1 -r govc datastore.rm -} - -new_id() { - echo "govc-test-$(uuidgen)" -} - -import_ttylinux_vmdk() { - # TODO: fix datastore.ls do we don't need grep - govc datastore.ls | grep -q $GOVC_TEST_VMDK || \ - govc import.vmdk $GOVC_TEST_VMDK_SRC > /dev/null -} - -datastore_upload() { - src=$1 - dst=$(basename $src) - # TODO: fix datastore.ls do we don't need grep - govc datastore.ls | grep -q $dst || \ - govc datastore.upload $src $dst > /dev/null -} - -upload_img() { - datastore_upload $GOVC_TEST_IMG_SRC -} - -upload_iso() { - datastore_upload $GOVC_TEST_ISO_SRC -} - -new_ttylinux_vm() { - import_ttylinux_vmdk # TODO: make this part of vagrant provision - id=$(new_id) - govc vm.create -m 32 -disk $GOVC_TEST_VMDK -disk.controller ide -on=false $id - echo $id -} - -new_empty_vm() { - id=$(new_id) - govc vm.create -on=false $id - echo $id -} - -vm_power_state() { - govc vm.info "$1" | grep "Power state:" | awk -F: '{print $2}' | collapse_ws -} - -# exports an enviroment for using vcsim if running, otherwise skips the calling test. -vcsim_env() { - if [ "$(uname)" == "Darwin" ] - then - PATH="/Applications/VMware Fusion.app/Contents/Library:$PATH" - fi - - if [ "$(vmrun list | grep $BATS_TEST_DIRNAME/vcsim | wc -l)" -eq 1 ] - then - export GOVC_URL=https://root:vmware@localhost:16443/sdk \ - GOVC_DATACENTER=DC0 \ - GOVC_DATASTORE=GlobalDS_0 \ - GOVC_HOST=/DC0/host/DC0_C0/DC0_C0_H0 \ - GOVC_RESOURCE_POOL=/DC0/host/DC0_C0/Resources \ - GOVC_NETWORK=/DC0/network/DC0_DVPG0 - else - skip "requires vcsim" - fi -} - -quit_vnc() { - if [ "$(uname)" = "Darwin" ] - then - osascript <&2 - return 1 -} - -assert_success() { - if [ "$status" -ne 0 ]; then - flunk "command failed with exit status $status: $output" - elif [ "$#" -gt 0 ]; then - assert_output "$1" - fi -} - -assert_failure() { - if [ "$status" -ne 1 ]; then - flunk $(printf "expected failed exit status=1, got status=%d" $status) - elif [ "$#" -gt 0 ]; then - assert_output "$1" - fi -} - -assert_equal() { - if [ "$1" != "$2" ]; then - { echo "expected: $1" - echo "actual: $2" - } | flunk - fi -} - -assert_output() { - local expected - if [ $# -eq 0 ]; then expected="$(cat -)" - else expected="$1" - fi - assert_equal "$expected" "$output" -} - -assert_matches() { - local pattern="${1}" - local actual="${2}" - - if [ $# -eq 1 ]; then - actual="$(cat -)" - fi - - if ! grep -q "${pattern}" <<<"${actual}"; then - { echo "pattern: ${pattern}" - echo "actual: ${actual}" - } | flunk - fi -} - -assert_empty() { - local actual="${1}" - - if [ $# -eq 0 ]; then - actual="$(cat -)" - fi - - if [ -n "${actual}" ]; then - { echo "actual: ${actual}" - } | flunk - fi -} - -assert_line() { - if [ "$1" -ge 0 ] 2>/dev/null; then - assert_equal "$2" "$(collapse_ws ${lines[$1]})" - else - local line - for line in "${lines[@]}"; do - if [ "$(collapse_ws $line)" = "$1" ]; then return 0; fi - done - flunk "expected line \`$1'" - fi -} - -refute_line() { - if [ "$1" -ge 0 ] 2>/dev/null; then - local num_lines="${#lines[@]}" - if [ "$1" -lt "$num_lines" ]; then - flunk "output has $num_lines lines" - fi - else - local line - for line in "${lines[@]}"; do - if [ "$line" = "$1" ]; then - flunk "expected to not find line \`$line'" - fi - done - fi -} - -assert() { - if ! "$@"; then - flunk "failed: $@" - fi -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/govc/test/vcsim/provision.sh juju-core-2.0.2/src/github.com/juju/govmomi/govc/test/vcsim/provision.sh --- juju-core-2.0.0/src/github.com/juju/govmomi/govc/test/vcsim/provision.sh 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/govc/test/vcsim/provision.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,30 +0,0 @@ -PATH=$PATH:/sbin:/usr/sbin:/usr/local/sbin - -echo "Creating vcsim model..." -cat > /etc/vmware-vpx/vcsim/model/initInventory-govc.cfg < - - 2 - 3 - 3 - 2 - 2 - 3 - 3 - 4 - 3 - 2 - - -EOF - -cat > /etc/vmware-vpx/vcsim/model/vcsim-default.cfg < -true -vcsim/model/initInventory-govc.cfg - -EOF - -echo "Starting VC simulator..." -vmware-vcsim-stop -vmware-vcsim-start default diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/govc/test/vcsim/Vagrantfile juju-core-2.0.2/src/github.com/juju/govmomi/govc/test/vcsim/Vagrantfile --- juju-core-2.0.0/src/github.com/juju/govmomi/govc/test/vcsim/Vagrantfile 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/govc/test/vcsim/Vagrantfile 1970-01-01 00:00:00.000000000 +0000 @@ -1,23 +0,0 @@ -# -*- mode: ruby -*- -# vi: set ft=ruby : - -# VCSA with VC simulator enabled. -# 'vagrant provision' will erase any existing inventory and -# populate with the config in ./provision.sh - -Vagrant.configure("2") do |config| - config.vm.hostname = "vcsim" - - config.vm.box = "vcsa" - config.vm.synced_folder ".", "/vagrant", disabled: true - - config.vm.provision "shell", path: "provision.sh" - - config.vm.network "forwarded_port", guest: 443, host: 16443 - - [:vmware_fusion, :vmware_workstation].each do |name| - config.vm.provider name do |v,override| - v.vmx["memsize"] = "4096" - end - end -end diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/govc/test/vm.bats juju-core-2.0.2/src/github.com/juju/govmomi/govc/test/vm.bats --- juju-core-2.0.0/src/github.com/juju/govmomi/govc/test/vm.bats 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/govc/test/vm.bats 1970-01-01 00:00:00.000000000 +0000 @@ -1,260 +0,0 @@ -#!/usr/bin/env bats - -load test_helper - -@test "vm.ip" { - id=$(new_ttylinux_vm) - - run govc vm.power -on $id - assert_success - - run govc vm.ip $id - assert_success -} - -@test "vm.ip -esxcli" { - id=$(new_ttylinux_vm) - - run govc vm.power -on $id - assert_success - - run govc vm.ip -esxcli $id - assert_success - - ip_esxcli=$output - - run govc vm.ip $id - assert_success - ip_tools=$output - - assert_equal $ip_esxcli $ip_tools -} - -@test "vm.create" { - id=$(new_ttylinux_vm) - - run govc vm.power -on $id - assert_success - - result=$(govc device.ls -vm $vm | grep disk- | wc -l) - [ $result -eq 0 ] - - result=$(govc device.ls -vm $vm | grep cdrom- | wc -l) - [ $result -eq 0 ] -} - -@test "vm.change" { - id=$(new_ttylinux_vm) - - run govc vm.change -g ubuntu64Guest -m 1024 -c 2 -vm $id - assert_success - - run govc vm.info $id - assert_success - assert_line "Guest name: Ubuntu Linux (64-bit)" - assert_line "Memory: 1024MB" - assert_line "CPU: 2 vCPU(s)" - - nid=$(new_id) - run govc vm.change -name $nid -vm $id - assert_success - - run govc vm.info $id - [ ${#lines[@]} -eq 0 ] - - run govc vm.info $nid - [ ${#lines[@]} -gt 0 ] -} - -@test "vm.power" { - vm=$(new_ttylinux_vm) - - run vm_power_state $vm - assert_success "poweredOff" - - run govc vm.power $vm - assert_failure - - run govc vm.power -on -off $vm - assert_failure - - run govc vm.power -on $vm - assert_success - run vm_power_state $vm - assert_success "poweredOn" - - run govc vm.power -suspend $vm - assert_success - run vm_power_state $vm - assert_success "suspended" - - run govc vm.power -on $vm - assert_success - run vm_power_state $vm - assert_success "poweredOn" -} - -@test "vm.create pvscsi" { - vm=$(new_id) - govc vm.create -on=false -disk.controller pvscsi $vm - - result=$(govc device.ls -vm $vm | grep pvscsi- | wc -l) - [ $result -eq 1 ] - - result=$(govc device.ls -vm $vm | grep lsilogic- | wc -l) - [ $result -eq 0 ] -} - -@test "vm.create in cluster" { - vcsim_env - - # using GOVC_HOST and its resource pool - run govc vm.create -on=false $(new_id) - assert_success - - # using no -host and the default resource pool for DC0 - unset GOVC_HOST - run govc vm.create -on=false $(new_id) - assert_success -} - -@test "vm.info" { - local num=3 - - local prefix=$(new_id) - - for x in $(seq $num) - do - local id="${prefix}-${x}" - run govc vm.create -on=false $id - assert_success - - local found=$(govc vm.info $id | grep Name: | wc -l) - [ "$found" -eq 1 ] - done - - # test find slice - local found=$(govc vm.info ${prefix}-* | grep Name: | wc -l) - [ "$found" -eq $num ] -} - -@test "vm.create linked ide disk" { - vm=$(new_id) - run govc vm.create -disk $GOVC_TEST_VMDK -disk.controller ide -on=false $vm - assert_success - - run govc device.info -vm $vm disk-200-0 - assert_success - assert_line "Controller: ide-200" -} - -@test "vm.create linked scsi disk" { - vm=$(new_id) - - run govc vm.create -disk enoent -on=false $vm - assert_failure "Error: datastore file does not exist" - - run govc vm.create -disk $GOVC_TEST_VMDK -on=false $vm - assert_success - - run govc device.info -vm $vm disk-1000-0 - assert_success - assert_line "Controller: lsilogic-1000" - assert_line "Parent: [datastore1] $GOVC_TEST_VMDK" - assert_line "File: [datastore1] $vm/${vm}.vmdk" -} - -@test "vm.create scsi disk" { - vm=$(new_id) - - run govc vm.create -disk enoent -on=false $vm - assert_failure "Error: datastore file does not exist" - - run govc vm.create -disk $GOVC_TEST_VMDK -on=false -link=false $vm - assert_success - - run govc device.info -vm $vm disk-1000-0 - assert_success - assert_line "Controller: lsilogic-1000" - refute_line "Parent: [datastore1] $GOVC_TEST_VMDK" - assert_line "File: [datastore1] $GOVC_TEST_VMDK" -} - -@test "vm.create iso" { - upload_iso - - vm=$(new_id) - - run govc vm.create -iso enoent -on=false $vm - assert_failure "Error: datastore file does not exist" - - run govc vm.create -iso $GOVC_TEST_ISO -on=false $vm - assert_success - - run govc device.info -vm $vm cdrom-3000 - assert_success - assert_line "Controller: ide-200" - assert_line "Summary: ISO [datastore1] $GOVC_TEST_ISO" -} - -@test "vm.disk.create empty vm" { - vm=$(new_empty_vm) - - local name=$(new_id) - - run govc vm.disk.create -vm $vm -name $name -size 1G - assert_success - result=$(govc device.ls -vm $vm | grep disk- | wc -l) - [ $result -eq 1 ] - - name=$(new_id) - - run govc vm.disk.create -vm $vm -name $name -controller lsilogic-1000 -size 2G - assert_success - result=$(govc device.ls -vm $vm | grep disk- | wc -l) - [ $result -eq 2 ] -} - -@test "vm.disk.create" { - import_ttylinux_vmdk - vm=$(new_id) - - govc vm.create -disk $GOVC_TEST_VMDK -on=false $vm - result=$(govc device.ls -vm $vm | grep disk- | wc -l) - [ $result -eq 1 ] - - local name=$(new_id) - - run govc vm.disk.create -vm $vm -name $name -size 1G - assert_success - result=$(govc device.ls -vm $vm | grep disk- | wc -l) - [ $result -eq 2 ] - - run govc vm.disk.create -vm $vm -name $name -size 1G - assert_success # TODO: should fail? - result=$(govc device.ls -vm $vm | grep disk- | wc -l) - [ $result -eq 2 ] -} - -@test "vm.disk.attach" { - import_ttylinux_vmdk - vm=$(new_id) - - govc vm.create -disk $GOVC_TEST_VMDK -on=false $vm - result=$(govc device.ls -vm $vm | grep disk- | wc -l) - [ $result -eq 1 ] - - run govc import.vmdk $GOVC_TEST_VMDK_SRC $vm - assert_success - - run govc vm.disk.attach -vm $vm -link=false -disk enoent.vmdk - assert_failure "Error: File [datastore1] enoent.vmdk was not found" - - run govc vm.disk.attach -vm $vm -disk enoent.vmdk - assert_failure "Error: Invalid configuration for device '0'." - - run govc vm.disk.attach -vm $vm -disk $vm/$GOVC_TEST_VMDK -controller lsilogic-1000 - assert_success - result=$(govc device.ls -vm $vm | grep disk- | wc -l) - [ $result -eq 2 ] -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/govc/version/command.go juju-core-2.0.2/src/github.com/juju/govmomi/govc/version/command.go --- juju-core-2.0.0/src/github.com/juju/govmomi/govc/version/command.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/govc/version/command.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,44 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package version - -import ( - "flag" - "fmt" - - "github.com/juju/govmomi/govc/cli" - "github.com/juju/govmomi/govc/flags" -) - -var gitVersion string - -type version struct { - *flags.EmptyFlag -} - -func init() { - if gitVersion == "" { - gitVersion = "unknown" - } - - cli.Register("version", &version{}) -} - -func (c *version) Run(f *flag.FlagSet) error { - fmt.Printf("govc %s\n", gitVersion) - return nil -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/govc/vm/change.go juju-core-2.0.2/src/github.com/juju/govmomi/govc/vm/change.go --- juju-core-2.0.0/src/github.com/juju/govmomi/govc/vm/change.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/govc/vm/change.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,63 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package vm - -import ( - "flag" - - "github.com/juju/govmomi/govc/cli" - "github.com/juju/govmomi/govc/flags" - "github.com/juju/govmomi/vim25/types" - "golang.org/x/net/context" -) - -type change struct { - *flags.VirtualMachineFlag - - types.VirtualMachineConfigSpec -} - -func init() { - cli.Register("vm.change", &change{}) -} - -func (cmd *change) Register(f *flag.FlagSet) { - f.Int64Var(&cmd.MemoryMB, "m", 0, "Size in MB of memory") - f.IntVar(&cmd.NumCPUs, "c", 0, "Number of CPUs") - f.StringVar(&cmd.GuestId, "g", "", "Guest OS") - f.StringVar(&cmd.Name, "name", "", "Display name") -} - -func (cmd *change) Process() error { return nil } - -func (cmd *change) Run(f *flag.FlagSet) error { - vm, err := cmd.VirtualMachine() - if err != nil { - return err - } - - if vm == nil { - return flag.ErrHelp - } - - task, err := vm.Reconfigure(context.TODO(), cmd.VirtualMachineConfigSpec) - if err != nil { - return err - } - - return task.Wait(context.TODO()) -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/govc/vm/create.go juju-core-2.0.2/src/github.com/juju/govmomi/govc/vm/create.go --- juju-core-2.0.0/src/github.com/juju/govmomi/govc/vm/create.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/govc/vm/create.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,236 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package vm - -import ( - "flag" - "fmt" - - "github.com/juju/govmomi/govc/cli" - "github.com/juju/govmomi/govc/flags" - "github.com/juju/govmomi/object" - "github.com/juju/govmomi/vim25" - "github.com/juju/govmomi/vim25/types" - "golang.org/x/net/context" -) - -type create struct { - *flags.ClientFlag - *flags.DatacenterFlag - *flags.DatastoreFlag - *flags.ResourcePoolFlag - *flags.HostSystemFlag - *flags.NetworkFlag - - memory int - cpus int - guestID string - link bool - on bool - force bool - iso string - disk string - controller string - - Client *vim25.Client - Datacenter *object.Datacenter - Datastore *object.Datastore - ResourcePool *object.ResourcePool - HostSystem *object.HostSystem -} - -func init() { - cli.Register("vm.create", &create{}) -} - -func (cmd *create) Register(f *flag.FlagSet) { - f.IntVar(&cmd.memory, "m", 1024, "Size in MB of memory") - f.IntVar(&cmd.cpus, "c", 1, "Number of CPUs") - f.StringVar(&cmd.guestID, "g", "otherGuest", "Guest OS") - f.BoolVar(&cmd.link, "link", true, "Link specified disk") - f.BoolVar(&cmd.on, "on", true, "Power on VM. Default is true if -disk argument is given.") - f.BoolVar(&cmd.force, "force", false, "Create VM if vmx already exists") - f.StringVar(&cmd.iso, "iso", "", "Path to ISO") - f.StringVar(&cmd.controller, "disk.controller", "scsi", "Disk controller type") - f.StringVar(&cmd.disk, "disk", "", "Disk path name") -} - -func (cmd *create) Process() error { return nil } - -func (cmd *create) Run(f *flag.FlagSet) error { - var err error - - if len(f.Args()) != 1 { - return flag.ErrHelp - } - - cmd.Client, err = cmd.ClientFlag.Client() - if err != nil { - return err - } - - cmd.Datacenter, err = cmd.DatacenterFlag.Datacenter() - if err != nil { - return err - } - - cmd.Datastore, err = cmd.DatastoreFlag.Datastore() - if err != nil { - return err - } - - cmd.HostSystem, err = cmd.HostSystemFlag.HostSystemIfSpecified() - if err != nil { - return err - } - - if cmd.HostSystem != nil { - if cmd.ResourcePool, err = cmd.HostSystem.ResourcePool(context.TODO()); err != nil { - return err - } - } else { - // -host is optional - if cmd.ResourcePool, err = cmd.ResourcePoolFlag.ResourcePool(); err != nil { - return err - } - } - - for _, file := range []*string{&cmd.iso, &cmd.disk} { - if *file != "" { - _, err = cmd.Stat(*file) - if err != nil { - return err - } - } - } - - task, err := cmd.createVM(f.Arg(0)) - if err != nil { - return err - } - - info, err := task.WaitForResult(context.TODO(), nil) - if err != nil { - return err - } - - vm := object.NewVirtualMachine(cmd.Client, info.Result.(types.ManagedObjectReference)) - - if err := cmd.addDevices(vm); err != nil { - return err - } - - if cmd.on { - task, err := vm.PowerOn(context.TODO()) - if err != nil { - return err - } - - _, err = task.WaitForResult(context.TODO(), nil) - if err != nil { - return err - } - } - - return nil -} - -func (cmd *create) addDevices(vm *object.VirtualMachine) error { - devices, err := vm.Device(context.TODO()) - if err != nil { - return err - } - - var add []types.BaseVirtualDevice - - if cmd.disk != "" { - controller, err := devices.FindDiskController(cmd.controller) - if err != nil { - return err - } - - disk := devices.CreateDisk(controller, cmd.Datastore.Path(cmd.disk)) - - if cmd.link { - disk = devices.ChildDisk(disk) - } - - add = append(add, disk) - } - - if cmd.iso != "" { - ide, err := devices.FindIDEController("") - if err != nil { - return err - } - - cdrom, err := devices.CreateCdrom(ide) - if err != nil { - return err - } - - add = append(add, devices.InsertIso(cdrom, cmd.Datastore.Path(cmd.iso))) - } - - netdev, err := cmd.NetworkFlag.Device() - if err != nil { - return err - } - - add = append(add, netdev) - - return vm.AddDevice(context.TODO(), add...) -} - -func (cmd *create) createVM(name string) (*object.Task, error) { - spec := types.VirtualMachineConfigSpec{ - Name: name, - GuestId: cmd.guestID, - Files: &types.VirtualMachineFileInfo{VmPathName: fmt.Sprintf("[%s]", cmd.Datastore.Name())}, - NumCPUs: cmd.cpus, - MemoryMB: int64(cmd.memory), - } - - if !cmd.force { - vmxPath := fmt.Sprintf("%s/%s.vmx", name, name) - - _, err := cmd.Stat(vmxPath) - if err == nil { - dsPath := cmd.Datastore.Path(vmxPath) - return nil, fmt.Errorf("File %s already exists", dsPath) - } - } - - if cmd.controller != "ide" { - scsi, err := object.SCSIControllerTypes().CreateSCSIController(cmd.controller) - if err != nil { - return nil, err - } - - spec.DeviceChange = append(spec.DeviceChange, &types.VirtualDeviceConfigSpec{ - Operation: types.VirtualDeviceConfigSpecOperationAdd, - Device: scsi, - }) - } - - folders, err := cmd.Datacenter.Folders(context.TODO()) - if err != nil { - return nil, err - } - - return folders.VmFolder.CreateVM(context.TODO(), spec, cmd.ResourcePool, cmd.HostSystem) -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/govc/vm/destroy.go juju-core-2.0.2/src/github.com/juju/govmomi/govc/vm/destroy.go --- juju-core-2.0.0/src/github.com/juju/govmomi/govc/vm/destroy.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/govc/vm/destroy.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,70 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package vm - -import ( - "flag" - - "github.com/juju/govmomi/govc/cli" - "github.com/juju/govmomi/govc/flags" - "golang.org/x/net/context" -) - -type destroy struct { - *flags.ClientFlag - *flags.SearchFlag -} - -func init() { - cli.Register("vm.destroy", &destroy{}) -} - -func (cmd *destroy) Register(f *flag.FlagSet) { - cmd.SearchFlag = flags.NewSearchFlag(flags.SearchVirtualMachines) -} - -func (cmd *destroy) Process() error { return nil } - -func (cmd *destroy) Run(f *flag.FlagSet) error { - vms, err := cmd.VirtualMachines(f.Args()) - if err != nil { - return err - } - - for _, vm := range vms { - task, err := vm.PowerOff(context.TODO()) - if err != nil { - return err - } - - // Ignore error since the VM may already been in powered off state. - // vm.Destroy will fail if the VM is still powered on. - _ = task.Wait(context.TODO()) - - task, err = vm.Destroy(context.TODO()) - if err != nil { - return err - } - - err = task.Wait(context.TODO()) - if err != nil { - return err - } - } - - return nil -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/govc/vm/disk/attach.go juju-core-2.0.2/src/github.com/juju/govmomi/govc/vm/disk/attach.go --- juju-core-2.0.0/src/github.com/juju/govmomi/govc/vm/disk/attach.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/govc/vm/disk/attach.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,97 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package disk - -import ( - "flag" - - "github.com/juju/govmomi/govc/cli" - "github.com/juju/govmomi/govc/flags" - "github.com/juju/govmomi/vim25/types" - "golang.org/x/net/context" -) - -type attach struct { - *flags.DatastoreFlag - *flags.VirtualMachineFlag - - persist bool - link bool - disk string - controller string -} - -func init() { - cli.Register("vm.disk.attach", &attach{}) -} - -func (cmd *attach) Register(f *flag.FlagSet) { - f.BoolVar(&cmd.persist, "persist", true, "Persist attached disk") - f.BoolVar(&cmd.link, "link", true, "Link specified disk") - f.StringVar(&cmd.controller, "controller", "", "Disk controller") - f.StringVar(&cmd.disk, "disk", "", "Disk path name") -} - -func (cmd *attach) Process() error { return nil } - -func (cmd *attach) Run(f *flag.FlagSet) error { - vm, err := cmd.VirtualMachine() - if err != nil { - return err - } - - if vm == nil { - return flag.ErrHelp - } - - ds, err := cmd.Datastore() - if err != nil { - return err - } - - devices, err := vm.Device(context.TODO()) - if err != nil { - return err - } - - controller, err := devices.FindDiskController(cmd.controller) - if err != nil { - return err - } - - disk := devices.CreateDisk(controller, ds.Path(cmd.disk)) - backing := disk.Backing.(*types.VirtualDiskFlatVer2BackingInfo) - - if cmd.link { - if cmd.persist { - backing.DiskMode = string(types.VirtualDiskModeIndependent_persistent) - } else { - backing.DiskMode = string(types.VirtualDiskModeIndependent_persistent) - } - - disk = devices.ChildDisk(disk) - return vm.AddDevice(context.TODO(), disk) - } - - if cmd.persist { - backing.DiskMode = string(types.VirtualDiskModePersistent) - } else { - backing.DiskMode = string(types.VirtualDiskModeNonpersistent) - } - - return vm.AddDevice(context.TODO(), disk) -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/govc/vm/disk/byte_value.go juju-core-2.0.2/src/github.com/juju/govmomi/govc/vm/disk/byte_value.go --- juju-core-2.0.0/src/github.com/juju/govmomi/govc/vm/disk/byte_value.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/govc/vm/disk/byte_value.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,83 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package disk - -import ( - "errors" - "fmt" - "regexp" - "strconv" - "strings" -) - -const ( - B = 1 - KiB = 1024 * B - MiB = 1024 * KiB - GiB = 1024 * MiB - TiB = 1024 * GiB - PiB = 1024 * TiB -) - -type ByteValue struct { - Bytes int64 -} - -func (b *ByteValue) String() string { - v := b.Bytes - suffix := "B" - - for _, s := range []string{"K", "M", "G", "T", "P"} { - if v < 1024 { - break - } - - suffix = fmt.Sprintf("%siB", s) - v /= 1024 - } - - return fmt.Sprintf("%d%s", v, suffix) -} - -var bytesRegexp = regexp.MustCompile(`^(?i)(\d+)([KMGTP]?)(ib|b)?$`) - -func (b *ByteValue) Set(s string) error { - m := bytesRegexp.FindStringSubmatch(s) - if len(m) == 0 { - return errors.New("invalid byte value") - } - - v32, _ := strconv.Atoi(m[1]) - v := int64(v32) - switch strings.ToUpper(m[2]) { - case "K": - v *= 1024 - case "M": - v *= 1024 * 1024 - case "G": - v *= 1024 * 1024 * 1024 - case "T": - v *= 1024 * 1024 * 1024 * 1024 - case "P": - v *= 1024 * 1024 * 1024 * 1024 * 1024 - case "E": - v *= 1024 * 1024 * 1024 * 1024 * 1024 * 1024 - } - - b.Bytes = v - return nil -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/govc/vm/disk/byte_value_test.go juju-core-2.0.2/src/github.com/juju/govmomi/govc/vm/disk/byte_value_test.go --- juju-core-2.0.0/src/github.com/juju/govmomi/govc/vm/disk/byte_value_test.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/govc/vm/disk/byte_value_test.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,88 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package disk - -import "testing" - -func TestByteValue(t *testing.T) { - var tests = []struct { - In string - OutStr string - OutInt int64 - }{ - { - In: "345", - OutStr: "345B", - OutInt: 345, - }, - { - In: "345K", - OutStr: "345KiB", - OutInt: 345 * KiB, - }, - { - In: "345kib", - OutStr: "345KiB", - OutInt: 345 * KiB, - }, - { - In: "345KiB", - OutStr: "345KiB", - OutInt: 345 * KiB, - }, - { - In: "345M", - OutStr: "345MiB", - OutInt: 345 * MiB, - }, - { - In: "345G", - OutStr: "345GiB", - OutInt: 345 * GiB, - }, - { - In: "345T", - OutStr: "345TiB", - OutInt: 345 * TiB, - }, - { - In: "345P", - OutStr: "345PiB", - OutInt: 345 * PiB, - }, - } - - v := ByteValue{} - - for _, test := range tests { - err := v.Set(test.In) - if err != nil { - t.Errorf("Error: %s", err) - continue - } - - if v.Bytes != test.OutInt { - t.Errorf("Int: %d", v.Bytes) - continue - } - - if v.String() != test.OutStr { - t.Errorf("String: %s", test.OutStr) - continue - } - } -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/govc/vm/disk/create.go juju-core-2.0.2/src/github.com/juju/govmomi/govc/vm/disk/create.go --- juju-core-2.0.0/src/github.com/juju/govmomi/govc/vm/disk/create.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/govc/vm/disk/create.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,97 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package disk - -import ( - "errors" - "flag" - - "github.com/juju/govmomi/govc/cli" - "github.com/juju/govmomi/govc/flags" - "golang.org/x/net/context" -) - -type create struct { - *flags.DatastoreFlag - *flags.OutputFlag - *flags.VirtualMachineFlag - - controller string - Name string - Bytes ByteValue -} - -func init() { - cli.Register("vm.disk.create", &create{}) -} - -func (cmd *create) Register(f *flag.FlagSet) { - err := (&cmd.Bytes).Set("10G") - if err != nil { - panic(err) - } - - f.StringVar(&cmd.controller, "controller", "", "Disk controller") - f.StringVar(&cmd.Name, "name", "", "Name for new disk") - f.Var(&cmd.Bytes, "size", "Size of new disk") -} - -func (cmd *create) Process() error { return nil } - -func (cmd *create) Run(f *flag.FlagSet) error { - var err error - - vm, err := cmd.VirtualMachine() - if err != nil { - return err - } - - if vm == nil { - return errors.New("please specify a vm") - } - - ds, err := cmd.Datastore() - if err != nil { - return err - } - - devices, err := vm.Device(context.TODO()) - if err != nil { - return err - } - - controller, err := devices.FindDiskController(cmd.controller) - if err != nil { - return err - } - - disk := devices.CreateDisk(controller, ds.Path(cmd.Name)) - - existing := devices.SelectByBackingInfo(disk.Backing) - - if len(existing) == 0 { - cmd.Log("Creating disk\n") - - disk.CapacityInKB = cmd.Bytes.Bytes / 1024 - - return vm.AddDevice(context.TODO(), disk) - } else { - cmd.Log("Disk already present\n") - } - - return nil -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/govc/vm/guest/auth.go juju-core-2.0.2/src/github.com/juju/govmomi/govc/vm/guest/auth.go --- juju-core-2.0.0/src/github.com/juju/govmomi/govc/vm/guest/auth.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/govc/vm/guest/auth.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,62 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package guest - -import ( - "flag" - "fmt" - "os" - "strings" - - "github.com/juju/govmomi/vim25/types" -) - -type AuthFlag struct { - auth types.NamePasswordAuthentication -} - -func (flag *AuthFlag) String() string { - return fmt.Sprintf("%s:%s", flag.auth.Username, strings.Repeat("x", len(flag.auth.Password))) -} - -func (flag *AuthFlag) Set(s string) error { - c := strings.Split(s, ":") - if len(c) > 0 { - flag.auth.Username = c[0] - if len(c) > 1 { - flag.auth.Password = c[1] - } - } - - return nil -} - -func (flag *AuthFlag) Register(f *flag.FlagSet) { - env := "GOVC_GUEST_LOGIN" - value := os.Getenv(env) - flag.Set(value) - usage := fmt.Sprintf("Guest VM credentials [%s]", env) - f.Var(flag, "l", usage) -} - -func (flag *AuthFlag) Process() error { - return nil -} - -func (flag *AuthFlag) Auth() types.BaseGuestAuthentication { - return &flag.auth -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/govc/vm/guest/chmod.go juju-core-2.0.2/src/github.com/juju/govmomi/govc/vm/guest/chmod.go --- juju-core-2.0.0/src/github.com/juju/govmomi/govc/vm/guest/chmod.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/govc/vm/guest/chmod.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,46 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package guest - -import ( - "flag" - - "github.com/juju/govmomi/govc/cli" - "golang.org/x/net/context" -) - -type chmod struct { - *GuestFlag - *FileAttrFlag -} - -func init() { - cli.Register("guest.chmod", &chmod{}) -} - -func (cmd *chmod) Register(f *flag.FlagSet) {} - -func (cmd *chmod) Process() error { return nil } - -func (cmd *chmod) Run(f *flag.FlagSet) error { - m, err := cmd.FileManager() - if err != nil { - return err - } - - return m.ChangeFileAttributes(context.TODO(), cmd.Auth(), f.Arg(0), cmd.Attr()) -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/govc/vm/guest/download.go juju-core-2.0.2/src/github.com/juju/govmomi/govc/vm/guest/download.go --- juju-core-2.0.0/src/github.com/juju/govmomi/govc/vm/guest/download.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/govc/vm/guest/download.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,76 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package guest - -import ( - "flag" - - "os" - - "github.com/juju/govmomi/govc/cli" - "golang.org/x/net/context" -) - -type download struct { - *GuestFlag - - overwrite bool -} - -func init() { - cli.Register("guest.download", &download{}) -} - -func (cmd *download) Register(f *flag.FlagSet) { - f.BoolVar(&cmd.overwrite, "f", false, "If set, the local destination file is clobbered") -} - -func (cmd *download) Process() error { - return nil -} - -func (cmd *download) Run(f *flag.FlagSet) error { - m, err := cmd.FileManager() - if err != nil { - return err - } - - src := f.Arg(0) - dst := f.Arg(1) - - _, err = os.Stat(dst) - if err == nil && !cmd.overwrite { - return os.ErrExist - } - - info, err := m.InitiateFileTransferFromGuest(context.TODO(), cmd.Auth(), src) - if err != nil { - return err - } - - u, err := cmd.ParseURL(info.Url) - if err != nil { - return err - } - - c, err := cmd.Client() - if err != nil { - return nil - } - - return c.Client.DownloadFile(dst, u, nil) -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/govc/vm/guest/file_attr.go juju-core-2.0.2/src/github.com/juju/govmomi/govc/vm/guest/file_attr.go --- juju-core-2.0.0/src/github.com/juju/govmomi/govc/vm/guest/file_attr.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/govc/vm/guest/file_attr.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,41 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package guest - -import ( - "flag" - - "github.com/juju/govmomi/vim25/types" -) - -type FileAttrFlag struct { - types.GuestPosixFileAttributes -} - -func (flag *FileAttrFlag) Register(f *flag.FlagSet) { - f.IntVar(&flag.OwnerId, "uid", 0, "User ID") - f.IntVar(&flag.GroupId, "gid", 0, "Group ID") - f.Int64Var(&flag.Permissions, "perm", 0, "File permissions") -} - -func (flag *FileAttrFlag) Process() error { - return nil -} - -func (flag *FileAttrFlag) Attr() types.BaseGuestFileAttributes { - return &flag.GuestPosixFileAttributes -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/govc/vm/guest/getenv.go juju-core-2.0.2/src/github.com/juju/govmomi/govc/vm/guest/getenv.go --- juju-core-2.0.0/src/github.com/juju/govmomi/govc/vm/guest/getenv.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/govc/vm/guest/getenv.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,55 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package guest - -import ( - "flag" - "fmt" - - "github.com/juju/govmomi/govc/cli" - "golang.org/x/net/context" -) - -type getenv struct { - *GuestFlag -} - -func init() { - cli.Register("guest.getenv", &getenv{}) -} - -func (cmd *getenv) Register(f *flag.FlagSet) {} - -func (cmd *getenv) Process() error { return nil } - -func (cmd *getenv) Run(f *flag.FlagSet) error { - m, err := cmd.ProcessManager() - if err != nil { - return err - } - - vars, err := m.ReadEnvironmentVariable(context.TODO(), cmd.Auth(), f.Args()) - if err != nil { - return err - } - - for _, v := range vars { - fmt.Printf("%s\n", v) - } - - return nil -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/govc/vm/guest/guest.go juju-core-2.0.2/src/github.com/juju/govmomi/govc/vm/guest/guest.go --- juju-core-2.0.0/src/github.com/juju/govmomi/govc/vm/guest/guest.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/govc/vm/guest/guest.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,90 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package guest - -import ( - "errors" - "flag" - - "net/url" - - "github.com/juju/govmomi/govc/flags" - "github.com/juju/govmomi/guest" - "github.com/juju/govmomi/object" - "golang.org/x/net/context" -) - -type GuestFlag struct { - *flags.ClientFlag - *flags.VirtualMachineFlag - - *AuthFlag -} - -func (flag *GuestFlag) Register(f *flag.FlagSet) {} - -func (flag *GuestFlag) Process() error { return nil } - -func (flag *GuestFlag) FileManager() (*guest.FileManager, error) { - c, err := flag.Client() - if err != nil { - return nil, err - } - - vm, err := flag.VirtualMachine() - if err != nil { - return nil, err - } - - o := guest.NewOperationsManager(c, vm.Reference()) - return o.FileManager(context.TODO()) -} - -func (flag *GuestFlag) ProcessManager() (*guest.ProcessManager, error) { - c, err := flag.Client() - if err != nil { - return nil, err - } - - vm, err := flag.VirtualMachine() - if err != nil { - return nil, err - } - - o := guest.NewOperationsManager(c, vm.Reference()) - return o.ProcessManager(context.TODO()) -} - -func (flag *GuestFlag) ParseURL(urlStr string) (*url.URL, error) { - c, err := flag.Client() - if err != nil { - return nil, err - } - - return c.Client.ParseURL(urlStr) -} - -func (flag *GuestFlag) VirtualMachine() (*object.VirtualMachine, error) { - vm, err := flag.VirtualMachineFlag.VirtualMachine() - if err != nil { - return nil, err - } - if vm == nil { - return nil, errors.New("no vm specified") - } - return vm, nil -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/govc/vm/guest/kill.go juju-core-2.0.2/src/github.com/juju/govmomi/govc/vm/guest/kill.go --- juju-core-2.0.0/src/github.com/juju/govmomi/govc/vm/guest/kill.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/govc/vm/guest/kill.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,55 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package guest - -import ( - "flag" - - "github.com/juju/govmomi/govc/cli" - "golang.org/x/net/context" -) - -type kill struct { - *GuestFlag - - pids pidSelector -} - -func init() { - cli.Register("guest.kill", &kill{}) -} - -func (cmd *kill) Register(f *flag.FlagSet) { - f.Var(&cmd.pids, "p", "Process ID") -} - -func (cmd *kill) Process() error { return nil } - -func (cmd *kill) Run(f *flag.FlagSet) error { - m, err := cmd.ProcessManager() - if err != nil { - return err - } - - for _, pid := range cmd.pids { - if err := m.TerminateProcess(context.TODO(), cmd.Auth(), pid); err != nil { - return err - } - } - - return nil -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/govc/vm/guest/ls.go juju-core-2.0.2/src/github.com/juju/govmomi/govc/vm/guest/ls.go --- juju-core-2.0.0/src/github.com/juju/govmomi/govc/vm/guest/ls.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/govc/vm/guest/ls.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,70 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package guest - -import ( - "flag" - "fmt" - "os" - "text/tabwriter" - - "github.com/juju/govmomi/govc/cli" - "golang.org/x/net/context" -) - -type ls struct { - *GuestFlag -} - -func init() { - cli.Register("guest.ls", &ls{}) -} - -func (cmd *ls) Register(f *flag.FlagSet) {} - -func (cmd *ls) Process() error { return nil } - -func (cmd *ls) Run(f *flag.FlagSet) error { - m, err := cmd.FileManager() - if err != nil { - return err - } - - offset := 0 - tw := tabwriter.NewWriter(os.Stdout, 3, 0, 2, ' ', 0) - - for { - info, err := m.ListFiles(context.TODO(), cmd.Auth(), f.Arg(0), offset, 0, f.Arg(1)) - if err != nil { - return err - } - - for _, f := range info.Files { - attr := f.Attributes.GetGuestFileAttributes() // TODO: GuestPosixFileAttributes - fmt.Fprintf(tw, "%d\t%s\t%s\n", f.Size, attr.ModificationTime.Format("Mon Jan 2 15:04:05 2006"), f.Path) - } - - _ = tw.Flush() - - if info.Remaining == 0 { - break - } - offset += len(info.Files) - } - - return nil -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/govc/vm/guest/mkdir.go juju-core-2.0.2/src/github.com/juju/govmomi/govc/vm/guest/mkdir.go --- juju-core-2.0.0/src/github.com/juju/govmomi/govc/vm/guest/mkdir.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/govc/vm/guest/mkdir.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,63 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package guest - -import ( - "flag" - - "github.com/juju/govmomi/govc/cli" - "github.com/juju/govmomi/vim25/soap" - "github.com/juju/govmomi/vim25/types" - "golang.org/x/net/context" -) - -type mkdir struct { - *GuestFlag - - createParents bool -} - -func init() { - cli.Register("guest.mkdir", &mkdir{}) -} - -func (cmd *mkdir) Register(f *flag.FlagSet) { - f.BoolVar(&cmd.createParents, "p", false, "Create intermediate directories as needed") -} - -func (cmd *mkdir) Process() error { return nil } - -func (cmd *mkdir) Run(f *flag.FlagSet) error { - m, err := cmd.FileManager() - if err != nil { - return err - } - - err = m.MakeDirectory(context.TODO(), cmd.Auth(), f.Arg(0), cmd.createParents) - - // ignore EEXIST if -p flag is given - if err != nil && cmd.createParents { - if soap.IsSoapFault(err) { - soapFault := soap.ToSoapFault(err) - if _, ok := soapFault.VimFault().(types.FileAlreadyExists); ok { - return nil - } - } - } - - return err -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/govc/vm/guest/mktemp.go juju-core-2.0.2/src/github.com/juju/govmomi/govc/vm/guest/mktemp.go --- juju-core-2.0.0/src/github.com/juju/govmomi/govc/vm/guest/mktemp.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/govc/vm/guest/mktemp.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,66 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package guest - -import ( - "flag" - "fmt" - - "github.com/juju/govmomi/govc/cli" - "golang.org/x/net/context" -) - -type mktemp struct { - *GuestFlag - - dir bool - prefix string - suffix string -} - -func init() { - cli.Register("guest.mktemp", &mktemp{}) -} - -func (cmd *mktemp) Register(f *flag.FlagSet) { - f.BoolVar(&cmd.dir, "d", false, "Make a directory instead of a file") - f.StringVar(&cmd.prefix, "t", "", "Prefix") - f.StringVar(&cmd.suffix, "s", "", "Suffix") -} - -func (cmd *mktemp) Process() error { return nil } - -func (cmd *mktemp) Run(f *flag.FlagSet) error { - m, err := cmd.FileManager() - if err != nil { - return err - } - - mk := m.CreateTemporaryFile - if cmd.dir { - mk = m.CreateTemporaryDirectory - } - - name, err := mk(context.TODO(), cmd.Auth(), cmd.prefix, cmd.suffix) - if err != nil { - return err - } - - fmt.Println(name) - - return nil -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/govc/vm/guest/ps.go juju-core-2.0.2/src/github.com/juju/govmomi/govc/vm/guest/ps.go --- juju-core-2.0.0/src/github.com/juju/govmomi/govc/vm/guest/ps.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/govc/vm/guest/ps.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,104 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package guest - -import ( - "flag" - "fmt" - "os" - "strconv" - "text/tabwriter" - - "github.com/juju/govmomi/govc/cli" - "golang.org/x/net/context" -) - -type ps struct { - *GuestFlag - - every bool - - pids pidSelector - uids uidSelector -} - -type pidSelector []int64 - -func (s *pidSelector) String() string { - return fmt.Sprint(*s) -} - -func (s *pidSelector) Set(value string) error { - v, err := strconv.ParseInt(value, 0, 64) - if err != nil { - return err - } - *s = append(*s, v) - return nil -} - -type uidSelector map[string]bool - -func (s uidSelector) String() string { - return "" -} - -func (s uidSelector) Set(value string) error { - s[value] = true - return nil -} - -func init() { - cli.Register("guest.ps", &ps{}) -} - -func (cmd *ps) Register(f *flag.FlagSet) { - cmd.uids = make(map[string]bool) - f.BoolVar(&cmd.every, "e", false, "Select all processes") - f.Var(&cmd.pids, "p", "Select by process ID") - f.Var(&cmd.uids, "U", "Select by process UID") -} - -func (cmd *ps) Process() error { return nil } - -func (cmd *ps) Run(f *flag.FlagSet) error { - m, err := cmd.ProcessManager() - if err != nil { - return err - } - - if !cmd.every && len(cmd.uids) == 0 { - cmd.uids[cmd.auth.Username] = true - } - - procs, err := m.ListProcesses(context.TODO(), cmd.Auth(), cmd.pids) - if err != nil { - return err - } - - tw := tabwriter.NewWriter(os.Stdout, 4, 0, 2, ' ', 0) - - fmt.Fprintf(tw, "%s\t%s\t%s\t%s\n", "UID", "PID", "STIME", "CMD") - - for _, p := range procs { - if cmd.every || cmd.uids[p.Owner] { - fmt.Fprintf(tw, "%s\t%d\t%s\t%s\n", p.Owner, p.Pid, p.StartTime.Format("15:04"), p.CmdLine) - } - } - - return tw.Flush() -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/govc/vm/guest/rmdir.go juju-core-2.0.2/src/github.com/juju/govmomi/govc/vm/guest/rmdir.go --- juju-core-2.0.0/src/github.com/juju/govmomi/govc/vm/guest/rmdir.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/govc/vm/guest/rmdir.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,49 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package guest - -import ( - "flag" - - "github.com/juju/govmomi/govc/cli" - "golang.org/x/net/context" -) - -type rmdir struct { - *GuestFlag - - recursive bool -} - -func init() { - cli.Register("guest.rmdir", &rmdir{}) -} - -func (cmd *rmdir) Register(f *flag.FlagSet) { - f.BoolVar(&cmd.recursive, "p", false, "Recursive removal") -} - -func (cmd *rmdir) Process() error { return nil } - -func (cmd *rmdir) Run(f *flag.FlagSet) error { - m, err := cmd.FileManager() - if err != nil { - return err - } - - return m.DeleteDirectory(context.TODO(), cmd.Auth(), f.Arg(0), cmd.recursive) -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/govc/vm/guest/rm.go juju-core-2.0.2/src/github.com/juju/govmomi/govc/vm/guest/rm.go --- juju-core-2.0.0/src/github.com/juju/govmomi/govc/vm/guest/rm.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/govc/vm/guest/rm.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,46 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package guest - -import ( - "flag" - - "github.com/juju/govmomi/govc/cli" - "golang.org/x/net/context" -) - -type rm struct { - *GuestFlag -} - -func init() { - cli.Register("guest.rm", &rm{}) -} - -func (cmd *rm) Register(f *flag.FlagSet) { -} - -func (cmd *rm) Process() error { return nil } - -func (cmd *rm) Run(f *flag.FlagSet) error { - m, err := cmd.FileManager() - if err != nil { - return err - } - - return m.DeleteFile(context.TODO(), cmd.Auth(), f.Arg(0)) -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/govc/vm/guest/start.go juju-core-2.0.2/src/github.com/juju/govmomi/govc/vm/guest/start.go --- juju-core-2.0.0/src/github.com/juju/govmomi/govc/vm/guest/start.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/govc/vm/guest/start.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,79 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package guest - -import ( - "flag" - "fmt" - "strings" - - "github.com/juju/govmomi/govc/cli" - "github.com/juju/govmomi/vim25/types" - "golang.org/x/net/context" -) - -type start struct { - *GuestFlag - - dir string - vars env -} - -type env []string - -func (e *env) String() string { - return fmt.Sprint(*e) -} - -func (e *env) Set(value string) error { - *e = append(*e, value) - return nil -} - -func init() { - cli.Register("guest.start", &start{}) -} - -func (cmd *start) Register(f *flag.FlagSet) { - f.StringVar(&cmd.dir, "C", "", "The absolute path of the working directory for the program to start") - f.Var(&cmd.vars, "e", "Set environment variable (key=val)") -} - -func (cmd *start) Process() error { return nil } - -func (cmd *start) Run(f *flag.FlagSet) error { - m, err := cmd.ProcessManager() - if err != nil { - return err - } - - spec := types.GuestProgramSpec{ - ProgramPath: f.Arg(0), - Arguments: strings.Join(f.Args()[1:], " "), - WorkingDirectory: cmd.dir, - EnvVariables: cmd.vars, - } - - pid, err := m.StartProgram(context.TODO(), cmd.Auth(), &spec) - if err != nil { - return err - } - - fmt.Printf("%d\n", pid) - - return nil -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/govc/vm/guest/upload.go juju-core-2.0.2/src/github.com/juju/govmomi/govc/vm/guest/upload.go --- juju-core-2.0.0/src/github.com/juju/govmomi/govc/vm/guest/upload.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/govc/vm/guest/upload.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,74 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package guest - -import ( - "flag" - "os" - - "github.com/juju/govmomi/govc/cli" - "golang.org/x/net/context" -) - -type upload struct { - *GuestFlag - *FileAttrFlag - - overwrite bool -} - -func init() { - cli.Register("guest.upload", &upload{}) -} - -func (cmd *upload) Register(f *flag.FlagSet) { - f.BoolVar(&cmd.overwrite, "f", false, "If set, the guest destination file is clobbered") -} - -func (cmd *upload) Process() error { return nil } - -func (cmd *upload) Run(f *flag.FlagSet) error { - m, err := cmd.FileManager() - if err != nil { - return err - } - - src := f.Arg(0) - dst := f.Arg(1) - - s, err := os.Stat(src) - if err != nil { - return err - } - - url, err := m.InitiateFileTransferToGuest(context.TODO(), cmd.Auth(), dst, cmd.Attr(), s.Size(), cmd.overwrite) - if err != nil { - return err - } - - u, err := cmd.ParseURL(url) - if err != nil { - return err - } - - c, err := cmd.Client() - if err != nil { - return nil - } - - return c.Client.UploadFile(src, u, nil) -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/govc/vm/info.go juju-core-2.0.2/src/github.com/juju/govmomi/govc/vm/info.go --- juju-core-2.0.0/src/github.com/juju/govmomi/govc/vm/info.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/govc/vm/info.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,122 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package vm - -import ( - "flag" - "fmt" - "io" - "os" - "text/tabwriter" - - "github.com/juju/govmomi/govc/cli" - "github.com/juju/govmomi/govc/flags" - "github.com/juju/govmomi/property" - "github.com/juju/govmomi/vim25/mo" - "golang.org/x/net/context" -) - -type info struct { - *flags.ClientFlag - *flags.OutputFlag - *flags.SearchFlag - - WaitForIP bool -} - -func init() { - cli.Register("vm.info", &info{}) -} - -func (cmd *info) Register(f *flag.FlagSet) { - cmd.SearchFlag = flags.NewSearchFlag(flags.SearchVirtualMachines) - - f.BoolVar(&cmd.WaitForIP, "waitip", false, "Wait for VM to acquire IP address") -} - -func (cmd *info) Process() error { return nil } - -func (cmd *info) Run(f *flag.FlagSet) error { - c, err := cmd.Client() - if err != nil { - return err - } - - vms, err := cmd.VirtualMachines(f.Args()) - if err != nil { - return err - } - - var res infoResult - var props []string - - if cmd.OutputFlag.JSON { - props = nil // Load everything - } else { - props = []string{"summary", "guest.ipAddress"} // Load summary - } - - for _, vm := range vms { - for { - var mvm mo.VirtualMachine - - pc := property.DefaultCollector(c) - err = pc.RetrieveOne(context.TODO(), vm.Reference(), props, &mvm) - if err != nil { - return err - } - - if cmd.WaitForIP && mvm.Guest.IpAddress == "" { - _, err = vm.WaitForIP(context.TODO()) - if err != nil { - return err - } - - // Reload virtual machine object - continue - } - - res.VirtualMachines = append(res.VirtualMachines, mvm) - break - } - } - - return cmd.WriteResult(&res) -} - -type infoResult struct { - VirtualMachines []mo.VirtualMachine -} - -func (r *infoResult) Write(w io.Writer) error { - tw := tabwriter.NewWriter(os.Stdout, 2, 0, 2, ' ', 0) - - for _, vm := range r.VirtualMachines { - s := vm.Summary - - fmt.Fprintf(tw, "Name:\t%s\n", s.Config.Name) - fmt.Fprintf(tw, " UUID:\t%s\n", s.Config.Uuid) - fmt.Fprintf(tw, " Guest name:\t%s\n", s.Config.GuestFullName) - fmt.Fprintf(tw, " Memory:\t%dMB\n", s.Config.MemorySizeMB) - fmt.Fprintf(tw, " CPU:\t%d vCPU(s)\n", s.Config.NumCpu) - fmt.Fprintf(tw, " Power state:\t%s\n", s.Runtime.PowerState) - fmt.Fprintf(tw, " Boot time:\t%s\n", s.Runtime.BootTime) - fmt.Fprintf(tw, " IP address:\t%s\n", s.Guest.IpAddress) - } - - return tw.Flush() -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/govc/vm/ip.go juju-core-2.0.2/src/github.com/juju/govmomi/govc/vm/ip.go --- juju-core-2.0.0/src/github.com/juju/govmomi/govc/vm/ip.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/govc/vm/ip.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,100 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package vm - -import ( - "flag" - "fmt" - "time" - - "github.com/juju/govmomi/govc/cli" - "github.com/juju/govmomi/govc/flags" - "github.com/juju/govmomi/govc/host/esxcli" - "github.com/juju/govmomi/object" - "golang.org/x/net/context" -) - -type ip struct { - *flags.OutputFlag - *flags.SearchFlag - - esx bool -} - -func init() { - cli.Register("vm.ip", &ip{}) -} - -func (cmd *ip) Register(f *flag.FlagSet) { - cmd.SearchFlag = flags.NewSearchFlag(flags.SearchVirtualMachines) - f.BoolVar(&cmd.esx, "esxcli", false, "Use esxcli instead of guest tools") -} - -func (cmd *ip) Process() error { return nil } - -func (cmd *ip) Run(f *flag.FlagSet) error { - c, err := cmd.Client() - if err != nil { - return err - } - - vms, err := cmd.VirtualMachines(f.Args()) - if err != nil { - return err - } - - var get func(*object.VirtualMachine) (string, error) - - if cmd.esx { - get = func(vm *object.VirtualMachine) (string, error) { - guest := esxcli.NewGuestInfo(c) - - ticker := time.NewTicker(time.Millisecond * 500) - defer ticker.Stop() - - for { - select { - case <-ticker.C: - ip, err := guest.IpAddress(vm) - if err != nil { - return "", err - } - - if ip != "0.0.0.0" { - return ip, nil - } - } - } - } - } else { - get = func(vm *object.VirtualMachine) (string, error) { - return vm.WaitForIP(context.TODO()) - } - } - - for _, vm := range vms { - ip, err := get(vm) - if err != nil { - return err - } - - // TODO(PN): Display inventory path to VM - fmt.Fprintf(cmd, "%s\n", ip) - } - - return nil -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/govc/vm/network/add.go juju-core-2.0.2/src/github.com/juju/govmomi/govc/vm/network/add.go --- juju-core-2.0.0/src/github.com/juju/govmomi/govc/vm/network/add.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/govc/vm/network/add.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,62 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package network - -import ( - "errors" - "flag" - - "github.com/juju/govmomi/govc/cli" - "github.com/juju/govmomi/govc/flags" - "golang.org/x/net/context" -) - -type add struct { - *flags.VirtualMachineFlag - *flags.NetworkFlag -} - -func init() { - cli.Register("vm.network.add", &add{}) -} - -func (cmd *add) Register(f *flag.FlagSet) {} - -func (cmd *add) Process() error { return nil } - -func (cmd *add) Run(f *flag.FlagSet) error { - vm, err := cmd.VirtualMachineFlag.VirtualMachine() - if err != nil { - return err - } - - if vm == nil { - return errors.New("please specify a vm") - } - - // Set network if specified as extra argument. - if f.NArg() > 0 { - _ = cmd.NetworkFlag.Set(f.Arg(0)) - } - - net, err := cmd.NetworkFlag.Device() - if err != nil { - return err - } - - return vm.AddDevice(context.TODO(), net) -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/govc/vm/network/change.go juju-core-2.0.2/src/github.com/juju/govmomi/govc/vm/network/change.go --- juju-core-2.0.0/src/github.com/juju/govmomi/govc/vm/network/change.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/govc/vm/network/change.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,82 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package network - -import ( - "errors" - "flag" - "fmt" - - "github.com/juju/govmomi/govc/cli" - "github.com/juju/govmomi/govc/flags" - "golang.org/x/net/context" -) - -type change struct { - *flags.VirtualMachineFlag - *flags.NetworkFlag -} - -func init() { - cli.Register("vm.network.change", &change{}) -} - -func (cmd *change) Register(f *flag.FlagSet) {} - -func (cmd *change) Process() error { return nil } - -func (cmd *change) Run(f *flag.FlagSet) error { - vm, err := cmd.VirtualMachineFlag.VirtualMachine() - if err != nil { - return err - } - - if vm == nil { - return errors.New("please specify a vm") - } - - name := f.Arg(0) - - if name == "" { - return errors.New("please specify a device name") - } - - // Set network if specified as extra argument. - if f.NArg() > 1 { - _ = cmd.NetworkFlag.Set(f.Arg(1)) - } - - devices, err := vm.Device(context.TODO()) - if err != nil { - return err - } - - net := devices.Find(name) - - if net == nil { - return fmt.Errorf("device '%s' not found", name) - } - - backing, err := cmd.NetworkFlag.Device() - if err != nil { - return err - } - - net.GetVirtualDevice().Backing = backing.GetVirtualDevice().Backing - - return vm.EditDevice(context.TODO(), net) -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/govc/vm/power.go juju-core-2.0.2/src/github.com/juju/govmomi/govc/vm/power.go --- juju-core-2.0.0/src/github.com/juju/govmomi/govc/vm/power.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/govc/vm/power.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,129 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package vm - -import ( - "flag" - "fmt" - - "github.com/juju/govmomi/govc/cli" - "github.com/juju/govmomi/govc/flags" - "github.com/juju/govmomi/object" - "golang.org/x/net/context" -) - -type power struct { - *flags.ClientFlag - *flags.SearchFlag - - On bool - Off bool - Reset bool - Reboot bool - Shutdown bool - Suspend bool - Force bool -} - -func init() { - cli.Register("vm.power", &power{}) -} - -func (cmd *power) Register(f *flag.FlagSet) { - cmd.SearchFlag = flags.NewSearchFlag(flags.SearchVirtualMachines) - - f.BoolVar(&cmd.On, "on", false, "Power on") - f.BoolVar(&cmd.Off, "off", false, "Power off") - f.BoolVar(&cmd.Reset, "reset", false, "Power reset") - f.BoolVar(&cmd.Suspend, "suspend", false, "Power suspend") - f.BoolVar(&cmd.Reboot, "r", false, "Reboot guest") - f.BoolVar(&cmd.Shutdown, "s", false, "Shutdown guest") - f.BoolVar(&cmd.Force, "force", false, "Force (ignore state error)") -} - -func (cmd *power) Process() error { - opts := []bool{cmd.On, cmd.Off, cmd.Reset, cmd.Suspend, cmd.Reboot, cmd.Shutdown} - selected := false - - for _, opt := range opts { - if opt { - if selected { - return flag.ErrHelp - } - selected = opt - } - } - - if !selected { - return flag.ErrHelp - } - - return nil -} - -func (cmd *power) Run(f *flag.FlagSet) error { - vms, err := cmd.VirtualMachines(f.Args()) - if err != nil { - return err - } - - for _, vm := range vms { - var task *object.Task - - switch { - case cmd.On: - fmt.Fprintf(cmd, "Powering on %s... ", vm.Reference()) - task, err = vm.PowerOn(context.TODO()) - case cmd.Off: - fmt.Fprintf(cmd, "Powering off %s... ", vm.Reference()) - task, err = vm.PowerOff(context.TODO()) - case cmd.Reset: - fmt.Fprintf(cmd, "Reset %s... ", vm.Reference()) - task, err = vm.Reset(context.TODO()) - case cmd.Suspend: - fmt.Fprintf(cmd, "Suspend %s... ", vm.Reference()) - task, err = vm.Suspend(context.TODO()) - case cmd.Reboot: - fmt.Fprintf(cmd, "Reboot guest %s... ", vm.Reference()) - err = vm.RebootGuest(context.TODO()) - case cmd.Shutdown: - fmt.Fprintf(cmd, "Shutdown guest %s... ", vm.Reference()) - err = vm.ShutdownGuest(context.TODO()) - } - - if err != nil { - return err - } - - if task != nil { - err = task.Wait(context.TODO()) - } - if err == nil { - fmt.Fprintf(cmd, "OK\n") - continue - } - - if cmd.Force { - fmt.Fprintf(cmd, "Error: %s\n", err) - continue - } - - return err - } - - return nil -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/govc/vm/question.go juju-core-2.0.2/src/github.com/juju/govmomi/govc/vm/question.go --- juju-core-2.0.0/src/github.com/juju/govmomi/govc/vm/question.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/govc/vm/question.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,92 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package vm - -import ( - "errors" - "flag" - "fmt" - - "github.com/juju/govmomi/govc/cli" - "github.com/juju/govmomi/govc/flags" - "github.com/juju/govmomi/property" - "github.com/juju/govmomi/vim25/mo" - "github.com/juju/govmomi/vim25/types" - "golang.org/x/net/context" -) - -type question struct { - *flags.VirtualMachineFlag - - answer string -} - -func init() { - cli.Register("vm.question", &question{}) -} - -func (cmd *question) Register(f *flag.FlagSet) { - f.StringVar(&cmd.answer, "answer", "", "Answer to question") -} - -func (cmd *question) Process() error { - return nil -} - -func (cmd *question) Run(f *flag.FlagSet) error { - c, err := cmd.Client() - if err != nil { - return err - } - - vm, err := cmd.VirtualMachine() - if err != nil { - return err - } - - if vm == nil { - return errors.New("No VM specified") - } - - var mvm mo.VirtualMachine - - pc := property.DefaultCollector(c) - err = pc.RetrieveOne(context.TODO(), vm.Reference(), []string{"runtime.question"}, &mvm) - if err != nil { - return err - } - - q := mvm.Runtime.Question - if q == nil { - fmt.Printf("No pending question\n") - return nil - } - - // Print question if no answer is specified - if cmd.answer == "" { - fmt.Printf("Question:\n%s\n\n", q.Text) - fmt.Printf("Possible answers:\n") - for _, e := range q.Choice.ChoiceInfo { - ed := e.(*types.ElementDescription) - fmt.Printf("%s) %s\n", ed.Key, ed.Description.Label) - } - return nil - } - - // Answer question - return vm.Answer(context.TODO(), q.Id, cmd.answer) -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/govc/vm/vnc.go juju-core-2.0.2/src/github.com/juju/govmomi/govc/vm/vnc.go --- juju-core-2.0.0/src/github.com/juju/govmomi/govc/vm/vnc.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/govc/vm/vnc.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,476 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package vm - -import ( - "encoding/json" - "flag" - "fmt" - "io" - "reflect" - "regexp" - "strconv" - "strings" - - "github.com/juju/govmomi/govc/cli" - "github.com/juju/govmomi/govc/flags" - "github.com/juju/govmomi/object" - "github.com/juju/govmomi/property" - "github.com/juju/govmomi/vim25" - "github.com/juju/govmomi/vim25/mo" - "github.com/juju/govmomi/vim25/types" - "golang.org/x/net/context" -) - -type intRange struct { - low, high int -} - -var intRangeRegexp = regexp.MustCompile("^([0-9]+)-([0-9]+)$") - -func (i *intRange) Set(s string) error { - m := intRangeRegexp.FindStringSubmatch(s) - if m == nil { - return fmt.Errorf("invalid range: %s", s) - } - - low, _ := strconv.Atoi(m[1]) - high, _ := strconv.Atoi(m[2]) - if low > high { - return fmt.Errorf("invalid range: low > high") - } - - i.low = low - i.high = high - return nil -} - -func (i *intRange) String() string { - return fmt.Sprintf("%d-%d", i.low, i.high) -} - -type vnc struct { - *flags.SearchFlag - - Enable bool - Disable bool - Port int - PortRange intRange - Password string -} - -func init() { - cmd := &vnc{} - cmd.PortRange.Set("5900-5999") - cli.Register("vm.vnc", cmd) -} - -func (cmd *vnc) Register(f *flag.FlagSet) { - cmd.SearchFlag = flags.NewSearchFlag(flags.SearchVirtualMachines) - - f.BoolVar(&cmd.Enable, "enable", false, "Enable VNC") - f.BoolVar(&cmd.Disable, "disable", false, "Disable VNC") - f.IntVar(&cmd.Port, "port", -1, "VNC port (-1 for auto-select)") - f.Var(&cmd.PortRange, "port-range", "VNC port auto-select range") - f.StringVar(&cmd.Password, "password", "", "VNC password") -} - -func (cmd *vnc) Process() error { - // Either may be true or none may be true. - if cmd.Enable && cmd.Disable { - return flag.ErrHelp - } - - return nil -} - -func (cmd *vnc) Usage() string { - return "VM..." -} - -func (cmd *vnc) Description() string { - return `VNC controls for VM(s). - -Port numbers are automatically chosen from a range if not specified. - -If neither -enable or -disable is specified, the current state is returned.` -} - -func (cmd *vnc) Run(f *flag.FlagSet) error { - vms, err := cmd.loadVMs(f.Args()) - if err != nil { - return err - } - - // Actuate settings in VMs - for _, vm := range vms { - switch { - case cmd.Enable: - vm.enable(cmd.Port, cmd.Password) - case cmd.Disable: - vm.disable() - } - } - - // Reconfigure VMs to reflect updates - for _, vm := range vms { - err = vm.reconfigure() - if err != nil { - return err - } - } - - return cmd.WriteResult(vncResult(vms)) -} - -func (cmd *vnc) loadVMs(args []string) ([]*vncVM, error) { - c, err := cmd.Client() - if err != nil { - return nil, err - } - - vms, err := cmd.VirtualMachines(args) - if err != nil { - return nil, err - } - - var vncVMs []*vncVM - for _, vm := range vms { - v, err := newVNCVM(c, vm) - if err != nil { - return nil, err - } - vncVMs = append(vncVMs, v) - } - - // Assign vncHosts to vncVMs - hosts := make(map[string]*vncHost) - for _, vm := range vncVMs { - if h, ok := hosts[vm.hostReference().Value]; ok { - vm.host = h - continue - } - - hs := object.NewHostSystem(c, vm.hostReference()) - h, err := newVNCHost(c, hs, cmd.PortRange.low, cmd.PortRange.high) - if err != nil { - return nil, err - } - - hosts[vm.hostReference().Value] = h - vm.host = h - } - - return vncVMs, nil -} - -type vncVM struct { - c *vim25.Client - vm *object.VirtualMachine - mvm mo.VirtualMachine - host *vncHost - - curOptions vncOptions - newOptions vncOptions -} - -func newVNCVM(c *vim25.Client, vm *object.VirtualMachine) (*vncVM, error) { - v := &vncVM{ - c: c, - vm: vm, - } - - virtualMachineProperties := []string{ - "name", - "config.extraConfig", - "runtime.host", - } - - pc := property.DefaultCollector(c) - err := pc.RetrieveOne(context.TODO(), vm.Reference(), virtualMachineProperties, &v.mvm) - if err != nil { - return nil, err - } - - v.curOptions = vncOptionsFromExtraConfig(v.mvm.Config.ExtraConfig) - v.newOptions = vncOptionsFromExtraConfig(v.mvm.Config.ExtraConfig) - - return v, nil -} - -func (v *vncVM) hostReference() types.ManagedObjectReference { - return *v.mvm.Runtime.Host -} - -func (v *vncVM) enable(port int, password string) error { - v.newOptions["enabled"] = "true" - v.newOptions["port"] = fmt.Sprintf("%d", port) - v.newOptions["password"] = password - - // Find port if auto-select - if port == -1 { - // Reuse port if If VM already has a port, reuse it. - // Otherwise, find unused VNC port on host. - if p, ok := v.curOptions["port"]; ok && p != "" { - v.newOptions["port"] = p - } else { - port, err := v.host.popUnusedPort() - if err != nil { - return err - } - v.newOptions["port"] = fmt.Sprintf("%d", port) - } - } - return nil -} - -func (v *vncVM) disable() error { - v.newOptions["enabled"] = "false" - v.newOptions["port"] = "" - v.newOptions["password"] = "" - return nil -} - -func (v *vncVM) reconfigure() error { - if reflect.DeepEqual(v.curOptions, v.newOptions) { - // No changes to settings - return nil - } - - spec := types.VirtualMachineConfigSpec{ - ExtraConfig: v.newOptions.ToExtraConfig(), - } - - task, err := v.vm.Reconfigure(context.TODO(), spec) - if err != nil { - return err - } - - return task.Wait(context.TODO()) -} - -func (v *vncVM) uri() (string, error) { - ip, err := v.host.managementIP() - if err != nil { - return "", err - } - - uri := fmt.Sprintf("vnc://:%s@%s:%s", - v.newOptions["password"], - ip, - v.newOptions["port"]) - - return uri, nil -} - -func (v *vncVM) write(w io.Writer) error { - if v.newOptions["enabled"] == "true" { - uri, err := v.uri() - if err != nil { - return err - } - fmt.Printf("%s: %s\n", v.mvm.Name, uri) - } else { - fmt.Printf("%s: disabled\n", v.mvm.Name) - } - return nil -} - -type vncHost struct { - c *vim25.Client - host *object.HostSystem - ports map[int]struct{} - ip string // This field is populated by `managementIP` -} - -func newVNCHost(c *vim25.Client, host *object.HostSystem, low, high int) (*vncHost, error) { - ports := make(map[int]struct{}) - for i := low; i <= high; i++ { - ports[i] = struct{}{} - } - - used, err := loadUsedPorts(c, host.Reference()) - if err != nil { - return nil, err - } - - // Remove used ports from range - for _, u := range used { - delete(ports, u) - } - - h := &vncHost{ - c: c, - host: host, - ports: ports, - } - - return h, nil -} - -func loadUsedPorts(c *vim25.Client, host types.ManagedObjectReference) ([]int, error) { - ospec := types.ObjectSpec{ - Obj: host, - SelectSet: []types.BaseSelectionSpec{ - &types.TraversalSpec{ - Type: "HostSystem", - Path: "vm", - Skip: types.NewBool(false), - }, - }, - Skip: types.NewBool(false), - } - - pspec := types.PropertySpec{ - Type: "VirtualMachine", - PathSet: []string{"config.extraConfig"}, - } - - req := types.RetrieveProperties{ - This: c.ServiceContent.PropertyCollector, - SpecSet: []types.PropertyFilterSpec{ - { - ObjectSet: []types.ObjectSpec{ospec}, - PropSet: []types.PropertySpec{pspec}, - }, - }, - } - - var vms []mo.VirtualMachine - err := mo.RetrievePropertiesForRequest(context.TODO(), c, req, &vms) - if err != nil { - return nil, err - } - - var ports []int - for _, vm := range vms { - if vm.Config == nil || vm.Config.ExtraConfig == nil { - continue - } - - options := vncOptionsFromExtraConfig(vm.Config.ExtraConfig) - if ps, ok := options["port"]; ok && ps != "" { - pi, err := strconv.Atoi(ps) - if err == nil { - ports = append(ports, pi) - } - } - } - - return ports, nil -} - -func (h *vncHost) popUnusedPort() (int, error) { - if len(h.ports) == 0 { - return 0, fmt.Errorf("no unused ports in range") - } - - // Return first port we get when iterating - var port int - for port, _ = range h.ports { - break - } - delete(h.ports, port) - return port, nil -} - -func (h *vncHost) managementIP() (string, error) { - if h.ip != "" { - return h.ip, nil - } - - ips, err := h.host.ManagementIPs(context.TODO()) - if err != nil { - return "", err - } - - if len(ips) > 0 { - h.ip = ips[0].String() - } else { - h.ip = "" - } - - return h.ip, nil -} - -type vncResult []*vncVM - -func (vms vncResult) MarshalJSON() ([]byte, error) { - out := make(map[string]string) - for _, vm := range vms { - uri, err := vm.uri() - if err != nil { - return nil, err - } - out[vm.mvm.Name] = uri - } - return json.Marshal(out) -} - -func (vms vncResult) Write(w io.Writer) error { - for _, vm := range vms { - err := vm.write(w) - if err != nil { - return err - } - } - - return nil -} - -type vncOptions map[string]string - -var vncPrefix = "RemoteDisplay.vnc." - -func vncOptionsFromExtraConfig(ov []types.BaseOptionValue) vncOptions { - vo := make(vncOptions) - for _, b := range ov { - o := b.GetOptionValue() - if strings.HasPrefix(o.Key, vncPrefix) { - key := o.Key[len(vncPrefix):] - if key != "key" { - vo[key] = o.Value.(string) - } - } - } - return vo -} - -func (vo vncOptions) ToExtraConfig() []types.BaseOptionValue { - ov := make([]types.BaseOptionValue, 0, 0) - for k, v := range vo { - key := vncPrefix + k - value := v - - o := types.OptionValue{ - Key: key, - Value: &value, // Pass pointer to avoid omitempty - } - - ov = append(ov, &o) - } - - // Don't know how to deal with the key option, set it to be empty... - o := types.OptionValue{ - Key: vncPrefix + "key", - Value: new(string), // Pass pointer to avoid omitempty - } - - ov = append(ov, &o) - - return ov -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/guest/auth_manager.go juju-core-2.0.2/src/github.com/juju/govmomi/guest/auth_manager.go --- juju-core-2.0.0/src/github.com/juju/govmomi/guest/auth_manager.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/guest/auth_manager.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,79 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package guest - -import ( - "github.com/juju/govmomi/vim25" - "github.com/juju/govmomi/vim25/methods" - "github.com/juju/govmomi/vim25/types" - "golang.org/x/net/context" -) - -type AuthManager struct { - types.ManagedObjectReference - - vm types.ManagedObjectReference - - c *vim25.Client -} - -func (m AuthManager) Reference() types.ManagedObjectReference { - return m.ManagedObjectReference -} - -func (m AuthManager) AcquireCredentials(ctx context.Context, requestedAuth types.BaseGuestAuthentication, sessionID int64) (types.BaseGuestAuthentication, error) { - req := types.AcquireCredentialsInGuest{ - This: m.Reference(), - Vm: m.vm, - RequestedAuth: requestedAuth, - SessionID: sessionID, - } - - res, err := methods.AcquireCredentialsInGuest(ctx, m.c, &req) - if err != nil { - return nil, err - } - - return res.Returnval, nil -} - -func (m AuthManager) ReleaseCredentials(ctx context.Context, auth types.BaseGuestAuthentication) error { - req := types.ReleaseCredentialsInGuest{ - This: m.Reference(), - Vm: m.vm, - Auth: auth, - } - - _, err := methods.ReleaseCredentialsInGuest(ctx, m.c, &req) - - return err -} - -func (m AuthManager) ValidateCredentials(ctx context.Context, auth types.BaseGuestAuthentication) error { - req := types.ValidateCredentialsInGuest{ - This: m.Reference(), - Vm: m.vm, - Auth: auth, - } - - _, err := methods.ValidateCredentialsInGuest(ctx, m.c, &req) - if err != nil { - return err - } - - return nil -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/guest/file_manager.go juju-core-2.0.2/src/github.com/juju/govmomi/guest/file_manager.go --- juju-core-2.0.0/src/github.com/juju/govmomi/guest/file_manager.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/guest/file_manager.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,202 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package guest - -import ( - "github.com/juju/govmomi/vim25" - "github.com/juju/govmomi/vim25/methods" - "github.com/juju/govmomi/vim25/types" - "golang.org/x/net/context" -) - -type FileManager struct { - types.ManagedObjectReference - - vm types.ManagedObjectReference - - c *vim25.Client -} - -func (m FileManager) Reference() types.ManagedObjectReference { - return m.ManagedObjectReference -} - -func (m FileManager) ChangeFileAttributes(ctx context.Context, auth types.BaseGuestAuthentication, guestFilePath string, fileAttributes types.BaseGuestFileAttributes) error { - req := types.ChangeFileAttributesInGuest{ - This: m.Reference(), - Vm: m.vm, - Auth: auth, - GuestFilePath: guestFilePath, - FileAttributes: fileAttributes, - } - - _, err := methods.ChangeFileAttributesInGuest(ctx, m.c, &req) - return err -} - -func (m FileManager) CreateTemporaryDirectory(ctx context.Context, auth types.BaseGuestAuthentication, prefix, suffix string) (string, error) { - req := types.CreateTemporaryDirectoryInGuest{ - This: m.Reference(), - Vm: m.vm, - Auth: auth, - Prefix: prefix, - Suffix: suffix, - } - - res, err := methods.CreateTemporaryDirectoryInGuest(ctx, m.c, &req) - if err != nil { - return "", err - } - - return res.Returnval, nil -} - -func (m FileManager) CreateTemporaryFile(ctx context.Context, auth types.BaseGuestAuthentication, prefix, suffix string) (string, error) { - req := types.CreateTemporaryFileInGuest{ - This: m.Reference(), - Vm: m.vm, - Auth: auth, - Prefix: prefix, - Suffix: suffix, - } - - res, err := methods.CreateTemporaryFileInGuest(ctx, m.c, &req) - if err != nil { - return "", err - } - - return res.Returnval, nil -} - -func (m FileManager) DeleteDirectory(ctx context.Context, auth types.BaseGuestAuthentication, directoryPath string, recursive bool) error { - req := types.DeleteDirectoryInGuest{ - This: m.Reference(), - Vm: m.vm, - Auth: auth, - DirectoryPath: directoryPath, - Recursive: recursive, - } - - _, err := methods.DeleteDirectoryInGuest(ctx, m.c, &req) - return err -} - -func (m FileManager) DeleteFile(ctx context.Context, auth types.BaseGuestAuthentication, filePath string) error { - req := types.DeleteFileInGuest{ - This: m.Reference(), - Vm: m.vm, - Auth: auth, - FilePath: filePath, - } - - _, err := methods.DeleteFileInGuest(ctx, m.c, &req) - return err -} - -func (m FileManager) InitiateFileTransferFromGuest(ctx context.Context, auth types.BaseGuestAuthentication, guestFilePath string) (*types.FileTransferInformation, error) { - req := types.InitiateFileTransferFromGuest{ - This: m.Reference(), - Vm: m.vm, - Auth: auth, - GuestFilePath: guestFilePath, - } - - res, err := methods.InitiateFileTransferFromGuest(ctx, m.c, &req) - if err != nil { - return nil, err - } - - return &res.Returnval, nil -} - -func (m FileManager) InitiateFileTransferToGuest(ctx context.Context, auth types.BaseGuestAuthentication, guestFilePath string, fileAttributes types.BaseGuestFileAttributes, fileSize int64, overwrite bool) (string, error) { - req := types.InitiateFileTransferToGuest{ - This: m.Reference(), - Vm: m.vm, - Auth: auth, - GuestFilePath: guestFilePath, - FileAttributes: fileAttributes, - FileSize: fileSize, - Overwrite: overwrite, - } - - res, err := methods.InitiateFileTransferToGuest(ctx, m.c, &req) - if err != nil { - return "", err - } - - return res.Returnval, nil -} - -func (m FileManager) ListFiles(ctx context.Context, auth types.BaseGuestAuthentication, filePath string, index int, maxResults int, matchPattern string) (*types.GuestListFileInfo, error) { - req := types.ListFilesInGuest{ - This: m.Reference(), - Vm: m.vm, - Auth: auth, - FilePath: filePath, - Index: index, - MaxResults: maxResults, - MatchPattern: matchPattern, - } - - res, err := methods.ListFilesInGuest(ctx, m.c, &req) - if err != nil { - return nil, err - } - - return &res.Returnval, nil -} - -func (m FileManager) MakeDirectory(ctx context.Context, auth types.BaseGuestAuthentication, directoryPath string, createParentDirectories bool) error { - req := types.MakeDirectoryInGuest{ - This: m.Reference(), - Vm: m.vm, - Auth: auth, - DirectoryPath: directoryPath, - CreateParentDirectories: createParentDirectories, - } - - _, err := methods.MakeDirectoryInGuest(ctx, m.c, &req) - return err -} - -func (m FileManager) MoveDirectory(ctx context.Context, auth types.BaseGuestAuthentication, srcDirectoryPath string, dstDirectoryPath string) error { - req := types.MoveDirectoryInGuest{ - This: m.Reference(), - Vm: m.vm, - Auth: auth, - SrcDirectoryPath: srcDirectoryPath, - DstDirectoryPath: dstDirectoryPath, - } - - _, err := methods.MoveDirectoryInGuest(ctx, m.c, &req) - return err -} - -func (m FileManager) MoveFile(ctx context.Context, auth types.BaseGuestAuthentication, srcFilePath string, dstFilePath string, overwrite bool) error { - req := types.MoveFileInGuest{ - This: m.Reference(), - Vm: m.vm, - Auth: auth, - SrcFilePath: srcFilePath, - DstFilePath: dstFilePath, - Overwrite: overwrite, - } - - _, err := methods.MoveFileInGuest(ctx, m.c, &req) - return err -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/guest/operations_manager.go juju-core-2.0.2/src/github.com/juju/govmomi/guest/operations_manager.go --- juju-core-2.0.0/src/github.com/juju/govmomi/guest/operations_manager.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/guest/operations_manager.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,72 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package guest - -import ( - "github.com/juju/govmomi/property" - "github.com/juju/govmomi/vim25" - "github.com/juju/govmomi/vim25/mo" - "github.com/juju/govmomi/vim25/types" - "golang.org/x/net/context" -) - -type OperationsManager struct { - c *vim25.Client - vm types.ManagedObjectReference -} - -func NewOperationsManager(c *vim25.Client, vm types.ManagedObjectReference) *OperationsManager { - return &OperationsManager{c, vm} -} - -func (m OperationsManager) retrieveOne(ctx context.Context, p string, dst *mo.GuestOperationsManager) error { - pc := property.DefaultCollector(m.c) - return pc.RetrieveOne(ctx, *m.c.ServiceContent.GuestOperationsManager, []string{p}, dst) -} - -func (m OperationsManager) AuthManager(ctx context.Context) (*AuthManager, error) { - var g mo.GuestOperationsManager - - err := m.retrieveOne(ctx, "authManager", &g) - if err != nil { - return nil, err - } - - return &AuthManager{*g.AuthManager, m.vm, m.c}, nil -} - -func (m OperationsManager) FileManager(ctx context.Context) (*FileManager, error) { - var g mo.GuestOperationsManager - - err := m.retrieveOne(ctx, "fileManager", &g) - if err != nil { - return nil, err - } - - return &FileManager{*g.FileManager, m.vm, m.c}, nil -} - -func (m OperationsManager) ProcessManager(ctx context.Context) (*ProcessManager, error) { - var g mo.GuestOperationsManager - - err := m.retrieveOne(ctx, "processManager", &g) - if err != nil { - return nil, err - } - - return &ProcessManager{*g.ProcessManager, m.vm, m.c}, nil -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/guest/process_manager.go juju-core-2.0.2/src/github.com/juju/govmomi/guest/process_manager.go --- juju-core-2.0.0/src/github.com/juju/govmomi/guest/process_manager.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/guest/process_manager.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,96 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package guest - -import ( - "github.com/juju/govmomi/vim25" - "github.com/juju/govmomi/vim25/methods" - "github.com/juju/govmomi/vim25/types" - "golang.org/x/net/context" -) - -type ProcessManager struct { - types.ManagedObjectReference - - vm types.ManagedObjectReference - - c *vim25.Client -} - -func (m ProcessManager) Reference() types.ManagedObjectReference { - return m.ManagedObjectReference -} - -func (m ProcessManager) ListProcesses(ctx context.Context, auth types.BaseGuestAuthentication, pids []int64) ([]types.GuestProcessInfo, error) { - req := types.ListProcessesInGuest{ - This: m.Reference(), - Vm: m.vm, - Auth: auth, - Pids: pids, - } - - res, err := methods.ListProcessesInGuest(ctx, m.c, &req) - if err != nil { - return nil, err - } - - return res.Returnval, err -} - -func (m ProcessManager) ReadEnvironmentVariable(ctx context.Context, auth types.BaseGuestAuthentication, names []string) ([]string, error) { - req := types.ReadEnvironmentVariableInGuest{ - This: m.Reference(), - Vm: m.vm, - Auth: auth, - Names: names, - } - - res, err := methods.ReadEnvironmentVariableInGuest(ctx, m.c, &req) - if err != nil { - return nil, err - } - - return res.Returnval, err -} - -func (m ProcessManager) StartProgram(ctx context.Context, auth types.BaseGuestAuthentication, spec types.BaseGuestProgramSpec) (int64, error) { - req := types.StartProgramInGuest{ - This: m.Reference(), - Vm: m.vm, - Auth: auth, - Spec: spec, - } - - res, err := methods.StartProgramInGuest(ctx, m.c, &req) - if err != nil { - return 0, err - } - - return res.Returnval, err -} - -func (m ProcessManager) TerminateProcess(ctx context.Context, auth types.BaseGuestAuthentication, pid int64) error { - req := types.TerminateProcessInGuest{ - This: m.Reference(), - Vm: m.vm, - Auth: auth, - Pid: pid, - } - - _, err := methods.TerminateProcessInGuest(ctx, m.c, &req) - return err -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/license/manager.go juju-core-2.0.2/src/github.com/juju/govmomi/license/manager.go --- juju-core-2.0.0/src/github.com/juju/govmomi/license/manager.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/license/manager.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,105 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package license - -import ( - "github.com/juju/govmomi/property" - "github.com/juju/govmomi/vim25" - "github.com/juju/govmomi/vim25/methods" - "github.com/juju/govmomi/vim25/mo" - "github.com/juju/govmomi/vim25/types" - "golang.org/x/net/context" -) - -type Manager struct { - reference types.ManagedObjectReference - - c *vim25.Client -} - -func NewManager(c *vim25.Client) *Manager { - m := Manager{ - reference: *c.ServiceContent.LicenseManager, - - c: c, - } - - return &m -} - -func (m Manager) Reference() types.ManagedObjectReference { - return m.reference -} - -func mapToKeyValueSlice(m map[string]string) []types.KeyValue { - r := make([]types.KeyValue, len(m)) - for k, v := range m { - r = append(r, types.KeyValue{Key: k, Value: v}) - } - return r -} - -func (m Manager) Add(ctx context.Context, key string, labels map[string]string) (types.LicenseManagerLicenseInfo, error) { - req := types.AddLicense{ - This: m.Reference(), - LicenseKey: key, - Labels: mapToKeyValueSlice(labels), - } - - res, err := methods.AddLicense(ctx, m.c, &req) - if err != nil { - return types.LicenseManagerLicenseInfo{}, err - } - - return res.Returnval, nil -} - -func (m Manager) Remove(ctx context.Context, key string) error { - req := types.RemoveLicense{ - This: m.Reference(), - LicenseKey: key, - } - - _, err := methods.RemoveLicense(ctx, m.c, &req) - return err -} - -func (m Manager) Update(ctx context.Context, key string, labels map[string]string) (types.LicenseManagerLicenseInfo, error) { - req := types.UpdateLicense{ - This: m.Reference(), - LicenseKey: key, - Labels: mapToKeyValueSlice(labels), - } - - res, err := methods.UpdateLicense(ctx, m.c, &req) - if err != nil { - return types.LicenseManagerLicenseInfo{}, err - } - - return res.Returnval, nil -} - -func (m Manager) List(ctx context.Context) ([]types.LicenseManagerLicenseInfo, error) { - var mlm mo.LicenseManager - - err := property.DefaultCollector(m.c).RetrieveOne(ctx, m.Reference(), []string{"licenses"}, &mlm) - if err != nil { - return nil, err - } - - return mlm.Licenses, nil -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/LICENSE.txt juju-core-2.0.2/src/github.com/juju/govmomi/LICENSE.txt --- juju-core-2.0.0/src/github.com/juju/govmomi/LICENSE.txt 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/LICENSE.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - 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, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/list/lister.go juju-core-2.0.2/src/github.com/juju/govmomi/list/lister.go --- juju-core-2.0.0/src/github.com/juju/govmomi/list/lister.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/list/lister.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,379 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package list - -import ( - "fmt" - "path" - "reflect" - - "github.com/juju/govmomi/property" - "github.com/juju/govmomi/vim25/mo" - "github.com/juju/govmomi/vim25/types" - "golang.org/x/net/context" -) - -type Element struct { - Path string - Object mo.Reference -} - -func ToElement(r mo.Reference, prefix string) Element { - var name string - - switch m := r.(type) { - case mo.Folder: - name = m.Name - case mo.Datacenter: - name = m.Name - case mo.VirtualMachine: - name = m.Name - case mo.Network: - name = m.Name - case mo.ComputeResource: - name = m.Name - case mo.Datastore: - name = m.Name - case mo.StoragePod: - name = m.Name - case mo.HostSystem: - name = m.Name - case mo.ResourcePool: - name = m.Name - case mo.ClusterComputeResource: - name = m.Name - case mo.DistributedVirtualPortgroup: - name = m.Name - default: - panic("not implemented for type " + reflect.TypeOf(r).String()) - } - - e := Element{ - Path: path.Join(prefix, name), - Object: r, - } - - return e -} - -type Lister struct { - Collector *property.Collector - Reference types.ManagedObjectReference - Prefix string - All bool -} - -func traversable(ref types.ManagedObjectReference) bool { - switch ref.Type { - case "Folder": - case "Datacenter": - case "ComputeResource", "ClusterComputeResource": - // Treat ComputeResource and ClusterComputeResource as one and the same. - // It doesn't matter from the perspective of the lister. - default: - return false - } - - return true -} - -func (l Lister) retrieveProperties(ctx context.Context, req types.RetrieveProperties, dst interface{}) error { - res, err := l.Collector.RetrieveProperties(ctx, req) - if err != nil { - return err - } - - err = mo.LoadRetrievePropertiesResponse(res, dst) - if err != nil { - return err - } - - return nil -} - -func (l Lister) List(ctx context.Context) ([]Element, error) { - switch l.Reference.Type { - case "Folder": - return l.ListFolder(ctx) - case "Datacenter": - return l.ListDatacenter(ctx) - case "ComputeResource", "ClusterComputeResource": - // Treat ComputeResource and ClusterComputeResource as one and the same. - // It doesn't matter from the perspective of the lister. - return l.ListComputeResource(ctx) - case "ResourcePool": - return l.ListResourcePool(ctx) - default: - return nil, fmt.Errorf("cannot traverse type " + l.Reference.Type) - } -} - -func (l Lister) ListFolder(ctx context.Context) ([]Element, error) { - spec := types.PropertyFilterSpec{ - ObjectSet: []types.ObjectSpec{ - { - Obj: l.Reference, - SelectSet: []types.BaseSelectionSpec{ - &types.TraversalSpec{ - Path: "childEntity", - Skip: types.NewBool(false), - Type: "Folder", - }, - }, - Skip: types.NewBool(true), - }, - }, - } - - // Retrieve all objects that we can deal with - childTypes := []string{ - "Folder", - "Datacenter", - "VirtualMachine", - "Network", - "ComputeResource", - "ClusterComputeResource", - "Datastore", - } - - for _, t := range childTypes { - pspec := types.PropertySpec{ - Type: t, - } - - if l.All { - pspec.All = types.NewBool(true) - } else { - pspec.PathSet = []string{"name"} - - // Additional basic properties. - switch t { - case "ComputeResource", "ClusterComputeResource": - // The ComputeResource and ClusterComputeResource are dereferenced in - // the ResourcePoolFlag. Make sure they always have their resourcePool - // field populated. - pspec.PathSet = append(pspec.PathSet, "resourcePool") - } - } - - spec.PropSet = append(spec.PropSet, pspec) - } - - req := types.RetrieveProperties{ - SpecSet: []types.PropertyFilterSpec{spec}, - } - - var dst []interface{} - - err := l.retrieveProperties(ctx, req, &dst) - if err != nil { - return nil, err - } - - es := []Element{} - for _, v := range dst { - es = append(es, ToElement(v.(mo.Reference), l.Prefix)) - } - - return es, nil -} - -func (l Lister) ListDatacenter(ctx context.Context) ([]Element, error) { - ospec := types.ObjectSpec{ - Obj: l.Reference, - Skip: types.NewBool(true), - } - - // Include every datastore folder in the select set - fields := []string{ - "vmFolder", - "hostFolder", - "datastoreFolder", - "networkFolder", - } - - for _, f := range fields { - tspec := types.TraversalSpec{ - Path: f, - Skip: types.NewBool(false), - Type: "Datacenter", - } - - ospec.SelectSet = append(ospec.SelectSet, &tspec) - } - - pspec := types.PropertySpec{ - Type: "Folder", - } - - if l.All { - pspec.All = types.NewBool(true) - } else { - pspec.PathSet = []string{"name"} - } - - req := types.RetrieveProperties{ - SpecSet: []types.PropertyFilterSpec{ - { - ObjectSet: []types.ObjectSpec{ospec}, - PropSet: []types.PropertySpec{pspec}, - }, - }, - } - - var dst []interface{} - - err := l.retrieveProperties(ctx, req, &dst) - if err != nil { - return nil, err - } - - es := []Element{} - for _, v := range dst { - es = append(es, ToElement(v.(mo.Reference), l.Prefix)) - } - - return es, nil -} - -func (l Lister) ListComputeResource(ctx context.Context) ([]Element, error) { - ospec := types.ObjectSpec{ - Obj: l.Reference, - Skip: types.NewBool(true), - } - - fields := []string{ - "host", - "resourcePool", - } - - for _, f := range fields { - tspec := types.TraversalSpec{ - Path: f, - Skip: types.NewBool(false), - Type: "ComputeResource", - } - - ospec.SelectSet = append(ospec.SelectSet, &tspec) - } - - childTypes := []string{ - "HostSystem", - "ResourcePool", - } - - var pspecs []types.PropertySpec - for _, t := range childTypes { - pspec := types.PropertySpec{ - Type: t, - } - - if l.All { - pspec.All = types.NewBool(true) - } else { - pspec.PathSet = []string{"name"} - } - - pspecs = append(pspecs, pspec) - } - - req := types.RetrieveProperties{ - SpecSet: []types.PropertyFilterSpec{ - { - ObjectSet: []types.ObjectSpec{ospec}, - PropSet: pspecs, - }, - }, - } - - var dst []interface{} - - err := l.retrieveProperties(ctx, req, &dst) - if err != nil { - return nil, err - } - - es := []Element{} - for _, v := range dst { - es = append(es, ToElement(v.(mo.Reference), l.Prefix)) - } - - return es, nil -} - -func (l Lister) ListResourcePool(ctx context.Context) ([]Element, error) { - ospec := types.ObjectSpec{ - Obj: l.Reference, - Skip: types.NewBool(true), - } - - fields := []string{ - "resourcePool", - } - - for _, f := range fields { - tspec := types.TraversalSpec{ - Path: f, - Skip: types.NewBool(false), - Type: "ResourcePool", - } - - ospec.SelectSet = append(ospec.SelectSet, &tspec) - } - - childTypes := []string{ - "ResourcePool", - } - - var pspecs []types.PropertySpec - for _, t := range childTypes { - pspec := types.PropertySpec{ - Type: t, - } - - if l.All { - pspec.All = types.NewBool(true) - } else { - pspec.PathSet = []string{"name"} - } - - pspecs = append(pspecs, pspec) - } - - req := types.RetrieveProperties{ - SpecSet: []types.PropertyFilterSpec{ - { - ObjectSet: []types.ObjectSpec{ospec}, - PropSet: pspecs, - }, - }, - } - - var dst []interface{} - - err := l.retrieveProperties(ctx, req, &dst) - if err != nil { - return nil, err - } - - es := []Element{} - for _, v := range dst { - es = append(es, ToElement(v.(mo.Reference), l.Prefix)) - } - - return es, nil -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/list/path.go juju-core-2.0.2/src/github.com/juju/govmomi/list/path.go --- juju-core-2.0.0/src/github.com/juju/govmomi/list/path.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/list/path.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,44 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package list - -import ( - "path" - "strings" -) - -func ToParts(p string) []string { - p = path.Clean(p) - if p == "/" { - return []string{} - } - - if len(p) > 0 { - // Prefix ./ if relative - if p[0] != '/' && p[0] != '.' { - p = "./" + p - } - } - - ps := strings.Split(p, "/") - if ps[0] == "" { - // Start at root - ps = ps[1:] - } - - return ps -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/list/path_test.go juju-core-2.0.2/src/github.com/juju/govmomi/list/path_test.go --- juju-core-2.0.0/src/github.com/juju/govmomi/list/path_test.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/list/path_test.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,93 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package list - -import ( - "reflect" - "testing" -) - -func TestToParts(t *testing.T) { - tests := []struct { - In string - Out []string - }{ - { - In: "/", - Out: []string{}, - }, - { - In: "/foo", - Out: []string{"foo"}, - }, - { - In: "/foo/..", - Out: []string{}, - }, - { - In: "/./foo", - Out: []string{"foo"}, - }, - { - In: "/../foo", - Out: []string{"foo"}, - }, - { - In: "/foo/bar", - Out: []string{"foo", "bar"}, - }, - { - In: "/foo/bar/..", - Out: []string{"foo"}, - }, - { - In: "", - Out: []string{"."}, - }, - { - In: ".", - Out: []string{"."}, - }, - { - In: "foo", - Out: []string{".", "foo"}, - }, - { - In: "foo/..", - Out: []string{"."}, - }, - { - In: "./foo", - Out: []string{".", "foo"}, - }, - { - In: "../foo", // Special case... - Out: []string{"..", "foo"}, - }, - { - In: "foo/bar/..", - Out: []string{".", "foo"}, - }, - } - - for _, test := range tests { - out := ToParts(test.In) - if !reflect.DeepEqual(test.Out, out) { - t.Errorf("Expected %s to return: %#v, actual: %#v", test.In, test.Out, out) - } - } -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/list/recurser.go juju-core-2.0.2/src/github.com/juju/govmomi/list/recurser.go --- juju-core-2.0.0/src/github.com/juju/govmomi/list/recurser.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/list/recurser.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,97 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package list - -import ( - "path" - "path/filepath" - - "github.com/juju/govmomi/property" - "golang.org/x/net/context" -) - -type Recurser struct { - Collector *property.Collector - - // All configures the recurses to fetch complete objects for leaf nodes. - All bool - - // TraverseLeafs configures the Recurser to traverse traversable leaf nodes. - // This is typically set to true when used from the ls command, where listing - // a folder means listing its contents. This is typically set to false for - // commands that take managed entities that are not folders as input. - TraverseLeafs bool -} - -func (r Recurser) Recurse(ctx context.Context, root Element, parts []string) ([]Element, error) { - if len(parts) == 0 { - // Include non-traversable leaf elements in result. For example, consider - // the pattern "./vm/my-vm-*", where the pattern should match the VMs and - // not try to traverse them. - // - // Include traversable leaf elements in result, if the TraverseLeafs - // field is set to false. - // - if !traversable(root.Object.Reference()) || !r.TraverseLeafs { - return []Element{root}, nil - } - } - - k := Lister{ - Collector: r.Collector, - Reference: root.Object.Reference(), - Prefix: root.Path, - } - - if r.All && len(parts) < 2 { - k.All = true - } - - in, err := k.List(ctx) - if err != nil { - return nil, err - } - - // This folder is a leaf as far as the glob goes. - if len(parts) == 0 { - return in, nil - } - - pattern := parts[0] - parts = parts[1:] - - var out []Element - for _, e := range in { - matched, err := filepath.Match(pattern, path.Base(e.Path)) - if err != nil { - return nil, err - } - - if !matched { - continue - } - - nres, err := r.Recurse(ctx, e, parts) - if err != nil { - return nil, err - } - - out = append(out, nres...) - } - - return out, nil -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/Makefile juju-core-2.0.2/src/github.com/juju/govmomi/Makefile --- juju-core-2.0.0/src/github.com/juju/govmomi/Makefile 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/Makefile 1970-01-01 00:00:00.000000000 +0000 @@ -1,20 +0,0 @@ -.PHONY: test - -all: check test - -check: goimports govet - -goimports: - @echo checking go imports... - @! goimports -d . 2>&1 | egrep -v '^$$' - -govet: - @echo checking go vet... - @go tool vet -structtags=false -methods=false . - -test: - go get - go test -v $(TEST_OPTS) ./... - -install: - go install github.com/vmware/govmomi/govc diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/object/cluster_compute_resource.go juju-core-2.0.2/src/github.com/juju/govmomi/object/cluster_compute_resource.go --- juju-core-2.0.0/src/github.com/juju/govmomi/object/cluster_compute_resource.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/object/cluster_compute_resource.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,21 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package object - -type ClusterComputeResource struct { - ComputeResource -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/object/common.go juju-core-2.0.2/src/github.com/juju/govmomi/object/common.go --- juju-core-2.0.0/src/github.com/juju/govmomi/object/common.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/object/common.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,42 +0,0 @@ -/* -Copyright (c) 2015 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package object - -import ( - "github.com/juju/govmomi/property" - "github.com/juju/govmomi/vim25" - "github.com/juju/govmomi/vim25/types" - "golang.org/x/net/context" -) - -// Common contains the fields and functions common to all objects. -type Common struct { - c *vim25.Client - r types.ManagedObjectReference -} - -func NewCommon(c *vim25.Client, r types.ManagedObjectReference) Common { - return Common{c: c, r: r} -} - -func (c Common) Reference() types.ManagedObjectReference { - return c.r -} - -func (c Common) Properties(ctx context.Context, r types.ManagedObjectReference, ps []string, dst interface{}) error { - return property.DefaultCollector(c.c).RetrieveOne(ctx, r, ps, dst) -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/object/compute_resource.go juju-core-2.0.2/src/github.com/juju/govmomi/object/compute_resource.go --- juju-core-2.0.0/src/github.com/juju/govmomi/object/compute_resource.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/object/compute_resource.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,45 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package object - -import ( - "github.com/juju/govmomi/vim25" - "github.com/juju/govmomi/vim25/mo" - "github.com/juju/govmomi/vim25/types" - "golang.org/x/net/context" -) - -type ComputeResource struct { - Common -} - -func NewComputeResource(c *vim25.Client, ref types.ManagedObjectReference) *ComputeResource { - return &ComputeResource{ - Common: NewCommon(c, ref), - } -} - -func (c ComputeResource) Hosts(ctx context.Context) ([]types.ManagedObjectReference, error) { - var cr mo.ComputeResource - - err := c.Properties(ctx, c.Reference(), []string{"host"}, &cr) - if err != nil { - return nil, err - } - - return cr.Host, nil -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/object/compute_resource_test.go juju-core-2.0.2/src/github.com/juju/govmomi/object/compute_resource_test.go --- juju-core-2.0.0/src/github.com/juju/govmomi/object/compute_resource_test.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/object/compute_resource_test.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,20 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package object - -// ComputeResource should implement the Reference interface. -var _ Reference = ComputeResource{} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/object/customization_spec_manager.go juju-core-2.0.2/src/github.com/juju/govmomi/object/customization_spec_manager.go --- juju-core-2.0.0/src/github.com/juju/govmomi/object/customization_spec_manager.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/object/customization_spec_manager.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,165 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package object - -import ( - "github.com/juju/govmomi/vim25" - "github.com/juju/govmomi/vim25/methods" - "github.com/juju/govmomi/vim25/types" - "golang.org/x/net/context" -) - -type CustomizationSpecManager struct { - Common -} - -func NewCustomizationSpecManager(c *vim25.Client) *CustomizationSpecManager { - cs := CustomizationSpecManager{ - Common: NewCommon(c, *c.ServiceContent.CustomizationSpecManager), - } - - return &cs -} - -func (cs CustomizationSpecManager) DoesCustomizationSpecExist(ctx context.Context, name string) (bool, error) { - req := types.DoesCustomizationSpecExist{ - This: cs.Reference(), - Name: name, - } - - res, err := methods.DoesCustomizationSpecExist(ctx, cs.c, &req) - - if err != nil { - return false, err - } - - return res.Returnval, nil -} - -func (cs CustomizationSpecManager) GetCustomizationSpec(ctx context.Context, name string) (*types.CustomizationSpecItem, error) { - req := types.GetCustomizationSpec{ - This: cs.Reference(), - Name: name, - } - - res, err := methods.GetCustomizationSpec(ctx, cs.c, &req) - - if err != nil { - return nil, err - } - - return &res.Returnval, nil -} - -func (cs CustomizationSpecManager) CreateCustomizationSpec(ctx context.Context, item types.CustomizationSpecItem) error { - req := types.CreateCustomizationSpec{ - This: cs.Reference(), - Item: item, - } - - _, err := methods.CreateCustomizationSpec(ctx, cs.c, &req) - if err != nil { - return err - } - - return nil -} - -func (cs CustomizationSpecManager) OverwriteCustomizationSpec(ctx context.Context, item types.CustomizationSpecItem) error { - req := types.OverwriteCustomizationSpec{ - This: cs.Reference(), - Item: item, - } - - _, err := methods.OverwriteCustomizationSpec(ctx, cs.c, &req) - if err != nil { - return err - } - - return nil -} - -func (cs CustomizationSpecManager) DeleteCustomizationSpec(ctx context.Context, name string) error { - req := types.DeleteCustomizationSpec{ - This: cs.Reference(), - Name: name, - } - - _, err := methods.DeleteCustomizationSpec(ctx, cs.c, &req) - if err != nil { - return err - } - - return nil -} - -func (cs CustomizationSpecManager) DuplicateCustomizationSpec(ctx context.Context, name string, newName string) error { - req := types.DuplicateCustomizationSpec{ - This: cs.Reference(), - Name: name, - NewName: newName, - } - - _, err := methods.DuplicateCustomizationSpec(ctx, cs.c, &req) - if err != nil { - return err - } - - return nil -} - -func (cs CustomizationSpecManager) RenameCustomizationSpec(ctx context.Context, name string, newName string) error { - req := types.RenameCustomizationSpec{ - This: cs.Reference(), - Name: name, - NewName: newName, - } - - _, err := methods.RenameCustomizationSpec(ctx, cs.c, &req) - if err != nil { - return err - } - - return nil -} - -func (cs CustomizationSpecManager) CustomizationSpecItemToXml(ctx context.Context, item types.CustomizationSpecItem) (string, error) { - req := types.CustomizationSpecItemToXml{ - This: cs.Reference(), - Item: item, - } - - res, err := methods.CustomizationSpecItemToXml(ctx, cs.c, &req) - if err != nil { - return "", err - } - - return res.Returnval, nil -} - -func (cs CustomizationSpecManager) XmlToCustomizationSpecItem(ctx context.Context, xml string) (*types.CustomizationSpecItem, error) { - req := types.XmlToCustomizationSpecItem{ - This: cs.Reference(), - SpecItemXml: xml, - } - - res, err := methods.XmlToCustomizationSpecItem(ctx, cs.c, &req) - if err != nil { - return nil, err - } - return &res.Returnval, nil -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/object/datacenter.go juju-core-2.0.2/src/github.com/juju/govmomi/object/datacenter.go --- juju-core-2.0.0/src/github.com/juju/govmomi/object/datacenter.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/object/datacenter.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,74 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package object - -import ( - "github.com/juju/govmomi/vim25" - "github.com/juju/govmomi/vim25/methods" - "github.com/juju/govmomi/vim25/mo" - "github.com/juju/govmomi/vim25/types" - "golang.org/x/net/context" -) - -type DatacenterFolders struct { - VmFolder *Folder - HostFolder *Folder - DatastoreFolder *Folder - NetworkFolder *Folder -} - -type Datacenter struct { - Common -} - -func NewDatacenter(c *vim25.Client, ref types.ManagedObjectReference) *Datacenter { - return &Datacenter{ - Common: NewCommon(c, ref), - } -} - -func (d *Datacenter) Folders(ctx context.Context) (*DatacenterFolders, error) { - var md mo.Datacenter - - ps := []string{"vmFolder", "hostFolder", "datastoreFolder", "networkFolder"} - err := d.Properties(ctx, d.Reference(), ps, &md) - if err != nil { - return nil, err - } - - df := &DatacenterFolders{ - VmFolder: NewFolder(d.c, md.VmFolder), - HostFolder: NewFolder(d.c, md.HostFolder), - DatastoreFolder: NewFolder(d.c, md.DatastoreFolder), - NetworkFolder: NewFolder(d.c, md.NetworkFolder), - } - - return df, nil -} - -func (d Datacenter) Destroy(ctx context.Context) (*Task, error) { - req := types.Destroy_Task{ - This: d.Reference(), - } - - res, err := methods.Destroy_Task(ctx, d.c, &req) - if err != nil { - return nil, err - } - - return NewTask(d.c, res.Returnval), nil -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/object/datacenter_test.go juju-core-2.0.2/src/github.com/juju/govmomi/object/datacenter_test.go --- juju-core-2.0.0/src/github.com/juju/govmomi/object/datacenter_test.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/object/datacenter_test.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,20 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package object - -// Datacenter should implement the Reference interface. -var _ Reference = Datacenter{} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/object/datastore.go juju-core-2.0.2/src/github.com/juju/govmomi/object/datastore.go --- juju-core-2.0.0/src/github.com/juju/govmomi/object/datastore.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/object/datastore.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,90 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package object - -import ( - "fmt" - "path" - - "net/url" - - "github.com/juju/govmomi/vim25" - "github.com/juju/govmomi/vim25/mo" - "github.com/juju/govmomi/vim25/types" - "golang.org/x/net/context" -) - -type Datastore struct { - Common - - InventoryPath string -} - -func NewDatastore(c *vim25.Client, ref types.ManagedObjectReference) *Datastore { - return &Datastore{ - Common: NewCommon(c, ref), - } -} - -func (d Datastore) Name() string { - return path.Base(d.InventoryPath) -} - -func (d Datastore) Path(path string) string { - name := d.Name() - if name == "" { - panic("expected non-empty name") - } - - return fmt.Sprintf("[%s] %s", name, path) -} - -// URL for datastore access over HTTP -func (d Datastore) URL(ctx context.Context, dc *Datacenter, path string) (*url.URL, error) { - var mdc mo.Datacenter - if err := dc.Properties(ctx, dc.Reference(), []string{"name"}, &mdc); err != nil { - return nil, err - } - - var mds mo.Datastore - if err := d.Properties(ctx, d.Reference(), []string{"name"}, &mds); err != nil { - return nil, err - } - - u := d.c.URL() - - return &url.URL{ - Scheme: u.Scheme, - Host: u.Host, - Path: fmt.Sprintf("/folder/%s", path), - RawQuery: url.Values{ - "dcPath": []string{mdc.Name}, - "dsName": []string{mds.Name}, - }.Encode(), - }, nil -} - -func (d Datastore) Browser(ctx context.Context) (*HostDatastoreBrowser, error) { - var do mo.Datastore - - err := d.Properties(ctx, d.Reference(), []string{"browser"}, &do) - if err != nil { - return nil, err - } - - return NewHostDatastoreBrowser(d.c, do.Browser), nil -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/object/datastore_test.go juju-core-2.0.2/src/github.com/juju/govmomi/object/datastore_test.go --- juju-core-2.0.0/src/github.com/juju/govmomi/object/datastore_test.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/object/datastore_test.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,20 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package object - -// Datastore should implement the Reference interface. -var _ Reference = Datastore{} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/object/distributed_virtual_portgroup.go juju-core-2.0.2/src/github.com/juju/govmomi/object/distributed_virtual_portgroup.go --- juju-core-2.0.0/src/github.com/juju/govmomi/object/distributed_virtual_portgroup.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/object/distributed_virtual_portgroup.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,64 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package object - -import ( - "path" - - "github.com/juju/govmomi/vim25" - "github.com/juju/govmomi/vim25/mo" - "github.com/juju/govmomi/vim25/types" - "golang.org/x/net/context" -) - -type DistributedVirtualPortgroup struct { - Common - - InventoryPath string -} - -func NewDistributedVirtualPortgroup(c *vim25.Client, ref types.ManagedObjectReference) *DistributedVirtualPortgroup { - return &DistributedVirtualPortgroup{ - Common: NewCommon(c, ref), - } -} -func (p DistributedVirtualPortgroup) Name() string { - return path.Base(p.InventoryPath) -} - -// EthernetCardBackingInfo returns the VirtualDeviceBackingInfo for this DistributedVirtualPortgroup -func (p DistributedVirtualPortgroup) EthernetCardBackingInfo(ctx context.Context) (types.BaseVirtualDeviceBackingInfo, error) { - var dvp mo.DistributedVirtualPortgroup - var dvs mo.VmwareDistributedVirtualSwitch // TODO: should be mo.BaseDistributedVirtualSwitch - - if err := p.Properties(ctx, p.Reference(), []string{"key", "config.distributedVirtualSwitch"}, &dvp); err != nil { - return nil, err - } - - if err := p.Properties(ctx, *dvp.Config.DistributedVirtualSwitch, []string{"uuid"}, &dvs); err != nil { - return nil, err - } - - backing := &types.VirtualEthernetCardDistributedVirtualPortBackingInfo{ - Port: types.DistributedVirtualSwitchPortConnection{ - PortgroupKey: dvp.Key, - SwitchUuid: dvs.Uuid, - }, - } - - return backing, nil -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/object/distributed_virtual_portgroup_test.go juju-core-2.0.2/src/github.com/juju/govmomi/object/distributed_virtual_portgroup_test.go --- juju-core-2.0.0/src/github.com/juju/govmomi/object/distributed_virtual_portgroup_test.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/object/distributed_virtual_portgroup_test.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,23 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package object - -// DistributedVirtualPortgroup should implement the Reference interface. -var _ Reference = DistributedVirtualPortgroup{} - -// DistributedVirtualPortgroup should implement the NetworkReference interface. -var _ NetworkReference = DistributedVirtualPortgroup{} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/object/distributed_virtual_switch.go juju-core-2.0.2/src/github.com/juju/govmomi/object/distributed_virtual_switch.go --- juju-core-2.0.0/src/github.com/juju/govmomi/object/distributed_virtual_switch.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/object/distributed_virtual_switch.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,32 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package object - -import ( - "github.com/juju/govmomi/vim25" - "github.com/juju/govmomi/vim25/types" -) - -type DistributedVirtualSwitch struct { - Common -} - -func NewDistributedVirtualSwitch(c *vim25.Client, ref types.ManagedObjectReference) *DistributedVirtualSwitch { - return &DistributedVirtualSwitch{ - Common: NewCommon(c, ref), - } -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/object/file_manager.go juju-core-2.0.2/src/github.com/juju/govmomi/object/file_manager.go --- juju-core-2.0.0/src/github.com/juju/govmomi/object/file_manager.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/object/file_manager.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,125 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package object - -import ( - "github.com/juju/govmomi/vim25" - "github.com/juju/govmomi/vim25/methods" - "github.com/juju/govmomi/vim25/types" - "golang.org/x/net/context" -) - -type FileManager struct { - Common -} - -func NewFileManager(c *vim25.Client) *FileManager { - f := FileManager{ - Common: NewCommon(c, *c.ServiceContent.FileManager), - } - - return &f -} - -func (f FileManager) CopyDatastoreFile(ctx context.Context, sourceName string, sourceDatacenter *Datacenter, destinationName string, destinationDatacenter *Datacenter, force bool) (*Task, error) { - req := types.CopyDatastoreFile_Task{ - This: f.Reference(), - SourceName: sourceName, - DestinationName: destinationName, - Force: types.NewBool(force), - } - - if sourceDatacenter != nil { - ref := sourceDatacenter.Reference() - req.SourceDatacenter = &ref - } - - if destinationDatacenter != nil { - ref := destinationDatacenter.Reference() - req.DestinationDatacenter = &ref - } - - res, err := methods.CopyDatastoreFile_Task(ctx, f.c, &req) - if err != nil { - return nil, err - } - - return NewTask(f.c, res.Returnval), nil -} - -// DeleteDatastoreFile deletes the specified file or folder from the datastore. -func (f FileManager) DeleteDatastoreFile(ctx context.Context, name string, dc *Datacenter) (*Task, error) { - req := types.DeleteDatastoreFile_Task{ - This: f.Reference(), - Name: name, - } - - if dc != nil { - ref := dc.Reference() - req.Datacenter = &ref - } - - res, err := methods.DeleteDatastoreFile_Task(ctx, f.c, &req) - if err != nil { - return nil, err - } - - return NewTask(f.c, res.Returnval), nil -} - -// MakeDirectory creates a folder using the specified name. -func (f FileManager) MakeDirectory(ctx context.Context, name string, dc *Datacenter, createParentDirectories bool) error { - req := types.MakeDirectory{ - This: f.Reference(), - Name: name, - CreateParentDirectories: types.NewBool(createParentDirectories), - } - - if dc != nil { - ref := dc.Reference() - req.Datacenter = &ref - } - - _, err := methods.MakeDirectory(ctx, f.c, &req) - return err -} - -func (f FileManager) MoveDatastoreFile(ctx context.Context, sourceName string, sourceDatacenter *Datacenter, destinationName string, destinationDatacenter *Datacenter, force bool) (*Task, error) { - req := types.MoveDatastoreFile_Task{ - This: f.Reference(), - SourceName: sourceName, - DestinationName: destinationName, - Force: types.NewBool(force), - } - - if sourceDatacenter != nil { - ref := sourceDatacenter.Reference() - req.SourceDatacenter = &ref - } - - if destinationDatacenter != nil { - ref := destinationDatacenter.Reference() - req.DestinationDatacenter = &ref - } - - res, err := methods.MoveDatastoreFile_Task(ctx, f.c, &req) - if err != nil { - return nil, err - } - - return NewTask(f.c, res.Returnval), nil -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/object/folder.go juju-core-2.0.2/src/github.com/juju/govmomi/object/folder.go --- juju-core-2.0.0/src/github.com/juju/govmomi/object/folder.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/object/folder.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,139 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package object - -import ( - "github.com/juju/govmomi/vim25" - "github.com/juju/govmomi/vim25/methods" - "github.com/juju/govmomi/vim25/mo" - "github.com/juju/govmomi/vim25/types" - "golang.org/x/net/context" -) - -type Folder struct { - Common -} - -func NewFolder(c *vim25.Client, ref types.ManagedObjectReference) *Folder { - return &Folder{ - Common: NewCommon(c, ref), - } -} - -func NewRootFolder(c *vim25.Client) *Folder { - return NewFolder(c, c.ServiceContent.RootFolder) -} - -func (f Folder) Children(ctx context.Context) ([]Reference, error) { - var mf mo.Folder - - err := f.Properties(ctx, f.Reference(), []string{"childEntity"}, &mf) - if err != nil { - return nil, err - } - - var rs []Reference - for _, e := range mf.ChildEntity { - if r := NewReference(f.c, e); r != nil { - rs = append(rs, r) - } - } - - return rs, nil -} - -func (f Folder) CreateDatacenter(ctx context.Context, datacenter string) (*Datacenter, error) { - req := types.CreateDatacenter{ - This: f.Reference(), - Name: datacenter, - } - - res, err := methods.CreateDatacenter(ctx, f.c, &req) - if err != nil { - return nil, err - } - - // Response will be nil if this is an ESX host that does not belong to a vCenter - if res == nil { - return nil, nil - } - - return NewDatacenter(f.c, res.Returnval), nil -} - -func (f Folder) CreateFolder(ctx context.Context, name string) (*Folder, error) { - req := types.CreateFolder{ - This: f.Reference(), - Name: name, - } - - res, err := methods.CreateFolder(ctx, f.c, &req) - if err != nil { - return nil, err - } - - return NewFolder(f.c, res.Returnval), err -} - -func (f Folder) CreateVM(ctx context.Context, config types.VirtualMachineConfigSpec, pool *ResourcePool, host *HostSystem) (*Task, error) { - req := types.CreateVM_Task{ - This: f.Reference(), - Config: config, - Pool: pool.Reference(), - } - - if host != nil { - ref := host.Reference() - req.Host = &ref - } - - res, err := methods.CreateVM_Task(ctx, f.c, &req) - if err != nil { - return nil, err - } - - return NewTask(f.c, res.Returnval), nil -} - -func (f Folder) RegisterVM(ctx context.Context, path string, name string, asTemplate bool, pool *ResourcePool, host *HostSystem) (*Task, error) { - req := types.RegisterVM_Task{ - This: f.Reference(), - Path: path, - AsTemplate: asTemplate, - } - - if name != "" { - req.Name = name - } - - if host != nil { - ref := host.Reference() - req.Host = &ref - } - - if pool != nil { - ref := pool.Reference() - req.Pool = &ref - } - - res, err := methods.RegisterVM_Task(ctx, f.c, &req) - if err != nil { - return nil, err - } - - return NewTask(f.c, res.Returnval), nil -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/object/folder_test.go juju-core-2.0.2/src/github.com/juju/govmomi/object/folder_test.go --- juju-core-2.0.0/src/github.com/juju/govmomi/object/folder_test.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/object/folder_test.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,20 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package object - -// Folder should implement the Reference interface. -var _ Reference = Folder{} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/object/host_config_manager.go juju-core-2.0.2/src/github.com/juju/govmomi/object/host_config_manager.go --- juju-core-2.0.0/src/github.com/juju/govmomi/object/host_config_manager.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/object/host_config_manager.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,45 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package object - -import ( - "github.com/juju/govmomi/vim25" - "github.com/juju/govmomi/vim25/mo" - "github.com/juju/govmomi/vim25/types" - "golang.org/x/net/context" -) - -type HostConfigManager struct { - Common -} - -func NewHostConfigManager(c *vim25.Client, ref types.ManagedObjectReference) *HostConfigManager { - return &HostConfigManager{ - Common: NewCommon(c, ref), - } -} - -func (m HostConfigManager) NetworkSystem(ctx context.Context) (*HostNetworkSystem, error) { - var h mo.HostSystem - - err := m.Properties(ctx, m.Reference(), []string{"configManager.networkSystem"}, &h) - if err != nil { - return nil, err - } - - return NewHostNetworkSystem(m.c, *h.ConfigManager.NetworkSystem), nil -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/object/host_datastore_browser.go juju-core-2.0.2/src/github.com/juju/govmomi/object/host_datastore_browser.go --- juju-core-2.0.0/src/github.com/juju/govmomi/object/host_datastore_browser.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/object/host_datastore_browser.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,64 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package object - -import ( - "github.com/juju/govmomi/vim25" - "github.com/juju/govmomi/vim25/methods" - "github.com/juju/govmomi/vim25/types" - "golang.org/x/net/context" -) - -type HostDatastoreBrowser struct { - Common -} - -func NewHostDatastoreBrowser(c *vim25.Client, ref types.ManagedObjectReference) *HostDatastoreBrowser { - return &HostDatastoreBrowser{ - Common: NewCommon(c, ref), - } -} - -func (b HostDatastoreBrowser) SearchDatastore(ctx context.Context, datastorePath string, searchSpec *types.HostDatastoreBrowserSearchSpec) (*Task, error) { - req := types.SearchDatastore_Task{ - This: b.Reference(), - DatastorePath: datastorePath, - SearchSpec: searchSpec, - } - - res, err := methods.SearchDatastore_Task(ctx, b.c, &req) - if err != nil { - return nil, err - } - - return NewTask(b.c, res.Returnval), nil -} - -func (b HostDatastoreBrowser) SearchDatastoreSubFolders(ctx context.Context, datastorePath string, searchSpec *types.HostDatastoreBrowserSearchSpec) (*Task, error) { - req := types.SearchDatastoreSubFolders_Task{ - This: b.Reference(), - DatastorePath: datastorePath, - SearchSpec: searchSpec, - } - - res, err := methods.SearchDatastoreSubFolders_Task(ctx, b.c, &req) - if err != nil { - return nil, err - } - - return NewTask(b.c, res.Returnval), nil -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/object/host_network_system.go juju-core-2.0.2/src/github.com/juju/govmomi/object/host_network_system.go --- juju-core-2.0.0/src/github.com/juju/govmomi/object/host_network_system.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/object/host_network_system.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,357 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package object - -import ( - "github.com/juju/govmomi/vim25" - "github.com/juju/govmomi/vim25/methods" - "github.com/juju/govmomi/vim25/types" - "golang.org/x/net/context" -) - -type HostNetworkSystem struct { - Common -} - -func NewHostNetworkSystem(c *vim25.Client, ref types.ManagedObjectReference) *HostNetworkSystem { - return &HostNetworkSystem{ - Common: NewCommon(c, ref), - } -} - -// AddPortGroup wraps methods.AddPortGroup -func (o HostNetworkSystem) AddPortGroup(ctx context.Context, portgrp types.HostPortGroupSpec) error { - req := types.AddPortGroup{ - This: o.Reference(), - Portgrp: portgrp, - } - - _, err := methods.AddPortGroup(ctx, o.c, &req) - if err != nil { - return err - } - - return nil -} - -// AddServiceConsoleVirtualNic wraps methods.AddServiceConsoleVirtualNic -func (o HostNetworkSystem) AddServiceConsoleVirtualNic(ctx context.Context, portgroup string, nic types.HostVirtualNicSpec) (string, error) { - req := types.AddServiceConsoleVirtualNic{ - This: o.Reference(), - Portgroup: portgroup, - Nic: nic, - } - - res, err := methods.AddServiceConsoleVirtualNic(ctx, o.c, &req) - if err != nil { - return "", err - } - - return res.Returnval, nil -} - -// AddVirtualNic wraps methods.AddVirtualNic -func (o HostNetworkSystem) AddVirtualNic(ctx context.Context, portgroup string, nic types.HostVirtualNicSpec) (string, error) { - req := types.AddVirtualNic{ - This: o.Reference(), - Portgroup: portgroup, - Nic: nic, - } - - res, err := methods.AddVirtualNic(ctx, o.c, &req) - if err != nil { - return "", err - } - - return res.Returnval, nil -} - -// AddVirtualSwitch wraps methods.AddVirtualSwitch -func (o HostNetworkSystem) AddVirtualSwitch(ctx context.Context, vswitchName string, spec *types.HostVirtualSwitchSpec) error { - req := types.AddVirtualSwitch{ - This: o.Reference(), - VswitchName: vswitchName, - Spec: spec, - } - - _, err := methods.AddVirtualSwitch(ctx, o.c, &req) - if err != nil { - return err - } - - return nil -} - -// QueryNetworkHint wraps methods.QueryNetworkHint -func (o HostNetworkSystem) QueryNetworkHint(ctx context.Context, device []string) error { - req := types.QueryNetworkHint{ - This: o.Reference(), - Device: device, - } - - _, err := methods.QueryNetworkHint(ctx, o.c, &req) - if err != nil { - return err - } - - return nil -} - -// RefreshNetworkSystem wraps methods.RefreshNetworkSystem -func (o HostNetworkSystem) RefreshNetworkSystem(ctx context.Context) error { - req := types.RefreshNetworkSystem{ - This: o.Reference(), - } - - _, err := methods.RefreshNetworkSystem(ctx, o.c, &req) - if err != nil { - return err - } - - return nil -} - -// RemovePortGroup wraps methods.RemovePortGroup -func (o HostNetworkSystem) RemovePortGroup(ctx context.Context, pgName string) error { - req := types.RemovePortGroup{ - This: o.Reference(), - PgName: pgName, - } - - _, err := methods.RemovePortGroup(ctx, o.c, &req) - if err != nil { - return err - } - - return nil -} - -// RemoveServiceConsoleVirtualNic wraps methods.RemoveServiceConsoleVirtualNic -func (o HostNetworkSystem) RemoveServiceConsoleVirtualNic(ctx context.Context, device string) error { - req := types.RemoveServiceConsoleVirtualNic{ - This: o.Reference(), - Device: device, - } - - _, err := methods.RemoveServiceConsoleVirtualNic(ctx, o.c, &req) - if err != nil { - return err - } - - return nil -} - -// RemoveVirtualNic wraps methods.RemoveVirtualNic -func (o HostNetworkSystem) RemoveVirtualNic(ctx context.Context, device string) error { - req := types.RemoveVirtualNic{ - This: o.Reference(), - Device: device, - } - - _, err := methods.RemoveVirtualNic(ctx, o.c, &req) - if err != nil { - return err - } - - return nil -} - -// RemoveVirtualSwitch wraps methods.RemoveVirtualSwitch -func (o HostNetworkSystem) RemoveVirtualSwitch(ctx context.Context, vswitchName string) error { - req := types.RemoveVirtualSwitch{ - This: o.Reference(), - VswitchName: vswitchName, - } - - _, err := methods.RemoveVirtualSwitch(ctx, o.c, &req) - if err != nil { - return err - } - - return nil -} - -// RestartServiceConsoleVirtualNic wraps methods.RestartServiceConsoleVirtualNic -func (o HostNetworkSystem) RestartServiceConsoleVirtualNic(ctx context.Context, device string) error { - req := types.RestartServiceConsoleVirtualNic{ - This: o.Reference(), - Device: device, - } - - _, err := methods.RestartServiceConsoleVirtualNic(ctx, o.c, &req) - if err != nil { - return err - } - - return nil -} - -// UpdateConsoleIpRouteConfig wraps methods.UpdateConsoleIpRouteConfig -func (o HostNetworkSystem) UpdateConsoleIpRouteConfig(ctx context.Context, config types.BaseHostIpRouteConfig) error { - req := types.UpdateConsoleIpRouteConfig{ - This: o.Reference(), - Config: config, - } - - _, err := methods.UpdateConsoleIpRouteConfig(ctx, o.c, &req) - if err != nil { - return err - } - - return nil -} - -// UpdateDnsConfig wraps methods.UpdateDnsConfig -func (o HostNetworkSystem) UpdateDnsConfig(ctx context.Context, config types.BaseHostDnsConfig) error { - req := types.UpdateDnsConfig{ - This: o.Reference(), - Config: config, - } - - _, err := methods.UpdateDnsConfig(ctx, o.c, &req) - if err != nil { - return err - } - - return nil -} - -// UpdateIpRouteConfig wraps methods.UpdateIpRouteConfig -func (o HostNetworkSystem) UpdateIpRouteConfig(ctx context.Context, config types.BaseHostIpRouteConfig) error { - req := types.UpdateIpRouteConfig{ - This: o.Reference(), - Config: config, - } - - _, err := methods.UpdateIpRouteConfig(ctx, o.c, &req) - if err != nil { - return err - } - - return nil -} - -// UpdateIpRouteTableConfig wraps methods.UpdateIpRouteTableConfig -func (o HostNetworkSystem) UpdateIpRouteTableConfig(ctx context.Context, config types.HostIpRouteTableConfig) error { - req := types.UpdateIpRouteTableConfig{ - This: o.Reference(), - Config: config, - } - - _, err := methods.UpdateIpRouteTableConfig(ctx, o.c, &req) - if err != nil { - return err - } - - return nil -} - -// UpdateNetworkConfig wraps methods.UpdateNetworkConfig -func (o HostNetworkSystem) UpdateNetworkConfig(ctx context.Context, config types.HostNetworkConfig, changeMode string) (*types.HostNetworkConfigResult, error) { - req := types.UpdateNetworkConfig{ - This: o.Reference(), - Config: config, - ChangeMode: changeMode, - } - - res, err := methods.UpdateNetworkConfig(ctx, o.c, &req) - if err != nil { - return nil, err - } - - return &res.Returnval, nil -} - -// UpdatePhysicalNicLinkSpeed wraps methods.UpdatePhysicalNicLinkSpeed -func (o HostNetworkSystem) UpdatePhysicalNicLinkSpeed(ctx context.Context, device string, linkSpeed *types.PhysicalNicLinkInfo) error { - req := types.UpdatePhysicalNicLinkSpeed{ - This: o.Reference(), - Device: device, - LinkSpeed: linkSpeed, - } - - _, err := methods.UpdatePhysicalNicLinkSpeed(ctx, o.c, &req) - if err != nil { - return err - } - - return nil -} - -// UpdatePortGroup wraps methods.UpdatePortGroup -func (o HostNetworkSystem) UpdatePortGroup(ctx context.Context, pgName string, portgrp types.HostPortGroupSpec) error { - req := types.UpdatePortGroup{ - This: o.Reference(), - PgName: pgName, - Portgrp: portgrp, - } - - _, err := methods.UpdatePortGroup(ctx, o.c, &req) - if err != nil { - return err - } - - return nil -} - -// UpdateServiceConsoleVirtualNic wraps methods.UpdateServiceConsoleVirtualNic -func (o HostNetworkSystem) UpdateServiceConsoleVirtualNic(ctx context.Context, device string, nic types.HostVirtualNicSpec) error { - req := types.UpdateServiceConsoleVirtualNic{ - This: o.Reference(), - Device: device, - Nic: nic, - } - - _, err := methods.UpdateServiceConsoleVirtualNic(ctx, o.c, &req) - if err != nil { - return err - } - - return nil -} - -// UpdateVirtualNic wraps methods.UpdateVirtualNic -func (o HostNetworkSystem) UpdateVirtualNic(ctx context.Context, device string, nic types.HostVirtualNicSpec) error { - req := types.UpdateVirtualNic{ - This: o.Reference(), - Device: device, - Nic: nic, - } - - _, err := methods.UpdateVirtualNic(ctx, o.c, &req) - if err != nil { - return err - } - - return nil -} - -// UpdateVirtualSwitch wraps methods.UpdateVirtualSwitch -func (o HostNetworkSystem) UpdateVirtualSwitch(ctx context.Context, vswitchName string, spec types.HostVirtualSwitchSpec) error { - req := types.UpdateVirtualSwitch{ - This: o.Reference(), - VswitchName: vswitchName, - Spec: spec, - } - - _, err := methods.UpdateVirtualSwitch(ctx, o.c, &req) - if err != nil { - return err - } - - return nil -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/object/host_system.go juju-core-2.0.2/src/github.com/juju/govmomi/object/host_system.go --- juju-core-2.0.0/src/github.com/juju/govmomi/object/host_system.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/object/host_system.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,96 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package object - -import ( - "fmt" - "net" - - "github.com/juju/govmomi/vim25" - "github.com/juju/govmomi/vim25/mo" - "github.com/juju/govmomi/vim25/types" - "golang.org/x/net/context" -) - -type HostSystem struct { - Common - - InventoryPath string -} - -func NewHostSystem(c *vim25.Client, ref types.ManagedObjectReference) *HostSystem { - return &HostSystem{ - Common: NewCommon(c, ref), - } -} - -func (h HostSystem) ConfigManager() *HostConfigManager { - return NewHostConfigManager(h.c, h.Reference()) -} - -func (h HostSystem) ResourcePool(ctx context.Context) (*ResourcePool, error) { - var mh mo.HostSystem - - err := h.Properties(ctx, h.Reference(), []string{"parent"}, &mh) - if err != nil { - return nil, err - } - - var mcr *mo.ComputeResource - var parent interface{} - - switch mh.Parent.Type { - case "ComputeResource": - mcr = new(mo.ComputeResource) - parent = mcr - case "ClusterComputeResource": - mcc := new(mo.ClusterComputeResource) - mcr = &mcc.ComputeResource - parent = mcc - default: - return nil, fmt.Errorf("unknown host parent type: %s", mh.Parent.Type) - } - - err = h.Properties(ctx, *mh.Parent, []string{"resourcePool"}, parent) - if err != nil { - return nil, err - } - - pool := NewResourcePool(h.c, *mcr.ResourcePool) - return pool, nil -} - -func (h HostSystem) ManagementIPs(ctx context.Context) ([]net.IP, error) { - var mh mo.HostSystem - - err := h.Properties(ctx, h.Reference(), []string{"config.virtualNicManagerInfo.netConfig"}, &mh) - if err != nil { - return nil, err - } - - var ips []net.IP - for _, nc := range mh.Config.VirtualNicManagerInfo.NetConfig { - if nc.NicType == "management" && len(nc.CandidateVnic) > 0 { - ip := net.ParseIP(nc.CandidateVnic[0].Spec.Ip.IpAddress) - if ip != nil { - ips = append(ips, ip) - } - } - } - - return ips, nil -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/object/http_nfc_lease.go juju-core-2.0.2/src/github.com/juju/govmomi/object/http_nfc_lease.go --- juju-core-2.0.0/src/github.com/juju/govmomi/object/http_nfc_lease.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/object/http_nfc_lease.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,143 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package object - -import ( - "errors" - "fmt" - - "github.com/juju/govmomi/property" - "github.com/juju/govmomi/vim25" - "github.com/juju/govmomi/vim25/methods" - "github.com/juju/govmomi/vim25/mo" - "github.com/juju/govmomi/vim25/types" - "golang.org/x/net/context" -) - -type HttpNfcLease struct { - Common -} - -func NewHttpNfcLease(c *vim25.Client, ref types.ManagedObjectReference) *HttpNfcLease { - return &HttpNfcLease{ - Common: NewCommon(c, ref), - } -} - -// HttpNfcLeaseAbort wraps methods.HttpNfcLeaseAbort -func (o HttpNfcLease) HttpNfcLeaseAbort(ctx context.Context, fault *types.LocalizedMethodFault) error { - req := types.HttpNfcLeaseAbort{ - This: o.Reference(), - Fault: fault, - } - - _, err := methods.HttpNfcLeaseAbort(ctx, o.c, &req) - if err != nil { - return err - } - - return nil -} - -// HttpNfcLeaseComplete wraps methods.HttpNfcLeaseComplete -func (o HttpNfcLease) HttpNfcLeaseComplete(ctx context.Context) error { - req := types.HttpNfcLeaseComplete{ - This: o.Reference(), - } - - _, err := methods.HttpNfcLeaseComplete(ctx, o.c, &req) - if err != nil { - return err - } - - return nil -} - -// HttpNfcLeaseGetManifest wraps methods.HttpNfcLeaseGetManifest -func (o HttpNfcLease) HttpNfcLeaseGetManifest(ctx context.Context) error { - req := types.HttpNfcLeaseGetManifest{ - This: o.Reference(), - } - - _, err := methods.HttpNfcLeaseGetManifest(ctx, o.c, &req) - if err != nil { - return err - } - - return nil -} - -// HttpNfcLeaseProgress wraps methods.HttpNfcLeaseProgress -func (o HttpNfcLease) HttpNfcLeaseProgress(ctx context.Context, percent int) error { - req := types.HttpNfcLeaseProgress{ - This: o.Reference(), - Percent: percent, - } - - _, err := methods.HttpNfcLeaseProgress(ctx, o.c, &req) - if err != nil { - return err - } - - return nil -} - -func (o HttpNfcLease) Wait(ctx context.Context) (*types.HttpNfcLeaseInfo, error) { - var lease mo.HttpNfcLease - - pc := property.DefaultCollector(o.c) - err := property.Wait(ctx, pc, o.Reference(), []string{"state", "info", "error"}, func(pc []types.PropertyChange) bool { - done := false - - for _, c := range pc { - if c.Val == nil { - continue - } - - switch c.Name { - case "error": - val := c.Val.(types.LocalizedMethodFault) - lease.Error = &val - done = true - case "info": - val := c.Val.(types.HttpNfcLeaseInfo) - lease.Info = &val - case "state": - lease.State = c.Val.(types.HttpNfcLeaseState) - if lease.State != types.HttpNfcLeaseStateInitializing { - done = true - } - } - } - - return done - }) - - if err != nil { - return nil, err - } - - if lease.State == types.HttpNfcLeaseStateReady { - return lease.Info, nil - } - - if lease.Error != nil { - return nil, errors.New(lease.Error.LocalizedMessage) - } - - return nil, fmt.Errorf("unexpected nfc lease state: %s", lease.State) -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/object/network.go juju-core-2.0.2/src/github.com/juju/govmomi/object/network.go --- juju-core-2.0.0/src/github.com/juju/govmomi/object/network.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/object/network.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,54 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package object - -import ( - "path" - - "github.com/juju/govmomi/vim25" - "github.com/juju/govmomi/vim25/types" - "golang.org/x/net/context" -) - -type Network struct { - Common - - InventoryPath string -} - -func NewNetwork(c *vim25.Client, ref types.ManagedObjectReference) *Network { - return &Network{ - Common: NewCommon(c, ref), - } -} - -func (n Network) Name() string { - return path.Base(n.InventoryPath) -} - -// EthernetCardBackingInfo returns the VirtualDeviceBackingInfo for this Network -func (n Network) EthernetCardBackingInfo(_ context.Context) (types.BaseVirtualDeviceBackingInfo, error) { - name := n.Name() - - backing := &types.VirtualEthernetCardNetworkBackingInfo{ - VirtualDeviceDeviceBackingInfo: types.VirtualDeviceDeviceBackingInfo{ - DeviceName: name, - }, - } - - return backing, nil -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/object/network_reference.go juju-core-2.0.2/src/github.com/juju/govmomi/object/network_reference.go --- juju-core-2.0.0/src/github.com/juju/govmomi/object/network_reference.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/object/network_reference.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,28 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package object - -import ( - "github.com/juju/govmomi/vim25/types" - "golang.org/x/net/context" -) - -// The NetworkReference interface is implemented by managed objects -// which can be used as the backing for a VirtualEthernetCard. -type NetworkReference interface { - EthernetCardBackingInfo(ctx context.Context) (types.BaseVirtualDeviceBackingInfo, error) -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/object/network_test.go juju-core-2.0.2/src/github.com/juju/govmomi/object/network_test.go --- juju-core-2.0.0/src/github.com/juju/govmomi/object/network_test.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/object/network_test.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,23 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package object - -// Network should implement the Reference interface. -var _ Reference = Network{} - -// Network should implement the NetworkReference interface. -var _ NetworkReference = Network{} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/object/ovf_manager.go juju-core-2.0.2/src/github.com/juju/govmomi/object/ovf_manager.go --- juju-core-2.0.0/src/github.com/juju/govmomi/object/ovf_manager.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/object/ovf_manager.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,103 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package object - -import ( - "github.com/juju/govmomi/vim25" - "github.com/juju/govmomi/vim25/methods" - "github.com/juju/govmomi/vim25/types" - "golang.org/x/net/context" -) - -type OvfManager struct { - Common -} - -func NewOvfManager(c *vim25.Client) *OvfManager { - o := OvfManager{ - Common: NewCommon(c, *c.ServiceContent.OvfManager), - } - - return &o -} - -// CreateDescriptor wraps methods.CreateDescriptor -func (o OvfManager) CreateDescriptor(ctx context.Context, obj Reference, cdp types.OvfCreateDescriptorParams) (*types.OvfCreateDescriptorResult, error) { - req := types.CreateDescriptor{ - This: o.Reference(), - Obj: obj.Reference(), - Cdp: cdp, - } - - res, err := methods.CreateDescriptor(ctx, o.c, &req) - if err != nil { - return nil, err - } - - return &res.Returnval, nil -} - -// CreateImportSpec wraps methods.CreateImportSpec -func (o OvfManager) CreateImportSpec(ctx context.Context, ovfDescriptor string, resourcePool Reference, datastore Reference, cisp types.OvfCreateImportSpecParams) (*types.OvfCreateImportSpecResult, error) { - req := types.CreateImportSpec{ - This: o.Reference(), - OvfDescriptor: ovfDescriptor, - ResourcePool: resourcePool.Reference(), - Datastore: datastore.Reference(), - Cisp: cisp, - } - - res, err := methods.CreateImportSpec(ctx, o.c, &req) - if err != nil { - return nil, err - } - - return &res.Returnval, nil -} - -// ParseDescriptor wraps methods.ParseDescriptor -func (o OvfManager) ParseDescriptor(ctx context.Context, ovfDescriptor string, pdp types.OvfParseDescriptorParams) (*types.OvfParseDescriptorResult, error) { - req := types.ParseDescriptor{ - This: o.Reference(), - OvfDescriptor: ovfDescriptor, - Pdp: pdp, - } - - res, err := methods.ParseDescriptor(ctx, o.c, &req) - if err != nil { - return nil, err - } - - return &res.Returnval, nil -} - -// ValidateHost wraps methods.ValidateHost -func (o OvfManager) ValidateHost(ctx context.Context, ovfDescriptor string, host Reference, vhp types.OvfValidateHostParams) (*types.OvfValidateHostResult, error) { - req := types.ValidateHost{ - This: o.Reference(), - OvfDescriptor: ovfDescriptor, - Host: host.Reference(), - Vhp: vhp, - } - - res, err := methods.ValidateHost(ctx, o.c, &req) - if err != nil { - return nil, err - } - - return &res.Returnval, nil -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/object/resource_pool.go juju-core-2.0.2/src/github.com/juju/govmomi/object/resource_pool.go --- juju-core-2.0.0/src/github.com/juju/govmomi/object/resource_pool.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/object/resource_pool.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,117 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package object - -import ( - "github.com/juju/govmomi/vim25" - "github.com/juju/govmomi/vim25/methods" - "github.com/juju/govmomi/vim25/types" - "golang.org/x/net/context" -) - -type ResourcePool struct { - Common - - InventoryPath string -} - -func NewResourcePool(c *vim25.Client, ref types.ManagedObjectReference) *ResourcePool { - return &ResourcePool{ - Common: NewCommon(c, ref), - } -} - -func (p ResourcePool) ImportVApp(ctx context.Context, spec types.BaseImportSpec, folder *Folder, host *HostSystem) (*HttpNfcLease, error) { - req := types.ImportVApp{ - This: p.Reference(), - Spec: spec, - } - - if folder != nil { - ref := folder.Reference() - req.Folder = &ref - } - - if host != nil { - ref := host.Reference() - req.Host = &ref - } - - res, err := methods.ImportVApp(ctx, p.c, &req) - if err != nil { - return nil, err - } - - return NewHttpNfcLease(p.c, res.Returnval), nil -} - -func (p ResourcePool) Create(ctx context.Context, name string, spec types.ResourceConfigSpec) (*ResourcePool, error) { - req := types.CreateResourcePool{ - This: p.Reference(), - Name: name, - Spec: spec, - } - - res, err := methods.CreateResourcePool(ctx, p.c, &req) - if err != nil { - return nil, err - } - - return NewResourcePool(p.c, res.Returnval), nil -} - -func (p ResourcePool) UpdateConfig(ctx context.Context, name string, config *types.ResourceConfigSpec) error { - req := types.UpdateConfig{ - This: p.Reference(), - Name: name, - Config: config, - } - - if config != nil && config.Entity == nil { - ref := p.Reference() - - // Create copy of config so changes won't leak back to the caller - newConfig := *config - newConfig.Entity = &ref - req.Config = &newConfig - } - - _, err := methods.UpdateConfig(ctx, p.c, &req) - return err -} - -func (p ResourcePool) DestroyChildren(ctx context.Context) error { - req := types.DestroyChildren{ - This: p.Reference(), - } - - _, err := methods.DestroyChildren(ctx, p.c, &req) - return err -} - -func (p ResourcePool) Destroy(ctx context.Context) (*Task, error) { - req := types.Destroy_Task{ - This: p.Reference(), - } - - res, err := methods.Destroy_Task(ctx, p.c, &req) - if err != nil { - return nil, err - } - - return NewTask(p.c, res.Returnval), nil -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/object/search_index.go juju-core-2.0.2/src/github.com/juju/govmomi/object/search_index.go --- juju-core-2.0.0/src/github.com/juju/govmomi/object/search_index.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/object/search_index.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,161 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package object - -import ( - "github.com/juju/govmomi/vim25" - "github.com/juju/govmomi/vim25/methods" - "github.com/juju/govmomi/vim25/types" - "golang.org/x/net/context" -) - -type SearchIndex struct { - Common -} - -func NewSearchIndex(c *vim25.Client) *SearchIndex { - s := SearchIndex{ - Common: NewCommon(c, *c.ServiceContent.SearchIndex), - } - - return &s -} - -// FindByDatastorePath finds a virtual machine by its location on a datastore. -func (s SearchIndex) FindByDatastorePath(ctx context.Context, dc *Datacenter, path string) (Reference, error) { - req := types.FindByDatastorePath{ - This: s.Reference(), - Datacenter: dc.Reference(), - Path: path, - } - - res, err := methods.FindByDatastorePath(ctx, s.c, &req) - if err != nil { - return nil, err - } - - if res.Returnval == nil { - return nil, nil - } - return NewReference(s.c, *res.Returnval), nil -} - -// FindByDnsName finds a virtual machine or host by DNS name. -func (s SearchIndex) FindByDnsName(ctx context.Context, dc *Datacenter, dnsName string, vmSearch bool) (Reference, error) { - req := types.FindByDnsName{ - This: s.Reference(), - DnsName: dnsName, - VmSearch: vmSearch, - } - if dc != nil { - ref := dc.Reference() - req.Datacenter = &ref - } - - res, err := methods.FindByDnsName(ctx, s.c, &req) - if err != nil { - return nil, err - } - - if res.Returnval == nil { - return nil, nil - } - return NewReference(s.c, *res.Returnval), nil -} - -// FindByInventoryPath finds a managed entity based on its location in the inventory. -func (s SearchIndex) FindByInventoryPath(ctx context.Context, path string) (Reference, error) { - req := types.FindByInventoryPath{ - This: s.Reference(), - InventoryPath: path, - } - - res, err := methods.FindByInventoryPath(ctx, s.c, &req) - if err != nil { - return nil, err - } - - if res.Returnval == nil { - return nil, nil - } - return NewReference(s.c, *res.Returnval), nil -} - -// FindByIp finds a virtual machine or host by IP address. -func (s SearchIndex) FindByIp(ctx context.Context, dc *Datacenter, ip string, vmSearch bool) (Reference, error) { - req := types.FindByIp{ - This: s.Reference(), - Ip: ip, - VmSearch: vmSearch, - } - if dc != nil { - ref := dc.Reference() - req.Datacenter = &ref - } - - res, err := methods.FindByIp(ctx, s.c, &req) - if err != nil { - return nil, err - } - - if res.Returnval == nil { - return nil, nil - } - return NewReference(s.c, *res.Returnval), nil -} - -// FindByUuid finds a virtual machine or host by UUID. -func (s SearchIndex) FindByUuid(ctx context.Context, dc *Datacenter, uuid string, vmSearch bool) (Reference, error) { - req := types.FindByUuid{ - This: s.Reference(), - Uuid: uuid, - VmSearch: vmSearch, - } - if dc != nil { - ref := dc.Reference() - req.Datacenter = &ref - } - - res, err := methods.FindByUuid(ctx, s.c, &req) - if err != nil { - return nil, err - } - - if res.Returnval == nil { - return nil, nil - } - return NewReference(s.c, *res.Returnval), nil -} - -// FindChild finds a particular child based on a managed entity name. -func (s SearchIndex) FindChild(ctx context.Context, entity Reference, name string) (Reference, error) { - req := types.FindChild{ - This: s.Reference(), - Entity: entity.Reference(), - Name: name, - } - - res, err := methods.FindChild(ctx, s.c, &req) - if err != nil { - return nil, err - } - - if res.Returnval == nil { - return nil, nil - } - return NewReference(s.c, *res.Returnval), nil -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/object/search_index_test.go juju-core-2.0.2/src/github.com/juju/govmomi/object/search_index_test.go --- juju-core-2.0.0/src/github.com/juju/govmomi/object/search_index_test.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/object/search_index_test.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,155 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package object - -import ( - "fmt" - "reflect" - "testing" - - "github.com/juju/govmomi/test/client" - "github.com/juju/govmomi/vim25/mo" - "golang.org/x/net/context" -) - -func TestSearch(t *testing.T) { - c := client.NewAuthenticatedClient(t) - s := NewSearchIndex(c) - - ref, err := s.FindChild(context.Background(), NewRootFolder(c), "ha-datacenter") - if err != nil { - t.Fatal(err) - } - - dc, ok := ref.(*Datacenter) - if !ok { - t.Errorf("Expected Datacenter: %#v", ref) - } - - folders, err := dc.Folders(context.Background()) - if err != nil { - t.Fatal(err) - } - - ref, err = s.FindChild(context.Background(), folders.DatastoreFolder, "datastore1") - if err != nil { - t.Fatal(err) - } - - _, ok = ref.(*Datastore) - if !ok { - t.Errorf("Expected Datastore: %#v", ref) - } - - ref, err = s.FindByInventoryPath(context.Background(), "/ha-datacenter/network/VM Network") - if err != nil { - t.Fatal(err) - } - - _, ok = ref.(*Network) - if !ok { - t.Errorf("Expected Network: %#v", ref) - } - - crs, err := folders.HostFolder.Children(context.Background()) - if err != nil { - if err != nil { - t.Fatal(err) - } - } - if len(crs) != 0 { - var cr mo.ComputeResource - ref = crs[0] - err = s.Properties(context.Background(), ref.Reference(), []string{"host"}, &cr) - if err != nil { - t.Fatal(err) - } - - var host mo.HostSystem - ref = NewHostSystem(c, cr.Host[0]) - err = s.Properties(context.Background(), ref.Reference(), []string{"name", "hardware", "config"}, &host) - if err != nil { - t.Fatal(err) - } - - dnsConfig := host.Config.Network.DnsConfig.GetHostDnsConfig() - dnsName := fmt.Sprintf("%s.%s", dnsConfig.HostName, dnsConfig.DomainName) - shost, err := s.FindByDnsName(context.Background(), dc, dnsName, false) - if err != nil { - t.Fatal(err) - } - if !reflect.DeepEqual(ref, shost) { - t.Errorf("%#v != %#v\n", ref, shost) - } - - shost, err = s.FindByUuid(context.Background(), dc, host.Hardware.SystemInfo.Uuid, false) - if err != nil { - t.Fatal(err) - } - if !reflect.DeepEqual(ref, shost) { - t.Errorf("%#v != %#v\n", ref, shost) - } - } - - vms, err := folders.VmFolder.Children(context.Background()) - if err != nil { - t.Fatal(err) - } - if len(vms) != 0 { - var vm mo.VirtualMachine - ref = vms[0] - err = s.Properties(context.Background(), ref.Reference(), []string{"config", "guest"}, &vm) - if err != nil { - t.Fatal(err) - } - svm, err := s.FindByDatastorePath(context.Background(), dc, vm.Config.Files.VmPathName) - if err != nil { - t.Fatal(err) - } - if !reflect.DeepEqual(ref, svm) { - t.Errorf("%#v != %#v\n", ref, svm) - } - - svm, err = s.FindByUuid(context.Background(), dc, vm.Config.Uuid, true) - if err != nil { - t.Fatal(err) - } - if !reflect.DeepEqual(ref, svm) { - t.Errorf("%#v != %#v\n", ref, svm) - } - - if vm.Guest.HostName != "" { - svm, err := s.FindByDnsName(context.Background(), dc, vm.Guest.HostName, true) - if err != nil { - t.Fatal(err) - } - if !reflect.DeepEqual(ref, svm) { - t.Errorf("%#v != %#v\n", ref, svm) - } - } - - if vm.Guest.IpAddress != "" { - svm, err := s.FindByIp(context.Background(), dc, vm.Guest.IpAddress, true) - if err != nil { - t.Fatal(err) - } - if !reflect.DeepEqual(ref, svm) { - t.Errorf("%#v != %#v\n", ref, svm) - } - } - } -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/object/storage_pod.go juju-core-2.0.2/src/github.com/juju/govmomi/object/storage_pod.go --- juju-core-2.0.0/src/github.com/juju/govmomi/object/storage_pod.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/object/storage_pod.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,21 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package object - -type StoragePod struct { - *Folder -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/object/storage_resource_manager.go juju-core-2.0.2/src/github.com/juju/govmomi/object/storage_resource_manager.go --- juju-core-2.0.0/src/github.com/juju/govmomi/object/storage_resource_manager.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/object/storage_resource_manager.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,178 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package object - -import ( - "github.com/juju/govmomi/vim25" - "github.com/juju/govmomi/vim25/methods" - "github.com/juju/govmomi/vim25/types" - "golang.org/x/net/context" -) - -type StorageResourceManager struct { - Common -} - -func NewStorageResourceManager(c *vim25.Client) *StorageResourceManager { - sr := StorageResourceManager{ - Common: NewCommon(c, *c.ServiceContent.StorageResourceManager), - } - - return &sr -} - -func (sr StorageResourceManager) ApplyStorageDrsRecommendation(ctx context.Context, key []string) (*Task, error) { - req := types.ApplyStorageDrsRecommendation_Task{ - This: sr.Reference(), - Key: key, - } - - res, err := methods.ApplyStorageDrsRecommendation_Task(ctx, sr.c, &req) - if err != nil { - return nil, err - } - - return NewTask(sr.c, res.Returnval), nil -} - -func (sr StorageResourceManager) ApplyStorageDrsRecommendationToPod(ctx context.Context, pod *StoragePod, key string) (*Task, error) { - req := types.ApplyStorageDrsRecommendationToPod_Task{ - This: sr.Reference(), - Key: key, - } - - if pod != nil { - req.Pod = pod.Reference() - } - - res, err := methods.ApplyStorageDrsRecommendationToPod_Task(ctx, sr.c, &req) - if err != nil { - return nil, err - } - - return NewTask(sr.c, res.Returnval), nil -} - -func (sr StorageResourceManager) CancelStorageDrsRecommendation(ctx context.Context, key []string) error { - req := types.CancelStorageDrsRecommendation{ - This: sr.Reference(), - Key: key, - } - - _, err := methods.CancelStorageDrsRecommendation(ctx, sr.c, &req) - - return err -} - -func (sr StorageResourceManager) ConfigureDatastoreIORM(ctx context.Context, datastore *Datastore, spec types.StorageIORMConfigSpec, key string) (*Task, error) { - req := types.ConfigureDatastoreIORM_Task{ - This: sr.Reference(), - Spec: spec, - } - - if datastore != nil { - req.Datastore = datastore.Reference() - } - - res, err := methods.ConfigureDatastoreIORM_Task(ctx, sr.c, &req) - if err != nil { - return nil, err - } - - return NewTask(sr.c, res.Returnval), nil -} - -func (sr StorageResourceManager) ConfigureStorageDrsForPod(ctx context.Context, pod *StoragePod, spec types.StorageDrsConfigSpec, modify bool) (*Task, error) { - req := types.ConfigureStorageDrsForPod_Task{ - This: sr.Reference(), - Spec: spec, - Modify: modify, - } - - if pod != nil { - req.Pod = pod.Reference() - } - - res, err := methods.ConfigureStorageDrsForPod_Task(ctx, sr.c, &req) - if err != nil { - return nil, err - } - - return NewTask(sr.c, res.Returnval), nil -} - -func (sr StorageResourceManager) QueryDatastorePerformanceSummary(ctx context.Context, datastore *Datastore) ([]types.StoragePerformanceSummary, error) { - req := types.QueryDatastorePerformanceSummary{ - This: sr.Reference(), - } - - if datastore != nil { - req.Datastore = datastore.Reference() - } - - res, err := methods.QueryDatastorePerformanceSummary(ctx, sr.c, &req) - if err != nil { - return nil, err - } - - return res.Returnval, nil -} - -func (sr StorageResourceManager) QueryIORMConfigOption(ctx context.Context, host *HostSystem) (*types.StorageIORMConfigOption, error) { - req := types.QueryIORMConfigOption{ - This: sr.Reference(), - } - - if host != nil { - req.Host = host.Reference() - } - - res, err := methods.QueryIORMConfigOption(ctx, sr.c, &req) - if err != nil { - return nil, err - } - - return &res.Returnval, nil -} - -func (sr StorageResourceManager) RecommendDatastores(ctx context.Context, storageSpec types.StoragePlacementSpec) (*types.StoragePlacementResult, error) { - req := types.RecommendDatastores{ - This: sr.Reference(), - StorageSpec: storageSpec, - } - - res, err := methods.RecommendDatastores(ctx, sr.c, &req) - if err != nil { - return nil, err - } - - return &res.Returnval, nil -} - -func (sr StorageResourceManager) RefreshStorageDrsRecommendation(ctx context.Context, pod *StoragePod) error { - req := types.RefreshStorageDrsRecommendation{ - This: sr.Reference(), - } - - if pod != nil { - req.Pod = pod.Reference() - } - - _, err := methods.RefreshStorageDrsRecommendation(ctx, sr.c, &req) - - return err -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/object/task.go juju-core-2.0.2/src/github.com/juju/govmomi/object/task.go --- juju-core-2.0.0/src/github.com/juju/govmomi/object/task.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/object/task.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,52 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package object - -import ( - "github.com/juju/govmomi/property" - "github.com/juju/govmomi/task" - "github.com/juju/govmomi/vim25" - "github.com/juju/govmomi/vim25/progress" - "github.com/juju/govmomi/vim25/types" - "golang.org/x/net/context" -) - -// Task is a convenience wrapper around task.Task that keeps a reference to -// the client that was used to create it. This allows users to call the Wait() -// function with only a context parameter, instead of a context parameter, a -// soap.RoundTripper, and reference to the root property collector. -type Task struct { - Common -} - -func NewTask(c *vim25.Client, ref types.ManagedObjectReference) *Task { - t := Task{ - Common: NewCommon(c, ref), - } - - return &t -} - -func (t *Task) Wait(ctx context.Context) error { - _, err := t.WaitForResult(ctx, nil) - return err -} - -func (t *Task) WaitForResult(ctx context.Context, s progress.Sinker) (*types.TaskInfo, error) { - p := property.DefaultCollector(t.c) - return task.Wait(ctx, t.Reference(), p, s) -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/object/types.go juju-core-2.0.2/src/github.com/juju/govmomi/object/types.go --- juju-core-2.0.0/src/github.com/juju/govmomi/object/types.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/object/types.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,65 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package object - -import ( - "github.com/juju/govmomi/vim25" - "github.com/juju/govmomi/vim25/types" -) - -type Reference interface { - Reference() types.ManagedObjectReference -} - -func NewReference(c *vim25.Client, e types.ManagedObjectReference) Reference { - switch e.Type { - case "Folder": - return NewFolder(c, e) - case "StoragePod": - return &StoragePod{ - NewFolder(c, e), - } - case "Datacenter": - return NewDatacenter(c, e) - case "VirtualMachine": - return NewVirtualMachine(c, e) - case "VirtualApp": - return &VirtualApp{ - NewResourcePool(c, e), - } - case "ComputeResource": - return NewComputeResource(c, e) - case "ClusterComputeResource": - return &ClusterComputeResource{*NewComputeResource(c, e)} - case "HostSystem": - return NewHostSystem(c, e) - case "Network": - return NewNetwork(c, e) - case "ResourcePool": - return NewResourcePool(c, e) - case "DistributedVirtualSwitch": - return NewDistributedVirtualSwitch(c, e) - case "VmwareDistributedVirtualSwitch": - return &VmwareDistributedVirtualSwitch{*NewDistributedVirtualSwitch(c, e)} - case "DistributedVirtualPortgroup": - return NewDistributedVirtualPortgroup(c, e) - case "Datastore": - return NewDatastore(c, e) - default: - panic("Unknown managed entity: " + e.Type) - } -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/object/virtual_app.go juju-core-2.0.2/src/github.com/juju/govmomi/object/virtual_app.go --- juju-core-2.0.0/src/github.com/juju/govmomi/object/virtual_app.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/object/virtual_app.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,21 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package object - -type VirtualApp struct { - *ResourcePool -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/object/virtual_device_list.go juju-core-2.0.2/src/github.com/juju/govmomi/object/virtual_device_list.go --- juju-core-2.0.0/src/github.com/juju/govmomi/object/virtual_device_list.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/object/virtual_device_list.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,745 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package object - -import ( - "errors" - "fmt" - "path/filepath" - "reflect" - "regexp" - "sort" - "strings" - - "github.com/juju/govmomi/vim25/types" -) - -// Type values for use in BootOrder -const ( - DeviceTypeCdrom = "cdrom" - DeviceTypeDisk = "disk" - DeviceTypeEthernet = "ethernet" - DeviceTypeFloppy = "floppy" -) - -// VirtualDeviceList provides helper methods for working with a list of virtual devices. -type VirtualDeviceList []types.BaseVirtualDevice - -// SCSIControllerTypes are used for adding a new SCSI controller to a VM. -func SCSIControllerTypes() VirtualDeviceList { - // Return a mutable list of SCSI controller types, initialized with defaults. - return VirtualDeviceList([]types.BaseVirtualDevice{ - &types.VirtualLsiLogicController{}, - &types.VirtualBusLogicController{}, - &types.ParaVirtualSCSIController{}, - &types.VirtualLsiLogicSASController{}, - }).Select(func(device types.BaseVirtualDevice) bool { - c := device.(types.BaseVirtualSCSIController).GetVirtualSCSIController() - c.SharedBus = types.VirtualSCSISharingNoSharing - c.BusNumber = -1 - return true - }) -} - -// EthernetCardTypes are used for adding a new ethernet card to a VM. -func EthernetCardTypes() VirtualDeviceList { - return VirtualDeviceList([]types.BaseVirtualDevice{ - &types.VirtualE1000{}, - &types.VirtualE1000e{}, - &types.VirtualVmxnet3{}, - }).Select(func(device types.BaseVirtualDevice) bool { - c := device.(types.BaseVirtualEthernetCard).GetVirtualEthernetCard() - c.AddressType = string(types.VirtualEthernetCardMacTypeGenerated) - c.GetVirtualDevice().Key = -1 - return true - }) -} - -// Select returns a new list containing all elements of the list for which the given func returns true. -func (l VirtualDeviceList) Select(f func(device types.BaseVirtualDevice) bool) VirtualDeviceList { - var found VirtualDeviceList - - for _, device := range l { - if f(device) { - found = append(found, device) - } - } - - return found -} - -// SelectByType returns a new list with devices that are equal to or extend the given type. -func (l VirtualDeviceList) SelectByType(deviceType types.BaseVirtualDevice) VirtualDeviceList { - dtype := reflect.TypeOf(deviceType) - dname := dtype.Elem().Name() - - return l.Select(func(device types.BaseVirtualDevice) bool { - t := reflect.TypeOf(device) - - if t == dtype { - return true - } - - _, ok := t.Elem().FieldByName(dname) - - return ok - }) -} - -// SelectByBackingInfo returns a new list with devices matching the given backing info. -func (l VirtualDeviceList) SelectByBackingInfo(backing types.BaseVirtualDeviceBackingInfo) VirtualDeviceList { - t := reflect.TypeOf(backing) - - return l.Select(func(device types.BaseVirtualDevice) bool { - db := device.GetVirtualDevice().Backing - if db == nil { - return false - } - - if reflect.TypeOf(db) != t { - return false - } - - switch a := db.(type) { - case *types.VirtualEthernetCardNetworkBackingInfo: - b := backing.(*types.VirtualEthernetCardNetworkBackingInfo) - return a.DeviceName == b.DeviceName - case *types.VirtualEthernetCardDistributedVirtualPortBackingInfo: - b := backing.(*types.VirtualEthernetCardDistributedVirtualPortBackingInfo) - return a.Port.SwitchUuid == b.Port.SwitchUuid - case *types.VirtualDiskFlatVer2BackingInfo: - b := backing.(*types.VirtualDiskFlatVer2BackingInfo) - if a.Parent != nil && b.Parent != nil { - return a.Parent.FileName == b.Parent.FileName - } - return a.FileName == b.FileName - case types.BaseVirtualDeviceFileBackingInfo: - b := backing.(types.BaseVirtualDeviceFileBackingInfo) - return a.GetVirtualDeviceFileBackingInfo().FileName == b.GetVirtualDeviceFileBackingInfo().FileName - default: - return false - } - }) -} - -// Find returns the device matching the given name. -func (l VirtualDeviceList) Find(name string) types.BaseVirtualDevice { - for _, device := range l { - if l.Name(device) == name { - return device - } - } - return nil -} - -// FindByKey returns the device matching the given key. -func (l VirtualDeviceList) FindByKey(key int) types.BaseVirtualDevice { - for _, device := range l { - if device.GetVirtualDevice().Key == key { - return device - } - } - return nil -} - -// FindIDEController will find the named IDE controller if given, otherwise will pick an available controller. -// An error is returned if the named controller is not found or not an IDE controller. Or, if name is not -// given and no available controller can be found. -func (l VirtualDeviceList) FindIDEController(name string) (*types.VirtualIDEController, error) { - if name != "" { - d := l.Find(name) - if d == nil { - return nil, fmt.Errorf("device '%s' not found", name) - } - if c, ok := d.(*types.VirtualIDEController); ok { - return c, nil - } - return nil, fmt.Errorf("%s is not an IDE controller", name) - } - - c := l.PickController((*types.VirtualIDEController)(nil)) - if c == nil { - return nil, errors.New("no available IDE controller") - } - - return c.(*types.VirtualIDEController), nil -} - -// FindSCSIController will find the named SCSI controller if given, otherwise will pick an available controller. -// An error is returned if the named controller is not found or not an SCSI controller. Or, if name is not -// given and no available controller can be found. -func (l VirtualDeviceList) FindSCSIController(name string) (*types.VirtualSCSIController, error) { - if name != "" { - d := l.Find(name) - if d == nil { - return nil, fmt.Errorf("device '%s' not found", name) - } - if c, ok := d.(types.BaseVirtualSCSIController); ok { - return c.GetVirtualSCSIController(), nil - } - return nil, fmt.Errorf("%s is not an SCSI controller", name) - } - - c := l.PickController((*types.VirtualSCSIController)(nil)) - if c == nil { - return nil, errors.New("no available SCSI controller") - } - - return c.(types.BaseVirtualSCSIController).GetVirtualSCSIController(), nil -} - -// CreateSCSIController creates a new SCSI controller of type name if given, otherwise defaults to lsilogic. -func (l VirtualDeviceList) CreateSCSIController(name string) (types.BaseVirtualDevice, error) { - ctypes := SCSIControllerTypes() - - if name == "scsi" || name == "" { - name = ctypes.Type(ctypes[0]) - } - - found := ctypes.Select(func(device types.BaseVirtualDevice) bool { - return l.Type(device) == name - }) - - if len(found) == 0 { - return nil, fmt.Errorf("unknown SCSI controller type '%s'", name) - } - - c, ok := found[0].(types.BaseVirtualSCSIController) - if !ok { - return nil, fmt.Errorf("invalid SCSI controller type '%s'", name) - } - - scsi := c.GetVirtualSCSIController() - - scsi.BusNumber = l.newSCSIBusNumber() - - return c.(types.BaseVirtualDevice), nil -} - -var scsiBusNumbers = []int{0, 1, 2, 3} - -// newSCSIBusNumber returns the bus number to use for adding a new SCSI bus device. -// -1 is returned if there are no bus numbers available. -func (l VirtualDeviceList) newSCSIBusNumber() int { - var used []int - - for _, d := range l.SelectByType((*types.VirtualSCSIController)(nil)) { - num := d.(types.BaseVirtualSCSIController).GetVirtualSCSIController().BusNumber - if num >= 0 { - used = append(used, num) - } // else caller is creating a new vm using SCSIControllerTypes - } - - sort.Ints(used) - - for i, n := range scsiBusNumbers { - if i == len(used) || n != used[i] { - return n - } - } - - return -1 -} - -// FindDiskController will find an existing ide or scsi disk controller. -func (l VirtualDeviceList) FindDiskController(name string) (types.BaseVirtualController, error) { - switch { - case name == "ide": - return l.FindIDEController("") - case name == "scsi" || name == "": - return l.FindSCSIController("") - default: - if c, ok := l.Find(name).(types.BaseVirtualController); ok { - return c, nil - } - return nil, fmt.Errorf("%s is not a valid controller", name) - } -} - -// PickController returns a controller of the given type(s). -// If no controllers are found or have no available slots, then nil is returned. -func (l VirtualDeviceList) PickController(kind types.BaseVirtualController) types.BaseVirtualController { - l = l.SelectByType(kind.(types.BaseVirtualDevice)).Select(func(device types.BaseVirtualDevice) bool { - num := len(device.(types.BaseVirtualController).GetVirtualController().Device) - - switch device.(type) { - case types.BaseVirtualSCSIController: - return num < 15 - case *types.VirtualIDEController: - return num < 2 - default: - return true - } - }) - - if len(l) == 0 { - return nil - } - - return l[0].(types.BaseVirtualController) -} - -// newUnitNumber returns the unit number to use for attaching a new device to the given controller. -func (l VirtualDeviceList) newUnitNumber(c types.BaseVirtualController) int { - key := c.GetVirtualController().Key - max := -1 - - for _, device := range l { - d := device.GetVirtualDevice() - - if d.ControllerKey == key { - if d.UnitNumber > max { - max = d.UnitNumber - } - } - } - - return max + 1 -} - -// AssignController assigns a device to a controller. -func (l VirtualDeviceList) AssignController(device types.BaseVirtualDevice, c types.BaseVirtualController) { - d := device.GetVirtualDevice() - d.ControllerKey = c.GetVirtualController().Key - d.UnitNumber = l.newUnitNumber(c) - d.Key = -1 -} - -// CreateDisk creates a new VirtualDisk device which can be added to a VM. -func (l VirtualDeviceList) CreateDisk(c types.BaseVirtualController, name string) *types.VirtualDisk { - // If name is not specified, one will be chosen for you. - // But if when given, make sure it ends in .vmdk, otherwise it will be treated as a directory. - if len(name) > 0 && filepath.Ext(name) != ".vmdk" { - name += ".vmdk" - } - - device := &types.VirtualDisk{ - VirtualDevice: types.VirtualDevice{ - Backing: &types.VirtualDiskFlatVer2BackingInfo{ - DiskMode: string(types.VirtualDiskModePersistent), - ThinProvisioned: types.NewBool(true), - VirtualDeviceFileBackingInfo: types.VirtualDeviceFileBackingInfo{ - FileName: name, - }, - }, - }, - } - - l.AssignController(device, c) - - if device.UnitNumber == 0 { - device.UnitNumber = -1 // TODO: this field is annotated as omitempty - } - - return device -} - -// ChildDisk creates a new VirtualDisk device, linked to the given parent disk, which can be added to a VM. -func (l VirtualDeviceList) ChildDisk(parent *types.VirtualDisk) *types.VirtualDisk { - disk := *parent - backing := disk.Backing.(*types.VirtualDiskFlatVer2BackingInfo) - ds := strings.SplitN(backing.FileName[1:], "]", 2) - - // Use specified disk as parent backing to a new disk. - disk.Backing = &types.VirtualDiskFlatVer2BackingInfo{ - VirtualDeviceFileBackingInfo: types.VirtualDeviceFileBackingInfo{ - FileName: fmt.Sprintf("[%s]", ds[0]), - }, - Parent: backing, - DiskMode: backing.DiskMode, - ThinProvisioned: backing.ThinProvisioned, - } - - return &disk -} - -func (l VirtualDeviceList) connectivity(device types.BaseVirtualDevice, v bool) error { - c := device.GetVirtualDevice().Connectable - if c == nil { - return fmt.Errorf("%s is not connectable", l.Name(device)) - } - - c.Connected = v - c.StartConnected = v - - return nil -} - -// Connect changes the device to connected, returns an error if the device is not connectable. -func (l VirtualDeviceList) Connect(device types.BaseVirtualDevice) error { - return l.connectivity(device, true) -} - -// Disconnect changes the device to disconnected, returns an error if the device is not connectable. -func (l VirtualDeviceList) Disconnect(device types.BaseVirtualDevice) error { - return l.connectivity(device, false) -} - -// FindCdrom finds a cdrom device with the given name, defaulting to the first cdrom device if any. -func (l VirtualDeviceList) FindCdrom(name string) (*types.VirtualCdrom, error) { - if name != "" { - d := l.Find(name) - if d == nil { - return nil, fmt.Errorf("device '%s' not found", name) - } - if c, ok := d.(*types.VirtualCdrom); ok { - return c, nil - } - return nil, fmt.Errorf("%s is not a cdrom device", name) - } - - c := l.SelectByType((*types.VirtualCdrom)(nil)) - if len(c) == 0 { - return nil, errors.New("no cdrom device found") - } - - return c[0].(*types.VirtualCdrom), nil -} - -// CreateCdrom creates a new VirtualCdrom device which can be added to a VM. -func (l VirtualDeviceList) CreateCdrom(c *types.VirtualIDEController) (*types.VirtualCdrom, error) { - device := &types.VirtualCdrom{} - - l.AssignController(device, c) - - l.setDefaultCdromBacking(device) - - device.Connectable = &types.VirtualDeviceConnectInfo{ - AllowGuestControl: true, - Connected: true, - StartConnected: true, - } - - return device, nil -} - -// InsertIso changes the cdrom device backing to use the given iso file. -func (l VirtualDeviceList) InsertIso(device *types.VirtualCdrom, iso string) *types.VirtualCdrom { - device.Backing = &types.VirtualCdromIsoBackingInfo{ - VirtualDeviceFileBackingInfo: types.VirtualDeviceFileBackingInfo{ - FileName: iso, - }, - } - - return device -} - -// EjectIso removes the iso file based backing and replaces with the default cdrom backing. -func (l VirtualDeviceList) EjectIso(device *types.VirtualCdrom) *types.VirtualCdrom { - l.setDefaultCdromBacking(device) - return device -} - -func (l VirtualDeviceList) setDefaultCdromBacking(device *types.VirtualCdrom) { - device.Backing = &types.VirtualCdromAtapiBackingInfo{ - VirtualDeviceDeviceBackingInfo: types.VirtualDeviceDeviceBackingInfo{ - DeviceName: fmt.Sprintf("%s-%d-%d", DeviceTypeCdrom, device.ControllerKey, device.UnitNumber), - UseAutoDetect: types.NewBool(false), - }, - } -} - -// FindFloppy finds a floppy device with the given name, defaulting to the first floppy device if any. -func (l VirtualDeviceList) FindFloppy(name string) (*types.VirtualFloppy, error) { - if name != "" { - d := l.Find(name) - if d == nil { - return nil, fmt.Errorf("device '%s' not found", name) - } - if c, ok := d.(*types.VirtualFloppy); ok { - return c, nil - } - return nil, fmt.Errorf("%s is not a floppy device", name) - } - - c := l.SelectByType((*types.VirtualFloppy)(nil)) - if len(c) == 0 { - return nil, errors.New("no floppy device found") - } - - return c[0].(*types.VirtualFloppy), nil -} - -// CreateFloppy creates a new VirtualFloppy device which can be added to a VM. -func (l VirtualDeviceList) CreateFloppy() (*types.VirtualFloppy, error) { - device := &types.VirtualFloppy{} - - c := l.PickController((*types.VirtualSIOController)(nil)) - if c == nil { - return nil, errors.New("no available SIO controller") - } - - l.AssignController(device, c) - - l.setDefaultFloppyBacking(device) - - device.Connectable = &types.VirtualDeviceConnectInfo{ - AllowGuestControl: true, - Connected: true, - StartConnected: true, - } - - return device, nil -} - -// InsertImg changes the floppy device backing to use the given img file. -func (l VirtualDeviceList) InsertImg(device *types.VirtualFloppy, img string) *types.VirtualFloppy { - device.Backing = &types.VirtualFloppyImageBackingInfo{ - VirtualDeviceFileBackingInfo: types.VirtualDeviceFileBackingInfo{ - FileName: img, - }, - } - - return device -} - -// EjectImg removes the img file based backing and replaces with the default floppy backing. -func (l VirtualDeviceList) EjectImg(device *types.VirtualFloppy) *types.VirtualFloppy { - l.setDefaultFloppyBacking(device) - return device -} - -func (l VirtualDeviceList) setDefaultFloppyBacking(device *types.VirtualFloppy) { - device.Backing = &types.VirtualFloppyDeviceBackingInfo{ - VirtualDeviceDeviceBackingInfo: types.VirtualDeviceDeviceBackingInfo{ - DeviceName: fmt.Sprintf("%s-%d", DeviceTypeFloppy, device.UnitNumber), - UseAutoDetect: types.NewBool(false), - }, - } -} - -// FindSerialPort finds a serial port device with the given name, defaulting to the first serial port device if any. -func (l VirtualDeviceList) FindSerialPort(name string) (*types.VirtualSerialPort, error) { - if name != "" { - d := l.Find(name) - if d == nil { - return nil, fmt.Errorf("device '%s' not found", name) - } - if c, ok := d.(*types.VirtualSerialPort); ok { - return c, nil - } - return nil, fmt.Errorf("%s is not a serial port device", name) - } - - c := l.SelectByType((*types.VirtualSerialPort)(nil)) - if len(c) == 0 { - return nil, errors.New("no serial port device found") - } - - return c[0].(*types.VirtualSerialPort), nil -} - -// CreateSerialPort creates a new VirtualSerialPort device which can be added to a VM. -func (l VirtualDeviceList) CreateSerialPort() (*types.VirtualSerialPort, error) { - device := &types.VirtualSerialPort{ - YieldOnPoll: true, - } - - c := l.PickController((*types.VirtualSIOController)(nil)) - if c == nil { - return nil, errors.New("no available SIO controller") - } - - l.AssignController(device, c) - - l.setDefaultSerialPortBacking(device) - - return device, nil -} - -// ConnectSerialPort connects a serial port to a server or client uri. -func (l VirtualDeviceList) ConnectSerialPort(device *types.VirtualSerialPort, uri string, client bool) *types.VirtualSerialPort { - direction := types.VirtualDeviceURIBackingOptionDirectionServer - if client { - direction = types.VirtualDeviceURIBackingOptionDirectionClient - } - - device.Backing = &types.VirtualSerialPortURIBackingInfo{ - VirtualDeviceURIBackingInfo: types.VirtualDeviceURIBackingInfo{ - Direction: string(direction), - ServiceURI: uri, - }, - } - - return device -} - -// DisconnectSerialPort disconnects the serial port backing. -func (l VirtualDeviceList) DisconnectSerialPort(device *types.VirtualSerialPort) *types.VirtualSerialPort { - l.setDefaultSerialPortBacking(device) - return device -} - -func (l VirtualDeviceList) setDefaultSerialPortBacking(device *types.VirtualSerialPort) { - device.Backing = &types.VirtualSerialPortURIBackingInfo{ - VirtualDeviceURIBackingInfo: types.VirtualDeviceURIBackingInfo{ - Direction: "client", - ServiceURI: "localhost:0", - }, - } -} - -// CreateEthernetCard creates a new VirtualEthernetCard of the given name name and initialized with the given backing. -func (l VirtualDeviceList) CreateEthernetCard(name string, backing types.BaseVirtualDeviceBackingInfo) (types.BaseVirtualDevice, error) { - ctypes := EthernetCardTypes() - - if name == "" { - name = ctypes.deviceName(ctypes[0]) - } - - found := ctypes.Select(func(device types.BaseVirtualDevice) bool { - return l.deviceName(device) == name - }) - - if len(found) == 0 { - return nil, fmt.Errorf("unknown ethernet card type '%s'", name) - } - - c, ok := found[0].(types.BaseVirtualEthernetCard) - if !ok { - return nil, fmt.Errorf("invalid ethernet card type '%s'", name) - } - - c.GetVirtualEthernetCard().Backing = backing - - return c.(types.BaseVirtualDevice), nil -} - -// PrimaryMacAddress returns the MacAddress field of the primary VirtualEthernetCard -func (l VirtualDeviceList) PrimaryMacAddress() string { - eth0 := l.Find("ethernet-0") - - if eth0 == nil { - return "" - } - - return eth0.(types.BaseVirtualEthernetCard).GetVirtualEthernetCard().MacAddress -} - -// convert a BaseVirtualDevice to a BaseVirtualMachineBootOptionsBootableDevice -var bootableDevices = map[string]func(device types.BaseVirtualDevice) types.BaseVirtualMachineBootOptionsBootableDevice{ - DeviceTypeCdrom: func(types.BaseVirtualDevice) types.BaseVirtualMachineBootOptionsBootableDevice { - return &types.VirtualMachineBootOptionsBootableCdromDevice{} - }, - DeviceTypeDisk: func(d types.BaseVirtualDevice) types.BaseVirtualMachineBootOptionsBootableDevice { - return &types.VirtualMachineBootOptionsBootableDiskDevice{ - DeviceKey: d.GetVirtualDevice().Key, - } - }, - DeviceTypeEthernet: func(d types.BaseVirtualDevice) types.BaseVirtualMachineBootOptionsBootableDevice { - return &types.VirtualMachineBootOptionsBootableEthernetDevice{ - DeviceKey: d.GetVirtualDevice().Key, - } - }, - DeviceTypeFloppy: func(types.BaseVirtualDevice) types.BaseVirtualMachineBootOptionsBootableDevice { - return &types.VirtualMachineBootOptionsBootableFloppyDevice{} - }, -} - -// BootOrder returns a list of devices which can be used to set boot order via VirtualMachine.SetBootOptions. -// The order can any of "ethernet", "cdrom", "floppy" or "disk" or by specific device name. -func (l VirtualDeviceList) BootOrder(order []string) []types.BaseVirtualMachineBootOptionsBootableDevice { - var devices []types.BaseVirtualMachineBootOptionsBootableDevice - - for _, name := range order { - if kind, ok := bootableDevices[name]; ok { - for _, device := range l { - if l.Type(device) == name { - devices = append(devices, kind(device)) - } - - } - continue - } - - if d := l.Find(name); d != nil { - if kind, ok := bootableDevices[l.Type(d)]; ok { - devices = append(devices, kind(d)) - } - } - } - - return devices -} - -// SelectBootOrder returns an ordered list of devices matching the given bootable device order -func (l VirtualDeviceList) SelectBootOrder(order []types.BaseVirtualMachineBootOptionsBootableDevice) VirtualDeviceList { - var devices VirtualDeviceList - - for _, bd := range order { - for _, device := range l { - if kind, ok := bootableDevices[l.Type(device)]; ok { - if reflect.DeepEqual(kind(device), bd) { - devices = append(devices, device) - } - } - } - } - - return devices -} - -// TypeName returns the vmodl type name of the device -func (l VirtualDeviceList) TypeName(device types.BaseVirtualDevice) string { - return reflect.TypeOf(device).Elem().Name() -} - -var deviceNameRegexp = regexp.MustCompile(`(?:Virtual)?(?:Machine)?(\w+?)(?:Card|Device|Controller)?$`) - -func (l VirtualDeviceList) deviceName(device types.BaseVirtualDevice) string { - name := "device" - typeName := l.TypeName(device) - - m := deviceNameRegexp.FindStringSubmatch(typeName) - if len(m) == 2 { - name = strings.ToLower(m[1]) - } - - return name -} - -// Type returns a human-readable name for the given device -func (l VirtualDeviceList) Type(device types.BaseVirtualDevice) string { - switch device.(type) { - case types.BaseVirtualEthernetCard: - return DeviceTypeEthernet - case *types.ParaVirtualSCSIController: - return "pvscsi" - case *types.VirtualLsiLogicSASController: - return "lsilogic-sas" - default: - return l.deviceName(device) - } -} - -// Name returns a stable, human-readable name for the given device -func (l VirtualDeviceList) Name(device types.BaseVirtualDevice) string { - var key string - d := device.GetVirtualDevice() - dtype := l.Type(device) - - switch dtype { - case DeviceTypeEthernet: - key = fmt.Sprintf("%d", d.UnitNumber-7) - case DeviceTypeDisk: - key = fmt.Sprintf("%d-%d", d.ControllerKey, d.UnitNumber) - default: - key = fmt.Sprintf("%d", d.Key) - } - - return fmt.Sprintf("%s-%s", dtype, key) -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/object/virtual_device_list_test.go juju-core-2.0.2/src/github.com/juju/govmomi/object/virtual_device_list_test.go --- juju-core-2.0.0/src/github.com/juju/govmomi/object/virtual_device_list_test.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/object/virtual_device_list_test.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,825 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package object - -import ( - "math/rand" - "reflect" - "testing" - - "github.com/juju/govmomi/vim25/types" -) - -var devices = VirtualDeviceList([]types.BaseVirtualDevice{ - &types.VirtualIDEController{ - VirtualController: types.VirtualController{ - VirtualDevice: types.VirtualDevice{ - DynamicData: types.DynamicData{}, - Key: 200, - DeviceInfo: &types.Description{ - DynamicData: types.DynamicData{}, - Label: "IDE 0", - Summary: "IDE 0", - }, - Backing: nil, - Connectable: (*types.VirtualDeviceConnectInfo)(nil), - SlotInfo: nil, - ControllerKey: 0, - UnitNumber: 0, - }, - BusNumber: 0, - Device: []int{3001, 3000}, - }, - }, - &types.VirtualIDEController{ - VirtualController: types.VirtualController{ - VirtualDevice: types.VirtualDevice{ - DynamicData: types.DynamicData{}, - Key: 201, - DeviceInfo: &types.Description{ - DynamicData: types.DynamicData{}, - Label: "IDE 1", - Summary: "IDE 1", - }, - Backing: nil, - Connectable: (*types.VirtualDeviceConnectInfo)(nil), - SlotInfo: nil, - ControllerKey: 0, - UnitNumber: 0, - }, - BusNumber: 1, - Device: []int{3002}, - }, - }, - &types.VirtualPS2Controller{ - VirtualController: types.VirtualController{ - VirtualDevice: types.VirtualDevice{ - DynamicData: types.DynamicData{}, - Key: 300, - DeviceInfo: &types.Description{ - DynamicData: types.DynamicData{}, - Label: "PS2 controller 0", - Summary: "PS2 controller 0", - }, - Backing: nil, - Connectable: (*types.VirtualDeviceConnectInfo)(nil), - SlotInfo: nil, - ControllerKey: 0, - UnitNumber: 0, - }, - BusNumber: 0, - Device: []int{600, 700}, - }, - }, - &types.VirtualPCIController{ - VirtualController: types.VirtualController{ - VirtualDevice: types.VirtualDevice{ - DynamicData: types.DynamicData{}, - Key: 100, - DeviceInfo: &types.Description{ - DynamicData: types.DynamicData{}, - Label: "PCI controller 0", - Summary: "PCI controller 0", - }, - Backing: nil, - Connectable: (*types.VirtualDeviceConnectInfo)(nil), - SlotInfo: nil, - ControllerKey: 0, - UnitNumber: 0, - }, - BusNumber: 0, - Device: []int{500, 12000, 1000, 4000}, - }, - }, - &types.VirtualSIOController{ - VirtualController: types.VirtualController{ - VirtualDevice: types.VirtualDevice{ - DynamicData: types.DynamicData{}, - Key: 400, - DeviceInfo: &types.Description{ - DynamicData: types.DynamicData{}, - Label: "SIO controller 0", - Summary: "SIO controller 0", - }, - Backing: nil, - Connectable: (*types.VirtualDeviceConnectInfo)(nil), - SlotInfo: nil, - ControllerKey: 0, - UnitNumber: 0, - }, - BusNumber: 0, - Device: []int{9000}, - }, - }, - &types.VirtualKeyboard{ - VirtualDevice: types.VirtualDevice{ - DynamicData: types.DynamicData{}, - Key: 600, - DeviceInfo: &types.Description{ - DynamicData: types.DynamicData{}, - Label: "Keyboard ", - Summary: "Keyboard", - }, - Backing: nil, - Connectable: (*types.VirtualDeviceConnectInfo)(nil), - SlotInfo: nil, - ControllerKey: 300, - UnitNumber: 0, - }, - }, - &types.VirtualPointingDevice{ - VirtualDevice: types.VirtualDevice{ - DynamicData: types.DynamicData{}, - Key: 700, - DeviceInfo: &types.Description{ - DynamicData: types.DynamicData{}, - Label: "Pointing device", - Summary: "Pointing device; Device", - }, - Backing: &types.VirtualPointingDeviceDeviceBackingInfo{ - VirtualDeviceDeviceBackingInfo: types.VirtualDeviceDeviceBackingInfo{}, - HostPointingDevice: "autodetect", - }, - Connectable: (*types.VirtualDeviceConnectInfo)(nil), - SlotInfo: nil, - ControllerKey: 300, - UnitNumber: 1, - }, - }, - &types.VirtualMachineVideoCard{ - VirtualDevice: types.VirtualDevice{ - DynamicData: types.DynamicData{}, - Key: 500, - DeviceInfo: &types.Description{ - DynamicData: types.DynamicData{}, - Label: "Video card ", - Summary: "Video card", - }, - Backing: nil, - Connectable: (*types.VirtualDeviceConnectInfo)(nil), - SlotInfo: nil, - ControllerKey: 100, - UnitNumber: 0, - }, - VideoRamSizeInKB: 4096, - NumDisplays: 1, - UseAutoDetect: types.NewBool(false), - Enable3DSupport: types.NewBool(false), - Use3dRenderer: "automatic", - }, - &types.VirtualMachineVMCIDevice{ - VirtualDevice: types.VirtualDevice{ - DynamicData: types.DynamicData{}, - Key: 12000, - DeviceInfo: &types.Description{ - DynamicData: types.DynamicData{}, - Label: "VMCI device", - Summary: "Device on the virtual machine PCI bus that provides support for the virtual machine communication interface", - }, - Backing: nil, - Connectable: (*types.VirtualDeviceConnectInfo)(nil), - SlotInfo: &types.VirtualDevicePciBusSlotInfo{ - VirtualDeviceBusSlotInfo: types.VirtualDeviceBusSlotInfo{}, - PciSlotNumber: 33, - }, - ControllerKey: 100, - UnitNumber: 17, - }, - Id: 1754519335, - AllowUnrestrictedCommunication: types.NewBool(false), - }, - &types.VirtualLsiLogicController{ - VirtualSCSIController: types.VirtualSCSIController{ - VirtualController: types.VirtualController{ - VirtualDevice: types.VirtualDevice{ - DynamicData: types.DynamicData{}, - Key: 1000, - DeviceInfo: &types.Description{ - DynamicData: types.DynamicData{}, - Label: "SCSI controller 0", - Summary: "LSI Logic", - }, - Backing: nil, - Connectable: (*types.VirtualDeviceConnectInfo)(nil), - SlotInfo: nil, - ControllerKey: 100, - UnitNumber: 3, - }, - BusNumber: 0, - Device: nil, - }, - HotAddRemove: types.NewBool(true), - SharedBus: "noSharing", - ScsiCtlrUnitNumber: 7, - }, - }, - &types.VirtualCdrom{ - VirtualDevice: types.VirtualDevice{ - DynamicData: types.DynamicData{}, - Key: 3001, - DeviceInfo: &types.Description{ - DynamicData: types.DynamicData{}, - Label: "CD/DVD drive 1", - Summary: "ISO [datastore1] ttylinux-pc_i486-16.1.iso", - }, - Backing: &types.VirtualCdromIsoBackingInfo{ - VirtualDeviceFileBackingInfo: types.VirtualDeviceFileBackingInfo{ - VirtualDeviceBackingInfo: types.VirtualDeviceBackingInfo{}, - FileName: "[datastore1] foo.iso", - Datastore: &types.ManagedObjectReference{Type: "Datastore", Value: "53fe43cc-75dc5110-3643-000c2918dc41"}, - BackingObjectId: "", - }, - }, - Connectable: &types.VirtualDeviceConnectInfo{ - DynamicData: types.DynamicData{}, - StartConnected: true, - AllowGuestControl: true, - Connected: false, - Status: "untried", - }, - SlotInfo: nil, - ControllerKey: 200, - UnitNumber: 1, - }, - }, - &types.VirtualDisk{ - VirtualDevice: types.VirtualDevice{ - DynamicData: types.DynamicData{}, - Key: 3000, - DeviceInfo: &types.Description{ - DynamicData: types.DynamicData{}, - Label: "Hard disk 1", - Summary: "30,720 KB", - }, - Backing: &types.VirtualDiskFlatVer2BackingInfo{ - VirtualDeviceFileBackingInfo: types.VirtualDeviceFileBackingInfo{ - VirtualDeviceBackingInfo: types.VirtualDeviceBackingInfo{}, - FileName: "[datastore1] bar/bar.vmdk", - Datastore: &types.ManagedObjectReference{Type: "Datastore", Value: "53fe43cc-75dc5110-3643-000c2918dc41"}, - BackingObjectId: "3-3000-0", - }, - DiskMode: "persistent", - Split: types.NewBool(false), - WriteThrough: types.NewBool(false), - ThinProvisioned: types.NewBool(false), - EagerlyScrub: types.NewBool(true), - Uuid: "6000C296-d0af-1209-1975-10c98eae10e4", - ContentId: "d46395062e2d1b1790985bdec573b211", - ChangeId: "", - Parent: &types.VirtualDiskFlatVer2BackingInfo{ - VirtualDeviceFileBackingInfo: types.VirtualDeviceFileBackingInfo{ - VirtualDeviceBackingInfo: types.VirtualDeviceBackingInfo{}, - FileName: "[datastore1] ttylinux.vmdk", - Datastore: &types.ManagedObjectReference{Type: "Datastore", Value: "53fe43cc-75dc5110-3643-000c2918dc41"}, - BackingObjectId: "3-3000-1", - }, - DiskMode: "persistent", - Split: types.NewBool(false), - WriteThrough: types.NewBool(false), - ThinProvisioned: types.NewBool(false), - EagerlyScrub: types.NewBool(true), - Uuid: "6000C296-d0af-1209-1975-10c98eae10e4", - ContentId: "1c2dad9e1662219e962a620c6d238a7c", - ChangeId: "", - Parent: (*types.VirtualDiskFlatVer2BackingInfo)(nil), - DeltaDiskFormat: "", - DigestEnabled: types.NewBool(false), - DeltaGrainSize: 0, - }, - DeltaDiskFormat: "redoLogFormat", - DigestEnabled: types.NewBool(false), - DeltaGrainSize: 0, - }, - Connectable: (*types.VirtualDeviceConnectInfo)(nil), - SlotInfo: nil, - ControllerKey: 200, - UnitNumber: 0, - }, - CapacityInKB: 30720, - CapacityInBytes: 31457280, - Shares: &types.SharesInfo{ - DynamicData: types.DynamicData{}, - Shares: 1000, - Level: "normal", - }, - StorageIOAllocation: &types.StorageIOAllocationInfo{ - DynamicData: types.DynamicData{}, - Limit: -1, - Shares: &types.SharesInfo{ - DynamicData: types.DynamicData{}, - Shares: 1000, - Level: "normal", - }, - Reservation: 0, - }, - DiskObjectId: "3-3000", - VFlashCacheConfigInfo: (*types.VirtualDiskVFlashCacheConfigInfo)(nil), - }, - &types.VirtualDisk{ - VirtualDevice: types.VirtualDevice{ - DynamicData: types.DynamicData{}, - Key: 3002, - DeviceInfo: &types.Description{ - DynamicData: types.DynamicData{}, - Label: "Hard disk 2", - Summary: "10,000,000 KB", - }, - Backing: &types.VirtualDiskFlatVer2BackingInfo{ - VirtualDeviceFileBackingInfo: types.VirtualDeviceFileBackingInfo{ - VirtualDeviceBackingInfo: types.VirtualDeviceBackingInfo{}, - FileName: "[datastore1] bar/disk-201-0.vmdk", - Datastore: &types.ManagedObjectReference{Type: "Datastore", Value: "53fe43cc-75dc5110-3643-000c2918dc41"}, - BackingObjectId: "3-3002-0", - }, - DiskMode: "persistent", - Split: types.NewBool(false), - WriteThrough: types.NewBool(false), - ThinProvisioned: types.NewBool(true), - EagerlyScrub: types.NewBool(false), - Uuid: "6000C293-fde5-4457-5118-dd267ea992a7", - ContentId: "90399989b9d520eed6793ab0fffffffe", - ChangeId: "", - Parent: (*types.VirtualDiskFlatVer2BackingInfo)(nil), - DeltaDiskFormat: "", - DigestEnabled: types.NewBool(false), - DeltaGrainSize: 0, - }, - Connectable: (*types.VirtualDeviceConnectInfo)(nil), - SlotInfo: nil, - ControllerKey: 201, - UnitNumber: 0, - }, - CapacityInKB: 10000000, - CapacityInBytes: 10240000000, - Shares: &types.SharesInfo{ - DynamicData: types.DynamicData{}, - Shares: 1000, - Level: "normal", - }, - StorageIOAllocation: &types.StorageIOAllocationInfo{ - DynamicData: types.DynamicData{}, - Limit: -1, - Shares: &types.SharesInfo{ - DynamicData: types.DynamicData{}, - Shares: 1000, - Level: "normal", - }, - Reservation: 0, - }, - DiskObjectId: "3-3002", - VFlashCacheConfigInfo: (*types.VirtualDiskVFlashCacheConfigInfo)(nil), - }, - &types.VirtualE1000{ - VirtualEthernetCard: types.VirtualEthernetCard{ - VirtualDevice: types.VirtualDevice{ - DynamicData: types.DynamicData{}, - Key: 4000, - DeviceInfo: &types.Description{ - DynamicData: types.DynamicData{}, - Label: "Network adapter 1", - Summary: "VM Network", - }, - Backing: &types.VirtualEthernetCardNetworkBackingInfo{ - VirtualDeviceDeviceBackingInfo: types.VirtualDeviceDeviceBackingInfo{ - VirtualDeviceBackingInfo: types.VirtualDeviceBackingInfo{}, - DeviceName: "VM Network", - UseAutoDetect: types.NewBool(false), - }, - Network: &types.ManagedObjectReference{Type: "Network", Value: "HaNetwork-VM Network"}, - InPassthroughMode: types.NewBool(false), - }, - Connectable: &types.VirtualDeviceConnectInfo{ - DynamicData: types.DynamicData{}, - StartConnected: true, - AllowGuestControl: true, - Connected: false, - Status: "untried", - }, - SlotInfo: &types.VirtualDevicePciBusSlotInfo{ - VirtualDeviceBusSlotInfo: types.VirtualDeviceBusSlotInfo{}, - PciSlotNumber: 32, - }, - ControllerKey: 100, - UnitNumber: 7, - }, - AddressType: "generated", - MacAddress: "00:0c:29:93:d7:27", - WakeOnLanEnabled: types.NewBool(true), - }, - }, - &types.VirtualSerialPort{ - VirtualDevice: types.VirtualDevice{ - DynamicData: types.DynamicData{}, - Key: 9000, - DeviceInfo: &types.Description{ - DynamicData: types.DynamicData{}, - Label: "Serial port 1", - Summary: "Remote localhost:0", - }, - Backing: &types.VirtualSerialPortURIBackingInfo{ - VirtualDeviceURIBackingInfo: types.VirtualDeviceURIBackingInfo{ - VirtualDeviceBackingInfo: types.VirtualDeviceBackingInfo{}, - ServiceURI: "localhost:0", - Direction: "client", - ProxyURI: "", - }, - }, - Connectable: &types.VirtualDeviceConnectInfo{ - DynamicData: types.DynamicData{}, - StartConnected: true, - AllowGuestControl: true, - Connected: false, - Status: "untried", - }, - SlotInfo: nil, - ControllerKey: 400, - UnitNumber: 0, - }, - YieldOnPoll: true, - }, -}) - -func TestSelectByType(t *testing.T) { - tests := []struct { - dtype types.BaseVirtualDevice - expect int - }{ - { - (*types.VirtualCdrom)(nil), - 1, - }, - { - (*types.VirtualEthernetCard)(nil), - 1, - }, - { - (*types.VirtualDisk)(nil), - 2, - }, - { - (*types.VirtualController)(nil), - 6, - }, - { - (*types.VirtualIDEController)(nil), - 2, - }, - { - (*types.VirtualSCSIController)(nil), - 1, - }, - { - (*types.VirtualLsiLogicController)(nil), - 1, - }, - { - (*types.ParaVirtualSCSIController)(nil), - 0, - }, - } - - for _, test := range tests { - d := devices.SelectByType(test.dtype) - - if len(d) != test.expect { - t.Errorf("%#v has %d", test.dtype, len(devices)) - } - } -} - -func TestSelectByBackingInfo(t *testing.T) { - tests := []types.BaseVirtualDeviceBackingInfo{ - &types.VirtualEthernetCardNetworkBackingInfo{ - VirtualDeviceDeviceBackingInfo: types.VirtualDeviceDeviceBackingInfo{ - DeviceName: "VM Network", - }, - }, - &types.VirtualDiskFlatVer2BackingInfo{ - VirtualDeviceFileBackingInfo: types.VirtualDeviceFileBackingInfo{ - FileName: "[datastore1] bar/bar.vmdk", - }, - }, - &types.VirtualDiskFlatVer2BackingInfo{ - Parent: &types.VirtualDiskFlatVer2BackingInfo{ - VirtualDeviceFileBackingInfo: types.VirtualDeviceFileBackingInfo{ - FileName: "[datastore1] ttylinux.vmdk", - }, - }, - }, - &types.VirtualCdromIsoBackingInfo{ - VirtualDeviceFileBackingInfo: types.VirtualDeviceFileBackingInfo{ - VirtualDeviceBackingInfo: types.VirtualDeviceBackingInfo{}, - FileName: "[datastore1] foo.iso", - }, - }, - } - - for _, test := range tests { - l := devices.SelectByBackingInfo(test) - - if len(l) != 1 { - t.Errorf("Expected 1, got %d: %#v", len(l), test) - } - } -} - -func TestFind(t *testing.T) { - for _, device := range devices { - name := devices.Name(device) - d := devices.Find(name) - if name != devices.Name(d) { - t.Errorf("expected name: %s, got: %s", name, devices.Name(d)) - } - } - - d := devices.Find("enoent") - if d != nil { - t.Errorf("unexpected: %#v", d) - } -} - -func TestFindController(t *testing.T) { - for _, name := range []string{"", "ide-200"} { - _, err := devices.FindIDEController(name) - if err != nil { - t.Error(err) - } - } - - for _, name := range []string{"", "lsilogic-1000"} { - _, err := devices.FindSCSIController(name) - if err != nil { - t.Error(err) - } - } - - fns := []func() error{ - func() error { - _, err := devices.FindIDEController("lsilogic-1000") - return err - }, - func() error { - _, err := devices.FindSCSIController("ide-200") - return err - }, - } - - for _, f := range fns { - err := f() - if err == nil { - t.Error("should fail") - } - } -} - -func TestPickController(t *testing.T) { - list := devices - - tests := []struct { - ctype types.BaseVirtualController - key int - unit int - }{ - { - (*types.VirtualIDEController)(nil), 201, 1, - }, - { - (*types.VirtualSCSIController)(nil), 1000, 0, - }, - { - (*types.VirtualSCSIController)(nil), 1000, 1, - }, - } - - for _, test := range tests { - c := list.PickController(test.ctype).GetVirtualController() - - key := c.Key - if key != test.key { - t.Errorf("expected controller key: %d, got: %d\n", test.key, key) - } - - unit := list.newUnitNumber(c) - if unit != test.unit { - t.Errorf("expected unit number: %d, got: %d\n", test.unit, unit) - } - - dev := &types.VirtualDevice{ - Key: rand.Int(), - UnitNumber: unit, - ControllerKey: key, - } - - list = append(list, dev) - c.Device = append(c.Device, dev.Key) - } - - if list.PickController((*types.VirtualIDEController)(nil)) != nil { - t.Error("should be nil") - } - - if list.PickController((*types.VirtualSCSIController)(nil)) == nil { - t.Errorf("should not be nil") - } -} - -func TestCreateSCSIController(t *testing.T) { - for _, l := range []VirtualDeviceList{SCSIControllerTypes(), devices} { - _, err := l.CreateSCSIController("enoent") - if err == nil { - t.Error("should fail") - } - - for _, name := range []string{"", "scsi", "pvscsi", "buslogic", "lsilogic", "lsilogic-sas"} { - _, err = l.CreateSCSIController(name) - if err != nil { - t.Error(err) - } - } - } -} - -func TestCreateEthernetCard(t *testing.T) { - _, err := EthernetCardTypes().CreateEthernetCard("enoent", nil) - if err == nil { - t.Error("should fail") - } - - for _, name := range []string{"", "e1000", "e1000e", "vmxnet3"} { - _, err := EthernetCardTypes().CreateEthernetCard(name, nil) - if err != nil { - t.Error(err) - } - } -} - -func TestCdrom(t *testing.T) { - c, err := devices.FindCdrom("") - if err != nil { - t.Error(err) - } - - d := devices.Find(devices.Name(c)) - - if c.Key != d.GetVirtualDevice().Key { - t.Error("device key mismatch") - } - - for _, name := range []string{"enoent", "ide-200"} { - c, err = devices.FindCdrom(name) - if err == nil { - t.Errorf("FindCdrom(%s) should fail", name) - } - } - - c, err = devices.Select(func(device types.BaseVirtualDevice) bool { - if _, ok := device.(*types.VirtualCdrom); ok { - return false - } - return true - }).FindCdrom("") - - if err == nil { - t.Error("FindCdrom('') should fail") - } -} - -func TestSerialPort(t *testing.T) { - device, err := devices.CreateSerialPort() - if err != nil { - t.Error(err) - } - devices.ConnectSerialPort(device, "telnet://:33233", false) -} - -func TestPrimaryMacAddress(t *testing.T) { - expect := "00:0c:29:93:d7:27" - mac := devices.PrimaryMacAddress() - if expect != mac { - t.Errorf("expected: %s, got: %s", expect, mac) - } -} - -func TestBootOrder(t *testing.T) { - o := []string{DeviceTypeEthernet, DeviceTypeCdrom, DeviceTypeFloppy, DeviceTypeDisk} - list := devices - - n := 4 // 1 ethernet, 1 cdrom, 2 disk - order := list.BootOrder(o) - if len(order) != n { - t.Errorf("expected %d boot devices, got: %d", n, len(order)) - } - - list = list.SelectBootOrder(order) - if len(list) != n { - t.Errorf("expected %d boot devices, got: %d", n, len(list)) - } - - // test lookup by name - var names []string - for _, x := range list { - names = append(names, list.Name(x)) - } - - order = list.BootOrder(names) - if len(order) != n { - t.Errorf("expected %d boot devices, got: %d", n, len(order)) - } - - if !reflect.DeepEqual(list, list.SelectBootOrder(order)) { - t.Error("boot order mismatch") - } - - // remove disks - list = list.Select(func(device types.BaseVirtualDevice) bool { - if _, ok := device.(*types.VirtualDisk); ok { - return false - } - return true - }) - - n = 2 // 1 ethernet, 1 cdrom - order = list.BootOrder(o) - if len(order) != n { - t.Errorf("expected %d boot devices, got: %d", n, len(order)) - } - - if !reflect.DeepEqual(list, list.SelectBootOrder(order)) { - t.Error("boot order mismatch") - } - - if len(list.BootOrder([]string{DeviceTypeDisk})) != 0 { - t.Error("expected 0 disks") - } -} - -func TestName(t *testing.T) { - tests := []struct { - device types.BaseVirtualDevice - expect string - }{ - { - &types.VirtualCdrom{}, - "cdrom-0", - }, - { - &types.VirtualDisk{}, - "disk-0-0", - }, - { - &types.VirtualFloppy{}, - "floppy-0", - }, - { - &types.VirtualIDEController{}, - "ide-0", - }, - { - &types.VirtualMachineVideoCard{}, - "video-0", - }, - { - &types.VirtualPointingDevice{}, - "pointing-0", - }, - { - &types.ParaVirtualSCSIController{}, - "pvscsi-0", - }, - { - &types.VirtualSerialPort{}, - "serialport-0", - }, - { - &types.VirtualE1000{ - VirtualEthernetCard: types.VirtualEthernetCard{ - VirtualDevice: types.VirtualDevice{ - UnitNumber: 7, - }, - }, - }, - "ethernet-0", - }, - } - - for _, test := range tests { - name := devices.Name(test.device) - if name != test.expect { - t.Errorf("expected: %s, got: %s", test.expect, name) - } - } -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/object/virtual_disk_manager.go juju-core-2.0.2/src/github.com/juju/govmomi/object/virtual_disk_manager.go --- juju-core-2.0.0/src/github.com/juju/govmomi/object/virtual_disk_manager.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/object/virtual_disk_manager.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,120 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package object - -import ( - "github.com/juju/govmomi/vim25" - "github.com/juju/govmomi/vim25/methods" - "github.com/juju/govmomi/vim25/types" - "golang.org/x/net/context" -) - -type VirtualDiskManager struct { - Common -} - -func NewVirtualDiskManager(c *vim25.Client) *VirtualDiskManager { - m := VirtualDiskManager{ - Common: NewCommon(c, *c.ServiceContent.VirtualDiskManager), - } - - return &m -} - -// CopyVirtualDisk copies a virtual disk, performing conversions as specified in the spec. -func (m VirtualDiskManager) CopyVirtualDisk( - ctx context.Context, - sourceName string, sourceDatacenter *Datacenter, - destName string, destDatacenter *Datacenter, - destSpec *types.VirtualDiskSpec, force bool) (*Task, error) { - - req := types.CopyVirtualDisk_Task{ - This: m.Reference(), - SourceName: sourceName, - DestName: destName, - DestSpec: destSpec, - Force: types.NewBool(force), - } - - if sourceDatacenter != nil { - ref := sourceDatacenter.Reference() - req.SourceDatacenter = &ref - } - - if destDatacenter != nil { - ref := destDatacenter.Reference() - req.DestDatacenter = &ref - } - - res, err := methods.CopyVirtualDisk_Task(ctx, m.c, &req) - if err != nil { - return nil, err - } - - return NewTask(m.c, res.Returnval), nil -} - -// MoveVirtualDisk moves a virtual disk. -func (m VirtualDiskManager) MoveVirtualDisk( - ctx context.Context, - sourceName string, sourceDatacenter *Datacenter, - destName string, destDatacenter *Datacenter, - force bool) (*Task, error) { - req := types.MoveVirtualDisk_Task{ - This: m.Reference(), - SourceName: sourceName, - DestName: destName, - Force: types.NewBool(force), - } - - if sourceDatacenter != nil { - ref := sourceDatacenter.Reference() - req.SourceDatacenter = &ref - } - - if destDatacenter != nil { - ref := destDatacenter.Reference() - req.DestDatacenter = &ref - } - - res, err := methods.MoveVirtualDisk_Task(ctx, m.c, &req) - if err != nil { - return nil, err - } - - return NewTask(m.c, res.Returnval), nil -} - -// DeleteVirtualDisk deletes a virtual disk. -func (m VirtualDiskManager) DeleteVirtualDisk(ctx context.Context, name string, dc *Datacenter) (*Task, error) { - req := types.DeleteVirtualDisk_Task{ - This: m.Reference(), - Name: name, - } - - if dc != nil { - ref := dc.Reference() - req.Datacenter = &ref - } - - res, err := methods.DeleteVirtualDisk_Task(ctx, m.c, &req) - if err != nil { - return nil, err - } - - return NewTask(m.c, res.Returnval), nil -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/object/virtual_machine.go juju-core-2.0.2/src/github.com/juju/govmomi/object/virtual_machine.go --- juju-core-2.0.0/src/github.com/juju/govmomi/object/virtual_machine.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/object/virtual_machine.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,318 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package object - -import ( - "github.com/juju/govmomi/property" - "github.com/juju/govmomi/vim25" - "github.com/juju/govmomi/vim25/methods" - "github.com/juju/govmomi/vim25/mo" - "github.com/juju/govmomi/vim25/types" - "golang.org/x/net/context" -) - -type VirtualMachine struct { - Common - - InventoryPath string -} - -func NewVirtualMachine(c *vim25.Client, ref types.ManagedObjectReference) *VirtualMachine { - return &VirtualMachine{ - Common: NewCommon(c, ref), - } -} - -func (v VirtualMachine) PowerOn(ctx context.Context) (*Task, error) { - req := types.PowerOnVM_Task{ - This: v.Reference(), - } - - res, err := methods.PowerOnVM_Task(ctx, v.c, &req) - if err != nil { - return nil, err - } - - return NewTask(v.c, res.Returnval), nil -} - -func (v VirtualMachine) PowerOff(ctx context.Context) (*Task, error) { - req := types.PowerOffVM_Task{ - This: v.Reference(), - } - - res, err := methods.PowerOffVM_Task(ctx, v.c, &req) - if err != nil { - return nil, err - } - - return NewTask(v.c, res.Returnval), nil -} - -func (v VirtualMachine) Reset(ctx context.Context) (*Task, error) { - req := types.ResetVM_Task{ - This: v.Reference(), - } - - res, err := methods.ResetVM_Task(ctx, v.c, &req) - if err != nil { - return nil, err - } - - return NewTask(v.c, res.Returnval), nil -} - -func (v VirtualMachine) Suspend(ctx context.Context) (*Task, error) { - req := types.SuspendVM_Task{ - This: v.Reference(), - } - - res, err := methods.SuspendVM_Task(ctx, v.c, &req) - if err != nil { - return nil, err - } - - return NewTask(v.c, res.Returnval), nil -} - -func (v VirtualMachine) ShutdownGuest(ctx context.Context) error { - req := types.ShutdownGuest{ - This: v.Reference(), - } - - _, err := methods.ShutdownGuest(ctx, v.c, &req) - return err -} - -func (v VirtualMachine) RebootGuest(ctx context.Context) error { - req := types.RebootGuest{ - This: v.Reference(), - } - - _, err := methods.RebootGuest(ctx, v.c, &req) - return err -} - -func (v VirtualMachine) Destroy(ctx context.Context) (*Task, error) { - req := types.Destroy_Task{ - This: v.Reference(), - } - - res, err := methods.Destroy_Task(ctx, v.c, &req) - if err != nil { - return nil, err - } - - return NewTask(v.c, res.Returnval), nil -} - -func (v VirtualMachine) Clone(ctx context.Context, folder *Folder, name string, config types.VirtualMachineCloneSpec) (*Task, error) { - req := types.CloneVM_Task{ - This: v.Reference(), - Folder: folder.Reference(), - Name: name, - Spec: config, - } - - res, err := methods.CloneVM_Task(ctx, v.c, &req) - if err != nil { - return nil, err - } - - return NewTask(v.c, res.Returnval), nil -} - -func (v VirtualMachine) Reconfigure(ctx context.Context, config types.VirtualMachineConfigSpec) (*Task, error) { - req := types.ReconfigVM_Task{ - This: v.Reference(), - Spec: config, - } - - res, err := methods.ReconfigVM_Task(ctx, v.c, &req) - if err != nil { - return nil, err - } - - return NewTask(v.c, res.Returnval), nil -} - -func (v VirtualMachine) WaitForIP(ctx context.Context) (string, error) { - var ip string - - p := property.DefaultCollector(v.c) - err := property.Wait(ctx, p, v.Reference(), []string{"guest.ipAddress"}, func(pc []types.PropertyChange) bool { - for _, c := range pc { - if c.Name != "guest.ipAddress" { - continue - } - if c.Op != types.PropertyChangeOpAssign { - continue - } - if c.Val == nil { - continue - } - - ip = c.Val.(string) - return true - } - - return false - }) - - if err != nil { - return "", err - } - - return ip, nil -} - -// Device returns the VirtualMachine's config.hardware.device property. -func (v VirtualMachine) Device(ctx context.Context) (VirtualDeviceList, error) { - var o mo.VirtualMachine - - err := v.Properties(ctx, v.Reference(), []string{"config.hardware.device"}, &o) - if err != nil { - return nil, err - } - - return VirtualDeviceList(o.Config.Hardware.Device), nil -} - -func (v VirtualMachine) configureDevice(ctx context.Context, op types.VirtualDeviceConfigSpecOperation, fop types.VirtualDeviceConfigSpecFileOperation, devices ...types.BaseVirtualDevice) error { - spec := types.VirtualMachineConfigSpec{} - - for _, device := range devices { - config := &types.VirtualDeviceConfigSpec{ - Device: device, - Operation: op, - } - - if disk, ok := device.(*types.VirtualDisk); ok { - config.FileOperation = fop - - // Special case to attach an existing disk - if op == types.VirtualDeviceConfigSpecOperationAdd && disk.CapacityInKB == 0 { - childDisk := false - if b, ok := disk.Backing.(*types.VirtualDiskFlatVer2BackingInfo); ok { - childDisk = b.Parent != nil - } - - if !childDisk { - config.FileOperation = "" // existing disk - } - } - } - - spec.DeviceChange = append(spec.DeviceChange, config) - } - - task, err := v.Reconfigure(ctx, spec) - if err != nil { - return err - } - - return task.Wait(ctx) -} - -// AddDevice adds the given devices to the VirtualMachine -func (v VirtualMachine) AddDevice(ctx context.Context, device ...types.BaseVirtualDevice) error { - return v.configureDevice(ctx, types.VirtualDeviceConfigSpecOperationAdd, types.VirtualDeviceConfigSpecFileOperationCreate, device...) -} - -// EditDevice edits the given (existing) devices on the VirtualMachine -func (v VirtualMachine) EditDevice(ctx context.Context, device ...types.BaseVirtualDevice) error { - return v.configureDevice(ctx, types.VirtualDeviceConfigSpecOperationEdit, types.VirtualDeviceConfigSpecFileOperationReplace, device...) -} - -// RemoveDevice removes the given devices on the VirtualMachine -func (v VirtualMachine) RemoveDevice(ctx context.Context, device ...types.BaseVirtualDevice) error { - return v.configureDevice(ctx, types.VirtualDeviceConfigSpecOperationRemove, types.VirtualDeviceConfigSpecFileOperationDestroy, device...) -} - -// BootOptions returns the VirtualMachine's config.bootOptions property. -func (v VirtualMachine) BootOptions(ctx context.Context) (*types.VirtualMachineBootOptions, error) { - var o mo.VirtualMachine - - err := v.Properties(ctx, v.Reference(), []string{"config.bootOptions"}, &o) - if err != nil { - return nil, err - } - - return o.Config.BootOptions, nil -} - -// SetBootOptions reconfigures the VirtualMachine with the given options. -func (v VirtualMachine) SetBootOptions(ctx context.Context, options *types.VirtualMachineBootOptions) error { - spec := types.VirtualMachineConfigSpec{} - - spec.BootOptions = options - - task, err := v.Reconfigure(ctx, spec) - if err != nil { - return err - } - - return task.Wait(ctx) -} - -// Answer answers a pending question. -func (v VirtualMachine) Answer(ctx context.Context, id, answer string) error { - req := types.AnswerVM{ - This: v.Reference(), - QuestionId: id, - AnswerChoice: answer, - } - - _, err := methods.AnswerVM(ctx, v.c, &req) - if err != nil { - return err - } - - return nil -} - -func (v VirtualMachine) MarkAsTemplate(ctx context.Context) error { - req := types.MarkAsTemplate{ - This: v.Reference(), - } - - _, err := methods.MarkAsTemplate(ctx, v.c, &req) - if err != nil { - return err - } - - return nil -} - -func (v VirtualMachine) MarkAsVirtualMachine(ctx context.Context, pool ResourcePool, host *HostSystem) error { - req := types.MarkAsVirtualMachine{ - This: v.Reference(), - Pool: pool.Reference(), - } - - if host != nil { - ref := host.Reference() - req.Host = &ref - } - - _, err := methods.MarkAsVirtualMachine(ctx, v.c, &req) - if err != nil { - return err - } - - return nil -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/object/virtual_machine_test.go juju-core-2.0.2/src/github.com/juju/govmomi/object/virtual_machine_test.go --- juju-core-2.0.0/src/github.com/juju/govmomi/object/virtual_machine_test.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/object/virtual_machine_test.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,20 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package object - -// VirtualMachine should implement the Reference interface. -var _ Reference = VirtualMachine{} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/object/vmware_distributed_virtual_switch.go juju-core-2.0.2/src/github.com/juju/govmomi/object/vmware_distributed_virtual_switch.go --- juju-core-2.0.0/src/github.com/juju/govmomi/object/vmware_distributed_virtual_switch.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/object/vmware_distributed_virtual_switch.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,21 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package object - -type VmwareDistributedVirtualSwitch struct { - DistributedVirtualSwitch -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/property/collector.go juju-core-2.0.2/src/github.com/juju/govmomi/property/collector.go --- juju-core-2.0.0/src/github.com/juju/govmomi/property/collector.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/property/collector.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,174 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package property - -import ( - "errors" - - "github.com/juju/govmomi/vim25" - "github.com/juju/govmomi/vim25/methods" - "github.com/juju/govmomi/vim25/mo" - "github.com/juju/govmomi/vim25/soap" - "github.com/juju/govmomi/vim25/types" - "golang.org/x/net/context" -) - -// Collector models the PropertyCollector managed object. -// -// For more information, see: -// http://pubs.vmware.com/vsphere-55/index.jsp#com.vmware.wssdk.apiref.doc/vmodl.query.PropertyCollector.html -// -type Collector struct { - roundTripper soap.RoundTripper - reference types.ManagedObjectReference -} - -// DefaultCollector returns the session's default property collector. -func DefaultCollector(c *vim25.Client) *Collector { - p := Collector{ - roundTripper: c, - reference: c.ServiceContent.PropertyCollector, - } - - return &p -} - -func (p Collector) Reference() types.ManagedObjectReference { - return p.reference -} - -// Create creates a new session-specific Collector that can be used to -// retrieve property updates independent of any other Collector. -func (p *Collector) Create(ctx context.Context) (*Collector, error) { - req := types.CreatePropertyCollector{ - This: p.Reference(), - } - - res, err := methods.CreatePropertyCollector(ctx, p.roundTripper, &req) - if err != nil { - return nil, err - } - - newp := Collector{ - roundTripper: p.roundTripper, - reference: res.Returnval, - } - - return &newp, nil -} - -// Destroy destroys this Collector. -func (p *Collector) Destroy(ctx context.Context) error { - req := types.DestroyPropertyCollector{ - This: p.Reference(), - } - - _, err := methods.DestroyPropertyCollector(ctx, p.roundTripper, &req) - if err != nil { - return err - } - - p.reference = types.ManagedObjectReference{} - return nil -} - -func (p *Collector) CreateFilter(ctx context.Context, req types.CreateFilter) error { - req.This = p.Reference() - - _, err := methods.CreateFilter(ctx, p.roundTripper, &req) - if err != nil { - return err - } - - return nil -} - -func (p *Collector) WaitForUpdates(ctx context.Context, v string) (*types.UpdateSet, error) { - req := types.WaitForUpdatesEx{ - This: p.Reference(), - Version: v, - } - - res, err := methods.WaitForUpdatesEx(ctx, p.roundTripper, &req) - if err != nil { - return nil, err - } - - return res.Returnval, nil -} - -func (p *Collector) RetrieveProperties(ctx context.Context, req types.RetrieveProperties) (*types.RetrievePropertiesResponse, error) { - req.This = p.Reference() - return methods.RetrieveProperties(ctx, p.roundTripper, &req) -} - -// Retrieve loads properties for a slice of managed objects. The dst argument -// must be a pointer to a []interface{}, which is populated with the instances -// of the specified managed objects, with the relevant properties filled in. If -// the properties slice is nil, all properties are loaded. -func (p *Collector) Retrieve(ctx context.Context, objs []types.ManagedObjectReference, ps []string, dst interface{}) error { - var propSpec *types.PropertySpec - var objectSet []types.ObjectSpec - - for _, obj := range objs { - // Ensure that all object reference types are the same - if propSpec == nil { - propSpec = &types.PropertySpec{ - Type: obj.Type, - } - - if ps == nil { - propSpec.All = types.NewBool(true) - } else { - propSpec.PathSet = ps - } - } else { - if obj.Type != propSpec.Type { - return errors.New("object references must have the same type") - } - } - - objectSpec := types.ObjectSpec{ - Obj: obj, - Skip: types.NewBool(false), - } - - objectSet = append(objectSet, objectSpec) - } - - req := types.RetrieveProperties{ - SpecSet: []types.PropertyFilterSpec{ - { - ObjectSet: objectSet, - PropSet: []types.PropertySpec{*propSpec}, - }, - }, - } - - res, err := p.RetrieveProperties(ctx, req) - if err != nil { - return err - } - - return mo.LoadRetrievePropertiesResponse(res, dst) -} - -// RetrieveOne calls Retrieve with a single managed object reference. -func (p *Collector) RetrieveOne(ctx context.Context, obj types.ManagedObjectReference, ps []string, dst interface{}) error { - var objs = []types.ManagedObjectReference{obj} - return p.Retrieve(ctx, objs, ps, dst) -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/property/wait.go juju-core-2.0.2/src/github.com/juju/govmomi/property/wait.go --- juju-core-2.0.0/src/github.com/juju/govmomi/property/wait.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/property/wait.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,86 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package property - -import ( - "github.com/juju/govmomi/vim25/types" - "golang.org/x/net/context" -) - -// Wait waits for any of the specified properties of the specified managed -// object to change. It calls the specified function for every update it -// receives. If this function returns false, it continues waiting for -// subsequent updates. If this function returns true, it stops waiting and -// returns. -// -// To only receive updates for the specified managed object, the function -// creates a new property collector and calls CreateFilter. A new property -// collector is required because filters can only be added, not removed. -// -// The newly created collector is destroyed before this function returns (both -// in case of success or error). -// -func Wait(ctx context.Context, c *Collector, obj types.ManagedObjectReference, ps []string, f func([]types.PropertyChange) bool) error { - p, err := c.Create(ctx) - if err != nil { - return err - } - - // Attempt to destroy the collector using the background context, as the - // specified context may have timed out or have been cancelled. - defer p.Destroy(context.Background()) - - req := types.CreateFilter{ - Spec: types.PropertyFilterSpec{ - ObjectSet: []types.ObjectSpec{ - { - Obj: obj, - }, - }, - PropSet: []types.PropertySpec{ - { - PathSet: ps, - Type: obj.Type, - }, - }, - }, - } - - err = p.CreateFilter(ctx, req) - if err != nil { - return err - } - - for version := ""; ; { - res, err := p.WaitForUpdates(ctx, version) - if err != nil { - return err - } - - version = res.Version - - for _, fs := range res.FilterSet { - for _, os := range fs.ObjectSet { - if os.Obj == obj { - if f(os.ChangeSet) { - return nil - } - } - } - } - } -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/README.md juju-core-2.0.2/src/github.com/juju/govmomi/README.md --- juju-core-2.0.0/src/github.com/juju/govmomi/README.md 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/README.md 1970-01-01 00:00:00.000000000 +0000 @@ -1,36 +0,0 @@ -[![Build Status](https://travis-ci.org/vmware/govmomi.png?branch=master)](https://travis-ci.org/vmware/govmomi) - -# govmomi - -A Go library for interacting with VMware vSphere APIs (ESXi and/or vCenter). - -For `govc`, a CLI built on top of govmomi, check out the [govc](./govc) directory. - -## Compatibility - -This library is built for and tested against ESXi and vCenter 5.5. - -If you're able to use it against older versions of ESXi and/or vCenter, please -leave a note and we'll include it in this compatibility list. - -## Documentation - -The APIs exposed by this library very closely follow the API described in the [VMware vSphere API Reference Documentation][apiref]. -Refer to this document to become familiar with the upstream API. - -The code in the `govmomi` package is a wrapper for the code that is generated from the vSphere API description. -It primarily provides convenience functions for working with the vSphere API. -See [godoc.org][godoc] for documentation. - -[apiref]:http://pubs.vmware.com/vsphere-55/index.jsp#com.vmware.wssdk.apiref.doc/right-pane.html -[godoc]:http://godoc.org/github.com/vmware/govmomi - -## Status - -Changes to the API are subject to [semantic versioning](http://semver.org). - -Refer to the [CHANGELOG](CHANGELOG.md) for version to version changes. - -## License - -govmomi is available under the [Apache 2 license](LICENSE). diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/session/keep_alive.go juju-core-2.0.2/src/github.com/juju/govmomi/session/keep_alive.go --- juju-core-2.0.0/src/github.com/juju/govmomi/session/keep_alive.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/session/keep_alive.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,117 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package session - -import ( - "sync" - "time" - - "github.com/juju/govmomi/vim25/methods" - "github.com/juju/govmomi/vim25/soap" - "golang.org/x/net/context" -) - -type keepAlive struct { - sync.Mutex - - roundTripper soap.RoundTripper - idleTime time.Duration - notifyRequest chan struct{} - notifyStop chan struct{} - notifyWaitGroup sync.WaitGroup - - // keepAlive executes a request in the background with the purpose of - // keeping the session active. The response for this request is discarded. - keepAlive func(soap.RoundTripper) -} - -func defaultKeepAlive(roundTripper soap.RoundTripper) { - methods.GetServiceContent(context.Background(), roundTripper) -} - -// KeepAlive wraps the specified soap.RoundTripper and executes a meaningless -// API request in the background after the RoundTripper has been idle for the -// specified amount of idle time. The keep alive process only starts once a -// user logs in and runs until the user logs out again. -func KeepAlive(roundTripper soap.RoundTripper, idleTime time.Duration) soap.RoundTripper { - k := &keepAlive{ - roundTripper: roundTripper, - idleTime: idleTime, - notifyRequest: make(chan struct{}), - } - - k.keepAlive = defaultKeepAlive - - return k -} - -func (k *keepAlive) start() { - k.Lock() - defer k.Unlock() - - if k.notifyStop != nil { - return - } - - // This channel must be closed to terminate idle timer. - k.notifyStop = make(chan struct{}) - k.notifyWaitGroup.Add(1) - - go func() { - defer k.notifyWaitGroup.Done() - - for t := time.NewTimer(k.idleTime); ; { - select { - case <-k.notifyStop: - return - case <-k.notifyRequest: - t.Reset(k.idleTime) - case <-t.C: - k.keepAlive(k.roundTripper) - t = time.NewTimer(k.idleTime) - } - } - }() -} - -func (k *keepAlive) stop() { - k.Lock() - defer k.Unlock() - - if k.notifyStop != nil { - close(k.notifyStop) - k.notifyWaitGroup.Wait() - k.notifyStop = nil - } -} - -func (k *keepAlive) RoundTrip(ctx context.Context, req, res soap.HasFault) error { - err := k.roundTripper.RoundTrip(ctx, req, res) - if err != nil { - return err - } - - // Start ticker on login, stop ticker on logout. - switch req.(type) { - case *methods.LoginBody: - k.start() - case *methods.LogoutBody: - k.stop() - } - - return nil -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/session/keep_alive_test.go juju-core-2.0.2/src/github.com/juju/govmomi/session/keep_alive_test.go --- juju-core-2.0.0/src/github.com/juju/govmomi/session/keep_alive_test.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/session/keep_alive_test.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,162 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package session - -import ( - "fmt" - "net/url" - "os" - "runtime" - "testing" - "time" - - "github.com/juju/govmomi/test" - "github.com/juju/govmomi/vim25" - "github.com/juju/govmomi/vim25/soap" - "golang.org/x/net/context" -) - -type testKeepAlive int - -func (t *testKeepAlive) Func(soap.RoundTripper) { - *t++ -} - -func newManager(t *testing.T) (*Manager, *url.URL) { - u := test.URL() - if u == nil { - t.SkipNow() - } - - soapClient := soap.NewClient(u, true) - vimClient, err := vim25.NewClient(context.Background(), soapClient) - if err != nil { - t.Fatal(err) - } - - return NewManager(vimClient), u -} - -func TestKeepAlive(t *testing.T) { - var i testKeepAlive - var j int - - m, u := newManager(t) - k := KeepAlive(m.client.RoundTripper, time.Millisecond) - k.(*keepAlive).keepAlive = i.Func - m.client.RoundTripper = k - - // Expect keep alive to not have triggered yet - if i != 0 { - t.Errorf("Expected i == 0, got i: %d", i) - } - - // Logging in starts keep alive - err := m.Login(context.Background(), u.User) - if err != nil { - t.Error(err) - } - - time.Sleep(2 * time.Millisecond) - - // Expect keep alive to triggered at least once - if i == 0 { - t.Errorf("Expected i != 0, got i: %d", i) - } - - j = int(i) - time.Sleep(2 * time.Millisecond) - - // Expect keep alive to triggered at least once more - if int(i) <= j { - t.Errorf("Expected i > j, got i: %d, j: %d", i, j) - } - - // Logging out stops keep alive - err = m.Logout(context.Background()) - if err != nil { - t.Error(err) - } - - j = int(i) - time.Sleep(2 * time.Millisecond) - - // Expect keep alive to have stopped - if int(i) != j { - t.Errorf("Expected i == j, got i: %d, j: %d", i, j) - } -} - -func testSessionOK(t *testing.T, m *Manager, ok bool) { - s, err := m.UserSession(context.Background()) - if err != nil { - t.Fatal(err) - } - - _, file, line, _ := runtime.Caller(1) - prefix := fmt.Sprintf("%s:%d", file, line) - - if ok && s == nil { - t.Fatalf("%s: Expected session to be OK, but is invalid", prefix) - } - - if !ok && s != nil { - t.Fatalf("%s: Expected session to be invalid, but is OK", prefix) - } -} - -// Run with: -// -// env GOVMOMI_KEEPALIVE_TEST=1 go test -timeout=60m -run TestRealKeepAlive -// -func TestRealKeepAlive(t *testing.T) { - if os.Getenv("GOVMOMI_KEEPALIVE_TEST") != "1" { - t.SkipNow() - } - - m1, u1 := newManager(t) - m2, u2 := newManager(t) - - // Enable keepalive on m2 - k := KeepAlive(m2.client.RoundTripper, 10*time.Minute) - m2.client.RoundTripper = k - - // Expect both sessions to be invalid - testSessionOK(t, m1, false) - testSessionOK(t, m2, false) - - // Logging in starts keep alive - if err := m1.Login(context.Background(), u1.User); err != nil { - t.Error(err) - } - if err := m2.Login(context.Background(), u2.User); err != nil { - t.Error(err) - } - - // Expect both sessions to be valid - testSessionOK(t, m1, true) - testSessionOK(t, m2, true) - - // Wait for m1 to time out - delay := 31 * time.Minute - fmt.Printf("%s: Waiting %d minutes for session to time out...\n", time.Now(), int(delay.Minutes())) - time.Sleep(delay) - - // Expect m1's session to be invalid, m2's session to be valid - testSessionOK(t, m1, false) - testSessionOK(t, m2, true) -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/session/manager.go juju-core-2.0.2/src/github.com/juju/govmomi/session/manager.go --- juju-core-2.0.0/src/github.com/juju/govmomi/session/manager.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/session/manager.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,121 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package session - -import ( - "net/url" - - "github.com/juju/govmomi/vim25" - "github.com/juju/govmomi/vim25/methods" - "github.com/juju/govmomi/vim25/mo" - "github.com/juju/govmomi/vim25/types" - "golang.org/x/net/context" -) - -type Manager struct { - client *vim25.Client - userSession *types.UserSession -} - -func NewManager(client *vim25.Client) *Manager { - m := Manager{ - client: client, - } - - return &m -} - -func (sm Manager) Reference() types.ManagedObjectReference { - return *sm.client.ServiceContent.SessionManager -} - -func (sm *Manager) Login(ctx context.Context, u *url.Userinfo) error { - req := types.Login{ - This: sm.Reference(), - } - - if u != nil { - req.UserName = u.Username() - if pw, ok := u.Password(); ok { - req.Password = pw - } - } - - login, err := methods.Login(ctx, sm.client, &req) - if err != nil { - return err - } - - sm.userSession = &login.Returnval - return nil -} - -func (sm *Manager) Logout(ctx context.Context) error { - req := types.Logout{ - This: sm.Reference(), - } - - _, err := methods.Logout(ctx, sm.client, &req) - if err != nil { - return err - } - - sm.userSession = nil - return nil -} - -// UserSession retrieves and returns the SessionManager's CurrentSession field. -// Nil is returned if the session is not authenticated. -func (sm *Manager) UserSession(ctx context.Context) (*types.UserSession, error) { - var mgr mo.SessionManager - - err := mo.RetrieveProperties(ctx, sm.client, sm.client.ServiceContent.PropertyCollector, sm.Reference(), &mgr) - if err != nil { - // It's OK if we can't retrieve properties because we're not authenticated - if f, ok := err.(types.HasFault); ok { - switch f.Fault().(type) { - case *types.NotAuthenticated: - return nil, nil - } - } - - return nil, err - } - - return mgr.CurrentSession, nil -} - -// SessionIsActive checks whether the session that was created at login is -// still valid. This function only works against vCenter. -func (sm *Manager) SessionIsActive(ctx context.Context) (bool, error) { - if sm.userSession == nil { - return false, nil - } - - req := types.SessionIsActive{ - This: sm.Reference(), - SessionID: sm.userSession.Key, - UserName: sm.userSession.UserName, - } - - active, err := methods.SessionIsActive(ctx, sm.client, &req) - if err != nil { - return false, err - } - - return active.Returnval, err -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/session/manager_test.go juju-core-2.0.2/src/github.com/juju/govmomi/session/manager_test.go --- juju-core-2.0.0/src/github.com/juju/govmomi/session/manager_test.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/session/manager_test.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,106 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package session - -import ( - "net/url" - "testing" - - "github.com/juju/govmomi/test" - "github.com/juju/govmomi/vim25" - "github.com/juju/govmomi/vim25/soap" - "golang.org/x/net/context" -) - -func sessionClient(u *url.URL, t *testing.T) *Manager { - soapClient := soap.NewClient(u, true) - vimClient, err := vim25.NewClient(context.Background(), soapClient) - if err != nil { - t.Fatal(err) - } - - return NewManager(vimClient) -} - -func TestLogin(t *testing.T) { - u := test.URL() - if u == nil { - t.SkipNow() - } - - session := sessionClient(u, t) - err := session.Login(context.Background(), u.User) - if err != nil { - t.Errorf("Expected no error, got %v", err) - } -} - -func TestLogout(t *testing.T) { - u := test.URL() - if u == nil { - t.SkipNow() - } - - session := sessionClient(u, t) - err := session.Login(context.Background(), u.User) - if err != nil { - t.Error("Login Error: ", err) - } - - err = session.Logout(context.Background()) - if err != nil { - t.Errorf("Expected nil, got %v", err) - } - - err = session.Logout(context.Background()) - if err == nil { - t.Errorf("Expected NotAuthenticated, got nil") - } -} - -func TestSessionIsActive(t *testing.T) { - u := test.URL() - if u == nil { - t.SkipNow() - } - - session := sessionClient(u, t) - - // Skip test against ESXi -- SessionIsActive is not implemented - if session.client.ServiceContent.About.ApiType != "VirtualCenter" { - t.Skipf("Talking to %s instead of %s", session.client.ServiceContent.About.ApiType, "VirtualCenter") - } - - err := session.Login(context.Background(), u.User) - if err != nil { - t.Error("Login Error: ", err) - } - - active, err := session.SessionIsActive(context.Background()) - if err != nil || !active { - t.Errorf("Expected %t, got %t", true, active) - t.Errorf("Expected nil, got %v", err) - } - - session.Logout(context.Background()) - - active, err = session.SessionIsActive(context.Background()) - if err == nil || active { - t.Errorf("Expected %t, got %t", false, active) - t.Errorf("Expected NotAuthenticated, got %v", err) - } -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/task/error.go juju-core-2.0.2/src/github.com/juju/govmomi/task/error.go --- juju-core-2.0.0/src/github.com/juju/govmomi/task/error.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/task/error.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,32 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package task - -import "github.com/juju/govmomi/vim25/types" - -type Error struct { - *types.LocalizedMethodFault -} - -// Error returns the task's localized fault message. -func (e Error) Error() string { - return e.LocalizedMethodFault.LocalizedMessage -} - -func (e Error) Fault() types.BaseMethodFault { - return e.LocalizedMethodFault.Fault -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/task/wait.go juju-core-2.0.2/src/github.com/juju/govmomi/task/wait.go --- juju-core-2.0.0/src/github.com/juju/govmomi/task/wait.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/task/wait.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,126 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package task - -import ( - "github.com/juju/govmomi/property" - "github.com/juju/govmomi/vim25/progress" - "github.com/juju/govmomi/vim25/types" - "golang.org/x/net/context" -) - -type taskProgress struct { - info *types.TaskInfo -} - -func (t taskProgress) Percentage() float32 { - return float32(t.info.Progress) -} - -func (t taskProgress) Detail() string { - return "" -} - -func (t taskProgress) Error() error { - if t.info.Error != nil { - return Error{t.info.Error} - } - - return nil -} - -type taskCallback struct { - ch chan<- progress.Report - info *types.TaskInfo - err error -} - -func (t *taskCallback) fn(pc []types.PropertyChange) bool { - for _, c := range pc { - if c.Name != "info" { - continue - } - - if c.Op != types.PropertyChangeOpAssign { - continue - } - - if c.Val == nil { - continue - } - - ti := c.Val.(types.TaskInfo) - t.info = &ti - } - - pr := taskProgress{t.info} - - // Store copy of error, so Wait() can return it as well. - t.err = pr.Error() - - switch t.info.State { - case types.TaskInfoStateQueued, types.TaskInfoStateRunning: - if t.ch != nil { - // Don't care if this is dropped - select { - case t.ch <- pr: - default: - } - } - return false - case types.TaskInfoStateSuccess, types.TaskInfoStateError: - if t.ch != nil { - // Last one must always be delivered - t.ch <- pr - } - return true - default: - panic("unknown state: " + t.info.State) - } -} - -// Wait waits for a task to finish with either success or failure. It does so -// by waiting for the "info" property of task managed object to change. The -// function returns when it finds the task in the "success" or "error" state. -// In the former case, the return value is nil. In the latter case the return -// value is an instance of this package's Error struct. -// -// Any error returned while waiting for property changes causes the function to -// return immediately and propagate the error. -// -// If the progress.Sinker argument is specified, any progress updates for the -// task are sent here. The completion percentage is passed through directly. -// The detail for the progress update is set to an empty string. If the task -// finishes in the error state, the error instance is passed through as well. -// Note that this error is the same error that is returned by this function. -// -func Wait(ctx context.Context, ref types.ManagedObjectReference, pc *property.Collector, s progress.Sinker) (*types.TaskInfo, error) { - cb := &taskCallback{} - - // Include progress sink if specified - if s != nil { - cb.ch = s.Sink() - defer close(cb.ch) - } - - err := property.Wait(ctx, pc, ref, []string{"info"}, cb.fn) - if err != nil { - return nil, err - } - - return cb.info, cb.err -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/test/client/client.go juju-core-2.0.2/src/github.com/juju/govmomi/test/client/client.go --- juju-core-2.0.0/src/github.com/juju/govmomi/test/client/client.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/test/client/client.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,48 +0,0 @@ -/* -Copyright (c) 2015 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package client - -import ( - "testing" - - "github.com/juju/govmomi/session" - "github.com/juju/govmomi/test" - "github.com/juju/govmomi/vim25" - "github.com/juju/govmomi/vim25/soap" - "golang.org/x/net/context" -) - -func NewAuthenticatedClient(t *testing.T) *vim25.Client { - u := test.URL() - if u == nil { - t.SkipNow() - } - - soapClient := soap.NewClient(u, true) - vimClient, err := vim25.NewClient(context.Background(), soapClient) - if err != nil { - t.Fatal(err) - } - - m := session.NewManager(vimClient) - err = m.Login(context.Background(), u.User) - if err != nil { - t.Fatal(err) - } - - return vimClient -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/test/helper.go juju-core-2.0.2/src/github.com/juju/govmomi/test/helper.go --- juju-core-2.0.0/src/github.com/juju/govmomi/test/helper.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/test/helper.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,35 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package test - -import ( - "net/url" - "os" -) - -// URL parses the GOVMOMI_TEST_URL environment variable if set -func URL() *url.URL { - s := os.Getenv("GOVMOMI_TEST_URL") - if s == "" { - return nil - } - u, err := url.Parse(s) - if err != nil { - panic(err) - } - return u -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/.travis.yml juju-core-2.0.2/src/github.com/juju/govmomi/.travis.yml --- juju-core-2.0.0/src/github.com/juju/govmomi/.travis.yml 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/.travis.yml 1970-01-01 00:00:00.000000000 +0000 @@ -1,9 +0,0 @@ -language: go -go: 1.4 - -before_install: - - go get golang.org/x/tools/cmd/vet - - go get golang.org/x/tools/cmd/goimports - -script: - - make check test diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/vim25/client.go juju-core-2.0.2/src/github.com/juju/govmomi/vim25/client.go --- juju-core-2.0.0/src/github.com/juju/govmomi/vim25/client.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/vim25/client.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,114 +0,0 @@ -/* -Copyright (c) 2015 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package vim25 - -import ( - "encoding/json" - - "github.com/juju/govmomi/vim25/methods" - "github.com/juju/govmomi/vim25/soap" - "github.com/juju/govmomi/vim25/types" - "golang.org/x/net/context" -) - -// Client is a tiny wrapper around the vim25/soap Client that stores session -// specific state (i.e. state that only needs to be retrieved once after the -// client has been created). This means the client can be reused after -// serialization without performing additional requests for initialization. -type Client struct { - *soap.Client - - ServiceContent types.ServiceContent - - // RoundTripper is a separate field such that the client's implementation of - // the RoundTripper interface can be wrapped by separate implementations for - // extra functionality (for example, reauthentication on session timeout). - RoundTripper soap.RoundTripper -} - -// NewClient creates and returns a new client wirh the ServiceContent field -// filled in. -func NewClient(ctx context.Context, soapClient *soap.Client) (*Client, error) { - serviceContent, err := methods.GetServiceContent(ctx, soapClient) - if err != nil { - return nil, err - } - - c := Client{ - Client: soapClient, - ServiceContent: serviceContent, - RoundTripper: soapClient, - } - - return &c, nil -} - -// RoundTrip dispatches to the RoundTripper field. -func (c *Client) RoundTrip(ctx context.Context, req, res soap.HasFault) error { - return c.RoundTripper.RoundTrip(ctx, req, res) -} - -type marshaledClient struct { - SoapClient *soap.Client - ServiceContent types.ServiceContent -} - -func (c *Client) MarshalJSON() ([]byte, error) { - m := marshaledClient{ - SoapClient: c.Client, - ServiceContent: c.ServiceContent, - } - - return json.Marshal(m) -} - -func (c *Client) UnmarshalJSON(b []byte) error { - var m marshaledClient - - err := json.Unmarshal(b, &m) - if err != nil { - return err - } - - *c = Client{ - Client: m.SoapClient, - ServiceContent: m.ServiceContent, - RoundTripper: m.SoapClient, - } - - return nil -} - -// Valid returns whether or not the client is valid and ready for use. -// This should be called after unmarshalling the client. -func (c *Client) Valid() bool { - if c == nil { - return false - } - - if c.Client == nil { - return false - } - - // Use arbitrary pointer field in the service content. - // Doesn't matter which one, as long as it is populated by default. - if c.ServiceContent.SessionManager == nil { - return false - } - - return true -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/vim25/client_test.go juju-core-2.0.2/src/github.com/juju/govmomi/vim25/client_test.go --- juju-core-2.0.0/src/github.com/juju/govmomi/vim25/client_test.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/vim25/client_test.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,97 +0,0 @@ -/* -Copyright (c) 2015 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package vim25 - -import ( - "encoding/json" - "net/url" - "os" - "testing" - - "github.com/juju/govmomi/vim25/methods" - "github.com/juju/govmomi/vim25/mo" - "github.com/juju/govmomi/vim25/soap" - "github.com/juju/govmomi/vim25/types" - "golang.org/x/net/context" -) - -// Duplicated to prevent cyclic dependency... -func testURL(t *testing.T) *url.URL { - s := os.Getenv("GOVMOMI_TEST_URL") - if s == "" { - t.SkipNow() - } - u, err := url.Parse(s) - if err != nil { - panic(err) - } - return u -} - -func sessionLogin(t *testing.T, c *Client) { - req := types.Login{ - This: *c.ServiceContent.SessionManager, - } - - u := testURL(t).User - req.UserName = u.Username() - if pw, ok := u.Password(); ok { - req.Password = pw - } - - _, err := methods.Login(context.Background(), c, &req) - if err != nil { - t.Fatal(err) - } -} - -func sessionCheck(t *testing.T, c *Client) { - var mgr mo.SessionManager - - err := mo.RetrieveProperties(context.Background(), c, c.ServiceContent.PropertyCollector, *c.ServiceContent.SessionManager, &mgr) - if err != nil { - t.Fatal(err) - } -} - -func TestClientSerialization(t *testing.T) { - var c1, c2 *Client - - soapClient := soap.NewClient(testURL(t), true) - c1, err := NewClient(context.Background(), soapClient) - if err != nil { - t.Fatal(err) - } - - // Login - sessionLogin(t, c1) - sessionCheck(t, c1) - - // Serialize/deserialize - b, err := json.Marshal(c1) - if err != nil { - t.Fatal(err) - } - c2 = &Client{} - err = json.Unmarshal(b, c2) - if err != nil { - t.Fatal(err) - } - - // Check the session is still valid - sessionCheck(t, c2) -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/vim25/debug/debug.go juju-core-2.0.2/src/github.com/juju/govmomi/vim25/debug/debug.go --- juju-core-2.0.0/src/github.com/juju/govmomi/vim25/debug/debug.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/vim25/debug/debug.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,81 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package debug - -import ( - "io" - "os" - "path" -) - -// Provider specified the interface types must implement to be used as a -// debugging sink. Having multiple such sink implementations allows it to be -// changed externally (for example when running tests). -type Provider interface { - NewFile(s string) io.WriteCloser - Flush() -} - -var currentProvider Provider = nil - -func SetProvider(p Provider) { - if currentProvider != nil { - currentProvider.Flush() - } - currentProvider = p -} - -// Enabled returns whether debugging is enabled or not. -func Enabled() bool { - return currentProvider != nil -} - -// NewFile dispatches to the current provider's NewFile function. -func NewFile(s string) io.WriteCloser { - return currentProvider.NewFile(s) -} - -// Flush dispatches to the current provider's Flush function. -func Flush() { - currentProvider.Flush() -} - -// FileProvider implements a debugging provider that creates a real file for -// every call to NewFile. It maintains a list of all files that it creates, -// such that it can close them when its Flush function is called. -type FileProvider struct { - Path string - - files []*os.File -} - -func (fp *FileProvider) NewFile(p string) io.WriteCloser { - f, err := os.Create(path.Join(fp.Path, p)) - if err != nil { - panic(err) - } - - fp.files = append(fp.files, f) - - return f -} - -func (fp *FileProvider) Flush() { - for _, f := range fp.files { - f.Close() - } -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/vim25/doc.go juju-core-2.0.2/src/github.com/juju/govmomi/vim25/doc.go --- juju-core-2.0.0/src/github.com/juju/govmomi/vim25/doc.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/vim25/doc.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,29 +0,0 @@ -/* -Copyright (c) 2015 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -/* -Package vim25 provides a minimal client implementation to use with other -packages in the vim25 tree. The code in this package intentionally does not -take any dependendies outside the vim25 tree. - -The client implementation in this package embeds the soap.Client structure. -Additionally, it stores the value of the session's ServiceContent object. This -object stores references to a variety of subsystems, such as the root property -collector, the session manager, and the search index. The client is fully -functional after serialization and deserialization, without the need for -additional requests for initialization. -*/ -package vim25 diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/vim25/methods/fault_test.go juju-core-2.0.2/src/github.com/juju/govmomi/vim25/methods/fault_test.go --- juju-core-2.0.0/src/github.com/juju/govmomi/vim25/methods/fault_test.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/vim25/methods/fault_test.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,62 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package methods - -import ( - "bytes" - "testing" - - "github.com/juju/govmomi/vim25/soap" - "github.com/juju/govmomi/vim25/types" - "github.com/juju/govmomi/vim25/xml" -) - -var invalidLoginFault = ` - - - -ServerFaultCodeCannot complete login due to an incorrect user name or password. - -` - -type TestBody struct { - Fault *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func TestFaultDetail(t *testing.T) { - body := TestBody{} - env := soap.Envelope{Body: &body} - - dec := xml.NewDecoder(bytes.NewReader([]byte(invalidLoginFault))) - dec.TypeFunc = types.TypeFunc() - - err := dec.Decode(&env) - if err != nil { - t.Fatalf("Decode: %s", err) - } - - if body.Fault == nil { - t.Fatal("Expected fault") - } - - if _, ok := body.Fault.Detail.Fault.(types.InvalidLogin); !ok { - t.Fatalf("Expected InvalidLogin, got: %#v", body.Fault.Detail.Fault) - } -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/vim25/methods/internal.go juju-core-2.0.2/src/github.com/juju/govmomi/vim25/methods/internal.go --- juju-core-2.0.0/src/github.com/juju/govmomi/vim25/methods/internal.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/vim25/methods/internal.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,123 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package methods - -import ( - "github.com/juju/govmomi/vim25/soap" - "github.com/juju/govmomi/vim25/types" - "golang.org/x/net/context" -) - -type RetrieveDynamicTypeManagerBody struct { - Req *types.RetrieveDynamicTypeManager `xml:"urn:vim25 RetrieveDynamicTypeManager"` - Res *types.RetrieveDynamicTypeManagerResponse `xml:"urn:vim25 RetrieveDynamicTypeManagerResponse"` - Fault_ *soap.Fault -} - -func (b *RetrieveDynamicTypeManagerBody) Fault() *soap.Fault { return b.Fault_ } - -func RetrieveDynamicTypeManager(ctx context.Context, r soap.RoundTripper, req *types.RetrieveDynamicTypeManager) (*types.RetrieveDynamicTypeManagerResponse, error) { - var reqBody, resBody RetrieveDynamicTypeManagerBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type RetrieveManagedMethodExecuterBody struct { - Req *types.RetrieveManagedMethodExecuter `xml:"urn:vim25 RetrieveManagedMethodExecuter"` - Res *types.RetrieveManagedMethodExecuterResponse `xml:"urn:vim25 RetrieveManagedMethodExecuterResponse"` - Fault_ *soap.Fault -} - -func (b *RetrieveManagedMethodExecuterBody) Fault() *soap.Fault { return b.Fault_ } - -func RetrieveManagedMethodExecuter(ctx context.Context, r soap.RoundTripper, req *types.RetrieveManagedMethodExecuter) (*types.RetrieveManagedMethodExecuterResponse, error) { - var reqBody, resBody RetrieveManagedMethodExecuterBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type DynamicTypeMgrQueryMoInstancesBody struct { - Req *types.DynamicTypeMgrQueryMoInstances `xml:"urn:vim25 DynamicTypeMgrQueryMoInstances"` - Res *types.DynamicTypeMgrQueryMoInstancesResponse `xml:"urn:vim25 DynamicTypeMgrQueryMoInstancesResponse"` - Fault_ *soap.Fault -} - -func (b *DynamicTypeMgrQueryMoInstancesBody) Fault() *soap.Fault { return b.Fault_ } - -func DynamicTypeMgrQueryMoInstances(ctx context.Context, r soap.RoundTripper, req *types.DynamicTypeMgrQueryMoInstances) (*types.DynamicTypeMgrQueryMoInstancesResponse, error) { - var reqBody, resBody DynamicTypeMgrQueryMoInstancesBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type DynamicTypeMgrQueryTypeInfoBody struct { - Req *types.DynamicTypeMgrQueryTypeInfo `xml:"urn:vim25 DynamicTypeMgrQueryTypeInfo"` - Res *types.DynamicTypeMgrQueryTypeInfoResponse `xml:"urn:vim25 DynamicTypeMgrQueryTypeInfoResponse"` - Fault_ *soap.Fault -} - -func (b *DynamicTypeMgrQueryTypeInfoBody) Fault() *soap.Fault { return b.Fault_ } - -func DynamicTypeMgrQueryTypeInfo(ctx context.Context, r soap.RoundTripper, req *types.DynamicTypeMgrQueryTypeInfo) (*types.DynamicTypeMgrQueryTypeInfoResponse, error) { - var reqBody, resBody DynamicTypeMgrQueryTypeInfoBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type ExecuteSoapBody struct { - Req *types.ExecuteSoap `xml:"urn:vim25 ExecuteSoap"` - Res *types.ExecuteSoapResponse `xml:"urn:vim25 ExecuteSoapResponse"` - Fault_ *soap.Fault -} - -func (b *ExecuteSoapBody) Fault() *soap.Fault { return b.Fault_ } - -func ExecuteSoap(ctx context.Context, r soap.RoundTripper, req *types.ExecuteSoap) (*types.ExecuteSoapResponse, error) { - var reqBody, resBody ExecuteSoapBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/vim25/methods/methods.go juju-core-2.0.2/src/github.com/juju/govmomi/vim25/methods/methods.go --- juju-core-2.0.0/src/github.com/juju/govmomi/vim25/methods/methods.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/vim25/methods/methods.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,12243 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package methods - -import ( - "github.com/juju/govmomi/vim25/soap" - "github.com/juju/govmomi/vim25/types" - "golang.org/x/net/context" -) - -type AcknowledgeAlarmBody struct { - Req *types.AcknowledgeAlarm `xml:"urn:vim25 AcknowledgeAlarm,omitempty"` - Res *types.AcknowledgeAlarmResponse `xml:"urn:vim25 AcknowledgeAlarmResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *AcknowledgeAlarmBody) Fault() *soap.Fault { return b.Fault_ } - -func AcknowledgeAlarm(ctx context.Context, r soap.RoundTripper, req *types.AcknowledgeAlarm) (*types.AcknowledgeAlarmResponse, error) { - var reqBody, resBody AcknowledgeAlarmBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type AcquireCimServicesTicketBody struct { - Req *types.AcquireCimServicesTicket `xml:"urn:vim25 AcquireCimServicesTicket,omitempty"` - Res *types.AcquireCimServicesTicketResponse `xml:"urn:vim25 AcquireCimServicesTicketResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *AcquireCimServicesTicketBody) Fault() *soap.Fault { return b.Fault_ } - -func AcquireCimServicesTicket(ctx context.Context, r soap.RoundTripper, req *types.AcquireCimServicesTicket) (*types.AcquireCimServicesTicketResponse, error) { - var reqBody, resBody AcquireCimServicesTicketBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type AcquireCloneTicketBody struct { - Req *types.AcquireCloneTicket `xml:"urn:vim25 AcquireCloneTicket,omitempty"` - Res *types.AcquireCloneTicketResponse `xml:"urn:vim25 AcquireCloneTicketResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *AcquireCloneTicketBody) Fault() *soap.Fault { return b.Fault_ } - -func AcquireCloneTicket(ctx context.Context, r soap.RoundTripper, req *types.AcquireCloneTicket) (*types.AcquireCloneTicketResponse, error) { - var reqBody, resBody AcquireCloneTicketBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type AcquireCredentialsInGuestBody struct { - Req *types.AcquireCredentialsInGuest `xml:"urn:vim25 AcquireCredentialsInGuest,omitempty"` - Res *types.AcquireCredentialsInGuestResponse `xml:"urn:vim25 AcquireCredentialsInGuestResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *AcquireCredentialsInGuestBody) Fault() *soap.Fault { return b.Fault_ } - -func AcquireCredentialsInGuest(ctx context.Context, r soap.RoundTripper, req *types.AcquireCredentialsInGuest) (*types.AcquireCredentialsInGuestResponse, error) { - var reqBody, resBody AcquireCredentialsInGuestBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type AcquireGenericServiceTicketBody struct { - Req *types.AcquireGenericServiceTicket `xml:"urn:vim25 AcquireGenericServiceTicket,omitempty"` - Res *types.AcquireGenericServiceTicketResponse `xml:"urn:vim25 AcquireGenericServiceTicketResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *AcquireGenericServiceTicketBody) Fault() *soap.Fault { return b.Fault_ } - -func AcquireGenericServiceTicket(ctx context.Context, r soap.RoundTripper, req *types.AcquireGenericServiceTicket) (*types.AcquireGenericServiceTicketResponse, error) { - var reqBody, resBody AcquireGenericServiceTicketBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type AcquireLocalTicketBody struct { - Req *types.AcquireLocalTicket `xml:"urn:vim25 AcquireLocalTicket,omitempty"` - Res *types.AcquireLocalTicketResponse `xml:"urn:vim25 AcquireLocalTicketResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *AcquireLocalTicketBody) Fault() *soap.Fault { return b.Fault_ } - -func AcquireLocalTicket(ctx context.Context, r soap.RoundTripper, req *types.AcquireLocalTicket) (*types.AcquireLocalTicketResponse, error) { - var reqBody, resBody AcquireLocalTicketBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type AcquireMksTicketBody struct { - Req *types.AcquireMksTicket `xml:"urn:vim25 AcquireMksTicket,omitempty"` - Res *types.AcquireMksTicketResponse `xml:"urn:vim25 AcquireMksTicketResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *AcquireMksTicketBody) Fault() *soap.Fault { return b.Fault_ } - -func AcquireMksTicket(ctx context.Context, r soap.RoundTripper, req *types.AcquireMksTicket) (*types.AcquireMksTicketResponse, error) { - var reqBody, resBody AcquireMksTicketBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type AcquireTicketBody struct { - Req *types.AcquireTicket `xml:"urn:vim25 AcquireTicket,omitempty"` - Res *types.AcquireTicketResponse `xml:"urn:vim25 AcquireTicketResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *AcquireTicketBody) Fault() *soap.Fault { return b.Fault_ } - -func AcquireTicket(ctx context.Context, r soap.RoundTripper, req *types.AcquireTicket) (*types.AcquireTicketResponse, error) { - var reqBody, resBody AcquireTicketBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type AddAuthorizationRoleBody struct { - Req *types.AddAuthorizationRole `xml:"urn:vim25 AddAuthorizationRole,omitempty"` - Res *types.AddAuthorizationRoleResponse `xml:"urn:vim25 AddAuthorizationRoleResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *AddAuthorizationRoleBody) Fault() *soap.Fault { return b.Fault_ } - -func AddAuthorizationRole(ctx context.Context, r soap.RoundTripper, req *types.AddAuthorizationRole) (*types.AddAuthorizationRoleResponse, error) { - var reqBody, resBody AddAuthorizationRoleBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type AddCustomFieldDefBody struct { - Req *types.AddCustomFieldDef `xml:"urn:vim25 AddCustomFieldDef,omitempty"` - Res *types.AddCustomFieldDefResponse `xml:"urn:vim25 AddCustomFieldDefResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *AddCustomFieldDefBody) Fault() *soap.Fault { return b.Fault_ } - -func AddCustomFieldDef(ctx context.Context, r soap.RoundTripper, req *types.AddCustomFieldDef) (*types.AddCustomFieldDefResponse, error) { - var reqBody, resBody AddCustomFieldDefBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type AddDVPortgroup_TaskBody struct { - Req *types.AddDVPortgroup_Task `xml:"urn:vim25 AddDVPortgroup_Task,omitempty"` - Res *types.AddDVPortgroup_TaskResponse `xml:"urn:vim25 AddDVPortgroup_TaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *AddDVPortgroup_TaskBody) Fault() *soap.Fault { return b.Fault_ } - -func AddDVPortgroup_Task(ctx context.Context, r soap.RoundTripper, req *types.AddDVPortgroup_Task) (*types.AddDVPortgroup_TaskResponse, error) { - var reqBody, resBody AddDVPortgroup_TaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type AddDisks_TaskBody struct { - Req *types.AddDisks_Task `xml:"urn:vim25 AddDisks_Task,omitempty"` - Res *types.AddDisks_TaskResponse `xml:"urn:vim25 AddDisks_TaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *AddDisks_TaskBody) Fault() *soap.Fault { return b.Fault_ } - -func AddDisks_Task(ctx context.Context, r soap.RoundTripper, req *types.AddDisks_Task) (*types.AddDisks_TaskResponse, error) { - var reqBody, resBody AddDisks_TaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type AddHost_TaskBody struct { - Req *types.AddHost_Task `xml:"urn:vim25 AddHost_Task,omitempty"` - Res *types.AddHost_TaskResponse `xml:"urn:vim25 AddHost_TaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *AddHost_TaskBody) Fault() *soap.Fault { return b.Fault_ } - -func AddHost_Task(ctx context.Context, r soap.RoundTripper, req *types.AddHost_Task) (*types.AddHost_TaskResponse, error) { - var reqBody, resBody AddHost_TaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type AddInternetScsiSendTargetsBody struct { - Req *types.AddInternetScsiSendTargets `xml:"urn:vim25 AddInternetScsiSendTargets,omitempty"` - Res *types.AddInternetScsiSendTargetsResponse `xml:"urn:vim25 AddInternetScsiSendTargetsResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *AddInternetScsiSendTargetsBody) Fault() *soap.Fault { return b.Fault_ } - -func AddInternetScsiSendTargets(ctx context.Context, r soap.RoundTripper, req *types.AddInternetScsiSendTargets) (*types.AddInternetScsiSendTargetsResponse, error) { - var reqBody, resBody AddInternetScsiSendTargetsBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type AddInternetScsiStaticTargetsBody struct { - Req *types.AddInternetScsiStaticTargets `xml:"urn:vim25 AddInternetScsiStaticTargets,omitempty"` - Res *types.AddInternetScsiStaticTargetsResponse `xml:"urn:vim25 AddInternetScsiStaticTargetsResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *AddInternetScsiStaticTargetsBody) Fault() *soap.Fault { return b.Fault_ } - -func AddInternetScsiStaticTargets(ctx context.Context, r soap.RoundTripper, req *types.AddInternetScsiStaticTargets) (*types.AddInternetScsiStaticTargetsResponse, error) { - var reqBody, resBody AddInternetScsiStaticTargetsBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type AddLicenseBody struct { - Req *types.AddLicense `xml:"urn:vim25 AddLicense,omitempty"` - Res *types.AddLicenseResponse `xml:"urn:vim25 AddLicenseResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *AddLicenseBody) Fault() *soap.Fault { return b.Fault_ } - -func AddLicense(ctx context.Context, r soap.RoundTripper, req *types.AddLicense) (*types.AddLicenseResponse, error) { - var reqBody, resBody AddLicenseBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type AddNetworkResourcePoolBody struct { - Req *types.AddNetworkResourcePool `xml:"urn:vim25 AddNetworkResourcePool,omitempty"` - Res *types.AddNetworkResourcePoolResponse `xml:"urn:vim25 AddNetworkResourcePoolResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *AddNetworkResourcePoolBody) Fault() *soap.Fault { return b.Fault_ } - -func AddNetworkResourcePool(ctx context.Context, r soap.RoundTripper, req *types.AddNetworkResourcePool) (*types.AddNetworkResourcePoolResponse, error) { - var reqBody, resBody AddNetworkResourcePoolBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type AddPortGroupBody struct { - Req *types.AddPortGroup `xml:"urn:vim25 AddPortGroup,omitempty"` - Res *types.AddPortGroupResponse `xml:"urn:vim25 AddPortGroupResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *AddPortGroupBody) Fault() *soap.Fault { return b.Fault_ } - -func AddPortGroup(ctx context.Context, r soap.RoundTripper, req *types.AddPortGroup) (*types.AddPortGroupResponse, error) { - var reqBody, resBody AddPortGroupBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type AddServiceConsoleVirtualNicBody struct { - Req *types.AddServiceConsoleVirtualNic `xml:"urn:vim25 AddServiceConsoleVirtualNic,omitempty"` - Res *types.AddServiceConsoleVirtualNicResponse `xml:"urn:vim25 AddServiceConsoleVirtualNicResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *AddServiceConsoleVirtualNicBody) Fault() *soap.Fault { return b.Fault_ } - -func AddServiceConsoleVirtualNic(ctx context.Context, r soap.RoundTripper, req *types.AddServiceConsoleVirtualNic) (*types.AddServiceConsoleVirtualNicResponse, error) { - var reqBody, resBody AddServiceConsoleVirtualNicBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type AddStandaloneHost_TaskBody struct { - Req *types.AddStandaloneHost_Task `xml:"urn:vim25 AddStandaloneHost_Task,omitempty"` - Res *types.AddStandaloneHost_TaskResponse `xml:"urn:vim25 AddStandaloneHost_TaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *AddStandaloneHost_TaskBody) Fault() *soap.Fault { return b.Fault_ } - -func AddStandaloneHost_Task(ctx context.Context, r soap.RoundTripper, req *types.AddStandaloneHost_Task) (*types.AddStandaloneHost_TaskResponse, error) { - var reqBody, resBody AddStandaloneHost_TaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type AddVirtualNicBody struct { - Req *types.AddVirtualNic `xml:"urn:vim25 AddVirtualNic,omitempty"` - Res *types.AddVirtualNicResponse `xml:"urn:vim25 AddVirtualNicResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *AddVirtualNicBody) Fault() *soap.Fault { return b.Fault_ } - -func AddVirtualNic(ctx context.Context, r soap.RoundTripper, req *types.AddVirtualNic) (*types.AddVirtualNicResponse, error) { - var reqBody, resBody AddVirtualNicBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type AddVirtualSwitchBody struct { - Req *types.AddVirtualSwitch `xml:"urn:vim25 AddVirtualSwitch,omitempty"` - Res *types.AddVirtualSwitchResponse `xml:"urn:vim25 AddVirtualSwitchResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *AddVirtualSwitchBody) Fault() *soap.Fault { return b.Fault_ } - -func AddVirtualSwitch(ctx context.Context, r soap.RoundTripper, req *types.AddVirtualSwitch) (*types.AddVirtualSwitchResponse, error) { - var reqBody, resBody AddVirtualSwitchBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type AllocateIpv4AddressBody struct { - Req *types.AllocateIpv4Address `xml:"urn:vim25 AllocateIpv4Address,omitempty"` - Res *types.AllocateIpv4AddressResponse `xml:"urn:vim25 AllocateIpv4AddressResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *AllocateIpv4AddressBody) Fault() *soap.Fault { return b.Fault_ } - -func AllocateIpv4Address(ctx context.Context, r soap.RoundTripper, req *types.AllocateIpv4Address) (*types.AllocateIpv4AddressResponse, error) { - var reqBody, resBody AllocateIpv4AddressBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type AllocateIpv6AddressBody struct { - Req *types.AllocateIpv6Address `xml:"urn:vim25 AllocateIpv6Address,omitempty"` - Res *types.AllocateIpv6AddressResponse `xml:"urn:vim25 AllocateIpv6AddressResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *AllocateIpv6AddressBody) Fault() *soap.Fault { return b.Fault_ } - -func AllocateIpv6Address(ctx context.Context, r soap.RoundTripper, req *types.AllocateIpv6Address) (*types.AllocateIpv6AddressResponse, error) { - var reqBody, resBody AllocateIpv6AddressBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type AnswerVMBody struct { - Req *types.AnswerVM `xml:"urn:vim25 AnswerVM,omitempty"` - Res *types.AnswerVMResponse `xml:"urn:vim25 AnswerVMResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *AnswerVMBody) Fault() *soap.Fault { return b.Fault_ } - -func AnswerVM(ctx context.Context, r soap.RoundTripper, req *types.AnswerVM) (*types.AnswerVMResponse, error) { - var reqBody, resBody AnswerVMBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type ApplyHostConfig_TaskBody struct { - Req *types.ApplyHostConfig_Task `xml:"urn:vim25 ApplyHostConfig_Task,omitempty"` - Res *types.ApplyHostConfig_TaskResponse `xml:"urn:vim25 ApplyHostConfig_TaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *ApplyHostConfig_TaskBody) Fault() *soap.Fault { return b.Fault_ } - -func ApplyHostConfig_Task(ctx context.Context, r soap.RoundTripper, req *types.ApplyHostConfig_Task) (*types.ApplyHostConfig_TaskResponse, error) { - var reqBody, resBody ApplyHostConfig_TaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type ApplyRecommendationBody struct { - Req *types.ApplyRecommendation `xml:"urn:vim25 ApplyRecommendation,omitempty"` - Res *types.ApplyRecommendationResponse `xml:"urn:vim25 ApplyRecommendationResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *ApplyRecommendationBody) Fault() *soap.Fault { return b.Fault_ } - -func ApplyRecommendation(ctx context.Context, r soap.RoundTripper, req *types.ApplyRecommendation) (*types.ApplyRecommendationResponse, error) { - var reqBody, resBody ApplyRecommendationBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type ApplyStorageDrsRecommendationToPod_TaskBody struct { - Req *types.ApplyStorageDrsRecommendationToPod_Task `xml:"urn:vim25 ApplyStorageDrsRecommendationToPod_Task,omitempty"` - Res *types.ApplyStorageDrsRecommendationToPod_TaskResponse `xml:"urn:vim25 ApplyStorageDrsRecommendationToPod_TaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *ApplyStorageDrsRecommendationToPod_TaskBody) Fault() *soap.Fault { return b.Fault_ } - -func ApplyStorageDrsRecommendationToPod_Task(ctx context.Context, r soap.RoundTripper, req *types.ApplyStorageDrsRecommendationToPod_Task) (*types.ApplyStorageDrsRecommendationToPod_TaskResponse, error) { - var reqBody, resBody ApplyStorageDrsRecommendationToPod_TaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type ApplyStorageDrsRecommendation_TaskBody struct { - Req *types.ApplyStorageDrsRecommendation_Task `xml:"urn:vim25 ApplyStorageDrsRecommendation_Task,omitempty"` - Res *types.ApplyStorageDrsRecommendation_TaskResponse `xml:"urn:vim25 ApplyStorageDrsRecommendation_TaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *ApplyStorageDrsRecommendation_TaskBody) Fault() *soap.Fault { return b.Fault_ } - -func ApplyStorageDrsRecommendation_Task(ctx context.Context, r soap.RoundTripper, req *types.ApplyStorageDrsRecommendation_Task) (*types.ApplyStorageDrsRecommendation_TaskResponse, error) { - var reqBody, resBody ApplyStorageDrsRecommendation_TaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type AreAlarmActionsEnabledBody struct { - Req *types.AreAlarmActionsEnabled `xml:"urn:vim25 AreAlarmActionsEnabled,omitempty"` - Res *types.AreAlarmActionsEnabledResponse `xml:"urn:vim25 AreAlarmActionsEnabledResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *AreAlarmActionsEnabledBody) Fault() *soap.Fault { return b.Fault_ } - -func AreAlarmActionsEnabled(ctx context.Context, r soap.RoundTripper, req *types.AreAlarmActionsEnabled) (*types.AreAlarmActionsEnabledResponse, error) { - var reqBody, resBody AreAlarmActionsEnabledBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type AssignUserToGroupBody struct { - Req *types.AssignUserToGroup `xml:"urn:vim25 AssignUserToGroup,omitempty"` - Res *types.AssignUserToGroupResponse `xml:"urn:vim25 AssignUserToGroupResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *AssignUserToGroupBody) Fault() *soap.Fault { return b.Fault_ } - -func AssignUserToGroup(ctx context.Context, r soap.RoundTripper, req *types.AssignUserToGroup) (*types.AssignUserToGroupResponse, error) { - var reqBody, resBody AssignUserToGroupBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type AssociateProfileBody struct { - Req *types.AssociateProfile `xml:"urn:vim25 AssociateProfile,omitempty"` - Res *types.AssociateProfileResponse `xml:"urn:vim25 AssociateProfileResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *AssociateProfileBody) Fault() *soap.Fault { return b.Fault_ } - -func AssociateProfile(ctx context.Context, r soap.RoundTripper, req *types.AssociateProfile) (*types.AssociateProfileResponse, error) { - var reqBody, resBody AssociateProfileBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type AttachScsiLunBody struct { - Req *types.AttachScsiLun `xml:"urn:vim25 AttachScsiLun,omitempty"` - Res *types.AttachScsiLunResponse `xml:"urn:vim25 AttachScsiLunResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *AttachScsiLunBody) Fault() *soap.Fault { return b.Fault_ } - -func AttachScsiLun(ctx context.Context, r soap.RoundTripper, req *types.AttachScsiLun) (*types.AttachScsiLunResponse, error) { - var reqBody, resBody AttachScsiLunBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type AttachVmfsExtentBody struct { - Req *types.AttachVmfsExtent `xml:"urn:vim25 AttachVmfsExtent,omitempty"` - Res *types.AttachVmfsExtentResponse `xml:"urn:vim25 AttachVmfsExtentResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *AttachVmfsExtentBody) Fault() *soap.Fault { return b.Fault_ } - -func AttachVmfsExtent(ctx context.Context, r soap.RoundTripper, req *types.AttachVmfsExtent) (*types.AttachVmfsExtentResponse, error) { - var reqBody, resBody AttachVmfsExtentBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type AutoStartPowerOffBody struct { - Req *types.AutoStartPowerOff `xml:"urn:vim25 AutoStartPowerOff,omitempty"` - Res *types.AutoStartPowerOffResponse `xml:"urn:vim25 AutoStartPowerOffResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *AutoStartPowerOffBody) Fault() *soap.Fault { return b.Fault_ } - -func AutoStartPowerOff(ctx context.Context, r soap.RoundTripper, req *types.AutoStartPowerOff) (*types.AutoStartPowerOffResponse, error) { - var reqBody, resBody AutoStartPowerOffBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type AutoStartPowerOnBody struct { - Req *types.AutoStartPowerOn `xml:"urn:vim25 AutoStartPowerOn,omitempty"` - Res *types.AutoStartPowerOnResponse `xml:"urn:vim25 AutoStartPowerOnResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *AutoStartPowerOnBody) Fault() *soap.Fault { return b.Fault_ } - -func AutoStartPowerOn(ctx context.Context, r soap.RoundTripper, req *types.AutoStartPowerOn) (*types.AutoStartPowerOnResponse, error) { - var reqBody, resBody AutoStartPowerOnBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type BackupFirmwareConfigurationBody struct { - Req *types.BackupFirmwareConfiguration `xml:"urn:vim25 BackupFirmwareConfiguration,omitempty"` - Res *types.BackupFirmwareConfigurationResponse `xml:"urn:vim25 BackupFirmwareConfigurationResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *BackupFirmwareConfigurationBody) Fault() *soap.Fault { return b.Fault_ } - -func BackupFirmwareConfiguration(ctx context.Context, r soap.RoundTripper, req *types.BackupFirmwareConfiguration) (*types.BackupFirmwareConfigurationResponse, error) { - var reqBody, resBody BackupFirmwareConfigurationBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type BindVnicBody struct { - Req *types.BindVnic `xml:"urn:vim25 BindVnic,omitempty"` - Res *types.BindVnicResponse `xml:"urn:vim25 BindVnicResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *BindVnicBody) Fault() *soap.Fault { return b.Fault_ } - -func BindVnic(ctx context.Context, r soap.RoundTripper, req *types.BindVnic) (*types.BindVnicResponse, error) { - var reqBody, resBody BindVnicBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type BrowseDiagnosticLogBody struct { - Req *types.BrowseDiagnosticLog `xml:"urn:vim25 BrowseDiagnosticLog,omitempty"` - Res *types.BrowseDiagnosticLogResponse `xml:"urn:vim25 BrowseDiagnosticLogResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *BrowseDiagnosticLogBody) Fault() *soap.Fault { return b.Fault_ } - -func BrowseDiagnosticLog(ctx context.Context, r soap.RoundTripper, req *types.BrowseDiagnosticLog) (*types.BrowseDiagnosticLogResponse, error) { - var reqBody, resBody BrowseDiagnosticLogBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type CancelRecommendationBody struct { - Req *types.CancelRecommendation `xml:"urn:vim25 CancelRecommendation,omitempty"` - Res *types.CancelRecommendationResponse `xml:"urn:vim25 CancelRecommendationResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *CancelRecommendationBody) Fault() *soap.Fault { return b.Fault_ } - -func CancelRecommendation(ctx context.Context, r soap.RoundTripper, req *types.CancelRecommendation) (*types.CancelRecommendationResponse, error) { - var reqBody, resBody CancelRecommendationBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type CancelRetrievePropertiesExBody struct { - Req *types.CancelRetrievePropertiesEx `xml:"urn:vim25 CancelRetrievePropertiesEx,omitempty"` - Res *types.CancelRetrievePropertiesExResponse `xml:"urn:vim25 CancelRetrievePropertiesExResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *CancelRetrievePropertiesExBody) Fault() *soap.Fault { return b.Fault_ } - -func CancelRetrievePropertiesEx(ctx context.Context, r soap.RoundTripper, req *types.CancelRetrievePropertiesEx) (*types.CancelRetrievePropertiesExResponse, error) { - var reqBody, resBody CancelRetrievePropertiesExBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type CancelStorageDrsRecommendationBody struct { - Req *types.CancelStorageDrsRecommendation `xml:"urn:vim25 CancelStorageDrsRecommendation,omitempty"` - Res *types.CancelStorageDrsRecommendationResponse `xml:"urn:vim25 CancelStorageDrsRecommendationResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *CancelStorageDrsRecommendationBody) Fault() *soap.Fault { return b.Fault_ } - -func CancelStorageDrsRecommendation(ctx context.Context, r soap.RoundTripper, req *types.CancelStorageDrsRecommendation) (*types.CancelStorageDrsRecommendationResponse, error) { - var reqBody, resBody CancelStorageDrsRecommendationBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type CancelTaskBody struct { - Req *types.CancelTask `xml:"urn:vim25 CancelTask,omitempty"` - Res *types.CancelTaskResponse `xml:"urn:vim25 CancelTaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *CancelTaskBody) Fault() *soap.Fault { return b.Fault_ } - -func CancelTask(ctx context.Context, r soap.RoundTripper, req *types.CancelTask) (*types.CancelTaskResponse, error) { - var reqBody, resBody CancelTaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type CancelWaitForUpdatesBody struct { - Req *types.CancelWaitForUpdates `xml:"urn:vim25 CancelWaitForUpdates,omitempty"` - Res *types.CancelWaitForUpdatesResponse `xml:"urn:vim25 CancelWaitForUpdatesResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *CancelWaitForUpdatesBody) Fault() *soap.Fault { return b.Fault_ } - -func CancelWaitForUpdates(ctx context.Context, r soap.RoundTripper, req *types.CancelWaitForUpdates) (*types.CancelWaitForUpdatesResponse, error) { - var reqBody, resBody CancelWaitForUpdatesBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type ChangeFileAttributesInGuestBody struct { - Req *types.ChangeFileAttributesInGuest `xml:"urn:vim25 ChangeFileAttributesInGuest,omitempty"` - Res *types.ChangeFileAttributesInGuestResponse `xml:"urn:vim25 ChangeFileAttributesInGuestResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *ChangeFileAttributesInGuestBody) Fault() *soap.Fault { return b.Fault_ } - -func ChangeFileAttributesInGuest(ctx context.Context, r soap.RoundTripper, req *types.ChangeFileAttributesInGuest) (*types.ChangeFileAttributesInGuestResponse, error) { - var reqBody, resBody ChangeFileAttributesInGuestBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type ChangeOwnerBody struct { - Req *types.ChangeOwner `xml:"urn:vim25 ChangeOwner,omitempty"` - Res *types.ChangeOwnerResponse `xml:"urn:vim25 ChangeOwnerResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *ChangeOwnerBody) Fault() *soap.Fault { return b.Fault_ } - -func ChangeOwner(ctx context.Context, r soap.RoundTripper, req *types.ChangeOwner) (*types.ChangeOwnerResponse, error) { - var reqBody, resBody ChangeOwnerBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type CheckAnswerFileStatus_TaskBody struct { - Req *types.CheckAnswerFileStatus_Task `xml:"urn:vim25 CheckAnswerFileStatus_Task,omitempty"` - Res *types.CheckAnswerFileStatus_TaskResponse `xml:"urn:vim25 CheckAnswerFileStatus_TaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *CheckAnswerFileStatus_TaskBody) Fault() *soap.Fault { return b.Fault_ } - -func CheckAnswerFileStatus_Task(ctx context.Context, r soap.RoundTripper, req *types.CheckAnswerFileStatus_Task) (*types.CheckAnswerFileStatus_TaskResponse, error) { - var reqBody, resBody CheckAnswerFileStatus_TaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type CheckCompatibility_TaskBody struct { - Req *types.CheckCompatibility_Task `xml:"urn:vim25 CheckCompatibility_Task,omitempty"` - Res *types.CheckCompatibility_TaskResponse `xml:"urn:vim25 CheckCompatibility_TaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *CheckCompatibility_TaskBody) Fault() *soap.Fault { return b.Fault_ } - -func CheckCompatibility_Task(ctx context.Context, r soap.RoundTripper, req *types.CheckCompatibility_Task) (*types.CheckCompatibility_TaskResponse, error) { - var reqBody, resBody CheckCompatibility_TaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type CheckCompliance_TaskBody struct { - Req *types.CheckCompliance_Task `xml:"urn:vim25 CheckCompliance_Task,omitempty"` - Res *types.CheckCompliance_TaskResponse `xml:"urn:vim25 CheckCompliance_TaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *CheckCompliance_TaskBody) Fault() *soap.Fault { return b.Fault_ } - -func CheckCompliance_Task(ctx context.Context, r soap.RoundTripper, req *types.CheckCompliance_Task) (*types.CheckCompliance_TaskResponse, error) { - var reqBody, resBody CheckCompliance_TaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type CheckCustomizationResourcesBody struct { - Req *types.CheckCustomizationResources `xml:"urn:vim25 CheckCustomizationResources,omitempty"` - Res *types.CheckCustomizationResourcesResponse `xml:"urn:vim25 CheckCustomizationResourcesResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *CheckCustomizationResourcesBody) Fault() *soap.Fault { return b.Fault_ } - -func CheckCustomizationResources(ctx context.Context, r soap.RoundTripper, req *types.CheckCustomizationResources) (*types.CheckCustomizationResourcesResponse, error) { - var reqBody, resBody CheckCustomizationResourcesBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type CheckCustomizationSpecBody struct { - Req *types.CheckCustomizationSpec `xml:"urn:vim25 CheckCustomizationSpec,omitempty"` - Res *types.CheckCustomizationSpecResponse `xml:"urn:vim25 CheckCustomizationSpecResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *CheckCustomizationSpecBody) Fault() *soap.Fault { return b.Fault_ } - -func CheckCustomizationSpec(ctx context.Context, r soap.RoundTripper, req *types.CheckCustomizationSpec) (*types.CheckCustomizationSpecResponse, error) { - var reqBody, resBody CheckCustomizationSpecBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type CheckForUpdatesBody struct { - Req *types.CheckForUpdates `xml:"urn:vim25 CheckForUpdates,omitempty"` - Res *types.CheckForUpdatesResponse `xml:"urn:vim25 CheckForUpdatesResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *CheckForUpdatesBody) Fault() *soap.Fault { return b.Fault_ } - -func CheckForUpdates(ctx context.Context, r soap.RoundTripper, req *types.CheckForUpdates) (*types.CheckForUpdatesResponse, error) { - var reqBody, resBody CheckForUpdatesBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type CheckHostPatch_TaskBody struct { - Req *types.CheckHostPatch_Task `xml:"urn:vim25 CheckHostPatch_Task,omitempty"` - Res *types.CheckHostPatch_TaskResponse `xml:"urn:vim25 CheckHostPatch_TaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *CheckHostPatch_TaskBody) Fault() *soap.Fault { return b.Fault_ } - -func CheckHostPatch_Task(ctx context.Context, r soap.RoundTripper, req *types.CheckHostPatch_Task) (*types.CheckHostPatch_TaskResponse, error) { - var reqBody, resBody CheckHostPatch_TaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type CheckLicenseFeatureBody struct { - Req *types.CheckLicenseFeature `xml:"urn:vim25 CheckLicenseFeature,omitempty"` - Res *types.CheckLicenseFeatureResponse `xml:"urn:vim25 CheckLicenseFeatureResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *CheckLicenseFeatureBody) Fault() *soap.Fault { return b.Fault_ } - -func CheckLicenseFeature(ctx context.Context, r soap.RoundTripper, req *types.CheckLicenseFeature) (*types.CheckLicenseFeatureResponse, error) { - var reqBody, resBody CheckLicenseFeatureBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type CheckMigrate_TaskBody struct { - Req *types.CheckMigrate_Task `xml:"urn:vim25 CheckMigrate_Task,omitempty"` - Res *types.CheckMigrate_TaskResponse `xml:"urn:vim25 CheckMigrate_TaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *CheckMigrate_TaskBody) Fault() *soap.Fault { return b.Fault_ } - -func CheckMigrate_Task(ctx context.Context, r soap.RoundTripper, req *types.CheckMigrate_Task) (*types.CheckMigrate_TaskResponse, error) { - var reqBody, resBody CheckMigrate_TaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type CheckProfileCompliance_TaskBody struct { - Req *types.CheckProfileCompliance_Task `xml:"urn:vim25 CheckProfileCompliance_Task,omitempty"` - Res *types.CheckProfileCompliance_TaskResponse `xml:"urn:vim25 CheckProfileCompliance_TaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *CheckProfileCompliance_TaskBody) Fault() *soap.Fault { return b.Fault_ } - -func CheckProfileCompliance_Task(ctx context.Context, r soap.RoundTripper, req *types.CheckProfileCompliance_Task) (*types.CheckProfileCompliance_TaskResponse, error) { - var reqBody, resBody CheckProfileCompliance_TaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type CheckRelocate_TaskBody struct { - Req *types.CheckRelocate_Task `xml:"urn:vim25 CheckRelocate_Task,omitempty"` - Res *types.CheckRelocate_TaskResponse `xml:"urn:vim25 CheckRelocate_TaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *CheckRelocate_TaskBody) Fault() *soap.Fault { return b.Fault_ } - -func CheckRelocate_Task(ctx context.Context, r soap.RoundTripper, req *types.CheckRelocate_Task) (*types.CheckRelocate_TaskResponse, error) { - var reqBody, resBody CheckRelocate_TaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type ClearComplianceStatusBody struct { - Req *types.ClearComplianceStatus `xml:"urn:vim25 ClearComplianceStatus,omitempty"` - Res *types.ClearComplianceStatusResponse `xml:"urn:vim25 ClearComplianceStatusResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *ClearComplianceStatusBody) Fault() *soap.Fault { return b.Fault_ } - -func ClearComplianceStatus(ctx context.Context, r soap.RoundTripper, req *types.ClearComplianceStatus) (*types.ClearComplianceStatusResponse, error) { - var reqBody, resBody ClearComplianceStatusBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type CloneSessionBody struct { - Req *types.CloneSession `xml:"urn:vim25 CloneSession,omitempty"` - Res *types.CloneSessionResponse `xml:"urn:vim25 CloneSessionResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *CloneSessionBody) Fault() *soap.Fault { return b.Fault_ } - -func CloneSession(ctx context.Context, r soap.RoundTripper, req *types.CloneSession) (*types.CloneSessionResponse, error) { - var reqBody, resBody CloneSessionBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type CloneVApp_TaskBody struct { - Req *types.CloneVApp_Task `xml:"urn:vim25 CloneVApp_Task,omitempty"` - Res *types.CloneVApp_TaskResponse `xml:"urn:vim25 CloneVApp_TaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *CloneVApp_TaskBody) Fault() *soap.Fault { return b.Fault_ } - -func CloneVApp_Task(ctx context.Context, r soap.RoundTripper, req *types.CloneVApp_Task) (*types.CloneVApp_TaskResponse, error) { - var reqBody, resBody CloneVApp_TaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type CloneVM_TaskBody struct { - Req *types.CloneVM_Task `xml:"urn:vim25 CloneVM_Task,omitempty"` - Res *types.CloneVM_TaskResponse `xml:"urn:vim25 CloneVM_TaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *CloneVM_TaskBody) Fault() *soap.Fault { return b.Fault_ } - -func CloneVM_Task(ctx context.Context, r soap.RoundTripper, req *types.CloneVM_Task) (*types.CloneVM_TaskResponse, error) { - var reqBody, resBody CloneVM_TaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type CloseInventoryViewFolderBody struct { - Req *types.CloseInventoryViewFolder `xml:"urn:vim25 CloseInventoryViewFolder,omitempty"` - Res *types.CloseInventoryViewFolderResponse `xml:"urn:vim25 CloseInventoryViewFolderResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *CloseInventoryViewFolderBody) Fault() *soap.Fault { return b.Fault_ } - -func CloseInventoryViewFolder(ctx context.Context, r soap.RoundTripper, req *types.CloseInventoryViewFolder) (*types.CloseInventoryViewFolderResponse, error) { - var reqBody, resBody CloseInventoryViewFolderBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type ClusterEnterMaintenanceModeBody struct { - Req *types.ClusterEnterMaintenanceMode `xml:"urn:vim25 ClusterEnterMaintenanceMode,omitempty"` - Res *types.ClusterEnterMaintenanceModeResponse `xml:"urn:vim25 ClusterEnterMaintenanceModeResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *ClusterEnterMaintenanceModeBody) Fault() *soap.Fault { return b.Fault_ } - -func ClusterEnterMaintenanceMode(ctx context.Context, r soap.RoundTripper, req *types.ClusterEnterMaintenanceMode) (*types.ClusterEnterMaintenanceModeResponse, error) { - var reqBody, resBody ClusterEnterMaintenanceModeBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type ComputeDiskPartitionInfoBody struct { - Req *types.ComputeDiskPartitionInfo `xml:"urn:vim25 ComputeDiskPartitionInfo,omitempty"` - Res *types.ComputeDiskPartitionInfoResponse `xml:"urn:vim25 ComputeDiskPartitionInfoResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *ComputeDiskPartitionInfoBody) Fault() *soap.Fault { return b.Fault_ } - -func ComputeDiskPartitionInfo(ctx context.Context, r soap.RoundTripper, req *types.ComputeDiskPartitionInfo) (*types.ComputeDiskPartitionInfoResponse, error) { - var reqBody, resBody ComputeDiskPartitionInfoBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type ComputeDiskPartitionInfoForResizeBody struct { - Req *types.ComputeDiskPartitionInfoForResize `xml:"urn:vim25 ComputeDiskPartitionInfoForResize,omitempty"` - Res *types.ComputeDiskPartitionInfoForResizeResponse `xml:"urn:vim25 ComputeDiskPartitionInfoForResizeResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *ComputeDiskPartitionInfoForResizeBody) Fault() *soap.Fault { return b.Fault_ } - -func ComputeDiskPartitionInfoForResize(ctx context.Context, r soap.RoundTripper, req *types.ComputeDiskPartitionInfoForResize) (*types.ComputeDiskPartitionInfoForResizeResponse, error) { - var reqBody, resBody ComputeDiskPartitionInfoForResizeBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type ConfigureDatastoreIORM_TaskBody struct { - Req *types.ConfigureDatastoreIORM_Task `xml:"urn:vim25 ConfigureDatastoreIORM_Task,omitempty"` - Res *types.ConfigureDatastoreIORM_TaskResponse `xml:"urn:vim25 ConfigureDatastoreIORM_TaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *ConfigureDatastoreIORM_TaskBody) Fault() *soap.Fault { return b.Fault_ } - -func ConfigureDatastoreIORM_Task(ctx context.Context, r soap.RoundTripper, req *types.ConfigureDatastoreIORM_Task) (*types.ConfigureDatastoreIORM_TaskResponse, error) { - var reqBody, resBody ConfigureDatastoreIORM_TaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type ConfigureDatastorePrincipalBody struct { - Req *types.ConfigureDatastorePrincipal `xml:"urn:vim25 ConfigureDatastorePrincipal,omitempty"` - Res *types.ConfigureDatastorePrincipalResponse `xml:"urn:vim25 ConfigureDatastorePrincipalResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *ConfigureDatastorePrincipalBody) Fault() *soap.Fault { return b.Fault_ } - -func ConfigureDatastorePrincipal(ctx context.Context, r soap.RoundTripper, req *types.ConfigureDatastorePrincipal) (*types.ConfigureDatastorePrincipalResponse, error) { - var reqBody, resBody ConfigureDatastorePrincipalBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type ConfigureHostCache_TaskBody struct { - Req *types.ConfigureHostCache_Task `xml:"urn:vim25 ConfigureHostCache_Task,omitempty"` - Res *types.ConfigureHostCache_TaskResponse `xml:"urn:vim25 ConfigureHostCache_TaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *ConfigureHostCache_TaskBody) Fault() *soap.Fault { return b.Fault_ } - -func ConfigureHostCache_Task(ctx context.Context, r soap.RoundTripper, req *types.ConfigureHostCache_Task) (*types.ConfigureHostCache_TaskResponse, error) { - var reqBody, resBody ConfigureHostCache_TaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type ConfigureLicenseSourceBody struct { - Req *types.ConfigureLicenseSource `xml:"urn:vim25 ConfigureLicenseSource,omitempty"` - Res *types.ConfigureLicenseSourceResponse `xml:"urn:vim25 ConfigureLicenseSourceResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *ConfigureLicenseSourceBody) Fault() *soap.Fault { return b.Fault_ } - -func ConfigureLicenseSource(ctx context.Context, r soap.RoundTripper, req *types.ConfigureLicenseSource) (*types.ConfigureLicenseSourceResponse, error) { - var reqBody, resBody ConfigureLicenseSourceBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type ConfigurePowerPolicyBody struct { - Req *types.ConfigurePowerPolicy `xml:"urn:vim25 ConfigurePowerPolicy,omitempty"` - Res *types.ConfigurePowerPolicyResponse `xml:"urn:vim25 ConfigurePowerPolicyResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *ConfigurePowerPolicyBody) Fault() *soap.Fault { return b.Fault_ } - -func ConfigurePowerPolicy(ctx context.Context, r soap.RoundTripper, req *types.ConfigurePowerPolicy) (*types.ConfigurePowerPolicyResponse, error) { - var reqBody, resBody ConfigurePowerPolicyBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type ConfigureStorageDrsForPod_TaskBody struct { - Req *types.ConfigureStorageDrsForPod_Task `xml:"urn:vim25 ConfigureStorageDrsForPod_Task,omitempty"` - Res *types.ConfigureStorageDrsForPod_TaskResponse `xml:"urn:vim25 ConfigureStorageDrsForPod_TaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *ConfigureStorageDrsForPod_TaskBody) Fault() *soap.Fault { return b.Fault_ } - -func ConfigureStorageDrsForPod_Task(ctx context.Context, r soap.RoundTripper, req *types.ConfigureStorageDrsForPod_Task) (*types.ConfigureStorageDrsForPod_TaskResponse, error) { - var reqBody, resBody ConfigureStorageDrsForPod_TaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type ConfigureVFlashResourceEx_TaskBody struct { - Req *types.ConfigureVFlashResourceEx_Task `xml:"urn:vim25 ConfigureVFlashResourceEx_Task,omitempty"` - Res *types.ConfigureVFlashResourceEx_TaskResponse `xml:"urn:vim25 ConfigureVFlashResourceEx_TaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *ConfigureVFlashResourceEx_TaskBody) Fault() *soap.Fault { return b.Fault_ } - -func ConfigureVFlashResourceEx_Task(ctx context.Context, r soap.RoundTripper, req *types.ConfigureVFlashResourceEx_Task) (*types.ConfigureVFlashResourceEx_TaskResponse, error) { - var reqBody, resBody ConfigureVFlashResourceEx_TaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type ConsolidateVMDisks_TaskBody struct { - Req *types.ConsolidateVMDisks_Task `xml:"urn:vim25 ConsolidateVMDisks_Task,omitempty"` - Res *types.ConsolidateVMDisks_TaskResponse `xml:"urn:vim25 ConsolidateVMDisks_TaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *ConsolidateVMDisks_TaskBody) Fault() *soap.Fault { return b.Fault_ } - -func ConsolidateVMDisks_Task(ctx context.Context, r soap.RoundTripper, req *types.ConsolidateVMDisks_Task) (*types.ConsolidateVMDisks_TaskResponse, error) { - var reqBody, resBody ConsolidateVMDisks_TaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type ContinueRetrievePropertiesExBody struct { - Req *types.ContinueRetrievePropertiesEx `xml:"urn:vim25 ContinueRetrievePropertiesEx,omitempty"` - Res *types.ContinueRetrievePropertiesExResponse `xml:"urn:vim25 ContinueRetrievePropertiesExResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *ContinueRetrievePropertiesExBody) Fault() *soap.Fault { return b.Fault_ } - -func ContinueRetrievePropertiesEx(ctx context.Context, r soap.RoundTripper, req *types.ContinueRetrievePropertiesEx) (*types.ContinueRetrievePropertiesExResponse, error) { - var reqBody, resBody ContinueRetrievePropertiesExBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type CopyDatastoreFile_TaskBody struct { - Req *types.CopyDatastoreFile_Task `xml:"urn:vim25 CopyDatastoreFile_Task,omitempty"` - Res *types.CopyDatastoreFile_TaskResponse `xml:"urn:vim25 CopyDatastoreFile_TaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *CopyDatastoreFile_TaskBody) Fault() *soap.Fault { return b.Fault_ } - -func CopyDatastoreFile_Task(ctx context.Context, r soap.RoundTripper, req *types.CopyDatastoreFile_Task) (*types.CopyDatastoreFile_TaskResponse, error) { - var reqBody, resBody CopyDatastoreFile_TaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type CopyVirtualDisk_TaskBody struct { - Req *types.CopyVirtualDisk_Task `xml:"urn:vim25 CopyVirtualDisk_Task,omitempty"` - Res *types.CopyVirtualDisk_TaskResponse `xml:"urn:vim25 CopyVirtualDisk_TaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *CopyVirtualDisk_TaskBody) Fault() *soap.Fault { return b.Fault_ } - -func CopyVirtualDisk_Task(ctx context.Context, r soap.RoundTripper, req *types.CopyVirtualDisk_Task) (*types.CopyVirtualDisk_TaskResponse, error) { - var reqBody, resBody CopyVirtualDisk_TaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type CreateAlarmBody struct { - Req *types.CreateAlarm `xml:"urn:vim25 CreateAlarm,omitempty"` - Res *types.CreateAlarmResponse `xml:"urn:vim25 CreateAlarmResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *CreateAlarmBody) Fault() *soap.Fault { return b.Fault_ } - -func CreateAlarm(ctx context.Context, r soap.RoundTripper, req *types.CreateAlarm) (*types.CreateAlarmResponse, error) { - var reqBody, resBody CreateAlarmBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type CreateChildVM_TaskBody struct { - Req *types.CreateChildVM_Task `xml:"urn:vim25 CreateChildVM_Task,omitempty"` - Res *types.CreateChildVM_TaskResponse `xml:"urn:vim25 CreateChildVM_TaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *CreateChildVM_TaskBody) Fault() *soap.Fault { return b.Fault_ } - -func CreateChildVM_Task(ctx context.Context, r soap.RoundTripper, req *types.CreateChildVM_Task) (*types.CreateChildVM_TaskResponse, error) { - var reqBody, resBody CreateChildVM_TaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type CreateClusterBody struct { - Req *types.CreateCluster `xml:"urn:vim25 CreateCluster,omitempty"` - Res *types.CreateClusterResponse `xml:"urn:vim25 CreateClusterResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *CreateClusterBody) Fault() *soap.Fault { return b.Fault_ } - -func CreateCluster(ctx context.Context, r soap.RoundTripper, req *types.CreateCluster) (*types.CreateClusterResponse, error) { - var reqBody, resBody CreateClusterBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type CreateClusterExBody struct { - Req *types.CreateClusterEx `xml:"urn:vim25 CreateClusterEx,omitempty"` - Res *types.CreateClusterExResponse `xml:"urn:vim25 CreateClusterExResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *CreateClusterExBody) Fault() *soap.Fault { return b.Fault_ } - -func CreateClusterEx(ctx context.Context, r soap.RoundTripper, req *types.CreateClusterEx) (*types.CreateClusterExResponse, error) { - var reqBody, resBody CreateClusterExBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type CreateCollectorForEventsBody struct { - Req *types.CreateCollectorForEvents `xml:"urn:vim25 CreateCollectorForEvents,omitempty"` - Res *types.CreateCollectorForEventsResponse `xml:"urn:vim25 CreateCollectorForEventsResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *CreateCollectorForEventsBody) Fault() *soap.Fault { return b.Fault_ } - -func CreateCollectorForEvents(ctx context.Context, r soap.RoundTripper, req *types.CreateCollectorForEvents) (*types.CreateCollectorForEventsResponse, error) { - var reqBody, resBody CreateCollectorForEventsBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type CreateCollectorForTasksBody struct { - Req *types.CreateCollectorForTasks `xml:"urn:vim25 CreateCollectorForTasks,omitempty"` - Res *types.CreateCollectorForTasksResponse `xml:"urn:vim25 CreateCollectorForTasksResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *CreateCollectorForTasksBody) Fault() *soap.Fault { return b.Fault_ } - -func CreateCollectorForTasks(ctx context.Context, r soap.RoundTripper, req *types.CreateCollectorForTasks) (*types.CreateCollectorForTasksResponse, error) { - var reqBody, resBody CreateCollectorForTasksBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type CreateContainerViewBody struct { - Req *types.CreateContainerView `xml:"urn:vim25 CreateContainerView,omitempty"` - Res *types.CreateContainerViewResponse `xml:"urn:vim25 CreateContainerViewResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *CreateContainerViewBody) Fault() *soap.Fault { return b.Fault_ } - -func CreateContainerView(ctx context.Context, r soap.RoundTripper, req *types.CreateContainerView) (*types.CreateContainerViewResponse, error) { - var reqBody, resBody CreateContainerViewBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type CreateCustomizationSpecBody struct { - Req *types.CreateCustomizationSpec `xml:"urn:vim25 CreateCustomizationSpec,omitempty"` - Res *types.CreateCustomizationSpecResponse `xml:"urn:vim25 CreateCustomizationSpecResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *CreateCustomizationSpecBody) Fault() *soap.Fault { return b.Fault_ } - -func CreateCustomizationSpec(ctx context.Context, r soap.RoundTripper, req *types.CreateCustomizationSpec) (*types.CreateCustomizationSpecResponse, error) { - var reqBody, resBody CreateCustomizationSpecBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type CreateDVPortgroup_TaskBody struct { - Req *types.CreateDVPortgroup_Task `xml:"urn:vim25 CreateDVPortgroup_Task,omitempty"` - Res *types.CreateDVPortgroup_TaskResponse `xml:"urn:vim25 CreateDVPortgroup_TaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *CreateDVPortgroup_TaskBody) Fault() *soap.Fault { return b.Fault_ } - -func CreateDVPortgroup_Task(ctx context.Context, r soap.RoundTripper, req *types.CreateDVPortgroup_Task) (*types.CreateDVPortgroup_TaskResponse, error) { - var reqBody, resBody CreateDVPortgroup_TaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type CreateDVS_TaskBody struct { - Req *types.CreateDVS_Task `xml:"urn:vim25 CreateDVS_Task,omitempty"` - Res *types.CreateDVS_TaskResponse `xml:"urn:vim25 CreateDVS_TaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *CreateDVS_TaskBody) Fault() *soap.Fault { return b.Fault_ } - -func CreateDVS_Task(ctx context.Context, r soap.RoundTripper, req *types.CreateDVS_Task) (*types.CreateDVS_TaskResponse, error) { - var reqBody, resBody CreateDVS_TaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type CreateDatacenterBody struct { - Req *types.CreateDatacenter `xml:"urn:vim25 CreateDatacenter,omitempty"` - Res *types.CreateDatacenterResponse `xml:"urn:vim25 CreateDatacenterResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *CreateDatacenterBody) Fault() *soap.Fault { return b.Fault_ } - -func CreateDatacenter(ctx context.Context, r soap.RoundTripper, req *types.CreateDatacenter) (*types.CreateDatacenterResponse, error) { - var reqBody, resBody CreateDatacenterBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type CreateDefaultProfileBody struct { - Req *types.CreateDefaultProfile `xml:"urn:vim25 CreateDefaultProfile,omitempty"` - Res *types.CreateDefaultProfileResponse `xml:"urn:vim25 CreateDefaultProfileResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *CreateDefaultProfileBody) Fault() *soap.Fault { return b.Fault_ } - -func CreateDefaultProfile(ctx context.Context, r soap.RoundTripper, req *types.CreateDefaultProfile) (*types.CreateDefaultProfileResponse, error) { - var reqBody, resBody CreateDefaultProfileBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type CreateDescriptorBody struct { - Req *types.CreateDescriptor `xml:"urn:vim25 CreateDescriptor,omitempty"` - Res *types.CreateDescriptorResponse `xml:"urn:vim25 CreateDescriptorResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *CreateDescriptorBody) Fault() *soap.Fault { return b.Fault_ } - -func CreateDescriptor(ctx context.Context, r soap.RoundTripper, req *types.CreateDescriptor) (*types.CreateDescriptorResponse, error) { - var reqBody, resBody CreateDescriptorBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type CreateDiagnosticPartitionBody struct { - Req *types.CreateDiagnosticPartition `xml:"urn:vim25 CreateDiagnosticPartition,omitempty"` - Res *types.CreateDiagnosticPartitionResponse `xml:"urn:vim25 CreateDiagnosticPartitionResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *CreateDiagnosticPartitionBody) Fault() *soap.Fault { return b.Fault_ } - -func CreateDiagnosticPartition(ctx context.Context, r soap.RoundTripper, req *types.CreateDiagnosticPartition) (*types.CreateDiagnosticPartitionResponse, error) { - var reqBody, resBody CreateDiagnosticPartitionBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type CreateDirectoryBody struct { - Req *types.CreateDirectory `xml:"urn:vim25 CreateDirectory,omitempty"` - Res *types.CreateDirectoryResponse `xml:"urn:vim25 CreateDirectoryResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *CreateDirectoryBody) Fault() *soap.Fault { return b.Fault_ } - -func CreateDirectory(ctx context.Context, r soap.RoundTripper, req *types.CreateDirectory) (*types.CreateDirectoryResponse, error) { - var reqBody, resBody CreateDirectoryBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type CreateFilterBody struct { - Req *types.CreateFilter `xml:"urn:vim25 CreateFilter,omitempty"` - Res *types.CreateFilterResponse `xml:"urn:vim25 CreateFilterResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *CreateFilterBody) Fault() *soap.Fault { return b.Fault_ } - -func CreateFilter(ctx context.Context, r soap.RoundTripper, req *types.CreateFilter) (*types.CreateFilterResponse, error) { - var reqBody, resBody CreateFilterBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type CreateFolderBody struct { - Req *types.CreateFolder `xml:"urn:vim25 CreateFolder,omitempty"` - Res *types.CreateFolderResponse `xml:"urn:vim25 CreateFolderResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *CreateFolderBody) Fault() *soap.Fault { return b.Fault_ } - -func CreateFolder(ctx context.Context, r soap.RoundTripper, req *types.CreateFolder) (*types.CreateFolderResponse, error) { - var reqBody, resBody CreateFolderBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type CreateGroupBody struct { - Req *types.CreateGroup `xml:"urn:vim25 CreateGroup,omitempty"` - Res *types.CreateGroupResponse `xml:"urn:vim25 CreateGroupResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *CreateGroupBody) Fault() *soap.Fault { return b.Fault_ } - -func CreateGroup(ctx context.Context, r soap.RoundTripper, req *types.CreateGroup) (*types.CreateGroupResponse, error) { - var reqBody, resBody CreateGroupBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type CreateImportSpecBody struct { - Req *types.CreateImportSpec `xml:"urn:vim25 CreateImportSpec,omitempty"` - Res *types.CreateImportSpecResponse `xml:"urn:vim25 CreateImportSpecResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *CreateImportSpecBody) Fault() *soap.Fault { return b.Fault_ } - -func CreateImportSpec(ctx context.Context, r soap.RoundTripper, req *types.CreateImportSpec) (*types.CreateImportSpecResponse, error) { - var reqBody, resBody CreateImportSpecBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type CreateInventoryViewBody struct { - Req *types.CreateInventoryView `xml:"urn:vim25 CreateInventoryView,omitempty"` - Res *types.CreateInventoryViewResponse `xml:"urn:vim25 CreateInventoryViewResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *CreateInventoryViewBody) Fault() *soap.Fault { return b.Fault_ } - -func CreateInventoryView(ctx context.Context, r soap.RoundTripper, req *types.CreateInventoryView) (*types.CreateInventoryViewResponse, error) { - var reqBody, resBody CreateInventoryViewBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type CreateIpPoolBody struct { - Req *types.CreateIpPool `xml:"urn:vim25 CreateIpPool,omitempty"` - Res *types.CreateIpPoolResponse `xml:"urn:vim25 CreateIpPoolResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *CreateIpPoolBody) Fault() *soap.Fault { return b.Fault_ } - -func CreateIpPool(ctx context.Context, r soap.RoundTripper, req *types.CreateIpPool) (*types.CreateIpPoolResponse, error) { - var reqBody, resBody CreateIpPoolBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type CreateListViewBody struct { - Req *types.CreateListView `xml:"urn:vim25 CreateListView,omitempty"` - Res *types.CreateListViewResponse `xml:"urn:vim25 CreateListViewResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *CreateListViewBody) Fault() *soap.Fault { return b.Fault_ } - -func CreateListView(ctx context.Context, r soap.RoundTripper, req *types.CreateListView) (*types.CreateListViewResponse, error) { - var reqBody, resBody CreateListViewBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type CreateListViewFromViewBody struct { - Req *types.CreateListViewFromView `xml:"urn:vim25 CreateListViewFromView,omitempty"` - Res *types.CreateListViewFromViewResponse `xml:"urn:vim25 CreateListViewFromViewResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *CreateListViewFromViewBody) Fault() *soap.Fault { return b.Fault_ } - -func CreateListViewFromView(ctx context.Context, r soap.RoundTripper, req *types.CreateListViewFromView) (*types.CreateListViewFromViewResponse, error) { - var reqBody, resBody CreateListViewFromViewBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type CreateLocalDatastoreBody struct { - Req *types.CreateLocalDatastore `xml:"urn:vim25 CreateLocalDatastore,omitempty"` - Res *types.CreateLocalDatastoreResponse `xml:"urn:vim25 CreateLocalDatastoreResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *CreateLocalDatastoreBody) Fault() *soap.Fault { return b.Fault_ } - -func CreateLocalDatastore(ctx context.Context, r soap.RoundTripper, req *types.CreateLocalDatastore) (*types.CreateLocalDatastoreResponse, error) { - var reqBody, resBody CreateLocalDatastoreBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type CreateNasDatastoreBody struct { - Req *types.CreateNasDatastore `xml:"urn:vim25 CreateNasDatastore,omitempty"` - Res *types.CreateNasDatastoreResponse `xml:"urn:vim25 CreateNasDatastoreResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *CreateNasDatastoreBody) Fault() *soap.Fault { return b.Fault_ } - -func CreateNasDatastore(ctx context.Context, r soap.RoundTripper, req *types.CreateNasDatastore) (*types.CreateNasDatastoreResponse, error) { - var reqBody, resBody CreateNasDatastoreBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type CreateObjectScheduledTaskBody struct { - Req *types.CreateObjectScheduledTask `xml:"urn:vim25 CreateObjectScheduledTask,omitempty"` - Res *types.CreateObjectScheduledTaskResponse `xml:"urn:vim25 CreateObjectScheduledTaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *CreateObjectScheduledTaskBody) Fault() *soap.Fault { return b.Fault_ } - -func CreateObjectScheduledTask(ctx context.Context, r soap.RoundTripper, req *types.CreateObjectScheduledTask) (*types.CreateObjectScheduledTaskResponse, error) { - var reqBody, resBody CreateObjectScheduledTaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type CreatePerfIntervalBody struct { - Req *types.CreatePerfInterval `xml:"urn:vim25 CreatePerfInterval,omitempty"` - Res *types.CreatePerfIntervalResponse `xml:"urn:vim25 CreatePerfIntervalResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *CreatePerfIntervalBody) Fault() *soap.Fault { return b.Fault_ } - -func CreatePerfInterval(ctx context.Context, r soap.RoundTripper, req *types.CreatePerfInterval) (*types.CreatePerfIntervalResponse, error) { - var reqBody, resBody CreatePerfIntervalBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type CreateProfileBody struct { - Req *types.CreateProfile `xml:"urn:vim25 CreateProfile,omitempty"` - Res *types.CreateProfileResponse `xml:"urn:vim25 CreateProfileResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *CreateProfileBody) Fault() *soap.Fault { return b.Fault_ } - -func CreateProfile(ctx context.Context, r soap.RoundTripper, req *types.CreateProfile) (*types.CreateProfileResponse, error) { - var reqBody, resBody CreateProfileBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type CreatePropertyCollectorBody struct { - Req *types.CreatePropertyCollector `xml:"urn:vim25 CreatePropertyCollector,omitempty"` - Res *types.CreatePropertyCollectorResponse `xml:"urn:vim25 CreatePropertyCollectorResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *CreatePropertyCollectorBody) Fault() *soap.Fault { return b.Fault_ } - -func CreatePropertyCollector(ctx context.Context, r soap.RoundTripper, req *types.CreatePropertyCollector) (*types.CreatePropertyCollectorResponse, error) { - var reqBody, resBody CreatePropertyCollectorBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type CreateResourcePoolBody struct { - Req *types.CreateResourcePool `xml:"urn:vim25 CreateResourcePool,omitempty"` - Res *types.CreateResourcePoolResponse `xml:"urn:vim25 CreateResourcePoolResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *CreateResourcePoolBody) Fault() *soap.Fault { return b.Fault_ } - -func CreateResourcePool(ctx context.Context, r soap.RoundTripper, req *types.CreateResourcePool) (*types.CreateResourcePoolResponse, error) { - var reqBody, resBody CreateResourcePoolBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type CreateScheduledTaskBody struct { - Req *types.CreateScheduledTask `xml:"urn:vim25 CreateScheduledTask,omitempty"` - Res *types.CreateScheduledTaskResponse `xml:"urn:vim25 CreateScheduledTaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *CreateScheduledTaskBody) Fault() *soap.Fault { return b.Fault_ } - -func CreateScheduledTask(ctx context.Context, r soap.RoundTripper, req *types.CreateScheduledTask) (*types.CreateScheduledTaskResponse, error) { - var reqBody, resBody CreateScheduledTaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type CreateScreenshot_TaskBody struct { - Req *types.CreateScreenshot_Task `xml:"urn:vim25 CreateScreenshot_Task,omitempty"` - Res *types.CreateScreenshot_TaskResponse `xml:"urn:vim25 CreateScreenshot_TaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *CreateScreenshot_TaskBody) Fault() *soap.Fault { return b.Fault_ } - -func CreateScreenshot_Task(ctx context.Context, r soap.RoundTripper, req *types.CreateScreenshot_Task) (*types.CreateScreenshot_TaskResponse, error) { - var reqBody, resBody CreateScreenshot_TaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type CreateSecondaryVM_TaskBody struct { - Req *types.CreateSecondaryVM_Task `xml:"urn:vim25 CreateSecondaryVM_Task,omitempty"` - Res *types.CreateSecondaryVM_TaskResponse `xml:"urn:vim25 CreateSecondaryVM_TaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *CreateSecondaryVM_TaskBody) Fault() *soap.Fault { return b.Fault_ } - -func CreateSecondaryVM_Task(ctx context.Context, r soap.RoundTripper, req *types.CreateSecondaryVM_Task) (*types.CreateSecondaryVM_TaskResponse, error) { - var reqBody, resBody CreateSecondaryVM_TaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type CreateSnapshot_TaskBody struct { - Req *types.CreateSnapshot_Task `xml:"urn:vim25 CreateSnapshot_Task,omitempty"` - Res *types.CreateSnapshot_TaskResponse `xml:"urn:vim25 CreateSnapshot_TaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *CreateSnapshot_TaskBody) Fault() *soap.Fault { return b.Fault_ } - -func CreateSnapshot_Task(ctx context.Context, r soap.RoundTripper, req *types.CreateSnapshot_Task) (*types.CreateSnapshot_TaskResponse, error) { - var reqBody, resBody CreateSnapshot_TaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type CreateStoragePodBody struct { - Req *types.CreateStoragePod `xml:"urn:vim25 CreateStoragePod,omitempty"` - Res *types.CreateStoragePodResponse `xml:"urn:vim25 CreateStoragePodResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *CreateStoragePodBody) Fault() *soap.Fault { return b.Fault_ } - -func CreateStoragePod(ctx context.Context, r soap.RoundTripper, req *types.CreateStoragePod) (*types.CreateStoragePodResponse, error) { - var reqBody, resBody CreateStoragePodBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type CreateTaskBody struct { - Req *types.CreateTask `xml:"urn:vim25 CreateTask,omitempty"` - Res *types.CreateTaskResponse `xml:"urn:vim25 CreateTaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *CreateTaskBody) Fault() *soap.Fault { return b.Fault_ } - -func CreateTask(ctx context.Context, r soap.RoundTripper, req *types.CreateTask) (*types.CreateTaskResponse, error) { - var reqBody, resBody CreateTaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type CreateTemporaryDirectoryInGuestBody struct { - Req *types.CreateTemporaryDirectoryInGuest `xml:"urn:vim25 CreateTemporaryDirectoryInGuest,omitempty"` - Res *types.CreateTemporaryDirectoryInGuestResponse `xml:"urn:vim25 CreateTemporaryDirectoryInGuestResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *CreateTemporaryDirectoryInGuestBody) Fault() *soap.Fault { return b.Fault_ } - -func CreateTemporaryDirectoryInGuest(ctx context.Context, r soap.RoundTripper, req *types.CreateTemporaryDirectoryInGuest) (*types.CreateTemporaryDirectoryInGuestResponse, error) { - var reqBody, resBody CreateTemporaryDirectoryInGuestBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type CreateTemporaryFileInGuestBody struct { - Req *types.CreateTemporaryFileInGuest `xml:"urn:vim25 CreateTemporaryFileInGuest,omitempty"` - Res *types.CreateTemporaryFileInGuestResponse `xml:"urn:vim25 CreateTemporaryFileInGuestResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *CreateTemporaryFileInGuestBody) Fault() *soap.Fault { return b.Fault_ } - -func CreateTemporaryFileInGuest(ctx context.Context, r soap.RoundTripper, req *types.CreateTemporaryFileInGuest) (*types.CreateTemporaryFileInGuestResponse, error) { - var reqBody, resBody CreateTemporaryFileInGuestBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type CreateUserBody struct { - Req *types.CreateUser `xml:"urn:vim25 CreateUser,omitempty"` - Res *types.CreateUserResponse `xml:"urn:vim25 CreateUserResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *CreateUserBody) Fault() *soap.Fault { return b.Fault_ } - -func CreateUser(ctx context.Context, r soap.RoundTripper, req *types.CreateUser) (*types.CreateUserResponse, error) { - var reqBody, resBody CreateUserBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type CreateVAppBody struct { - Req *types.CreateVApp `xml:"urn:vim25 CreateVApp,omitempty"` - Res *types.CreateVAppResponse `xml:"urn:vim25 CreateVAppResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *CreateVAppBody) Fault() *soap.Fault { return b.Fault_ } - -func CreateVApp(ctx context.Context, r soap.RoundTripper, req *types.CreateVApp) (*types.CreateVAppResponse, error) { - var reqBody, resBody CreateVAppBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type CreateVM_TaskBody struct { - Req *types.CreateVM_Task `xml:"urn:vim25 CreateVM_Task,omitempty"` - Res *types.CreateVM_TaskResponse `xml:"urn:vim25 CreateVM_TaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *CreateVM_TaskBody) Fault() *soap.Fault { return b.Fault_ } - -func CreateVM_Task(ctx context.Context, r soap.RoundTripper, req *types.CreateVM_Task) (*types.CreateVM_TaskResponse, error) { - var reqBody, resBody CreateVM_TaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type CreateVirtualDisk_TaskBody struct { - Req *types.CreateVirtualDisk_Task `xml:"urn:vim25 CreateVirtualDisk_Task,omitempty"` - Res *types.CreateVirtualDisk_TaskResponse `xml:"urn:vim25 CreateVirtualDisk_TaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *CreateVirtualDisk_TaskBody) Fault() *soap.Fault { return b.Fault_ } - -func CreateVirtualDisk_Task(ctx context.Context, r soap.RoundTripper, req *types.CreateVirtualDisk_Task) (*types.CreateVirtualDisk_TaskResponse, error) { - var reqBody, resBody CreateVirtualDisk_TaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type CreateVmfsDatastoreBody struct { - Req *types.CreateVmfsDatastore `xml:"urn:vim25 CreateVmfsDatastore,omitempty"` - Res *types.CreateVmfsDatastoreResponse `xml:"urn:vim25 CreateVmfsDatastoreResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *CreateVmfsDatastoreBody) Fault() *soap.Fault { return b.Fault_ } - -func CreateVmfsDatastore(ctx context.Context, r soap.RoundTripper, req *types.CreateVmfsDatastore) (*types.CreateVmfsDatastoreResponse, error) { - var reqBody, resBody CreateVmfsDatastoreBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type CurrentTimeBody struct { - Req *types.CurrentTime `xml:"urn:vim25 CurrentTime,omitempty"` - Res *types.CurrentTimeResponse `xml:"urn:vim25 CurrentTimeResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *CurrentTimeBody) Fault() *soap.Fault { return b.Fault_ } - -func CurrentTime(ctx context.Context, r soap.RoundTripper, req *types.CurrentTime) (*types.CurrentTimeResponse, error) { - var reqBody, resBody CurrentTimeBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type CustomizationSpecItemToXmlBody struct { - Req *types.CustomizationSpecItemToXml `xml:"urn:vim25 CustomizationSpecItemToXml,omitempty"` - Res *types.CustomizationSpecItemToXmlResponse `xml:"urn:vim25 CustomizationSpecItemToXmlResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *CustomizationSpecItemToXmlBody) Fault() *soap.Fault { return b.Fault_ } - -func CustomizationSpecItemToXml(ctx context.Context, r soap.RoundTripper, req *types.CustomizationSpecItemToXml) (*types.CustomizationSpecItemToXmlResponse, error) { - var reqBody, resBody CustomizationSpecItemToXmlBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type CustomizeVM_TaskBody struct { - Req *types.CustomizeVM_Task `xml:"urn:vim25 CustomizeVM_Task,omitempty"` - Res *types.CustomizeVM_TaskResponse `xml:"urn:vim25 CustomizeVM_TaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *CustomizeVM_TaskBody) Fault() *soap.Fault { return b.Fault_ } - -func CustomizeVM_Task(ctx context.Context, r soap.RoundTripper, req *types.CustomizeVM_Task) (*types.CustomizeVM_TaskResponse, error) { - var reqBody, resBody CustomizeVM_TaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type DVPortgroupRollback_TaskBody struct { - Req *types.DVPortgroupRollback_Task `xml:"urn:vim25 DVPortgroupRollback_Task,omitempty"` - Res *types.DVPortgroupRollback_TaskResponse `xml:"urn:vim25 DVPortgroupRollback_TaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *DVPortgroupRollback_TaskBody) Fault() *soap.Fault { return b.Fault_ } - -func DVPortgroupRollback_Task(ctx context.Context, r soap.RoundTripper, req *types.DVPortgroupRollback_Task) (*types.DVPortgroupRollback_TaskResponse, error) { - var reqBody, resBody DVPortgroupRollback_TaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type DVSManagerExportEntity_TaskBody struct { - Req *types.DVSManagerExportEntity_Task `xml:"urn:vim25 DVSManagerExportEntity_Task,omitempty"` - Res *types.DVSManagerExportEntity_TaskResponse `xml:"urn:vim25 DVSManagerExportEntity_TaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *DVSManagerExportEntity_TaskBody) Fault() *soap.Fault { return b.Fault_ } - -func DVSManagerExportEntity_Task(ctx context.Context, r soap.RoundTripper, req *types.DVSManagerExportEntity_Task) (*types.DVSManagerExportEntity_TaskResponse, error) { - var reqBody, resBody DVSManagerExportEntity_TaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type DVSManagerImportEntity_TaskBody struct { - Req *types.DVSManagerImportEntity_Task `xml:"urn:vim25 DVSManagerImportEntity_Task,omitempty"` - Res *types.DVSManagerImportEntity_TaskResponse `xml:"urn:vim25 DVSManagerImportEntity_TaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *DVSManagerImportEntity_TaskBody) Fault() *soap.Fault { return b.Fault_ } - -func DVSManagerImportEntity_Task(ctx context.Context, r soap.RoundTripper, req *types.DVSManagerImportEntity_Task) (*types.DVSManagerImportEntity_TaskResponse, error) { - var reqBody, resBody DVSManagerImportEntity_TaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type DVSManagerLookupDvPortGroupBody struct { - Req *types.DVSManagerLookupDvPortGroup `xml:"urn:vim25 DVSManagerLookupDvPortGroup,omitempty"` - Res *types.DVSManagerLookupDvPortGroupResponse `xml:"urn:vim25 DVSManagerLookupDvPortGroupResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *DVSManagerLookupDvPortGroupBody) Fault() *soap.Fault { return b.Fault_ } - -func DVSManagerLookupDvPortGroup(ctx context.Context, r soap.RoundTripper, req *types.DVSManagerLookupDvPortGroup) (*types.DVSManagerLookupDvPortGroupResponse, error) { - var reqBody, resBody DVSManagerLookupDvPortGroupBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type DVSRollback_TaskBody struct { - Req *types.DVSRollback_Task `xml:"urn:vim25 DVSRollback_Task,omitempty"` - Res *types.DVSRollback_TaskResponse `xml:"urn:vim25 DVSRollback_TaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *DVSRollback_TaskBody) Fault() *soap.Fault { return b.Fault_ } - -func DVSRollback_Task(ctx context.Context, r soap.RoundTripper, req *types.DVSRollback_Task) (*types.DVSRollback_TaskResponse, error) { - var reqBody, resBody DVSRollback_TaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type DatastoreEnterMaintenanceModeBody struct { - Req *types.DatastoreEnterMaintenanceMode `xml:"urn:vim25 DatastoreEnterMaintenanceMode,omitempty"` - Res *types.DatastoreEnterMaintenanceModeResponse `xml:"urn:vim25 DatastoreEnterMaintenanceModeResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *DatastoreEnterMaintenanceModeBody) Fault() *soap.Fault { return b.Fault_ } - -func DatastoreEnterMaintenanceMode(ctx context.Context, r soap.RoundTripper, req *types.DatastoreEnterMaintenanceMode) (*types.DatastoreEnterMaintenanceModeResponse, error) { - var reqBody, resBody DatastoreEnterMaintenanceModeBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type DatastoreExitMaintenanceMode_TaskBody struct { - Req *types.DatastoreExitMaintenanceMode_Task `xml:"urn:vim25 DatastoreExitMaintenanceMode_Task,omitempty"` - Res *types.DatastoreExitMaintenanceMode_TaskResponse `xml:"urn:vim25 DatastoreExitMaintenanceMode_TaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *DatastoreExitMaintenanceMode_TaskBody) Fault() *soap.Fault { return b.Fault_ } - -func DatastoreExitMaintenanceMode_Task(ctx context.Context, r soap.RoundTripper, req *types.DatastoreExitMaintenanceMode_Task) (*types.DatastoreExitMaintenanceMode_TaskResponse, error) { - var reqBody, resBody DatastoreExitMaintenanceMode_TaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type DecodeLicenseBody struct { - Req *types.DecodeLicense `xml:"urn:vim25 DecodeLicense,omitempty"` - Res *types.DecodeLicenseResponse `xml:"urn:vim25 DecodeLicenseResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *DecodeLicenseBody) Fault() *soap.Fault { return b.Fault_ } - -func DecodeLicense(ctx context.Context, r soap.RoundTripper, req *types.DecodeLicense) (*types.DecodeLicenseResponse, error) { - var reqBody, resBody DecodeLicenseBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type DefragmentAllDisksBody struct { - Req *types.DefragmentAllDisks `xml:"urn:vim25 DefragmentAllDisks,omitempty"` - Res *types.DefragmentAllDisksResponse `xml:"urn:vim25 DefragmentAllDisksResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *DefragmentAllDisksBody) Fault() *soap.Fault { return b.Fault_ } - -func DefragmentAllDisks(ctx context.Context, r soap.RoundTripper, req *types.DefragmentAllDisks) (*types.DefragmentAllDisksResponse, error) { - var reqBody, resBody DefragmentAllDisksBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type DefragmentVirtualDisk_TaskBody struct { - Req *types.DefragmentVirtualDisk_Task `xml:"urn:vim25 DefragmentVirtualDisk_Task,omitempty"` - Res *types.DefragmentVirtualDisk_TaskResponse `xml:"urn:vim25 DefragmentVirtualDisk_TaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *DefragmentVirtualDisk_TaskBody) Fault() *soap.Fault { return b.Fault_ } - -func DefragmentVirtualDisk_Task(ctx context.Context, r soap.RoundTripper, req *types.DefragmentVirtualDisk_Task) (*types.DefragmentVirtualDisk_TaskResponse, error) { - var reqBody, resBody DefragmentVirtualDisk_TaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type DeleteCustomizationSpecBody struct { - Req *types.DeleteCustomizationSpec `xml:"urn:vim25 DeleteCustomizationSpec,omitempty"` - Res *types.DeleteCustomizationSpecResponse `xml:"urn:vim25 DeleteCustomizationSpecResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *DeleteCustomizationSpecBody) Fault() *soap.Fault { return b.Fault_ } - -func DeleteCustomizationSpec(ctx context.Context, r soap.RoundTripper, req *types.DeleteCustomizationSpec) (*types.DeleteCustomizationSpecResponse, error) { - var reqBody, resBody DeleteCustomizationSpecBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type DeleteDatastoreFile_TaskBody struct { - Req *types.DeleteDatastoreFile_Task `xml:"urn:vim25 DeleteDatastoreFile_Task,omitempty"` - Res *types.DeleteDatastoreFile_TaskResponse `xml:"urn:vim25 DeleteDatastoreFile_TaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *DeleteDatastoreFile_TaskBody) Fault() *soap.Fault { return b.Fault_ } - -func DeleteDatastoreFile_Task(ctx context.Context, r soap.RoundTripper, req *types.DeleteDatastoreFile_Task) (*types.DeleteDatastoreFile_TaskResponse, error) { - var reqBody, resBody DeleteDatastoreFile_TaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type DeleteDirectoryBody struct { - Req *types.DeleteDirectory `xml:"urn:vim25 DeleteDirectory,omitempty"` - Res *types.DeleteDirectoryResponse `xml:"urn:vim25 DeleteDirectoryResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *DeleteDirectoryBody) Fault() *soap.Fault { return b.Fault_ } - -func DeleteDirectory(ctx context.Context, r soap.RoundTripper, req *types.DeleteDirectory) (*types.DeleteDirectoryResponse, error) { - var reqBody, resBody DeleteDirectoryBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type DeleteDirectoryInGuestBody struct { - Req *types.DeleteDirectoryInGuest `xml:"urn:vim25 DeleteDirectoryInGuest,omitempty"` - Res *types.DeleteDirectoryInGuestResponse `xml:"urn:vim25 DeleteDirectoryInGuestResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *DeleteDirectoryInGuestBody) Fault() *soap.Fault { return b.Fault_ } - -func DeleteDirectoryInGuest(ctx context.Context, r soap.RoundTripper, req *types.DeleteDirectoryInGuest) (*types.DeleteDirectoryInGuestResponse, error) { - var reqBody, resBody DeleteDirectoryInGuestBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type DeleteFileBody struct { - Req *types.DeleteFile `xml:"urn:vim25 DeleteFile,omitempty"` - Res *types.DeleteFileResponse `xml:"urn:vim25 DeleteFileResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *DeleteFileBody) Fault() *soap.Fault { return b.Fault_ } - -func DeleteFile(ctx context.Context, r soap.RoundTripper, req *types.DeleteFile) (*types.DeleteFileResponse, error) { - var reqBody, resBody DeleteFileBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type DeleteFileInGuestBody struct { - Req *types.DeleteFileInGuest `xml:"urn:vim25 DeleteFileInGuest,omitempty"` - Res *types.DeleteFileInGuestResponse `xml:"urn:vim25 DeleteFileInGuestResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *DeleteFileInGuestBody) Fault() *soap.Fault { return b.Fault_ } - -func DeleteFileInGuest(ctx context.Context, r soap.RoundTripper, req *types.DeleteFileInGuest) (*types.DeleteFileInGuestResponse, error) { - var reqBody, resBody DeleteFileInGuestBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type DeleteScsiLunStateBody struct { - Req *types.DeleteScsiLunState `xml:"urn:vim25 DeleteScsiLunState,omitempty"` - Res *types.DeleteScsiLunStateResponse `xml:"urn:vim25 DeleteScsiLunStateResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *DeleteScsiLunStateBody) Fault() *soap.Fault { return b.Fault_ } - -func DeleteScsiLunState(ctx context.Context, r soap.RoundTripper, req *types.DeleteScsiLunState) (*types.DeleteScsiLunStateResponse, error) { - var reqBody, resBody DeleteScsiLunStateBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type DeleteVffsVolumeStateBody struct { - Req *types.DeleteVffsVolumeState `xml:"urn:vim25 DeleteVffsVolumeState,omitempty"` - Res *types.DeleteVffsVolumeStateResponse `xml:"urn:vim25 DeleteVffsVolumeStateResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *DeleteVffsVolumeStateBody) Fault() *soap.Fault { return b.Fault_ } - -func DeleteVffsVolumeState(ctx context.Context, r soap.RoundTripper, req *types.DeleteVffsVolumeState) (*types.DeleteVffsVolumeStateResponse, error) { - var reqBody, resBody DeleteVffsVolumeStateBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type DeleteVirtualDisk_TaskBody struct { - Req *types.DeleteVirtualDisk_Task `xml:"urn:vim25 DeleteVirtualDisk_Task,omitempty"` - Res *types.DeleteVirtualDisk_TaskResponse `xml:"urn:vim25 DeleteVirtualDisk_TaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *DeleteVirtualDisk_TaskBody) Fault() *soap.Fault { return b.Fault_ } - -func DeleteVirtualDisk_Task(ctx context.Context, r soap.RoundTripper, req *types.DeleteVirtualDisk_Task) (*types.DeleteVirtualDisk_TaskResponse, error) { - var reqBody, resBody DeleteVirtualDisk_TaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type DeleteVmfsVolumeStateBody struct { - Req *types.DeleteVmfsVolumeState `xml:"urn:vim25 DeleteVmfsVolumeState,omitempty"` - Res *types.DeleteVmfsVolumeStateResponse `xml:"urn:vim25 DeleteVmfsVolumeStateResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *DeleteVmfsVolumeStateBody) Fault() *soap.Fault { return b.Fault_ } - -func DeleteVmfsVolumeState(ctx context.Context, r soap.RoundTripper, req *types.DeleteVmfsVolumeState) (*types.DeleteVmfsVolumeStateResponse, error) { - var reqBody, resBody DeleteVmfsVolumeStateBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type DeselectVnicBody struct { - Req *types.DeselectVnic `xml:"urn:vim25 DeselectVnic,omitempty"` - Res *types.DeselectVnicResponse `xml:"urn:vim25 DeselectVnicResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *DeselectVnicBody) Fault() *soap.Fault { return b.Fault_ } - -func DeselectVnic(ctx context.Context, r soap.RoundTripper, req *types.DeselectVnic) (*types.DeselectVnicResponse, error) { - var reqBody, resBody DeselectVnicBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type DeselectVnicForNicTypeBody struct { - Req *types.DeselectVnicForNicType `xml:"urn:vim25 DeselectVnicForNicType,omitempty"` - Res *types.DeselectVnicForNicTypeResponse `xml:"urn:vim25 DeselectVnicForNicTypeResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *DeselectVnicForNicTypeBody) Fault() *soap.Fault { return b.Fault_ } - -func DeselectVnicForNicType(ctx context.Context, r soap.RoundTripper, req *types.DeselectVnicForNicType) (*types.DeselectVnicForNicTypeResponse, error) { - var reqBody, resBody DeselectVnicForNicTypeBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type DestroyChildrenBody struct { - Req *types.DestroyChildren `xml:"urn:vim25 DestroyChildren,omitempty"` - Res *types.DestroyChildrenResponse `xml:"urn:vim25 DestroyChildrenResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *DestroyChildrenBody) Fault() *soap.Fault { return b.Fault_ } - -func DestroyChildren(ctx context.Context, r soap.RoundTripper, req *types.DestroyChildren) (*types.DestroyChildrenResponse, error) { - var reqBody, resBody DestroyChildrenBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type DestroyCollectorBody struct { - Req *types.DestroyCollector `xml:"urn:vim25 DestroyCollector,omitempty"` - Res *types.DestroyCollectorResponse `xml:"urn:vim25 DestroyCollectorResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *DestroyCollectorBody) Fault() *soap.Fault { return b.Fault_ } - -func DestroyCollector(ctx context.Context, r soap.RoundTripper, req *types.DestroyCollector) (*types.DestroyCollectorResponse, error) { - var reqBody, resBody DestroyCollectorBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type DestroyDatastoreBody struct { - Req *types.DestroyDatastore `xml:"urn:vim25 DestroyDatastore,omitempty"` - Res *types.DestroyDatastoreResponse `xml:"urn:vim25 DestroyDatastoreResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *DestroyDatastoreBody) Fault() *soap.Fault { return b.Fault_ } - -func DestroyDatastore(ctx context.Context, r soap.RoundTripper, req *types.DestroyDatastore) (*types.DestroyDatastoreResponse, error) { - var reqBody, resBody DestroyDatastoreBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type DestroyIpPoolBody struct { - Req *types.DestroyIpPool `xml:"urn:vim25 DestroyIpPool,omitempty"` - Res *types.DestroyIpPoolResponse `xml:"urn:vim25 DestroyIpPoolResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *DestroyIpPoolBody) Fault() *soap.Fault { return b.Fault_ } - -func DestroyIpPool(ctx context.Context, r soap.RoundTripper, req *types.DestroyIpPool) (*types.DestroyIpPoolResponse, error) { - var reqBody, resBody DestroyIpPoolBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type DestroyNetworkBody struct { - Req *types.DestroyNetwork `xml:"urn:vim25 DestroyNetwork,omitempty"` - Res *types.DestroyNetworkResponse `xml:"urn:vim25 DestroyNetworkResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *DestroyNetworkBody) Fault() *soap.Fault { return b.Fault_ } - -func DestroyNetwork(ctx context.Context, r soap.RoundTripper, req *types.DestroyNetwork) (*types.DestroyNetworkResponse, error) { - var reqBody, resBody DestroyNetworkBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type DestroyProfileBody struct { - Req *types.DestroyProfile `xml:"urn:vim25 DestroyProfile,omitempty"` - Res *types.DestroyProfileResponse `xml:"urn:vim25 DestroyProfileResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *DestroyProfileBody) Fault() *soap.Fault { return b.Fault_ } - -func DestroyProfile(ctx context.Context, r soap.RoundTripper, req *types.DestroyProfile) (*types.DestroyProfileResponse, error) { - var reqBody, resBody DestroyProfileBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type DestroyPropertyCollectorBody struct { - Req *types.DestroyPropertyCollector `xml:"urn:vim25 DestroyPropertyCollector,omitempty"` - Res *types.DestroyPropertyCollectorResponse `xml:"urn:vim25 DestroyPropertyCollectorResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *DestroyPropertyCollectorBody) Fault() *soap.Fault { return b.Fault_ } - -func DestroyPropertyCollector(ctx context.Context, r soap.RoundTripper, req *types.DestroyPropertyCollector) (*types.DestroyPropertyCollectorResponse, error) { - var reqBody, resBody DestroyPropertyCollectorBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type DestroyPropertyFilterBody struct { - Req *types.DestroyPropertyFilter `xml:"urn:vim25 DestroyPropertyFilter,omitempty"` - Res *types.DestroyPropertyFilterResponse `xml:"urn:vim25 DestroyPropertyFilterResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *DestroyPropertyFilterBody) Fault() *soap.Fault { return b.Fault_ } - -func DestroyPropertyFilter(ctx context.Context, r soap.RoundTripper, req *types.DestroyPropertyFilter) (*types.DestroyPropertyFilterResponse, error) { - var reqBody, resBody DestroyPropertyFilterBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type DestroyVffsBody struct { - Req *types.DestroyVffs `xml:"urn:vim25 DestroyVffs,omitempty"` - Res *types.DestroyVffsResponse `xml:"urn:vim25 DestroyVffsResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *DestroyVffsBody) Fault() *soap.Fault { return b.Fault_ } - -func DestroyVffs(ctx context.Context, r soap.RoundTripper, req *types.DestroyVffs) (*types.DestroyVffsResponse, error) { - var reqBody, resBody DestroyVffsBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type DestroyViewBody struct { - Req *types.DestroyView `xml:"urn:vim25 DestroyView,omitempty"` - Res *types.DestroyViewResponse `xml:"urn:vim25 DestroyViewResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *DestroyViewBody) Fault() *soap.Fault { return b.Fault_ } - -func DestroyView(ctx context.Context, r soap.RoundTripper, req *types.DestroyView) (*types.DestroyViewResponse, error) { - var reqBody, resBody DestroyViewBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type Destroy_TaskBody struct { - Req *types.Destroy_Task `xml:"urn:vim25 Destroy_Task,omitempty"` - Res *types.Destroy_TaskResponse `xml:"urn:vim25 Destroy_TaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *Destroy_TaskBody) Fault() *soap.Fault { return b.Fault_ } - -func Destroy_Task(ctx context.Context, r soap.RoundTripper, req *types.Destroy_Task) (*types.Destroy_TaskResponse, error) { - var reqBody, resBody Destroy_TaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type DetachScsiLunBody struct { - Req *types.DetachScsiLun `xml:"urn:vim25 DetachScsiLun,omitempty"` - Res *types.DetachScsiLunResponse `xml:"urn:vim25 DetachScsiLunResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *DetachScsiLunBody) Fault() *soap.Fault { return b.Fault_ } - -func DetachScsiLun(ctx context.Context, r soap.RoundTripper, req *types.DetachScsiLun) (*types.DetachScsiLunResponse, error) { - var reqBody, resBody DetachScsiLunBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type DisableFeatureBody struct { - Req *types.DisableFeature `xml:"urn:vim25 DisableFeature,omitempty"` - Res *types.DisableFeatureResponse `xml:"urn:vim25 DisableFeatureResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *DisableFeatureBody) Fault() *soap.Fault { return b.Fault_ } - -func DisableFeature(ctx context.Context, r soap.RoundTripper, req *types.DisableFeature) (*types.DisableFeatureResponse, error) { - var reqBody, resBody DisableFeatureBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type DisableHyperThreadingBody struct { - Req *types.DisableHyperThreading `xml:"urn:vim25 DisableHyperThreading,omitempty"` - Res *types.DisableHyperThreadingResponse `xml:"urn:vim25 DisableHyperThreadingResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *DisableHyperThreadingBody) Fault() *soap.Fault { return b.Fault_ } - -func DisableHyperThreading(ctx context.Context, r soap.RoundTripper, req *types.DisableHyperThreading) (*types.DisableHyperThreadingResponse, error) { - var reqBody, resBody DisableHyperThreadingBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type DisableMultipathPathBody struct { - Req *types.DisableMultipathPath `xml:"urn:vim25 DisableMultipathPath,omitempty"` - Res *types.DisableMultipathPathResponse `xml:"urn:vim25 DisableMultipathPathResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *DisableMultipathPathBody) Fault() *soap.Fault { return b.Fault_ } - -func DisableMultipathPath(ctx context.Context, r soap.RoundTripper, req *types.DisableMultipathPath) (*types.DisableMultipathPathResponse, error) { - var reqBody, resBody DisableMultipathPathBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type DisableRulesetBody struct { - Req *types.DisableRuleset `xml:"urn:vim25 DisableRuleset,omitempty"` - Res *types.DisableRulesetResponse `xml:"urn:vim25 DisableRulesetResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *DisableRulesetBody) Fault() *soap.Fault { return b.Fault_ } - -func DisableRuleset(ctx context.Context, r soap.RoundTripper, req *types.DisableRuleset) (*types.DisableRulesetResponse, error) { - var reqBody, resBody DisableRulesetBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type DisableSecondaryVM_TaskBody struct { - Req *types.DisableSecondaryVM_Task `xml:"urn:vim25 DisableSecondaryVM_Task,omitempty"` - Res *types.DisableSecondaryVM_TaskResponse `xml:"urn:vim25 DisableSecondaryVM_TaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *DisableSecondaryVM_TaskBody) Fault() *soap.Fault { return b.Fault_ } - -func DisableSecondaryVM_Task(ctx context.Context, r soap.RoundTripper, req *types.DisableSecondaryVM_Task) (*types.DisableSecondaryVM_TaskResponse, error) { - var reqBody, resBody DisableSecondaryVM_TaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type DisconnectHost_TaskBody struct { - Req *types.DisconnectHost_Task `xml:"urn:vim25 DisconnectHost_Task,omitempty"` - Res *types.DisconnectHost_TaskResponse `xml:"urn:vim25 DisconnectHost_TaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *DisconnectHost_TaskBody) Fault() *soap.Fault { return b.Fault_ } - -func DisconnectHost_Task(ctx context.Context, r soap.RoundTripper, req *types.DisconnectHost_Task) (*types.DisconnectHost_TaskResponse, error) { - var reqBody, resBody DisconnectHost_TaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type DiscoverFcoeHbasBody struct { - Req *types.DiscoverFcoeHbas `xml:"urn:vim25 DiscoverFcoeHbas,omitempty"` - Res *types.DiscoverFcoeHbasResponse `xml:"urn:vim25 DiscoverFcoeHbasResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *DiscoverFcoeHbasBody) Fault() *soap.Fault { return b.Fault_ } - -func DiscoverFcoeHbas(ctx context.Context, r soap.RoundTripper, req *types.DiscoverFcoeHbas) (*types.DiscoverFcoeHbasResponse, error) { - var reqBody, resBody DiscoverFcoeHbasBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type DissociateProfileBody struct { - Req *types.DissociateProfile `xml:"urn:vim25 DissociateProfile,omitempty"` - Res *types.DissociateProfileResponse `xml:"urn:vim25 DissociateProfileResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *DissociateProfileBody) Fault() *soap.Fault { return b.Fault_ } - -func DissociateProfile(ctx context.Context, r soap.RoundTripper, req *types.DissociateProfile) (*types.DissociateProfileResponse, error) { - var reqBody, resBody DissociateProfileBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type DoesCustomizationSpecExistBody struct { - Req *types.DoesCustomizationSpecExist `xml:"urn:vim25 DoesCustomizationSpecExist,omitempty"` - Res *types.DoesCustomizationSpecExistResponse `xml:"urn:vim25 DoesCustomizationSpecExistResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *DoesCustomizationSpecExistBody) Fault() *soap.Fault { return b.Fault_ } - -func DoesCustomizationSpecExist(ctx context.Context, r soap.RoundTripper, req *types.DoesCustomizationSpecExist) (*types.DoesCustomizationSpecExistResponse, error) { - var reqBody, resBody DoesCustomizationSpecExistBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type DuplicateCustomizationSpecBody struct { - Req *types.DuplicateCustomizationSpec `xml:"urn:vim25 DuplicateCustomizationSpec,omitempty"` - Res *types.DuplicateCustomizationSpecResponse `xml:"urn:vim25 DuplicateCustomizationSpecResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *DuplicateCustomizationSpecBody) Fault() *soap.Fault { return b.Fault_ } - -func DuplicateCustomizationSpec(ctx context.Context, r soap.RoundTripper, req *types.DuplicateCustomizationSpec) (*types.DuplicateCustomizationSpecResponse, error) { - var reqBody, resBody DuplicateCustomizationSpecBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type EagerZeroVirtualDisk_TaskBody struct { - Req *types.EagerZeroVirtualDisk_Task `xml:"urn:vim25 EagerZeroVirtualDisk_Task,omitempty"` - Res *types.EagerZeroVirtualDisk_TaskResponse `xml:"urn:vim25 EagerZeroVirtualDisk_TaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *EagerZeroVirtualDisk_TaskBody) Fault() *soap.Fault { return b.Fault_ } - -func EagerZeroVirtualDisk_Task(ctx context.Context, r soap.RoundTripper, req *types.EagerZeroVirtualDisk_Task) (*types.EagerZeroVirtualDisk_TaskResponse, error) { - var reqBody, resBody EagerZeroVirtualDisk_TaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type EnableAlarmActionsBody struct { - Req *types.EnableAlarmActions `xml:"urn:vim25 EnableAlarmActions,omitempty"` - Res *types.EnableAlarmActionsResponse `xml:"urn:vim25 EnableAlarmActionsResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *EnableAlarmActionsBody) Fault() *soap.Fault { return b.Fault_ } - -func EnableAlarmActions(ctx context.Context, r soap.RoundTripper, req *types.EnableAlarmActions) (*types.EnableAlarmActionsResponse, error) { - var reqBody, resBody EnableAlarmActionsBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type EnableFeatureBody struct { - Req *types.EnableFeature `xml:"urn:vim25 EnableFeature,omitempty"` - Res *types.EnableFeatureResponse `xml:"urn:vim25 EnableFeatureResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *EnableFeatureBody) Fault() *soap.Fault { return b.Fault_ } - -func EnableFeature(ctx context.Context, r soap.RoundTripper, req *types.EnableFeature) (*types.EnableFeatureResponse, error) { - var reqBody, resBody EnableFeatureBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type EnableHyperThreadingBody struct { - Req *types.EnableHyperThreading `xml:"urn:vim25 EnableHyperThreading,omitempty"` - Res *types.EnableHyperThreadingResponse `xml:"urn:vim25 EnableHyperThreadingResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *EnableHyperThreadingBody) Fault() *soap.Fault { return b.Fault_ } - -func EnableHyperThreading(ctx context.Context, r soap.RoundTripper, req *types.EnableHyperThreading) (*types.EnableHyperThreadingResponse, error) { - var reqBody, resBody EnableHyperThreadingBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type EnableMultipathPathBody struct { - Req *types.EnableMultipathPath `xml:"urn:vim25 EnableMultipathPath,omitempty"` - Res *types.EnableMultipathPathResponse `xml:"urn:vim25 EnableMultipathPathResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *EnableMultipathPathBody) Fault() *soap.Fault { return b.Fault_ } - -func EnableMultipathPath(ctx context.Context, r soap.RoundTripper, req *types.EnableMultipathPath) (*types.EnableMultipathPathResponse, error) { - var reqBody, resBody EnableMultipathPathBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type EnableNetworkResourceManagementBody struct { - Req *types.EnableNetworkResourceManagement `xml:"urn:vim25 EnableNetworkResourceManagement,omitempty"` - Res *types.EnableNetworkResourceManagementResponse `xml:"urn:vim25 EnableNetworkResourceManagementResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *EnableNetworkResourceManagementBody) Fault() *soap.Fault { return b.Fault_ } - -func EnableNetworkResourceManagement(ctx context.Context, r soap.RoundTripper, req *types.EnableNetworkResourceManagement) (*types.EnableNetworkResourceManagementResponse, error) { - var reqBody, resBody EnableNetworkResourceManagementBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type EnableRulesetBody struct { - Req *types.EnableRuleset `xml:"urn:vim25 EnableRuleset,omitempty"` - Res *types.EnableRulesetResponse `xml:"urn:vim25 EnableRulesetResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *EnableRulesetBody) Fault() *soap.Fault { return b.Fault_ } - -func EnableRuleset(ctx context.Context, r soap.RoundTripper, req *types.EnableRuleset) (*types.EnableRulesetResponse, error) { - var reqBody, resBody EnableRulesetBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type EnableSecondaryVM_TaskBody struct { - Req *types.EnableSecondaryVM_Task `xml:"urn:vim25 EnableSecondaryVM_Task,omitempty"` - Res *types.EnableSecondaryVM_TaskResponse `xml:"urn:vim25 EnableSecondaryVM_TaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *EnableSecondaryVM_TaskBody) Fault() *soap.Fault { return b.Fault_ } - -func EnableSecondaryVM_Task(ctx context.Context, r soap.RoundTripper, req *types.EnableSecondaryVM_Task) (*types.EnableSecondaryVM_TaskResponse, error) { - var reqBody, resBody EnableSecondaryVM_TaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type EnterLockdownModeBody struct { - Req *types.EnterLockdownMode `xml:"urn:vim25 EnterLockdownMode,omitempty"` - Res *types.EnterLockdownModeResponse `xml:"urn:vim25 EnterLockdownModeResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *EnterLockdownModeBody) Fault() *soap.Fault { return b.Fault_ } - -func EnterLockdownMode(ctx context.Context, r soap.RoundTripper, req *types.EnterLockdownMode) (*types.EnterLockdownModeResponse, error) { - var reqBody, resBody EnterLockdownModeBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type EnterMaintenanceMode_TaskBody struct { - Req *types.EnterMaintenanceMode_Task `xml:"urn:vim25 EnterMaintenanceMode_Task,omitempty"` - Res *types.EnterMaintenanceMode_TaskResponse `xml:"urn:vim25 EnterMaintenanceMode_TaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *EnterMaintenanceMode_TaskBody) Fault() *soap.Fault { return b.Fault_ } - -func EnterMaintenanceMode_Task(ctx context.Context, r soap.RoundTripper, req *types.EnterMaintenanceMode_Task) (*types.EnterMaintenanceMode_TaskResponse, error) { - var reqBody, resBody EnterMaintenanceMode_TaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type EstimateDatabaseSizeBody struct { - Req *types.EstimateDatabaseSize `xml:"urn:vim25 EstimateDatabaseSize,omitempty"` - Res *types.EstimateDatabaseSizeResponse `xml:"urn:vim25 EstimateDatabaseSizeResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *EstimateDatabaseSizeBody) Fault() *soap.Fault { return b.Fault_ } - -func EstimateDatabaseSize(ctx context.Context, r soap.RoundTripper, req *types.EstimateDatabaseSize) (*types.EstimateDatabaseSizeResponse, error) { - var reqBody, resBody EstimateDatabaseSizeBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type EstimateStorageForConsolidateSnapshots_TaskBody struct { - Req *types.EstimateStorageForConsolidateSnapshots_Task `xml:"urn:vim25 EstimateStorageForConsolidateSnapshots_Task,omitempty"` - Res *types.EstimateStorageForConsolidateSnapshots_TaskResponse `xml:"urn:vim25 EstimateStorageForConsolidateSnapshots_TaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *EstimateStorageForConsolidateSnapshots_TaskBody) Fault() *soap.Fault { return b.Fault_ } - -func EstimateStorageForConsolidateSnapshots_Task(ctx context.Context, r soap.RoundTripper, req *types.EstimateStorageForConsolidateSnapshots_Task) (*types.EstimateStorageForConsolidateSnapshots_TaskResponse, error) { - var reqBody, resBody EstimateStorageForConsolidateSnapshots_TaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type EsxAgentHostManagerUpdateConfigBody struct { - Req *types.EsxAgentHostManagerUpdateConfig `xml:"urn:vim25 EsxAgentHostManagerUpdateConfig,omitempty"` - Res *types.EsxAgentHostManagerUpdateConfigResponse `xml:"urn:vim25 EsxAgentHostManagerUpdateConfigResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *EsxAgentHostManagerUpdateConfigBody) Fault() *soap.Fault { return b.Fault_ } - -func EsxAgentHostManagerUpdateConfig(ctx context.Context, r soap.RoundTripper, req *types.EsxAgentHostManagerUpdateConfig) (*types.EsxAgentHostManagerUpdateConfigResponse, error) { - var reqBody, resBody EsxAgentHostManagerUpdateConfigBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type ExecuteHostProfileBody struct { - Req *types.ExecuteHostProfile `xml:"urn:vim25 ExecuteHostProfile,omitempty"` - Res *types.ExecuteHostProfileResponse `xml:"urn:vim25 ExecuteHostProfileResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *ExecuteHostProfileBody) Fault() *soap.Fault { return b.Fault_ } - -func ExecuteHostProfile(ctx context.Context, r soap.RoundTripper, req *types.ExecuteHostProfile) (*types.ExecuteHostProfileResponse, error) { - var reqBody, resBody ExecuteHostProfileBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type ExecuteSimpleCommandBody struct { - Req *types.ExecuteSimpleCommand `xml:"urn:vim25 ExecuteSimpleCommand,omitempty"` - Res *types.ExecuteSimpleCommandResponse `xml:"urn:vim25 ExecuteSimpleCommandResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *ExecuteSimpleCommandBody) Fault() *soap.Fault { return b.Fault_ } - -func ExecuteSimpleCommand(ctx context.Context, r soap.RoundTripper, req *types.ExecuteSimpleCommand) (*types.ExecuteSimpleCommandResponse, error) { - var reqBody, resBody ExecuteSimpleCommandBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type ExitLockdownModeBody struct { - Req *types.ExitLockdownMode `xml:"urn:vim25 ExitLockdownMode,omitempty"` - Res *types.ExitLockdownModeResponse `xml:"urn:vim25 ExitLockdownModeResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *ExitLockdownModeBody) Fault() *soap.Fault { return b.Fault_ } - -func ExitLockdownMode(ctx context.Context, r soap.RoundTripper, req *types.ExitLockdownMode) (*types.ExitLockdownModeResponse, error) { - var reqBody, resBody ExitLockdownModeBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type ExitMaintenanceMode_TaskBody struct { - Req *types.ExitMaintenanceMode_Task `xml:"urn:vim25 ExitMaintenanceMode_Task,omitempty"` - Res *types.ExitMaintenanceMode_TaskResponse `xml:"urn:vim25 ExitMaintenanceMode_TaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *ExitMaintenanceMode_TaskBody) Fault() *soap.Fault { return b.Fault_ } - -func ExitMaintenanceMode_Task(ctx context.Context, r soap.RoundTripper, req *types.ExitMaintenanceMode_Task) (*types.ExitMaintenanceMode_TaskResponse, error) { - var reqBody, resBody ExitMaintenanceMode_TaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type ExpandVmfsDatastoreBody struct { - Req *types.ExpandVmfsDatastore `xml:"urn:vim25 ExpandVmfsDatastore,omitempty"` - Res *types.ExpandVmfsDatastoreResponse `xml:"urn:vim25 ExpandVmfsDatastoreResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *ExpandVmfsDatastoreBody) Fault() *soap.Fault { return b.Fault_ } - -func ExpandVmfsDatastore(ctx context.Context, r soap.RoundTripper, req *types.ExpandVmfsDatastore) (*types.ExpandVmfsDatastoreResponse, error) { - var reqBody, resBody ExpandVmfsDatastoreBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type ExpandVmfsExtentBody struct { - Req *types.ExpandVmfsExtent `xml:"urn:vim25 ExpandVmfsExtent,omitempty"` - Res *types.ExpandVmfsExtentResponse `xml:"urn:vim25 ExpandVmfsExtentResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *ExpandVmfsExtentBody) Fault() *soap.Fault { return b.Fault_ } - -func ExpandVmfsExtent(ctx context.Context, r soap.RoundTripper, req *types.ExpandVmfsExtent) (*types.ExpandVmfsExtentResponse, error) { - var reqBody, resBody ExpandVmfsExtentBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type ExportAnswerFile_TaskBody struct { - Req *types.ExportAnswerFile_Task `xml:"urn:vim25 ExportAnswerFile_Task,omitempty"` - Res *types.ExportAnswerFile_TaskResponse `xml:"urn:vim25 ExportAnswerFile_TaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *ExportAnswerFile_TaskBody) Fault() *soap.Fault { return b.Fault_ } - -func ExportAnswerFile_Task(ctx context.Context, r soap.RoundTripper, req *types.ExportAnswerFile_Task) (*types.ExportAnswerFile_TaskResponse, error) { - var reqBody, resBody ExportAnswerFile_TaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type ExportProfileBody struct { - Req *types.ExportProfile `xml:"urn:vim25 ExportProfile,omitempty"` - Res *types.ExportProfileResponse `xml:"urn:vim25 ExportProfileResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *ExportProfileBody) Fault() *soap.Fault { return b.Fault_ } - -func ExportProfile(ctx context.Context, r soap.RoundTripper, req *types.ExportProfile) (*types.ExportProfileResponse, error) { - var reqBody, resBody ExportProfileBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type ExportSnapshotBody struct { - Req *types.ExportSnapshot `xml:"urn:vim25 ExportSnapshot,omitempty"` - Res *types.ExportSnapshotResponse `xml:"urn:vim25 ExportSnapshotResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *ExportSnapshotBody) Fault() *soap.Fault { return b.Fault_ } - -func ExportSnapshot(ctx context.Context, r soap.RoundTripper, req *types.ExportSnapshot) (*types.ExportSnapshotResponse, error) { - var reqBody, resBody ExportSnapshotBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type ExportVAppBody struct { - Req *types.ExportVApp `xml:"urn:vim25 ExportVApp,omitempty"` - Res *types.ExportVAppResponse `xml:"urn:vim25 ExportVAppResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *ExportVAppBody) Fault() *soap.Fault { return b.Fault_ } - -func ExportVApp(ctx context.Context, r soap.RoundTripper, req *types.ExportVApp) (*types.ExportVAppResponse, error) { - var reqBody, resBody ExportVAppBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type ExportVmBody struct { - Req *types.ExportVm `xml:"urn:vim25 ExportVm,omitempty"` - Res *types.ExportVmResponse `xml:"urn:vim25 ExportVmResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *ExportVmBody) Fault() *soap.Fault { return b.Fault_ } - -func ExportVm(ctx context.Context, r soap.RoundTripper, req *types.ExportVm) (*types.ExportVmResponse, error) { - var reqBody, resBody ExportVmBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type ExtendVffsBody struct { - Req *types.ExtendVffs `xml:"urn:vim25 ExtendVffs,omitempty"` - Res *types.ExtendVffsResponse `xml:"urn:vim25 ExtendVffsResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *ExtendVffsBody) Fault() *soap.Fault { return b.Fault_ } - -func ExtendVffs(ctx context.Context, r soap.RoundTripper, req *types.ExtendVffs) (*types.ExtendVffsResponse, error) { - var reqBody, resBody ExtendVffsBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type ExtendVirtualDisk_TaskBody struct { - Req *types.ExtendVirtualDisk_Task `xml:"urn:vim25 ExtendVirtualDisk_Task,omitempty"` - Res *types.ExtendVirtualDisk_TaskResponse `xml:"urn:vim25 ExtendVirtualDisk_TaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *ExtendVirtualDisk_TaskBody) Fault() *soap.Fault { return b.Fault_ } - -func ExtendVirtualDisk_Task(ctx context.Context, r soap.RoundTripper, req *types.ExtendVirtualDisk_Task) (*types.ExtendVirtualDisk_TaskResponse, error) { - var reqBody, resBody ExtendVirtualDisk_TaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type ExtendVmfsDatastoreBody struct { - Req *types.ExtendVmfsDatastore `xml:"urn:vim25 ExtendVmfsDatastore,omitempty"` - Res *types.ExtendVmfsDatastoreResponse `xml:"urn:vim25 ExtendVmfsDatastoreResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *ExtendVmfsDatastoreBody) Fault() *soap.Fault { return b.Fault_ } - -func ExtendVmfsDatastore(ctx context.Context, r soap.RoundTripper, req *types.ExtendVmfsDatastore) (*types.ExtendVmfsDatastoreResponse, error) { - var reqBody, resBody ExtendVmfsDatastoreBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type ExtractOvfEnvironmentBody struct { - Req *types.ExtractOvfEnvironment `xml:"urn:vim25 ExtractOvfEnvironment,omitempty"` - Res *types.ExtractOvfEnvironmentResponse `xml:"urn:vim25 ExtractOvfEnvironmentResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *ExtractOvfEnvironmentBody) Fault() *soap.Fault { return b.Fault_ } - -func ExtractOvfEnvironment(ctx context.Context, r soap.RoundTripper, req *types.ExtractOvfEnvironment) (*types.ExtractOvfEnvironmentResponse, error) { - var reqBody, resBody ExtractOvfEnvironmentBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type FetchDVPortKeysBody struct { - Req *types.FetchDVPortKeys `xml:"urn:vim25 FetchDVPortKeys,omitempty"` - Res *types.FetchDVPortKeysResponse `xml:"urn:vim25 FetchDVPortKeysResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *FetchDVPortKeysBody) Fault() *soap.Fault { return b.Fault_ } - -func FetchDVPortKeys(ctx context.Context, r soap.RoundTripper, req *types.FetchDVPortKeys) (*types.FetchDVPortKeysResponse, error) { - var reqBody, resBody FetchDVPortKeysBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type FetchDVPortsBody struct { - Req *types.FetchDVPorts `xml:"urn:vim25 FetchDVPorts,omitempty"` - Res *types.FetchDVPortsResponse `xml:"urn:vim25 FetchDVPortsResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *FetchDVPortsBody) Fault() *soap.Fault { return b.Fault_ } - -func FetchDVPorts(ctx context.Context, r soap.RoundTripper, req *types.FetchDVPorts) (*types.FetchDVPortsResponse, error) { - var reqBody, resBody FetchDVPortsBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type FindAllByDnsNameBody struct { - Req *types.FindAllByDnsName `xml:"urn:vim25 FindAllByDnsName,omitempty"` - Res *types.FindAllByDnsNameResponse `xml:"urn:vim25 FindAllByDnsNameResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *FindAllByDnsNameBody) Fault() *soap.Fault { return b.Fault_ } - -func FindAllByDnsName(ctx context.Context, r soap.RoundTripper, req *types.FindAllByDnsName) (*types.FindAllByDnsNameResponse, error) { - var reqBody, resBody FindAllByDnsNameBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type FindAllByIpBody struct { - Req *types.FindAllByIp `xml:"urn:vim25 FindAllByIp,omitempty"` - Res *types.FindAllByIpResponse `xml:"urn:vim25 FindAllByIpResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *FindAllByIpBody) Fault() *soap.Fault { return b.Fault_ } - -func FindAllByIp(ctx context.Context, r soap.RoundTripper, req *types.FindAllByIp) (*types.FindAllByIpResponse, error) { - var reqBody, resBody FindAllByIpBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type FindAllByUuidBody struct { - Req *types.FindAllByUuid `xml:"urn:vim25 FindAllByUuid,omitempty"` - Res *types.FindAllByUuidResponse `xml:"urn:vim25 FindAllByUuidResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *FindAllByUuidBody) Fault() *soap.Fault { return b.Fault_ } - -func FindAllByUuid(ctx context.Context, r soap.RoundTripper, req *types.FindAllByUuid) (*types.FindAllByUuidResponse, error) { - var reqBody, resBody FindAllByUuidBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type FindAssociatedProfileBody struct { - Req *types.FindAssociatedProfile `xml:"urn:vim25 FindAssociatedProfile,omitempty"` - Res *types.FindAssociatedProfileResponse `xml:"urn:vim25 FindAssociatedProfileResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *FindAssociatedProfileBody) Fault() *soap.Fault { return b.Fault_ } - -func FindAssociatedProfile(ctx context.Context, r soap.RoundTripper, req *types.FindAssociatedProfile) (*types.FindAssociatedProfileResponse, error) { - var reqBody, resBody FindAssociatedProfileBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type FindByDatastorePathBody struct { - Req *types.FindByDatastorePath `xml:"urn:vim25 FindByDatastorePath,omitempty"` - Res *types.FindByDatastorePathResponse `xml:"urn:vim25 FindByDatastorePathResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *FindByDatastorePathBody) Fault() *soap.Fault { return b.Fault_ } - -func FindByDatastorePath(ctx context.Context, r soap.RoundTripper, req *types.FindByDatastorePath) (*types.FindByDatastorePathResponse, error) { - var reqBody, resBody FindByDatastorePathBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type FindByDnsNameBody struct { - Req *types.FindByDnsName `xml:"urn:vim25 FindByDnsName,omitempty"` - Res *types.FindByDnsNameResponse `xml:"urn:vim25 FindByDnsNameResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *FindByDnsNameBody) Fault() *soap.Fault { return b.Fault_ } - -func FindByDnsName(ctx context.Context, r soap.RoundTripper, req *types.FindByDnsName) (*types.FindByDnsNameResponse, error) { - var reqBody, resBody FindByDnsNameBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type FindByInventoryPathBody struct { - Req *types.FindByInventoryPath `xml:"urn:vim25 FindByInventoryPath,omitempty"` - Res *types.FindByInventoryPathResponse `xml:"urn:vim25 FindByInventoryPathResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *FindByInventoryPathBody) Fault() *soap.Fault { return b.Fault_ } - -func FindByInventoryPath(ctx context.Context, r soap.RoundTripper, req *types.FindByInventoryPath) (*types.FindByInventoryPathResponse, error) { - var reqBody, resBody FindByInventoryPathBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type FindByIpBody struct { - Req *types.FindByIp `xml:"urn:vim25 FindByIp,omitempty"` - Res *types.FindByIpResponse `xml:"urn:vim25 FindByIpResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *FindByIpBody) Fault() *soap.Fault { return b.Fault_ } - -func FindByIp(ctx context.Context, r soap.RoundTripper, req *types.FindByIp) (*types.FindByIpResponse, error) { - var reqBody, resBody FindByIpBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type FindByUuidBody struct { - Req *types.FindByUuid `xml:"urn:vim25 FindByUuid,omitempty"` - Res *types.FindByUuidResponse `xml:"urn:vim25 FindByUuidResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *FindByUuidBody) Fault() *soap.Fault { return b.Fault_ } - -func FindByUuid(ctx context.Context, r soap.RoundTripper, req *types.FindByUuid) (*types.FindByUuidResponse, error) { - var reqBody, resBody FindByUuidBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type FindChildBody struct { - Req *types.FindChild `xml:"urn:vim25 FindChild,omitempty"` - Res *types.FindChildResponse `xml:"urn:vim25 FindChildResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *FindChildBody) Fault() *soap.Fault { return b.Fault_ } - -func FindChild(ctx context.Context, r soap.RoundTripper, req *types.FindChild) (*types.FindChildResponse, error) { - var reqBody, resBody FindChildBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type FindExtensionBody struct { - Req *types.FindExtension `xml:"urn:vim25 FindExtension,omitempty"` - Res *types.FindExtensionResponse `xml:"urn:vim25 FindExtensionResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *FindExtensionBody) Fault() *soap.Fault { return b.Fault_ } - -func FindExtension(ctx context.Context, r soap.RoundTripper, req *types.FindExtension) (*types.FindExtensionResponse, error) { - var reqBody, resBody FindExtensionBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type FormatVffsBody struct { - Req *types.FormatVffs `xml:"urn:vim25 FormatVffs,omitempty"` - Res *types.FormatVffsResponse `xml:"urn:vim25 FormatVffsResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *FormatVffsBody) Fault() *soap.Fault { return b.Fault_ } - -func FormatVffs(ctx context.Context, r soap.RoundTripper, req *types.FormatVffs) (*types.FormatVffsResponse, error) { - var reqBody, resBody FormatVffsBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type FormatVmfsBody struct { - Req *types.FormatVmfs `xml:"urn:vim25 FormatVmfs,omitempty"` - Res *types.FormatVmfsResponse `xml:"urn:vim25 FormatVmfsResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *FormatVmfsBody) Fault() *soap.Fault { return b.Fault_ } - -func FormatVmfs(ctx context.Context, r soap.RoundTripper, req *types.FormatVmfs) (*types.FormatVmfsResponse, error) { - var reqBody, resBody FormatVmfsBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type GenerateConfigTaskListBody struct { - Req *types.GenerateConfigTaskList `xml:"urn:vim25 GenerateConfigTaskList,omitempty"` - Res *types.GenerateConfigTaskListResponse `xml:"urn:vim25 GenerateConfigTaskListResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *GenerateConfigTaskListBody) Fault() *soap.Fault { return b.Fault_ } - -func GenerateConfigTaskList(ctx context.Context, r soap.RoundTripper, req *types.GenerateConfigTaskList) (*types.GenerateConfigTaskListResponse, error) { - var reqBody, resBody GenerateConfigTaskListBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type GenerateHostProfileTaskList_TaskBody struct { - Req *types.GenerateHostProfileTaskList_Task `xml:"urn:vim25 GenerateHostProfileTaskList_Task,omitempty"` - Res *types.GenerateHostProfileTaskList_TaskResponse `xml:"urn:vim25 GenerateHostProfileTaskList_TaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *GenerateHostProfileTaskList_TaskBody) Fault() *soap.Fault { return b.Fault_ } - -func GenerateHostProfileTaskList_Task(ctx context.Context, r soap.RoundTripper, req *types.GenerateHostProfileTaskList_Task) (*types.GenerateHostProfileTaskList_TaskResponse, error) { - var reqBody, resBody GenerateHostProfileTaskList_TaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type GenerateLogBundles_TaskBody struct { - Req *types.GenerateLogBundles_Task `xml:"urn:vim25 GenerateLogBundles_Task,omitempty"` - Res *types.GenerateLogBundles_TaskResponse `xml:"urn:vim25 GenerateLogBundles_TaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *GenerateLogBundles_TaskBody) Fault() *soap.Fault { return b.Fault_ } - -func GenerateLogBundles_Task(ctx context.Context, r soap.RoundTripper, req *types.GenerateLogBundles_Task) (*types.GenerateLogBundles_TaskResponse, error) { - var reqBody, resBody GenerateLogBundles_TaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type GetAlarmBody struct { - Req *types.GetAlarm `xml:"urn:vim25 GetAlarm,omitempty"` - Res *types.GetAlarmResponse `xml:"urn:vim25 GetAlarmResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *GetAlarmBody) Fault() *soap.Fault { return b.Fault_ } - -func GetAlarm(ctx context.Context, r soap.RoundTripper, req *types.GetAlarm) (*types.GetAlarmResponse, error) { - var reqBody, resBody GetAlarmBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type GetAlarmStateBody struct { - Req *types.GetAlarmState `xml:"urn:vim25 GetAlarmState,omitempty"` - Res *types.GetAlarmStateResponse `xml:"urn:vim25 GetAlarmStateResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *GetAlarmStateBody) Fault() *soap.Fault { return b.Fault_ } - -func GetAlarmState(ctx context.Context, r soap.RoundTripper, req *types.GetAlarmState) (*types.GetAlarmStateResponse, error) { - var reqBody, resBody GetAlarmStateBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type GetCustomizationSpecBody struct { - Req *types.GetCustomizationSpec `xml:"urn:vim25 GetCustomizationSpec,omitempty"` - Res *types.GetCustomizationSpecResponse `xml:"urn:vim25 GetCustomizationSpecResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *GetCustomizationSpecBody) Fault() *soap.Fault { return b.Fault_ } - -func GetCustomizationSpec(ctx context.Context, r soap.RoundTripper, req *types.GetCustomizationSpec) (*types.GetCustomizationSpecResponse, error) { - var reqBody, resBody GetCustomizationSpecBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type GetPublicKeyBody struct { - Req *types.GetPublicKey `xml:"urn:vim25 GetPublicKey,omitempty"` - Res *types.GetPublicKeyResponse `xml:"urn:vim25 GetPublicKeyResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *GetPublicKeyBody) Fault() *soap.Fault { return b.Fault_ } - -func GetPublicKey(ctx context.Context, r soap.RoundTripper, req *types.GetPublicKey) (*types.GetPublicKeyResponse, error) { - var reqBody, resBody GetPublicKeyBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type HasPrivilegeOnEntitiesBody struct { - Req *types.HasPrivilegeOnEntities `xml:"urn:vim25 HasPrivilegeOnEntities,omitempty"` - Res *types.HasPrivilegeOnEntitiesResponse `xml:"urn:vim25 HasPrivilegeOnEntitiesResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *HasPrivilegeOnEntitiesBody) Fault() *soap.Fault { return b.Fault_ } - -func HasPrivilegeOnEntities(ctx context.Context, r soap.RoundTripper, req *types.HasPrivilegeOnEntities) (*types.HasPrivilegeOnEntitiesResponse, error) { - var reqBody, resBody HasPrivilegeOnEntitiesBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type HasPrivilegeOnEntityBody struct { - Req *types.HasPrivilegeOnEntity `xml:"urn:vim25 HasPrivilegeOnEntity,omitempty"` - Res *types.HasPrivilegeOnEntityResponse `xml:"urn:vim25 HasPrivilegeOnEntityResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *HasPrivilegeOnEntityBody) Fault() *soap.Fault { return b.Fault_ } - -func HasPrivilegeOnEntity(ctx context.Context, r soap.RoundTripper, req *types.HasPrivilegeOnEntity) (*types.HasPrivilegeOnEntityResponse, error) { - var reqBody, resBody HasPrivilegeOnEntityBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type HostConfigVFlashCacheBody struct { - Req *types.HostConfigVFlashCache `xml:"urn:vim25 HostConfigVFlashCache,omitempty"` - Res *types.HostConfigVFlashCacheResponse `xml:"urn:vim25 HostConfigVFlashCacheResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *HostConfigVFlashCacheBody) Fault() *soap.Fault { return b.Fault_ } - -func HostConfigVFlashCache(ctx context.Context, r soap.RoundTripper, req *types.HostConfigVFlashCache) (*types.HostConfigVFlashCacheResponse, error) { - var reqBody, resBody HostConfigVFlashCacheBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type HostConfigureVFlashResourceBody struct { - Req *types.HostConfigureVFlashResource `xml:"urn:vim25 HostConfigureVFlashResource,omitempty"` - Res *types.HostConfigureVFlashResourceResponse `xml:"urn:vim25 HostConfigureVFlashResourceResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *HostConfigureVFlashResourceBody) Fault() *soap.Fault { return b.Fault_ } - -func HostConfigureVFlashResource(ctx context.Context, r soap.RoundTripper, req *types.HostConfigureVFlashResource) (*types.HostConfigureVFlashResourceResponse, error) { - var reqBody, resBody HostConfigureVFlashResourceBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type HostGetVFlashModuleDefaultConfigBody struct { - Req *types.HostGetVFlashModuleDefaultConfig `xml:"urn:vim25 HostGetVFlashModuleDefaultConfig,omitempty"` - Res *types.HostGetVFlashModuleDefaultConfigResponse `xml:"urn:vim25 HostGetVFlashModuleDefaultConfigResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *HostGetVFlashModuleDefaultConfigBody) Fault() *soap.Fault { return b.Fault_ } - -func HostGetVFlashModuleDefaultConfig(ctx context.Context, r soap.RoundTripper, req *types.HostGetVFlashModuleDefaultConfig) (*types.HostGetVFlashModuleDefaultConfigResponse, error) { - var reqBody, resBody HostGetVFlashModuleDefaultConfigBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type HostImageConfigGetAcceptanceBody struct { - Req *types.HostImageConfigGetAcceptance `xml:"urn:vim25 HostImageConfigGetAcceptance,omitempty"` - Res *types.HostImageConfigGetAcceptanceResponse `xml:"urn:vim25 HostImageConfigGetAcceptanceResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *HostImageConfigGetAcceptanceBody) Fault() *soap.Fault { return b.Fault_ } - -func HostImageConfigGetAcceptance(ctx context.Context, r soap.RoundTripper, req *types.HostImageConfigGetAcceptance) (*types.HostImageConfigGetAcceptanceResponse, error) { - var reqBody, resBody HostImageConfigGetAcceptanceBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type HostImageConfigGetProfileBody struct { - Req *types.HostImageConfigGetProfile `xml:"urn:vim25 HostImageConfigGetProfile,omitempty"` - Res *types.HostImageConfigGetProfileResponse `xml:"urn:vim25 HostImageConfigGetProfileResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *HostImageConfigGetProfileBody) Fault() *soap.Fault { return b.Fault_ } - -func HostImageConfigGetProfile(ctx context.Context, r soap.RoundTripper, req *types.HostImageConfigGetProfile) (*types.HostImageConfigGetProfileResponse, error) { - var reqBody, resBody HostImageConfigGetProfileBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type HostRemoveVFlashResourceBody struct { - Req *types.HostRemoveVFlashResource `xml:"urn:vim25 HostRemoveVFlashResource,omitempty"` - Res *types.HostRemoveVFlashResourceResponse `xml:"urn:vim25 HostRemoveVFlashResourceResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *HostRemoveVFlashResourceBody) Fault() *soap.Fault { return b.Fault_ } - -func HostRemoveVFlashResource(ctx context.Context, r soap.RoundTripper, req *types.HostRemoveVFlashResource) (*types.HostRemoveVFlashResourceResponse, error) { - var reqBody, resBody HostRemoveVFlashResourceBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type HttpNfcLeaseAbortBody struct { - Req *types.HttpNfcLeaseAbort `xml:"urn:vim25 HttpNfcLeaseAbort,omitempty"` - Res *types.HttpNfcLeaseAbortResponse `xml:"urn:vim25 HttpNfcLeaseAbortResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *HttpNfcLeaseAbortBody) Fault() *soap.Fault { return b.Fault_ } - -func HttpNfcLeaseAbort(ctx context.Context, r soap.RoundTripper, req *types.HttpNfcLeaseAbort) (*types.HttpNfcLeaseAbortResponse, error) { - var reqBody, resBody HttpNfcLeaseAbortBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type HttpNfcLeaseCompleteBody struct { - Req *types.HttpNfcLeaseComplete `xml:"urn:vim25 HttpNfcLeaseComplete,omitempty"` - Res *types.HttpNfcLeaseCompleteResponse `xml:"urn:vim25 HttpNfcLeaseCompleteResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *HttpNfcLeaseCompleteBody) Fault() *soap.Fault { return b.Fault_ } - -func HttpNfcLeaseComplete(ctx context.Context, r soap.RoundTripper, req *types.HttpNfcLeaseComplete) (*types.HttpNfcLeaseCompleteResponse, error) { - var reqBody, resBody HttpNfcLeaseCompleteBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type HttpNfcLeaseGetManifestBody struct { - Req *types.HttpNfcLeaseGetManifest `xml:"urn:vim25 HttpNfcLeaseGetManifest,omitempty"` - Res *types.HttpNfcLeaseGetManifestResponse `xml:"urn:vim25 HttpNfcLeaseGetManifestResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *HttpNfcLeaseGetManifestBody) Fault() *soap.Fault { return b.Fault_ } - -func HttpNfcLeaseGetManifest(ctx context.Context, r soap.RoundTripper, req *types.HttpNfcLeaseGetManifest) (*types.HttpNfcLeaseGetManifestResponse, error) { - var reqBody, resBody HttpNfcLeaseGetManifestBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type HttpNfcLeaseProgressBody struct { - Req *types.HttpNfcLeaseProgress `xml:"urn:vim25 HttpNfcLeaseProgress,omitempty"` - Res *types.HttpNfcLeaseProgressResponse `xml:"urn:vim25 HttpNfcLeaseProgressResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *HttpNfcLeaseProgressBody) Fault() *soap.Fault { return b.Fault_ } - -func HttpNfcLeaseProgress(ctx context.Context, r soap.RoundTripper, req *types.HttpNfcLeaseProgress) (*types.HttpNfcLeaseProgressResponse, error) { - var reqBody, resBody HttpNfcLeaseProgressBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type ImpersonateUserBody struct { - Req *types.ImpersonateUser `xml:"urn:vim25 ImpersonateUser,omitempty"` - Res *types.ImpersonateUserResponse `xml:"urn:vim25 ImpersonateUserResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *ImpersonateUserBody) Fault() *soap.Fault { return b.Fault_ } - -func ImpersonateUser(ctx context.Context, r soap.RoundTripper, req *types.ImpersonateUser) (*types.ImpersonateUserResponse, error) { - var reqBody, resBody ImpersonateUserBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type ImportCertificateForCAM_TaskBody struct { - Req *types.ImportCertificateForCAM_Task `xml:"urn:vim25 ImportCertificateForCAM_Task,omitempty"` - Res *types.ImportCertificateForCAM_TaskResponse `xml:"urn:vim25 ImportCertificateForCAM_TaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *ImportCertificateForCAM_TaskBody) Fault() *soap.Fault { return b.Fault_ } - -func ImportCertificateForCAM_Task(ctx context.Context, r soap.RoundTripper, req *types.ImportCertificateForCAM_Task) (*types.ImportCertificateForCAM_TaskResponse, error) { - var reqBody, resBody ImportCertificateForCAM_TaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type ImportVAppBody struct { - Req *types.ImportVApp `xml:"urn:vim25 ImportVApp,omitempty"` - Res *types.ImportVAppResponse `xml:"urn:vim25 ImportVAppResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *ImportVAppBody) Fault() *soap.Fault { return b.Fault_ } - -func ImportVApp(ctx context.Context, r soap.RoundTripper, req *types.ImportVApp) (*types.ImportVAppResponse, error) { - var reqBody, resBody ImportVAppBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type InflateVirtualDisk_TaskBody struct { - Req *types.InflateVirtualDisk_Task `xml:"urn:vim25 InflateVirtualDisk_Task,omitempty"` - Res *types.InflateVirtualDisk_TaskResponse `xml:"urn:vim25 InflateVirtualDisk_TaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *InflateVirtualDisk_TaskBody) Fault() *soap.Fault { return b.Fault_ } - -func InflateVirtualDisk_Task(ctx context.Context, r soap.RoundTripper, req *types.InflateVirtualDisk_Task) (*types.InflateVirtualDisk_TaskResponse, error) { - var reqBody, resBody InflateVirtualDisk_TaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type InitializeDisks_TaskBody struct { - Req *types.InitializeDisks_Task `xml:"urn:vim25 InitializeDisks_Task,omitempty"` - Res *types.InitializeDisks_TaskResponse `xml:"urn:vim25 InitializeDisks_TaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *InitializeDisks_TaskBody) Fault() *soap.Fault { return b.Fault_ } - -func InitializeDisks_Task(ctx context.Context, r soap.RoundTripper, req *types.InitializeDisks_Task) (*types.InitializeDisks_TaskResponse, error) { - var reqBody, resBody InitializeDisks_TaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type InitiateFileTransferFromGuestBody struct { - Req *types.InitiateFileTransferFromGuest `xml:"urn:vim25 InitiateFileTransferFromGuest,omitempty"` - Res *types.InitiateFileTransferFromGuestResponse `xml:"urn:vim25 InitiateFileTransferFromGuestResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *InitiateFileTransferFromGuestBody) Fault() *soap.Fault { return b.Fault_ } - -func InitiateFileTransferFromGuest(ctx context.Context, r soap.RoundTripper, req *types.InitiateFileTransferFromGuest) (*types.InitiateFileTransferFromGuestResponse, error) { - var reqBody, resBody InitiateFileTransferFromGuestBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type InitiateFileTransferToGuestBody struct { - Req *types.InitiateFileTransferToGuest `xml:"urn:vim25 InitiateFileTransferToGuest,omitempty"` - Res *types.InitiateFileTransferToGuestResponse `xml:"urn:vim25 InitiateFileTransferToGuestResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *InitiateFileTransferToGuestBody) Fault() *soap.Fault { return b.Fault_ } - -func InitiateFileTransferToGuest(ctx context.Context, r soap.RoundTripper, req *types.InitiateFileTransferToGuest) (*types.InitiateFileTransferToGuestResponse, error) { - var reqBody, resBody InitiateFileTransferToGuestBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type InstallHostPatchV2_TaskBody struct { - Req *types.InstallHostPatchV2_Task `xml:"urn:vim25 InstallHostPatchV2_Task,omitempty"` - Res *types.InstallHostPatchV2_TaskResponse `xml:"urn:vim25 InstallHostPatchV2_TaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *InstallHostPatchV2_TaskBody) Fault() *soap.Fault { return b.Fault_ } - -func InstallHostPatchV2_Task(ctx context.Context, r soap.RoundTripper, req *types.InstallHostPatchV2_Task) (*types.InstallHostPatchV2_TaskResponse, error) { - var reqBody, resBody InstallHostPatchV2_TaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type InstallHostPatch_TaskBody struct { - Req *types.InstallHostPatch_Task `xml:"urn:vim25 InstallHostPatch_Task,omitempty"` - Res *types.InstallHostPatch_TaskResponse `xml:"urn:vim25 InstallHostPatch_TaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *InstallHostPatch_TaskBody) Fault() *soap.Fault { return b.Fault_ } - -func InstallHostPatch_Task(ctx context.Context, r soap.RoundTripper, req *types.InstallHostPatch_Task) (*types.InstallHostPatch_TaskResponse, error) { - var reqBody, resBody InstallHostPatch_TaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type IsSharedGraphicsActiveBody struct { - Req *types.IsSharedGraphicsActive `xml:"urn:vim25 IsSharedGraphicsActive,omitempty"` - Res *types.IsSharedGraphicsActiveResponse `xml:"urn:vim25 IsSharedGraphicsActiveResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *IsSharedGraphicsActiveBody) Fault() *soap.Fault { return b.Fault_ } - -func IsSharedGraphicsActive(ctx context.Context, r soap.RoundTripper, req *types.IsSharedGraphicsActive) (*types.IsSharedGraphicsActiveResponse, error) { - var reqBody, resBody IsSharedGraphicsActiveBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type JoinDomainWithCAM_TaskBody struct { - Req *types.JoinDomainWithCAM_Task `xml:"urn:vim25 JoinDomainWithCAM_Task,omitempty"` - Res *types.JoinDomainWithCAM_TaskResponse `xml:"urn:vim25 JoinDomainWithCAM_TaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *JoinDomainWithCAM_TaskBody) Fault() *soap.Fault { return b.Fault_ } - -func JoinDomainWithCAM_Task(ctx context.Context, r soap.RoundTripper, req *types.JoinDomainWithCAM_Task) (*types.JoinDomainWithCAM_TaskResponse, error) { - var reqBody, resBody JoinDomainWithCAM_TaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type JoinDomain_TaskBody struct { - Req *types.JoinDomain_Task `xml:"urn:vim25 JoinDomain_Task,omitempty"` - Res *types.JoinDomain_TaskResponse `xml:"urn:vim25 JoinDomain_TaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *JoinDomain_TaskBody) Fault() *soap.Fault { return b.Fault_ } - -func JoinDomain_Task(ctx context.Context, r soap.RoundTripper, req *types.JoinDomain_Task) (*types.JoinDomain_TaskResponse, error) { - var reqBody, resBody JoinDomain_TaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type LeaveCurrentDomain_TaskBody struct { - Req *types.LeaveCurrentDomain_Task `xml:"urn:vim25 LeaveCurrentDomain_Task,omitempty"` - Res *types.LeaveCurrentDomain_TaskResponse `xml:"urn:vim25 LeaveCurrentDomain_TaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *LeaveCurrentDomain_TaskBody) Fault() *soap.Fault { return b.Fault_ } - -func LeaveCurrentDomain_Task(ctx context.Context, r soap.RoundTripper, req *types.LeaveCurrentDomain_Task) (*types.LeaveCurrentDomain_TaskResponse, error) { - var reqBody, resBody LeaveCurrentDomain_TaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type ListFilesInGuestBody struct { - Req *types.ListFilesInGuest `xml:"urn:vim25 ListFilesInGuest,omitempty"` - Res *types.ListFilesInGuestResponse `xml:"urn:vim25 ListFilesInGuestResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *ListFilesInGuestBody) Fault() *soap.Fault { return b.Fault_ } - -func ListFilesInGuest(ctx context.Context, r soap.RoundTripper, req *types.ListFilesInGuest) (*types.ListFilesInGuestResponse, error) { - var reqBody, resBody ListFilesInGuestBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type ListProcessesInGuestBody struct { - Req *types.ListProcessesInGuest `xml:"urn:vim25 ListProcessesInGuest,omitempty"` - Res *types.ListProcessesInGuestResponse `xml:"urn:vim25 ListProcessesInGuestResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *ListProcessesInGuestBody) Fault() *soap.Fault { return b.Fault_ } - -func ListProcessesInGuest(ctx context.Context, r soap.RoundTripper, req *types.ListProcessesInGuest) (*types.ListProcessesInGuestResponse, error) { - var reqBody, resBody ListProcessesInGuestBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type LogUserEventBody struct { - Req *types.LogUserEvent `xml:"urn:vim25 LogUserEvent,omitempty"` - Res *types.LogUserEventResponse `xml:"urn:vim25 LogUserEventResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *LogUserEventBody) Fault() *soap.Fault { return b.Fault_ } - -func LogUserEvent(ctx context.Context, r soap.RoundTripper, req *types.LogUserEvent) (*types.LogUserEventResponse, error) { - var reqBody, resBody LogUserEventBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type LoginBody struct { - Req *types.Login `xml:"urn:vim25 Login,omitempty"` - Res *types.LoginResponse `xml:"urn:vim25 LoginResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *LoginBody) Fault() *soap.Fault { return b.Fault_ } - -func Login(ctx context.Context, r soap.RoundTripper, req *types.Login) (*types.LoginResponse, error) { - var reqBody, resBody LoginBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type LoginBySSPIBody struct { - Req *types.LoginBySSPI `xml:"urn:vim25 LoginBySSPI,omitempty"` - Res *types.LoginBySSPIResponse `xml:"urn:vim25 LoginBySSPIResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *LoginBySSPIBody) Fault() *soap.Fault { return b.Fault_ } - -func LoginBySSPI(ctx context.Context, r soap.RoundTripper, req *types.LoginBySSPI) (*types.LoginBySSPIResponse, error) { - var reqBody, resBody LoginBySSPIBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type LoginByTokenBody struct { - Req *types.LoginByToken `xml:"urn:vim25 LoginByToken,omitempty"` - Res *types.LoginByTokenResponse `xml:"urn:vim25 LoginByTokenResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *LoginByTokenBody) Fault() *soap.Fault { return b.Fault_ } - -func LoginByToken(ctx context.Context, r soap.RoundTripper, req *types.LoginByToken) (*types.LoginByTokenResponse, error) { - var reqBody, resBody LoginByTokenBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type LoginExtensionByCertificateBody struct { - Req *types.LoginExtensionByCertificate `xml:"urn:vim25 LoginExtensionByCertificate,omitempty"` - Res *types.LoginExtensionByCertificateResponse `xml:"urn:vim25 LoginExtensionByCertificateResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *LoginExtensionByCertificateBody) Fault() *soap.Fault { return b.Fault_ } - -func LoginExtensionByCertificate(ctx context.Context, r soap.RoundTripper, req *types.LoginExtensionByCertificate) (*types.LoginExtensionByCertificateResponse, error) { - var reqBody, resBody LoginExtensionByCertificateBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type LoginExtensionBySubjectNameBody struct { - Req *types.LoginExtensionBySubjectName `xml:"urn:vim25 LoginExtensionBySubjectName,omitempty"` - Res *types.LoginExtensionBySubjectNameResponse `xml:"urn:vim25 LoginExtensionBySubjectNameResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *LoginExtensionBySubjectNameBody) Fault() *soap.Fault { return b.Fault_ } - -func LoginExtensionBySubjectName(ctx context.Context, r soap.RoundTripper, req *types.LoginExtensionBySubjectName) (*types.LoginExtensionBySubjectNameResponse, error) { - var reqBody, resBody LoginExtensionBySubjectNameBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type LogoutBody struct { - Req *types.Logout `xml:"urn:vim25 Logout,omitempty"` - Res *types.LogoutResponse `xml:"urn:vim25 LogoutResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *LogoutBody) Fault() *soap.Fault { return b.Fault_ } - -func Logout(ctx context.Context, r soap.RoundTripper, req *types.Logout) (*types.LogoutResponse, error) { - var reqBody, resBody LogoutBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type LookupDvPortGroupBody struct { - Req *types.LookupDvPortGroup `xml:"urn:vim25 LookupDvPortGroup,omitempty"` - Res *types.LookupDvPortGroupResponse `xml:"urn:vim25 LookupDvPortGroupResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *LookupDvPortGroupBody) Fault() *soap.Fault { return b.Fault_ } - -func LookupDvPortGroup(ctx context.Context, r soap.RoundTripper, req *types.LookupDvPortGroup) (*types.LookupDvPortGroupResponse, error) { - var reqBody, resBody LookupDvPortGroupBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type MakeDirectoryBody struct { - Req *types.MakeDirectory `xml:"urn:vim25 MakeDirectory,omitempty"` - Res *types.MakeDirectoryResponse `xml:"urn:vim25 MakeDirectoryResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *MakeDirectoryBody) Fault() *soap.Fault { return b.Fault_ } - -func MakeDirectory(ctx context.Context, r soap.RoundTripper, req *types.MakeDirectory) (*types.MakeDirectoryResponse, error) { - var reqBody, resBody MakeDirectoryBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type MakeDirectoryInGuestBody struct { - Req *types.MakeDirectoryInGuest `xml:"urn:vim25 MakeDirectoryInGuest,omitempty"` - Res *types.MakeDirectoryInGuestResponse `xml:"urn:vim25 MakeDirectoryInGuestResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *MakeDirectoryInGuestBody) Fault() *soap.Fault { return b.Fault_ } - -func MakeDirectoryInGuest(ctx context.Context, r soap.RoundTripper, req *types.MakeDirectoryInGuest) (*types.MakeDirectoryInGuestResponse, error) { - var reqBody, resBody MakeDirectoryInGuestBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type MakePrimaryVM_TaskBody struct { - Req *types.MakePrimaryVM_Task `xml:"urn:vim25 MakePrimaryVM_Task,omitempty"` - Res *types.MakePrimaryVM_TaskResponse `xml:"urn:vim25 MakePrimaryVM_TaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *MakePrimaryVM_TaskBody) Fault() *soap.Fault { return b.Fault_ } - -func MakePrimaryVM_Task(ctx context.Context, r soap.RoundTripper, req *types.MakePrimaryVM_Task) (*types.MakePrimaryVM_TaskResponse, error) { - var reqBody, resBody MakePrimaryVM_TaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type MarkAsTemplateBody struct { - Req *types.MarkAsTemplate `xml:"urn:vim25 MarkAsTemplate,omitempty"` - Res *types.MarkAsTemplateResponse `xml:"urn:vim25 MarkAsTemplateResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *MarkAsTemplateBody) Fault() *soap.Fault { return b.Fault_ } - -func MarkAsTemplate(ctx context.Context, r soap.RoundTripper, req *types.MarkAsTemplate) (*types.MarkAsTemplateResponse, error) { - var reqBody, resBody MarkAsTemplateBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type MarkAsVirtualMachineBody struct { - Req *types.MarkAsVirtualMachine `xml:"urn:vim25 MarkAsVirtualMachine,omitempty"` - Res *types.MarkAsVirtualMachineResponse `xml:"urn:vim25 MarkAsVirtualMachineResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *MarkAsVirtualMachineBody) Fault() *soap.Fault { return b.Fault_ } - -func MarkAsVirtualMachine(ctx context.Context, r soap.RoundTripper, req *types.MarkAsVirtualMachine) (*types.MarkAsVirtualMachineResponse, error) { - var reqBody, resBody MarkAsVirtualMachineBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type MarkForRemovalBody struct { - Req *types.MarkForRemoval `xml:"urn:vim25 MarkForRemoval,omitempty"` - Res *types.MarkForRemovalResponse `xml:"urn:vim25 MarkForRemovalResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *MarkForRemovalBody) Fault() *soap.Fault { return b.Fault_ } - -func MarkForRemoval(ctx context.Context, r soap.RoundTripper, req *types.MarkForRemoval) (*types.MarkForRemovalResponse, error) { - var reqBody, resBody MarkForRemovalBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type MergeDvs_TaskBody struct { - Req *types.MergeDvs_Task `xml:"urn:vim25 MergeDvs_Task,omitempty"` - Res *types.MergeDvs_TaskResponse `xml:"urn:vim25 MergeDvs_TaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *MergeDvs_TaskBody) Fault() *soap.Fault { return b.Fault_ } - -func MergeDvs_Task(ctx context.Context, r soap.RoundTripper, req *types.MergeDvs_Task) (*types.MergeDvs_TaskResponse, error) { - var reqBody, resBody MergeDvs_TaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type MergePermissionsBody struct { - Req *types.MergePermissions `xml:"urn:vim25 MergePermissions,omitempty"` - Res *types.MergePermissionsResponse `xml:"urn:vim25 MergePermissionsResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *MergePermissionsBody) Fault() *soap.Fault { return b.Fault_ } - -func MergePermissions(ctx context.Context, r soap.RoundTripper, req *types.MergePermissions) (*types.MergePermissionsResponse, error) { - var reqBody, resBody MergePermissionsBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type MigrateVM_TaskBody struct { - Req *types.MigrateVM_Task `xml:"urn:vim25 MigrateVM_Task,omitempty"` - Res *types.MigrateVM_TaskResponse `xml:"urn:vim25 MigrateVM_TaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *MigrateVM_TaskBody) Fault() *soap.Fault { return b.Fault_ } - -func MigrateVM_Task(ctx context.Context, r soap.RoundTripper, req *types.MigrateVM_Task) (*types.MigrateVM_TaskResponse, error) { - var reqBody, resBody MigrateVM_TaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type ModifyListViewBody struct { - Req *types.ModifyListView `xml:"urn:vim25 ModifyListView,omitempty"` - Res *types.ModifyListViewResponse `xml:"urn:vim25 ModifyListViewResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *ModifyListViewBody) Fault() *soap.Fault { return b.Fault_ } - -func ModifyListView(ctx context.Context, r soap.RoundTripper, req *types.ModifyListView) (*types.ModifyListViewResponse, error) { - var reqBody, resBody ModifyListViewBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type MountToolsInstallerBody struct { - Req *types.MountToolsInstaller `xml:"urn:vim25 MountToolsInstaller,omitempty"` - Res *types.MountToolsInstallerResponse `xml:"urn:vim25 MountToolsInstallerResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *MountToolsInstallerBody) Fault() *soap.Fault { return b.Fault_ } - -func MountToolsInstaller(ctx context.Context, r soap.RoundTripper, req *types.MountToolsInstaller) (*types.MountToolsInstallerResponse, error) { - var reqBody, resBody MountToolsInstallerBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type MountVffsVolumeBody struct { - Req *types.MountVffsVolume `xml:"urn:vim25 MountVffsVolume,omitempty"` - Res *types.MountVffsVolumeResponse `xml:"urn:vim25 MountVffsVolumeResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *MountVffsVolumeBody) Fault() *soap.Fault { return b.Fault_ } - -func MountVffsVolume(ctx context.Context, r soap.RoundTripper, req *types.MountVffsVolume) (*types.MountVffsVolumeResponse, error) { - var reqBody, resBody MountVffsVolumeBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type MountVmfsVolumeBody struct { - Req *types.MountVmfsVolume `xml:"urn:vim25 MountVmfsVolume,omitempty"` - Res *types.MountVmfsVolumeResponse `xml:"urn:vim25 MountVmfsVolumeResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *MountVmfsVolumeBody) Fault() *soap.Fault { return b.Fault_ } - -func MountVmfsVolume(ctx context.Context, r soap.RoundTripper, req *types.MountVmfsVolume) (*types.MountVmfsVolumeResponse, error) { - var reqBody, resBody MountVmfsVolumeBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type MoveDVPort_TaskBody struct { - Req *types.MoveDVPort_Task `xml:"urn:vim25 MoveDVPort_Task,omitempty"` - Res *types.MoveDVPort_TaskResponse `xml:"urn:vim25 MoveDVPort_TaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *MoveDVPort_TaskBody) Fault() *soap.Fault { return b.Fault_ } - -func MoveDVPort_Task(ctx context.Context, r soap.RoundTripper, req *types.MoveDVPort_Task) (*types.MoveDVPort_TaskResponse, error) { - var reqBody, resBody MoveDVPort_TaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type MoveDatastoreFile_TaskBody struct { - Req *types.MoveDatastoreFile_Task `xml:"urn:vim25 MoveDatastoreFile_Task,omitempty"` - Res *types.MoveDatastoreFile_TaskResponse `xml:"urn:vim25 MoveDatastoreFile_TaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *MoveDatastoreFile_TaskBody) Fault() *soap.Fault { return b.Fault_ } - -func MoveDatastoreFile_Task(ctx context.Context, r soap.RoundTripper, req *types.MoveDatastoreFile_Task) (*types.MoveDatastoreFile_TaskResponse, error) { - var reqBody, resBody MoveDatastoreFile_TaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type MoveDirectoryInGuestBody struct { - Req *types.MoveDirectoryInGuest `xml:"urn:vim25 MoveDirectoryInGuest,omitempty"` - Res *types.MoveDirectoryInGuestResponse `xml:"urn:vim25 MoveDirectoryInGuestResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *MoveDirectoryInGuestBody) Fault() *soap.Fault { return b.Fault_ } - -func MoveDirectoryInGuest(ctx context.Context, r soap.RoundTripper, req *types.MoveDirectoryInGuest) (*types.MoveDirectoryInGuestResponse, error) { - var reqBody, resBody MoveDirectoryInGuestBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type MoveFileInGuestBody struct { - Req *types.MoveFileInGuest `xml:"urn:vim25 MoveFileInGuest,omitempty"` - Res *types.MoveFileInGuestResponse `xml:"urn:vim25 MoveFileInGuestResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *MoveFileInGuestBody) Fault() *soap.Fault { return b.Fault_ } - -func MoveFileInGuest(ctx context.Context, r soap.RoundTripper, req *types.MoveFileInGuest) (*types.MoveFileInGuestResponse, error) { - var reqBody, resBody MoveFileInGuestBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type MoveHostInto_TaskBody struct { - Req *types.MoveHostInto_Task `xml:"urn:vim25 MoveHostInto_Task,omitempty"` - Res *types.MoveHostInto_TaskResponse `xml:"urn:vim25 MoveHostInto_TaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *MoveHostInto_TaskBody) Fault() *soap.Fault { return b.Fault_ } - -func MoveHostInto_Task(ctx context.Context, r soap.RoundTripper, req *types.MoveHostInto_Task) (*types.MoveHostInto_TaskResponse, error) { - var reqBody, resBody MoveHostInto_TaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type MoveIntoFolder_TaskBody struct { - Req *types.MoveIntoFolder_Task `xml:"urn:vim25 MoveIntoFolder_Task,omitempty"` - Res *types.MoveIntoFolder_TaskResponse `xml:"urn:vim25 MoveIntoFolder_TaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *MoveIntoFolder_TaskBody) Fault() *soap.Fault { return b.Fault_ } - -func MoveIntoFolder_Task(ctx context.Context, r soap.RoundTripper, req *types.MoveIntoFolder_Task) (*types.MoveIntoFolder_TaskResponse, error) { - var reqBody, resBody MoveIntoFolder_TaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type MoveIntoResourcePoolBody struct { - Req *types.MoveIntoResourcePool `xml:"urn:vim25 MoveIntoResourcePool,omitempty"` - Res *types.MoveIntoResourcePoolResponse `xml:"urn:vim25 MoveIntoResourcePoolResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *MoveIntoResourcePoolBody) Fault() *soap.Fault { return b.Fault_ } - -func MoveIntoResourcePool(ctx context.Context, r soap.RoundTripper, req *types.MoveIntoResourcePool) (*types.MoveIntoResourcePoolResponse, error) { - var reqBody, resBody MoveIntoResourcePoolBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type MoveInto_TaskBody struct { - Req *types.MoveInto_Task `xml:"urn:vim25 MoveInto_Task,omitempty"` - Res *types.MoveInto_TaskResponse `xml:"urn:vim25 MoveInto_TaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *MoveInto_TaskBody) Fault() *soap.Fault { return b.Fault_ } - -func MoveInto_Task(ctx context.Context, r soap.RoundTripper, req *types.MoveInto_Task) (*types.MoveInto_TaskResponse, error) { - var reqBody, resBody MoveInto_TaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type MoveVirtualDisk_TaskBody struct { - Req *types.MoveVirtualDisk_Task `xml:"urn:vim25 MoveVirtualDisk_Task,omitempty"` - Res *types.MoveVirtualDisk_TaskResponse `xml:"urn:vim25 MoveVirtualDisk_TaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *MoveVirtualDisk_TaskBody) Fault() *soap.Fault { return b.Fault_ } - -func MoveVirtualDisk_Task(ctx context.Context, r soap.RoundTripper, req *types.MoveVirtualDisk_Task) (*types.MoveVirtualDisk_TaskResponse, error) { - var reqBody, resBody MoveVirtualDisk_TaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type OpenInventoryViewFolderBody struct { - Req *types.OpenInventoryViewFolder `xml:"urn:vim25 OpenInventoryViewFolder,omitempty"` - Res *types.OpenInventoryViewFolderResponse `xml:"urn:vim25 OpenInventoryViewFolderResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *OpenInventoryViewFolderBody) Fault() *soap.Fault { return b.Fault_ } - -func OpenInventoryViewFolder(ctx context.Context, r soap.RoundTripper, req *types.OpenInventoryViewFolder) (*types.OpenInventoryViewFolderResponse, error) { - var reqBody, resBody OpenInventoryViewFolderBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type OverwriteCustomizationSpecBody struct { - Req *types.OverwriteCustomizationSpec `xml:"urn:vim25 OverwriteCustomizationSpec,omitempty"` - Res *types.OverwriteCustomizationSpecResponse `xml:"urn:vim25 OverwriteCustomizationSpecResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *OverwriteCustomizationSpecBody) Fault() *soap.Fault { return b.Fault_ } - -func OverwriteCustomizationSpec(ctx context.Context, r soap.RoundTripper, req *types.OverwriteCustomizationSpec) (*types.OverwriteCustomizationSpecResponse, error) { - var reqBody, resBody OverwriteCustomizationSpecBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type ParseDescriptorBody struct { - Req *types.ParseDescriptor `xml:"urn:vim25 ParseDescriptor,omitempty"` - Res *types.ParseDescriptorResponse `xml:"urn:vim25 ParseDescriptorResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *ParseDescriptorBody) Fault() *soap.Fault { return b.Fault_ } - -func ParseDescriptor(ctx context.Context, r soap.RoundTripper, req *types.ParseDescriptor) (*types.ParseDescriptorResponse, error) { - var reqBody, resBody ParseDescriptorBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type PerformDvsProductSpecOperation_TaskBody struct { - Req *types.PerformDvsProductSpecOperation_Task `xml:"urn:vim25 PerformDvsProductSpecOperation_Task,omitempty"` - Res *types.PerformDvsProductSpecOperation_TaskResponse `xml:"urn:vim25 PerformDvsProductSpecOperation_TaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *PerformDvsProductSpecOperation_TaskBody) Fault() *soap.Fault { return b.Fault_ } - -func PerformDvsProductSpecOperation_Task(ctx context.Context, r soap.RoundTripper, req *types.PerformDvsProductSpecOperation_Task) (*types.PerformDvsProductSpecOperation_TaskResponse, error) { - var reqBody, resBody PerformDvsProductSpecOperation_TaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type PostEventBody struct { - Req *types.PostEvent `xml:"urn:vim25 PostEvent,omitempty"` - Res *types.PostEventResponse `xml:"urn:vim25 PostEventResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *PostEventBody) Fault() *soap.Fault { return b.Fault_ } - -func PostEvent(ctx context.Context, r soap.RoundTripper, req *types.PostEvent) (*types.PostEventResponse, error) { - var reqBody, resBody PostEventBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type PowerDownHostToStandBy_TaskBody struct { - Req *types.PowerDownHostToStandBy_Task `xml:"urn:vim25 PowerDownHostToStandBy_Task,omitempty"` - Res *types.PowerDownHostToStandBy_TaskResponse `xml:"urn:vim25 PowerDownHostToStandBy_TaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *PowerDownHostToStandBy_TaskBody) Fault() *soap.Fault { return b.Fault_ } - -func PowerDownHostToStandBy_Task(ctx context.Context, r soap.RoundTripper, req *types.PowerDownHostToStandBy_Task) (*types.PowerDownHostToStandBy_TaskResponse, error) { - var reqBody, resBody PowerDownHostToStandBy_TaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type PowerOffVApp_TaskBody struct { - Req *types.PowerOffVApp_Task `xml:"urn:vim25 PowerOffVApp_Task,omitempty"` - Res *types.PowerOffVApp_TaskResponse `xml:"urn:vim25 PowerOffVApp_TaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *PowerOffVApp_TaskBody) Fault() *soap.Fault { return b.Fault_ } - -func PowerOffVApp_Task(ctx context.Context, r soap.RoundTripper, req *types.PowerOffVApp_Task) (*types.PowerOffVApp_TaskResponse, error) { - var reqBody, resBody PowerOffVApp_TaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type PowerOffVM_TaskBody struct { - Req *types.PowerOffVM_Task `xml:"urn:vim25 PowerOffVM_Task,omitempty"` - Res *types.PowerOffVM_TaskResponse `xml:"urn:vim25 PowerOffVM_TaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *PowerOffVM_TaskBody) Fault() *soap.Fault { return b.Fault_ } - -func PowerOffVM_Task(ctx context.Context, r soap.RoundTripper, req *types.PowerOffVM_Task) (*types.PowerOffVM_TaskResponse, error) { - var reqBody, resBody PowerOffVM_TaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type PowerOnMultiVM_TaskBody struct { - Req *types.PowerOnMultiVM_Task `xml:"urn:vim25 PowerOnMultiVM_Task,omitempty"` - Res *types.PowerOnMultiVM_TaskResponse `xml:"urn:vim25 PowerOnMultiVM_TaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *PowerOnMultiVM_TaskBody) Fault() *soap.Fault { return b.Fault_ } - -func PowerOnMultiVM_Task(ctx context.Context, r soap.RoundTripper, req *types.PowerOnMultiVM_Task) (*types.PowerOnMultiVM_TaskResponse, error) { - var reqBody, resBody PowerOnMultiVM_TaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type PowerOnVApp_TaskBody struct { - Req *types.PowerOnVApp_Task `xml:"urn:vim25 PowerOnVApp_Task,omitempty"` - Res *types.PowerOnVApp_TaskResponse `xml:"urn:vim25 PowerOnVApp_TaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *PowerOnVApp_TaskBody) Fault() *soap.Fault { return b.Fault_ } - -func PowerOnVApp_Task(ctx context.Context, r soap.RoundTripper, req *types.PowerOnVApp_Task) (*types.PowerOnVApp_TaskResponse, error) { - var reqBody, resBody PowerOnVApp_TaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type PowerOnVM_TaskBody struct { - Req *types.PowerOnVM_Task `xml:"urn:vim25 PowerOnVM_Task,omitempty"` - Res *types.PowerOnVM_TaskResponse `xml:"urn:vim25 PowerOnVM_TaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *PowerOnVM_TaskBody) Fault() *soap.Fault { return b.Fault_ } - -func PowerOnVM_Task(ctx context.Context, r soap.RoundTripper, req *types.PowerOnVM_Task) (*types.PowerOnVM_TaskResponse, error) { - var reqBody, resBody PowerOnVM_TaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type PowerUpHostFromStandBy_TaskBody struct { - Req *types.PowerUpHostFromStandBy_Task `xml:"urn:vim25 PowerUpHostFromStandBy_Task,omitempty"` - Res *types.PowerUpHostFromStandBy_TaskResponse `xml:"urn:vim25 PowerUpHostFromStandBy_TaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *PowerUpHostFromStandBy_TaskBody) Fault() *soap.Fault { return b.Fault_ } - -func PowerUpHostFromStandBy_Task(ctx context.Context, r soap.RoundTripper, req *types.PowerUpHostFromStandBy_Task) (*types.PowerUpHostFromStandBy_TaskResponse, error) { - var reqBody, resBody PowerUpHostFromStandBy_TaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type PromoteDisks_TaskBody struct { - Req *types.PromoteDisks_Task `xml:"urn:vim25 PromoteDisks_Task,omitempty"` - Res *types.PromoteDisks_TaskResponse `xml:"urn:vim25 PromoteDisks_TaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *PromoteDisks_TaskBody) Fault() *soap.Fault { return b.Fault_ } - -func PromoteDisks_Task(ctx context.Context, r soap.RoundTripper, req *types.PromoteDisks_Task) (*types.PromoteDisks_TaskResponse, error) { - var reqBody, resBody PromoteDisks_TaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type QueryAnswerFileStatusBody struct { - Req *types.QueryAnswerFileStatus `xml:"urn:vim25 QueryAnswerFileStatus,omitempty"` - Res *types.QueryAnswerFileStatusResponse `xml:"urn:vim25 QueryAnswerFileStatusResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *QueryAnswerFileStatusBody) Fault() *soap.Fault { return b.Fault_ } - -func QueryAnswerFileStatus(ctx context.Context, r soap.RoundTripper, req *types.QueryAnswerFileStatus) (*types.QueryAnswerFileStatusResponse, error) { - var reqBody, resBody QueryAnswerFileStatusBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type QueryAssignedLicensesBody struct { - Req *types.QueryAssignedLicenses `xml:"urn:vim25 QueryAssignedLicenses,omitempty"` - Res *types.QueryAssignedLicensesResponse `xml:"urn:vim25 QueryAssignedLicensesResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *QueryAssignedLicensesBody) Fault() *soap.Fault { return b.Fault_ } - -func QueryAssignedLicenses(ctx context.Context, r soap.RoundTripper, req *types.QueryAssignedLicenses) (*types.QueryAssignedLicensesResponse, error) { - var reqBody, resBody QueryAssignedLicensesBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type QueryAvailableDisksForVmfsBody struct { - Req *types.QueryAvailableDisksForVmfs `xml:"urn:vim25 QueryAvailableDisksForVmfs,omitempty"` - Res *types.QueryAvailableDisksForVmfsResponse `xml:"urn:vim25 QueryAvailableDisksForVmfsResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *QueryAvailableDisksForVmfsBody) Fault() *soap.Fault { return b.Fault_ } - -func QueryAvailableDisksForVmfs(ctx context.Context, r soap.RoundTripper, req *types.QueryAvailableDisksForVmfs) (*types.QueryAvailableDisksForVmfsResponse, error) { - var reqBody, resBody QueryAvailableDisksForVmfsBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type QueryAvailableDvsSpecBody struct { - Req *types.QueryAvailableDvsSpec `xml:"urn:vim25 QueryAvailableDvsSpec,omitempty"` - Res *types.QueryAvailableDvsSpecResponse `xml:"urn:vim25 QueryAvailableDvsSpecResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *QueryAvailableDvsSpecBody) Fault() *soap.Fault { return b.Fault_ } - -func QueryAvailableDvsSpec(ctx context.Context, r soap.RoundTripper, req *types.QueryAvailableDvsSpec) (*types.QueryAvailableDvsSpecResponse, error) { - var reqBody, resBody QueryAvailableDvsSpecBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type QueryAvailablePartitionBody struct { - Req *types.QueryAvailablePartition `xml:"urn:vim25 QueryAvailablePartition,omitempty"` - Res *types.QueryAvailablePartitionResponse `xml:"urn:vim25 QueryAvailablePartitionResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *QueryAvailablePartitionBody) Fault() *soap.Fault { return b.Fault_ } - -func QueryAvailablePartition(ctx context.Context, r soap.RoundTripper, req *types.QueryAvailablePartition) (*types.QueryAvailablePartitionResponse, error) { - var reqBody, resBody QueryAvailablePartitionBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type QueryAvailablePerfMetricBody struct { - Req *types.QueryAvailablePerfMetric `xml:"urn:vim25 QueryAvailablePerfMetric,omitempty"` - Res *types.QueryAvailablePerfMetricResponse `xml:"urn:vim25 QueryAvailablePerfMetricResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *QueryAvailablePerfMetricBody) Fault() *soap.Fault { return b.Fault_ } - -func QueryAvailablePerfMetric(ctx context.Context, r soap.RoundTripper, req *types.QueryAvailablePerfMetric) (*types.QueryAvailablePerfMetricResponse, error) { - var reqBody, resBody QueryAvailablePerfMetricBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type QueryAvailableSsdsBody struct { - Req *types.QueryAvailableSsds `xml:"urn:vim25 QueryAvailableSsds,omitempty"` - Res *types.QueryAvailableSsdsResponse `xml:"urn:vim25 QueryAvailableSsdsResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *QueryAvailableSsdsBody) Fault() *soap.Fault { return b.Fault_ } - -func QueryAvailableSsds(ctx context.Context, r soap.RoundTripper, req *types.QueryAvailableSsds) (*types.QueryAvailableSsdsResponse, error) { - var reqBody, resBody QueryAvailableSsdsBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type QueryAvailableTimeZonesBody struct { - Req *types.QueryAvailableTimeZones `xml:"urn:vim25 QueryAvailableTimeZones,omitempty"` - Res *types.QueryAvailableTimeZonesResponse `xml:"urn:vim25 QueryAvailableTimeZonesResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *QueryAvailableTimeZonesBody) Fault() *soap.Fault { return b.Fault_ } - -func QueryAvailableTimeZones(ctx context.Context, r soap.RoundTripper, req *types.QueryAvailableTimeZones) (*types.QueryAvailableTimeZonesResponse, error) { - var reqBody, resBody QueryAvailableTimeZonesBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type QueryBootDevicesBody struct { - Req *types.QueryBootDevices `xml:"urn:vim25 QueryBootDevices,omitempty"` - Res *types.QueryBootDevicesResponse `xml:"urn:vim25 QueryBootDevicesResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *QueryBootDevicesBody) Fault() *soap.Fault { return b.Fault_ } - -func QueryBootDevices(ctx context.Context, r soap.RoundTripper, req *types.QueryBootDevices) (*types.QueryBootDevicesResponse, error) { - var reqBody, resBody QueryBootDevicesBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type QueryBoundVnicsBody struct { - Req *types.QueryBoundVnics `xml:"urn:vim25 QueryBoundVnics,omitempty"` - Res *types.QueryBoundVnicsResponse `xml:"urn:vim25 QueryBoundVnicsResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *QueryBoundVnicsBody) Fault() *soap.Fault { return b.Fault_ } - -func QueryBoundVnics(ctx context.Context, r soap.RoundTripper, req *types.QueryBoundVnics) (*types.QueryBoundVnicsResponse, error) { - var reqBody, resBody QueryBoundVnicsBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type QueryCandidateNicsBody struct { - Req *types.QueryCandidateNics `xml:"urn:vim25 QueryCandidateNics,omitempty"` - Res *types.QueryCandidateNicsResponse `xml:"urn:vim25 QueryCandidateNicsResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *QueryCandidateNicsBody) Fault() *soap.Fault { return b.Fault_ } - -func QueryCandidateNics(ctx context.Context, r soap.RoundTripper, req *types.QueryCandidateNics) (*types.QueryCandidateNicsResponse, error) { - var reqBody, resBody QueryCandidateNicsBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type QueryChangedDiskAreasBody struct { - Req *types.QueryChangedDiskAreas `xml:"urn:vim25 QueryChangedDiskAreas,omitempty"` - Res *types.QueryChangedDiskAreasResponse `xml:"urn:vim25 QueryChangedDiskAreasResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *QueryChangedDiskAreasBody) Fault() *soap.Fault { return b.Fault_ } - -func QueryChangedDiskAreas(ctx context.Context, r soap.RoundTripper, req *types.QueryChangedDiskAreas) (*types.QueryChangedDiskAreasResponse, error) { - var reqBody, resBody QueryChangedDiskAreasBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type QueryCmmdsBody struct { - Req *types.QueryCmmds `xml:"urn:vim25 QueryCmmds,omitempty"` - Res *types.QueryCmmdsResponse `xml:"urn:vim25 QueryCmmdsResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *QueryCmmdsBody) Fault() *soap.Fault { return b.Fault_ } - -func QueryCmmds(ctx context.Context, r soap.RoundTripper, req *types.QueryCmmds) (*types.QueryCmmdsResponse, error) { - var reqBody, resBody QueryCmmdsBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type QueryCompatibleHostForExistingDvsBody struct { - Req *types.QueryCompatibleHostForExistingDvs `xml:"urn:vim25 QueryCompatibleHostForExistingDvs,omitempty"` - Res *types.QueryCompatibleHostForExistingDvsResponse `xml:"urn:vim25 QueryCompatibleHostForExistingDvsResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *QueryCompatibleHostForExistingDvsBody) Fault() *soap.Fault { return b.Fault_ } - -func QueryCompatibleHostForExistingDvs(ctx context.Context, r soap.RoundTripper, req *types.QueryCompatibleHostForExistingDvs) (*types.QueryCompatibleHostForExistingDvsResponse, error) { - var reqBody, resBody QueryCompatibleHostForExistingDvsBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type QueryCompatibleHostForNewDvsBody struct { - Req *types.QueryCompatibleHostForNewDvs `xml:"urn:vim25 QueryCompatibleHostForNewDvs,omitempty"` - Res *types.QueryCompatibleHostForNewDvsResponse `xml:"urn:vim25 QueryCompatibleHostForNewDvsResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *QueryCompatibleHostForNewDvsBody) Fault() *soap.Fault { return b.Fault_ } - -func QueryCompatibleHostForNewDvs(ctx context.Context, r soap.RoundTripper, req *types.QueryCompatibleHostForNewDvs) (*types.QueryCompatibleHostForNewDvsResponse, error) { - var reqBody, resBody QueryCompatibleHostForNewDvsBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type QueryComplianceStatusBody struct { - Req *types.QueryComplianceStatus `xml:"urn:vim25 QueryComplianceStatus,omitempty"` - Res *types.QueryComplianceStatusResponse `xml:"urn:vim25 QueryComplianceStatusResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *QueryComplianceStatusBody) Fault() *soap.Fault { return b.Fault_ } - -func QueryComplianceStatus(ctx context.Context, r soap.RoundTripper, req *types.QueryComplianceStatus) (*types.QueryComplianceStatusResponse, error) { - var reqBody, resBody QueryComplianceStatusBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type QueryConfigOptionBody struct { - Req *types.QueryConfigOption `xml:"urn:vim25 QueryConfigOption,omitempty"` - Res *types.QueryConfigOptionResponse `xml:"urn:vim25 QueryConfigOptionResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *QueryConfigOptionBody) Fault() *soap.Fault { return b.Fault_ } - -func QueryConfigOption(ctx context.Context, r soap.RoundTripper, req *types.QueryConfigOption) (*types.QueryConfigOptionResponse, error) { - var reqBody, resBody QueryConfigOptionBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type QueryConfigOptionDescriptorBody struct { - Req *types.QueryConfigOptionDescriptor `xml:"urn:vim25 QueryConfigOptionDescriptor,omitempty"` - Res *types.QueryConfigOptionDescriptorResponse `xml:"urn:vim25 QueryConfigOptionDescriptorResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *QueryConfigOptionDescriptorBody) Fault() *soap.Fault { return b.Fault_ } - -func QueryConfigOptionDescriptor(ctx context.Context, r soap.RoundTripper, req *types.QueryConfigOptionDescriptor) (*types.QueryConfigOptionDescriptorResponse, error) { - var reqBody, resBody QueryConfigOptionDescriptorBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type QueryConfigTargetBody struct { - Req *types.QueryConfigTarget `xml:"urn:vim25 QueryConfigTarget,omitempty"` - Res *types.QueryConfigTargetResponse `xml:"urn:vim25 QueryConfigTargetResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *QueryConfigTargetBody) Fault() *soap.Fault { return b.Fault_ } - -func QueryConfigTarget(ctx context.Context, r soap.RoundTripper, req *types.QueryConfigTarget) (*types.QueryConfigTargetResponse, error) { - var reqBody, resBody QueryConfigTargetBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type QueryConfiguredModuleOptionStringBody struct { - Req *types.QueryConfiguredModuleOptionString `xml:"urn:vim25 QueryConfiguredModuleOptionString,omitempty"` - Res *types.QueryConfiguredModuleOptionStringResponse `xml:"urn:vim25 QueryConfiguredModuleOptionStringResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *QueryConfiguredModuleOptionStringBody) Fault() *soap.Fault { return b.Fault_ } - -func QueryConfiguredModuleOptionString(ctx context.Context, r soap.RoundTripper, req *types.QueryConfiguredModuleOptionString) (*types.QueryConfiguredModuleOptionStringResponse, error) { - var reqBody, resBody QueryConfiguredModuleOptionStringBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type QueryConnectionInfoBody struct { - Req *types.QueryConnectionInfo `xml:"urn:vim25 QueryConnectionInfo,omitempty"` - Res *types.QueryConnectionInfoResponse `xml:"urn:vim25 QueryConnectionInfoResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *QueryConnectionInfoBody) Fault() *soap.Fault { return b.Fault_ } - -func QueryConnectionInfo(ctx context.Context, r soap.RoundTripper, req *types.QueryConnectionInfo) (*types.QueryConnectionInfoResponse, error) { - var reqBody, resBody QueryConnectionInfoBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type QueryDatastorePerformanceSummaryBody struct { - Req *types.QueryDatastorePerformanceSummary `xml:"urn:vim25 QueryDatastorePerformanceSummary,omitempty"` - Res *types.QueryDatastorePerformanceSummaryResponse `xml:"urn:vim25 QueryDatastorePerformanceSummaryResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *QueryDatastorePerformanceSummaryBody) Fault() *soap.Fault { return b.Fault_ } - -func QueryDatastorePerformanceSummary(ctx context.Context, r soap.RoundTripper, req *types.QueryDatastorePerformanceSummary) (*types.QueryDatastorePerformanceSummaryResponse, error) { - var reqBody, resBody QueryDatastorePerformanceSummaryBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type QueryDateTimeBody struct { - Req *types.QueryDateTime `xml:"urn:vim25 QueryDateTime,omitempty"` - Res *types.QueryDateTimeResponse `xml:"urn:vim25 QueryDateTimeResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *QueryDateTimeBody) Fault() *soap.Fault { return b.Fault_ } - -func QueryDateTime(ctx context.Context, r soap.RoundTripper, req *types.QueryDateTime) (*types.QueryDateTimeResponse, error) { - var reqBody, resBody QueryDateTimeBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type QueryDescriptionsBody struct { - Req *types.QueryDescriptions `xml:"urn:vim25 QueryDescriptions,omitempty"` - Res *types.QueryDescriptionsResponse `xml:"urn:vim25 QueryDescriptionsResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *QueryDescriptionsBody) Fault() *soap.Fault { return b.Fault_ } - -func QueryDescriptions(ctx context.Context, r soap.RoundTripper, req *types.QueryDescriptions) (*types.QueryDescriptionsResponse, error) { - var reqBody, resBody QueryDescriptionsBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type QueryDisksForVsanBody struct { - Req *types.QueryDisksForVsan `xml:"urn:vim25 QueryDisksForVsan,omitempty"` - Res *types.QueryDisksForVsanResponse `xml:"urn:vim25 QueryDisksForVsanResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *QueryDisksForVsanBody) Fault() *soap.Fault { return b.Fault_ } - -func QueryDisksForVsan(ctx context.Context, r soap.RoundTripper, req *types.QueryDisksForVsan) (*types.QueryDisksForVsanResponse, error) { - var reqBody, resBody QueryDisksForVsanBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type QueryDvsByUuidBody struct { - Req *types.QueryDvsByUuid `xml:"urn:vim25 QueryDvsByUuid,omitempty"` - Res *types.QueryDvsByUuidResponse `xml:"urn:vim25 QueryDvsByUuidResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *QueryDvsByUuidBody) Fault() *soap.Fault { return b.Fault_ } - -func QueryDvsByUuid(ctx context.Context, r soap.RoundTripper, req *types.QueryDvsByUuid) (*types.QueryDvsByUuidResponse, error) { - var reqBody, resBody QueryDvsByUuidBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type QueryDvsCheckCompatibilityBody struct { - Req *types.QueryDvsCheckCompatibility `xml:"urn:vim25 QueryDvsCheckCompatibility,omitempty"` - Res *types.QueryDvsCheckCompatibilityResponse `xml:"urn:vim25 QueryDvsCheckCompatibilityResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *QueryDvsCheckCompatibilityBody) Fault() *soap.Fault { return b.Fault_ } - -func QueryDvsCheckCompatibility(ctx context.Context, r soap.RoundTripper, req *types.QueryDvsCheckCompatibility) (*types.QueryDvsCheckCompatibilityResponse, error) { - var reqBody, resBody QueryDvsCheckCompatibilityBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type QueryDvsCompatibleHostSpecBody struct { - Req *types.QueryDvsCompatibleHostSpec `xml:"urn:vim25 QueryDvsCompatibleHostSpec,omitempty"` - Res *types.QueryDvsCompatibleHostSpecResponse `xml:"urn:vim25 QueryDvsCompatibleHostSpecResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *QueryDvsCompatibleHostSpecBody) Fault() *soap.Fault { return b.Fault_ } - -func QueryDvsCompatibleHostSpec(ctx context.Context, r soap.RoundTripper, req *types.QueryDvsCompatibleHostSpec) (*types.QueryDvsCompatibleHostSpecResponse, error) { - var reqBody, resBody QueryDvsCompatibleHostSpecBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type QueryDvsConfigTargetBody struct { - Req *types.QueryDvsConfigTarget `xml:"urn:vim25 QueryDvsConfigTarget,omitempty"` - Res *types.QueryDvsConfigTargetResponse `xml:"urn:vim25 QueryDvsConfigTargetResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *QueryDvsConfigTargetBody) Fault() *soap.Fault { return b.Fault_ } - -func QueryDvsConfigTarget(ctx context.Context, r soap.RoundTripper, req *types.QueryDvsConfigTarget) (*types.QueryDvsConfigTargetResponse, error) { - var reqBody, resBody QueryDvsConfigTargetBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type QueryDvsFeatureCapabilityBody struct { - Req *types.QueryDvsFeatureCapability `xml:"urn:vim25 QueryDvsFeatureCapability,omitempty"` - Res *types.QueryDvsFeatureCapabilityResponse `xml:"urn:vim25 QueryDvsFeatureCapabilityResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *QueryDvsFeatureCapabilityBody) Fault() *soap.Fault { return b.Fault_ } - -func QueryDvsFeatureCapability(ctx context.Context, r soap.RoundTripper, req *types.QueryDvsFeatureCapability) (*types.QueryDvsFeatureCapabilityResponse, error) { - var reqBody, resBody QueryDvsFeatureCapabilityBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type QueryEventsBody struct { - Req *types.QueryEvents `xml:"urn:vim25 QueryEvents,omitempty"` - Res *types.QueryEventsResponse `xml:"urn:vim25 QueryEventsResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *QueryEventsBody) Fault() *soap.Fault { return b.Fault_ } - -func QueryEvents(ctx context.Context, r soap.RoundTripper, req *types.QueryEvents) (*types.QueryEventsResponse, error) { - var reqBody, resBody QueryEventsBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type QueryExpressionMetadataBody struct { - Req *types.QueryExpressionMetadata `xml:"urn:vim25 QueryExpressionMetadata,omitempty"` - Res *types.QueryExpressionMetadataResponse `xml:"urn:vim25 QueryExpressionMetadataResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *QueryExpressionMetadataBody) Fault() *soap.Fault { return b.Fault_ } - -func QueryExpressionMetadata(ctx context.Context, r soap.RoundTripper, req *types.QueryExpressionMetadata) (*types.QueryExpressionMetadataResponse, error) { - var reqBody, resBody QueryExpressionMetadataBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type QueryExtensionIpAllocationUsageBody struct { - Req *types.QueryExtensionIpAllocationUsage `xml:"urn:vim25 QueryExtensionIpAllocationUsage,omitempty"` - Res *types.QueryExtensionIpAllocationUsageResponse `xml:"urn:vim25 QueryExtensionIpAllocationUsageResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *QueryExtensionIpAllocationUsageBody) Fault() *soap.Fault { return b.Fault_ } - -func QueryExtensionIpAllocationUsage(ctx context.Context, r soap.RoundTripper, req *types.QueryExtensionIpAllocationUsage) (*types.QueryExtensionIpAllocationUsageResponse, error) { - var reqBody, resBody QueryExtensionIpAllocationUsageBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type QueryFaultToleranceCompatibilityBody struct { - Req *types.QueryFaultToleranceCompatibility `xml:"urn:vim25 QueryFaultToleranceCompatibility,omitempty"` - Res *types.QueryFaultToleranceCompatibilityResponse `xml:"urn:vim25 QueryFaultToleranceCompatibilityResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *QueryFaultToleranceCompatibilityBody) Fault() *soap.Fault { return b.Fault_ } - -func QueryFaultToleranceCompatibility(ctx context.Context, r soap.RoundTripper, req *types.QueryFaultToleranceCompatibility) (*types.QueryFaultToleranceCompatibilityResponse, error) { - var reqBody, resBody QueryFaultToleranceCompatibilityBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type QueryFirmwareConfigUploadURLBody struct { - Req *types.QueryFirmwareConfigUploadURL `xml:"urn:vim25 QueryFirmwareConfigUploadURL,omitempty"` - Res *types.QueryFirmwareConfigUploadURLResponse `xml:"urn:vim25 QueryFirmwareConfigUploadURLResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *QueryFirmwareConfigUploadURLBody) Fault() *soap.Fault { return b.Fault_ } - -func QueryFirmwareConfigUploadURL(ctx context.Context, r soap.RoundTripper, req *types.QueryFirmwareConfigUploadURL) (*types.QueryFirmwareConfigUploadURLResponse, error) { - var reqBody, resBody QueryFirmwareConfigUploadURLBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type QueryHostConnectionInfoBody struct { - Req *types.QueryHostConnectionInfo `xml:"urn:vim25 QueryHostConnectionInfo,omitempty"` - Res *types.QueryHostConnectionInfoResponse `xml:"urn:vim25 QueryHostConnectionInfoResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *QueryHostConnectionInfoBody) Fault() *soap.Fault { return b.Fault_ } - -func QueryHostConnectionInfo(ctx context.Context, r soap.RoundTripper, req *types.QueryHostConnectionInfo) (*types.QueryHostConnectionInfoResponse, error) { - var reqBody, resBody QueryHostConnectionInfoBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type QueryHostPatch_TaskBody struct { - Req *types.QueryHostPatch_Task `xml:"urn:vim25 QueryHostPatch_Task,omitempty"` - Res *types.QueryHostPatch_TaskResponse `xml:"urn:vim25 QueryHostPatch_TaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *QueryHostPatch_TaskBody) Fault() *soap.Fault { return b.Fault_ } - -func QueryHostPatch_Task(ctx context.Context, r soap.RoundTripper, req *types.QueryHostPatch_Task) (*types.QueryHostPatch_TaskResponse, error) { - var reqBody, resBody QueryHostPatch_TaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type QueryHostProfileMetadataBody struct { - Req *types.QueryHostProfileMetadata `xml:"urn:vim25 QueryHostProfileMetadata,omitempty"` - Res *types.QueryHostProfileMetadataResponse `xml:"urn:vim25 QueryHostProfileMetadataResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *QueryHostProfileMetadataBody) Fault() *soap.Fault { return b.Fault_ } - -func QueryHostProfileMetadata(ctx context.Context, r soap.RoundTripper, req *types.QueryHostProfileMetadata) (*types.QueryHostProfileMetadataResponse, error) { - var reqBody, resBody QueryHostProfileMetadataBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type QueryHostStatusBody struct { - Req *types.QueryHostStatus `xml:"urn:vim25 QueryHostStatus,omitempty"` - Res *types.QueryHostStatusResponse `xml:"urn:vim25 QueryHostStatusResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *QueryHostStatusBody) Fault() *soap.Fault { return b.Fault_ } - -func QueryHostStatus(ctx context.Context, r soap.RoundTripper, req *types.QueryHostStatus) (*types.QueryHostStatusResponse, error) { - var reqBody, resBody QueryHostStatusBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type QueryIORMConfigOptionBody struct { - Req *types.QueryIORMConfigOption `xml:"urn:vim25 QueryIORMConfigOption,omitempty"` - Res *types.QueryIORMConfigOptionResponse `xml:"urn:vim25 QueryIORMConfigOptionResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *QueryIORMConfigOptionBody) Fault() *soap.Fault { return b.Fault_ } - -func QueryIORMConfigOption(ctx context.Context, r soap.RoundTripper, req *types.QueryIORMConfigOption) (*types.QueryIORMConfigOptionResponse, error) { - var reqBody, resBody QueryIORMConfigOptionBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type QueryIPAllocationsBody struct { - Req *types.QueryIPAllocations `xml:"urn:vim25 QueryIPAllocations,omitempty"` - Res *types.QueryIPAllocationsResponse `xml:"urn:vim25 QueryIPAllocationsResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *QueryIPAllocationsBody) Fault() *soap.Fault { return b.Fault_ } - -func QueryIPAllocations(ctx context.Context, r soap.RoundTripper, req *types.QueryIPAllocations) (*types.QueryIPAllocationsResponse, error) { - var reqBody, resBody QueryIPAllocationsBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type QueryIpPoolsBody struct { - Req *types.QueryIpPools `xml:"urn:vim25 QueryIpPools,omitempty"` - Res *types.QueryIpPoolsResponse `xml:"urn:vim25 QueryIpPoolsResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *QueryIpPoolsBody) Fault() *soap.Fault { return b.Fault_ } - -func QueryIpPools(ctx context.Context, r soap.RoundTripper, req *types.QueryIpPools) (*types.QueryIpPoolsResponse, error) { - var reqBody, resBody QueryIpPoolsBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type QueryLicenseSourceAvailabilityBody struct { - Req *types.QueryLicenseSourceAvailability `xml:"urn:vim25 QueryLicenseSourceAvailability,omitempty"` - Res *types.QueryLicenseSourceAvailabilityResponse `xml:"urn:vim25 QueryLicenseSourceAvailabilityResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *QueryLicenseSourceAvailabilityBody) Fault() *soap.Fault { return b.Fault_ } - -func QueryLicenseSourceAvailability(ctx context.Context, r soap.RoundTripper, req *types.QueryLicenseSourceAvailability) (*types.QueryLicenseSourceAvailabilityResponse, error) { - var reqBody, resBody QueryLicenseSourceAvailabilityBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type QueryLicenseUsageBody struct { - Req *types.QueryLicenseUsage `xml:"urn:vim25 QueryLicenseUsage,omitempty"` - Res *types.QueryLicenseUsageResponse `xml:"urn:vim25 QueryLicenseUsageResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *QueryLicenseUsageBody) Fault() *soap.Fault { return b.Fault_ } - -func QueryLicenseUsage(ctx context.Context, r soap.RoundTripper, req *types.QueryLicenseUsage) (*types.QueryLicenseUsageResponse, error) { - var reqBody, resBody QueryLicenseUsageBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type QueryManagedByBody struct { - Req *types.QueryManagedBy `xml:"urn:vim25 QueryManagedBy,omitempty"` - Res *types.QueryManagedByResponse `xml:"urn:vim25 QueryManagedByResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *QueryManagedByBody) Fault() *soap.Fault { return b.Fault_ } - -func QueryManagedBy(ctx context.Context, r soap.RoundTripper, req *types.QueryManagedBy) (*types.QueryManagedByResponse, error) { - var reqBody, resBody QueryManagedByBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type QueryMemoryOverheadBody struct { - Req *types.QueryMemoryOverhead `xml:"urn:vim25 QueryMemoryOverhead,omitempty"` - Res *types.QueryMemoryOverheadResponse `xml:"urn:vim25 QueryMemoryOverheadResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *QueryMemoryOverheadBody) Fault() *soap.Fault { return b.Fault_ } - -func QueryMemoryOverhead(ctx context.Context, r soap.RoundTripper, req *types.QueryMemoryOverhead) (*types.QueryMemoryOverheadResponse, error) { - var reqBody, resBody QueryMemoryOverheadBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type QueryMemoryOverheadExBody struct { - Req *types.QueryMemoryOverheadEx `xml:"urn:vim25 QueryMemoryOverheadEx,omitempty"` - Res *types.QueryMemoryOverheadExResponse `xml:"urn:vim25 QueryMemoryOverheadExResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *QueryMemoryOverheadExBody) Fault() *soap.Fault { return b.Fault_ } - -func QueryMemoryOverheadEx(ctx context.Context, r soap.RoundTripper, req *types.QueryMemoryOverheadEx) (*types.QueryMemoryOverheadExResponse, error) { - var reqBody, resBody QueryMemoryOverheadExBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type QueryMigrationDependenciesBody struct { - Req *types.QueryMigrationDependencies `xml:"urn:vim25 QueryMigrationDependencies,omitempty"` - Res *types.QueryMigrationDependenciesResponse `xml:"urn:vim25 QueryMigrationDependenciesResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *QueryMigrationDependenciesBody) Fault() *soap.Fault { return b.Fault_ } - -func QueryMigrationDependencies(ctx context.Context, r soap.RoundTripper, req *types.QueryMigrationDependencies) (*types.QueryMigrationDependenciesResponse, error) { - var reqBody, resBody QueryMigrationDependenciesBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type QueryModulesBody struct { - Req *types.QueryModules `xml:"urn:vim25 QueryModules,omitempty"` - Res *types.QueryModulesResponse `xml:"urn:vim25 QueryModulesResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *QueryModulesBody) Fault() *soap.Fault { return b.Fault_ } - -func QueryModules(ctx context.Context, r soap.RoundTripper, req *types.QueryModules) (*types.QueryModulesResponse, error) { - var reqBody, resBody QueryModulesBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type QueryNetConfigBody struct { - Req *types.QueryNetConfig `xml:"urn:vim25 QueryNetConfig,omitempty"` - Res *types.QueryNetConfigResponse `xml:"urn:vim25 QueryNetConfigResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *QueryNetConfigBody) Fault() *soap.Fault { return b.Fault_ } - -func QueryNetConfig(ctx context.Context, r soap.RoundTripper, req *types.QueryNetConfig) (*types.QueryNetConfigResponse, error) { - var reqBody, resBody QueryNetConfigBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type QueryNetworkHintBody struct { - Req *types.QueryNetworkHint `xml:"urn:vim25 QueryNetworkHint,omitempty"` - Res *types.QueryNetworkHintResponse `xml:"urn:vim25 QueryNetworkHintResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *QueryNetworkHintBody) Fault() *soap.Fault { return b.Fault_ } - -func QueryNetworkHint(ctx context.Context, r soap.RoundTripper, req *types.QueryNetworkHint) (*types.QueryNetworkHintResponse, error) { - var reqBody, resBody QueryNetworkHintBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type QueryObjectsOnPhysicalVsanDiskBody struct { - Req *types.QueryObjectsOnPhysicalVsanDisk `xml:"urn:vim25 QueryObjectsOnPhysicalVsanDisk,omitempty"` - Res *types.QueryObjectsOnPhysicalVsanDiskResponse `xml:"urn:vim25 QueryObjectsOnPhysicalVsanDiskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *QueryObjectsOnPhysicalVsanDiskBody) Fault() *soap.Fault { return b.Fault_ } - -func QueryObjectsOnPhysicalVsanDisk(ctx context.Context, r soap.RoundTripper, req *types.QueryObjectsOnPhysicalVsanDisk) (*types.QueryObjectsOnPhysicalVsanDiskResponse, error) { - var reqBody, resBody QueryObjectsOnPhysicalVsanDiskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type QueryOptionsBody struct { - Req *types.QueryOptions `xml:"urn:vim25 QueryOptions,omitempty"` - Res *types.QueryOptionsResponse `xml:"urn:vim25 QueryOptionsResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *QueryOptionsBody) Fault() *soap.Fault { return b.Fault_ } - -func QueryOptions(ctx context.Context, r soap.RoundTripper, req *types.QueryOptions) (*types.QueryOptionsResponse, error) { - var reqBody, resBody QueryOptionsBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type QueryPartitionCreateDescBody struct { - Req *types.QueryPartitionCreateDesc `xml:"urn:vim25 QueryPartitionCreateDesc,omitempty"` - Res *types.QueryPartitionCreateDescResponse `xml:"urn:vim25 QueryPartitionCreateDescResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *QueryPartitionCreateDescBody) Fault() *soap.Fault { return b.Fault_ } - -func QueryPartitionCreateDesc(ctx context.Context, r soap.RoundTripper, req *types.QueryPartitionCreateDesc) (*types.QueryPartitionCreateDescResponse, error) { - var reqBody, resBody QueryPartitionCreateDescBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type QueryPartitionCreateOptionsBody struct { - Req *types.QueryPartitionCreateOptions `xml:"urn:vim25 QueryPartitionCreateOptions,omitempty"` - Res *types.QueryPartitionCreateOptionsResponse `xml:"urn:vim25 QueryPartitionCreateOptionsResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *QueryPartitionCreateOptionsBody) Fault() *soap.Fault { return b.Fault_ } - -func QueryPartitionCreateOptions(ctx context.Context, r soap.RoundTripper, req *types.QueryPartitionCreateOptions) (*types.QueryPartitionCreateOptionsResponse, error) { - var reqBody, resBody QueryPartitionCreateOptionsBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type QueryPathSelectionPolicyOptionsBody struct { - Req *types.QueryPathSelectionPolicyOptions `xml:"urn:vim25 QueryPathSelectionPolicyOptions,omitempty"` - Res *types.QueryPathSelectionPolicyOptionsResponse `xml:"urn:vim25 QueryPathSelectionPolicyOptionsResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *QueryPathSelectionPolicyOptionsBody) Fault() *soap.Fault { return b.Fault_ } - -func QueryPathSelectionPolicyOptions(ctx context.Context, r soap.RoundTripper, req *types.QueryPathSelectionPolicyOptions) (*types.QueryPathSelectionPolicyOptionsResponse, error) { - var reqBody, resBody QueryPathSelectionPolicyOptionsBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type QueryPerfBody struct { - Req *types.QueryPerf `xml:"urn:vim25 QueryPerf,omitempty"` - Res *types.QueryPerfResponse `xml:"urn:vim25 QueryPerfResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *QueryPerfBody) Fault() *soap.Fault { return b.Fault_ } - -func QueryPerf(ctx context.Context, r soap.RoundTripper, req *types.QueryPerf) (*types.QueryPerfResponse, error) { - var reqBody, resBody QueryPerfBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type QueryPerfCompositeBody struct { - Req *types.QueryPerfComposite `xml:"urn:vim25 QueryPerfComposite,omitempty"` - Res *types.QueryPerfCompositeResponse `xml:"urn:vim25 QueryPerfCompositeResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *QueryPerfCompositeBody) Fault() *soap.Fault { return b.Fault_ } - -func QueryPerfComposite(ctx context.Context, r soap.RoundTripper, req *types.QueryPerfComposite) (*types.QueryPerfCompositeResponse, error) { - var reqBody, resBody QueryPerfCompositeBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type QueryPerfCounterBody struct { - Req *types.QueryPerfCounter `xml:"urn:vim25 QueryPerfCounter,omitempty"` - Res *types.QueryPerfCounterResponse `xml:"urn:vim25 QueryPerfCounterResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *QueryPerfCounterBody) Fault() *soap.Fault { return b.Fault_ } - -func QueryPerfCounter(ctx context.Context, r soap.RoundTripper, req *types.QueryPerfCounter) (*types.QueryPerfCounterResponse, error) { - var reqBody, resBody QueryPerfCounterBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type QueryPerfCounterByLevelBody struct { - Req *types.QueryPerfCounterByLevel `xml:"urn:vim25 QueryPerfCounterByLevel,omitempty"` - Res *types.QueryPerfCounterByLevelResponse `xml:"urn:vim25 QueryPerfCounterByLevelResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *QueryPerfCounterByLevelBody) Fault() *soap.Fault { return b.Fault_ } - -func QueryPerfCounterByLevel(ctx context.Context, r soap.RoundTripper, req *types.QueryPerfCounterByLevel) (*types.QueryPerfCounterByLevelResponse, error) { - var reqBody, resBody QueryPerfCounterByLevelBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type QueryPerfProviderSummaryBody struct { - Req *types.QueryPerfProviderSummary `xml:"urn:vim25 QueryPerfProviderSummary,omitempty"` - Res *types.QueryPerfProviderSummaryResponse `xml:"urn:vim25 QueryPerfProviderSummaryResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *QueryPerfProviderSummaryBody) Fault() *soap.Fault { return b.Fault_ } - -func QueryPerfProviderSummary(ctx context.Context, r soap.RoundTripper, req *types.QueryPerfProviderSummary) (*types.QueryPerfProviderSummaryResponse, error) { - var reqBody, resBody QueryPerfProviderSummaryBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type QueryPhysicalVsanDisksBody struct { - Req *types.QueryPhysicalVsanDisks `xml:"urn:vim25 QueryPhysicalVsanDisks,omitempty"` - Res *types.QueryPhysicalVsanDisksResponse `xml:"urn:vim25 QueryPhysicalVsanDisksResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *QueryPhysicalVsanDisksBody) Fault() *soap.Fault { return b.Fault_ } - -func QueryPhysicalVsanDisks(ctx context.Context, r soap.RoundTripper, req *types.QueryPhysicalVsanDisks) (*types.QueryPhysicalVsanDisksResponse, error) { - var reqBody, resBody QueryPhysicalVsanDisksBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type QueryPnicStatusBody struct { - Req *types.QueryPnicStatus `xml:"urn:vim25 QueryPnicStatus,omitempty"` - Res *types.QueryPnicStatusResponse `xml:"urn:vim25 QueryPnicStatusResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *QueryPnicStatusBody) Fault() *soap.Fault { return b.Fault_ } - -func QueryPnicStatus(ctx context.Context, r soap.RoundTripper, req *types.QueryPnicStatus) (*types.QueryPnicStatusResponse, error) { - var reqBody, resBody QueryPnicStatusBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type QueryPolicyMetadataBody struct { - Req *types.QueryPolicyMetadata `xml:"urn:vim25 QueryPolicyMetadata,omitempty"` - Res *types.QueryPolicyMetadataResponse `xml:"urn:vim25 QueryPolicyMetadataResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *QueryPolicyMetadataBody) Fault() *soap.Fault { return b.Fault_ } - -func QueryPolicyMetadata(ctx context.Context, r soap.RoundTripper, req *types.QueryPolicyMetadata) (*types.QueryPolicyMetadataResponse, error) { - var reqBody, resBody QueryPolicyMetadataBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type QueryProfileStructureBody struct { - Req *types.QueryProfileStructure `xml:"urn:vim25 QueryProfileStructure,omitempty"` - Res *types.QueryProfileStructureResponse `xml:"urn:vim25 QueryProfileStructureResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *QueryProfileStructureBody) Fault() *soap.Fault { return b.Fault_ } - -func QueryProfileStructure(ctx context.Context, r soap.RoundTripper, req *types.QueryProfileStructure) (*types.QueryProfileStructureResponse, error) { - var reqBody, resBody QueryProfileStructureBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type QueryResourceConfigOptionBody struct { - Req *types.QueryResourceConfigOption `xml:"urn:vim25 QueryResourceConfigOption,omitempty"` - Res *types.QueryResourceConfigOptionResponse `xml:"urn:vim25 QueryResourceConfigOptionResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *QueryResourceConfigOptionBody) Fault() *soap.Fault { return b.Fault_ } - -func QueryResourceConfigOption(ctx context.Context, r soap.RoundTripper, req *types.QueryResourceConfigOption) (*types.QueryResourceConfigOptionResponse, error) { - var reqBody, resBody QueryResourceConfigOptionBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type QueryServiceListBody struct { - Req *types.QueryServiceList `xml:"urn:vim25 QueryServiceList,omitempty"` - Res *types.QueryServiceListResponse `xml:"urn:vim25 QueryServiceListResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *QueryServiceListBody) Fault() *soap.Fault { return b.Fault_ } - -func QueryServiceList(ctx context.Context, r soap.RoundTripper, req *types.QueryServiceList) (*types.QueryServiceListResponse, error) { - var reqBody, resBody QueryServiceListBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type QueryStorageArrayTypePolicyOptionsBody struct { - Req *types.QueryStorageArrayTypePolicyOptions `xml:"urn:vim25 QueryStorageArrayTypePolicyOptions,omitempty"` - Res *types.QueryStorageArrayTypePolicyOptionsResponse `xml:"urn:vim25 QueryStorageArrayTypePolicyOptionsResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *QueryStorageArrayTypePolicyOptionsBody) Fault() *soap.Fault { return b.Fault_ } - -func QueryStorageArrayTypePolicyOptions(ctx context.Context, r soap.RoundTripper, req *types.QueryStorageArrayTypePolicyOptions) (*types.QueryStorageArrayTypePolicyOptionsResponse, error) { - var reqBody, resBody QueryStorageArrayTypePolicyOptionsBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type QuerySupportedFeaturesBody struct { - Req *types.QuerySupportedFeatures `xml:"urn:vim25 QuerySupportedFeatures,omitempty"` - Res *types.QuerySupportedFeaturesResponse `xml:"urn:vim25 QuerySupportedFeaturesResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *QuerySupportedFeaturesBody) Fault() *soap.Fault { return b.Fault_ } - -func QuerySupportedFeatures(ctx context.Context, r soap.RoundTripper, req *types.QuerySupportedFeatures) (*types.QuerySupportedFeaturesResponse, error) { - var reqBody, resBody QuerySupportedFeaturesBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type QueryTargetCapabilitiesBody struct { - Req *types.QueryTargetCapabilities `xml:"urn:vim25 QueryTargetCapabilities,omitempty"` - Res *types.QueryTargetCapabilitiesResponse `xml:"urn:vim25 QueryTargetCapabilitiesResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *QueryTargetCapabilitiesBody) Fault() *soap.Fault { return b.Fault_ } - -func QueryTargetCapabilities(ctx context.Context, r soap.RoundTripper, req *types.QueryTargetCapabilities) (*types.QueryTargetCapabilitiesResponse, error) { - var reqBody, resBody QueryTargetCapabilitiesBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type QueryTpmAttestationReportBody struct { - Req *types.QueryTpmAttestationReport `xml:"urn:vim25 QueryTpmAttestationReport,omitempty"` - Res *types.QueryTpmAttestationReportResponse `xml:"urn:vim25 QueryTpmAttestationReportResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *QueryTpmAttestationReportBody) Fault() *soap.Fault { return b.Fault_ } - -func QueryTpmAttestationReport(ctx context.Context, r soap.RoundTripper, req *types.QueryTpmAttestationReport) (*types.QueryTpmAttestationReportResponse, error) { - var reqBody, resBody QueryTpmAttestationReportBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type QueryUnownedFilesBody struct { - Req *types.QueryUnownedFiles `xml:"urn:vim25 QueryUnownedFiles,omitempty"` - Res *types.QueryUnownedFilesResponse `xml:"urn:vim25 QueryUnownedFilesResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *QueryUnownedFilesBody) Fault() *soap.Fault { return b.Fault_ } - -func QueryUnownedFiles(ctx context.Context, r soap.RoundTripper, req *types.QueryUnownedFiles) (*types.QueryUnownedFilesResponse, error) { - var reqBody, resBody QueryUnownedFilesBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type QueryUnresolvedVmfsVolumeBody struct { - Req *types.QueryUnresolvedVmfsVolume `xml:"urn:vim25 QueryUnresolvedVmfsVolume,omitempty"` - Res *types.QueryUnresolvedVmfsVolumeResponse `xml:"urn:vim25 QueryUnresolvedVmfsVolumeResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *QueryUnresolvedVmfsVolumeBody) Fault() *soap.Fault { return b.Fault_ } - -func QueryUnresolvedVmfsVolume(ctx context.Context, r soap.RoundTripper, req *types.QueryUnresolvedVmfsVolume) (*types.QueryUnresolvedVmfsVolumeResponse, error) { - var reqBody, resBody QueryUnresolvedVmfsVolumeBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type QueryUnresolvedVmfsVolumesBody struct { - Req *types.QueryUnresolvedVmfsVolumes `xml:"urn:vim25 QueryUnresolvedVmfsVolumes,omitempty"` - Res *types.QueryUnresolvedVmfsVolumesResponse `xml:"urn:vim25 QueryUnresolvedVmfsVolumesResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *QueryUnresolvedVmfsVolumesBody) Fault() *soap.Fault { return b.Fault_ } - -func QueryUnresolvedVmfsVolumes(ctx context.Context, r soap.RoundTripper, req *types.QueryUnresolvedVmfsVolumes) (*types.QueryUnresolvedVmfsVolumesResponse, error) { - var reqBody, resBody QueryUnresolvedVmfsVolumesBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type QueryUsedVlanIdInDvsBody struct { - Req *types.QueryUsedVlanIdInDvs `xml:"urn:vim25 QueryUsedVlanIdInDvs,omitempty"` - Res *types.QueryUsedVlanIdInDvsResponse `xml:"urn:vim25 QueryUsedVlanIdInDvsResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *QueryUsedVlanIdInDvsBody) Fault() *soap.Fault { return b.Fault_ } - -func QueryUsedVlanIdInDvs(ctx context.Context, r soap.RoundTripper, req *types.QueryUsedVlanIdInDvs) (*types.QueryUsedVlanIdInDvsResponse, error) { - var reqBody, resBody QueryUsedVlanIdInDvsBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type QueryVMotionCompatibilityBody struct { - Req *types.QueryVMotionCompatibility `xml:"urn:vim25 QueryVMotionCompatibility,omitempty"` - Res *types.QueryVMotionCompatibilityResponse `xml:"urn:vim25 QueryVMotionCompatibilityResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *QueryVMotionCompatibilityBody) Fault() *soap.Fault { return b.Fault_ } - -func QueryVMotionCompatibility(ctx context.Context, r soap.RoundTripper, req *types.QueryVMotionCompatibility) (*types.QueryVMotionCompatibilityResponse, error) { - var reqBody, resBody QueryVMotionCompatibilityBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type QueryVMotionCompatibilityEx_TaskBody struct { - Req *types.QueryVMotionCompatibilityEx_Task `xml:"urn:vim25 QueryVMotionCompatibilityEx_Task,omitempty"` - Res *types.QueryVMotionCompatibilityEx_TaskResponse `xml:"urn:vim25 QueryVMotionCompatibilityEx_TaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *QueryVMotionCompatibilityEx_TaskBody) Fault() *soap.Fault { return b.Fault_ } - -func QueryVMotionCompatibilityEx_Task(ctx context.Context, r soap.RoundTripper, req *types.QueryVMotionCompatibilityEx_Task) (*types.QueryVMotionCompatibilityEx_TaskResponse, error) { - var reqBody, resBody QueryVMotionCompatibilityEx_TaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type QueryVirtualDiskFragmentationBody struct { - Req *types.QueryVirtualDiskFragmentation `xml:"urn:vim25 QueryVirtualDiskFragmentation,omitempty"` - Res *types.QueryVirtualDiskFragmentationResponse `xml:"urn:vim25 QueryVirtualDiskFragmentationResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *QueryVirtualDiskFragmentationBody) Fault() *soap.Fault { return b.Fault_ } - -func QueryVirtualDiskFragmentation(ctx context.Context, r soap.RoundTripper, req *types.QueryVirtualDiskFragmentation) (*types.QueryVirtualDiskFragmentationResponse, error) { - var reqBody, resBody QueryVirtualDiskFragmentationBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type QueryVirtualDiskGeometryBody struct { - Req *types.QueryVirtualDiskGeometry `xml:"urn:vim25 QueryVirtualDiskGeometry,omitempty"` - Res *types.QueryVirtualDiskGeometryResponse `xml:"urn:vim25 QueryVirtualDiskGeometryResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *QueryVirtualDiskGeometryBody) Fault() *soap.Fault { return b.Fault_ } - -func QueryVirtualDiskGeometry(ctx context.Context, r soap.RoundTripper, req *types.QueryVirtualDiskGeometry) (*types.QueryVirtualDiskGeometryResponse, error) { - var reqBody, resBody QueryVirtualDiskGeometryBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type QueryVirtualDiskUuidBody struct { - Req *types.QueryVirtualDiskUuid `xml:"urn:vim25 QueryVirtualDiskUuid,omitempty"` - Res *types.QueryVirtualDiskUuidResponse `xml:"urn:vim25 QueryVirtualDiskUuidResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *QueryVirtualDiskUuidBody) Fault() *soap.Fault { return b.Fault_ } - -func QueryVirtualDiskUuid(ctx context.Context, r soap.RoundTripper, req *types.QueryVirtualDiskUuid) (*types.QueryVirtualDiskUuidResponse, error) { - var reqBody, resBody QueryVirtualDiskUuidBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type QueryVmfsDatastoreCreateOptionsBody struct { - Req *types.QueryVmfsDatastoreCreateOptions `xml:"urn:vim25 QueryVmfsDatastoreCreateOptions,omitempty"` - Res *types.QueryVmfsDatastoreCreateOptionsResponse `xml:"urn:vim25 QueryVmfsDatastoreCreateOptionsResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *QueryVmfsDatastoreCreateOptionsBody) Fault() *soap.Fault { return b.Fault_ } - -func QueryVmfsDatastoreCreateOptions(ctx context.Context, r soap.RoundTripper, req *types.QueryVmfsDatastoreCreateOptions) (*types.QueryVmfsDatastoreCreateOptionsResponse, error) { - var reqBody, resBody QueryVmfsDatastoreCreateOptionsBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type QueryVmfsDatastoreExpandOptionsBody struct { - Req *types.QueryVmfsDatastoreExpandOptions `xml:"urn:vim25 QueryVmfsDatastoreExpandOptions,omitempty"` - Res *types.QueryVmfsDatastoreExpandOptionsResponse `xml:"urn:vim25 QueryVmfsDatastoreExpandOptionsResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *QueryVmfsDatastoreExpandOptionsBody) Fault() *soap.Fault { return b.Fault_ } - -func QueryVmfsDatastoreExpandOptions(ctx context.Context, r soap.RoundTripper, req *types.QueryVmfsDatastoreExpandOptions) (*types.QueryVmfsDatastoreExpandOptionsResponse, error) { - var reqBody, resBody QueryVmfsDatastoreExpandOptionsBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type QueryVmfsDatastoreExtendOptionsBody struct { - Req *types.QueryVmfsDatastoreExtendOptions `xml:"urn:vim25 QueryVmfsDatastoreExtendOptions,omitempty"` - Res *types.QueryVmfsDatastoreExtendOptionsResponse `xml:"urn:vim25 QueryVmfsDatastoreExtendOptionsResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *QueryVmfsDatastoreExtendOptionsBody) Fault() *soap.Fault { return b.Fault_ } - -func QueryVmfsDatastoreExtendOptions(ctx context.Context, r soap.RoundTripper, req *types.QueryVmfsDatastoreExtendOptions) (*types.QueryVmfsDatastoreExtendOptionsResponse, error) { - var reqBody, resBody QueryVmfsDatastoreExtendOptionsBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type QueryVnicStatusBody struct { - Req *types.QueryVnicStatus `xml:"urn:vim25 QueryVnicStatus,omitempty"` - Res *types.QueryVnicStatusResponse `xml:"urn:vim25 QueryVnicStatusResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *QueryVnicStatusBody) Fault() *soap.Fault { return b.Fault_ } - -func QueryVnicStatus(ctx context.Context, r soap.RoundTripper, req *types.QueryVnicStatus) (*types.QueryVnicStatusResponse, error) { - var reqBody, resBody QueryVnicStatusBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type QueryVsanObjectsBody struct { - Req *types.QueryVsanObjects `xml:"urn:vim25 QueryVsanObjects,omitempty"` - Res *types.QueryVsanObjectsResponse `xml:"urn:vim25 QueryVsanObjectsResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *QueryVsanObjectsBody) Fault() *soap.Fault { return b.Fault_ } - -func QueryVsanObjects(ctx context.Context, r soap.RoundTripper, req *types.QueryVsanObjects) (*types.QueryVsanObjectsResponse, error) { - var reqBody, resBody QueryVsanObjectsBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type ReadEnvironmentVariableInGuestBody struct { - Req *types.ReadEnvironmentVariableInGuest `xml:"urn:vim25 ReadEnvironmentVariableInGuest,omitempty"` - Res *types.ReadEnvironmentVariableInGuestResponse `xml:"urn:vim25 ReadEnvironmentVariableInGuestResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *ReadEnvironmentVariableInGuestBody) Fault() *soap.Fault { return b.Fault_ } - -func ReadEnvironmentVariableInGuest(ctx context.Context, r soap.RoundTripper, req *types.ReadEnvironmentVariableInGuest) (*types.ReadEnvironmentVariableInGuestResponse, error) { - var reqBody, resBody ReadEnvironmentVariableInGuestBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type ReadNextEventsBody struct { - Req *types.ReadNextEvents `xml:"urn:vim25 ReadNextEvents,omitempty"` - Res *types.ReadNextEventsResponse `xml:"urn:vim25 ReadNextEventsResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *ReadNextEventsBody) Fault() *soap.Fault { return b.Fault_ } - -func ReadNextEvents(ctx context.Context, r soap.RoundTripper, req *types.ReadNextEvents) (*types.ReadNextEventsResponse, error) { - var reqBody, resBody ReadNextEventsBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type ReadNextTasksBody struct { - Req *types.ReadNextTasks `xml:"urn:vim25 ReadNextTasks,omitempty"` - Res *types.ReadNextTasksResponse `xml:"urn:vim25 ReadNextTasksResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *ReadNextTasksBody) Fault() *soap.Fault { return b.Fault_ } - -func ReadNextTasks(ctx context.Context, r soap.RoundTripper, req *types.ReadNextTasks) (*types.ReadNextTasksResponse, error) { - var reqBody, resBody ReadNextTasksBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type ReadPreviousEventsBody struct { - Req *types.ReadPreviousEvents `xml:"urn:vim25 ReadPreviousEvents,omitempty"` - Res *types.ReadPreviousEventsResponse `xml:"urn:vim25 ReadPreviousEventsResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *ReadPreviousEventsBody) Fault() *soap.Fault { return b.Fault_ } - -func ReadPreviousEvents(ctx context.Context, r soap.RoundTripper, req *types.ReadPreviousEvents) (*types.ReadPreviousEventsResponse, error) { - var reqBody, resBody ReadPreviousEventsBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type ReadPreviousTasksBody struct { - Req *types.ReadPreviousTasks `xml:"urn:vim25 ReadPreviousTasks,omitempty"` - Res *types.ReadPreviousTasksResponse `xml:"urn:vim25 ReadPreviousTasksResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *ReadPreviousTasksBody) Fault() *soap.Fault { return b.Fault_ } - -func ReadPreviousTasks(ctx context.Context, r soap.RoundTripper, req *types.ReadPreviousTasks) (*types.ReadPreviousTasksResponse, error) { - var reqBody, resBody ReadPreviousTasksBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type RebootGuestBody struct { - Req *types.RebootGuest `xml:"urn:vim25 RebootGuest,omitempty"` - Res *types.RebootGuestResponse `xml:"urn:vim25 RebootGuestResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *RebootGuestBody) Fault() *soap.Fault { return b.Fault_ } - -func RebootGuest(ctx context.Context, r soap.RoundTripper, req *types.RebootGuest) (*types.RebootGuestResponse, error) { - var reqBody, resBody RebootGuestBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type RebootHost_TaskBody struct { - Req *types.RebootHost_Task `xml:"urn:vim25 RebootHost_Task,omitempty"` - Res *types.RebootHost_TaskResponse `xml:"urn:vim25 RebootHost_TaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *RebootHost_TaskBody) Fault() *soap.Fault { return b.Fault_ } - -func RebootHost_Task(ctx context.Context, r soap.RoundTripper, req *types.RebootHost_Task) (*types.RebootHost_TaskResponse, error) { - var reqBody, resBody RebootHost_TaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type RecommendDatastoresBody struct { - Req *types.RecommendDatastores `xml:"urn:vim25 RecommendDatastores,omitempty"` - Res *types.RecommendDatastoresResponse `xml:"urn:vim25 RecommendDatastoresResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *RecommendDatastoresBody) Fault() *soap.Fault { return b.Fault_ } - -func RecommendDatastores(ctx context.Context, r soap.RoundTripper, req *types.RecommendDatastores) (*types.RecommendDatastoresResponse, error) { - var reqBody, resBody RecommendDatastoresBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type RecommendHostsForVmBody struct { - Req *types.RecommendHostsForVm `xml:"urn:vim25 RecommendHostsForVm,omitempty"` - Res *types.RecommendHostsForVmResponse `xml:"urn:vim25 RecommendHostsForVmResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *RecommendHostsForVmBody) Fault() *soap.Fault { return b.Fault_ } - -func RecommendHostsForVm(ctx context.Context, r soap.RoundTripper, req *types.RecommendHostsForVm) (*types.RecommendHostsForVmResponse, error) { - var reqBody, resBody RecommendHostsForVmBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type ReconfigVM_TaskBody struct { - Req *types.ReconfigVM_Task `xml:"urn:vim25 ReconfigVM_Task,omitempty"` - Res *types.ReconfigVM_TaskResponse `xml:"urn:vim25 ReconfigVM_TaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *ReconfigVM_TaskBody) Fault() *soap.Fault { return b.Fault_ } - -func ReconfigVM_Task(ctx context.Context, r soap.RoundTripper, req *types.ReconfigVM_Task) (*types.ReconfigVM_TaskResponse, error) { - var reqBody, resBody ReconfigVM_TaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type ReconfigureAlarmBody struct { - Req *types.ReconfigureAlarm `xml:"urn:vim25 ReconfigureAlarm,omitempty"` - Res *types.ReconfigureAlarmResponse `xml:"urn:vim25 ReconfigureAlarmResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *ReconfigureAlarmBody) Fault() *soap.Fault { return b.Fault_ } - -func ReconfigureAlarm(ctx context.Context, r soap.RoundTripper, req *types.ReconfigureAlarm) (*types.ReconfigureAlarmResponse, error) { - var reqBody, resBody ReconfigureAlarmBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type ReconfigureAutostartBody struct { - Req *types.ReconfigureAutostart `xml:"urn:vim25 ReconfigureAutostart,omitempty"` - Res *types.ReconfigureAutostartResponse `xml:"urn:vim25 ReconfigureAutostartResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *ReconfigureAutostartBody) Fault() *soap.Fault { return b.Fault_ } - -func ReconfigureAutostart(ctx context.Context, r soap.RoundTripper, req *types.ReconfigureAutostart) (*types.ReconfigureAutostartResponse, error) { - var reqBody, resBody ReconfigureAutostartBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type ReconfigureCluster_TaskBody struct { - Req *types.ReconfigureCluster_Task `xml:"urn:vim25 ReconfigureCluster_Task,omitempty"` - Res *types.ReconfigureCluster_TaskResponse `xml:"urn:vim25 ReconfigureCluster_TaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *ReconfigureCluster_TaskBody) Fault() *soap.Fault { return b.Fault_ } - -func ReconfigureCluster_Task(ctx context.Context, r soap.RoundTripper, req *types.ReconfigureCluster_Task) (*types.ReconfigureCluster_TaskResponse, error) { - var reqBody, resBody ReconfigureCluster_TaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type ReconfigureComputeResource_TaskBody struct { - Req *types.ReconfigureComputeResource_Task `xml:"urn:vim25 ReconfigureComputeResource_Task,omitempty"` - Res *types.ReconfigureComputeResource_TaskResponse `xml:"urn:vim25 ReconfigureComputeResource_TaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *ReconfigureComputeResource_TaskBody) Fault() *soap.Fault { return b.Fault_ } - -func ReconfigureComputeResource_Task(ctx context.Context, r soap.RoundTripper, req *types.ReconfigureComputeResource_Task) (*types.ReconfigureComputeResource_TaskResponse, error) { - var reqBody, resBody ReconfigureComputeResource_TaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type ReconfigureDVPort_TaskBody struct { - Req *types.ReconfigureDVPort_Task `xml:"urn:vim25 ReconfigureDVPort_Task,omitempty"` - Res *types.ReconfigureDVPort_TaskResponse `xml:"urn:vim25 ReconfigureDVPort_TaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *ReconfigureDVPort_TaskBody) Fault() *soap.Fault { return b.Fault_ } - -func ReconfigureDVPort_Task(ctx context.Context, r soap.RoundTripper, req *types.ReconfigureDVPort_Task) (*types.ReconfigureDVPort_TaskResponse, error) { - var reqBody, resBody ReconfigureDVPort_TaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type ReconfigureDVPortgroup_TaskBody struct { - Req *types.ReconfigureDVPortgroup_Task `xml:"urn:vim25 ReconfigureDVPortgroup_Task,omitempty"` - Res *types.ReconfigureDVPortgroup_TaskResponse `xml:"urn:vim25 ReconfigureDVPortgroup_TaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *ReconfigureDVPortgroup_TaskBody) Fault() *soap.Fault { return b.Fault_ } - -func ReconfigureDVPortgroup_Task(ctx context.Context, r soap.RoundTripper, req *types.ReconfigureDVPortgroup_Task) (*types.ReconfigureDVPortgroup_TaskResponse, error) { - var reqBody, resBody ReconfigureDVPortgroup_TaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type ReconfigureDatacenter_TaskBody struct { - Req *types.ReconfigureDatacenter_Task `xml:"urn:vim25 ReconfigureDatacenter_Task,omitempty"` - Res *types.ReconfigureDatacenter_TaskResponse `xml:"urn:vim25 ReconfigureDatacenter_TaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *ReconfigureDatacenter_TaskBody) Fault() *soap.Fault { return b.Fault_ } - -func ReconfigureDatacenter_Task(ctx context.Context, r soap.RoundTripper, req *types.ReconfigureDatacenter_Task) (*types.ReconfigureDatacenter_TaskResponse, error) { - var reqBody, resBody ReconfigureDatacenter_TaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type ReconfigureDvs_TaskBody struct { - Req *types.ReconfigureDvs_Task `xml:"urn:vim25 ReconfigureDvs_Task,omitempty"` - Res *types.ReconfigureDvs_TaskResponse `xml:"urn:vim25 ReconfigureDvs_TaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *ReconfigureDvs_TaskBody) Fault() *soap.Fault { return b.Fault_ } - -func ReconfigureDvs_Task(ctx context.Context, r soap.RoundTripper, req *types.ReconfigureDvs_Task) (*types.ReconfigureDvs_TaskResponse, error) { - var reqBody, resBody ReconfigureDvs_TaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type ReconfigureHostForDAS_TaskBody struct { - Req *types.ReconfigureHostForDAS_Task `xml:"urn:vim25 ReconfigureHostForDAS_Task,omitempty"` - Res *types.ReconfigureHostForDAS_TaskResponse `xml:"urn:vim25 ReconfigureHostForDAS_TaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *ReconfigureHostForDAS_TaskBody) Fault() *soap.Fault { return b.Fault_ } - -func ReconfigureHostForDAS_Task(ctx context.Context, r soap.RoundTripper, req *types.ReconfigureHostForDAS_Task) (*types.ReconfigureHostForDAS_TaskResponse, error) { - var reqBody, resBody ReconfigureHostForDAS_TaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type ReconfigureScheduledTaskBody struct { - Req *types.ReconfigureScheduledTask `xml:"urn:vim25 ReconfigureScheduledTask,omitempty"` - Res *types.ReconfigureScheduledTaskResponse `xml:"urn:vim25 ReconfigureScheduledTaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *ReconfigureScheduledTaskBody) Fault() *soap.Fault { return b.Fault_ } - -func ReconfigureScheduledTask(ctx context.Context, r soap.RoundTripper, req *types.ReconfigureScheduledTask) (*types.ReconfigureScheduledTaskResponse, error) { - var reqBody, resBody ReconfigureScheduledTaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type ReconfigureServiceConsoleReservationBody struct { - Req *types.ReconfigureServiceConsoleReservation `xml:"urn:vim25 ReconfigureServiceConsoleReservation,omitempty"` - Res *types.ReconfigureServiceConsoleReservationResponse `xml:"urn:vim25 ReconfigureServiceConsoleReservationResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *ReconfigureServiceConsoleReservationBody) Fault() *soap.Fault { return b.Fault_ } - -func ReconfigureServiceConsoleReservation(ctx context.Context, r soap.RoundTripper, req *types.ReconfigureServiceConsoleReservation) (*types.ReconfigureServiceConsoleReservationResponse, error) { - var reqBody, resBody ReconfigureServiceConsoleReservationBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type ReconfigureSnmpAgentBody struct { - Req *types.ReconfigureSnmpAgent `xml:"urn:vim25 ReconfigureSnmpAgent,omitempty"` - Res *types.ReconfigureSnmpAgentResponse `xml:"urn:vim25 ReconfigureSnmpAgentResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *ReconfigureSnmpAgentBody) Fault() *soap.Fault { return b.Fault_ } - -func ReconfigureSnmpAgent(ctx context.Context, r soap.RoundTripper, req *types.ReconfigureSnmpAgent) (*types.ReconfigureSnmpAgentResponse, error) { - var reqBody, resBody ReconfigureSnmpAgentBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type ReconfigureVirtualMachineReservationBody struct { - Req *types.ReconfigureVirtualMachineReservation `xml:"urn:vim25 ReconfigureVirtualMachineReservation,omitempty"` - Res *types.ReconfigureVirtualMachineReservationResponse `xml:"urn:vim25 ReconfigureVirtualMachineReservationResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *ReconfigureVirtualMachineReservationBody) Fault() *soap.Fault { return b.Fault_ } - -func ReconfigureVirtualMachineReservation(ctx context.Context, r soap.RoundTripper, req *types.ReconfigureVirtualMachineReservation) (*types.ReconfigureVirtualMachineReservationResponse, error) { - var reqBody, resBody ReconfigureVirtualMachineReservationBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type ReconnectHost_TaskBody struct { - Req *types.ReconnectHost_Task `xml:"urn:vim25 ReconnectHost_Task,omitempty"` - Res *types.ReconnectHost_TaskResponse `xml:"urn:vim25 ReconnectHost_TaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *ReconnectHost_TaskBody) Fault() *soap.Fault { return b.Fault_ } - -func ReconnectHost_Task(ctx context.Context, r soap.RoundTripper, req *types.ReconnectHost_Task) (*types.ReconnectHost_TaskResponse, error) { - var reqBody, resBody ReconnectHost_TaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type RectifyDvsHost_TaskBody struct { - Req *types.RectifyDvsHost_Task `xml:"urn:vim25 RectifyDvsHost_Task,omitempty"` - Res *types.RectifyDvsHost_TaskResponse `xml:"urn:vim25 RectifyDvsHost_TaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *RectifyDvsHost_TaskBody) Fault() *soap.Fault { return b.Fault_ } - -func RectifyDvsHost_Task(ctx context.Context, r soap.RoundTripper, req *types.RectifyDvsHost_Task) (*types.RectifyDvsHost_TaskResponse, error) { - var reqBody, resBody RectifyDvsHost_TaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type RectifyDvsOnHost_TaskBody struct { - Req *types.RectifyDvsOnHost_Task `xml:"urn:vim25 RectifyDvsOnHost_Task,omitempty"` - Res *types.RectifyDvsOnHost_TaskResponse `xml:"urn:vim25 RectifyDvsOnHost_TaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *RectifyDvsOnHost_TaskBody) Fault() *soap.Fault { return b.Fault_ } - -func RectifyDvsOnHost_Task(ctx context.Context, r soap.RoundTripper, req *types.RectifyDvsOnHost_Task) (*types.RectifyDvsOnHost_TaskResponse, error) { - var reqBody, resBody RectifyDvsOnHost_TaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type RefreshBody struct { - Req *types.Refresh `xml:"urn:vim25 Refresh,omitempty"` - Res *types.RefreshResponse `xml:"urn:vim25 RefreshResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *RefreshBody) Fault() *soap.Fault { return b.Fault_ } - -func Refresh(ctx context.Context, r soap.RoundTripper, req *types.Refresh) (*types.RefreshResponse, error) { - var reqBody, resBody RefreshBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type RefreshDVPortStateBody struct { - Req *types.RefreshDVPortState `xml:"urn:vim25 RefreshDVPortState,omitempty"` - Res *types.RefreshDVPortStateResponse `xml:"urn:vim25 RefreshDVPortStateResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *RefreshDVPortStateBody) Fault() *soap.Fault { return b.Fault_ } - -func RefreshDVPortState(ctx context.Context, r soap.RoundTripper, req *types.RefreshDVPortState) (*types.RefreshDVPortStateResponse, error) { - var reqBody, resBody RefreshDVPortStateBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type RefreshDatastoreBody struct { - Req *types.RefreshDatastore `xml:"urn:vim25 RefreshDatastore,omitempty"` - Res *types.RefreshDatastoreResponse `xml:"urn:vim25 RefreshDatastoreResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *RefreshDatastoreBody) Fault() *soap.Fault { return b.Fault_ } - -func RefreshDatastore(ctx context.Context, r soap.RoundTripper, req *types.RefreshDatastore) (*types.RefreshDatastoreResponse, error) { - var reqBody, resBody RefreshDatastoreBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type RefreshDatastoreStorageInfoBody struct { - Req *types.RefreshDatastoreStorageInfo `xml:"urn:vim25 RefreshDatastoreStorageInfo,omitempty"` - Res *types.RefreshDatastoreStorageInfoResponse `xml:"urn:vim25 RefreshDatastoreStorageInfoResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *RefreshDatastoreStorageInfoBody) Fault() *soap.Fault { return b.Fault_ } - -func RefreshDatastoreStorageInfo(ctx context.Context, r soap.RoundTripper, req *types.RefreshDatastoreStorageInfo) (*types.RefreshDatastoreStorageInfoResponse, error) { - var reqBody, resBody RefreshDatastoreStorageInfoBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type RefreshDateTimeSystemBody struct { - Req *types.RefreshDateTimeSystem `xml:"urn:vim25 RefreshDateTimeSystem,omitempty"` - Res *types.RefreshDateTimeSystemResponse `xml:"urn:vim25 RefreshDateTimeSystemResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *RefreshDateTimeSystemBody) Fault() *soap.Fault { return b.Fault_ } - -func RefreshDateTimeSystem(ctx context.Context, r soap.RoundTripper, req *types.RefreshDateTimeSystem) (*types.RefreshDateTimeSystemResponse, error) { - var reqBody, resBody RefreshDateTimeSystemBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type RefreshFirewallBody struct { - Req *types.RefreshFirewall `xml:"urn:vim25 RefreshFirewall,omitempty"` - Res *types.RefreshFirewallResponse `xml:"urn:vim25 RefreshFirewallResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *RefreshFirewallBody) Fault() *soap.Fault { return b.Fault_ } - -func RefreshFirewall(ctx context.Context, r soap.RoundTripper, req *types.RefreshFirewall) (*types.RefreshFirewallResponse, error) { - var reqBody, resBody RefreshFirewallBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type RefreshGraphicsManagerBody struct { - Req *types.RefreshGraphicsManager `xml:"urn:vim25 RefreshGraphicsManager,omitempty"` - Res *types.RefreshGraphicsManagerResponse `xml:"urn:vim25 RefreshGraphicsManagerResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *RefreshGraphicsManagerBody) Fault() *soap.Fault { return b.Fault_ } - -func RefreshGraphicsManager(ctx context.Context, r soap.RoundTripper, req *types.RefreshGraphicsManager) (*types.RefreshGraphicsManagerResponse, error) { - var reqBody, resBody RefreshGraphicsManagerBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type RefreshHealthStatusSystemBody struct { - Req *types.RefreshHealthStatusSystem `xml:"urn:vim25 RefreshHealthStatusSystem,omitempty"` - Res *types.RefreshHealthStatusSystemResponse `xml:"urn:vim25 RefreshHealthStatusSystemResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *RefreshHealthStatusSystemBody) Fault() *soap.Fault { return b.Fault_ } - -func RefreshHealthStatusSystem(ctx context.Context, r soap.RoundTripper, req *types.RefreshHealthStatusSystem) (*types.RefreshHealthStatusSystemResponse, error) { - var reqBody, resBody RefreshHealthStatusSystemBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type RefreshNetworkSystemBody struct { - Req *types.RefreshNetworkSystem `xml:"urn:vim25 RefreshNetworkSystem,omitempty"` - Res *types.RefreshNetworkSystemResponse `xml:"urn:vim25 RefreshNetworkSystemResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *RefreshNetworkSystemBody) Fault() *soap.Fault { return b.Fault_ } - -func RefreshNetworkSystem(ctx context.Context, r soap.RoundTripper, req *types.RefreshNetworkSystem) (*types.RefreshNetworkSystemResponse, error) { - var reqBody, resBody RefreshNetworkSystemBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type RefreshRecommendationBody struct { - Req *types.RefreshRecommendation `xml:"urn:vim25 RefreshRecommendation,omitempty"` - Res *types.RefreshRecommendationResponse `xml:"urn:vim25 RefreshRecommendationResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *RefreshRecommendationBody) Fault() *soap.Fault { return b.Fault_ } - -func RefreshRecommendation(ctx context.Context, r soap.RoundTripper, req *types.RefreshRecommendation) (*types.RefreshRecommendationResponse, error) { - var reqBody, resBody RefreshRecommendationBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type RefreshRuntimeBody struct { - Req *types.RefreshRuntime `xml:"urn:vim25 RefreshRuntime,omitempty"` - Res *types.RefreshRuntimeResponse `xml:"urn:vim25 RefreshRuntimeResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *RefreshRuntimeBody) Fault() *soap.Fault { return b.Fault_ } - -func RefreshRuntime(ctx context.Context, r soap.RoundTripper, req *types.RefreshRuntime) (*types.RefreshRuntimeResponse, error) { - var reqBody, resBody RefreshRuntimeBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type RefreshServicesBody struct { - Req *types.RefreshServices `xml:"urn:vim25 RefreshServices,omitempty"` - Res *types.RefreshServicesResponse `xml:"urn:vim25 RefreshServicesResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *RefreshServicesBody) Fault() *soap.Fault { return b.Fault_ } - -func RefreshServices(ctx context.Context, r soap.RoundTripper, req *types.RefreshServices) (*types.RefreshServicesResponse, error) { - var reqBody, resBody RefreshServicesBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type RefreshStorageDrsRecommendationBody struct { - Req *types.RefreshStorageDrsRecommendation `xml:"urn:vim25 RefreshStorageDrsRecommendation,omitempty"` - Res *types.RefreshStorageDrsRecommendationResponse `xml:"urn:vim25 RefreshStorageDrsRecommendationResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *RefreshStorageDrsRecommendationBody) Fault() *soap.Fault { return b.Fault_ } - -func RefreshStorageDrsRecommendation(ctx context.Context, r soap.RoundTripper, req *types.RefreshStorageDrsRecommendation) (*types.RefreshStorageDrsRecommendationResponse, error) { - var reqBody, resBody RefreshStorageDrsRecommendationBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type RefreshStorageInfoBody struct { - Req *types.RefreshStorageInfo `xml:"urn:vim25 RefreshStorageInfo,omitempty"` - Res *types.RefreshStorageInfoResponse `xml:"urn:vim25 RefreshStorageInfoResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *RefreshStorageInfoBody) Fault() *soap.Fault { return b.Fault_ } - -func RefreshStorageInfo(ctx context.Context, r soap.RoundTripper, req *types.RefreshStorageInfo) (*types.RefreshStorageInfoResponse, error) { - var reqBody, resBody RefreshStorageInfoBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type RefreshStorageSystemBody struct { - Req *types.RefreshStorageSystem `xml:"urn:vim25 RefreshStorageSystem,omitempty"` - Res *types.RefreshStorageSystemResponse `xml:"urn:vim25 RefreshStorageSystemResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *RefreshStorageSystemBody) Fault() *soap.Fault { return b.Fault_ } - -func RefreshStorageSystem(ctx context.Context, r soap.RoundTripper, req *types.RefreshStorageSystem) (*types.RefreshStorageSystemResponse, error) { - var reqBody, resBody RefreshStorageSystemBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type RegisterChildVM_TaskBody struct { - Req *types.RegisterChildVM_Task `xml:"urn:vim25 RegisterChildVM_Task,omitempty"` - Res *types.RegisterChildVM_TaskResponse `xml:"urn:vim25 RegisterChildVM_TaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *RegisterChildVM_TaskBody) Fault() *soap.Fault { return b.Fault_ } - -func RegisterChildVM_Task(ctx context.Context, r soap.RoundTripper, req *types.RegisterChildVM_Task) (*types.RegisterChildVM_TaskResponse, error) { - var reqBody, resBody RegisterChildVM_TaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type RegisterExtensionBody struct { - Req *types.RegisterExtension `xml:"urn:vim25 RegisterExtension,omitempty"` - Res *types.RegisterExtensionResponse `xml:"urn:vim25 RegisterExtensionResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *RegisterExtensionBody) Fault() *soap.Fault { return b.Fault_ } - -func RegisterExtension(ctx context.Context, r soap.RoundTripper, req *types.RegisterExtension) (*types.RegisterExtensionResponse, error) { - var reqBody, resBody RegisterExtensionBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type RegisterVM_TaskBody struct { - Req *types.RegisterVM_Task `xml:"urn:vim25 RegisterVM_Task,omitempty"` - Res *types.RegisterVM_TaskResponse `xml:"urn:vim25 RegisterVM_TaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *RegisterVM_TaskBody) Fault() *soap.Fault { return b.Fault_ } - -func RegisterVM_Task(ctx context.Context, r soap.RoundTripper, req *types.RegisterVM_Task) (*types.RegisterVM_TaskResponse, error) { - var reqBody, resBody RegisterVM_TaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type ReleaseCredentialsInGuestBody struct { - Req *types.ReleaseCredentialsInGuest `xml:"urn:vim25 ReleaseCredentialsInGuest,omitempty"` - Res *types.ReleaseCredentialsInGuestResponse `xml:"urn:vim25 ReleaseCredentialsInGuestResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *ReleaseCredentialsInGuestBody) Fault() *soap.Fault { return b.Fault_ } - -func ReleaseCredentialsInGuest(ctx context.Context, r soap.RoundTripper, req *types.ReleaseCredentialsInGuest) (*types.ReleaseCredentialsInGuestResponse, error) { - var reqBody, resBody ReleaseCredentialsInGuestBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type ReleaseIpAllocationBody struct { - Req *types.ReleaseIpAllocation `xml:"urn:vim25 ReleaseIpAllocation,omitempty"` - Res *types.ReleaseIpAllocationResponse `xml:"urn:vim25 ReleaseIpAllocationResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *ReleaseIpAllocationBody) Fault() *soap.Fault { return b.Fault_ } - -func ReleaseIpAllocation(ctx context.Context, r soap.RoundTripper, req *types.ReleaseIpAllocation) (*types.ReleaseIpAllocationResponse, error) { - var reqBody, resBody ReleaseIpAllocationBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type ReloadBody struct { - Req *types.Reload `xml:"urn:vim25 Reload,omitempty"` - Res *types.ReloadResponse `xml:"urn:vim25 ReloadResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *ReloadBody) Fault() *soap.Fault { return b.Fault_ } - -func Reload(ctx context.Context, r soap.RoundTripper, req *types.Reload) (*types.ReloadResponse, error) { - var reqBody, resBody ReloadBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type RelocateVM_TaskBody struct { - Req *types.RelocateVM_Task `xml:"urn:vim25 RelocateVM_Task,omitempty"` - Res *types.RelocateVM_TaskResponse `xml:"urn:vim25 RelocateVM_TaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *RelocateVM_TaskBody) Fault() *soap.Fault { return b.Fault_ } - -func RelocateVM_Task(ctx context.Context, r soap.RoundTripper, req *types.RelocateVM_Task) (*types.RelocateVM_TaskResponse, error) { - var reqBody, resBody RelocateVM_TaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type RemoveAlarmBody struct { - Req *types.RemoveAlarm `xml:"urn:vim25 RemoveAlarm,omitempty"` - Res *types.RemoveAlarmResponse `xml:"urn:vim25 RemoveAlarmResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *RemoveAlarmBody) Fault() *soap.Fault { return b.Fault_ } - -func RemoveAlarm(ctx context.Context, r soap.RoundTripper, req *types.RemoveAlarm) (*types.RemoveAlarmResponse, error) { - var reqBody, resBody RemoveAlarmBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type RemoveAllSnapshots_TaskBody struct { - Req *types.RemoveAllSnapshots_Task `xml:"urn:vim25 RemoveAllSnapshots_Task,omitempty"` - Res *types.RemoveAllSnapshots_TaskResponse `xml:"urn:vim25 RemoveAllSnapshots_TaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *RemoveAllSnapshots_TaskBody) Fault() *soap.Fault { return b.Fault_ } - -func RemoveAllSnapshots_Task(ctx context.Context, r soap.RoundTripper, req *types.RemoveAllSnapshots_Task) (*types.RemoveAllSnapshots_TaskResponse, error) { - var reqBody, resBody RemoveAllSnapshots_TaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type RemoveAssignedLicenseBody struct { - Req *types.RemoveAssignedLicense `xml:"urn:vim25 RemoveAssignedLicense,omitempty"` - Res *types.RemoveAssignedLicenseResponse `xml:"urn:vim25 RemoveAssignedLicenseResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *RemoveAssignedLicenseBody) Fault() *soap.Fault { return b.Fault_ } - -func RemoveAssignedLicense(ctx context.Context, r soap.RoundTripper, req *types.RemoveAssignedLicense) (*types.RemoveAssignedLicenseResponse, error) { - var reqBody, resBody RemoveAssignedLicenseBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type RemoveAuthorizationRoleBody struct { - Req *types.RemoveAuthorizationRole `xml:"urn:vim25 RemoveAuthorizationRole,omitempty"` - Res *types.RemoveAuthorizationRoleResponse `xml:"urn:vim25 RemoveAuthorizationRoleResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *RemoveAuthorizationRoleBody) Fault() *soap.Fault { return b.Fault_ } - -func RemoveAuthorizationRole(ctx context.Context, r soap.RoundTripper, req *types.RemoveAuthorizationRole) (*types.RemoveAuthorizationRoleResponse, error) { - var reqBody, resBody RemoveAuthorizationRoleBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type RemoveCustomFieldDefBody struct { - Req *types.RemoveCustomFieldDef `xml:"urn:vim25 RemoveCustomFieldDef,omitempty"` - Res *types.RemoveCustomFieldDefResponse `xml:"urn:vim25 RemoveCustomFieldDefResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *RemoveCustomFieldDefBody) Fault() *soap.Fault { return b.Fault_ } - -func RemoveCustomFieldDef(ctx context.Context, r soap.RoundTripper, req *types.RemoveCustomFieldDef) (*types.RemoveCustomFieldDefResponse, error) { - var reqBody, resBody RemoveCustomFieldDefBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type RemoveDatastoreBody struct { - Req *types.RemoveDatastore `xml:"urn:vim25 RemoveDatastore,omitempty"` - Res *types.RemoveDatastoreResponse `xml:"urn:vim25 RemoveDatastoreResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *RemoveDatastoreBody) Fault() *soap.Fault { return b.Fault_ } - -func RemoveDatastore(ctx context.Context, r soap.RoundTripper, req *types.RemoveDatastore) (*types.RemoveDatastoreResponse, error) { - var reqBody, resBody RemoveDatastoreBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type RemoveDiskMapping_TaskBody struct { - Req *types.RemoveDiskMapping_Task `xml:"urn:vim25 RemoveDiskMapping_Task,omitempty"` - Res *types.RemoveDiskMapping_TaskResponse `xml:"urn:vim25 RemoveDiskMapping_TaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *RemoveDiskMapping_TaskBody) Fault() *soap.Fault { return b.Fault_ } - -func RemoveDiskMapping_Task(ctx context.Context, r soap.RoundTripper, req *types.RemoveDiskMapping_Task) (*types.RemoveDiskMapping_TaskResponse, error) { - var reqBody, resBody RemoveDiskMapping_TaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type RemoveDisk_TaskBody struct { - Req *types.RemoveDisk_Task `xml:"urn:vim25 RemoveDisk_Task,omitempty"` - Res *types.RemoveDisk_TaskResponse `xml:"urn:vim25 RemoveDisk_TaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *RemoveDisk_TaskBody) Fault() *soap.Fault { return b.Fault_ } - -func RemoveDisk_Task(ctx context.Context, r soap.RoundTripper, req *types.RemoveDisk_Task) (*types.RemoveDisk_TaskResponse, error) { - var reqBody, resBody RemoveDisk_TaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type RemoveEntityPermissionBody struct { - Req *types.RemoveEntityPermission `xml:"urn:vim25 RemoveEntityPermission,omitempty"` - Res *types.RemoveEntityPermissionResponse `xml:"urn:vim25 RemoveEntityPermissionResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *RemoveEntityPermissionBody) Fault() *soap.Fault { return b.Fault_ } - -func RemoveEntityPermission(ctx context.Context, r soap.RoundTripper, req *types.RemoveEntityPermission) (*types.RemoveEntityPermissionResponse, error) { - var reqBody, resBody RemoveEntityPermissionBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type RemoveGroupBody struct { - Req *types.RemoveGroup `xml:"urn:vim25 RemoveGroup,omitempty"` - Res *types.RemoveGroupResponse `xml:"urn:vim25 RemoveGroupResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *RemoveGroupBody) Fault() *soap.Fault { return b.Fault_ } - -func RemoveGroup(ctx context.Context, r soap.RoundTripper, req *types.RemoveGroup) (*types.RemoveGroupResponse, error) { - var reqBody, resBody RemoveGroupBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type RemoveInternetScsiSendTargetsBody struct { - Req *types.RemoveInternetScsiSendTargets `xml:"urn:vim25 RemoveInternetScsiSendTargets,omitempty"` - Res *types.RemoveInternetScsiSendTargetsResponse `xml:"urn:vim25 RemoveInternetScsiSendTargetsResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *RemoveInternetScsiSendTargetsBody) Fault() *soap.Fault { return b.Fault_ } - -func RemoveInternetScsiSendTargets(ctx context.Context, r soap.RoundTripper, req *types.RemoveInternetScsiSendTargets) (*types.RemoveInternetScsiSendTargetsResponse, error) { - var reqBody, resBody RemoveInternetScsiSendTargetsBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type RemoveInternetScsiStaticTargetsBody struct { - Req *types.RemoveInternetScsiStaticTargets `xml:"urn:vim25 RemoveInternetScsiStaticTargets,omitempty"` - Res *types.RemoveInternetScsiStaticTargetsResponse `xml:"urn:vim25 RemoveInternetScsiStaticTargetsResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *RemoveInternetScsiStaticTargetsBody) Fault() *soap.Fault { return b.Fault_ } - -func RemoveInternetScsiStaticTargets(ctx context.Context, r soap.RoundTripper, req *types.RemoveInternetScsiStaticTargets) (*types.RemoveInternetScsiStaticTargetsResponse, error) { - var reqBody, resBody RemoveInternetScsiStaticTargetsBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type RemoveLicenseBody struct { - Req *types.RemoveLicense `xml:"urn:vim25 RemoveLicense,omitempty"` - Res *types.RemoveLicenseResponse `xml:"urn:vim25 RemoveLicenseResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *RemoveLicenseBody) Fault() *soap.Fault { return b.Fault_ } - -func RemoveLicense(ctx context.Context, r soap.RoundTripper, req *types.RemoveLicense) (*types.RemoveLicenseResponse, error) { - var reqBody, resBody RemoveLicenseBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type RemoveLicenseLabelBody struct { - Req *types.RemoveLicenseLabel `xml:"urn:vim25 RemoveLicenseLabel,omitempty"` - Res *types.RemoveLicenseLabelResponse `xml:"urn:vim25 RemoveLicenseLabelResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *RemoveLicenseLabelBody) Fault() *soap.Fault { return b.Fault_ } - -func RemoveLicenseLabel(ctx context.Context, r soap.RoundTripper, req *types.RemoveLicenseLabel) (*types.RemoveLicenseLabelResponse, error) { - var reqBody, resBody RemoveLicenseLabelBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type RemoveNetworkResourcePoolBody struct { - Req *types.RemoveNetworkResourcePool `xml:"urn:vim25 RemoveNetworkResourcePool,omitempty"` - Res *types.RemoveNetworkResourcePoolResponse `xml:"urn:vim25 RemoveNetworkResourcePoolResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *RemoveNetworkResourcePoolBody) Fault() *soap.Fault { return b.Fault_ } - -func RemoveNetworkResourcePool(ctx context.Context, r soap.RoundTripper, req *types.RemoveNetworkResourcePool) (*types.RemoveNetworkResourcePoolResponse, error) { - var reqBody, resBody RemoveNetworkResourcePoolBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type RemovePerfIntervalBody struct { - Req *types.RemovePerfInterval `xml:"urn:vim25 RemovePerfInterval,omitempty"` - Res *types.RemovePerfIntervalResponse `xml:"urn:vim25 RemovePerfIntervalResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *RemovePerfIntervalBody) Fault() *soap.Fault { return b.Fault_ } - -func RemovePerfInterval(ctx context.Context, r soap.RoundTripper, req *types.RemovePerfInterval) (*types.RemovePerfIntervalResponse, error) { - var reqBody, resBody RemovePerfIntervalBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type RemovePortGroupBody struct { - Req *types.RemovePortGroup `xml:"urn:vim25 RemovePortGroup,omitempty"` - Res *types.RemovePortGroupResponse `xml:"urn:vim25 RemovePortGroupResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *RemovePortGroupBody) Fault() *soap.Fault { return b.Fault_ } - -func RemovePortGroup(ctx context.Context, r soap.RoundTripper, req *types.RemovePortGroup) (*types.RemovePortGroupResponse, error) { - var reqBody, resBody RemovePortGroupBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type RemoveScheduledTaskBody struct { - Req *types.RemoveScheduledTask `xml:"urn:vim25 RemoveScheduledTask,omitempty"` - Res *types.RemoveScheduledTaskResponse `xml:"urn:vim25 RemoveScheduledTaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *RemoveScheduledTaskBody) Fault() *soap.Fault { return b.Fault_ } - -func RemoveScheduledTask(ctx context.Context, r soap.RoundTripper, req *types.RemoveScheduledTask) (*types.RemoveScheduledTaskResponse, error) { - var reqBody, resBody RemoveScheduledTaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type RemoveServiceConsoleVirtualNicBody struct { - Req *types.RemoveServiceConsoleVirtualNic `xml:"urn:vim25 RemoveServiceConsoleVirtualNic,omitempty"` - Res *types.RemoveServiceConsoleVirtualNicResponse `xml:"urn:vim25 RemoveServiceConsoleVirtualNicResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *RemoveServiceConsoleVirtualNicBody) Fault() *soap.Fault { return b.Fault_ } - -func RemoveServiceConsoleVirtualNic(ctx context.Context, r soap.RoundTripper, req *types.RemoveServiceConsoleVirtualNic) (*types.RemoveServiceConsoleVirtualNicResponse, error) { - var reqBody, resBody RemoveServiceConsoleVirtualNicBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type RemoveSnapshot_TaskBody struct { - Req *types.RemoveSnapshot_Task `xml:"urn:vim25 RemoveSnapshot_Task,omitempty"` - Res *types.RemoveSnapshot_TaskResponse `xml:"urn:vim25 RemoveSnapshot_TaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *RemoveSnapshot_TaskBody) Fault() *soap.Fault { return b.Fault_ } - -func RemoveSnapshot_Task(ctx context.Context, r soap.RoundTripper, req *types.RemoveSnapshot_Task) (*types.RemoveSnapshot_TaskResponse, error) { - var reqBody, resBody RemoveSnapshot_TaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type RemoveUserBody struct { - Req *types.RemoveUser `xml:"urn:vim25 RemoveUser,omitempty"` - Res *types.RemoveUserResponse `xml:"urn:vim25 RemoveUserResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *RemoveUserBody) Fault() *soap.Fault { return b.Fault_ } - -func RemoveUser(ctx context.Context, r soap.RoundTripper, req *types.RemoveUser) (*types.RemoveUserResponse, error) { - var reqBody, resBody RemoveUserBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type RemoveVirtualNicBody struct { - Req *types.RemoveVirtualNic `xml:"urn:vim25 RemoveVirtualNic,omitempty"` - Res *types.RemoveVirtualNicResponse `xml:"urn:vim25 RemoveVirtualNicResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *RemoveVirtualNicBody) Fault() *soap.Fault { return b.Fault_ } - -func RemoveVirtualNic(ctx context.Context, r soap.RoundTripper, req *types.RemoveVirtualNic) (*types.RemoveVirtualNicResponse, error) { - var reqBody, resBody RemoveVirtualNicBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type RemoveVirtualSwitchBody struct { - Req *types.RemoveVirtualSwitch `xml:"urn:vim25 RemoveVirtualSwitch,omitempty"` - Res *types.RemoveVirtualSwitchResponse `xml:"urn:vim25 RemoveVirtualSwitchResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *RemoveVirtualSwitchBody) Fault() *soap.Fault { return b.Fault_ } - -func RemoveVirtualSwitch(ctx context.Context, r soap.RoundTripper, req *types.RemoveVirtualSwitch) (*types.RemoveVirtualSwitchResponse, error) { - var reqBody, resBody RemoveVirtualSwitchBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type RenameCustomFieldDefBody struct { - Req *types.RenameCustomFieldDef `xml:"urn:vim25 RenameCustomFieldDef,omitempty"` - Res *types.RenameCustomFieldDefResponse `xml:"urn:vim25 RenameCustomFieldDefResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *RenameCustomFieldDefBody) Fault() *soap.Fault { return b.Fault_ } - -func RenameCustomFieldDef(ctx context.Context, r soap.RoundTripper, req *types.RenameCustomFieldDef) (*types.RenameCustomFieldDefResponse, error) { - var reqBody, resBody RenameCustomFieldDefBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type RenameCustomizationSpecBody struct { - Req *types.RenameCustomizationSpec `xml:"urn:vim25 RenameCustomizationSpec,omitempty"` - Res *types.RenameCustomizationSpecResponse `xml:"urn:vim25 RenameCustomizationSpecResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *RenameCustomizationSpecBody) Fault() *soap.Fault { return b.Fault_ } - -func RenameCustomizationSpec(ctx context.Context, r soap.RoundTripper, req *types.RenameCustomizationSpec) (*types.RenameCustomizationSpecResponse, error) { - var reqBody, resBody RenameCustomizationSpecBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type RenameDatastoreBody struct { - Req *types.RenameDatastore `xml:"urn:vim25 RenameDatastore,omitempty"` - Res *types.RenameDatastoreResponse `xml:"urn:vim25 RenameDatastoreResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *RenameDatastoreBody) Fault() *soap.Fault { return b.Fault_ } - -func RenameDatastore(ctx context.Context, r soap.RoundTripper, req *types.RenameDatastore) (*types.RenameDatastoreResponse, error) { - var reqBody, resBody RenameDatastoreBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type RenameSnapshotBody struct { - Req *types.RenameSnapshot `xml:"urn:vim25 RenameSnapshot,omitempty"` - Res *types.RenameSnapshotResponse `xml:"urn:vim25 RenameSnapshotResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *RenameSnapshotBody) Fault() *soap.Fault { return b.Fault_ } - -func RenameSnapshot(ctx context.Context, r soap.RoundTripper, req *types.RenameSnapshot) (*types.RenameSnapshotResponse, error) { - var reqBody, resBody RenameSnapshotBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type Rename_TaskBody struct { - Req *types.Rename_Task `xml:"urn:vim25 Rename_Task,omitempty"` - Res *types.Rename_TaskResponse `xml:"urn:vim25 Rename_TaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *Rename_TaskBody) Fault() *soap.Fault { return b.Fault_ } - -func Rename_Task(ctx context.Context, r soap.RoundTripper, req *types.Rename_Task) (*types.Rename_TaskResponse, error) { - var reqBody, resBody Rename_TaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type RescanAllHbaBody struct { - Req *types.RescanAllHba `xml:"urn:vim25 RescanAllHba,omitempty"` - Res *types.RescanAllHbaResponse `xml:"urn:vim25 RescanAllHbaResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *RescanAllHbaBody) Fault() *soap.Fault { return b.Fault_ } - -func RescanAllHba(ctx context.Context, r soap.RoundTripper, req *types.RescanAllHba) (*types.RescanAllHbaResponse, error) { - var reqBody, resBody RescanAllHbaBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type RescanHbaBody struct { - Req *types.RescanHba `xml:"urn:vim25 RescanHba,omitempty"` - Res *types.RescanHbaResponse `xml:"urn:vim25 RescanHbaResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *RescanHbaBody) Fault() *soap.Fault { return b.Fault_ } - -func RescanHba(ctx context.Context, r soap.RoundTripper, req *types.RescanHba) (*types.RescanHbaResponse, error) { - var reqBody, resBody RescanHbaBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type RescanVffsBody struct { - Req *types.RescanVffs `xml:"urn:vim25 RescanVffs,omitempty"` - Res *types.RescanVffsResponse `xml:"urn:vim25 RescanVffsResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *RescanVffsBody) Fault() *soap.Fault { return b.Fault_ } - -func RescanVffs(ctx context.Context, r soap.RoundTripper, req *types.RescanVffs) (*types.RescanVffsResponse, error) { - var reqBody, resBody RescanVffsBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type RescanVmfsBody struct { - Req *types.RescanVmfs `xml:"urn:vim25 RescanVmfs,omitempty"` - Res *types.RescanVmfsResponse `xml:"urn:vim25 RescanVmfsResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *RescanVmfsBody) Fault() *soap.Fault { return b.Fault_ } - -func RescanVmfs(ctx context.Context, r soap.RoundTripper, req *types.RescanVmfs) (*types.RescanVmfsResponse, error) { - var reqBody, resBody RescanVmfsBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type ResetCollectorBody struct { - Req *types.ResetCollector `xml:"urn:vim25 ResetCollector,omitempty"` - Res *types.ResetCollectorResponse `xml:"urn:vim25 ResetCollectorResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *ResetCollectorBody) Fault() *soap.Fault { return b.Fault_ } - -func ResetCollector(ctx context.Context, r soap.RoundTripper, req *types.ResetCollector) (*types.ResetCollectorResponse, error) { - var reqBody, resBody ResetCollectorBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type ResetCounterLevelMappingBody struct { - Req *types.ResetCounterLevelMapping `xml:"urn:vim25 ResetCounterLevelMapping,omitempty"` - Res *types.ResetCounterLevelMappingResponse `xml:"urn:vim25 ResetCounterLevelMappingResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *ResetCounterLevelMappingBody) Fault() *soap.Fault { return b.Fault_ } - -func ResetCounterLevelMapping(ctx context.Context, r soap.RoundTripper, req *types.ResetCounterLevelMapping) (*types.ResetCounterLevelMappingResponse, error) { - var reqBody, resBody ResetCounterLevelMappingBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type ResetEntityPermissionsBody struct { - Req *types.ResetEntityPermissions `xml:"urn:vim25 ResetEntityPermissions,omitempty"` - Res *types.ResetEntityPermissionsResponse `xml:"urn:vim25 ResetEntityPermissionsResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *ResetEntityPermissionsBody) Fault() *soap.Fault { return b.Fault_ } - -func ResetEntityPermissions(ctx context.Context, r soap.RoundTripper, req *types.ResetEntityPermissions) (*types.ResetEntityPermissionsResponse, error) { - var reqBody, resBody ResetEntityPermissionsBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type ResetFirmwareToFactoryDefaultsBody struct { - Req *types.ResetFirmwareToFactoryDefaults `xml:"urn:vim25 ResetFirmwareToFactoryDefaults,omitempty"` - Res *types.ResetFirmwareToFactoryDefaultsResponse `xml:"urn:vim25 ResetFirmwareToFactoryDefaultsResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *ResetFirmwareToFactoryDefaultsBody) Fault() *soap.Fault { return b.Fault_ } - -func ResetFirmwareToFactoryDefaults(ctx context.Context, r soap.RoundTripper, req *types.ResetFirmwareToFactoryDefaults) (*types.ResetFirmwareToFactoryDefaultsResponse, error) { - var reqBody, resBody ResetFirmwareToFactoryDefaultsBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type ResetGuestInformationBody struct { - Req *types.ResetGuestInformation `xml:"urn:vim25 ResetGuestInformation,omitempty"` - Res *types.ResetGuestInformationResponse `xml:"urn:vim25 ResetGuestInformationResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *ResetGuestInformationBody) Fault() *soap.Fault { return b.Fault_ } - -func ResetGuestInformation(ctx context.Context, r soap.RoundTripper, req *types.ResetGuestInformation) (*types.ResetGuestInformationResponse, error) { - var reqBody, resBody ResetGuestInformationBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type ResetListViewBody struct { - Req *types.ResetListView `xml:"urn:vim25 ResetListView,omitempty"` - Res *types.ResetListViewResponse `xml:"urn:vim25 ResetListViewResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *ResetListViewBody) Fault() *soap.Fault { return b.Fault_ } - -func ResetListView(ctx context.Context, r soap.RoundTripper, req *types.ResetListView) (*types.ResetListViewResponse, error) { - var reqBody, resBody ResetListViewBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type ResetListViewFromViewBody struct { - Req *types.ResetListViewFromView `xml:"urn:vim25 ResetListViewFromView,omitempty"` - Res *types.ResetListViewFromViewResponse `xml:"urn:vim25 ResetListViewFromViewResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *ResetListViewFromViewBody) Fault() *soap.Fault { return b.Fault_ } - -func ResetListViewFromView(ctx context.Context, r soap.RoundTripper, req *types.ResetListViewFromView) (*types.ResetListViewFromViewResponse, error) { - var reqBody, resBody ResetListViewFromViewBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type ResetSystemHealthInfoBody struct { - Req *types.ResetSystemHealthInfo `xml:"urn:vim25 ResetSystemHealthInfo,omitempty"` - Res *types.ResetSystemHealthInfoResponse `xml:"urn:vim25 ResetSystemHealthInfoResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *ResetSystemHealthInfoBody) Fault() *soap.Fault { return b.Fault_ } - -func ResetSystemHealthInfo(ctx context.Context, r soap.RoundTripper, req *types.ResetSystemHealthInfo) (*types.ResetSystemHealthInfoResponse, error) { - var reqBody, resBody ResetSystemHealthInfoBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type ResetVM_TaskBody struct { - Req *types.ResetVM_Task `xml:"urn:vim25 ResetVM_Task,omitempty"` - Res *types.ResetVM_TaskResponse `xml:"urn:vim25 ResetVM_TaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *ResetVM_TaskBody) Fault() *soap.Fault { return b.Fault_ } - -func ResetVM_Task(ctx context.Context, r soap.RoundTripper, req *types.ResetVM_Task) (*types.ResetVM_TaskResponse, error) { - var reqBody, resBody ResetVM_TaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type ResignatureUnresolvedVmfsVolume_TaskBody struct { - Req *types.ResignatureUnresolvedVmfsVolume_Task `xml:"urn:vim25 ResignatureUnresolvedVmfsVolume_Task,omitempty"` - Res *types.ResignatureUnresolvedVmfsVolume_TaskResponse `xml:"urn:vim25 ResignatureUnresolvedVmfsVolume_TaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *ResignatureUnresolvedVmfsVolume_TaskBody) Fault() *soap.Fault { return b.Fault_ } - -func ResignatureUnresolvedVmfsVolume_Task(ctx context.Context, r soap.RoundTripper, req *types.ResignatureUnresolvedVmfsVolume_Task) (*types.ResignatureUnresolvedVmfsVolume_TaskResponse, error) { - var reqBody, resBody ResignatureUnresolvedVmfsVolume_TaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type ResolveMultipleUnresolvedVmfsVolumesBody struct { - Req *types.ResolveMultipleUnresolvedVmfsVolumes `xml:"urn:vim25 ResolveMultipleUnresolvedVmfsVolumes,omitempty"` - Res *types.ResolveMultipleUnresolvedVmfsVolumesResponse `xml:"urn:vim25 ResolveMultipleUnresolvedVmfsVolumesResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *ResolveMultipleUnresolvedVmfsVolumesBody) Fault() *soap.Fault { return b.Fault_ } - -func ResolveMultipleUnresolvedVmfsVolumes(ctx context.Context, r soap.RoundTripper, req *types.ResolveMultipleUnresolvedVmfsVolumes) (*types.ResolveMultipleUnresolvedVmfsVolumesResponse, error) { - var reqBody, resBody ResolveMultipleUnresolvedVmfsVolumesBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type ResolveMultipleUnresolvedVmfsVolumesEx_TaskBody struct { - Req *types.ResolveMultipleUnresolvedVmfsVolumesEx_Task `xml:"urn:vim25 ResolveMultipleUnresolvedVmfsVolumesEx_Task,omitempty"` - Res *types.ResolveMultipleUnresolvedVmfsVolumesEx_TaskResponse `xml:"urn:vim25 ResolveMultipleUnresolvedVmfsVolumesEx_TaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *ResolveMultipleUnresolvedVmfsVolumesEx_TaskBody) Fault() *soap.Fault { return b.Fault_ } - -func ResolveMultipleUnresolvedVmfsVolumesEx_Task(ctx context.Context, r soap.RoundTripper, req *types.ResolveMultipleUnresolvedVmfsVolumesEx_Task) (*types.ResolveMultipleUnresolvedVmfsVolumesEx_TaskResponse, error) { - var reqBody, resBody ResolveMultipleUnresolvedVmfsVolumesEx_TaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type RestartServiceBody struct { - Req *types.RestartService `xml:"urn:vim25 RestartService,omitempty"` - Res *types.RestartServiceResponse `xml:"urn:vim25 RestartServiceResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *RestartServiceBody) Fault() *soap.Fault { return b.Fault_ } - -func RestartService(ctx context.Context, r soap.RoundTripper, req *types.RestartService) (*types.RestartServiceResponse, error) { - var reqBody, resBody RestartServiceBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type RestartServiceConsoleVirtualNicBody struct { - Req *types.RestartServiceConsoleVirtualNic `xml:"urn:vim25 RestartServiceConsoleVirtualNic,omitempty"` - Res *types.RestartServiceConsoleVirtualNicResponse `xml:"urn:vim25 RestartServiceConsoleVirtualNicResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *RestartServiceConsoleVirtualNicBody) Fault() *soap.Fault { return b.Fault_ } - -func RestartServiceConsoleVirtualNic(ctx context.Context, r soap.RoundTripper, req *types.RestartServiceConsoleVirtualNic) (*types.RestartServiceConsoleVirtualNicResponse, error) { - var reqBody, resBody RestartServiceConsoleVirtualNicBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type RestoreFirmwareConfigurationBody struct { - Req *types.RestoreFirmwareConfiguration `xml:"urn:vim25 RestoreFirmwareConfiguration,omitempty"` - Res *types.RestoreFirmwareConfigurationResponse `xml:"urn:vim25 RestoreFirmwareConfigurationResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *RestoreFirmwareConfigurationBody) Fault() *soap.Fault { return b.Fault_ } - -func RestoreFirmwareConfiguration(ctx context.Context, r soap.RoundTripper, req *types.RestoreFirmwareConfiguration) (*types.RestoreFirmwareConfigurationResponse, error) { - var reqBody, resBody RestoreFirmwareConfigurationBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type RetrieveAllPermissionsBody struct { - Req *types.RetrieveAllPermissions `xml:"urn:vim25 RetrieveAllPermissions,omitempty"` - Res *types.RetrieveAllPermissionsResponse `xml:"urn:vim25 RetrieveAllPermissionsResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *RetrieveAllPermissionsBody) Fault() *soap.Fault { return b.Fault_ } - -func RetrieveAllPermissions(ctx context.Context, r soap.RoundTripper, req *types.RetrieveAllPermissions) (*types.RetrieveAllPermissionsResponse, error) { - var reqBody, resBody RetrieveAllPermissionsBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type RetrieveAnswerFileBody struct { - Req *types.RetrieveAnswerFile `xml:"urn:vim25 RetrieveAnswerFile,omitempty"` - Res *types.RetrieveAnswerFileResponse `xml:"urn:vim25 RetrieveAnswerFileResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *RetrieveAnswerFileBody) Fault() *soap.Fault { return b.Fault_ } - -func RetrieveAnswerFile(ctx context.Context, r soap.RoundTripper, req *types.RetrieveAnswerFile) (*types.RetrieveAnswerFileResponse, error) { - var reqBody, resBody RetrieveAnswerFileBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type RetrieveAnswerFileForProfileBody struct { - Req *types.RetrieveAnswerFileForProfile `xml:"urn:vim25 RetrieveAnswerFileForProfile,omitempty"` - Res *types.RetrieveAnswerFileForProfileResponse `xml:"urn:vim25 RetrieveAnswerFileForProfileResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *RetrieveAnswerFileForProfileBody) Fault() *soap.Fault { return b.Fault_ } - -func RetrieveAnswerFileForProfile(ctx context.Context, r soap.RoundTripper, req *types.RetrieveAnswerFileForProfile) (*types.RetrieveAnswerFileForProfileResponse, error) { - var reqBody, resBody RetrieveAnswerFileForProfileBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type RetrieveArgumentDescriptionBody struct { - Req *types.RetrieveArgumentDescription `xml:"urn:vim25 RetrieveArgumentDescription,omitempty"` - Res *types.RetrieveArgumentDescriptionResponse `xml:"urn:vim25 RetrieveArgumentDescriptionResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *RetrieveArgumentDescriptionBody) Fault() *soap.Fault { return b.Fault_ } - -func RetrieveArgumentDescription(ctx context.Context, r soap.RoundTripper, req *types.RetrieveArgumentDescription) (*types.RetrieveArgumentDescriptionResponse, error) { - var reqBody, resBody RetrieveArgumentDescriptionBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type RetrieveDasAdvancedRuntimeInfoBody struct { - Req *types.RetrieveDasAdvancedRuntimeInfo `xml:"urn:vim25 RetrieveDasAdvancedRuntimeInfo,omitempty"` - Res *types.RetrieveDasAdvancedRuntimeInfoResponse `xml:"urn:vim25 RetrieveDasAdvancedRuntimeInfoResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *RetrieveDasAdvancedRuntimeInfoBody) Fault() *soap.Fault { return b.Fault_ } - -func RetrieveDasAdvancedRuntimeInfo(ctx context.Context, r soap.RoundTripper, req *types.RetrieveDasAdvancedRuntimeInfo) (*types.RetrieveDasAdvancedRuntimeInfoResponse, error) { - var reqBody, resBody RetrieveDasAdvancedRuntimeInfoBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type RetrieveDescriptionBody struct { - Req *types.RetrieveDescription `xml:"urn:vim25 RetrieveDescription,omitempty"` - Res *types.RetrieveDescriptionResponse `xml:"urn:vim25 RetrieveDescriptionResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *RetrieveDescriptionBody) Fault() *soap.Fault { return b.Fault_ } - -func RetrieveDescription(ctx context.Context, r soap.RoundTripper, req *types.RetrieveDescription) (*types.RetrieveDescriptionResponse, error) { - var reqBody, resBody RetrieveDescriptionBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type RetrieveDiskPartitionInfoBody struct { - Req *types.RetrieveDiskPartitionInfo `xml:"urn:vim25 RetrieveDiskPartitionInfo,omitempty"` - Res *types.RetrieveDiskPartitionInfoResponse `xml:"urn:vim25 RetrieveDiskPartitionInfoResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *RetrieveDiskPartitionInfoBody) Fault() *soap.Fault { return b.Fault_ } - -func RetrieveDiskPartitionInfo(ctx context.Context, r soap.RoundTripper, req *types.RetrieveDiskPartitionInfo) (*types.RetrieveDiskPartitionInfoResponse, error) { - var reqBody, resBody RetrieveDiskPartitionInfoBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type RetrieveEntityPermissionsBody struct { - Req *types.RetrieveEntityPermissions `xml:"urn:vim25 RetrieveEntityPermissions,omitempty"` - Res *types.RetrieveEntityPermissionsResponse `xml:"urn:vim25 RetrieveEntityPermissionsResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *RetrieveEntityPermissionsBody) Fault() *soap.Fault { return b.Fault_ } - -func RetrieveEntityPermissions(ctx context.Context, r soap.RoundTripper, req *types.RetrieveEntityPermissions) (*types.RetrieveEntityPermissionsResponse, error) { - var reqBody, resBody RetrieveEntityPermissionsBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type RetrieveEntityScheduledTaskBody struct { - Req *types.RetrieveEntityScheduledTask `xml:"urn:vim25 RetrieveEntityScheduledTask,omitempty"` - Res *types.RetrieveEntityScheduledTaskResponse `xml:"urn:vim25 RetrieveEntityScheduledTaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *RetrieveEntityScheduledTaskBody) Fault() *soap.Fault { return b.Fault_ } - -func RetrieveEntityScheduledTask(ctx context.Context, r soap.RoundTripper, req *types.RetrieveEntityScheduledTask) (*types.RetrieveEntityScheduledTaskResponse, error) { - var reqBody, resBody RetrieveEntityScheduledTaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type RetrieveHardwareUptimeBody struct { - Req *types.RetrieveHardwareUptime `xml:"urn:vim25 RetrieveHardwareUptime,omitempty"` - Res *types.RetrieveHardwareUptimeResponse `xml:"urn:vim25 RetrieveHardwareUptimeResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *RetrieveHardwareUptimeBody) Fault() *soap.Fault { return b.Fault_ } - -func RetrieveHardwareUptime(ctx context.Context, r soap.RoundTripper, req *types.RetrieveHardwareUptime) (*types.RetrieveHardwareUptimeResponse, error) { - var reqBody, resBody RetrieveHardwareUptimeBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type RetrieveObjectScheduledTaskBody struct { - Req *types.RetrieveObjectScheduledTask `xml:"urn:vim25 RetrieveObjectScheduledTask,omitempty"` - Res *types.RetrieveObjectScheduledTaskResponse `xml:"urn:vim25 RetrieveObjectScheduledTaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *RetrieveObjectScheduledTaskBody) Fault() *soap.Fault { return b.Fault_ } - -func RetrieveObjectScheduledTask(ctx context.Context, r soap.RoundTripper, req *types.RetrieveObjectScheduledTask) (*types.RetrieveObjectScheduledTaskResponse, error) { - var reqBody, resBody RetrieveObjectScheduledTaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type RetrieveProductComponentsBody struct { - Req *types.RetrieveProductComponents `xml:"urn:vim25 RetrieveProductComponents,omitempty"` - Res *types.RetrieveProductComponentsResponse `xml:"urn:vim25 RetrieveProductComponentsResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *RetrieveProductComponentsBody) Fault() *soap.Fault { return b.Fault_ } - -func RetrieveProductComponents(ctx context.Context, r soap.RoundTripper, req *types.RetrieveProductComponents) (*types.RetrieveProductComponentsResponse, error) { - var reqBody, resBody RetrieveProductComponentsBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type RetrievePropertiesBody struct { - Req *types.RetrieveProperties `xml:"urn:vim25 RetrieveProperties,omitempty"` - Res *types.RetrievePropertiesResponse `xml:"urn:vim25 RetrievePropertiesResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *RetrievePropertiesBody) Fault() *soap.Fault { return b.Fault_ } - -func RetrieveProperties(ctx context.Context, r soap.RoundTripper, req *types.RetrieveProperties) (*types.RetrievePropertiesResponse, error) { - var reqBody, resBody RetrievePropertiesBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type RetrievePropertiesExBody struct { - Req *types.RetrievePropertiesEx `xml:"urn:vim25 RetrievePropertiesEx,omitempty"` - Res *types.RetrievePropertiesExResponse `xml:"urn:vim25 RetrievePropertiesExResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *RetrievePropertiesExBody) Fault() *soap.Fault { return b.Fault_ } - -func RetrievePropertiesEx(ctx context.Context, r soap.RoundTripper, req *types.RetrievePropertiesEx) (*types.RetrievePropertiesExResponse, error) { - var reqBody, resBody RetrievePropertiesExBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type RetrieveRolePermissionsBody struct { - Req *types.RetrieveRolePermissions `xml:"urn:vim25 RetrieveRolePermissions,omitempty"` - Res *types.RetrieveRolePermissionsResponse `xml:"urn:vim25 RetrieveRolePermissionsResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *RetrieveRolePermissionsBody) Fault() *soap.Fault { return b.Fault_ } - -func RetrieveRolePermissions(ctx context.Context, r soap.RoundTripper, req *types.RetrieveRolePermissions) (*types.RetrieveRolePermissionsResponse, error) { - var reqBody, resBody RetrieveRolePermissionsBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type RetrieveServiceContentBody struct { - Req *types.RetrieveServiceContent `xml:"urn:vim25 RetrieveServiceContent,omitempty"` - Res *types.RetrieveServiceContentResponse `xml:"urn:vim25 RetrieveServiceContentResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *RetrieveServiceContentBody) Fault() *soap.Fault { return b.Fault_ } - -func RetrieveServiceContent(ctx context.Context, r soap.RoundTripper, req *types.RetrieveServiceContent) (*types.RetrieveServiceContentResponse, error) { - var reqBody, resBody RetrieveServiceContentBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type RetrieveUserGroupsBody struct { - Req *types.RetrieveUserGroups `xml:"urn:vim25 RetrieveUserGroups,omitempty"` - Res *types.RetrieveUserGroupsResponse `xml:"urn:vim25 RetrieveUserGroupsResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *RetrieveUserGroupsBody) Fault() *soap.Fault { return b.Fault_ } - -func RetrieveUserGroups(ctx context.Context, r soap.RoundTripper, req *types.RetrieveUserGroups) (*types.RetrieveUserGroupsResponse, error) { - var reqBody, resBody RetrieveUserGroupsBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type RevertToCurrentSnapshot_TaskBody struct { - Req *types.RevertToCurrentSnapshot_Task `xml:"urn:vim25 RevertToCurrentSnapshot_Task,omitempty"` - Res *types.RevertToCurrentSnapshot_TaskResponse `xml:"urn:vim25 RevertToCurrentSnapshot_TaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *RevertToCurrentSnapshot_TaskBody) Fault() *soap.Fault { return b.Fault_ } - -func RevertToCurrentSnapshot_Task(ctx context.Context, r soap.RoundTripper, req *types.RevertToCurrentSnapshot_Task) (*types.RevertToCurrentSnapshot_TaskResponse, error) { - var reqBody, resBody RevertToCurrentSnapshot_TaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type RevertToSnapshot_TaskBody struct { - Req *types.RevertToSnapshot_Task `xml:"urn:vim25 RevertToSnapshot_Task,omitempty"` - Res *types.RevertToSnapshot_TaskResponse `xml:"urn:vim25 RevertToSnapshot_TaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *RevertToSnapshot_TaskBody) Fault() *soap.Fault { return b.Fault_ } - -func RevertToSnapshot_Task(ctx context.Context, r soap.RoundTripper, req *types.RevertToSnapshot_Task) (*types.RevertToSnapshot_TaskResponse, error) { - var reqBody, resBody RevertToSnapshot_TaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type RewindCollectorBody struct { - Req *types.RewindCollector `xml:"urn:vim25 RewindCollector,omitempty"` - Res *types.RewindCollectorResponse `xml:"urn:vim25 RewindCollectorResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *RewindCollectorBody) Fault() *soap.Fault { return b.Fault_ } - -func RewindCollector(ctx context.Context, r soap.RoundTripper, req *types.RewindCollector) (*types.RewindCollectorResponse, error) { - var reqBody, resBody RewindCollectorBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type RunScheduledTaskBody struct { - Req *types.RunScheduledTask `xml:"urn:vim25 RunScheduledTask,omitempty"` - Res *types.RunScheduledTaskResponse `xml:"urn:vim25 RunScheduledTaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *RunScheduledTaskBody) Fault() *soap.Fault { return b.Fault_ } - -func RunScheduledTask(ctx context.Context, r soap.RoundTripper, req *types.RunScheduledTask) (*types.RunScheduledTaskResponse, error) { - var reqBody, resBody RunScheduledTaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type ScanHostPatchV2_TaskBody struct { - Req *types.ScanHostPatchV2_Task `xml:"urn:vim25 ScanHostPatchV2_Task,omitempty"` - Res *types.ScanHostPatchV2_TaskResponse `xml:"urn:vim25 ScanHostPatchV2_TaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *ScanHostPatchV2_TaskBody) Fault() *soap.Fault { return b.Fault_ } - -func ScanHostPatchV2_Task(ctx context.Context, r soap.RoundTripper, req *types.ScanHostPatchV2_Task) (*types.ScanHostPatchV2_TaskResponse, error) { - var reqBody, resBody ScanHostPatchV2_TaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type ScanHostPatch_TaskBody struct { - Req *types.ScanHostPatch_Task `xml:"urn:vim25 ScanHostPatch_Task,omitempty"` - Res *types.ScanHostPatch_TaskResponse `xml:"urn:vim25 ScanHostPatch_TaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *ScanHostPatch_TaskBody) Fault() *soap.Fault { return b.Fault_ } - -func ScanHostPatch_Task(ctx context.Context, r soap.RoundTripper, req *types.ScanHostPatch_Task) (*types.ScanHostPatch_TaskResponse, error) { - var reqBody, resBody ScanHostPatch_TaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type SearchDatastoreSubFolders_TaskBody struct { - Req *types.SearchDatastoreSubFolders_Task `xml:"urn:vim25 SearchDatastoreSubFolders_Task,omitempty"` - Res *types.SearchDatastoreSubFolders_TaskResponse `xml:"urn:vim25 SearchDatastoreSubFolders_TaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *SearchDatastoreSubFolders_TaskBody) Fault() *soap.Fault { return b.Fault_ } - -func SearchDatastoreSubFolders_Task(ctx context.Context, r soap.RoundTripper, req *types.SearchDatastoreSubFolders_Task) (*types.SearchDatastoreSubFolders_TaskResponse, error) { - var reqBody, resBody SearchDatastoreSubFolders_TaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type SearchDatastore_TaskBody struct { - Req *types.SearchDatastore_Task `xml:"urn:vim25 SearchDatastore_Task,omitempty"` - Res *types.SearchDatastore_TaskResponse `xml:"urn:vim25 SearchDatastore_TaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *SearchDatastore_TaskBody) Fault() *soap.Fault { return b.Fault_ } - -func SearchDatastore_Task(ctx context.Context, r soap.RoundTripper, req *types.SearchDatastore_Task) (*types.SearchDatastore_TaskResponse, error) { - var reqBody, resBody SearchDatastore_TaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type SelectActivePartitionBody struct { - Req *types.SelectActivePartition `xml:"urn:vim25 SelectActivePartition,omitempty"` - Res *types.SelectActivePartitionResponse `xml:"urn:vim25 SelectActivePartitionResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *SelectActivePartitionBody) Fault() *soap.Fault { return b.Fault_ } - -func SelectActivePartition(ctx context.Context, r soap.RoundTripper, req *types.SelectActivePartition) (*types.SelectActivePartitionResponse, error) { - var reqBody, resBody SelectActivePartitionBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type SelectVnicBody struct { - Req *types.SelectVnic `xml:"urn:vim25 SelectVnic,omitempty"` - Res *types.SelectVnicResponse `xml:"urn:vim25 SelectVnicResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *SelectVnicBody) Fault() *soap.Fault { return b.Fault_ } - -func SelectVnic(ctx context.Context, r soap.RoundTripper, req *types.SelectVnic) (*types.SelectVnicResponse, error) { - var reqBody, resBody SelectVnicBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type SelectVnicForNicTypeBody struct { - Req *types.SelectVnicForNicType `xml:"urn:vim25 SelectVnicForNicType,omitempty"` - Res *types.SelectVnicForNicTypeResponse `xml:"urn:vim25 SelectVnicForNicTypeResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *SelectVnicForNicTypeBody) Fault() *soap.Fault { return b.Fault_ } - -func SelectVnicForNicType(ctx context.Context, r soap.RoundTripper, req *types.SelectVnicForNicType) (*types.SelectVnicForNicTypeResponse, error) { - var reqBody, resBody SelectVnicForNicTypeBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type SendTestNotificationBody struct { - Req *types.SendTestNotification `xml:"urn:vim25 SendTestNotification,omitempty"` - Res *types.SendTestNotificationResponse `xml:"urn:vim25 SendTestNotificationResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *SendTestNotificationBody) Fault() *soap.Fault { return b.Fault_ } - -func SendTestNotification(ctx context.Context, r soap.RoundTripper, req *types.SendTestNotification) (*types.SendTestNotificationResponse, error) { - var reqBody, resBody SendTestNotificationBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type SessionIsActiveBody struct { - Req *types.SessionIsActive `xml:"urn:vim25 SessionIsActive,omitempty"` - Res *types.SessionIsActiveResponse `xml:"urn:vim25 SessionIsActiveResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *SessionIsActiveBody) Fault() *soap.Fault { return b.Fault_ } - -func SessionIsActive(ctx context.Context, r soap.RoundTripper, req *types.SessionIsActive) (*types.SessionIsActiveResponse, error) { - var reqBody, resBody SessionIsActiveBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type SetCollectorPageSizeBody struct { - Req *types.SetCollectorPageSize `xml:"urn:vim25 SetCollectorPageSize,omitempty"` - Res *types.SetCollectorPageSizeResponse `xml:"urn:vim25 SetCollectorPageSizeResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *SetCollectorPageSizeBody) Fault() *soap.Fault { return b.Fault_ } - -func SetCollectorPageSize(ctx context.Context, r soap.RoundTripper, req *types.SetCollectorPageSize) (*types.SetCollectorPageSizeResponse, error) { - var reqBody, resBody SetCollectorPageSizeBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type SetDisplayTopologyBody struct { - Req *types.SetDisplayTopology `xml:"urn:vim25 SetDisplayTopology,omitempty"` - Res *types.SetDisplayTopologyResponse `xml:"urn:vim25 SetDisplayTopologyResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *SetDisplayTopologyBody) Fault() *soap.Fault { return b.Fault_ } - -func SetDisplayTopology(ctx context.Context, r soap.RoundTripper, req *types.SetDisplayTopology) (*types.SetDisplayTopologyResponse, error) { - var reqBody, resBody SetDisplayTopologyBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type SetEntityPermissionsBody struct { - Req *types.SetEntityPermissions `xml:"urn:vim25 SetEntityPermissions,omitempty"` - Res *types.SetEntityPermissionsResponse `xml:"urn:vim25 SetEntityPermissionsResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *SetEntityPermissionsBody) Fault() *soap.Fault { return b.Fault_ } - -func SetEntityPermissions(ctx context.Context, r soap.RoundTripper, req *types.SetEntityPermissions) (*types.SetEntityPermissionsResponse, error) { - var reqBody, resBody SetEntityPermissionsBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type SetExtensionCertificateBody struct { - Req *types.SetExtensionCertificate `xml:"urn:vim25 SetExtensionCertificate,omitempty"` - Res *types.SetExtensionCertificateResponse `xml:"urn:vim25 SetExtensionCertificateResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *SetExtensionCertificateBody) Fault() *soap.Fault { return b.Fault_ } - -func SetExtensionCertificate(ctx context.Context, r soap.RoundTripper, req *types.SetExtensionCertificate) (*types.SetExtensionCertificateResponse, error) { - var reqBody, resBody SetExtensionCertificateBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type SetFieldBody struct { - Req *types.SetField `xml:"urn:vim25 SetField,omitempty"` - Res *types.SetFieldResponse `xml:"urn:vim25 SetFieldResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *SetFieldBody) Fault() *soap.Fault { return b.Fault_ } - -func SetField(ctx context.Context, r soap.RoundTripper, req *types.SetField) (*types.SetFieldResponse, error) { - var reqBody, resBody SetFieldBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type SetLicenseEditionBody struct { - Req *types.SetLicenseEdition `xml:"urn:vim25 SetLicenseEdition,omitempty"` - Res *types.SetLicenseEditionResponse `xml:"urn:vim25 SetLicenseEditionResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *SetLicenseEditionBody) Fault() *soap.Fault { return b.Fault_ } - -func SetLicenseEdition(ctx context.Context, r soap.RoundTripper, req *types.SetLicenseEdition) (*types.SetLicenseEditionResponse, error) { - var reqBody, resBody SetLicenseEditionBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type SetLocaleBody struct { - Req *types.SetLocale `xml:"urn:vim25 SetLocale,omitempty"` - Res *types.SetLocaleResponse `xml:"urn:vim25 SetLocaleResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *SetLocaleBody) Fault() *soap.Fault { return b.Fault_ } - -func SetLocale(ctx context.Context, r soap.RoundTripper, req *types.SetLocale) (*types.SetLocaleResponse, error) { - var reqBody, resBody SetLocaleBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type SetMultipathLunPolicyBody struct { - Req *types.SetMultipathLunPolicy `xml:"urn:vim25 SetMultipathLunPolicy,omitempty"` - Res *types.SetMultipathLunPolicyResponse `xml:"urn:vim25 SetMultipathLunPolicyResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *SetMultipathLunPolicyBody) Fault() *soap.Fault { return b.Fault_ } - -func SetMultipathLunPolicy(ctx context.Context, r soap.RoundTripper, req *types.SetMultipathLunPolicy) (*types.SetMultipathLunPolicyResponse, error) { - var reqBody, resBody SetMultipathLunPolicyBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type SetPublicKeyBody struct { - Req *types.SetPublicKey `xml:"urn:vim25 SetPublicKey,omitempty"` - Res *types.SetPublicKeyResponse `xml:"urn:vim25 SetPublicKeyResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *SetPublicKeyBody) Fault() *soap.Fault { return b.Fault_ } - -func SetPublicKey(ctx context.Context, r soap.RoundTripper, req *types.SetPublicKey) (*types.SetPublicKeyResponse, error) { - var reqBody, resBody SetPublicKeyBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type SetScreenResolutionBody struct { - Req *types.SetScreenResolution `xml:"urn:vim25 SetScreenResolution,omitempty"` - Res *types.SetScreenResolutionResponse `xml:"urn:vim25 SetScreenResolutionResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *SetScreenResolutionBody) Fault() *soap.Fault { return b.Fault_ } - -func SetScreenResolution(ctx context.Context, r soap.RoundTripper, req *types.SetScreenResolution) (*types.SetScreenResolutionResponse, error) { - var reqBody, resBody SetScreenResolutionBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type SetTaskDescriptionBody struct { - Req *types.SetTaskDescription `xml:"urn:vim25 SetTaskDescription,omitempty"` - Res *types.SetTaskDescriptionResponse `xml:"urn:vim25 SetTaskDescriptionResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *SetTaskDescriptionBody) Fault() *soap.Fault { return b.Fault_ } - -func SetTaskDescription(ctx context.Context, r soap.RoundTripper, req *types.SetTaskDescription) (*types.SetTaskDescriptionResponse, error) { - var reqBody, resBody SetTaskDescriptionBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type SetTaskStateBody struct { - Req *types.SetTaskState `xml:"urn:vim25 SetTaskState,omitempty"` - Res *types.SetTaskStateResponse `xml:"urn:vim25 SetTaskStateResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *SetTaskStateBody) Fault() *soap.Fault { return b.Fault_ } - -func SetTaskState(ctx context.Context, r soap.RoundTripper, req *types.SetTaskState) (*types.SetTaskStateResponse, error) { - var reqBody, resBody SetTaskStateBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type SetVirtualDiskUuidBody struct { - Req *types.SetVirtualDiskUuid `xml:"urn:vim25 SetVirtualDiskUuid,omitempty"` - Res *types.SetVirtualDiskUuidResponse `xml:"urn:vim25 SetVirtualDiskUuidResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *SetVirtualDiskUuidBody) Fault() *soap.Fault { return b.Fault_ } - -func SetVirtualDiskUuid(ctx context.Context, r soap.RoundTripper, req *types.SetVirtualDiskUuid) (*types.SetVirtualDiskUuidResponse, error) { - var reqBody, resBody SetVirtualDiskUuidBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type ShrinkVirtualDisk_TaskBody struct { - Req *types.ShrinkVirtualDisk_Task `xml:"urn:vim25 ShrinkVirtualDisk_Task,omitempty"` - Res *types.ShrinkVirtualDisk_TaskResponse `xml:"urn:vim25 ShrinkVirtualDisk_TaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *ShrinkVirtualDisk_TaskBody) Fault() *soap.Fault { return b.Fault_ } - -func ShrinkVirtualDisk_Task(ctx context.Context, r soap.RoundTripper, req *types.ShrinkVirtualDisk_Task) (*types.ShrinkVirtualDisk_TaskResponse, error) { - var reqBody, resBody ShrinkVirtualDisk_TaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type ShutdownGuestBody struct { - Req *types.ShutdownGuest `xml:"urn:vim25 ShutdownGuest,omitempty"` - Res *types.ShutdownGuestResponse `xml:"urn:vim25 ShutdownGuestResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *ShutdownGuestBody) Fault() *soap.Fault { return b.Fault_ } - -func ShutdownGuest(ctx context.Context, r soap.RoundTripper, req *types.ShutdownGuest) (*types.ShutdownGuestResponse, error) { - var reqBody, resBody ShutdownGuestBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type ShutdownHost_TaskBody struct { - Req *types.ShutdownHost_Task `xml:"urn:vim25 ShutdownHost_Task,omitempty"` - Res *types.ShutdownHost_TaskResponse `xml:"urn:vim25 ShutdownHost_TaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *ShutdownHost_TaskBody) Fault() *soap.Fault { return b.Fault_ } - -func ShutdownHost_Task(ctx context.Context, r soap.RoundTripper, req *types.ShutdownHost_Task) (*types.ShutdownHost_TaskResponse, error) { - var reqBody, resBody ShutdownHost_TaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type StageHostPatch_TaskBody struct { - Req *types.StageHostPatch_Task `xml:"urn:vim25 StageHostPatch_Task,omitempty"` - Res *types.StageHostPatch_TaskResponse `xml:"urn:vim25 StageHostPatch_TaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *StageHostPatch_TaskBody) Fault() *soap.Fault { return b.Fault_ } - -func StageHostPatch_Task(ctx context.Context, r soap.RoundTripper, req *types.StageHostPatch_Task) (*types.StageHostPatch_TaskResponse, error) { - var reqBody, resBody StageHostPatch_TaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type StandbyGuestBody struct { - Req *types.StandbyGuest `xml:"urn:vim25 StandbyGuest,omitempty"` - Res *types.StandbyGuestResponse `xml:"urn:vim25 StandbyGuestResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *StandbyGuestBody) Fault() *soap.Fault { return b.Fault_ } - -func StandbyGuest(ctx context.Context, r soap.RoundTripper, req *types.StandbyGuest) (*types.StandbyGuestResponse, error) { - var reqBody, resBody StandbyGuestBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type StartProgramInGuestBody struct { - Req *types.StartProgramInGuest `xml:"urn:vim25 StartProgramInGuest,omitempty"` - Res *types.StartProgramInGuestResponse `xml:"urn:vim25 StartProgramInGuestResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *StartProgramInGuestBody) Fault() *soap.Fault { return b.Fault_ } - -func StartProgramInGuest(ctx context.Context, r soap.RoundTripper, req *types.StartProgramInGuest) (*types.StartProgramInGuestResponse, error) { - var reqBody, resBody StartProgramInGuestBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type StartRecording_TaskBody struct { - Req *types.StartRecording_Task `xml:"urn:vim25 StartRecording_Task,omitempty"` - Res *types.StartRecording_TaskResponse `xml:"urn:vim25 StartRecording_TaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *StartRecording_TaskBody) Fault() *soap.Fault { return b.Fault_ } - -func StartRecording_Task(ctx context.Context, r soap.RoundTripper, req *types.StartRecording_Task) (*types.StartRecording_TaskResponse, error) { - var reqBody, resBody StartRecording_TaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type StartReplaying_TaskBody struct { - Req *types.StartReplaying_Task `xml:"urn:vim25 StartReplaying_Task,omitempty"` - Res *types.StartReplaying_TaskResponse `xml:"urn:vim25 StartReplaying_TaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *StartReplaying_TaskBody) Fault() *soap.Fault { return b.Fault_ } - -func StartReplaying_Task(ctx context.Context, r soap.RoundTripper, req *types.StartReplaying_Task) (*types.StartReplaying_TaskResponse, error) { - var reqBody, resBody StartReplaying_TaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type StartServiceBody struct { - Req *types.StartService `xml:"urn:vim25 StartService,omitempty"` - Res *types.StartServiceResponse `xml:"urn:vim25 StartServiceResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *StartServiceBody) Fault() *soap.Fault { return b.Fault_ } - -func StartService(ctx context.Context, r soap.RoundTripper, req *types.StartService) (*types.StartServiceResponse, error) { - var reqBody, resBody StartServiceBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type StopRecording_TaskBody struct { - Req *types.StopRecording_Task `xml:"urn:vim25 StopRecording_Task,omitempty"` - Res *types.StopRecording_TaskResponse `xml:"urn:vim25 StopRecording_TaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *StopRecording_TaskBody) Fault() *soap.Fault { return b.Fault_ } - -func StopRecording_Task(ctx context.Context, r soap.RoundTripper, req *types.StopRecording_Task) (*types.StopRecording_TaskResponse, error) { - var reqBody, resBody StopRecording_TaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type StopReplaying_TaskBody struct { - Req *types.StopReplaying_Task `xml:"urn:vim25 StopReplaying_Task,omitempty"` - Res *types.StopReplaying_TaskResponse `xml:"urn:vim25 StopReplaying_TaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *StopReplaying_TaskBody) Fault() *soap.Fault { return b.Fault_ } - -func StopReplaying_Task(ctx context.Context, r soap.RoundTripper, req *types.StopReplaying_Task) (*types.StopReplaying_TaskResponse, error) { - var reqBody, resBody StopReplaying_TaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type StopServiceBody struct { - Req *types.StopService `xml:"urn:vim25 StopService,omitempty"` - Res *types.StopServiceResponse `xml:"urn:vim25 StopServiceResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *StopServiceBody) Fault() *soap.Fault { return b.Fault_ } - -func StopService(ctx context.Context, r soap.RoundTripper, req *types.StopService) (*types.StopServiceResponse, error) { - var reqBody, resBody StopServiceBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type SuspendVApp_TaskBody struct { - Req *types.SuspendVApp_Task `xml:"urn:vim25 SuspendVApp_Task,omitempty"` - Res *types.SuspendVApp_TaskResponse `xml:"urn:vim25 SuspendVApp_TaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *SuspendVApp_TaskBody) Fault() *soap.Fault { return b.Fault_ } - -func SuspendVApp_Task(ctx context.Context, r soap.RoundTripper, req *types.SuspendVApp_Task) (*types.SuspendVApp_TaskResponse, error) { - var reqBody, resBody SuspendVApp_TaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type SuspendVM_TaskBody struct { - Req *types.SuspendVM_Task `xml:"urn:vim25 SuspendVM_Task,omitempty"` - Res *types.SuspendVM_TaskResponse `xml:"urn:vim25 SuspendVM_TaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *SuspendVM_TaskBody) Fault() *soap.Fault { return b.Fault_ } - -func SuspendVM_Task(ctx context.Context, r soap.RoundTripper, req *types.SuspendVM_Task) (*types.SuspendVM_TaskResponse, error) { - var reqBody, resBody SuspendVM_TaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type TerminateFaultTolerantVM_TaskBody struct { - Req *types.TerminateFaultTolerantVM_Task `xml:"urn:vim25 TerminateFaultTolerantVM_Task,omitempty"` - Res *types.TerminateFaultTolerantVM_TaskResponse `xml:"urn:vim25 TerminateFaultTolerantVM_TaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *TerminateFaultTolerantVM_TaskBody) Fault() *soap.Fault { return b.Fault_ } - -func TerminateFaultTolerantVM_Task(ctx context.Context, r soap.RoundTripper, req *types.TerminateFaultTolerantVM_Task) (*types.TerminateFaultTolerantVM_TaskResponse, error) { - var reqBody, resBody TerminateFaultTolerantVM_TaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type TerminateProcessInGuestBody struct { - Req *types.TerminateProcessInGuest `xml:"urn:vim25 TerminateProcessInGuest,omitempty"` - Res *types.TerminateProcessInGuestResponse `xml:"urn:vim25 TerminateProcessInGuestResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *TerminateProcessInGuestBody) Fault() *soap.Fault { return b.Fault_ } - -func TerminateProcessInGuest(ctx context.Context, r soap.RoundTripper, req *types.TerminateProcessInGuest) (*types.TerminateProcessInGuestResponse, error) { - var reqBody, resBody TerminateProcessInGuestBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type TerminateSessionBody struct { - Req *types.TerminateSession `xml:"urn:vim25 TerminateSession,omitempty"` - Res *types.TerminateSessionResponse `xml:"urn:vim25 TerminateSessionResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *TerminateSessionBody) Fault() *soap.Fault { return b.Fault_ } - -func TerminateSession(ctx context.Context, r soap.RoundTripper, req *types.TerminateSession) (*types.TerminateSessionResponse, error) { - var reqBody, resBody TerminateSessionBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type TerminateVMBody struct { - Req *types.TerminateVM `xml:"urn:vim25 TerminateVM,omitempty"` - Res *types.TerminateVMResponse `xml:"urn:vim25 TerminateVMResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *TerminateVMBody) Fault() *soap.Fault { return b.Fault_ } - -func TerminateVM(ctx context.Context, r soap.RoundTripper, req *types.TerminateVM) (*types.TerminateVMResponse, error) { - var reqBody, resBody TerminateVMBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type TurnOffFaultToleranceForVM_TaskBody struct { - Req *types.TurnOffFaultToleranceForVM_Task `xml:"urn:vim25 TurnOffFaultToleranceForVM_Task,omitempty"` - Res *types.TurnOffFaultToleranceForVM_TaskResponse `xml:"urn:vim25 TurnOffFaultToleranceForVM_TaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *TurnOffFaultToleranceForVM_TaskBody) Fault() *soap.Fault { return b.Fault_ } - -func TurnOffFaultToleranceForVM_Task(ctx context.Context, r soap.RoundTripper, req *types.TurnOffFaultToleranceForVM_Task) (*types.TurnOffFaultToleranceForVM_TaskResponse, error) { - var reqBody, resBody TurnOffFaultToleranceForVM_TaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type UnassignUserFromGroupBody struct { - Req *types.UnassignUserFromGroup `xml:"urn:vim25 UnassignUserFromGroup,omitempty"` - Res *types.UnassignUserFromGroupResponse `xml:"urn:vim25 UnassignUserFromGroupResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *UnassignUserFromGroupBody) Fault() *soap.Fault { return b.Fault_ } - -func UnassignUserFromGroup(ctx context.Context, r soap.RoundTripper, req *types.UnassignUserFromGroup) (*types.UnassignUserFromGroupResponse, error) { - var reqBody, resBody UnassignUserFromGroupBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type UnbindVnicBody struct { - Req *types.UnbindVnic `xml:"urn:vim25 UnbindVnic,omitempty"` - Res *types.UnbindVnicResponse `xml:"urn:vim25 UnbindVnicResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *UnbindVnicBody) Fault() *soap.Fault { return b.Fault_ } - -func UnbindVnic(ctx context.Context, r soap.RoundTripper, req *types.UnbindVnic) (*types.UnbindVnicResponse, error) { - var reqBody, resBody UnbindVnicBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type UninstallHostPatch_TaskBody struct { - Req *types.UninstallHostPatch_Task `xml:"urn:vim25 UninstallHostPatch_Task,omitempty"` - Res *types.UninstallHostPatch_TaskResponse `xml:"urn:vim25 UninstallHostPatch_TaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *UninstallHostPatch_TaskBody) Fault() *soap.Fault { return b.Fault_ } - -func UninstallHostPatch_Task(ctx context.Context, r soap.RoundTripper, req *types.UninstallHostPatch_Task) (*types.UninstallHostPatch_TaskResponse, error) { - var reqBody, resBody UninstallHostPatch_TaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type UninstallServiceBody struct { - Req *types.UninstallService `xml:"urn:vim25 UninstallService,omitempty"` - Res *types.UninstallServiceResponse `xml:"urn:vim25 UninstallServiceResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *UninstallServiceBody) Fault() *soap.Fault { return b.Fault_ } - -func UninstallService(ctx context.Context, r soap.RoundTripper, req *types.UninstallService) (*types.UninstallServiceResponse, error) { - var reqBody, resBody UninstallServiceBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type UnmountForceMountedVmfsVolumeBody struct { - Req *types.UnmountForceMountedVmfsVolume `xml:"urn:vim25 UnmountForceMountedVmfsVolume,omitempty"` - Res *types.UnmountForceMountedVmfsVolumeResponse `xml:"urn:vim25 UnmountForceMountedVmfsVolumeResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *UnmountForceMountedVmfsVolumeBody) Fault() *soap.Fault { return b.Fault_ } - -func UnmountForceMountedVmfsVolume(ctx context.Context, r soap.RoundTripper, req *types.UnmountForceMountedVmfsVolume) (*types.UnmountForceMountedVmfsVolumeResponse, error) { - var reqBody, resBody UnmountForceMountedVmfsVolumeBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type UnmountToolsInstallerBody struct { - Req *types.UnmountToolsInstaller `xml:"urn:vim25 UnmountToolsInstaller,omitempty"` - Res *types.UnmountToolsInstallerResponse `xml:"urn:vim25 UnmountToolsInstallerResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *UnmountToolsInstallerBody) Fault() *soap.Fault { return b.Fault_ } - -func UnmountToolsInstaller(ctx context.Context, r soap.RoundTripper, req *types.UnmountToolsInstaller) (*types.UnmountToolsInstallerResponse, error) { - var reqBody, resBody UnmountToolsInstallerBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type UnmountVffsVolumeBody struct { - Req *types.UnmountVffsVolume `xml:"urn:vim25 UnmountVffsVolume,omitempty"` - Res *types.UnmountVffsVolumeResponse `xml:"urn:vim25 UnmountVffsVolumeResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *UnmountVffsVolumeBody) Fault() *soap.Fault { return b.Fault_ } - -func UnmountVffsVolume(ctx context.Context, r soap.RoundTripper, req *types.UnmountVffsVolume) (*types.UnmountVffsVolumeResponse, error) { - var reqBody, resBody UnmountVffsVolumeBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type UnmountVmfsVolumeBody struct { - Req *types.UnmountVmfsVolume `xml:"urn:vim25 UnmountVmfsVolume,omitempty"` - Res *types.UnmountVmfsVolumeResponse `xml:"urn:vim25 UnmountVmfsVolumeResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *UnmountVmfsVolumeBody) Fault() *soap.Fault { return b.Fault_ } - -func UnmountVmfsVolume(ctx context.Context, r soap.RoundTripper, req *types.UnmountVmfsVolume) (*types.UnmountVmfsVolumeResponse, error) { - var reqBody, resBody UnmountVmfsVolumeBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type UnregisterAndDestroy_TaskBody struct { - Req *types.UnregisterAndDestroy_Task `xml:"urn:vim25 UnregisterAndDestroy_Task,omitempty"` - Res *types.UnregisterAndDestroy_TaskResponse `xml:"urn:vim25 UnregisterAndDestroy_TaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *UnregisterAndDestroy_TaskBody) Fault() *soap.Fault { return b.Fault_ } - -func UnregisterAndDestroy_Task(ctx context.Context, r soap.RoundTripper, req *types.UnregisterAndDestroy_Task) (*types.UnregisterAndDestroy_TaskResponse, error) { - var reqBody, resBody UnregisterAndDestroy_TaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type UnregisterExtensionBody struct { - Req *types.UnregisterExtension `xml:"urn:vim25 UnregisterExtension,omitempty"` - Res *types.UnregisterExtensionResponse `xml:"urn:vim25 UnregisterExtensionResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *UnregisterExtensionBody) Fault() *soap.Fault { return b.Fault_ } - -func UnregisterExtension(ctx context.Context, r soap.RoundTripper, req *types.UnregisterExtension) (*types.UnregisterExtensionResponse, error) { - var reqBody, resBody UnregisterExtensionBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type UnregisterVMBody struct { - Req *types.UnregisterVM `xml:"urn:vim25 UnregisterVM,omitempty"` - Res *types.UnregisterVMResponse `xml:"urn:vim25 UnregisterVMResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *UnregisterVMBody) Fault() *soap.Fault { return b.Fault_ } - -func UnregisterVM(ctx context.Context, r soap.RoundTripper, req *types.UnregisterVM) (*types.UnregisterVMResponse, error) { - var reqBody, resBody UnregisterVMBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type UpdateAnswerFile_TaskBody struct { - Req *types.UpdateAnswerFile_Task `xml:"urn:vim25 UpdateAnswerFile_Task,omitempty"` - Res *types.UpdateAnswerFile_TaskResponse `xml:"urn:vim25 UpdateAnswerFile_TaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *UpdateAnswerFile_TaskBody) Fault() *soap.Fault { return b.Fault_ } - -func UpdateAnswerFile_Task(ctx context.Context, r soap.RoundTripper, req *types.UpdateAnswerFile_Task) (*types.UpdateAnswerFile_TaskResponse, error) { - var reqBody, resBody UpdateAnswerFile_TaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type UpdateAssignedLicenseBody struct { - Req *types.UpdateAssignedLicense `xml:"urn:vim25 UpdateAssignedLicense,omitempty"` - Res *types.UpdateAssignedLicenseResponse `xml:"urn:vim25 UpdateAssignedLicenseResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *UpdateAssignedLicenseBody) Fault() *soap.Fault { return b.Fault_ } - -func UpdateAssignedLicense(ctx context.Context, r soap.RoundTripper, req *types.UpdateAssignedLicense) (*types.UpdateAssignedLicenseResponse, error) { - var reqBody, resBody UpdateAssignedLicenseBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type UpdateAuthorizationRoleBody struct { - Req *types.UpdateAuthorizationRole `xml:"urn:vim25 UpdateAuthorizationRole,omitempty"` - Res *types.UpdateAuthorizationRoleResponse `xml:"urn:vim25 UpdateAuthorizationRoleResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *UpdateAuthorizationRoleBody) Fault() *soap.Fault { return b.Fault_ } - -func UpdateAuthorizationRole(ctx context.Context, r soap.RoundTripper, req *types.UpdateAuthorizationRole) (*types.UpdateAuthorizationRoleResponse, error) { - var reqBody, resBody UpdateAuthorizationRoleBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type UpdateBootDeviceBody struct { - Req *types.UpdateBootDevice `xml:"urn:vim25 UpdateBootDevice,omitempty"` - Res *types.UpdateBootDeviceResponse `xml:"urn:vim25 UpdateBootDeviceResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *UpdateBootDeviceBody) Fault() *soap.Fault { return b.Fault_ } - -func UpdateBootDevice(ctx context.Context, r soap.RoundTripper, req *types.UpdateBootDevice) (*types.UpdateBootDeviceResponse, error) { - var reqBody, resBody UpdateBootDeviceBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type UpdateChildResourceConfigurationBody struct { - Req *types.UpdateChildResourceConfiguration `xml:"urn:vim25 UpdateChildResourceConfiguration,omitempty"` - Res *types.UpdateChildResourceConfigurationResponse `xml:"urn:vim25 UpdateChildResourceConfigurationResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *UpdateChildResourceConfigurationBody) Fault() *soap.Fault { return b.Fault_ } - -func UpdateChildResourceConfiguration(ctx context.Context, r soap.RoundTripper, req *types.UpdateChildResourceConfiguration) (*types.UpdateChildResourceConfigurationResponse, error) { - var reqBody, resBody UpdateChildResourceConfigurationBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type UpdateClusterProfileBody struct { - Req *types.UpdateClusterProfile `xml:"urn:vim25 UpdateClusterProfile,omitempty"` - Res *types.UpdateClusterProfileResponse `xml:"urn:vim25 UpdateClusterProfileResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *UpdateClusterProfileBody) Fault() *soap.Fault { return b.Fault_ } - -func UpdateClusterProfile(ctx context.Context, r soap.RoundTripper, req *types.UpdateClusterProfile) (*types.UpdateClusterProfileResponse, error) { - var reqBody, resBody UpdateClusterProfileBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type UpdateConfigBody struct { - Req *types.UpdateConfig `xml:"urn:vim25 UpdateConfig,omitempty"` - Res *types.UpdateConfigResponse `xml:"urn:vim25 UpdateConfigResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *UpdateConfigBody) Fault() *soap.Fault { return b.Fault_ } - -func UpdateConfig(ctx context.Context, r soap.RoundTripper, req *types.UpdateConfig) (*types.UpdateConfigResponse, error) { - var reqBody, resBody UpdateConfigBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type UpdateConsoleIpRouteConfigBody struct { - Req *types.UpdateConsoleIpRouteConfig `xml:"urn:vim25 UpdateConsoleIpRouteConfig,omitempty"` - Res *types.UpdateConsoleIpRouteConfigResponse `xml:"urn:vim25 UpdateConsoleIpRouteConfigResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *UpdateConsoleIpRouteConfigBody) Fault() *soap.Fault { return b.Fault_ } - -func UpdateConsoleIpRouteConfig(ctx context.Context, r soap.RoundTripper, req *types.UpdateConsoleIpRouteConfig) (*types.UpdateConsoleIpRouteConfigResponse, error) { - var reqBody, resBody UpdateConsoleIpRouteConfigBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type UpdateCounterLevelMappingBody struct { - Req *types.UpdateCounterLevelMapping `xml:"urn:vim25 UpdateCounterLevelMapping,omitempty"` - Res *types.UpdateCounterLevelMappingResponse `xml:"urn:vim25 UpdateCounterLevelMappingResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *UpdateCounterLevelMappingBody) Fault() *soap.Fault { return b.Fault_ } - -func UpdateCounterLevelMapping(ctx context.Context, r soap.RoundTripper, req *types.UpdateCounterLevelMapping) (*types.UpdateCounterLevelMappingResponse, error) { - var reqBody, resBody UpdateCounterLevelMappingBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type UpdateDVSHealthCheckConfig_TaskBody struct { - Req *types.UpdateDVSHealthCheckConfig_Task `xml:"urn:vim25 UpdateDVSHealthCheckConfig_Task,omitempty"` - Res *types.UpdateDVSHealthCheckConfig_TaskResponse `xml:"urn:vim25 UpdateDVSHealthCheckConfig_TaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *UpdateDVSHealthCheckConfig_TaskBody) Fault() *soap.Fault { return b.Fault_ } - -func UpdateDVSHealthCheckConfig_Task(ctx context.Context, r soap.RoundTripper, req *types.UpdateDVSHealthCheckConfig_Task) (*types.UpdateDVSHealthCheckConfig_TaskResponse, error) { - var reqBody, resBody UpdateDVSHealthCheckConfig_TaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type UpdateDVSLacpGroupConfig_TaskBody struct { - Req *types.UpdateDVSLacpGroupConfig_Task `xml:"urn:vim25 UpdateDVSLacpGroupConfig_Task,omitempty"` - Res *types.UpdateDVSLacpGroupConfig_TaskResponse `xml:"urn:vim25 UpdateDVSLacpGroupConfig_TaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *UpdateDVSLacpGroupConfig_TaskBody) Fault() *soap.Fault { return b.Fault_ } - -func UpdateDVSLacpGroupConfig_Task(ctx context.Context, r soap.RoundTripper, req *types.UpdateDVSLacpGroupConfig_Task) (*types.UpdateDVSLacpGroupConfig_TaskResponse, error) { - var reqBody, resBody UpdateDVSLacpGroupConfig_TaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type UpdateDateTimeBody struct { - Req *types.UpdateDateTime `xml:"urn:vim25 UpdateDateTime,omitempty"` - Res *types.UpdateDateTimeResponse `xml:"urn:vim25 UpdateDateTimeResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *UpdateDateTimeBody) Fault() *soap.Fault { return b.Fault_ } - -func UpdateDateTime(ctx context.Context, r soap.RoundTripper, req *types.UpdateDateTime) (*types.UpdateDateTimeResponse, error) { - var reqBody, resBody UpdateDateTimeBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type UpdateDateTimeConfigBody struct { - Req *types.UpdateDateTimeConfig `xml:"urn:vim25 UpdateDateTimeConfig,omitempty"` - Res *types.UpdateDateTimeConfigResponse `xml:"urn:vim25 UpdateDateTimeConfigResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *UpdateDateTimeConfigBody) Fault() *soap.Fault { return b.Fault_ } - -func UpdateDateTimeConfig(ctx context.Context, r soap.RoundTripper, req *types.UpdateDateTimeConfig) (*types.UpdateDateTimeConfigResponse, error) { - var reqBody, resBody UpdateDateTimeConfigBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type UpdateDefaultPolicyBody struct { - Req *types.UpdateDefaultPolicy `xml:"urn:vim25 UpdateDefaultPolicy,omitempty"` - Res *types.UpdateDefaultPolicyResponse `xml:"urn:vim25 UpdateDefaultPolicyResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *UpdateDefaultPolicyBody) Fault() *soap.Fault { return b.Fault_ } - -func UpdateDefaultPolicy(ctx context.Context, r soap.RoundTripper, req *types.UpdateDefaultPolicy) (*types.UpdateDefaultPolicyResponse, error) { - var reqBody, resBody UpdateDefaultPolicyBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type UpdateDiskPartitionsBody struct { - Req *types.UpdateDiskPartitions `xml:"urn:vim25 UpdateDiskPartitions,omitempty"` - Res *types.UpdateDiskPartitionsResponse `xml:"urn:vim25 UpdateDiskPartitionsResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *UpdateDiskPartitionsBody) Fault() *soap.Fault { return b.Fault_ } - -func UpdateDiskPartitions(ctx context.Context, r soap.RoundTripper, req *types.UpdateDiskPartitions) (*types.UpdateDiskPartitionsResponse, error) { - var reqBody, resBody UpdateDiskPartitionsBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type UpdateDnsConfigBody struct { - Req *types.UpdateDnsConfig `xml:"urn:vim25 UpdateDnsConfig,omitempty"` - Res *types.UpdateDnsConfigResponse `xml:"urn:vim25 UpdateDnsConfigResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *UpdateDnsConfigBody) Fault() *soap.Fault { return b.Fault_ } - -func UpdateDnsConfig(ctx context.Context, r soap.RoundTripper, req *types.UpdateDnsConfig) (*types.UpdateDnsConfigResponse, error) { - var reqBody, resBody UpdateDnsConfigBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type UpdateDvsCapabilityBody struct { - Req *types.UpdateDvsCapability `xml:"urn:vim25 UpdateDvsCapability,omitempty"` - Res *types.UpdateDvsCapabilityResponse `xml:"urn:vim25 UpdateDvsCapabilityResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *UpdateDvsCapabilityBody) Fault() *soap.Fault { return b.Fault_ } - -func UpdateDvsCapability(ctx context.Context, r soap.RoundTripper, req *types.UpdateDvsCapability) (*types.UpdateDvsCapabilityResponse, error) { - var reqBody, resBody UpdateDvsCapabilityBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type UpdateExtensionBody struct { - Req *types.UpdateExtension `xml:"urn:vim25 UpdateExtension,omitempty"` - Res *types.UpdateExtensionResponse `xml:"urn:vim25 UpdateExtensionResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *UpdateExtensionBody) Fault() *soap.Fault { return b.Fault_ } - -func UpdateExtension(ctx context.Context, r soap.RoundTripper, req *types.UpdateExtension) (*types.UpdateExtensionResponse, error) { - var reqBody, resBody UpdateExtensionBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type UpdateFlagsBody struct { - Req *types.UpdateFlags `xml:"urn:vim25 UpdateFlags,omitempty"` - Res *types.UpdateFlagsResponse `xml:"urn:vim25 UpdateFlagsResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *UpdateFlagsBody) Fault() *soap.Fault { return b.Fault_ } - -func UpdateFlags(ctx context.Context, r soap.RoundTripper, req *types.UpdateFlags) (*types.UpdateFlagsResponse, error) { - var reqBody, resBody UpdateFlagsBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type UpdateHostImageAcceptanceLevelBody struct { - Req *types.UpdateHostImageAcceptanceLevel `xml:"urn:vim25 UpdateHostImageAcceptanceLevel,omitempty"` - Res *types.UpdateHostImageAcceptanceLevelResponse `xml:"urn:vim25 UpdateHostImageAcceptanceLevelResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *UpdateHostImageAcceptanceLevelBody) Fault() *soap.Fault { return b.Fault_ } - -func UpdateHostImageAcceptanceLevel(ctx context.Context, r soap.RoundTripper, req *types.UpdateHostImageAcceptanceLevel) (*types.UpdateHostImageAcceptanceLevelResponse, error) { - var reqBody, resBody UpdateHostImageAcceptanceLevelBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type UpdateHostProfileBody struct { - Req *types.UpdateHostProfile `xml:"urn:vim25 UpdateHostProfile,omitempty"` - Res *types.UpdateHostProfileResponse `xml:"urn:vim25 UpdateHostProfileResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *UpdateHostProfileBody) Fault() *soap.Fault { return b.Fault_ } - -func UpdateHostProfile(ctx context.Context, r soap.RoundTripper, req *types.UpdateHostProfile) (*types.UpdateHostProfileResponse, error) { - var reqBody, resBody UpdateHostProfileBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type UpdateInternetScsiAdvancedOptionsBody struct { - Req *types.UpdateInternetScsiAdvancedOptions `xml:"urn:vim25 UpdateInternetScsiAdvancedOptions,omitempty"` - Res *types.UpdateInternetScsiAdvancedOptionsResponse `xml:"urn:vim25 UpdateInternetScsiAdvancedOptionsResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *UpdateInternetScsiAdvancedOptionsBody) Fault() *soap.Fault { return b.Fault_ } - -func UpdateInternetScsiAdvancedOptions(ctx context.Context, r soap.RoundTripper, req *types.UpdateInternetScsiAdvancedOptions) (*types.UpdateInternetScsiAdvancedOptionsResponse, error) { - var reqBody, resBody UpdateInternetScsiAdvancedOptionsBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type UpdateInternetScsiAliasBody struct { - Req *types.UpdateInternetScsiAlias `xml:"urn:vim25 UpdateInternetScsiAlias,omitempty"` - Res *types.UpdateInternetScsiAliasResponse `xml:"urn:vim25 UpdateInternetScsiAliasResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *UpdateInternetScsiAliasBody) Fault() *soap.Fault { return b.Fault_ } - -func UpdateInternetScsiAlias(ctx context.Context, r soap.RoundTripper, req *types.UpdateInternetScsiAlias) (*types.UpdateInternetScsiAliasResponse, error) { - var reqBody, resBody UpdateInternetScsiAliasBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type UpdateInternetScsiAuthenticationPropertiesBody struct { - Req *types.UpdateInternetScsiAuthenticationProperties `xml:"urn:vim25 UpdateInternetScsiAuthenticationProperties,omitempty"` - Res *types.UpdateInternetScsiAuthenticationPropertiesResponse `xml:"urn:vim25 UpdateInternetScsiAuthenticationPropertiesResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *UpdateInternetScsiAuthenticationPropertiesBody) Fault() *soap.Fault { return b.Fault_ } - -func UpdateInternetScsiAuthenticationProperties(ctx context.Context, r soap.RoundTripper, req *types.UpdateInternetScsiAuthenticationProperties) (*types.UpdateInternetScsiAuthenticationPropertiesResponse, error) { - var reqBody, resBody UpdateInternetScsiAuthenticationPropertiesBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type UpdateInternetScsiDigestPropertiesBody struct { - Req *types.UpdateInternetScsiDigestProperties `xml:"urn:vim25 UpdateInternetScsiDigestProperties,omitempty"` - Res *types.UpdateInternetScsiDigestPropertiesResponse `xml:"urn:vim25 UpdateInternetScsiDigestPropertiesResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *UpdateInternetScsiDigestPropertiesBody) Fault() *soap.Fault { return b.Fault_ } - -func UpdateInternetScsiDigestProperties(ctx context.Context, r soap.RoundTripper, req *types.UpdateInternetScsiDigestProperties) (*types.UpdateInternetScsiDigestPropertiesResponse, error) { - var reqBody, resBody UpdateInternetScsiDigestPropertiesBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type UpdateInternetScsiDiscoveryPropertiesBody struct { - Req *types.UpdateInternetScsiDiscoveryProperties `xml:"urn:vim25 UpdateInternetScsiDiscoveryProperties,omitempty"` - Res *types.UpdateInternetScsiDiscoveryPropertiesResponse `xml:"urn:vim25 UpdateInternetScsiDiscoveryPropertiesResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *UpdateInternetScsiDiscoveryPropertiesBody) Fault() *soap.Fault { return b.Fault_ } - -func UpdateInternetScsiDiscoveryProperties(ctx context.Context, r soap.RoundTripper, req *types.UpdateInternetScsiDiscoveryProperties) (*types.UpdateInternetScsiDiscoveryPropertiesResponse, error) { - var reqBody, resBody UpdateInternetScsiDiscoveryPropertiesBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type UpdateInternetScsiIPPropertiesBody struct { - Req *types.UpdateInternetScsiIPProperties `xml:"urn:vim25 UpdateInternetScsiIPProperties,omitempty"` - Res *types.UpdateInternetScsiIPPropertiesResponse `xml:"urn:vim25 UpdateInternetScsiIPPropertiesResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *UpdateInternetScsiIPPropertiesBody) Fault() *soap.Fault { return b.Fault_ } - -func UpdateInternetScsiIPProperties(ctx context.Context, r soap.RoundTripper, req *types.UpdateInternetScsiIPProperties) (*types.UpdateInternetScsiIPPropertiesResponse, error) { - var reqBody, resBody UpdateInternetScsiIPPropertiesBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type UpdateInternetScsiNameBody struct { - Req *types.UpdateInternetScsiName `xml:"urn:vim25 UpdateInternetScsiName,omitempty"` - Res *types.UpdateInternetScsiNameResponse `xml:"urn:vim25 UpdateInternetScsiNameResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *UpdateInternetScsiNameBody) Fault() *soap.Fault { return b.Fault_ } - -func UpdateInternetScsiName(ctx context.Context, r soap.RoundTripper, req *types.UpdateInternetScsiName) (*types.UpdateInternetScsiNameResponse, error) { - var reqBody, resBody UpdateInternetScsiNameBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type UpdateIpConfigBody struct { - Req *types.UpdateIpConfig `xml:"urn:vim25 UpdateIpConfig,omitempty"` - Res *types.UpdateIpConfigResponse `xml:"urn:vim25 UpdateIpConfigResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *UpdateIpConfigBody) Fault() *soap.Fault { return b.Fault_ } - -func UpdateIpConfig(ctx context.Context, r soap.RoundTripper, req *types.UpdateIpConfig) (*types.UpdateIpConfigResponse, error) { - var reqBody, resBody UpdateIpConfigBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type UpdateIpPoolBody struct { - Req *types.UpdateIpPool `xml:"urn:vim25 UpdateIpPool,omitempty"` - Res *types.UpdateIpPoolResponse `xml:"urn:vim25 UpdateIpPoolResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *UpdateIpPoolBody) Fault() *soap.Fault { return b.Fault_ } - -func UpdateIpPool(ctx context.Context, r soap.RoundTripper, req *types.UpdateIpPool) (*types.UpdateIpPoolResponse, error) { - var reqBody, resBody UpdateIpPoolBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type UpdateIpRouteConfigBody struct { - Req *types.UpdateIpRouteConfig `xml:"urn:vim25 UpdateIpRouteConfig,omitempty"` - Res *types.UpdateIpRouteConfigResponse `xml:"urn:vim25 UpdateIpRouteConfigResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *UpdateIpRouteConfigBody) Fault() *soap.Fault { return b.Fault_ } - -func UpdateIpRouteConfig(ctx context.Context, r soap.RoundTripper, req *types.UpdateIpRouteConfig) (*types.UpdateIpRouteConfigResponse, error) { - var reqBody, resBody UpdateIpRouteConfigBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type UpdateIpRouteTableConfigBody struct { - Req *types.UpdateIpRouteTableConfig `xml:"urn:vim25 UpdateIpRouteTableConfig,omitempty"` - Res *types.UpdateIpRouteTableConfigResponse `xml:"urn:vim25 UpdateIpRouteTableConfigResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *UpdateIpRouteTableConfigBody) Fault() *soap.Fault { return b.Fault_ } - -func UpdateIpRouteTableConfig(ctx context.Context, r soap.RoundTripper, req *types.UpdateIpRouteTableConfig) (*types.UpdateIpRouteTableConfigResponse, error) { - var reqBody, resBody UpdateIpRouteTableConfigBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type UpdateIpmiBody struct { - Req *types.UpdateIpmi `xml:"urn:vim25 UpdateIpmi,omitempty"` - Res *types.UpdateIpmiResponse `xml:"urn:vim25 UpdateIpmiResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *UpdateIpmiBody) Fault() *soap.Fault { return b.Fault_ } - -func UpdateIpmi(ctx context.Context, r soap.RoundTripper, req *types.UpdateIpmi) (*types.UpdateIpmiResponse, error) { - var reqBody, resBody UpdateIpmiBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type UpdateLicenseBody struct { - Req *types.UpdateLicense `xml:"urn:vim25 UpdateLicense,omitempty"` - Res *types.UpdateLicenseResponse `xml:"urn:vim25 UpdateLicenseResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *UpdateLicenseBody) Fault() *soap.Fault { return b.Fault_ } - -func UpdateLicense(ctx context.Context, r soap.RoundTripper, req *types.UpdateLicense) (*types.UpdateLicenseResponse, error) { - var reqBody, resBody UpdateLicenseBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type UpdateLicenseLabelBody struct { - Req *types.UpdateLicenseLabel `xml:"urn:vim25 UpdateLicenseLabel,omitempty"` - Res *types.UpdateLicenseLabelResponse `xml:"urn:vim25 UpdateLicenseLabelResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *UpdateLicenseLabelBody) Fault() *soap.Fault { return b.Fault_ } - -func UpdateLicenseLabel(ctx context.Context, r soap.RoundTripper, req *types.UpdateLicenseLabel) (*types.UpdateLicenseLabelResponse, error) { - var reqBody, resBody UpdateLicenseLabelBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type UpdateLinkedChildrenBody struct { - Req *types.UpdateLinkedChildren `xml:"urn:vim25 UpdateLinkedChildren,omitempty"` - Res *types.UpdateLinkedChildrenResponse `xml:"urn:vim25 UpdateLinkedChildrenResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *UpdateLinkedChildrenBody) Fault() *soap.Fault { return b.Fault_ } - -func UpdateLinkedChildren(ctx context.Context, r soap.RoundTripper, req *types.UpdateLinkedChildren) (*types.UpdateLinkedChildrenResponse, error) { - var reqBody, resBody UpdateLinkedChildrenBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type UpdateLocalSwapDatastoreBody struct { - Req *types.UpdateLocalSwapDatastore `xml:"urn:vim25 UpdateLocalSwapDatastore,omitempty"` - Res *types.UpdateLocalSwapDatastoreResponse `xml:"urn:vim25 UpdateLocalSwapDatastoreResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *UpdateLocalSwapDatastoreBody) Fault() *soap.Fault { return b.Fault_ } - -func UpdateLocalSwapDatastore(ctx context.Context, r soap.RoundTripper, req *types.UpdateLocalSwapDatastore) (*types.UpdateLocalSwapDatastoreResponse, error) { - var reqBody, resBody UpdateLocalSwapDatastoreBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type UpdateModuleOptionStringBody struct { - Req *types.UpdateModuleOptionString `xml:"urn:vim25 UpdateModuleOptionString,omitempty"` - Res *types.UpdateModuleOptionStringResponse `xml:"urn:vim25 UpdateModuleOptionStringResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *UpdateModuleOptionStringBody) Fault() *soap.Fault { return b.Fault_ } - -func UpdateModuleOptionString(ctx context.Context, r soap.RoundTripper, req *types.UpdateModuleOptionString) (*types.UpdateModuleOptionStringResponse, error) { - var reqBody, resBody UpdateModuleOptionStringBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type UpdateNetworkConfigBody struct { - Req *types.UpdateNetworkConfig `xml:"urn:vim25 UpdateNetworkConfig,omitempty"` - Res *types.UpdateNetworkConfigResponse `xml:"urn:vim25 UpdateNetworkConfigResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *UpdateNetworkConfigBody) Fault() *soap.Fault { return b.Fault_ } - -func UpdateNetworkConfig(ctx context.Context, r soap.RoundTripper, req *types.UpdateNetworkConfig) (*types.UpdateNetworkConfigResponse, error) { - var reqBody, resBody UpdateNetworkConfigBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type UpdateNetworkResourcePoolBody struct { - Req *types.UpdateNetworkResourcePool `xml:"urn:vim25 UpdateNetworkResourcePool,omitempty"` - Res *types.UpdateNetworkResourcePoolResponse `xml:"urn:vim25 UpdateNetworkResourcePoolResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *UpdateNetworkResourcePoolBody) Fault() *soap.Fault { return b.Fault_ } - -func UpdateNetworkResourcePool(ctx context.Context, r soap.RoundTripper, req *types.UpdateNetworkResourcePool) (*types.UpdateNetworkResourcePoolResponse, error) { - var reqBody, resBody UpdateNetworkResourcePoolBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type UpdateOptionsBody struct { - Req *types.UpdateOptions `xml:"urn:vim25 UpdateOptions,omitempty"` - Res *types.UpdateOptionsResponse `xml:"urn:vim25 UpdateOptionsResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *UpdateOptionsBody) Fault() *soap.Fault { return b.Fault_ } - -func UpdateOptions(ctx context.Context, r soap.RoundTripper, req *types.UpdateOptions) (*types.UpdateOptionsResponse, error) { - var reqBody, resBody UpdateOptionsBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type UpdatePassthruConfigBody struct { - Req *types.UpdatePassthruConfig `xml:"urn:vim25 UpdatePassthruConfig,omitempty"` - Res *types.UpdatePassthruConfigResponse `xml:"urn:vim25 UpdatePassthruConfigResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *UpdatePassthruConfigBody) Fault() *soap.Fault { return b.Fault_ } - -func UpdatePassthruConfig(ctx context.Context, r soap.RoundTripper, req *types.UpdatePassthruConfig) (*types.UpdatePassthruConfigResponse, error) { - var reqBody, resBody UpdatePassthruConfigBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type UpdatePerfIntervalBody struct { - Req *types.UpdatePerfInterval `xml:"urn:vim25 UpdatePerfInterval,omitempty"` - Res *types.UpdatePerfIntervalResponse `xml:"urn:vim25 UpdatePerfIntervalResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *UpdatePerfIntervalBody) Fault() *soap.Fault { return b.Fault_ } - -func UpdatePerfInterval(ctx context.Context, r soap.RoundTripper, req *types.UpdatePerfInterval) (*types.UpdatePerfIntervalResponse, error) { - var reqBody, resBody UpdatePerfIntervalBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type UpdatePhysicalNicLinkSpeedBody struct { - Req *types.UpdatePhysicalNicLinkSpeed `xml:"urn:vim25 UpdatePhysicalNicLinkSpeed,omitempty"` - Res *types.UpdatePhysicalNicLinkSpeedResponse `xml:"urn:vim25 UpdatePhysicalNicLinkSpeedResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *UpdatePhysicalNicLinkSpeedBody) Fault() *soap.Fault { return b.Fault_ } - -func UpdatePhysicalNicLinkSpeed(ctx context.Context, r soap.RoundTripper, req *types.UpdatePhysicalNicLinkSpeed) (*types.UpdatePhysicalNicLinkSpeedResponse, error) { - var reqBody, resBody UpdatePhysicalNicLinkSpeedBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type UpdatePortGroupBody struct { - Req *types.UpdatePortGroup `xml:"urn:vim25 UpdatePortGroup,omitempty"` - Res *types.UpdatePortGroupResponse `xml:"urn:vim25 UpdatePortGroupResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *UpdatePortGroupBody) Fault() *soap.Fault { return b.Fault_ } - -func UpdatePortGroup(ctx context.Context, r soap.RoundTripper, req *types.UpdatePortGroup) (*types.UpdatePortGroupResponse, error) { - var reqBody, resBody UpdatePortGroupBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type UpdateProgressBody struct { - Req *types.UpdateProgress `xml:"urn:vim25 UpdateProgress,omitempty"` - Res *types.UpdateProgressResponse `xml:"urn:vim25 UpdateProgressResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *UpdateProgressBody) Fault() *soap.Fault { return b.Fault_ } - -func UpdateProgress(ctx context.Context, r soap.RoundTripper, req *types.UpdateProgress) (*types.UpdateProgressResponse, error) { - var reqBody, resBody UpdateProgressBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type UpdateReferenceHostBody struct { - Req *types.UpdateReferenceHost `xml:"urn:vim25 UpdateReferenceHost,omitempty"` - Res *types.UpdateReferenceHostResponse `xml:"urn:vim25 UpdateReferenceHostResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *UpdateReferenceHostBody) Fault() *soap.Fault { return b.Fault_ } - -func UpdateReferenceHost(ctx context.Context, r soap.RoundTripper, req *types.UpdateReferenceHost) (*types.UpdateReferenceHostResponse, error) { - var reqBody, resBody UpdateReferenceHostBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type UpdateRulesetBody struct { - Req *types.UpdateRuleset `xml:"urn:vim25 UpdateRuleset,omitempty"` - Res *types.UpdateRulesetResponse `xml:"urn:vim25 UpdateRulesetResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *UpdateRulesetBody) Fault() *soap.Fault { return b.Fault_ } - -func UpdateRuleset(ctx context.Context, r soap.RoundTripper, req *types.UpdateRuleset) (*types.UpdateRulesetResponse, error) { - var reqBody, resBody UpdateRulesetBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type UpdateScsiLunDisplayNameBody struct { - Req *types.UpdateScsiLunDisplayName `xml:"urn:vim25 UpdateScsiLunDisplayName,omitempty"` - Res *types.UpdateScsiLunDisplayNameResponse `xml:"urn:vim25 UpdateScsiLunDisplayNameResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *UpdateScsiLunDisplayNameBody) Fault() *soap.Fault { return b.Fault_ } - -func UpdateScsiLunDisplayName(ctx context.Context, r soap.RoundTripper, req *types.UpdateScsiLunDisplayName) (*types.UpdateScsiLunDisplayNameResponse, error) { - var reqBody, resBody UpdateScsiLunDisplayNameBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type UpdateServiceConsoleVirtualNicBody struct { - Req *types.UpdateServiceConsoleVirtualNic `xml:"urn:vim25 UpdateServiceConsoleVirtualNic,omitempty"` - Res *types.UpdateServiceConsoleVirtualNicResponse `xml:"urn:vim25 UpdateServiceConsoleVirtualNicResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *UpdateServiceConsoleVirtualNicBody) Fault() *soap.Fault { return b.Fault_ } - -func UpdateServiceConsoleVirtualNic(ctx context.Context, r soap.RoundTripper, req *types.UpdateServiceConsoleVirtualNic) (*types.UpdateServiceConsoleVirtualNicResponse, error) { - var reqBody, resBody UpdateServiceConsoleVirtualNicBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type UpdateServiceMessageBody struct { - Req *types.UpdateServiceMessage `xml:"urn:vim25 UpdateServiceMessage,omitempty"` - Res *types.UpdateServiceMessageResponse `xml:"urn:vim25 UpdateServiceMessageResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *UpdateServiceMessageBody) Fault() *soap.Fault { return b.Fault_ } - -func UpdateServiceMessage(ctx context.Context, r soap.RoundTripper, req *types.UpdateServiceMessage) (*types.UpdateServiceMessageResponse, error) { - var reqBody, resBody UpdateServiceMessageBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type UpdateServicePolicyBody struct { - Req *types.UpdateServicePolicy `xml:"urn:vim25 UpdateServicePolicy,omitempty"` - Res *types.UpdateServicePolicyResponse `xml:"urn:vim25 UpdateServicePolicyResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *UpdateServicePolicyBody) Fault() *soap.Fault { return b.Fault_ } - -func UpdateServicePolicy(ctx context.Context, r soap.RoundTripper, req *types.UpdateServicePolicy) (*types.UpdateServicePolicyResponse, error) { - var reqBody, resBody UpdateServicePolicyBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type UpdateSoftwareInternetScsiEnabledBody struct { - Req *types.UpdateSoftwareInternetScsiEnabled `xml:"urn:vim25 UpdateSoftwareInternetScsiEnabled,omitempty"` - Res *types.UpdateSoftwareInternetScsiEnabledResponse `xml:"urn:vim25 UpdateSoftwareInternetScsiEnabledResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *UpdateSoftwareInternetScsiEnabledBody) Fault() *soap.Fault { return b.Fault_ } - -func UpdateSoftwareInternetScsiEnabled(ctx context.Context, r soap.RoundTripper, req *types.UpdateSoftwareInternetScsiEnabled) (*types.UpdateSoftwareInternetScsiEnabledResponse, error) { - var reqBody, resBody UpdateSoftwareInternetScsiEnabledBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type UpdateSystemResourcesBody struct { - Req *types.UpdateSystemResources `xml:"urn:vim25 UpdateSystemResources,omitempty"` - Res *types.UpdateSystemResourcesResponse `xml:"urn:vim25 UpdateSystemResourcesResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *UpdateSystemResourcesBody) Fault() *soap.Fault { return b.Fault_ } - -func UpdateSystemResources(ctx context.Context, r soap.RoundTripper, req *types.UpdateSystemResources) (*types.UpdateSystemResourcesResponse, error) { - var reqBody, resBody UpdateSystemResourcesBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type UpdateSystemSwapConfigurationBody struct { - Req *types.UpdateSystemSwapConfiguration `xml:"urn:vim25 UpdateSystemSwapConfiguration,omitempty"` - Res *types.UpdateSystemSwapConfigurationResponse `xml:"urn:vim25 UpdateSystemSwapConfigurationResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *UpdateSystemSwapConfigurationBody) Fault() *soap.Fault { return b.Fault_ } - -func UpdateSystemSwapConfiguration(ctx context.Context, r soap.RoundTripper, req *types.UpdateSystemSwapConfiguration) (*types.UpdateSystemSwapConfigurationResponse, error) { - var reqBody, resBody UpdateSystemSwapConfigurationBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type UpdateUserBody struct { - Req *types.UpdateUser `xml:"urn:vim25 UpdateUser,omitempty"` - Res *types.UpdateUserResponse `xml:"urn:vim25 UpdateUserResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *UpdateUserBody) Fault() *soap.Fault { return b.Fault_ } - -func UpdateUser(ctx context.Context, r soap.RoundTripper, req *types.UpdateUser) (*types.UpdateUserResponse, error) { - var reqBody, resBody UpdateUserBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type UpdateVAppConfigBody struct { - Req *types.UpdateVAppConfig `xml:"urn:vim25 UpdateVAppConfig,omitempty"` - Res *types.UpdateVAppConfigResponse `xml:"urn:vim25 UpdateVAppConfigResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *UpdateVAppConfigBody) Fault() *soap.Fault { return b.Fault_ } - -func UpdateVAppConfig(ctx context.Context, r soap.RoundTripper, req *types.UpdateVAppConfig) (*types.UpdateVAppConfigResponse, error) { - var reqBody, resBody UpdateVAppConfigBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type UpdateVirtualMachineFiles_TaskBody struct { - Req *types.UpdateVirtualMachineFiles_Task `xml:"urn:vim25 UpdateVirtualMachineFiles_Task,omitempty"` - Res *types.UpdateVirtualMachineFiles_TaskResponse `xml:"urn:vim25 UpdateVirtualMachineFiles_TaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *UpdateVirtualMachineFiles_TaskBody) Fault() *soap.Fault { return b.Fault_ } - -func UpdateVirtualMachineFiles_Task(ctx context.Context, r soap.RoundTripper, req *types.UpdateVirtualMachineFiles_Task) (*types.UpdateVirtualMachineFiles_TaskResponse, error) { - var reqBody, resBody UpdateVirtualMachineFiles_TaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type UpdateVirtualNicBody struct { - Req *types.UpdateVirtualNic `xml:"urn:vim25 UpdateVirtualNic,omitempty"` - Res *types.UpdateVirtualNicResponse `xml:"urn:vim25 UpdateVirtualNicResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *UpdateVirtualNicBody) Fault() *soap.Fault { return b.Fault_ } - -func UpdateVirtualNic(ctx context.Context, r soap.RoundTripper, req *types.UpdateVirtualNic) (*types.UpdateVirtualNicResponse, error) { - var reqBody, resBody UpdateVirtualNicBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type UpdateVirtualSwitchBody struct { - Req *types.UpdateVirtualSwitch `xml:"urn:vim25 UpdateVirtualSwitch,omitempty"` - Res *types.UpdateVirtualSwitchResponse `xml:"urn:vim25 UpdateVirtualSwitchResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *UpdateVirtualSwitchBody) Fault() *soap.Fault { return b.Fault_ } - -func UpdateVirtualSwitch(ctx context.Context, r soap.RoundTripper, req *types.UpdateVirtualSwitch) (*types.UpdateVirtualSwitchResponse, error) { - var reqBody, resBody UpdateVirtualSwitchBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type UpdateVsan_TaskBody struct { - Req *types.UpdateVsan_Task `xml:"urn:vim25 UpdateVsan_Task,omitempty"` - Res *types.UpdateVsan_TaskResponse `xml:"urn:vim25 UpdateVsan_TaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *UpdateVsan_TaskBody) Fault() *soap.Fault { return b.Fault_ } - -func UpdateVsan_Task(ctx context.Context, r soap.RoundTripper, req *types.UpdateVsan_Task) (*types.UpdateVsan_TaskResponse, error) { - var reqBody, resBody UpdateVsan_TaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type UpgradeTools_TaskBody struct { - Req *types.UpgradeTools_Task `xml:"urn:vim25 UpgradeTools_Task,omitempty"` - Res *types.UpgradeTools_TaskResponse `xml:"urn:vim25 UpgradeTools_TaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *UpgradeTools_TaskBody) Fault() *soap.Fault { return b.Fault_ } - -func UpgradeTools_Task(ctx context.Context, r soap.RoundTripper, req *types.UpgradeTools_Task) (*types.UpgradeTools_TaskResponse, error) { - var reqBody, resBody UpgradeTools_TaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type UpgradeVM_TaskBody struct { - Req *types.UpgradeVM_Task `xml:"urn:vim25 UpgradeVM_Task,omitempty"` - Res *types.UpgradeVM_TaskResponse `xml:"urn:vim25 UpgradeVM_TaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *UpgradeVM_TaskBody) Fault() *soap.Fault { return b.Fault_ } - -func UpgradeVM_Task(ctx context.Context, r soap.RoundTripper, req *types.UpgradeVM_Task) (*types.UpgradeVM_TaskResponse, error) { - var reqBody, resBody UpgradeVM_TaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type UpgradeVmLayoutBody struct { - Req *types.UpgradeVmLayout `xml:"urn:vim25 UpgradeVmLayout,omitempty"` - Res *types.UpgradeVmLayoutResponse `xml:"urn:vim25 UpgradeVmLayoutResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *UpgradeVmLayoutBody) Fault() *soap.Fault { return b.Fault_ } - -func UpgradeVmLayout(ctx context.Context, r soap.RoundTripper, req *types.UpgradeVmLayout) (*types.UpgradeVmLayoutResponse, error) { - var reqBody, resBody UpgradeVmLayoutBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type UpgradeVmfsBody struct { - Req *types.UpgradeVmfs `xml:"urn:vim25 UpgradeVmfs,omitempty"` - Res *types.UpgradeVmfsResponse `xml:"urn:vim25 UpgradeVmfsResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *UpgradeVmfsBody) Fault() *soap.Fault { return b.Fault_ } - -func UpgradeVmfs(ctx context.Context, r soap.RoundTripper, req *types.UpgradeVmfs) (*types.UpgradeVmfsResponse, error) { - var reqBody, resBody UpgradeVmfsBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type ValidateCredentialsInGuestBody struct { - Req *types.ValidateCredentialsInGuest `xml:"urn:vim25 ValidateCredentialsInGuest,omitempty"` - Res *types.ValidateCredentialsInGuestResponse `xml:"urn:vim25 ValidateCredentialsInGuestResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *ValidateCredentialsInGuestBody) Fault() *soap.Fault { return b.Fault_ } - -func ValidateCredentialsInGuest(ctx context.Context, r soap.RoundTripper, req *types.ValidateCredentialsInGuest) (*types.ValidateCredentialsInGuestResponse, error) { - var reqBody, resBody ValidateCredentialsInGuestBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type ValidateHostBody struct { - Req *types.ValidateHost `xml:"urn:vim25 ValidateHost,omitempty"` - Res *types.ValidateHostResponse `xml:"urn:vim25 ValidateHostResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *ValidateHostBody) Fault() *soap.Fault { return b.Fault_ } - -func ValidateHost(ctx context.Context, r soap.RoundTripper, req *types.ValidateHost) (*types.ValidateHostResponse, error) { - var reqBody, resBody ValidateHostBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type ValidateMigrationBody struct { - Req *types.ValidateMigration `xml:"urn:vim25 ValidateMigration,omitempty"` - Res *types.ValidateMigrationResponse `xml:"urn:vim25 ValidateMigrationResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *ValidateMigrationBody) Fault() *soap.Fault { return b.Fault_ } - -func ValidateMigration(ctx context.Context, r soap.RoundTripper, req *types.ValidateMigration) (*types.ValidateMigrationResponse, error) { - var reqBody, resBody ValidateMigrationBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type WaitForUpdatesBody struct { - Req *types.WaitForUpdates `xml:"urn:vim25 WaitForUpdates,omitempty"` - Res *types.WaitForUpdatesResponse `xml:"urn:vim25 WaitForUpdatesResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *WaitForUpdatesBody) Fault() *soap.Fault { return b.Fault_ } - -func WaitForUpdates(ctx context.Context, r soap.RoundTripper, req *types.WaitForUpdates) (*types.WaitForUpdatesResponse, error) { - var reqBody, resBody WaitForUpdatesBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type WaitForUpdatesExBody struct { - Req *types.WaitForUpdatesEx `xml:"urn:vim25 WaitForUpdatesEx,omitempty"` - Res *types.WaitForUpdatesExResponse `xml:"urn:vim25 WaitForUpdatesExResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *WaitForUpdatesExBody) Fault() *soap.Fault { return b.Fault_ } - -func WaitForUpdatesEx(ctx context.Context, r soap.RoundTripper, req *types.WaitForUpdatesEx) (*types.WaitForUpdatesExResponse, error) { - var reqBody, resBody WaitForUpdatesExBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type XmlToCustomizationSpecItemBody struct { - Req *types.XmlToCustomizationSpecItem `xml:"urn:vim25 XmlToCustomizationSpecItem,omitempty"` - Res *types.XmlToCustomizationSpecItemResponse `xml:"urn:vim25 XmlToCustomizationSpecItemResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *XmlToCustomizationSpecItemBody) Fault() *soap.Fault { return b.Fault_ } - -func XmlToCustomizationSpecItem(ctx context.Context, r soap.RoundTripper, req *types.XmlToCustomizationSpecItem) (*types.XmlToCustomizationSpecItemResponse, error) { - var reqBody, resBody XmlToCustomizationSpecItemBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} - -type ZeroFillVirtualDisk_TaskBody struct { - Req *types.ZeroFillVirtualDisk_Task `xml:"urn:vim25 ZeroFillVirtualDisk_Task,omitempty"` - Res *types.ZeroFillVirtualDisk_TaskResponse `xml:"urn:vim25 ZeroFillVirtualDisk_TaskResponse,omitempty"` - Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` -} - -func (b *ZeroFillVirtualDisk_TaskBody) Fault() *soap.Fault { return b.Fault_ } - -func ZeroFillVirtualDisk_Task(ctx context.Context, r soap.RoundTripper, req *types.ZeroFillVirtualDisk_Task) (*types.ZeroFillVirtualDisk_TaskResponse, error) { - var reqBody, resBody ZeroFillVirtualDisk_TaskBody - - reqBody.Req = req - - if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { - return nil, err - } - - return resBody.Res, nil -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/vim25/methods/service_content.go juju-core-2.0.2/src/github.com/juju/govmomi/vim25/methods/service_content.go --- juju-core-2.0.0/src/github.com/juju/govmomi/vim25/methods/service_content.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/vim25/methods/service_content.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,41 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package methods - -import ( - "github.com/juju/govmomi/vim25/soap" - "github.com/juju/govmomi/vim25/types" - "golang.org/x/net/context" -) - -var serviceInstance = types.ManagedObjectReference{ - Type: "ServiceInstance", - Value: "ServiceInstance", -} - -func GetServiceContent(ctx context.Context, r soap.RoundTripper) (types.ServiceContent, error) { - req := types.RetrieveServiceContent{ - This: serviceInstance, - } - - res, err := RetrieveServiceContent(ctx, r, &req) - if err != nil { - return types.ServiceContent{}, err - } - - return res.Returnval, nil -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/vim25/mo/ancestors.go juju-core-2.0.2/src/github.com/juju/govmomi/vim25/mo/ancestors.go --- juju-core-2.0.0/src/github.com/juju/govmomi/vim25/mo/ancestors.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/vim25/mo/ancestors.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,92 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package mo - -import ( - "github.com/juju/govmomi/vim25/soap" - "github.com/juju/govmomi/vim25/types" - "golang.org/x/net/context" -) - -// Ancestors returns the entire ancestry tree of a specified managed object. -// The return value includes the root node and the specified object itself. -func Ancestors(ctx context.Context, rt soap.RoundTripper, pc, obj types.ManagedObjectReference) ([]ManagedEntity, error) { - ospec := types.ObjectSpec{ - Obj: obj, - SelectSet: []types.BaseSelectionSpec{ - &types.TraversalSpec{ - SelectionSpec: types.SelectionSpec{Name: "traverseParent"}, - Type: "ManagedEntity", - Path: "parent", - Skip: types.NewBool(false), - SelectSet: []types.BaseSelectionSpec{ - &types.SelectionSpec{Name: "traverseParent"}, - }, - }, - }, - Skip: types.NewBool(false), - } - - pspec := types.PropertySpec{ - Type: "ManagedEntity", - PathSet: []string{"name", "parent"}, - } - - req := types.RetrieveProperties{ - This: pc, - SpecSet: []types.PropertyFilterSpec{ - { - ObjectSet: []types.ObjectSpec{ospec}, - PropSet: []types.PropertySpec{pspec}, - }, - }, - } - - var ifaces []interface{} - - err := RetrievePropertiesForRequest(ctx, rt, req, &ifaces) - if err != nil { - return nil, err - } - - var out []ManagedEntity - - // Build ancestry tree by iteratively finding a new child. - for len(out) < len(ifaces) { - var find types.ManagedObjectReference - - if len(out) > 0 { - find = out[len(out)-1].Self - } - - // Find entity we're looking for given the last entity in the current tree. - for _, iface := range ifaces { - me := iface.(IsManagedEntity).GetManagedEntity() - if me.Parent == nil { - out = append(out, me) - break - } - - if *me.Parent == find { - out = append(out, me) - break - } - } - } - - return out, nil -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/vim25/mo/extra.go juju-core-2.0.2/src/github.com/juju/govmomi/vim25/mo/extra.go --- juju-core-2.0.0/src/github.com/juju/govmomi/vim25/mo/extra.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/vim25/mo/extra.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,57 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package mo - -type IsManagedEntity interface { - GetManagedEntity() ManagedEntity -} - -func (m ComputeResource) GetManagedEntity() ManagedEntity { - return m.ManagedEntity -} - -func (m Datacenter) GetManagedEntity() ManagedEntity { - return m.ManagedEntity -} - -func (m Datastore) GetManagedEntity() ManagedEntity { - return m.ManagedEntity -} - -func (m DistributedVirtualSwitch) GetManagedEntity() ManagedEntity { - return m.ManagedEntity -} - -func (m Folder) GetManagedEntity() ManagedEntity { - return m.ManagedEntity -} - -func (m HostSystem) GetManagedEntity() ManagedEntity { - return m.ManagedEntity -} - -func (m Network) GetManagedEntity() ManagedEntity { - return m.ManagedEntity -} - -func (m ResourcePool) GetManagedEntity() ManagedEntity { - return m.ManagedEntity -} - -func (m VirtualMachine) GetManagedEntity() ManagedEntity { - return m.ManagedEntity -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/vim25/mo/fixtures/nested_property.xml juju-core-2.0.2/src/github.com/juju/govmomi/vim25/mo/fixtures/nested_property.xml --- juju-core-2.0.0/src/github.com/juju/govmomi/vim25/mo/fixtures/nested_property.xml 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/vim25/mo/fixtures/nested_property.xml 1970-01-01 00:00:00.000000000 +0000 @@ -1,14 +0,0 @@ - - - - vm-411 - - config.name - kubernetes-master - - - config.uuid - 422ec880-ab06-06b4-23f3-beb7a052a4c9 - - - diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/vim25/mo/fixtures/not_authenticated_fault.xml juju-core-2.0.2/src/github.com/juju/govmomi/vim25/mo/fixtures/not_authenticated_fault.xml --- juju-core-2.0.0/src/github.com/juju/govmomi/vim25/mo/fixtures/not_authenticated_fault.xml 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/vim25/mo/fixtures/not_authenticated_fault.xml 1970-01-01 00:00:00.000000000 +0000 @@ -1,42 +0,0 @@ - - - - SessionManager - - defaultLocale - en - - - messageLocaleList - - ja - zh_CN - en - de - zh_TW - ko - fr - - - - message - - - group-d1 - System.View - - - - - - sessionList - - - group-d1 - Sessions.TerminateSession - - - - - - diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/vim25/mo/fixtures/pointer_property.xml juju-core-2.0.2/src/github.com/juju/govmomi/vim25/mo/fixtures/pointer_property.xml --- juju-core-2.0.0/src/github.com/juju/govmomi/vim25/mo/fixtures/pointer_property.xml 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/vim25/mo/fixtures/pointer_property.xml 1970-01-01 00:00:00.000000000 +0000 @@ -1,15 +0,0 @@ - - - - vm-411 - - config.bootOptions - - 0 - false - false - 10000 - - - - diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/vim25/mo/mo.go juju-core-2.0.2/src/github.com/juju/govmomi/vim25/mo/mo.go --- juju-core-2.0.0/src/github.com/juju/govmomi/vim25/mo/mo.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/vim25/mo/mo.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,1509 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package mo - -import ( - "reflect" - "time" - - "github.com/juju/govmomi/vim25/types" -) - -type Alarm struct { - ExtensibleManagedObject - - Info types.AlarmInfo `mo:"info"` -} - -func init() { - t["Alarm"] = reflect.TypeOf((*Alarm)(nil)).Elem() -} - -type AlarmManager struct { - Self types.ManagedObjectReference - - DefaultExpression []types.BaseAlarmExpression `mo:"defaultExpression"` - Description types.AlarmDescription `mo:"description"` -} - -func (m AlarmManager) Reference() types.ManagedObjectReference { - return m.Self -} - -func init() { - t["AlarmManager"] = reflect.TypeOf((*AlarmManager)(nil)).Elem() -} - -type AuthorizationManager struct { - Self types.ManagedObjectReference - - PrivilegeList []types.AuthorizationPrivilege `mo:"privilegeList"` - RoleList []types.AuthorizationRole `mo:"roleList"` - Description types.AuthorizationDescription `mo:"description"` -} - -func (m AuthorizationManager) Reference() types.ManagedObjectReference { - return m.Self -} - -func init() { - t["AuthorizationManager"] = reflect.TypeOf((*AuthorizationManager)(nil)).Elem() -} - -type ClusterComputeResource struct { - ComputeResource - - Configuration types.ClusterConfigInfo `mo:"configuration"` - Recommendation []types.ClusterRecommendation `mo:"recommendation"` - DrsRecommendation []types.ClusterDrsRecommendation `mo:"drsRecommendation"` - MigrationHistory []types.ClusterDrsMigration `mo:"migrationHistory"` - ActionHistory []types.ClusterActionHistory `mo:"actionHistory"` - DrsFault []types.ClusterDrsFaults `mo:"drsFault"` -} - -func init() { - t["ClusterComputeResource"] = reflect.TypeOf((*ClusterComputeResource)(nil)).Elem() -} - -type ClusterProfile struct { - Profile -} - -func init() { - t["ClusterProfile"] = reflect.TypeOf((*ClusterProfile)(nil)).Elem() -} - -type ClusterProfileManager struct { - ProfileManager -} - -func init() { - t["ClusterProfileManager"] = reflect.TypeOf((*ClusterProfileManager)(nil)).Elem() -} - -type ComputeResource struct { - ManagedEntity - - ResourcePool *types.ManagedObjectReference `mo:"resourcePool"` - Host []types.ManagedObjectReference `mo:"host"` - Datastore []types.ManagedObjectReference `mo:"datastore"` - Network []types.ManagedObjectReference `mo:"network"` - Summary types.BaseComputeResourceSummary `mo:"summary"` - EnvironmentBrowser *types.ManagedObjectReference `mo:"environmentBrowser"` - ConfigurationEx types.BaseComputeResourceConfigInfo `mo:"configurationEx"` -} - -func init() { - t["ComputeResource"] = reflect.TypeOf((*ComputeResource)(nil)).Elem() -} - -type ContainerView struct { - ManagedObjectView - - Container types.ManagedObjectReference `mo:"container"` - Type []string `mo:"type"` - Recursive bool `mo:"recursive"` -} - -func init() { - t["ContainerView"] = reflect.TypeOf((*ContainerView)(nil)).Elem() -} - -type CustomFieldsManager struct { - Self types.ManagedObjectReference - - Field []types.CustomFieldDef `mo:"field"` -} - -func (m CustomFieldsManager) Reference() types.ManagedObjectReference { - return m.Self -} - -func init() { - t["CustomFieldsManager"] = reflect.TypeOf((*CustomFieldsManager)(nil)).Elem() -} - -type CustomizationSpecManager struct { - Self types.ManagedObjectReference - - Info []types.CustomizationSpecInfo `mo:"info"` - EncryptionKey []byte `mo:"encryptionKey"` -} - -func (m CustomizationSpecManager) Reference() types.ManagedObjectReference { - return m.Self -} - -func init() { - t["CustomizationSpecManager"] = reflect.TypeOf((*CustomizationSpecManager)(nil)).Elem() -} - -type Datacenter struct { - ManagedEntity - - VmFolder types.ManagedObjectReference `mo:"vmFolder"` - HostFolder types.ManagedObjectReference `mo:"hostFolder"` - DatastoreFolder types.ManagedObjectReference `mo:"datastoreFolder"` - NetworkFolder types.ManagedObjectReference `mo:"networkFolder"` - Datastore []types.ManagedObjectReference `mo:"datastore"` - Network []types.ManagedObjectReference `mo:"network"` - Configuration types.DatacenterConfigInfo `mo:"configuration"` -} - -func init() { - t["Datacenter"] = reflect.TypeOf((*Datacenter)(nil)).Elem() -} - -type Datastore struct { - ManagedEntity - - Info types.BaseDatastoreInfo `mo:"info"` - Summary types.DatastoreSummary `mo:"summary"` - Host []types.DatastoreHostMount `mo:"host"` - Vm []types.ManagedObjectReference `mo:"vm"` - Browser types.ManagedObjectReference `mo:"browser"` - Capability types.DatastoreCapability `mo:"capability"` - IormConfiguration *types.StorageIORMInfo `mo:"iormConfiguration"` -} - -func init() { - t["Datastore"] = reflect.TypeOf((*Datastore)(nil)).Elem() -} - -type DatastoreNamespaceManager struct { - Self types.ManagedObjectReference -} - -func (m DatastoreNamespaceManager) Reference() types.ManagedObjectReference { - return m.Self -} - -func init() { - t["DatastoreNamespaceManager"] = reflect.TypeOf((*DatastoreNamespaceManager)(nil)).Elem() -} - -type DiagnosticManager struct { - Self types.ManagedObjectReference -} - -func (m DiagnosticManager) Reference() types.ManagedObjectReference { - return m.Self -} - -func init() { - t["DiagnosticManager"] = reflect.TypeOf((*DiagnosticManager)(nil)).Elem() -} - -type DistributedVirtualPortgroup struct { - Network - - Key string `mo:"key"` - Config types.DVPortgroupConfigInfo `mo:"config"` - PortKeys []string `mo:"portKeys"` -} - -func init() { - t["DistributedVirtualPortgroup"] = reflect.TypeOf((*DistributedVirtualPortgroup)(nil)).Elem() -} - -type DistributedVirtualSwitch struct { - ManagedEntity - - Uuid string `mo:"uuid"` - Capability types.DVSCapability `mo:"capability"` - Summary types.DVSSummary `mo:"summary"` - Config types.BaseDVSConfigInfo `mo:"config"` - NetworkResourcePool []types.DVSNetworkResourcePool `mo:"networkResourcePool"` - Portgroup []types.ManagedObjectReference `mo:"portgroup"` - Runtime *types.DVSRuntimeInfo `mo:"runtime"` -} - -func init() { - t["DistributedVirtualSwitch"] = reflect.TypeOf((*DistributedVirtualSwitch)(nil)).Elem() -} - -type DistributedVirtualSwitchManager struct { - Self types.ManagedObjectReference -} - -func (m DistributedVirtualSwitchManager) Reference() types.ManagedObjectReference { - return m.Self -} - -func init() { - t["DistributedVirtualSwitchManager"] = reflect.TypeOf((*DistributedVirtualSwitchManager)(nil)).Elem() -} - -type EnvironmentBrowser struct { - Self types.ManagedObjectReference - - DatastoreBrowser *types.ManagedObjectReference `mo:"datastoreBrowser"` -} - -func (m EnvironmentBrowser) Reference() types.ManagedObjectReference { - return m.Self -} - -func init() { - t["EnvironmentBrowser"] = reflect.TypeOf((*EnvironmentBrowser)(nil)).Elem() -} - -type EventHistoryCollector struct { - HistoryCollector - - LatestPage []types.BaseEvent `mo:"latestPage"` -} - -func init() { - t["EventHistoryCollector"] = reflect.TypeOf((*EventHistoryCollector)(nil)).Elem() -} - -type EventManager struct { - Self types.ManagedObjectReference - - Description types.EventDescription `mo:"description"` - LatestEvent types.BaseEvent `mo:"latestEvent"` - MaxCollector int `mo:"maxCollector"` -} - -func (m EventManager) Reference() types.ManagedObjectReference { - return m.Self -} - -func init() { - t["EventManager"] = reflect.TypeOf((*EventManager)(nil)).Elem() -} - -type ExtensibleManagedObject struct { - Self types.ManagedObjectReference - - Value []types.BaseCustomFieldValue `mo:"value"` - AvailableField []types.CustomFieldDef `mo:"availableField"` -} - -func (m ExtensibleManagedObject) Reference() types.ManagedObjectReference { - return m.Self -} - -func init() { - t["ExtensibleManagedObject"] = reflect.TypeOf((*ExtensibleManagedObject)(nil)).Elem() -} - -type ExtensionManager struct { - Self types.ManagedObjectReference - - ExtensionList []types.Extension `mo:"extensionList"` -} - -func (m ExtensionManager) Reference() types.ManagedObjectReference { - return m.Self -} - -func init() { - t["ExtensionManager"] = reflect.TypeOf((*ExtensionManager)(nil)).Elem() -} - -type FileManager struct { - Self types.ManagedObjectReference -} - -func (m FileManager) Reference() types.ManagedObjectReference { - return m.Self -} - -func init() { - t["FileManager"] = reflect.TypeOf((*FileManager)(nil)).Elem() -} - -type Folder struct { - ManagedEntity - - ChildType []string `mo:"childType"` - ChildEntity []types.ManagedObjectReference `mo:"childEntity"` -} - -func init() { - t["Folder"] = reflect.TypeOf((*Folder)(nil)).Elem() -} - -type GuestAuthManager struct { - Self types.ManagedObjectReference -} - -func (m GuestAuthManager) Reference() types.ManagedObjectReference { - return m.Self -} - -func init() { - t["GuestAuthManager"] = reflect.TypeOf((*GuestAuthManager)(nil)).Elem() -} - -type GuestFileManager struct { - Self types.ManagedObjectReference -} - -func (m GuestFileManager) Reference() types.ManagedObjectReference { - return m.Self -} - -func init() { - t["GuestFileManager"] = reflect.TypeOf((*GuestFileManager)(nil)).Elem() -} - -type GuestOperationsManager struct { - Self types.ManagedObjectReference - - AuthManager *types.ManagedObjectReference `mo:"authManager"` - FileManager *types.ManagedObjectReference `mo:"fileManager"` - ProcessManager *types.ManagedObjectReference `mo:"processManager"` -} - -func (m GuestOperationsManager) Reference() types.ManagedObjectReference { - return m.Self -} - -func init() { - t["GuestOperationsManager"] = reflect.TypeOf((*GuestOperationsManager)(nil)).Elem() -} - -type GuestProcessManager struct { - Self types.ManagedObjectReference -} - -func (m GuestProcessManager) Reference() types.ManagedObjectReference { - return m.Self -} - -func init() { - t["GuestProcessManager"] = reflect.TypeOf((*GuestProcessManager)(nil)).Elem() -} - -type HistoryCollector struct { - Self types.ManagedObjectReference - - Filter types.AnyType `mo:"filter"` -} - -func (m HistoryCollector) Reference() types.ManagedObjectReference { - return m.Self -} - -func init() { - t["HistoryCollector"] = reflect.TypeOf((*HistoryCollector)(nil)).Elem() -} - -type HostActiveDirectoryAuthentication struct { - HostDirectoryStore -} - -func init() { - t["HostActiveDirectoryAuthentication"] = reflect.TypeOf((*HostActiveDirectoryAuthentication)(nil)).Elem() -} - -type HostAuthenticationManager struct { - Self types.ManagedObjectReference - - Info types.HostAuthenticationManagerInfo `mo:"info"` - SupportedStore []types.ManagedObjectReference `mo:"supportedStore"` -} - -func (m HostAuthenticationManager) Reference() types.ManagedObjectReference { - return m.Self -} - -func init() { - t["HostAuthenticationManager"] = reflect.TypeOf((*HostAuthenticationManager)(nil)).Elem() -} - -type HostAuthenticationStore struct { - Self types.ManagedObjectReference - - Info types.BaseHostAuthenticationStoreInfo `mo:"info"` -} - -func (m HostAuthenticationStore) Reference() types.ManagedObjectReference { - return m.Self -} - -func init() { - t["HostAuthenticationStore"] = reflect.TypeOf((*HostAuthenticationStore)(nil)).Elem() -} - -type HostAutoStartManager struct { - Self types.ManagedObjectReference - - Config types.HostAutoStartManagerConfig `mo:"config"` -} - -func (m HostAutoStartManager) Reference() types.ManagedObjectReference { - return m.Self -} - -func init() { - t["HostAutoStartManager"] = reflect.TypeOf((*HostAutoStartManager)(nil)).Elem() -} - -type HostBootDeviceSystem struct { - Self types.ManagedObjectReference -} - -func (m HostBootDeviceSystem) Reference() types.ManagedObjectReference { - return m.Self -} - -func init() { - t["HostBootDeviceSystem"] = reflect.TypeOf((*HostBootDeviceSystem)(nil)).Elem() -} - -type HostCacheConfigurationManager struct { - Self types.ManagedObjectReference - - CacheConfigurationInfo []types.HostCacheConfigurationInfo `mo:"cacheConfigurationInfo"` -} - -func (m HostCacheConfigurationManager) Reference() types.ManagedObjectReference { - return m.Self -} - -func init() { - t["HostCacheConfigurationManager"] = reflect.TypeOf((*HostCacheConfigurationManager)(nil)).Elem() -} - -type HostCpuSchedulerSystem struct { - ExtensibleManagedObject - - HyperthreadInfo *types.HostHyperThreadScheduleInfo `mo:"hyperthreadInfo"` -} - -func init() { - t["HostCpuSchedulerSystem"] = reflect.TypeOf((*HostCpuSchedulerSystem)(nil)).Elem() -} - -type HostDatastoreBrowser struct { - Self types.ManagedObjectReference - - Datastore []types.ManagedObjectReference `mo:"datastore"` - SupportedType []types.BaseFileQuery `mo:"supportedType"` -} - -func (m HostDatastoreBrowser) Reference() types.ManagedObjectReference { - return m.Self -} - -func init() { - t["HostDatastoreBrowser"] = reflect.TypeOf((*HostDatastoreBrowser)(nil)).Elem() -} - -type HostDatastoreSystem struct { - Self types.ManagedObjectReference - - Datastore []types.ManagedObjectReference `mo:"datastore"` - Capabilities types.HostDatastoreSystemCapabilities `mo:"capabilities"` -} - -func (m HostDatastoreSystem) Reference() types.ManagedObjectReference { - return m.Self -} - -func init() { - t["HostDatastoreSystem"] = reflect.TypeOf((*HostDatastoreSystem)(nil)).Elem() -} - -type HostDateTimeSystem struct { - Self types.ManagedObjectReference - - DateTimeInfo types.HostDateTimeInfo `mo:"dateTimeInfo"` -} - -func (m HostDateTimeSystem) Reference() types.ManagedObjectReference { - return m.Self -} - -func init() { - t["HostDateTimeSystem"] = reflect.TypeOf((*HostDateTimeSystem)(nil)).Elem() -} - -type HostDiagnosticSystem struct { - Self types.ManagedObjectReference - - ActivePartition *types.HostDiagnosticPartition `mo:"activePartition"` -} - -func (m HostDiagnosticSystem) Reference() types.ManagedObjectReference { - return m.Self -} - -func init() { - t["HostDiagnosticSystem"] = reflect.TypeOf((*HostDiagnosticSystem)(nil)).Elem() -} - -type HostDirectoryStore struct { - HostAuthenticationStore -} - -func init() { - t["HostDirectoryStore"] = reflect.TypeOf((*HostDirectoryStore)(nil)).Elem() -} - -type HostEsxAgentHostManager struct { - Self types.ManagedObjectReference - - ConfigInfo types.HostEsxAgentHostManagerConfigInfo `mo:"configInfo"` -} - -func (m HostEsxAgentHostManager) Reference() types.ManagedObjectReference { - return m.Self -} - -func init() { - t["HostEsxAgentHostManager"] = reflect.TypeOf((*HostEsxAgentHostManager)(nil)).Elem() -} - -type HostFirewallSystem struct { - ExtensibleManagedObject - - FirewallInfo *types.HostFirewallInfo `mo:"firewallInfo"` -} - -func init() { - t["HostFirewallSystem"] = reflect.TypeOf((*HostFirewallSystem)(nil)).Elem() -} - -type HostFirmwareSystem struct { - Self types.ManagedObjectReference -} - -func (m HostFirmwareSystem) Reference() types.ManagedObjectReference { - return m.Self -} - -func init() { - t["HostFirmwareSystem"] = reflect.TypeOf((*HostFirmwareSystem)(nil)).Elem() -} - -type HostGraphicsManager struct { - ExtensibleManagedObject - - GraphicsInfo []types.HostGraphicsInfo `mo:"graphicsInfo"` -} - -func init() { - t["HostGraphicsManager"] = reflect.TypeOf((*HostGraphicsManager)(nil)).Elem() -} - -type HostHealthStatusSystem struct { - Self types.ManagedObjectReference - - Runtime types.HealthSystemRuntime `mo:"runtime"` -} - -func (m HostHealthStatusSystem) Reference() types.ManagedObjectReference { - return m.Self -} - -func init() { - t["HostHealthStatusSystem"] = reflect.TypeOf((*HostHealthStatusSystem)(nil)).Elem() -} - -type HostImageConfigManager struct { - Self types.ManagedObjectReference -} - -func (m HostImageConfigManager) Reference() types.ManagedObjectReference { - return m.Self -} - -func init() { - t["HostImageConfigManager"] = reflect.TypeOf((*HostImageConfigManager)(nil)).Elem() -} - -type HostKernelModuleSystem struct { - Self types.ManagedObjectReference -} - -func (m HostKernelModuleSystem) Reference() types.ManagedObjectReference { - return m.Self -} - -func init() { - t["HostKernelModuleSystem"] = reflect.TypeOf((*HostKernelModuleSystem)(nil)).Elem() -} - -type HostLocalAccountManager struct { - Self types.ManagedObjectReference -} - -func (m HostLocalAccountManager) Reference() types.ManagedObjectReference { - return m.Self -} - -func init() { - t["HostLocalAccountManager"] = reflect.TypeOf((*HostLocalAccountManager)(nil)).Elem() -} - -type HostLocalAuthentication struct { - HostAuthenticationStore -} - -func init() { - t["HostLocalAuthentication"] = reflect.TypeOf((*HostLocalAuthentication)(nil)).Elem() -} - -type HostMemorySystem struct { - ExtensibleManagedObject - - ConsoleReservationInfo *types.ServiceConsoleReservationInfo `mo:"consoleReservationInfo"` - VirtualMachineReservationInfo *types.VirtualMachineMemoryReservationInfo `mo:"virtualMachineReservationInfo"` -} - -func init() { - t["HostMemorySystem"] = reflect.TypeOf((*HostMemorySystem)(nil)).Elem() -} - -type HostNetworkSystem struct { - ExtensibleManagedObject - - Capabilities *types.HostNetCapabilities `mo:"capabilities"` - NetworkInfo *types.HostNetworkInfo `mo:"networkInfo"` - OffloadCapabilities *types.HostNetOffloadCapabilities `mo:"offloadCapabilities"` - NetworkConfig *types.HostNetworkConfig `mo:"networkConfig"` - DnsConfig types.BaseHostDnsConfig `mo:"dnsConfig"` - IpRouteConfig types.BaseHostIpRouteConfig `mo:"ipRouteConfig"` - ConsoleIpRouteConfig types.BaseHostIpRouteConfig `mo:"consoleIpRouteConfig"` -} - -func init() { - t["HostNetworkSystem"] = reflect.TypeOf((*HostNetworkSystem)(nil)).Elem() -} - -type HostPatchManager struct { - Self types.ManagedObjectReference -} - -func (m HostPatchManager) Reference() types.ManagedObjectReference { - return m.Self -} - -func init() { - t["HostPatchManager"] = reflect.TypeOf((*HostPatchManager)(nil)).Elem() -} - -type HostPciPassthruSystem struct { - ExtensibleManagedObject - - PciPassthruInfo []types.BaseHostPciPassthruInfo `mo:"pciPassthruInfo"` -} - -func init() { - t["HostPciPassthruSystem"] = reflect.TypeOf((*HostPciPassthruSystem)(nil)).Elem() -} - -type HostPowerSystem struct { - Self types.ManagedObjectReference - - Capability types.PowerSystemCapability `mo:"capability"` - Info types.PowerSystemInfo `mo:"info"` -} - -func (m HostPowerSystem) Reference() types.ManagedObjectReference { - return m.Self -} - -func init() { - t["HostPowerSystem"] = reflect.TypeOf((*HostPowerSystem)(nil)).Elem() -} - -type HostProfile struct { - Profile - - ReferenceHost *types.ManagedObjectReference `mo:"referenceHost"` -} - -func init() { - t["HostProfile"] = reflect.TypeOf((*HostProfile)(nil)).Elem() -} - -type HostProfileManager struct { - ProfileManager -} - -func init() { - t["HostProfileManager"] = reflect.TypeOf((*HostProfileManager)(nil)).Elem() -} - -type HostServiceSystem struct { - ExtensibleManagedObject - - ServiceInfo types.HostServiceInfo `mo:"serviceInfo"` -} - -func init() { - t["HostServiceSystem"] = reflect.TypeOf((*HostServiceSystem)(nil)).Elem() -} - -type HostSnmpSystem struct { - Self types.ManagedObjectReference - - Configuration types.HostSnmpConfigSpec `mo:"configuration"` - Limits types.HostSnmpSystemAgentLimits `mo:"limits"` -} - -func (m HostSnmpSystem) Reference() types.ManagedObjectReference { - return m.Self -} - -func init() { - t["HostSnmpSystem"] = reflect.TypeOf((*HostSnmpSystem)(nil)).Elem() -} - -type HostStorageSystem struct { - ExtensibleManagedObject - - StorageDeviceInfo *types.HostStorageDeviceInfo `mo:"storageDeviceInfo"` - FileSystemVolumeInfo types.HostFileSystemVolumeInfo `mo:"fileSystemVolumeInfo"` - SystemFile []string `mo:"systemFile"` - MultipathStateInfo *types.HostMultipathStateInfo `mo:"multipathStateInfo"` -} - -func init() { - t["HostStorageSystem"] = reflect.TypeOf((*HostStorageSystem)(nil)).Elem() -} - -type HostSystem struct { - ManagedEntity - - Runtime types.HostRuntimeInfo `mo:"runtime"` - Summary types.HostListSummary `mo:"summary"` - Hardware *types.HostHardwareInfo `mo:"hardware"` - Capability *types.HostCapability `mo:"capability"` - LicensableResource types.HostLicensableResourceInfo `mo:"licensableResource"` - ConfigManager types.HostConfigManager `mo:"configManager"` - Config *types.HostConfigInfo `mo:"config"` - Vm []types.ManagedObjectReference `mo:"vm"` - Datastore []types.ManagedObjectReference `mo:"datastore"` - Network []types.ManagedObjectReference `mo:"network"` - DatastoreBrowser types.ManagedObjectReference `mo:"datastoreBrowser"` - SystemResources *types.HostSystemResourceInfo `mo:"systemResources"` -} - -func init() { - t["HostSystem"] = reflect.TypeOf((*HostSystem)(nil)).Elem() -} - -type HostVFlashManager struct { - Self types.ManagedObjectReference - - VFlashConfigInfo *types.HostVFlashManagerVFlashConfigInfo `mo:"vFlashConfigInfo"` -} - -func (m HostVFlashManager) Reference() types.ManagedObjectReference { - return m.Self -} - -func init() { - t["HostVFlashManager"] = reflect.TypeOf((*HostVFlashManager)(nil)).Elem() -} - -type HostVMotionSystem struct { - ExtensibleManagedObject - - NetConfig *types.HostVMotionNetConfig `mo:"netConfig"` - IpConfig *types.HostIpConfig `mo:"ipConfig"` -} - -func init() { - t["HostVMotionSystem"] = reflect.TypeOf((*HostVMotionSystem)(nil)).Elem() -} - -type HostVirtualNicManager struct { - ExtensibleManagedObject - - Info types.HostVirtualNicManagerInfo `mo:"info"` -} - -func init() { - t["HostVirtualNicManager"] = reflect.TypeOf((*HostVirtualNicManager)(nil)).Elem() -} - -type HostVsanInternalSystem struct { - Self types.ManagedObjectReference -} - -func (m HostVsanInternalSystem) Reference() types.ManagedObjectReference { - return m.Self -} - -func init() { - t["HostVsanInternalSystem"] = reflect.TypeOf((*HostVsanInternalSystem)(nil)).Elem() -} - -type HostVsanSystem struct { - Self types.ManagedObjectReference - - Config types.VsanHostConfigInfo `mo:"config"` -} - -func (m HostVsanSystem) Reference() types.ManagedObjectReference { - return m.Self -} - -func init() { - t["HostVsanSystem"] = reflect.TypeOf((*HostVsanSystem)(nil)).Elem() -} - -type HttpNfcLease struct { - Self types.ManagedObjectReference - - InitializeProgress int `mo:"initializeProgress"` - Info *types.HttpNfcLeaseInfo `mo:"info"` - State types.HttpNfcLeaseState `mo:"state"` - Error *types.LocalizedMethodFault `mo:"error"` -} - -func (m HttpNfcLease) Reference() types.ManagedObjectReference { - return m.Self -} - -func init() { - t["HttpNfcLease"] = reflect.TypeOf((*HttpNfcLease)(nil)).Elem() -} - -type InternalDynamicTypeManager struct { - Self types.ManagedObjectReference -} - -func (m InternalDynamicTypeManager) Reference() types.ManagedObjectReference { - return m.Self -} - -func init() { - t["InternalDynamicTypeManager"] = reflect.TypeOf((*InternalDynamicTypeManager)(nil)).Elem() -} - -type InventoryView struct { - ManagedObjectView -} - -func init() { - t["InventoryView"] = reflect.TypeOf((*InventoryView)(nil)).Elem() -} - -type IpPoolManager struct { - Self types.ManagedObjectReference -} - -func (m IpPoolManager) Reference() types.ManagedObjectReference { - return m.Self -} - -func init() { - t["IpPoolManager"] = reflect.TypeOf((*IpPoolManager)(nil)).Elem() -} - -type IscsiManager struct { - Self types.ManagedObjectReference -} - -func (m IscsiManager) Reference() types.ManagedObjectReference { - return m.Self -} - -func init() { - t["IscsiManager"] = reflect.TypeOf((*IscsiManager)(nil)).Elem() -} - -type LicenseAssignmentManager struct { - Self types.ManagedObjectReference -} - -func (m LicenseAssignmentManager) Reference() types.ManagedObjectReference { - return m.Self -} - -func init() { - t["LicenseAssignmentManager"] = reflect.TypeOf((*LicenseAssignmentManager)(nil)).Elem() -} - -type LicenseManager struct { - Self types.ManagedObjectReference - - Source types.BaseLicenseSource `mo:"source"` - SourceAvailable bool `mo:"sourceAvailable"` - Diagnostics *types.LicenseDiagnostics `mo:"diagnostics"` - FeatureInfo []types.LicenseFeatureInfo `mo:"featureInfo"` - LicensedEdition string `mo:"licensedEdition"` - Licenses []types.LicenseManagerLicenseInfo `mo:"licenses"` - LicenseAssignmentManager *types.ManagedObjectReference `mo:"licenseAssignmentManager"` - Evaluation types.LicenseManagerEvaluationInfo `mo:"evaluation"` -} - -func (m LicenseManager) Reference() types.ManagedObjectReference { - return m.Self -} - -func init() { - t["LicenseManager"] = reflect.TypeOf((*LicenseManager)(nil)).Elem() -} - -type ListView struct { - ManagedObjectView -} - -func init() { - t["ListView"] = reflect.TypeOf((*ListView)(nil)).Elem() -} - -type LocalizationManager struct { - Self types.ManagedObjectReference - - Catalog []types.LocalizationManagerMessageCatalog `mo:"catalog"` -} - -func (m LocalizationManager) Reference() types.ManagedObjectReference { - return m.Self -} - -func init() { - t["LocalizationManager"] = reflect.TypeOf((*LocalizationManager)(nil)).Elem() -} - -type ManagedEntity struct { - ExtensibleManagedObject - - Parent *types.ManagedObjectReference `mo:"parent"` - CustomValue []types.BaseCustomFieldValue `mo:"customValue"` - OverallStatus types.ManagedEntityStatus `mo:"overallStatus"` - ConfigStatus types.ManagedEntityStatus `mo:"configStatus"` - ConfigIssue []types.BaseEvent `mo:"configIssue"` - EffectiveRole []int `mo:"effectiveRole"` - Permission []types.Permission `mo:"permission"` - Name string `mo:"name"` - DisabledMethod []string `mo:"disabledMethod"` - RecentTask []types.ManagedObjectReference `mo:"recentTask"` - DeclaredAlarmState []types.AlarmState `mo:"declaredAlarmState"` - TriggeredAlarmState []types.AlarmState `mo:"triggeredAlarmState"` - AlarmActionsEnabled *bool `mo:"alarmActionsEnabled"` - Tag []types.Tag `mo:"tag"` -} - -func init() { - t["ManagedEntity"] = reflect.TypeOf((*ManagedEntity)(nil)).Elem() -} - -type ManagedObjectView struct { - Self types.ManagedObjectReference - - View []types.ManagedObjectReference `mo:"view"` -} - -func (m ManagedObjectView) Reference() types.ManagedObjectReference { - return m.Self -} - -func init() { - t["ManagedObjectView"] = reflect.TypeOf((*ManagedObjectView)(nil)).Elem() -} - -type Network struct { - ManagedEntity - - Name string `mo:"name"` - Summary types.BaseNetworkSummary `mo:"summary"` - Host []types.ManagedObjectReference `mo:"host"` - Vm []types.ManagedObjectReference `mo:"vm"` -} - -func init() { - t["Network"] = reflect.TypeOf((*Network)(nil)).Elem() -} - -type OpaqueNetwork struct { - Network -} - -func init() { - t["OpaqueNetwork"] = reflect.TypeOf((*OpaqueNetwork)(nil)).Elem() -} - -type OptionManager struct { - Self types.ManagedObjectReference - - SupportedOption []types.OptionDef `mo:"supportedOption"` - Setting []types.BaseOptionValue `mo:"setting"` -} - -func (m OptionManager) Reference() types.ManagedObjectReference { - return m.Self -} - -func init() { - t["OptionManager"] = reflect.TypeOf((*OptionManager)(nil)).Elem() -} - -type OvfManager struct { - Self types.ManagedObjectReference - - OvfImportOption []types.OvfOptionInfo `mo:"ovfImportOption"` - OvfExportOption []types.OvfOptionInfo `mo:"ovfExportOption"` -} - -func (m OvfManager) Reference() types.ManagedObjectReference { - return m.Self -} - -func init() { - t["OvfManager"] = reflect.TypeOf((*OvfManager)(nil)).Elem() -} - -type PerformanceManager struct { - Self types.ManagedObjectReference - - Description types.PerformanceDescription `mo:"description"` - HistoricalInterval []types.PerfInterval `mo:"historicalInterval"` - PerfCounter []types.PerfCounterInfo `mo:"perfCounter"` -} - -func (m PerformanceManager) Reference() types.ManagedObjectReference { - return m.Self -} - -func init() { - t["PerformanceManager"] = reflect.TypeOf((*PerformanceManager)(nil)).Elem() -} - -type Profile struct { - Self types.ManagedObjectReference - - Config types.BaseProfileConfigInfo `mo:"config"` - Description *types.ProfileDescription `mo:"description"` - Name string `mo:"name"` - CreatedTime time.Time `mo:"createdTime"` - ModifiedTime time.Time `mo:"modifiedTime"` - Entity []types.ManagedObjectReference `mo:"entity"` - ComplianceStatus string `mo:"complianceStatus"` -} - -func (m Profile) Reference() types.ManagedObjectReference { - return m.Self -} - -func init() { - t["Profile"] = reflect.TypeOf((*Profile)(nil)).Elem() -} - -type ProfileComplianceManager struct { - Self types.ManagedObjectReference -} - -func (m ProfileComplianceManager) Reference() types.ManagedObjectReference { - return m.Self -} - -func init() { - t["ProfileComplianceManager"] = reflect.TypeOf((*ProfileComplianceManager)(nil)).Elem() -} - -type ProfileManager struct { - Self types.ManagedObjectReference - - Profile []types.ManagedObjectReference `mo:"profile"` -} - -func (m ProfileManager) Reference() types.ManagedObjectReference { - return m.Self -} - -func init() { - t["ProfileManager"] = reflect.TypeOf((*ProfileManager)(nil)).Elem() -} - -type PropertyCollector struct { - Self types.ManagedObjectReference - - Filter []types.ManagedObjectReference `mo:"filter"` -} - -func (m PropertyCollector) Reference() types.ManagedObjectReference { - return m.Self -} - -func init() { - t["PropertyCollector"] = reflect.TypeOf((*PropertyCollector)(nil)).Elem() -} - -type PropertyFilter struct { - Self types.ManagedObjectReference - - Spec types.PropertyFilterSpec `mo:"spec"` - PartialUpdates bool `mo:"partialUpdates"` -} - -func (m PropertyFilter) Reference() types.ManagedObjectReference { - return m.Self -} - -func init() { - t["PropertyFilter"] = reflect.TypeOf((*PropertyFilter)(nil)).Elem() -} - -type ReflectManagedMethodExecuter struct { - Self types.ManagedObjectReference -} - -func (m ReflectManagedMethodExecuter) Reference() types.ManagedObjectReference { - return m.Self -} - -func init() { - t["ReflectManagedMethodExecuter"] = reflect.TypeOf((*ReflectManagedMethodExecuter)(nil)).Elem() -} - -type ResourcePlanningManager struct { - Self types.ManagedObjectReference -} - -func (m ResourcePlanningManager) Reference() types.ManagedObjectReference { - return m.Self -} - -func init() { - t["ResourcePlanningManager"] = reflect.TypeOf((*ResourcePlanningManager)(nil)).Elem() -} - -type ResourcePool struct { - ManagedEntity - - Summary types.BaseResourcePoolSummary `mo:"summary"` - Runtime types.ResourcePoolRuntimeInfo `mo:"runtime"` - Owner types.ManagedObjectReference `mo:"owner"` - ResourcePool []types.ManagedObjectReference `mo:"resourcePool"` - Vm []types.ManagedObjectReference `mo:"vm"` - Config types.ResourceConfigSpec `mo:"config"` - ChildConfiguration []types.ResourceConfigSpec `mo:"childConfiguration"` -} - -func init() { - t["ResourcePool"] = reflect.TypeOf((*ResourcePool)(nil)).Elem() -} - -type ScheduledTask struct { - ExtensibleManagedObject - - Info types.ScheduledTaskInfo `mo:"info"` -} - -func init() { - t["ScheduledTask"] = reflect.TypeOf((*ScheduledTask)(nil)).Elem() -} - -type ScheduledTaskManager struct { - Self types.ManagedObjectReference - - ScheduledTask []types.ManagedObjectReference `mo:"scheduledTask"` - Description types.ScheduledTaskDescription `mo:"description"` -} - -func (m ScheduledTaskManager) Reference() types.ManagedObjectReference { - return m.Self -} - -func init() { - t["ScheduledTaskManager"] = reflect.TypeOf((*ScheduledTaskManager)(nil)).Elem() -} - -type SearchIndex struct { - Self types.ManagedObjectReference -} - -func (m SearchIndex) Reference() types.ManagedObjectReference { - return m.Self -} - -func init() { - t["SearchIndex"] = reflect.TypeOf((*SearchIndex)(nil)).Elem() -} - -type ServiceInstance struct { - Self types.ManagedObjectReference - - ServerClock time.Time `mo:"serverClock"` - Capability types.Capability `mo:"capability"` - Content types.ServiceContent `mo:"content"` -} - -func (m ServiceInstance) Reference() types.ManagedObjectReference { - return m.Self -} - -func init() { - t["ServiceInstance"] = reflect.TypeOf((*ServiceInstance)(nil)).Elem() -} - -type ServiceManager struct { - Self types.ManagedObjectReference - - Service []types.ServiceManagerServiceInfo `mo:"service"` -} - -func (m ServiceManager) Reference() types.ManagedObjectReference { - return m.Self -} - -func init() { - t["ServiceManager"] = reflect.TypeOf((*ServiceManager)(nil)).Elem() -} - -type SessionManager struct { - Self types.ManagedObjectReference - - SessionList []types.UserSession `mo:"sessionList"` - CurrentSession *types.UserSession `mo:"currentSession"` - Message *string `mo:"message"` - MessageLocaleList []string `mo:"messageLocaleList"` - SupportedLocaleList []string `mo:"supportedLocaleList"` - DefaultLocale string `mo:"defaultLocale"` -} - -func (m SessionManager) Reference() types.ManagedObjectReference { - return m.Self -} - -func init() { - t["SessionManager"] = reflect.TypeOf((*SessionManager)(nil)).Elem() -} - -type SimpleCommand struct { - Self types.ManagedObjectReference - - EncodingType types.SimpleCommandEncoding `mo:"encodingType"` - Entity types.ServiceManagerServiceInfo `mo:"entity"` -} - -func (m SimpleCommand) Reference() types.ManagedObjectReference { - return m.Self -} - -func init() { - t["SimpleCommand"] = reflect.TypeOf((*SimpleCommand)(nil)).Elem() -} - -type StoragePod struct { - Folder - - Summary *types.StoragePodSummary `mo:"summary"` - PodStorageDrsEntry *types.PodStorageDrsEntry `mo:"podStorageDrsEntry"` -} - -func init() { - t["StoragePod"] = reflect.TypeOf((*StoragePod)(nil)).Elem() -} - -type StorageResourceManager struct { - Self types.ManagedObjectReference -} - -func (m StorageResourceManager) Reference() types.ManagedObjectReference { - return m.Self -} - -func init() { - t["StorageResourceManager"] = reflect.TypeOf((*StorageResourceManager)(nil)).Elem() -} - -type Task struct { - ExtensibleManagedObject - - Info types.TaskInfo `mo:"info"` -} - -func init() { - t["Task"] = reflect.TypeOf((*Task)(nil)).Elem() -} - -type TaskHistoryCollector struct { - HistoryCollector - - LatestPage []types.TaskInfo `mo:"latestPage"` -} - -func init() { - t["TaskHistoryCollector"] = reflect.TypeOf((*TaskHistoryCollector)(nil)).Elem() -} - -type TaskManager struct { - Self types.ManagedObjectReference - - RecentTask []types.ManagedObjectReference `mo:"recentTask"` - Description types.TaskDescription `mo:"description"` - MaxCollector int `mo:"maxCollector"` -} - -func (m TaskManager) Reference() types.ManagedObjectReference { - return m.Self -} - -func init() { - t["TaskManager"] = reflect.TypeOf((*TaskManager)(nil)).Elem() -} - -type UserDirectory struct { - Self types.ManagedObjectReference - - DomainList []string `mo:"domainList"` -} - -func (m UserDirectory) Reference() types.ManagedObjectReference { - return m.Self -} - -func init() { - t["UserDirectory"] = reflect.TypeOf((*UserDirectory)(nil)).Elem() -} - -type View struct { - Self types.ManagedObjectReference -} - -func (m View) Reference() types.ManagedObjectReference { - return m.Self -} - -func init() { - t["View"] = reflect.TypeOf((*View)(nil)).Elem() -} - -type ViewManager struct { - Self types.ManagedObjectReference - - ViewList []types.ManagedObjectReference `mo:"viewList"` -} - -func (m ViewManager) Reference() types.ManagedObjectReference { - return m.Self -} - -func init() { - t["ViewManager"] = reflect.TypeOf((*ViewManager)(nil)).Elem() -} - -type VirtualApp struct { - ResourcePool - - ParentFolder *types.ManagedObjectReference `mo:"parentFolder"` - Datastore []types.ManagedObjectReference `mo:"datastore"` - Network []types.ManagedObjectReference `mo:"network"` - VAppConfig *types.VAppConfigInfo `mo:"vAppConfig"` - ParentVApp *types.ManagedObjectReference `mo:"parentVApp"` - ChildLink []types.VirtualAppLinkInfo `mo:"childLink"` -} - -func init() { - t["VirtualApp"] = reflect.TypeOf((*VirtualApp)(nil)).Elem() -} - -type VirtualDiskManager struct { - Self types.ManagedObjectReference -} - -func (m VirtualDiskManager) Reference() types.ManagedObjectReference { - return m.Self -} - -func init() { - t["VirtualDiskManager"] = reflect.TypeOf((*VirtualDiskManager)(nil)).Elem() -} - -type VirtualMachine struct { - ManagedEntity - - Capability types.VirtualMachineCapability `mo:"capability"` - Config *types.VirtualMachineConfigInfo `mo:"config"` - Layout *types.VirtualMachineFileLayout `mo:"layout"` - LayoutEx *types.VirtualMachineFileLayoutEx `mo:"layoutEx"` - Storage *types.VirtualMachineStorageInfo `mo:"storage"` - EnvironmentBrowser types.ManagedObjectReference `mo:"environmentBrowser"` - ResourcePool *types.ManagedObjectReference `mo:"resourcePool"` - ParentVApp *types.ManagedObjectReference `mo:"parentVApp"` - ResourceConfig *types.ResourceConfigSpec `mo:"resourceConfig"` - Runtime types.VirtualMachineRuntimeInfo `mo:"runtime"` - Guest *types.GuestInfo `mo:"guest"` - Summary types.VirtualMachineSummary `mo:"summary"` - Datastore []types.ManagedObjectReference `mo:"datastore"` - Network []types.ManagedObjectReference `mo:"network"` - Snapshot *types.VirtualMachineSnapshotInfo `mo:"snapshot"` - RootSnapshot []types.ManagedObjectReference `mo:"rootSnapshot"` - GuestHeartbeatStatus types.ManagedEntityStatus `mo:"guestHeartbeatStatus"` -} - -func init() { - t["VirtualMachine"] = reflect.TypeOf((*VirtualMachine)(nil)).Elem() -} - -type VirtualMachineCompatibilityChecker struct { - Self types.ManagedObjectReference -} - -func (m VirtualMachineCompatibilityChecker) Reference() types.ManagedObjectReference { - return m.Self -} - -func init() { - t["VirtualMachineCompatibilityChecker"] = reflect.TypeOf((*VirtualMachineCompatibilityChecker)(nil)).Elem() -} - -type VirtualMachineProvisioningChecker struct { - Self types.ManagedObjectReference -} - -func (m VirtualMachineProvisioningChecker) Reference() types.ManagedObjectReference { - return m.Self -} - -func init() { - t["VirtualMachineProvisioningChecker"] = reflect.TypeOf((*VirtualMachineProvisioningChecker)(nil)).Elem() -} - -type VirtualMachineSnapshot struct { - ExtensibleManagedObject - - Config types.VirtualMachineConfigInfo `mo:"config"` - ChildSnapshot []types.ManagedObjectReference `mo:"childSnapshot"` -} - -func init() { - t["VirtualMachineSnapshot"] = reflect.TypeOf((*VirtualMachineSnapshot)(nil)).Elem() -} - -type VirtualizationManager struct { - Self types.ManagedObjectReference -} - -func (m VirtualizationManager) Reference() types.ManagedObjectReference { - return m.Self -} - -func init() { - t["VirtualizationManager"] = reflect.TypeOf((*VirtualizationManager)(nil)).Elem() -} - -type VmwareDistributedVirtualSwitch struct { - DistributedVirtualSwitch -} - -func init() { - t["VmwareDistributedVirtualSwitch"] = reflect.TypeOf((*VmwareDistributedVirtualSwitch)(nil)).Elem() -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/vim25/mo/reference.go juju-core-2.0.2/src/github.com/juju/govmomi/vim25/mo/reference.go --- juju-core-2.0.0/src/github.com/juju/govmomi/vim25/mo/reference.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/vim25/mo/reference.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,26 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package mo - -import "github.com/juju/govmomi/vim25/types" - -// Reference is the interface that is implemented by all the managed objects -// defined in this package. It specifies that these managed objects have a -// function that returns the managed object reference to themselves. -type Reference interface { - Reference() types.ManagedObjectReference -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/vim25/mo/registry.go juju-core-2.0.2/src/github.com/juju/govmomi/vim25/mo/registry.go --- juju-core-2.0.0/src/github.com/juju/govmomi/vim25/mo/registry.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/vim25/mo/registry.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,21 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package mo - -import "reflect" - -var t = map[string]reflect.Type{} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/vim25/mo/retrieve.go juju-core-2.0.2/src/github.com/juju/govmomi/vim25/mo/retrieve.go --- juju-core-2.0.0/src/github.com/juju/govmomi/vim25/mo/retrieve.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/vim25/mo/retrieve.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,132 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package mo - -import ( - "reflect" - - "github.com/juju/govmomi/vim25/methods" - "github.com/juju/govmomi/vim25/soap" - "github.com/juju/govmomi/vim25/types" - "golang.org/x/net/context" -) - -// objectContentToType loads an ObjectContent value into the value it -// represents. If the ObjectContent value has a non-empty 'MissingSet' field, -// it returns the first fault it finds there as error. If the 'MissingSet' -// field is empty, it returns a pointer to a reflect.Value. It handles contain -// nested properties, such as 'guest.ipAddress' or 'config.hardware'. -func objectContentToType(o types.ObjectContent) (*reflect.Value, error) { - // Expect no properties in the missing set - for _, p := range o.MissingSet { - return nil, soap.WrapVimFault(p.Fault.Fault) - } - - ti := typeInfoForType(o.Obj.Type) - v, err := ti.LoadFromObjectContent(o) - if err != nil { - return nil, err - } - - return &v, nil -} - -// LoadRetrievePropertiesResponse converts the response of a call to -// RetrieveProperties to one or more managed objects. -func LoadRetrievePropertiesResponse(res *types.RetrievePropertiesResponse, dst interface{}) error { - rt := reflect.TypeOf(dst) - if rt == nil || rt.Kind() != reflect.Ptr { - panic("need pointer") - } - - rv := reflect.ValueOf(dst).Elem() - if !rv.CanSet() { - panic("cannot set dst") - } - - isSlice := false - switch rt.Elem().Kind() { - case reflect.Struct: - case reflect.Slice: - isSlice = true - default: - panic("unexpected type") - } - - if isSlice { - for _, p := range res.Returnval { - v, err := objectContentToType(p) - if err != nil { - return err - } - rv.Set(reflect.Append(rv, v.Elem())) - } - } else { - switch len(res.Returnval) { - case 0: - case 1: - v, err := objectContentToType(res.Returnval[0]) - if err != nil { - return err - } - rv.Set(v.Elem()) - default: - // If dst is not a slice, expect to receive 0 or 1 results - panic("more than 1 result") - } - } - - return nil -} - -// RetrievePropertiesForRequest calls the RetrieveProperties method with the -// specified request and decodes the response struct into the value pointed to -// by dst. -func RetrievePropertiesForRequest(ctx context.Context, r soap.RoundTripper, req types.RetrieveProperties, dst interface{}) error { - res, err := methods.RetrieveProperties(ctx, r, &req) - if err != nil { - return err - } - - return LoadRetrievePropertiesResponse(res, dst) -} - -// RetrieveProperties retrieves the properties of the managed object specified -// as obj and decodes the response struct into the value pointed to by dst. -func RetrieveProperties(ctx context.Context, r soap.RoundTripper, pc, obj types.ManagedObjectReference, dst interface{}) error { - req := types.RetrieveProperties{ - This: pc, - SpecSet: []types.PropertyFilterSpec{ - { - ObjectSet: []types.ObjectSpec{ - { - Obj: obj, - Skip: types.NewBool(false), - }, - }, - PropSet: []types.PropertySpec{ - { - All: types.NewBool(true), - Type: obj.Type, - }, - }, - }, - }, - } - - return RetrievePropertiesForRequest(ctx, r, req, dst) -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/vim25/mo/retrieve_test.go juju-core-2.0.2/src/github.com/juju/govmomi/vim25/mo/retrieve_test.go --- juju-core-2.0.0/src/github.com/juju/govmomi/vim25/mo/retrieve_test.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/vim25/mo/retrieve_test.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,106 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package mo - -import ( - "os" - "testing" - - "github.com/juju/govmomi/vim25/soap" - "github.com/juju/govmomi/vim25/types" - "github.com/juju/govmomi/vim25/xml" -) - -func load(name string) *types.RetrievePropertiesResponse { - f, err := os.Open(name) - if err != nil { - panic(err) - } - - defer f.Close() - - var b types.RetrievePropertiesResponse - - dec := xml.NewDecoder(f) - dec.TypeFunc = types.TypeFunc() - if err := dec.Decode(&b); err != nil { - panic(err) - } - - return &b -} - -func TestNotAuthenticatedFault(t *testing.T) { - var s SessionManager - - err := LoadRetrievePropertiesResponse(load("fixtures/not_authenticated_fault.xml"), &s) - if !soap.IsVimFault(err) { - t.Errorf("Expected IsVimFault") - } - - fault := soap.ToVimFault(err).(*types.NotAuthenticated) - if fault.PrivilegeId != "System.View" { - t.Errorf("Expected first fault to be returned") - } -} - -func TestNestedProperty(t *testing.T) { - var vm VirtualMachine - - err := LoadRetrievePropertiesResponse(load("fixtures/nested_property.xml"), &vm) - if err != nil { - t.Fatalf("Expected no error, got: %s", err) - } - - self := types.ManagedObjectReference{ - Type: "VirtualMachine", - Value: "vm-411", - } - - if vm.Self != self { - t.Fatalf("Expected vm.Self to be set") - } - - if vm.Config == nil { - t.Fatalf("Expected vm.Config to be set") - } - - if vm.Config.Name != "kubernetes-master" { - t.Errorf("Got: %s", vm.Config.Name) - } - - if vm.Config.Uuid != "422ec880-ab06-06b4-23f3-beb7a052a4c9" { - t.Errorf("Got: %s", vm.Config.Uuid) - } -} - -func TestPointerProperty(t *testing.T) { - var vm VirtualMachine - - err := LoadRetrievePropertiesResponse(load("fixtures/pointer_property.xml"), &vm) - if err != nil { - t.Fatalf("Expected no error, got: %s", err) - } - - if vm.Config == nil { - t.Fatalf("Expected vm.Config to be set") - } - - if vm.Config.BootOptions == nil { - t.Fatalf("Expected vm.Config.BootOptions to be set") - } -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/vim25/mo/type_info.go juju-core-2.0.2/src/github.com/juju/govmomi/vim25/mo/type_info.go --- juju-core-2.0.0/src/github.com/juju/govmomi/vim25/mo/type_info.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/vim25/mo/type_info.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,239 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package mo - -import ( - "fmt" - "reflect" - "regexp" - "strings" - "sync" - - "github.com/juju/govmomi/vim25/types" -) - -type typeInfo struct { - typ reflect.Type - - // Field indices of "Self" field. - self []int - - // Map property names to field indices. - props map[string][]int -} - -var typeInfoLock sync.RWMutex -var typeInfoMap = make(map[string]*typeInfo) - -func typeInfoForType(tname string) *typeInfo { - typeInfoLock.RLock() - ti, ok := typeInfoMap[tname] - typeInfoLock.RUnlock() - - if ok { - return ti - } - - // Create new typeInfo for type. - if typ, ok := t[tname]; !ok { - panic("unknown type: " + tname) - } else { - // Multiple routines may race to set it, but the result is the same. - typeInfoLock.Lock() - ti = newTypeInfo(typ) - typeInfoMap[tname] = ti - typeInfoLock.Unlock() - } - - return ti -} - -func newTypeInfo(typ reflect.Type) *typeInfo { - t := typeInfo{ - typ: typ, - props: make(map[string][]int), - } - - t.build(typ, "", []int{}) - - return &t -} - -var managedObjectRefType = reflect.TypeOf((*types.ManagedObjectReference)(nil)).Elem() - -func buildName(fn string, f reflect.StructField) string { - if fn != "" { - fn += "." - } - - motag := f.Tag.Get("mo") - if motag != "" { - return fn + motag - } - - xmltag := f.Tag.Get("xml") - if xmltag != "" { - tokens := strings.Split(xmltag, ",") - if tokens[0] != "" { - return fn + tokens[0] - } - } - - return "" -} - -func (t *typeInfo) build(typ reflect.Type, fn string, fi []int) { - if typ.Kind() == reflect.Ptr { - typ = typ.Elem() - } - - if typ.Kind() != reflect.Struct { - panic("need struct") - } - - for i := 0; i < typ.NumField(); i++ { - f := typ.Field(i) - ftyp := f.Type - - // Copy field indices so they can be passed along. - fic := make([]int, len(fi)+1) - copy(fic, fi) - fic[len(fi)] = i - - // Recurse into embedded field. - if f.Anonymous { - t.build(ftyp, fn, fic) - continue - } - - // Top level type has a "Self" field. - if f.Name == "Self" && ftyp == managedObjectRefType { - t.self = fic - continue - } - - fnc := buildName(fn, f) - if fnc == "" { - continue - } - - t.props[fnc] = fic - - // Dereference pointer. - if ftyp.Kind() == reflect.Ptr { - ftyp = ftyp.Elem() - } - - // Slices are not addressable by `foo.bar.qux`. - if ftyp.Kind() == reflect.Slice { - continue - } - - // Skip the managed reference type. - if ftyp == managedObjectRefType { - continue - } - - // Recurse into structs. - if ftyp.Kind() == reflect.Struct { - t.build(ftyp, fnc, fic) - } - } -} - -// assignValue assignes a value 'pv' to the struct pointed to by 'val', given a -// slice of field indices. It recurses into the struct until it finds the field -// specified by the indices. It creates new values for pointer types where -// needed. -func assignValue(val reflect.Value, fi []int, pv reflect.Value) { - // Create new value if necessary. - if val.Kind() == reflect.Ptr { - if val.IsNil() { - val.Set(reflect.New(val.Type().Elem())) - } - - val = val.Elem() - } - - rv := val.Field(fi[0]) - fi = fi[1:] - if len(fi) == 0 { - rt := rv.Type() - pt := pv.Type() - - // If type is a pointer, create new instance of type. - if rt.Kind() == reflect.Ptr { - rv.Set(reflect.New(rt.Elem())) - rv = rv.Elem() - rt = rv.Type() - } - - // If type is an interface, check if pv implements it. - if rt.Kind() == reflect.Interface && !pt.Implements(rt) { - // Check if pointer to pv implements it. - if reflect.PtrTo(pt).Implements(rt) { - npv := reflect.New(pt) - npv.Elem().Set(pv) - pv = npv - } else { - panic(fmt.Sprintf("type %s doesn't implement %s", pt.Name(), rt.Name())) - } - } - - rv.Set(pv) - return - } - - assignValue(rv, fi, pv) -} - -var arrayOfRegexp = regexp.MustCompile("ArrayOf(.*)$") - -func anyTypeToValue(t interface{}) reflect.Value { - rt := reflect.TypeOf(t) - rv := reflect.ValueOf(t) - - // Dereference if ArrayOfXYZ type - m := arrayOfRegexp.FindStringSubmatch(rt.Name()) - if len(m) > 0 { - // ArrayOfXYZ type has single field named XYZ - rv = rv.FieldByName(m[1]) - if !rv.IsValid() { - panic(fmt.Sprintf("expected %s type to have field %s", m[0], m[1])) - } - } - - return rv -} - -// LoadObjectFromContent loads properties from the 'PropSet' field in the -// specified ObjectContent value into the value it represents, which is -// returned as a reflect.Value. -func (t *typeInfo) LoadFromObjectContent(o types.ObjectContent) (reflect.Value, error) { - v := reflect.New(t.typ) - assignValue(v, t.self, reflect.ValueOf(o.Obj)) - - for _, p := range o.PropSet { - rv, ok := t.props[p.Name] - if !ok { - continue - } - assignValue(v, rv, anyTypeToValue(p.Val)) - } - - return v, nil -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/vim25/mo/type_info_test.go juju-core-2.0.2/src/github.com/juju/govmomi/vim25/mo/type_info_test.go --- juju-core-2.0.0/src/github.com/juju/govmomi/vim25/mo/type_info_test.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/vim25/mo/type_info_test.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,37 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package mo - -import ( - "reflect" - "testing" -) - -func TestLoadAll(*testing.T) { - for _, typ := range t { - newTypeInfo(typ) - } -} - -// The virtual machine managed object has about 500 nested properties. -// It's likely to be indicative of the function's performance in general. -func BenchmarkLoadVirtualMachine(b *testing.B) { - vmtyp := reflect.TypeOf((*VirtualMachine)(nil)).Elem() - for i := 0; i < b.N; i++ { - newTypeInfo(vmtyp) - } -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/vim25/progress/aggregator.go juju-core-2.0.2/src/github.com/juju/govmomi/vim25/progress/aggregator.go --- juju-core-2.0.0/src/github.com/juju/govmomi/vim25/progress/aggregator.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/vim25/progress/aggregator.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,73 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package progress - -import "sync" - -type Aggregator struct { - downstream Sinker - upstream chan (<-chan Report) - - done chan struct{} - w sync.WaitGroup -} - -func NewAggregator(s Sinker) *Aggregator { - a := &Aggregator{ - downstream: s, - upstream: make(chan (<-chan Report)), - - done: make(chan struct{}), - } - - a.w.Add(1) - go a.loop() - - return a -} - -func (a *Aggregator) loop() { - defer a.w.Done() - - dch := a.downstream.Sink() - defer close(dch) - - for { - select { - case uch := <-a.upstream: - // Drain upstream channel - for e := range uch { - dch <- e - } - case <-a.done: - return - } - } -} - -func (a *Aggregator) Sink() chan<- Report { - ch := make(chan Report) - a.upstream <- ch - return ch -} - -// Done marks the aggregator as done. No more calls to Sink() may be made and -// the downstream progress report channel will be closed when Done() returns. -func (a *Aggregator) Done() { - close(a.done) - a.w.Wait() -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/vim25/progress/aggregator_test.go juju-core-2.0.2/src/github.com/juju/govmomi/vim25/progress/aggregator_test.go --- juju-core-2.0.0/src/github.com/juju/govmomi/vim25/progress/aggregator_test.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/vim25/progress/aggregator_test.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,81 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package progress - -import ( - "testing" - "time" -) - -func TestAggregatorNoSinks(t *testing.T) { - ch := make(chan Report) - a := NewAggregator(dummySinker{ch}) - a.Done() - - _, ok := <-ch - if ok { - t.Errorf("Expected channel to be closed") - } -} - -func TestAggregatorMultipleSinks(t *testing.T) { - ch := make(chan Report) - a := NewAggregator(dummySinker{ch}) - - for i := 0; i < 5; i++ { - go func(ch chan<- Report) { - ch <- dummyReport{} - ch <- dummyReport{} - close(ch) - }(a.Sink()) - - <-ch - <-ch - } - - a.Done() - - _, ok := <-ch - if ok { - t.Errorf("Expected channel to be closed") - } -} - -func TestAggregatorSinkInFlightOnDone(t *testing.T) { - ch := make(chan Report) - a := NewAggregator(dummySinker{ch}) - - // Simulate upstream - go func(ch chan<- Report) { - time.Sleep(1 * time.Millisecond) - ch <- dummyReport{} - close(ch) - }(a.Sink()) - - // Drain downstream - go func(ch <-chan Report) { - <-ch - }(ch) - - // This should wait for upstream to complete - a.Done() - - _, ok := <-ch - if ok { - t.Errorf("Expected channel to be closed") - } -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/vim25/progress/common_test.go juju-core-2.0.2/src/github.com/juju/govmomi/vim25/progress/common_test.go --- juju-core-2.0.0/src/github.com/juju/govmomi/vim25/progress/common_test.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/vim25/progress/common_test.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,43 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package progress - -type dummySinker struct { - ch chan Report -} - -func (d dummySinker) Sink() chan<- Report { - return d.ch -} - -type dummyReport struct { - p float32 - d string - e error -} - -func (p dummyReport) Percentage() float32 { - return p.p -} - -func (p dummyReport) Detail() string { - return p.d -} - -func (p dummyReport) Error() error { - return p.e -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/vim25/progress/doc.go juju-core-2.0.2/src/github.com/juju/govmomi/vim25/progress/doc.go --- juju-core-2.0.0/src/github.com/juju/govmomi/vim25/progress/doc.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/vim25/progress/doc.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,32 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package progress - -/* -The progress package contains functionality to deal with progress reporting. -The functionality is built to serve progress reporting for infrastructure -operations when talking the vSphere API, but is generic enough to be used -elsewhere. - -At the core of this progress reporting API lies the Sinker interface. This -interface is implemented by any object that can act as a sink for progress -reports. Callers of the Sink() function receives a send-only channel for -progress reports. They are responsible for closing the channel when done. -This semantic makes it easy to keep track of multiple progress report channels; -they are only created when Sink() is called and assumed closed when any -function that receives a Sinker parameter returns. -*/ diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/vim25/progress/prefix.go juju-core-2.0.2/src/github.com/juju/govmomi/vim25/progress/prefix.go --- juju-core-2.0.0/src/github.com/juju/govmomi/vim25/progress/prefix.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/vim25/progress/prefix.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,54 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package progress - -import "fmt" - -type prefixedReport struct { - Report - prefix string -} - -func (r prefixedReport) Detail() string { - if d := r.Report.Detail(); d != "" { - return fmt.Sprintf("%s: %s", r.prefix, d) - } - - return r.prefix -} - -func prefixLoop(upstream <-chan Report, downstream chan<- Report, prefix string) { - defer close(downstream) - - for r := range upstream { - downstream <- prefixedReport{ - Report: r, - prefix: prefix, - } - } -} - -func Prefix(s Sinker, prefix string) Sinker { - fn := func() chan<- Report { - upstream := make(chan Report) - downstream := s.Sink() - go prefixLoop(upstream, downstream, prefix) - return upstream - } - - return SinkFunc(fn) -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/vim25/progress/prefix_test.go juju-core-2.0.2/src/github.com/juju/govmomi/vim25/progress/prefix_test.go --- juju-core-2.0.0/src/github.com/juju/govmomi/vim25/progress/prefix_test.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/vim25/progress/prefix_test.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,40 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package progress - -import "testing" - -func TestPrefix(t *testing.T) { - var r Report - - ch := make(chan Report, 1) - s := Prefix(dummySinker{ch}, "prefix").Sink() - - // No detail - s <- dummyReport{d: ""} - r = <-ch - if r.Detail() != "prefix" { - t.Errorf("Expected detail to be prefixed") - } - - // With detail - s <- dummyReport{d: "something"} - r = <-ch - if r.Detail() != "prefix: something" { - t.Errorf("Expected detail to be prefixed") - } -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/vim25/progress/reader.go juju-core-2.0.2/src/github.com/juju/govmomi/vim25/progress/reader.go --- juju-core-2.0.0/src/github.com/juju/govmomi/vim25/progress/reader.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/vim25/progress/reader.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,176 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package progress - -import ( - "container/list" - "fmt" - "io" - "sync/atomic" - "time" -) - -type readerReport struct { - t time.Time - - pos int64 - size int64 - bps *uint64 - - err error -} - -func (r readerReport) Percentage() float32 { - return 100.0 * float32(r.pos) / float32(r.size) -} - -func (r readerReport) Detail() string { - const ( - KiB = 1024 - MiB = 1024 * KiB - GiB = 1024 * MiB - ) - - // Use the reader's bps field, so this report returns an up-to-date number. - // - // For example: if there hasn't been progress for the last 5 seconds, the - // most recent report should return "0B/s". - // - bps := atomic.LoadUint64(r.bps) - - switch { - case bps >= GiB: - return fmt.Sprintf("%.1fGiB/s", float32(bps)/float32(GiB)) - case bps >= MiB: - return fmt.Sprintf("%.1fMiB/s", float32(bps)/float32(MiB)) - case bps >= KiB: - return fmt.Sprintf("%.1fKiB/s", float32(bps)/float32(KiB)) - default: - return fmt.Sprintf("%dB/s", bps) - } -} - -func (p readerReport) Error() error { - return p.err -} - -// reader wraps an io.Reader and sends a progress report over a channel for -// every read it handles. -type reader struct { - r io.Reader - - pos int64 - size int64 - - bps uint64 - - ch chan<- Report -} - -func NewReader(s Sinker, r io.Reader, size int64) *reader { - pr := reader{ - r: r, - - size: size, - } - - // Reports must be sent downstream and to the bps computation loop. - pr.ch = Tee(s, newBpsLoop(&pr.bps)).Sink() - - return &pr -} - -// Read calls the Read function on the underlying io.Reader. Additionally, -// every read causes a progress report to be sent to the progress reader's -// underlying channel. -func (p *reader) Read(b []byte) (int, error) { - n, err := p.r.Read(b) - if err != nil { - return n, err - } - - p.pos += int64(n) - q := readerReport{ - t: time.Now(), - pos: p.pos, - size: p.size, - bps: &p.bps, - } - - p.ch <- q - - return n, err -} - -// Done marks the progress reader as done, optionally including an error in the -// progress report. After sending it, the underlying channel is closed. -func (r *reader) Done(err error) { - q := readerReport{ - t: time.Now(), - pos: r.pos, - size: r.size, - err: err, - } - - r.ch <- q - close(r.ch) -} - -// newBpsLoop returns a sink that monitors and stores throughput. -func newBpsLoop(dst *uint64) SinkFunc { - fn := func() chan<- Report { - sink := make(chan Report) - go bpsLoop(sink, dst) - return sink - } - - return fn -} - -func bpsLoop(ch <-chan Report, dst *uint64) { - l := list.New() - - for { - var tch <-chan time.Time - - // Setup timer for front of list to become stale. - if e := l.Front(); e != nil { - dt := time.Second - time.Now().Sub(e.Value.(readerReport).t) - tch = time.After(dt) - } - - select { - case q, ok := <-ch: - if !ok { - return - } - - l.PushBack(q) - case <-tch: - l.Remove(l.Front()) - } - - // Compute new bps - if l.Len() == 0 { - atomic.StoreUint64(dst, 0) - } else { - f := l.Front().Value.(readerReport) - b := l.Back().Value.(readerReport) - atomic.StoreUint64(dst, uint64(b.pos-f.pos)) - } - } -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/vim25/progress/reader_test.go juju-core-2.0.2/src/github.com/juju/govmomi/vim25/progress/reader_test.go --- juju-core-2.0.0/src/github.com/juju/govmomi/vim25/progress/reader_test.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/vim25/progress/reader_test.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,90 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package progress - -import ( - "io" - "strings" - "testing" -) - -func TestReader(t *testing.T) { - s := "helloworld" - ch := make(chan Report, 1) - pr := NewReader(&dummySinker{ch}, strings.NewReader(s), int64(len(s))) - - var buf [10]byte - var q Report - var n int - var err error - - // Read first byte - n, err = pr.Read(buf[0:1]) - if n != 1 { - t.Errorf("Expected n=1, but got: %d", n) - } - - if err != nil { - t.Errorf("Error: %s", err) - } - - q = <-ch - if q.Error() != nil { - t.Errorf("Error: %s", err) - } - - if f := q.Percentage(); f != 10.0 { - t.Errorf("Expected percentage after 1 byte to be 10%%, but got: %.0f%%", f) - } - - // Read remaining bytes - n, err = pr.Read(buf[:]) - if n != 9 { - t.Errorf("Expected n=1, but got: %d", n) - } - if err != nil { - t.Errorf("Error: %s", err) - } - - q = <-ch - if q.Error() != nil { - t.Errorf("Error: %s", err) - } - - if f := q.Percentage(); f != 100.0 { - t.Errorf("Expected percentage after 10 bytes to be 100%%, but got: %.0f%%", f) - } - - // Read EOF - _, err = pr.Read(buf[:]) - if err != io.EOF { - t.Errorf("Expected io.EOF, but got: %s", err) - } - - // Mark progress reader as done - pr.Done(io.EOF) - q = <-ch - if err != io.EOF { - t.Errorf("Expected io.EOF, but got: %s", err) - } - - // Progress channel should be closed after progress reader is marked done - _, ok := <-ch - if ok { - t.Errorf("Expected channel to be closed") - } -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/vim25/progress/report.go juju-core-2.0.2/src/github.com/juju/govmomi/vim25/progress/report.go --- juju-core-2.0.0/src/github.com/juju/govmomi/vim25/progress/report.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/vim25/progress/report.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,26 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package progress - -// Report defines the interface for types that can deliver progress reports. -// Examples include uploads/downloads in the http client and the task info -// field in the task managed object. -type Report interface { - Percentage() float32 - Detail() string - Error() error -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/vim25/progress/scale.go juju-core-2.0.2/src/github.com/juju/govmomi/vim25/progress/scale.go --- juju-core-2.0.0/src/github.com/juju/govmomi/vim25/progress/scale.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/vim25/progress/scale.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,76 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package progress - -type scaledReport struct { - Report - n int - i int -} - -func (r scaledReport) Percentage() float32 { - b := 100 * float32(r.i) / float32(r.n) - return b + (r.Report.Percentage() / float32(r.n)) -} - -type scaleOne struct { - s Sinker - n int - i int -} - -func (s scaleOne) Sink() chan<- Report { - upstream := make(chan Report) - downstream := s.s.Sink() - go s.loop(upstream, downstream) - return upstream -} - -func (s scaleOne) loop(upstream <-chan Report, downstream chan<- Report) { - defer close(downstream) - - for r := range upstream { - downstream <- scaledReport{ - Report: r, - n: s.n, - i: s.i, - } - } -} - -type scaleMany struct { - s Sinker - n int - i int -} - -func Scale(s Sinker, n int) Sinker { - return &scaleMany{ - s: s, - n: n, - } -} - -func (s *scaleMany) Sink() chan<- Report { - if s.i == s.n { - s.n++ - } - - ch := scaleOne{s: s.s, n: s.n, i: s.i}.Sink() - s.i++ - return ch -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/vim25/progress/scale_test.go juju-core-2.0.2/src/github.com/juju/govmomi/vim25/progress/scale_test.go --- juju-core-2.0.0/src/github.com/juju/govmomi/vim25/progress/scale_test.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/vim25/progress/scale_test.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,45 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package progress - -import "testing" - -func TestScaleMany(t *testing.T) { - ch := make(chan Report) - a := NewAggregator(dummySinker{ch}) - defer a.Done() - - s := Scale(a, 5) - - go func() { - for i := 0; i < 5; i++ { - go func(ch chan<- Report) { - ch <- dummyReport{p: 0.0} - ch <- dummyReport{p: 50.0} - close(ch) - }(s.Sink()) - } - }() - - // Expect percentages to be scaled across sinks - for p := float32(0.0); p < 100.0; p += 10.0 { - r := <-ch - if r.Percentage() != p { - t.Errorf("Expected percentage to be: %.0f%%", p) - } - } -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/vim25/progress/sinker.go juju-core-2.0.2/src/github.com/juju/govmomi/vim25/progress/sinker.go --- juju-core-2.0.0/src/github.com/juju/govmomi/vim25/progress/sinker.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/vim25/progress/sinker.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,33 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package progress - -// Sinker defines what is expected of a type that can act as a sink for -// progress reports. The semantics are as follows. If you call Sink(), you are -// responsible for closing the returned channel. Closing this channel means -// that the related task is done, or resulted in error. -type Sinker interface { - Sink() chan<- Report -} - -// SinkFunc defines a function that returns a progress report channel. -type SinkFunc func() chan<- Report - -// Sink makes the SinkFunc implement the Sinker interface. -func (fn SinkFunc) Sink() chan<- Report { - return fn() -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/vim25/progress/tee.go juju-core-2.0.2/src/github.com/juju/govmomi/vim25/progress/tee.go --- juju-core-2.0.0/src/github.com/juju/govmomi/vim25/progress/tee.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/vim25/progress/tee.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,41 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package progress - -// Tee works like Unix tee; it forwards all progress reports it receives to the -// specified sinks -func Tee(s1, s2 Sinker) Sinker { - fn := func() chan<- Report { - d1 := s1.Sink() - d2 := s2.Sink() - u := make(chan Report) - go tee(u, d1, d2) - return u - } - - return SinkFunc(fn) -} - -func tee(u <-chan Report, d1, d2 chan<- Report) { - defer close(d1) - defer close(d2) - - for r := range u { - d1 <- r - d2 <- r - } -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/vim25/progress/tee_test.go juju-core-2.0.2/src/github.com/juju/govmomi/vim25/progress/tee_test.go --- juju-core-2.0.0/src/github.com/juju/govmomi/vim25/progress/tee_test.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/vim25/progress/tee_test.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,46 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package progress - -import "testing" - -func TestTee(t *testing.T) { - var ok bool - - ch1 := make(chan Report) - ch2 := make(chan Report) - - s := Tee(&dummySinker{ch: ch1}, &dummySinker{ch: ch2}) - - in := s.Sink() - in <- dummyReport{} - close(in) - - // Receive dummy on both sinks - <-ch1 - <-ch2 - - _, ok = <-ch1 - if ok { - t.Errorf("Expected channel to be closed") - } - - _, ok = <-ch2 - if ok { - t.Errorf("Expected channel to be closed") - } -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/vim25/soap/client.go juju-core-2.0.2/src/github.com/juju/govmomi/vim25/soap/client.go --- juju-core-2.0.0/src/github.com/juju/govmomi/vim25/soap/client.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/vim25/soap/client.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,399 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package soap - -import ( - "bytes" - "crypto/tls" - "encoding/json" - "errors" - "io" - "net" - "net/http" - "net/http/cookiejar" - "net/url" - "os" - "strings" - "time" - - "github.com/juju/govmomi/vim25/progress" - "github.com/juju/govmomi/vim25/types" - "github.com/juju/govmomi/vim25/xml" - "golang.org/x/net/context" -) - -type HasFault interface { - Fault() *Fault -} - -type RoundTripper interface { - RoundTrip(ctx context.Context, req, res HasFault) error -} - -type Client struct { - http.Client - - u *url.URL - k bool // Named after curl's -k flag - d *debugContainer - t *http.Transport -} - -func NewClient(u *url.URL, insecure bool) *Client { - c := Client{ - u: u, - k: insecure, - d: newDebug(), - } - - // Initialize http.RoundTripper on client, so we can customize it below - c.t = &http.Transport{ - Proxy: http.ProxyFromEnvironment, - Dial: func(network, address string) (net.Conn, error) { - dialer := &net.Dialer{ - Timeout: 30 * time.Second, - } - conn, err := dialer.Dial(network, address) - if err != nil { - return conn, err - } - if tc, ok := conn.(*net.TCPConn); ok { - keepAlive := 30 * time.Second - tc.SetKeepAlive(true) - tc.SetKeepAlivePeriod(keepAlive) - } - return conn, nil - }, - } - - if c.u.Scheme == "https" { - c.t.TLSClientConfig = &tls.Config{InsecureSkipVerify: c.k} - setTLSHandshakeTimeout(c.t, 10*time.Second) - } - - c.Client.Transport = c.t - c.Client.Jar, _ = cookiejar.New(nil) - - // Remove user information from a copy of the URL - c.u = c.URL() - c.u.User = nil - - return &c -} - -func (c *Client) URL() *url.URL { - urlCopy := *c.u - return &urlCopy -} - -type marshaledClient struct { - Cookies []*http.Cookie - URL *url.URL - Insecure bool -} - -func (c *Client) MarshalJSON() ([]byte, error) { - m := marshaledClient{ - Cookies: c.Jar.Cookies(c.u), - URL: c.u, - Insecure: c.k, - } - - return json.Marshal(m) -} - -func (c *Client) UnmarshalJSON(b []byte) error { - var m marshaledClient - - err := json.Unmarshal(b, &m) - if err != nil { - return err - } - - *c = *NewClient(m.URL, m.Insecure) - c.Jar.SetCookies(m.URL, m.Cookies) - - return nil -} - -func (c *Client) do(ctx context.Context, req *http.Request) (*http.Response, error) { - var resc = make(chan *http.Response, 1) - var errc = make(chan error, 1) - - // Perform request from separate routine. - go func() { - res, err := c.Client.Do(req) - if err != nil { - errc <- err - } else { - resc <- res - } - }() - - // Wait for request completion of context expiry. - select { - case <-ctx.Done(): - c.t.CancelRequest(req) - return nil, ctx.Err() - case err := <-errc: - return nil, err - case res := <-resc: - return res, nil - } -} - -func (c *Client) RoundTrip(ctx context.Context, reqBody, resBody HasFault) error { - var err error - - reqEnv := Envelope{Body: reqBody} - resEnv := Envelope{Body: resBody} - - // Create debugging context for this round trip - d := c.d.newRoundTrip() - if d.enabled() { - defer d.done() - } - - b, err := xml.Marshal(reqEnv) - if err != nil { - panic(err) - } - - rawReqBody := io.MultiReader(strings.NewReader(xml.Header), bytes.NewReader(b)) - req, err := http.NewRequest("POST", c.u.String(), rawReqBody) - if err != nil { - panic(err) - } - - req.Header.Set(`Content-Type`, `text/xml; charset="utf-8"`) - req.Header.Set(`SOAPAction`, `urn:vim25/5.5`) - - if d.enabled() { - d.debugRequest(req) - } - - tstart := time.Now() - res, err := c.do(ctx, req) - tstop := time.Now() - - if d.enabled() { - d.logf("%6dms (%T)", tstop.Sub(tstart)/time.Millisecond, resBody) - } - - if err != nil { - return err - } - - if d.enabled() { - d.debugResponse(res) - } - - // Close response regardless of what happens next - defer res.Body.Close() - - switch res.StatusCode { - case http.StatusOK: - // OK - case http.StatusInternalServerError: - // Error, but typically includes a body explaining the error - default: - return errors.New(res.Status) - } - - dec := xml.NewDecoder(res.Body) - dec.TypeFunc = types.TypeFunc() - err = dec.Decode(&resEnv) - if err != nil { - return err - } - - if f := resBody.Fault(); f != nil { - return WrapSoapFault(f) - } - - return err -} - -func (c *Client) CloseIdleConnections() { - c.t.CloseIdleConnections() -} - -// ParseURL wraps url.Parse to rewrite the URL.Host field -// In the case of VM guest uploads or NFC lease URLs, a Host -// field with a value of "*" is rewritten to the Client's URL.Host. -func (c *Client) ParseURL(urlStr string) (*url.URL, error) { - u, err := url.Parse(urlStr) - if err != nil { - return nil, err - } - - host := strings.Split(u.Host, ":") - if host[0] == "*" { - // Also use Client's port, to support port forwarding - u.Host = c.URL().Host - } - - return u, nil -} - -type Upload struct { - Type string - Method string - ContentLength int64 - Headers map[string]string - Progress progress.Sinker -} - -var DefaultUpload = Upload{ - Type: "application/octet-stream", - Method: "PUT", -} - -// Upload PUTs the local file to the given URL -func (c *Client) Upload(f io.Reader, u *url.URL, param *Upload) error { - var err error - - if param.Progress != nil { - pr := progress.NewReader(param.Progress, f, param.ContentLength) - f = pr - - // Mark progress reader as done when returning from this function. - defer func() { - pr.Done(err) - }() - } - - req, err := http.NewRequest(param.Method, u.String(), f) - if err != nil { - return err - } - - req.ContentLength = param.ContentLength - req.Header.Set("Content-Type", param.Type) - - for k, v := range param.Headers { - req.Header.Add(k, v) - } - - res, err := c.Client.Do(req) - if err != nil { - return err - } - - switch res.StatusCode { - case http.StatusOK: - case http.StatusCreated: - default: - err = errors.New(res.Status) - } - - return err -} - -// UploadFile PUTs the local file to the given URL -func (c *Client) UploadFile(file string, u *url.URL, param *Upload) error { - if param == nil { - p := DefaultUpload // Copy since we set ContentLength - param = &p - } - - s, err := os.Stat(file) - if err != nil { - return err - } - - f, err := os.Open(file) - if err != nil { - return err - } - defer f.Close() - - param.ContentLength = s.Size() - - return c.Upload(f, u, param) -} - -type Download struct { - Method string - Progress progress.Sinker -} - -var DefaultDownload = Download{ - Method: "GET", -} - -// DownloadFile GETs the given URL to a local file -func (c *Client) DownloadFile(file string, u *url.URL, param *Download) error { - var err error - - if param == nil { - param = &DefaultDownload - } - - fh, err := os.Create(file) - if err != nil { - return err - } - defer fh.Close() - - req, err := http.NewRequest(param.Method, u.String(), nil) - if err != nil { - return err - } - - res, err := c.Client.Do(req) - if err != nil { - return err - } - - defer res.Body.Close() - - switch res.StatusCode { - case http.StatusOK: - default: - err = errors.New(res.Status) - } - - if err != nil { - return err - } - - var r io.Reader = res.Body - if param.Progress != nil { - pr := progress.NewReader(param.Progress, res.Body, res.ContentLength) - r = pr - - // Mark progress reader as done when returning from this function. - defer func() { - pr.Done(err) - }() - } - - _, err = io.Copy(fh, r) - if err != nil { - return err - } - - // Assign error before returning so that it gets picked up by the deferred - // function marking the progress reader as done. - err = fh.Close() - if err != nil { - return err - } - - return nil -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/vim25/soap/client_legacy.go juju-core-2.0.2/src/github.com/juju/govmomi/vim25/soap/client_legacy.go --- juju-core-2.0.0/src/github.com/juju/govmomi/vim25/soap/client_legacy.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/vim25/soap/client_legacy.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,11 +0,0 @@ -// +build go1.2,!go1.3 - -package soap - -import ( - "net/http" - "time" -) - -func setTLSHandshakeTimeout(t *http.Transport, d time.Duration) { -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/vim25/soap/client_newer.go juju-core-2.0.2/src/github.com/juju/govmomi/vim25/soap/client_newer.go --- juju-core-2.0.0/src/github.com/juju/govmomi/vim25/soap/client_newer.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/vim25/soap/client_newer.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -// +build go1.3 - -package soap - -import ( - "net/http" - "time" -) - -func setTLSHandshakeTimeout(t *http.Transport, d time.Duration) { - t.TLSHandshakeTimeout = d -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/vim25/soap/debug.go juju-core-2.0.2/src/github.com/juju/govmomi/vim25/soap/debug.go --- juju-core-2.0.0/src/github.com/juju/govmomi/vim25/soap/debug.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/vim25/soap/debug.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,149 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package soap - -import ( - "fmt" - "io" - "net/http" - "net/http/httputil" - "sync/atomic" - "time" - - "github.com/juju/govmomi/vim25/debug" -) - -// teeReader wraps io.TeeReader and patches through the Close() function. -type teeReader struct { - io.Reader - io.Closer -} - -func newTeeReader(rc io.ReadCloser, w io.Writer) io.ReadCloser { - return teeReader{ - Reader: io.TeeReader(rc, w), - Closer: rc, - } -} - -// debugRoundTrip contains state and logic needed to debug a single round trip. -type debugRoundTrip struct { - cn uint64 // Client number - rn uint64 // Request number - log io.WriteCloser // Request log - cs []io.Closer // Files that need closing when done -} - -func (d *debugRoundTrip) logf(format string, a ...interface{}) { - now := time.Now().Format("2006-01-02T15-04-05.000000000") - fmt.Fprintf(d.log, "%s - %04d: ", now, d.rn) - fmt.Fprintf(d.log, format, a...) - fmt.Fprintf(d.log, "\n") -} - -func (d *debugRoundTrip) enabled() bool { - return d != nil -} - -func (d *debugRoundTrip) done() { - for _, c := range d.cs { - c.Close() - } -} - -func (d *debugRoundTrip) newFile(suffix string) io.WriteCloser { - return debug.NewFile(fmt.Sprintf("%d-%04d.%s", d.cn, d.rn, suffix)) -} - -func (d *debugRoundTrip) debugRequest(req *http.Request) { - if d == nil { - return - } - - var wc io.WriteCloser - - // Capture headers - wc = d.newFile("req.headers") - b, _ := httputil.DumpRequest(req, false) - wc.Write(b) - wc.Close() - - // Capture body - wc = d.newFile("req.xml") - req.Body = newTeeReader(req.Body, wc) - - // Delay closing until marked done - d.cs = append(d.cs, wc) -} - -func (d *debugRoundTrip) debugResponse(res *http.Response) { - if d == nil { - return - } - - var wc io.WriteCloser - - // Capture headers - wc = d.newFile("res.headers") - b, _ := httputil.DumpResponse(res, false) - wc.Write(b) - wc.Close() - - // Capture body - wc = d.newFile("res.xml") - res.Body = newTeeReader(res.Body, wc) - - // Delay closing until marked done - d.cs = append(d.cs, wc) -} - -var cn uint64 // Client counter - -// debugContainer wraps the debugging state for a single client. -type debugContainer struct { - cn uint64 // Client number - rn uint64 // Request counter - log io.WriteCloser // Request log -} - -func newDebug() *debugContainer { - d := debugContainer{ - cn: atomic.AddUint64(&cn, 1), - rn: 0, - } - - if !debug.Enabled() { - return nil - } - - d.log = debug.NewFile(fmt.Sprintf("%d-client.log", d.cn)) - return &d -} - -func (d *debugContainer) newRoundTrip() *debugRoundTrip { - if d == nil { - return nil - } - - drt := debugRoundTrip{ - cn: d.cn, - rn: atomic.AddUint64(&d.rn, 1), - log: d.log, - } - - return &drt -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/vim25/soap/error.go juju-core-2.0.2/src/github.com/juju/govmomi/vim25/soap/error.go --- juju-core-2.0.0/src/github.com/juju/govmomi/vim25/soap/error.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/vim25/soap/error.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,109 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package soap - -import ( - "fmt" - "reflect" - - "github.com/juju/govmomi/vim25/types" -) - -type regularError struct { - err error -} - -func (r regularError) Error() string { - return r.err.Error() -} - -type soapFaultError struct { - fault *Fault -} - -func (s soapFaultError) Error() string { - return fmt.Sprintf("%s: %s", s.fault.Code, s.fault.String) -} - -type vimFaultError struct { - fault types.BaseMethodFault -} - -func (v vimFaultError) Error() string { - typ := reflect.TypeOf(v.fault) - for typ.Kind() == reflect.Ptr { - typ = typ.Elem() - } - - return typ.Name() -} - -func (v vimFaultError) Fault() types.BaseMethodFault { - return v.fault -} - -func Wrap(err error) error { - switch err.(type) { - case regularError: - return err - case soapFaultError: - return err - case vimFaultError: - return err - } - - return WrapRegularError(err) -} - -func WrapRegularError(err error) error { - return regularError{err} -} - -func IsRegularError(err error) bool { - _, ok := err.(regularError) - return ok -} - -func ToRegularError(err error) error { - return err.(regularError).err -} - -func WrapSoapFault(f *Fault) error { - return soapFaultError{f} -} - -func IsSoapFault(err error) bool { - _, ok := err.(soapFaultError) - return ok -} - -func ToSoapFault(err error) *Fault { - return err.(soapFaultError).fault -} - -func WrapVimFault(v types.BaseMethodFault) error { - return vimFaultError{v} -} - -func IsVimFault(err error) bool { - _, ok := err.(vimFaultError) - return ok -} - -func ToVimFault(err error) types.BaseMethodFault { - return err.(vimFaultError).fault -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/vim25/soap/soap.go juju-core-2.0.2/src/github.com/juju/govmomi/vim25/soap/soap.go --- juju-core-2.0.0/src/github.com/juju/govmomi/vim25/soap/soap.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/vim25/soap/soap.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,45 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package soap - -import ( - "github.com/juju/govmomi/vim25/types" - "github.com/juju/govmomi/vim25/xml" -) - -type Envelope struct { - XMLName xml.Name `xml:"http://schemas.xmlsoap.org/soap/envelope/ Envelope"` - Header *Header `xml:",omitempty"` - Body interface{} -} - -type Header struct { - XMLName xml.Name `xml:"http://schemas.xmlsoap.org/soap/envelope/ Header"` -} - -type Fault struct { - XMLName xml.Name `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault"` - Code string `xml:"faultcode"` - String string `xml:"faultstring"` - Detail struct { - Fault types.AnyType `xml:",any"` - } `xml:"detail"` -} - -func (f *Fault) VimFault() types.AnyType { - return f.Detail.Fault -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/vim25/soap/soap_test.go juju-core-2.0.2/src/github.com/juju/govmomi/vim25/soap/soap_test.go --- juju-core-2.0.0/src/github.com/juju/govmomi/vim25/soap/soap_test.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/vim25/soap/soap_test.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,55 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package soap - -import ( - "testing" - - "github.com/juju/govmomi/vim25/xml" -) - -func TestEmptyEnvelope(t *testing.T) { - env := Envelope{} - - b, err := xml.Marshal(env) - if err != nil { - t.Errorf("error: %s", err) - return - } - - expected := `` - actual := string(b) - if expected != actual { - t.Fatalf("expected: %s, actual: %s", expected, actual) - } -} - -func TestEmptyHeader(t *testing.T) { - h := Header{} - - b, err := xml.Marshal(h) - if err != nil { - t.Errorf("error: %s", err) - return - } - - expected := `
` - actual := string(b) - if expected != actual { - t.Fatalf("expected: %s, actual: %s", expected, actual) - } -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/vim25/types/base.go juju-core-2.0.2/src/github.com/juju/govmomi/vim25/types/base.go --- juju-core-2.0.0/src/github.com/juju/govmomi/vim25/types/base.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/vim25/types/base.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,19 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package types - -type AnyType interface{} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/vim25/types/base_test.go juju-core-2.0.2/src/github.com/juju/govmomi/vim25/types/base_test.go --- juju-core-2.0.0/src/github.com/juju/govmomi/vim25/types/base_test.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/vim25/types/base_test.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,65 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package types - -import ( - "bytes" - "reflect" - "testing" - - "github.com/juju/govmomi/vim25/xml" -) - -func TestAnyType(t *testing.T) { - x := func(s string) []byte { - s = `` + s - s += `` - return []byte(s) - } - - tests := []struct { - Input []byte - Value interface{} - }{ - { - Input: x(`test`), - Value: "test", - }, - { - Input: x(`AABB`), - Value: ArrayOfString{String: []string{"AA", "BB"}}, - }, - } - - for _, test := range tests { - var r struct { - A interface{} `xml:"name,typeattr"` - } - - dec := xml.NewDecoder(bytes.NewReader(test.Input)) - dec.TypeFunc = TypeFunc() - - err := dec.Decode(&r) - if err != nil { - t.Fatalf("Decode: %s", err) - } - - if !reflect.DeepEqual(r.A, test.Value) { - t.Errorf("Expected: %#v, actual: %#v", r.A, test.Value) - } - } -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/vim25/types/enum.go juju-core-2.0.2/src/github.com/juju/govmomi/vim25/types/enum.go --- juju-core-2.0.0/src/github.com/juju/govmomi/vim25/types/enum.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/vim25/types/enum.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,3615 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package types - -import "reflect" - -type ActionParameter string - -const ( - ActionParameterTargetName = ActionParameter("targetName") - ActionParameterAlarmName = ActionParameter("alarmName") - ActionParameterOldStatus = ActionParameter("oldStatus") - ActionParameterNewStatus = ActionParameter("newStatus") - ActionParameterTriggeringSummary = ActionParameter("triggeringSummary") - ActionParameterDeclaringSummary = ActionParameter("declaringSummary") - ActionParameterEventDescription = ActionParameter("eventDescription") - ActionParameterTarget = ActionParameter("target") - ActionParameterAlarm = ActionParameter("alarm") -) - -func init() { - t["ActionParameter"] = reflect.TypeOf((*ActionParameter)(nil)).Elem() -} - -type ActionType string - -const ( - ActionTypeMigrationV1 = ActionType("MigrationV1") - ActionTypeVmPowerV1 = ActionType("VmPowerV1") - ActionTypeHostPowerV1 = ActionType("HostPowerV1") - ActionTypeHostMaintenanceV1 = ActionType("HostMaintenanceV1") - ActionTypeStorageMigrationV1 = ActionType("StorageMigrationV1") - ActionTypeStoragePlacementV1 = ActionType("StoragePlacementV1") -) - -func init() { - t["ActionType"] = reflect.TypeOf((*ActionType)(nil)).Elem() -} - -type AffinityType string - -const ( - AffinityTypeMemory = AffinityType("memory") - AffinityTypeCpu = AffinityType("cpu") -) - -func init() { - t["AffinityType"] = reflect.TypeOf((*AffinityType)(nil)).Elem() -} - -type AgentInstallFailedReason string - -const ( - AgentInstallFailedReasonNotEnoughSpaceOnDevice = AgentInstallFailedReason("NotEnoughSpaceOnDevice") - AgentInstallFailedReasonPrepareToUpgradeFailed = AgentInstallFailedReason("PrepareToUpgradeFailed") - AgentInstallFailedReasonAgentNotRunning = AgentInstallFailedReason("AgentNotRunning") - AgentInstallFailedReasonAgentNotReachable = AgentInstallFailedReason("AgentNotReachable") - AgentInstallFailedReasonInstallTimedout = AgentInstallFailedReason("InstallTimedout") - AgentInstallFailedReasonSignatureVerificationFailed = AgentInstallFailedReason("SignatureVerificationFailed") - AgentInstallFailedReasonAgentUploadFailed = AgentInstallFailedReason("AgentUploadFailed") - AgentInstallFailedReasonAgentUploadTimedout = AgentInstallFailedReason("AgentUploadTimedout") - AgentInstallFailedReasonUnknownInstallerError = AgentInstallFailedReason("UnknownInstallerError") -) - -func init() { - t["AgentInstallFailedReason"] = reflect.TypeOf((*AgentInstallFailedReason)(nil)).Elem() -} - -type ArrayUpdateOperation string - -const ( - ArrayUpdateOperationAdd = ArrayUpdateOperation("add") - ArrayUpdateOperationRemove = ArrayUpdateOperation("remove") - ArrayUpdateOperationEdit = ArrayUpdateOperation("edit") -) - -func init() { - t["ArrayUpdateOperation"] = reflect.TypeOf((*ArrayUpdateOperation)(nil)).Elem() -} - -type AutoStartAction string - -const ( - AutoStartActionNone = AutoStartAction("none") - AutoStartActionSystemDefault = AutoStartAction("systemDefault") - AutoStartActionPowerOn = AutoStartAction("powerOn") - AutoStartActionPowerOff = AutoStartAction("powerOff") - AutoStartActionGuestShutdown = AutoStartAction("guestShutdown") - AutoStartActionSuspend = AutoStartAction("suspend") -) - -func init() { - t["AutoStartAction"] = reflect.TypeOf((*AutoStartAction)(nil)).Elem() -} - -type AutoStartWaitHeartbeatSetting string - -const ( - AutoStartWaitHeartbeatSettingYes = AutoStartWaitHeartbeatSetting("yes") - AutoStartWaitHeartbeatSettingNo = AutoStartWaitHeartbeatSetting("no") - AutoStartWaitHeartbeatSettingSystemDefault = AutoStartWaitHeartbeatSetting("systemDefault") -) - -func init() { - t["AutoStartWaitHeartbeatSetting"] = reflect.TypeOf((*AutoStartWaitHeartbeatSetting)(nil)).Elem() -} - -type CannotMoveFaultToleranceVmMoveType string - -const ( - CannotMoveFaultToleranceVmMoveTypeResourcePool = CannotMoveFaultToleranceVmMoveType("resourcePool") - CannotMoveFaultToleranceVmMoveTypeCluster = CannotMoveFaultToleranceVmMoveType("cluster") -) - -func init() { - t["CannotMoveFaultToleranceVmMoveType"] = reflect.TypeOf((*CannotMoveFaultToleranceVmMoveType)(nil)).Elem() -} - -type CannotPowerOffVmInClusterOperation string - -const ( - CannotPowerOffVmInClusterOperationSuspend = CannotPowerOffVmInClusterOperation("suspend") - CannotPowerOffVmInClusterOperationPowerOff = CannotPowerOffVmInClusterOperation("powerOff") - CannotPowerOffVmInClusterOperationGuestShutdown = CannotPowerOffVmInClusterOperation("guestShutdown") - CannotPowerOffVmInClusterOperationGuestSuspend = CannotPowerOffVmInClusterOperation("guestSuspend") -) - -func init() { - t["CannotPowerOffVmInClusterOperation"] = reflect.TypeOf((*CannotPowerOffVmInClusterOperation)(nil)).Elem() -} - -type CannotUseNetworkReason string - -const ( - CannotUseNetworkReasonNetworkReservationNotSupported = CannotUseNetworkReason("NetworkReservationNotSupported") - CannotUseNetworkReasonMismatchedNetworkPolicies = CannotUseNetworkReason("MismatchedNetworkPolicies") - CannotUseNetworkReasonMismatchedDvsVersionOrVendor = CannotUseNetworkReason("MismatchedDvsVersionOrVendor") - CannotUseNetworkReasonVMotionToUnsupportedNetworkType = CannotUseNetworkReason("VMotionToUnsupportedNetworkType") -) - -func init() { - t["CannotUseNetworkReason"] = reflect.TypeOf((*CannotUseNetworkReason)(nil)).Elem() -} - -type CheckTestType string - -const ( - CheckTestTypeSourceTests = CheckTestType("sourceTests") - CheckTestTypeHostTests = CheckTestType("hostTests") - CheckTestTypeResourcePoolTests = CheckTestType("resourcePoolTests") - CheckTestTypeDatastoreTests = CheckTestType("datastoreTests") - CheckTestTypeNetworkTests = CheckTestType("networkTests") -) - -func init() { - t["CheckTestType"] = reflect.TypeOf((*CheckTestType)(nil)).Elem() -} - -type ClusterDasAamNodeStateDasState string - -const ( - ClusterDasAamNodeStateDasStateUninitialized = ClusterDasAamNodeStateDasState("uninitialized") - ClusterDasAamNodeStateDasStateInitialized = ClusterDasAamNodeStateDasState("initialized") - ClusterDasAamNodeStateDasStateConfiguring = ClusterDasAamNodeStateDasState("configuring") - ClusterDasAamNodeStateDasStateUnconfiguring = ClusterDasAamNodeStateDasState("unconfiguring") - ClusterDasAamNodeStateDasStateRunning = ClusterDasAamNodeStateDasState("running") - ClusterDasAamNodeStateDasStateError = ClusterDasAamNodeStateDasState("error") - ClusterDasAamNodeStateDasStateAgentShutdown = ClusterDasAamNodeStateDasState("agentShutdown") - ClusterDasAamNodeStateDasStateNodeFailed = ClusterDasAamNodeStateDasState("nodeFailed") -) - -func init() { - t["ClusterDasAamNodeStateDasState"] = reflect.TypeOf((*ClusterDasAamNodeStateDasState)(nil)).Elem() -} - -type ClusterDasConfigInfoHBDatastoreCandidate string - -const ( - ClusterDasConfigInfoHBDatastoreCandidateUserSelectedDs = ClusterDasConfigInfoHBDatastoreCandidate("userSelectedDs") - ClusterDasConfigInfoHBDatastoreCandidateAllFeasibleDs = ClusterDasConfigInfoHBDatastoreCandidate("allFeasibleDs") - ClusterDasConfigInfoHBDatastoreCandidateAllFeasibleDsWithUserPreference = ClusterDasConfigInfoHBDatastoreCandidate("allFeasibleDsWithUserPreference") -) - -func init() { - t["ClusterDasConfigInfoHBDatastoreCandidate"] = reflect.TypeOf((*ClusterDasConfigInfoHBDatastoreCandidate)(nil)).Elem() -} - -type ClusterDasConfigInfoServiceState string - -const ( - ClusterDasConfigInfoServiceStateDisabled = ClusterDasConfigInfoServiceState("disabled") - ClusterDasConfigInfoServiceStateEnabled = ClusterDasConfigInfoServiceState("enabled") -) - -func init() { - t["ClusterDasConfigInfoServiceState"] = reflect.TypeOf((*ClusterDasConfigInfoServiceState)(nil)).Elem() -} - -type ClusterDasConfigInfoVmMonitoringState string - -const ( - ClusterDasConfigInfoVmMonitoringStateVmMonitoringDisabled = ClusterDasConfigInfoVmMonitoringState("vmMonitoringDisabled") - ClusterDasConfigInfoVmMonitoringStateVmMonitoringOnly = ClusterDasConfigInfoVmMonitoringState("vmMonitoringOnly") - ClusterDasConfigInfoVmMonitoringStateVmAndAppMonitoring = ClusterDasConfigInfoVmMonitoringState("vmAndAppMonitoring") -) - -func init() { - t["ClusterDasConfigInfoVmMonitoringState"] = reflect.TypeOf((*ClusterDasConfigInfoVmMonitoringState)(nil)).Elem() -} - -type ClusterDasFdmAvailabilityState string - -const ( - ClusterDasFdmAvailabilityStateUninitialized = ClusterDasFdmAvailabilityState("uninitialized") - ClusterDasFdmAvailabilityStateElection = ClusterDasFdmAvailabilityState("election") - ClusterDasFdmAvailabilityStateMaster = ClusterDasFdmAvailabilityState("master") - ClusterDasFdmAvailabilityStateConnectedToMaster = ClusterDasFdmAvailabilityState("connectedToMaster") - ClusterDasFdmAvailabilityStateNetworkPartitionedFromMaster = ClusterDasFdmAvailabilityState("networkPartitionedFromMaster") - ClusterDasFdmAvailabilityStateNetworkIsolated = ClusterDasFdmAvailabilityState("networkIsolated") - ClusterDasFdmAvailabilityStateHostDown = ClusterDasFdmAvailabilityState("hostDown") - ClusterDasFdmAvailabilityStateInitializationError = ClusterDasFdmAvailabilityState("initializationError") - ClusterDasFdmAvailabilityStateUninitializationError = ClusterDasFdmAvailabilityState("uninitializationError") - ClusterDasFdmAvailabilityStateFdmUnreachable = ClusterDasFdmAvailabilityState("fdmUnreachable") -) - -func init() { - t["ClusterDasFdmAvailabilityState"] = reflect.TypeOf((*ClusterDasFdmAvailabilityState)(nil)).Elem() -} - -type ClusterDasVmSettingsIsolationResponse string - -const ( - ClusterDasVmSettingsIsolationResponseNone = ClusterDasVmSettingsIsolationResponse("none") - ClusterDasVmSettingsIsolationResponsePowerOff = ClusterDasVmSettingsIsolationResponse("powerOff") - ClusterDasVmSettingsIsolationResponseShutdown = ClusterDasVmSettingsIsolationResponse("shutdown") - ClusterDasVmSettingsIsolationResponseClusterIsolationResponse = ClusterDasVmSettingsIsolationResponse("clusterIsolationResponse") -) - -func init() { - t["ClusterDasVmSettingsIsolationResponse"] = reflect.TypeOf((*ClusterDasVmSettingsIsolationResponse)(nil)).Elem() -} - -type ClusterDasVmSettingsRestartPriority string - -const ( - ClusterDasVmSettingsRestartPriorityDisabled = ClusterDasVmSettingsRestartPriority("disabled") - ClusterDasVmSettingsRestartPriorityLow = ClusterDasVmSettingsRestartPriority("low") - ClusterDasVmSettingsRestartPriorityMedium = ClusterDasVmSettingsRestartPriority("medium") - ClusterDasVmSettingsRestartPriorityHigh = ClusterDasVmSettingsRestartPriority("high") - ClusterDasVmSettingsRestartPriorityClusterRestartPriority = ClusterDasVmSettingsRestartPriority("clusterRestartPriority") -) - -func init() { - t["ClusterDasVmSettingsRestartPriority"] = reflect.TypeOf((*ClusterDasVmSettingsRestartPriority)(nil)).Elem() -} - -type ClusterPowerOnVmOption string - -const ( - ClusterPowerOnVmOptionOverrideAutomationLevel = ClusterPowerOnVmOption("OverrideAutomationLevel") - ClusterPowerOnVmOptionReserveResources = ClusterPowerOnVmOption("ReserveResources") -) - -func init() { - t["ClusterPowerOnVmOption"] = reflect.TypeOf((*ClusterPowerOnVmOption)(nil)).Elem() -} - -type ClusterProfileServiceType string - -const ( - ClusterProfileServiceTypeDRS = ClusterProfileServiceType("DRS") - ClusterProfileServiceTypeHA = ClusterProfileServiceType("HA") - ClusterProfileServiceTypeDPM = ClusterProfileServiceType("DPM") - ClusterProfileServiceTypeFT = ClusterProfileServiceType("FT") -) - -func init() { - t["ClusterProfileServiceType"] = reflect.TypeOf((*ClusterProfileServiceType)(nil)).Elem() -} - -type ComplianceResultStatus string - -const ( - ComplianceResultStatusCompliant = ComplianceResultStatus("compliant") - ComplianceResultStatusNonCompliant = ComplianceResultStatus("nonCompliant") - ComplianceResultStatusUnknown = ComplianceResultStatus("unknown") -) - -func init() { - t["ComplianceResultStatus"] = reflect.TypeOf((*ComplianceResultStatus)(nil)).Elem() -} - -type ComputeResourceHostSPBMLicenseInfoHostSPBMLicenseState string - -const ( - ComputeResourceHostSPBMLicenseInfoHostSPBMLicenseStateLicensed = ComputeResourceHostSPBMLicenseInfoHostSPBMLicenseState("licensed") - ComputeResourceHostSPBMLicenseInfoHostSPBMLicenseStateUnlicensed = ComputeResourceHostSPBMLicenseInfoHostSPBMLicenseState("unlicensed") - ComputeResourceHostSPBMLicenseInfoHostSPBMLicenseStateUnknown = ComputeResourceHostSPBMLicenseInfoHostSPBMLicenseState("unknown") -) - -func init() { - t["ComputeResourceHostSPBMLicenseInfoHostSPBMLicenseState"] = reflect.TypeOf((*ComputeResourceHostSPBMLicenseInfoHostSPBMLicenseState)(nil)).Elem() -} - -type ConfigSpecOperation string - -const ( - ConfigSpecOperationAdd = ConfigSpecOperation("add") - ConfigSpecOperationEdit = ConfigSpecOperation("edit") - ConfigSpecOperationRemove = ConfigSpecOperation("remove") -) - -func init() { - t["ConfigSpecOperation"] = reflect.TypeOf((*ConfigSpecOperation)(nil)).Elem() -} - -type CustomizationLicenseDataMode string - -const ( - CustomizationLicenseDataModePerServer = CustomizationLicenseDataMode("perServer") - CustomizationLicenseDataModePerSeat = CustomizationLicenseDataMode("perSeat") -) - -func init() { - t["CustomizationLicenseDataMode"] = reflect.TypeOf((*CustomizationLicenseDataMode)(nil)).Elem() -} - -type CustomizationNetBIOSMode string - -const ( - CustomizationNetBIOSModeEnableNetBIOSViaDhcp = CustomizationNetBIOSMode("enableNetBIOSViaDhcp") - CustomizationNetBIOSModeEnableNetBIOS = CustomizationNetBIOSMode("enableNetBIOS") - CustomizationNetBIOSModeDisableNetBIOS = CustomizationNetBIOSMode("disableNetBIOS") -) - -func init() { - t["CustomizationNetBIOSMode"] = reflect.TypeOf((*CustomizationNetBIOSMode)(nil)).Elem() -} - -type CustomizationSysprepRebootOption string - -const ( - CustomizationSysprepRebootOptionReboot = CustomizationSysprepRebootOption("reboot") - CustomizationSysprepRebootOptionNoreboot = CustomizationSysprepRebootOption("noreboot") - CustomizationSysprepRebootOptionShutdown = CustomizationSysprepRebootOption("shutdown") -) - -func init() { - t["CustomizationSysprepRebootOption"] = reflect.TypeOf((*CustomizationSysprepRebootOption)(nil)).Elem() -} - -type DVPortStatusVmDirectPathGen2InactiveReasonNetwork string - -const ( - DVPortStatusVmDirectPathGen2InactiveReasonNetworkPortNptIncompatibleDvs = DVPortStatusVmDirectPathGen2InactiveReasonNetwork("portNptIncompatibleDvs") - DVPortStatusVmDirectPathGen2InactiveReasonNetworkPortNptNoCompatibleNics = DVPortStatusVmDirectPathGen2InactiveReasonNetwork("portNptNoCompatibleNics") - DVPortStatusVmDirectPathGen2InactiveReasonNetworkPortNptNoVirtualFunctionsAvailable = DVPortStatusVmDirectPathGen2InactiveReasonNetwork("portNptNoVirtualFunctionsAvailable") - DVPortStatusVmDirectPathGen2InactiveReasonNetworkPortNptDisabledForPort = DVPortStatusVmDirectPathGen2InactiveReasonNetwork("portNptDisabledForPort") -) - -func init() { - t["DVPortStatusVmDirectPathGen2InactiveReasonNetwork"] = reflect.TypeOf((*DVPortStatusVmDirectPathGen2InactiveReasonNetwork)(nil)).Elem() -} - -type DVPortStatusVmDirectPathGen2InactiveReasonOther string - -const ( - DVPortStatusVmDirectPathGen2InactiveReasonOtherPortNptIncompatibleHost = DVPortStatusVmDirectPathGen2InactiveReasonOther("portNptIncompatibleHost") - DVPortStatusVmDirectPathGen2InactiveReasonOtherPortNptIncompatibleConnectee = DVPortStatusVmDirectPathGen2InactiveReasonOther("portNptIncompatibleConnectee") -) - -func init() { - t["DVPortStatusVmDirectPathGen2InactiveReasonOther"] = reflect.TypeOf((*DVPortStatusVmDirectPathGen2InactiveReasonOther)(nil)).Elem() -} - -type DasConfigFaultDasConfigFaultReason string - -const ( - DasConfigFaultDasConfigFaultReasonHostNetworkMisconfiguration = DasConfigFaultDasConfigFaultReason("HostNetworkMisconfiguration") - DasConfigFaultDasConfigFaultReasonHostMisconfiguration = DasConfigFaultDasConfigFaultReason("HostMisconfiguration") - DasConfigFaultDasConfigFaultReasonInsufficientPrivileges = DasConfigFaultDasConfigFaultReason("InsufficientPrivileges") - DasConfigFaultDasConfigFaultReasonNoPrimaryAgentAvailable = DasConfigFaultDasConfigFaultReason("NoPrimaryAgentAvailable") - DasConfigFaultDasConfigFaultReasonOther = DasConfigFaultDasConfigFaultReason("Other") - DasConfigFaultDasConfigFaultReasonNoDatastoresConfigured = DasConfigFaultDasConfigFaultReason("NoDatastoresConfigured") - DasConfigFaultDasConfigFaultReasonVSanNotSupportedOnHost = DasConfigFaultDasConfigFaultReason("VSanNotSupportedOnHost") -) - -func init() { - t["DasConfigFaultDasConfigFaultReason"] = reflect.TypeOf((*DasConfigFaultDasConfigFaultReason)(nil)).Elem() -} - -type DasVmPriority string - -const ( - DasVmPriorityDisabled = DasVmPriority("disabled") - DasVmPriorityLow = DasVmPriority("low") - DasVmPriorityMedium = DasVmPriority("medium") - DasVmPriorityHigh = DasVmPriority("high") -) - -func init() { - t["DasVmPriority"] = reflect.TypeOf((*DasVmPriority)(nil)).Elem() -} - -type DatastoreAccessible string - -const ( - DatastoreAccessibleTrue = DatastoreAccessible("True") - DatastoreAccessibleFalse = DatastoreAccessible("False") -) - -func init() { - t["DatastoreAccessible"] = reflect.TypeOf((*DatastoreAccessible)(nil)).Elem() -} - -type DatastoreSummaryMaintenanceModeState string - -const ( - DatastoreSummaryMaintenanceModeStateNormal = DatastoreSummaryMaintenanceModeState("normal") - DatastoreSummaryMaintenanceModeStateEnteringMaintenance = DatastoreSummaryMaintenanceModeState("enteringMaintenance") - DatastoreSummaryMaintenanceModeStateInMaintenance = DatastoreSummaryMaintenanceModeState("inMaintenance") -) - -func init() { - t["DatastoreSummaryMaintenanceModeState"] = reflect.TypeOf((*DatastoreSummaryMaintenanceModeState)(nil)).Elem() -} - -type DayOfWeek string - -const ( - DayOfWeekSunday = DayOfWeek("sunday") - DayOfWeekMonday = DayOfWeek("monday") - DayOfWeekTuesday = DayOfWeek("tuesday") - DayOfWeekWednesday = DayOfWeek("wednesday") - DayOfWeekThursday = DayOfWeek("thursday") - DayOfWeekFriday = DayOfWeek("friday") - DayOfWeekSaturday = DayOfWeek("saturday") -) - -func init() { - t["DayOfWeek"] = reflect.TypeOf((*DayOfWeek)(nil)).Elem() -} - -type DeviceNotSupportedReason string - -const ( - DeviceNotSupportedReasonHost = DeviceNotSupportedReason("host") - DeviceNotSupportedReasonGuest = DeviceNotSupportedReason("guest") -) - -func init() { - t["DeviceNotSupportedReason"] = reflect.TypeOf((*DeviceNotSupportedReason)(nil)).Elem() -} - -type DiagnosticManagerLogCreator string - -const ( - DiagnosticManagerLogCreatorVpxd = DiagnosticManagerLogCreator("vpxd") - DiagnosticManagerLogCreatorVpxa = DiagnosticManagerLogCreator("vpxa") - DiagnosticManagerLogCreatorHostd = DiagnosticManagerLogCreator("hostd") - DiagnosticManagerLogCreatorServerd = DiagnosticManagerLogCreator("serverd") - DiagnosticManagerLogCreatorInstall = DiagnosticManagerLogCreator("install") - DiagnosticManagerLogCreatorVpxClient = DiagnosticManagerLogCreator("vpxClient") - DiagnosticManagerLogCreatorRecordLog = DiagnosticManagerLogCreator("recordLog") -) - -func init() { - t["DiagnosticManagerLogCreator"] = reflect.TypeOf((*DiagnosticManagerLogCreator)(nil)).Elem() -} - -type DiagnosticManagerLogFormat string - -const ( - DiagnosticManagerLogFormatPlain = DiagnosticManagerLogFormat("plain") -) - -func init() { - t["DiagnosticManagerLogFormat"] = reflect.TypeOf((*DiagnosticManagerLogFormat)(nil)).Elem() -} - -type DiagnosticPartitionStorageType string - -const ( - DiagnosticPartitionStorageTypeDirectAttached = DiagnosticPartitionStorageType("directAttached") - DiagnosticPartitionStorageTypeNetworkAttached = DiagnosticPartitionStorageType("networkAttached") -) - -func init() { - t["DiagnosticPartitionStorageType"] = reflect.TypeOf((*DiagnosticPartitionStorageType)(nil)).Elem() -} - -type DiagnosticPartitionType string - -const ( - DiagnosticPartitionTypeSingleHost = DiagnosticPartitionType("singleHost") - DiagnosticPartitionTypeMultiHost = DiagnosticPartitionType("multiHost") -) - -func init() { - t["DiagnosticPartitionType"] = reflect.TypeOf((*DiagnosticPartitionType)(nil)).Elem() -} - -type DisallowedChangeByServiceDisallowedChange string - -const ( - DisallowedChangeByServiceDisallowedChangeHotExtendDisk = DisallowedChangeByServiceDisallowedChange("hotExtendDisk") -) - -func init() { - t["DisallowedChangeByServiceDisallowedChange"] = reflect.TypeOf((*DisallowedChangeByServiceDisallowedChange)(nil)).Elem() -} - -type DistributedVirtualPortgroupMetaTagName string - -const ( - DistributedVirtualPortgroupMetaTagNameDvsName = DistributedVirtualPortgroupMetaTagName("dvsName") - DistributedVirtualPortgroupMetaTagNamePortgroupName = DistributedVirtualPortgroupMetaTagName("portgroupName") - DistributedVirtualPortgroupMetaTagNamePortIndex = DistributedVirtualPortgroupMetaTagName("portIndex") -) - -func init() { - t["DistributedVirtualPortgroupMetaTagName"] = reflect.TypeOf((*DistributedVirtualPortgroupMetaTagName)(nil)).Elem() -} - -type DistributedVirtualPortgroupPortgroupType string - -const ( - DistributedVirtualPortgroupPortgroupTypeEarlyBinding = DistributedVirtualPortgroupPortgroupType("earlyBinding") - DistributedVirtualPortgroupPortgroupTypeLateBinding = DistributedVirtualPortgroupPortgroupType("lateBinding") - DistributedVirtualPortgroupPortgroupTypeEphemeral = DistributedVirtualPortgroupPortgroupType("ephemeral") -) - -func init() { - t["DistributedVirtualPortgroupPortgroupType"] = reflect.TypeOf((*DistributedVirtualPortgroupPortgroupType)(nil)).Elem() -} - -type DistributedVirtualSwitchHostInfrastructureTrafficClass string - -const ( - DistributedVirtualSwitchHostInfrastructureTrafficClassManagement = DistributedVirtualSwitchHostInfrastructureTrafficClass("management") - DistributedVirtualSwitchHostInfrastructureTrafficClassFaultTolerance = DistributedVirtualSwitchHostInfrastructureTrafficClass("faultTolerance") - DistributedVirtualSwitchHostInfrastructureTrafficClassVmotion = DistributedVirtualSwitchHostInfrastructureTrafficClass("vmotion") - DistributedVirtualSwitchHostInfrastructureTrafficClassVirtualMachine = DistributedVirtualSwitchHostInfrastructureTrafficClass("virtualMachine") - DistributedVirtualSwitchHostInfrastructureTrafficClassISCSI = DistributedVirtualSwitchHostInfrastructureTrafficClass("iSCSI") - DistributedVirtualSwitchHostInfrastructureTrafficClassNfs = DistributedVirtualSwitchHostInfrastructureTrafficClass("nfs") - DistributedVirtualSwitchHostInfrastructureTrafficClassHbr = DistributedVirtualSwitchHostInfrastructureTrafficClass("hbr") - DistributedVirtualSwitchHostInfrastructureTrafficClassVsan = DistributedVirtualSwitchHostInfrastructureTrafficClass("vsan") -) - -func init() { - t["DistributedVirtualSwitchHostInfrastructureTrafficClass"] = reflect.TypeOf((*DistributedVirtualSwitchHostInfrastructureTrafficClass)(nil)).Elem() -} - -type DistributedVirtualSwitchHostMemberHostComponentState string - -const ( - DistributedVirtualSwitchHostMemberHostComponentStateUp = DistributedVirtualSwitchHostMemberHostComponentState("up") - DistributedVirtualSwitchHostMemberHostComponentStatePending = DistributedVirtualSwitchHostMemberHostComponentState("pending") - DistributedVirtualSwitchHostMemberHostComponentStateOutOfSync = DistributedVirtualSwitchHostMemberHostComponentState("outOfSync") - DistributedVirtualSwitchHostMemberHostComponentStateWarning = DistributedVirtualSwitchHostMemberHostComponentState("warning") - DistributedVirtualSwitchHostMemberHostComponentStateDisconnected = DistributedVirtualSwitchHostMemberHostComponentState("disconnected") - DistributedVirtualSwitchHostMemberHostComponentStateDown = DistributedVirtualSwitchHostMemberHostComponentState("down") -) - -func init() { - t["DistributedVirtualSwitchHostMemberHostComponentState"] = reflect.TypeOf((*DistributedVirtualSwitchHostMemberHostComponentState)(nil)).Elem() -} - -type DistributedVirtualSwitchNicTeamingPolicyMode string - -const ( - DistributedVirtualSwitchNicTeamingPolicyModeLoadbalance_ip = DistributedVirtualSwitchNicTeamingPolicyMode("loadbalance_ip") - DistributedVirtualSwitchNicTeamingPolicyModeLoadbalance_srcmac = DistributedVirtualSwitchNicTeamingPolicyMode("loadbalance_srcmac") - DistributedVirtualSwitchNicTeamingPolicyModeLoadbalance_srcid = DistributedVirtualSwitchNicTeamingPolicyMode("loadbalance_srcid") - DistributedVirtualSwitchNicTeamingPolicyModeFailover_explicit = DistributedVirtualSwitchNicTeamingPolicyMode("failover_explicit") - DistributedVirtualSwitchNicTeamingPolicyModeLoadbalance_loadbased = DistributedVirtualSwitchNicTeamingPolicyMode("loadbalance_loadbased") -) - -func init() { - t["DistributedVirtualSwitchNicTeamingPolicyMode"] = reflect.TypeOf((*DistributedVirtualSwitchNicTeamingPolicyMode)(nil)).Elem() -} - -type DistributedVirtualSwitchPortConnecteeConnecteeType string - -const ( - DistributedVirtualSwitchPortConnecteeConnecteeTypePnic = DistributedVirtualSwitchPortConnecteeConnecteeType("pnic") - DistributedVirtualSwitchPortConnecteeConnecteeTypeVmVnic = DistributedVirtualSwitchPortConnecteeConnecteeType("vmVnic") - DistributedVirtualSwitchPortConnecteeConnecteeTypeHostConsoleVnic = DistributedVirtualSwitchPortConnecteeConnecteeType("hostConsoleVnic") - DistributedVirtualSwitchPortConnecteeConnecteeTypeHostVmkVnic = DistributedVirtualSwitchPortConnecteeConnecteeType("hostVmkVnic") -) - -func init() { - t["DistributedVirtualSwitchPortConnecteeConnecteeType"] = reflect.TypeOf((*DistributedVirtualSwitchPortConnecteeConnecteeType)(nil)).Elem() -} - -type DistributedVirtualSwitchProductSpecOperationType string - -const ( - DistributedVirtualSwitchProductSpecOperationTypePreInstall = DistributedVirtualSwitchProductSpecOperationType("preInstall") - DistributedVirtualSwitchProductSpecOperationTypeUpgrade = DistributedVirtualSwitchProductSpecOperationType("upgrade") - DistributedVirtualSwitchProductSpecOperationTypeNotifyAvailableUpgrade = DistributedVirtualSwitchProductSpecOperationType("notifyAvailableUpgrade") - DistributedVirtualSwitchProductSpecOperationTypeProceedWithUpgrade = DistributedVirtualSwitchProductSpecOperationType("proceedWithUpgrade") - DistributedVirtualSwitchProductSpecOperationTypeUpdateBundleInfo = DistributedVirtualSwitchProductSpecOperationType("updateBundleInfo") -) - -func init() { - t["DistributedVirtualSwitchProductSpecOperationType"] = reflect.TypeOf((*DistributedVirtualSwitchProductSpecOperationType)(nil)).Elem() -} - -type DpmBehavior string - -const ( - DpmBehaviorManual = DpmBehavior("manual") - DpmBehaviorAutomated = DpmBehavior("automated") -) - -func init() { - t["DpmBehavior"] = reflect.TypeOf((*DpmBehavior)(nil)).Elem() -} - -type DrsBehavior string - -const ( - DrsBehaviorManual = DrsBehavior("manual") - DrsBehaviorPartiallyAutomated = DrsBehavior("partiallyAutomated") - DrsBehaviorFullyAutomated = DrsBehavior("fullyAutomated") -) - -func init() { - t["DrsBehavior"] = reflect.TypeOf((*DrsBehavior)(nil)).Elem() -} - -type DrsInjectorWorkloadCorrelationState string - -const ( - DrsInjectorWorkloadCorrelationStateCorrelated = DrsInjectorWorkloadCorrelationState("Correlated") - DrsInjectorWorkloadCorrelationStateUncorrelated = DrsInjectorWorkloadCorrelationState("Uncorrelated") -) - -func init() { - t["DrsInjectorWorkloadCorrelationState"] = reflect.TypeOf((*DrsInjectorWorkloadCorrelationState)(nil)).Elem() -} - -type DrsRecommendationReasonCode string - -const ( - DrsRecommendationReasonCodeFairnessCpuAvg = DrsRecommendationReasonCode("fairnessCpuAvg") - DrsRecommendationReasonCodeFairnessMemAvg = DrsRecommendationReasonCode("fairnessMemAvg") - DrsRecommendationReasonCodeJointAffin = DrsRecommendationReasonCode("jointAffin") - DrsRecommendationReasonCodeAntiAffin = DrsRecommendationReasonCode("antiAffin") - DrsRecommendationReasonCodeHostMaint = DrsRecommendationReasonCode("hostMaint") -) - -func init() { - t["DrsRecommendationReasonCode"] = reflect.TypeOf((*DrsRecommendationReasonCode)(nil)).Elem() -} - -type DvsFilterOnFailure string - -const ( - DvsFilterOnFailureFailOpen = DvsFilterOnFailure("failOpen") - DvsFilterOnFailureFailClosed = DvsFilterOnFailure("failClosed") -) - -func init() { - t["DvsFilterOnFailure"] = reflect.TypeOf((*DvsFilterOnFailure)(nil)).Elem() -} - -type DvsNetworkRuleDirectionType string - -const ( - DvsNetworkRuleDirectionTypeIncomingPackets = DvsNetworkRuleDirectionType("incomingPackets") - DvsNetworkRuleDirectionTypeOutgoingPackets = DvsNetworkRuleDirectionType("outgoingPackets") - DvsNetworkRuleDirectionTypeBoth = DvsNetworkRuleDirectionType("both") -) - -func init() { - t["DvsNetworkRuleDirectionType"] = reflect.TypeOf((*DvsNetworkRuleDirectionType)(nil)).Elem() -} - -type EntityImportType string - -const ( - EntityImportTypeCreateEntityWithNewIdentifier = EntityImportType("createEntityWithNewIdentifier") - EntityImportTypeCreateEntityWithOriginalIdentifier = EntityImportType("createEntityWithOriginalIdentifier") - EntityImportTypeApplyToEntitySpecified = EntityImportType("applyToEntitySpecified") -) - -func init() { - t["EntityImportType"] = reflect.TypeOf((*EntityImportType)(nil)).Elem() -} - -type EntityType string - -const ( - EntityTypeDistributedVirtualSwitch = EntityType("distributedVirtualSwitch") - EntityTypeDistributedVirtualPortgroup = EntityType("distributedVirtualPortgroup") -) - -func init() { - t["EntityType"] = reflect.TypeOf((*EntityType)(nil)).Elem() -} - -type EventAlarmExpressionComparisonOperator string - -const ( - EventAlarmExpressionComparisonOperatorEquals = EventAlarmExpressionComparisonOperator("equals") - EventAlarmExpressionComparisonOperatorNotEqualTo = EventAlarmExpressionComparisonOperator("notEqualTo") - EventAlarmExpressionComparisonOperatorStartsWith = EventAlarmExpressionComparisonOperator("startsWith") - EventAlarmExpressionComparisonOperatorDoesNotStartWith = EventAlarmExpressionComparisonOperator("doesNotStartWith") - EventAlarmExpressionComparisonOperatorEndsWith = EventAlarmExpressionComparisonOperator("endsWith") - EventAlarmExpressionComparisonOperatorDoesNotEndWith = EventAlarmExpressionComparisonOperator("doesNotEndWith") -) - -func init() { - t["EventAlarmExpressionComparisonOperator"] = reflect.TypeOf((*EventAlarmExpressionComparisonOperator)(nil)).Elem() -} - -type EventCategory string - -const ( - EventCategoryInfo = EventCategory("info") - EventCategoryWarning = EventCategory("warning") - EventCategoryError = EventCategory("error") - EventCategoryUser = EventCategory("user") -) - -func init() { - t["EventCategory"] = reflect.TypeOf((*EventCategory)(nil)).Elem() -} - -type EventEventSeverity string - -const ( - EventEventSeverityError = EventEventSeverity("error") - EventEventSeverityWarning = EventEventSeverity("warning") - EventEventSeverityInfo = EventEventSeverity("info") - EventEventSeverityUser = EventEventSeverity("user") -) - -func init() { - t["EventEventSeverity"] = reflect.TypeOf((*EventEventSeverity)(nil)).Elem() -} - -type EventFilterSpecRecursionOption string - -const ( - EventFilterSpecRecursionOptionSelf = EventFilterSpecRecursionOption("self") - EventFilterSpecRecursionOptionChildren = EventFilterSpecRecursionOption("children") - EventFilterSpecRecursionOptionAll = EventFilterSpecRecursionOption("all") -) - -func init() { - t["EventFilterSpecRecursionOption"] = reflect.TypeOf((*EventFilterSpecRecursionOption)(nil)).Elem() -} - -type FibreChannelPortType string - -const ( - FibreChannelPortTypeFabric = FibreChannelPortType("fabric") - FibreChannelPortTypeLoop = FibreChannelPortType("loop") - FibreChannelPortTypePointToPoint = FibreChannelPortType("pointToPoint") - FibreChannelPortTypeUnknown = FibreChannelPortType("unknown") -) - -func init() { - t["FibreChannelPortType"] = reflect.TypeOf((*FibreChannelPortType)(nil)).Elem() -} - -type FileSystemMountInfoVStorageSupportStatus string - -const ( - FileSystemMountInfoVStorageSupportStatusVStorageSupported = FileSystemMountInfoVStorageSupportStatus("vStorageSupported") - FileSystemMountInfoVStorageSupportStatusVStorageUnsupported = FileSystemMountInfoVStorageSupportStatus("vStorageUnsupported") - FileSystemMountInfoVStorageSupportStatusVStorageUnknown = FileSystemMountInfoVStorageSupportStatus("vStorageUnknown") -) - -func init() { - t["FileSystemMountInfoVStorageSupportStatus"] = reflect.TypeOf((*FileSystemMountInfoVStorageSupportStatus)(nil)).Elem() -} - -type FtIssuesOnHostHostSelectionType string - -const ( - FtIssuesOnHostHostSelectionTypeUser = FtIssuesOnHostHostSelectionType("user") - FtIssuesOnHostHostSelectionTypeVc = FtIssuesOnHostHostSelectionType("vc") - FtIssuesOnHostHostSelectionTypeDrs = FtIssuesOnHostHostSelectionType("drs") -) - -func init() { - t["FtIssuesOnHostHostSelectionType"] = reflect.TypeOf((*FtIssuesOnHostHostSelectionType)(nil)).Elem() -} - -type GuestFileType string - -const ( - GuestFileTypeFile = GuestFileType("file") - GuestFileTypeDirectory = GuestFileType("directory") - GuestFileTypeSymlink = GuestFileType("symlink") -) - -func init() { - t["GuestFileType"] = reflect.TypeOf((*GuestFileType)(nil)).Elem() -} - -type GuestInfoAppStateType string - -const ( - GuestInfoAppStateTypeNone = GuestInfoAppStateType("none") - GuestInfoAppStateTypeAppStateOk = GuestInfoAppStateType("appStateOk") - GuestInfoAppStateTypeAppStateNeedReset = GuestInfoAppStateType("appStateNeedReset") -) - -func init() { - t["GuestInfoAppStateType"] = reflect.TypeOf((*GuestInfoAppStateType)(nil)).Elem() -} - -type GuestOsDescriptorFirmwareType string - -const ( - GuestOsDescriptorFirmwareTypeBios = GuestOsDescriptorFirmwareType("bios") - GuestOsDescriptorFirmwareTypeEfi = GuestOsDescriptorFirmwareType("efi") -) - -func init() { - t["GuestOsDescriptorFirmwareType"] = reflect.TypeOf((*GuestOsDescriptorFirmwareType)(nil)).Elem() -} - -type GuestOsDescriptorSupportLevel string - -const ( - GuestOsDescriptorSupportLevelExperimental = GuestOsDescriptorSupportLevel("experimental") - GuestOsDescriptorSupportLevelLegacy = GuestOsDescriptorSupportLevel("legacy") - GuestOsDescriptorSupportLevelTerminated = GuestOsDescriptorSupportLevel("terminated") - GuestOsDescriptorSupportLevelSupported = GuestOsDescriptorSupportLevel("supported") - GuestOsDescriptorSupportLevelUnsupported = GuestOsDescriptorSupportLevel("unsupported") - GuestOsDescriptorSupportLevelDeprecated = GuestOsDescriptorSupportLevel("deprecated") - GuestOsDescriptorSupportLevelTechPreview = GuestOsDescriptorSupportLevel("techPreview") -) - -func init() { - t["GuestOsDescriptorSupportLevel"] = reflect.TypeOf((*GuestOsDescriptorSupportLevel)(nil)).Elem() -} - -type HostActiveDirectoryInfoDomainMembershipStatus string - -const ( - HostActiveDirectoryInfoDomainMembershipStatusUnknown = HostActiveDirectoryInfoDomainMembershipStatus("unknown") - HostActiveDirectoryInfoDomainMembershipStatusOk = HostActiveDirectoryInfoDomainMembershipStatus("ok") - HostActiveDirectoryInfoDomainMembershipStatusNoServers = HostActiveDirectoryInfoDomainMembershipStatus("noServers") - HostActiveDirectoryInfoDomainMembershipStatusClientTrustBroken = HostActiveDirectoryInfoDomainMembershipStatus("clientTrustBroken") - HostActiveDirectoryInfoDomainMembershipStatusServerTrustBroken = HostActiveDirectoryInfoDomainMembershipStatus("serverTrustBroken") - HostActiveDirectoryInfoDomainMembershipStatusInconsistentTrust = HostActiveDirectoryInfoDomainMembershipStatus("inconsistentTrust") - HostActiveDirectoryInfoDomainMembershipStatusOtherProblem = HostActiveDirectoryInfoDomainMembershipStatus("otherProblem") -) - -func init() { - t["HostActiveDirectoryInfoDomainMembershipStatus"] = reflect.TypeOf((*HostActiveDirectoryInfoDomainMembershipStatus)(nil)).Elem() -} - -type HostCapabilityFtUnsupportedReason string - -const ( - HostCapabilityFtUnsupportedReasonVMotionNotLicensed = HostCapabilityFtUnsupportedReason("vMotionNotLicensed") - HostCapabilityFtUnsupportedReasonMissingVMotionNic = HostCapabilityFtUnsupportedReason("missingVMotionNic") - HostCapabilityFtUnsupportedReasonMissingFTLoggingNic = HostCapabilityFtUnsupportedReason("missingFTLoggingNic") - HostCapabilityFtUnsupportedReasonFtNotLicensed = HostCapabilityFtUnsupportedReason("ftNotLicensed") - HostCapabilityFtUnsupportedReasonHaAgentIssue = HostCapabilityFtUnsupportedReason("haAgentIssue") -) - -func init() { - t["HostCapabilityFtUnsupportedReason"] = reflect.TypeOf((*HostCapabilityFtUnsupportedReason)(nil)).Elem() -} - -type HostCapabilityVmDirectPathGen2UnsupportedReason string - -const ( - HostCapabilityVmDirectPathGen2UnsupportedReasonHostNptIncompatibleProduct = HostCapabilityVmDirectPathGen2UnsupportedReason("hostNptIncompatibleProduct") - HostCapabilityVmDirectPathGen2UnsupportedReasonHostNptIncompatibleHardware = HostCapabilityVmDirectPathGen2UnsupportedReason("hostNptIncompatibleHardware") - HostCapabilityVmDirectPathGen2UnsupportedReasonHostNptDisabled = HostCapabilityVmDirectPathGen2UnsupportedReason("hostNptDisabled") -) - -func init() { - t["HostCapabilityVmDirectPathGen2UnsupportedReason"] = reflect.TypeOf((*HostCapabilityVmDirectPathGen2UnsupportedReason)(nil)).Elem() -} - -type HostConfigChangeMode string - -const ( - HostConfigChangeModeModify = HostConfigChangeMode("modify") - HostConfigChangeModeReplace = HostConfigChangeMode("replace") -) - -func init() { - t["HostConfigChangeMode"] = reflect.TypeOf((*HostConfigChangeMode)(nil)).Elem() -} - -type HostConfigChangeOperation string - -const ( - HostConfigChangeOperationAdd = HostConfigChangeOperation("add") - HostConfigChangeOperationRemove = HostConfigChangeOperation("remove") - HostConfigChangeOperationEdit = HostConfigChangeOperation("edit") -) - -func init() { - t["HostConfigChangeOperation"] = reflect.TypeOf((*HostConfigChangeOperation)(nil)).Elem() -} - -type HostCpuPackageVendor string - -const ( - HostCpuPackageVendorUnknown = HostCpuPackageVendor("unknown") - HostCpuPackageVendorIntel = HostCpuPackageVendor("intel") - HostCpuPackageVendorAmd = HostCpuPackageVendor("amd") -) - -func init() { - t["HostCpuPackageVendor"] = reflect.TypeOf((*HostCpuPackageVendor)(nil)).Elem() -} - -type HostCpuPowerManagementInfoPolicyType string - -const ( - HostCpuPowerManagementInfoPolicyTypeOff = HostCpuPowerManagementInfoPolicyType("off") - HostCpuPowerManagementInfoPolicyTypeStaticPolicy = HostCpuPowerManagementInfoPolicyType("staticPolicy") - HostCpuPowerManagementInfoPolicyTypeDynamicPolicy = HostCpuPowerManagementInfoPolicyType("dynamicPolicy") -) - -func init() { - t["HostCpuPowerManagementInfoPolicyType"] = reflect.TypeOf((*HostCpuPowerManagementInfoPolicyType)(nil)).Elem() -} - -type HostDasErrorEventHostDasErrorReason string - -const ( - HostDasErrorEventHostDasErrorReasonConfigFailed = HostDasErrorEventHostDasErrorReason("configFailed") - HostDasErrorEventHostDasErrorReasonTimeout = HostDasErrorEventHostDasErrorReason("timeout") - HostDasErrorEventHostDasErrorReasonCommunicationInitFailed = HostDasErrorEventHostDasErrorReason("communicationInitFailed") - HostDasErrorEventHostDasErrorReasonHealthCheckScriptFailed = HostDasErrorEventHostDasErrorReason("healthCheckScriptFailed") - HostDasErrorEventHostDasErrorReasonAgentFailed = HostDasErrorEventHostDasErrorReason("agentFailed") - HostDasErrorEventHostDasErrorReasonAgentShutdown = HostDasErrorEventHostDasErrorReason("agentShutdown") - HostDasErrorEventHostDasErrorReasonIsolationAddressUnpingable = HostDasErrorEventHostDasErrorReason("isolationAddressUnpingable") - HostDasErrorEventHostDasErrorReasonOther = HostDasErrorEventHostDasErrorReason("other") -) - -func init() { - t["HostDasErrorEventHostDasErrorReason"] = reflect.TypeOf((*HostDasErrorEventHostDasErrorReason)(nil)).Elem() -} - -type HostDigestInfoDigestMethodType string - -const ( - HostDigestInfoDigestMethodTypeSHA1 = HostDigestInfoDigestMethodType("SHA1") - HostDigestInfoDigestMethodTypeMD5 = HostDigestInfoDigestMethodType("MD5") -) - -func init() { - t["HostDigestInfoDigestMethodType"] = reflect.TypeOf((*HostDigestInfoDigestMethodType)(nil)).Elem() -} - -type HostDisconnectedEventReasonCode string - -const ( - HostDisconnectedEventReasonCodeSslThumbprintVerifyFailed = HostDisconnectedEventReasonCode("sslThumbprintVerifyFailed") - HostDisconnectedEventReasonCodeLicenseExpired = HostDisconnectedEventReasonCode("licenseExpired") - HostDisconnectedEventReasonCodeAgentUpgrade = HostDisconnectedEventReasonCode("agentUpgrade") - HostDisconnectedEventReasonCodeUserRequest = HostDisconnectedEventReasonCode("userRequest") - HostDisconnectedEventReasonCodeInsufficientLicenses = HostDisconnectedEventReasonCode("insufficientLicenses") - HostDisconnectedEventReasonCodeAgentOutOfDate = HostDisconnectedEventReasonCode("agentOutOfDate") - HostDisconnectedEventReasonCodePasswordDecryptFailure = HostDisconnectedEventReasonCode("passwordDecryptFailure") - HostDisconnectedEventReasonCodeUnknown = HostDisconnectedEventReasonCode("unknown") - HostDisconnectedEventReasonCodeVcVRAMCapacityExceeded = HostDisconnectedEventReasonCode("vcVRAMCapacityExceeded") -) - -func init() { - t["HostDisconnectedEventReasonCode"] = reflect.TypeOf((*HostDisconnectedEventReasonCode)(nil)).Elem() -} - -type HostDiskPartitionInfoPartitionFormat string - -const ( - HostDiskPartitionInfoPartitionFormatGpt = HostDiskPartitionInfoPartitionFormat("gpt") - HostDiskPartitionInfoPartitionFormatMbr = HostDiskPartitionInfoPartitionFormat("mbr") - HostDiskPartitionInfoPartitionFormatUnknown = HostDiskPartitionInfoPartitionFormat("unknown") -) - -func init() { - t["HostDiskPartitionInfoPartitionFormat"] = reflect.TypeOf((*HostDiskPartitionInfoPartitionFormat)(nil)).Elem() -} - -type HostDiskPartitionInfoType string - -const ( - HostDiskPartitionInfoTypeNone = HostDiskPartitionInfoType("none") - HostDiskPartitionInfoTypeVmfs = HostDiskPartitionInfoType("vmfs") - HostDiskPartitionInfoTypeLinuxNative = HostDiskPartitionInfoType("linuxNative") - HostDiskPartitionInfoTypeLinuxSwap = HostDiskPartitionInfoType("linuxSwap") - HostDiskPartitionInfoTypeExtended = HostDiskPartitionInfoType("extended") - HostDiskPartitionInfoTypeNtfs = HostDiskPartitionInfoType("ntfs") - HostDiskPartitionInfoTypeVmkDiagnostic = HostDiskPartitionInfoType("vmkDiagnostic") - HostDiskPartitionInfoTypeVffs = HostDiskPartitionInfoType("vffs") -) - -func init() { - t["HostDiskPartitionInfoType"] = reflect.TypeOf((*HostDiskPartitionInfoType)(nil)).Elem() -} - -type HostFeatureVersionKey string - -const ( - HostFeatureVersionKeyFaultTolerance = HostFeatureVersionKey("faultTolerance") -) - -func init() { - t["HostFeatureVersionKey"] = reflect.TypeOf((*HostFeatureVersionKey)(nil)).Elem() -} - -type HostFirewallRuleDirection string - -const ( - HostFirewallRuleDirectionInbound = HostFirewallRuleDirection("inbound") - HostFirewallRuleDirectionOutbound = HostFirewallRuleDirection("outbound") -) - -func init() { - t["HostFirewallRuleDirection"] = reflect.TypeOf((*HostFirewallRuleDirection)(nil)).Elem() -} - -type HostFirewallRulePortType string - -const ( - HostFirewallRulePortTypeSrc = HostFirewallRulePortType("src") - HostFirewallRulePortTypeDst = HostFirewallRulePortType("dst") -) - -func init() { - t["HostFirewallRulePortType"] = reflect.TypeOf((*HostFirewallRulePortType)(nil)).Elem() -} - -type HostFirewallRuleProtocol string - -const ( - HostFirewallRuleProtocolTcp = HostFirewallRuleProtocol("tcp") - HostFirewallRuleProtocolUdp = HostFirewallRuleProtocol("udp") -) - -func init() { - t["HostFirewallRuleProtocol"] = reflect.TypeOf((*HostFirewallRuleProtocol)(nil)).Elem() -} - -type HostGraphicsInfoGraphicsType string - -const ( - HostGraphicsInfoGraphicsTypeBasic = HostGraphicsInfoGraphicsType("basic") - HostGraphicsInfoGraphicsTypeShared = HostGraphicsInfoGraphicsType("shared") - HostGraphicsInfoGraphicsTypeDirect = HostGraphicsInfoGraphicsType("direct") -) - -func init() { - t["HostGraphicsInfoGraphicsType"] = reflect.TypeOf((*HostGraphicsInfoGraphicsType)(nil)).Elem() -} - -type HostHardwareElementStatus string - -const ( - HostHardwareElementStatusUnknown = HostHardwareElementStatus("Unknown") - HostHardwareElementStatusGreen = HostHardwareElementStatus("Green") - HostHardwareElementStatusYellow = HostHardwareElementStatus("Yellow") - HostHardwareElementStatusRed = HostHardwareElementStatus("Red") -) - -func init() { - t["HostHardwareElementStatus"] = reflect.TypeOf((*HostHardwareElementStatus)(nil)).Elem() -} - -type HostImageAcceptanceLevel string - -const ( - HostImageAcceptanceLevelVmware_certified = HostImageAcceptanceLevel("vmware_certified") - HostImageAcceptanceLevelVmware_accepted = HostImageAcceptanceLevel("vmware_accepted") - HostImageAcceptanceLevelPartner = HostImageAcceptanceLevel("partner") - HostImageAcceptanceLevelCommunity = HostImageAcceptanceLevel("community") -) - -func init() { - t["HostImageAcceptanceLevel"] = reflect.TypeOf((*HostImageAcceptanceLevel)(nil)).Elem() -} - -type HostIncompatibleForFaultToleranceReason string - -const ( - HostIncompatibleForFaultToleranceReasonProduct = HostIncompatibleForFaultToleranceReason("product") - HostIncompatibleForFaultToleranceReasonProcessor = HostIncompatibleForFaultToleranceReason("processor") -) - -func init() { - t["HostIncompatibleForFaultToleranceReason"] = reflect.TypeOf((*HostIncompatibleForFaultToleranceReason)(nil)).Elem() -} - -type HostIncompatibleForRecordReplayReason string - -const ( - HostIncompatibleForRecordReplayReasonProduct = HostIncompatibleForRecordReplayReason("product") - HostIncompatibleForRecordReplayReasonProcessor = HostIncompatibleForRecordReplayReason("processor") -) - -func init() { - t["HostIncompatibleForRecordReplayReason"] = reflect.TypeOf((*HostIncompatibleForRecordReplayReason)(nil)).Elem() -} - -type HostInternetScsiHbaChapAuthenticationType string - -const ( - HostInternetScsiHbaChapAuthenticationTypeChapProhibited = HostInternetScsiHbaChapAuthenticationType("chapProhibited") - HostInternetScsiHbaChapAuthenticationTypeChapDiscouraged = HostInternetScsiHbaChapAuthenticationType("chapDiscouraged") - HostInternetScsiHbaChapAuthenticationTypeChapPreferred = HostInternetScsiHbaChapAuthenticationType("chapPreferred") - HostInternetScsiHbaChapAuthenticationTypeChapRequired = HostInternetScsiHbaChapAuthenticationType("chapRequired") -) - -func init() { - t["HostInternetScsiHbaChapAuthenticationType"] = reflect.TypeOf((*HostInternetScsiHbaChapAuthenticationType)(nil)).Elem() -} - -type HostInternetScsiHbaDigestType string - -const ( - HostInternetScsiHbaDigestTypeDigestProhibited = HostInternetScsiHbaDigestType("digestProhibited") - HostInternetScsiHbaDigestTypeDigestDiscouraged = HostInternetScsiHbaDigestType("digestDiscouraged") - HostInternetScsiHbaDigestTypeDigestPreferred = HostInternetScsiHbaDigestType("digestPreferred") - HostInternetScsiHbaDigestTypeDigestRequired = HostInternetScsiHbaDigestType("digestRequired") -) - -func init() { - t["HostInternetScsiHbaDigestType"] = reflect.TypeOf((*HostInternetScsiHbaDigestType)(nil)).Elem() -} - -type HostInternetScsiHbaNetworkBindingSupportType string - -const ( - HostInternetScsiHbaNetworkBindingSupportTypeNotsupported = HostInternetScsiHbaNetworkBindingSupportType("notsupported") - HostInternetScsiHbaNetworkBindingSupportTypeOptional = HostInternetScsiHbaNetworkBindingSupportType("optional") - HostInternetScsiHbaNetworkBindingSupportTypeRequired = HostInternetScsiHbaNetworkBindingSupportType("required") -) - -func init() { - t["HostInternetScsiHbaNetworkBindingSupportType"] = reflect.TypeOf((*HostInternetScsiHbaNetworkBindingSupportType)(nil)).Elem() -} - -type HostInternetScsiHbaStaticTargetTargetDiscoveryMethod string - -const ( - HostInternetScsiHbaStaticTargetTargetDiscoveryMethodStaticMethod = HostInternetScsiHbaStaticTargetTargetDiscoveryMethod("staticMethod") - HostInternetScsiHbaStaticTargetTargetDiscoveryMethodSendTargetMethod = HostInternetScsiHbaStaticTargetTargetDiscoveryMethod("sendTargetMethod") - HostInternetScsiHbaStaticTargetTargetDiscoveryMethodSlpMethod = HostInternetScsiHbaStaticTargetTargetDiscoveryMethod("slpMethod") - HostInternetScsiHbaStaticTargetTargetDiscoveryMethodIsnsMethod = HostInternetScsiHbaStaticTargetTargetDiscoveryMethod("isnsMethod") - HostInternetScsiHbaStaticTargetTargetDiscoveryMethodUnknownMethod = HostInternetScsiHbaStaticTargetTargetDiscoveryMethod("unknownMethod") -) - -func init() { - t["HostInternetScsiHbaStaticTargetTargetDiscoveryMethod"] = reflect.TypeOf((*HostInternetScsiHbaStaticTargetTargetDiscoveryMethod)(nil)).Elem() -} - -type HostIpConfigIpV6AddressConfigType string - -const ( - HostIpConfigIpV6AddressConfigTypeOther = HostIpConfigIpV6AddressConfigType("other") - HostIpConfigIpV6AddressConfigTypeManual = HostIpConfigIpV6AddressConfigType("manual") - HostIpConfigIpV6AddressConfigTypeDhcp = HostIpConfigIpV6AddressConfigType("dhcp") - HostIpConfigIpV6AddressConfigTypeLinklayer = HostIpConfigIpV6AddressConfigType("linklayer") - HostIpConfigIpV6AddressConfigTypeRandom = HostIpConfigIpV6AddressConfigType("random") -) - -func init() { - t["HostIpConfigIpV6AddressConfigType"] = reflect.TypeOf((*HostIpConfigIpV6AddressConfigType)(nil)).Elem() -} - -type HostIpConfigIpV6AddressStatus string - -const ( - HostIpConfigIpV6AddressStatusPreferred = HostIpConfigIpV6AddressStatus("preferred") - HostIpConfigIpV6AddressStatusDeprecated = HostIpConfigIpV6AddressStatus("deprecated") - HostIpConfigIpV6AddressStatusInvalid = HostIpConfigIpV6AddressStatus("invalid") - HostIpConfigIpV6AddressStatusInaccessible = HostIpConfigIpV6AddressStatus("inaccessible") - HostIpConfigIpV6AddressStatusUnknown = HostIpConfigIpV6AddressStatus("unknown") - HostIpConfigIpV6AddressStatusTentative = HostIpConfigIpV6AddressStatus("tentative") - HostIpConfigIpV6AddressStatusDuplicate = HostIpConfigIpV6AddressStatus("duplicate") -) - -func init() { - t["HostIpConfigIpV6AddressStatus"] = reflect.TypeOf((*HostIpConfigIpV6AddressStatus)(nil)).Elem() -} - -type HostLicensableResourceKey string - -const ( - HostLicensableResourceKeyNumCpuPackages = HostLicensableResourceKey("numCpuPackages") - HostLicensableResourceKeyNumCpuCores = HostLicensableResourceKey("numCpuCores") - HostLicensableResourceKeyMemorySize = HostLicensableResourceKey("memorySize") - HostLicensableResourceKeyMemoryForVms = HostLicensableResourceKey("memoryForVms") - HostLicensableResourceKeyNumVmsStarted = HostLicensableResourceKey("numVmsStarted") - HostLicensableResourceKeyNumVmsStarting = HostLicensableResourceKey("numVmsStarting") -) - -func init() { - t["HostLicensableResourceKey"] = reflect.TypeOf((*HostLicensableResourceKey)(nil)).Elem() -} - -type HostLowLevelProvisioningManagerReloadTarget string - -const ( - HostLowLevelProvisioningManagerReloadTargetCurrentConfig = HostLowLevelProvisioningManagerReloadTarget("currentConfig") - HostLowLevelProvisioningManagerReloadTargetSnapshotConfig = HostLowLevelProvisioningManagerReloadTarget("snapshotConfig") -) - -func init() { - t["HostLowLevelProvisioningManagerReloadTarget"] = reflect.TypeOf((*HostLowLevelProvisioningManagerReloadTarget)(nil)).Elem() -} - -type HostMountInfoInaccessibleReason string - -const ( - HostMountInfoInaccessibleReasonAllPathsDown_Start = HostMountInfoInaccessibleReason("AllPathsDown_Start") - HostMountInfoInaccessibleReasonAllPathsDown_Timeout = HostMountInfoInaccessibleReason("AllPathsDown_Timeout") - HostMountInfoInaccessibleReasonPermanentDeviceLoss = HostMountInfoInaccessibleReason("PermanentDeviceLoss") -) - -func init() { - t["HostMountInfoInaccessibleReason"] = reflect.TypeOf((*HostMountInfoInaccessibleReason)(nil)).Elem() -} - -type HostMountMode string - -const ( - HostMountModeReadWrite = HostMountMode("readWrite") - HostMountModeReadOnly = HostMountMode("readOnly") -) - -func init() { - t["HostMountMode"] = reflect.TypeOf((*HostMountMode)(nil)).Elem() -} - -type HostNetStackInstanceCongestionControlAlgorithmType string - -const ( - HostNetStackInstanceCongestionControlAlgorithmTypeNewreno = HostNetStackInstanceCongestionControlAlgorithmType("newreno") - HostNetStackInstanceCongestionControlAlgorithmTypeCubic = HostNetStackInstanceCongestionControlAlgorithmType("cubic") -) - -func init() { - t["HostNetStackInstanceCongestionControlAlgorithmType"] = reflect.TypeOf((*HostNetStackInstanceCongestionControlAlgorithmType)(nil)).Elem() -} - -type HostNetStackInstanceSystemStackKey string - -const ( - HostNetStackInstanceSystemStackKeyDefaultTcpipStack = HostNetStackInstanceSystemStackKey("defaultTcpipStack") -) - -func init() { - t["HostNetStackInstanceSystemStackKey"] = reflect.TypeOf((*HostNetStackInstanceSystemStackKey)(nil)).Elem() -} - -type HostNumericSensorHealthState string - -const ( - HostNumericSensorHealthStateUnknown = HostNumericSensorHealthState("unknown") - HostNumericSensorHealthStateGreen = HostNumericSensorHealthState("green") - HostNumericSensorHealthStateYellow = HostNumericSensorHealthState("yellow") - HostNumericSensorHealthStateRed = HostNumericSensorHealthState("red") -) - -func init() { - t["HostNumericSensorHealthState"] = reflect.TypeOf((*HostNumericSensorHealthState)(nil)).Elem() -} - -type HostNumericSensorType string - -const ( - HostNumericSensorTypeFan = HostNumericSensorType("fan") - HostNumericSensorTypePower = HostNumericSensorType("power") - HostNumericSensorTypeTemperature = HostNumericSensorType("temperature") - HostNumericSensorTypeVoltage = HostNumericSensorType("voltage") - HostNumericSensorTypeOther = HostNumericSensorType("other") -) - -func init() { - t["HostNumericSensorType"] = reflect.TypeOf((*HostNumericSensorType)(nil)).Elem() -} - -type HostPatchManagerInstallState string - -const ( - HostPatchManagerInstallStateHostRestarted = HostPatchManagerInstallState("hostRestarted") - HostPatchManagerInstallStateImageActive = HostPatchManagerInstallState("imageActive") -) - -func init() { - t["HostPatchManagerInstallState"] = reflect.TypeOf((*HostPatchManagerInstallState)(nil)).Elem() -} - -type HostPatchManagerIntegrityStatus string - -const ( - HostPatchManagerIntegrityStatusValidated = HostPatchManagerIntegrityStatus("validated") - HostPatchManagerIntegrityStatusKeyNotFound = HostPatchManagerIntegrityStatus("keyNotFound") - HostPatchManagerIntegrityStatusKeyRevoked = HostPatchManagerIntegrityStatus("keyRevoked") - HostPatchManagerIntegrityStatusKeyExpired = HostPatchManagerIntegrityStatus("keyExpired") - HostPatchManagerIntegrityStatusDigestMismatch = HostPatchManagerIntegrityStatus("digestMismatch") - HostPatchManagerIntegrityStatusNotEnoughSignatures = HostPatchManagerIntegrityStatus("notEnoughSignatures") - HostPatchManagerIntegrityStatusValidationError = HostPatchManagerIntegrityStatus("validationError") -) - -func init() { - t["HostPatchManagerIntegrityStatus"] = reflect.TypeOf((*HostPatchManagerIntegrityStatus)(nil)).Elem() -} - -type HostPatchManagerReason string - -const ( - HostPatchManagerReasonObsoleted = HostPatchManagerReason("obsoleted") - HostPatchManagerReasonMissingPatch = HostPatchManagerReason("missingPatch") - HostPatchManagerReasonMissingLib = HostPatchManagerReason("missingLib") - HostPatchManagerReasonHasDependentPatch = HostPatchManagerReason("hasDependentPatch") - HostPatchManagerReasonConflictPatch = HostPatchManagerReason("conflictPatch") - HostPatchManagerReasonConflictLib = HostPatchManagerReason("conflictLib") -) - -func init() { - t["HostPatchManagerReason"] = reflect.TypeOf((*HostPatchManagerReason)(nil)).Elem() -} - -type HostPowerOperationType string - -const ( - HostPowerOperationTypePowerOn = HostPowerOperationType("powerOn") - HostPowerOperationTypePowerOff = HostPowerOperationType("powerOff") -) - -func init() { - t["HostPowerOperationType"] = reflect.TypeOf((*HostPowerOperationType)(nil)).Elem() -} - -type HostProfileManagerAnswerFileStatus string - -const ( - HostProfileManagerAnswerFileStatusValid = HostProfileManagerAnswerFileStatus("valid") - HostProfileManagerAnswerFileStatusInvalid = HostProfileManagerAnswerFileStatus("invalid") - HostProfileManagerAnswerFileStatusUnknown = HostProfileManagerAnswerFileStatus("unknown") -) - -func init() { - t["HostProfileManagerAnswerFileStatus"] = reflect.TypeOf((*HostProfileManagerAnswerFileStatus)(nil)).Elem() -} - -type HostReplayUnsupportedReason string - -const ( - HostReplayUnsupportedReasonIncompatibleProduct = HostReplayUnsupportedReason("incompatibleProduct") - HostReplayUnsupportedReasonIncompatibleCpu = HostReplayUnsupportedReason("incompatibleCpu") - HostReplayUnsupportedReasonHvDisabled = HostReplayUnsupportedReason("hvDisabled") - HostReplayUnsupportedReasonCpuidLimitSet = HostReplayUnsupportedReason("cpuidLimitSet") - HostReplayUnsupportedReasonOldBIOS = HostReplayUnsupportedReason("oldBIOS") - HostReplayUnsupportedReasonUnknown = HostReplayUnsupportedReason("unknown") -) - -func init() { - t["HostReplayUnsupportedReason"] = reflect.TypeOf((*HostReplayUnsupportedReason)(nil)).Elem() -} - -type HostRuntimeInfoNetStackInstanceRuntimeInfoState string - -const ( - HostRuntimeInfoNetStackInstanceRuntimeInfoStateInactive = HostRuntimeInfoNetStackInstanceRuntimeInfoState("inactive") - HostRuntimeInfoNetStackInstanceRuntimeInfoStateActive = HostRuntimeInfoNetStackInstanceRuntimeInfoState("active") - HostRuntimeInfoNetStackInstanceRuntimeInfoStateDeactivating = HostRuntimeInfoNetStackInstanceRuntimeInfoState("deactivating") - HostRuntimeInfoNetStackInstanceRuntimeInfoStateActivating = HostRuntimeInfoNetStackInstanceRuntimeInfoState("activating") -) - -func init() { - t["HostRuntimeInfoNetStackInstanceRuntimeInfoState"] = reflect.TypeOf((*HostRuntimeInfoNetStackInstanceRuntimeInfoState)(nil)).Elem() -} - -type HostServicePolicy string - -const ( - HostServicePolicyOn = HostServicePolicy("on") - HostServicePolicyAutomatic = HostServicePolicy("automatic") - HostServicePolicyOff = HostServicePolicy("off") -) - -func init() { - t["HostServicePolicy"] = reflect.TypeOf((*HostServicePolicy)(nil)).Elem() -} - -type HostSnmpAgentCapability string - -const ( - HostSnmpAgentCapabilityCOMPLETE = HostSnmpAgentCapability("COMPLETE") - HostSnmpAgentCapabilityDIAGNOSTICS = HostSnmpAgentCapability("DIAGNOSTICS") - HostSnmpAgentCapabilityCONFIGURATION = HostSnmpAgentCapability("CONFIGURATION") -) - -func init() { - t["HostSnmpAgentCapability"] = reflect.TypeOf((*HostSnmpAgentCapability)(nil)).Elem() -} - -type HostStandbyMode string - -const ( - HostStandbyModeEntering = HostStandbyMode("entering") - HostStandbyModeExiting = HostStandbyMode("exiting") - HostStandbyModeIn = HostStandbyMode("in") - HostStandbyModeNone = HostStandbyMode("none") -) - -func init() { - t["HostStandbyMode"] = reflect.TypeOf((*HostStandbyMode)(nil)).Elem() -} - -type HostSystemConnectionState string - -const ( - HostSystemConnectionStateConnected = HostSystemConnectionState("connected") - HostSystemConnectionStateNotResponding = HostSystemConnectionState("notResponding") - HostSystemConnectionStateDisconnected = HostSystemConnectionState("disconnected") -) - -func init() { - t["HostSystemConnectionState"] = reflect.TypeOf((*HostSystemConnectionState)(nil)).Elem() -} - -type HostSystemIdentificationInfoIdentifier string - -const ( - HostSystemIdentificationInfoIdentifierAssetTag = HostSystemIdentificationInfoIdentifier("AssetTag") - HostSystemIdentificationInfoIdentifierServiceTag = HostSystemIdentificationInfoIdentifier("ServiceTag") - HostSystemIdentificationInfoIdentifierOemSpecificString = HostSystemIdentificationInfoIdentifier("OemSpecificString") -) - -func init() { - t["HostSystemIdentificationInfoIdentifier"] = reflect.TypeOf((*HostSystemIdentificationInfoIdentifier)(nil)).Elem() -} - -type HostSystemPowerState string - -const ( - HostSystemPowerStatePoweredOn = HostSystemPowerState("poweredOn") - HostSystemPowerStatePoweredOff = HostSystemPowerState("poweredOff") - HostSystemPowerStateStandBy = HostSystemPowerState("standBy") - HostSystemPowerStateUnknown = HostSystemPowerState("unknown") -) - -func init() { - t["HostSystemPowerState"] = reflect.TypeOf((*HostSystemPowerState)(nil)).Elem() -} - -type HostUnresolvedVmfsExtentUnresolvedReason string - -const ( - HostUnresolvedVmfsExtentUnresolvedReasonDiskIdMismatch = HostUnresolvedVmfsExtentUnresolvedReason("diskIdMismatch") - HostUnresolvedVmfsExtentUnresolvedReasonUuidConflict = HostUnresolvedVmfsExtentUnresolvedReason("uuidConflict") -) - -func init() { - t["HostUnresolvedVmfsExtentUnresolvedReason"] = reflect.TypeOf((*HostUnresolvedVmfsExtentUnresolvedReason)(nil)).Elem() -} - -type HostUnresolvedVmfsResolutionSpecVmfsUuidResolution string - -const ( - HostUnresolvedVmfsResolutionSpecVmfsUuidResolutionResignature = HostUnresolvedVmfsResolutionSpecVmfsUuidResolution("resignature") - HostUnresolvedVmfsResolutionSpecVmfsUuidResolutionForceMount = HostUnresolvedVmfsResolutionSpecVmfsUuidResolution("forceMount") -) - -func init() { - t["HostUnresolvedVmfsResolutionSpecVmfsUuidResolution"] = reflect.TypeOf((*HostUnresolvedVmfsResolutionSpecVmfsUuidResolution)(nil)).Elem() -} - -type HostVirtualNicManagerNicType string - -const ( - HostVirtualNicManagerNicTypeVmotion = HostVirtualNicManagerNicType("vmotion") - HostVirtualNicManagerNicTypeFaultToleranceLogging = HostVirtualNicManagerNicType("faultToleranceLogging") - HostVirtualNicManagerNicTypeVSphereReplication = HostVirtualNicManagerNicType("vSphereReplication") - HostVirtualNicManagerNicTypeManagement = HostVirtualNicManagerNicType("management") - HostVirtualNicManagerNicTypeVsan = HostVirtualNicManagerNicType("vsan") -) - -func init() { - t["HostVirtualNicManagerNicType"] = reflect.TypeOf((*HostVirtualNicManagerNicType)(nil)).Elem() -} - -type HostVmciAccessManagerMode string - -const ( - HostVmciAccessManagerModeGrant = HostVmciAccessManagerMode("grant") - HostVmciAccessManagerModeReplace = HostVmciAccessManagerMode("replace") - HostVmciAccessManagerModeRevoke = HostVmciAccessManagerMode("revoke") -) - -func init() { - t["HostVmciAccessManagerMode"] = reflect.TypeOf((*HostVmciAccessManagerMode)(nil)).Elem() -} - -type HttpNfcLeaseState string - -const ( - HttpNfcLeaseStateInitializing = HttpNfcLeaseState("initializing") - HttpNfcLeaseStateReady = HttpNfcLeaseState("ready") - HttpNfcLeaseStateDone = HttpNfcLeaseState("done") - HttpNfcLeaseStateError = HttpNfcLeaseState("error") -) - -func init() { - t["HttpNfcLeaseState"] = reflect.TypeOf((*HttpNfcLeaseState)(nil)).Elem() -} - -type InternetScsiSnsDiscoveryMethod string - -const ( - InternetScsiSnsDiscoveryMethodIsnsStatic = InternetScsiSnsDiscoveryMethod("isnsStatic") - InternetScsiSnsDiscoveryMethodIsnsDhcp = InternetScsiSnsDiscoveryMethod("isnsDhcp") - InternetScsiSnsDiscoveryMethodIsnsSlp = InternetScsiSnsDiscoveryMethod("isnsSlp") -) - -func init() { - t["InternetScsiSnsDiscoveryMethod"] = reflect.TypeOf((*InternetScsiSnsDiscoveryMethod)(nil)).Elem() -} - -type InvalidDasConfigArgumentEntryForInvalidArgument string - -const ( - InvalidDasConfigArgumentEntryForInvalidArgumentAdmissionControl = InvalidDasConfigArgumentEntryForInvalidArgument("admissionControl") - InvalidDasConfigArgumentEntryForInvalidArgumentUserHeartbeatDs = InvalidDasConfigArgumentEntryForInvalidArgument("userHeartbeatDs") - InvalidDasConfigArgumentEntryForInvalidArgumentVmConfig = InvalidDasConfigArgumentEntryForInvalidArgument("vmConfig") -) - -func init() { - t["InvalidDasConfigArgumentEntryForInvalidArgument"] = reflect.TypeOf((*InvalidDasConfigArgumentEntryForInvalidArgument)(nil)).Elem() -} - -type InvalidProfileReferenceHostReason string - -const ( - InvalidProfileReferenceHostReasonIncompatibleVersion = InvalidProfileReferenceHostReason("incompatibleVersion") - InvalidProfileReferenceHostReasonMissingReferenceHost = InvalidProfileReferenceHostReason("missingReferenceHost") -) - -func init() { - t["InvalidProfileReferenceHostReason"] = reflect.TypeOf((*InvalidProfileReferenceHostReason)(nil)).Elem() -} - -type IscsiPortInfoPathStatus string - -const ( - IscsiPortInfoPathStatusNotUsed = IscsiPortInfoPathStatus("notUsed") - IscsiPortInfoPathStatusActive = IscsiPortInfoPathStatus("active") - IscsiPortInfoPathStatusStandBy = IscsiPortInfoPathStatus("standBy") - IscsiPortInfoPathStatusLastActive = IscsiPortInfoPathStatus("lastActive") -) - -func init() { - t["IscsiPortInfoPathStatus"] = reflect.TypeOf((*IscsiPortInfoPathStatus)(nil)).Elem() -} - -type LatencySensitivitySensitivityLevel string - -const ( - LatencySensitivitySensitivityLevelLow = LatencySensitivitySensitivityLevel("low") - LatencySensitivitySensitivityLevelNormal = LatencySensitivitySensitivityLevel("normal") - LatencySensitivitySensitivityLevelMedium = LatencySensitivitySensitivityLevel("medium") - LatencySensitivitySensitivityLevelHigh = LatencySensitivitySensitivityLevel("high") - LatencySensitivitySensitivityLevelCustom = LatencySensitivitySensitivityLevel("custom") -) - -func init() { - t["LatencySensitivitySensitivityLevel"] = reflect.TypeOf((*LatencySensitivitySensitivityLevel)(nil)).Elem() -} - -type LicenseAssignmentFailedReason string - -const ( - LicenseAssignmentFailedReasonKeyEntityMismatch = LicenseAssignmentFailedReason("keyEntityMismatch") - LicenseAssignmentFailedReasonDowngradeDisallowed = LicenseAssignmentFailedReason("downgradeDisallowed") - LicenseAssignmentFailedReasonInventoryNotManageableByVirtualCenter = LicenseAssignmentFailedReason("inventoryNotManageableByVirtualCenter") - LicenseAssignmentFailedReasonHostsUnmanageableByVirtualCenterWithoutLicenseServer = LicenseAssignmentFailedReason("hostsUnmanageableByVirtualCenterWithoutLicenseServer") -) - -func init() { - t["LicenseAssignmentFailedReason"] = reflect.TypeOf((*LicenseAssignmentFailedReason)(nil)).Elem() -} - -type LicenseFeatureInfoSourceRestriction string - -const ( - LicenseFeatureInfoSourceRestrictionUnrestricted = LicenseFeatureInfoSourceRestriction("unrestricted") - LicenseFeatureInfoSourceRestrictionServed = LicenseFeatureInfoSourceRestriction("served") - LicenseFeatureInfoSourceRestrictionFile = LicenseFeatureInfoSourceRestriction("file") -) - -func init() { - t["LicenseFeatureInfoSourceRestriction"] = reflect.TypeOf((*LicenseFeatureInfoSourceRestriction)(nil)).Elem() -} - -type LicenseFeatureInfoState string - -const ( - LicenseFeatureInfoStateEnabled = LicenseFeatureInfoState("enabled") - LicenseFeatureInfoStateDisabled = LicenseFeatureInfoState("disabled") - LicenseFeatureInfoStateOptional = LicenseFeatureInfoState("optional") -) - -func init() { - t["LicenseFeatureInfoState"] = reflect.TypeOf((*LicenseFeatureInfoState)(nil)).Elem() -} - -type LicenseFeatureInfoUnit string - -const ( - LicenseFeatureInfoUnitHost = LicenseFeatureInfoUnit("host") - LicenseFeatureInfoUnitCpuCore = LicenseFeatureInfoUnit("cpuCore") - LicenseFeatureInfoUnitCpuPackage = LicenseFeatureInfoUnit("cpuPackage") - LicenseFeatureInfoUnitServer = LicenseFeatureInfoUnit("server") - LicenseFeatureInfoUnitVm = LicenseFeatureInfoUnit("vm") -) - -func init() { - t["LicenseFeatureInfoUnit"] = reflect.TypeOf((*LicenseFeatureInfoUnit)(nil)).Elem() -} - -type LicenseManagerLicenseKey string - -const ( - LicenseManagerLicenseKeyEsxFull = LicenseManagerLicenseKey("esxFull") - LicenseManagerLicenseKeyEsxVmtn = LicenseManagerLicenseKey("esxVmtn") - LicenseManagerLicenseKeyEsxExpress = LicenseManagerLicenseKey("esxExpress") - LicenseManagerLicenseKeySan = LicenseManagerLicenseKey("san") - LicenseManagerLicenseKeyIscsi = LicenseManagerLicenseKey("iscsi") - LicenseManagerLicenseKeyNas = LicenseManagerLicenseKey("nas") - LicenseManagerLicenseKeyVsmp = LicenseManagerLicenseKey("vsmp") - LicenseManagerLicenseKeyBackup = LicenseManagerLicenseKey("backup") - LicenseManagerLicenseKeyVc = LicenseManagerLicenseKey("vc") - LicenseManagerLicenseKeyVcExpress = LicenseManagerLicenseKey("vcExpress") - LicenseManagerLicenseKeyEsxHost = LicenseManagerLicenseKey("esxHost") - LicenseManagerLicenseKeyGsxHost = LicenseManagerLicenseKey("gsxHost") - LicenseManagerLicenseKeyServerHost = LicenseManagerLicenseKey("serverHost") - LicenseManagerLicenseKeyDrsPower = LicenseManagerLicenseKey("drsPower") - LicenseManagerLicenseKeyVmotion = LicenseManagerLicenseKey("vmotion") - LicenseManagerLicenseKeyDrs = LicenseManagerLicenseKey("drs") - LicenseManagerLicenseKeyDas = LicenseManagerLicenseKey("das") -) - -func init() { - t["LicenseManagerLicenseKey"] = reflect.TypeOf((*LicenseManagerLicenseKey)(nil)).Elem() -} - -type LicenseManagerState string - -const ( - LicenseManagerStateInitializing = LicenseManagerState("initializing") - LicenseManagerStateNormal = LicenseManagerState("normal") - LicenseManagerStateMarginal = LicenseManagerState("marginal") - LicenseManagerStateFault = LicenseManagerState("fault") -) - -func init() { - t["LicenseManagerState"] = reflect.TypeOf((*LicenseManagerState)(nil)).Elem() -} - -type LicenseReservationInfoState string - -const ( - LicenseReservationInfoStateNotUsed = LicenseReservationInfoState("notUsed") - LicenseReservationInfoStateNoLicense = LicenseReservationInfoState("noLicense") - LicenseReservationInfoStateUnlicensedUse = LicenseReservationInfoState("unlicensedUse") - LicenseReservationInfoStateLicensed = LicenseReservationInfoState("licensed") -) - -func init() { - t["LicenseReservationInfoState"] = reflect.TypeOf((*LicenseReservationInfoState)(nil)).Elem() -} - -type LinkDiscoveryProtocolConfigOperationType string - -const ( - LinkDiscoveryProtocolConfigOperationTypeNone = LinkDiscoveryProtocolConfigOperationType("none") - LinkDiscoveryProtocolConfigOperationTypeListen = LinkDiscoveryProtocolConfigOperationType("listen") - LinkDiscoveryProtocolConfigOperationTypeAdvertise = LinkDiscoveryProtocolConfigOperationType("advertise") - LinkDiscoveryProtocolConfigOperationTypeBoth = LinkDiscoveryProtocolConfigOperationType("both") -) - -func init() { - t["LinkDiscoveryProtocolConfigOperationType"] = reflect.TypeOf((*LinkDiscoveryProtocolConfigOperationType)(nil)).Elem() -} - -type LinkDiscoveryProtocolConfigProtocolType string - -const ( - LinkDiscoveryProtocolConfigProtocolTypeCdp = LinkDiscoveryProtocolConfigProtocolType("cdp") - LinkDiscoveryProtocolConfigProtocolTypeLldp = LinkDiscoveryProtocolConfigProtocolType("lldp") -) - -func init() { - t["LinkDiscoveryProtocolConfigProtocolType"] = reflect.TypeOf((*LinkDiscoveryProtocolConfigProtocolType)(nil)).Elem() -} - -type ManagedEntityStatus string - -const ( - ManagedEntityStatusGray = ManagedEntityStatus("gray") - ManagedEntityStatusGreen = ManagedEntityStatus("green") - ManagedEntityStatusYellow = ManagedEntityStatus("yellow") - ManagedEntityStatusRed = ManagedEntityStatus("red") -) - -func init() { - t["ManagedEntityStatus"] = reflect.TypeOf((*ManagedEntityStatus)(nil)).Elem() -} - -type MetricAlarmOperator string - -const ( - MetricAlarmOperatorIsAbove = MetricAlarmOperator("isAbove") - MetricAlarmOperatorIsBelow = MetricAlarmOperator("isBelow") -) - -func init() { - t["MetricAlarmOperator"] = reflect.TypeOf((*MetricAlarmOperator)(nil)).Elem() -} - -type MultipathState string - -const ( - MultipathStateStandby = MultipathState("standby") - MultipathStateActive = MultipathState("active") - MultipathStateDisabled = MultipathState("disabled") - MultipathStateDead = MultipathState("dead") - MultipathStateUnknown = MultipathState("unknown") -) - -func init() { - t["MultipathState"] = reflect.TypeOf((*MultipathState)(nil)).Elem() -} - -type NetBIOSConfigInfoMode string - -const ( - NetBIOSConfigInfoModeUnknown = NetBIOSConfigInfoMode("unknown") - NetBIOSConfigInfoModeEnabled = NetBIOSConfigInfoMode("enabled") - NetBIOSConfigInfoModeDisabled = NetBIOSConfigInfoMode("disabled") - NetBIOSConfigInfoModeEnabledViaDHCP = NetBIOSConfigInfoMode("enabledViaDHCP") -) - -func init() { - t["NetBIOSConfigInfoMode"] = reflect.TypeOf((*NetBIOSConfigInfoMode)(nil)).Elem() -} - -type NetIpConfigInfoIpAddressOrigin string - -const ( - NetIpConfigInfoIpAddressOriginOther = NetIpConfigInfoIpAddressOrigin("other") - NetIpConfigInfoIpAddressOriginManual = NetIpConfigInfoIpAddressOrigin("manual") - NetIpConfigInfoIpAddressOriginDhcp = NetIpConfigInfoIpAddressOrigin("dhcp") - NetIpConfigInfoIpAddressOriginLinklayer = NetIpConfigInfoIpAddressOrigin("linklayer") - NetIpConfigInfoIpAddressOriginRandom = NetIpConfigInfoIpAddressOrigin("random") -) - -func init() { - t["NetIpConfigInfoIpAddressOrigin"] = reflect.TypeOf((*NetIpConfigInfoIpAddressOrigin)(nil)).Elem() -} - -type NetIpConfigInfoIpAddressStatus string - -const ( - NetIpConfigInfoIpAddressStatusPreferred = NetIpConfigInfoIpAddressStatus("preferred") - NetIpConfigInfoIpAddressStatusDeprecated = NetIpConfigInfoIpAddressStatus("deprecated") - NetIpConfigInfoIpAddressStatusInvalid = NetIpConfigInfoIpAddressStatus("invalid") - NetIpConfigInfoIpAddressStatusInaccessible = NetIpConfigInfoIpAddressStatus("inaccessible") - NetIpConfigInfoIpAddressStatusUnknown = NetIpConfigInfoIpAddressStatus("unknown") - NetIpConfigInfoIpAddressStatusTentative = NetIpConfigInfoIpAddressStatus("tentative") - NetIpConfigInfoIpAddressStatusDuplicate = NetIpConfigInfoIpAddressStatus("duplicate") -) - -func init() { - t["NetIpConfigInfoIpAddressStatus"] = reflect.TypeOf((*NetIpConfigInfoIpAddressStatus)(nil)).Elem() -} - -type NetIpStackInfoEntryType string - -const ( - NetIpStackInfoEntryTypeOther = NetIpStackInfoEntryType("other") - NetIpStackInfoEntryTypeInvalid = NetIpStackInfoEntryType("invalid") - NetIpStackInfoEntryTypeDynamic = NetIpStackInfoEntryType("dynamic") - NetIpStackInfoEntryTypeManual = NetIpStackInfoEntryType("manual") -) - -func init() { - t["NetIpStackInfoEntryType"] = reflect.TypeOf((*NetIpStackInfoEntryType)(nil)).Elem() -} - -type NetIpStackInfoPreference string - -const ( - NetIpStackInfoPreferenceReserved = NetIpStackInfoPreference("reserved") - NetIpStackInfoPreferenceLow = NetIpStackInfoPreference("low") - NetIpStackInfoPreferenceMedium = NetIpStackInfoPreference("medium") - NetIpStackInfoPreferenceHigh = NetIpStackInfoPreference("high") -) - -func init() { - t["NetIpStackInfoPreference"] = reflect.TypeOf((*NetIpStackInfoPreference)(nil)).Elem() -} - -type NotSupportedDeviceForFTDeviceType string - -const ( - NotSupportedDeviceForFTDeviceTypeVirtualVmxnet3 = NotSupportedDeviceForFTDeviceType("virtualVmxnet3") - NotSupportedDeviceForFTDeviceTypeParaVirtualSCSIController = NotSupportedDeviceForFTDeviceType("paraVirtualSCSIController") -) - -func init() { - t["NotSupportedDeviceForFTDeviceType"] = reflect.TypeOf((*NotSupportedDeviceForFTDeviceType)(nil)).Elem() -} - -type NumVirtualCpusIncompatibleReason string - -const ( - NumVirtualCpusIncompatibleReasonRecordReplay = NumVirtualCpusIncompatibleReason("recordReplay") - NumVirtualCpusIncompatibleReasonFaultTolerance = NumVirtualCpusIncompatibleReason("faultTolerance") -) - -func init() { - t["NumVirtualCpusIncompatibleReason"] = reflect.TypeOf((*NumVirtualCpusIncompatibleReason)(nil)).Elem() -} - -type ObjectUpdateKind string - -const ( - ObjectUpdateKindModify = ObjectUpdateKind("modify") - ObjectUpdateKindEnter = ObjectUpdateKind("enter") - ObjectUpdateKindLeave = ObjectUpdateKind("leave") -) - -func init() { - t["ObjectUpdateKind"] = reflect.TypeOf((*ObjectUpdateKind)(nil)).Elem() -} - -type OvfConsumerOstNodeType string - -const ( - OvfConsumerOstNodeTypeEnvelope = OvfConsumerOstNodeType("envelope") - OvfConsumerOstNodeTypeVirtualSystem = OvfConsumerOstNodeType("virtualSystem") - OvfConsumerOstNodeTypeVirtualSystemCollection = OvfConsumerOstNodeType("virtualSystemCollection") -) - -func init() { - t["OvfConsumerOstNodeType"] = reflect.TypeOf((*OvfConsumerOstNodeType)(nil)).Elem() -} - -type OvfCreateImportSpecParamsDiskProvisioningType string - -const ( - OvfCreateImportSpecParamsDiskProvisioningTypeMonolithicSparse = OvfCreateImportSpecParamsDiskProvisioningType("monolithicSparse") - OvfCreateImportSpecParamsDiskProvisioningTypeMonolithicFlat = OvfCreateImportSpecParamsDiskProvisioningType("monolithicFlat") - OvfCreateImportSpecParamsDiskProvisioningTypeTwoGbMaxExtentSparse = OvfCreateImportSpecParamsDiskProvisioningType("twoGbMaxExtentSparse") - OvfCreateImportSpecParamsDiskProvisioningTypeTwoGbMaxExtentFlat = OvfCreateImportSpecParamsDiskProvisioningType("twoGbMaxExtentFlat") - OvfCreateImportSpecParamsDiskProvisioningTypeThin = OvfCreateImportSpecParamsDiskProvisioningType("thin") - OvfCreateImportSpecParamsDiskProvisioningTypeThick = OvfCreateImportSpecParamsDiskProvisioningType("thick") - OvfCreateImportSpecParamsDiskProvisioningTypeSeSparse = OvfCreateImportSpecParamsDiskProvisioningType("seSparse") - OvfCreateImportSpecParamsDiskProvisioningTypeEagerZeroedThick = OvfCreateImportSpecParamsDiskProvisioningType("eagerZeroedThick") - OvfCreateImportSpecParamsDiskProvisioningTypeSparse = OvfCreateImportSpecParamsDiskProvisioningType("sparse") - OvfCreateImportSpecParamsDiskProvisioningTypeFlat = OvfCreateImportSpecParamsDiskProvisioningType("flat") -) - -func init() { - t["OvfCreateImportSpecParamsDiskProvisioningType"] = reflect.TypeOf((*OvfCreateImportSpecParamsDiskProvisioningType)(nil)).Elem() -} - -type PerfFormat string - -const ( - PerfFormatNormal = PerfFormat("normal") - PerfFormatCsv = PerfFormat("csv") -) - -func init() { - t["PerfFormat"] = reflect.TypeOf((*PerfFormat)(nil)).Elem() -} - -type PerfStatsType string - -const ( - PerfStatsTypeAbsolute = PerfStatsType("absolute") - PerfStatsTypeDelta = PerfStatsType("delta") - PerfStatsTypeRate = PerfStatsType("rate") -) - -func init() { - t["PerfStatsType"] = reflect.TypeOf((*PerfStatsType)(nil)).Elem() -} - -type PerfSummaryType string - -const ( - PerfSummaryTypeAverage = PerfSummaryType("average") - PerfSummaryTypeMaximum = PerfSummaryType("maximum") - PerfSummaryTypeMinimum = PerfSummaryType("minimum") - PerfSummaryTypeLatest = PerfSummaryType("latest") - PerfSummaryTypeSummation = PerfSummaryType("summation") - PerfSummaryTypeNone = PerfSummaryType("none") -) - -func init() { - t["PerfSummaryType"] = reflect.TypeOf((*PerfSummaryType)(nil)).Elem() -} - -type PerformanceManagerUnit string - -const ( - PerformanceManagerUnitPercent = PerformanceManagerUnit("percent") - PerformanceManagerUnitKiloBytes = PerformanceManagerUnit("kiloBytes") - PerformanceManagerUnitMegaBytes = PerformanceManagerUnit("megaBytes") - PerformanceManagerUnitMegaHertz = PerformanceManagerUnit("megaHertz") - PerformanceManagerUnitNumber = PerformanceManagerUnit("number") - PerformanceManagerUnitMicrosecond = PerformanceManagerUnit("microsecond") - PerformanceManagerUnitMillisecond = PerformanceManagerUnit("millisecond") - PerformanceManagerUnitSecond = PerformanceManagerUnit("second") - PerformanceManagerUnitKiloBytesPerSecond = PerformanceManagerUnit("kiloBytesPerSecond") - PerformanceManagerUnitMegaBytesPerSecond = PerformanceManagerUnit("megaBytesPerSecond") - PerformanceManagerUnitWatt = PerformanceManagerUnit("watt") - PerformanceManagerUnitJoule = PerformanceManagerUnit("joule") -) - -func init() { - t["PerformanceManagerUnit"] = reflect.TypeOf((*PerformanceManagerUnit)(nil)).Elem() -} - -type PhysicalNicResourcePoolSchedulerDisallowedReason string - -const ( - PhysicalNicResourcePoolSchedulerDisallowedReasonUserOptOut = PhysicalNicResourcePoolSchedulerDisallowedReason("userOptOut") - PhysicalNicResourcePoolSchedulerDisallowedReasonHardwareUnsupported = PhysicalNicResourcePoolSchedulerDisallowedReason("hardwareUnsupported") -) - -func init() { - t["PhysicalNicResourcePoolSchedulerDisallowedReason"] = reflect.TypeOf((*PhysicalNicResourcePoolSchedulerDisallowedReason)(nil)).Elem() -} - -type PhysicalNicVmDirectPathGen2SupportedMode string - -const ( - PhysicalNicVmDirectPathGen2SupportedModeUpt = PhysicalNicVmDirectPathGen2SupportedMode("upt") -) - -func init() { - t["PhysicalNicVmDirectPathGen2SupportedMode"] = reflect.TypeOf((*PhysicalNicVmDirectPathGen2SupportedMode)(nil)).Elem() -} - -type PortGroupConnecteeType string - -const ( - PortGroupConnecteeTypeVirtualMachine = PortGroupConnecteeType("virtualMachine") - PortGroupConnecteeTypeSystemManagement = PortGroupConnecteeType("systemManagement") - PortGroupConnecteeTypeHost = PortGroupConnecteeType("host") - PortGroupConnecteeTypeUnknown = PortGroupConnecteeType("unknown") -) - -func init() { - t["PortGroupConnecteeType"] = reflect.TypeOf((*PortGroupConnecteeType)(nil)).Elem() -} - -type ProfileExecuteResultStatus string - -const ( - ProfileExecuteResultStatusSuccess = ProfileExecuteResultStatus("success") - ProfileExecuteResultStatusNeedInput = ProfileExecuteResultStatus("needInput") - ProfileExecuteResultStatusError = ProfileExecuteResultStatus("error") -) - -func init() { - t["ProfileExecuteResultStatus"] = reflect.TypeOf((*ProfileExecuteResultStatus)(nil)).Elem() -} - -type ProfileNumericComparator string - -const ( - ProfileNumericComparatorLessThan = ProfileNumericComparator("lessThan") - ProfileNumericComparatorLessThanEqual = ProfileNumericComparator("lessThanEqual") - ProfileNumericComparatorEqual = ProfileNumericComparator("equal") - ProfileNumericComparatorNotEqual = ProfileNumericComparator("notEqual") - ProfileNumericComparatorGreaterThanEqual = ProfileNumericComparator("greaterThanEqual") - ProfileNumericComparatorGreaterThan = ProfileNumericComparator("greaterThan") -) - -func init() { - t["ProfileNumericComparator"] = reflect.TypeOf((*ProfileNumericComparator)(nil)).Elem() -} - -type PropertyChangeOp string - -const ( - PropertyChangeOpAdd = PropertyChangeOp("add") - PropertyChangeOpRemove = PropertyChangeOp("remove") - PropertyChangeOpAssign = PropertyChangeOp("assign") - PropertyChangeOpIndirectRemove = PropertyChangeOp("indirectRemove") -) - -func init() { - t["PropertyChangeOp"] = reflect.TypeOf((*PropertyChangeOp)(nil)).Elem() -} - -type RecommendationReasonCode string - -const ( - RecommendationReasonCodeFairnessCpuAvg = RecommendationReasonCode("fairnessCpuAvg") - RecommendationReasonCodeFairnessMemAvg = RecommendationReasonCode("fairnessMemAvg") - RecommendationReasonCodeJointAffin = RecommendationReasonCode("jointAffin") - RecommendationReasonCodeAntiAffin = RecommendationReasonCode("antiAffin") - RecommendationReasonCodeHostMaint = RecommendationReasonCode("hostMaint") - RecommendationReasonCodeEnterStandby = RecommendationReasonCode("enterStandby") - RecommendationReasonCodeReservationCpu = RecommendationReasonCode("reservationCpu") - RecommendationReasonCodeReservationMem = RecommendationReasonCode("reservationMem") - RecommendationReasonCodePowerOnVm = RecommendationReasonCode("powerOnVm") - RecommendationReasonCodePowerSaving = RecommendationReasonCode("powerSaving") - RecommendationReasonCodeIncreaseCapacity = RecommendationReasonCode("increaseCapacity") - RecommendationReasonCodeCheckResource = RecommendationReasonCode("checkResource") - RecommendationReasonCodeUnreservedCapacity = RecommendationReasonCode("unreservedCapacity") - RecommendationReasonCodeVmHostHardAffinity = RecommendationReasonCode("vmHostHardAffinity") - RecommendationReasonCodeVmHostSoftAffinity = RecommendationReasonCode("vmHostSoftAffinity") - RecommendationReasonCodeBalanceDatastoreSpaceUsage = RecommendationReasonCode("balanceDatastoreSpaceUsage") - RecommendationReasonCodeBalanceDatastoreIOLoad = RecommendationReasonCode("balanceDatastoreIOLoad") - RecommendationReasonCodeDatastoreMaint = RecommendationReasonCode("datastoreMaint") - RecommendationReasonCodeVirtualDiskJointAffin = RecommendationReasonCode("virtualDiskJointAffin") - RecommendationReasonCodeVirtualDiskAntiAffin = RecommendationReasonCode("virtualDiskAntiAffin") - RecommendationReasonCodeDatastoreSpaceOutage = RecommendationReasonCode("datastoreSpaceOutage") - RecommendationReasonCodeStoragePlacement = RecommendationReasonCode("storagePlacement") - RecommendationReasonCodeIolbDisabledInternal = RecommendationReasonCode("iolbDisabledInternal") -) - -func init() { - t["RecommendationReasonCode"] = reflect.TypeOf((*RecommendationReasonCode)(nil)).Elem() -} - -type RecommendationType string - -const ( - RecommendationTypeV1 = RecommendationType("V1") -) - -func init() { - t["RecommendationType"] = reflect.TypeOf((*RecommendationType)(nil)).Elem() -} - -type ReplicationDiskConfigFaultReasonForFault string - -const ( - ReplicationDiskConfigFaultReasonForFaultDiskNotFound = ReplicationDiskConfigFaultReasonForFault("diskNotFound") - ReplicationDiskConfigFaultReasonForFaultDiskTypeNotSupported = ReplicationDiskConfigFaultReasonForFault("diskTypeNotSupported") - ReplicationDiskConfigFaultReasonForFaultInvalidDiskKey = ReplicationDiskConfigFaultReasonForFault("invalidDiskKey") - ReplicationDiskConfigFaultReasonForFaultInvalidDiskReplicationId = ReplicationDiskConfigFaultReasonForFault("invalidDiskReplicationId") - ReplicationDiskConfigFaultReasonForFaultDuplicateDiskReplicationId = ReplicationDiskConfigFaultReasonForFault("duplicateDiskReplicationId") - ReplicationDiskConfigFaultReasonForFaultInvalidPersistentFilePath = ReplicationDiskConfigFaultReasonForFault("invalidPersistentFilePath") - ReplicationDiskConfigFaultReasonForFaultReconfigureDiskReplicationIdNotAllowed = ReplicationDiskConfigFaultReasonForFault("reconfigureDiskReplicationIdNotAllowed") -) - -func init() { - t["ReplicationDiskConfigFaultReasonForFault"] = reflect.TypeOf((*ReplicationDiskConfigFaultReasonForFault)(nil)).Elem() -} - -type ReplicationVmConfigFaultReasonForFault string - -const ( - ReplicationVmConfigFaultReasonForFaultIncompatibleHwVersion = ReplicationVmConfigFaultReasonForFault("incompatibleHwVersion") - ReplicationVmConfigFaultReasonForFaultInvalidVmReplicationId = ReplicationVmConfigFaultReasonForFault("invalidVmReplicationId") - ReplicationVmConfigFaultReasonForFaultInvalidGenerationNumber = ReplicationVmConfigFaultReasonForFault("invalidGenerationNumber") - ReplicationVmConfigFaultReasonForFaultOutOfBoundsRpoValue = ReplicationVmConfigFaultReasonForFault("outOfBoundsRpoValue") - ReplicationVmConfigFaultReasonForFaultInvalidDestinationIpAddress = ReplicationVmConfigFaultReasonForFault("invalidDestinationIpAddress") - ReplicationVmConfigFaultReasonForFaultInvalidDestinationPort = ReplicationVmConfigFaultReasonForFault("invalidDestinationPort") - ReplicationVmConfigFaultReasonForFaultInvalidExtraVmOptions = ReplicationVmConfigFaultReasonForFault("invalidExtraVmOptions") - ReplicationVmConfigFaultReasonForFaultStaleGenerationNumber = ReplicationVmConfigFaultReasonForFault("staleGenerationNumber") - ReplicationVmConfigFaultReasonForFaultReconfigureVmReplicationIdNotAllowed = ReplicationVmConfigFaultReasonForFault("reconfigureVmReplicationIdNotAllowed") - ReplicationVmConfigFaultReasonForFaultCannotRetrieveVmReplicationConfiguration = ReplicationVmConfigFaultReasonForFault("cannotRetrieveVmReplicationConfiguration") - ReplicationVmConfigFaultReasonForFaultReplicationAlreadyEnabled = ReplicationVmConfigFaultReasonForFault("replicationAlreadyEnabled") - ReplicationVmConfigFaultReasonForFaultInvalidPriorConfiguration = ReplicationVmConfigFaultReasonForFault("invalidPriorConfiguration") - ReplicationVmConfigFaultReasonForFaultReplicationNotEnabled = ReplicationVmConfigFaultReasonForFault("replicationNotEnabled") - ReplicationVmConfigFaultReasonForFaultReplicationConfigurationFailed = ReplicationVmConfigFaultReasonForFault("replicationConfigurationFailed") -) - -func init() { - t["ReplicationVmConfigFaultReasonForFault"] = reflect.TypeOf((*ReplicationVmConfigFaultReasonForFault)(nil)).Elem() -} - -type ReplicationVmFaultReasonForFault string - -const ( - ReplicationVmFaultReasonForFaultNotConfigured = ReplicationVmFaultReasonForFault("notConfigured") - ReplicationVmFaultReasonForFaultPoweredOff = ReplicationVmFaultReasonForFault("poweredOff") - ReplicationVmFaultReasonForFaultSuspended = ReplicationVmFaultReasonForFault("suspended") - ReplicationVmFaultReasonForFaultPoweredOn = ReplicationVmFaultReasonForFault("poweredOn") - ReplicationVmFaultReasonForFaultOfflineReplicating = ReplicationVmFaultReasonForFault("offlineReplicating") - ReplicationVmFaultReasonForFaultInvalidState = ReplicationVmFaultReasonForFault("invalidState") - ReplicationVmFaultReasonForFaultInvalidInstanceId = ReplicationVmFaultReasonForFault("invalidInstanceId") -) - -func init() { - t["ReplicationVmFaultReasonForFault"] = reflect.TypeOf((*ReplicationVmFaultReasonForFault)(nil)).Elem() -} - -type ReplicationVmState string - -const ( - ReplicationVmStateNone = ReplicationVmState("none") - ReplicationVmStatePaused = ReplicationVmState("paused") - ReplicationVmStateSyncing = ReplicationVmState("syncing") - ReplicationVmStateIdle = ReplicationVmState("idle") - ReplicationVmStateActive = ReplicationVmState("active") - ReplicationVmStateError = ReplicationVmState("error") -) - -func init() { - t["ReplicationVmState"] = reflect.TypeOf((*ReplicationVmState)(nil)).Elem() -} - -type ScheduledHardwareUpgradeInfoHardwareUpgradePolicy string - -const ( - ScheduledHardwareUpgradeInfoHardwareUpgradePolicyNever = ScheduledHardwareUpgradeInfoHardwareUpgradePolicy("never") - ScheduledHardwareUpgradeInfoHardwareUpgradePolicyOnSoftPowerOff = ScheduledHardwareUpgradeInfoHardwareUpgradePolicy("onSoftPowerOff") - ScheduledHardwareUpgradeInfoHardwareUpgradePolicyAlways = ScheduledHardwareUpgradeInfoHardwareUpgradePolicy("always") -) - -func init() { - t["ScheduledHardwareUpgradeInfoHardwareUpgradePolicy"] = reflect.TypeOf((*ScheduledHardwareUpgradeInfoHardwareUpgradePolicy)(nil)).Elem() -} - -type ScheduledHardwareUpgradeInfoHardwareUpgradeStatus string - -const ( - ScheduledHardwareUpgradeInfoHardwareUpgradeStatusNone = ScheduledHardwareUpgradeInfoHardwareUpgradeStatus("none") - ScheduledHardwareUpgradeInfoHardwareUpgradeStatusPending = ScheduledHardwareUpgradeInfoHardwareUpgradeStatus("pending") - ScheduledHardwareUpgradeInfoHardwareUpgradeStatusSuccess = ScheduledHardwareUpgradeInfoHardwareUpgradeStatus("success") - ScheduledHardwareUpgradeInfoHardwareUpgradeStatusFailed = ScheduledHardwareUpgradeInfoHardwareUpgradeStatus("failed") -) - -func init() { - t["ScheduledHardwareUpgradeInfoHardwareUpgradeStatus"] = reflect.TypeOf((*ScheduledHardwareUpgradeInfoHardwareUpgradeStatus)(nil)).Elem() -} - -type ScsiLunDescriptorQuality string - -const ( - ScsiLunDescriptorQualityHighQuality = ScsiLunDescriptorQuality("highQuality") - ScsiLunDescriptorQualityMediumQuality = ScsiLunDescriptorQuality("mediumQuality") - ScsiLunDescriptorQualityLowQuality = ScsiLunDescriptorQuality("lowQuality") - ScsiLunDescriptorQualityUnknownQuality = ScsiLunDescriptorQuality("unknownQuality") -) - -func init() { - t["ScsiLunDescriptorQuality"] = reflect.TypeOf((*ScsiLunDescriptorQuality)(nil)).Elem() -} - -type ScsiLunState string - -const ( - ScsiLunStateUnknownState = ScsiLunState("unknownState") - ScsiLunStateOk = ScsiLunState("ok") - ScsiLunStateError = ScsiLunState("error") - ScsiLunStateOff = ScsiLunState("off") - ScsiLunStateQuiesced = ScsiLunState("quiesced") - ScsiLunStateDegraded = ScsiLunState("degraded") - ScsiLunStateLostCommunication = ScsiLunState("lostCommunication") - ScsiLunStateTimeout = ScsiLunState("timeout") -) - -func init() { - t["ScsiLunState"] = reflect.TypeOf((*ScsiLunState)(nil)).Elem() -} - -type ScsiLunType string - -const ( - ScsiLunTypeDisk = ScsiLunType("disk") - ScsiLunTypeTape = ScsiLunType("tape") - ScsiLunTypePrinter = ScsiLunType("printer") - ScsiLunTypeProcessor = ScsiLunType("processor") - ScsiLunTypeWorm = ScsiLunType("worm") - ScsiLunTypeCdrom = ScsiLunType("cdrom") - ScsiLunTypeScanner = ScsiLunType("scanner") - ScsiLunTypeOpticalDevice = ScsiLunType("opticalDevice") - ScsiLunTypeMediaChanger = ScsiLunType("mediaChanger") - ScsiLunTypeCommunications = ScsiLunType("communications") - ScsiLunTypeStorageArrayController = ScsiLunType("storageArrayController") - ScsiLunTypeEnclosure = ScsiLunType("enclosure") - ScsiLunTypeUnknown = ScsiLunType("unknown") -) - -func init() { - t["ScsiLunType"] = reflect.TypeOf((*ScsiLunType)(nil)).Elem() -} - -type ScsiLunVStorageSupportStatus string - -const ( - ScsiLunVStorageSupportStatusVStorageSupported = ScsiLunVStorageSupportStatus("vStorageSupported") - ScsiLunVStorageSupportStatusVStorageUnsupported = ScsiLunVStorageSupportStatus("vStorageUnsupported") - ScsiLunVStorageSupportStatusVStorageUnknown = ScsiLunVStorageSupportStatus("vStorageUnknown") -) - -func init() { - t["ScsiLunVStorageSupportStatus"] = reflect.TypeOf((*ScsiLunVStorageSupportStatus)(nil)).Elem() -} - -type SessionManagerHttpServiceRequestSpecMethod string - -const ( - SessionManagerHttpServiceRequestSpecMethodHttpOptions = SessionManagerHttpServiceRequestSpecMethod("httpOptions") - SessionManagerHttpServiceRequestSpecMethodHttpGet = SessionManagerHttpServiceRequestSpecMethod("httpGet") - SessionManagerHttpServiceRequestSpecMethodHttpHead = SessionManagerHttpServiceRequestSpecMethod("httpHead") - SessionManagerHttpServiceRequestSpecMethodHttpPost = SessionManagerHttpServiceRequestSpecMethod("httpPost") - SessionManagerHttpServiceRequestSpecMethodHttpPut = SessionManagerHttpServiceRequestSpecMethod("httpPut") - SessionManagerHttpServiceRequestSpecMethodHttpDelete = SessionManagerHttpServiceRequestSpecMethod("httpDelete") - SessionManagerHttpServiceRequestSpecMethodHttpTrace = SessionManagerHttpServiceRequestSpecMethod("httpTrace") - SessionManagerHttpServiceRequestSpecMethodHttpConnect = SessionManagerHttpServiceRequestSpecMethod("httpConnect") -) - -func init() { - t["SessionManagerHttpServiceRequestSpecMethod"] = reflect.TypeOf((*SessionManagerHttpServiceRequestSpecMethod)(nil)).Elem() -} - -type SharesLevel string - -const ( - SharesLevelLow = SharesLevel("low") - SharesLevelNormal = SharesLevel("normal") - SharesLevelHigh = SharesLevel("high") - SharesLevelCustom = SharesLevel("custom") -) - -func init() { - t["SharesLevel"] = reflect.TypeOf((*SharesLevel)(nil)).Elem() -} - -type SimpleCommandEncoding string - -const ( - SimpleCommandEncodingCSV = SimpleCommandEncoding("CSV") - SimpleCommandEncodingHEX = SimpleCommandEncoding("HEX") - SimpleCommandEncodingSTRING = SimpleCommandEncoding("STRING") -) - -func init() { - t["SimpleCommandEncoding"] = reflect.TypeOf((*SimpleCommandEncoding)(nil)).Elem() -} - -type SlpDiscoveryMethod string - -const ( - SlpDiscoveryMethodSlpDhcp = SlpDiscoveryMethod("slpDhcp") - SlpDiscoveryMethodSlpAutoUnicast = SlpDiscoveryMethod("slpAutoUnicast") - SlpDiscoveryMethodSlpAutoMulticast = SlpDiscoveryMethod("slpAutoMulticast") - SlpDiscoveryMethodSlpManual = SlpDiscoveryMethod("slpManual") -) - -func init() { - t["SlpDiscoveryMethod"] = reflect.TypeOf((*SlpDiscoveryMethod)(nil)).Elem() -} - -type StateAlarmOperator string - -const ( - StateAlarmOperatorIsEqual = StateAlarmOperator("isEqual") - StateAlarmOperatorIsUnequal = StateAlarmOperator("isUnequal") -) - -func init() { - t["StateAlarmOperator"] = reflect.TypeOf((*StateAlarmOperator)(nil)).Elem() -} - -type StorageDrsPodConfigInfoBehavior string - -const ( - StorageDrsPodConfigInfoBehaviorManual = StorageDrsPodConfigInfoBehavior("manual") - StorageDrsPodConfigInfoBehaviorAutomated = StorageDrsPodConfigInfoBehavior("automated") -) - -func init() { - t["StorageDrsPodConfigInfoBehavior"] = reflect.TypeOf((*StorageDrsPodConfigInfoBehavior)(nil)).Elem() -} - -type StorageIORMThresholdMode string - -const ( - StorageIORMThresholdModeAutomatic = StorageIORMThresholdMode("automatic") - StorageIORMThresholdModeManual = StorageIORMThresholdMode("manual") -) - -func init() { - t["StorageIORMThresholdMode"] = reflect.TypeOf((*StorageIORMThresholdMode)(nil)).Elem() -} - -type StoragePlacementSpecPlacementType string - -const ( - StoragePlacementSpecPlacementTypeCreate = StoragePlacementSpecPlacementType("create") - StoragePlacementSpecPlacementTypeReconfigure = StoragePlacementSpecPlacementType("reconfigure") - StoragePlacementSpecPlacementTypeRelocate = StoragePlacementSpecPlacementType("relocate") - StoragePlacementSpecPlacementTypeClone = StoragePlacementSpecPlacementType("clone") -) - -func init() { - t["StoragePlacementSpecPlacementType"] = reflect.TypeOf((*StoragePlacementSpecPlacementType)(nil)).Elem() -} - -type TaskFilterSpecRecursionOption string - -const ( - TaskFilterSpecRecursionOptionSelf = TaskFilterSpecRecursionOption("self") - TaskFilterSpecRecursionOptionChildren = TaskFilterSpecRecursionOption("children") - TaskFilterSpecRecursionOptionAll = TaskFilterSpecRecursionOption("all") -) - -func init() { - t["TaskFilterSpecRecursionOption"] = reflect.TypeOf((*TaskFilterSpecRecursionOption)(nil)).Elem() -} - -type TaskFilterSpecTimeOption string - -const ( - TaskFilterSpecTimeOptionQueuedTime = TaskFilterSpecTimeOption("queuedTime") - TaskFilterSpecTimeOptionStartedTime = TaskFilterSpecTimeOption("startedTime") - TaskFilterSpecTimeOptionCompletedTime = TaskFilterSpecTimeOption("completedTime") -) - -func init() { - t["TaskFilterSpecTimeOption"] = reflect.TypeOf((*TaskFilterSpecTimeOption)(nil)).Elem() -} - -type TaskInfoState string - -const ( - TaskInfoStateQueued = TaskInfoState("queued") - TaskInfoStateRunning = TaskInfoState("running") - TaskInfoStateSuccess = TaskInfoState("success") - TaskInfoStateError = TaskInfoState("error") -) - -func init() { - t["TaskInfoState"] = reflect.TypeOf((*TaskInfoState)(nil)).Elem() -} - -type ThirdPartyLicenseAssignmentFailedReason string - -const ( - ThirdPartyLicenseAssignmentFailedReasonLicenseAssignmentFailed = ThirdPartyLicenseAssignmentFailedReason("licenseAssignmentFailed") - ThirdPartyLicenseAssignmentFailedReasonModuleNotInstalled = ThirdPartyLicenseAssignmentFailedReason("moduleNotInstalled") -) - -func init() { - t["ThirdPartyLicenseAssignmentFailedReason"] = reflect.TypeOf((*ThirdPartyLicenseAssignmentFailedReason)(nil)).Elem() -} - -type UpgradePolicy string - -const ( - UpgradePolicyManual = UpgradePolicy("manual") - UpgradePolicyUpgradeAtPowerCycle = UpgradePolicy("upgradeAtPowerCycle") -) - -func init() { - t["UpgradePolicy"] = reflect.TypeOf((*UpgradePolicy)(nil)).Elem() -} - -type VAppAutoStartAction string - -const ( - VAppAutoStartActionNone = VAppAutoStartAction("none") - VAppAutoStartActionPowerOn = VAppAutoStartAction("powerOn") - VAppAutoStartActionPowerOff = VAppAutoStartAction("powerOff") - VAppAutoStartActionGuestShutdown = VAppAutoStartAction("guestShutdown") - VAppAutoStartActionSuspend = VAppAutoStartAction("suspend") -) - -func init() { - t["VAppAutoStartAction"] = reflect.TypeOf((*VAppAutoStartAction)(nil)).Elem() -} - -type VAppCloneSpecProvisioningType string - -const ( - VAppCloneSpecProvisioningTypeSameAsSource = VAppCloneSpecProvisioningType("sameAsSource") - VAppCloneSpecProvisioningTypeThin = VAppCloneSpecProvisioningType("thin") - VAppCloneSpecProvisioningTypeThick = VAppCloneSpecProvisioningType("thick") -) - -func init() { - t["VAppCloneSpecProvisioningType"] = reflect.TypeOf((*VAppCloneSpecProvisioningType)(nil)).Elem() -} - -type VAppIPAssignmentInfoAllocationSchemes string - -const ( - VAppIPAssignmentInfoAllocationSchemesDhcp = VAppIPAssignmentInfoAllocationSchemes("dhcp") - VAppIPAssignmentInfoAllocationSchemesOvfenv = VAppIPAssignmentInfoAllocationSchemes("ovfenv") -) - -func init() { - t["VAppIPAssignmentInfoAllocationSchemes"] = reflect.TypeOf((*VAppIPAssignmentInfoAllocationSchemes)(nil)).Elem() -} - -type VAppIPAssignmentInfoIpAllocationPolicy string - -const ( - VAppIPAssignmentInfoIpAllocationPolicyDhcpPolicy = VAppIPAssignmentInfoIpAllocationPolicy("dhcpPolicy") - VAppIPAssignmentInfoIpAllocationPolicyTransientPolicy = VAppIPAssignmentInfoIpAllocationPolicy("transientPolicy") - VAppIPAssignmentInfoIpAllocationPolicyFixedPolicy = VAppIPAssignmentInfoIpAllocationPolicy("fixedPolicy") - VAppIPAssignmentInfoIpAllocationPolicyFixedAllocatedPolicy = VAppIPAssignmentInfoIpAllocationPolicy("fixedAllocatedPolicy") -) - -func init() { - t["VAppIPAssignmentInfoIpAllocationPolicy"] = reflect.TypeOf((*VAppIPAssignmentInfoIpAllocationPolicy)(nil)).Elem() -} - -type VAppIPAssignmentInfoProtocols string - -const ( - VAppIPAssignmentInfoProtocolsIPv4 = VAppIPAssignmentInfoProtocols("IPv4") - VAppIPAssignmentInfoProtocolsIPv6 = VAppIPAssignmentInfoProtocols("IPv6") -) - -func init() { - t["VAppIPAssignmentInfoProtocols"] = reflect.TypeOf((*VAppIPAssignmentInfoProtocols)(nil)).Elem() -} - -type VFlashModuleNotSupportedReason string - -const ( - VFlashModuleNotSupportedReasonCacheModeNotSupported = VFlashModuleNotSupportedReason("CacheModeNotSupported") - VFlashModuleNotSupportedReasonCacheConsistencyTypeNotSupported = VFlashModuleNotSupportedReason("CacheConsistencyTypeNotSupported") - VFlashModuleNotSupportedReasonCacheBlockSizeNotSupported = VFlashModuleNotSupportedReason("CacheBlockSizeNotSupported") - VFlashModuleNotSupportedReasonCacheReservationNotSupported = VFlashModuleNotSupportedReason("CacheReservationNotSupported") - VFlashModuleNotSupportedReasonDiskSizeNotSupported = VFlashModuleNotSupportedReason("DiskSizeNotSupported") -) - -func init() { - t["VFlashModuleNotSupportedReason"] = reflect.TypeOf((*VFlashModuleNotSupportedReason)(nil)).Elem() -} - -type VMotionCompatibilityType string - -const ( - VMotionCompatibilityTypeCpu = VMotionCompatibilityType("cpu") - VMotionCompatibilityTypeSoftware = VMotionCompatibilityType("software") -) - -func init() { - t["VMotionCompatibilityType"] = reflect.TypeOf((*VMotionCompatibilityType)(nil)).Elem() -} - -type VMwareDVSTeamingMatchStatus string - -const ( - VMwareDVSTeamingMatchStatusIphashMatch = VMwareDVSTeamingMatchStatus("iphashMatch") - VMwareDVSTeamingMatchStatusNonIphashMatch = VMwareDVSTeamingMatchStatus("nonIphashMatch") - VMwareDVSTeamingMatchStatusIphashMismatch = VMwareDVSTeamingMatchStatus("iphashMismatch") - VMwareDVSTeamingMatchStatusNonIphashMismatch = VMwareDVSTeamingMatchStatus("nonIphashMismatch") -) - -func init() { - t["VMwareDVSTeamingMatchStatus"] = reflect.TypeOf((*VMwareDVSTeamingMatchStatus)(nil)).Elem() -} - -type VMwareDVSVspanSessionType string - -const ( - VMwareDVSVspanSessionTypeMixedDestMirror = VMwareDVSVspanSessionType("mixedDestMirror") - VMwareDVSVspanSessionTypeDvPortMirror = VMwareDVSVspanSessionType("dvPortMirror") - VMwareDVSVspanSessionTypeRemoteMirrorSource = VMwareDVSVspanSessionType("remoteMirrorSource") - VMwareDVSVspanSessionTypeRemoteMirrorDest = VMwareDVSVspanSessionType("remoteMirrorDest") - VMwareDVSVspanSessionTypeEncapsulatedRemoteMirrorSource = VMwareDVSVspanSessionType("encapsulatedRemoteMirrorSource") -) - -func init() { - t["VMwareDVSVspanSessionType"] = reflect.TypeOf((*VMwareDVSVspanSessionType)(nil)).Elem() -} - -type VMwareDvsLacpApiVersion string - -const ( - VMwareDvsLacpApiVersionSingleLag = VMwareDvsLacpApiVersion("singleLag") - VMwareDvsLacpApiVersionMultipleLag = VMwareDvsLacpApiVersion("multipleLag") -) - -func init() { - t["VMwareDvsLacpApiVersion"] = reflect.TypeOf((*VMwareDvsLacpApiVersion)(nil)).Elem() -} - -type VMwareDvsLacpLoadBalanceAlgorithm string - -const ( - VMwareDvsLacpLoadBalanceAlgorithmSrcMac = VMwareDvsLacpLoadBalanceAlgorithm("srcMac") - VMwareDvsLacpLoadBalanceAlgorithmDestMac = VMwareDvsLacpLoadBalanceAlgorithm("destMac") - VMwareDvsLacpLoadBalanceAlgorithmSrcDestMac = VMwareDvsLacpLoadBalanceAlgorithm("srcDestMac") - VMwareDvsLacpLoadBalanceAlgorithmDestIpVlan = VMwareDvsLacpLoadBalanceAlgorithm("destIpVlan") - VMwareDvsLacpLoadBalanceAlgorithmSrcIpVlan = VMwareDvsLacpLoadBalanceAlgorithm("srcIpVlan") - VMwareDvsLacpLoadBalanceAlgorithmSrcDestIpVlan = VMwareDvsLacpLoadBalanceAlgorithm("srcDestIpVlan") - VMwareDvsLacpLoadBalanceAlgorithmDestTcpUdpPort = VMwareDvsLacpLoadBalanceAlgorithm("destTcpUdpPort") - VMwareDvsLacpLoadBalanceAlgorithmSrcTcpUdpPort = VMwareDvsLacpLoadBalanceAlgorithm("srcTcpUdpPort") - VMwareDvsLacpLoadBalanceAlgorithmSrcDestTcpUdpPort = VMwareDvsLacpLoadBalanceAlgorithm("srcDestTcpUdpPort") - VMwareDvsLacpLoadBalanceAlgorithmDestIpTcpUdpPort = VMwareDvsLacpLoadBalanceAlgorithm("destIpTcpUdpPort") - VMwareDvsLacpLoadBalanceAlgorithmSrcIpTcpUdpPort = VMwareDvsLacpLoadBalanceAlgorithm("srcIpTcpUdpPort") - VMwareDvsLacpLoadBalanceAlgorithmSrcDestIpTcpUdpPort = VMwareDvsLacpLoadBalanceAlgorithm("srcDestIpTcpUdpPort") - VMwareDvsLacpLoadBalanceAlgorithmDestIpTcpUdpPortVlan = VMwareDvsLacpLoadBalanceAlgorithm("destIpTcpUdpPortVlan") - VMwareDvsLacpLoadBalanceAlgorithmSrcIpTcpUdpPortVlan = VMwareDvsLacpLoadBalanceAlgorithm("srcIpTcpUdpPortVlan") - VMwareDvsLacpLoadBalanceAlgorithmSrcDestIpTcpUdpPortVlan = VMwareDvsLacpLoadBalanceAlgorithm("srcDestIpTcpUdpPortVlan") - VMwareDvsLacpLoadBalanceAlgorithmDestIp = VMwareDvsLacpLoadBalanceAlgorithm("destIp") - VMwareDvsLacpLoadBalanceAlgorithmSrcIp = VMwareDvsLacpLoadBalanceAlgorithm("srcIp") - VMwareDvsLacpLoadBalanceAlgorithmSrcDestIp = VMwareDvsLacpLoadBalanceAlgorithm("srcDestIp") - VMwareDvsLacpLoadBalanceAlgorithmVlan = VMwareDvsLacpLoadBalanceAlgorithm("vlan") - VMwareDvsLacpLoadBalanceAlgorithmSrcPortId = VMwareDvsLacpLoadBalanceAlgorithm("srcPortId") -) - -func init() { - t["VMwareDvsLacpLoadBalanceAlgorithm"] = reflect.TypeOf((*VMwareDvsLacpLoadBalanceAlgorithm)(nil)).Elem() -} - -type VMwareUplinkLacpMode string - -const ( - VMwareUplinkLacpModeActive = VMwareUplinkLacpMode("active") - VMwareUplinkLacpModePassive = VMwareUplinkLacpMode("passive") -) - -func init() { - t["VMwareUplinkLacpMode"] = reflect.TypeOf((*VMwareUplinkLacpMode)(nil)).Elem() -} - -type ValidateMigrationTestType string - -const ( - ValidateMigrationTestTypeSourceTests = ValidateMigrationTestType("sourceTests") - ValidateMigrationTestTypeCompatibilityTests = ValidateMigrationTestType("compatibilityTests") - ValidateMigrationTestTypeDiskAccessibilityTests = ValidateMigrationTestType("diskAccessibilityTests") - ValidateMigrationTestTypeResourceTests = ValidateMigrationTestType("resourceTests") -) - -func init() { - t["ValidateMigrationTestType"] = reflect.TypeOf((*ValidateMigrationTestType)(nil)).Elem() -} - -type VirtualAppVAppState string - -const ( - VirtualAppVAppStateStarted = VirtualAppVAppState("started") - VirtualAppVAppStateStopped = VirtualAppVAppState("stopped") - VirtualAppVAppStateStarting = VirtualAppVAppState("starting") - VirtualAppVAppStateStopping = VirtualAppVAppState("stopping") -) - -func init() { - t["VirtualAppVAppState"] = reflect.TypeOf((*VirtualAppVAppState)(nil)).Elem() -} - -type VirtualDeviceConfigSpecFileOperation string - -const ( - VirtualDeviceConfigSpecFileOperationCreate = VirtualDeviceConfigSpecFileOperation("create") - VirtualDeviceConfigSpecFileOperationDestroy = VirtualDeviceConfigSpecFileOperation("destroy") - VirtualDeviceConfigSpecFileOperationReplace = VirtualDeviceConfigSpecFileOperation("replace") -) - -func init() { - t["VirtualDeviceConfigSpecFileOperation"] = reflect.TypeOf((*VirtualDeviceConfigSpecFileOperation)(nil)).Elem() -} - -type VirtualDeviceConfigSpecOperation string - -const ( - VirtualDeviceConfigSpecOperationAdd = VirtualDeviceConfigSpecOperation("add") - VirtualDeviceConfigSpecOperationRemove = VirtualDeviceConfigSpecOperation("remove") - VirtualDeviceConfigSpecOperationEdit = VirtualDeviceConfigSpecOperation("edit") -) - -func init() { - t["VirtualDeviceConfigSpecOperation"] = reflect.TypeOf((*VirtualDeviceConfigSpecOperation)(nil)).Elem() -} - -type VirtualDeviceConnectInfoStatus string - -const ( - VirtualDeviceConnectInfoStatusOk = VirtualDeviceConnectInfoStatus("ok") - VirtualDeviceConnectInfoStatusRecoverableError = VirtualDeviceConnectInfoStatus("recoverableError") - VirtualDeviceConnectInfoStatusUnrecoverableError = VirtualDeviceConnectInfoStatus("unrecoverableError") - VirtualDeviceConnectInfoStatusUntried = VirtualDeviceConnectInfoStatus("untried") -) - -func init() { - t["VirtualDeviceConnectInfoStatus"] = reflect.TypeOf((*VirtualDeviceConnectInfoStatus)(nil)).Elem() -} - -type VirtualDeviceFileExtension string - -const ( - VirtualDeviceFileExtensionIso = VirtualDeviceFileExtension("iso") - VirtualDeviceFileExtensionFlp = VirtualDeviceFileExtension("flp") - VirtualDeviceFileExtensionVmdk = VirtualDeviceFileExtension("vmdk") - VirtualDeviceFileExtensionDsk = VirtualDeviceFileExtension("dsk") - VirtualDeviceFileExtensionRdm = VirtualDeviceFileExtension("rdm") -) - -func init() { - t["VirtualDeviceFileExtension"] = reflect.TypeOf((*VirtualDeviceFileExtension)(nil)).Elem() -} - -type VirtualDeviceURIBackingOptionDirection string - -const ( - VirtualDeviceURIBackingOptionDirectionServer = VirtualDeviceURIBackingOptionDirection("server") - VirtualDeviceURIBackingOptionDirectionClient = VirtualDeviceURIBackingOptionDirection("client") -) - -func init() { - t["VirtualDeviceURIBackingOptionDirection"] = reflect.TypeOf((*VirtualDeviceURIBackingOptionDirection)(nil)).Elem() -} - -type VirtualDiskAdapterType string - -const ( - VirtualDiskAdapterTypeIde = VirtualDiskAdapterType("ide") - VirtualDiskAdapterTypeBusLogic = VirtualDiskAdapterType("busLogic") - VirtualDiskAdapterTypeLsiLogic = VirtualDiskAdapterType("lsiLogic") -) - -func init() { - t["VirtualDiskAdapterType"] = reflect.TypeOf((*VirtualDiskAdapterType)(nil)).Elem() -} - -type VirtualDiskCompatibilityMode string - -const ( - VirtualDiskCompatibilityModeVirtualMode = VirtualDiskCompatibilityMode("virtualMode") - VirtualDiskCompatibilityModePhysicalMode = VirtualDiskCompatibilityMode("physicalMode") -) - -func init() { - t["VirtualDiskCompatibilityMode"] = reflect.TypeOf((*VirtualDiskCompatibilityMode)(nil)).Elem() -} - -type VirtualDiskDeltaDiskFormat string - -const ( - VirtualDiskDeltaDiskFormatRedoLogFormat = VirtualDiskDeltaDiskFormat("redoLogFormat") - VirtualDiskDeltaDiskFormatNativeFormat = VirtualDiskDeltaDiskFormat("nativeFormat") - VirtualDiskDeltaDiskFormatSeSparseFormat = VirtualDiskDeltaDiskFormat("seSparseFormat") -) - -func init() { - t["VirtualDiskDeltaDiskFormat"] = reflect.TypeOf((*VirtualDiskDeltaDiskFormat)(nil)).Elem() -} - -type VirtualDiskMode string - -const ( - VirtualDiskModePersistent = VirtualDiskMode("persistent") - VirtualDiskModeNonpersistent = VirtualDiskMode("nonpersistent") - VirtualDiskModeUndoable = VirtualDiskMode("undoable") - VirtualDiskModeIndependent_persistent = VirtualDiskMode("independent_persistent") - VirtualDiskModeIndependent_nonpersistent = VirtualDiskMode("independent_nonpersistent") - VirtualDiskModeAppend = VirtualDiskMode("append") -) - -func init() { - t["VirtualDiskMode"] = reflect.TypeOf((*VirtualDiskMode)(nil)).Elem() -} - -type VirtualDiskType string - -const ( - VirtualDiskTypePreallocated = VirtualDiskType("preallocated") - VirtualDiskTypeThin = VirtualDiskType("thin") - VirtualDiskTypeSeSparse = VirtualDiskType("seSparse") - VirtualDiskTypeRdm = VirtualDiskType("rdm") - VirtualDiskTypeRdmp = VirtualDiskType("rdmp") - VirtualDiskTypeRaw = VirtualDiskType("raw") - VirtualDiskTypeDelta = VirtualDiskType("delta") - VirtualDiskTypeSparse2Gb = VirtualDiskType("sparse2Gb") - VirtualDiskTypeThick2Gb = VirtualDiskType("thick2Gb") - VirtualDiskTypeEagerZeroedThick = VirtualDiskType("eagerZeroedThick") - VirtualDiskTypeSparseMonolithic = VirtualDiskType("sparseMonolithic") - VirtualDiskTypeFlatMonolithic = VirtualDiskType("flatMonolithic") - VirtualDiskTypeThick = VirtualDiskType("thick") -) - -func init() { - t["VirtualDiskType"] = reflect.TypeOf((*VirtualDiskType)(nil)).Elem() -} - -type VirtualDiskVFlashCacheConfigInfoCacheConsistencyType string - -const ( - VirtualDiskVFlashCacheConfigInfoCacheConsistencyTypeStrong = VirtualDiskVFlashCacheConfigInfoCacheConsistencyType("strong") - VirtualDiskVFlashCacheConfigInfoCacheConsistencyTypeWeak = VirtualDiskVFlashCacheConfigInfoCacheConsistencyType("weak") -) - -func init() { - t["VirtualDiskVFlashCacheConfigInfoCacheConsistencyType"] = reflect.TypeOf((*VirtualDiskVFlashCacheConfigInfoCacheConsistencyType)(nil)).Elem() -} - -type VirtualDiskVFlashCacheConfigInfoCacheMode string - -const ( - VirtualDiskVFlashCacheConfigInfoCacheModeWrite_thru = VirtualDiskVFlashCacheConfigInfoCacheMode("write_thru") - VirtualDiskVFlashCacheConfigInfoCacheModeWrite_back = VirtualDiskVFlashCacheConfigInfoCacheMode("write_back") -) - -func init() { - t["VirtualDiskVFlashCacheConfigInfoCacheMode"] = reflect.TypeOf((*VirtualDiskVFlashCacheConfigInfoCacheMode)(nil)).Elem() -} - -type VirtualEthernetCardLegacyNetworkDeviceName string - -const ( - VirtualEthernetCardLegacyNetworkDeviceNameBridged = VirtualEthernetCardLegacyNetworkDeviceName("bridged") - VirtualEthernetCardLegacyNetworkDeviceNameNat = VirtualEthernetCardLegacyNetworkDeviceName("nat") - VirtualEthernetCardLegacyNetworkDeviceNameHostonly = VirtualEthernetCardLegacyNetworkDeviceName("hostonly") -) - -func init() { - t["VirtualEthernetCardLegacyNetworkDeviceName"] = reflect.TypeOf((*VirtualEthernetCardLegacyNetworkDeviceName)(nil)).Elem() -} - -type VirtualEthernetCardMacType string - -const ( - VirtualEthernetCardMacTypeManual = VirtualEthernetCardMacType("manual") - VirtualEthernetCardMacTypeGenerated = VirtualEthernetCardMacType("generated") - VirtualEthernetCardMacTypeAssigned = VirtualEthernetCardMacType("assigned") -) - -func init() { - t["VirtualEthernetCardMacType"] = reflect.TypeOf((*VirtualEthernetCardMacType)(nil)).Elem() -} - -type VirtualMachineAppHeartbeatStatusType string - -const ( - VirtualMachineAppHeartbeatStatusTypeAppStatusGray = VirtualMachineAppHeartbeatStatusType("appStatusGray") - VirtualMachineAppHeartbeatStatusTypeAppStatusGreen = VirtualMachineAppHeartbeatStatusType("appStatusGreen") - VirtualMachineAppHeartbeatStatusTypeAppStatusRed = VirtualMachineAppHeartbeatStatusType("appStatusRed") -) - -func init() { - t["VirtualMachineAppHeartbeatStatusType"] = reflect.TypeOf((*VirtualMachineAppHeartbeatStatusType)(nil)).Elem() -} - -type VirtualMachineConfigInfoNpivWwnType string - -const ( - VirtualMachineConfigInfoNpivWwnTypeVc = VirtualMachineConfigInfoNpivWwnType("vc") - VirtualMachineConfigInfoNpivWwnTypeHost = VirtualMachineConfigInfoNpivWwnType("host") - VirtualMachineConfigInfoNpivWwnTypeExternal = VirtualMachineConfigInfoNpivWwnType("external") -) - -func init() { - t["VirtualMachineConfigInfoNpivWwnType"] = reflect.TypeOf((*VirtualMachineConfigInfoNpivWwnType)(nil)).Elem() -} - -type VirtualMachineConfigInfoSwapPlacementType string - -const ( - VirtualMachineConfigInfoSwapPlacementTypeInherit = VirtualMachineConfigInfoSwapPlacementType("inherit") - VirtualMachineConfigInfoSwapPlacementTypeVmDirectory = VirtualMachineConfigInfoSwapPlacementType("vmDirectory") - VirtualMachineConfigInfoSwapPlacementTypeHostLocal = VirtualMachineConfigInfoSwapPlacementType("hostLocal") -) - -func init() { - t["VirtualMachineConfigInfoSwapPlacementType"] = reflect.TypeOf((*VirtualMachineConfigInfoSwapPlacementType)(nil)).Elem() -} - -type VirtualMachineConfigSpecNpivWwnOp string - -const ( - VirtualMachineConfigSpecNpivWwnOpGenerate = VirtualMachineConfigSpecNpivWwnOp("generate") - VirtualMachineConfigSpecNpivWwnOpSet = VirtualMachineConfigSpecNpivWwnOp("set") - VirtualMachineConfigSpecNpivWwnOpRemove = VirtualMachineConfigSpecNpivWwnOp("remove") - VirtualMachineConfigSpecNpivWwnOpExtend = VirtualMachineConfigSpecNpivWwnOp("extend") -) - -func init() { - t["VirtualMachineConfigSpecNpivWwnOp"] = reflect.TypeOf((*VirtualMachineConfigSpecNpivWwnOp)(nil)).Elem() -} - -type VirtualMachineConnectionState string - -const ( - VirtualMachineConnectionStateConnected = VirtualMachineConnectionState("connected") - VirtualMachineConnectionStateDisconnected = VirtualMachineConnectionState("disconnected") - VirtualMachineConnectionStateOrphaned = VirtualMachineConnectionState("orphaned") - VirtualMachineConnectionStateInaccessible = VirtualMachineConnectionState("inaccessible") - VirtualMachineConnectionStateInvalid = VirtualMachineConnectionState("invalid") -) - -func init() { - t["VirtualMachineConnectionState"] = reflect.TypeOf((*VirtualMachineConnectionState)(nil)).Elem() -} - -type VirtualMachineDeviceRuntimeInfoVirtualEthernetCardRuntimeStateVmDirectPathGen2InactiveReasonOther string - -const ( - VirtualMachineDeviceRuntimeInfoVirtualEthernetCardRuntimeStateVmDirectPathGen2InactiveReasonOtherVmNptIncompatibleHost = VirtualMachineDeviceRuntimeInfoVirtualEthernetCardRuntimeStateVmDirectPathGen2InactiveReasonOther("vmNptIncompatibleHost") - VirtualMachineDeviceRuntimeInfoVirtualEthernetCardRuntimeStateVmDirectPathGen2InactiveReasonOtherVmNptIncompatibleNetwork = VirtualMachineDeviceRuntimeInfoVirtualEthernetCardRuntimeStateVmDirectPathGen2InactiveReasonOther("vmNptIncompatibleNetwork") -) - -func init() { - t["VirtualMachineDeviceRuntimeInfoVirtualEthernetCardRuntimeStateVmDirectPathGen2InactiveReasonOther"] = reflect.TypeOf((*VirtualMachineDeviceRuntimeInfoVirtualEthernetCardRuntimeStateVmDirectPathGen2InactiveReasonOther)(nil)).Elem() -} - -type VirtualMachineDeviceRuntimeInfoVirtualEthernetCardRuntimeStateVmDirectPathGen2InactiveReasonVm string - -const ( - VirtualMachineDeviceRuntimeInfoVirtualEthernetCardRuntimeStateVmDirectPathGen2InactiveReasonVmVmNptIncompatibleGuest = VirtualMachineDeviceRuntimeInfoVirtualEthernetCardRuntimeStateVmDirectPathGen2InactiveReasonVm("vmNptIncompatibleGuest") - VirtualMachineDeviceRuntimeInfoVirtualEthernetCardRuntimeStateVmDirectPathGen2InactiveReasonVmVmNptIncompatibleGuestDriver = VirtualMachineDeviceRuntimeInfoVirtualEthernetCardRuntimeStateVmDirectPathGen2InactiveReasonVm("vmNptIncompatibleGuestDriver") - VirtualMachineDeviceRuntimeInfoVirtualEthernetCardRuntimeStateVmDirectPathGen2InactiveReasonVmVmNptIncompatibleAdapterType = VirtualMachineDeviceRuntimeInfoVirtualEthernetCardRuntimeStateVmDirectPathGen2InactiveReasonVm("vmNptIncompatibleAdapterType") - VirtualMachineDeviceRuntimeInfoVirtualEthernetCardRuntimeStateVmDirectPathGen2InactiveReasonVmVmNptDisabledOrDisconnectedAdapter = VirtualMachineDeviceRuntimeInfoVirtualEthernetCardRuntimeStateVmDirectPathGen2InactiveReasonVm("vmNptDisabledOrDisconnectedAdapter") - VirtualMachineDeviceRuntimeInfoVirtualEthernetCardRuntimeStateVmDirectPathGen2InactiveReasonVmVmNptIncompatibleAdapterFeatures = VirtualMachineDeviceRuntimeInfoVirtualEthernetCardRuntimeStateVmDirectPathGen2InactiveReasonVm("vmNptIncompatibleAdapterFeatures") - VirtualMachineDeviceRuntimeInfoVirtualEthernetCardRuntimeStateVmDirectPathGen2InactiveReasonVmVmNptIncompatibleBackingType = VirtualMachineDeviceRuntimeInfoVirtualEthernetCardRuntimeStateVmDirectPathGen2InactiveReasonVm("vmNptIncompatibleBackingType") - VirtualMachineDeviceRuntimeInfoVirtualEthernetCardRuntimeStateVmDirectPathGen2InactiveReasonVmVmNptInsufficientMemoryReservation = VirtualMachineDeviceRuntimeInfoVirtualEthernetCardRuntimeStateVmDirectPathGen2InactiveReasonVm("vmNptInsufficientMemoryReservation") - VirtualMachineDeviceRuntimeInfoVirtualEthernetCardRuntimeStateVmDirectPathGen2InactiveReasonVmVmNptFaultToleranceOrRecordReplayConfigured = VirtualMachineDeviceRuntimeInfoVirtualEthernetCardRuntimeStateVmDirectPathGen2InactiveReasonVm("vmNptFaultToleranceOrRecordReplayConfigured") - VirtualMachineDeviceRuntimeInfoVirtualEthernetCardRuntimeStateVmDirectPathGen2InactiveReasonVmVmNptConflictingIOChainConfigured = VirtualMachineDeviceRuntimeInfoVirtualEthernetCardRuntimeStateVmDirectPathGen2InactiveReasonVm("vmNptConflictingIOChainConfigured") - VirtualMachineDeviceRuntimeInfoVirtualEthernetCardRuntimeStateVmDirectPathGen2InactiveReasonVmVmNptMonitorBlocks = VirtualMachineDeviceRuntimeInfoVirtualEthernetCardRuntimeStateVmDirectPathGen2InactiveReasonVm("vmNptMonitorBlocks") - VirtualMachineDeviceRuntimeInfoVirtualEthernetCardRuntimeStateVmDirectPathGen2InactiveReasonVmVmNptConflictingOperationInProgress = VirtualMachineDeviceRuntimeInfoVirtualEthernetCardRuntimeStateVmDirectPathGen2InactiveReasonVm("vmNptConflictingOperationInProgress") - VirtualMachineDeviceRuntimeInfoVirtualEthernetCardRuntimeStateVmDirectPathGen2InactiveReasonVmVmNptRuntimeError = VirtualMachineDeviceRuntimeInfoVirtualEthernetCardRuntimeStateVmDirectPathGen2InactiveReasonVm("vmNptRuntimeError") - VirtualMachineDeviceRuntimeInfoVirtualEthernetCardRuntimeStateVmDirectPathGen2InactiveReasonVmVmNptOutOfIntrVector = VirtualMachineDeviceRuntimeInfoVirtualEthernetCardRuntimeStateVmDirectPathGen2InactiveReasonVm("vmNptOutOfIntrVector") - VirtualMachineDeviceRuntimeInfoVirtualEthernetCardRuntimeStateVmDirectPathGen2InactiveReasonVmVmNptVMCIActive = VirtualMachineDeviceRuntimeInfoVirtualEthernetCardRuntimeStateVmDirectPathGen2InactiveReasonVm("vmNptVMCIActive") -) - -func init() { - t["VirtualMachineDeviceRuntimeInfoVirtualEthernetCardRuntimeStateVmDirectPathGen2InactiveReasonVm"] = reflect.TypeOf((*VirtualMachineDeviceRuntimeInfoVirtualEthernetCardRuntimeStateVmDirectPathGen2InactiveReasonVm)(nil)).Elem() -} - -type VirtualMachineFaultToleranceState string - -const ( - VirtualMachineFaultToleranceStateNotConfigured = VirtualMachineFaultToleranceState("notConfigured") - VirtualMachineFaultToleranceStateDisabled = VirtualMachineFaultToleranceState("disabled") - VirtualMachineFaultToleranceStateEnabled = VirtualMachineFaultToleranceState("enabled") - VirtualMachineFaultToleranceStateNeedSecondary = VirtualMachineFaultToleranceState("needSecondary") - VirtualMachineFaultToleranceStateStarting = VirtualMachineFaultToleranceState("starting") - VirtualMachineFaultToleranceStateRunning = VirtualMachineFaultToleranceState("running") -) - -func init() { - t["VirtualMachineFaultToleranceState"] = reflect.TypeOf((*VirtualMachineFaultToleranceState)(nil)).Elem() -} - -type VirtualMachineFileLayoutExFileType string - -const ( - VirtualMachineFileLayoutExFileTypeConfig = VirtualMachineFileLayoutExFileType("config") - VirtualMachineFileLayoutExFileTypeExtendedConfig = VirtualMachineFileLayoutExFileType("extendedConfig") - VirtualMachineFileLayoutExFileTypeDiskDescriptor = VirtualMachineFileLayoutExFileType("diskDescriptor") - VirtualMachineFileLayoutExFileTypeDiskExtent = VirtualMachineFileLayoutExFileType("diskExtent") - VirtualMachineFileLayoutExFileTypeDigestDescriptor = VirtualMachineFileLayoutExFileType("digestDescriptor") - VirtualMachineFileLayoutExFileTypeDigestExtent = VirtualMachineFileLayoutExFileType("digestExtent") - VirtualMachineFileLayoutExFileTypeDiskReplicationState = VirtualMachineFileLayoutExFileType("diskReplicationState") - VirtualMachineFileLayoutExFileTypeLog = VirtualMachineFileLayoutExFileType("log") - VirtualMachineFileLayoutExFileTypeStat = VirtualMachineFileLayoutExFileType("stat") - VirtualMachineFileLayoutExFileTypeNamespaceData = VirtualMachineFileLayoutExFileType("namespaceData") - VirtualMachineFileLayoutExFileTypeNvram = VirtualMachineFileLayoutExFileType("nvram") - VirtualMachineFileLayoutExFileTypeSnapshotData = VirtualMachineFileLayoutExFileType("snapshotData") - VirtualMachineFileLayoutExFileTypeSnapshotList = VirtualMachineFileLayoutExFileType("snapshotList") - VirtualMachineFileLayoutExFileTypeSnapshotManifestList = VirtualMachineFileLayoutExFileType("snapshotManifestList") - VirtualMachineFileLayoutExFileTypeSuspend = VirtualMachineFileLayoutExFileType("suspend") - VirtualMachineFileLayoutExFileTypeSwap = VirtualMachineFileLayoutExFileType("swap") - VirtualMachineFileLayoutExFileTypeUwswap = VirtualMachineFileLayoutExFileType("uwswap") - VirtualMachineFileLayoutExFileTypeCore = VirtualMachineFileLayoutExFileType("core") - VirtualMachineFileLayoutExFileTypeScreenshot = VirtualMachineFileLayoutExFileType("screenshot") -) - -func init() { - t["VirtualMachineFileLayoutExFileType"] = reflect.TypeOf((*VirtualMachineFileLayoutExFileType)(nil)).Elem() -} - -type VirtualMachineFlagInfoMonitorType string - -const ( - VirtualMachineFlagInfoMonitorTypeRelease = VirtualMachineFlagInfoMonitorType("release") - VirtualMachineFlagInfoMonitorTypeDebug = VirtualMachineFlagInfoMonitorType("debug") - VirtualMachineFlagInfoMonitorTypeStats = VirtualMachineFlagInfoMonitorType("stats") -) - -func init() { - t["VirtualMachineFlagInfoMonitorType"] = reflect.TypeOf((*VirtualMachineFlagInfoMonitorType)(nil)).Elem() -} - -type VirtualMachineFlagInfoVirtualExecUsage string - -const ( - VirtualMachineFlagInfoVirtualExecUsageHvAuto = VirtualMachineFlagInfoVirtualExecUsage("hvAuto") - VirtualMachineFlagInfoVirtualExecUsageHvOn = VirtualMachineFlagInfoVirtualExecUsage("hvOn") - VirtualMachineFlagInfoVirtualExecUsageHvOff = VirtualMachineFlagInfoVirtualExecUsage("hvOff") -) - -func init() { - t["VirtualMachineFlagInfoVirtualExecUsage"] = reflect.TypeOf((*VirtualMachineFlagInfoVirtualExecUsage)(nil)).Elem() -} - -type VirtualMachineFlagInfoVirtualMmuUsage string - -const ( - VirtualMachineFlagInfoVirtualMmuUsageAutomatic = VirtualMachineFlagInfoVirtualMmuUsage("automatic") - VirtualMachineFlagInfoVirtualMmuUsageOn = VirtualMachineFlagInfoVirtualMmuUsage("on") - VirtualMachineFlagInfoVirtualMmuUsageOff = VirtualMachineFlagInfoVirtualMmuUsage("off") -) - -func init() { - t["VirtualMachineFlagInfoVirtualMmuUsage"] = reflect.TypeOf((*VirtualMachineFlagInfoVirtualMmuUsage)(nil)).Elem() -} - -type VirtualMachineGuestOsFamily string - -const ( - VirtualMachineGuestOsFamilyWindowsGuest = VirtualMachineGuestOsFamily("windowsGuest") - VirtualMachineGuestOsFamilyLinuxGuest = VirtualMachineGuestOsFamily("linuxGuest") - VirtualMachineGuestOsFamilyNetwareGuest = VirtualMachineGuestOsFamily("netwareGuest") - VirtualMachineGuestOsFamilySolarisGuest = VirtualMachineGuestOsFamily("solarisGuest") - VirtualMachineGuestOsFamilyDarwinGuestFamily = VirtualMachineGuestOsFamily("darwinGuestFamily") - VirtualMachineGuestOsFamilyOtherGuestFamily = VirtualMachineGuestOsFamily("otherGuestFamily") -) - -func init() { - t["VirtualMachineGuestOsFamily"] = reflect.TypeOf((*VirtualMachineGuestOsFamily)(nil)).Elem() -} - -type VirtualMachineGuestOsIdentifier string - -const ( - VirtualMachineGuestOsIdentifierDosGuest = VirtualMachineGuestOsIdentifier("dosGuest") - VirtualMachineGuestOsIdentifierWin31Guest = VirtualMachineGuestOsIdentifier("win31Guest") - VirtualMachineGuestOsIdentifierWin95Guest = VirtualMachineGuestOsIdentifier("win95Guest") - VirtualMachineGuestOsIdentifierWin98Guest = VirtualMachineGuestOsIdentifier("win98Guest") - VirtualMachineGuestOsIdentifierWinMeGuest = VirtualMachineGuestOsIdentifier("winMeGuest") - VirtualMachineGuestOsIdentifierWinNTGuest = VirtualMachineGuestOsIdentifier("winNTGuest") - VirtualMachineGuestOsIdentifierWin2000ProGuest = VirtualMachineGuestOsIdentifier("win2000ProGuest") - VirtualMachineGuestOsIdentifierWin2000ServGuest = VirtualMachineGuestOsIdentifier("win2000ServGuest") - VirtualMachineGuestOsIdentifierWin2000AdvServGuest = VirtualMachineGuestOsIdentifier("win2000AdvServGuest") - VirtualMachineGuestOsIdentifierWinXPHomeGuest = VirtualMachineGuestOsIdentifier("winXPHomeGuest") - VirtualMachineGuestOsIdentifierWinXPProGuest = VirtualMachineGuestOsIdentifier("winXPProGuest") - VirtualMachineGuestOsIdentifierWinXPPro64Guest = VirtualMachineGuestOsIdentifier("winXPPro64Guest") - VirtualMachineGuestOsIdentifierWinNetWebGuest = VirtualMachineGuestOsIdentifier("winNetWebGuest") - VirtualMachineGuestOsIdentifierWinNetStandardGuest = VirtualMachineGuestOsIdentifier("winNetStandardGuest") - VirtualMachineGuestOsIdentifierWinNetEnterpriseGuest = VirtualMachineGuestOsIdentifier("winNetEnterpriseGuest") - VirtualMachineGuestOsIdentifierWinNetDatacenterGuest = VirtualMachineGuestOsIdentifier("winNetDatacenterGuest") - VirtualMachineGuestOsIdentifierWinNetBusinessGuest = VirtualMachineGuestOsIdentifier("winNetBusinessGuest") - VirtualMachineGuestOsIdentifierWinNetStandard64Guest = VirtualMachineGuestOsIdentifier("winNetStandard64Guest") - VirtualMachineGuestOsIdentifierWinNetEnterprise64Guest = VirtualMachineGuestOsIdentifier("winNetEnterprise64Guest") - VirtualMachineGuestOsIdentifierWinLonghornGuest = VirtualMachineGuestOsIdentifier("winLonghornGuest") - VirtualMachineGuestOsIdentifierWinLonghorn64Guest = VirtualMachineGuestOsIdentifier("winLonghorn64Guest") - VirtualMachineGuestOsIdentifierWinNetDatacenter64Guest = VirtualMachineGuestOsIdentifier("winNetDatacenter64Guest") - VirtualMachineGuestOsIdentifierWinVistaGuest = VirtualMachineGuestOsIdentifier("winVistaGuest") - VirtualMachineGuestOsIdentifierWinVista64Guest = VirtualMachineGuestOsIdentifier("winVista64Guest") - VirtualMachineGuestOsIdentifierWindows7Guest = VirtualMachineGuestOsIdentifier("windows7Guest") - VirtualMachineGuestOsIdentifierWindows7_64Guest = VirtualMachineGuestOsIdentifier("windows7_64Guest") - VirtualMachineGuestOsIdentifierWindows7Server64Guest = VirtualMachineGuestOsIdentifier("windows7Server64Guest") - VirtualMachineGuestOsIdentifierWindows8Guest = VirtualMachineGuestOsIdentifier("windows8Guest") - VirtualMachineGuestOsIdentifierWindows8_64Guest = VirtualMachineGuestOsIdentifier("windows8_64Guest") - VirtualMachineGuestOsIdentifierWindows8Server64Guest = VirtualMachineGuestOsIdentifier("windows8Server64Guest") - VirtualMachineGuestOsIdentifierWindowsHyperVGuest = VirtualMachineGuestOsIdentifier("windowsHyperVGuest") - VirtualMachineGuestOsIdentifierFreebsdGuest = VirtualMachineGuestOsIdentifier("freebsdGuest") - VirtualMachineGuestOsIdentifierFreebsd64Guest = VirtualMachineGuestOsIdentifier("freebsd64Guest") - VirtualMachineGuestOsIdentifierRedhatGuest = VirtualMachineGuestOsIdentifier("redhatGuest") - VirtualMachineGuestOsIdentifierRhel2Guest = VirtualMachineGuestOsIdentifier("rhel2Guest") - VirtualMachineGuestOsIdentifierRhel3Guest = VirtualMachineGuestOsIdentifier("rhel3Guest") - VirtualMachineGuestOsIdentifierRhel3_64Guest = VirtualMachineGuestOsIdentifier("rhel3_64Guest") - VirtualMachineGuestOsIdentifierRhel4Guest = VirtualMachineGuestOsIdentifier("rhel4Guest") - VirtualMachineGuestOsIdentifierRhel4_64Guest = VirtualMachineGuestOsIdentifier("rhel4_64Guest") - VirtualMachineGuestOsIdentifierRhel5Guest = VirtualMachineGuestOsIdentifier("rhel5Guest") - VirtualMachineGuestOsIdentifierRhel5_64Guest = VirtualMachineGuestOsIdentifier("rhel5_64Guest") - VirtualMachineGuestOsIdentifierRhel6Guest = VirtualMachineGuestOsIdentifier("rhel6Guest") - VirtualMachineGuestOsIdentifierRhel6_64Guest = VirtualMachineGuestOsIdentifier("rhel6_64Guest") - VirtualMachineGuestOsIdentifierRhel7Guest = VirtualMachineGuestOsIdentifier("rhel7Guest") - VirtualMachineGuestOsIdentifierRhel7_64Guest = VirtualMachineGuestOsIdentifier("rhel7_64Guest") - VirtualMachineGuestOsIdentifierCentosGuest = VirtualMachineGuestOsIdentifier("centosGuest") - VirtualMachineGuestOsIdentifierCentos64Guest = VirtualMachineGuestOsIdentifier("centos64Guest") - VirtualMachineGuestOsIdentifierOracleLinuxGuest = VirtualMachineGuestOsIdentifier("oracleLinuxGuest") - VirtualMachineGuestOsIdentifierOracleLinux64Guest = VirtualMachineGuestOsIdentifier("oracleLinux64Guest") - VirtualMachineGuestOsIdentifierSuseGuest = VirtualMachineGuestOsIdentifier("suseGuest") - VirtualMachineGuestOsIdentifierSuse64Guest = VirtualMachineGuestOsIdentifier("suse64Guest") - VirtualMachineGuestOsIdentifierSlesGuest = VirtualMachineGuestOsIdentifier("slesGuest") - VirtualMachineGuestOsIdentifierSles64Guest = VirtualMachineGuestOsIdentifier("sles64Guest") - VirtualMachineGuestOsIdentifierSles10Guest = VirtualMachineGuestOsIdentifier("sles10Guest") - VirtualMachineGuestOsIdentifierSles10_64Guest = VirtualMachineGuestOsIdentifier("sles10_64Guest") - VirtualMachineGuestOsIdentifierSles11Guest = VirtualMachineGuestOsIdentifier("sles11Guest") - VirtualMachineGuestOsIdentifierSles11_64Guest = VirtualMachineGuestOsIdentifier("sles11_64Guest") - VirtualMachineGuestOsIdentifierSles12Guest = VirtualMachineGuestOsIdentifier("sles12Guest") - VirtualMachineGuestOsIdentifierSles12_64Guest = VirtualMachineGuestOsIdentifier("sles12_64Guest") - VirtualMachineGuestOsIdentifierNld9Guest = VirtualMachineGuestOsIdentifier("nld9Guest") - VirtualMachineGuestOsIdentifierOesGuest = VirtualMachineGuestOsIdentifier("oesGuest") - VirtualMachineGuestOsIdentifierSjdsGuest = VirtualMachineGuestOsIdentifier("sjdsGuest") - VirtualMachineGuestOsIdentifierMandrakeGuest = VirtualMachineGuestOsIdentifier("mandrakeGuest") - VirtualMachineGuestOsIdentifierMandrivaGuest = VirtualMachineGuestOsIdentifier("mandrivaGuest") - VirtualMachineGuestOsIdentifierMandriva64Guest = VirtualMachineGuestOsIdentifier("mandriva64Guest") - VirtualMachineGuestOsIdentifierTurboLinuxGuest = VirtualMachineGuestOsIdentifier("turboLinuxGuest") - VirtualMachineGuestOsIdentifierTurboLinux64Guest = VirtualMachineGuestOsIdentifier("turboLinux64Guest") - VirtualMachineGuestOsIdentifierUbuntuGuest = VirtualMachineGuestOsIdentifier("ubuntuGuest") - VirtualMachineGuestOsIdentifierUbuntu64Guest = VirtualMachineGuestOsIdentifier("ubuntu64Guest") - VirtualMachineGuestOsIdentifierDebian4Guest = VirtualMachineGuestOsIdentifier("debian4Guest") - VirtualMachineGuestOsIdentifierDebian4_64Guest = VirtualMachineGuestOsIdentifier("debian4_64Guest") - VirtualMachineGuestOsIdentifierDebian5Guest = VirtualMachineGuestOsIdentifier("debian5Guest") - VirtualMachineGuestOsIdentifierDebian5_64Guest = VirtualMachineGuestOsIdentifier("debian5_64Guest") - VirtualMachineGuestOsIdentifierDebian6Guest = VirtualMachineGuestOsIdentifier("debian6Guest") - VirtualMachineGuestOsIdentifierDebian6_64Guest = VirtualMachineGuestOsIdentifier("debian6_64Guest") - VirtualMachineGuestOsIdentifierDebian7Guest = VirtualMachineGuestOsIdentifier("debian7Guest") - VirtualMachineGuestOsIdentifierDebian7_64Guest = VirtualMachineGuestOsIdentifier("debian7_64Guest") - VirtualMachineGuestOsIdentifierAsianux3Guest = VirtualMachineGuestOsIdentifier("asianux3Guest") - VirtualMachineGuestOsIdentifierAsianux3_64Guest = VirtualMachineGuestOsIdentifier("asianux3_64Guest") - VirtualMachineGuestOsIdentifierAsianux4Guest = VirtualMachineGuestOsIdentifier("asianux4Guest") - VirtualMachineGuestOsIdentifierAsianux4_64Guest = VirtualMachineGuestOsIdentifier("asianux4_64Guest") - VirtualMachineGuestOsIdentifierOpensuseGuest = VirtualMachineGuestOsIdentifier("opensuseGuest") - VirtualMachineGuestOsIdentifierOpensuse64Guest = VirtualMachineGuestOsIdentifier("opensuse64Guest") - VirtualMachineGuestOsIdentifierFedoraGuest = VirtualMachineGuestOsIdentifier("fedoraGuest") - VirtualMachineGuestOsIdentifierFedora64Guest = VirtualMachineGuestOsIdentifier("fedora64Guest") - VirtualMachineGuestOsIdentifierOther24xLinuxGuest = VirtualMachineGuestOsIdentifier("other24xLinuxGuest") - VirtualMachineGuestOsIdentifierOther26xLinuxGuest = VirtualMachineGuestOsIdentifier("other26xLinuxGuest") - VirtualMachineGuestOsIdentifierOtherLinuxGuest = VirtualMachineGuestOsIdentifier("otherLinuxGuest") - VirtualMachineGuestOsIdentifierOther3xLinuxGuest = VirtualMachineGuestOsIdentifier("other3xLinuxGuest") - VirtualMachineGuestOsIdentifierGenericLinuxGuest = VirtualMachineGuestOsIdentifier("genericLinuxGuest") - VirtualMachineGuestOsIdentifierOther24xLinux64Guest = VirtualMachineGuestOsIdentifier("other24xLinux64Guest") - VirtualMachineGuestOsIdentifierOther26xLinux64Guest = VirtualMachineGuestOsIdentifier("other26xLinux64Guest") - VirtualMachineGuestOsIdentifierOther3xLinux64Guest = VirtualMachineGuestOsIdentifier("other3xLinux64Guest") - VirtualMachineGuestOsIdentifierOtherLinux64Guest = VirtualMachineGuestOsIdentifier("otherLinux64Guest") - VirtualMachineGuestOsIdentifierSolaris6Guest = VirtualMachineGuestOsIdentifier("solaris6Guest") - VirtualMachineGuestOsIdentifierSolaris7Guest = VirtualMachineGuestOsIdentifier("solaris7Guest") - VirtualMachineGuestOsIdentifierSolaris8Guest = VirtualMachineGuestOsIdentifier("solaris8Guest") - VirtualMachineGuestOsIdentifierSolaris9Guest = VirtualMachineGuestOsIdentifier("solaris9Guest") - VirtualMachineGuestOsIdentifierSolaris10Guest = VirtualMachineGuestOsIdentifier("solaris10Guest") - VirtualMachineGuestOsIdentifierSolaris10_64Guest = VirtualMachineGuestOsIdentifier("solaris10_64Guest") - VirtualMachineGuestOsIdentifierSolaris11_64Guest = VirtualMachineGuestOsIdentifier("solaris11_64Guest") - VirtualMachineGuestOsIdentifierOs2Guest = VirtualMachineGuestOsIdentifier("os2Guest") - VirtualMachineGuestOsIdentifierEComStationGuest = VirtualMachineGuestOsIdentifier("eComStationGuest") - VirtualMachineGuestOsIdentifierEComStation2Guest = VirtualMachineGuestOsIdentifier("eComStation2Guest") - VirtualMachineGuestOsIdentifierNetware4Guest = VirtualMachineGuestOsIdentifier("netware4Guest") - VirtualMachineGuestOsIdentifierNetware5Guest = VirtualMachineGuestOsIdentifier("netware5Guest") - VirtualMachineGuestOsIdentifierNetware6Guest = VirtualMachineGuestOsIdentifier("netware6Guest") - VirtualMachineGuestOsIdentifierOpenServer5Guest = VirtualMachineGuestOsIdentifier("openServer5Guest") - VirtualMachineGuestOsIdentifierOpenServer6Guest = VirtualMachineGuestOsIdentifier("openServer6Guest") - VirtualMachineGuestOsIdentifierUnixWare7Guest = VirtualMachineGuestOsIdentifier("unixWare7Guest") - VirtualMachineGuestOsIdentifierDarwinGuest = VirtualMachineGuestOsIdentifier("darwinGuest") - VirtualMachineGuestOsIdentifierDarwin64Guest = VirtualMachineGuestOsIdentifier("darwin64Guest") - VirtualMachineGuestOsIdentifierDarwin10Guest = VirtualMachineGuestOsIdentifier("darwin10Guest") - VirtualMachineGuestOsIdentifierDarwin10_64Guest = VirtualMachineGuestOsIdentifier("darwin10_64Guest") - VirtualMachineGuestOsIdentifierDarwin11Guest = VirtualMachineGuestOsIdentifier("darwin11Guest") - VirtualMachineGuestOsIdentifierDarwin11_64Guest = VirtualMachineGuestOsIdentifier("darwin11_64Guest") - VirtualMachineGuestOsIdentifierDarwin12_64Guest = VirtualMachineGuestOsIdentifier("darwin12_64Guest") - VirtualMachineGuestOsIdentifierDarwin13_64Guest = VirtualMachineGuestOsIdentifier("darwin13_64Guest") - VirtualMachineGuestOsIdentifierVmkernelGuest = VirtualMachineGuestOsIdentifier("vmkernelGuest") - VirtualMachineGuestOsIdentifierVmkernel5Guest = VirtualMachineGuestOsIdentifier("vmkernel5Guest") - VirtualMachineGuestOsIdentifierOtherGuest = VirtualMachineGuestOsIdentifier("otherGuest") - VirtualMachineGuestOsIdentifierOtherGuest64 = VirtualMachineGuestOsIdentifier("otherGuest64") -) - -func init() { - t["VirtualMachineGuestOsIdentifier"] = reflect.TypeOf((*VirtualMachineGuestOsIdentifier)(nil)).Elem() -} - -type VirtualMachineGuestState string - -const ( - VirtualMachineGuestStateRunning = VirtualMachineGuestState("running") - VirtualMachineGuestStateShuttingDown = VirtualMachineGuestState("shuttingDown") - VirtualMachineGuestStateResetting = VirtualMachineGuestState("resetting") - VirtualMachineGuestStateStandby = VirtualMachineGuestState("standby") - VirtualMachineGuestStateNotRunning = VirtualMachineGuestState("notRunning") - VirtualMachineGuestStateUnknown = VirtualMachineGuestState("unknown") -) - -func init() { - t["VirtualMachineGuestState"] = reflect.TypeOf((*VirtualMachineGuestState)(nil)).Elem() -} - -type VirtualMachineHtSharing string - -const ( - VirtualMachineHtSharingAny = VirtualMachineHtSharing("any") - VirtualMachineHtSharingNone = VirtualMachineHtSharing("none") - VirtualMachineHtSharingInternal = VirtualMachineHtSharing("internal") -) - -func init() { - t["VirtualMachineHtSharing"] = reflect.TypeOf((*VirtualMachineHtSharing)(nil)).Elem() -} - -type VirtualMachineMemoryAllocationPolicy string - -const ( - VirtualMachineMemoryAllocationPolicySwapNone = VirtualMachineMemoryAllocationPolicy("swapNone") - VirtualMachineMemoryAllocationPolicySwapSome = VirtualMachineMemoryAllocationPolicy("swapSome") - VirtualMachineMemoryAllocationPolicySwapMost = VirtualMachineMemoryAllocationPolicy("swapMost") -) - -func init() { - t["VirtualMachineMemoryAllocationPolicy"] = reflect.TypeOf((*VirtualMachineMemoryAllocationPolicy)(nil)).Elem() -} - -type VirtualMachineMetadataManagerVmMetadataOp string - -const ( - VirtualMachineMetadataManagerVmMetadataOpUpdate = VirtualMachineMetadataManagerVmMetadataOp("Update") - VirtualMachineMetadataManagerVmMetadataOpRemove = VirtualMachineMetadataManagerVmMetadataOp("Remove") -) - -func init() { - t["VirtualMachineMetadataManagerVmMetadataOp"] = reflect.TypeOf((*VirtualMachineMetadataManagerVmMetadataOp)(nil)).Elem() -} - -type VirtualMachineMetadataManagerVmMetadataOwnerOwner string - -const ( - VirtualMachineMetadataManagerVmMetadataOwnerOwnerComVmwareVsphereHA = VirtualMachineMetadataManagerVmMetadataOwnerOwner("ComVmwareVsphereHA") -) - -func init() { - t["VirtualMachineMetadataManagerVmMetadataOwnerOwner"] = reflect.TypeOf((*VirtualMachineMetadataManagerVmMetadataOwnerOwner)(nil)).Elem() -} - -type VirtualMachineMovePriority string - -const ( - VirtualMachineMovePriorityLowPriority = VirtualMachineMovePriority("lowPriority") - VirtualMachineMovePriorityHighPriority = VirtualMachineMovePriority("highPriority") - VirtualMachineMovePriorityDefaultPriority = VirtualMachineMovePriority("defaultPriority") -) - -func init() { - t["VirtualMachineMovePriority"] = reflect.TypeOf((*VirtualMachineMovePriority)(nil)).Elem() -} - -type VirtualMachineNeedSecondaryReason string - -const ( - VirtualMachineNeedSecondaryReasonInitializing = VirtualMachineNeedSecondaryReason("initializing") - VirtualMachineNeedSecondaryReasonDivergence = VirtualMachineNeedSecondaryReason("divergence") - VirtualMachineNeedSecondaryReasonLostConnection = VirtualMachineNeedSecondaryReason("lostConnection") - VirtualMachineNeedSecondaryReasonPartialHardwareFailure = VirtualMachineNeedSecondaryReason("partialHardwareFailure") - VirtualMachineNeedSecondaryReasonUserAction = VirtualMachineNeedSecondaryReason("userAction") - VirtualMachineNeedSecondaryReasonOther = VirtualMachineNeedSecondaryReason("other") -) - -func init() { - t["VirtualMachineNeedSecondaryReason"] = reflect.TypeOf((*VirtualMachineNeedSecondaryReason)(nil)).Elem() -} - -type VirtualMachinePowerOffBehavior string - -const ( - VirtualMachinePowerOffBehaviorPowerOff = VirtualMachinePowerOffBehavior("powerOff") - VirtualMachinePowerOffBehaviorRevert = VirtualMachinePowerOffBehavior("revert") - VirtualMachinePowerOffBehaviorPrompt = VirtualMachinePowerOffBehavior("prompt") -) - -func init() { - t["VirtualMachinePowerOffBehavior"] = reflect.TypeOf((*VirtualMachinePowerOffBehavior)(nil)).Elem() -} - -type VirtualMachinePowerOpType string - -const ( - VirtualMachinePowerOpTypeSoft = VirtualMachinePowerOpType("soft") - VirtualMachinePowerOpTypeHard = VirtualMachinePowerOpType("hard") - VirtualMachinePowerOpTypePreset = VirtualMachinePowerOpType("preset") -) - -func init() { - t["VirtualMachinePowerOpType"] = reflect.TypeOf((*VirtualMachinePowerOpType)(nil)).Elem() -} - -type VirtualMachinePowerState string - -const ( - VirtualMachinePowerStatePoweredOff = VirtualMachinePowerState("poweredOff") - VirtualMachinePowerStatePoweredOn = VirtualMachinePowerState("poweredOn") - VirtualMachinePowerStateSuspended = VirtualMachinePowerState("suspended") -) - -func init() { - t["VirtualMachinePowerState"] = reflect.TypeOf((*VirtualMachinePowerState)(nil)).Elem() -} - -type VirtualMachineRecordReplayState string - -const ( - VirtualMachineRecordReplayStateRecording = VirtualMachineRecordReplayState("recording") - VirtualMachineRecordReplayStateReplaying = VirtualMachineRecordReplayState("replaying") - VirtualMachineRecordReplayStateInactive = VirtualMachineRecordReplayState("inactive") -) - -func init() { - t["VirtualMachineRecordReplayState"] = reflect.TypeOf((*VirtualMachineRecordReplayState)(nil)).Elem() -} - -type VirtualMachineRelocateDiskMoveOptions string - -const ( - VirtualMachineRelocateDiskMoveOptionsMoveAllDiskBackingsAndAllowSharing = VirtualMachineRelocateDiskMoveOptions("moveAllDiskBackingsAndAllowSharing") - VirtualMachineRelocateDiskMoveOptionsMoveAllDiskBackingsAndDisallowSharing = VirtualMachineRelocateDiskMoveOptions("moveAllDiskBackingsAndDisallowSharing") - VirtualMachineRelocateDiskMoveOptionsMoveChildMostDiskBacking = VirtualMachineRelocateDiskMoveOptions("moveChildMostDiskBacking") - VirtualMachineRelocateDiskMoveOptionsCreateNewChildDiskBacking = VirtualMachineRelocateDiskMoveOptions("createNewChildDiskBacking") - VirtualMachineRelocateDiskMoveOptionsMoveAllDiskBackingsAndConsolidate = VirtualMachineRelocateDiskMoveOptions("moveAllDiskBackingsAndConsolidate") -) - -func init() { - t["VirtualMachineRelocateDiskMoveOptions"] = reflect.TypeOf((*VirtualMachineRelocateDiskMoveOptions)(nil)).Elem() -} - -type VirtualMachineRelocateTransformation string - -const ( - VirtualMachineRelocateTransformationFlat = VirtualMachineRelocateTransformation("flat") - VirtualMachineRelocateTransformationSparse = VirtualMachineRelocateTransformation("sparse") -) - -func init() { - t["VirtualMachineRelocateTransformation"] = reflect.TypeOf((*VirtualMachineRelocateTransformation)(nil)).Elem() -} - -type VirtualMachineScsiPassthroughType string - -const ( - VirtualMachineScsiPassthroughTypeDisk = VirtualMachineScsiPassthroughType("disk") - VirtualMachineScsiPassthroughTypeTape = VirtualMachineScsiPassthroughType("tape") - VirtualMachineScsiPassthroughTypePrinter = VirtualMachineScsiPassthroughType("printer") - VirtualMachineScsiPassthroughTypeProcessor = VirtualMachineScsiPassthroughType("processor") - VirtualMachineScsiPassthroughTypeWorm = VirtualMachineScsiPassthroughType("worm") - VirtualMachineScsiPassthroughTypeCdrom = VirtualMachineScsiPassthroughType("cdrom") - VirtualMachineScsiPassthroughTypeScanner = VirtualMachineScsiPassthroughType("scanner") - VirtualMachineScsiPassthroughTypeOptical = VirtualMachineScsiPassthroughType("optical") - VirtualMachineScsiPassthroughTypeMedia = VirtualMachineScsiPassthroughType("media") - VirtualMachineScsiPassthroughTypeCom = VirtualMachineScsiPassthroughType("com") - VirtualMachineScsiPassthroughTypeRaid = VirtualMachineScsiPassthroughType("raid") - VirtualMachineScsiPassthroughTypeUnknown = VirtualMachineScsiPassthroughType("unknown") -) - -func init() { - t["VirtualMachineScsiPassthroughType"] = reflect.TypeOf((*VirtualMachineScsiPassthroughType)(nil)).Elem() -} - -type VirtualMachineStandbyActionType string - -const ( - VirtualMachineStandbyActionTypeCheckpoint = VirtualMachineStandbyActionType("checkpoint") - VirtualMachineStandbyActionTypePowerOnSuspend = VirtualMachineStandbyActionType("powerOnSuspend") -) - -func init() { - t["VirtualMachineStandbyActionType"] = reflect.TypeOf((*VirtualMachineStandbyActionType)(nil)).Elem() -} - -type VirtualMachineTargetInfoConfigurationTag string - -const ( - VirtualMachineTargetInfoConfigurationTagCompliant = VirtualMachineTargetInfoConfigurationTag("compliant") - VirtualMachineTargetInfoConfigurationTagClusterWide = VirtualMachineTargetInfoConfigurationTag("clusterWide") -) - -func init() { - t["VirtualMachineTargetInfoConfigurationTag"] = reflect.TypeOf((*VirtualMachineTargetInfoConfigurationTag)(nil)).Elem() -} - -type VirtualMachineTicketType string - -const ( - VirtualMachineTicketTypeMks = VirtualMachineTicketType("mks") - VirtualMachineTicketTypeDevice = VirtualMachineTicketType("device") - VirtualMachineTicketTypeGuestControl = VirtualMachineTicketType("guestControl") -) - -func init() { - t["VirtualMachineTicketType"] = reflect.TypeOf((*VirtualMachineTicketType)(nil)).Elem() -} - -type VirtualMachineToolsRunningStatus string - -const ( - VirtualMachineToolsRunningStatusGuestToolsNotRunning = VirtualMachineToolsRunningStatus("guestToolsNotRunning") - VirtualMachineToolsRunningStatusGuestToolsRunning = VirtualMachineToolsRunningStatus("guestToolsRunning") - VirtualMachineToolsRunningStatusGuestToolsExecutingScripts = VirtualMachineToolsRunningStatus("guestToolsExecutingScripts") -) - -func init() { - t["VirtualMachineToolsRunningStatus"] = reflect.TypeOf((*VirtualMachineToolsRunningStatus)(nil)).Elem() -} - -type VirtualMachineToolsStatus string - -const ( - VirtualMachineToolsStatusToolsNotInstalled = VirtualMachineToolsStatus("toolsNotInstalled") - VirtualMachineToolsStatusToolsNotRunning = VirtualMachineToolsStatus("toolsNotRunning") - VirtualMachineToolsStatusToolsOld = VirtualMachineToolsStatus("toolsOld") - VirtualMachineToolsStatusToolsOk = VirtualMachineToolsStatus("toolsOk") -) - -func init() { - t["VirtualMachineToolsStatus"] = reflect.TypeOf((*VirtualMachineToolsStatus)(nil)).Elem() -} - -type VirtualMachineToolsVersionStatus string - -const ( - VirtualMachineToolsVersionStatusGuestToolsNotInstalled = VirtualMachineToolsVersionStatus("guestToolsNotInstalled") - VirtualMachineToolsVersionStatusGuestToolsNeedUpgrade = VirtualMachineToolsVersionStatus("guestToolsNeedUpgrade") - VirtualMachineToolsVersionStatusGuestToolsCurrent = VirtualMachineToolsVersionStatus("guestToolsCurrent") - VirtualMachineToolsVersionStatusGuestToolsUnmanaged = VirtualMachineToolsVersionStatus("guestToolsUnmanaged") - VirtualMachineToolsVersionStatusGuestToolsTooOld = VirtualMachineToolsVersionStatus("guestToolsTooOld") - VirtualMachineToolsVersionStatusGuestToolsSupportedOld = VirtualMachineToolsVersionStatus("guestToolsSupportedOld") - VirtualMachineToolsVersionStatusGuestToolsSupportedNew = VirtualMachineToolsVersionStatus("guestToolsSupportedNew") - VirtualMachineToolsVersionStatusGuestToolsTooNew = VirtualMachineToolsVersionStatus("guestToolsTooNew") - VirtualMachineToolsVersionStatusGuestToolsBlacklisted = VirtualMachineToolsVersionStatus("guestToolsBlacklisted") -) - -func init() { - t["VirtualMachineToolsVersionStatus"] = reflect.TypeOf((*VirtualMachineToolsVersionStatus)(nil)).Elem() -} - -type VirtualMachineUsbInfoFamily string - -const ( - VirtualMachineUsbInfoFamilyAudio = VirtualMachineUsbInfoFamily("audio") - VirtualMachineUsbInfoFamilyHid = VirtualMachineUsbInfoFamily("hid") - VirtualMachineUsbInfoFamilyHid_bootable = VirtualMachineUsbInfoFamily("hid_bootable") - VirtualMachineUsbInfoFamilyPhysical = VirtualMachineUsbInfoFamily("physical") - VirtualMachineUsbInfoFamilyCommunication = VirtualMachineUsbInfoFamily("communication") - VirtualMachineUsbInfoFamilyImaging = VirtualMachineUsbInfoFamily("imaging") - VirtualMachineUsbInfoFamilyPrinter = VirtualMachineUsbInfoFamily("printer") - VirtualMachineUsbInfoFamilyStorage = VirtualMachineUsbInfoFamily("storage") - VirtualMachineUsbInfoFamilyHub = VirtualMachineUsbInfoFamily("hub") - VirtualMachineUsbInfoFamilySmart_card = VirtualMachineUsbInfoFamily("smart_card") - VirtualMachineUsbInfoFamilySecurity = VirtualMachineUsbInfoFamily("security") - VirtualMachineUsbInfoFamilyVideo = VirtualMachineUsbInfoFamily("video") - VirtualMachineUsbInfoFamilyWireless = VirtualMachineUsbInfoFamily("wireless") - VirtualMachineUsbInfoFamilyBluetooth = VirtualMachineUsbInfoFamily("bluetooth") - VirtualMachineUsbInfoFamilyWusb = VirtualMachineUsbInfoFamily("wusb") - VirtualMachineUsbInfoFamilyPda = VirtualMachineUsbInfoFamily("pda") - VirtualMachineUsbInfoFamilyVendor_specific = VirtualMachineUsbInfoFamily("vendor_specific") - VirtualMachineUsbInfoFamilyOther = VirtualMachineUsbInfoFamily("other") - VirtualMachineUsbInfoFamilyUnknownFamily = VirtualMachineUsbInfoFamily("unknownFamily") -) - -func init() { - t["VirtualMachineUsbInfoFamily"] = reflect.TypeOf((*VirtualMachineUsbInfoFamily)(nil)).Elem() -} - -type VirtualMachineUsbInfoSpeed string - -const ( - VirtualMachineUsbInfoSpeedLow = VirtualMachineUsbInfoSpeed("low") - VirtualMachineUsbInfoSpeedFull = VirtualMachineUsbInfoSpeed("full") - VirtualMachineUsbInfoSpeedHigh = VirtualMachineUsbInfoSpeed("high") - VirtualMachineUsbInfoSpeedSuperSpeed = VirtualMachineUsbInfoSpeed("superSpeed") - VirtualMachineUsbInfoSpeedUnknownSpeed = VirtualMachineUsbInfoSpeed("unknownSpeed") -) - -func init() { - t["VirtualMachineUsbInfoSpeed"] = reflect.TypeOf((*VirtualMachineUsbInfoSpeed)(nil)).Elem() -} - -type VirtualMachineVideoCardUse3dRenderer string - -const ( - VirtualMachineVideoCardUse3dRendererAutomatic = VirtualMachineVideoCardUse3dRenderer("automatic") - VirtualMachineVideoCardUse3dRendererSoftware = VirtualMachineVideoCardUse3dRenderer("software") - VirtualMachineVideoCardUse3dRendererHardware = VirtualMachineVideoCardUse3dRenderer("hardware") -) - -func init() { - t["VirtualMachineVideoCardUse3dRenderer"] = reflect.TypeOf((*VirtualMachineVideoCardUse3dRenderer)(nil)).Elem() -} - -type VirtualPointingDeviceHostChoice string - -const ( - VirtualPointingDeviceHostChoiceAutodetect = VirtualPointingDeviceHostChoice("autodetect") - VirtualPointingDeviceHostChoiceIntellimouseExplorer = VirtualPointingDeviceHostChoice("intellimouseExplorer") - VirtualPointingDeviceHostChoiceIntellimousePs2 = VirtualPointingDeviceHostChoice("intellimousePs2") - VirtualPointingDeviceHostChoiceLogitechMouseman = VirtualPointingDeviceHostChoice("logitechMouseman") - VirtualPointingDeviceHostChoiceMicrosoft_serial = VirtualPointingDeviceHostChoice("microsoft_serial") - VirtualPointingDeviceHostChoiceMouseSystems = VirtualPointingDeviceHostChoice("mouseSystems") - VirtualPointingDeviceHostChoiceMousemanSerial = VirtualPointingDeviceHostChoice("mousemanSerial") - VirtualPointingDeviceHostChoicePs2 = VirtualPointingDeviceHostChoice("ps2") -) - -func init() { - t["VirtualPointingDeviceHostChoice"] = reflect.TypeOf((*VirtualPointingDeviceHostChoice)(nil)).Elem() -} - -type VirtualSCSISharing string - -const ( - VirtualSCSISharingNoSharing = VirtualSCSISharing("noSharing") - VirtualSCSISharingVirtualSharing = VirtualSCSISharing("virtualSharing") - VirtualSCSISharingPhysicalSharing = VirtualSCSISharing("physicalSharing") -) - -func init() { - t["VirtualSCSISharing"] = reflect.TypeOf((*VirtualSCSISharing)(nil)).Elem() -} - -type VirtualSerialPortEndPoint string - -const ( - VirtualSerialPortEndPointClient = VirtualSerialPortEndPoint("client") - VirtualSerialPortEndPointServer = VirtualSerialPortEndPoint("server") -) - -func init() { - t["VirtualSerialPortEndPoint"] = reflect.TypeOf((*VirtualSerialPortEndPoint)(nil)).Elem() -} - -type VmDasBeingResetEventReasonCode string - -const ( - VmDasBeingResetEventReasonCodeVmtoolsHeartbeatFailure = VmDasBeingResetEventReasonCode("vmtoolsHeartbeatFailure") - VmDasBeingResetEventReasonCodeAppHeartbeatFailure = VmDasBeingResetEventReasonCode("appHeartbeatFailure") - VmDasBeingResetEventReasonCodeAppImmediateResetRequest = VmDasBeingResetEventReasonCode("appImmediateResetRequest") -) - -func init() { - t["VmDasBeingResetEventReasonCode"] = reflect.TypeOf((*VmDasBeingResetEventReasonCode)(nil)).Elem() -} - -type VmFailedStartingSecondaryEventFailureReason string - -const ( - VmFailedStartingSecondaryEventFailureReasonIncompatibleHost = VmFailedStartingSecondaryEventFailureReason("incompatibleHost") - VmFailedStartingSecondaryEventFailureReasonLoginFailed = VmFailedStartingSecondaryEventFailureReason("loginFailed") - VmFailedStartingSecondaryEventFailureReasonRegisterVmFailed = VmFailedStartingSecondaryEventFailureReason("registerVmFailed") - VmFailedStartingSecondaryEventFailureReasonMigrateFailed = VmFailedStartingSecondaryEventFailureReason("migrateFailed") -) - -func init() { - t["VmFailedStartingSecondaryEventFailureReason"] = reflect.TypeOf((*VmFailedStartingSecondaryEventFailureReason)(nil)).Elem() -} - -type VmFaultToleranceConfigIssueReasonForIssue string - -const ( - VmFaultToleranceConfigIssueReasonForIssueHaNotEnabled = VmFaultToleranceConfigIssueReasonForIssue("haNotEnabled") - VmFaultToleranceConfigIssueReasonForIssueMoreThanOneSecondary = VmFaultToleranceConfigIssueReasonForIssue("moreThanOneSecondary") - VmFaultToleranceConfigIssueReasonForIssueRecordReplayNotSupported = VmFaultToleranceConfigIssueReasonForIssue("recordReplayNotSupported") - VmFaultToleranceConfigIssueReasonForIssueReplayNotSupported = VmFaultToleranceConfigIssueReasonForIssue("replayNotSupported") - VmFaultToleranceConfigIssueReasonForIssueTemplateVm = VmFaultToleranceConfigIssueReasonForIssue("templateVm") - VmFaultToleranceConfigIssueReasonForIssueMultipleVCPU = VmFaultToleranceConfigIssueReasonForIssue("multipleVCPU") - VmFaultToleranceConfigIssueReasonForIssueHostInactive = VmFaultToleranceConfigIssueReasonForIssue("hostInactive") - VmFaultToleranceConfigIssueReasonForIssueFtUnsupportedHardware = VmFaultToleranceConfigIssueReasonForIssue("ftUnsupportedHardware") - VmFaultToleranceConfigIssueReasonForIssueFtUnsupportedProduct = VmFaultToleranceConfigIssueReasonForIssue("ftUnsupportedProduct") - VmFaultToleranceConfigIssueReasonForIssueMissingVMotionNic = VmFaultToleranceConfigIssueReasonForIssue("missingVMotionNic") - VmFaultToleranceConfigIssueReasonForIssueMissingFTLoggingNic = VmFaultToleranceConfigIssueReasonForIssue("missingFTLoggingNic") - VmFaultToleranceConfigIssueReasonForIssueThinDisk = VmFaultToleranceConfigIssueReasonForIssue("thinDisk") - VmFaultToleranceConfigIssueReasonForIssueVerifySSLCertificateFlagNotSet = VmFaultToleranceConfigIssueReasonForIssue("verifySSLCertificateFlagNotSet") - VmFaultToleranceConfigIssueReasonForIssueHasSnapshots = VmFaultToleranceConfigIssueReasonForIssue("hasSnapshots") - VmFaultToleranceConfigIssueReasonForIssueNoConfig = VmFaultToleranceConfigIssueReasonForIssue("noConfig") - VmFaultToleranceConfigIssueReasonForIssueFtSecondaryVm = VmFaultToleranceConfigIssueReasonForIssue("ftSecondaryVm") - VmFaultToleranceConfigIssueReasonForIssueHasLocalDisk = VmFaultToleranceConfigIssueReasonForIssue("hasLocalDisk") - VmFaultToleranceConfigIssueReasonForIssueEsxAgentVm = VmFaultToleranceConfigIssueReasonForIssue("esxAgentVm") - VmFaultToleranceConfigIssueReasonForIssueVideo3dEnabled = VmFaultToleranceConfigIssueReasonForIssue("video3dEnabled") - VmFaultToleranceConfigIssueReasonForIssueHasUnsupportedDisk = VmFaultToleranceConfigIssueReasonForIssue("hasUnsupportedDisk") - VmFaultToleranceConfigIssueReasonForIssueHasNestedHVConfiguration = VmFaultToleranceConfigIssueReasonForIssue("hasNestedHVConfiguration") - VmFaultToleranceConfigIssueReasonForIssueHasVFlashConfiguration = VmFaultToleranceConfigIssueReasonForIssue("hasVFlashConfiguration") -) - -func init() { - t["VmFaultToleranceConfigIssueReasonForIssue"] = reflect.TypeOf((*VmFaultToleranceConfigIssueReasonForIssue)(nil)).Elem() -} - -type VmFaultToleranceInvalidFileBackingDeviceType string - -const ( - VmFaultToleranceInvalidFileBackingDeviceTypeVirtualFloppy = VmFaultToleranceInvalidFileBackingDeviceType("virtualFloppy") - VmFaultToleranceInvalidFileBackingDeviceTypeVirtualCdrom = VmFaultToleranceInvalidFileBackingDeviceType("virtualCdrom") - VmFaultToleranceInvalidFileBackingDeviceTypeVirtualSerialPort = VmFaultToleranceInvalidFileBackingDeviceType("virtualSerialPort") - VmFaultToleranceInvalidFileBackingDeviceTypeVirtualParallelPort = VmFaultToleranceInvalidFileBackingDeviceType("virtualParallelPort") - VmFaultToleranceInvalidFileBackingDeviceTypeVirtualDisk = VmFaultToleranceInvalidFileBackingDeviceType("virtualDisk") -) - -func init() { - t["VmFaultToleranceInvalidFileBackingDeviceType"] = reflect.TypeOf((*VmFaultToleranceInvalidFileBackingDeviceType)(nil)).Elem() -} - -type VmShutdownOnIsolationEventOperation string - -const ( - VmShutdownOnIsolationEventOperationShutdown = VmShutdownOnIsolationEventOperation("shutdown") - VmShutdownOnIsolationEventOperationPoweredOff = VmShutdownOnIsolationEventOperation("poweredOff") -) - -func init() { - t["VmShutdownOnIsolationEventOperation"] = reflect.TypeOf((*VmShutdownOnIsolationEventOperation)(nil)).Elem() -} - -type VmwareDistributedVirtualSwitchPvlanPortType string - -const ( - VmwareDistributedVirtualSwitchPvlanPortTypePromiscuous = VmwareDistributedVirtualSwitchPvlanPortType("promiscuous") - VmwareDistributedVirtualSwitchPvlanPortTypeIsolated = VmwareDistributedVirtualSwitchPvlanPortType("isolated") - VmwareDistributedVirtualSwitchPvlanPortTypeCommunity = VmwareDistributedVirtualSwitchPvlanPortType("community") -) - -func init() { - t["VmwareDistributedVirtualSwitchPvlanPortType"] = reflect.TypeOf((*VmwareDistributedVirtualSwitchPvlanPortType)(nil)).Elem() -} - -type VsanDiskIssueType string - -const ( - VsanDiskIssueTypeNonExist = VsanDiskIssueType("nonExist") - VsanDiskIssueTypeStampMismatch = VsanDiskIssueType("stampMismatch") - VsanDiskIssueTypeUnknown = VsanDiskIssueType("unknown") -) - -func init() { - t["VsanDiskIssueType"] = reflect.TypeOf((*VsanDiskIssueType)(nil)).Elem() -} - -type VsanHostDecommissionModeObjectAction string - -const ( - VsanHostDecommissionModeObjectActionNoAction = VsanHostDecommissionModeObjectAction("noAction") - VsanHostDecommissionModeObjectActionEnsureObjectAccessibility = VsanHostDecommissionModeObjectAction("ensureObjectAccessibility") - VsanHostDecommissionModeObjectActionEvacuateAllData = VsanHostDecommissionModeObjectAction("evacuateAllData") -) - -func init() { - t["VsanHostDecommissionModeObjectAction"] = reflect.TypeOf((*VsanHostDecommissionModeObjectAction)(nil)).Elem() -} - -type VsanHostDiskResultState string - -const ( - VsanHostDiskResultStateInUse = VsanHostDiskResultState("inUse") - VsanHostDiskResultStateEligible = VsanHostDiskResultState("eligible") - VsanHostDiskResultStateIneligible = VsanHostDiskResultState("ineligible") -) - -func init() { - t["VsanHostDiskResultState"] = reflect.TypeOf((*VsanHostDiskResultState)(nil)).Elem() -} - -type VsanHostHealthState string - -const ( - VsanHostHealthStateUnknown = VsanHostHealthState("unknown") - VsanHostHealthStateHealthy = VsanHostHealthState("healthy") - VsanHostHealthStateUnhealthy = VsanHostHealthState("unhealthy") -) - -func init() { - t["VsanHostHealthState"] = reflect.TypeOf((*VsanHostHealthState)(nil)).Elem() -} - -type VsanHostNodeState string - -const ( - VsanHostNodeStateError = VsanHostNodeState("error") - VsanHostNodeStateDisabled = VsanHostNodeState("disabled") - VsanHostNodeStateAgent = VsanHostNodeState("agent") - VsanHostNodeStateMaster = VsanHostNodeState("master") - VsanHostNodeStateBackup = VsanHostNodeState("backup") - VsanHostNodeStateStarting = VsanHostNodeState("starting") - VsanHostNodeStateStopping = VsanHostNodeState("stopping") - VsanHostNodeStateEnteringMaintenanceMode = VsanHostNodeState("enteringMaintenanceMode") - VsanHostNodeStateExitingMaintenanceMode = VsanHostNodeState("exitingMaintenanceMode") - VsanHostNodeStateDecommissioning = VsanHostNodeState("decommissioning") -) - -func init() { - t["VsanHostNodeState"] = reflect.TypeOf((*VsanHostNodeState)(nil)).Elem() -} - -type WeekOfMonth string - -const ( - WeekOfMonthFirst = WeekOfMonth("first") - WeekOfMonthSecond = WeekOfMonth("second") - WeekOfMonthThird = WeekOfMonth("third") - WeekOfMonthFourth = WeekOfMonth("fourth") - WeekOfMonthLast = WeekOfMonth("last") -) - -func init() { - t["WeekOfMonth"] = reflect.TypeOf((*WeekOfMonth)(nil)).Elem() -} - -type WillLoseHAProtectionResolution string - -const ( - WillLoseHAProtectionResolutionSvmotion = WillLoseHAProtectionResolution("svmotion") - WillLoseHAProtectionResolutionRelocate = WillLoseHAProtectionResolution("relocate") -) - -func init() { - t["WillLoseHAProtectionResolution"] = reflect.TypeOf((*WillLoseHAProtectionResolution)(nil)).Elem() -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/vim25/types/fault.go juju-core-2.0.2/src/github.com/juju/govmomi/vim25/types/fault.go --- juju-core-2.0.0/src/github.com/juju/govmomi/vim25/types/fault.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/vim25/types/fault.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,32 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package types - -type HasFault interface { - Fault() BaseMethodFault -} - -func IsFileNotFound(err error) bool { - if f, ok := err.(HasFault); ok { - switch f.Fault().(type) { - case *FileNotFound: - return true - } - } - - return false -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/vim25/types/helpers.go juju-core-2.0.2/src/github.com/juju/govmomi/vim25/types/helpers.go --- juju-core-2.0.0/src/github.com/juju/govmomi/vim25/types/helpers.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/vim25/types/helpers.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,21 +0,0 @@ -/* -Copyright (c) 2015 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package types - -func NewBool(v bool) *bool { - return &v -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/vim25/types/if.go juju-core-2.0.2/src/github.com/juju/govmomi/vim25/types/if.go --- juju-core-2.0.0/src/github.com/juju/govmomi/vim25/types/if.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/vim25/types/if.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,3107 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package types - -import "reflect" - -func (b *Action) GetAction() *Action { return b } - -type BaseAction interface { - GetAction() *Action -} - -func init() { - t["BaseAction"] = reflect.TypeOf((*Action)(nil)).Elem() -} - -func (b *ActiveDirectoryFault) GetActiveDirectoryFault() *ActiveDirectoryFault { return b } - -type BaseActiveDirectoryFault interface { - GetActiveDirectoryFault() *ActiveDirectoryFault -} - -func init() { - t["BaseActiveDirectoryFault"] = reflect.TypeOf((*ActiveDirectoryFault)(nil)).Elem() -} - -func (b *AlarmAction) GetAlarmAction() *AlarmAction { return b } - -type BaseAlarmAction interface { - GetAlarmAction() *AlarmAction -} - -func init() { - t["BaseAlarmAction"] = reflect.TypeOf((*AlarmAction)(nil)).Elem() -} - -func (b *AlarmEvent) GetAlarmEvent() *AlarmEvent { return b } - -type BaseAlarmEvent interface { - GetAlarmEvent() *AlarmEvent -} - -func init() { - t["BaseAlarmEvent"] = reflect.TypeOf((*AlarmEvent)(nil)).Elem() -} - -func (b *AlarmExpression) GetAlarmExpression() *AlarmExpression { return b } - -type BaseAlarmExpression interface { - GetAlarmExpression() *AlarmExpression -} - -func init() { - t["BaseAlarmExpression"] = reflect.TypeOf((*AlarmExpression)(nil)).Elem() -} - -func (b *AlarmSpec) GetAlarmSpec() *AlarmSpec { return b } - -type BaseAlarmSpec interface { - GetAlarmSpec() *AlarmSpec -} - -func init() { - t["BaseAlarmSpec"] = reflect.TypeOf((*AlarmSpec)(nil)).Elem() -} - -func (b *AnswerFileCreateSpec) GetAnswerFileCreateSpec() *AnswerFileCreateSpec { return b } - -type BaseAnswerFileCreateSpec interface { - GetAnswerFileCreateSpec() *AnswerFileCreateSpec -} - -func init() { - t["BaseAnswerFileCreateSpec"] = reflect.TypeOf((*AnswerFileCreateSpec)(nil)).Elem() -} - -func (b *ApplyProfile) GetApplyProfile() *ApplyProfile { return b } - -type BaseApplyProfile interface { - GetApplyProfile() *ApplyProfile -} - -func init() { - t["BaseApplyProfile"] = reflect.TypeOf((*ApplyProfile)(nil)).Elem() -} - -func (b *ArrayUpdateSpec) GetArrayUpdateSpec() *ArrayUpdateSpec { return b } - -type BaseArrayUpdateSpec interface { - GetArrayUpdateSpec() *ArrayUpdateSpec -} - -func init() { - t["BaseArrayUpdateSpec"] = reflect.TypeOf((*ArrayUpdateSpec)(nil)).Elem() -} - -func (b *AuthorizationEvent) GetAuthorizationEvent() *AuthorizationEvent { return b } - -type BaseAuthorizationEvent interface { - GetAuthorizationEvent() *AuthorizationEvent -} - -func init() { - t["BaseAuthorizationEvent"] = reflect.TypeOf((*AuthorizationEvent)(nil)).Elem() -} - -func (b *CannotAccessNetwork) GetCannotAccessNetwork() *CannotAccessNetwork { return b } - -type BaseCannotAccessNetwork interface { - GetCannotAccessNetwork() *CannotAccessNetwork -} - -func init() { - t["BaseCannotAccessNetwork"] = reflect.TypeOf((*CannotAccessNetwork)(nil)).Elem() -} - -func (b *CannotAccessVmComponent) GetCannotAccessVmComponent() *CannotAccessVmComponent { return b } - -type BaseCannotAccessVmComponent interface { - GetCannotAccessVmComponent() *CannotAccessVmComponent -} - -func init() { - t["BaseCannotAccessVmComponent"] = reflect.TypeOf((*CannotAccessVmComponent)(nil)).Elem() -} - -func (b *CannotAccessVmDevice) GetCannotAccessVmDevice() *CannotAccessVmDevice { return b } - -type BaseCannotAccessVmDevice interface { - GetCannotAccessVmDevice() *CannotAccessVmDevice -} - -func init() { - t["BaseCannotAccessVmDevice"] = reflect.TypeOf((*CannotAccessVmDevice)(nil)).Elem() -} - -func (b *CannotAccessVmDisk) GetCannotAccessVmDisk() *CannotAccessVmDisk { return b } - -type BaseCannotAccessVmDisk interface { - GetCannotAccessVmDisk() *CannotAccessVmDisk -} - -func init() { - t["BaseCannotAccessVmDisk"] = reflect.TypeOf((*CannotAccessVmDisk)(nil)).Elem() -} - -func (b *CannotMoveVsanEnabledHost) GetCannotMoveVsanEnabledHost() *CannotMoveVsanEnabledHost { - return b -} - -type BaseCannotMoveVsanEnabledHost interface { - GetCannotMoveVsanEnabledHost() *CannotMoveVsanEnabledHost -} - -func init() { - t["BaseCannotMoveVsanEnabledHost"] = reflect.TypeOf((*CannotMoveVsanEnabledHost)(nil)).Elem() -} - -func (b *ClusterAction) GetClusterAction() *ClusterAction { return b } - -type BaseClusterAction interface { - GetClusterAction() *ClusterAction -} - -func init() { - t["BaseClusterAction"] = reflect.TypeOf((*ClusterAction)(nil)).Elem() -} - -func (b *ClusterDasAdmissionControlInfo) GetClusterDasAdmissionControlInfo() *ClusterDasAdmissionControlInfo { - return b -} - -type BaseClusterDasAdmissionControlInfo interface { - GetClusterDasAdmissionControlInfo() *ClusterDasAdmissionControlInfo -} - -func init() { - t["BaseClusterDasAdmissionControlInfo"] = reflect.TypeOf((*ClusterDasAdmissionControlInfo)(nil)).Elem() -} - -func (b *ClusterDasAdmissionControlPolicy) GetClusterDasAdmissionControlPolicy() *ClusterDasAdmissionControlPolicy { - return b -} - -type BaseClusterDasAdmissionControlPolicy interface { - GetClusterDasAdmissionControlPolicy() *ClusterDasAdmissionControlPolicy -} - -func init() { - t["BaseClusterDasAdmissionControlPolicy"] = reflect.TypeOf((*ClusterDasAdmissionControlPolicy)(nil)).Elem() -} - -func (b *ClusterDasAdvancedRuntimeInfo) GetClusterDasAdvancedRuntimeInfo() *ClusterDasAdvancedRuntimeInfo { - return b -} - -type BaseClusterDasAdvancedRuntimeInfo interface { - GetClusterDasAdvancedRuntimeInfo() *ClusterDasAdvancedRuntimeInfo -} - -func init() { - t["BaseClusterDasAdvancedRuntimeInfo"] = reflect.TypeOf((*ClusterDasAdvancedRuntimeInfo)(nil)).Elem() -} - -func (b *ClusterDasData) GetClusterDasData() *ClusterDasData { return b } - -type BaseClusterDasData interface { - GetClusterDasData() *ClusterDasData -} - -func init() { - t["BaseClusterDasData"] = reflect.TypeOf((*ClusterDasData)(nil)).Elem() -} - -func (b *ClusterDasHostInfo) GetClusterDasHostInfo() *ClusterDasHostInfo { return b } - -type BaseClusterDasHostInfo interface { - GetClusterDasHostInfo() *ClusterDasHostInfo -} - -func init() { - t["BaseClusterDasHostInfo"] = reflect.TypeOf((*ClusterDasHostInfo)(nil)).Elem() -} - -func (b *ClusterDrsFaultsFaultsByVm) GetClusterDrsFaultsFaultsByVm() *ClusterDrsFaultsFaultsByVm { - return b -} - -type BaseClusterDrsFaultsFaultsByVm interface { - GetClusterDrsFaultsFaultsByVm() *ClusterDrsFaultsFaultsByVm -} - -func init() { - t["BaseClusterDrsFaultsFaultsByVm"] = reflect.TypeOf((*ClusterDrsFaultsFaultsByVm)(nil)).Elem() -} - -func (b *ClusterEvent) GetClusterEvent() *ClusterEvent { return b } - -type BaseClusterEvent interface { - GetClusterEvent() *ClusterEvent -} - -func init() { - t["BaseClusterEvent"] = reflect.TypeOf((*ClusterEvent)(nil)).Elem() -} - -func (b *ClusterGroupInfo) GetClusterGroupInfo() *ClusterGroupInfo { return b } - -type BaseClusterGroupInfo interface { - GetClusterGroupInfo() *ClusterGroupInfo -} - -func init() { - t["BaseClusterGroupInfo"] = reflect.TypeOf((*ClusterGroupInfo)(nil)).Elem() -} - -func (b *ClusterOvercommittedEvent) GetClusterOvercommittedEvent() *ClusterOvercommittedEvent { - return b -} - -type BaseClusterOvercommittedEvent interface { - GetClusterOvercommittedEvent() *ClusterOvercommittedEvent -} - -func init() { - t["BaseClusterOvercommittedEvent"] = reflect.TypeOf((*ClusterOvercommittedEvent)(nil)).Elem() -} - -func (b *ClusterProfileConfigSpec) GetClusterProfileConfigSpec() *ClusterProfileConfigSpec { return b } - -type BaseClusterProfileConfigSpec interface { - GetClusterProfileConfigSpec() *ClusterProfileConfigSpec -} - -func init() { - t["BaseClusterProfileConfigSpec"] = reflect.TypeOf((*ClusterProfileConfigSpec)(nil)).Elem() -} - -func (b *ClusterProfileCreateSpec) GetClusterProfileCreateSpec() *ClusterProfileCreateSpec { return b } - -type BaseClusterProfileCreateSpec interface { - GetClusterProfileCreateSpec() *ClusterProfileCreateSpec -} - -func init() { - t["BaseClusterProfileCreateSpec"] = reflect.TypeOf((*ClusterProfileCreateSpec)(nil)).Elem() -} - -func (b *ClusterRuleInfo) GetClusterRuleInfo() *ClusterRuleInfo { return b } - -type BaseClusterRuleInfo interface { - GetClusterRuleInfo() *ClusterRuleInfo -} - -func init() { - t["BaseClusterRuleInfo"] = reflect.TypeOf((*ClusterRuleInfo)(nil)).Elem() -} - -func (b *ClusterSlotPolicy) GetClusterSlotPolicy() *ClusterSlotPolicy { return b } - -type BaseClusterSlotPolicy interface { - GetClusterSlotPolicy() *ClusterSlotPolicy -} - -func init() { - t["BaseClusterSlotPolicy"] = reflect.TypeOf((*ClusterSlotPolicy)(nil)).Elem() -} - -func (b *ClusterStatusChangedEvent) GetClusterStatusChangedEvent() *ClusterStatusChangedEvent { - return b -} - -type BaseClusterStatusChangedEvent interface { - GetClusterStatusChangedEvent() *ClusterStatusChangedEvent -} - -func init() { - t["BaseClusterStatusChangedEvent"] = reflect.TypeOf((*ClusterStatusChangedEvent)(nil)).Elem() -} - -func (b *ComputeResourceConfigInfo) GetComputeResourceConfigInfo() *ComputeResourceConfigInfo { - return b -} - -type BaseComputeResourceConfigInfo interface { - GetComputeResourceConfigInfo() *ComputeResourceConfigInfo -} - -func init() { - t["BaseComputeResourceConfigInfo"] = reflect.TypeOf((*ComputeResourceConfigInfo)(nil)).Elem() -} - -func (b *ComputeResourceConfigSpec) GetComputeResourceConfigSpec() *ComputeResourceConfigSpec { - return b -} - -type BaseComputeResourceConfigSpec interface { - GetComputeResourceConfigSpec() *ComputeResourceConfigSpec -} - -func init() { - t["BaseComputeResourceConfigSpec"] = reflect.TypeOf((*ComputeResourceConfigSpec)(nil)).Elem() -} - -func (b *ComputeResourceSummary) GetComputeResourceSummary() *ComputeResourceSummary { return b } - -type BaseComputeResourceSummary interface { - GetComputeResourceSummary() *ComputeResourceSummary -} - -func init() { - t["BaseComputeResourceSummary"] = reflect.TypeOf((*ComputeResourceSummary)(nil)).Elem() -} - -func (b *CpuIncompatible) GetCpuIncompatible() *CpuIncompatible { return b } - -type BaseCpuIncompatible interface { - GetCpuIncompatible() *CpuIncompatible -} - -func init() { - t["BaseCpuIncompatible"] = reflect.TypeOf((*CpuIncompatible)(nil)).Elem() -} - -func (b *CustomFieldDefEvent) GetCustomFieldDefEvent() *CustomFieldDefEvent { return b } - -type BaseCustomFieldDefEvent interface { - GetCustomFieldDefEvent() *CustomFieldDefEvent -} - -func init() { - t["BaseCustomFieldDefEvent"] = reflect.TypeOf((*CustomFieldDefEvent)(nil)).Elem() -} - -func (b *CustomFieldEvent) GetCustomFieldEvent() *CustomFieldEvent { return b } - -type BaseCustomFieldEvent interface { - GetCustomFieldEvent() *CustomFieldEvent -} - -func init() { - t["BaseCustomFieldEvent"] = reflect.TypeOf((*CustomFieldEvent)(nil)).Elem() -} - -func (b *CustomFieldValue) GetCustomFieldValue() *CustomFieldValue { return b } - -type BaseCustomFieldValue interface { - GetCustomFieldValue() *CustomFieldValue -} - -func init() { - t["BaseCustomFieldValue"] = reflect.TypeOf((*CustomFieldValue)(nil)).Elem() -} - -func (b *CustomizationEvent) GetCustomizationEvent() *CustomizationEvent { return b } - -type BaseCustomizationEvent interface { - GetCustomizationEvent() *CustomizationEvent -} - -func init() { - t["BaseCustomizationEvent"] = reflect.TypeOf((*CustomizationEvent)(nil)).Elem() -} - -func (b *CustomizationFailed) GetCustomizationFailed() *CustomizationFailed { return b } - -type BaseCustomizationFailed interface { - GetCustomizationFailed() *CustomizationFailed -} - -func init() { - t["BaseCustomizationFailed"] = reflect.TypeOf((*CustomizationFailed)(nil)).Elem() -} - -func (b *CustomizationFault) GetCustomizationFault() *CustomizationFault { return b } - -type BaseCustomizationFault interface { - GetCustomizationFault() *CustomizationFault -} - -func init() { - t["BaseCustomizationFault"] = reflect.TypeOf((*CustomizationFault)(nil)).Elem() -} - -func (b *CustomizationIdentitySettings) GetCustomizationIdentitySettings() *CustomizationIdentitySettings { - return b -} - -type BaseCustomizationIdentitySettings interface { - GetCustomizationIdentitySettings() *CustomizationIdentitySettings -} - -func init() { - t["BaseCustomizationIdentitySettings"] = reflect.TypeOf((*CustomizationIdentitySettings)(nil)).Elem() -} - -func (b *CustomizationIpGenerator) GetCustomizationIpGenerator() *CustomizationIpGenerator { return b } - -type BaseCustomizationIpGenerator interface { - GetCustomizationIpGenerator() *CustomizationIpGenerator -} - -func init() { - t["BaseCustomizationIpGenerator"] = reflect.TypeOf((*CustomizationIpGenerator)(nil)).Elem() -} - -func (b *CustomizationIpV6Generator) GetCustomizationIpV6Generator() *CustomizationIpV6Generator { - return b -} - -type BaseCustomizationIpV6Generator interface { - GetCustomizationIpV6Generator() *CustomizationIpV6Generator -} - -func init() { - t["BaseCustomizationIpV6Generator"] = reflect.TypeOf((*CustomizationIpV6Generator)(nil)).Elem() -} - -func (b *CustomizationName) GetCustomizationName() *CustomizationName { return b } - -type BaseCustomizationName interface { - GetCustomizationName() *CustomizationName -} - -func init() { - t["BaseCustomizationName"] = reflect.TypeOf((*CustomizationName)(nil)).Elem() -} - -func (b *CustomizationOptions) GetCustomizationOptions() *CustomizationOptions { return b } - -type BaseCustomizationOptions interface { - GetCustomizationOptions() *CustomizationOptions -} - -func init() { - t["BaseCustomizationOptions"] = reflect.TypeOf((*CustomizationOptions)(nil)).Elem() -} - -func (b *DVPortSetting) GetDVPortSetting() *DVPortSetting { return b } - -type BaseDVPortSetting interface { - GetDVPortSetting() *DVPortSetting -} - -func init() { - t["BaseDVPortSetting"] = reflect.TypeOf((*DVPortSetting)(nil)).Elem() -} - -func (b *DVPortgroupEvent) GetDVPortgroupEvent() *DVPortgroupEvent { return b } - -type BaseDVPortgroupEvent interface { - GetDVPortgroupEvent() *DVPortgroupEvent -} - -func init() { - t["BaseDVPortgroupEvent"] = reflect.TypeOf((*DVPortgroupEvent)(nil)).Elem() -} - -func (b *DVPortgroupPolicy) GetDVPortgroupPolicy() *DVPortgroupPolicy { return b } - -type BaseDVPortgroupPolicy interface { - GetDVPortgroupPolicy() *DVPortgroupPolicy -} - -func init() { - t["BaseDVPortgroupPolicy"] = reflect.TypeOf((*DVPortgroupPolicy)(nil)).Elem() -} - -func (b *DVSConfigInfo) GetDVSConfigInfo() *DVSConfigInfo { return b } - -type BaseDVSConfigInfo interface { - GetDVSConfigInfo() *DVSConfigInfo -} - -func init() { - t["BaseDVSConfigInfo"] = reflect.TypeOf((*DVSConfigInfo)(nil)).Elem() -} - -func (b *DVSConfigSpec) GetDVSConfigSpec() *DVSConfigSpec { return b } - -type BaseDVSConfigSpec interface { - GetDVSConfigSpec() *DVSConfigSpec -} - -func init() { - t["BaseDVSConfigSpec"] = reflect.TypeOf((*DVSConfigSpec)(nil)).Elem() -} - -func (b *DVSFeatureCapability) GetDVSFeatureCapability() *DVSFeatureCapability { return b } - -type BaseDVSFeatureCapability interface { - GetDVSFeatureCapability() *DVSFeatureCapability -} - -func init() { - t["BaseDVSFeatureCapability"] = reflect.TypeOf((*DVSFeatureCapability)(nil)).Elem() -} - -func (b *DVSHealthCheckCapability) GetDVSHealthCheckCapability() *DVSHealthCheckCapability { return b } - -type BaseDVSHealthCheckCapability interface { - GetDVSHealthCheckCapability() *DVSHealthCheckCapability -} - -func init() { - t["BaseDVSHealthCheckCapability"] = reflect.TypeOf((*DVSHealthCheckCapability)(nil)).Elem() -} - -func (b *DVSHealthCheckConfig) GetDVSHealthCheckConfig() *DVSHealthCheckConfig { return b } - -type BaseDVSHealthCheckConfig interface { - GetDVSHealthCheckConfig() *DVSHealthCheckConfig -} - -func init() { - t["BaseDVSHealthCheckConfig"] = reflect.TypeOf((*DVSHealthCheckConfig)(nil)).Elem() -} - -func (b *DVSUplinkPortPolicy) GetDVSUplinkPortPolicy() *DVSUplinkPortPolicy { return b } - -type BaseDVSUplinkPortPolicy interface { - GetDVSUplinkPortPolicy() *DVSUplinkPortPolicy -} - -func init() { - t["BaseDVSUplinkPortPolicy"] = reflect.TypeOf((*DVSUplinkPortPolicy)(nil)).Elem() -} - -func (b *DailyTaskScheduler) GetDailyTaskScheduler() *DailyTaskScheduler { return b } - -type BaseDailyTaskScheduler interface { - GetDailyTaskScheduler() *DailyTaskScheduler -} - -func init() { - t["BaseDailyTaskScheduler"] = reflect.TypeOf((*DailyTaskScheduler)(nil)).Elem() -} - -func (b *DatacenterEvent) GetDatacenterEvent() *DatacenterEvent { return b } - -type BaseDatacenterEvent interface { - GetDatacenterEvent() *DatacenterEvent -} - -func init() { - t["BaseDatacenterEvent"] = reflect.TypeOf((*DatacenterEvent)(nil)).Elem() -} - -func (b *DatastoreEvent) GetDatastoreEvent() *DatastoreEvent { return b } - -type BaseDatastoreEvent interface { - GetDatastoreEvent() *DatastoreEvent -} - -func init() { - t["BaseDatastoreEvent"] = reflect.TypeOf((*DatastoreEvent)(nil)).Elem() -} - -func (b *DatastoreFileEvent) GetDatastoreFileEvent() *DatastoreFileEvent { return b } - -type BaseDatastoreFileEvent interface { - GetDatastoreFileEvent() *DatastoreFileEvent -} - -func init() { - t["BaseDatastoreFileEvent"] = reflect.TypeOf((*DatastoreFileEvent)(nil)).Elem() -} - -func (b *DatastoreInfo) GetDatastoreInfo() *DatastoreInfo { return b } - -type BaseDatastoreInfo interface { - GetDatastoreInfo() *DatastoreInfo -} - -func init() { - t["BaseDatastoreInfo"] = reflect.TypeOf((*DatastoreInfo)(nil)).Elem() -} - -func (b *DatastoreNotWritableOnHost) GetDatastoreNotWritableOnHost() *DatastoreNotWritableOnHost { - return b -} - -type BaseDatastoreNotWritableOnHost interface { - GetDatastoreNotWritableOnHost() *DatastoreNotWritableOnHost -} - -func init() { - t["BaseDatastoreNotWritableOnHost"] = reflect.TypeOf((*DatastoreNotWritableOnHost)(nil)).Elem() -} - -func (b *Description) GetDescription() *Description { return b } - -type BaseDescription interface { - GetDescription() *Description -} - -func init() { - t["BaseDescription"] = reflect.TypeOf((*Description)(nil)).Elem() -} - -func (b *DeviceBackingNotSupported) GetDeviceBackingNotSupported() *DeviceBackingNotSupported { - return b -} - -type BaseDeviceBackingNotSupported interface { - GetDeviceBackingNotSupported() *DeviceBackingNotSupported -} - -func init() { - t["BaseDeviceBackingNotSupported"] = reflect.TypeOf((*DeviceBackingNotSupported)(nil)).Elem() -} - -func (b *DeviceNotSupported) GetDeviceNotSupported() *DeviceNotSupported { return b } - -type BaseDeviceNotSupported interface { - GetDeviceNotSupported() *DeviceNotSupported -} - -func init() { - t["BaseDeviceNotSupported"] = reflect.TypeOf((*DeviceNotSupported)(nil)).Elem() -} - -func (b *DiskNotSupported) GetDiskNotSupported() *DiskNotSupported { return b } - -type BaseDiskNotSupported interface { - GetDiskNotSupported() *DiskNotSupported -} - -func init() { - t["BaseDiskNotSupported"] = reflect.TypeOf((*DiskNotSupported)(nil)).Elem() -} - -func (b *DistributedVirtualSwitchHostMemberBacking) GetDistributedVirtualSwitchHostMemberBacking() *DistributedVirtualSwitchHostMemberBacking { - return b -} - -type BaseDistributedVirtualSwitchHostMemberBacking interface { - GetDistributedVirtualSwitchHostMemberBacking() *DistributedVirtualSwitchHostMemberBacking -} - -func init() { - t["BaseDistributedVirtualSwitchHostMemberBacking"] = reflect.TypeOf((*DistributedVirtualSwitchHostMemberBacking)(nil)).Elem() -} - -func (b *DistributedVirtualSwitchManagerHostDvsFilterSpec) GetDistributedVirtualSwitchManagerHostDvsFilterSpec() *DistributedVirtualSwitchManagerHostDvsFilterSpec { - return b -} - -type BaseDistributedVirtualSwitchManagerHostDvsFilterSpec interface { - GetDistributedVirtualSwitchManagerHostDvsFilterSpec() *DistributedVirtualSwitchManagerHostDvsFilterSpec -} - -func init() { - t["BaseDistributedVirtualSwitchManagerHostDvsFilterSpec"] = reflect.TypeOf((*DistributedVirtualSwitchManagerHostDvsFilterSpec)(nil)).Elem() -} - -func (b *DvsEvent) GetDvsEvent() *DvsEvent { return b } - -type BaseDvsEvent interface { - GetDvsEvent() *DvsEvent -} - -func init() { - t["BaseDvsEvent"] = reflect.TypeOf((*DvsEvent)(nil)).Elem() -} - -func (b *DvsFault) GetDvsFault() *DvsFault { return b } - -type BaseDvsFault interface { - GetDvsFault() *DvsFault -} - -func init() { - t["BaseDvsFault"] = reflect.TypeOf((*DvsFault)(nil)).Elem() -} - -func (b *DvsFilterConfig) GetDvsFilterConfig() *DvsFilterConfig { return b } - -type BaseDvsFilterConfig interface { - GetDvsFilterConfig() *DvsFilterConfig -} - -func init() { - t["BaseDvsFilterConfig"] = reflect.TypeOf((*DvsFilterConfig)(nil)).Elem() -} - -func (b *DvsHealthStatusChangeEvent) GetDvsHealthStatusChangeEvent() *DvsHealthStatusChangeEvent { - return b -} - -type BaseDvsHealthStatusChangeEvent interface { - GetDvsHealthStatusChangeEvent() *DvsHealthStatusChangeEvent -} - -func init() { - t["BaseDvsHealthStatusChangeEvent"] = reflect.TypeOf((*DvsHealthStatusChangeEvent)(nil)).Elem() -} - -func (b *DvsIpPort) GetDvsIpPort() *DvsIpPort { return b } - -type BaseDvsIpPort interface { - GetDvsIpPort() *DvsIpPort -} - -func init() { - t["BaseDvsIpPort"] = reflect.TypeOf((*DvsIpPort)(nil)).Elem() -} - -func (b *DvsNetworkRuleAction) GetDvsNetworkRuleAction() *DvsNetworkRuleAction { return b } - -type BaseDvsNetworkRuleAction interface { - GetDvsNetworkRuleAction() *DvsNetworkRuleAction -} - -func init() { - t["BaseDvsNetworkRuleAction"] = reflect.TypeOf((*DvsNetworkRuleAction)(nil)).Elem() -} - -func (b *DvsNetworkRuleQualifier) GetDvsNetworkRuleQualifier() *DvsNetworkRuleQualifier { return b } - -type BaseDvsNetworkRuleQualifier interface { - GetDvsNetworkRuleQualifier() *DvsNetworkRuleQualifier -} - -func init() { - t["BaseDvsNetworkRuleQualifier"] = reflect.TypeOf((*DvsNetworkRuleQualifier)(nil)).Elem() -} - -func (b *DvsTrafficFilterConfig) GetDvsTrafficFilterConfig() *DvsTrafficFilterConfig { return b } - -type BaseDvsTrafficFilterConfig interface { - GetDvsTrafficFilterConfig() *DvsTrafficFilterConfig -} - -func init() { - t["BaseDvsTrafficFilterConfig"] = reflect.TypeOf((*DvsTrafficFilterConfig)(nil)).Elem() -} - -func (b *DvsVNicProfile) GetDvsVNicProfile() *DvsVNicProfile { return b } - -type BaseDvsVNicProfile interface { - GetDvsVNicProfile() *DvsVNicProfile -} - -func init() { - t["BaseDvsVNicProfile"] = reflect.TypeOf((*DvsVNicProfile)(nil)).Elem() -} - -func (b *DynamicData) GetDynamicData() *DynamicData { return b } - -type BaseDynamicData interface { - GetDynamicData() *DynamicData -} - -func init() { - t["BaseDynamicData"] = reflect.TypeOf((*DynamicData)(nil)).Elem() -} - -func (b *EVCAdmissionFailed) GetEVCAdmissionFailed() *EVCAdmissionFailed { return b } - -type BaseEVCAdmissionFailed interface { - GetEVCAdmissionFailed() *EVCAdmissionFailed -} - -func init() { - t["BaseEVCAdmissionFailed"] = reflect.TypeOf((*EVCAdmissionFailed)(nil)).Elem() -} - -func (b *ElementDescription) GetElementDescription() *ElementDescription { return b } - -type BaseElementDescription interface { - GetElementDescription() *ElementDescription -} - -func init() { - t["BaseElementDescription"] = reflect.TypeOf((*ElementDescription)(nil)).Elem() -} - -func (b *EnteredStandbyModeEvent) GetEnteredStandbyModeEvent() *EnteredStandbyModeEvent { return b } - -type BaseEnteredStandbyModeEvent interface { - GetEnteredStandbyModeEvent() *EnteredStandbyModeEvent -} - -func init() { - t["BaseEnteredStandbyModeEvent"] = reflect.TypeOf((*EnteredStandbyModeEvent)(nil)).Elem() -} - -func (b *EnteringStandbyModeEvent) GetEnteringStandbyModeEvent() *EnteringStandbyModeEvent { return b } - -type BaseEnteringStandbyModeEvent interface { - GetEnteringStandbyModeEvent() *EnteringStandbyModeEvent -} - -func init() { - t["BaseEnteringStandbyModeEvent"] = reflect.TypeOf((*EnteringStandbyModeEvent)(nil)).Elem() -} - -func (b *EntityEventArgument) GetEntityEventArgument() *EntityEventArgument { return b } - -type BaseEntityEventArgument interface { - GetEntityEventArgument() *EntityEventArgument -} - -func init() { - t["BaseEntityEventArgument"] = reflect.TypeOf((*EntityEventArgument)(nil)).Elem() -} - -func (b *Event) GetEvent() *Event { return b } - -type BaseEvent interface { - GetEvent() *Event -} - -func init() { - t["BaseEvent"] = reflect.TypeOf((*Event)(nil)).Elem() -} - -func (b *EventArgument) GetEventArgument() *EventArgument { return b } - -type BaseEventArgument interface { - GetEventArgument() *EventArgument -} - -func init() { - t["BaseEventArgument"] = reflect.TypeOf((*EventArgument)(nil)).Elem() -} - -func (b *ExitStandbyModeFailedEvent) GetExitStandbyModeFailedEvent() *ExitStandbyModeFailedEvent { - return b -} - -type BaseExitStandbyModeFailedEvent interface { - GetExitStandbyModeFailedEvent() *ExitStandbyModeFailedEvent -} - -func init() { - t["BaseExitStandbyModeFailedEvent"] = reflect.TypeOf((*ExitStandbyModeFailedEvent)(nil)).Elem() -} - -func (b *ExitedStandbyModeEvent) GetExitedStandbyModeEvent() *ExitedStandbyModeEvent { return b } - -type BaseExitedStandbyModeEvent interface { - GetExitedStandbyModeEvent() *ExitedStandbyModeEvent -} - -func init() { - t["BaseExitedStandbyModeEvent"] = reflect.TypeOf((*ExitedStandbyModeEvent)(nil)).Elem() -} - -func (b *ExitingStandbyModeEvent) GetExitingStandbyModeEvent() *ExitingStandbyModeEvent { return b } - -type BaseExitingStandbyModeEvent interface { - GetExitingStandbyModeEvent() *ExitingStandbyModeEvent -} - -func init() { - t["BaseExitingStandbyModeEvent"] = reflect.TypeOf((*ExitingStandbyModeEvent)(nil)).Elem() -} - -func (b *ExpiredFeatureLicense) GetExpiredFeatureLicense() *ExpiredFeatureLicense { return b } - -type BaseExpiredFeatureLicense interface { - GetExpiredFeatureLicense() *ExpiredFeatureLicense -} - -func init() { - t["BaseExpiredFeatureLicense"] = reflect.TypeOf((*ExpiredFeatureLicense)(nil)).Elem() -} - -func (b *FaultToleranceConfigInfo) GetFaultToleranceConfigInfo() *FaultToleranceConfigInfo { return b } - -type BaseFaultToleranceConfigInfo interface { - GetFaultToleranceConfigInfo() *FaultToleranceConfigInfo -} - -func init() { - t["BaseFaultToleranceConfigInfo"] = reflect.TypeOf((*FaultToleranceConfigInfo)(nil)).Elem() -} - -func (b *FcoeFault) GetFcoeFault() *FcoeFault { return b } - -type BaseFcoeFault interface { - GetFcoeFault() *FcoeFault -} - -func init() { - t["BaseFcoeFault"] = reflect.TypeOf((*FcoeFault)(nil)).Elem() -} - -func (b *FileBackedVirtualDiskSpec) GetFileBackedVirtualDiskSpec() *FileBackedVirtualDiskSpec { - return b -} - -type BaseFileBackedVirtualDiskSpec interface { - GetFileBackedVirtualDiskSpec() *FileBackedVirtualDiskSpec -} - -func init() { - t["BaseFileBackedVirtualDiskSpec"] = reflect.TypeOf((*FileBackedVirtualDiskSpec)(nil)).Elem() -} - -func (b *FileFault) GetFileFault() *FileFault { return b } - -type BaseFileFault interface { - GetFileFault() *FileFault -} - -func init() { - t["BaseFileFault"] = reflect.TypeOf((*FileFault)(nil)).Elem() -} - -func (b *FileInfo) GetFileInfo() *FileInfo { return b } - -type BaseFileInfo interface { - GetFileInfo() *FileInfo -} - -func init() { - t["BaseFileInfo"] = reflect.TypeOf((*FileInfo)(nil)).Elem() -} - -func (b *FileQuery) GetFileQuery() *FileQuery { return b } - -type BaseFileQuery interface { - GetFileQuery() *FileQuery -} - -func init() { - t["BaseFileQuery"] = reflect.TypeOf((*FileQuery)(nil)).Elem() -} - -func (b *GeneralEvent) GetGeneralEvent() *GeneralEvent { return b } - -type BaseGeneralEvent interface { - GetGeneralEvent() *GeneralEvent -} - -func init() { - t["BaseGeneralEvent"] = reflect.TypeOf((*GeneralEvent)(nil)).Elem() -} - -func (b *GuestAuthentication) GetGuestAuthentication() *GuestAuthentication { return b } - -type BaseGuestAuthentication interface { - GetGuestAuthentication() *GuestAuthentication -} - -func init() { - t["BaseGuestAuthentication"] = reflect.TypeOf((*GuestAuthentication)(nil)).Elem() -} - -func (b *GuestFileAttributes) GetGuestFileAttributes() *GuestFileAttributes { return b } - -type BaseGuestFileAttributes interface { - GetGuestFileAttributes() *GuestFileAttributes -} - -func init() { - t["BaseGuestFileAttributes"] = reflect.TypeOf((*GuestFileAttributes)(nil)).Elem() -} - -func (b *GuestOperationsFault) GetGuestOperationsFault() *GuestOperationsFault { return b } - -type BaseGuestOperationsFault interface { - GetGuestOperationsFault() *GuestOperationsFault -} - -func init() { - t["BaseGuestOperationsFault"] = reflect.TypeOf((*GuestOperationsFault)(nil)).Elem() -} - -func (b *GuestProgramSpec) GetGuestProgramSpec() *GuestProgramSpec { return b } - -type BaseGuestProgramSpec interface { - GetGuestProgramSpec() *GuestProgramSpec -} - -func init() { - t["BaseGuestProgramSpec"] = reflect.TypeOf((*GuestProgramSpec)(nil)).Elem() -} - -func (b *HostAccountSpec) GetHostAccountSpec() *HostAccountSpec { return b } - -type BaseHostAccountSpec interface { - GetHostAccountSpec() *HostAccountSpec -} - -func init() { - t["BaseHostAccountSpec"] = reflect.TypeOf((*HostAccountSpec)(nil)).Elem() -} - -func (b *HostAuthenticationStoreInfo) GetHostAuthenticationStoreInfo() *HostAuthenticationStoreInfo { - return b -} - -type BaseHostAuthenticationStoreInfo interface { - GetHostAuthenticationStoreInfo() *HostAuthenticationStoreInfo -} - -func init() { - t["BaseHostAuthenticationStoreInfo"] = reflect.TypeOf((*HostAuthenticationStoreInfo)(nil)).Elem() -} - -func (b *HostCommunication) GetHostCommunication() *HostCommunication { return b } - -type BaseHostCommunication interface { - GetHostCommunication() *HostCommunication -} - -func init() { - t["BaseHostCommunication"] = reflect.TypeOf((*HostCommunication)(nil)).Elem() -} - -func (b *HostConfigFault) GetHostConfigFault() *HostConfigFault { return b } - -type BaseHostConfigFault interface { - GetHostConfigFault() *HostConfigFault -} - -func init() { - t["BaseHostConfigFault"] = reflect.TypeOf((*HostConfigFault)(nil)).Elem() -} - -func (b *HostConnectFault) GetHostConnectFault() *HostConnectFault { return b } - -type BaseHostConnectFault interface { - GetHostConnectFault() *HostConnectFault -} - -func init() { - t["BaseHostConnectFault"] = reflect.TypeOf((*HostConnectFault)(nil)).Elem() -} - -func (b *HostConnectInfoNetworkInfo) GetHostConnectInfoNetworkInfo() *HostConnectInfoNetworkInfo { - return b -} - -type BaseHostConnectInfoNetworkInfo interface { - GetHostConnectInfoNetworkInfo() *HostConnectInfoNetworkInfo -} - -func init() { - t["BaseHostConnectInfoNetworkInfo"] = reflect.TypeOf((*HostConnectInfoNetworkInfo)(nil)).Elem() -} - -func (b *HostDasEvent) GetHostDasEvent() *HostDasEvent { return b } - -type BaseHostDasEvent interface { - GetHostDasEvent() *HostDasEvent -} - -func init() { - t["BaseHostDasEvent"] = reflect.TypeOf((*HostDasEvent)(nil)).Elem() -} - -func (b *HostDatastoreConnectInfo) GetHostDatastoreConnectInfo() *HostDatastoreConnectInfo { return b } - -type BaseHostDatastoreConnectInfo interface { - GetHostDatastoreConnectInfo() *HostDatastoreConnectInfo -} - -func init() { - t["BaseHostDatastoreConnectInfo"] = reflect.TypeOf((*HostDatastoreConnectInfo)(nil)).Elem() -} - -func (b *HostDevice) GetHostDevice() *HostDevice { return b } - -type BaseHostDevice interface { - GetHostDevice() *HostDevice -} - -func init() { - t["BaseHostDevice"] = reflect.TypeOf((*HostDevice)(nil)).Elem() -} - -func (b *HostDigestInfo) GetHostDigestInfo() *HostDigestInfo { return b } - -type BaseHostDigestInfo interface { - GetHostDigestInfo() *HostDigestInfo -} - -func init() { - t["BaseHostDigestInfo"] = reflect.TypeOf((*HostDigestInfo)(nil)).Elem() -} - -func (b *HostDirectoryStoreInfo) GetHostDirectoryStoreInfo() *HostDirectoryStoreInfo { return b } - -type BaseHostDirectoryStoreInfo interface { - GetHostDirectoryStoreInfo() *HostDirectoryStoreInfo -} - -func init() { - t["BaseHostDirectoryStoreInfo"] = reflect.TypeOf((*HostDirectoryStoreInfo)(nil)).Elem() -} - -func (b *HostDnsConfig) GetHostDnsConfig() *HostDnsConfig { return b } - -type BaseHostDnsConfig interface { - GetHostDnsConfig() *HostDnsConfig -} - -func init() { - t["BaseHostDnsConfig"] = reflect.TypeOf((*HostDnsConfig)(nil)).Elem() -} - -func (b *HostEvent) GetHostEvent() *HostEvent { return b } - -type BaseHostEvent interface { - GetHostEvent() *HostEvent -} - -func init() { - t["BaseHostEvent"] = reflect.TypeOf((*HostEvent)(nil)).Elem() -} - -func (b *HostFibreChannelHba) GetHostFibreChannelHba() *HostFibreChannelHba { return b } - -type BaseHostFibreChannelHba interface { - GetHostFibreChannelHba() *HostFibreChannelHba -} - -func init() { - t["BaseHostFibreChannelHba"] = reflect.TypeOf((*HostFibreChannelHba)(nil)).Elem() -} - -func (b *HostFibreChannelTargetTransport) GetHostFibreChannelTargetTransport() *HostFibreChannelTargetTransport { - return b -} - -type BaseHostFibreChannelTargetTransport interface { - GetHostFibreChannelTargetTransport() *HostFibreChannelTargetTransport -} - -func init() { - t["BaseHostFibreChannelTargetTransport"] = reflect.TypeOf((*HostFibreChannelTargetTransport)(nil)).Elem() -} - -func (b *HostFileSystemVolume) GetHostFileSystemVolume() *HostFileSystemVolume { return b } - -type BaseHostFileSystemVolume interface { - GetHostFileSystemVolume() *HostFileSystemVolume -} - -func init() { - t["BaseHostFileSystemVolume"] = reflect.TypeOf((*HostFileSystemVolume)(nil)).Elem() -} - -func (b *HostHardwareElementInfo) GetHostHardwareElementInfo() *HostHardwareElementInfo { return b } - -type BaseHostHardwareElementInfo interface { - GetHostHardwareElementInfo() *HostHardwareElementInfo -} - -func init() { - t["BaseHostHardwareElementInfo"] = reflect.TypeOf((*HostHardwareElementInfo)(nil)).Elem() -} - -func (b *HostHostBusAdapter) GetHostHostBusAdapter() *HostHostBusAdapter { return b } - -type BaseHostHostBusAdapter interface { - GetHostHostBusAdapter() *HostHostBusAdapter -} - -func init() { - t["BaseHostHostBusAdapter"] = reflect.TypeOf((*HostHostBusAdapter)(nil)).Elem() -} - -func (b *HostIpRouteConfig) GetHostIpRouteConfig() *HostIpRouteConfig { return b } - -type BaseHostIpRouteConfig interface { - GetHostIpRouteConfig() *HostIpRouteConfig -} - -func init() { - t["BaseHostIpRouteConfig"] = reflect.TypeOf((*HostIpRouteConfig)(nil)).Elem() -} - -func (b *HostMemberHealthCheckResult) GetHostMemberHealthCheckResult() *HostMemberHealthCheckResult { - return b -} - -type BaseHostMemberHealthCheckResult interface { - GetHostMemberHealthCheckResult() *HostMemberHealthCheckResult -} - -func init() { - t["BaseHostMemberHealthCheckResult"] = reflect.TypeOf((*HostMemberHealthCheckResult)(nil)).Elem() -} - -func (b *HostMemberUplinkHealthCheckResult) GetHostMemberUplinkHealthCheckResult() *HostMemberUplinkHealthCheckResult { - return b -} - -type BaseHostMemberUplinkHealthCheckResult interface { - GetHostMemberUplinkHealthCheckResult() *HostMemberUplinkHealthCheckResult -} - -func init() { - t["BaseHostMemberUplinkHealthCheckResult"] = reflect.TypeOf((*HostMemberUplinkHealthCheckResult)(nil)).Elem() -} - -func (b *HostMultipathInfoLogicalUnitPolicy) GetHostMultipathInfoLogicalUnitPolicy() *HostMultipathInfoLogicalUnitPolicy { - return b -} - -type BaseHostMultipathInfoLogicalUnitPolicy interface { - GetHostMultipathInfoLogicalUnitPolicy() *HostMultipathInfoLogicalUnitPolicy -} - -func init() { - t["BaseHostMultipathInfoLogicalUnitPolicy"] = reflect.TypeOf((*HostMultipathInfoLogicalUnitPolicy)(nil)).Elem() -} - -func (b *HostPciPassthruConfig) GetHostPciPassthruConfig() *HostPciPassthruConfig { return b } - -type BaseHostPciPassthruConfig interface { - GetHostPciPassthruConfig() *HostPciPassthruConfig -} - -func init() { - t["BaseHostPciPassthruConfig"] = reflect.TypeOf((*HostPciPassthruConfig)(nil)).Elem() -} - -func (b *HostPciPassthruInfo) GetHostPciPassthruInfo() *HostPciPassthruInfo { return b } - -type BaseHostPciPassthruInfo interface { - GetHostPciPassthruInfo() *HostPciPassthruInfo -} - -func init() { - t["BaseHostPciPassthruInfo"] = reflect.TypeOf((*HostPciPassthruInfo)(nil)).Elem() -} - -func (b *HostPowerOpFailed) GetHostPowerOpFailed() *HostPowerOpFailed { return b } - -type BaseHostPowerOpFailed interface { - GetHostPowerOpFailed() *HostPowerOpFailed -} - -func init() { - t["BaseHostPowerOpFailed"] = reflect.TypeOf((*HostPowerOpFailed)(nil)).Elem() -} - -func (b *HostProfileConfigSpec) GetHostProfileConfigSpec() *HostProfileConfigSpec { return b } - -type BaseHostProfileConfigSpec interface { - GetHostProfileConfigSpec() *HostProfileConfigSpec -} - -func init() { - t["BaseHostProfileConfigSpec"] = reflect.TypeOf((*HostProfileConfigSpec)(nil)).Elem() -} - -func (b *HostSystemSwapConfigurationSystemSwapOption) GetHostSystemSwapConfigurationSystemSwapOption() *HostSystemSwapConfigurationSystemSwapOption { - return b -} - -type BaseHostSystemSwapConfigurationSystemSwapOption interface { - GetHostSystemSwapConfigurationSystemSwapOption() *HostSystemSwapConfigurationSystemSwapOption -} - -func init() { - t["BaseHostSystemSwapConfigurationSystemSwapOption"] = reflect.TypeOf((*HostSystemSwapConfigurationSystemSwapOption)(nil)).Elem() -} - -func (b *HostTargetTransport) GetHostTargetTransport() *HostTargetTransport { return b } - -type BaseHostTargetTransport interface { - GetHostTargetTransport() *HostTargetTransport -} - -func init() { - t["BaseHostTargetTransport"] = reflect.TypeOf((*HostTargetTransport)(nil)).Elem() -} - -func (b *HostTpmEventDetails) GetHostTpmEventDetails() *HostTpmEventDetails { return b } - -type BaseHostTpmEventDetails interface { - GetHostTpmEventDetails() *HostTpmEventDetails -} - -func init() { - t["BaseHostTpmEventDetails"] = reflect.TypeOf((*HostTpmEventDetails)(nil)).Elem() -} - -func (b *HostVirtualSwitchBridge) GetHostVirtualSwitchBridge() *HostVirtualSwitchBridge { return b } - -type BaseHostVirtualSwitchBridge interface { - GetHostVirtualSwitchBridge() *HostVirtualSwitchBridge -} - -func init() { - t["BaseHostVirtualSwitchBridge"] = reflect.TypeOf((*HostVirtualSwitchBridge)(nil)).Elem() -} - -func (b *HourlyTaskScheduler) GetHourlyTaskScheduler() *HourlyTaskScheduler { return b } - -type BaseHourlyTaskScheduler interface { - GetHourlyTaskScheduler() *HourlyTaskScheduler -} - -func init() { - t["BaseHourlyTaskScheduler"] = reflect.TypeOf((*HourlyTaskScheduler)(nil)).Elem() -} - -func (b *ImportSpec) GetImportSpec() *ImportSpec { return b } - -type BaseImportSpec interface { - GetImportSpec() *ImportSpec -} - -func init() { - t["BaseImportSpec"] = reflect.TypeOf((*ImportSpec)(nil)).Elem() -} - -func (b *InheritablePolicy) GetInheritablePolicy() *InheritablePolicy { return b } - -type BaseInheritablePolicy interface { - GetInheritablePolicy() *InheritablePolicy -} - -func init() { - t["BaseInheritablePolicy"] = reflect.TypeOf((*InheritablePolicy)(nil)).Elem() -} - -func (b *InsufficientHostCapacityFault) GetInsufficientHostCapacityFault() *InsufficientHostCapacityFault { - return b -} - -type BaseInsufficientHostCapacityFault interface { - GetInsufficientHostCapacityFault() *InsufficientHostCapacityFault -} - -func init() { - t["BaseInsufficientHostCapacityFault"] = reflect.TypeOf((*InsufficientHostCapacityFault)(nil)).Elem() -} - -func (b *InsufficientResourcesFault) GetInsufficientResourcesFault() *InsufficientResourcesFault { - return b -} - -type BaseInsufficientResourcesFault interface { - GetInsufficientResourcesFault() *InsufficientResourcesFault -} - -func init() { - t["BaseInsufficientResourcesFault"] = reflect.TypeOf((*InsufficientResourcesFault)(nil)).Elem() -} - -func (b *InsufficientStandbyResource) GetInsufficientStandbyResource() *InsufficientStandbyResource { - return b -} - -type BaseInsufficientStandbyResource interface { - GetInsufficientStandbyResource() *InsufficientStandbyResource -} - -func init() { - t["BaseInsufficientStandbyResource"] = reflect.TypeOf((*InsufficientStandbyResource)(nil)).Elem() -} - -func (b *InvalidArgument) GetInvalidArgument() *InvalidArgument { return b } - -type BaseInvalidArgument interface { - GetInvalidArgument() *InvalidArgument -} - -func init() { - t["BaseInvalidArgument"] = reflect.TypeOf((*InvalidArgument)(nil)).Elem() -} - -func (b *InvalidCAMServer) GetInvalidCAMServer() *InvalidCAMServer { return b } - -type BaseInvalidCAMServer interface { - GetInvalidCAMServer() *InvalidCAMServer -} - -func init() { - t["BaseInvalidCAMServer"] = reflect.TypeOf((*InvalidCAMServer)(nil)).Elem() -} - -func (b *InvalidDatastore) GetInvalidDatastore() *InvalidDatastore { return b } - -type BaseInvalidDatastore interface { - GetInvalidDatastore() *InvalidDatastore -} - -func init() { - t["BaseInvalidDatastore"] = reflect.TypeOf((*InvalidDatastore)(nil)).Elem() -} - -func (b *InvalidDeviceSpec) GetInvalidDeviceSpec() *InvalidDeviceSpec { return b } - -type BaseInvalidDeviceSpec interface { - GetInvalidDeviceSpec() *InvalidDeviceSpec -} - -func init() { - t["BaseInvalidDeviceSpec"] = reflect.TypeOf((*InvalidDeviceSpec)(nil)).Elem() -} - -func (b *InvalidFolder) GetInvalidFolder() *InvalidFolder { return b } - -type BaseInvalidFolder interface { - GetInvalidFolder() *InvalidFolder -} - -func init() { - t["BaseInvalidFolder"] = reflect.TypeOf((*InvalidFolder)(nil)).Elem() -} - -func (b *InvalidFormat) GetInvalidFormat() *InvalidFormat { return b } - -type BaseInvalidFormat interface { - GetInvalidFormat() *InvalidFormat -} - -func init() { - t["BaseInvalidFormat"] = reflect.TypeOf((*InvalidFormat)(nil)).Elem() -} - -func (b *InvalidHostState) GetInvalidHostState() *InvalidHostState { return b } - -type BaseInvalidHostState interface { - GetInvalidHostState() *InvalidHostState -} - -func init() { - t["BaseInvalidHostState"] = reflect.TypeOf((*InvalidHostState)(nil)).Elem() -} - -func (b *InvalidLogin) GetInvalidLogin() *InvalidLogin { return b } - -type BaseInvalidLogin interface { - GetInvalidLogin() *InvalidLogin -} - -func init() { - t["BaseInvalidLogin"] = reflect.TypeOf((*InvalidLogin)(nil)).Elem() -} - -func (b *InvalidPropertyValue) GetInvalidPropertyValue() *InvalidPropertyValue { return b } - -type BaseInvalidPropertyValue interface { - GetInvalidPropertyValue() *InvalidPropertyValue -} - -func init() { - t["BaseInvalidPropertyValue"] = reflect.TypeOf((*InvalidPropertyValue)(nil)).Elem() -} - -func (b *InvalidRequest) GetInvalidRequest() *InvalidRequest { return b } - -type BaseInvalidRequest interface { - GetInvalidRequest() *InvalidRequest -} - -func init() { - t["BaseInvalidRequest"] = reflect.TypeOf((*InvalidRequest)(nil)).Elem() -} - -func (b *InvalidState) GetInvalidState() *InvalidState { return b } - -type BaseInvalidState interface { - GetInvalidState() *InvalidState -} - -func init() { - t["BaseInvalidState"] = reflect.TypeOf((*InvalidState)(nil)).Elem() -} - -func (b *InvalidVmConfig) GetInvalidVmConfig() *InvalidVmConfig { return b } - -type BaseInvalidVmConfig interface { - GetInvalidVmConfig() *InvalidVmConfig -} - -func init() { - t["BaseInvalidVmConfig"] = reflect.TypeOf((*InvalidVmConfig)(nil)).Elem() -} - -func (b *IpAddress) GetIpAddress() *IpAddress { return b } - -type BaseIpAddress interface { - GetIpAddress() *IpAddress -} - -func init() { - t["BaseIpAddress"] = reflect.TypeOf((*IpAddress)(nil)).Elem() -} - -func (b *IscsiFault) GetIscsiFault() *IscsiFault { return b } - -type BaseIscsiFault interface { - GetIscsiFault() *IscsiFault -} - -func init() { - t["BaseIscsiFault"] = reflect.TypeOf((*IscsiFault)(nil)).Elem() -} - -func (b *LicenseEvent) GetLicenseEvent() *LicenseEvent { return b } - -type BaseLicenseEvent interface { - GetLicenseEvent() *LicenseEvent -} - -func init() { - t["BaseLicenseEvent"] = reflect.TypeOf((*LicenseEvent)(nil)).Elem() -} - -func (b *LicenseSource) GetLicenseSource() *LicenseSource { return b } - -type BaseLicenseSource interface { - GetLicenseSource() *LicenseSource -} - -func init() { - t["BaseLicenseSource"] = reflect.TypeOf((*LicenseSource)(nil)).Elem() -} - -func (b *MacAddress) GetMacAddress() *MacAddress { return b } - -type BaseMacAddress interface { - GetMacAddress() *MacAddress -} - -func init() { - t["BaseMacAddress"] = reflect.TypeOf((*MacAddress)(nil)).Elem() -} - -func (b *MethodFault) GetMethodFault() *MethodFault { return b } - -type BaseMethodFault interface { - GetMethodFault() *MethodFault -} - -func init() { - t["BaseMethodFault"] = reflect.TypeOf((*MethodFault)(nil)).Elem() -} - -func (b *MigrationEvent) GetMigrationEvent() *MigrationEvent { return b } - -type BaseMigrationEvent interface { - GetMigrationEvent() *MigrationEvent -} - -func init() { - t["BaseMigrationEvent"] = reflect.TypeOf((*MigrationEvent)(nil)).Elem() -} - -func (b *MigrationFault) GetMigrationFault() *MigrationFault { return b } - -type BaseMigrationFault interface { - GetMigrationFault() *MigrationFault -} - -func init() { - t["BaseMigrationFault"] = reflect.TypeOf((*MigrationFault)(nil)).Elem() -} - -func (b *MigrationFeatureNotSupported) GetMigrationFeatureNotSupported() *MigrationFeatureNotSupported { - return b -} - -type BaseMigrationFeatureNotSupported interface { - GetMigrationFeatureNotSupported() *MigrationFeatureNotSupported -} - -func init() { - t["BaseMigrationFeatureNotSupported"] = reflect.TypeOf((*MigrationFeatureNotSupported)(nil)).Elem() -} - -func (b *MonthlyTaskScheduler) GetMonthlyTaskScheduler() *MonthlyTaskScheduler { return b } - -type BaseMonthlyTaskScheduler interface { - GetMonthlyTaskScheduler() *MonthlyTaskScheduler -} - -func init() { - t["BaseMonthlyTaskScheduler"] = reflect.TypeOf((*MonthlyTaskScheduler)(nil)).Elem() -} - -func (b *NasConfigFault) GetNasConfigFault() *NasConfigFault { return b } - -type BaseNasConfigFault interface { - GetNasConfigFault() *NasConfigFault -} - -func init() { - t["BaseNasConfigFault"] = reflect.TypeOf((*NasConfigFault)(nil)).Elem() -} - -func (b *NegatableExpression) GetNegatableExpression() *NegatableExpression { return b } - -type BaseNegatableExpression interface { - GetNegatableExpression() *NegatableExpression -} - -func init() { - t["BaseNegatableExpression"] = reflect.TypeOf((*NegatableExpression)(nil)).Elem() -} - -func (b *NetBIOSConfigInfo) GetNetBIOSConfigInfo() *NetBIOSConfigInfo { return b } - -type BaseNetBIOSConfigInfo interface { - GetNetBIOSConfigInfo() *NetBIOSConfigInfo -} - -func init() { - t["BaseNetBIOSConfigInfo"] = reflect.TypeOf((*NetBIOSConfigInfo)(nil)).Elem() -} - -func (b *NetworkSummary) GetNetworkSummary() *NetworkSummary { return b } - -type BaseNetworkSummary interface { - GetNetworkSummary() *NetworkSummary -} - -func init() { - t["BaseNetworkSummary"] = reflect.TypeOf((*NetworkSummary)(nil)).Elem() -} - -func (b *NoCompatibleHost) GetNoCompatibleHost() *NoCompatibleHost { return b } - -type BaseNoCompatibleHost interface { - GetNoCompatibleHost() *NoCompatibleHost -} - -func init() { - t["BaseNoCompatibleHost"] = reflect.TypeOf((*NoCompatibleHost)(nil)).Elem() -} - -func (b *NoPermission) GetNoPermission() *NoPermission { return b } - -type BaseNoPermission interface { - GetNoPermission() *NoPermission -} - -func init() { - t["BaseNoPermission"] = reflect.TypeOf((*NoPermission)(nil)).Elem() -} - -func (b *NotEnoughCpus) GetNotEnoughCpus() *NotEnoughCpus { return b } - -type BaseNotEnoughCpus interface { - GetNotEnoughCpus() *NotEnoughCpus -} - -func init() { - t["BaseNotEnoughCpus"] = reflect.TypeOf((*NotEnoughCpus)(nil)).Elem() -} - -func (b *NotEnoughLicenses) GetNotEnoughLicenses() *NotEnoughLicenses { return b } - -type BaseNotEnoughLicenses interface { - GetNotEnoughLicenses() *NotEnoughLicenses -} - -func init() { - t["BaseNotEnoughLicenses"] = reflect.TypeOf((*NotEnoughLicenses)(nil)).Elem() -} - -func (b *NotSupported) GetNotSupported() *NotSupported { return b } - -type BaseNotSupported interface { - GetNotSupported() *NotSupported -} - -func init() { - t["BaseNotSupported"] = reflect.TypeOf((*NotSupported)(nil)).Elem() -} - -func (b *NotSupportedHost) GetNotSupportedHost() *NotSupportedHost { return b } - -type BaseNotSupportedHost interface { - GetNotSupportedHost() *NotSupportedHost -} - -func init() { - t["BaseNotSupportedHost"] = reflect.TypeOf((*NotSupportedHost)(nil)).Elem() -} - -func (b *NotSupportedHostInCluster) GetNotSupportedHostInCluster() *NotSupportedHostInCluster { - return b -} - -type BaseNotSupportedHostInCluster interface { - GetNotSupportedHostInCluster() *NotSupportedHostInCluster -} - -func init() { - t["BaseNotSupportedHostInCluster"] = reflect.TypeOf((*NotSupportedHostInCluster)(nil)).Elem() -} - -func (b *OptionType) GetOptionType() *OptionType { return b } - -type BaseOptionType interface { - GetOptionType() *OptionType -} - -func init() { - t["BaseOptionType"] = reflect.TypeOf((*OptionType)(nil)).Elem() -} - -func (b *OptionValue) GetOptionValue() *OptionValue { return b } - -type BaseOptionValue interface { - GetOptionValue() *OptionValue -} - -func init() { - t["BaseOptionValue"] = reflect.TypeOf((*OptionValue)(nil)).Elem() -} - -func (b *OvfAttribute) GetOvfAttribute() *OvfAttribute { return b } - -type BaseOvfAttribute interface { - GetOvfAttribute() *OvfAttribute -} - -func init() { - t["BaseOvfAttribute"] = reflect.TypeOf((*OvfAttribute)(nil)).Elem() -} - -func (b *OvfConnectedDevice) GetOvfConnectedDevice() *OvfConnectedDevice { return b } - -type BaseOvfConnectedDevice interface { - GetOvfConnectedDevice() *OvfConnectedDevice -} - -func init() { - t["BaseOvfConnectedDevice"] = reflect.TypeOf((*OvfConnectedDevice)(nil)).Elem() -} - -func (b *OvfConstraint) GetOvfConstraint() *OvfConstraint { return b } - -type BaseOvfConstraint interface { - GetOvfConstraint() *OvfConstraint -} - -func init() { - t["BaseOvfConstraint"] = reflect.TypeOf((*OvfConstraint)(nil)).Elem() -} - -func (b *OvfConsumerCallbackFault) GetOvfConsumerCallbackFault() *OvfConsumerCallbackFault { return b } - -type BaseOvfConsumerCallbackFault interface { - GetOvfConsumerCallbackFault() *OvfConsumerCallbackFault -} - -func init() { - t["BaseOvfConsumerCallbackFault"] = reflect.TypeOf((*OvfConsumerCallbackFault)(nil)).Elem() -} - -func (b *OvfElement) GetOvfElement() *OvfElement { return b } - -type BaseOvfElement interface { - GetOvfElement() *OvfElement -} - -func init() { - t["BaseOvfElement"] = reflect.TypeOf((*OvfElement)(nil)).Elem() -} - -func (b *OvfExport) GetOvfExport() *OvfExport { return b } - -type BaseOvfExport interface { - GetOvfExport() *OvfExport -} - -func init() { - t["BaseOvfExport"] = reflect.TypeOf((*OvfExport)(nil)).Elem() -} - -func (b *OvfFault) GetOvfFault() *OvfFault { return b } - -type BaseOvfFault interface { - GetOvfFault() *OvfFault -} - -func init() { - t["BaseOvfFault"] = reflect.TypeOf((*OvfFault)(nil)).Elem() -} - -func (b *OvfHardwareExport) GetOvfHardwareExport() *OvfHardwareExport { return b } - -type BaseOvfHardwareExport interface { - GetOvfHardwareExport() *OvfHardwareExport -} - -func init() { - t["BaseOvfHardwareExport"] = reflect.TypeOf((*OvfHardwareExport)(nil)).Elem() -} - -func (b *OvfImport) GetOvfImport() *OvfImport { return b } - -type BaseOvfImport interface { - GetOvfImport() *OvfImport -} - -func init() { - t["BaseOvfImport"] = reflect.TypeOf((*OvfImport)(nil)).Elem() -} - -func (b *OvfInvalidPackage) GetOvfInvalidPackage() *OvfInvalidPackage { return b } - -type BaseOvfInvalidPackage interface { - GetOvfInvalidPackage() *OvfInvalidPackage -} - -func init() { - t["BaseOvfInvalidPackage"] = reflect.TypeOf((*OvfInvalidPackage)(nil)).Elem() -} - -func (b *OvfInvalidValue) GetOvfInvalidValue() *OvfInvalidValue { return b } - -type BaseOvfInvalidValue interface { - GetOvfInvalidValue() *OvfInvalidValue -} - -func init() { - t["BaseOvfInvalidValue"] = reflect.TypeOf((*OvfInvalidValue)(nil)).Elem() -} - -func (b *OvfManagerCommonParams) GetOvfManagerCommonParams() *OvfManagerCommonParams { return b } - -type BaseOvfManagerCommonParams interface { - GetOvfManagerCommonParams() *OvfManagerCommonParams -} - -func init() { - t["BaseOvfManagerCommonParams"] = reflect.TypeOf((*OvfManagerCommonParams)(nil)).Elem() -} - -func (b *OvfMissingElement) GetOvfMissingElement() *OvfMissingElement { return b } - -type BaseOvfMissingElement interface { - GetOvfMissingElement() *OvfMissingElement -} - -func init() { - t["BaseOvfMissingElement"] = reflect.TypeOf((*OvfMissingElement)(nil)).Elem() -} - -func (b *OvfProperty) GetOvfProperty() *OvfProperty { return b } - -type BaseOvfProperty interface { - GetOvfProperty() *OvfProperty -} - -func init() { - t["BaseOvfProperty"] = reflect.TypeOf((*OvfProperty)(nil)).Elem() -} - -func (b *OvfSystemFault) GetOvfSystemFault() *OvfSystemFault { return b } - -type BaseOvfSystemFault interface { - GetOvfSystemFault() *OvfSystemFault -} - -func init() { - t["BaseOvfSystemFault"] = reflect.TypeOf((*OvfSystemFault)(nil)).Elem() -} - -func (b *OvfUnsupportedAttribute) GetOvfUnsupportedAttribute() *OvfUnsupportedAttribute { return b } - -type BaseOvfUnsupportedAttribute interface { - GetOvfUnsupportedAttribute() *OvfUnsupportedAttribute -} - -func init() { - t["BaseOvfUnsupportedAttribute"] = reflect.TypeOf((*OvfUnsupportedAttribute)(nil)).Elem() -} - -func (b *OvfUnsupportedElement) GetOvfUnsupportedElement() *OvfUnsupportedElement { return b } - -type BaseOvfUnsupportedElement interface { - GetOvfUnsupportedElement() *OvfUnsupportedElement -} - -func init() { - t["BaseOvfUnsupportedElement"] = reflect.TypeOf((*OvfUnsupportedElement)(nil)).Elem() -} - -func (b *OvfUnsupportedPackage) GetOvfUnsupportedPackage() *OvfUnsupportedPackage { return b } - -type BaseOvfUnsupportedPackage interface { - GetOvfUnsupportedPackage() *OvfUnsupportedPackage -} - -func init() { - t["BaseOvfUnsupportedPackage"] = reflect.TypeOf((*OvfUnsupportedPackage)(nil)).Elem() -} - -func (b *PatchMetadataInvalid) GetPatchMetadataInvalid() *PatchMetadataInvalid { return b } - -type BasePatchMetadataInvalid interface { - GetPatchMetadataInvalid() *PatchMetadataInvalid -} - -func init() { - t["BasePatchMetadataInvalid"] = reflect.TypeOf((*PatchMetadataInvalid)(nil)).Elem() -} - -func (b *PatchNotApplicable) GetPatchNotApplicable() *PatchNotApplicable { return b } - -type BasePatchNotApplicable interface { - GetPatchNotApplicable() *PatchNotApplicable -} - -func init() { - t["BasePatchNotApplicable"] = reflect.TypeOf((*PatchNotApplicable)(nil)).Elem() -} - -func (b *PerfEntityMetricBase) GetPerfEntityMetricBase() *PerfEntityMetricBase { return b } - -type BasePerfEntityMetricBase interface { - GetPerfEntityMetricBase() *PerfEntityMetricBase -} - -func init() { - t["BasePerfEntityMetricBase"] = reflect.TypeOf((*PerfEntityMetricBase)(nil)).Elem() -} - -func (b *PerfMetricSeries) GetPerfMetricSeries() *PerfMetricSeries { return b } - -type BasePerfMetricSeries interface { - GetPerfMetricSeries() *PerfMetricSeries -} - -func init() { - t["BasePerfMetricSeries"] = reflect.TypeOf((*PerfMetricSeries)(nil)).Elem() -} - -func (b *PermissionEvent) GetPermissionEvent() *PermissionEvent { return b } - -type BasePermissionEvent interface { - GetPermissionEvent() *PermissionEvent -} - -func init() { - t["BasePermissionEvent"] = reflect.TypeOf((*PermissionEvent)(nil)).Elem() -} - -func (b *PhysicalNicHint) GetPhysicalNicHint() *PhysicalNicHint { return b } - -type BasePhysicalNicHint interface { - GetPhysicalNicHint() *PhysicalNicHint -} - -func init() { - t["BasePhysicalNicHint"] = reflect.TypeOf((*PhysicalNicHint)(nil)).Elem() -} - -func (b *PlatformConfigFault) GetPlatformConfigFault() *PlatformConfigFault { return b } - -type BasePlatformConfigFault interface { - GetPlatformConfigFault() *PlatformConfigFault -} - -func init() { - t["BasePlatformConfigFault"] = reflect.TypeOf((*PlatformConfigFault)(nil)).Elem() -} - -func (b *PolicyOption) GetPolicyOption() *PolicyOption { return b } - -type BasePolicyOption interface { - GetPolicyOption() *PolicyOption -} - -func init() { - t["BasePolicyOption"] = reflect.TypeOf((*PolicyOption)(nil)).Elem() -} - -func (b *PortGroupProfile) GetPortGroupProfile() *PortGroupProfile { return b } - -type BasePortGroupProfile interface { - GetPortGroupProfile() *PortGroupProfile -} - -func init() { - t["BasePortGroupProfile"] = reflect.TypeOf((*PortGroupProfile)(nil)).Elem() -} - -func (b *ProfileConfigInfo) GetProfileConfigInfo() *ProfileConfigInfo { return b } - -type BaseProfileConfigInfo interface { - GetProfileConfigInfo() *ProfileConfigInfo -} - -func init() { - t["BaseProfileConfigInfo"] = reflect.TypeOf((*ProfileConfigInfo)(nil)).Elem() -} - -func (b *ProfileCreateSpec) GetProfileCreateSpec() *ProfileCreateSpec { return b } - -type BaseProfileCreateSpec interface { - GetProfileCreateSpec() *ProfileCreateSpec -} - -func init() { - t["BaseProfileCreateSpec"] = reflect.TypeOf((*ProfileCreateSpec)(nil)).Elem() -} - -func (b *ProfileEvent) GetProfileEvent() *ProfileEvent { return b } - -type BaseProfileEvent interface { - GetProfileEvent() *ProfileEvent -} - -func init() { - t["BaseProfileEvent"] = reflect.TypeOf((*ProfileEvent)(nil)).Elem() -} - -func (b *ProfileExpression) GetProfileExpression() *ProfileExpression { return b } - -type BaseProfileExpression interface { - GetProfileExpression() *ProfileExpression -} - -func init() { - t["BaseProfileExpression"] = reflect.TypeOf((*ProfileExpression)(nil)).Elem() -} - -func (b *ProfilePolicyOptionMetadata) GetProfilePolicyOptionMetadata() *ProfilePolicyOptionMetadata { - return b -} - -type BaseProfilePolicyOptionMetadata interface { - GetProfilePolicyOptionMetadata() *ProfilePolicyOptionMetadata -} - -func init() { - t["BaseProfilePolicyOptionMetadata"] = reflect.TypeOf((*ProfilePolicyOptionMetadata)(nil)).Elem() -} - -func (b *ProfileSerializedCreateSpec) GetProfileSerializedCreateSpec() *ProfileSerializedCreateSpec { - return b -} - -type BaseProfileSerializedCreateSpec interface { - GetProfileSerializedCreateSpec() *ProfileSerializedCreateSpec -} - -func init() { - t["BaseProfileSerializedCreateSpec"] = reflect.TypeOf((*ProfileSerializedCreateSpec)(nil)).Elem() -} - -func (b *RDMNotSupported) GetRDMNotSupported() *RDMNotSupported { return b } - -type BaseRDMNotSupported interface { - GetRDMNotSupported() *RDMNotSupported -} - -func init() { - t["BaseRDMNotSupported"] = reflect.TypeOf((*RDMNotSupported)(nil)).Elem() -} - -func (b *RecurrentTaskScheduler) GetRecurrentTaskScheduler() *RecurrentTaskScheduler { return b } - -type BaseRecurrentTaskScheduler interface { - GetRecurrentTaskScheduler() *RecurrentTaskScheduler -} - -func init() { - t["BaseRecurrentTaskScheduler"] = reflect.TypeOf((*RecurrentTaskScheduler)(nil)).Elem() -} - -func (b *ReplicationConfigFault) GetReplicationConfigFault() *ReplicationConfigFault { return b } - -type BaseReplicationConfigFault interface { - GetReplicationConfigFault() *ReplicationConfigFault -} - -func init() { - t["BaseReplicationConfigFault"] = reflect.TypeOf((*ReplicationConfigFault)(nil)).Elem() -} - -func (b *ReplicationFault) GetReplicationFault() *ReplicationFault { return b } - -type BaseReplicationFault interface { - GetReplicationFault() *ReplicationFault -} - -func init() { - t["BaseReplicationFault"] = reflect.TypeOf((*ReplicationFault)(nil)).Elem() -} - -func (b *ResourceInUse) GetResourceInUse() *ResourceInUse { return b } - -type BaseResourceInUse interface { - GetResourceInUse() *ResourceInUse -} - -func init() { - t["BaseResourceInUse"] = reflect.TypeOf((*ResourceInUse)(nil)).Elem() -} - -func (b *ResourcePoolEvent) GetResourcePoolEvent() *ResourcePoolEvent { return b } - -type BaseResourcePoolEvent interface { - GetResourcePoolEvent() *ResourcePoolEvent -} - -func init() { - t["BaseResourcePoolEvent"] = reflect.TypeOf((*ResourcePoolEvent)(nil)).Elem() -} - -func (b *ResourcePoolSummary) GetResourcePoolSummary() *ResourcePoolSummary { return b } - -type BaseResourcePoolSummary interface { - GetResourcePoolSummary() *ResourcePoolSummary -} - -func init() { - t["BaseResourcePoolSummary"] = reflect.TypeOf((*ResourcePoolSummary)(nil)).Elem() -} - -func (b *RoleEvent) GetRoleEvent() *RoleEvent { return b } - -type BaseRoleEvent interface { - GetRoleEvent() *RoleEvent -} - -func init() { - t["BaseRoleEvent"] = reflect.TypeOf((*RoleEvent)(nil)).Elem() -} - -func (b *RuntimeFault) GetRuntimeFault() *RuntimeFault { return b } - -type BaseRuntimeFault interface { - GetRuntimeFault() *RuntimeFault -} - -func init() { - t["BaseRuntimeFault"] = reflect.TypeOf((*RuntimeFault)(nil)).Elem() -} - -func (b *ScheduledTaskEvent) GetScheduledTaskEvent() *ScheduledTaskEvent { return b } - -type BaseScheduledTaskEvent interface { - GetScheduledTaskEvent() *ScheduledTaskEvent -} - -func init() { - t["BaseScheduledTaskEvent"] = reflect.TypeOf((*ScheduledTaskEvent)(nil)).Elem() -} - -func (b *ScheduledTaskSpec) GetScheduledTaskSpec() *ScheduledTaskSpec { return b } - -type BaseScheduledTaskSpec interface { - GetScheduledTaskSpec() *ScheduledTaskSpec -} - -func init() { - t["BaseScheduledTaskSpec"] = reflect.TypeOf((*ScheduledTaskSpec)(nil)).Elem() -} - -func (b *ScsiLun) GetScsiLun() *ScsiLun { return b } - -type BaseScsiLun interface { - GetScsiLun() *ScsiLun -} - -func init() { - t["BaseScsiLun"] = reflect.TypeOf((*ScsiLun)(nil)).Elem() -} - -func (b *SecurityError) GetSecurityError() *SecurityError { return b } - -type BaseSecurityError interface { - GetSecurityError() *SecurityError -} - -func init() { - t["BaseSecurityError"] = reflect.TypeOf((*SecurityError)(nil)).Elem() -} - -func (b *SelectionSet) GetSelectionSet() *SelectionSet { return b } - -type BaseSelectionSet interface { - GetSelectionSet() *SelectionSet -} - -func init() { - t["BaseSelectionSet"] = reflect.TypeOf((*SelectionSet)(nil)).Elem() -} - -func (b *SelectionSpec) GetSelectionSpec() *SelectionSpec { return b } - -type BaseSelectionSpec interface { - GetSelectionSpec() *SelectionSpec -} - -func init() { - t["BaseSelectionSpec"] = reflect.TypeOf((*SelectionSpec)(nil)).Elem() -} - -func (b *SessionEvent) GetSessionEvent() *SessionEvent { return b } - -type BaseSessionEvent interface { - GetSessionEvent() *SessionEvent -} - -func init() { - t["BaseSessionEvent"] = reflect.TypeOf((*SessionEvent)(nil)).Elem() -} - -func (b *SessionManagerServiceRequestSpec) GetSessionManagerServiceRequestSpec() *SessionManagerServiceRequestSpec { - return b -} - -type BaseSessionManagerServiceRequestSpec interface { - GetSessionManagerServiceRequestSpec() *SessionManagerServiceRequestSpec -} - -func init() { - t["BaseSessionManagerServiceRequestSpec"] = reflect.TypeOf((*SessionManagerServiceRequestSpec)(nil)).Elem() -} - -func (b *SnapshotCopyNotSupported) GetSnapshotCopyNotSupported() *SnapshotCopyNotSupported { return b } - -type BaseSnapshotCopyNotSupported interface { - GetSnapshotCopyNotSupported() *SnapshotCopyNotSupported -} - -func init() { - t["BaseSnapshotCopyNotSupported"] = reflect.TypeOf((*SnapshotCopyNotSupported)(nil)).Elem() -} - -func (b *SnapshotFault) GetSnapshotFault() *SnapshotFault { return b } - -type BaseSnapshotFault interface { - GetSnapshotFault() *SnapshotFault -} - -func init() { - t["BaseSnapshotFault"] = reflect.TypeOf((*SnapshotFault)(nil)).Elem() -} - -func (b *TaskEvent) GetTaskEvent() *TaskEvent { return b } - -type BaseTaskEvent interface { - GetTaskEvent() *TaskEvent -} - -func init() { - t["BaseTaskEvent"] = reflect.TypeOf((*TaskEvent)(nil)).Elem() -} - -func (b *TaskInProgress) GetTaskInProgress() *TaskInProgress { return b } - -type BaseTaskInProgress interface { - GetTaskInProgress() *TaskInProgress -} - -func init() { - t["BaseTaskInProgress"] = reflect.TypeOf((*TaskInProgress)(nil)).Elem() -} - -func (b *TaskReason) GetTaskReason() *TaskReason { return b } - -type BaseTaskReason interface { - GetTaskReason() *TaskReason -} - -func init() { - t["BaseTaskReason"] = reflect.TypeOf((*TaskReason)(nil)).Elem() -} - -func (b *TaskScheduler) GetTaskScheduler() *TaskScheduler { return b } - -type BaseTaskScheduler interface { - GetTaskScheduler() *TaskScheduler -} - -func init() { - t["BaseTaskScheduler"] = reflect.TypeOf((*TaskScheduler)(nil)).Elem() -} - -func (b *TemplateUpgradeEvent) GetTemplateUpgradeEvent() *TemplateUpgradeEvent { return b } - -type BaseTemplateUpgradeEvent interface { - GetTemplateUpgradeEvent() *TemplateUpgradeEvent -} - -func init() { - t["BaseTemplateUpgradeEvent"] = reflect.TypeOf((*TemplateUpgradeEvent)(nil)).Elem() -} - -func (b *Timedout) GetTimedout() *Timedout { return b } - -type BaseTimedout interface { - GetTimedout() *Timedout -} - -func init() { - t["BaseTimedout"] = reflect.TypeOf((*Timedout)(nil)).Elem() -} - -func (b *TypeDescription) GetTypeDescription() *TypeDescription { return b } - -type BaseTypeDescription interface { - GetTypeDescription() *TypeDescription -} - -func init() { - t["BaseTypeDescription"] = reflect.TypeOf((*TypeDescription)(nil)).Elem() -} - -func (b *UnsupportedDatastore) GetUnsupportedDatastore() *UnsupportedDatastore { return b } - -type BaseUnsupportedDatastore interface { - GetUnsupportedDatastore() *UnsupportedDatastore -} - -func init() { - t["BaseUnsupportedDatastore"] = reflect.TypeOf((*UnsupportedDatastore)(nil)).Elem() -} - -func (b *UpgradeEvent) GetUpgradeEvent() *UpgradeEvent { return b } - -type BaseUpgradeEvent interface { - GetUpgradeEvent() *UpgradeEvent -} - -func init() { - t["BaseUpgradeEvent"] = reflect.TypeOf((*UpgradeEvent)(nil)).Elem() -} - -func (b *UserSearchResult) GetUserSearchResult() *UserSearchResult { return b } - -type BaseUserSearchResult interface { - GetUserSearchResult() *UserSearchResult -} - -func init() { - t["BaseUserSearchResult"] = reflect.TypeOf((*UserSearchResult)(nil)).Elem() -} - -func (b *VAppConfigFault) GetVAppConfigFault() *VAppConfigFault { return b } - -type BaseVAppConfigFault interface { - GetVAppConfigFault() *VAppConfigFault -} - -func init() { - t["BaseVAppConfigFault"] = reflect.TypeOf((*VAppConfigFault)(nil)).Elem() -} - -func (b *VAppPropertyFault) GetVAppPropertyFault() *VAppPropertyFault { return b } - -type BaseVAppPropertyFault interface { - GetVAppPropertyFault() *VAppPropertyFault -} - -func init() { - t["BaseVAppPropertyFault"] = reflect.TypeOf((*VAppPropertyFault)(nil)).Elem() -} - -func (b *VMotionInterfaceIssue) GetVMotionInterfaceIssue() *VMotionInterfaceIssue { return b } - -type BaseVMotionInterfaceIssue interface { - GetVMotionInterfaceIssue() *VMotionInterfaceIssue -} - -func init() { - t["BaseVMotionInterfaceIssue"] = reflect.TypeOf((*VMotionInterfaceIssue)(nil)).Elem() -} - -func (b *VMwareDVSHealthCheckConfig) GetVMwareDVSHealthCheckConfig() *VMwareDVSHealthCheckConfig { - return b -} - -type BaseVMwareDVSHealthCheckConfig interface { - GetVMwareDVSHealthCheckConfig() *VMwareDVSHealthCheckConfig -} - -func init() { - t["BaseVMwareDVSHealthCheckConfig"] = reflect.TypeOf((*VMwareDVSHealthCheckConfig)(nil)).Elem() -} - -func (b *VimFault) GetVimFault() *VimFault { return b } - -type BaseVimFault interface { - GetVimFault() *VimFault -} - -func init() { - t["BaseVimFault"] = reflect.TypeOf((*VimFault)(nil)).Elem() -} - -func (b *VirtualController) GetVirtualController() *VirtualController { return b } - -type BaseVirtualController interface { - GetVirtualController() *VirtualController -} - -func init() { - t["BaseVirtualController"] = reflect.TypeOf((*VirtualController)(nil)).Elem() -} - -func (b *VirtualControllerOption) GetVirtualControllerOption() *VirtualControllerOption { return b } - -type BaseVirtualControllerOption interface { - GetVirtualControllerOption() *VirtualControllerOption -} - -func init() { - t["BaseVirtualControllerOption"] = reflect.TypeOf((*VirtualControllerOption)(nil)).Elem() -} - -func (b *VirtualDevice) GetVirtualDevice() *VirtualDevice { return b } - -type BaseVirtualDevice interface { - GetVirtualDevice() *VirtualDevice -} - -func init() { - t["BaseVirtualDevice"] = reflect.TypeOf((*VirtualDevice)(nil)).Elem() -} - -func (b *VirtualDeviceBackingInfo) GetVirtualDeviceBackingInfo() *VirtualDeviceBackingInfo { return b } - -type BaseVirtualDeviceBackingInfo interface { - GetVirtualDeviceBackingInfo() *VirtualDeviceBackingInfo -} - -func init() { - t["BaseVirtualDeviceBackingInfo"] = reflect.TypeOf((*VirtualDeviceBackingInfo)(nil)).Elem() -} - -func (b *VirtualDeviceBackingOption) GetVirtualDeviceBackingOption() *VirtualDeviceBackingOption { - return b -} - -type BaseVirtualDeviceBackingOption interface { - GetVirtualDeviceBackingOption() *VirtualDeviceBackingOption -} - -func init() { - t["BaseVirtualDeviceBackingOption"] = reflect.TypeOf((*VirtualDeviceBackingOption)(nil)).Elem() -} - -func (b *VirtualDeviceBusSlotInfo) GetVirtualDeviceBusSlotInfo() *VirtualDeviceBusSlotInfo { return b } - -type BaseVirtualDeviceBusSlotInfo interface { - GetVirtualDeviceBusSlotInfo() *VirtualDeviceBusSlotInfo -} - -func init() { - t["BaseVirtualDeviceBusSlotInfo"] = reflect.TypeOf((*VirtualDeviceBusSlotInfo)(nil)).Elem() -} - -func (b *VirtualDeviceConfigSpec) GetVirtualDeviceConfigSpec() *VirtualDeviceConfigSpec { return b } - -type BaseVirtualDeviceConfigSpec interface { - GetVirtualDeviceConfigSpec() *VirtualDeviceConfigSpec -} - -func init() { - t["BaseVirtualDeviceConfigSpec"] = reflect.TypeOf((*VirtualDeviceConfigSpec)(nil)).Elem() -} - -func (b *VirtualDeviceDeviceBackingInfo) GetVirtualDeviceDeviceBackingInfo() *VirtualDeviceDeviceBackingInfo { - return b -} - -type BaseVirtualDeviceDeviceBackingInfo interface { - GetVirtualDeviceDeviceBackingInfo() *VirtualDeviceDeviceBackingInfo -} - -func init() { - t["BaseVirtualDeviceDeviceBackingInfo"] = reflect.TypeOf((*VirtualDeviceDeviceBackingInfo)(nil)).Elem() -} - -func (b *VirtualDeviceDeviceBackingOption) GetVirtualDeviceDeviceBackingOption() *VirtualDeviceDeviceBackingOption { - return b -} - -type BaseVirtualDeviceDeviceBackingOption interface { - GetVirtualDeviceDeviceBackingOption() *VirtualDeviceDeviceBackingOption -} - -func init() { - t["BaseVirtualDeviceDeviceBackingOption"] = reflect.TypeOf((*VirtualDeviceDeviceBackingOption)(nil)).Elem() -} - -func (b *VirtualDeviceFileBackingInfo) GetVirtualDeviceFileBackingInfo() *VirtualDeviceFileBackingInfo { - return b -} - -type BaseVirtualDeviceFileBackingInfo interface { - GetVirtualDeviceFileBackingInfo() *VirtualDeviceFileBackingInfo -} - -func init() { - t["BaseVirtualDeviceFileBackingInfo"] = reflect.TypeOf((*VirtualDeviceFileBackingInfo)(nil)).Elem() -} - -func (b *VirtualDeviceFileBackingOption) GetVirtualDeviceFileBackingOption() *VirtualDeviceFileBackingOption { - return b -} - -type BaseVirtualDeviceFileBackingOption interface { - GetVirtualDeviceFileBackingOption() *VirtualDeviceFileBackingOption -} - -func init() { - t["BaseVirtualDeviceFileBackingOption"] = reflect.TypeOf((*VirtualDeviceFileBackingOption)(nil)).Elem() -} - -func (b *VirtualDeviceOption) GetVirtualDeviceOption() *VirtualDeviceOption { return b } - -type BaseVirtualDeviceOption interface { - GetVirtualDeviceOption() *VirtualDeviceOption -} - -func init() { - t["BaseVirtualDeviceOption"] = reflect.TypeOf((*VirtualDeviceOption)(nil)).Elem() -} - -func (b *VirtualDevicePciBusSlotInfo) GetVirtualDevicePciBusSlotInfo() *VirtualDevicePciBusSlotInfo { - return b -} - -type BaseVirtualDevicePciBusSlotInfo interface { - GetVirtualDevicePciBusSlotInfo() *VirtualDevicePciBusSlotInfo -} - -func init() { - t["BaseVirtualDevicePciBusSlotInfo"] = reflect.TypeOf((*VirtualDevicePciBusSlotInfo)(nil)).Elem() -} - -func (b *VirtualDevicePipeBackingInfo) GetVirtualDevicePipeBackingInfo() *VirtualDevicePipeBackingInfo { - return b -} - -type BaseVirtualDevicePipeBackingInfo interface { - GetVirtualDevicePipeBackingInfo() *VirtualDevicePipeBackingInfo -} - -func init() { - t["BaseVirtualDevicePipeBackingInfo"] = reflect.TypeOf((*VirtualDevicePipeBackingInfo)(nil)).Elem() -} - -func (b *VirtualDevicePipeBackingOption) GetVirtualDevicePipeBackingOption() *VirtualDevicePipeBackingOption { - return b -} - -type BaseVirtualDevicePipeBackingOption interface { - GetVirtualDevicePipeBackingOption() *VirtualDevicePipeBackingOption -} - -func init() { - t["BaseVirtualDevicePipeBackingOption"] = reflect.TypeOf((*VirtualDevicePipeBackingOption)(nil)).Elem() -} - -func (b *VirtualDeviceRemoteDeviceBackingInfo) GetVirtualDeviceRemoteDeviceBackingInfo() *VirtualDeviceRemoteDeviceBackingInfo { - return b -} - -type BaseVirtualDeviceRemoteDeviceBackingInfo interface { - GetVirtualDeviceRemoteDeviceBackingInfo() *VirtualDeviceRemoteDeviceBackingInfo -} - -func init() { - t["BaseVirtualDeviceRemoteDeviceBackingInfo"] = reflect.TypeOf((*VirtualDeviceRemoteDeviceBackingInfo)(nil)).Elem() -} - -func (b *VirtualDeviceRemoteDeviceBackingOption) GetVirtualDeviceRemoteDeviceBackingOption() *VirtualDeviceRemoteDeviceBackingOption { - return b -} - -type BaseVirtualDeviceRemoteDeviceBackingOption interface { - GetVirtualDeviceRemoteDeviceBackingOption() *VirtualDeviceRemoteDeviceBackingOption -} - -func init() { - t["BaseVirtualDeviceRemoteDeviceBackingOption"] = reflect.TypeOf((*VirtualDeviceRemoteDeviceBackingOption)(nil)).Elem() -} - -func (b *VirtualDeviceURIBackingInfo) GetVirtualDeviceURIBackingInfo() *VirtualDeviceURIBackingInfo { - return b -} - -type BaseVirtualDeviceURIBackingInfo interface { - GetVirtualDeviceURIBackingInfo() *VirtualDeviceURIBackingInfo -} - -func init() { - t["BaseVirtualDeviceURIBackingInfo"] = reflect.TypeOf((*VirtualDeviceURIBackingInfo)(nil)).Elem() -} - -func (b *VirtualDeviceURIBackingOption) GetVirtualDeviceURIBackingOption() *VirtualDeviceURIBackingOption { - return b -} - -type BaseVirtualDeviceURIBackingOption interface { - GetVirtualDeviceURIBackingOption() *VirtualDeviceURIBackingOption -} - -func init() { - t["BaseVirtualDeviceURIBackingOption"] = reflect.TypeOf((*VirtualDeviceURIBackingOption)(nil)).Elem() -} - -func (b *VirtualDiskRawDiskVer2BackingInfo) GetVirtualDiskRawDiskVer2BackingInfo() *VirtualDiskRawDiskVer2BackingInfo { - return b -} - -type BaseVirtualDiskRawDiskVer2BackingInfo interface { - GetVirtualDiskRawDiskVer2BackingInfo() *VirtualDiskRawDiskVer2BackingInfo -} - -func init() { - t["BaseVirtualDiskRawDiskVer2BackingInfo"] = reflect.TypeOf((*VirtualDiskRawDiskVer2BackingInfo)(nil)).Elem() -} - -func (b *VirtualDiskRawDiskVer2BackingOption) GetVirtualDiskRawDiskVer2BackingOption() *VirtualDiskRawDiskVer2BackingOption { - return b -} - -type BaseVirtualDiskRawDiskVer2BackingOption interface { - GetVirtualDiskRawDiskVer2BackingOption() *VirtualDiskRawDiskVer2BackingOption -} - -func init() { - t["BaseVirtualDiskRawDiskVer2BackingOption"] = reflect.TypeOf((*VirtualDiskRawDiskVer2BackingOption)(nil)).Elem() -} - -func (b *VirtualDiskSpec) GetVirtualDiskSpec() *VirtualDiskSpec { return b } - -type BaseVirtualDiskSpec interface { - GetVirtualDiskSpec() *VirtualDiskSpec -} - -func init() { - t["BaseVirtualDiskSpec"] = reflect.TypeOf((*VirtualDiskSpec)(nil)).Elem() -} - -func (b *VirtualEthernetCard) GetVirtualEthernetCard() *VirtualEthernetCard { return b } - -type BaseVirtualEthernetCard interface { - GetVirtualEthernetCard() *VirtualEthernetCard -} - -func init() { - t["BaseVirtualEthernetCard"] = reflect.TypeOf((*VirtualEthernetCard)(nil)).Elem() -} - -func (b *VirtualEthernetCardOption) GetVirtualEthernetCardOption() *VirtualEthernetCardOption { - return b -} - -type BaseVirtualEthernetCardOption interface { - GetVirtualEthernetCardOption() *VirtualEthernetCardOption -} - -func init() { - t["BaseVirtualEthernetCardOption"] = reflect.TypeOf((*VirtualEthernetCardOption)(nil)).Elem() -} - -func (b *VirtualHardwareCompatibilityIssue) GetVirtualHardwareCompatibilityIssue() *VirtualHardwareCompatibilityIssue { - return b -} - -type BaseVirtualHardwareCompatibilityIssue interface { - GetVirtualHardwareCompatibilityIssue() *VirtualHardwareCompatibilityIssue -} - -func init() { - t["BaseVirtualHardwareCompatibilityIssue"] = reflect.TypeOf((*VirtualHardwareCompatibilityIssue)(nil)).Elem() -} - -func (b *VirtualMachineBootOptionsBootableDevice) GetVirtualMachineBootOptionsBootableDevice() *VirtualMachineBootOptionsBootableDevice { - return b -} - -type BaseVirtualMachineBootOptionsBootableDevice interface { - GetVirtualMachineBootOptionsBootableDevice() *VirtualMachineBootOptionsBootableDevice -} - -func init() { - t["BaseVirtualMachineBootOptionsBootableDevice"] = reflect.TypeOf((*VirtualMachineBootOptionsBootableDevice)(nil)).Elem() -} - -func (b *VirtualMachineDeviceRuntimeInfoDeviceRuntimeState) GetVirtualMachineDeviceRuntimeInfoDeviceRuntimeState() *VirtualMachineDeviceRuntimeInfoDeviceRuntimeState { - return b -} - -type BaseVirtualMachineDeviceRuntimeInfoDeviceRuntimeState interface { - GetVirtualMachineDeviceRuntimeInfoDeviceRuntimeState() *VirtualMachineDeviceRuntimeInfoDeviceRuntimeState -} - -func init() { - t["BaseVirtualMachineDeviceRuntimeInfoDeviceRuntimeState"] = reflect.TypeOf((*VirtualMachineDeviceRuntimeInfoDeviceRuntimeState)(nil)).Elem() -} - -func (b *VirtualMachineDiskDeviceInfo) GetVirtualMachineDiskDeviceInfo() *VirtualMachineDiskDeviceInfo { - return b -} - -type BaseVirtualMachineDiskDeviceInfo interface { - GetVirtualMachineDiskDeviceInfo() *VirtualMachineDiskDeviceInfo -} - -func init() { - t["BaseVirtualMachineDiskDeviceInfo"] = reflect.TypeOf((*VirtualMachineDiskDeviceInfo)(nil)).Elem() -} - -func (b *VirtualMachinePciPassthroughInfo) GetVirtualMachinePciPassthroughInfo() *VirtualMachinePciPassthroughInfo { - return b -} - -type BaseVirtualMachinePciPassthroughInfo interface { - GetVirtualMachinePciPassthroughInfo() *VirtualMachinePciPassthroughInfo -} - -func init() { - t["BaseVirtualMachinePciPassthroughInfo"] = reflect.TypeOf((*VirtualMachinePciPassthroughInfo)(nil)).Elem() -} - -func (b *VirtualMachineProfileSpec) GetVirtualMachineProfileSpec() *VirtualMachineProfileSpec { - return b -} - -type BaseVirtualMachineProfileSpec interface { - GetVirtualMachineProfileSpec() *VirtualMachineProfileSpec -} - -func init() { - t["BaseVirtualMachineProfileSpec"] = reflect.TypeOf((*VirtualMachineProfileSpec)(nil)).Elem() -} - -func (b *VirtualMachineTargetInfo) GetVirtualMachineTargetInfo() *VirtualMachineTargetInfo { return b } - -type BaseVirtualMachineTargetInfo interface { - GetVirtualMachineTargetInfo() *VirtualMachineTargetInfo -} - -func init() { - t["BaseVirtualMachineTargetInfo"] = reflect.TypeOf((*VirtualMachineTargetInfo)(nil)).Elem() -} - -func (b *VirtualSATAController) GetVirtualSATAController() *VirtualSATAController { return b } - -type BaseVirtualSATAController interface { - GetVirtualSATAController() *VirtualSATAController -} - -func init() { - t["BaseVirtualSATAController"] = reflect.TypeOf((*VirtualSATAController)(nil)).Elem() -} - -func (b *VirtualSATAControllerOption) GetVirtualSATAControllerOption() *VirtualSATAControllerOption { - return b -} - -type BaseVirtualSATAControllerOption interface { - GetVirtualSATAControllerOption() *VirtualSATAControllerOption -} - -func init() { - t["BaseVirtualSATAControllerOption"] = reflect.TypeOf((*VirtualSATAControllerOption)(nil)).Elem() -} - -func (b *VirtualSCSIController) GetVirtualSCSIController() *VirtualSCSIController { return b } - -type BaseVirtualSCSIController interface { - GetVirtualSCSIController() *VirtualSCSIController -} - -func init() { - t["BaseVirtualSCSIController"] = reflect.TypeOf((*VirtualSCSIController)(nil)).Elem() -} - -func (b *VirtualSCSIControllerOption) GetVirtualSCSIControllerOption() *VirtualSCSIControllerOption { - return b -} - -type BaseVirtualSCSIControllerOption interface { - GetVirtualSCSIControllerOption() *VirtualSCSIControllerOption -} - -func init() { - t["BaseVirtualSCSIControllerOption"] = reflect.TypeOf((*VirtualSCSIControllerOption)(nil)).Elem() -} - -func (b *VirtualSoundCard) GetVirtualSoundCard() *VirtualSoundCard { return b } - -type BaseVirtualSoundCard interface { - GetVirtualSoundCard() *VirtualSoundCard -} - -func init() { - t["BaseVirtualSoundCard"] = reflect.TypeOf((*VirtualSoundCard)(nil)).Elem() -} - -func (b *VirtualSoundCardOption) GetVirtualSoundCardOption() *VirtualSoundCardOption { return b } - -type BaseVirtualSoundCardOption interface { - GetVirtualSoundCardOption() *VirtualSoundCardOption -} - -func init() { - t["BaseVirtualSoundCardOption"] = reflect.TypeOf((*VirtualSoundCardOption)(nil)).Elem() -} - -func (b *VirtualVmxnet) GetVirtualVmxnet() *VirtualVmxnet { return b } - -type BaseVirtualVmxnet interface { - GetVirtualVmxnet() *VirtualVmxnet -} - -func init() { - t["BaseVirtualVmxnet"] = reflect.TypeOf((*VirtualVmxnet)(nil)).Elem() -} - -func (b *VirtualVmxnetOption) GetVirtualVmxnetOption() *VirtualVmxnetOption { return b } - -type BaseVirtualVmxnetOption interface { - GetVirtualVmxnetOption() *VirtualVmxnetOption -} - -func init() { - t["BaseVirtualVmxnetOption"] = reflect.TypeOf((*VirtualVmxnetOption)(nil)).Elem() -} - -func (b *VmCloneEvent) GetVmCloneEvent() *VmCloneEvent { return b } - -type BaseVmCloneEvent interface { - GetVmCloneEvent() *VmCloneEvent -} - -func init() { - t["BaseVmCloneEvent"] = reflect.TypeOf((*VmCloneEvent)(nil)).Elem() -} - -func (b *VmConfigFault) GetVmConfigFault() *VmConfigFault { return b } - -type BaseVmConfigFault interface { - GetVmConfigFault() *VmConfigFault -} - -func init() { - t["BaseVmConfigFault"] = reflect.TypeOf((*VmConfigFault)(nil)).Elem() -} - -func (b *VmConfigFileInfo) GetVmConfigFileInfo() *VmConfigFileInfo { return b } - -type BaseVmConfigFileInfo interface { - GetVmConfigFileInfo() *VmConfigFileInfo -} - -func init() { - t["BaseVmConfigFileInfo"] = reflect.TypeOf((*VmConfigFileInfo)(nil)).Elem() -} - -func (b *VmConfigFileQuery) GetVmConfigFileQuery() *VmConfigFileQuery { return b } - -type BaseVmConfigFileQuery interface { - GetVmConfigFileQuery() *VmConfigFileQuery -} - -func init() { - t["BaseVmConfigFileQuery"] = reflect.TypeOf((*VmConfigFileQuery)(nil)).Elem() -} - -func (b *VmConfigInfo) GetVmConfigInfo() *VmConfigInfo { return b } - -type BaseVmConfigInfo interface { - GetVmConfigInfo() *VmConfigInfo -} - -func init() { - t["BaseVmConfigInfo"] = reflect.TypeOf((*VmConfigInfo)(nil)).Elem() -} - -func (b *VmConfigSpec) GetVmConfigSpec() *VmConfigSpec { return b } - -type BaseVmConfigSpec interface { - GetVmConfigSpec() *VmConfigSpec -} - -func init() { - t["BaseVmConfigSpec"] = reflect.TypeOf((*VmConfigSpec)(nil)).Elem() -} - -func (b *VmDasBeingResetEvent) GetVmDasBeingResetEvent() *VmDasBeingResetEvent { return b } - -type BaseVmDasBeingResetEvent interface { - GetVmDasBeingResetEvent() *VmDasBeingResetEvent -} - -func init() { - t["BaseVmDasBeingResetEvent"] = reflect.TypeOf((*VmDasBeingResetEvent)(nil)).Elem() -} - -func (b *VmEvent) GetVmEvent() *VmEvent { return b } - -type BaseVmEvent interface { - GetVmEvent() *VmEvent -} - -func init() { - t["BaseVmEvent"] = reflect.TypeOf((*VmEvent)(nil)).Elem() -} - -func (b *VmFaultToleranceIssue) GetVmFaultToleranceIssue() *VmFaultToleranceIssue { return b } - -type BaseVmFaultToleranceIssue interface { - GetVmFaultToleranceIssue() *VmFaultToleranceIssue -} - -func init() { - t["BaseVmFaultToleranceIssue"] = reflect.TypeOf((*VmFaultToleranceIssue)(nil)).Elem() -} - -func (b *VmMigratedEvent) GetVmMigratedEvent() *VmMigratedEvent { return b } - -type BaseVmMigratedEvent interface { - GetVmMigratedEvent() *VmMigratedEvent -} - -func init() { - t["BaseVmMigratedEvent"] = reflect.TypeOf((*VmMigratedEvent)(nil)).Elem() -} - -func (b *VmPoweredOffEvent) GetVmPoweredOffEvent() *VmPoweredOffEvent { return b } - -type BaseVmPoweredOffEvent interface { - GetVmPoweredOffEvent() *VmPoweredOffEvent -} - -func init() { - t["BaseVmPoweredOffEvent"] = reflect.TypeOf((*VmPoweredOffEvent)(nil)).Elem() -} - -func (b *VmPoweredOnEvent) GetVmPoweredOnEvent() *VmPoweredOnEvent { return b } - -type BaseVmPoweredOnEvent interface { - GetVmPoweredOnEvent() *VmPoweredOnEvent -} - -func init() { - t["BaseVmPoweredOnEvent"] = reflect.TypeOf((*VmPoweredOnEvent)(nil)).Elem() -} - -func (b *VmRelocateSpecEvent) GetVmRelocateSpecEvent() *VmRelocateSpecEvent { return b } - -type BaseVmRelocateSpecEvent interface { - GetVmRelocateSpecEvent() *VmRelocateSpecEvent -} - -func init() { - t["BaseVmRelocateSpecEvent"] = reflect.TypeOf((*VmRelocateSpecEvent)(nil)).Elem() -} - -func (b *VmStartingEvent) GetVmStartingEvent() *VmStartingEvent { return b } - -type BaseVmStartingEvent interface { - GetVmStartingEvent() *VmStartingEvent -} - -func init() { - t["BaseVmStartingEvent"] = reflect.TypeOf((*VmStartingEvent)(nil)).Elem() -} - -func (b *VmToolsUpgradeFault) GetVmToolsUpgradeFault() *VmToolsUpgradeFault { return b } - -type BaseVmToolsUpgradeFault interface { - GetVmToolsUpgradeFault() *VmToolsUpgradeFault -} - -func init() { - t["BaseVmToolsUpgradeFault"] = reflect.TypeOf((*VmToolsUpgradeFault)(nil)).Elem() -} - -func (b *VmfsDatastoreBaseOption) GetVmfsDatastoreBaseOption() *VmfsDatastoreBaseOption { return b } - -type BaseVmfsDatastoreBaseOption interface { - GetVmfsDatastoreBaseOption() *VmfsDatastoreBaseOption -} - -func init() { - t["BaseVmfsDatastoreBaseOption"] = reflect.TypeOf((*VmfsDatastoreBaseOption)(nil)).Elem() -} - -func (b *VmfsDatastoreSingleExtentOption) GetVmfsDatastoreSingleExtentOption() *VmfsDatastoreSingleExtentOption { - return b -} - -type BaseVmfsDatastoreSingleExtentOption interface { - GetVmfsDatastoreSingleExtentOption() *VmfsDatastoreSingleExtentOption -} - -func init() { - t["BaseVmfsDatastoreSingleExtentOption"] = reflect.TypeOf((*VmfsDatastoreSingleExtentOption)(nil)).Elem() -} - -func (b *VmfsDatastoreSpec) GetVmfsDatastoreSpec() *VmfsDatastoreSpec { return b } - -type BaseVmfsDatastoreSpec interface { - GetVmfsDatastoreSpec() *VmfsDatastoreSpec -} - -func init() { - t["BaseVmfsDatastoreSpec"] = reflect.TypeOf((*VmfsDatastoreSpec)(nil)).Elem() -} - -func (b *VmfsMountFault) GetVmfsMountFault() *VmfsMountFault { return b } - -type BaseVmfsMountFault interface { - GetVmfsMountFault() *VmfsMountFault -} - -func init() { - t["BaseVmfsMountFault"] = reflect.TypeOf((*VmfsMountFault)(nil)).Elem() -} - -func (b *VmwareDistributedVirtualSwitchVlanSpec) GetVmwareDistributedVirtualSwitchVlanSpec() *VmwareDistributedVirtualSwitchVlanSpec { - return b -} - -type BaseVmwareDistributedVirtualSwitchVlanSpec interface { - GetVmwareDistributedVirtualSwitchVlanSpec() *VmwareDistributedVirtualSwitchVlanSpec -} - -func init() { - t["BaseVmwareDistributedVirtualSwitchVlanSpec"] = reflect.TypeOf((*VmwareDistributedVirtualSwitchVlanSpec)(nil)).Elem() -} - -func (b *VsanDiskFault) GetVsanDiskFault() *VsanDiskFault { return b } - -type BaseVsanDiskFault interface { - GetVsanDiskFault() *VsanDiskFault -} - -func init() { - t["BaseVsanDiskFault"] = reflect.TypeOf((*VsanDiskFault)(nil)).Elem() -} - -func (b *VsanFault) GetVsanFault() *VsanFault { return b } - -type BaseVsanFault interface { - GetVsanFault() *VsanFault -} - -func init() { - t["BaseVsanFault"] = reflect.TypeOf((*VsanFault)(nil)).Elem() -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/vim25/types/internal.go juju-core-2.0.2/src/github.com/juju/govmomi/vim25/types/internal.go --- juju-core-2.0.0/src/github.com/juju/govmomi/vim25/types/internal.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/vim25/types/internal.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,262 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package types - -import "reflect" - -type DynamicTypeMgrQueryMoInstances struct { - This ManagedObjectReference `xml:"_this"` - FilterSpec BaseDynamicTypeMgrFilterSpec `xml:"filterSpec,omitempty,typeattr"` -} - -type DynamicTypeMgrQueryMoInstancesResponse struct { - Returnval []DynamicTypeMgrMoInstance `xml:"urn:vim25 returnval"` -} - -type DynamicTypeEnumTypeInfo struct { - DynamicData - - Name string `xml:"name"` - WsdlName string `xml:"wsdlName"` - Version string `xml:"version"` - Value []string `xml:"value,omitempty"` - Annotation []DynamicTypeMgrAnnotation `xml:"annotation,omitempty"` -} - -func init() { - t["DynamicTypeEnumTypeInfo"] = reflect.TypeOf((*DynamicTypeEnumTypeInfo)(nil)).Elem() -} - -type DynamicTypeMgrAllTypeInfo struct { - DynamicData - - ManagedTypeInfo []DynamicTypeMgrManagedTypeInfo `xml:"managedTypeInfo,omitempty"` - EnumTypeInfo []DynamicTypeEnumTypeInfo `xml:"enumTypeInfo,omitempty"` - DataTypeInfo []DynamicTypeMgrDataTypeInfo `xml:"dataTypeInfo,omitempty"` -} - -func init() { - t["DynamicTypeMgrAllTypeInfo"] = reflect.TypeOf((*DynamicTypeMgrAllTypeInfo)(nil)).Elem() -} - -type DynamicTypeMgrAnnotation struct { - DynamicData - - Name string `xml:"name"` - Parameter []string `xml:"parameter,omitempty"` -} - -func init() { - t["DynamicTypeMgrAnnotation"] = reflect.TypeOf((*DynamicTypeMgrAnnotation)(nil)).Elem() -} - -type DynamicTypeMgrDataTypeInfo struct { - DynamicData - - Name string `xml:"name"` - WsdlName string `xml:"wsdlName"` - Version string `xml:"version"` - Base []string `xml:"base,omitempty"` - Property []DynamicTypeMgrPropertyTypeInfo `xml:"property,omitempty"` - Annotation []DynamicTypeMgrAnnotation `xml:"annotation,omitempty"` -} - -func init() { - t["DynamicTypeMgrDataTypeInfo"] = reflect.TypeOf((*DynamicTypeMgrDataTypeInfo)(nil)).Elem() -} - -func (b *DynamicTypeMgrFilterSpec) GetDynamicTypeMgrFilterSpec() *DynamicTypeMgrFilterSpec { return b } - -type BaseDynamicTypeMgrFilterSpec interface { - GetDynamicTypeMgrFilterSpec() *DynamicTypeMgrFilterSpec -} - -type DynamicTypeMgrFilterSpec struct { - DynamicData -} - -func init() { - t["DynamicTypeMgrFilterSpec"] = reflect.TypeOf((*DynamicTypeMgrFilterSpec)(nil)).Elem() -} - -type DynamicTypeMgrManagedTypeInfo struct { - DynamicData - - Name string `xml:"name"` - WsdlName string `xml:"wsdlName"` - Version string `xml:"version"` - Base []string `xml:"base,omitempty"` - Property []DynamicTypeMgrPropertyTypeInfo `xml:"property,omitempty"` - Method []DynamicTypeMgrMethodTypeInfo `xml:"method,omitempty"` - Annotation []DynamicTypeMgrAnnotation `xml:"annotation,omitempty"` -} - -func init() { - t["DynamicTypeMgrManagedTypeInfo"] = reflect.TypeOf((*DynamicTypeMgrManagedTypeInfo)(nil)).Elem() -} - -type DynamicTypeMgrMethodTypeInfo struct { - DynamicData - - Name string `xml:"name"` - WsdlName string `xml:"wsdlName"` - Version string `xml:"version"` - ParamTypeInfo []DynamicTypeMgrParamTypeInfo `xml:"paramTypeInfo,omitempty"` - ReturnTypeInfo *DynamicTypeMgrParamTypeInfo `xml:"returnTypeInfo,omitempty"` - Fault []string `xml:"fault,omitempty"` - PrivId string `xml:"privId,omitempty"` - Annotation []DynamicTypeMgrAnnotation `xml:"annotation,omitempty"` -} - -func init() { - t["DynamicTypeMgrMethodTypeInfo"] = reflect.TypeOf((*DynamicTypeMgrMethodTypeInfo)(nil)).Elem() -} - -type DynamicTypeMgrMoFilterSpec struct { - DynamicTypeMgrFilterSpec - - Id string `xml:"id,omitempty"` - TypeSubstr string `xml:"typeSubstr,omitempty"` -} - -func init() { - t["DynamicTypeMgrMoFilterSpec"] = reflect.TypeOf((*DynamicTypeMgrMoFilterSpec)(nil)).Elem() -} - -type DynamicTypeMgrMoInstance struct { - DynamicData - - Id string `xml:"id"` - MoType string `xml:"moType"` -} - -func init() { - t["DynamicTypeMgrMoInstance"] = reflect.TypeOf((*DynamicTypeMgrMoInstance)(nil)).Elem() -} - -type DynamicTypeMgrParamTypeInfo struct { - DynamicData - - Name string `xml:"name"` - Version string `xml:"version"` - Type string `xml:"type"` - PrivId string `xml:"privId,omitempty"` - Annotation []DynamicTypeMgrAnnotation `xml:"annotation,omitempty"` -} - -func init() { - t["DynamicTypeMgrParamTypeInfo"] = reflect.TypeOf((*DynamicTypeMgrParamTypeInfo)(nil)).Elem() -} - -type DynamicTypeMgrPropertyTypeInfo struct { - DynamicData - - Name string `xml:"name"` - Version string `xml:"version"` - Type string `xml:"type"` - PrivId string `xml:"privId,omitempty"` - MsgIdFormat string `xml:"msgIdFormat,omitempty"` - Annotation []DynamicTypeMgrAnnotation `xml:"annotation,omitempty"` -} - -type DynamicTypeMgrQueryTypeInfo struct { - This ManagedObjectReference `xml:"_this"` - FilterSpec BaseDynamicTypeMgrFilterSpec `xml:"filterSpec,omitempty,typeattr"` -} - -type DynamicTypeMgrQueryTypeInfoResponse struct { - Returnval DynamicTypeMgrAllTypeInfo `xml:"urn:vim25 returnval"` -} - -func init() { - t["DynamicTypeMgrPropertyTypeInfo"] = reflect.TypeOf((*DynamicTypeMgrPropertyTypeInfo)(nil)).Elem() -} - -type DynamicTypeMgrTypeFilterSpec struct { - DynamicTypeMgrFilterSpec - - TypeSubstr string `xml:"typeSubstr,omitempty"` -} - -func init() { - t["DynamicTypeMgrTypeFilterSpec"] = reflect.TypeOf((*DynamicTypeMgrTypeFilterSpec)(nil)).Elem() -} - -type ReflectManagedMethodExecuterSoapArgument struct { - DynamicData - - Name string `xml:"name"` - Val string `xml:"val"` -} - -func init() { - t["ReflectManagedMethodExecuterSoapArgument"] = reflect.TypeOf((*ReflectManagedMethodExecuterSoapArgument)(nil)).Elem() -} - -type ReflectManagedMethodExecuterSoapFault struct { - DynamicData - - FaultMsg string `xml:"faultMsg"` - FaultDetail string `xml:"faultDetail,omitempty"` -} - -func init() { - t["ReflectManagedMethodExecuterSoapFault"] = reflect.TypeOf((*ReflectManagedMethodExecuterSoapFault)(nil)).Elem() -} - -type ReflectManagedMethodExecuterSoapResult struct { - DynamicData - - Response string `xml:"response,omitempty"` - Fault *ReflectManagedMethodExecuterSoapFault `xml:"fault,omitempty"` -} - -type RetrieveDynamicTypeManager struct { - This ManagedObjectReference `xml:"_this"` -} - -type RetrieveDynamicTypeManagerResponse struct { - Returnval *InternalDynamicTypeManager `xml:"urn:vim25 returnval"` -} - -type RetrieveManagedMethodExecuter struct { - This ManagedObjectReference `xml:"_this"` -} - -type RetrieveManagedMethodExecuterResponse struct { - Returnval *ReflectManagedMethodExecuter `xml:"urn:vim25 returnval"` -} - -type InternalDynamicTypeManager struct { - ManagedObjectReference -} - -type ReflectManagedMethodExecuter struct { - ManagedObjectReference -} - -type ExecuteSoap struct { - This ManagedObjectReference `xml:"_this"` - Moid string `xml:"moid"` - Version string `xml:"version"` - Method string `xml:"method"` - Argument []ReflectManagedMethodExecuterSoapArgument `xml:"argument,omitempty"` -} - -type ExecuteSoapResponse struct { - Returnval *ReflectManagedMethodExecuterSoapResult `xml:"urn:vim25 returnval"` -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/vim25/types/registry.go juju-core-2.0.2/src/github.com/juju/govmomi/vim25/types/registry.go --- juju-core-2.0.0/src/github.com/juju/govmomi/vim25/types/registry.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/vim25/types/registry.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,30 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package types - -import "reflect" - -var t = map[string]reflect.Type{} - -type Func func(string) (reflect.Type, bool) - -func TypeFunc() Func { - return func(name string) (reflect.Type, bool) { - typ, ok := t[name] - return typ, ok - } -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/vim25/types/registry_test.go juju-core-2.0.2/src/github.com/juju/govmomi/vim25/types/registry_test.go --- juju-core-2.0.0/src/github.com/juju/govmomi/vim25/types/registry_test.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/vim25/types/registry_test.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,43 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package types - -import ( - "reflect" - "testing" -) - -func TestTypeFunc(t *testing.T) { - var ok bool - - fn := TypeFunc() - - _, ok = fn("unknown") - if ok { - t.Errorf("Expected ok==false") - } - - actual, ok := fn("UserProfile") - if !ok { - t.Errorf("Expected ok==true") - } - - expected := reflect.TypeOf(UserProfile{}) - if !reflect.DeepEqual(expected, actual) { - t.Errorf("Expected: %#v, actual: %#v", expected, actual) - } -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/vim25/types/types.go juju-core-2.0.2/src/github.com/juju/govmomi/vim25/types/types.go --- juju-core-2.0.0/src/github.com/juju/govmomi/vim25/types/types.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/vim25/types/types.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,44837 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package types - -import ( - "reflect" - "time" -) - -type AboutInfo struct { - DynamicData - - Name string `xml:"name"` - FullName string `xml:"fullName"` - Vendor string `xml:"vendor"` - Version string `xml:"version"` - Build string `xml:"build"` - LocaleVersion string `xml:"localeVersion,omitempty"` - LocaleBuild string `xml:"localeBuild,omitempty"` - OsType string `xml:"osType"` - ProductLineId string `xml:"productLineId"` - ApiType string `xml:"apiType"` - ApiVersion string `xml:"apiVersion"` - InstanceUuid string `xml:"instanceUuid,omitempty"` - LicenseProductName string `xml:"licenseProductName,omitempty"` - LicenseProductVersion string `xml:"licenseProductVersion,omitempty"` -} - -func init() { - t["AboutInfo"] = reflect.TypeOf((*AboutInfo)(nil)).Elem() -} - -type AccountCreatedEvent struct { - HostEvent - - Spec BaseHostAccountSpec `xml:"spec,typeattr"` - Group bool `xml:"group"` -} - -func init() { - t["AccountCreatedEvent"] = reflect.TypeOf((*AccountCreatedEvent)(nil)).Elem() -} - -type AccountRemovedEvent struct { - HostEvent - - Account string `xml:"account"` - Group bool `xml:"group"` -} - -func init() { - t["AccountRemovedEvent"] = reflect.TypeOf((*AccountRemovedEvent)(nil)).Elem() -} - -type AccountUpdatedEvent struct { - HostEvent - - Spec BaseHostAccountSpec `xml:"spec,typeattr"` - Group bool `xml:"group"` -} - -func init() { - t["AccountUpdatedEvent"] = reflect.TypeOf((*AccountUpdatedEvent)(nil)).Elem() -} - -type AcknowledgeAlarm AcknowledgeAlarmRequestType - -func init() { - t["AcknowledgeAlarm"] = reflect.TypeOf((*AcknowledgeAlarm)(nil)).Elem() -} - -type AcknowledgeAlarmRequestType struct { - This ManagedObjectReference `xml:"_this"` - Alarm ManagedObjectReference `xml:"alarm"` - Entity ManagedObjectReference `xml:"entity"` -} - -func init() { - t["AcknowledgeAlarmRequestType"] = reflect.TypeOf((*AcknowledgeAlarmRequestType)(nil)).Elem() -} - -type AcknowledgeAlarmResponse struct { -} - -type AcquireCimServicesTicket AcquireCimServicesTicketRequestType - -func init() { - t["AcquireCimServicesTicket"] = reflect.TypeOf((*AcquireCimServicesTicket)(nil)).Elem() -} - -type AcquireCimServicesTicketRequestType struct { - This ManagedObjectReference `xml:"_this"` -} - -func init() { - t["AcquireCimServicesTicketRequestType"] = reflect.TypeOf((*AcquireCimServicesTicketRequestType)(nil)).Elem() -} - -type AcquireCimServicesTicketResponse struct { - Returnval HostServiceTicket `xml:"returnval"` -} - -type AcquireCloneTicket AcquireCloneTicketRequestType - -func init() { - t["AcquireCloneTicket"] = reflect.TypeOf((*AcquireCloneTicket)(nil)).Elem() -} - -type AcquireCloneTicketRequestType struct { - This ManagedObjectReference `xml:"_this"` -} - -func init() { - t["AcquireCloneTicketRequestType"] = reflect.TypeOf((*AcquireCloneTicketRequestType)(nil)).Elem() -} - -type AcquireCloneTicketResponse struct { - Returnval string `xml:"returnval"` -} - -type AcquireCredentialsInGuest AcquireCredentialsInGuestRequestType - -func init() { - t["AcquireCredentialsInGuest"] = reflect.TypeOf((*AcquireCredentialsInGuest)(nil)).Elem() -} - -type AcquireCredentialsInGuestRequestType struct { - This ManagedObjectReference `xml:"_this"` - Vm ManagedObjectReference `xml:"vm"` - RequestedAuth BaseGuestAuthentication `xml:"requestedAuth,typeattr"` - SessionID int64 `xml:"sessionID,omitempty"` -} - -func init() { - t["AcquireCredentialsInGuestRequestType"] = reflect.TypeOf((*AcquireCredentialsInGuestRequestType)(nil)).Elem() -} - -type AcquireCredentialsInGuestResponse struct { - Returnval BaseGuestAuthentication `xml:"returnval,typeattr"` -} - -type AcquireGenericServiceTicket AcquireGenericServiceTicketRequestType - -func init() { - t["AcquireGenericServiceTicket"] = reflect.TypeOf((*AcquireGenericServiceTicket)(nil)).Elem() -} - -type AcquireGenericServiceTicketRequestType struct { - This ManagedObjectReference `xml:"_this"` - Spec BaseSessionManagerServiceRequestSpec `xml:"spec,typeattr"` -} - -func init() { - t["AcquireGenericServiceTicketRequestType"] = reflect.TypeOf((*AcquireGenericServiceTicketRequestType)(nil)).Elem() -} - -type AcquireGenericServiceTicketResponse struct { - Returnval SessionManagerGenericServiceTicket `xml:"returnval"` -} - -type AcquireLocalTicket AcquireLocalTicketRequestType - -func init() { - t["AcquireLocalTicket"] = reflect.TypeOf((*AcquireLocalTicket)(nil)).Elem() -} - -type AcquireLocalTicketRequestType struct { - This ManagedObjectReference `xml:"_this"` - UserName string `xml:"userName"` -} - -func init() { - t["AcquireLocalTicketRequestType"] = reflect.TypeOf((*AcquireLocalTicketRequestType)(nil)).Elem() -} - -type AcquireLocalTicketResponse struct { - Returnval SessionManagerLocalTicket `xml:"returnval"` -} - -type AcquireMksTicket AcquireMksTicketRequestType - -func init() { - t["AcquireMksTicket"] = reflect.TypeOf((*AcquireMksTicket)(nil)).Elem() -} - -type AcquireMksTicketRequestType struct { - This ManagedObjectReference `xml:"_this"` -} - -func init() { - t["AcquireMksTicketRequestType"] = reflect.TypeOf((*AcquireMksTicketRequestType)(nil)).Elem() -} - -type AcquireMksTicketResponse struct { - Returnval VirtualMachineMksTicket `xml:"returnval"` -} - -type AcquireTicket AcquireTicketRequestType - -func init() { - t["AcquireTicket"] = reflect.TypeOf((*AcquireTicket)(nil)).Elem() -} - -type AcquireTicketRequestType struct { - This ManagedObjectReference `xml:"_this"` - TicketType string `xml:"ticketType"` -} - -func init() { - t["AcquireTicketRequestType"] = reflect.TypeOf((*AcquireTicketRequestType)(nil)).Elem() -} - -type AcquireTicketResponse struct { - Returnval VirtualMachineTicket `xml:"returnval"` -} - -type Action struct { - DynamicData -} - -func init() { - t["Action"] = reflect.TypeOf((*Action)(nil)).Elem() -} - -type ActiveDirectoryFault struct { - VimFault - - ErrorCode int `xml:"errorCode,omitempty"` -} - -func init() { - t["ActiveDirectoryFault"] = reflect.TypeOf((*ActiveDirectoryFault)(nil)).Elem() -} - -type ActiveDirectoryFaultFault BaseActiveDirectoryFault - -func init() { - t["ActiveDirectoryFaultFault"] = reflect.TypeOf((*ActiveDirectoryFaultFault)(nil)).Elem() -} - -type ActiveDirectoryProfile struct { - ApplyProfile -} - -func init() { - t["ActiveDirectoryProfile"] = reflect.TypeOf((*ActiveDirectoryProfile)(nil)).Elem() -} - -type AddAuthorizationRole AddAuthorizationRoleRequestType - -func init() { - t["AddAuthorizationRole"] = reflect.TypeOf((*AddAuthorizationRole)(nil)).Elem() -} - -type AddAuthorizationRoleRequestType struct { - This ManagedObjectReference `xml:"_this"` - Name string `xml:"name"` - PrivIds []string `xml:"privIds,omitempty"` -} - -func init() { - t["AddAuthorizationRoleRequestType"] = reflect.TypeOf((*AddAuthorizationRoleRequestType)(nil)).Elem() -} - -type AddAuthorizationRoleResponse struct { - Returnval int `xml:"returnval"` -} - -type AddCustomFieldDef AddCustomFieldDefRequestType - -func init() { - t["AddCustomFieldDef"] = reflect.TypeOf((*AddCustomFieldDef)(nil)).Elem() -} - -type AddCustomFieldDefRequestType struct { - This ManagedObjectReference `xml:"_this"` - Name string `xml:"name"` - MoType string `xml:"moType,omitempty"` - FieldDefPolicy *PrivilegePolicyDef `xml:"fieldDefPolicy,omitempty"` - FieldPolicy *PrivilegePolicyDef `xml:"fieldPolicy,omitempty"` -} - -func init() { - t["AddCustomFieldDefRequestType"] = reflect.TypeOf((*AddCustomFieldDefRequestType)(nil)).Elem() -} - -type AddCustomFieldDefResponse struct { - Returnval CustomFieldDef `xml:"returnval"` -} - -type AddDVPortgroupRequestType struct { - This ManagedObjectReference `xml:"_this"` - Spec []DVPortgroupConfigSpec `xml:"spec"` -} - -func init() { - t["AddDVPortgroupRequestType"] = reflect.TypeOf((*AddDVPortgroupRequestType)(nil)).Elem() -} - -type AddDVPortgroup_Task AddDVPortgroupRequestType - -func init() { - t["AddDVPortgroup_Task"] = reflect.TypeOf((*AddDVPortgroup_Task)(nil)).Elem() -} - -type AddDVPortgroup_TaskResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type AddDisksRequestType struct { - This ManagedObjectReference `xml:"_this"` - Disk []HostScsiDisk `xml:"disk"` -} - -func init() { - t["AddDisksRequestType"] = reflect.TypeOf((*AddDisksRequestType)(nil)).Elem() -} - -type AddDisks_Task AddDisksRequestType - -func init() { - t["AddDisks_Task"] = reflect.TypeOf((*AddDisks_Task)(nil)).Elem() -} - -type AddDisks_TaskResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type AddHostRequestType struct { - This ManagedObjectReference `xml:"_this"` - Spec HostConnectSpec `xml:"spec"` - AsConnected bool `xml:"asConnected"` - ResourcePool *ManagedObjectReference `xml:"resourcePool,omitempty"` - License string `xml:"license,omitempty"` -} - -func init() { - t["AddHostRequestType"] = reflect.TypeOf((*AddHostRequestType)(nil)).Elem() -} - -type AddHost_Task AddHostRequestType - -func init() { - t["AddHost_Task"] = reflect.TypeOf((*AddHost_Task)(nil)).Elem() -} - -type AddHost_TaskResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type AddInternetScsiSendTargets AddInternetScsiSendTargetsRequestType - -func init() { - t["AddInternetScsiSendTargets"] = reflect.TypeOf((*AddInternetScsiSendTargets)(nil)).Elem() -} - -type AddInternetScsiSendTargetsRequestType struct { - This ManagedObjectReference `xml:"_this"` - IScsiHbaDevice string `xml:"iScsiHbaDevice"` - Targets []HostInternetScsiHbaSendTarget `xml:"targets"` -} - -func init() { - t["AddInternetScsiSendTargetsRequestType"] = reflect.TypeOf((*AddInternetScsiSendTargetsRequestType)(nil)).Elem() -} - -type AddInternetScsiSendTargetsResponse struct { -} - -type AddInternetScsiStaticTargets AddInternetScsiStaticTargetsRequestType - -func init() { - t["AddInternetScsiStaticTargets"] = reflect.TypeOf((*AddInternetScsiStaticTargets)(nil)).Elem() -} - -type AddInternetScsiStaticTargetsRequestType struct { - This ManagedObjectReference `xml:"_this"` - IScsiHbaDevice string `xml:"iScsiHbaDevice"` - Targets []HostInternetScsiHbaStaticTarget `xml:"targets"` -} - -func init() { - t["AddInternetScsiStaticTargetsRequestType"] = reflect.TypeOf((*AddInternetScsiStaticTargetsRequestType)(nil)).Elem() -} - -type AddInternetScsiStaticTargetsResponse struct { -} - -type AddLicense AddLicenseRequestType - -func init() { - t["AddLicense"] = reflect.TypeOf((*AddLicense)(nil)).Elem() -} - -type AddLicenseRequestType struct { - This ManagedObjectReference `xml:"_this"` - LicenseKey string `xml:"licenseKey"` - Labels []KeyValue `xml:"labels,omitempty"` -} - -func init() { - t["AddLicenseRequestType"] = reflect.TypeOf((*AddLicenseRequestType)(nil)).Elem() -} - -type AddLicenseResponse struct { - Returnval LicenseManagerLicenseInfo `xml:"returnval"` -} - -type AddNetworkResourcePool AddNetworkResourcePoolRequestType - -func init() { - t["AddNetworkResourcePool"] = reflect.TypeOf((*AddNetworkResourcePool)(nil)).Elem() -} - -type AddNetworkResourcePoolRequestType struct { - This ManagedObjectReference `xml:"_this"` - ConfigSpec []DVSNetworkResourcePoolConfigSpec `xml:"configSpec"` -} - -func init() { - t["AddNetworkResourcePoolRequestType"] = reflect.TypeOf((*AddNetworkResourcePoolRequestType)(nil)).Elem() -} - -type AddNetworkResourcePoolResponse struct { -} - -type AddPortGroup AddPortGroupRequestType - -func init() { - t["AddPortGroup"] = reflect.TypeOf((*AddPortGroup)(nil)).Elem() -} - -type AddPortGroupRequestType struct { - This ManagedObjectReference `xml:"_this"` - Portgrp HostPortGroupSpec `xml:"portgrp"` -} - -func init() { - t["AddPortGroupRequestType"] = reflect.TypeOf((*AddPortGroupRequestType)(nil)).Elem() -} - -type AddPortGroupResponse struct { -} - -type AddServiceConsoleVirtualNic AddServiceConsoleVirtualNicRequestType - -func init() { - t["AddServiceConsoleVirtualNic"] = reflect.TypeOf((*AddServiceConsoleVirtualNic)(nil)).Elem() -} - -type AddServiceConsoleVirtualNicRequestType struct { - This ManagedObjectReference `xml:"_this"` - Portgroup string `xml:"portgroup"` - Nic HostVirtualNicSpec `xml:"nic"` -} - -func init() { - t["AddServiceConsoleVirtualNicRequestType"] = reflect.TypeOf((*AddServiceConsoleVirtualNicRequestType)(nil)).Elem() -} - -type AddServiceConsoleVirtualNicResponse struct { - Returnval string `xml:"returnval"` -} - -type AddStandaloneHostRequestType struct { - This ManagedObjectReference `xml:"_this"` - Spec HostConnectSpec `xml:"spec"` - CompResSpec BaseComputeResourceConfigSpec `xml:"compResSpec,omitempty,typeattr"` - AddConnected bool `xml:"addConnected"` - License string `xml:"license,omitempty"` -} - -func init() { - t["AddStandaloneHostRequestType"] = reflect.TypeOf((*AddStandaloneHostRequestType)(nil)).Elem() -} - -type AddStandaloneHost_Task AddStandaloneHostRequestType - -func init() { - t["AddStandaloneHost_Task"] = reflect.TypeOf((*AddStandaloneHost_Task)(nil)).Elem() -} - -type AddStandaloneHost_TaskResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type AddVirtualNic AddVirtualNicRequestType - -func init() { - t["AddVirtualNic"] = reflect.TypeOf((*AddVirtualNic)(nil)).Elem() -} - -type AddVirtualNicRequestType struct { - This ManagedObjectReference `xml:"_this"` - Portgroup string `xml:"portgroup"` - Nic HostVirtualNicSpec `xml:"nic"` -} - -func init() { - t["AddVirtualNicRequestType"] = reflect.TypeOf((*AddVirtualNicRequestType)(nil)).Elem() -} - -type AddVirtualNicResponse struct { - Returnval string `xml:"returnval"` -} - -type AddVirtualSwitch AddVirtualSwitchRequestType - -func init() { - t["AddVirtualSwitch"] = reflect.TypeOf((*AddVirtualSwitch)(nil)).Elem() -} - -type AddVirtualSwitchRequestType struct { - This ManagedObjectReference `xml:"_this"` - VswitchName string `xml:"vswitchName"` - Spec *HostVirtualSwitchSpec `xml:"spec,omitempty"` -} - -func init() { - t["AddVirtualSwitchRequestType"] = reflect.TypeOf((*AddVirtualSwitchRequestType)(nil)).Elem() -} - -type AddVirtualSwitchResponse struct { -} - -type AdminDisabled struct { - HostConfigFault -} - -func init() { - t["AdminDisabled"] = reflect.TypeOf((*AdminDisabled)(nil)).Elem() -} - -type AdminDisabledFault AdminDisabled - -func init() { - t["AdminDisabledFault"] = reflect.TypeOf((*AdminDisabledFault)(nil)).Elem() -} - -type AdminNotDisabled struct { - HostConfigFault -} - -func init() { - t["AdminNotDisabled"] = reflect.TypeOf((*AdminNotDisabled)(nil)).Elem() -} - -type AdminNotDisabledFault AdminNotDisabled - -func init() { - t["AdminNotDisabledFault"] = reflect.TypeOf((*AdminNotDisabledFault)(nil)).Elem() -} - -type AdminPasswordNotChangedEvent struct { - HostEvent -} - -func init() { - t["AdminPasswordNotChangedEvent"] = reflect.TypeOf((*AdminPasswordNotChangedEvent)(nil)).Elem() -} - -type AffinityConfigured struct { - MigrationFault - - ConfiguredAffinity []string `xml:"configuredAffinity"` -} - -func init() { - t["AffinityConfigured"] = reflect.TypeOf((*AffinityConfigured)(nil)).Elem() -} - -type AffinityConfiguredFault AffinityConfigured - -func init() { - t["AffinityConfiguredFault"] = reflect.TypeOf((*AffinityConfiguredFault)(nil)).Elem() -} - -type AfterStartupTaskScheduler struct { - TaskScheduler - - Minute int `xml:"minute"` -} - -func init() { - t["AfterStartupTaskScheduler"] = reflect.TypeOf((*AfterStartupTaskScheduler)(nil)).Elem() -} - -type AgentInstallFailed struct { - HostConnectFault - - Reason string `xml:"reason,omitempty"` - StatusCode int `xml:"statusCode,omitempty"` - InstallerOutput string `xml:"installerOutput,omitempty"` -} - -func init() { - t["AgentInstallFailed"] = reflect.TypeOf((*AgentInstallFailed)(nil)).Elem() -} - -type AgentInstallFailedFault AgentInstallFailed - -func init() { - t["AgentInstallFailedFault"] = reflect.TypeOf((*AgentInstallFailedFault)(nil)).Elem() -} - -type AlarmAcknowledgedEvent struct { - AlarmEvent - - Source ManagedEntityEventArgument `xml:"source"` - Entity ManagedEntityEventArgument `xml:"entity"` -} - -func init() { - t["AlarmAcknowledgedEvent"] = reflect.TypeOf((*AlarmAcknowledgedEvent)(nil)).Elem() -} - -type AlarmAction struct { - DynamicData -} - -func init() { - t["AlarmAction"] = reflect.TypeOf((*AlarmAction)(nil)).Elem() -} - -type AlarmActionTriggeredEvent struct { - AlarmEvent - - Source ManagedEntityEventArgument `xml:"source"` - Entity ManagedEntityEventArgument `xml:"entity"` -} - -func init() { - t["AlarmActionTriggeredEvent"] = reflect.TypeOf((*AlarmActionTriggeredEvent)(nil)).Elem() -} - -type AlarmClearedEvent struct { - AlarmEvent - - Source ManagedEntityEventArgument `xml:"source"` - Entity ManagedEntityEventArgument `xml:"entity"` - From string `xml:"from"` -} - -func init() { - t["AlarmClearedEvent"] = reflect.TypeOf((*AlarmClearedEvent)(nil)).Elem() -} - -type AlarmCreatedEvent struct { - AlarmEvent - - Entity ManagedEntityEventArgument `xml:"entity"` -} - -func init() { - t["AlarmCreatedEvent"] = reflect.TypeOf((*AlarmCreatedEvent)(nil)).Elem() -} - -type AlarmDescription struct { - DynamicData - - Expr []BaseTypeDescription `xml:"expr,typeattr"` - StateOperator []BaseElementDescription `xml:"stateOperator,typeattr"` - MetricOperator []BaseElementDescription `xml:"metricOperator,typeattr"` - HostSystemConnectionState []BaseElementDescription `xml:"hostSystemConnectionState,typeattr"` - VirtualMachinePowerState []BaseElementDescription `xml:"virtualMachinePowerState,typeattr"` - DatastoreConnectionState []BaseElementDescription `xml:"datastoreConnectionState,omitempty,typeattr"` - HostSystemPowerState []BaseElementDescription `xml:"hostSystemPowerState,omitempty,typeattr"` - VirtualMachineGuestHeartbeatStatus []BaseElementDescription `xml:"virtualMachineGuestHeartbeatStatus,omitempty,typeattr"` - EntityStatus []BaseElementDescription `xml:"entityStatus,typeattr"` - Action []BaseTypeDescription `xml:"action,typeattr"` -} - -func init() { - t["AlarmDescription"] = reflect.TypeOf((*AlarmDescription)(nil)).Elem() -} - -type AlarmEmailCompletedEvent struct { - AlarmEvent - - Entity ManagedEntityEventArgument `xml:"entity"` - To string `xml:"to"` -} - -func init() { - t["AlarmEmailCompletedEvent"] = reflect.TypeOf((*AlarmEmailCompletedEvent)(nil)).Elem() -} - -type AlarmEmailFailedEvent struct { - AlarmEvent - - Entity ManagedEntityEventArgument `xml:"entity"` - To string `xml:"to"` - Reason LocalizedMethodFault `xml:"reason"` -} - -func init() { - t["AlarmEmailFailedEvent"] = reflect.TypeOf((*AlarmEmailFailedEvent)(nil)).Elem() -} - -type AlarmEvent struct { - Event - - Alarm AlarmEventArgument `xml:"alarm"` -} - -func init() { - t["AlarmEvent"] = reflect.TypeOf((*AlarmEvent)(nil)).Elem() -} - -type AlarmEventArgument struct { - EntityEventArgument - - Alarm ManagedObjectReference `xml:"alarm"` -} - -func init() { - t["AlarmEventArgument"] = reflect.TypeOf((*AlarmEventArgument)(nil)).Elem() -} - -type AlarmExpression struct { - DynamicData -} - -func init() { - t["AlarmExpression"] = reflect.TypeOf((*AlarmExpression)(nil)).Elem() -} - -type AlarmInfo struct { - AlarmSpec - - Key string `xml:"key"` - Alarm ManagedObjectReference `xml:"alarm"` - Entity ManagedObjectReference `xml:"entity"` - LastModifiedTime time.Time `xml:"lastModifiedTime"` - LastModifiedUser string `xml:"lastModifiedUser"` - CreationEventId int `xml:"creationEventId"` -} - -func init() { - t["AlarmInfo"] = reflect.TypeOf((*AlarmInfo)(nil)).Elem() -} - -type AlarmReconfiguredEvent struct { - AlarmEvent - - Entity ManagedEntityEventArgument `xml:"entity"` -} - -func init() { - t["AlarmReconfiguredEvent"] = reflect.TypeOf((*AlarmReconfiguredEvent)(nil)).Elem() -} - -type AlarmRemovedEvent struct { - AlarmEvent - - Entity ManagedEntityEventArgument `xml:"entity"` -} - -func init() { - t["AlarmRemovedEvent"] = reflect.TypeOf((*AlarmRemovedEvent)(nil)).Elem() -} - -type AlarmScriptCompleteEvent struct { - AlarmEvent - - Entity ManagedEntityEventArgument `xml:"entity"` - Script string `xml:"script"` -} - -func init() { - t["AlarmScriptCompleteEvent"] = reflect.TypeOf((*AlarmScriptCompleteEvent)(nil)).Elem() -} - -type AlarmScriptFailedEvent struct { - AlarmEvent - - Entity ManagedEntityEventArgument `xml:"entity"` - Script string `xml:"script"` - Reason LocalizedMethodFault `xml:"reason"` -} - -func init() { - t["AlarmScriptFailedEvent"] = reflect.TypeOf((*AlarmScriptFailedEvent)(nil)).Elem() -} - -type AlarmSetting struct { - DynamicData - - ToleranceRange int `xml:"toleranceRange"` - ReportingFrequency int `xml:"reportingFrequency"` -} - -func init() { - t["AlarmSetting"] = reflect.TypeOf((*AlarmSetting)(nil)).Elem() -} - -type AlarmSnmpCompletedEvent struct { - AlarmEvent - - Entity ManagedEntityEventArgument `xml:"entity"` -} - -func init() { - t["AlarmSnmpCompletedEvent"] = reflect.TypeOf((*AlarmSnmpCompletedEvent)(nil)).Elem() -} - -type AlarmSnmpFailedEvent struct { - AlarmEvent - - Entity ManagedEntityEventArgument `xml:"entity"` - Reason LocalizedMethodFault `xml:"reason"` -} - -func init() { - t["AlarmSnmpFailedEvent"] = reflect.TypeOf((*AlarmSnmpFailedEvent)(nil)).Elem() -} - -type AlarmSpec struct { - DynamicData - - Name string `xml:"name"` - SystemName string `xml:"systemName,omitempty"` - Description string `xml:"description"` - Enabled bool `xml:"enabled"` - Expression BaseAlarmExpression `xml:"expression,typeattr"` - Action BaseAlarmAction `xml:"action,omitempty,typeattr"` - ActionFrequency int `xml:"actionFrequency,omitempty"` - Setting *AlarmSetting `xml:"setting,omitempty"` -} - -func init() { - t["AlarmSpec"] = reflect.TypeOf((*AlarmSpec)(nil)).Elem() -} - -type AlarmState struct { - DynamicData - - Key string `xml:"key"` - Entity ManagedObjectReference `xml:"entity"` - Alarm ManagedObjectReference `xml:"alarm"` - OverallStatus ManagedEntityStatus `xml:"overallStatus"` - Time time.Time `xml:"time"` - Acknowledged *bool `xml:"acknowledged"` - AcknowledgedByUser string `xml:"acknowledgedByUser,omitempty"` - AcknowledgedTime *time.Time `xml:"acknowledgedTime"` -} - -func init() { - t["AlarmState"] = reflect.TypeOf((*AlarmState)(nil)).Elem() -} - -type AlarmStatusChangedEvent struct { - AlarmEvent - - Source ManagedEntityEventArgument `xml:"source"` - Entity ManagedEntityEventArgument `xml:"entity"` - From string `xml:"from"` - To string `xml:"to"` -} - -func init() { - t["AlarmStatusChangedEvent"] = reflect.TypeOf((*AlarmStatusChangedEvent)(nil)).Elem() -} - -type AlarmTriggeringAction struct { - AlarmAction - - Action BaseAction `xml:"action,typeattr"` - TransitionSpecs []AlarmTriggeringActionTransitionSpec `xml:"transitionSpecs,omitempty"` - Green2yellow bool `xml:"green2yellow"` - Yellow2red bool `xml:"yellow2red"` - Red2yellow bool `xml:"red2yellow"` - Yellow2green bool `xml:"yellow2green"` -} - -func init() { - t["AlarmTriggeringAction"] = reflect.TypeOf((*AlarmTriggeringAction)(nil)).Elem() -} - -type AlarmTriggeringActionTransitionSpec struct { - DynamicData - - StartState ManagedEntityStatus `xml:"startState"` - FinalState ManagedEntityStatus `xml:"finalState"` - Repeats bool `xml:"repeats"` -} - -func init() { - t["AlarmTriggeringActionTransitionSpec"] = reflect.TypeOf((*AlarmTriggeringActionTransitionSpec)(nil)).Elem() -} - -type AllVirtualMachinesLicensedEvent struct { - LicenseEvent -} - -func init() { - t["AllVirtualMachinesLicensedEvent"] = reflect.TypeOf((*AllVirtualMachinesLicensedEvent)(nil)).Elem() -} - -type AllocateIpv4Address AllocateIpv4AddressRequestType - -func init() { - t["AllocateIpv4Address"] = reflect.TypeOf((*AllocateIpv4Address)(nil)).Elem() -} - -type AllocateIpv4AddressRequestType struct { - This ManagedObjectReference `xml:"_this"` - Dc ManagedObjectReference `xml:"dc"` - PoolId int `xml:"poolId"` - AllocationId string `xml:"allocationId"` -} - -func init() { - t["AllocateIpv4AddressRequestType"] = reflect.TypeOf((*AllocateIpv4AddressRequestType)(nil)).Elem() -} - -type AllocateIpv4AddressResponse struct { - Returnval string `xml:"returnval"` -} - -type AllocateIpv6Address AllocateIpv6AddressRequestType - -func init() { - t["AllocateIpv6Address"] = reflect.TypeOf((*AllocateIpv6Address)(nil)).Elem() -} - -type AllocateIpv6AddressRequestType struct { - This ManagedObjectReference `xml:"_this"` - Dc ManagedObjectReference `xml:"dc"` - PoolId int `xml:"poolId"` - AllocationId string `xml:"allocationId"` -} - -func init() { - t["AllocateIpv6AddressRequestType"] = reflect.TypeOf((*AllocateIpv6AddressRequestType)(nil)).Elem() -} - -type AllocateIpv6AddressResponse struct { - Returnval string `xml:"returnval"` -} - -type AlreadyAuthenticatedSessionEvent struct { - SessionEvent -} - -func init() { - t["AlreadyAuthenticatedSessionEvent"] = reflect.TypeOf((*AlreadyAuthenticatedSessionEvent)(nil)).Elem() -} - -type AlreadyBeingManaged struct { - HostConnectFault - - IpAddress string `xml:"ipAddress"` -} - -func init() { - t["AlreadyBeingManaged"] = reflect.TypeOf((*AlreadyBeingManaged)(nil)).Elem() -} - -type AlreadyBeingManagedFault AlreadyBeingManaged - -func init() { - t["AlreadyBeingManagedFault"] = reflect.TypeOf((*AlreadyBeingManagedFault)(nil)).Elem() -} - -type AlreadyConnected struct { - HostConnectFault - - Name string `xml:"name"` -} - -func init() { - t["AlreadyConnected"] = reflect.TypeOf((*AlreadyConnected)(nil)).Elem() -} - -type AlreadyConnectedFault AlreadyConnected - -func init() { - t["AlreadyConnectedFault"] = reflect.TypeOf((*AlreadyConnectedFault)(nil)).Elem() -} - -type AlreadyExists struct { - VimFault - - Name string `xml:"name,omitempty"` -} - -func init() { - t["AlreadyExists"] = reflect.TypeOf((*AlreadyExists)(nil)).Elem() -} - -type AlreadyExistsFault AlreadyExists - -func init() { - t["AlreadyExistsFault"] = reflect.TypeOf((*AlreadyExistsFault)(nil)).Elem() -} - -type AlreadyUpgraded struct { - VimFault -} - -func init() { - t["AlreadyUpgraded"] = reflect.TypeOf((*AlreadyUpgraded)(nil)).Elem() -} - -type AlreadyUpgradedFault AlreadyUpgraded - -func init() { - t["AlreadyUpgradedFault"] = reflect.TypeOf((*AlreadyUpgradedFault)(nil)).Elem() -} - -type AndAlarmExpression struct { - AlarmExpression - - Expression []BaseAlarmExpression `xml:"expression,typeattr"` -} - -func init() { - t["AndAlarmExpression"] = reflect.TypeOf((*AndAlarmExpression)(nil)).Elem() -} - -type AnswerFile struct { - DynamicData - - UserInput []ProfileDeferredPolicyOptionParameter `xml:"userInput,omitempty"` - CreatedTime time.Time `xml:"createdTime"` - ModifiedTime time.Time `xml:"modifiedTime"` -} - -func init() { - t["AnswerFile"] = reflect.TypeOf((*AnswerFile)(nil)).Elem() -} - -type AnswerFileCreateSpec struct { - DynamicData -} - -func init() { - t["AnswerFileCreateSpec"] = reflect.TypeOf((*AnswerFileCreateSpec)(nil)).Elem() -} - -type AnswerFileOptionsCreateSpec struct { - AnswerFileCreateSpec - - UserInput []ProfileDeferredPolicyOptionParameter `xml:"userInput,omitempty"` -} - -func init() { - t["AnswerFileOptionsCreateSpec"] = reflect.TypeOf((*AnswerFileOptionsCreateSpec)(nil)).Elem() -} - -type AnswerFileSerializedCreateSpec struct { - AnswerFileCreateSpec - - AnswerFileConfigString string `xml:"answerFileConfigString"` -} - -func init() { - t["AnswerFileSerializedCreateSpec"] = reflect.TypeOf((*AnswerFileSerializedCreateSpec)(nil)).Elem() -} - -type AnswerFileStatusError struct { - DynamicData - - UserInputPath ProfilePropertyPath `xml:"userInputPath"` - ErrMsg LocalizableMessage `xml:"errMsg"` -} - -func init() { - t["AnswerFileStatusError"] = reflect.TypeOf((*AnswerFileStatusError)(nil)).Elem() -} - -type AnswerFileStatusResult struct { - DynamicData - - CheckedTime time.Time `xml:"checkedTime"` - Host ManagedObjectReference `xml:"host"` - Status string `xml:"status"` - Error []AnswerFileStatusError `xml:"error,omitempty"` -} - -func init() { - t["AnswerFileStatusResult"] = reflect.TypeOf((*AnswerFileStatusResult)(nil)).Elem() -} - -type AnswerFileUpdateFailed struct { - VimFault - - Failure []AnswerFileUpdateFailure `xml:"failure"` -} - -func init() { - t["AnswerFileUpdateFailed"] = reflect.TypeOf((*AnswerFileUpdateFailed)(nil)).Elem() -} - -type AnswerFileUpdateFailedFault AnswerFileUpdateFailed - -func init() { - t["AnswerFileUpdateFailedFault"] = reflect.TypeOf((*AnswerFileUpdateFailedFault)(nil)).Elem() -} - -type AnswerFileUpdateFailure struct { - DynamicData - - UserInputPath ProfilePropertyPath `xml:"userInputPath"` - ErrMsg LocalizableMessage `xml:"errMsg"` -} - -func init() { - t["AnswerFileUpdateFailure"] = reflect.TypeOf((*AnswerFileUpdateFailure)(nil)).Elem() -} - -type AnswerVM AnswerVMRequestType - -func init() { - t["AnswerVM"] = reflect.TypeOf((*AnswerVM)(nil)).Elem() -} - -type AnswerVMRequestType struct { - This ManagedObjectReference `xml:"_this"` - QuestionId string `xml:"questionId"` - AnswerChoice string `xml:"answerChoice"` -} - -func init() { - t["AnswerVMRequestType"] = reflect.TypeOf((*AnswerVMRequestType)(nil)).Elem() -} - -type AnswerVMResponse struct { -} - -type ApplicationQuiesceFault struct { - SnapshotFault -} - -func init() { - t["ApplicationQuiesceFault"] = reflect.TypeOf((*ApplicationQuiesceFault)(nil)).Elem() -} - -type ApplicationQuiesceFaultFault ApplicationQuiesceFault - -func init() { - t["ApplicationQuiesceFaultFault"] = reflect.TypeOf((*ApplicationQuiesceFaultFault)(nil)).Elem() -} - -type ApplyHostConfigRequestType struct { - This ManagedObjectReference `xml:"_this"` - Host ManagedObjectReference `xml:"host"` - ConfigSpec HostConfigSpec `xml:"configSpec"` - UserInput []ProfileDeferredPolicyOptionParameter `xml:"userInput,omitempty"` -} - -func init() { - t["ApplyHostConfigRequestType"] = reflect.TypeOf((*ApplyHostConfigRequestType)(nil)).Elem() -} - -type ApplyHostConfig_Task ApplyHostConfigRequestType - -func init() { - t["ApplyHostConfig_Task"] = reflect.TypeOf((*ApplyHostConfig_Task)(nil)).Elem() -} - -type ApplyHostConfig_TaskResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type ApplyProfile struct { - DynamicData - - Enabled bool `xml:"enabled"` - Policy []ProfilePolicy `xml:"policy,omitempty"` - ProfileTypeName string `xml:"profileTypeName,omitempty"` - ProfileVersion string `xml:"profileVersion,omitempty"` - Property []ProfileApplyProfileProperty `xml:"property,omitempty"` -} - -func init() { - t["ApplyProfile"] = reflect.TypeOf((*ApplyProfile)(nil)).Elem() -} - -type ApplyRecommendation ApplyRecommendationRequestType - -func init() { - t["ApplyRecommendation"] = reflect.TypeOf((*ApplyRecommendation)(nil)).Elem() -} - -type ApplyRecommendationRequestType struct { - This ManagedObjectReference `xml:"_this"` - Key string `xml:"key"` -} - -func init() { - t["ApplyRecommendationRequestType"] = reflect.TypeOf((*ApplyRecommendationRequestType)(nil)).Elem() -} - -type ApplyRecommendationResponse struct { -} - -type ApplyStorageDrsRecommendationRequestType struct { - This ManagedObjectReference `xml:"_this"` - Key []string `xml:"key"` -} - -func init() { - t["ApplyStorageDrsRecommendationRequestType"] = reflect.TypeOf((*ApplyStorageDrsRecommendationRequestType)(nil)).Elem() -} - -type ApplyStorageDrsRecommendationToPodRequestType struct { - This ManagedObjectReference `xml:"_this"` - Pod ManagedObjectReference `xml:"pod"` - Key string `xml:"key"` -} - -func init() { - t["ApplyStorageDrsRecommendationToPodRequestType"] = reflect.TypeOf((*ApplyStorageDrsRecommendationToPodRequestType)(nil)).Elem() -} - -type ApplyStorageDrsRecommendationToPod_Task ApplyStorageDrsRecommendationToPodRequestType - -func init() { - t["ApplyStorageDrsRecommendationToPod_Task"] = reflect.TypeOf((*ApplyStorageDrsRecommendationToPod_Task)(nil)).Elem() -} - -type ApplyStorageDrsRecommendationToPod_TaskResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type ApplyStorageDrsRecommendation_Task ApplyStorageDrsRecommendationRequestType - -func init() { - t["ApplyStorageDrsRecommendation_Task"] = reflect.TypeOf((*ApplyStorageDrsRecommendation_Task)(nil)).Elem() -} - -type ApplyStorageDrsRecommendation_TaskResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type ApplyStorageRecommendationResult struct { - DynamicData - - Vm *ManagedObjectReference `xml:"vm,omitempty"` -} - -func init() { - t["ApplyStorageRecommendationResult"] = reflect.TypeOf((*ApplyStorageRecommendationResult)(nil)).Elem() -} - -type AreAlarmActionsEnabled AreAlarmActionsEnabledRequestType - -func init() { - t["AreAlarmActionsEnabled"] = reflect.TypeOf((*AreAlarmActionsEnabled)(nil)).Elem() -} - -type AreAlarmActionsEnabledRequestType struct { - This ManagedObjectReference `xml:"_this"` - Entity ManagedObjectReference `xml:"entity"` -} - -func init() { - t["AreAlarmActionsEnabledRequestType"] = reflect.TypeOf((*AreAlarmActionsEnabledRequestType)(nil)).Elem() -} - -type AreAlarmActionsEnabledResponse struct { - Returnval bool `xml:"returnval"` -} - -type ArrayOfAlarmAction struct { - AlarmAction []BaseAlarmAction `xml:"AlarmAction,omitempty,typeattr"` -} - -func init() { - t["ArrayOfAlarmAction"] = reflect.TypeOf((*ArrayOfAlarmAction)(nil)).Elem() -} - -type ArrayOfAlarmExpression struct { - AlarmExpression []BaseAlarmExpression `xml:"AlarmExpression,omitempty,typeattr"` -} - -func init() { - t["ArrayOfAlarmExpression"] = reflect.TypeOf((*ArrayOfAlarmExpression)(nil)).Elem() -} - -type ArrayOfAlarmState struct { - AlarmState []AlarmState `xml:"AlarmState,omitempty"` -} - -func init() { - t["ArrayOfAlarmState"] = reflect.TypeOf((*ArrayOfAlarmState)(nil)).Elem() -} - -type ArrayOfAlarmTriggeringActionTransitionSpec struct { - AlarmTriggeringActionTransitionSpec []AlarmTriggeringActionTransitionSpec `xml:"AlarmTriggeringActionTransitionSpec,omitempty"` -} - -func init() { - t["ArrayOfAlarmTriggeringActionTransitionSpec"] = reflect.TypeOf((*ArrayOfAlarmTriggeringActionTransitionSpec)(nil)).Elem() -} - -type ArrayOfAnswerFileStatusError struct { - AnswerFileStatusError []AnswerFileStatusError `xml:"AnswerFileStatusError,omitempty"` -} - -func init() { - t["ArrayOfAnswerFileStatusError"] = reflect.TypeOf((*ArrayOfAnswerFileStatusError)(nil)).Elem() -} - -type ArrayOfAnswerFileStatusResult struct { - AnswerFileStatusResult []AnswerFileStatusResult `xml:"AnswerFileStatusResult,omitempty"` -} - -func init() { - t["ArrayOfAnswerFileStatusResult"] = reflect.TypeOf((*ArrayOfAnswerFileStatusResult)(nil)).Elem() -} - -type ArrayOfAnswerFileUpdateFailure struct { - AnswerFileUpdateFailure []AnswerFileUpdateFailure `xml:"AnswerFileUpdateFailure,omitempty"` -} - -func init() { - t["ArrayOfAnswerFileUpdateFailure"] = reflect.TypeOf((*ArrayOfAnswerFileUpdateFailure)(nil)).Elem() -} - -type ArrayOfAnyType struct { - AnyType []AnyType `xml:"anyType,omitempty,typeattr"` -} - -func init() { - t["ArrayOfAnyType"] = reflect.TypeOf((*ArrayOfAnyType)(nil)).Elem() -} - -type ArrayOfApplyProfile struct { - ApplyProfile []BaseApplyProfile `xml:"ApplyProfile,omitempty,typeattr"` -} - -func init() { - t["ArrayOfApplyProfile"] = reflect.TypeOf((*ArrayOfApplyProfile)(nil)).Elem() -} - -type ArrayOfAuthorizationPrivilege struct { - AuthorizationPrivilege []AuthorizationPrivilege `xml:"AuthorizationPrivilege,omitempty"` -} - -func init() { - t["ArrayOfAuthorizationPrivilege"] = reflect.TypeOf((*ArrayOfAuthorizationPrivilege)(nil)).Elem() -} - -type ArrayOfAuthorizationRole struct { - AuthorizationRole []AuthorizationRole `xml:"AuthorizationRole,omitempty"` -} - -func init() { - t["ArrayOfAuthorizationRole"] = reflect.TypeOf((*ArrayOfAuthorizationRole)(nil)).Elem() -} - -type ArrayOfAutoStartPowerInfo struct { - AutoStartPowerInfo []AutoStartPowerInfo `xml:"AutoStartPowerInfo,omitempty"` -} - -func init() { - t["ArrayOfAutoStartPowerInfo"] = reflect.TypeOf((*ArrayOfAutoStartPowerInfo)(nil)).Elem() -} - -type ArrayOfBoolean struct { - Boolean []bool `xml:"boolean,omitempty"` -} - -func init() { - t["ArrayOfBoolean"] = reflect.TypeOf((*ArrayOfBoolean)(nil)).Elem() -} - -type ArrayOfByte struct { - Byte []byte `xml:"byte,omitempty"` -} - -func init() { - t["ArrayOfByte"] = reflect.TypeOf((*ArrayOfByte)(nil)).Elem() -} - -type ArrayOfCheckResult struct { - CheckResult []CheckResult `xml:"CheckResult,omitempty"` -} - -func init() { - t["ArrayOfCheckResult"] = reflect.TypeOf((*ArrayOfCheckResult)(nil)).Elem() -} - -type ArrayOfClusterAction struct { - ClusterAction []BaseClusterAction `xml:"ClusterAction,omitempty,typeattr"` -} - -func init() { - t["ArrayOfClusterAction"] = reflect.TypeOf((*ArrayOfClusterAction)(nil)).Elem() -} - -type ArrayOfClusterActionHistory struct { - ClusterActionHistory []ClusterActionHistory `xml:"ClusterActionHistory,omitempty"` -} - -func init() { - t["ArrayOfClusterActionHistory"] = reflect.TypeOf((*ArrayOfClusterActionHistory)(nil)).Elem() -} - -type ArrayOfClusterAttemptedVmInfo struct { - ClusterAttemptedVmInfo []ClusterAttemptedVmInfo `xml:"ClusterAttemptedVmInfo,omitempty"` -} - -func init() { - t["ArrayOfClusterAttemptedVmInfo"] = reflect.TypeOf((*ArrayOfClusterAttemptedVmInfo)(nil)).Elem() -} - -type ArrayOfClusterDasAamNodeState struct { - ClusterDasAamNodeState []ClusterDasAamNodeState `xml:"ClusterDasAamNodeState,omitempty"` -} - -func init() { - t["ArrayOfClusterDasAamNodeState"] = reflect.TypeOf((*ArrayOfClusterDasAamNodeState)(nil)).Elem() -} - -type ArrayOfClusterDasFailoverLevelAdvancedRuntimeInfoHostSlots struct { - ClusterDasFailoverLevelAdvancedRuntimeInfoHostSlots []ClusterDasFailoverLevelAdvancedRuntimeInfoHostSlots `xml:"ClusterDasFailoverLevelAdvancedRuntimeInfoHostSlots,omitempty"` -} - -func init() { - t["ArrayOfClusterDasFailoverLevelAdvancedRuntimeInfoHostSlots"] = reflect.TypeOf((*ArrayOfClusterDasFailoverLevelAdvancedRuntimeInfoHostSlots)(nil)).Elem() -} - -type ArrayOfClusterDasFailoverLevelAdvancedRuntimeInfoVmSlots struct { - ClusterDasFailoverLevelAdvancedRuntimeInfoVmSlots []ClusterDasFailoverLevelAdvancedRuntimeInfoVmSlots `xml:"ClusterDasFailoverLevelAdvancedRuntimeInfoVmSlots,omitempty"` -} - -func init() { - t["ArrayOfClusterDasFailoverLevelAdvancedRuntimeInfoVmSlots"] = reflect.TypeOf((*ArrayOfClusterDasFailoverLevelAdvancedRuntimeInfoVmSlots)(nil)).Elem() -} - -type ArrayOfClusterDasVmConfigInfo struct { - ClusterDasVmConfigInfo []ClusterDasVmConfigInfo `xml:"ClusterDasVmConfigInfo,omitempty"` -} - -func init() { - t["ArrayOfClusterDasVmConfigInfo"] = reflect.TypeOf((*ArrayOfClusterDasVmConfigInfo)(nil)).Elem() -} - -type ArrayOfClusterDasVmConfigSpec struct { - ClusterDasVmConfigSpec []ClusterDasVmConfigSpec `xml:"ClusterDasVmConfigSpec,omitempty"` -} - -func init() { - t["ArrayOfClusterDasVmConfigSpec"] = reflect.TypeOf((*ArrayOfClusterDasVmConfigSpec)(nil)).Elem() -} - -type ArrayOfClusterDpmHostConfigInfo struct { - ClusterDpmHostConfigInfo []ClusterDpmHostConfigInfo `xml:"ClusterDpmHostConfigInfo,omitempty"` -} - -func init() { - t["ArrayOfClusterDpmHostConfigInfo"] = reflect.TypeOf((*ArrayOfClusterDpmHostConfigInfo)(nil)).Elem() -} - -type ArrayOfClusterDpmHostConfigSpec struct { - ClusterDpmHostConfigSpec []ClusterDpmHostConfigSpec `xml:"ClusterDpmHostConfigSpec,omitempty"` -} - -func init() { - t["ArrayOfClusterDpmHostConfigSpec"] = reflect.TypeOf((*ArrayOfClusterDpmHostConfigSpec)(nil)).Elem() -} - -type ArrayOfClusterDrsFaults struct { - ClusterDrsFaults []ClusterDrsFaults `xml:"ClusterDrsFaults,omitempty"` -} - -func init() { - t["ArrayOfClusterDrsFaults"] = reflect.TypeOf((*ArrayOfClusterDrsFaults)(nil)).Elem() -} - -type ArrayOfClusterDrsFaultsFaultsByVm struct { - ClusterDrsFaultsFaultsByVm []BaseClusterDrsFaultsFaultsByVm `xml:"ClusterDrsFaultsFaultsByVm,omitempty,typeattr"` -} - -func init() { - t["ArrayOfClusterDrsFaultsFaultsByVm"] = reflect.TypeOf((*ArrayOfClusterDrsFaultsFaultsByVm)(nil)).Elem() -} - -type ArrayOfClusterDrsMigration struct { - ClusterDrsMigration []ClusterDrsMigration `xml:"ClusterDrsMigration,omitempty"` -} - -func init() { - t["ArrayOfClusterDrsMigration"] = reflect.TypeOf((*ArrayOfClusterDrsMigration)(nil)).Elem() -} - -type ArrayOfClusterDrsRecommendation struct { - ClusterDrsRecommendation []ClusterDrsRecommendation `xml:"ClusterDrsRecommendation,omitempty"` -} - -func init() { - t["ArrayOfClusterDrsRecommendation"] = reflect.TypeOf((*ArrayOfClusterDrsRecommendation)(nil)).Elem() -} - -type ArrayOfClusterDrsVmConfigInfo struct { - ClusterDrsVmConfigInfo []ClusterDrsVmConfigInfo `xml:"ClusterDrsVmConfigInfo,omitempty"` -} - -func init() { - t["ArrayOfClusterDrsVmConfigInfo"] = reflect.TypeOf((*ArrayOfClusterDrsVmConfigInfo)(nil)).Elem() -} - -type ArrayOfClusterDrsVmConfigSpec struct { - ClusterDrsVmConfigSpec []ClusterDrsVmConfigSpec `xml:"ClusterDrsVmConfigSpec,omitempty"` -} - -func init() { - t["ArrayOfClusterDrsVmConfigSpec"] = reflect.TypeOf((*ArrayOfClusterDrsVmConfigSpec)(nil)).Elem() -} - -type ArrayOfClusterFailoverHostAdmissionControlInfoHostStatus struct { - ClusterFailoverHostAdmissionControlInfoHostStatus []ClusterFailoverHostAdmissionControlInfoHostStatus `xml:"ClusterFailoverHostAdmissionControlInfoHostStatus,omitempty"` -} - -func init() { - t["ArrayOfClusterFailoverHostAdmissionControlInfoHostStatus"] = reflect.TypeOf((*ArrayOfClusterFailoverHostAdmissionControlInfoHostStatus)(nil)).Elem() -} - -type ArrayOfClusterGroupInfo struct { - ClusterGroupInfo []BaseClusterGroupInfo `xml:"ClusterGroupInfo,omitempty,typeattr"` -} - -func init() { - t["ArrayOfClusterGroupInfo"] = reflect.TypeOf((*ArrayOfClusterGroupInfo)(nil)).Elem() -} - -type ArrayOfClusterGroupSpec struct { - ClusterGroupSpec []ClusterGroupSpec `xml:"ClusterGroupSpec,omitempty"` -} - -func init() { - t["ArrayOfClusterGroupSpec"] = reflect.TypeOf((*ArrayOfClusterGroupSpec)(nil)).Elem() -} - -type ArrayOfClusterHostRecommendation struct { - ClusterHostRecommendation []ClusterHostRecommendation `xml:"ClusterHostRecommendation,omitempty"` -} - -func init() { - t["ArrayOfClusterHostRecommendation"] = reflect.TypeOf((*ArrayOfClusterHostRecommendation)(nil)).Elem() -} - -type ArrayOfClusterNotAttemptedVmInfo struct { - ClusterNotAttemptedVmInfo []ClusterNotAttemptedVmInfo `xml:"ClusterNotAttemptedVmInfo,omitempty"` -} - -func init() { - t["ArrayOfClusterNotAttemptedVmInfo"] = reflect.TypeOf((*ArrayOfClusterNotAttemptedVmInfo)(nil)).Elem() -} - -type ArrayOfClusterRecommendation struct { - ClusterRecommendation []ClusterRecommendation `xml:"ClusterRecommendation,omitempty"` -} - -func init() { - t["ArrayOfClusterRecommendation"] = reflect.TypeOf((*ArrayOfClusterRecommendation)(nil)).Elem() -} - -type ArrayOfClusterRuleInfo struct { - ClusterRuleInfo []BaseClusterRuleInfo `xml:"ClusterRuleInfo,omitempty,typeattr"` -} - -func init() { - t["ArrayOfClusterRuleInfo"] = reflect.TypeOf((*ArrayOfClusterRuleInfo)(nil)).Elem() -} - -type ArrayOfClusterRuleSpec struct { - ClusterRuleSpec []ClusterRuleSpec `xml:"ClusterRuleSpec,omitempty"` -} - -func init() { - t["ArrayOfClusterRuleSpec"] = reflect.TypeOf((*ArrayOfClusterRuleSpec)(nil)).Elem() -} - -type ArrayOfComplianceFailure struct { - ComplianceFailure []ComplianceFailure `xml:"ComplianceFailure,omitempty"` -} - -func init() { - t["ArrayOfComplianceFailure"] = reflect.TypeOf((*ArrayOfComplianceFailure)(nil)).Elem() -} - -type ArrayOfComplianceLocator struct { - ComplianceLocator []ComplianceLocator `xml:"ComplianceLocator,omitempty"` -} - -func init() { - t["ArrayOfComplianceLocator"] = reflect.TypeOf((*ArrayOfComplianceLocator)(nil)).Elem() -} - -type ArrayOfComplianceResult struct { - ComplianceResult []ComplianceResult `xml:"ComplianceResult,omitempty"` -} - -func init() { - t["ArrayOfComplianceResult"] = reflect.TypeOf((*ArrayOfComplianceResult)(nil)).Elem() -} - -type ArrayOfComputeResourceHostSPBMLicenseInfo struct { - ComputeResourceHostSPBMLicenseInfo []ComputeResourceHostSPBMLicenseInfo `xml:"ComputeResourceHostSPBMLicenseInfo,omitempty"` -} - -func init() { - t["ArrayOfComputeResourceHostSPBMLicenseInfo"] = reflect.TypeOf((*ArrayOfComputeResourceHostSPBMLicenseInfo)(nil)).Elem() -} - -type ArrayOfConflictingConfigurationConfig struct { - ConflictingConfigurationConfig []ConflictingConfigurationConfig `xml:"ConflictingConfigurationConfig,omitempty"` -} - -func init() { - t["ArrayOfConflictingConfigurationConfig"] = reflect.TypeOf((*ArrayOfConflictingConfigurationConfig)(nil)).Elem() -} - -type ArrayOfCustomFieldDef struct { - CustomFieldDef []CustomFieldDef `xml:"CustomFieldDef,omitempty"` -} - -func init() { - t["ArrayOfCustomFieldDef"] = reflect.TypeOf((*ArrayOfCustomFieldDef)(nil)).Elem() -} - -type ArrayOfCustomFieldValue struct { - CustomFieldValue []BaseCustomFieldValue `xml:"CustomFieldValue,omitempty,typeattr"` -} - -func init() { - t["ArrayOfCustomFieldValue"] = reflect.TypeOf((*ArrayOfCustomFieldValue)(nil)).Elem() -} - -type ArrayOfCustomizationAdapterMapping struct { - CustomizationAdapterMapping []CustomizationAdapterMapping `xml:"CustomizationAdapterMapping,omitempty"` -} - -func init() { - t["ArrayOfCustomizationAdapterMapping"] = reflect.TypeOf((*ArrayOfCustomizationAdapterMapping)(nil)).Elem() -} - -type ArrayOfCustomizationIpV6Generator struct { - CustomizationIpV6Generator []BaseCustomizationIpV6Generator `xml:"CustomizationIpV6Generator,omitempty,typeattr"` -} - -func init() { - t["ArrayOfCustomizationIpV6Generator"] = reflect.TypeOf((*ArrayOfCustomizationIpV6Generator)(nil)).Elem() -} - -type ArrayOfCustomizationSpecInfo struct { - CustomizationSpecInfo []CustomizationSpecInfo `xml:"CustomizationSpecInfo,omitempty"` -} - -func init() { - t["ArrayOfCustomizationSpecInfo"] = reflect.TypeOf((*ArrayOfCustomizationSpecInfo)(nil)).Elem() -} - -type ArrayOfDVPortConfigSpec struct { - DVPortConfigSpec []DVPortConfigSpec `xml:"DVPortConfigSpec,omitempty"` -} - -func init() { - t["ArrayOfDVPortConfigSpec"] = reflect.TypeOf((*ArrayOfDVPortConfigSpec)(nil)).Elem() -} - -type ArrayOfDVPortgroupConfigSpec struct { - DVPortgroupConfigSpec []DVPortgroupConfigSpec `xml:"DVPortgroupConfigSpec,omitempty"` -} - -func init() { - t["ArrayOfDVPortgroupConfigSpec"] = reflect.TypeOf((*ArrayOfDVPortgroupConfigSpec)(nil)).Elem() -} - -type ArrayOfDVSHealthCheckConfig struct { - DVSHealthCheckConfig []BaseDVSHealthCheckConfig `xml:"DVSHealthCheckConfig,omitempty,typeattr"` -} - -func init() { - t["ArrayOfDVSHealthCheckConfig"] = reflect.TypeOf((*ArrayOfDVSHealthCheckConfig)(nil)).Elem() -} - -type ArrayOfDVSNetworkResourcePool struct { - DVSNetworkResourcePool []DVSNetworkResourcePool `xml:"DVSNetworkResourcePool,omitempty"` -} - -func init() { - t["ArrayOfDVSNetworkResourcePool"] = reflect.TypeOf((*ArrayOfDVSNetworkResourcePool)(nil)).Elem() -} - -type ArrayOfDVSNetworkResourcePoolConfigSpec struct { - DVSNetworkResourcePoolConfigSpec []DVSNetworkResourcePoolConfigSpec `xml:"DVSNetworkResourcePoolConfigSpec,omitempty"` -} - -func init() { - t["ArrayOfDVSNetworkResourcePoolConfigSpec"] = reflect.TypeOf((*ArrayOfDVSNetworkResourcePoolConfigSpec)(nil)).Elem() -} - -type ArrayOfDasHeartbeatDatastoreInfo struct { - DasHeartbeatDatastoreInfo []DasHeartbeatDatastoreInfo `xml:"DasHeartbeatDatastoreInfo,omitempty"` -} - -func init() { - t["ArrayOfDasHeartbeatDatastoreInfo"] = reflect.TypeOf((*ArrayOfDasHeartbeatDatastoreInfo)(nil)).Elem() -} - -type ArrayOfDatacenterMismatchArgument struct { - DatacenterMismatchArgument []DatacenterMismatchArgument `xml:"DatacenterMismatchArgument,omitempty"` -} - -func init() { - t["ArrayOfDatacenterMismatchArgument"] = reflect.TypeOf((*ArrayOfDatacenterMismatchArgument)(nil)).Elem() -} - -type ArrayOfDatastoreHostMount struct { - DatastoreHostMount []DatastoreHostMount `xml:"DatastoreHostMount,omitempty"` -} - -func init() { - t["ArrayOfDatastoreHostMount"] = reflect.TypeOf((*ArrayOfDatastoreHostMount)(nil)).Elem() -} - -type ArrayOfDatastoreMountPathDatastorePair struct { - DatastoreMountPathDatastorePair []DatastoreMountPathDatastorePair `xml:"DatastoreMountPathDatastorePair,omitempty"` -} - -func init() { - t["ArrayOfDatastoreMountPathDatastorePair"] = reflect.TypeOf((*ArrayOfDatastoreMountPathDatastorePair)(nil)).Elem() -} - -type ArrayOfDiagnosticManagerBundleInfo struct { - DiagnosticManagerBundleInfo []DiagnosticManagerBundleInfo `xml:"DiagnosticManagerBundleInfo,omitempty"` -} - -func init() { - t["ArrayOfDiagnosticManagerBundleInfo"] = reflect.TypeOf((*ArrayOfDiagnosticManagerBundleInfo)(nil)).Elem() -} - -type ArrayOfDiagnosticManagerLogDescriptor struct { - DiagnosticManagerLogDescriptor []DiagnosticManagerLogDescriptor `xml:"DiagnosticManagerLogDescriptor,omitempty"` -} - -func init() { - t["ArrayOfDiagnosticManagerLogDescriptor"] = reflect.TypeOf((*ArrayOfDiagnosticManagerLogDescriptor)(nil)).Elem() -} - -type ArrayOfDiskChangeExtent struct { - DiskChangeExtent []DiskChangeExtent `xml:"DiskChangeExtent,omitempty"` -} - -func init() { - t["ArrayOfDiskChangeExtent"] = reflect.TypeOf((*ArrayOfDiskChangeExtent)(nil)).Elem() -} - -type ArrayOfDistributedVirtualPort struct { - DistributedVirtualPort []DistributedVirtualPort `xml:"DistributedVirtualPort,omitempty"` -} - -func init() { - t["ArrayOfDistributedVirtualPort"] = reflect.TypeOf((*ArrayOfDistributedVirtualPort)(nil)).Elem() -} - -type ArrayOfDistributedVirtualPortgroupInfo struct { - DistributedVirtualPortgroupInfo []DistributedVirtualPortgroupInfo `xml:"DistributedVirtualPortgroupInfo,omitempty"` -} - -func init() { - t["ArrayOfDistributedVirtualPortgroupInfo"] = reflect.TypeOf((*ArrayOfDistributedVirtualPortgroupInfo)(nil)).Elem() -} - -type ArrayOfDistributedVirtualSwitchHostMember struct { - DistributedVirtualSwitchHostMember []DistributedVirtualSwitchHostMember `xml:"DistributedVirtualSwitchHostMember,omitempty"` -} - -func init() { - t["ArrayOfDistributedVirtualSwitchHostMember"] = reflect.TypeOf((*ArrayOfDistributedVirtualSwitchHostMember)(nil)).Elem() -} - -type ArrayOfDistributedVirtualSwitchHostMemberConfigSpec struct { - DistributedVirtualSwitchHostMemberConfigSpec []DistributedVirtualSwitchHostMemberConfigSpec `xml:"DistributedVirtualSwitchHostMemberConfigSpec,omitempty"` -} - -func init() { - t["ArrayOfDistributedVirtualSwitchHostMemberConfigSpec"] = reflect.TypeOf((*ArrayOfDistributedVirtualSwitchHostMemberConfigSpec)(nil)).Elem() -} - -type ArrayOfDistributedVirtualSwitchHostMemberPnicSpec struct { - DistributedVirtualSwitchHostMemberPnicSpec []DistributedVirtualSwitchHostMemberPnicSpec `xml:"DistributedVirtualSwitchHostMemberPnicSpec,omitempty"` -} - -func init() { - t["ArrayOfDistributedVirtualSwitchHostMemberPnicSpec"] = reflect.TypeOf((*ArrayOfDistributedVirtualSwitchHostMemberPnicSpec)(nil)).Elem() -} - -type ArrayOfDistributedVirtualSwitchHostProductSpec struct { - DistributedVirtualSwitchHostProductSpec []DistributedVirtualSwitchHostProductSpec `xml:"DistributedVirtualSwitchHostProductSpec,omitempty"` -} - -func init() { - t["ArrayOfDistributedVirtualSwitchHostProductSpec"] = reflect.TypeOf((*ArrayOfDistributedVirtualSwitchHostProductSpec)(nil)).Elem() -} - -type ArrayOfDistributedVirtualSwitchInfo struct { - DistributedVirtualSwitchInfo []DistributedVirtualSwitchInfo `xml:"DistributedVirtualSwitchInfo,omitempty"` -} - -func init() { - t["ArrayOfDistributedVirtualSwitchInfo"] = reflect.TypeOf((*ArrayOfDistributedVirtualSwitchInfo)(nil)).Elem() -} - -type ArrayOfDistributedVirtualSwitchKeyedOpaqueBlob struct { - DistributedVirtualSwitchKeyedOpaqueBlob []DistributedVirtualSwitchKeyedOpaqueBlob `xml:"DistributedVirtualSwitchKeyedOpaqueBlob,omitempty"` -} - -func init() { - t["ArrayOfDistributedVirtualSwitchKeyedOpaqueBlob"] = reflect.TypeOf((*ArrayOfDistributedVirtualSwitchKeyedOpaqueBlob)(nil)).Elem() -} - -type ArrayOfDistributedVirtualSwitchManagerCompatibilityResult struct { - DistributedVirtualSwitchManagerCompatibilityResult []DistributedVirtualSwitchManagerCompatibilityResult `xml:"DistributedVirtualSwitchManagerCompatibilityResult,omitempty"` -} - -func init() { - t["ArrayOfDistributedVirtualSwitchManagerCompatibilityResult"] = reflect.TypeOf((*ArrayOfDistributedVirtualSwitchManagerCompatibilityResult)(nil)).Elem() -} - -type ArrayOfDistributedVirtualSwitchManagerHostDvsFilterSpec struct { - DistributedVirtualSwitchManagerHostDvsFilterSpec []BaseDistributedVirtualSwitchManagerHostDvsFilterSpec `xml:"DistributedVirtualSwitchManagerHostDvsFilterSpec,omitempty,typeattr"` -} - -func init() { - t["ArrayOfDistributedVirtualSwitchManagerHostDvsFilterSpec"] = reflect.TypeOf((*ArrayOfDistributedVirtualSwitchManagerHostDvsFilterSpec)(nil)).Elem() -} - -type ArrayOfDistributedVirtualSwitchProductSpec struct { - DistributedVirtualSwitchProductSpec []DistributedVirtualSwitchProductSpec `xml:"DistributedVirtualSwitchProductSpec,omitempty"` -} - -func init() { - t["ArrayOfDistributedVirtualSwitchProductSpec"] = reflect.TypeOf((*ArrayOfDistributedVirtualSwitchProductSpec)(nil)).Elem() -} - -type ArrayOfDouble struct { - Double []float64 `xml:"double,omitempty"` -} - -func init() { - t["ArrayOfDouble"] = reflect.TypeOf((*ArrayOfDouble)(nil)).Elem() -} - -type ArrayOfDvsApplyOperationFaultFaultOnObject struct { - DvsApplyOperationFaultFaultOnObject []DvsApplyOperationFaultFaultOnObject `xml:"DvsApplyOperationFaultFaultOnObject,omitempty"` -} - -func init() { - t["ArrayOfDvsApplyOperationFaultFaultOnObject"] = reflect.TypeOf((*ArrayOfDvsApplyOperationFaultFaultOnObject)(nil)).Elem() -} - -type ArrayOfDvsFilterConfig struct { - DvsFilterConfig []BaseDvsFilterConfig `xml:"DvsFilterConfig,omitempty,typeattr"` -} - -func init() { - t["ArrayOfDvsFilterConfig"] = reflect.TypeOf((*ArrayOfDvsFilterConfig)(nil)).Elem() -} - -type ArrayOfDvsHostVNicProfile struct { - DvsHostVNicProfile []DvsHostVNicProfile `xml:"DvsHostVNicProfile,omitempty"` -} - -func init() { - t["ArrayOfDvsHostVNicProfile"] = reflect.TypeOf((*ArrayOfDvsHostVNicProfile)(nil)).Elem() -} - -type ArrayOfDvsNetworkRuleQualifier struct { - DvsNetworkRuleQualifier []BaseDvsNetworkRuleQualifier `xml:"DvsNetworkRuleQualifier,omitempty,typeattr"` -} - -func init() { - t["ArrayOfDvsNetworkRuleQualifier"] = reflect.TypeOf((*ArrayOfDvsNetworkRuleQualifier)(nil)).Elem() -} - -type ArrayOfDvsOperationBulkFaultFaultOnHost struct { - DvsOperationBulkFaultFaultOnHost []DvsOperationBulkFaultFaultOnHost `xml:"DvsOperationBulkFaultFaultOnHost,omitempty"` -} - -func init() { - t["ArrayOfDvsOperationBulkFaultFaultOnHost"] = reflect.TypeOf((*ArrayOfDvsOperationBulkFaultFaultOnHost)(nil)).Elem() -} - -type ArrayOfDvsOutOfSyncHostArgument struct { - DvsOutOfSyncHostArgument []DvsOutOfSyncHostArgument `xml:"DvsOutOfSyncHostArgument,omitempty"` -} - -func init() { - t["ArrayOfDvsOutOfSyncHostArgument"] = reflect.TypeOf((*ArrayOfDvsOutOfSyncHostArgument)(nil)).Elem() -} - -type ArrayOfDvsProfile struct { - DvsProfile []DvsProfile `xml:"DvsProfile,omitempty"` -} - -func init() { - t["ArrayOfDvsProfile"] = reflect.TypeOf((*ArrayOfDvsProfile)(nil)).Elem() -} - -type ArrayOfDvsServiceConsoleVNicProfile struct { - DvsServiceConsoleVNicProfile []DvsServiceConsoleVNicProfile `xml:"DvsServiceConsoleVNicProfile,omitempty"` -} - -func init() { - t["ArrayOfDvsServiceConsoleVNicProfile"] = reflect.TypeOf((*ArrayOfDvsServiceConsoleVNicProfile)(nil)).Elem() -} - -type ArrayOfDvsTrafficRule struct { - DvsTrafficRule []DvsTrafficRule `xml:"DvsTrafficRule,omitempty"` -} - -func init() { - t["ArrayOfDvsTrafficRule"] = reflect.TypeOf((*ArrayOfDvsTrafficRule)(nil)).Elem() -} - -type ArrayOfDynamicProperty struct { - DynamicProperty []DynamicProperty `xml:"DynamicProperty,omitempty"` -} - -func init() { - t["ArrayOfDynamicProperty"] = reflect.TypeOf((*ArrayOfDynamicProperty)(nil)).Elem() -} - -type ArrayOfEVCMode struct { - EVCMode []EVCMode `xml:"EVCMode,omitempty"` -} - -func init() { - t["ArrayOfEVCMode"] = reflect.TypeOf((*ArrayOfEVCMode)(nil)).Elem() -} - -type ArrayOfElementDescription struct { - ElementDescription []BaseElementDescription `xml:"ElementDescription,omitempty,typeattr"` -} - -func init() { - t["ArrayOfElementDescription"] = reflect.TypeOf((*ArrayOfElementDescription)(nil)).Elem() -} - -type ArrayOfEntityBackupConfig struct { - EntityBackupConfig []EntityBackupConfig `xml:"EntityBackupConfig,omitempty"` -} - -func init() { - t["ArrayOfEntityBackupConfig"] = reflect.TypeOf((*ArrayOfEntityBackupConfig)(nil)).Elem() -} - -type ArrayOfEntityPrivilege struct { - EntityPrivilege []EntityPrivilege `xml:"EntityPrivilege,omitempty"` -} - -func init() { - t["ArrayOfEntityPrivilege"] = reflect.TypeOf((*ArrayOfEntityPrivilege)(nil)).Elem() -} - -type ArrayOfEnumDescription struct { - EnumDescription []EnumDescription `xml:"EnumDescription,omitempty"` -} - -func init() { - t["ArrayOfEnumDescription"] = reflect.TypeOf((*ArrayOfEnumDescription)(nil)).Elem() -} - -type ArrayOfEvent struct { - Event []BaseEvent `xml:"Event,omitempty,typeattr"` -} - -func init() { - t["ArrayOfEvent"] = reflect.TypeOf((*ArrayOfEvent)(nil)).Elem() -} - -type ArrayOfEventAlarmExpressionComparison struct { - EventAlarmExpressionComparison []EventAlarmExpressionComparison `xml:"EventAlarmExpressionComparison,omitempty"` -} - -func init() { - t["ArrayOfEventAlarmExpressionComparison"] = reflect.TypeOf((*ArrayOfEventAlarmExpressionComparison)(nil)).Elem() -} - -type ArrayOfEventArgDesc struct { - EventArgDesc []EventArgDesc `xml:"EventArgDesc,omitempty"` -} - -func init() { - t["ArrayOfEventArgDesc"] = reflect.TypeOf((*ArrayOfEventArgDesc)(nil)).Elem() -} - -type ArrayOfEventDescriptionEventDetail struct { - EventDescriptionEventDetail []EventDescriptionEventDetail `xml:"EventDescriptionEventDetail,omitempty"` -} - -func init() { - t["ArrayOfEventDescriptionEventDetail"] = reflect.TypeOf((*ArrayOfEventDescriptionEventDetail)(nil)).Elem() -} - -type ArrayOfExtManagedEntityInfo struct { - ExtManagedEntityInfo []ExtManagedEntityInfo `xml:"ExtManagedEntityInfo,omitempty"` -} - -func init() { - t["ArrayOfExtManagedEntityInfo"] = reflect.TypeOf((*ArrayOfExtManagedEntityInfo)(nil)).Elem() -} - -type ArrayOfExtSolutionManagerInfoTabInfo struct { - ExtSolutionManagerInfoTabInfo []ExtSolutionManagerInfoTabInfo `xml:"ExtSolutionManagerInfoTabInfo,omitempty"` -} - -func init() { - t["ArrayOfExtSolutionManagerInfoTabInfo"] = reflect.TypeOf((*ArrayOfExtSolutionManagerInfoTabInfo)(nil)).Elem() -} - -type ArrayOfExtendedEventPair struct { - ExtendedEventPair []ExtendedEventPair `xml:"ExtendedEventPair,omitempty"` -} - -func init() { - t["ArrayOfExtendedEventPair"] = reflect.TypeOf((*ArrayOfExtendedEventPair)(nil)).Elem() -} - -type ArrayOfExtension struct { - Extension []Extension `xml:"Extension,omitempty"` -} - -func init() { - t["ArrayOfExtension"] = reflect.TypeOf((*ArrayOfExtension)(nil)).Elem() -} - -type ArrayOfExtensionClientInfo struct { - ExtensionClientInfo []ExtensionClientInfo `xml:"ExtensionClientInfo,omitempty"` -} - -func init() { - t["ArrayOfExtensionClientInfo"] = reflect.TypeOf((*ArrayOfExtensionClientInfo)(nil)).Elem() -} - -type ArrayOfExtensionEventTypeInfo struct { - ExtensionEventTypeInfo []ExtensionEventTypeInfo `xml:"ExtensionEventTypeInfo,omitempty"` -} - -func init() { - t["ArrayOfExtensionEventTypeInfo"] = reflect.TypeOf((*ArrayOfExtensionEventTypeInfo)(nil)).Elem() -} - -type ArrayOfExtensionFaultTypeInfo struct { - ExtensionFaultTypeInfo []ExtensionFaultTypeInfo `xml:"ExtensionFaultTypeInfo,omitempty"` -} - -func init() { - t["ArrayOfExtensionFaultTypeInfo"] = reflect.TypeOf((*ArrayOfExtensionFaultTypeInfo)(nil)).Elem() -} - -type ArrayOfExtensionManagerIpAllocationUsage struct { - ExtensionManagerIpAllocationUsage []ExtensionManagerIpAllocationUsage `xml:"ExtensionManagerIpAllocationUsage,omitempty"` -} - -func init() { - t["ArrayOfExtensionManagerIpAllocationUsage"] = reflect.TypeOf((*ArrayOfExtensionManagerIpAllocationUsage)(nil)).Elem() -} - -type ArrayOfExtensionPrivilegeInfo struct { - ExtensionPrivilegeInfo []ExtensionPrivilegeInfo `xml:"ExtensionPrivilegeInfo,omitempty"` -} - -func init() { - t["ArrayOfExtensionPrivilegeInfo"] = reflect.TypeOf((*ArrayOfExtensionPrivilegeInfo)(nil)).Elem() -} - -type ArrayOfExtensionResourceInfo struct { - ExtensionResourceInfo []ExtensionResourceInfo `xml:"ExtensionResourceInfo,omitempty"` -} - -func init() { - t["ArrayOfExtensionResourceInfo"] = reflect.TypeOf((*ArrayOfExtensionResourceInfo)(nil)).Elem() -} - -type ArrayOfExtensionServerInfo struct { - ExtensionServerInfo []ExtensionServerInfo `xml:"ExtensionServerInfo,omitempty"` -} - -func init() { - t["ArrayOfExtensionServerInfo"] = reflect.TypeOf((*ArrayOfExtensionServerInfo)(nil)).Elem() -} - -type ArrayOfExtensionTaskTypeInfo struct { - ExtensionTaskTypeInfo []ExtensionTaskTypeInfo `xml:"ExtensionTaskTypeInfo,omitempty"` -} - -func init() { - t["ArrayOfExtensionTaskTypeInfo"] = reflect.TypeOf((*ArrayOfExtensionTaskTypeInfo)(nil)).Elem() -} - -type ArrayOfFcoeConfigVlanRange struct { - FcoeConfigVlanRange []FcoeConfigVlanRange `xml:"FcoeConfigVlanRange,omitempty"` -} - -func init() { - t["ArrayOfFcoeConfigVlanRange"] = reflect.TypeOf((*ArrayOfFcoeConfigVlanRange)(nil)).Elem() -} - -type ArrayOfFileInfo struct { - FileInfo []BaseFileInfo `xml:"FileInfo,omitempty,typeattr"` -} - -func init() { - t["ArrayOfFileInfo"] = reflect.TypeOf((*ArrayOfFileInfo)(nil)).Elem() -} - -type ArrayOfFileQuery struct { - FileQuery []BaseFileQuery `xml:"FileQuery,omitempty,typeattr"` -} - -func init() { - t["ArrayOfFileQuery"] = reflect.TypeOf((*ArrayOfFileQuery)(nil)).Elem() -} - -type ArrayOfFirewallProfileRulesetProfile struct { - FirewallProfileRulesetProfile []FirewallProfileRulesetProfile `xml:"FirewallProfileRulesetProfile,omitempty"` -} - -func init() { - t["ArrayOfFirewallProfileRulesetProfile"] = reflect.TypeOf((*ArrayOfFirewallProfileRulesetProfile)(nil)).Elem() -} - -type ArrayOfGuestDiskInfo struct { - GuestDiskInfo []GuestDiskInfo `xml:"GuestDiskInfo,omitempty"` -} - -func init() { - t["ArrayOfGuestDiskInfo"] = reflect.TypeOf((*ArrayOfGuestDiskInfo)(nil)).Elem() -} - -type ArrayOfGuestFileInfo struct { - GuestFileInfo []GuestFileInfo `xml:"GuestFileInfo,omitempty"` -} - -func init() { - t["ArrayOfGuestFileInfo"] = reflect.TypeOf((*ArrayOfGuestFileInfo)(nil)).Elem() -} - -type ArrayOfGuestInfoNamespaceGenerationInfo struct { - GuestInfoNamespaceGenerationInfo []GuestInfoNamespaceGenerationInfo `xml:"GuestInfoNamespaceGenerationInfo,omitempty"` -} - -func init() { - t["ArrayOfGuestInfoNamespaceGenerationInfo"] = reflect.TypeOf((*ArrayOfGuestInfoNamespaceGenerationInfo)(nil)).Elem() -} - -type ArrayOfGuestNicInfo struct { - GuestNicInfo []GuestNicInfo `xml:"GuestNicInfo,omitempty"` -} - -func init() { - t["ArrayOfGuestNicInfo"] = reflect.TypeOf((*ArrayOfGuestNicInfo)(nil)).Elem() -} - -type ArrayOfGuestOsDescriptor struct { - GuestOsDescriptor []GuestOsDescriptor `xml:"GuestOsDescriptor,omitempty"` -} - -func init() { - t["ArrayOfGuestOsDescriptor"] = reflect.TypeOf((*ArrayOfGuestOsDescriptor)(nil)).Elem() -} - -type ArrayOfGuestProcessInfo struct { - GuestProcessInfo []GuestProcessInfo `xml:"GuestProcessInfo,omitempty"` -} - -func init() { - t["ArrayOfGuestProcessInfo"] = reflect.TypeOf((*ArrayOfGuestProcessInfo)(nil)).Elem() -} - -type ArrayOfGuestStackInfo struct { - GuestStackInfo []GuestStackInfo `xml:"GuestStackInfo,omitempty"` -} - -func init() { - t["ArrayOfGuestStackInfo"] = reflect.TypeOf((*ArrayOfGuestStackInfo)(nil)).Elem() -} - -type ArrayOfHostAccountSpec struct { - HostAccountSpec []BaseHostAccountSpec `xml:"HostAccountSpec,omitempty,typeattr"` -} - -func init() { - t["ArrayOfHostAccountSpec"] = reflect.TypeOf((*ArrayOfHostAccountSpec)(nil)).Elem() -} - -type ArrayOfHostActiveDirectory struct { - HostActiveDirectory []HostActiveDirectory `xml:"HostActiveDirectory,omitempty"` -} - -func init() { - t["ArrayOfHostActiveDirectory"] = reflect.TypeOf((*ArrayOfHostActiveDirectory)(nil)).Elem() -} - -type ArrayOfHostAuthenticationStoreInfo struct { - HostAuthenticationStoreInfo []BaseHostAuthenticationStoreInfo `xml:"HostAuthenticationStoreInfo,omitempty,typeattr"` -} - -func init() { - t["ArrayOfHostAuthenticationStoreInfo"] = reflect.TypeOf((*ArrayOfHostAuthenticationStoreInfo)(nil)).Elem() -} - -type ArrayOfHostBootDevice struct { - HostBootDevice []HostBootDevice `xml:"HostBootDevice,omitempty"` -} - -func init() { - t["ArrayOfHostBootDevice"] = reflect.TypeOf((*ArrayOfHostBootDevice)(nil)).Elem() -} - -type ArrayOfHostCacheConfigurationInfo struct { - HostCacheConfigurationInfo []HostCacheConfigurationInfo `xml:"HostCacheConfigurationInfo,omitempty"` -} - -func init() { - t["ArrayOfHostCacheConfigurationInfo"] = reflect.TypeOf((*ArrayOfHostCacheConfigurationInfo)(nil)).Elem() -} - -type ArrayOfHostConnectInfoNetworkInfo struct { - HostConnectInfoNetworkInfo []BaseHostConnectInfoNetworkInfo `xml:"HostConnectInfoNetworkInfo,omitempty,typeattr"` -} - -func init() { - t["ArrayOfHostConnectInfoNetworkInfo"] = reflect.TypeOf((*ArrayOfHostConnectInfoNetworkInfo)(nil)).Elem() -} - -type ArrayOfHostCpuIdInfo struct { - HostCpuIdInfo []HostCpuIdInfo `xml:"HostCpuIdInfo,omitempty"` -} - -func init() { - t["ArrayOfHostCpuIdInfo"] = reflect.TypeOf((*ArrayOfHostCpuIdInfo)(nil)).Elem() -} - -type ArrayOfHostCpuPackage struct { - HostCpuPackage []HostCpuPackage `xml:"HostCpuPackage,omitempty"` -} - -func init() { - t["ArrayOfHostCpuPackage"] = reflect.TypeOf((*ArrayOfHostCpuPackage)(nil)).Elem() -} - -type ArrayOfHostDatastoreBrowserSearchResults struct { - HostDatastoreBrowserSearchResults []HostDatastoreBrowserSearchResults `xml:"HostDatastoreBrowserSearchResults,omitempty"` -} - -func init() { - t["ArrayOfHostDatastoreBrowserSearchResults"] = reflect.TypeOf((*ArrayOfHostDatastoreBrowserSearchResults)(nil)).Elem() -} - -type ArrayOfHostDatastoreConnectInfo struct { - HostDatastoreConnectInfo []BaseHostDatastoreConnectInfo `xml:"HostDatastoreConnectInfo,omitempty,typeattr"` -} - -func init() { - t["ArrayOfHostDatastoreConnectInfo"] = reflect.TypeOf((*ArrayOfHostDatastoreConnectInfo)(nil)).Elem() -} - -type ArrayOfHostDateTimeSystemTimeZone struct { - HostDateTimeSystemTimeZone []HostDateTimeSystemTimeZone `xml:"HostDateTimeSystemTimeZone,omitempty"` -} - -func init() { - t["ArrayOfHostDateTimeSystemTimeZone"] = reflect.TypeOf((*ArrayOfHostDateTimeSystemTimeZone)(nil)).Elem() -} - -type ArrayOfHostDhcpService struct { - HostDhcpService []HostDhcpService `xml:"HostDhcpService,omitempty"` -} - -func init() { - t["ArrayOfHostDhcpService"] = reflect.TypeOf((*ArrayOfHostDhcpService)(nil)).Elem() -} - -type ArrayOfHostDhcpServiceConfig struct { - HostDhcpServiceConfig []HostDhcpServiceConfig `xml:"HostDhcpServiceConfig,omitempty"` -} - -func init() { - t["ArrayOfHostDhcpServiceConfig"] = reflect.TypeOf((*ArrayOfHostDhcpServiceConfig)(nil)).Elem() -} - -type ArrayOfHostDiagnosticPartition struct { - HostDiagnosticPartition []HostDiagnosticPartition `xml:"HostDiagnosticPartition,omitempty"` -} - -func init() { - t["ArrayOfHostDiagnosticPartition"] = reflect.TypeOf((*ArrayOfHostDiagnosticPartition)(nil)).Elem() -} - -type ArrayOfHostDiagnosticPartitionCreateOption struct { - HostDiagnosticPartitionCreateOption []HostDiagnosticPartitionCreateOption `xml:"HostDiagnosticPartitionCreateOption,omitempty"` -} - -func init() { - t["ArrayOfHostDiagnosticPartitionCreateOption"] = reflect.TypeOf((*ArrayOfHostDiagnosticPartitionCreateOption)(nil)).Elem() -} - -type ArrayOfHostDiskConfigurationResult struct { - HostDiskConfigurationResult []HostDiskConfigurationResult `xml:"HostDiskConfigurationResult,omitempty"` -} - -func init() { - t["ArrayOfHostDiskConfigurationResult"] = reflect.TypeOf((*ArrayOfHostDiskConfigurationResult)(nil)).Elem() -} - -type ArrayOfHostDiskMappingPartitionOption struct { - HostDiskMappingPartitionOption []HostDiskMappingPartitionOption `xml:"HostDiskMappingPartitionOption,omitempty"` -} - -func init() { - t["ArrayOfHostDiskMappingPartitionOption"] = reflect.TypeOf((*ArrayOfHostDiskMappingPartitionOption)(nil)).Elem() -} - -type ArrayOfHostDiskPartitionAttributes struct { - HostDiskPartitionAttributes []HostDiskPartitionAttributes `xml:"HostDiskPartitionAttributes,omitempty"` -} - -func init() { - t["ArrayOfHostDiskPartitionAttributes"] = reflect.TypeOf((*ArrayOfHostDiskPartitionAttributes)(nil)).Elem() -} - -type ArrayOfHostDiskPartitionBlockRange struct { - HostDiskPartitionBlockRange []HostDiskPartitionBlockRange `xml:"HostDiskPartitionBlockRange,omitempty"` -} - -func init() { - t["ArrayOfHostDiskPartitionBlockRange"] = reflect.TypeOf((*ArrayOfHostDiskPartitionBlockRange)(nil)).Elem() -} - -type ArrayOfHostDiskPartitionInfo struct { - HostDiskPartitionInfo []HostDiskPartitionInfo `xml:"HostDiskPartitionInfo,omitempty"` -} - -func init() { - t["ArrayOfHostDiskPartitionInfo"] = reflect.TypeOf((*ArrayOfHostDiskPartitionInfo)(nil)).Elem() -} - -type ArrayOfHostEventArgument struct { - HostEventArgument []HostEventArgument `xml:"HostEventArgument,omitempty"` -} - -func init() { - t["ArrayOfHostEventArgument"] = reflect.TypeOf((*ArrayOfHostEventArgument)(nil)).Elem() -} - -type ArrayOfHostFeatureCapability struct { - HostFeatureCapability []HostFeatureCapability `xml:"HostFeatureCapability,omitempty"` -} - -func init() { - t["ArrayOfHostFeatureCapability"] = reflect.TypeOf((*ArrayOfHostFeatureCapability)(nil)).Elem() -} - -type ArrayOfHostFeatureMask struct { - HostFeatureMask []HostFeatureMask `xml:"HostFeatureMask,omitempty"` -} - -func init() { - t["ArrayOfHostFeatureMask"] = reflect.TypeOf((*ArrayOfHostFeatureMask)(nil)).Elem() -} - -type ArrayOfHostFeatureVersionInfo struct { - HostFeatureVersionInfo []HostFeatureVersionInfo `xml:"HostFeatureVersionInfo,omitempty"` -} - -func init() { - t["ArrayOfHostFeatureVersionInfo"] = reflect.TypeOf((*ArrayOfHostFeatureVersionInfo)(nil)).Elem() -} - -type ArrayOfHostFileSystemMountInfo struct { - HostFileSystemMountInfo []HostFileSystemMountInfo `xml:"HostFileSystemMountInfo,omitempty"` -} - -func init() { - t["ArrayOfHostFileSystemMountInfo"] = reflect.TypeOf((*ArrayOfHostFileSystemMountInfo)(nil)).Elem() -} - -type ArrayOfHostFirewallConfigRuleSetConfig struct { - HostFirewallConfigRuleSetConfig []HostFirewallConfigRuleSetConfig `xml:"HostFirewallConfigRuleSetConfig,omitempty"` -} - -func init() { - t["ArrayOfHostFirewallConfigRuleSetConfig"] = reflect.TypeOf((*ArrayOfHostFirewallConfigRuleSetConfig)(nil)).Elem() -} - -type ArrayOfHostFirewallRule struct { - HostFirewallRule []HostFirewallRule `xml:"HostFirewallRule,omitempty"` -} - -func init() { - t["ArrayOfHostFirewallRule"] = reflect.TypeOf((*ArrayOfHostFirewallRule)(nil)).Elem() -} - -type ArrayOfHostFirewallRuleset struct { - HostFirewallRuleset []HostFirewallRuleset `xml:"HostFirewallRuleset,omitempty"` -} - -func init() { - t["ArrayOfHostFirewallRuleset"] = reflect.TypeOf((*ArrayOfHostFirewallRuleset)(nil)).Elem() -} - -type ArrayOfHostFirewallRulesetIpNetwork struct { - HostFirewallRulesetIpNetwork []HostFirewallRulesetIpNetwork `xml:"HostFirewallRulesetIpNetwork,omitempty"` -} - -func init() { - t["ArrayOfHostFirewallRulesetIpNetwork"] = reflect.TypeOf((*ArrayOfHostFirewallRulesetIpNetwork)(nil)).Elem() -} - -type ArrayOfHostGraphicsInfo struct { - HostGraphicsInfo []HostGraphicsInfo `xml:"HostGraphicsInfo,omitempty"` -} - -func init() { - t["ArrayOfHostGraphicsInfo"] = reflect.TypeOf((*ArrayOfHostGraphicsInfo)(nil)).Elem() -} - -type ArrayOfHostHardwareElementInfo struct { - HostHardwareElementInfo []BaseHostHardwareElementInfo `xml:"HostHardwareElementInfo,omitempty,typeattr"` -} - -func init() { - t["ArrayOfHostHardwareElementInfo"] = reflect.TypeOf((*ArrayOfHostHardwareElementInfo)(nil)).Elem() -} - -type ArrayOfHostHostBusAdapter struct { - HostHostBusAdapter []BaseHostHostBusAdapter `xml:"HostHostBusAdapter,omitempty,typeattr"` -} - -func init() { - t["ArrayOfHostHostBusAdapter"] = reflect.TypeOf((*ArrayOfHostHostBusAdapter)(nil)).Elem() -} - -type ArrayOfHostInternetScsiHbaParamValue struct { - HostInternetScsiHbaParamValue []HostInternetScsiHbaParamValue `xml:"HostInternetScsiHbaParamValue,omitempty"` -} - -func init() { - t["ArrayOfHostInternetScsiHbaParamValue"] = reflect.TypeOf((*ArrayOfHostInternetScsiHbaParamValue)(nil)).Elem() -} - -type ArrayOfHostInternetScsiHbaSendTarget struct { - HostInternetScsiHbaSendTarget []HostInternetScsiHbaSendTarget `xml:"HostInternetScsiHbaSendTarget,omitempty"` -} - -func init() { - t["ArrayOfHostInternetScsiHbaSendTarget"] = reflect.TypeOf((*ArrayOfHostInternetScsiHbaSendTarget)(nil)).Elem() -} - -type ArrayOfHostInternetScsiHbaStaticTarget struct { - HostInternetScsiHbaStaticTarget []HostInternetScsiHbaStaticTarget `xml:"HostInternetScsiHbaStaticTarget,omitempty"` -} - -func init() { - t["ArrayOfHostInternetScsiHbaStaticTarget"] = reflect.TypeOf((*ArrayOfHostInternetScsiHbaStaticTarget)(nil)).Elem() -} - -type ArrayOfHostIpConfigIpV6Address struct { - HostIpConfigIpV6Address []HostIpConfigIpV6Address `xml:"HostIpConfigIpV6Address,omitempty"` -} - -func init() { - t["ArrayOfHostIpConfigIpV6Address"] = reflect.TypeOf((*ArrayOfHostIpConfigIpV6Address)(nil)).Elem() -} - -type ArrayOfHostIpRouteEntry struct { - HostIpRouteEntry []HostIpRouteEntry `xml:"HostIpRouteEntry,omitempty"` -} - -func init() { - t["ArrayOfHostIpRouteEntry"] = reflect.TypeOf((*ArrayOfHostIpRouteEntry)(nil)).Elem() -} - -type ArrayOfHostIpRouteOp struct { - HostIpRouteOp []HostIpRouteOp `xml:"HostIpRouteOp,omitempty"` -} - -func init() { - t["ArrayOfHostIpRouteOp"] = reflect.TypeOf((*ArrayOfHostIpRouteOp)(nil)).Elem() -} - -type ArrayOfHostLowLevelProvisioningManagerDiskLayoutSpec struct { - HostLowLevelProvisioningManagerDiskLayoutSpec []HostLowLevelProvisioningManagerDiskLayoutSpec `xml:"HostLowLevelProvisioningManagerDiskLayoutSpec,omitempty"` -} - -func init() { - t["ArrayOfHostLowLevelProvisioningManagerDiskLayoutSpec"] = reflect.TypeOf((*ArrayOfHostLowLevelProvisioningManagerDiskLayoutSpec)(nil)).Elem() -} - -type ArrayOfHostLowLevelProvisioningManagerSnapshotLayoutSpec struct { - HostLowLevelProvisioningManagerSnapshotLayoutSpec []HostLowLevelProvisioningManagerSnapshotLayoutSpec `xml:"HostLowLevelProvisioningManagerSnapshotLayoutSpec,omitempty"` -} - -func init() { - t["ArrayOfHostLowLevelProvisioningManagerSnapshotLayoutSpec"] = reflect.TypeOf((*ArrayOfHostLowLevelProvisioningManagerSnapshotLayoutSpec)(nil)).Elem() -} - -type ArrayOfHostMemberHealthCheckResult struct { - HostMemberHealthCheckResult []BaseHostMemberHealthCheckResult `xml:"HostMemberHealthCheckResult,omitempty,typeattr"` -} - -func init() { - t["ArrayOfHostMemberHealthCheckResult"] = reflect.TypeOf((*ArrayOfHostMemberHealthCheckResult)(nil)).Elem() -} - -type ArrayOfHostMemberRuntimeInfo struct { - HostMemberRuntimeInfo []HostMemberRuntimeInfo `xml:"HostMemberRuntimeInfo,omitempty"` -} - -func init() { - t["ArrayOfHostMemberRuntimeInfo"] = reflect.TypeOf((*ArrayOfHostMemberRuntimeInfo)(nil)).Elem() -} - -type ArrayOfHostMultipathInfoLogicalUnit struct { - HostMultipathInfoLogicalUnit []HostMultipathInfoLogicalUnit `xml:"HostMultipathInfoLogicalUnit,omitempty"` -} - -func init() { - t["ArrayOfHostMultipathInfoLogicalUnit"] = reflect.TypeOf((*ArrayOfHostMultipathInfoLogicalUnit)(nil)).Elem() -} - -type ArrayOfHostMultipathInfoPath struct { - HostMultipathInfoPath []HostMultipathInfoPath `xml:"HostMultipathInfoPath,omitempty"` -} - -func init() { - t["ArrayOfHostMultipathInfoPath"] = reflect.TypeOf((*ArrayOfHostMultipathInfoPath)(nil)).Elem() -} - -type ArrayOfHostMultipathStateInfoPath struct { - HostMultipathStateInfoPath []HostMultipathStateInfoPath `xml:"HostMultipathStateInfoPath,omitempty"` -} - -func init() { - t["ArrayOfHostMultipathStateInfoPath"] = reflect.TypeOf((*ArrayOfHostMultipathStateInfoPath)(nil)).Elem() -} - -type ArrayOfHostNasVolumeConfig struct { - HostNasVolumeConfig []HostNasVolumeConfig `xml:"HostNasVolumeConfig,omitempty"` -} - -func init() { - t["ArrayOfHostNasVolumeConfig"] = reflect.TypeOf((*ArrayOfHostNasVolumeConfig)(nil)).Elem() -} - -type ArrayOfHostNatService struct { - HostNatService []HostNatService `xml:"HostNatService,omitempty"` -} - -func init() { - t["ArrayOfHostNatService"] = reflect.TypeOf((*ArrayOfHostNatService)(nil)).Elem() -} - -type ArrayOfHostNatServiceConfig struct { - HostNatServiceConfig []HostNatServiceConfig `xml:"HostNatServiceConfig,omitempty"` -} - -func init() { - t["ArrayOfHostNatServiceConfig"] = reflect.TypeOf((*ArrayOfHostNatServiceConfig)(nil)).Elem() -} - -type ArrayOfHostNatServicePortForwardSpec struct { - HostNatServicePortForwardSpec []HostNatServicePortForwardSpec `xml:"HostNatServicePortForwardSpec,omitempty"` -} - -func init() { - t["ArrayOfHostNatServicePortForwardSpec"] = reflect.TypeOf((*ArrayOfHostNatServicePortForwardSpec)(nil)).Elem() -} - -type ArrayOfHostNetStackInstance struct { - HostNetStackInstance []HostNetStackInstance `xml:"HostNetStackInstance,omitempty"` -} - -func init() { - t["ArrayOfHostNetStackInstance"] = reflect.TypeOf((*ArrayOfHostNetStackInstance)(nil)).Elem() -} - -type ArrayOfHostNetworkConfigNetStackSpec struct { - HostNetworkConfigNetStackSpec []HostNetworkConfigNetStackSpec `xml:"HostNetworkConfigNetStackSpec,omitempty"` -} - -func init() { - t["ArrayOfHostNetworkConfigNetStackSpec"] = reflect.TypeOf((*ArrayOfHostNetworkConfigNetStackSpec)(nil)).Elem() -} - -type ArrayOfHostNumaNode struct { - HostNumaNode []HostNumaNode `xml:"HostNumaNode,omitempty"` -} - -func init() { - t["ArrayOfHostNumaNode"] = reflect.TypeOf((*ArrayOfHostNumaNode)(nil)).Elem() -} - -type ArrayOfHostNumericSensorInfo struct { - HostNumericSensorInfo []HostNumericSensorInfo `xml:"HostNumericSensorInfo,omitempty"` -} - -func init() { - t["ArrayOfHostNumericSensorInfo"] = reflect.TypeOf((*ArrayOfHostNumericSensorInfo)(nil)).Elem() -} - -type ArrayOfHostOpaqueNetworkInfo struct { - HostOpaqueNetworkInfo []HostOpaqueNetworkInfo `xml:"HostOpaqueNetworkInfo,omitempty"` -} - -func init() { - t["ArrayOfHostOpaqueNetworkInfo"] = reflect.TypeOf((*ArrayOfHostOpaqueNetworkInfo)(nil)).Elem() -} - -type ArrayOfHostOpaqueSwitch struct { - HostOpaqueSwitch []HostOpaqueSwitch `xml:"HostOpaqueSwitch,omitempty"` -} - -func init() { - t["ArrayOfHostOpaqueSwitch"] = reflect.TypeOf((*ArrayOfHostOpaqueSwitch)(nil)).Elem() -} - -type ArrayOfHostPatchManagerStatus struct { - HostPatchManagerStatus []HostPatchManagerStatus `xml:"HostPatchManagerStatus,omitempty"` -} - -func init() { - t["ArrayOfHostPatchManagerStatus"] = reflect.TypeOf((*ArrayOfHostPatchManagerStatus)(nil)).Elem() -} - -type ArrayOfHostPatchManagerStatusPrerequisitePatch struct { - HostPatchManagerStatusPrerequisitePatch []HostPatchManagerStatusPrerequisitePatch `xml:"HostPatchManagerStatusPrerequisitePatch,omitempty"` -} - -func init() { - t["ArrayOfHostPatchManagerStatusPrerequisitePatch"] = reflect.TypeOf((*ArrayOfHostPatchManagerStatusPrerequisitePatch)(nil)).Elem() -} - -type ArrayOfHostPathSelectionPolicyOption struct { - HostPathSelectionPolicyOption []HostPathSelectionPolicyOption `xml:"HostPathSelectionPolicyOption,omitempty"` -} - -func init() { - t["ArrayOfHostPathSelectionPolicyOption"] = reflect.TypeOf((*ArrayOfHostPathSelectionPolicyOption)(nil)).Elem() -} - -type ArrayOfHostPciDevice struct { - HostPciDevice []HostPciDevice `xml:"HostPciDevice,omitempty"` -} - -func init() { - t["ArrayOfHostPciDevice"] = reflect.TypeOf((*ArrayOfHostPciDevice)(nil)).Elem() -} - -type ArrayOfHostPciPassthruConfig struct { - HostPciPassthruConfig []BaseHostPciPassthruConfig `xml:"HostPciPassthruConfig,omitempty,typeattr"` -} - -func init() { - t["ArrayOfHostPciPassthruConfig"] = reflect.TypeOf((*ArrayOfHostPciPassthruConfig)(nil)).Elem() -} - -type ArrayOfHostPciPassthruInfo struct { - HostPciPassthruInfo []BaseHostPciPassthruInfo `xml:"HostPciPassthruInfo,omitempty,typeattr"` -} - -func init() { - t["ArrayOfHostPciPassthruInfo"] = reflect.TypeOf((*ArrayOfHostPciPassthruInfo)(nil)).Elem() -} - -type ArrayOfHostPlugStoreTopologyAdapter struct { - HostPlugStoreTopologyAdapter []HostPlugStoreTopologyAdapter `xml:"HostPlugStoreTopologyAdapter,omitempty"` -} - -func init() { - t["ArrayOfHostPlugStoreTopologyAdapter"] = reflect.TypeOf((*ArrayOfHostPlugStoreTopologyAdapter)(nil)).Elem() -} - -type ArrayOfHostPlugStoreTopologyDevice struct { - HostPlugStoreTopologyDevice []HostPlugStoreTopologyDevice `xml:"HostPlugStoreTopologyDevice,omitempty"` -} - -func init() { - t["ArrayOfHostPlugStoreTopologyDevice"] = reflect.TypeOf((*ArrayOfHostPlugStoreTopologyDevice)(nil)).Elem() -} - -type ArrayOfHostPlugStoreTopologyPath struct { - HostPlugStoreTopologyPath []HostPlugStoreTopologyPath `xml:"HostPlugStoreTopologyPath,omitempty"` -} - -func init() { - t["ArrayOfHostPlugStoreTopologyPath"] = reflect.TypeOf((*ArrayOfHostPlugStoreTopologyPath)(nil)).Elem() -} - -type ArrayOfHostPlugStoreTopologyPlugin struct { - HostPlugStoreTopologyPlugin []HostPlugStoreTopologyPlugin `xml:"HostPlugStoreTopologyPlugin,omitempty"` -} - -func init() { - t["ArrayOfHostPlugStoreTopologyPlugin"] = reflect.TypeOf((*ArrayOfHostPlugStoreTopologyPlugin)(nil)).Elem() -} - -type ArrayOfHostPlugStoreTopologyTarget struct { - HostPlugStoreTopologyTarget []HostPlugStoreTopologyTarget `xml:"HostPlugStoreTopologyTarget,omitempty"` -} - -func init() { - t["ArrayOfHostPlugStoreTopologyTarget"] = reflect.TypeOf((*ArrayOfHostPlugStoreTopologyTarget)(nil)).Elem() -} - -type ArrayOfHostPortGroup struct { - HostPortGroup []HostPortGroup `xml:"HostPortGroup,omitempty"` -} - -func init() { - t["ArrayOfHostPortGroup"] = reflect.TypeOf((*ArrayOfHostPortGroup)(nil)).Elem() -} - -type ArrayOfHostPortGroupConfig struct { - HostPortGroupConfig []HostPortGroupConfig `xml:"HostPortGroupConfig,omitempty"` -} - -func init() { - t["ArrayOfHostPortGroupConfig"] = reflect.TypeOf((*ArrayOfHostPortGroupConfig)(nil)).Elem() -} - -type ArrayOfHostPortGroupPort struct { - HostPortGroupPort []HostPortGroupPort `xml:"HostPortGroupPort,omitempty"` -} - -func init() { - t["ArrayOfHostPortGroupPort"] = reflect.TypeOf((*ArrayOfHostPortGroupPort)(nil)).Elem() -} - -type ArrayOfHostPortGroupProfile struct { - HostPortGroupProfile []HostPortGroupProfile `xml:"HostPortGroupProfile,omitempty"` -} - -func init() { - t["ArrayOfHostPortGroupProfile"] = reflect.TypeOf((*ArrayOfHostPortGroupProfile)(nil)).Elem() -} - -type ArrayOfHostPowerPolicy struct { - HostPowerPolicy []HostPowerPolicy `xml:"HostPowerPolicy,omitempty"` -} - -func init() { - t["ArrayOfHostPowerPolicy"] = reflect.TypeOf((*ArrayOfHostPowerPolicy)(nil)).Elem() -} - -type ArrayOfHostProxySwitch struct { - HostProxySwitch []HostProxySwitch `xml:"HostProxySwitch,omitempty"` -} - -func init() { - t["ArrayOfHostProxySwitch"] = reflect.TypeOf((*ArrayOfHostProxySwitch)(nil)).Elem() -} - -type ArrayOfHostProxySwitchConfig struct { - HostProxySwitchConfig []HostProxySwitchConfig `xml:"HostProxySwitchConfig,omitempty"` -} - -func init() { - t["ArrayOfHostProxySwitchConfig"] = reflect.TypeOf((*ArrayOfHostProxySwitchConfig)(nil)).Elem() -} - -type ArrayOfHostProxySwitchHostLagConfig struct { - HostProxySwitchHostLagConfig []HostProxySwitchHostLagConfig `xml:"HostProxySwitchHostLagConfig,omitempty"` -} - -func init() { - t["ArrayOfHostProxySwitchHostLagConfig"] = reflect.TypeOf((*ArrayOfHostProxySwitchHostLagConfig)(nil)).Elem() -} - -type ArrayOfHostRuntimeInfoNetStackInstanceRuntimeInfo struct { - HostRuntimeInfoNetStackInstanceRuntimeInfo []HostRuntimeInfoNetStackInstanceRuntimeInfo `xml:"HostRuntimeInfoNetStackInstanceRuntimeInfo,omitempty"` -} - -func init() { - t["ArrayOfHostRuntimeInfoNetStackInstanceRuntimeInfo"] = reflect.TypeOf((*ArrayOfHostRuntimeInfoNetStackInstanceRuntimeInfo)(nil)).Elem() -} - -type ArrayOfHostScsiDisk struct { - HostScsiDisk []HostScsiDisk `xml:"HostScsiDisk,omitempty"` -} - -func init() { - t["ArrayOfHostScsiDisk"] = reflect.TypeOf((*ArrayOfHostScsiDisk)(nil)).Elem() -} - -type ArrayOfHostScsiDiskPartition struct { - HostScsiDiskPartition []HostScsiDiskPartition `xml:"HostScsiDiskPartition,omitempty"` -} - -func init() { - t["ArrayOfHostScsiDiskPartition"] = reflect.TypeOf((*ArrayOfHostScsiDiskPartition)(nil)).Elem() -} - -type ArrayOfHostScsiTopologyInterface struct { - HostScsiTopologyInterface []HostScsiTopologyInterface `xml:"HostScsiTopologyInterface,omitempty"` -} - -func init() { - t["ArrayOfHostScsiTopologyInterface"] = reflect.TypeOf((*ArrayOfHostScsiTopologyInterface)(nil)).Elem() -} - -type ArrayOfHostScsiTopologyLun struct { - HostScsiTopologyLun []HostScsiTopologyLun `xml:"HostScsiTopologyLun,omitempty"` -} - -func init() { - t["ArrayOfHostScsiTopologyLun"] = reflect.TypeOf((*ArrayOfHostScsiTopologyLun)(nil)).Elem() -} - -type ArrayOfHostScsiTopologyTarget struct { - HostScsiTopologyTarget []HostScsiTopologyTarget `xml:"HostScsiTopologyTarget,omitempty"` -} - -func init() { - t["ArrayOfHostScsiTopologyTarget"] = reflect.TypeOf((*ArrayOfHostScsiTopologyTarget)(nil)).Elem() -} - -type ArrayOfHostService struct { - HostService []HostService `xml:"HostService,omitempty"` -} - -func init() { - t["ArrayOfHostService"] = reflect.TypeOf((*ArrayOfHostService)(nil)).Elem() -} - -type ArrayOfHostServiceConfig struct { - HostServiceConfig []HostServiceConfig `xml:"HostServiceConfig,omitempty"` -} - -func init() { - t["ArrayOfHostServiceConfig"] = reflect.TypeOf((*ArrayOfHostServiceConfig)(nil)).Elem() -} - -type ArrayOfHostSnmpDestination struct { - HostSnmpDestination []HostSnmpDestination `xml:"HostSnmpDestination,omitempty"` -} - -func init() { - t["ArrayOfHostSnmpDestination"] = reflect.TypeOf((*ArrayOfHostSnmpDestination)(nil)).Elem() -} - -type ArrayOfHostSslThumbprintInfo struct { - HostSslThumbprintInfo []HostSslThumbprintInfo `xml:"HostSslThumbprintInfo,omitempty"` -} - -func init() { - t["ArrayOfHostSslThumbprintInfo"] = reflect.TypeOf((*ArrayOfHostSslThumbprintInfo)(nil)).Elem() -} - -type ArrayOfHostStorageArrayTypePolicyOption struct { - HostStorageArrayTypePolicyOption []HostStorageArrayTypePolicyOption `xml:"HostStorageArrayTypePolicyOption,omitempty"` -} - -func init() { - t["ArrayOfHostStorageArrayTypePolicyOption"] = reflect.TypeOf((*ArrayOfHostStorageArrayTypePolicyOption)(nil)).Elem() -} - -type ArrayOfHostStorageElementInfo struct { - HostStorageElementInfo []HostStorageElementInfo `xml:"HostStorageElementInfo,omitempty"` -} - -func init() { - t["ArrayOfHostStorageElementInfo"] = reflect.TypeOf((*ArrayOfHostStorageElementInfo)(nil)).Elem() -} - -type ArrayOfHostStorageOperationalInfo struct { - HostStorageOperationalInfo []HostStorageOperationalInfo `xml:"HostStorageOperationalInfo,omitempty"` -} - -func init() { - t["ArrayOfHostStorageOperationalInfo"] = reflect.TypeOf((*ArrayOfHostStorageOperationalInfo)(nil)).Elem() -} - -type ArrayOfHostSystemIdentificationInfo struct { - HostSystemIdentificationInfo []HostSystemIdentificationInfo `xml:"HostSystemIdentificationInfo,omitempty"` -} - -func init() { - t["ArrayOfHostSystemIdentificationInfo"] = reflect.TypeOf((*ArrayOfHostSystemIdentificationInfo)(nil)).Elem() -} - -type ArrayOfHostSystemResourceInfo struct { - HostSystemResourceInfo []HostSystemResourceInfo `xml:"HostSystemResourceInfo,omitempty"` -} - -func init() { - t["ArrayOfHostSystemResourceInfo"] = reflect.TypeOf((*ArrayOfHostSystemResourceInfo)(nil)).Elem() -} - -type ArrayOfHostSystemSwapConfigurationSystemSwapOption struct { - HostSystemSwapConfigurationSystemSwapOption []BaseHostSystemSwapConfigurationSystemSwapOption `xml:"HostSystemSwapConfigurationSystemSwapOption,omitempty,typeattr"` -} - -func init() { - t["ArrayOfHostSystemSwapConfigurationSystemSwapOption"] = reflect.TypeOf((*ArrayOfHostSystemSwapConfigurationSystemSwapOption)(nil)).Elem() -} - -type ArrayOfHostTpmDigestInfo struct { - HostTpmDigestInfo []HostTpmDigestInfo `xml:"HostTpmDigestInfo,omitempty"` -} - -func init() { - t["ArrayOfHostTpmDigestInfo"] = reflect.TypeOf((*ArrayOfHostTpmDigestInfo)(nil)).Elem() -} - -type ArrayOfHostTpmEventLogEntry struct { - HostTpmEventLogEntry []HostTpmEventLogEntry `xml:"HostTpmEventLogEntry,omitempty"` -} - -func init() { - t["ArrayOfHostTpmEventLogEntry"] = reflect.TypeOf((*ArrayOfHostTpmEventLogEntry)(nil)).Elem() -} - -type ArrayOfHostUnresolvedVmfsExtent struct { - HostUnresolvedVmfsExtent []HostUnresolvedVmfsExtent `xml:"HostUnresolvedVmfsExtent,omitempty"` -} - -func init() { - t["ArrayOfHostUnresolvedVmfsExtent"] = reflect.TypeOf((*ArrayOfHostUnresolvedVmfsExtent)(nil)).Elem() -} - -type ArrayOfHostUnresolvedVmfsResolutionResult struct { - HostUnresolvedVmfsResolutionResult []HostUnresolvedVmfsResolutionResult `xml:"HostUnresolvedVmfsResolutionResult,omitempty"` -} - -func init() { - t["ArrayOfHostUnresolvedVmfsResolutionResult"] = reflect.TypeOf((*ArrayOfHostUnresolvedVmfsResolutionResult)(nil)).Elem() -} - -type ArrayOfHostUnresolvedVmfsResolutionSpec struct { - HostUnresolvedVmfsResolutionSpec []HostUnresolvedVmfsResolutionSpec `xml:"HostUnresolvedVmfsResolutionSpec,omitempty"` -} - -func init() { - t["ArrayOfHostUnresolvedVmfsResolutionSpec"] = reflect.TypeOf((*ArrayOfHostUnresolvedVmfsResolutionSpec)(nil)).Elem() -} - -type ArrayOfHostUnresolvedVmfsVolume struct { - HostUnresolvedVmfsVolume []HostUnresolvedVmfsVolume `xml:"HostUnresolvedVmfsVolume,omitempty"` -} - -func init() { - t["ArrayOfHostUnresolvedVmfsVolume"] = reflect.TypeOf((*ArrayOfHostUnresolvedVmfsVolume)(nil)).Elem() -} - -type ArrayOfHostVFlashManagerVFlashCacheConfigInfoVFlashModuleConfigOption struct { - HostVFlashManagerVFlashCacheConfigInfoVFlashModuleConfigOption []HostVFlashManagerVFlashCacheConfigInfoVFlashModuleConfigOption `xml:"HostVFlashManagerVFlashCacheConfigInfoVFlashModuleConfigOption,omitempty"` -} - -func init() { - t["ArrayOfHostVFlashManagerVFlashCacheConfigInfoVFlashModuleConfigOption"] = reflect.TypeOf((*ArrayOfHostVFlashManagerVFlashCacheConfigInfoVFlashModuleConfigOption)(nil)).Elem() -} - -type ArrayOfHostVMotionCompatibility struct { - HostVMotionCompatibility []HostVMotionCompatibility `xml:"HostVMotionCompatibility,omitempty"` -} - -func init() { - t["ArrayOfHostVMotionCompatibility"] = reflect.TypeOf((*ArrayOfHostVMotionCompatibility)(nil)).Elem() -} - -type ArrayOfHostVirtualNic struct { - HostVirtualNic []HostVirtualNic `xml:"HostVirtualNic,omitempty"` -} - -func init() { - t["ArrayOfHostVirtualNic"] = reflect.TypeOf((*ArrayOfHostVirtualNic)(nil)).Elem() -} - -type ArrayOfHostVirtualNicConfig struct { - HostVirtualNicConfig []HostVirtualNicConfig `xml:"HostVirtualNicConfig,omitempty"` -} - -func init() { - t["ArrayOfHostVirtualNicConfig"] = reflect.TypeOf((*ArrayOfHostVirtualNicConfig)(nil)).Elem() -} - -type ArrayOfHostVirtualNicManagerNicTypeSelection struct { - HostVirtualNicManagerNicTypeSelection []HostVirtualNicManagerNicTypeSelection `xml:"HostVirtualNicManagerNicTypeSelection,omitempty"` -} - -func init() { - t["ArrayOfHostVirtualNicManagerNicTypeSelection"] = reflect.TypeOf((*ArrayOfHostVirtualNicManagerNicTypeSelection)(nil)).Elem() -} - -type ArrayOfHostVirtualSwitch struct { - HostVirtualSwitch []HostVirtualSwitch `xml:"HostVirtualSwitch,omitempty"` -} - -func init() { - t["ArrayOfHostVirtualSwitch"] = reflect.TypeOf((*ArrayOfHostVirtualSwitch)(nil)).Elem() -} - -type ArrayOfHostVirtualSwitchConfig struct { - HostVirtualSwitchConfig []HostVirtualSwitchConfig `xml:"HostVirtualSwitchConfig,omitempty"` -} - -func init() { - t["ArrayOfHostVirtualSwitchConfig"] = reflect.TypeOf((*ArrayOfHostVirtualSwitchConfig)(nil)).Elem() -} - -type ArrayOfHostVmciAccessManagerAccessSpec struct { - HostVmciAccessManagerAccessSpec []HostVmciAccessManagerAccessSpec `xml:"HostVmciAccessManagerAccessSpec,omitempty"` -} - -func init() { - t["ArrayOfHostVmciAccessManagerAccessSpec"] = reflect.TypeOf((*ArrayOfHostVmciAccessManagerAccessSpec)(nil)).Elem() -} - -type ArrayOfHostVmfsRescanResult struct { - HostVmfsRescanResult []HostVmfsRescanResult `xml:"HostVmfsRescanResult,omitempty"` -} - -func init() { - t["ArrayOfHostVmfsRescanResult"] = reflect.TypeOf((*ArrayOfHostVmfsRescanResult)(nil)).Elem() -} - -type ArrayOfHostVsanInternalSystemCmmdsQuery struct { - HostVsanInternalSystemCmmdsQuery []HostVsanInternalSystemCmmdsQuery `xml:"HostVsanInternalSystemCmmdsQuery,omitempty"` -} - -func init() { - t["ArrayOfHostVsanInternalSystemCmmdsQuery"] = reflect.TypeOf((*ArrayOfHostVsanInternalSystemCmmdsQuery)(nil)).Elem() -} - -type ArrayOfHttpNfcLeaseDatastoreLeaseInfo struct { - HttpNfcLeaseDatastoreLeaseInfo []HttpNfcLeaseDatastoreLeaseInfo `xml:"HttpNfcLeaseDatastoreLeaseInfo,omitempty"` -} - -func init() { - t["ArrayOfHttpNfcLeaseDatastoreLeaseInfo"] = reflect.TypeOf((*ArrayOfHttpNfcLeaseDatastoreLeaseInfo)(nil)).Elem() -} - -type ArrayOfHttpNfcLeaseDeviceUrl struct { - HttpNfcLeaseDeviceUrl []HttpNfcLeaseDeviceUrl `xml:"HttpNfcLeaseDeviceUrl,omitempty"` -} - -func init() { - t["ArrayOfHttpNfcLeaseDeviceUrl"] = reflect.TypeOf((*ArrayOfHttpNfcLeaseDeviceUrl)(nil)).Elem() -} - -type ArrayOfHttpNfcLeaseHostInfo struct { - HttpNfcLeaseHostInfo []HttpNfcLeaseHostInfo `xml:"HttpNfcLeaseHostInfo,omitempty"` -} - -func init() { - t["ArrayOfHttpNfcLeaseHostInfo"] = reflect.TypeOf((*ArrayOfHttpNfcLeaseHostInfo)(nil)).Elem() -} - -type ArrayOfHttpNfcLeaseManifestEntry struct { - HttpNfcLeaseManifestEntry []HttpNfcLeaseManifestEntry `xml:"HttpNfcLeaseManifestEntry,omitempty"` -} - -func init() { - t["ArrayOfHttpNfcLeaseManifestEntry"] = reflect.TypeOf((*ArrayOfHttpNfcLeaseManifestEntry)(nil)).Elem() -} - -type ArrayOfImportOperationBulkFaultFaultOnImport struct { - ImportOperationBulkFaultFaultOnImport []ImportOperationBulkFaultFaultOnImport `xml:"ImportOperationBulkFaultFaultOnImport,omitempty"` -} - -func init() { - t["ArrayOfImportOperationBulkFaultFaultOnImport"] = reflect.TypeOf((*ArrayOfImportOperationBulkFaultFaultOnImport)(nil)).Elem() -} - -type ArrayOfImportSpec struct { - ImportSpec []BaseImportSpec `xml:"ImportSpec,omitempty,typeattr"` -} - -func init() { - t["ArrayOfImportSpec"] = reflect.TypeOf((*ArrayOfImportSpec)(nil)).Elem() -} - -type ArrayOfInt struct { - Int []int `xml:"int,omitempty"` -} - -func init() { - t["ArrayOfInt"] = reflect.TypeOf((*ArrayOfInt)(nil)).Elem() -} - -type ArrayOfIpPool struct { - IpPool []IpPool `xml:"IpPool,omitempty"` -} - -func init() { - t["ArrayOfIpPool"] = reflect.TypeOf((*ArrayOfIpPool)(nil)).Elem() -} - -type ArrayOfIpPoolAssociation struct { - IpPoolAssociation []IpPoolAssociation `xml:"IpPoolAssociation,omitempty"` -} - -func init() { - t["ArrayOfIpPoolAssociation"] = reflect.TypeOf((*ArrayOfIpPoolAssociation)(nil)).Elem() -} - -type ArrayOfIpPoolManagerIpAllocation struct { - IpPoolManagerIpAllocation []IpPoolManagerIpAllocation `xml:"IpPoolManagerIpAllocation,omitempty"` -} - -func init() { - t["ArrayOfIpPoolManagerIpAllocation"] = reflect.TypeOf((*ArrayOfIpPoolManagerIpAllocation)(nil)).Elem() -} - -type ArrayOfIscsiDependencyEntity struct { - IscsiDependencyEntity []IscsiDependencyEntity `xml:"IscsiDependencyEntity,omitempty"` -} - -func init() { - t["ArrayOfIscsiDependencyEntity"] = reflect.TypeOf((*ArrayOfIscsiDependencyEntity)(nil)).Elem() -} - -type ArrayOfIscsiPortInfo struct { - IscsiPortInfo []IscsiPortInfo `xml:"IscsiPortInfo,omitempty"` -} - -func init() { - t["ArrayOfIscsiPortInfo"] = reflect.TypeOf((*ArrayOfIscsiPortInfo)(nil)).Elem() -} - -type ArrayOfKernelModuleInfo struct { - KernelModuleInfo []KernelModuleInfo `xml:"KernelModuleInfo,omitempty"` -} - -func init() { - t["ArrayOfKernelModuleInfo"] = reflect.TypeOf((*ArrayOfKernelModuleInfo)(nil)).Elem() -} - -type ArrayOfKeyAnyValue struct { - KeyAnyValue []KeyAnyValue `xml:"KeyAnyValue,omitempty"` -} - -func init() { - t["ArrayOfKeyAnyValue"] = reflect.TypeOf((*ArrayOfKeyAnyValue)(nil)).Elem() -} - -type ArrayOfKeyValue struct { - KeyValue []KeyValue `xml:"KeyValue,omitempty"` -} - -func init() { - t["ArrayOfKeyValue"] = reflect.TypeOf((*ArrayOfKeyValue)(nil)).Elem() -} - -type ArrayOfLicenseAssignmentManagerLicenseAssignment struct { - LicenseAssignmentManagerLicenseAssignment []LicenseAssignmentManagerLicenseAssignment `xml:"LicenseAssignmentManagerLicenseAssignment,omitempty"` -} - -func init() { - t["ArrayOfLicenseAssignmentManagerLicenseAssignment"] = reflect.TypeOf((*ArrayOfLicenseAssignmentManagerLicenseAssignment)(nil)).Elem() -} - -type ArrayOfLicenseAvailabilityInfo struct { - LicenseAvailabilityInfo []LicenseAvailabilityInfo `xml:"LicenseAvailabilityInfo,omitempty"` -} - -func init() { - t["ArrayOfLicenseAvailabilityInfo"] = reflect.TypeOf((*ArrayOfLicenseAvailabilityInfo)(nil)).Elem() -} - -type ArrayOfLicenseFeatureInfo struct { - LicenseFeatureInfo []LicenseFeatureInfo `xml:"LicenseFeatureInfo,omitempty"` -} - -func init() { - t["ArrayOfLicenseFeatureInfo"] = reflect.TypeOf((*ArrayOfLicenseFeatureInfo)(nil)).Elem() -} - -type ArrayOfLicenseManagerLicenseInfo struct { - LicenseManagerLicenseInfo []LicenseManagerLicenseInfo `xml:"LicenseManagerLicenseInfo,omitempty"` -} - -func init() { - t["ArrayOfLicenseManagerLicenseInfo"] = reflect.TypeOf((*ArrayOfLicenseManagerLicenseInfo)(nil)).Elem() -} - -type ArrayOfLicenseReservationInfo struct { - LicenseReservationInfo []LicenseReservationInfo `xml:"LicenseReservationInfo,omitempty"` -} - -func init() { - t["ArrayOfLicenseReservationInfo"] = reflect.TypeOf((*ArrayOfLicenseReservationInfo)(nil)).Elem() -} - -type ArrayOfLocalizableMessage struct { - LocalizableMessage []LocalizableMessage `xml:"LocalizableMessage,omitempty"` -} - -func init() { - t["ArrayOfLocalizableMessage"] = reflect.TypeOf((*ArrayOfLocalizableMessage)(nil)).Elem() -} - -type ArrayOfLocalizationManagerMessageCatalog struct { - LocalizationManagerMessageCatalog []LocalizationManagerMessageCatalog `xml:"LocalizationManagerMessageCatalog,omitempty"` -} - -func init() { - t["ArrayOfLocalizationManagerMessageCatalog"] = reflect.TypeOf((*ArrayOfLocalizationManagerMessageCatalog)(nil)).Elem() -} - -type ArrayOfLong struct { - Long []int64 `xml:"long,omitempty"` -} - -func init() { - t["ArrayOfLong"] = reflect.TypeOf((*ArrayOfLong)(nil)).Elem() -} - -type ArrayOfManagedObjectReference struct { - ManagedObjectReference []ManagedObjectReference `xml:"ManagedObjectReference,omitempty"` -} - -func init() { - t["ArrayOfManagedObjectReference"] = reflect.TypeOf((*ArrayOfManagedObjectReference)(nil)).Elem() -} - -type ArrayOfMethodActionArgument struct { - MethodActionArgument []MethodActionArgument `xml:"MethodActionArgument,omitempty"` -} - -func init() { - t["ArrayOfMethodActionArgument"] = reflect.TypeOf((*ArrayOfMethodActionArgument)(nil)).Elem() -} - -type ArrayOfMethodFault struct { - MethodFault []BaseMethodFault `xml:"MethodFault,omitempty,typeattr"` -} - -func init() { - t["ArrayOfMethodFault"] = reflect.TypeOf((*ArrayOfMethodFault)(nil)).Elem() -} - -type ArrayOfMissingObject struct { - MissingObject []MissingObject `xml:"MissingObject,omitempty"` -} - -func init() { - t["ArrayOfMissingObject"] = reflect.TypeOf((*ArrayOfMissingObject)(nil)).Elem() -} - -type ArrayOfMissingProperty struct { - MissingProperty []MissingProperty `xml:"MissingProperty,omitempty"` -} - -func init() { - t["ArrayOfMissingProperty"] = reflect.TypeOf((*ArrayOfMissingProperty)(nil)).Elem() -} - -type ArrayOfMultipleCertificatesVerifyFaultThumbprintData struct { - MultipleCertificatesVerifyFaultThumbprintData []MultipleCertificatesVerifyFaultThumbprintData `xml:"MultipleCertificatesVerifyFaultThumbprintData,omitempty"` -} - -func init() { - t["ArrayOfMultipleCertificatesVerifyFaultThumbprintData"] = reflect.TypeOf((*ArrayOfMultipleCertificatesVerifyFaultThumbprintData)(nil)).Elem() -} - -type ArrayOfNasStorageProfile struct { - NasStorageProfile []NasStorageProfile `xml:"NasStorageProfile,omitempty"` -} - -func init() { - t["ArrayOfNasStorageProfile"] = reflect.TypeOf((*ArrayOfNasStorageProfile)(nil)).Elem() -} - -type ArrayOfNetIpConfigInfoIpAddress struct { - NetIpConfigInfoIpAddress []NetIpConfigInfoIpAddress `xml:"NetIpConfigInfoIpAddress,omitempty"` -} - -func init() { - t["ArrayOfNetIpConfigInfoIpAddress"] = reflect.TypeOf((*ArrayOfNetIpConfigInfoIpAddress)(nil)).Elem() -} - -type ArrayOfNetIpConfigSpecIpAddressSpec struct { - NetIpConfigSpecIpAddressSpec []NetIpConfigSpecIpAddressSpec `xml:"NetIpConfigSpecIpAddressSpec,omitempty"` -} - -func init() { - t["ArrayOfNetIpConfigSpecIpAddressSpec"] = reflect.TypeOf((*ArrayOfNetIpConfigSpecIpAddressSpec)(nil)).Elem() -} - -type ArrayOfNetIpRouteConfigInfoIpRoute struct { - NetIpRouteConfigInfoIpRoute []NetIpRouteConfigInfoIpRoute `xml:"NetIpRouteConfigInfoIpRoute,omitempty"` -} - -func init() { - t["ArrayOfNetIpRouteConfigInfoIpRoute"] = reflect.TypeOf((*ArrayOfNetIpRouteConfigInfoIpRoute)(nil)).Elem() -} - -type ArrayOfNetIpRouteConfigSpecIpRouteSpec struct { - NetIpRouteConfigSpecIpRouteSpec []NetIpRouteConfigSpecIpRouteSpec `xml:"NetIpRouteConfigSpecIpRouteSpec,omitempty"` -} - -func init() { - t["ArrayOfNetIpRouteConfigSpecIpRouteSpec"] = reflect.TypeOf((*ArrayOfNetIpRouteConfigSpecIpRouteSpec)(nil)).Elem() -} - -type ArrayOfNetIpStackInfoDefaultRouter struct { - NetIpStackInfoDefaultRouter []NetIpStackInfoDefaultRouter `xml:"NetIpStackInfoDefaultRouter,omitempty"` -} - -func init() { - t["ArrayOfNetIpStackInfoDefaultRouter"] = reflect.TypeOf((*ArrayOfNetIpStackInfoDefaultRouter)(nil)).Elem() -} - -type ArrayOfNetIpStackInfoNetToMedia struct { - NetIpStackInfoNetToMedia []NetIpStackInfoNetToMedia `xml:"NetIpStackInfoNetToMedia,omitempty"` -} - -func init() { - t["ArrayOfNetIpStackInfoNetToMedia"] = reflect.TypeOf((*ArrayOfNetIpStackInfoNetToMedia)(nil)).Elem() -} - -type ArrayOfNetStackInstanceProfile struct { - NetStackInstanceProfile []NetStackInstanceProfile `xml:"NetStackInstanceProfile,omitempty"` -} - -func init() { - t["ArrayOfNetStackInstanceProfile"] = reflect.TypeOf((*ArrayOfNetStackInstanceProfile)(nil)).Elem() -} - -type ArrayOfNumericRange struct { - NumericRange []NumericRange `xml:"NumericRange,omitempty"` -} - -func init() { - t["ArrayOfNumericRange"] = reflect.TypeOf((*ArrayOfNumericRange)(nil)).Elem() -} - -type ArrayOfObjectContent struct { - ObjectContent []ObjectContent `xml:"ObjectContent,omitempty"` -} - -func init() { - t["ArrayOfObjectContent"] = reflect.TypeOf((*ArrayOfObjectContent)(nil)).Elem() -} - -type ArrayOfObjectSpec struct { - ObjectSpec []ObjectSpec `xml:"ObjectSpec,omitempty"` -} - -func init() { - t["ArrayOfObjectSpec"] = reflect.TypeOf((*ArrayOfObjectSpec)(nil)).Elem() -} - -type ArrayOfObjectUpdate struct { - ObjectUpdate []ObjectUpdate `xml:"ObjectUpdate,omitempty"` -} - -func init() { - t["ArrayOfObjectUpdate"] = reflect.TypeOf((*ArrayOfObjectUpdate)(nil)).Elem() -} - -type ArrayOfOpaqueNetworkTargetInfo struct { - OpaqueNetworkTargetInfo []OpaqueNetworkTargetInfo `xml:"OpaqueNetworkTargetInfo,omitempty"` -} - -func init() { - t["ArrayOfOpaqueNetworkTargetInfo"] = reflect.TypeOf((*ArrayOfOpaqueNetworkTargetInfo)(nil)).Elem() -} - -type ArrayOfOptionDef struct { - OptionDef []OptionDef `xml:"OptionDef,omitempty"` -} - -func init() { - t["ArrayOfOptionDef"] = reflect.TypeOf((*ArrayOfOptionDef)(nil)).Elem() -} - -type ArrayOfOptionProfile struct { - OptionProfile []OptionProfile `xml:"OptionProfile,omitempty"` -} - -func init() { - t["ArrayOfOptionProfile"] = reflect.TypeOf((*ArrayOfOptionProfile)(nil)).Elem() -} - -type ArrayOfOptionValue struct { - OptionValue []BaseOptionValue `xml:"OptionValue,omitempty,typeattr"` -} - -func init() { - t["ArrayOfOptionValue"] = reflect.TypeOf((*ArrayOfOptionValue)(nil)).Elem() -} - -type ArrayOfOvfConsumerOstNode struct { - OvfConsumerOstNode []OvfConsumerOstNode `xml:"OvfConsumerOstNode,omitempty"` -} - -func init() { - t["ArrayOfOvfConsumerOstNode"] = reflect.TypeOf((*ArrayOfOvfConsumerOstNode)(nil)).Elem() -} - -type ArrayOfOvfConsumerOvfSection struct { - OvfConsumerOvfSection []OvfConsumerOvfSection `xml:"OvfConsumerOvfSection,omitempty"` -} - -func init() { - t["ArrayOfOvfConsumerOvfSection"] = reflect.TypeOf((*ArrayOfOvfConsumerOvfSection)(nil)).Elem() -} - -type ArrayOfOvfDeploymentOption struct { - OvfDeploymentOption []OvfDeploymentOption `xml:"OvfDeploymentOption,omitempty"` -} - -func init() { - t["ArrayOfOvfDeploymentOption"] = reflect.TypeOf((*ArrayOfOvfDeploymentOption)(nil)).Elem() -} - -type ArrayOfOvfFile struct { - OvfFile []OvfFile `xml:"OvfFile,omitempty"` -} - -func init() { - t["ArrayOfOvfFile"] = reflect.TypeOf((*ArrayOfOvfFile)(nil)).Elem() -} - -type ArrayOfOvfFileItem struct { - OvfFileItem []OvfFileItem `xml:"OvfFileItem,omitempty"` -} - -func init() { - t["ArrayOfOvfFileItem"] = reflect.TypeOf((*ArrayOfOvfFileItem)(nil)).Elem() -} - -type ArrayOfOvfNetworkInfo struct { - OvfNetworkInfo []OvfNetworkInfo `xml:"OvfNetworkInfo,omitempty"` -} - -func init() { - t["ArrayOfOvfNetworkInfo"] = reflect.TypeOf((*ArrayOfOvfNetworkInfo)(nil)).Elem() -} - -type ArrayOfOvfNetworkMapping struct { - OvfNetworkMapping []OvfNetworkMapping `xml:"OvfNetworkMapping,omitempty"` -} - -func init() { - t["ArrayOfOvfNetworkMapping"] = reflect.TypeOf((*ArrayOfOvfNetworkMapping)(nil)).Elem() -} - -type ArrayOfOvfOptionInfo struct { - OvfOptionInfo []OvfOptionInfo `xml:"OvfOptionInfo,omitempty"` -} - -func init() { - t["ArrayOfOvfOptionInfo"] = reflect.TypeOf((*ArrayOfOvfOptionInfo)(nil)).Elem() -} - -type ArrayOfOvfResourceMap struct { - OvfResourceMap []OvfResourceMap `xml:"OvfResourceMap,omitempty"` -} - -func init() { - t["ArrayOfOvfResourceMap"] = reflect.TypeOf((*ArrayOfOvfResourceMap)(nil)).Elem() -} - -type ArrayOfPerfCounterInfo struct { - PerfCounterInfo []PerfCounterInfo `xml:"PerfCounterInfo,omitempty"` -} - -func init() { - t["ArrayOfPerfCounterInfo"] = reflect.TypeOf((*ArrayOfPerfCounterInfo)(nil)).Elem() -} - -type ArrayOfPerfEntityMetricBase struct { - PerfEntityMetricBase []BasePerfEntityMetricBase `xml:"PerfEntityMetricBase,omitempty,typeattr"` -} - -func init() { - t["ArrayOfPerfEntityMetricBase"] = reflect.TypeOf((*ArrayOfPerfEntityMetricBase)(nil)).Elem() -} - -type ArrayOfPerfInterval struct { - PerfInterval []PerfInterval `xml:"PerfInterval,omitempty"` -} - -func init() { - t["ArrayOfPerfInterval"] = reflect.TypeOf((*ArrayOfPerfInterval)(nil)).Elem() -} - -type ArrayOfPerfMetricId struct { - PerfMetricId []PerfMetricId `xml:"PerfMetricId,omitempty"` -} - -func init() { - t["ArrayOfPerfMetricId"] = reflect.TypeOf((*ArrayOfPerfMetricId)(nil)).Elem() -} - -type ArrayOfPerfMetricSeries struct { - PerfMetricSeries []BasePerfMetricSeries `xml:"PerfMetricSeries,omitempty,typeattr"` -} - -func init() { - t["ArrayOfPerfMetricSeries"] = reflect.TypeOf((*ArrayOfPerfMetricSeries)(nil)).Elem() -} - -type ArrayOfPerfMetricSeriesCSV struct { - PerfMetricSeriesCSV []PerfMetricSeriesCSV `xml:"PerfMetricSeriesCSV,omitempty"` -} - -func init() { - t["ArrayOfPerfMetricSeriesCSV"] = reflect.TypeOf((*ArrayOfPerfMetricSeriesCSV)(nil)).Elem() -} - -type ArrayOfPerfQuerySpec struct { - PerfQuerySpec []PerfQuerySpec `xml:"PerfQuerySpec,omitempty"` -} - -func init() { - t["ArrayOfPerfQuerySpec"] = reflect.TypeOf((*ArrayOfPerfQuerySpec)(nil)).Elem() -} - -type ArrayOfPerfSampleInfo struct { - PerfSampleInfo []PerfSampleInfo `xml:"PerfSampleInfo,omitempty"` -} - -func init() { - t["ArrayOfPerfSampleInfo"] = reflect.TypeOf((*ArrayOfPerfSampleInfo)(nil)).Elem() -} - -type ArrayOfPerformanceManagerCounterLevelMapping struct { - PerformanceManagerCounterLevelMapping []PerformanceManagerCounterLevelMapping `xml:"PerformanceManagerCounterLevelMapping,omitempty"` -} - -func init() { - t["ArrayOfPerformanceManagerCounterLevelMapping"] = reflect.TypeOf((*ArrayOfPerformanceManagerCounterLevelMapping)(nil)).Elem() -} - -type ArrayOfPermission struct { - Permission []Permission `xml:"Permission,omitempty"` -} - -func init() { - t["ArrayOfPermission"] = reflect.TypeOf((*ArrayOfPermission)(nil)).Elem() -} - -type ArrayOfPermissionProfile struct { - PermissionProfile []PermissionProfile `xml:"PermissionProfile,omitempty"` -} - -func init() { - t["ArrayOfPermissionProfile"] = reflect.TypeOf((*ArrayOfPermissionProfile)(nil)).Elem() -} - -type ArrayOfPhysicalNic struct { - PhysicalNic []PhysicalNic `xml:"PhysicalNic,omitempty"` -} - -func init() { - t["ArrayOfPhysicalNic"] = reflect.TypeOf((*ArrayOfPhysicalNic)(nil)).Elem() -} - -type ArrayOfPhysicalNicConfig struct { - PhysicalNicConfig []PhysicalNicConfig `xml:"PhysicalNicConfig,omitempty"` -} - -func init() { - t["ArrayOfPhysicalNicConfig"] = reflect.TypeOf((*ArrayOfPhysicalNicConfig)(nil)).Elem() -} - -type ArrayOfPhysicalNicHintInfo struct { - PhysicalNicHintInfo []PhysicalNicHintInfo `xml:"PhysicalNicHintInfo,omitempty"` -} - -func init() { - t["ArrayOfPhysicalNicHintInfo"] = reflect.TypeOf((*ArrayOfPhysicalNicHintInfo)(nil)).Elem() -} - -type ArrayOfPhysicalNicIpHint struct { - PhysicalNicIpHint []PhysicalNicIpHint `xml:"PhysicalNicIpHint,omitempty"` -} - -func init() { - t["ArrayOfPhysicalNicIpHint"] = reflect.TypeOf((*ArrayOfPhysicalNicIpHint)(nil)).Elem() -} - -type ArrayOfPhysicalNicLinkInfo struct { - PhysicalNicLinkInfo []PhysicalNicLinkInfo `xml:"PhysicalNicLinkInfo,omitempty"` -} - -func init() { - t["ArrayOfPhysicalNicLinkInfo"] = reflect.TypeOf((*ArrayOfPhysicalNicLinkInfo)(nil)).Elem() -} - -type ArrayOfPhysicalNicNameHint struct { - PhysicalNicNameHint []PhysicalNicNameHint `xml:"PhysicalNicNameHint,omitempty"` -} - -func init() { - t["ArrayOfPhysicalNicNameHint"] = reflect.TypeOf((*ArrayOfPhysicalNicNameHint)(nil)).Elem() -} - -type ArrayOfPhysicalNicProfile struct { - PhysicalNicProfile []PhysicalNicProfile `xml:"PhysicalNicProfile,omitempty"` -} - -func init() { - t["ArrayOfPhysicalNicProfile"] = reflect.TypeOf((*ArrayOfPhysicalNicProfile)(nil)).Elem() -} - -type ArrayOfPnicUplinkProfile struct { - PnicUplinkProfile []PnicUplinkProfile `xml:"PnicUplinkProfile,omitempty"` -} - -func init() { - t["ArrayOfPnicUplinkProfile"] = reflect.TypeOf((*ArrayOfPnicUplinkProfile)(nil)).Elem() -} - -type ArrayOfPodDiskLocator struct { - PodDiskLocator []PodDiskLocator `xml:"PodDiskLocator,omitempty"` -} - -func init() { - t["ArrayOfPodDiskLocator"] = reflect.TypeOf((*ArrayOfPodDiskLocator)(nil)).Elem() -} - -type ArrayOfPolicyOption struct { - PolicyOption []BasePolicyOption `xml:"PolicyOption,omitempty,typeattr"` -} - -func init() { - t["ArrayOfPolicyOption"] = reflect.TypeOf((*ArrayOfPolicyOption)(nil)).Elem() -} - -type ArrayOfPrivilegeAvailability struct { - PrivilegeAvailability []PrivilegeAvailability `xml:"PrivilegeAvailability,omitempty"` -} - -func init() { - t["ArrayOfPrivilegeAvailability"] = reflect.TypeOf((*ArrayOfPrivilegeAvailability)(nil)).Elem() -} - -type ArrayOfProductComponentInfo struct { - ProductComponentInfo []ProductComponentInfo `xml:"ProductComponentInfo,omitempty"` -} - -func init() { - t["ArrayOfProductComponentInfo"] = reflect.TypeOf((*ArrayOfProductComponentInfo)(nil)).Elem() -} - -type ArrayOfProfileApplyProfileProperty struct { - ProfileApplyProfileProperty []ProfileApplyProfileProperty `xml:"ProfileApplyProfileProperty,omitempty"` -} - -func init() { - t["ArrayOfProfileApplyProfileProperty"] = reflect.TypeOf((*ArrayOfProfileApplyProfileProperty)(nil)).Elem() -} - -type ArrayOfProfileDeferredPolicyOptionParameter struct { - ProfileDeferredPolicyOptionParameter []ProfileDeferredPolicyOptionParameter `xml:"ProfileDeferredPolicyOptionParameter,omitempty"` -} - -func init() { - t["ArrayOfProfileDeferredPolicyOptionParameter"] = reflect.TypeOf((*ArrayOfProfileDeferredPolicyOptionParameter)(nil)).Elem() -} - -type ArrayOfProfileDescriptionSection struct { - ProfileDescriptionSection []ProfileDescriptionSection `xml:"ProfileDescriptionSection,omitempty"` -} - -func init() { - t["ArrayOfProfileDescriptionSection"] = reflect.TypeOf((*ArrayOfProfileDescriptionSection)(nil)).Elem() -} - -type ArrayOfProfileExecuteError struct { - ProfileExecuteError []ProfileExecuteError `xml:"ProfileExecuteError,omitempty"` -} - -func init() { - t["ArrayOfProfileExecuteError"] = reflect.TypeOf((*ArrayOfProfileExecuteError)(nil)).Elem() -} - -type ArrayOfProfileExpression struct { - ProfileExpression []BaseProfileExpression `xml:"ProfileExpression,omitempty,typeattr"` -} - -func init() { - t["ArrayOfProfileExpression"] = reflect.TypeOf((*ArrayOfProfileExpression)(nil)).Elem() -} - -type ArrayOfProfileExpressionMetadata struct { - ProfileExpressionMetadata []ProfileExpressionMetadata `xml:"ProfileExpressionMetadata,omitempty"` -} - -func init() { - t["ArrayOfProfileExpressionMetadata"] = reflect.TypeOf((*ArrayOfProfileExpressionMetadata)(nil)).Elem() -} - -type ArrayOfProfileMetadata struct { - ProfileMetadata []ProfileMetadata `xml:"ProfileMetadata,omitempty"` -} - -func init() { - t["ArrayOfProfileMetadata"] = reflect.TypeOf((*ArrayOfProfileMetadata)(nil)).Elem() -} - -type ArrayOfProfileMetadataProfileSortSpec struct { - ProfileMetadataProfileSortSpec []ProfileMetadataProfileSortSpec `xml:"ProfileMetadataProfileSortSpec,omitempty"` -} - -func init() { - t["ArrayOfProfileMetadataProfileSortSpec"] = reflect.TypeOf((*ArrayOfProfileMetadataProfileSortSpec)(nil)).Elem() -} - -type ArrayOfProfileParameterMetadata struct { - ProfileParameterMetadata []ProfileParameterMetadata `xml:"ProfileParameterMetadata,omitempty"` -} - -func init() { - t["ArrayOfProfileParameterMetadata"] = reflect.TypeOf((*ArrayOfProfileParameterMetadata)(nil)).Elem() -} - -type ArrayOfProfilePolicy struct { - ProfilePolicy []ProfilePolicy `xml:"ProfilePolicy,omitempty"` -} - -func init() { - t["ArrayOfProfilePolicy"] = reflect.TypeOf((*ArrayOfProfilePolicy)(nil)).Elem() -} - -type ArrayOfProfilePolicyMetadata struct { - ProfilePolicyMetadata []ProfilePolicyMetadata `xml:"ProfilePolicyMetadata,omitempty"` -} - -func init() { - t["ArrayOfProfilePolicyMetadata"] = reflect.TypeOf((*ArrayOfProfilePolicyMetadata)(nil)).Elem() -} - -type ArrayOfProfilePolicyOptionMetadata struct { - ProfilePolicyOptionMetadata []BaseProfilePolicyOptionMetadata `xml:"ProfilePolicyOptionMetadata,omitempty,typeattr"` -} - -func init() { - t["ArrayOfProfilePolicyOptionMetadata"] = reflect.TypeOf((*ArrayOfProfilePolicyOptionMetadata)(nil)).Elem() -} - -type ArrayOfProfileProfileStructureProperty struct { - ProfileProfileStructureProperty []ProfileProfileStructureProperty `xml:"ProfileProfileStructureProperty,omitempty"` -} - -func init() { - t["ArrayOfProfileProfileStructureProperty"] = reflect.TypeOf((*ArrayOfProfileProfileStructureProperty)(nil)).Elem() -} - -type ArrayOfProfilePropertyPath struct { - ProfilePropertyPath []ProfilePropertyPath `xml:"ProfilePropertyPath,omitempty"` -} - -func init() { - t["ArrayOfProfilePropertyPath"] = reflect.TypeOf((*ArrayOfProfilePropertyPath)(nil)).Elem() -} - -type ArrayOfProfileUpdateFailedUpdateFailure struct { - ProfileUpdateFailedUpdateFailure []ProfileUpdateFailedUpdateFailure `xml:"ProfileUpdateFailedUpdateFailure,omitempty"` -} - -func init() { - t["ArrayOfProfileUpdateFailedUpdateFailure"] = reflect.TypeOf((*ArrayOfProfileUpdateFailedUpdateFailure)(nil)).Elem() -} - -type ArrayOfPropertyChange struct { - PropertyChange []PropertyChange `xml:"PropertyChange,omitempty"` -} - -func init() { - t["ArrayOfPropertyChange"] = reflect.TypeOf((*ArrayOfPropertyChange)(nil)).Elem() -} - -type ArrayOfPropertyFilterSpec struct { - PropertyFilterSpec []PropertyFilterSpec `xml:"PropertyFilterSpec,omitempty"` -} - -func init() { - t["ArrayOfPropertyFilterSpec"] = reflect.TypeOf((*ArrayOfPropertyFilterSpec)(nil)).Elem() -} - -type ArrayOfPropertyFilterUpdate struct { - PropertyFilterUpdate []PropertyFilterUpdate `xml:"PropertyFilterUpdate,omitempty"` -} - -func init() { - t["ArrayOfPropertyFilterUpdate"] = reflect.TypeOf((*ArrayOfPropertyFilterUpdate)(nil)).Elem() -} - -type ArrayOfPropertySpec struct { - PropertySpec []PropertySpec `xml:"PropertySpec,omitempty"` -} - -func init() { - t["ArrayOfPropertySpec"] = reflect.TypeOf((*ArrayOfPropertySpec)(nil)).Elem() -} - -type ArrayOfReplicationInfoDiskSettings struct { - ReplicationInfoDiskSettings []ReplicationInfoDiskSettings `xml:"ReplicationInfoDiskSettings,omitempty"` -} - -func init() { - t["ArrayOfReplicationInfoDiskSettings"] = reflect.TypeOf((*ArrayOfReplicationInfoDiskSettings)(nil)).Elem() -} - -type ArrayOfResourceConfigSpec struct { - ResourceConfigSpec []ResourceConfigSpec `xml:"ResourceConfigSpec,omitempty"` -} - -func init() { - t["ArrayOfResourceConfigSpec"] = reflect.TypeOf((*ArrayOfResourceConfigSpec)(nil)).Elem() -} - -type ArrayOfScheduledTaskDetail struct { - ScheduledTaskDetail []ScheduledTaskDetail `xml:"ScheduledTaskDetail,omitempty"` -} - -func init() { - t["ArrayOfScheduledTaskDetail"] = reflect.TypeOf((*ArrayOfScheduledTaskDetail)(nil)).Elem() -} - -type ArrayOfScsiLun struct { - ScsiLun []BaseScsiLun `xml:"ScsiLun,omitempty,typeattr"` -} - -func init() { - t["ArrayOfScsiLun"] = reflect.TypeOf((*ArrayOfScsiLun)(nil)).Elem() -} - -type ArrayOfScsiLunDescriptor struct { - ScsiLunDescriptor []ScsiLunDescriptor `xml:"ScsiLunDescriptor,omitempty"` -} - -func init() { - t["ArrayOfScsiLunDescriptor"] = reflect.TypeOf((*ArrayOfScsiLunDescriptor)(nil)).Elem() -} - -type ArrayOfScsiLunDurableName struct { - ScsiLunDurableName []ScsiLunDurableName `xml:"ScsiLunDurableName,omitempty"` -} - -func init() { - t["ArrayOfScsiLunDurableName"] = reflect.TypeOf((*ArrayOfScsiLunDurableName)(nil)).Elem() -} - -type ArrayOfSelectionSet struct { - SelectionSet []BaseSelectionSet `xml:"SelectionSet,omitempty,typeattr"` -} - -func init() { - t["ArrayOfSelectionSet"] = reflect.TypeOf((*ArrayOfSelectionSet)(nil)).Elem() -} - -type ArrayOfSelectionSpec struct { - SelectionSpec []BaseSelectionSpec `xml:"SelectionSpec,omitempty,typeattr"` -} - -func init() { - t["ArrayOfSelectionSpec"] = reflect.TypeOf((*ArrayOfSelectionSpec)(nil)).Elem() -} - -type ArrayOfServiceConsolePortGroupProfile struct { - ServiceConsolePortGroupProfile []ServiceConsolePortGroupProfile `xml:"ServiceConsolePortGroupProfile,omitempty"` -} - -func init() { - t["ArrayOfServiceConsolePortGroupProfile"] = reflect.TypeOf((*ArrayOfServiceConsolePortGroupProfile)(nil)).Elem() -} - -type ArrayOfServiceManagerServiceInfo struct { - ServiceManagerServiceInfo []ServiceManagerServiceInfo `xml:"ServiceManagerServiceInfo,omitempty"` -} - -func init() { - t["ArrayOfServiceManagerServiceInfo"] = reflect.TypeOf((*ArrayOfServiceManagerServiceInfo)(nil)).Elem() -} - -type ArrayOfServiceProfile struct { - ServiceProfile []ServiceProfile `xml:"ServiceProfile,omitempty"` -} - -func init() { - t["ArrayOfServiceProfile"] = reflect.TypeOf((*ArrayOfServiceProfile)(nil)).Elem() -} - -type ArrayOfShort struct { - Short []int16 `xml:"short,omitempty"` -} - -func init() { - t["ArrayOfShort"] = reflect.TypeOf((*ArrayOfShort)(nil)).Elem() -} - -type ArrayOfStaticRouteProfile struct { - StaticRouteProfile []StaticRouteProfile `xml:"StaticRouteProfile,omitempty"` -} - -func init() { - t["ArrayOfStaticRouteProfile"] = reflect.TypeOf((*ArrayOfStaticRouteProfile)(nil)).Elem() -} - -type ArrayOfStorageDrsOptionSpec struct { - StorageDrsOptionSpec []StorageDrsOptionSpec `xml:"StorageDrsOptionSpec,omitempty"` -} - -func init() { - t["ArrayOfStorageDrsOptionSpec"] = reflect.TypeOf((*ArrayOfStorageDrsOptionSpec)(nil)).Elem() -} - -type ArrayOfStorageDrsVmConfigInfo struct { - StorageDrsVmConfigInfo []StorageDrsVmConfigInfo `xml:"StorageDrsVmConfigInfo,omitempty"` -} - -func init() { - t["ArrayOfStorageDrsVmConfigInfo"] = reflect.TypeOf((*ArrayOfStorageDrsVmConfigInfo)(nil)).Elem() -} - -type ArrayOfStorageDrsVmConfigSpec struct { - StorageDrsVmConfigSpec []StorageDrsVmConfigSpec `xml:"StorageDrsVmConfigSpec,omitempty"` -} - -func init() { - t["ArrayOfStorageDrsVmConfigSpec"] = reflect.TypeOf((*ArrayOfStorageDrsVmConfigSpec)(nil)).Elem() -} - -type ArrayOfStoragePerformanceSummary struct { - StoragePerformanceSummary []StoragePerformanceSummary `xml:"StoragePerformanceSummary,omitempty"` -} - -func init() { - t["ArrayOfStoragePerformanceSummary"] = reflect.TypeOf((*ArrayOfStoragePerformanceSummary)(nil)).Elem() -} - -type ArrayOfStorageRequirement struct { - StorageRequirement []StorageRequirement `xml:"StorageRequirement,omitempty"` -} - -func init() { - t["ArrayOfStorageRequirement"] = reflect.TypeOf((*ArrayOfStorageRequirement)(nil)).Elem() -} - -type ArrayOfString struct { - String []string `xml:"string,omitempty"` -} - -func init() { - t["ArrayOfString"] = reflect.TypeOf((*ArrayOfString)(nil)).Elem() -} - -type ArrayOfTag struct { - Tag []Tag `xml:"Tag,omitempty"` -} - -func init() { - t["ArrayOfTag"] = reflect.TypeOf((*ArrayOfTag)(nil)).Elem() -} - -type ArrayOfTaskInfo struct { - TaskInfo []TaskInfo `xml:"TaskInfo,omitempty"` -} - -func init() { - t["ArrayOfTaskInfo"] = reflect.TypeOf((*ArrayOfTaskInfo)(nil)).Elem() -} - -type ArrayOfTaskInfoState struct { - TaskInfoState []TaskInfoState `xml:"TaskInfoState,omitempty"` -} - -func init() { - t["ArrayOfTaskInfoState"] = reflect.TypeOf((*ArrayOfTaskInfoState)(nil)).Elem() -} - -type ArrayOfTypeDescription struct { - TypeDescription []BaseTypeDescription `xml:"TypeDescription,omitempty,typeattr"` -} - -func init() { - t["ArrayOfTypeDescription"] = reflect.TypeOf((*ArrayOfTypeDescription)(nil)).Elem() -} - -type ArrayOfUpdateVirtualMachineFilesResultFailedVmFileInfo struct { - UpdateVirtualMachineFilesResultFailedVmFileInfo []UpdateVirtualMachineFilesResultFailedVmFileInfo `xml:"UpdateVirtualMachineFilesResultFailedVmFileInfo,omitempty"` -} - -func init() { - t["ArrayOfUpdateVirtualMachineFilesResultFailedVmFileInfo"] = reflect.TypeOf((*ArrayOfUpdateVirtualMachineFilesResultFailedVmFileInfo)(nil)).Elem() -} - -type ArrayOfUserGroupProfile struct { - UserGroupProfile []UserGroupProfile `xml:"UserGroupProfile,omitempty"` -} - -func init() { - t["ArrayOfUserGroupProfile"] = reflect.TypeOf((*ArrayOfUserGroupProfile)(nil)).Elem() -} - -type ArrayOfUserProfile struct { - UserProfile []UserProfile `xml:"UserProfile,omitempty"` -} - -func init() { - t["ArrayOfUserProfile"] = reflect.TypeOf((*ArrayOfUserProfile)(nil)).Elem() -} - -type ArrayOfUserSearchResult struct { - UserSearchResult []BaseUserSearchResult `xml:"UserSearchResult,omitempty,typeattr"` -} - -func init() { - t["ArrayOfUserSearchResult"] = reflect.TypeOf((*ArrayOfUserSearchResult)(nil)).Elem() -} - -type ArrayOfUserSession struct { - UserSession []UserSession `xml:"UserSession,omitempty"` -} - -func init() { - t["ArrayOfUserSession"] = reflect.TypeOf((*ArrayOfUserSession)(nil)).Elem() -} - -type ArrayOfVAppCloneSpecNetworkMappingPair struct { - VAppCloneSpecNetworkMappingPair []VAppCloneSpecNetworkMappingPair `xml:"VAppCloneSpecNetworkMappingPair,omitempty"` -} - -func init() { - t["ArrayOfVAppCloneSpecNetworkMappingPair"] = reflect.TypeOf((*ArrayOfVAppCloneSpecNetworkMappingPair)(nil)).Elem() -} - -type ArrayOfVAppCloneSpecResourceMap struct { - VAppCloneSpecResourceMap []VAppCloneSpecResourceMap `xml:"VAppCloneSpecResourceMap,omitempty"` -} - -func init() { - t["ArrayOfVAppCloneSpecResourceMap"] = reflect.TypeOf((*ArrayOfVAppCloneSpecResourceMap)(nil)).Elem() -} - -type ArrayOfVAppEntityConfigInfo struct { - VAppEntityConfigInfo []VAppEntityConfigInfo `xml:"VAppEntityConfigInfo,omitempty"` -} - -func init() { - t["ArrayOfVAppEntityConfigInfo"] = reflect.TypeOf((*ArrayOfVAppEntityConfigInfo)(nil)).Elem() -} - -type ArrayOfVAppOvfSectionInfo struct { - VAppOvfSectionInfo []VAppOvfSectionInfo `xml:"VAppOvfSectionInfo,omitempty"` -} - -func init() { - t["ArrayOfVAppOvfSectionInfo"] = reflect.TypeOf((*ArrayOfVAppOvfSectionInfo)(nil)).Elem() -} - -type ArrayOfVAppOvfSectionSpec struct { - VAppOvfSectionSpec []VAppOvfSectionSpec `xml:"VAppOvfSectionSpec,omitempty"` -} - -func init() { - t["ArrayOfVAppOvfSectionSpec"] = reflect.TypeOf((*ArrayOfVAppOvfSectionSpec)(nil)).Elem() -} - -type ArrayOfVAppProductInfo struct { - VAppProductInfo []VAppProductInfo `xml:"VAppProductInfo,omitempty"` -} - -func init() { - t["ArrayOfVAppProductInfo"] = reflect.TypeOf((*ArrayOfVAppProductInfo)(nil)).Elem() -} - -type ArrayOfVAppProductSpec struct { - VAppProductSpec []VAppProductSpec `xml:"VAppProductSpec,omitempty"` -} - -func init() { - t["ArrayOfVAppProductSpec"] = reflect.TypeOf((*ArrayOfVAppProductSpec)(nil)).Elem() -} - -type ArrayOfVAppPropertyInfo struct { - VAppPropertyInfo []VAppPropertyInfo `xml:"VAppPropertyInfo,omitempty"` -} - -func init() { - t["ArrayOfVAppPropertyInfo"] = reflect.TypeOf((*ArrayOfVAppPropertyInfo)(nil)).Elem() -} - -type ArrayOfVAppPropertySpec struct { - VAppPropertySpec []VAppPropertySpec `xml:"VAppPropertySpec,omitempty"` -} - -func init() { - t["ArrayOfVAppPropertySpec"] = reflect.TypeOf((*ArrayOfVAppPropertySpec)(nil)).Elem() -} - -type ArrayOfVMwareDVSPvlanConfigSpec struct { - VMwareDVSPvlanConfigSpec []VMwareDVSPvlanConfigSpec `xml:"VMwareDVSPvlanConfigSpec,omitempty"` -} - -func init() { - t["ArrayOfVMwareDVSPvlanConfigSpec"] = reflect.TypeOf((*ArrayOfVMwareDVSPvlanConfigSpec)(nil)).Elem() -} - -type ArrayOfVMwareDVSPvlanMapEntry struct { - VMwareDVSPvlanMapEntry []VMwareDVSPvlanMapEntry `xml:"VMwareDVSPvlanMapEntry,omitempty"` -} - -func init() { - t["ArrayOfVMwareDVSPvlanMapEntry"] = reflect.TypeOf((*ArrayOfVMwareDVSPvlanMapEntry)(nil)).Elem() -} - -type ArrayOfVMwareDVSVspanConfigSpec struct { - VMwareDVSVspanConfigSpec []VMwareDVSVspanConfigSpec `xml:"VMwareDVSVspanConfigSpec,omitempty"` -} - -func init() { - t["ArrayOfVMwareDVSVspanConfigSpec"] = reflect.TypeOf((*ArrayOfVMwareDVSVspanConfigSpec)(nil)).Elem() -} - -type ArrayOfVMwareDvsLacpGroupConfig struct { - VMwareDvsLacpGroupConfig []VMwareDvsLacpGroupConfig `xml:"VMwareDvsLacpGroupConfig,omitempty"` -} - -func init() { - t["ArrayOfVMwareDvsLacpGroupConfig"] = reflect.TypeOf((*ArrayOfVMwareDvsLacpGroupConfig)(nil)).Elem() -} - -type ArrayOfVMwareDvsLacpGroupSpec struct { - VMwareDvsLacpGroupSpec []VMwareDvsLacpGroupSpec `xml:"VMwareDvsLacpGroupSpec,omitempty"` -} - -func init() { - t["ArrayOfVMwareDvsLacpGroupSpec"] = reflect.TypeOf((*ArrayOfVMwareDvsLacpGroupSpec)(nil)).Elem() -} - -type ArrayOfVMwareVspanSession struct { - VMwareVspanSession []VMwareVspanSession `xml:"VMwareVspanSession,omitempty"` -} - -func init() { - t["ArrayOfVMwareVspanSession"] = reflect.TypeOf((*ArrayOfVMwareVspanSession)(nil)).Elem() -} - -type ArrayOfVirtualAppLinkInfo struct { - VirtualAppLinkInfo []VirtualAppLinkInfo `xml:"VirtualAppLinkInfo,omitempty"` -} - -func init() { - t["ArrayOfVirtualAppLinkInfo"] = reflect.TypeOf((*ArrayOfVirtualAppLinkInfo)(nil)).Elem() -} - -type ArrayOfVirtualDevice struct { - VirtualDevice []BaseVirtualDevice `xml:"VirtualDevice,omitempty,typeattr"` -} - -func init() { - t["ArrayOfVirtualDevice"] = reflect.TypeOf((*ArrayOfVirtualDevice)(nil)).Elem() -} - -type ArrayOfVirtualDeviceBackingOption struct { - VirtualDeviceBackingOption []BaseVirtualDeviceBackingOption `xml:"VirtualDeviceBackingOption,omitempty,typeattr"` -} - -func init() { - t["ArrayOfVirtualDeviceBackingOption"] = reflect.TypeOf((*ArrayOfVirtualDeviceBackingOption)(nil)).Elem() -} - -type ArrayOfVirtualDeviceConfigSpec struct { - VirtualDeviceConfigSpec []BaseVirtualDeviceConfigSpec `xml:"VirtualDeviceConfigSpec,omitempty,typeattr"` -} - -func init() { - t["ArrayOfVirtualDeviceConfigSpec"] = reflect.TypeOf((*ArrayOfVirtualDeviceConfigSpec)(nil)).Elem() -} - -type ArrayOfVirtualDeviceOption struct { - VirtualDeviceOption []BaseVirtualDeviceOption `xml:"VirtualDeviceOption,omitempty,typeattr"` -} - -func init() { - t["ArrayOfVirtualDeviceOption"] = reflect.TypeOf((*ArrayOfVirtualDeviceOption)(nil)).Elem() -} - -type ArrayOfVirtualDisk struct { - VirtualDisk []VirtualDisk `xml:"VirtualDisk,omitempty"` -} - -func init() { - t["ArrayOfVirtualDisk"] = reflect.TypeOf((*ArrayOfVirtualDisk)(nil)).Elem() -} - -type ArrayOfVirtualDiskDeltaDiskFormatsSupported struct { - VirtualDiskDeltaDiskFormatsSupported []VirtualDiskDeltaDiskFormatsSupported `xml:"VirtualDiskDeltaDiskFormatsSupported,omitempty"` -} - -func init() { - t["ArrayOfVirtualDiskDeltaDiskFormatsSupported"] = reflect.TypeOf((*ArrayOfVirtualDiskDeltaDiskFormatsSupported)(nil)).Elem() -} - -type ArrayOfVirtualMachineBootOptionsBootableDevice struct { - VirtualMachineBootOptionsBootableDevice []BaseVirtualMachineBootOptionsBootableDevice `xml:"VirtualMachineBootOptionsBootableDevice,omitempty,typeattr"` -} - -func init() { - t["ArrayOfVirtualMachineBootOptionsBootableDevice"] = reflect.TypeOf((*ArrayOfVirtualMachineBootOptionsBootableDevice)(nil)).Elem() -} - -type ArrayOfVirtualMachineCdromInfo struct { - VirtualMachineCdromInfo []VirtualMachineCdromInfo `xml:"VirtualMachineCdromInfo,omitempty"` -} - -func init() { - t["ArrayOfVirtualMachineCdromInfo"] = reflect.TypeOf((*ArrayOfVirtualMachineCdromInfo)(nil)).Elem() -} - -type ArrayOfVirtualMachineConfigInfoDatastoreUrlPair struct { - VirtualMachineConfigInfoDatastoreUrlPair []VirtualMachineConfigInfoDatastoreUrlPair `xml:"VirtualMachineConfigInfoDatastoreUrlPair,omitempty"` -} - -func init() { - t["ArrayOfVirtualMachineConfigInfoDatastoreUrlPair"] = reflect.TypeOf((*ArrayOfVirtualMachineConfigInfoDatastoreUrlPair)(nil)).Elem() -} - -type ArrayOfVirtualMachineConfigOptionDescriptor struct { - VirtualMachineConfigOptionDescriptor []VirtualMachineConfigOptionDescriptor `xml:"VirtualMachineConfigOptionDescriptor,omitempty"` -} - -func init() { - t["ArrayOfVirtualMachineConfigOptionDescriptor"] = reflect.TypeOf((*ArrayOfVirtualMachineConfigOptionDescriptor)(nil)).Elem() -} - -type ArrayOfVirtualMachineCpuIdInfoSpec struct { - VirtualMachineCpuIdInfoSpec []VirtualMachineCpuIdInfoSpec `xml:"VirtualMachineCpuIdInfoSpec,omitempty"` -} - -func init() { - t["ArrayOfVirtualMachineCpuIdInfoSpec"] = reflect.TypeOf((*ArrayOfVirtualMachineCpuIdInfoSpec)(nil)).Elem() -} - -type ArrayOfVirtualMachineDatastoreInfo struct { - VirtualMachineDatastoreInfo []VirtualMachineDatastoreInfo `xml:"VirtualMachineDatastoreInfo,omitempty"` -} - -func init() { - t["ArrayOfVirtualMachineDatastoreInfo"] = reflect.TypeOf((*ArrayOfVirtualMachineDatastoreInfo)(nil)).Elem() -} - -type ArrayOfVirtualMachineDatastoreVolumeOption struct { - VirtualMachineDatastoreVolumeOption []VirtualMachineDatastoreVolumeOption `xml:"VirtualMachineDatastoreVolumeOption,omitempty"` -} - -func init() { - t["ArrayOfVirtualMachineDatastoreVolumeOption"] = reflect.TypeOf((*ArrayOfVirtualMachineDatastoreVolumeOption)(nil)).Elem() -} - -type ArrayOfVirtualMachineDeviceRuntimeInfo struct { - VirtualMachineDeviceRuntimeInfo []VirtualMachineDeviceRuntimeInfo `xml:"VirtualMachineDeviceRuntimeInfo,omitempty"` -} - -func init() { - t["ArrayOfVirtualMachineDeviceRuntimeInfo"] = reflect.TypeOf((*ArrayOfVirtualMachineDeviceRuntimeInfo)(nil)).Elem() -} - -type ArrayOfVirtualMachineDisplayTopology struct { - VirtualMachineDisplayTopology []VirtualMachineDisplayTopology `xml:"VirtualMachineDisplayTopology,omitempty"` -} - -func init() { - t["ArrayOfVirtualMachineDisplayTopology"] = reflect.TypeOf((*ArrayOfVirtualMachineDisplayTopology)(nil)).Elem() -} - -type ArrayOfVirtualMachineFeatureRequirement struct { - VirtualMachineFeatureRequirement []VirtualMachineFeatureRequirement `xml:"VirtualMachineFeatureRequirement,omitempty"` -} - -func init() { - t["ArrayOfVirtualMachineFeatureRequirement"] = reflect.TypeOf((*ArrayOfVirtualMachineFeatureRequirement)(nil)).Elem() -} - -type ArrayOfVirtualMachineFileLayoutDiskLayout struct { - VirtualMachineFileLayoutDiskLayout []VirtualMachineFileLayoutDiskLayout `xml:"VirtualMachineFileLayoutDiskLayout,omitempty"` -} - -func init() { - t["ArrayOfVirtualMachineFileLayoutDiskLayout"] = reflect.TypeOf((*ArrayOfVirtualMachineFileLayoutDiskLayout)(nil)).Elem() -} - -type ArrayOfVirtualMachineFileLayoutExDiskLayout struct { - VirtualMachineFileLayoutExDiskLayout []VirtualMachineFileLayoutExDiskLayout `xml:"VirtualMachineFileLayoutExDiskLayout,omitempty"` -} - -func init() { - t["ArrayOfVirtualMachineFileLayoutExDiskLayout"] = reflect.TypeOf((*ArrayOfVirtualMachineFileLayoutExDiskLayout)(nil)).Elem() -} - -type ArrayOfVirtualMachineFileLayoutExDiskUnit struct { - VirtualMachineFileLayoutExDiskUnit []VirtualMachineFileLayoutExDiskUnit `xml:"VirtualMachineFileLayoutExDiskUnit,omitempty"` -} - -func init() { - t["ArrayOfVirtualMachineFileLayoutExDiskUnit"] = reflect.TypeOf((*ArrayOfVirtualMachineFileLayoutExDiskUnit)(nil)).Elem() -} - -type ArrayOfVirtualMachineFileLayoutExFileInfo struct { - VirtualMachineFileLayoutExFileInfo []VirtualMachineFileLayoutExFileInfo `xml:"VirtualMachineFileLayoutExFileInfo,omitempty"` -} - -func init() { - t["ArrayOfVirtualMachineFileLayoutExFileInfo"] = reflect.TypeOf((*ArrayOfVirtualMachineFileLayoutExFileInfo)(nil)).Elem() -} - -type ArrayOfVirtualMachineFileLayoutExSnapshotLayout struct { - VirtualMachineFileLayoutExSnapshotLayout []VirtualMachineFileLayoutExSnapshotLayout `xml:"VirtualMachineFileLayoutExSnapshotLayout,omitempty"` -} - -func init() { - t["ArrayOfVirtualMachineFileLayoutExSnapshotLayout"] = reflect.TypeOf((*ArrayOfVirtualMachineFileLayoutExSnapshotLayout)(nil)).Elem() -} - -type ArrayOfVirtualMachineFileLayoutSnapshotLayout struct { - VirtualMachineFileLayoutSnapshotLayout []VirtualMachineFileLayoutSnapshotLayout `xml:"VirtualMachineFileLayoutSnapshotLayout,omitempty"` -} - -func init() { - t["ArrayOfVirtualMachineFileLayoutSnapshotLayout"] = reflect.TypeOf((*ArrayOfVirtualMachineFileLayoutSnapshotLayout)(nil)).Elem() -} - -type ArrayOfVirtualMachineFloppyInfo struct { - VirtualMachineFloppyInfo []VirtualMachineFloppyInfo `xml:"VirtualMachineFloppyInfo,omitempty"` -} - -func init() { - t["ArrayOfVirtualMachineFloppyInfo"] = reflect.TypeOf((*ArrayOfVirtualMachineFloppyInfo)(nil)).Elem() -} - -type ArrayOfVirtualMachineIdeDiskDeviceInfo struct { - VirtualMachineIdeDiskDeviceInfo []VirtualMachineIdeDiskDeviceInfo `xml:"VirtualMachineIdeDiskDeviceInfo,omitempty"` -} - -func init() { - t["ArrayOfVirtualMachineIdeDiskDeviceInfo"] = reflect.TypeOf((*ArrayOfVirtualMachineIdeDiskDeviceInfo)(nil)).Elem() -} - -type ArrayOfVirtualMachineIdeDiskDevicePartitionInfo struct { - VirtualMachineIdeDiskDevicePartitionInfo []VirtualMachineIdeDiskDevicePartitionInfo `xml:"VirtualMachineIdeDiskDevicePartitionInfo,omitempty"` -} - -func init() { - t["ArrayOfVirtualMachineIdeDiskDevicePartitionInfo"] = reflect.TypeOf((*ArrayOfVirtualMachineIdeDiskDevicePartitionInfo)(nil)).Elem() -} - -type ArrayOfVirtualMachineLegacyNetworkSwitchInfo struct { - VirtualMachineLegacyNetworkSwitchInfo []VirtualMachineLegacyNetworkSwitchInfo `xml:"VirtualMachineLegacyNetworkSwitchInfo,omitempty"` -} - -func init() { - t["ArrayOfVirtualMachineLegacyNetworkSwitchInfo"] = reflect.TypeOf((*ArrayOfVirtualMachineLegacyNetworkSwitchInfo)(nil)).Elem() -} - -type ArrayOfVirtualMachineMessage struct { - VirtualMachineMessage []VirtualMachineMessage `xml:"VirtualMachineMessage,omitempty"` -} - -func init() { - t["ArrayOfVirtualMachineMessage"] = reflect.TypeOf((*ArrayOfVirtualMachineMessage)(nil)).Elem() -} - -type ArrayOfVirtualMachineMetadataManagerVmMetadataInput struct { - VirtualMachineMetadataManagerVmMetadataInput []VirtualMachineMetadataManagerVmMetadataInput `xml:"VirtualMachineMetadataManagerVmMetadataInput,omitempty"` -} - -func init() { - t["ArrayOfVirtualMachineMetadataManagerVmMetadataInput"] = reflect.TypeOf((*ArrayOfVirtualMachineMetadataManagerVmMetadataInput)(nil)).Elem() -} - -type ArrayOfVirtualMachineMetadataManagerVmMetadataResult struct { - VirtualMachineMetadataManagerVmMetadataResult []VirtualMachineMetadataManagerVmMetadataResult `xml:"VirtualMachineMetadataManagerVmMetadataResult,omitempty"` -} - -func init() { - t["ArrayOfVirtualMachineMetadataManagerVmMetadataResult"] = reflect.TypeOf((*ArrayOfVirtualMachineMetadataManagerVmMetadataResult)(nil)).Elem() -} - -type ArrayOfVirtualMachineNetworkInfo struct { - VirtualMachineNetworkInfo []VirtualMachineNetworkInfo `xml:"VirtualMachineNetworkInfo,omitempty"` -} - -func init() { - t["ArrayOfVirtualMachineNetworkInfo"] = reflect.TypeOf((*ArrayOfVirtualMachineNetworkInfo)(nil)).Elem() -} - -type ArrayOfVirtualMachineParallelInfo struct { - VirtualMachineParallelInfo []VirtualMachineParallelInfo `xml:"VirtualMachineParallelInfo,omitempty"` -} - -func init() { - t["ArrayOfVirtualMachineParallelInfo"] = reflect.TypeOf((*ArrayOfVirtualMachineParallelInfo)(nil)).Elem() -} - -type ArrayOfVirtualMachinePciPassthroughInfo struct { - VirtualMachinePciPassthroughInfo []BaseVirtualMachinePciPassthroughInfo `xml:"VirtualMachinePciPassthroughInfo,omitempty,typeattr"` -} - -func init() { - t["ArrayOfVirtualMachinePciPassthroughInfo"] = reflect.TypeOf((*ArrayOfVirtualMachinePciPassthroughInfo)(nil)).Elem() -} - -type ArrayOfVirtualMachineProfileSpec struct { - VirtualMachineProfileSpec []BaseVirtualMachineProfileSpec `xml:"VirtualMachineProfileSpec,omitempty,typeattr"` -} - -func init() { - t["ArrayOfVirtualMachineProfileSpec"] = reflect.TypeOf((*ArrayOfVirtualMachineProfileSpec)(nil)).Elem() -} - -type ArrayOfVirtualMachineRelocateSpecDiskLocator struct { - VirtualMachineRelocateSpecDiskLocator []VirtualMachineRelocateSpecDiskLocator `xml:"VirtualMachineRelocateSpecDiskLocator,omitempty"` -} - -func init() { - t["ArrayOfVirtualMachineRelocateSpecDiskLocator"] = reflect.TypeOf((*ArrayOfVirtualMachineRelocateSpecDiskLocator)(nil)).Elem() -} - -type ArrayOfVirtualMachineScsiDiskDeviceInfo struct { - VirtualMachineScsiDiskDeviceInfo []VirtualMachineScsiDiskDeviceInfo `xml:"VirtualMachineScsiDiskDeviceInfo,omitempty"` -} - -func init() { - t["ArrayOfVirtualMachineScsiDiskDeviceInfo"] = reflect.TypeOf((*ArrayOfVirtualMachineScsiDiskDeviceInfo)(nil)).Elem() -} - -type ArrayOfVirtualMachineScsiPassthroughInfo struct { - VirtualMachineScsiPassthroughInfo []VirtualMachineScsiPassthroughInfo `xml:"VirtualMachineScsiPassthroughInfo,omitempty"` -} - -func init() { - t["ArrayOfVirtualMachineScsiPassthroughInfo"] = reflect.TypeOf((*ArrayOfVirtualMachineScsiPassthroughInfo)(nil)).Elem() -} - -type ArrayOfVirtualMachineSerialInfo struct { - VirtualMachineSerialInfo []VirtualMachineSerialInfo `xml:"VirtualMachineSerialInfo,omitempty"` -} - -func init() { - t["ArrayOfVirtualMachineSerialInfo"] = reflect.TypeOf((*ArrayOfVirtualMachineSerialInfo)(nil)).Elem() -} - -type ArrayOfVirtualMachineSnapshotTree struct { - VirtualMachineSnapshotTree []VirtualMachineSnapshotTree `xml:"VirtualMachineSnapshotTree,omitempty"` -} - -func init() { - t["ArrayOfVirtualMachineSnapshotTree"] = reflect.TypeOf((*ArrayOfVirtualMachineSnapshotTree)(nil)).Elem() -} - -type ArrayOfVirtualMachineSoundInfo struct { - VirtualMachineSoundInfo []VirtualMachineSoundInfo `xml:"VirtualMachineSoundInfo,omitempty"` -} - -func init() { - t["ArrayOfVirtualMachineSoundInfo"] = reflect.TypeOf((*ArrayOfVirtualMachineSoundInfo)(nil)).Elem() -} - -type ArrayOfVirtualMachineSriovInfo struct { - VirtualMachineSriovInfo []VirtualMachineSriovInfo `xml:"VirtualMachineSriovInfo,omitempty"` -} - -func init() { - t["ArrayOfVirtualMachineSriovInfo"] = reflect.TypeOf((*ArrayOfVirtualMachineSriovInfo)(nil)).Elem() -} - -type ArrayOfVirtualMachineSummary struct { - VirtualMachineSummary []VirtualMachineSummary `xml:"VirtualMachineSummary,omitempty"` -} - -func init() { - t["ArrayOfVirtualMachineSummary"] = reflect.TypeOf((*ArrayOfVirtualMachineSummary)(nil)).Elem() -} - -type ArrayOfVirtualMachineUsageOnDatastore struct { - VirtualMachineUsageOnDatastore []VirtualMachineUsageOnDatastore `xml:"VirtualMachineUsageOnDatastore,omitempty"` -} - -func init() { - t["ArrayOfVirtualMachineUsageOnDatastore"] = reflect.TypeOf((*ArrayOfVirtualMachineUsageOnDatastore)(nil)).Elem() -} - -type ArrayOfVirtualMachineUsbInfo struct { - VirtualMachineUsbInfo []VirtualMachineUsbInfo `xml:"VirtualMachineUsbInfo,omitempty"` -} - -func init() { - t["ArrayOfVirtualMachineUsbInfo"] = reflect.TypeOf((*ArrayOfVirtualMachineUsbInfo)(nil)).Elem() -} - -type ArrayOfVirtualMachineVFlashModuleInfo struct { - VirtualMachineVFlashModuleInfo []VirtualMachineVFlashModuleInfo `xml:"VirtualMachineVFlashModuleInfo,omitempty"` -} - -func init() { - t["ArrayOfVirtualMachineVFlashModuleInfo"] = reflect.TypeOf((*ArrayOfVirtualMachineVFlashModuleInfo)(nil)).Elem() -} - -type ArrayOfVirtualNicManagerNetConfig struct { - VirtualNicManagerNetConfig []VirtualNicManagerNetConfig `xml:"VirtualNicManagerNetConfig,omitempty"` -} - -func init() { - t["ArrayOfVirtualNicManagerNetConfig"] = reflect.TypeOf((*ArrayOfVirtualNicManagerNetConfig)(nil)).Elem() -} - -type ArrayOfVirtualSCSISharing struct { - VirtualSCSISharing []VirtualSCSISharing `xml:"VirtualSCSISharing,omitempty"` -} - -func init() { - t["ArrayOfVirtualSCSISharing"] = reflect.TypeOf((*ArrayOfVirtualSCSISharing)(nil)).Elem() -} - -type ArrayOfVirtualSwitchProfile struct { - VirtualSwitchProfile []VirtualSwitchProfile `xml:"VirtualSwitchProfile,omitempty"` -} - -func init() { - t["ArrayOfVirtualSwitchProfile"] = reflect.TypeOf((*ArrayOfVirtualSwitchProfile)(nil)).Elem() -} - -type ArrayOfVmEventArgument struct { - VmEventArgument []VmEventArgument `xml:"VmEventArgument,omitempty"` -} - -func init() { - t["ArrayOfVmEventArgument"] = reflect.TypeOf((*ArrayOfVmEventArgument)(nil)).Elem() -} - -type ArrayOfVmPodConfigForPlacement struct { - VmPodConfigForPlacement []VmPodConfigForPlacement `xml:"VmPodConfigForPlacement,omitempty"` -} - -func init() { - t["ArrayOfVmPodConfigForPlacement"] = reflect.TypeOf((*ArrayOfVmPodConfigForPlacement)(nil)).Elem() -} - -type ArrayOfVmPortGroupProfile struct { - VmPortGroupProfile []VmPortGroupProfile `xml:"VmPortGroupProfile,omitempty"` -} - -func init() { - t["ArrayOfVmPortGroupProfile"] = reflect.TypeOf((*ArrayOfVmPortGroupProfile)(nil)).Elem() -} - -type ArrayOfVmfsDatastoreOption struct { - VmfsDatastoreOption []VmfsDatastoreOption `xml:"VmfsDatastoreOption,omitempty"` -} - -func init() { - t["ArrayOfVmfsDatastoreOption"] = reflect.TypeOf((*ArrayOfVmfsDatastoreOption)(nil)).Elem() -} - -type ArrayOfVnicPortArgument struct { - VnicPortArgument []VnicPortArgument `xml:"VnicPortArgument,omitempty"` -} - -func init() { - t["ArrayOfVnicPortArgument"] = reflect.TypeOf((*ArrayOfVnicPortArgument)(nil)).Elem() -} - -type ArrayOfVsanHostConfigInfo struct { - VsanHostConfigInfo []VsanHostConfigInfo `xml:"VsanHostConfigInfo,omitempty"` -} - -func init() { - t["ArrayOfVsanHostConfigInfo"] = reflect.TypeOf((*ArrayOfVsanHostConfigInfo)(nil)).Elem() -} - -type ArrayOfVsanHostConfigInfoNetworkInfoPortConfig struct { - VsanHostConfigInfoNetworkInfoPortConfig []VsanHostConfigInfoNetworkInfoPortConfig `xml:"VsanHostConfigInfoNetworkInfoPortConfig,omitempty"` -} - -func init() { - t["ArrayOfVsanHostConfigInfoNetworkInfoPortConfig"] = reflect.TypeOf((*ArrayOfVsanHostConfigInfoNetworkInfoPortConfig)(nil)).Elem() -} - -type ArrayOfVsanHostDiskMapResult struct { - VsanHostDiskMapResult []VsanHostDiskMapResult `xml:"VsanHostDiskMapResult,omitempty"` -} - -func init() { - t["ArrayOfVsanHostDiskMapResult"] = reflect.TypeOf((*ArrayOfVsanHostDiskMapResult)(nil)).Elem() -} - -type ArrayOfVsanHostDiskMapping struct { - VsanHostDiskMapping []VsanHostDiskMapping `xml:"VsanHostDiskMapping,omitempty"` -} - -func init() { - t["ArrayOfVsanHostDiskMapping"] = reflect.TypeOf((*ArrayOfVsanHostDiskMapping)(nil)).Elem() -} - -type ArrayOfVsanHostDiskResult struct { - VsanHostDiskResult []VsanHostDiskResult `xml:"VsanHostDiskResult,omitempty"` -} - -func init() { - t["ArrayOfVsanHostDiskResult"] = reflect.TypeOf((*ArrayOfVsanHostDiskResult)(nil)).Elem() -} - -type ArrayOfVsanHostMembershipInfo struct { - VsanHostMembershipInfo []VsanHostMembershipInfo `xml:"VsanHostMembershipInfo,omitempty"` -} - -func init() { - t["ArrayOfVsanHostMembershipInfo"] = reflect.TypeOf((*ArrayOfVsanHostMembershipInfo)(nil)).Elem() -} - -type ArrayOfVsanHostRuntimeInfoDiskIssue struct { - VsanHostRuntimeInfoDiskIssue []VsanHostRuntimeInfoDiskIssue `xml:"VsanHostRuntimeInfoDiskIssue,omitempty"` -} - -func init() { - t["ArrayOfVsanHostRuntimeInfoDiskIssue"] = reflect.TypeOf((*ArrayOfVsanHostRuntimeInfoDiskIssue)(nil)).Elem() -} - -type ArrayUpdateSpec struct { - DynamicData - - Operation ArrayUpdateOperation `xml:"operation"` - RemoveKey AnyType `xml:"removeKey,omitempty,typeattr"` -} - -func init() { - t["ArrayUpdateSpec"] = reflect.TypeOf((*ArrayUpdateSpec)(nil)).Elem() -} - -type AssignUserToGroup AssignUserToGroupRequestType - -func init() { - t["AssignUserToGroup"] = reflect.TypeOf((*AssignUserToGroup)(nil)).Elem() -} - -type AssignUserToGroupRequestType struct { - This ManagedObjectReference `xml:"_this"` - User string `xml:"user"` - Group string `xml:"group"` -} - -func init() { - t["AssignUserToGroupRequestType"] = reflect.TypeOf((*AssignUserToGroupRequestType)(nil)).Elem() -} - -type AssignUserToGroupResponse struct { -} - -type AssociateProfile AssociateProfileRequestType - -func init() { - t["AssociateProfile"] = reflect.TypeOf((*AssociateProfile)(nil)).Elem() -} - -type AssociateProfileRequestType struct { - This ManagedObjectReference `xml:"_this"` - Entity []ManagedObjectReference `xml:"entity"` -} - -func init() { - t["AssociateProfileRequestType"] = reflect.TypeOf((*AssociateProfileRequestType)(nil)).Elem() -} - -type AssociateProfileResponse struct { -} - -type AttachScsiLun AttachScsiLunRequestType - -func init() { - t["AttachScsiLun"] = reflect.TypeOf((*AttachScsiLun)(nil)).Elem() -} - -type AttachScsiLunRequestType struct { - This ManagedObjectReference `xml:"_this"` - LunUuid string `xml:"lunUuid"` -} - -func init() { - t["AttachScsiLunRequestType"] = reflect.TypeOf((*AttachScsiLunRequestType)(nil)).Elem() -} - -type AttachScsiLunResponse struct { -} - -type AttachVmfsExtent AttachVmfsExtentRequestType - -func init() { - t["AttachVmfsExtent"] = reflect.TypeOf((*AttachVmfsExtent)(nil)).Elem() -} - -type AttachVmfsExtentRequestType struct { - This ManagedObjectReference `xml:"_this"` - VmfsPath string `xml:"vmfsPath"` - Extent HostScsiDiskPartition `xml:"extent"` -} - -func init() { - t["AttachVmfsExtentRequestType"] = reflect.TypeOf((*AttachVmfsExtentRequestType)(nil)).Elem() -} - -type AttachVmfsExtentResponse struct { -} - -type AuthMinimumAdminPermission struct { - VimFault -} - -func init() { - t["AuthMinimumAdminPermission"] = reflect.TypeOf((*AuthMinimumAdminPermission)(nil)).Elem() -} - -type AuthMinimumAdminPermissionFault AuthMinimumAdminPermission - -func init() { - t["AuthMinimumAdminPermissionFault"] = reflect.TypeOf((*AuthMinimumAdminPermissionFault)(nil)).Elem() -} - -type AuthenticationProfile struct { - ApplyProfile - - ActiveDirectory *ActiveDirectoryProfile `xml:"activeDirectory,omitempty"` -} - -func init() { - t["AuthenticationProfile"] = reflect.TypeOf((*AuthenticationProfile)(nil)).Elem() -} - -type AuthorizationDescription struct { - DynamicData - - Privilege []BaseElementDescription `xml:"privilege,typeattr"` - PrivilegeGroup []BaseElementDescription `xml:"privilegeGroup,typeattr"` -} - -func init() { - t["AuthorizationDescription"] = reflect.TypeOf((*AuthorizationDescription)(nil)).Elem() -} - -type AuthorizationEvent struct { - Event -} - -func init() { - t["AuthorizationEvent"] = reflect.TypeOf((*AuthorizationEvent)(nil)).Elem() -} - -type AuthorizationPrivilege struct { - DynamicData - - PrivId string `xml:"privId"` - OnParent bool `xml:"onParent"` - Name string `xml:"name"` - PrivGroupName string `xml:"privGroupName"` -} - -func init() { - t["AuthorizationPrivilege"] = reflect.TypeOf((*AuthorizationPrivilege)(nil)).Elem() -} - -type AuthorizationRole struct { - DynamicData - - RoleId int `xml:"roleId"` - System bool `xml:"system"` - Name string `xml:"name"` - Info BaseDescription `xml:"info,typeattr"` - Privilege []string `xml:"privilege,omitempty"` -} - -func init() { - t["AuthorizationRole"] = reflect.TypeOf((*AuthorizationRole)(nil)).Elem() -} - -type AutoStartDefaults struct { - DynamicData - - Enabled *bool `xml:"enabled"` - StartDelay int `xml:"startDelay,omitempty"` - StopDelay int `xml:"stopDelay,omitempty"` - WaitForHeartbeat *bool `xml:"waitForHeartbeat"` - StopAction string `xml:"stopAction,omitempty"` -} - -func init() { - t["AutoStartDefaults"] = reflect.TypeOf((*AutoStartDefaults)(nil)).Elem() -} - -type AutoStartPowerInfo struct { - DynamicData - - Key ManagedObjectReference `xml:"key"` - StartOrder int `xml:"startOrder"` - StartDelay int `xml:"startDelay"` - WaitForHeartbeat AutoStartWaitHeartbeatSetting `xml:"waitForHeartbeat"` - StartAction string `xml:"startAction"` - StopDelay int `xml:"stopDelay"` - StopAction string `xml:"stopAction"` -} - -func init() { - t["AutoStartPowerInfo"] = reflect.TypeOf((*AutoStartPowerInfo)(nil)).Elem() -} - -type AutoStartPowerOff AutoStartPowerOffRequestType - -func init() { - t["AutoStartPowerOff"] = reflect.TypeOf((*AutoStartPowerOff)(nil)).Elem() -} - -type AutoStartPowerOffRequestType struct { - This ManagedObjectReference `xml:"_this"` -} - -func init() { - t["AutoStartPowerOffRequestType"] = reflect.TypeOf((*AutoStartPowerOffRequestType)(nil)).Elem() -} - -type AutoStartPowerOffResponse struct { -} - -type AutoStartPowerOn AutoStartPowerOnRequestType - -func init() { - t["AutoStartPowerOn"] = reflect.TypeOf((*AutoStartPowerOn)(nil)).Elem() -} - -type AutoStartPowerOnRequestType struct { - This ManagedObjectReference `xml:"_this"` -} - -func init() { - t["AutoStartPowerOnRequestType"] = reflect.TypeOf((*AutoStartPowerOnRequestType)(nil)).Elem() -} - -type AutoStartPowerOnResponse struct { -} - -type BackupBlobReadFailure struct { - DvsFault - - EntityName string `xml:"entityName"` - EntityType string `xml:"entityType"` - Fault LocalizedMethodFault `xml:"fault"` -} - -func init() { - t["BackupBlobReadFailure"] = reflect.TypeOf((*BackupBlobReadFailure)(nil)).Elem() -} - -type BackupBlobReadFailureFault BackupBlobReadFailure - -func init() { - t["BackupBlobReadFailureFault"] = reflect.TypeOf((*BackupBlobReadFailureFault)(nil)).Elem() -} - -type BackupBlobWriteFailure struct { - DvsFault - - EntityName string `xml:"entityName"` - EntityType string `xml:"entityType"` - Fault LocalizedMethodFault `xml:"fault"` -} - -func init() { - t["BackupBlobWriteFailure"] = reflect.TypeOf((*BackupBlobWriteFailure)(nil)).Elem() -} - -type BackupBlobWriteFailureFault BackupBlobWriteFailure - -func init() { - t["BackupBlobWriteFailureFault"] = reflect.TypeOf((*BackupBlobWriteFailureFault)(nil)).Elem() -} - -type BackupFirmwareConfiguration BackupFirmwareConfigurationRequestType - -func init() { - t["BackupFirmwareConfiguration"] = reflect.TypeOf((*BackupFirmwareConfiguration)(nil)).Elem() -} - -type BackupFirmwareConfigurationRequestType struct { - This ManagedObjectReference `xml:"_this"` -} - -func init() { - t["BackupFirmwareConfigurationRequestType"] = reflect.TypeOf((*BackupFirmwareConfigurationRequestType)(nil)).Elem() -} - -type BackupFirmwareConfigurationResponse struct { - Returnval string `xml:"returnval"` -} - -type BadUsernameSessionEvent struct { - SessionEvent - - IpAddress string `xml:"ipAddress"` -} - -func init() { - t["BadUsernameSessionEvent"] = reflect.TypeOf((*BadUsernameSessionEvent)(nil)).Elem() -} - -type BindVnic BindVnicRequestType - -func init() { - t["BindVnic"] = reflect.TypeOf((*BindVnic)(nil)).Elem() -} - -type BindVnicRequestType struct { - This ManagedObjectReference `xml:"_this"` - IScsiHbaName string `xml:"iScsiHbaName"` - VnicDevice string `xml:"vnicDevice"` -} - -func init() { - t["BindVnicRequestType"] = reflect.TypeOf((*BindVnicRequestType)(nil)).Elem() -} - -type BindVnicResponse struct { -} - -type BlockedByFirewall struct { - HostConfigFault -} - -func init() { - t["BlockedByFirewall"] = reflect.TypeOf((*BlockedByFirewall)(nil)).Elem() -} - -type BlockedByFirewallFault BlockedByFirewall - -func init() { - t["BlockedByFirewallFault"] = reflect.TypeOf((*BlockedByFirewallFault)(nil)).Elem() -} - -type BoolOption struct { - OptionType - - Supported bool `xml:"supported"` - DefaultValue bool `xml:"defaultValue"` -} - -func init() { - t["BoolOption"] = reflect.TypeOf((*BoolOption)(nil)).Elem() -} - -type BoolPolicy struct { - InheritablePolicy - - Value *bool `xml:"value"` -} - -func init() { - t["BoolPolicy"] = reflect.TypeOf((*BoolPolicy)(nil)).Elem() -} - -type BrowseDiagnosticLog BrowseDiagnosticLogRequestType - -func init() { - t["BrowseDiagnosticLog"] = reflect.TypeOf((*BrowseDiagnosticLog)(nil)).Elem() -} - -type BrowseDiagnosticLogRequestType struct { - This ManagedObjectReference `xml:"_this"` - Host *ManagedObjectReference `xml:"host,omitempty"` - Key string `xml:"key"` - Start int `xml:"start,omitempty"` - Lines int `xml:"lines,omitempty"` -} - -func init() { - t["BrowseDiagnosticLogRequestType"] = reflect.TypeOf((*BrowseDiagnosticLogRequestType)(nil)).Elem() -} - -type BrowseDiagnosticLogResponse struct { - Returnval DiagnosticManagerLogHeader `xml:"returnval"` -} - -type CAMServerRefusedConnection struct { - InvalidCAMServer -} - -func init() { - t["CAMServerRefusedConnection"] = reflect.TypeOf((*CAMServerRefusedConnection)(nil)).Elem() -} - -type CAMServerRefusedConnectionFault CAMServerRefusedConnection - -func init() { - t["CAMServerRefusedConnectionFault"] = reflect.TypeOf((*CAMServerRefusedConnectionFault)(nil)).Elem() -} - -type CancelRecommendation CancelRecommendationRequestType - -func init() { - t["CancelRecommendation"] = reflect.TypeOf((*CancelRecommendation)(nil)).Elem() -} - -type CancelRecommendationRequestType struct { - This ManagedObjectReference `xml:"_this"` - Key string `xml:"key"` -} - -func init() { - t["CancelRecommendationRequestType"] = reflect.TypeOf((*CancelRecommendationRequestType)(nil)).Elem() -} - -type CancelRecommendationResponse struct { -} - -type CancelRetrievePropertiesEx CancelRetrievePropertiesExRequestType - -func init() { - t["CancelRetrievePropertiesEx"] = reflect.TypeOf((*CancelRetrievePropertiesEx)(nil)).Elem() -} - -type CancelRetrievePropertiesExRequestType struct { - This ManagedObjectReference `xml:"_this"` - Token string `xml:"token"` -} - -func init() { - t["CancelRetrievePropertiesExRequestType"] = reflect.TypeOf((*CancelRetrievePropertiesExRequestType)(nil)).Elem() -} - -type CancelRetrievePropertiesExResponse struct { -} - -type CancelStorageDrsRecommendation CancelStorageDrsRecommendationRequestType - -func init() { - t["CancelStorageDrsRecommendation"] = reflect.TypeOf((*CancelStorageDrsRecommendation)(nil)).Elem() -} - -type CancelStorageDrsRecommendationRequestType struct { - This ManagedObjectReference `xml:"_this"` - Key []string `xml:"key"` -} - -func init() { - t["CancelStorageDrsRecommendationRequestType"] = reflect.TypeOf((*CancelStorageDrsRecommendationRequestType)(nil)).Elem() -} - -type CancelStorageDrsRecommendationResponse struct { -} - -type CancelTask CancelTaskRequestType - -func init() { - t["CancelTask"] = reflect.TypeOf((*CancelTask)(nil)).Elem() -} - -type CancelTaskRequestType struct { - This ManagedObjectReference `xml:"_this"` -} - -func init() { - t["CancelTaskRequestType"] = reflect.TypeOf((*CancelTaskRequestType)(nil)).Elem() -} - -type CancelTaskResponse struct { -} - -type CancelWaitForUpdates CancelWaitForUpdatesRequestType - -func init() { - t["CancelWaitForUpdates"] = reflect.TypeOf((*CancelWaitForUpdates)(nil)).Elem() -} - -type CancelWaitForUpdatesRequestType struct { - This ManagedObjectReference `xml:"_this"` -} - -func init() { - t["CancelWaitForUpdatesRequestType"] = reflect.TypeOf((*CancelWaitForUpdatesRequestType)(nil)).Elem() -} - -type CancelWaitForUpdatesResponse struct { -} - -type CanceledHostOperationEvent struct { - HostEvent -} - -func init() { - t["CanceledHostOperationEvent"] = reflect.TypeOf((*CanceledHostOperationEvent)(nil)).Elem() -} - -type CannotAccessFile struct { - FileFault -} - -func init() { - t["CannotAccessFile"] = reflect.TypeOf((*CannotAccessFile)(nil)).Elem() -} - -type CannotAccessFileFault CannotAccessFile - -func init() { - t["CannotAccessFileFault"] = reflect.TypeOf((*CannotAccessFileFault)(nil)).Elem() -} - -type CannotAccessLocalSource struct { - VimFault -} - -func init() { - t["CannotAccessLocalSource"] = reflect.TypeOf((*CannotAccessLocalSource)(nil)).Elem() -} - -type CannotAccessLocalSourceFault CannotAccessLocalSource - -func init() { - t["CannotAccessLocalSourceFault"] = reflect.TypeOf((*CannotAccessLocalSourceFault)(nil)).Elem() -} - -type CannotAccessNetwork struct { - CannotAccessVmDevice -} - -func init() { - t["CannotAccessNetwork"] = reflect.TypeOf((*CannotAccessNetwork)(nil)).Elem() -} - -type CannotAccessNetworkFault BaseCannotAccessNetwork - -func init() { - t["CannotAccessNetworkFault"] = reflect.TypeOf((*CannotAccessNetworkFault)(nil)).Elem() -} - -type CannotAccessVmComponent struct { - VmConfigFault -} - -func init() { - t["CannotAccessVmComponent"] = reflect.TypeOf((*CannotAccessVmComponent)(nil)).Elem() -} - -type CannotAccessVmComponentFault BaseCannotAccessVmComponent - -func init() { - t["CannotAccessVmComponentFault"] = reflect.TypeOf((*CannotAccessVmComponentFault)(nil)).Elem() -} - -type CannotAccessVmConfig struct { - CannotAccessVmComponent - - Reason LocalizedMethodFault `xml:"reason"` -} - -func init() { - t["CannotAccessVmConfig"] = reflect.TypeOf((*CannotAccessVmConfig)(nil)).Elem() -} - -type CannotAccessVmConfigFault CannotAccessVmConfig - -func init() { - t["CannotAccessVmConfigFault"] = reflect.TypeOf((*CannotAccessVmConfigFault)(nil)).Elem() -} - -type CannotAccessVmDevice struct { - CannotAccessVmComponent - - Device string `xml:"device"` - Backing string `xml:"backing"` - Connected bool `xml:"connected"` -} - -func init() { - t["CannotAccessVmDevice"] = reflect.TypeOf((*CannotAccessVmDevice)(nil)).Elem() -} - -type CannotAccessVmDeviceFault BaseCannotAccessVmDevice - -func init() { - t["CannotAccessVmDeviceFault"] = reflect.TypeOf((*CannotAccessVmDeviceFault)(nil)).Elem() -} - -type CannotAccessVmDisk struct { - CannotAccessVmDevice - - Fault LocalizedMethodFault `xml:"fault"` -} - -func init() { - t["CannotAccessVmDisk"] = reflect.TypeOf((*CannotAccessVmDisk)(nil)).Elem() -} - -type CannotAccessVmDiskFault BaseCannotAccessVmDisk - -func init() { - t["CannotAccessVmDiskFault"] = reflect.TypeOf((*CannotAccessVmDiskFault)(nil)).Elem() -} - -type CannotAddHostWithFTVmAsStandalone struct { - HostConnectFault -} - -func init() { - t["CannotAddHostWithFTVmAsStandalone"] = reflect.TypeOf((*CannotAddHostWithFTVmAsStandalone)(nil)).Elem() -} - -type CannotAddHostWithFTVmAsStandaloneFault CannotAddHostWithFTVmAsStandalone - -func init() { - t["CannotAddHostWithFTVmAsStandaloneFault"] = reflect.TypeOf((*CannotAddHostWithFTVmAsStandaloneFault)(nil)).Elem() -} - -type CannotAddHostWithFTVmToDifferentCluster struct { - HostConnectFault -} - -func init() { - t["CannotAddHostWithFTVmToDifferentCluster"] = reflect.TypeOf((*CannotAddHostWithFTVmToDifferentCluster)(nil)).Elem() -} - -type CannotAddHostWithFTVmToDifferentClusterFault CannotAddHostWithFTVmToDifferentCluster - -func init() { - t["CannotAddHostWithFTVmToDifferentClusterFault"] = reflect.TypeOf((*CannotAddHostWithFTVmToDifferentClusterFault)(nil)).Elem() -} - -type CannotAddHostWithFTVmToNonHACluster struct { - HostConnectFault -} - -func init() { - t["CannotAddHostWithFTVmToNonHACluster"] = reflect.TypeOf((*CannotAddHostWithFTVmToNonHACluster)(nil)).Elem() -} - -type CannotAddHostWithFTVmToNonHAClusterFault CannotAddHostWithFTVmToNonHACluster - -func init() { - t["CannotAddHostWithFTVmToNonHAClusterFault"] = reflect.TypeOf((*CannotAddHostWithFTVmToNonHAClusterFault)(nil)).Elem() -} - -type CannotChangeDrsBehaviorForFtSecondary struct { - VmFaultToleranceIssue - - Vm ManagedObjectReference `xml:"vm"` - VmName string `xml:"vmName"` -} - -func init() { - t["CannotChangeDrsBehaviorForFtSecondary"] = reflect.TypeOf((*CannotChangeDrsBehaviorForFtSecondary)(nil)).Elem() -} - -type CannotChangeDrsBehaviorForFtSecondaryFault CannotChangeDrsBehaviorForFtSecondary - -func init() { - t["CannotChangeDrsBehaviorForFtSecondaryFault"] = reflect.TypeOf((*CannotChangeDrsBehaviorForFtSecondaryFault)(nil)).Elem() -} - -type CannotChangeHaSettingsForFtSecondary struct { - VmFaultToleranceIssue - - Vm ManagedObjectReference `xml:"vm"` - VmName string `xml:"vmName"` -} - -func init() { - t["CannotChangeHaSettingsForFtSecondary"] = reflect.TypeOf((*CannotChangeHaSettingsForFtSecondary)(nil)).Elem() -} - -type CannotChangeHaSettingsForFtSecondaryFault CannotChangeHaSettingsForFtSecondary - -func init() { - t["CannotChangeHaSettingsForFtSecondaryFault"] = reflect.TypeOf((*CannotChangeHaSettingsForFtSecondaryFault)(nil)).Elem() -} - -type CannotChangeVsanClusterUuid struct { - VsanFault -} - -func init() { - t["CannotChangeVsanClusterUuid"] = reflect.TypeOf((*CannotChangeVsanClusterUuid)(nil)).Elem() -} - -type CannotChangeVsanClusterUuidFault CannotChangeVsanClusterUuid - -func init() { - t["CannotChangeVsanClusterUuidFault"] = reflect.TypeOf((*CannotChangeVsanClusterUuidFault)(nil)).Elem() -} - -type CannotChangeVsanNodeUuid struct { - VsanFault -} - -func init() { - t["CannotChangeVsanNodeUuid"] = reflect.TypeOf((*CannotChangeVsanNodeUuid)(nil)).Elem() -} - -type CannotChangeVsanNodeUuidFault CannotChangeVsanNodeUuid - -func init() { - t["CannotChangeVsanNodeUuidFault"] = reflect.TypeOf((*CannotChangeVsanNodeUuidFault)(nil)).Elem() -} - -type CannotCreateFile struct { - FileFault -} - -func init() { - t["CannotCreateFile"] = reflect.TypeOf((*CannotCreateFile)(nil)).Elem() -} - -type CannotCreateFileFault CannotCreateFile - -func init() { - t["CannotCreateFileFault"] = reflect.TypeOf((*CannotCreateFileFault)(nil)).Elem() -} - -type CannotDecryptPasswords struct { - CustomizationFault -} - -func init() { - t["CannotDecryptPasswords"] = reflect.TypeOf((*CannotDecryptPasswords)(nil)).Elem() -} - -type CannotDecryptPasswordsFault CannotDecryptPasswords - -func init() { - t["CannotDecryptPasswordsFault"] = reflect.TypeOf((*CannotDecryptPasswordsFault)(nil)).Elem() -} - -type CannotDeleteFile struct { - FileFault -} - -func init() { - t["CannotDeleteFile"] = reflect.TypeOf((*CannotDeleteFile)(nil)).Elem() -} - -type CannotDeleteFileFault CannotDeleteFile - -func init() { - t["CannotDeleteFileFault"] = reflect.TypeOf((*CannotDeleteFileFault)(nil)).Elem() -} - -type CannotDisableDrsOnClustersWithVApps struct { - RuntimeFault -} - -func init() { - t["CannotDisableDrsOnClustersWithVApps"] = reflect.TypeOf((*CannotDisableDrsOnClustersWithVApps)(nil)).Elem() -} - -type CannotDisableDrsOnClustersWithVAppsFault CannotDisableDrsOnClustersWithVApps - -func init() { - t["CannotDisableDrsOnClustersWithVAppsFault"] = reflect.TypeOf((*CannotDisableDrsOnClustersWithVAppsFault)(nil)).Elem() -} - -type CannotDisableSnapshot struct { - VmConfigFault -} - -func init() { - t["CannotDisableSnapshot"] = reflect.TypeOf((*CannotDisableSnapshot)(nil)).Elem() -} - -type CannotDisableSnapshotFault CannotDisableSnapshot - -func init() { - t["CannotDisableSnapshotFault"] = reflect.TypeOf((*CannotDisableSnapshotFault)(nil)).Elem() -} - -type CannotDisconnectHostWithFaultToleranceVm struct { - VimFault - - HostName string `xml:"hostName"` -} - -func init() { - t["CannotDisconnectHostWithFaultToleranceVm"] = reflect.TypeOf((*CannotDisconnectHostWithFaultToleranceVm)(nil)).Elem() -} - -type CannotDisconnectHostWithFaultToleranceVmFault CannotDisconnectHostWithFaultToleranceVm - -func init() { - t["CannotDisconnectHostWithFaultToleranceVmFault"] = reflect.TypeOf((*CannotDisconnectHostWithFaultToleranceVmFault)(nil)).Elem() -} - -type CannotModifyConfigCpuRequirements struct { - MigrationFault -} - -func init() { - t["CannotModifyConfigCpuRequirements"] = reflect.TypeOf((*CannotModifyConfigCpuRequirements)(nil)).Elem() -} - -type CannotModifyConfigCpuRequirementsFault CannotModifyConfigCpuRequirements - -func init() { - t["CannotModifyConfigCpuRequirementsFault"] = reflect.TypeOf((*CannotModifyConfigCpuRequirementsFault)(nil)).Elem() -} - -type CannotMoveFaultToleranceVm struct { - VimFault - - MoveType string `xml:"moveType"` - VmName string `xml:"vmName"` -} - -func init() { - t["CannotMoveFaultToleranceVm"] = reflect.TypeOf((*CannotMoveFaultToleranceVm)(nil)).Elem() -} - -type CannotMoveFaultToleranceVmFault CannotMoveFaultToleranceVm - -func init() { - t["CannotMoveFaultToleranceVmFault"] = reflect.TypeOf((*CannotMoveFaultToleranceVmFault)(nil)).Elem() -} - -type CannotMoveHostWithFaultToleranceVm struct { - VimFault -} - -func init() { - t["CannotMoveHostWithFaultToleranceVm"] = reflect.TypeOf((*CannotMoveHostWithFaultToleranceVm)(nil)).Elem() -} - -type CannotMoveHostWithFaultToleranceVmFault CannotMoveHostWithFaultToleranceVm - -func init() { - t["CannotMoveHostWithFaultToleranceVmFault"] = reflect.TypeOf((*CannotMoveHostWithFaultToleranceVmFault)(nil)).Elem() -} - -type CannotMoveVmWithDeltaDisk struct { - MigrationFault - - Device string `xml:"device"` -} - -func init() { - t["CannotMoveVmWithDeltaDisk"] = reflect.TypeOf((*CannotMoveVmWithDeltaDisk)(nil)).Elem() -} - -type CannotMoveVmWithDeltaDiskFault CannotMoveVmWithDeltaDisk - -func init() { - t["CannotMoveVmWithDeltaDiskFault"] = reflect.TypeOf((*CannotMoveVmWithDeltaDiskFault)(nil)).Elem() -} - -type CannotMoveVmWithNativeDeltaDisk struct { - MigrationFault -} - -func init() { - t["CannotMoveVmWithNativeDeltaDisk"] = reflect.TypeOf((*CannotMoveVmWithNativeDeltaDisk)(nil)).Elem() -} - -type CannotMoveVmWithNativeDeltaDiskFault CannotMoveVmWithNativeDeltaDisk - -func init() { - t["CannotMoveVmWithNativeDeltaDiskFault"] = reflect.TypeOf((*CannotMoveVmWithNativeDeltaDiskFault)(nil)).Elem() -} - -type CannotMoveVsanEnabledHost struct { - VsanFault -} - -func init() { - t["CannotMoveVsanEnabledHost"] = reflect.TypeOf((*CannotMoveVsanEnabledHost)(nil)).Elem() -} - -type CannotMoveVsanEnabledHostFault BaseCannotMoveVsanEnabledHost - -func init() { - t["CannotMoveVsanEnabledHostFault"] = reflect.TypeOf((*CannotMoveVsanEnabledHostFault)(nil)).Elem() -} - -type CannotPlaceWithoutPrerequisiteMoves struct { - VimFault -} - -func init() { - t["CannotPlaceWithoutPrerequisiteMoves"] = reflect.TypeOf((*CannotPlaceWithoutPrerequisiteMoves)(nil)).Elem() -} - -type CannotPlaceWithoutPrerequisiteMovesFault CannotPlaceWithoutPrerequisiteMoves - -func init() { - t["CannotPlaceWithoutPrerequisiteMovesFault"] = reflect.TypeOf((*CannotPlaceWithoutPrerequisiteMovesFault)(nil)).Elem() -} - -type CannotPowerOffVmInCluster struct { - InvalidState - - Operation string `xml:"operation"` - Vm ManagedObjectReference `xml:"vm"` - VmName string `xml:"vmName"` -} - -func init() { - t["CannotPowerOffVmInCluster"] = reflect.TypeOf((*CannotPowerOffVmInCluster)(nil)).Elem() -} - -type CannotPowerOffVmInClusterFault CannotPowerOffVmInCluster - -func init() { - t["CannotPowerOffVmInClusterFault"] = reflect.TypeOf((*CannotPowerOffVmInClusterFault)(nil)).Elem() -} - -type CannotReconfigureVsanWhenHaEnabled struct { - VsanFault -} - -func init() { - t["CannotReconfigureVsanWhenHaEnabled"] = reflect.TypeOf((*CannotReconfigureVsanWhenHaEnabled)(nil)).Elem() -} - -type CannotReconfigureVsanWhenHaEnabledFault CannotReconfigureVsanWhenHaEnabled - -func init() { - t["CannotReconfigureVsanWhenHaEnabledFault"] = reflect.TypeOf((*CannotReconfigureVsanWhenHaEnabledFault)(nil)).Elem() -} - -type CannotUseNetwork struct { - VmConfigFault - - Device string `xml:"device"` - Backing string `xml:"backing"` - Connected bool `xml:"connected"` - Reason string `xml:"reason"` -} - -func init() { - t["CannotUseNetwork"] = reflect.TypeOf((*CannotUseNetwork)(nil)).Elem() -} - -type CannotUseNetworkFault CannotUseNetwork - -func init() { - t["CannotUseNetworkFault"] = reflect.TypeOf((*CannotUseNetworkFault)(nil)).Elem() -} - -type Capability struct { - DynamicData - - ProvisioningSupported bool `xml:"provisioningSupported"` - MultiHostSupported bool `xml:"multiHostSupported"` - UserShellAccessSupported bool `xml:"userShellAccessSupported"` - SupportedEVCMode []EVCMode `xml:"supportedEVCMode,omitempty"` - NetworkBackupAndRestoreSupported *bool `xml:"networkBackupAndRestoreSupported"` -} - -func init() { - t["Capability"] = reflect.TypeOf((*Capability)(nil)).Elem() -} - -type ChangeFileAttributesInGuest ChangeFileAttributesInGuestRequestType - -func init() { - t["ChangeFileAttributesInGuest"] = reflect.TypeOf((*ChangeFileAttributesInGuest)(nil)).Elem() -} - -type ChangeFileAttributesInGuestRequestType struct { - This ManagedObjectReference `xml:"_this"` - Vm ManagedObjectReference `xml:"vm"` - Auth BaseGuestAuthentication `xml:"auth,typeattr"` - GuestFilePath string `xml:"guestFilePath"` - FileAttributes BaseGuestFileAttributes `xml:"fileAttributes,typeattr"` -} - -func init() { - t["ChangeFileAttributesInGuestRequestType"] = reflect.TypeOf((*ChangeFileAttributesInGuestRequestType)(nil)).Elem() -} - -type ChangeFileAttributesInGuestResponse struct { -} - -type ChangeOwner ChangeOwnerRequestType - -func init() { - t["ChangeOwner"] = reflect.TypeOf((*ChangeOwner)(nil)).Elem() -} - -type ChangeOwnerRequestType struct { - This ManagedObjectReference `xml:"_this"` - Name string `xml:"name"` - Datacenter *ManagedObjectReference `xml:"datacenter,omitempty"` - Owner string `xml:"owner"` -} - -func init() { - t["ChangeOwnerRequestType"] = reflect.TypeOf((*ChangeOwnerRequestType)(nil)).Elem() -} - -type ChangeOwnerResponse struct { -} - -type CheckAnswerFileStatusRequestType struct { - This ManagedObjectReference `xml:"_this"` - Host []ManagedObjectReference `xml:"host"` -} - -func init() { - t["CheckAnswerFileStatusRequestType"] = reflect.TypeOf((*CheckAnswerFileStatusRequestType)(nil)).Elem() -} - -type CheckAnswerFileStatus_Task CheckAnswerFileStatusRequestType - -func init() { - t["CheckAnswerFileStatus_Task"] = reflect.TypeOf((*CheckAnswerFileStatus_Task)(nil)).Elem() -} - -type CheckAnswerFileStatus_TaskResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type CheckCompatibilityRequestType struct { - This ManagedObjectReference `xml:"_this"` - Vm ManagedObjectReference `xml:"vm"` - Host *ManagedObjectReference `xml:"host,omitempty"` - Pool *ManagedObjectReference `xml:"pool,omitempty"` - TestType []string `xml:"testType,omitempty"` -} - -func init() { - t["CheckCompatibilityRequestType"] = reflect.TypeOf((*CheckCompatibilityRequestType)(nil)).Elem() -} - -type CheckCompatibility_Task CheckCompatibilityRequestType - -func init() { - t["CheckCompatibility_Task"] = reflect.TypeOf((*CheckCompatibility_Task)(nil)).Elem() -} - -type CheckCompatibility_TaskResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type CheckComplianceRequestType struct { - This ManagedObjectReference `xml:"_this"` - Profile []ManagedObjectReference `xml:"profile,omitempty"` - Entity []ManagedObjectReference `xml:"entity,omitempty"` -} - -func init() { - t["CheckComplianceRequestType"] = reflect.TypeOf((*CheckComplianceRequestType)(nil)).Elem() -} - -type CheckCompliance_Task CheckComplianceRequestType - -func init() { - t["CheckCompliance_Task"] = reflect.TypeOf((*CheckCompliance_Task)(nil)).Elem() -} - -type CheckCompliance_TaskResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type CheckCustomizationResources CheckCustomizationResourcesRequestType - -func init() { - t["CheckCustomizationResources"] = reflect.TypeOf((*CheckCustomizationResources)(nil)).Elem() -} - -type CheckCustomizationResourcesRequestType struct { - This ManagedObjectReference `xml:"_this"` - GuestOs string `xml:"guestOs"` -} - -func init() { - t["CheckCustomizationResourcesRequestType"] = reflect.TypeOf((*CheckCustomizationResourcesRequestType)(nil)).Elem() -} - -type CheckCustomizationResourcesResponse struct { -} - -type CheckCustomizationSpec CheckCustomizationSpecRequestType - -func init() { - t["CheckCustomizationSpec"] = reflect.TypeOf((*CheckCustomizationSpec)(nil)).Elem() -} - -type CheckCustomizationSpecRequestType struct { - This ManagedObjectReference `xml:"_this"` - Spec CustomizationSpec `xml:"spec"` -} - -func init() { - t["CheckCustomizationSpecRequestType"] = reflect.TypeOf((*CheckCustomizationSpecRequestType)(nil)).Elem() -} - -type CheckCustomizationSpecResponse struct { -} - -type CheckForUpdates CheckForUpdatesRequestType - -func init() { - t["CheckForUpdates"] = reflect.TypeOf((*CheckForUpdates)(nil)).Elem() -} - -type CheckForUpdatesRequestType struct { - This ManagedObjectReference `xml:"_this"` - Version string `xml:"version,omitempty"` -} - -func init() { - t["CheckForUpdatesRequestType"] = reflect.TypeOf((*CheckForUpdatesRequestType)(nil)).Elem() -} - -type CheckForUpdatesResponse struct { - Returnval *UpdateSet `xml:"returnval,omitempty"` -} - -type CheckHostPatchRequestType struct { - This ManagedObjectReference `xml:"_this"` - MetaUrls []string `xml:"metaUrls,omitempty"` - BundleUrls []string `xml:"bundleUrls,omitempty"` - Spec *HostPatchManagerPatchManagerOperationSpec `xml:"spec,omitempty"` -} - -func init() { - t["CheckHostPatchRequestType"] = reflect.TypeOf((*CheckHostPatchRequestType)(nil)).Elem() -} - -type CheckHostPatch_Task CheckHostPatchRequestType - -func init() { - t["CheckHostPatch_Task"] = reflect.TypeOf((*CheckHostPatch_Task)(nil)).Elem() -} - -type CheckHostPatch_TaskResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type CheckLicenseFeature CheckLicenseFeatureRequestType - -func init() { - t["CheckLicenseFeature"] = reflect.TypeOf((*CheckLicenseFeature)(nil)).Elem() -} - -type CheckLicenseFeatureRequestType struct { - This ManagedObjectReference `xml:"_this"` - Host *ManagedObjectReference `xml:"host,omitempty"` - FeatureKey string `xml:"featureKey"` -} - -func init() { - t["CheckLicenseFeatureRequestType"] = reflect.TypeOf((*CheckLicenseFeatureRequestType)(nil)).Elem() -} - -type CheckLicenseFeatureResponse struct { - Returnval bool `xml:"returnval"` -} - -type CheckMigrateRequestType struct { - This ManagedObjectReference `xml:"_this"` - Vm ManagedObjectReference `xml:"vm"` - Host *ManagedObjectReference `xml:"host,omitempty"` - Pool *ManagedObjectReference `xml:"pool,omitempty"` - State VirtualMachinePowerState `xml:"state,omitempty"` - TestType []string `xml:"testType,omitempty"` -} - -func init() { - t["CheckMigrateRequestType"] = reflect.TypeOf((*CheckMigrateRequestType)(nil)).Elem() -} - -type CheckMigrate_Task CheckMigrateRequestType - -func init() { - t["CheckMigrate_Task"] = reflect.TypeOf((*CheckMigrate_Task)(nil)).Elem() -} - -type CheckMigrate_TaskResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type CheckProfileComplianceRequestType struct { - This ManagedObjectReference `xml:"_this"` - Entity []ManagedObjectReference `xml:"entity,omitempty"` -} - -func init() { - t["CheckProfileComplianceRequestType"] = reflect.TypeOf((*CheckProfileComplianceRequestType)(nil)).Elem() -} - -type CheckProfileCompliance_Task CheckProfileComplianceRequestType - -func init() { - t["CheckProfileCompliance_Task"] = reflect.TypeOf((*CheckProfileCompliance_Task)(nil)).Elem() -} - -type CheckProfileCompliance_TaskResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type CheckRelocateRequestType struct { - This ManagedObjectReference `xml:"_this"` - Vm ManagedObjectReference `xml:"vm"` - Spec VirtualMachineRelocateSpec `xml:"spec"` - TestType []string `xml:"testType,omitempty"` -} - -func init() { - t["CheckRelocateRequestType"] = reflect.TypeOf((*CheckRelocateRequestType)(nil)).Elem() -} - -type CheckRelocate_Task CheckRelocateRequestType - -func init() { - t["CheckRelocate_Task"] = reflect.TypeOf((*CheckRelocate_Task)(nil)).Elem() -} - -type CheckRelocate_TaskResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type CheckResult struct { - DynamicData - - Vm *ManagedObjectReference `xml:"vm,omitempty"` - Host *ManagedObjectReference `xml:"host,omitempty"` - Warning []LocalizedMethodFault `xml:"warning,omitempty"` - Error []LocalizedMethodFault `xml:"error,omitempty"` -} - -func init() { - t["CheckResult"] = reflect.TypeOf((*CheckResult)(nil)).Elem() -} - -type ChoiceOption struct { - OptionType - - ChoiceInfo []BaseElementDescription `xml:"choiceInfo,typeattr"` - DefaultIndex int `xml:"defaultIndex,omitempty"` -} - -func init() { - t["ChoiceOption"] = reflect.TypeOf((*ChoiceOption)(nil)).Elem() -} - -type ClearComplianceStatus ClearComplianceStatusRequestType - -func init() { - t["ClearComplianceStatus"] = reflect.TypeOf((*ClearComplianceStatus)(nil)).Elem() -} - -type ClearComplianceStatusRequestType struct { - This ManagedObjectReference `xml:"_this"` - Profile []ManagedObjectReference `xml:"profile,omitempty"` - Entity []ManagedObjectReference `xml:"entity,omitempty"` -} - -func init() { - t["ClearComplianceStatusRequestType"] = reflect.TypeOf((*ClearComplianceStatusRequestType)(nil)).Elem() -} - -type ClearComplianceStatusResponse struct { -} - -type ClockSkew struct { - HostConfigFault -} - -func init() { - t["ClockSkew"] = reflect.TypeOf((*ClockSkew)(nil)).Elem() -} - -type ClockSkewFault ClockSkew - -func init() { - t["ClockSkewFault"] = reflect.TypeOf((*ClockSkewFault)(nil)).Elem() -} - -type CloneFromSnapshotNotSupported struct { - MigrationFault -} - -func init() { - t["CloneFromSnapshotNotSupported"] = reflect.TypeOf((*CloneFromSnapshotNotSupported)(nil)).Elem() -} - -type CloneFromSnapshotNotSupportedFault CloneFromSnapshotNotSupported - -func init() { - t["CloneFromSnapshotNotSupportedFault"] = reflect.TypeOf((*CloneFromSnapshotNotSupportedFault)(nil)).Elem() -} - -type CloneSession CloneSessionRequestType - -func init() { - t["CloneSession"] = reflect.TypeOf((*CloneSession)(nil)).Elem() -} - -type CloneSessionRequestType struct { - This ManagedObjectReference `xml:"_this"` - CloneTicket string `xml:"cloneTicket"` -} - -func init() { - t["CloneSessionRequestType"] = reflect.TypeOf((*CloneSessionRequestType)(nil)).Elem() -} - -type CloneSessionResponse struct { - Returnval UserSession `xml:"returnval"` -} - -type CloneVAppRequestType struct { - This ManagedObjectReference `xml:"_this"` - Name string `xml:"name"` - Target ManagedObjectReference `xml:"target"` - Spec VAppCloneSpec `xml:"spec"` -} - -func init() { - t["CloneVAppRequestType"] = reflect.TypeOf((*CloneVAppRequestType)(nil)).Elem() -} - -type CloneVApp_Task CloneVAppRequestType - -func init() { - t["CloneVApp_Task"] = reflect.TypeOf((*CloneVApp_Task)(nil)).Elem() -} - -type CloneVApp_TaskResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type CloneVMRequestType struct { - This ManagedObjectReference `xml:"_this"` - Folder ManagedObjectReference `xml:"folder"` - Name string `xml:"name"` - Spec VirtualMachineCloneSpec `xml:"spec"` -} - -func init() { - t["CloneVMRequestType"] = reflect.TypeOf((*CloneVMRequestType)(nil)).Elem() -} - -type CloneVM_Task CloneVMRequestType - -func init() { - t["CloneVM_Task"] = reflect.TypeOf((*CloneVM_Task)(nil)).Elem() -} - -type CloneVM_TaskResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type CloseInventoryViewFolder CloseInventoryViewFolderRequestType - -func init() { - t["CloseInventoryViewFolder"] = reflect.TypeOf((*CloseInventoryViewFolder)(nil)).Elem() -} - -type CloseInventoryViewFolderRequestType struct { - This ManagedObjectReference `xml:"_this"` - Entity []ManagedObjectReference `xml:"entity"` -} - -func init() { - t["CloseInventoryViewFolderRequestType"] = reflect.TypeOf((*CloseInventoryViewFolderRequestType)(nil)).Elem() -} - -type CloseInventoryViewFolderResponse struct { - Returnval []ManagedObjectReference `xml:"returnval,omitempty"` -} - -type ClusterAction struct { - DynamicData - - Type string `xml:"type"` - Target *ManagedObjectReference `xml:"target,omitempty"` -} - -func init() { - t["ClusterAction"] = reflect.TypeOf((*ClusterAction)(nil)).Elem() -} - -type ClusterActionHistory struct { - DynamicData - - Action BaseClusterAction `xml:"action,typeattr"` - Time time.Time `xml:"time"` -} - -func init() { - t["ClusterActionHistory"] = reflect.TypeOf((*ClusterActionHistory)(nil)).Elem() -} - -type ClusterAffinityRuleSpec struct { - ClusterRuleInfo - - Vm []ManagedObjectReference `xml:"vm"` -} - -func init() { - t["ClusterAffinityRuleSpec"] = reflect.TypeOf((*ClusterAffinityRuleSpec)(nil)).Elem() -} - -type ClusterAntiAffinityRuleSpec struct { - ClusterRuleInfo - - Vm []ManagedObjectReference `xml:"vm"` -} - -func init() { - t["ClusterAntiAffinityRuleSpec"] = reflect.TypeOf((*ClusterAntiAffinityRuleSpec)(nil)).Elem() -} - -type ClusterAttemptedVmInfo struct { - DynamicData - - Vm ManagedObjectReference `xml:"vm"` - Task *ManagedObjectReference `xml:"task,omitempty"` -} - -func init() { - t["ClusterAttemptedVmInfo"] = reflect.TypeOf((*ClusterAttemptedVmInfo)(nil)).Elem() -} - -type ClusterComplianceCheckedEvent struct { - ClusterEvent - - Profile ProfileEventArgument `xml:"profile"` -} - -func init() { - t["ClusterComplianceCheckedEvent"] = reflect.TypeOf((*ClusterComplianceCheckedEvent)(nil)).Elem() -} - -type ClusterComputeResourceSummary struct { - ComputeResourceSummary - - CurrentFailoverLevel int `xml:"currentFailoverLevel"` - AdmissionControlInfo BaseClusterDasAdmissionControlInfo `xml:"admissionControlInfo,omitempty,typeattr"` - NumVmotions int `xml:"numVmotions"` - TargetBalance int `xml:"targetBalance,omitempty"` - CurrentBalance int `xml:"currentBalance,omitempty"` - CurrentEVCModeKey string `xml:"currentEVCModeKey,omitempty"` - DasData BaseClusterDasData `xml:"dasData,omitempty,typeattr"` -} - -func init() { - t["ClusterComputeResourceSummary"] = reflect.TypeOf((*ClusterComputeResourceSummary)(nil)).Elem() -} - -type ClusterConfigInfo struct { - DynamicData - - DasConfig ClusterDasConfigInfo `xml:"dasConfig"` - DasVmConfig []ClusterDasVmConfigInfo `xml:"dasVmConfig,omitempty"` - DrsConfig ClusterDrsConfigInfo `xml:"drsConfig"` - DrsVmConfig []ClusterDrsVmConfigInfo `xml:"drsVmConfig,omitempty"` - Rule []BaseClusterRuleInfo `xml:"rule,omitempty,typeattr"` -} - -func init() { - t["ClusterConfigInfo"] = reflect.TypeOf((*ClusterConfigInfo)(nil)).Elem() -} - -type ClusterConfigInfoEx struct { - ComputeResourceConfigInfo - - DasConfig ClusterDasConfigInfo `xml:"dasConfig"` - DasVmConfig []ClusterDasVmConfigInfo `xml:"dasVmConfig,omitempty"` - DrsConfig ClusterDrsConfigInfo `xml:"drsConfig"` - DrsVmConfig []ClusterDrsVmConfigInfo `xml:"drsVmConfig,omitempty"` - Rule []BaseClusterRuleInfo `xml:"rule,omitempty,typeattr"` - DpmConfigInfo *ClusterDpmConfigInfo `xml:"dpmConfigInfo,omitempty"` - DpmHostConfig []ClusterDpmHostConfigInfo `xml:"dpmHostConfig,omitempty"` - VsanConfigInfo *VsanClusterConfigInfo `xml:"vsanConfigInfo,omitempty"` - VsanHostConfig []VsanHostConfigInfo `xml:"vsanHostConfig,omitempty"` - Group []BaseClusterGroupInfo `xml:"group,omitempty,typeattr"` -} - -func init() { - t["ClusterConfigInfoEx"] = reflect.TypeOf((*ClusterConfigInfoEx)(nil)).Elem() -} - -type ClusterConfigSpec struct { - DynamicData - - DasConfig *ClusterDasConfigInfo `xml:"dasConfig,omitempty"` - DasVmConfigSpec []ClusterDasVmConfigSpec `xml:"dasVmConfigSpec,omitempty"` - DrsConfig *ClusterDrsConfigInfo `xml:"drsConfig,omitempty"` - DrsVmConfigSpec []ClusterDrsVmConfigSpec `xml:"drsVmConfigSpec,omitempty"` - RulesSpec []ClusterRuleSpec `xml:"rulesSpec,omitempty"` -} - -func init() { - t["ClusterConfigSpec"] = reflect.TypeOf((*ClusterConfigSpec)(nil)).Elem() -} - -type ClusterConfigSpecEx struct { - ComputeResourceConfigSpec - - DasConfig *ClusterDasConfigInfo `xml:"dasConfig,omitempty"` - DasVmConfigSpec []ClusterDasVmConfigSpec `xml:"dasVmConfigSpec,omitempty"` - DrsConfig *ClusterDrsConfigInfo `xml:"drsConfig,omitempty"` - DrsVmConfigSpec []ClusterDrsVmConfigSpec `xml:"drsVmConfigSpec,omitempty"` - RulesSpec []ClusterRuleSpec `xml:"rulesSpec,omitempty"` - DpmConfig *ClusterDpmConfigInfo `xml:"dpmConfig,omitempty"` - DpmHostConfigSpec []ClusterDpmHostConfigSpec `xml:"dpmHostConfigSpec,omitempty"` - VsanConfig *VsanClusterConfigInfo `xml:"vsanConfig,omitempty"` - VsanHostConfigSpec []VsanHostConfigInfo `xml:"vsanHostConfigSpec,omitempty"` - GroupSpec []ClusterGroupSpec `xml:"groupSpec,omitempty"` -} - -func init() { - t["ClusterConfigSpecEx"] = reflect.TypeOf((*ClusterConfigSpecEx)(nil)).Elem() -} - -type ClusterCreatedEvent struct { - ClusterEvent - - Parent FolderEventArgument `xml:"parent"` -} - -func init() { - t["ClusterCreatedEvent"] = reflect.TypeOf((*ClusterCreatedEvent)(nil)).Elem() -} - -type ClusterDasAamHostInfo struct { - ClusterDasHostInfo - - HostDasState []ClusterDasAamNodeState `xml:"hostDasState,omitempty"` - PrimaryHosts []string `xml:"primaryHosts,omitempty"` -} - -func init() { - t["ClusterDasAamHostInfo"] = reflect.TypeOf((*ClusterDasAamHostInfo)(nil)).Elem() -} - -type ClusterDasAamNodeState struct { - DynamicData - - Host ManagedObjectReference `xml:"host"` - Name string `xml:"name"` - ConfigState string `xml:"configState"` - RuntimeState string `xml:"runtimeState"` -} - -func init() { - t["ClusterDasAamNodeState"] = reflect.TypeOf((*ClusterDasAamNodeState)(nil)).Elem() -} - -type ClusterDasAdmissionControlInfo struct { - DynamicData -} - -func init() { - t["ClusterDasAdmissionControlInfo"] = reflect.TypeOf((*ClusterDasAdmissionControlInfo)(nil)).Elem() -} - -type ClusterDasAdmissionControlPolicy struct { - DynamicData -} - -func init() { - t["ClusterDasAdmissionControlPolicy"] = reflect.TypeOf((*ClusterDasAdmissionControlPolicy)(nil)).Elem() -} - -type ClusterDasAdvancedRuntimeInfo struct { - DynamicData - - DasHostInfo BaseClusterDasHostInfo `xml:"dasHostInfo,omitempty,typeattr"` - HeartbeatDatastoreInfo []DasHeartbeatDatastoreInfo `xml:"heartbeatDatastoreInfo,omitempty"` -} - -func init() { - t["ClusterDasAdvancedRuntimeInfo"] = reflect.TypeOf((*ClusterDasAdvancedRuntimeInfo)(nil)).Elem() -} - -type ClusterDasConfigInfo struct { - DynamicData - - Enabled *bool `xml:"enabled"` - VmMonitoring string `xml:"vmMonitoring,omitempty"` - HostMonitoring string `xml:"hostMonitoring,omitempty"` - FailoverLevel int `xml:"failoverLevel,omitempty"` - AdmissionControlPolicy BaseClusterDasAdmissionControlPolicy `xml:"admissionControlPolicy,omitempty,typeattr"` - AdmissionControlEnabled *bool `xml:"admissionControlEnabled"` - DefaultVmSettings *ClusterDasVmSettings `xml:"defaultVmSettings,omitempty"` - Option []BaseOptionValue `xml:"option,omitempty,typeattr"` - HeartbeatDatastore []ManagedObjectReference `xml:"heartbeatDatastore,omitempty"` - HBDatastoreCandidatePolicy string `xml:"hBDatastoreCandidatePolicy,omitempty"` -} - -func init() { - t["ClusterDasConfigInfo"] = reflect.TypeOf((*ClusterDasConfigInfo)(nil)).Elem() -} - -type ClusterDasData struct { - DynamicData -} - -func init() { - t["ClusterDasData"] = reflect.TypeOf((*ClusterDasData)(nil)).Elem() -} - -type ClusterDasDataSummary struct { - ClusterDasData - - HostListVersion int64 `xml:"hostListVersion"` - ClusterConfigVersion int64 `xml:"clusterConfigVersion"` - CompatListVersion int64 `xml:"compatListVersion"` -} - -func init() { - t["ClusterDasDataSummary"] = reflect.TypeOf((*ClusterDasDataSummary)(nil)).Elem() -} - -type ClusterDasFailoverLevelAdvancedRuntimeInfo struct { - ClusterDasAdvancedRuntimeInfo - - SlotInfo ClusterDasFailoverLevelAdvancedRuntimeInfoSlotInfo `xml:"slotInfo"` - TotalSlots int `xml:"totalSlots"` - UsedSlots int `xml:"usedSlots"` - UnreservedSlots int `xml:"unreservedSlots"` - TotalVms int `xml:"totalVms"` - TotalHosts int `xml:"totalHosts"` - TotalGoodHosts int `xml:"totalGoodHosts"` - HostSlots []ClusterDasFailoverLevelAdvancedRuntimeInfoHostSlots `xml:"hostSlots,omitempty"` - VmsRequiringMultipleSlots []ClusterDasFailoverLevelAdvancedRuntimeInfoVmSlots `xml:"vmsRequiringMultipleSlots,omitempty"` -} - -func init() { - t["ClusterDasFailoverLevelAdvancedRuntimeInfo"] = reflect.TypeOf((*ClusterDasFailoverLevelAdvancedRuntimeInfo)(nil)).Elem() -} - -type ClusterDasFailoverLevelAdvancedRuntimeInfoHostSlots struct { - DynamicData - - Host ManagedObjectReference `xml:"host"` - Slots int `xml:"slots"` -} - -func init() { - t["ClusterDasFailoverLevelAdvancedRuntimeInfoHostSlots"] = reflect.TypeOf((*ClusterDasFailoverLevelAdvancedRuntimeInfoHostSlots)(nil)).Elem() -} - -type ClusterDasFailoverLevelAdvancedRuntimeInfoSlotInfo struct { - DynamicData - - NumVcpus int `xml:"numVcpus"` - CpuMHz int `xml:"cpuMHz"` - MemoryMB int `xml:"memoryMB"` -} - -func init() { - t["ClusterDasFailoverLevelAdvancedRuntimeInfoSlotInfo"] = reflect.TypeOf((*ClusterDasFailoverLevelAdvancedRuntimeInfoSlotInfo)(nil)).Elem() -} - -type ClusterDasFailoverLevelAdvancedRuntimeInfoVmSlots struct { - DynamicData - - Vm ManagedObjectReference `xml:"vm"` - Slots int `xml:"slots"` -} - -func init() { - t["ClusterDasFailoverLevelAdvancedRuntimeInfoVmSlots"] = reflect.TypeOf((*ClusterDasFailoverLevelAdvancedRuntimeInfoVmSlots)(nil)).Elem() -} - -type ClusterDasFdmHostState struct { - DynamicData - - State string `xml:"state"` - StateReporter *ManagedObjectReference `xml:"stateReporter,omitempty"` -} - -func init() { - t["ClusterDasFdmHostState"] = reflect.TypeOf((*ClusterDasFdmHostState)(nil)).Elem() -} - -type ClusterDasHostInfo struct { - DynamicData -} - -func init() { - t["ClusterDasHostInfo"] = reflect.TypeOf((*ClusterDasHostInfo)(nil)).Elem() -} - -type ClusterDasHostRecommendation struct { - DynamicData - - Host ManagedObjectReference `xml:"host"` - DrsRating int `xml:"drsRating,omitempty"` -} - -func init() { - t["ClusterDasHostRecommendation"] = reflect.TypeOf((*ClusterDasHostRecommendation)(nil)).Elem() -} - -type ClusterDasVmConfigInfo struct { - DynamicData - - Key ManagedObjectReference `xml:"key"` - RestartPriority DasVmPriority `xml:"restartPriority,omitempty"` - PowerOffOnIsolation *bool `xml:"powerOffOnIsolation"` - DasSettings *ClusterDasVmSettings `xml:"dasSettings,omitempty"` -} - -func init() { - t["ClusterDasVmConfigInfo"] = reflect.TypeOf((*ClusterDasVmConfigInfo)(nil)).Elem() -} - -type ClusterDasVmConfigSpec struct { - ArrayUpdateSpec - - Info *ClusterDasVmConfigInfo `xml:"info,omitempty"` -} - -func init() { - t["ClusterDasVmConfigSpec"] = reflect.TypeOf((*ClusterDasVmConfigSpec)(nil)).Elem() -} - -type ClusterDasVmSettings struct { - DynamicData - - RestartPriority string `xml:"restartPriority,omitempty"` - IsolationResponse string `xml:"isolationResponse,omitempty"` - VmToolsMonitoringSettings *ClusterVmToolsMonitoringSettings `xml:"vmToolsMonitoringSettings,omitempty"` -} - -func init() { - t["ClusterDasVmSettings"] = reflect.TypeOf((*ClusterDasVmSettings)(nil)).Elem() -} - -type ClusterDestroyedEvent struct { - ClusterEvent -} - -func init() { - t["ClusterDestroyedEvent"] = reflect.TypeOf((*ClusterDestroyedEvent)(nil)).Elem() -} - -type ClusterDpmConfigInfo struct { - DynamicData - - Enabled *bool `xml:"enabled"` - DefaultDpmBehavior DpmBehavior `xml:"defaultDpmBehavior,omitempty"` - HostPowerActionRate int `xml:"hostPowerActionRate,omitempty"` - Option []BaseOptionValue `xml:"option,omitempty,typeattr"` -} - -func init() { - t["ClusterDpmConfigInfo"] = reflect.TypeOf((*ClusterDpmConfigInfo)(nil)).Elem() -} - -type ClusterDpmHostConfigInfo struct { - DynamicData - - Key ManagedObjectReference `xml:"key"` - Enabled *bool `xml:"enabled"` - Behavior DpmBehavior `xml:"behavior,omitempty"` -} - -func init() { - t["ClusterDpmHostConfigInfo"] = reflect.TypeOf((*ClusterDpmHostConfigInfo)(nil)).Elem() -} - -type ClusterDpmHostConfigSpec struct { - ArrayUpdateSpec - - Info *ClusterDpmHostConfigInfo `xml:"info,omitempty"` -} - -func init() { - t["ClusterDpmHostConfigSpec"] = reflect.TypeOf((*ClusterDpmHostConfigSpec)(nil)).Elem() -} - -type ClusterDrsConfigInfo struct { - DynamicData - - Enabled *bool `xml:"enabled"` - EnableVmBehaviorOverrides *bool `xml:"enableVmBehaviorOverrides"` - DefaultVmBehavior DrsBehavior `xml:"defaultVmBehavior,omitempty"` - VmotionRate int `xml:"vmotionRate,omitempty"` - Option []BaseOptionValue `xml:"option,omitempty,typeattr"` -} - -func init() { - t["ClusterDrsConfigInfo"] = reflect.TypeOf((*ClusterDrsConfigInfo)(nil)).Elem() -} - -type ClusterDrsFaults struct { - DynamicData - - Reason string `xml:"reason"` - FaultsByVm []BaseClusterDrsFaultsFaultsByVm `xml:"faultsByVm,typeattr"` -} - -func init() { - t["ClusterDrsFaults"] = reflect.TypeOf((*ClusterDrsFaults)(nil)).Elem() -} - -type ClusterDrsFaultsFaultsByVirtualDisk struct { - ClusterDrsFaultsFaultsByVm - - Disk *VirtualDiskId `xml:"disk,omitempty"` -} - -func init() { - t["ClusterDrsFaultsFaultsByVirtualDisk"] = reflect.TypeOf((*ClusterDrsFaultsFaultsByVirtualDisk)(nil)).Elem() -} - -type ClusterDrsFaultsFaultsByVm struct { - DynamicData - - Vm *ManagedObjectReference `xml:"vm,omitempty"` - Fault []LocalizedMethodFault `xml:"fault"` -} - -func init() { - t["ClusterDrsFaultsFaultsByVm"] = reflect.TypeOf((*ClusterDrsFaultsFaultsByVm)(nil)).Elem() -} - -type ClusterDrsMigration struct { - DynamicData - - Key string `xml:"key"` - Time time.Time `xml:"time"` - Vm ManagedObjectReference `xml:"vm"` - CpuLoad int `xml:"cpuLoad,omitempty"` - MemoryLoad int64 `xml:"memoryLoad,omitempty"` - Source ManagedObjectReference `xml:"source"` - SourceCpuLoad int `xml:"sourceCpuLoad,omitempty"` - SourceMemoryLoad int64 `xml:"sourceMemoryLoad,omitempty"` - Destination ManagedObjectReference `xml:"destination"` - DestinationCpuLoad int `xml:"destinationCpuLoad,omitempty"` - DestinationMemoryLoad int64 `xml:"destinationMemoryLoad,omitempty"` -} - -func init() { - t["ClusterDrsMigration"] = reflect.TypeOf((*ClusterDrsMigration)(nil)).Elem() -} - -type ClusterDrsRecommendation struct { - DynamicData - - Key string `xml:"key"` - Rating int `xml:"rating"` - Reason string `xml:"reason"` - ReasonText string `xml:"reasonText"` - MigrationList []ClusterDrsMigration `xml:"migrationList"` -} - -func init() { - t["ClusterDrsRecommendation"] = reflect.TypeOf((*ClusterDrsRecommendation)(nil)).Elem() -} - -type ClusterDrsVmConfigInfo struct { - DynamicData - - Key ManagedObjectReference `xml:"key"` - Enabled *bool `xml:"enabled"` - Behavior DrsBehavior `xml:"behavior,omitempty"` -} - -func init() { - t["ClusterDrsVmConfigInfo"] = reflect.TypeOf((*ClusterDrsVmConfigInfo)(nil)).Elem() -} - -type ClusterDrsVmConfigSpec struct { - ArrayUpdateSpec - - Info *ClusterDrsVmConfigInfo `xml:"info,omitempty"` -} - -func init() { - t["ClusterDrsVmConfigSpec"] = reflect.TypeOf((*ClusterDrsVmConfigSpec)(nil)).Elem() -} - -type ClusterEnterMaintenanceMode ClusterEnterMaintenanceModeRequestType - -func init() { - t["ClusterEnterMaintenanceMode"] = reflect.TypeOf((*ClusterEnterMaintenanceMode)(nil)).Elem() -} - -type ClusterEnterMaintenanceModeRequestType struct { - This ManagedObjectReference `xml:"_this"` - Host []ManagedObjectReference `xml:"host"` - Option []BaseOptionValue `xml:"option,omitempty,typeattr"` -} - -func init() { - t["ClusterEnterMaintenanceModeRequestType"] = reflect.TypeOf((*ClusterEnterMaintenanceModeRequestType)(nil)).Elem() -} - -type ClusterEnterMaintenanceModeResponse struct { - Returnval ClusterEnterMaintenanceResult `xml:"returnval"` -} - -type ClusterEnterMaintenanceResult struct { - DynamicData - - Recommendations []ClusterRecommendation `xml:"recommendations,omitempty"` - Fault *ClusterDrsFaults `xml:"fault,omitempty"` -} - -func init() { - t["ClusterEnterMaintenanceResult"] = reflect.TypeOf((*ClusterEnterMaintenanceResult)(nil)).Elem() -} - -type ClusterEvent struct { - Event -} - -func init() { - t["ClusterEvent"] = reflect.TypeOf((*ClusterEvent)(nil)).Elem() -} - -type ClusterFailoverHostAdmissionControlInfo struct { - ClusterDasAdmissionControlInfo - - HostStatus []ClusterFailoverHostAdmissionControlInfoHostStatus `xml:"hostStatus,omitempty"` -} - -func init() { - t["ClusterFailoverHostAdmissionControlInfo"] = reflect.TypeOf((*ClusterFailoverHostAdmissionControlInfo)(nil)).Elem() -} - -type ClusterFailoverHostAdmissionControlInfoHostStatus struct { - DynamicData - - Host ManagedObjectReference `xml:"host"` - Status ManagedEntityStatus `xml:"status"` -} - -func init() { - t["ClusterFailoverHostAdmissionControlInfoHostStatus"] = reflect.TypeOf((*ClusterFailoverHostAdmissionControlInfoHostStatus)(nil)).Elem() -} - -type ClusterFailoverHostAdmissionControlPolicy struct { - ClusterDasAdmissionControlPolicy - - FailoverHosts []ManagedObjectReference `xml:"failoverHosts,omitempty"` -} - -func init() { - t["ClusterFailoverHostAdmissionControlPolicy"] = reflect.TypeOf((*ClusterFailoverHostAdmissionControlPolicy)(nil)).Elem() -} - -type ClusterFailoverLevelAdmissionControlInfo struct { - ClusterDasAdmissionControlInfo - - CurrentFailoverLevel int `xml:"currentFailoverLevel"` -} - -func init() { - t["ClusterFailoverLevelAdmissionControlInfo"] = reflect.TypeOf((*ClusterFailoverLevelAdmissionControlInfo)(nil)).Elem() -} - -type ClusterFailoverLevelAdmissionControlPolicy struct { - ClusterDasAdmissionControlPolicy - - FailoverLevel int `xml:"failoverLevel"` - SlotPolicy BaseClusterSlotPolicy `xml:"slotPolicy,omitempty,typeattr"` -} - -func init() { - t["ClusterFailoverLevelAdmissionControlPolicy"] = reflect.TypeOf((*ClusterFailoverLevelAdmissionControlPolicy)(nil)).Elem() -} - -type ClusterFailoverResourcesAdmissionControlInfo struct { - ClusterDasAdmissionControlInfo - - CurrentCpuFailoverResourcesPercent int `xml:"currentCpuFailoverResourcesPercent"` - CurrentMemoryFailoverResourcesPercent int `xml:"currentMemoryFailoverResourcesPercent"` -} - -func init() { - t["ClusterFailoverResourcesAdmissionControlInfo"] = reflect.TypeOf((*ClusterFailoverResourcesAdmissionControlInfo)(nil)).Elem() -} - -type ClusterFailoverResourcesAdmissionControlPolicy struct { - ClusterDasAdmissionControlPolicy - - CpuFailoverResourcesPercent int `xml:"cpuFailoverResourcesPercent"` - MemoryFailoverResourcesPercent int `xml:"memoryFailoverResourcesPercent"` -} - -func init() { - t["ClusterFailoverResourcesAdmissionControlPolicy"] = reflect.TypeOf((*ClusterFailoverResourcesAdmissionControlPolicy)(nil)).Elem() -} - -type ClusterFixedSizeSlotPolicy struct { - ClusterSlotPolicy - - Cpu int `xml:"cpu"` - Memory int `xml:"memory"` -} - -func init() { - t["ClusterFixedSizeSlotPolicy"] = reflect.TypeOf((*ClusterFixedSizeSlotPolicy)(nil)).Elem() -} - -type ClusterGroupInfo struct { - DynamicData - - Name string `xml:"name"` - UserCreated *bool `xml:"userCreated"` -} - -func init() { - t["ClusterGroupInfo"] = reflect.TypeOf((*ClusterGroupInfo)(nil)).Elem() -} - -type ClusterGroupSpec struct { - ArrayUpdateSpec - - Info BaseClusterGroupInfo `xml:"info,omitempty,typeattr"` -} - -func init() { - t["ClusterGroupSpec"] = reflect.TypeOf((*ClusterGroupSpec)(nil)).Elem() -} - -type ClusterHostGroup struct { - ClusterGroupInfo - - Host []ManagedObjectReference `xml:"host,omitempty"` -} - -func init() { - t["ClusterHostGroup"] = reflect.TypeOf((*ClusterHostGroup)(nil)).Elem() -} - -type ClusterHostPowerAction struct { - ClusterAction - - OperationType HostPowerOperationType `xml:"operationType"` - PowerConsumptionWatt int `xml:"powerConsumptionWatt,omitempty"` - CpuCapacityMHz int `xml:"cpuCapacityMHz,omitempty"` - MemCapacityMB int `xml:"memCapacityMB,omitempty"` -} - -func init() { - t["ClusterHostPowerAction"] = reflect.TypeOf((*ClusterHostPowerAction)(nil)).Elem() -} - -type ClusterHostRecommendation struct { - DynamicData - - Host ManagedObjectReference `xml:"host"` - Rating int `xml:"rating"` -} - -func init() { - t["ClusterHostRecommendation"] = reflect.TypeOf((*ClusterHostRecommendation)(nil)).Elem() -} - -type ClusterInitialPlacementAction struct { - ClusterAction - - TargetHost ManagedObjectReference `xml:"targetHost"` - Pool *ManagedObjectReference `xml:"pool,omitempty"` -} - -func init() { - t["ClusterInitialPlacementAction"] = reflect.TypeOf((*ClusterInitialPlacementAction)(nil)).Elem() -} - -type ClusterMigrationAction struct { - ClusterAction - - DrsMigration *ClusterDrsMigration `xml:"drsMigration,omitempty"` -} - -func init() { - t["ClusterMigrationAction"] = reflect.TypeOf((*ClusterMigrationAction)(nil)).Elem() -} - -type ClusterNotAttemptedVmInfo struct { - DynamicData - - Vm ManagedObjectReference `xml:"vm"` - Fault LocalizedMethodFault `xml:"fault"` -} - -func init() { - t["ClusterNotAttemptedVmInfo"] = reflect.TypeOf((*ClusterNotAttemptedVmInfo)(nil)).Elem() -} - -type ClusterOvercommittedEvent struct { - ClusterEvent -} - -func init() { - t["ClusterOvercommittedEvent"] = reflect.TypeOf((*ClusterOvercommittedEvent)(nil)).Elem() -} - -type ClusterPowerOnVmResult struct { - DynamicData - - Attempted []ClusterAttemptedVmInfo `xml:"attempted,omitempty"` - NotAttempted []ClusterNotAttemptedVmInfo `xml:"notAttempted,omitempty"` - Recommendations []ClusterRecommendation `xml:"recommendations,omitempty"` -} - -func init() { - t["ClusterPowerOnVmResult"] = reflect.TypeOf((*ClusterPowerOnVmResult)(nil)).Elem() -} - -type ClusterProfileCompleteConfigSpec struct { - ClusterProfileConfigSpec - - ComplyProfile *ComplianceProfile `xml:"complyProfile,omitempty"` -} - -func init() { - t["ClusterProfileCompleteConfigSpec"] = reflect.TypeOf((*ClusterProfileCompleteConfigSpec)(nil)).Elem() -} - -type ClusterProfileConfigInfo struct { - ProfileConfigInfo - - ComplyProfile *ComplianceProfile `xml:"complyProfile,omitempty"` -} - -func init() { - t["ClusterProfileConfigInfo"] = reflect.TypeOf((*ClusterProfileConfigInfo)(nil)).Elem() -} - -type ClusterProfileConfigServiceCreateSpec struct { - ClusterProfileConfigSpec - - ServiceType []string `xml:"serviceType,omitempty"` -} - -func init() { - t["ClusterProfileConfigServiceCreateSpec"] = reflect.TypeOf((*ClusterProfileConfigServiceCreateSpec)(nil)).Elem() -} - -type ClusterProfileConfigSpec struct { - ClusterProfileCreateSpec -} - -func init() { - t["ClusterProfileConfigSpec"] = reflect.TypeOf((*ClusterProfileConfigSpec)(nil)).Elem() -} - -type ClusterProfileCreateSpec struct { - ProfileCreateSpec -} - -func init() { - t["ClusterProfileCreateSpec"] = reflect.TypeOf((*ClusterProfileCreateSpec)(nil)).Elem() -} - -type ClusterRecommendation struct { - DynamicData - - Key string `xml:"key"` - Type string `xml:"type"` - Time time.Time `xml:"time"` - Rating int `xml:"rating"` - Reason string `xml:"reason"` - ReasonText string `xml:"reasonText"` - Prerequisite []string `xml:"prerequisite,omitempty"` - Action []BaseClusterAction `xml:"action,omitempty,typeattr"` - Target *ManagedObjectReference `xml:"target,omitempty"` -} - -func init() { - t["ClusterRecommendation"] = reflect.TypeOf((*ClusterRecommendation)(nil)).Elem() -} - -type ClusterReconfiguredEvent struct { - ClusterEvent -} - -func init() { - t["ClusterReconfiguredEvent"] = reflect.TypeOf((*ClusterReconfiguredEvent)(nil)).Elem() -} - -type ClusterRuleInfo struct { - DynamicData - - Key int `xml:"key,omitempty"` - Status ManagedEntityStatus `xml:"status,omitempty"` - Enabled *bool `xml:"enabled"` - Name string `xml:"name,omitempty"` - Mandatory *bool `xml:"mandatory"` - UserCreated *bool `xml:"userCreated"` - InCompliance *bool `xml:"inCompliance"` -} - -func init() { - t["ClusterRuleInfo"] = reflect.TypeOf((*ClusterRuleInfo)(nil)).Elem() -} - -type ClusterRuleSpec struct { - ArrayUpdateSpec - - Info BaseClusterRuleInfo `xml:"info,omitempty,typeattr"` -} - -func init() { - t["ClusterRuleSpec"] = reflect.TypeOf((*ClusterRuleSpec)(nil)).Elem() -} - -type ClusterSlotPolicy struct { - DynamicData -} - -func init() { - t["ClusterSlotPolicy"] = reflect.TypeOf((*ClusterSlotPolicy)(nil)).Elem() -} - -type ClusterStatusChangedEvent struct { - ClusterEvent - - OldStatus string `xml:"oldStatus"` - NewStatus string `xml:"newStatus"` -} - -func init() { - t["ClusterStatusChangedEvent"] = reflect.TypeOf((*ClusterStatusChangedEvent)(nil)).Elem() -} - -type ClusterVmGroup struct { - ClusterGroupInfo - - Vm []ManagedObjectReference `xml:"vm,omitempty"` -} - -func init() { - t["ClusterVmGroup"] = reflect.TypeOf((*ClusterVmGroup)(nil)).Elem() -} - -type ClusterVmHostRuleInfo struct { - ClusterRuleInfo - - VmGroupName string `xml:"vmGroupName,omitempty"` - AffineHostGroupName string `xml:"affineHostGroupName,omitempty"` - AntiAffineHostGroupName string `xml:"antiAffineHostGroupName,omitempty"` -} - -func init() { - t["ClusterVmHostRuleInfo"] = reflect.TypeOf((*ClusterVmHostRuleInfo)(nil)).Elem() -} - -type ClusterVmToolsMonitoringSettings struct { - DynamicData - - Enabled *bool `xml:"enabled"` - VmMonitoring string `xml:"vmMonitoring,omitempty"` - ClusterSettings *bool `xml:"clusterSettings"` - FailureInterval int `xml:"failureInterval,omitempty"` - MinUpTime int `xml:"minUpTime,omitempty"` - MaxFailures int `xml:"maxFailures,omitempty"` - MaxFailureWindow int `xml:"maxFailureWindow,omitempty"` -} - -func init() { - t["ClusterVmToolsMonitoringSettings"] = reflect.TypeOf((*ClusterVmToolsMonitoringSettings)(nil)).Elem() -} - -type CollectorAddressUnset struct { - DvsFault -} - -func init() { - t["CollectorAddressUnset"] = reflect.TypeOf((*CollectorAddressUnset)(nil)).Elem() -} - -type CollectorAddressUnsetFault CollectorAddressUnset - -func init() { - t["CollectorAddressUnsetFault"] = reflect.TypeOf((*CollectorAddressUnsetFault)(nil)).Elem() -} - -type ComplianceFailure struct { - DynamicData - - FailureType string `xml:"failureType"` - Message LocalizableMessage `xml:"message"` - ExpressionName string `xml:"expressionName,omitempty"` -} - -func init() { - t["ComplianceFailure"] = reflect.TypeOf((*ComplianceFailure)(nil)).Elem() -} - -type ComplianceLocator struct { - DynamicData - - ExpressionName string `xml:"expressionName"` - ApplyPath ProfilePropertyPath `xml:"applyPath"` -} - -func init() { - t["ComplianceLocator"] = reflect.TypeOf((*ComplianceLocator)(nil)).Elem() -} - -type ComplianceProfile struct { - DynamicData - - Expression []BaseProfileExpression `xml:"expression,typeattr"` - RootExpression string `xml:"rootExpression"` -} - -func init() { - t["ComplianceProfile"] = reflect.TypeOf((*ComplianceProfile)(nil)).Elem() -} - -type ComplianceResult struct { - DynamicData - - Profile *ManagedObjectReference `xml:"profile,omitempty"` - ComplianceStatus string `xml:"complianceStatus"` - Entity *ManagedObjectReference `xml:"entity,omitempty"` - CheckTime *time.Time `xml:"checkTime"` - Failure []ComplianceFailure `xml:"failure,omitempty"` -} - -func init() { - t["ComplianceResult"] = reflect.TypeOf((*ComplianceResult)(nil)).Elem() -} - -type CompositePolicyOption struct { - PolicyOption - - Option []BasePolicyOption `xml:"option,omitempty,typeattr"` -} - -func init() { - t["CompositePolicyOption"] = reflect.TypeOf((*CompositePolicyOption)(nil)).Elem() -} - -type ComputeDiskPartitionInfo ComputeDiskPartitionInfoRequestType - -func init() { - t["ComputeDiskPartitionInfo"] = reflect.TypeOf((*ComputeDiskPartitionInfo)(nil)).Elem() -} - -type ComputeDiskPartitionInfoForResize ComputeDiskPartitionInfoForResizeRequestType - -func init() { - t["ComputeDiskPartitionInfoForResize"] = reflect.TypeOf((*ComputeDiskPartitionInfoForResize)(nil)).Elem() -} - -type ComputeDiskPartitionInfoForResizeRequestType struct { - This ManagedObjectReference `xml:"_this"` - Partition HostScsiDiskPartition `xml:"partition"` - BlockRange HostDiskPartitionBlockRange `xml:"blockRange"` - PartitionFormat string `xml:"partitionFormat,omitempty"` -} - -func init() { - t["ComputeDiskPartitionInfoForResizeRequestType"] = reflect.TypeOf((*ComputeDiskPartitionInfoForResizeRequestType)(nil)).Elem() -} - -type ComputeDiskPartitionInfoForResizeResponse struct { - Returnval HostDiskPartitionInfo `xml:"returnval"` -} - -type ComputeDiskPartitionInfoRequestType struct { - This ManagedObjectReference `xml:"_this"` - DevicePath string `xml:"devicePath"` - Layout HostDiskPartitionLayout `xml:"layout"` - PartitionFormat string `xml:"partitionFormat,omitempty"` -} - -func init() { - t["ComputeDiskPartitionInfoRequestType"] = reflect.TypeOf((*ComputeDiskPartitionInfoRequestType)(nil)).Elem() -} - -type ComputeDiskPartitionInfoResponse struct { - Returnval HostDiskPartitionInfo `xml:"returnval"` -} - -type ComputeResourceConfigInfo struct { - DynamicData - - VmSwapPlacement string `xml:"vmSwapPlacement"` - SpbmEnabled *bool `xml:"spbmEnabled"` - DefaultHardwareVersionKey string `xml:"defaultHardwareVersionKey,omitempty"` -} - -func init() { - t["ComputeResourceConfigInfo"] = reflect.TypeOf((*ComputeResourceConfigInfo)(nil)).Elem() -} - -type ComputeResourceConfigSpec struct { - DynamicData - - VmSwapPlacement string `xml:"vmSwapPlacement,omitempty"` - SpbmEnabled *bool `xml:"spbmEnabled"` - DefaultHardwareVersionKey string `xml:"defaultHardwareVersionKey,omitempty"` -} - -func init() { - t["ComputeResourceConfigSpec"] = reflect.TypeOf((*ComputeResourceConfigSpec)(nil)).Elem() -} - -type ComputeResourceEventArgument struct { - EntityEventArgument - - ComputeResource ManagedObjectReference `xml:"computeResource"` -} - -func init() { - t["ComputeResourceEventArgument"] = reflect.TypeOf((*ComputeResourceEventArgument)(nil)).Elem() -} - -type ComputeResourceHostSPBMLicenseInfo struct { - DynamicData - - Host ManagedObjectReference `xml:"host"` - LicenseState ComputeResourceHostSPBMLicenseInfoHostSPBMLicenseState `xml:"licenseState"` -} - -func init() { - t["ComputeResourceHostSPBMLicenseInfo"] = reflect.TypeOf((*ComputeResourceHostSPBMLicenseInfo)(nil)).Elem() -} - -type ComputeResourceSummary struct { - DynamicData - - TotalCpu int `xml:"totalCpu"` - TotalMemory int64 `xml:"totalMemory"` - NumCpuCores int16 `xml:"numCpuCores"` - NumCpuThreads int16 `xml:"numCpuThreads"` - EffectiveCpu int `xml:"effectiveCpu"` - EffectiveMemory int64 `xml:"effectiveMemory"` - NumHosts int `xml:"numHosts"` - NumEffectiveHosts int `xml:"numEffectiveHosts"` - OverallStatus ManagedEntityStatus `xml:"overallStatus"` -} - -func init() { - t["ComputeResourceSummary"] = reflect.TypeOf((*ComputeResourceSummary)(nil)).Elem() -} - -type ConcurrentAccess struct { - VimFault -} - -func init() { - t["ConcurrentAccess"] = reflect.TypeOf((*ConcurrentAccess)(nil)).Elem() -} - -type ConcurrentAccessFault ConcurrentAccess - -func init() { - t["ConcurrentAccessFault"] = reflect.TypeOf((*ConcurrentAccessFault)(nil)).Elem() -} - -type ConfigTarget struct { - DynamicData - - NumCpus int `xml:"numCpus"` - NumCpuCores int `xml:"numCpuCores"` - NumNumaNodes int `xml:"numNumaNodes"` - SmcPresent *bool `xml:"smcPresent"` - Datastore []VirtualMachineDatastoreInfo `xml:"datastore,omitempty"` - Network []VirtualMachineNetworkInfo `xml:"network,omitempty"` - OpaqueNetwork []OpaqueNetworkTargetInfo `xml:"opaqueNetwork,omitempty"` - DistributedVirtualPortgroup []DistributedVirtualPortgroupInfo `xml:"distributedVirtualPortgroup,omitempty"` - DistributedVirtualSwitch []DistributedVirtualSwitchInfo `xml:"distributedVirtualSwitch,omitempty"` - CdRom []VirtualMachineCdromInfo `xml:"cdRom,omitempty"` - Serial []VirtualMachineSerialInfo `xml:"serial,omitempty"` - Parallel []VirtualMachineParallelInfo `xml:"parallel,omitempty"` - Sound []VirtualMachineSoundInfo `xml:"sound,omitempty"` - Usb []VirtualMachineUsbInfo `xml:"usb,omitempty"` - Floppy []VirtualMachineFloppyInfo `xml:"floppy,omitempty"` - LegacyNetworkInfo []VirtualMachineLegacyNetworkSwitchInfo `xml:"legacyNetworkInfo,omitempty"` - ScsiPassthrough []VirtualMachineScsiPassthroughInfo `xml:"scsiPassthrough,omitempty"` - ScsiDisk []VirtualMachineScsiDiskDeviceInfo `xml:"scsiDisk,omitempty"` - IdeDisk []VirtualMachineIdeDiskDeviceInfo `xml:"ideDisk,omitempty"` - MaxMemMBOptimalPerf int `xml:"maxMemMBOptimalPerf"` - ResourcePool *ResourcePoolRuntimeInfo `xml:"resourcePool,omitempty"` - AutoVmotion *bool `xml:"autoVmotion"` - PciPassthrough []BaseVirtualMachinePciPassthroughInfo `xml:"pciPassthrough,omitempty,typeattr"` - Sriov []VirtualMachineSriovInfo `xml:"sriov,omitempty"` - VFlashModule []VirtualMachineVFlashModuleInfo `xml:"vFlashModule,omitempty"` -} - -func init() { - t["ConfigTarget"] = reflect.TypeOf((*ConfigTarget)(nil)).Elem() -} - -type ConfigureDatastoreIORMRequestType struct { - This ManagedObjectReference `xml:"_this"` - Datastore ManagedObjectReference `xml:"datastore"` - Spec StorageIORMConfigSpec `xml:"spec"` -} - -func init() { - t["ConfigureDatastoreIORMRequestType"] = reflect.TypeOf((*ConfigureDatastoreIORMRequestType)(nil)).Elem() -} - -type ConfigureDatastoreIORM_Task ConfigureDatastoreIORMRequestType - -func init() { - t["ConfigureDatastoreIORM_Task"] = reflect.TypeOf((*ConfigureDatastoreIORM_Task)(nil)).Elem() -} - -type ConfigureDatastoreIORM_TaskResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type ConfigureDatastorePrincipal ConfigureDatastorePrincipalRequestType - -func init() { - t["ConfigureDatastorePrincipal"] = reflect.TypeOf((*ConfigureDatastorePrincipal)(nil)).Elem() -} - -type ConfigureDatastorePrincipalRequestType struct { - This ManagedObjectReference `xml:"_this"` - UserName string `xml:"userName"` - Password string `xml:"password,omitempty"` -} - -func init() { - t["ConfigureDatastorePrincipalRequestType"] = reflect.TypeOf((*ConfigureDatastorePrincipalRequestType)(nil)).Elem() -} - -type ConfigureDatastorePrincipalResponse struct { -} - -type ConfigureHostCacheRequestType struct { - This ManagedObjectReference `xml:"_this"` - Spec HostCacheConfigurationSpec `xml:"spec"` -} - -func init() { - t["ConfigureHostCacheRequestType"] = reflect.TypeOf((*ConfigureHostCacheRequestType)(nil)).Elem() -} - -type ConfigureHostCache_Task ConfigureHostCacheRequestType - -func init() { - t["ConfigureHostCache_Task"] = reflect.TypeOf((*ConfigureHostCache_Task)(nil)).Elem() -} - -type ConfigureHostCache_TaskResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type ConfigureLicenseSource ConfigureLicenseSourceRequestType - -func init() { - t["ConfigureLicenseSource"] = reflect.TypeOf((*ConfigureLicenseSource)(nil)).Elem() -} - -type ConfigureLicenseSourceRequestType struct { - This ManagedObjectReference `xml:"_this"` - Host *ManagedObjectReference `xml:"host,omitempty"` - LicenseSource BaseLicenseSource `xml:"licenseSource,typeattr"` -} - -func init() { - t["ConfigureLicenseSourceRequestType"] = reflect.TypeOf((*ConfigureLicenseSourceRequestType)(nil)).Elem() -} - -type ConfigureLicenseSourceResponse struct { -} - -type ConfigurePowerPolicy ConfigurePowerPolicyRequestType - -func init() { - t["ConfigurePowerPolicy"] = reflect.TypeOf((*ConfigurePowerPolicy)(nil)).Elem() -} - -type ConfigurePowerPolicyRequestType struct { - This ManagedObjectReference `xml:"_this"` - Key int `xml:"key"` -} - -func init() { - t["ConfigurePowerPolicyRequestType"] = reflect.TypeOf((*ConfigurePowerPolicyRequestType)(nil)).Elem() -} - -type ConfigurePowerPolicyResponse struct { -} - -type ConfigureStorageDrsForPodRequestType struct { - This ManagedObjectReference `xml:"_this"` - Pod ManagedObjectReference `xml:"pod"` - Spec StorageDrsConfigSpec `xml:"spec"` - Modify bool `xml:"modify"` -} - -func init() { - t["ConfigureStorageDrsForPodRequestType"] = reflect.TypeOf((*ConfigureStorageDrsForPodRequestType)(nil)).Elem() -} - -type ConfigureStorageDrsForPod_Task ConfigureStorageDrsForPodRequestType - -func init() { - t["ConfigureStorageDrsForPod_Task"] = reflect.TypeOf((*ConfigureStorageDrsForPod_Task)(nil)).Elem() -} - -type ConfigureStorageDrsForPod_TaskResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type ConfigureVFlashResourceExRequestType struct { - This ManagedObjectReference `xml:"_this"` - DevicePath []string `xml:"devicePath,omitempty"` -} - -func init() { - t["ConfigureVFlashResourceExRequestType"] = reflect.TypeOf((*ConfigureVFlashResourceExRequestType)(nil)).Elem() -} - -type ConfigureVFlashResourceEx_Task ConfigureVFlashResourceExRequestType - -func init() { - t["ConfigureVFlashResourceEx_Task"] = reflect.TypeOf((*ConfigureVFlashResourceEx_Task)(nil)).Elem() -} - -type ConfigureVFlashResourceEx_TaskResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type ConflictingConfiguration struct { - DvsFault - - ConfigInConflict []ConflictingConfigurationConfig `xml:"configInConflict"` -} - -func init() { - t["ConflictingConfiguration"] = reflect.TypeOf((*ConflictingConfiguration)(nil)).Elem() -} - -type ConflictingConfigurationConfig struct { - DynamicData - - Entity *ManagedObjectReference `xml:"entity,omitempty"` - PropertyPath string `xml:"propertyPath"` -} - -func init() { - t["ConflictingConfigurationConfig"] = reflect.TypeOf((*ConflictingConfigurationConfig)(nil)).Elem() -} - -type ConflictingConfigurationFault ConflictingConfiguration - -func init() { - t["ConflictingConfigurationFault"] = reflect.TypeOf((*ConflictingConfigurationFault)(nil)).Elem() -} - -type ConflictingDatastoreFound struct { - RuntimeFault - - Name string `xml:"name"` - Url string `xml:"url"` -} - -func init() { - t["ConflictingDatastoreFound"] = reflect.TypeOf((*ConflictingDatastoreFound)(nil)).Elem() -} - -type ConflictingDatastoreFoundFault ConflictingDatastoreFound - -func init() { - t["ConflictingDatastoreFoundFault"] = reflect.TypeOf((*ConflictingDatastoreFoundFault)(nil)).Elem() -} - -type ConnectedIso struct { - OvfExport - - Cdrom VirtualCdrom `xml:"cdrom"` - Filename string `xml:"filename"` -} - -func init() { - t["ConnectedIso"] = reflect.TypeOf((*ConnectedIso)(nil)).Elem() -} - -type ConnectedIsoFault ConnectedIso - -func init() { - t["ConnectedIsoFault"] = reflect.TypeOf((*ConnectedIsoFault)(nil)).Elem() -} - -type ConsolidateVMDisksRequestType struct { - This ManagedObjectReference `xml:"_this"` -} - -func init() { - t["ConsolidateVMDisksRequestType"] = reflect.TypeOf((*ConsolidateVMDisksRequestType)(nil)).Elem() -} - -type ConsolidateVMDisks_Task ConsolidateVMDisksRequestType - -func init() { - t["ConsolidateVMDisks_Task"] = reflect.TypeOf((*ConsolidateVMDisks_Task)(nil)).Elem() -} - -type ConsolidateVMDisks_TaskResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type ContinueRetrievePropertiesEx ContinueRetrievePropertiesExRequestType - -func init() { - t["ContinueRetrievePropertiesEx"] = reflect.TypeOf((*ContinueRetrievePropertiesEx)(nil)).Elem() -} - -type ContinueRetrievePropertiesExRequestType struct { - This ManagedObjectReference `xml:"_this"` - Token string `xml:"token"` -} - -func init() { - t["ContinueRetrievePropertiesExRequestType"] = reflect.TypeOf((*ContinueRetrievePropertiesExRequestType)(nil)).Elem() -} - -type ContinueRetrievePropertiesExResponse struct { - Returnval RetrieveResult `xml:"returnval"` -} - -type CopyDatastoreFileRequestType struct { - This ManagedObjectReference `xml:"_this"` - SourceName string `xml:"sourceName"` - SourceDatacenter *ManagedObjectReference `xml:"sourceDatacenter,omitempty"` - DestinationName string `xml:"destinationName"` - DestinationDatacenter *ManagedObjectReference `xml:"destinationDatacenter,omitempty"` - Force *bool `xml:"force"` -} - -func init() { - t["CopyDatastoreFileRequestType"] = reflect.TypeOf((*CopyDatastoreFileRequestType)(nil)).Elem() -} - -type CopyDatastoreFile_Task CopyDatastoreFileRequestType - -func init() { - t["CopyDatastoreFile_Task"] = reflect.TypeOf((*CopyDatastoreFile_Task)(nil)).Elem() -} - -type CopyDatastoreFile_TaskResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type CopyVirtualDiskRequestType struct { - This ManagedObjectReference `xml:"_this"` - SourceName string `xml:"sourceName"` - SourceDatacenter *ManagedObjectReference `xml:"sourceDatacenter,omitempty"` - DestName string `xml:"destName"` - DestDatacenter *ManagedObjectReference `xml:"destDatacenter,omitempty"` - DestSpec BaseVirtualDiskSpec `xml:"destSpec,omitempty,typeattr"` - Force *bool `xml:"force"` -} - -func init() { - t["CopyVirtualDiskRequestType"] = reflect.TypeOf((*CopyVirtualDiskRequestType)(nil)).Elem() -} - -type CopyVirtualDisk_Task CopyVirtualDiskRequestType - -func init() { - t["CopyVirtualDisk_Task"] = reflect.TypeOf((*CopyVirtualDisk_Task)(nil)).Elem() -} - -type CopyVirtualDisk_TaskResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type CpuCompatibilityUnknown struct { - CpuIncompatible -} - -func init() { - t["CpuCompatibilityUnknown"] = reflect.TypeOf((*CpuCompatibilityUnknown)(nil)).Elem() -} - -type CpuCompatibilityUnknownFault CpuCompatibilityUnknown - -func init() { - t["CpuCompatibilityUnknownFault"] = reflect.TypeOf((*CpuCompatibilityUnknownFault)(nil)).Elem() -} - -type CpuHotPlugNotSupported struct { - VmConfigFault -} - -func init() { - t["CpuHotPlugNotSupported"] = reflect.TypeOf((*CpuHotPlugNotSupported)(nil)).Elem() -} - -type CpuHotPlugNotSupportedFault CpuHotPlugNotSupported - -func init() { - t["CpuHotPlugNotSupportedFault"] = reflect.TypeOf((*CpuHotPlugNotSupportedFault)(nil)).Elem() -} - -type CpuIncompatible struct { - VirtualHardwareCompatibilityIssue - - Level int `xml:"level"` - RegisterName string `xml:"registerName"` - RegisterBits string `xml:"registerBits,omitempty"` - DesiredBits string `xml:"desiredBits,omitempty"` - Host *ManagedObjectReference `xml:"host,omitempty"` -} - -func init() { - t["CpuIncompatible"] = reflect.TypeOf((*CpuIncompatible)(nil)).Elem() -} - -type CpuIncompatible1ECX struct { - CpuIncompatible - - Sse3 bool `xml:"sse3"` - Pclmulqdq *bool `xml:"pclmulqdq"` - Ssse3 bool `xml:"ssse3"` - Sse41 bool `xml:"sse41"` - Sse42 bool `xml:"sse42"` - Aes *bool `xml:"aes"` - Other bool `xml:"other"` - OtherOnly bool `xml:"otherOnly"` -} - -func init() { - t["CpuIncompatible1ECX"] = reflect.TypeOf((*CpuIncompatible1ECX)(nil)).Elem() -} - -type CpuIncompatible1ECXFault CpuIncompatible1ECX - -func init() { - t["CpuIncompatible1ECXFault"] = reflect.TypeOf((*CpuIncompatible1ECXFault)(nil)).Elem() -} - -type CpuIncompatible81EDX struct { - CpuIncompatible - - Nx bool `xml:"nx"` - Ffxsr bool `xml:"ffxsr"` - Rdtscp bool `xml:"rdtscp"` - Lm bool `xml:"lm"` - Other bool `xml:"other"` - OtherOnly bool `xml:"otherOnly"` -} - -func init() { - t["CpuIncompatible81EDX"] = reflect.TypeOf((*CpuIncompatible81EDX)(nil)).Elem() -} - -type CpuIncompatible81EDXFault CpuIncompatible81EDX - -func init() { - t["CpuIncompatible81EDXFault"] = reflect.TypeOf((*CpuIncompatible81EDXFault)(nil)).Elem() -} - -type CpuIncompatibleFault BaseCpuIncompatible - -func init() { - t["CpuIncompatibleFault"] = reflect.TypeOf((*CpuIncompatibleFault)(nil)).Elem() -} - -type CreateAlarm CreateAlarmRequestType - -func init() { - t["CreateAlarm"] = reflect.TypeOf((*CreateAlarm)(nil)).Elem() -} - -type CreateAlarmRequestType struct { - This ManagedObjectReference `xml:"_this"` - Entity ManagedObjectReference `xml:"entity"` - Spec BaseAlarmSpec `xml:"spec,typeattr"` -} - -func init() { - t["CreateAlarmRequestType"] = reflect.TypeOf((*CreateAlarmRequestType)(nil)).Elem() -} - -type CreateAlarmResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type CreateChildVMRequestType struct { - This ManagedObjectReference `xml:"_this"` - Config VirtualMachineConfigSpec `xml:"config"` - Host *ManagedObjectReference `xml:"host,omitempty"` -} - -func init() { - t["CreateChildVMRequestType"] = reflect.TypeOf((*CreateChildVMRequestType)(nil)).Elem() -} - -type CreateChildVM_Task CreateChildVMRequestType - -func init() { - t["CreateChildVM_Task"] = reflect.TypeOf((*CreateChildVM_Task)(nil)).Elem() -} - -type CreateChildVM_TaskResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type CreateCluster CreateClusterRequestType - -func init() { - t["CreateCluster"] = reflect.TypeOf((*CreateCluster)(nil)).Elem() -} - -type CreateClusterEx CreateClusterExRequestType - -func init() { - t["CreateClusterEx"] = reflect.TypeOf((*CreateClusterEx)(nil)).Elem() -} - -type CreateClusterExRequestType struct { - This ManagedObjectReference `xml:"_this"` - Name string `xml:"name"` - Spec ClusterConfigSpecEx `xml:"spec"` -} - -func init() { - t["CreateClusterExRequestType"] = reflect.TypeOf((*CreateClusterExRequestType)(nil)).Elem() -} - -type CreateClusterExResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type CreateClusterRequestType struct { - This ManagedObjectReference `xml:"_this"` - Name string `xml:"name"` - Spec ClusterConfigSpec `xml:"spec"` -} - -func init() { - t["CreateClusterRequestType"] = reflect.TypeOf((*CreateClusterRequestType)(nil)).Elem() -} - -type CreateClusterResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type CreateCollectorForEvents CreateCollectorForEventsRequestType - -func init() { - t["CreateCollectorForEvents"] = reflect.TypeOf((*CreateCollectorForEvents)(nil)).Elem() -} - -type CreateCollectorForEventsRequestType struct { - This ManagedObjectReference `xml:"_this"` - Filter EventFilterSpec `xml:"filter"` -} - -func init() { - t["CreateCollectorForEventsRequestType"] = reflect.TypeOf((*CreateCollectorForEventsRequestType)(nil)).Elem() -} - -type CreateCollectorForEventsResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type CreateCollectorForTasks CreateCollectorForTasksRequestType - -func init() { - t["CreateCollectorForTasks"] = reflect.TypeOf((*CreateCollectorForTasks)(nil)).Elem() -} - -type CreateCollectorForTasksRequestType struct { - This ManagedObjectReference `xml:"_this"` - Filter TaskFilterSpec `xml:"filter"` -} - -func init() { - t["CreateCollectorForTasksRequestType"] = reflect.TypeOf((*CreateCollectorForTasksRequestType)(nil)).Elem() -} - -type CreateCollectorForTasksResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type CreateContainerView CreateContainerViewRequestType - -func init() { - t["CreateContainerView"] = reflect.TypeOf((*CreateContainerView)(nil)).Elem() -} - -type CreateContainerViewRequestType struct { - This ManagedObjectReference `xml:"_this"` - Container ManagedObjectReference `xml:"container"` - Type []string `xml:"type,omitempty"` - Recursive bool `xml:"recursive"` -} - -func init() { - t["CreateContainerViewRequestType"] = reflect.TypeOf((*CreateContainerViewRequestType)(nil)).Elem() -} - -type CreateContainerViewResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type CreateCustomizationSpec CreateCustomizationSpecRequestType - -func init() { - t["CreateCustomizationSpec"] = reflect.TypeOf((*CreateCustomizationSpec)(nil)).Elem() -} - -type CreateCustomizationSpecRequestType struct { - This ManagedObjectReference `xml:"_this"` - Item CustomizationSpecItem `xml:"item"` -} - -func init() { - t["CreateCustomizationSpecRequestType"] = reflect.TypeOf((*CreateCustomizationSpecRequestType)(nil)).Elem() -} - -type CreateCustomizationSpecResponse struct { -} - -type CreateDVPortgroupRequestType struct { - This ManagedObjectReference `xml:"_this"` - Spec DVPortgroupConfigSpec `xml:"spec"` -} - -func init() { - t["CreateDVPortgroupRequestType"] = reflect.TypeOf((*CreateDVPortgroupRequestType)(nil)).Elem() -} - -type CreateDVPortgroup_Task CreateDVPortgroupRequestType - -func init() { - t["CreateDVPortgroup_Task"] = reflect.TypeOf((*CreateDVPortgroup_Task)(nil)).Elem() -} - -type CreateDVPortgroup_TaskResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type CreateDVSRequestType struct { - This ManagedObjectReference `xml:"_this"` - Spec DVSCreateSpec `xml:"spec"` -} - -func init() { - t["CreateDVSRequestType"] = reflect.TypeOf((*CreateDVSRequestType)(nil)).Elem() -} - -type CreateDVS_Task CreateDVSRequestType - -func init() { - t["CreateDVS_Task"] = reflect.TypeOf((*CreateDVS_Task)(nil)).Elem() -} - -type CreateDVS_TaskResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type CreateDatacenter CreateDatacenterRequestType - -func init() { - t["CreateDatacenter"] = reflect.TypeOf((*CreateDatacenter)(nil)).Elem() -} - -type CreateDatacenterRequestType struct { - This ManagedObjectReference `xml:"_this"` - Name string `xml:"name"` -} - -func init() { - t["CreateDatacenterRequestType"] = reflect.TypeOf((*CreateDatacenterRequestType)(nil)).Elem() -} - -type CreateDatacenterResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type CreateDefaultProfile CreateDefaultProfileRequestType - -func init() { - t["CreateDefaultProfile"] = reflect.TypeOf((*CreateDefaultProfile)(nil)).Elem() -} - -type CreateDefaultProfileRequestType struct { - This ManagedObjectReference `xml:"_this"` - ProfileType string `xml:"profileType"` - ProfileTypeName string `xml:"profileTypeName,omitempty"` - Profile *ManagedObjectReference `xml:"profile,omitempty"` -} - -func init() { - t["CreateDefaultProfileRequestType"] = reflect.TypeOf((*CreateDefaultProfileRequestType)(nil)).Elem() -} - -type CreateDefaultProfileResponse struct { - Returnval BaseApplyProfile `xml:"returnval,typeattr"` -} - -type CreateDescriptor CreateDescriptorRequestType - -func init() { - t["CreateDescriptor"] = reflect.TypeOf((*CreateDescriptor)(nil)).Elem() -} - -type CreateDescriptorRequestType struct { - This ManagedObjectReference `xml:"_this"` - Obj ManagedObjectReference `xml:"obj"` - Cdp OvfCreateDescriptorParams `xml:"cdp"` -} - -func init() { - t["CreateDescriptorRequestType"] = reflect.TypeOf((*CreateDescriptorRequestType)(nil)).Elem() -} - -type CreateDescriptorResponse struct { - Returnval OvfCreateDescriptorResult `xml:"returnval"` -} - -type CreateDiagnosticPartition CreateDiagnosticPartitionRequestType - -func init() { - t["CreateDiagnosticPartition"] = reflect.TypeOf((*CreateDiagnosticPartition)(nil)).Elem() -} - -type CreateDiagnosticPartitionRequestType struct { - This ManagedObjectReference `xml:"_this"` - Spec HostDiagnosticPartitionCreateSpec `xml:"spec"` -} - -func init() { - t["CreateDiagnosticPartitionRequestType"] = reflect.TypeOf((*CreateDiagnosticPartitionRequestType)(nil)).Elem() -} - -type CreateDiagnosticPartitionResponse struct { -} - -type CreateDirectory CreateDirectoryRequestType - -func init() { - t["CreateDirectory"] = reflect.TypeOf((*CreateDirectory)(nil)).Elem() -} - -type CreateDirectoryRequestType struct { - This ManagedObjectReference `xml:"_this"` - Datastore ManagedObjectReference `xml:"datastore"` - DisplayName string `xml:"displayName,omitempty"` - Policy string `xml:"policy,omitempty"` -} - -func init() { - t["CreateDirectoryRequestType"] = reflect.TypeOf((*CreateDirectoryRequestType)(nil)).Elem() -} - -type CreateDirectoryResponse struct { - Returnval string `xml:"returnval"` -} - -type CreateFilter CreateFilterRequestType - -func init() { - t["CreateFilter"] = reflect.TypeOf((*CreateFilter)(nil)).Elem() -} - -type CreateFilterRequestType struct { - This ManagedObjectReference `xml:"_this"` - Spec PropertyFilterSpec `xml:"spec"` - PartialUpdates bool `xml:"partialUpdates"` -} - -func init() { - t["CreateFilterRequestType"] = reflect.TypeOf((*CreateFilterRequestType)(nil)).Elem() -} - -type CreateFilterResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type CreateFolder CreateFolderRequestType - -func init() { - t["CreateFolder"] = reflect.TypeOf((*CreateFolder)(nil)).Elem() -} - -type CreateFolderRequestType struct { - This ManagedObjectReference `xml:"_this"` - Name string `xml:"name"` -} - -func init() { - t["CreateFolderRequestType"] = reflect.TypeOf((*CreateFolderRequestType)(nil)).Elem() -} - -type CreateFolderResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type CreateGroup CreateGroupRequestType - -func init() { - t["CreateGroup"] = reflect.TypeOf((*CreateGroup)(nil)).Elem() -} - -type CreateGroupRequestType struct { - This ManagedObjectReference `xml:"_this"` - Group BaseHostAccountSpec `xml:"group,typeattr"` -} - -func init() { - t["CreateGroupRequestType"] = reflect.TypeOf((*CreateGroupRequestType)(nil)).Elem() -} - -type CreateGroupResponse struct { -} - -type CreateImportSpec CreateImportSpecRequestType - -func init() { - t["CreateImportSpec"] = reflect.TypeOf((*CreateImportSpec)(nil)).Elem() -} - -type CreateImportSpecRequestType struct { - This ManagedObjectReference `xml:"_this"` - OvfDescriptor string `xml:"ovfDescriptor"` - ResourcePool ManagedObjectReference `xml:"resourcePool"` - Datastore ManagedObjectReference `xml:"datastore"` - Cisp OvfCreateImportSpecParams `xml:"cisp"` -} - -func init() { - t["CreateImportSpecRequestType"] = reflect.TypeOf((*CreateImportSpecRequestType)(nil)).Elem() -} - -type CreateImportSpecResponse struct { - Returnval OvfCreateImportSpecResult `xml:"returnval"` -} - -type CreateInventoryView CreateInventoryViewRequestType - -func init() { - t["CreateInventoryView"] = reflect.TypeOf((*CreateInventoryView)(nil)).Elem() -} - -type CreateInventoryViewRequestType struct { - This ManagedObjectReference `xml:"_this"` -} - -func init() { - t["CreateInventoryViewRequestType"] = reflect.TypeOf((*CreateInventoryViewRequestType)(nil)).Elem() -} - -type CreateInventoryViewResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type CreateIpPool CreateIpPoolRequestType - -func init() { - t["CreateIpPool"] = reflect.TypeOf((*CreateIpPool)(nil)).Elem() -} - -type CreateIpPoolRequestType struct { - This ManagedObjectReference `xml:"_this"` - Dc ManagedObjectReference `xml:"dc"` - Pool IpPool `xml:"pool"` -} - -func init() { - t["CreateIpPoolRequestType"] = reflect.TypeOf((*CreateIpPoolRequestType)(nil)).Elem() -} - -type CreateIpPoolResponse struct { - Returnval int `xml:"returnval"` -} - -type CreateListView CreateListViewRequestType - -func init() { - t["CreateListView"] = reflect.TypeOf((*CreateListView)(nil)).Elem() -} - -type CreateListViewFromView CreateListViewFromViewRequestType - -func init() { - t["CreateListViewFromView"] = reflect.TypeOf((*CreateListViewFromView)(nil)).Elem() -} - -type CreateListViewFromViewRequestType struct { - This ManagedObjectReference `xml:"_this"` - View ManagedObjectReference `xml:"view"` -} - -func init() { - t["CreateListViewFromViewRequestType"] = reflect.TypeOf((*CreateListViewFromViewRequestType)(nil)).Elem() -} - -type CreateListViewFromViewResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type CreateListViewRequestType struct { - This ManagedObjectReference `xml:"_this"` - Obj []ManagedObjectReference `xml:"obj,omitempty"` -} - -func init() { - t["CreateListViewRequestType"] = reflect.TypeOf((*CreateListViewRequestType)(nil)).Elem() -} - -type CreateListViewResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type CreateLocalDatastore CreateLocalDatastoreRequestType - -func init() { - t["CreateLocalDatastore"] = reflect.TypeOf((*CreateLocalDatastore)(nil)).Elem() -} - -type CreateLocalDatastoreRequestType struct { - This ManagedObjectReference `xml:"_this"` - Name string `xml:"name"` - Path string `xml:"path"` -} - -func init() { - t["CreateLocalDatastoreRequestType"] = reflect.TypeOf((*CreateLocalDatastoreRequestType)(nil)).Elem() -} - -type CreateLocalDatastoreResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type CreateNasDatastore CreateNasDatastoreRequestType - -func init() { - t["CreateNasDatastore"] = reflect.TypeOf((*CreateNasDatastore)(nil)).Elem() -} - -type CreateNasDatastoreRequestType struct { - This ManagedObjectReference `xml:"_this"` - Spec HostNasVolumeSpec `xml:"spec"` -} - -func init() { - t["CreateNasDatastoreRequestType"] = reflect.TypeOf((*CreateNasDatastoreRequestType)(nil)).Elem() -} - -type CreateNasDatastoreResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type CreateObjectScheduledTask CreateObjectScheduledTaskRequestType - -func init() { - t["CreateObjectScheduledTask"] = reflect.TypeOf((*CreateObjectScheduledTask)(nil)).Elem() -} - -type CreateObjectScheduledTaskRequestType struct { - This ManagedObjectReference `xml:"_this"` - Obj ManagedObjectReference `xml:"obj"` - Spec BaseScheduledTaskSpec `xml:"spec,typeattr"` -} - -func init() { - t["CreateObjectScheduledTaskRequestType"] = reflect.TypeOf((*CreateObjectScheduledTaskRequestType)(nil)).Elem() -} - -type CreateObjectScheduledTaskResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type CreatePerfInterval CreatePerfIntervalRequestType - -func init() { - t["CreatePerfInterval"] = reflect.TypeOf((*CreatePerfInterval)(nil)).Elem() -} - -type CreatePerfIntervalRequestType struct { - This ManagedObjectReference `xml:"_this"` - IntervalId PerfInterval `xml:"intervalId"` -} - -func init() { - t["CreatePerfIntervalRequestType"] = reflect.TypeOf((*CreatePerfIntervalRequestType)(nil)).Elem() -} - -type CreatePerfIntervalResponse struct { -} - -type CreateProfile CreateProfileRequestType - -func init() { - t["CreateProfile"] = reflect.TypeOf((*CreateProfile)(nil)).Elem() -} - -type CreateProfileRequestType struct { - This ManagedObjectReference `xml:"_this"` - CreateSpec BaseProfileCreateSpec `xml:"createSpec,typeattr"` -} - -func init() { - t["CreateProfileRequestType"] = reflect.TypeOf((*CreateProfileRequestType)(nil)).Elem() -} - -type CreateProfileResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type CreatePropertyCollector CreatePropertyCollectorRequestType - -func init() { - t["CreatePropertyCollector"] = reflect.TypeOf((*CreatePropertyCollector)(nil)).Elem() -} - -type CreatePropertyCollectorRequestType struct { - This ManagedObjectReference `xml:"_this"` -} - -func init() { - t["CreatePropertyCollectorRequestType"] = reflect.TypeOf((*CreatePropertyCollectorRequestType)(nil)).Elem() -} - -type CreatePropertyCollectorResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type CreateResourcePool CreateResourcePoolRequestType - -func init() { - t["CreateResourcePool"] = reflect.TypeOf((*CreateResourcePool)(nil)).Elem() -} - -type CreateResourcePoolRequestType struct { - This ManagedObjectReference `xml:"_this"` - Name string `xml:"name"` - Spec ResourceConfigSpec `xml:"spec"` -} - -func init() { - t["CreateResourcePoolRequestType"] = reflect.TypeOf((*CreateResourcePoolRequestType)(nil)).Elem() -} - -type CreateResourcePoolResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type CreateScheduledTask CreateScheduledTaskRequestType - -func init() { - t["CreateScheduledTask"] = reflect.TypeOf((*CreateScheduledTask)(nil)).Elem() -} - -type CreateScheduledTaskRequestType struct { - This ManagedObjectReference `xml:"_this"` - Entity ManagedObjectReference `xml:"entity"` - Spec BaseScheduledTaskSpec `xml:"spec,typeattr"` -} - -func init() { - t["CreateScheduledTaskRequestType"] = reflect.TypeOf((*CreateScheduledTaskRequestType)(nil)).Elem() -} - -type CreateScheduledTaskResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type CreateScreenshotRequestType struct { - This ManagedObjectReference `xml:"_this"` -} - -func init() { - t["CreateScreenshotRequestType"] = reflect.TypeOf((*CreateScreenshotRequestType)(nil)).Elem() -} - -type CreateScreenshot_Task CreateScreenshotRequestType - -func init() { - t["CreateScreenshot_Task"] = reflect.TypeOf((*CreateScreenshot_Task)(nil)).Elem() -} - -type CreateScreenshot_TaskResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type CreateSecondaryVMRequestType struct { - This ManagedObjectReference `xml:"_this"` - Host *ManagedObjectReference `xml:"host,omitempty"` -} - -func init() { - t["CreateSecondaryVMRequestType"] = reflect.TypeOf((*CreateSecondaryVMRequestType)(nil)).Elem() -} - -type CreateSecondaryVM_Task CreateSecondaryVMRequestType - -func init() { - t["CreateSecondaryVM_Task"] = reflect.TypeOf((*CreateSecondaryVM_Task)(nil)).Elem() -} - -type CreateSecondaryVM_TaskResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type CreateSnapshotRequestType struct { - This ManagedObjectReference `xml:"_this"` - Name string `xml:"name"` - Description string `xml:"description,omitempty"` - Memory bool `xml:"memory"` - Quiesce bool `xml:"quiesce"` -} - -func init() { - t["CreateSnapshotRequestType"] = reflect.TypeOf((*CreateSnapshotRequestType)(nil)).Elem() -} - -type CreateSnapshot_Task CreateSnapshotRequestType - -func init() { - t["CreateSnapshot_Task"] = reflect.TypeOf((*CreateSnapshot_Task)(nil)).Elem() -} - -type CreateSnapshot_TaskResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type CreateStoragePod CreateStoragePodRequestType - -func init() { - t["CreateStoragePod"] = reflect.TypeOf((*CreateStoragePod)(nil)).Elem() -} - -type CreateStoragePodRequestType struct { - This ManagedObjectReference `xml:"_this"` - Name string `xml:"name"` -} - -func init() { - t["CreateStoragePodRequestType"] = reflect.TypeOf((*CreateStoragePodRequestType)(nil)).Elem() -} - -type CreateStoragePodResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type CreateTask CreateTaskRequestType - -func init() { - t["CreateTask"] = reflect.TypeOf((*CreateTask)(nil)).Elem() -} - -type CreateTaskAction struct { - Action - - TaskTypeId string `xml:"taskTypeId"` - Cancelable bool `xml:"cancelable"` -} - -func init() { - t["CreateTaskAction"] = reflect.TypeOf((*CreateTaskAction)(nil)).Elem() -} - -type CreateTaskRequestType struct { - This ManagedObjectReference `xml:"_this"` - Obj ManagedObjectReference `xml:"obj"` - TaskTypeId string `xml:"taskTypeId"` - InitiatedBy string `xml:"initiatedBy,omitempty"` - Cancelable bool `xml:"cancelable"` - ParentTaskKey string `xml:"parentTaskKey,omitempty"` -} - -func init() { - t["CreateTaskRequestType"] = reflect.TypeOf((*CreateTaskRequestType)(nil)).Elem() -} - -type CreateTaskResponse struct { - Returnval TaskInfo `xml:"returnval"` -} - -type CreateTemporaryDirectoryInGuest CreateTemporaryDirectoryInGuestRequestType - -func init() { - t["CreateTemporaryDirectoryInGuest"] = reflect.TypeOf((*CreateTemporaryDirectoryInGuest)(nil)).Elem() -} - -type CreateTemporaryDirectoryInGuestRequestType struct { - This ManagedObjectReference `xml:"_this"` - Vm ManagedObjectReference `xml:"vm"` - Auth BaseGuestAuthentication `xml:"auth,typeattr"` - Prefix string `xml:"prefix"` - Suffix string `xml:"suffix"` - DirectoryPath string `xml:"directoryPath,omitempty"` -} - -func init() { - t["CreateTemporaryDirectoryInGuestRequestType"] = reflect.TypeOf((*CreateTemporaryDirectoryInGuestRequestType)(nil)).Elem() -} - -type CreateTemporaryDirectoryInGuestResponse struct { - Returnval string `xml:"returnval"` -} - -type CreateTemporaryFileInGuest CreateTemporaryFileInGuestRequestType - -func init() { - t["CreateTemporaryFileInGuest"] = reflect.TypeOf((*CreateTemporaryFileInGuest)(nil)).Elem() -} - -type CreateTemporaryFileInGuestRequestType struct { - This ManagedObjectReference `xml:"_this"` - Vm ManagedObjectReference `xml:"vm"` - Auth BaseGuestAuthentication `xml:"auth,typeattr"` - Prefix string `xml:"prefix"` - Suffix string `xml:"suffix"` - DirectoryPath string `xml:"directoryPath,omitempty"` -} - -func init() { - t["CreateTemporaryFileInGuestRequestType"] = reflect.TypeOf((*CreateTemporaryFileInGuestRequestType)(nil)).Elem() -} - -type CreateTemporaryFileInGuestResponse struct { - Returnval string `xml:"returnval"` -} - -type CreateUser CreateUserRequestType - -func init() { - t["CreateUser"] = reflect.TypeOf((*CreateUser)(nil)).Elem() -} - -type CreateUserRequestType struct { - This ManagedObjectReference `xml:"_this"` - User BaseHostAccountSpec `xml:"user,typeattr"` -} - -func init() { - t["CreateUserRequestType"] = reflect.TypeOf((*CreateUserRequestType)(nil)).Elem() -} - -type CreateUserResponse struct { -} - -type CreateVApp CreateVAppRequestType - -func init() { - t["CreateVApp"] = reflect.TypeOf((*CreateVApp)(nil)).Elem() -} - -type CreateVAppRequestType struct { - This ManagedObjectReference `xml:"_this"` - Name string `xml:"name"` - ResSpec ResourceConfigSpec `xml:"resSpec"` - ConfigSpec VAppConfigSpec `xml:"configSpec"` - VmFolder *ManagedObjectReference `xml:"vmFolder,omitempty"` -} - -func init() { - t["CreateVAppRequestType"] = reflect.TypeOf((*CreateVAppRequestType)(nil)).Elem() -} - -type CreateVAppResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type CreateVMRequestType struct { - This ManagedObjectReference `xml:"_this"` - Config VirtualMachineConfigSpec `xml:"config"` - Pool ManagedObjectReference `xml:"pool"` - Host *ManagedObjectReference `xml:"host,omitempty"` -} - -func init() { - t["CreateVMRequestType"] = reflect.TypeOf((*CreateVMRequestType)(nil)).Elem() -} - -type CreateVM_Task CreateVMRequestType - -func init() { - t["CreateVM_Task"] = reflect.TypeOf((*CreateVM_Task)(nil)).Elem() -} - -type CreateVM_TaskResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type CreateVirtualDiskRequestType struct { - This ManagedObjectReference `xml:"_this"` - Name string `xml:"name"` - Datacenter *ManagedObjectReference `xml:"datacenter,omitempty"` - Spec BaseVirtualDiskSpec `xml:"spec,typeattr"` -} - -func init() { - t["CreateVirtualDiskRequestType"] = reflect.TypeOf((*CreateVirtualDiskRequestType)(nil)).Elem() -} - -type CreateVirtualDisk_Task CreateVirtualDiskRequestType - -func init() { - t["CreateVirtualDisk_Task"] = reflect.TypeOf((*CreateVirtualDisk_Task)(nil)).Elem() -} - -type CreateVirtualDisk_TaskResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type CreateVmfsDatastore CreateVmfsDatastoreRequestType - -func init() { - t["CreateVmfsDatastore"] = reflect.TypeOf((*CreateVmfsDatastore)(nil)).Elem() -} - -type CreateVmfsDatastoreRequestType struct { - This ManagedObjectReference `xml:"_this"` - Spec VmfsDatastoreCreateSpec `xml:"spec"` -} - -func init() { - t["CreateVmfsDatastoreRequestType"] = reflect.TypeOf((*CreateVmfsDatastoreRequestType)(nil)).Elem() -} - -type CreateVmfsDatastoreResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type CurrentTime CurrentTimeRequestType - -func init() { - t["CurrentTime"] = reflect.TypeOf((*CurrentTime)(nil)).Elem() -} - -type CurrentTimeRequestType struct { - This ManagedObjectReference `xml:"_this"` -} - -func init() { - t["CurrentTimeRequestType"] = reflect.TypeOf((*CurrentTimeRequestType)(nil)).Elem() -} - -type CurrentTimeResponse struct { - Returnval time.Time `xml:"returnval"` -} - -type CustomFieldDef struct { - DynamicData - - Key int `xml:"key"` - Name string `xml:"name"` - Type string `xml:"type"` - ManagedObjectType string `xml:"managedObjectType,omitempty"` - FieldDefPrivileges *PrivilegePolicyDef `xml:"fieldDefPrivileges,omitempty"` - FieldInstancePrivileges *PrivilegePolicyDef `xml:"fieldInstancePrivileges,omitempty"` -} - -func init() { - t["CustomFieldDef"] = reflect.TypeOf((*CustomFieldDef)(nil)).Elem() -} - -type CustomFieldDefAddedEvent struct { - CustomFieldDefEvent -} - -func init() { - t["CustomFieldDefAddedEvent"] = reflect.TypeOf((*CustomFieldDefAddedEvent)(nil)).Elem() -} - -type CustomFieldDefEvent struct { - CustomFieldEvent - - FieldKey int `xml:"fieldKey"` - Name string `xml:"name"` -} - -func init() { - t["CustomFieldDefEvent"] = reflect.TypeOf((*CustomFieldDefEvent)(nil)).Elem() -} - -type CustomFieldDefRemovedEvent struct { - CustomFieldDefEvent -} - -func init() { - t["CustomFieldDefRemovedEvent"] = reflect.TypeOf((*CustomFieldDefRemovedEvent)(nil)).Elem() -} - -type CustomFieldDefRenamedEvent struct { - CustomFieldDefEvent - - NewName string `xml:"newName"` -} - -func init() { - t["CustomFieldDefRenamedEvent"] = reflect.TypeOf((*CustomFieldDefRenamedEvent)(nil)).Elem() -} - -type CustomFieldEvent struct { - Event -} - -func init() { - t["CustomFieldEvent"] = reflect.TypeOf((*CustomFieldEvent)(nil)).Elem() -} - -type CustomFieldStringValue struct { - CustomFieldValue - - Value string `xml:"value"` -} - -func init() { - t["CustomFieldStringValue"] = reflect.TypeOf((*CustomFieldStringValue)(nil)).Elem() -} - -type CustomFieldValue struct { - DynamicData - - Key int `xml:"key"` -} - -func init() { - t["CustomFieldValue"] = reflect.TypeOf((*CustomFieldValue)(nil)).Elem() -} - -type CustomFieldValueChangedEvent struct { - CustomFieldEvent - - Entity ManagedEntityEventArgument `xml:"entity"` - FieldKey int `xml:"fieldKey"` - Name string `xml:"name"` - Value string `xml:"value"` -} - -func init() { - t["CustomFieldValueChangedEvent"] = reflect.TypeOf((*CustomFieldValueChangedEvent)(nil)).Elem() -} - -type CustomizationAdapterMapping struct { - DynamicData - - MacAddress string `xml:"macAddress,omitempty"` - Adapter CustomizationIPSettings `xml:"adapter"` -} - -func init() { - t["CustomizationAdapterMapping"] = reflect.TypeOf((*CustomizationAdapterMapping)(nil)).Elem() -} - -type CustomizationAutoIpV6Generator struct { - CustomizationIpV6Generator -} - -func init() { - t["CustomizationAutoIpV6Generator"] = reflect.TypeOf((*CustomizationAutoIpV6Generator)(nil)).Elem() -} - -type CustomizationCustomIpGenerator struct { - CustomizationIpGenerator - - Argument string `xml:"argument,omitempty"` -} - -func init() { - t["CustomizationCustomIpGenerator"] = reflect.TypeOf((*CustomizationCustomIpGenerator)(nil)).Elem() -} - -type CustomizationCustomIpV6Generator struct { - CustomizationIpV6Generator - - Argument string `xml:"argument,omitempty"` -} - -func init() { - t["CustomizationCustomIpV6Generator"] = reflect.TypeOf((*CustomizationCustomIpV6Generator)(nil)).Elem() -} - -type CustomizationCustomName struct { - CustomizationName - - Argument string `xml:"argument,omitempty"` -} - -func init() { - t["CustomizationCustomName"] = reflect.TypeOf((*CustomizationCustomName)(nil)).Elem() -} - -type CustomizationDhcpIpGenerator struct { - CustomizationIpGenerator -} - -func init() { - t["CustomizationDhcpIpGenerator"] = reflect.TypeOf((*CustomizationDhcpIpGenerator)(nil)).Elem() -} - -type CustomizationDhcpIpV6Generator struct { - CustomizationIpV6Generator -} - -func init() { - t["CustomizationDhcpIpV6Generator"] = reflect.TypeOf((*CustomizationDhcpIpV6Generator)(nil)).Elem() -} - -type CustomizationEvent struct { - VmEvent - - LogLocation string `xml:"logLocation,omitempty"` -} - -func init() { - t["CustomizationEvent"] = reflect.TypeOf((*CustomizationEvent)(nil)).Elem() -} - -type CustomizationFailed struct { - CustomizationEvent -} - -func init() { - t["CustomizationFailed"] = reflect.TypeOf((*CustomizationFailed)(nil)).Elem() -} - -type CustomizationFault struct { - VimFault -} - -func init() { - t["CustomizationFault"] = reflect.TypeOf((*CustomizationFault)(nil)).Elem() -} - -type CustomizationFaultFault BaseCustomizationFault - -func init() { - t["CustomizationFaultFault"] = reflect.TypeOf((*CustomizationFaultFault)(nil)).Elem() -} - -type CustomizationFixedIp struct { - CustomizationIpGenerator - - IpAddress string `xml:"ipAddress"` -} - -func init() { - t["CustomizationFixedIp"] = reflect.TypeOf((*CustomizationFixedIp)(nil)).Elem() -} - -type CustomizationFixedIpV6 struct { - CustomizationIpV6Generator - - IpAddress string `xml:"ipAddress"` - SubnetMask int `xml:"subnetMask"` -} - -func init() { - t["CustomizationFixedIpV6"] = reflect.TypeOf((*CustomizationFixedIpV6)(nil)).Elem() -} - -type CustomizationFixedName struct { - CustomizationName - - Name string `xml:"name"` -} - -func init() { - t["CustomizationFixedName"] = reflect.TypeOf((*CustomizationFixedName)(nil)).Elem() -} - -type CustomizationGlobalIPSettings struct { - DynamicData - - DnsSuffixList []string `xml:"dnsSuffixList,omitempty"` - DnsServerList []string `xml:"dnsServerList,omitempty"` -} - -func init() { - t["CustomizationGlobalIPSettings"] = reflect.TypeOf((*CustomizationGlobalIPSettings)(nil)).Elem() -} - -type CustomizationGuiRunOnce struct { - DynamicData - - CommandList []string `xml:"commandList"` -} - -func init() { - t["CustomizationGuiRunOnce"] = reflect.TypeOf((*CustomizationGuiRunOnce)(nil)).Elem() -} - -type CustomizationGuiUnattended struct { - DynamicData - - Password *CustomizationPassword `xml:"password,omitempty"` - TimeZone int `xml:"timeZone"` - AutoLogon bool `xml:"autoLogon"` - AutoLogonCount int `xml:"autoLogonCount"` -} - -func init() { - t["CustomizationGuiUnattended"] = reflect.TypeOf((*CustomizationGuiUnattended)(nil)).Elem() -} - -type CustomizationIPSettings struct { - DynamicData - - Ip BaseCustomizationIpGenerator `xml:"ip,typeattr"` - SubnetMask string `xml:"subnetMask,omitempty"` - Gateway []string `xml:"gateway,omitempty"` - IpV6Spec *CustomizationIPSettingsIpV6AddressSpec `xml:"ipV6Spec,omitempty"` - DnsServerList []string `xml:"dnsServerList,omitempty"` - DnsDomain string `xml:"dnsDomain,omitempty"` - PrimaryWINS string `xml:"primaryWINS,omitempty"` - SecondaryWINS string `xml:"secondaryWINS,omitempty"` - NetBIOS CustomizationNetBIOSMode `xml:"netBIOS,omitempty"` -} - -func init() { - t["CustomizationIPSettings"] = reflect.TypeOf((*CustomizationIPSettings)(nil)).Elem() -} - -type CustomizationIPSettingsIpV6AddressSpec struct { - DynamicData - - Ip []BaseCustomizationIpV6Generator `xml:"ip,typeattr"` - Gateway []string `xml:"gateway,omitempty"` -} - -func init() { - t["CustomizationIPSettingsIpV6AddressSpec"] = reflect.TypeOf((*CustomizationIPSettingsIpV6AddressSpec)(nil)).Elem() -} - -type CustomizationIdentification struct { - DynamicData - - JoinWorkgroup string `xml:"joinWorkgroup,omitempty"` - JoinDomain string `xml:"joinDomain,omitempty"` - DomainAdmin string `xml:"domainAdmin,omitempty"` - DomainAdminPassword *CustomizationPassword `xml:"domainAdminPassword,omitempty"` -} - -func init() { - t["CustomizationIdentification"] = reflect.TypeOf((*CustomizationIdentification)(nil)).Elem() -} - -type CustomizationIdentitySettings struct { - DynamicData -} - -func init() { - t["CustomizationIdentitySettings"] = reflect.TypeOf((*CustomizationIdentitySettings)(nil)).Elem() -} - -type CustomizationIpGenerator struct { - DynamicData -} - -func init() { - t["CustomizationIpGenerator"] = reflect.TypeOf((*CustomizationIpGenerator)(nil)).Elem() -} - -type CustomizationIpV6Generator struct { - DynamicData -} - -func init() { - t["CustomizationIpV6Generator"] = reflect.TypeOf((*CustomizationIpV6Generator)(nil)).Elem() -} - -type CustomizationLicenseFilePrintData struct { - DynamicData - - AutoMode CustomizationLicenseDataMode `xml:"autoMode"` - AutoUsers int `xml:"autoUsers,omitempty"` -} - -func init() { - t["CustomizationLicenseFilePrintData"] = reflect.TypeOf((*CustomizationLicenseFilePrintData)(nil)).Elem() -} - -type CustomizationLinuxIdentityFailed struct { - CustomizationFailed -} - -func init() { - t["CustomizationLinuxIdentityFailed"] = reflect.TypeOf((*CustomizationLinuxIdentityFailed)(nil)).Elem() -} - -type CustomizationLinuxOptions struct { - CustomizationOptions -} - -func init() { - t["CustomizationLinuxOptions"] = reflect.TypeOf((*CustomizationLinuxOptions)(nil)).Elem() -} - -type CustomizationLinuxPrep struct { - CustomizationIdentitySettings - - HostName BaseCustomizationName `xml:"hostName,typeattr"` - Domain string `xml:"domain"` - TimeZone string `xml:"timeZone,omitempty"` - HwClockUTC *bool `xml:"hwClockUTC"` -} - -func init() { - t["CustomizationLinuxPrep"] = reflect.TypeOf((*CustomizationLinuxPrep)(nil)).Elem() -} - -type CustomizationName struct { - DynamicData -} - -func init() { - t["CustomizationName"] = reflect.TypeOf((*CustomizationName)(nil)).Elem() -} - -type CustomizationNetworkSetupFailed struct { - CustomizationFailed -} - -func init() { - t["CustomizationNetworkSetupFailed"] = reflect.TypeOf((*CustomizationNetworkSetupFailed)(nil)).Elem() -} - -type CustomizationOptions struct { - DynamicData -} - -func init() { - t["CustomizationOptions"] = reflect.TypeOf((*CustomizationOptions)(nil)).Elem() -} - -type CustomizationPassword struct { - DynamicData - - Value string `xml:"value"` - PlainText bool `xml:"plainText"` -} - -func init() { - t["CustomizationPassword"] = reflect.TypeOf((*CustomizationPassword)(nil)).Elem() -} - -type CustomizationPending struct { - CustomizationFault -} - -func init() { - t["CustomizationPending"] = reflect.TypeOf((*CustomizationPending)(nil)).Elem() -} - -type CustomizationPendingFault CustomizationPending - -func init() { - t["CustomizationPendingFault"] = reflect.TypeOf((*CustomizationPendingFault)(nil)).Elem() -} - -type CustomizationPrefixName struct { - CustomizationName - - Base string `xml:"base"` -} - -func init() { - t["CustomizationPrefixName"] = reflect.TypeOf((*CustomizationPrefixName)(nil)).Elem() -} - -type CustomizationSpec struct { - DynamicData - - Options BaseCustomizationOptions `xml:"options,omitempty,typeattr"` - Identity BaseCustomizationIdentitySettings `xml:"identity,typeattr"` - GlobalIPSettings CustomizationGlobalIPSettings `xml:"globalIPSettings"` - NicSettingMap []CustomizationAdapterMapping `xml:"nicSettingMap,omitempty"` - EncryptionKey []byte `xml:"encryptionKey,omitempty"` -} - -func init() { - t["CustomizationSpec"] = reflect.TypeOf((*CustomizationSpec)(nil)).Elem() -} - -type CustomizationSpecInfo struct { - DynamicData - - Name string `xml:"name"` - Description string `xml:"description"` - Type string `xml:"type"` - ChangeVersion string `xml:"changeVersion,omitempty"` - LastUpdateTime *time.Time `xml:"lastUpdateTime"` -} - -func init() { - t["CustomizationSpecInfo"] = reflect.TypeOf((*CustomizationSpecInfo)(nil)).Elem() -} - -type CustomizationSpecItem struct { - DynamicData - - Info CustomizationSpecInfo `xml:"info"` - Spec CustomizationSpec `xml:"spec"` -} - -func init() { - t["CustomizationSpecItem"] = reflect.TypeOf((*CustomizationSpecItem)(nil)).Elem() -} - -type CustomizationSpecItemToXml CustomizationSpecItemToXmlRequestType - -func init() { - t["CustomizationSpecItemToXml"] = reflect.TypeOf((*CustomizationSpecItemToXml)(nil)).Elem() -} - -type CustomizationSpecItemToXmlRequestType struct { - This ManagedObjectReference `xml:"_this"` - Item CustomizationSpecItem `xml:"item"` -} - -func init() { - t["CustomizationSpecItemToXmlRequestType"] = reflect.TypeOf((*CustomizationSpecItemToXmlRequestType)(nil)).Elem() -} - -type CustomizationSpecItemToXmlResponse struct { - Returnval string `xml:"returnval"` -} - -type CustomizationStartedEvent struct { - CustomizationEvent -} - -func init() { - t["CustomizationStartedEvent"] = reflect.TypeOf((*CustomizationStartedEvent)(nil)).Elem() -} - -type CustomizationStatelessIpV6Generator struct { - CustomizationIpV6Generator -} - -func init() { - t["CustomizationStatelessIpV6Generator"] = reflect.TypeOf((*CustomizationStatelessIpV6Generator)(nil)).Elem() -} - -type CustomizationSucceeded struct { - CustomizationEvent -} - -func init() { - t["CustomizationSucceeded"] = reflect.TypeOf((*CustomizationSucceeded)(nil)).Elem() -} - -type CustomizationSysprep struct { - CustomizationIdentitySettings - - GuiUnattended CustomizationGuiUnattended `xml:"guiUnattended"` - UserData CustomizationUserData `xml:"userData"` - GuiRunOnce *CustomizationGuiRunOnce `xml:"guiRunOnce,omitempty"` - Identification CustomizationIdentification `xml:"identification"` - LicenseFilePrintData *CustomizationLicenseFilePrintData `xml:"licenseFilePrintData,omitempty"` -} - -func init() { - t["CustomizationSysprep"] = reflect.TypeOf((*CustomizationSysprep)(nil)).Elem() -} - -type CustomizationSysprepFailed struct { - CustomizationFailed - - SysprepVersion string `xml:"sysprepVersion"` - SystemVersion string `xml:"systemVersion"` -} - -func init() { - t["CustomizationSysprepFailed"] = reflect.TypeOf((*CustomizationSysprepFailed)(nil)).Elem() -} - -type CustomizationSysprepText struct { - CustomizationIdentitySettings - - Value string `xml:"value"` -} - -func init() { - t["CustomizationSysprepText"] = reflect.TypeOf((*CustomizationSysprepText)(nil)).Elem() -} - -type CustomizationUnknownFailure struct { - CustomizationFailed -} - -func init() { - t["CustomizationUnknownFailure"] = reflect.TypeOf((*CustomizationUnknownFailure)(nil)).Elem() -} - -type CustomizationUnknownIpGenerator struct { - CustomizationIpGenerator -} - -func init() { - t["CustomizationUnknownIpGenerator"] = reflect.TypeOf((*CustomizationUnknownIpGenerator)(nil)).Elem() -} - -type CustomizationUnknownIpV6Generator struct { - CustomizationIpV6Generator -} - -func init() { - t["CustomizationUnknownIpV6Generator"] = reflect.TypeOf((*CustomizationUnknownIpV6Generator)(nil)).Elem() -} - -type CustomizationUnknownName struct { - CustomizationName -} - -func init() { - t["CustomizationUnknownName"] = reflect.TypeOf((*CustomizationUnknownName)(nil)).Elem() -} - -type CustomizationUserData struct { - DynamicData - - FullName string `xml:"fullName"` - OrgName string `xml:"orgName"` - ComputerName BaseCustomizationName `xml:"computerName,typeattr"` - ProductId string `xml:"productId"` -} - -func init() { - t["CustomizationUserData"] = reflect.TypeOf((*CustomizationUserData)(nil)).Elem() -} - -type CustomizationVirtualMachineName struct { - CustomizationName -} - -func init() { - t["CustomizationVirtualMachineName"] = reflect.TypeOf((*CustomizationVirtualMachineName)(nil)).Elem() -} - -type CustomizationWinOptions struct { - CustomizationOptions - - ChangeSID bool `xml:"changeSID"` - DeleteAccounts bool `xml:"deleteAccounts"` - Reboot CustomizationSysprepRebootOption `xml:"reboot,omitempty"` -} - -func init() { - t["CustomizationWinOptions"] = reflect.TypeOf((*CustomizationWinOptions)(nil)).Elem() -} - -type CustomizeVMRequestType struct { - This ManagedObjectReference `xml:"_this"` - Spec CustomizationSpec `xml:"spec"` -} - -func init() { - t["CustomizeVMRequestType"] = reflect.TypeOf((*CustomizeVMRequestType)(nil)).Elem() -} - -type CustomizeVM_Task CustomizeVMRequestType - -func init() { - t["CustomizeVM_Task"] = reflect.TypeOf((*CustomizeVM_Task)(nil)).Elem() -} - -type CustomizeVM_TaskResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type DVPortConfigInfo struct { - DynamicData - - Name string `xml:"name,omitempty"` - Scope []ManagedObjectReference `xml:"scope,omitempty"` - Description string `xml:"description,omitempty"` - Setting BaseDVPortSetting `xml:"setting,omitempty,typeattr"` - ConfigVersion string `xml:"configVersion"` -} - -func init() { - t["DVPortConfigInfo"] = reflect.TypeOf((*DVPortConfigInfo)(nil)).Elem() -} - -type DVPortConfigSpec struct { - DynamicData - - Operation string `xml:"operation"` - Key string `xml:"key,omitempty"` - Name string `xml:"name,omitempty"` - Scope []ManagedObjectReference `xml:"scope,omitempty"` - Description string `xml:"description,omitempty"` - Setting BaseDVPortSetting `xml:"setting,omitempty,typeattr"` - ConfigVersion string `xml:"configVersion,omitempty"` -} - -func init() { - t["DVPortConfigSpec"] = reflect.TypeOf((*DVPortConfigSpec)(nil)).Elem() -} - -type DVPortNotSupported struct { - DeviceBackingNotSupported -} - -func init() { - t["DVPortNotSupported"] = reflect.TypeOf((*DVPortNotSupported)(nil)).Elem() -} - -type DVPortNotSupportedFault DVPortNotSupported - -func init() { - t["DVPortNotSupportedFault"] = reflect.TypeOf((*DVPortNotSupportedFault)(nil)).Elem() -} - -type DVPortSetting struct { - DynamicData - - Blocked *BoolPolicy `xml:"blocked,omitempty"` - VmDirectPathGen2Allowed *BoolPolicy `xml:"vmDirectPathGen2Allowed,omitempty"` - InShapingPolicy *DVSTrafficShapingPolicy `xml:"inShapingPolicy,omitempty"` - OutShapingPolicy *DVSTrafficShapingPolicy `xml:"outShapingPolicy,omitempty"` - VendorSpecificConfig *DVSVendorSpecificConfig `xml:"vendorSpecificConfig,omitempty"` - NetworkResourcePoolKey *StringPolicy `xml:"networkResourcePoolKey,omitempty"` - FilterPolicy *DvsFilterPolicy `xml:"filterPolicy,omitempty"` -} - -func init() { - t["DVPortSetting"] = reflect.TypeOf((*DVPortSetting)(nil)).Elem() -} - -type DVPortState struct { - DynamicData - - RuntimeInfo *DVPortStatus `xml:"runtimeInfo,omitempty"` - Stats DistributedVirtualSwitchPortStatistics `xml:"stats"` - VendorSpecificState []DistributedVirtualSwitchKeyedOpaqueBlob `xml:"vendorSpecificState,omitempty"` -} - -func init() { - t["DVPortState"] = reflect.TypeOf((*DVPortState)(nil)).Elem() -} - -type DVPortStatus struct { - DynamicData - - LinkUp bool `xml:"linkUp"` - Blocked bool `xml:"blocked"` - VlanIds []NumericRange `xml:"vlanIds,omitempty"` - TrunkingMode *bool `xml:"trunkingMode"` - Mtu int `xml:"mtu,omitempty"` - LinkPeer string `xml:"linkPeer,omitempty"` - MacAddress string `xml:"macAddress,omitempty"` - StatusDetail string `xml:"statusDetail,omitempty"` - VmDirectPathGen2Active *bool `xml:"vmDirectPathGen2Active"` - VmDirectPathGen2InactiveReasonNetwork []string `xml:"vmDirectPathGen2InactiveReasonNetwork,omitempty"` - VmDirectPathGen2InactiveReasonOther []string `xml:"vmDirectPathGen2InactiveReasonOther,omitempty"` - VmDirectPathGen2InactiveReasonExtended string `xml:"vmDirectPathGen2InactiveReasonExtended,omitempty"` -} - -func init() { - t["DVPortStatus"] = reflect.TypeOf((*DVPortStatus)(nil)).Elem() -} - -type DVPortgroupConfigInfo struct { - DynamicData - - Key string `xml:"key"` - Name string `xml:"name"` - NumPorts int `xml:"numPorts"` - DistributedVirtualSwitch *ManagedObjectReference `xml:"distributedVirtualSwitch,omitempty"` - DefaultPortConfig BaseDVPortSetting `xml:"defaultPortConfig,omitempty,typeattr"` - Description string `xml:"description,omitempty"` - Type string `xml:"type"` - Policy BaseDVPortgroupPolicy `xml:"policy,typeattr"` - PortNameFormat string `xml:"portNameFormat,omitempty"` - Scope []ManagedObjectReference `xml:"scope,omitempty"` - VendorSpecificConfig []DistributedVirtualSwitchKeyedOpaqueBlob `xml:"vendorSpecificConfig,omitempty"` - ConfigVersion string `xml:"configVersion,omitempty"` - AutoExpand *bool `xml:"autoExpand"` -} - -func init() { - t["DVPortgroupConfigInfo"] = reflect.TypeOf((*DVPortgroupConfigInfo)(nil)).Elem() -} - -type DVPortgroupConfigSpec struct { - DynamicData - - ConfigVersion string `xml:"configVersion,omitempty"` - Name string `xml:"name,omitempty"` - NumPorts int `xml:"numPorts,omitempty"` - PortNameFormat string `xml:"portNameFormat,omitempty"` - DefaultPortConfig BaseDVPortSetting `xml:"defaultPortConfig,omitempty,typeattr"` - Description string `xml:"description,omitempty"` - Type string `xml:"type,omitempty"` - Scope []ManagedObjectReference `xml:"scope,omitempty"` - Policy BaseDVPortgroupPolicy `xml:"policy,omitempty,typeattr"` - VendorSpecificConfig []DistributedVirtualSwitchKeyedOpaqueBlob `xml:"vendorSpecificConfig,omitempty"` - AutoExpand *bool `xml:"autoExpand"` -} - -func init() { - t["DVPortgroupConfigSpec"] = reflect.TypeOf((*DVPortgroupConfigSpec)(nil)).Elem() -} - -type DVPortgroupCreatedEvent struct { - DVPortgroupEvent -} - -func init() { - t["DVPortgroupCreatedEvent"] = reflect.TypeOf((*DVPortgroupCreatedEvent)(nil)).Elem() -} - -type DVPortgroupDestroyedEvent struct { - DVPortgroupEvent -} - -func init() { - t["DVPortgroupDestroyedEvent"] = reflect.TypeOf((*DVPortgroupDestroyedEvent)(nil)).Elem() -} - -type DVPortgroupEvent struct { - Event -} - -func init() { - t["DVPortgroupEvent"] = reflect.TypeOf((*DVPortgroupEvent)(nil)).Elem() -} - -type DVPortgroupPolicy struct { - DynamicData - - BlockOverrideAllowed bool `xml:"blockOverrideAllowed"` - ShapingOverrideAllowed bool `xml:"shapingOverrideAllowed"` - VendorConfigOverrideAllowed bool `xml:"vendorConfigOverrideAllowed"` - LivePortMovingAllowed bool `xml:"livePortMovingAllowed"` - PortConfigResetAtDisconnect bool `xml:"portConfigResetAtDisconnect"` - NetworkResourcePoolOverrideAllowed *bool `xml:"networkResourcePoolOverrideAllowed"` - TrafficFilterOverrideAllowed *bool `xml:"trafficFilterOverrideAllowed"` -} - -func init() { - t["DVPortgroupPolicy"] = reflect.TypeOf((*DVPortgroupPolicy)(nil)).Elem() -} - -type DVPortgroupReconfiguredEvent struct { - DVPortgroupEvent - - ConfigSpec DVPortgroupConfigSpec `xml:"configSpec"` -} - -func init() { - t["DVPortgroupReconfiguredEvent"] = reflect.TypeOf((*DVPortgroupReconfiguredEvent)(nil)).Elem() -} - -type DVPortgroupRenamedEvent struct { - DVPortgroupEvent - - OldName string `xml:"oldName"` - NewName string `xml:"newName"` -} - -func init() { - t["DVPortgroupRenamedEvent"] = reflect.TypeOf((*DVPortgroupRenamedEvent)(nil)).Elem() -} - -type DVPortgroupRollbackRequestType struct { - This ManagedObjectReference `xml:"_this"` - EntityBackup *EntityBackupConfig `xml:"entityBackup,omitempty"` -} - -func init() { - t["DVPortgroupRollbackRequestType"] = reflect.TypeOf((*DVPortgroupRollbackRequestType)(nil)).Elem() -} - -type DVPortgroupRollback_Task DVPortgroupRollbackRequestType - -func init() { - t["DVPortgroupRollback_Task"] = reflect.TypeOf((*DVPortgroupRollback_Task)(nil)).Elem() -} - -type DVPortgroupRollback_TaskResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type DVPortgroupSelection struct { - SelectionSet - - DvsUuid string `xml:"dvsUuid"` - PortgroupKey []string `xml:"portgroupKey"` -} - -func init() { - t["DVPortgroupSelection"] = reflect.TypeOf((*DVPortgroupSelection)(nil)).Elem() -} - -type DVSBackupRestoreCapability struct { - DynamicData - - BackupRestoreSupported bool `xml:"backupRestoreSupported"` -} - -func init() { - t["DVSBackupRestoreCapability"] = reflect.TypeOf((*DVSBackupRestoreCapability)(nil)).Elem() -} - -type DVSCapability struct { - DynamicData - - DvsOperationSupported *bool `xml:"dvsOperationSupported"` - DvPortGroupOperationSupported *bool `xml:"dvPortGroupOperationSupported"` - DvPortOperationSupported *bool `xml:"dvPortOperationSupported"` - CompatibleHostComponentProductInfo []DistributedVirtualSwitchHostProductSpec `xml:"compatibleHostComponentProductInfo,omitempty"` - FeaturesSupported BaseDVSFeatureCapability `xml:"featuresSupported,omitempty,typeattr"` -} - -func init() { - t["DVSCapability"] = reflect.TypeOf((*DVSCapability)(nil)).Elem() -} - -type DVSConfigInfo struct { - DynamicData - - Uuid string `xml:"uuid"` - Name string `xml:"name"` - NumStandalonePorts int `xml:"numStandalonePorts"` - NumPorts int `xml:"numPorts"` - MaxPorts int `xml:"maxPorts"` - UplinkPortPolicy BaseDVSUplinkPortPolicy `xml:"uplinkPortPolicy,typeattr"` - UplinkPortgroup []ManagedObjectReference `xml:"uplinkPortgroup,omitempty"` - DefaultPortConfig BaseDVPortSetting `xml:"defaultPortConfig,typeattr"` - Host []DistributedVirtualSwitchHostMember `xml:"host,omitempty"` - ProductInfo DistributedVirtualSwitchProductSpec `xml:"productInfo"` - TargetInfo *DistributedVirtualSwitchProductSpec `xml:"targetInfo,omitempty"` - ExtensionKey string `xml:"extensionKey,omitempty"` - VendorSpecificConfig []DistributedVirtualSwitchKeyedOpaqueBlob `xml:"vendorSpecificConfig,omitempty"` - Policy *DVSPolicy `xml:"policy,omitempty"` - Description string `xml:"description,omitempty"` - ConfigVersion string `xml:"configVersion"` - Contact DVSContactInfo `xml:"contact"` - SwitchIpAddress string `xml:"switchIpAddress,omitempty"` - CreateTime time.Time `xml:"createTime"` - NetworkResourceManagementEnabled *bool `xml:"networkResourceManagementEnabled"` - DefaultProxySwitchMaxNumPorts int `xml:"defaultProxySwitchMaxNumPorts,omitempty"` - HealthCheckConfig []BaseDVSHealthCheckConfig `xml:"healthCheckConfig,omitempty,typeattr"` -} - -func init() { - t["DVSConfigInfo"] = reflect.TypeOf((*DVSConfigInfo)(nil)).Elem() -} - -type DVSConfigSpec struct { - DynamicData - - ConfigVersion string `xml:"configVersion,omitempty"` - Name string `xml:"name,omitempty"` - NumStandalonePorts int `xml:"numStandalonePorts,omitempty"` - MaxPorts int `xml:"maxPorts,omitempty"` - UplinkPortPolicy BaseDVSUplinkPortPolicy `xml:"uplinkPortPolicy,omitempty,typeattr"` - UplinkPortgroup []ManagedObjectReference `xml:"uplinkPortgroup,omitempty"` - DefaultPortConfig BaseDVPortSetting `xml:"defaultPortConfig,omitempty,typeattr"` - Host []DistributedVirtualSwitchHostMemberConfigSpec `xml:"host,omitempty"` - ExtensionKey string `xml:"extensionKey,omitempty"` - Description string `xml:"description,omitempty"` - Policy *DVSPolicy `xml:"policy,omitempty"` - VendorSpecificConfig []DistributedVirtualSwitchKeyedOpaqueBlob `xml:"vendorSpecificConfig,omitempty"` - Contact *DVSContactInfo `xml:"contact,omitempty"` - SwitchIpAddress string `xml:"switchIpAddress,omitempty"` - DefaultProxySwitchMaxNumPorts int `xml:"defaultProxySwitchMaxNumPorts,omitempty"` -} - -func init() { - t["DVSConfigSpec"] = reflect.TypeOf((*DVSConfigSpec)(nil)).Elem() -} - -type DVSContactInfo struct { - DynamicData - - Name string `xml:"name,omitempty"` - Contact string `xml:"contact,omitempty"` -} - -func init() { - t["DVSContactInfo"] = reflect.TypeOf((*DVSContactInfo)(nil)).Elem() -} - -type DVSCreateSpec struct { - DynamicData - - ConfigSpec BaseDVSConfigSpec `xml:"configSpec,typeattr"` - ProductInfo *DistributedVirtualSwitchProductSpec `xml:"productInfo,omitempty"` - Capability *DVSCapability `xml:"capability,omitempty"` -} - -func init() { - t["DVSCreateSpec"] = reflect.TypeOf((*DVSCreateSpec)(nil)).Elem() -} - -type DVSFailureCriteria struct { - InheritablePolicy - - CheckSpeed *StringPolicy `xml:"checkSpeed,omitempty"` - Speed *IntPolicy `xml:"speed,omitempty"` - CheckDuplex *BoolPolicy `xml:"checkDuplex,omitempty"` - FullDuplex *BoolPolicy `xml:"fullDuplex,omitempty"` - CheckErrorPercent *BoolPolicy `xml:"checkErrorPercent,omitempty"` - Percentage *IntPolicy `xml:"percentage,omitempty"` - CheckBeacon *BoolPolicy `xml:"checkBeacon,omitempty"` -} - -func init() { - t["DVSFailureCriteria"] = reflect.TypeOf((*DVSFailureCriteria)(nil)).Elem() -} - -type DVSFeatureCapability struct { - DynamicData - - NetworkResourceManagementSupported bool `xml:"networkResourceManagementSupported"` - VmDirectPathGen2Supported bool `xml:"vmDirectPathGen2Supported"` - NicTeamingPolicy []string `xml:"nicTeamingPolicy,omitempty"` - NetworkResourcePoolHighShareValue int `xml:"networkResourcePoolHighShareValue,omitempty"` - NetworkResourceManagementCapability *DVSNetworkResourceManagementCapability `xml:"networkResourceManagementCapability,omitempty"` - HealthCheckCapability BaseDVSHealthCheckCapability `xml:"healthCheckCapability,omitempty,typeattr"` - RollbackCapability *DVSRollbackCapability `xml:"rollbackCapability,omitempty"` - BackupRestoreCapability *DVSBackupRestoreCapability `xml:"backupRestoreCapability,omitempty"` - NetworkFilterSupported *bool `xml:"networkFilterSupported"` -} - -func init() { - t["DVSFeatureCapability"] = reflect.TypeOf((*DVSFeatureCapability)(nil)).Elem() -} - -type DVSHealthCheckCapability struct { - DynamicData -} - -func init() { - t["DVSHealthCheckCapability"] = reflect.TypeOf((*DVSHealthCheckCapability)(nil)).Elem() -} - -type DVSHealthCheckConfig struct { - DynamicData - - Enable *bool `xml:"enable"` - Interval int `xml:"interval,omitempty"` -} - -func init() { - t["DVSHealthCheckConfig"] = reflect.TypeOf((*DVSHealthCheckConfig)(nil)).Elem() -} - -type DVSHostLocalPortInfo struct { - DynamicData - - SwitchUuid string `xml:"switchUuid"` - PortKey string `xml:"portKey"` - Setting BaseDVPortSetting `xml:"setting,typeattr"` - Vnic string `xml:"vnic"` -} - -func init() { - t["DVSHostLocalPortInfo"] = reflect.TypeOf((*DVSHostLocalPortInfo)(nil)).Elem() -} - -type DVSManagerDvsConfigTarget struct { - DynamicData - - DistributedVirtualPortgroup []DistributedVirtualPortgroupInfo `xml:"distributedVirtualPortgroup,omitempty"` - DistributedVirtualSwitch []DistributedVirtualSwitchInfo `xml:"distributedVirtualSwitch,omitempty"` -} - -func init() { - t["DVSManagerDvsConfigTarget"] = reflect.TypeOf((*DVSManagerDvsConfigTarget)(nil)).Elem() -} - -type DVSManagerExportEntityRequestType struct { - This ManagedObjectReference `xml:"_this"` - SelectionSet []BaseSelectionSet `xml:"selectionSet,typeattr"` -} - -func init() { - t["DVSManagerExportEntityRequestType"] = reflect.TypeOf((*DVSManagerExportEntityRequestType)(nil)).Elem() -} - -type DVSManagerExportEntity_Task DVSManagerExportEntityRequestType - -func init() { - t["DVSManagerExportEntity_Task"] = reflect.TypeOf((*DVSManagerExportEntity_Task)(nil)).Elem() -} - -type DVSManagerExportEntity_TaskResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type DVSManagerImportEntityRequestType struct { - This ManagedObjectReference `xml:"_this"` - EntityBackup []EntityBackupConfig `xml:"entityBackup"` - ImportType string `xml:"importType"` -} - -func init() { - t["DVSManagerImportEntityRequestType"] = reflect.TypeOf((*DVSManagerImportEntityRequestType)(nil)).Elem() -} - -type DVSManagerImportEntity_Task DVSManagerImportEntityRequestType - -func init() { - t["DVSManagerImportEntity_Task"] = reflect.TypeOf((*DVSManagerImportEntity_Task)(nil)).Elem() -} - -type DVSManagerImportEntity_TaskResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type DVSManagerLookupDvPortGroup DVSManagerLookupDvPortGroupRequestType - -func init() { - t["DVSManagerLookupDvPortGroup"] = reflect.TypeOf((*DVSManagerLookupDvPortGroup)(nil)).Elem() -} - -type DVSManagerLookupDvPortGroupRequestType struct { - This ManagedObjectReference `xml:"_this"` - SwitchUuid string `xml:"switchUuid"` - PortgroupKey string `xml:"portgroupKey"` -} - -func init() { - t["DVSManagerLookupDvPortGroupRequestType"] = reflect.TypeOf((*DVSManagerLookupDvPortGroupRequestType)(nil)).Elem() -} - -type DVSManagerLookupDvPortGroupResponse struct { - Returnval *ManagedObjectReference `xml:"returnval,omitempty"` -} - -type DVSNameArrayUplinkPortPolicy struct { - DVSUplinkPortPolicy - - UplinkPortName []string `xml:"uplinkPortName"` -} - -func init() { - t["DVSNameArrayUplinkPortPolicy"] = reflect.TypeOf((*DVSNameArrayUplinkPortPolicy)(nil)).Elem() -} - -type DVSNetworkResourceManagementCapability struct { - DynamicData - - NetworkResourceManagementSupported bool `xml:"networkResourceManagementSupported"` - NetworkResourcePoolHighShareValue int `xml:"networkResourcePoolHighShareValue"` - QosSupported bool `xml:"qosSupported"` - UserDefinedNetworkResourcePoolsSupported bool `xml:"userDefinedNetworkResourcePoolsSupported"` -} - -func init() { - t["DVSNetworkResourceManagementCapability"] = reflect.TypeOf((*DVSNetworkResourceManagementCapability)(nil)).Elem() -} - -type DVSNetworkResourcePool struct { - DynamicData - - Key string `xml:"key"` - Name string `xml:"name,omitempty"` - Description string `xml:"description,omitempty"` - ConfigVersion string `xml:"configVersion"` - AllocationInfo DVSNetworkResourcePoolAllocationInfo `xml:"allocationInfo"` -} - -func init() { - t["DVSNetworkResourcePool"] = reflect.TypeOf((*DVSNetworkResourcePool)(nil)).Elem() -} - -type DVSNetworkResourcePoolAllocationInfo struct { - DynamicData - - Limit int64 `xml:"limit,omitempty"` - Shares *SharesInfo `xml:"shares,omitempty"` - PriorityTag int `xml:"priorityTag,omitempty"` -} - -func init() { - t["DVSNetworkResourcePoolAllocationInfo"] = reflect.TypeOf((*DVSNetworkResourcePoolAllocationInfo)(nil)).Elem() -} - -type DVSNetworkResourcePoolConfigSpec struct { - DynamicData - - Key string `xml:"key"` - ConfigVersion string `xml:"configVersion,omitempty"` - AllocationInfo *DVSNetworkResourcePoolAllocationInfo `xml:"allocationInfo,omitempty"` - Name string `xml:"name,omitempty"` - Description string `xml:"description,omitempty"` -} - -func init() { - t["DVSNetworkResourcePoolConfigSpec"] = reflect.TypeOf((*DVSNetworkResourcePoolConfigSpec)(nil)).Elem() -} - -type DVSPolicy struct { - DynamicData - - AutoPreInstallAllowed *bool `xml:"autoPreInstallAllowed"` - AutoUpgradeAllowed *bool `xml:"autoUpgradeAllowed"` - PartialUpgradeAllowed *bool `xml:"partialUpgradeAllowed"` -} - -func init() { - t["DVSPolicy"] = reflect.TypeOf((*DVSPolicy)(nil)).Elem() -} - -type DVSRollbackCapability struct { - DynamicData - - RollbackSupported bool `xml:"rollbackSupported"` -} - -func init() { - t["DVSRollbackCapability"] = reflect.TypeOf((*DVSRollbackCapability)(nil)).Elem() -} - -type DVSRollbackRequestType struct { - This ManagedObjectReference `xml:"_this"` - EntityBackup *EntityBackupConfig `xml:"entityBackup,omitempty"` -} - -func init() { - t["DVSRollbackRequestType"] = reflect.TypeOf((*DVSRollbackRequestType)(nil)).Elem() -} - -type DVSRollback_Task DVSRollbackRequestType - -func init() { - t["DVSRollback_Task"] = reflect.TypeOf((*DVSRollback_Task)(nil)).Elem() -} - -type DVSRollback_TaskResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type DVSRuntimeInfo struct { - DynamicData - - HostMemberRuntime []HostMemberRuntimeInfo `xml:"hostMemberRuntime,omitempty"` -} - -func init() { - t["DVSRuntimeInfo"] = reflect.TypeOf((*DVSRuntimeInfo)(nil)).Elem() -} - -type DVSSecurityPolicy struct { - InheritablePolicy - - AllowPromiscuous *BoolPolicy `xml:"allowPromiscuous,omitempty"` - MacChanges *BoolPolicy `xml:"macChanges,omitempty"` - ForgedTransmits *BoolPolicy `xml:"forgedTransmits,omitempty"` -} - -func init() { - t["DVSSecurityPolicy"] = reflect.TypeOf((*DVSSecurityPolicy)(nil)).Elem() -} - -type DVSSelection struct { - SelectionSet - - DvsUuid string `xml:"dvsUuid"` -} - -func init() { - t["DVSSelection"] = reflect.TypeOf((*DVSSelection)(nil)).Elem() -} - -type DVSSummary struct { - DynamicData - - Name string `xml:"name"` - Uuid string `xml:"uuid"` - NumPorts int `xml:"numPorts"` - ProductInfo *DistributedVirtualSwitchProductSpec `xml:"productInfo,omitempty"` - HostMember []ManagedObjectReference `xml:"hostMember,omitempty"` - Vm []ManagedObjectReference `xml:"vm,omitempty"` - Host []ManagedObjectReference `xml:"host,omitempty"` - PortgroupName []string `xml:"portgroupName,omitempty"` - Description string `xml:"description,omitempty"` - Contact *DVSContactInfo `xml:"contact,omitempty"` - NumHosts int `xml:"numHosts,omitempty"` -} - -func init() { - t["DVSSummary"] = reflect.TypeOf((*DVSSummary)(nil)).Elem() -} - -type DVSTrafficShapingPolicy struct { - InheritablePolicy - - Enabled *BoolPolicy `xml:"enabled,omitempty"` - AverageBandwidth *LongPolicy `xml:"averageBandwidth,omitempty"` - PeakBandwidth *LongPolicy `xml:"peakBandwidth,omitempty"` - BurstSize *LongPolicy `xml:"burstSize,omitempty"` -} - -func init() { - t["DVSTrafficShapingPolicy"] = reflect.TypeOf((*DVSTrafficShapingPolicy)(nil)).Elem() -} - -type DVSUplinkPortPolicy struct { - DynamicData -} - -func init() { - t["DVSUplinkPortPolicy"] = reflect.TypeOf((*DVSUplinkPortPolicy)(nil)).Elem() -} - -type DVSVendorSpecificConfig struct { - InheritablePolicy - - KeyValue []DistributedVirtualSwitchKeyedOpaqueBlob `xml:"keyValue,omitempty"` -} - -func init() { - t["DVSVendorSpecificConfig"] = reflect.TypeOf((*DVSVendorSpecificConfig)(nil)).Elem() -} - -type DailyTaskScheduler struct { - HourlyTaskScheduler - - Hour int `xml:"hour"` -} - -func init() { - t["DailyTaskScheduler"] = reflect.TypeOf((*DailyTaskScheduler)(nil)).Elem() -} - -type DasAdmissionControlDisabledEvent struct { - ClusterEvent -} - -func init() { - t["DasAdmissionControlDisabledEvent"] = reflect.TypeOf((*DasAdmissionControlDisabledEvent)(nil)).Elem() -} - -type DasAdmissionControlEnabledEvent struct { - ClusterEvent -} - -func init() { - t["DasAdmissionControlEnabledEvent"] = reflect.TypeOf((*DasAdmissionControlEnabledEvent)(nil)).Elem() -} - -type DasAgentFoundEvent struct { - ClusterEvent -} - -func init() { - t["DasAgentFoundEvent"] = reflect.TypeOf((*DasAgentFoundEvent)(nil)).Elem() -} - -type DasAgentUnavailableEvent struct { - ClusterEvent -} - -func init() { - t["DasAgentUnavailableEvent"] = reflect.TypeOf((*DasAgentUnavailableEvent)(nil)).Elem() -} - -type DasClusterIsolatedEvent struct { - ClusterEvent -} - -func init() { - t["DasClusterIsolatedEvent"] = reflect.TypeOf((*DasClusterIsolatedEvent)(nil)).Elem() -} - -type DasConfigFault struct { - VimFault - - Reason string `xml:"reason,omitempty"` - Output string `xml:"output,omitempty"` - Event []BaseEvent `xml:"event,omitempty,typeattr"` -} - -func init() { - t["DasConfigFault"] = reflect.TypeOf((*DasConfigFault)(nil)).Elem() -} - -type DasConfigFaultFault DasConfigFault - -func init() { - t["DasConfigFaultFault"] = reflect.TypeOf((*DasConfigFaultFault)(nil)).Elem() -} - -type DasDisabledEvent struct { - ClusterEvent -} - -func init() { - t["DasDisabledEvent"] = reflect.TypeOf((*DasDisabledEvent)(nil)).Elem() -} - -type DasEnabledEvent struct { - ClusterEvent -} - -func init() { - t["DasEnabledEvent"] = reflect.TypeOf((*DasEnabledEvent)(nil)).Elem() -} - -type DasHeartbeatDatastoreInfo struct { - DynamicData - - Datastore ManagedObjectReference `xml:"datastore"` - Hosts []ManagedObjectReference `xml:"hosts"` -} - -func init() { - t["DasHeartbeatDatastoreInfo"] = reflect.TypeOf((*DasHeartbeatDatastoreInfo)(nil)).Elem() -} - -type DasHostFailedEvent struct { - ClusterEvent - - FailedHost HostEventArgument `xml:"failedHost"` -} - -func init() { - t["DasHostFailedEvent"] = reflect.TypeOf((*DasHostFailedEvent)(nil)).Elem() -} - -type DasHostIsolatedEvent struct { - ClusterEvent - - IsolatedHost HostEventArgument `xml:"isolatedHost"` -} - -func init() { - t["DasHostIsolatedEvent"] = reflect.TypeOf((*DasHostIsolatedEvent)(nil)).Elem() -} - -type DatabaseError struct { - RuntimeFault -} - -func init() { - t["DatabaseError"] = reflect.TypeOf((*DatabaseError)(nil)).Elem() -} - -type DatabaseErrorFault DatabaseError - -func init() { - t["DatabaseErrorFault"] = reflect.TypeOf((*DatabaseErrorFault)(nil)).Elem() -} - -type DatabaseSizeEstimate struct { - DynamicData - - Size int64 `xml:"size"` -} - -func init() { - t["DatabaseSizeEstimate"] = reflect.TypeOf((*DatabaseSizeEstimate)(nil)).Elem() -} - -type DatabaseSizeParam struct { - DynamicData - - InventoryDesc InventoryDescription `xml:"inventoryDesc"` - PerfStatsDesc *PerformanceStatisticsDescription `xml:"perfStatsDesc,omitempty"` -} - -func init() { - t["DatabaseSizeParam"] = reflect.TypeOf((*DatabaseSizeParam)(nil)).Elem() -} - -type DatacenterConfigInfo struct { - DynamicData - - DefaultHardwareVersionKey string `xml:"defaultHardwareVersionKey,omitempty"` -} - -func init() { - t["DatacenterConfigInfo"] = reflect.TypeOf((*DatacenterConfigInfo)(nil)).Elem() -} - -type DatacenterConfigSpec struct { - DynamicData - - DefaultHardwareVersionKey string `xml:"defaultHardwareVersionKey,omitempty"` -} - -func init() { - t["DatacenterConfigSpec"] = reflect.TypeOf((*DatacenterConfigSpec)(nil)).Elem() -} - -type DatacenterCreatedEvent struct { - DatacenterEvent - - Parent FolderEventArgument `xml:"parent"` -} - -func init() { - t["DatacenterCreatedEvent"] = reflect.TypeOf((*DatacenterCreatedEvent)(nil)).Elem() -} - -type DatacenterEvent struct { - Event -} - -func init() { - t["DatacenterEvent"] = reflect.TypeOf((*DatacenterEvent)(nil)).Elem() -} - -type DatacenterEventArgument struct { - EntityEventArgument - - Datacenter ManagedObjectReference `xml:"datacenter"` -} - -func init() { - t["DatacenterEventArgument"] = reflect.TypeOf((*DatacenterEventArgument)(nil)).Elem() -} - -type DatacenterMismatch struct { - MigrationFault - - InvalidArgument []DatacenterMismatchArgument `xml:"invalidArgument"` - ExpectedDatacenter ManagedObjectReference `xml:"expectedDatacenter"` -} - -func init() { - t["DatacenterMismatch"] = reflect.TypeOf((*DatacenterMismatch)(nil)).Elem() -} - -type DatacenterMismatchArgument struct { - DynamicData - - Entity ManagedObjectReference `xml:"entity"` - InputDatacenter *ManagedObjectReference `xml:"inputDatacenter,omitempty"` -} - -func init() { - t["DatacenterMismatchArgument"] = reflect.TypeOf((*DatacenterMismatchArgument)(nil)).Elem() -} - -type DatacenterMismatchFault DatacenterMismatch - -func init() { - t["DatacenterMismatchFault"] = reflect.TypeOf((*DatacenterMismatchFault)(nil)).Elem() -} - -type DatacenterRenamedEvent struct { - DatacenterEvent - - OldName string `xml:"oldName"` - NewName string `xml:"newName"` -} - -func init() { - t["DatacenterRenamedEvent"] = reflect.TypeOf((*DatacenterRenamedEvent)(nil)).Elem() -} - -type DatastoreCapability struct { - DynamicData - - DirectoryHierarchySupported bool `xml:"directoryHierarchySupported"` - RawDiskMappingsSupported bool `xml:"rawDiskMappingsSupported"` - PerFileThinProvisioningSupported bool `xml:"perFileThinProvisioningSupported"` - StorageIORMSupported *bool `xml:"storageIORMSupported"` - NativeSnapshotSupported *bool `xml:"nativeSnapshotSupported"` - TopLevelDirectoryCreateSupported *bool `xml:"topLevelDirectoryCreateSupported"` - SeSparseSupported *bool `xml:"seSparseSupported"` -} - -func init() { - t["DatastoreCapability"] = reflect.TypeOf((*DatastoreCapability)(nil)).Elem() -} - -type DatastoreCapacityIncreasedEvent struct { - DatastoreEvent - - OldCapacity int64 `xml:"oldCapacity"` - NewCapacity int64 `xml:"newCapacity"` -} - -func init() { - t["DatastoreCapacityIncreasedEvent"] = reflect.TypeOf((*DatastoreCapacityIncreasedEvent)(nil)).Elem() -} - -type DatastoreDestroyedEvent struct { - DatastoreEvent -} - -func init() { - t["DatastoreDestroyedEvent"] = reflect.TypeOf((*DatastoreDestroyedEvent)(nil)).Elem() -} - -type DatastoreDiscoveredEvent struct { - HostEvent - - Datastore DatastoreEventArgument `xml:"datastore"` -} - -func init() { - t["DatastoreDiscoveredEvent"] = reflect.TypeOf((*DatastoreDiscoveredEvent)(nil)).Elem() -} - -type DatastoreDuplicatedEvent struct { - DatastoreEvent -} - -func init() { - t["DatastoreDuplicatedEvent"] = reflect.TypeOf((*DatastoreDuplicatedEvent)(nil)).Elem() -} - -type DatastoreEnterMaintenanceMode DatastoreEnterMaintenanceModeRequestType - -func init() { - t["DatastoreEnterMaintenanceMode"] = reflect.TypeOf((*DatastoreEnterMaintenanceMode)(nil)).Elem() -} - -type DatastoreEnterMaintenanceModeRequestType struct { - This ManagedObjectReference `xml:"_this"` -} - -func init() { - t["DatastoreEnterMaintenanceModeRequestType"] = reflect.TypeOf((*DatastoreEnterMaintenanceModeRequestType)(nil)).Elem() -} - -type DatastoreEnterMaintenanceModeResponse struct { - Returnval StoragePlacementResult `xml:"returnval"` -} - -type DatastoreEvent struct { - Event - - Datastore *DatastoreEventArgument `xml:"datastore,omitempty"` -} - -func init() { - t["DatastoreEvent"] = reflect.TypeOf((*DatastoreEvent)(nil)).Elem() -} - -type DatastoreEventArgument struct { - EntityEventArgument - - Datastore ManagedObjectReference `xml:"datastore"` -} - -func init() { - t["DatastoreEventArgument"] = reflect.TypeOf((*DatastoreEventArgument)(nil)).Elem() -} - -type DatastoreExitMaintenanceModeRequestType struct { - This ManagedObjectReference `xml:"_this"` -} - -func init() { - t["DatastoreExitMaintenanceModeRequestType"] = reflect.TypeOf((*DatastoreExitMaintenanceModeRequestType)(nil)).Elem() -} - -type DatastoreExitMaintenanceMode_Task DatastoreExitMaintenanceModeRequestType - -func init() { - t["DatastoreExitMaintenanceMode_Task"] = reflect.TypeOf((*DatastoreExitMaintenanceMode_Task)(nil)).Elem() -} - -type DatastoreExitMaintenanceMode_TaskResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type DatastoreFileCopiedEvent struct { - DatastoreFileEvent - - SourceDatastore DatastoreEventArgument `xml:"sourceDatastore"` - SourceFile string `xml:"sourceFile"` -} - -func init() { - t["DatastoreFileCopiedEvent"] = reflect.TypeOf((*DatastoreFileCopiedEvent)(nil)).Elem() -} - -type DatastoreFileDeletedEvent struct { - DatastoreFileEvent -} - -func init() { - t["DatastoreFileDeletedEvent"] = reflect.TypeOf((*DatastoreFileDeletedEvent)(nil)).Elem() -} - -type DatastoreFileEvent struct { - DatastoreEvent - - TargetFile string `xml:"targetFile"` -} - -func init() { - t["DatastoreFileEvent"] = reflect.TypeOf((*DatastoreFileEvent)(nil)).Elem() -} - -type DatastoreFileMovedEvent struct { - DatastoreFileEvent - - SourceDatastore DatastoreEventArgument `xml:"sourceDatastore"` - SourceFile string `xml:"sourceFile"` -} - -func init() { - t["DatastoreFileMovedEvent"] = reflect.TypeOf((*DatastoreFileMovedEvent)(nil)).Elem() -} - -type DatastoreHostMount struct { - DynamicData - - Key ManagedObjectReference `xml:"key"` - MountInfo HostMountInfo `xml:"mountInfo"` -} - -func init() { - t["DatastoreHostMount"] = reflect.TypeOf((*DatastoreHostMount)(nil)).Elem() -} - -type DatastoreIORMReconfiguredEvent struct { - DatastoreEvent -} - -func init() { - t["DatastoreIORMReconfiguredEvent"] = reflect.TypeOf((*DatastoreIORMReconfiguredEvent)(nil)).Elem() -} - -type DatastoreInfo struct { - DynamicData - - Name string `xml:"name"` - Url string `xml:"url"` - FreeSpace int64 `xml:"freeSpace"` - MaxFileSize int64 `xml:"maxFileSize"` - MaxVirtualDiskCapacity int64 `xml:"maxVirtualDiskCapacity,omitempty"` - Timestamp *time.Time `xml:"timestamp"` - ContainerId string `xml:"containerId,omitempty"` -} - -func init() { - t["DatastoreInfo"] = reflect.TypeOf((*DatastoreInfo)(nil)).Elem() -} - -type DatastoreMountPathDatastorePair struct { - DynamicData - - OldMountPath string `xml:"oldMountPath"` - Datastore ManagedObjectReference `xml:"datastore"` -} - -func init() { - t["DatastoreMountPathDatastorePair"] = reflect.TypeOf((*DatastoreMountPathDatastorePair)(nil)).Elem() -} - -type DatastoreNotWritableOnHost struct { - InvalidDatastore - - Host ManagedObjectReference `xml:"host"` -} - -func init() { - t["DatastoreNotWritableOnHost"] = reflect.TypeOf((*DatastoreNotWritableOnHost)(nil)).Elem() -} - -type DatastoreNotWritableOnHostFault BaseDatastoreNotWritableOnHost - -func init() { - t["DatastoreNotWritableOnHostFault"] = reflect.TypeOf((*DatastoreNotWritableOnHostFault)(nil)).Elem() -} - -type DatastoreOption struct { - DynamicData - - UnsupportedVolumes []VirtualMachineDatastoreVolumeOption `xml:"unsupportedVolumes,omitempty"` -} - -func init() { - t["DatastoreOption"] = reflect.TypeOf((*DatastoreOption)(nil)).Elem() -} - -type DatastorePrincipalConfigured struct { - HostEvent - - DatastorePrincipal string `xml:"datastorePrincipal"` -} - -func init() { - t["DatastorePrincipalConfigured"] = reflect.TypeOf((*DatastorePrincipalConfigured)(nil)).Elem() -} - -type DatastoreRemovedOnHostEvent struct { - HostEvent - - Datastore DatastoreEventArgument `xml:"datastore"` -} - -func init() { - t["DatastoreRemovedOnHostEvent"] = reflect.TypeOf((*DatastoreRemovedOnHostEvent)(nil)).Elem() -} - -type DatastoreRenamedEvent struct { - DatastoreEvent - - OldName string `xml:"oldName"` - NewName string `xml:"newName"` -} - -func init() { - t["DatastoreRenamedEvent"] = reflect.TypeOf((*DatastoreRenamedEvent)(nil)).Elem() -} - -type DatastoreRenamedOnHostEvent struct { - HostEvent - - OldName string `xml:"oldName"` - NewName string `xml:"newName"` -} - -func init() { - t["DatastoreRenamedOnHostEvent"] = reflect.TypeOf((*DatastoreRenamedOnHostEvent)(nil)).Elem() -} - -type DatastoreSummary struct { - DynamicData - - Datastore *ManagedObjectReference `xml:"datastore,omitempty"` - Name string `xml:"name"` - Url string `xml:"url"` - Capacity int64 `xml:"capacity"` - FreeSpace int64 `xml:"freeSpace"` - Uncommitted int64 `xml:"uncommitted,omitempty"` - Accessible bool `xml:"accessible"` - MultipleHostAccess *bool `xml:"multipleHostAccess"` - Type string `xml:"type"` - MaintenanceMode string `xml:"maintenanceMode,omitempty"` -} - -func init() { - t["DatastoreSummary"] = reflect.TypeOf((*DatastoreSummary)(nil)).Elem() -} - -type DateTimeProfile struct { - ApplyProfile -} - -func init() { - t["DateTimeProfile"] = reflect.TypeOf((*DateTimeProfile)(nil)).Elem() -} - -type DecodeLicense DecodeLicenseRequestType - -func init() { - t["DecodeLicense"] = reflect.TypeOf((*DecodeLicense)(nil)).Elem() -} - -type DecodeLicenseRequestType struct { - This ManagedObjectReference `xml:"_this"` - LicenseKey string `xml:"licenseKey"` -} - -func init() { - t["DecodeLicenseRequestType"] = reflect.TypeOf((*DecodeLicenseRequestType)(nil)).Elem() -} - -type DecodeLicenseResponse struct { - Returnval LicenseManagerLicenseInfo `xml:"returnval"` -} - -type DefragmentAllDisks DefragmentAllDisksRequestType - -func init() { - t["DefragmentAllDisks"] = reflect.TypeOf((*DefragmentAllDisks)(nil)).Elem() -} - -type DefragmentAllDisksRequestType struct { - This ManagedObjectReference `xml:"_this"` -} - -func init() { - t["DefragmentAllDisksRequestType"] = reflect.TypeOf((*DefragmentAllDisksRequestType)(nil)).Elem() -} - -type DefragmentAllDisksResponse struct { -} - -type DefragmentVirtualDiskRequestType struct { - This ManagedObjectReference `xml:"_this"` - Name string `xml:"name"` - Datacenter *ManagedObjectReference `xml:"datacenter,omitempty"` -} - -func init() { - t["DefragmentVirtualDiskRequestType"] = reflect.TypeOf((*DefragmentVirtualDiskRequestType)(nil)).Elem() -} - -type DefragmentVirtualDisk_Task DefragmentVirtualDiskRequestType - -func init() { - t["DefragmentVirtualDisk_Task"] = reflect.TypeOf((*DefragmentVirtualDisk_Task)(nil)).Elem() -} - -type DefragmentVirtualDisk_TaskResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type DeleteCustomizationSpec DeleteCustomizationSpecRequestType - -func init() { - t["DeleteCustomizationSpec"] = reflect.TypeOf((*DeleteCustomizationSpec)(nil)).Elem() -} - -type DeleteCustomizationSpecRequestType struct { - This ManagedObjectReference `xml:"_this"` - Name string `xml:"name"` -} - -func init() { - t["DeleteCustomizationSpecRequestType"] = reflect.TypeOf((*DeleteCustomizationSpecRequestType)(nil)).Elem() -} - -type DeleteCustomizationSpecResponse struct { -} - -type DeleteDatastoreFileRequestType struct { - This ManagedObjectReference `xml:"_this"` - Name string `xml:"name"` - Datacenter *ManagedObjectReference `xml:"datacenter,omitempty"` -} - -func init() { - t["DeleteDatastoreFileRequestType"] = reflect.TypeOf((*DeleteDatastoreFileRequestType)(nil)).Elem() -} - -type DeleteDatastoreFile_Task DeleteDatastoreFileRequestType - -func init() { - t["DeleteDatastoreFile_Task"] = reflect.TypeOf((*DeleteDatastoreFile_Task)(nil)).Elem() -} - -type DeleteDatastoreFile_TaskResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type DeleteDirectory DeleteDirectoryRequestType - -func init() { - t["DeleteDirectory"] = reflect.TypeOf((*DeleteDirectory)(nil)).Elem() -} - -type DeleteDirectoryInGuest DeleteDirectoryInGuestRequestType - -func init() { - t["DeleteDirectoryInGuest"] = reflect.TypeOf((*DeleteDirectoryInGuest)(nil)).Elem() -} - -type DeleteDirectoryInGuestRequestType struct { - This ManagedObjectReference `xml:"_this"` - Vm ManagedObjectReference `xml:"vm"` - Auth BaseGuestAuthentication `xml:"auth,typeattr"` - DirectoryPath string `xml:"directoryPath"` - Recursive bool `xml:"recursive"` -} - -func init() { - t["DeleteDirectoryInGuestRequestType"] = reflect.TypeOf((*DeleteDirectoryInGuestRequestType)(nil)).Elem() -} - -type DeleteDirectoryInGuestResponse struct { -} - -type DeleteDirectoryRequestType struct { - This ManagedObjectReference `xml:"_this"` - Datacenter *ManagedObjectReference `xml:"datacenter,omitempty"` - DatastorePath string `xml:"datastorePath"` -} - -func init() { - t["DeleteDirectoryRequestType"] = reflect.TypeOf((*DeleteDirectoryRequestType)(nil)).Elem() -} - -type DeleteDirectoryResponse struct { -} - -type DeleteFile DeleteFileRequestType - -func init() { - t["DeleteFile"] = reflect.TypeOf((*DeleteFile)(nil)).Elem() -} - -type DeleteFileInGuest DeleteFileInGuestRequestType - -func init() { - t["DeleteFileInGuest"] = reflect.TypeOf((*DeleteFileInGuest)(nil)).Elem() -} - -type DeleteFileInGuestRequestType struct { - This ManagedObjectReference `xml:"_this"` - Vm ManagedObjectReference `xml:"vm"` - Auth BaseGuestAuthentication `xml:"auth,typeattr"` - FilePath string `xml:"filePath"` -} - -func init() { - t["DeleteFileInGuestRequestType"] = reflect.TypeOf((*DeleteFileInGuestRequestType)(nil)).Elem() -} - -type DeleteFileInGuestResponse struct { -} - -type DeleteFileRequestType struct { - This ManagedObjectReference `xml:"_this"` - DatastorePath string `xml:"datastorePath"` -} - -func init() { - t["DeleteFileRequestType"] = reflect.TypeOf((*DeleteFileRequestType)(nil)).Elem() -} - -type DeleteFileResponse struct { -} - -type DeleteScsiLunState DeleteScsiLunStateRequestType - -func init() { - t["DeleteScsiLunState"] = reflect.TypeOf((*DeleteScsiLunState)(nil)).Elem() -} - -type DeleteScsiLunStateRequestType struct { - This ManagedObjectReference `xml:"_this"` - LunCanonicalName string `xml:"lunCanonicalName"` -} - -func init() { - t["DeleteScsiLunStateRequestType"] = reflect.TypeOf((*DeleteScsiLunStateRequestType)(nil)).Elem() -} - -type DeleteScsiLunStateResponse struct { -} - -type DeleteVffsVolumeState DeleteVffsVolumeStateRequestType - -func init() { - t["DeleteVffsVolumeState"] = reflect.TypeOf((*DeleteVffsVolumeState)(nil)).Elem() -} - -type DeleteVffsVolumeStateRequestType struct { - This ManagedObjectReference `xml:"_this"` - VffsUuid string `xml:"vffsUuid"` -} - -func init() { - t["DeleteVffsVolumeStateRequestType"] = reflect.TypeOf((*DeleteVffsVolumeStateRequestType)(nil)).Elem() -} - -type DeleteVffsVolumeStateResponse struct { -} - -type DeleteVirtualDiskRequestType struct { - This ManagedObjectReference `xml:"_this"` - Name string `xml:"name"` - Datacenter *ManagedObjectReference `xml:"datacenter,omitempty"` -} - -func init() { - t["DeleteVirtualDiskRequestType"] = reflect.TypeOf((*DeleteVirtualDiskRequestType)(nil)).Elem() -} - -type DeleteVirtualDisk_Task DeleteVirtualDiskRequestType - -func init() { - t["DeleteVirtualDisk_Task"] = reflect.TypeOf((*DeleteVirtualDisk_Task)(nil)).Elem() -} - -type DeleteVirtualDisk_TaskResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type DeleteVmfsVolumeState DeleteVmfsVolumeStateRequestType - -func init() { - t["DeleteVmfsVolumeState"] = reflect.TypeOf((*DeleteVmfsVolumeState)(nil)).Elem() -} - -type DeleteVmfsVolumeStateRequestType struct { - This ManagedObjectReference `xml:"_this"` - VmfsUuid string `xml:"vmfsUuid"` -} - -func init() { - t["DeleteVmfsVolumeStateRequestType"] = reflect.TypeOf((*DeleteVmfsVolumeStateRequestType)(nil)).Elem() -} - -type DeleteVmfsVolumeStateResponse struct { -} - -type DeltaDiskFormatNotSupported struct { - VmConfigFault - - Datastore []ManagedObjectReference `xml:"datastore,omitempty"` - DeltaDiskFormat string `xml:"deltaDiskFormat"` -} - -func init() { - t["DeltaDiskFormatNotSupported"] = reflect.TypeOf((*DeltaDiskFormatNotSupported)(nil)).Elem() -} - -type DeltaDiskFormatNotSupportedFault DeltaDiskFormatNotSupported - -func init() { - t["DeltaDiskFormatNotSupportedFault"] = reflect.TypeOf((*DeltaDiskFormatNotSupportedFault)(nil)).Elem() -} - -type Description struct { - DynamicData - - Label string `xml:"label"` - Summary string `xml:"summary"` -} - -func init() { - t["Description"] = reflect.TypeOf((*Description)(nil)).Elem() -} - -type DeselectVnic DeselectVnicRequestType - -func init() { - t["DeselectVnic"] = reflect.TypeOf((*DeselectVnic)(nil)).Elem() -} - -type DeselectVnicForNicType DeselectVnicForNicTypeRequestType - -func init() { - t["DeselectVnicForNicType"] = reflect.TypeOf((*DeselectVnicForNicType)(nil)).Elem() -} - -type DeselectVnicForNicTypeRequestType struct { - This ManagedObjectReference `xml:"_this"` - NicType string `xml:"nicType"` - Device string `xml:"device"` -} - -func init() { - t["DeselectVnicForNicTypeRequestType"] = reflect.TypeOf((*DeselectVnicForNicTypeRequestType)(nil)).Elem() -} - -type DeselectVnicForNicTypeResponse struct { -} - -type DeselectVnicRequestType struct { - This ManagedObjectReference `xml:"_this"` -} - -func init() { - t["DeselectVnicRequestType"] = reflect.TypeOf((*DeselectVnicRequestType)(nil)).Elem() -} - -type DeselectVnicResponse struct { -} - -type DestinationSwitchFull struct { - CannotAccessNetwork -} - -func init() { - t["DestinationSwitchFull"] = reflect.TypeOf((*DestinationSwitchFull)(nil)).Elem() -} - -type DestinationSwitchFullFault DestinationSwitchFull - -func init() { - t["DestinationSwitchFullFault"] = reflect.TypeOf((*DestinationSwitchFullFault)(nil)).Elem() -} - -type DestinationVsanDisabled struct { - CannotMoveVsanEnabledHost - - DestinationCluster string `xml:"destinationCluster"` -} - -func init() { - t["DestinationVsanDisabled"] = reflect.TypeOf((*DestinationVsanDisabled)(nil)).Elem() -} - -type DestinationVsanDisabledFault DestinationVsanDisabled - -func init() { - t["DestinationVsanDisabledFault"] = reflect.TypeOf((*DestinationVsanDisabledFault)(nil)).Elem() -} - -type DestroyChildren DestroyChildrenRequestType - -func init() { - t["DestroyChildren"] = reflect.TypeOf((*DestroyChildren)(nil)).Elem() -} - -type DestroyChildrenRequestType struct { - This ManagedObjectReference `xml:"_this"` -} - -func init() { - t["DestroyChildrenRequestType"] = reflect.TypeOf((*DestroyChildrenRequestType)(nil)).Elem() -} - -type DestroyChildrenResponse struct { -} - -type DestroyCollector DestroyCollectorRequestType - -func init() { - t["DestroyCollector"] = reflect.TypeOf((*DestroyCollector)(nil)).Elem() -} - -type DestroyCollectorRequestType struct { - This ManagedObjectReference `xml:"_this"` -} - -func init() { - t["DestroyCollectorRequestType"] = reflect.TypeOf((*DestroyCollectorRequestType)(nil)).Elem() -} - -type DestroyCollectorResponse struct { -} - -type DestroyDatastore DestroyDatastoreRequestType - -func init() { - t["DestroyDatastore"] = reflect.TypeOf((*DestroyDatastore)(nil)).Elem() -} - -type DestroyDatastoreRequestType struct { - This ManagedObjectReference `xml:"_this"` -} - -func init() { - t["DestroyDatastoreRequestType"] = reflect.TypeOf((*DestroyDatastoreRequestType)(nil)).Elem() -} - -type DestroyDatastoreResponse struct { -} - -type DestroyIpPool DestroyIpPoolRequestType - -func init() { - t["DestroyIpPool"] = reflect.TypeOf((*DestroyIpPool)(nil)).Elem() -} - -type DestroyIpPoolRequestType struct { - This ManagedObjectReference `xml:"_this"` - Dc ManagedObjectReference `xml:"dc"` - Id int `xml:"id"` - Force bool `xml:"force"` -} - -func init() { - t["DestroyIpPoolRequestType"] = reflect.TypeOf((*DestroyIpPoolRequestType)(nil)).Elem() -} - -type DestroyIpPoolResponse struct { -} - -type DestroyNetwork DestroyNetworkRequestType - -func init() { - t["DestroyNetwork"] = reflect.TypeOf((*DestroyNetwork)(nil)).Elem() -} - -type DestroyNetworkRequestType struct { - This ManagedObjectReference `xml:"_this"` -} - -func init() { - t["DestroyNetworkRequestType"] = reflect.TypeOf((*DestroyNetworkRequestType)(nil)).Elem() -} - -type DestroyNetworkResponse struct { -} - -type DestroyProfile DestroyProfileRequestType - -func init() { - t["DestroyProfile"] = reflect.TypeOf((*DestroyProfile)(nil)).Elem() -} - -type DestroyProfileRequestType struct { - This ManagedObjectReference `xml:"_this"` -} - -func init() { - t["DestroyProfileRequestType"] = reflect.TypeOf((*DestroyProfileRequestType)(nil)).Elem() -} - -type DestroyProfileResponse struct { -} - -type DestroyPropertyCollector DestroyPropertyCollectorRequestType - -func init() { - t["DestroyPropertyCollector"] = reflect.TypeOf((*DestroyPropertyCollector)(nil)).Elem() -} - -type DestroyPropertyCollectorRequestType struct { - This ManagedObjectReference `xml:"_this"` -} - -func init() { - t["DestroyPropertyCollectorRequestType"] = reflect.TypeOf((*DestroyPropertyCollectorRequestType)(nil)).Elem() -} - -type DestroyPropertyCollectorResponse struct { -} - -type DestroyPropertyFilter DestroyPropertyFilterRequestType - -func init() { - t["DestroyPropertyFilter"] = reflect.TypeOf((*DestroyPropertyFilter)(nil)).Elem() -} - -type DestroyPropertyFilterRequestType struct { - This ManagedObjectReference `xml:"_this"` -} - -func init() { - t["DestroyPropertyFilterRequestType"] = reflect.TypeOf((*DestroyPropertyFilterRequestType)(nil)).Elem() -} - -type DestroyPropertyFilterResponse struct { -} - -type DestroyRequestType struct { - This ManagedObjectReference `xml:"_this"` -} - -func init() { - t["DestroyRequestType"] = reflect.TypeOf((*DestroyRequestType)(nil)).Elem() -} - -type DestroyVffs DestroyVffsRequestType - -func init() { - t["DestroyVffs"] = reflect.TypeOf((*DestroyVffs)(nil)).Elem() -} - -type DestroyVffsRequestType struct { - This ManagedObjectReference `xml:"_this"` - VffsPath string `xml:"vffsPath"` -} - -func init() { - t["DestroyVffsRequestType"] = reflect.TypeOf((*DestroyVffsRequestType)(nil)).Elem() -} - -type DestroyVffsResponse struct { -} - -type DestroyView DestroyViewRequestType - -func init() { - t["DestroyView"] = reflect.TypeOf((*DestroyView)(nil)).Elem() -} - -type DestroyViewRequestType struct { - This ManagedObjectReference `xml:"_this"` -} - -func init() { - t["DestroyViewRequestType"] = reflect.TypeOf((*DestroyViewRequestType)(nil)).Elem() -} - -type DestroyViewResponse struct { -} - -type Destroy_Task DestroyRequestType - -func init() { - t["Destroy_Task"] = reflect.TypeOf((*Destroy_Task)(nil)).Elem() -} - -type Destroy_TaskResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type DetachScsiLun DetachScsiLunRequestType - -func init() { - t["DetachScsiLun"] = reflect.TypeOf((*DetachScsiLun)(nil)).Elem() -} - -type DetachScsiLunRequestType struct { - This ManagedObjectReference `xml:"_this"` - LunUuid string `xml:"lunUuid"` -} - -func init() { - t["DetachScsiLunRequestType"] = reflect.TypeOf((*DetachScsiLunRequestType)(nil)).Elem() -} - -type DetachScsiLunResponse struct { -} - -type DeviceBackedVirtualDiskSpec struct { - VirtualDiskSpec - - Device string `xml:"device"` -} - -func init() { - t["DeviceBackedVirtualDiskSpec"] = reflect.TypeOf((*DeviceBackedVirtualDiskSpec)(nil)).Elem() -} - -type DeviceBackingNotSupported struct { - DeviceNotSupported - - Backing string `xml:"backing"` -} - -func init() { - t["DeviceBackingNotSupported"] = reflect.TypeOf((*DeviceBackingNotSupported)(nil)).Elem() -} - -type DeviceBackingNotSupportedFault BaseDeviceBackingNotSupported - -func init() { - t["DeviceBackingNotSupportedFault"] = reflect.TypeOf((*DeviceBackingNotSupportedFault)(nil)).Elem() -} - -type DeviceControllerNotSupported struct { - DeviceNotSupported - - Controller string `xml:"controller"` -} - -func init() { - t["DeviceControllerNotSupported"] = reflect.TypeOf((*DeviceControllerNotSupported)(nil)).Elem() -} - -type DeviceControllerNotSupportedFault DeviceControllerNotSupported - -func init() { - t["DeviceControllerNotSupportedFault"] = reflect.TypeOf((*DeviceControllerNotSupportedFault)(nil)).Elem() -} - -type DeviceHotPlugNotSupported struct { - InvalidDeviceSpec -} - -func init() { - t["DeviceHotPlugNotSupported"] = reflect.TypeOf((*DeviceHotPlugNotSupported)(nil)).Elem() -} - -type DeviceHotPlugNotSupportedFault DeviceHotPlugNotSupported - -func init() { - t["DeviceHotPlugNotSupportedFault"] = reflect.TypeOf((*DeviceHotPlugNotSupportedFault)(nil)).Elem() -} - -type DeviceNotFound struct { - InvalidDeviceSpec -} - -func init() { - t["DeviceNotFound"] = reflect.TypeOf((*DeviceNotFound)(nil)).Elem() -} - -type DeviceNotFoundFault DeviceNotFound - -func init() { - t["DeviceNotFoundFault"] = reflect.TypeOf((*DeviceNotFoundFault)(nil)).Elem() -} - -type DeviceNotSupported struct { - VirtualHardwareCompatibilityIssue - - Device string `xml:"device"` - Reason string `xml:"reason,omitempty"` -} - -func init() { - t["DeviceNotSupported"] = reflect.TypeOf((*DeviceNotSupported)(nil)).Elem() -} - -type DeviceNotSupportedFault BaseDeviceNotSupported - -func init() { - t["DeviceNotSupportedFault"] = reflect.TypeOf((*DeviceNotSupportedFault)(nil)).Elem() -} - -type DeviceUnsupportedForVmPlatform struct { - InvalidDeviceSpec -} - -func init() { - t["DeviceUnsupportedForVmPlatform"] = reflect.TypeOf((*DeviceUnsupportedForVmPlatform)(nil)).Elem() -} - -type DeviceUnsupportedForVmPlatformFault DeviceUnsupportedForVmPlatform - -func init() { - t["DeviceUnsupportedForVmPlatformFault"] = reflect.TypeOf((*DeviceUnsupportedForVmPlatformFault)(nil)).Elem() -} - -type DeviceUnsupportedForVmVersion struct { - InvalidDeviceSpec - - CurrentVersion string `xml:"currentVersion"` - ExpectedVersion string `xml:"expectedVersion"` -} - -func init() { - t["DeviceUnsupportedForVmVersion"] = reflect.TypeOf((*DeviceUnsupportedForVmVersion)(nil)).Elem() -} - -type DeviceUnsupportedForVmVersionFault DeviceUnsupportedForVmVersion - -func init() { - t["DeviceUnsupportedForVmVersionFault"] = reflect.TypeOf((*DeviceUnsupportedForVmVersionFault)(nil)).Elem() -} - -type DiagnosticManagerBundleInfo struct { - DynamicData - - System *ManagedObjectReference `xml:"system,omitempty"` - Url string `xml:"url"` -} - -func init() { - t["DiagnosticManagerBundleInfo"] = reflect.TypeOf((*DiagnosticManagerBundleInfo)(nil)).Elem() -} - -type DiagnosticManagerLogDescriptor struct { - DynamicData - - Key string `xml:"key"` - FileName string `xml:"fileName"` - Creator string `xml:"creator"` - Format string `xml:"format"` - MimeType string `xml:"mimeType"` - Info BaseDescription `xml:"info,typeattr"` -} - -func init() { - t["DiagnosticManagerLogDescriptor"] = reflect.TypeOf((*DiagnosticManagerLogDescriptor)(nil)).Elem() -} - -type DiagnosticManagerLogHeader struct { - DynamicData - - LineStart int `xml:"lineStart"` - LineEnd int `xml:"lineEnd"` - LineText []string `xml:"lineText,omitempty"` -} - -func init() { - t["DiagnosticManagerLogHeader"] = reflect.TypeOf((*DiagnosticManagerLogHeader)(nil)).Elem() -} - -type DirectoryNotEmpty struct { - FileFault -} - -func init() { - t["DirectoryNotEmpty"] = reflect.TypeOf((*DirectoryNotEmpty)(nil)).Elem() -} - -type DirectoryNotEmptyFault DirectoryNotEmpty - -func init() { - t["DirectoryNotEmptyFault"] = reflect.TypeOf((*DirectoryNotEmptyFault)(nil)).Elem() -} - -type DisableAdminNotSupported struct { - HostConfigFault -} - -func init() { - t["DisableAdminNotSupported"] = reflect.TypeOf((*DisableAdminNotSupported)(nil)).Elem() -} - -type DisableAdminNotSupportedFault DisableAdminNotSupported - -func init() { - t["DisableAdminNotSupportedFault"] = reflect.TypeOf((*DisableAdminNotSupportedFault)(nil)).Elem() -} - -type DisableFeature DisableFeatureRequestType - -func init() { - t["DisableFeature"] = reflect.TypeOf((*DisableFeature)(nil)).Elem() -} - -type DisableFeatureRequestType struct { - This ManagedObjectReference `xml:"_this"` - Host *ManagedObjectReference `xml:"host,omitempty"` - FeatureKey string `xml:"featureKey"` -} - -func init() { - t["DisableFeatureRequestType"] = reflect.TypeOf((*DisableFeatureRequestType)(nil)).Elem() -} - -type DisableFeatureResponse struct { - Returnval bool `xml:"returnval"` -} - -type DisableHyperThreading DisableHyperThreadingRequestType - -func init() { - t["DisableHyperThreading"] = reflect.TypeOf((*DisableHyperThreading)(nil)).Elem() -} - -type DisableHyperThreadingRequestType struct { - This ManagedObjectReference `xml:"_this"` -} - -func init() { - t["DisableHyperThreadingRequestType"] = reflect.TypeOf((*DisableHyperThreadingRequestType)(nil)).Elem() -} - -type DisableHyperThreadingResponse struct { -} - -type DisableMultipathPath DisableMultipathPathRequestType - -func init() { - t["DisableMultipathPath"] = reflect.TypeOf((*DisableMultipathPath)(nil)).Elem() -} - -type DisableMultipathPathRequestType struct { - This ManagedObjectReference `xml:"_this"` - PathName string `xml:"pathName"` -} - -func init() { - t["DisableMultipathPathRequestType"] = reflect.TypeOf((*DisableMultipathPathRequestType)(nil)).Elem() -} - -type DisableMultipathPathResponse struct { -} - -type DisableRuleset DisableRulesetRequestType - -func init() { - t["DisableRuleset"] = reflect.TypeOf((*DisableRuleset)(nil)).Elem() -} - -type DisableRulesetRequestType struct { - This ManagedObjectReference `xml:"_this"` - Id string `xml:"id"` -} - -func init() { - t["DisableRulesetRequestType"] = reflect.TypeOf((*DisableRulesetRequestType)(nil)).Elem() -} - -type DisableRulesetResponse struct { -} - -type DisableSecondaryVMRequestType struct { - This ManagedObjectReference `xml:"_this"` - Vm ManagedObjectReference `xml:"vm"` -} - -func init() { - t["DisableSecondaryVMRequestType"] = reflect.TypeOf((*DisableSecondaryVMRequestType)(nil)).Elem() -} - -type DisableSecondaryVM_Task DisableSecondaryVMRequestType - -func init() { - t["DisableSecondaryVM_Task"] = reflect.TypeOf((*DisableSecondaryVM_Task)(nil)).Elem() -} - -type DisableSecondaryVM_TaskResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type DisallowedChangeByService struct { - RuntimeFault - - ServiceName string `xml:"serviceName"` - DisallowedChange string `xml:"disallowedChange,omitempty"` -} - -func init() { - t["DisallowedChangeByService"] = reflect.TypeOf((*DisallowedChangeByService)(nil)).Elem() -} - -type DisallowedChangeByServiceFault DisallowedChangeByService - -func init() { - t["DisallowedChangeByServiceFault"] = reflect.TypeOf((*DisallowedChangeByServiceFault)(nil)).Elem() -} - -type DisallowedDiskModeChange struct { - InvalidDeviceSpec -} - -func init() { - t["DisallowedDiskModeChange"] = reflect.TypeOf((*DisallowedDiskModeChange)(nil)).Elem() -} - -type DisallowedDiskModeChangeFault DisallowedDiskModeChange - -func init() { - t["DisallowedDiskModeChangeFault"] = reflect.TypeOf((*DisallowedDiskModeChangeFault)(nil)).Elem() -} - -type DisallowedMigrationDeviceAttached struct { - MigrationFault - - Fault LocalizedMethodFault `xml:"fault"` -} - -func init() { - t["DisallowedMigrationDeviceAttached"] = reflect.TypeOf((*DisallowedMigrationDeviceAttached)(nil)).Elem() -} - -type DisallowedMigrationDeviceAttachedFault DisallowedMigrationDeviceAttached - -func init() { - t["DisallowedMigrationDeviceAttachedFault"] = reflect.TypeOf((*DisallowedMigrationDeviceAttachedFault)(nil)).Elem() -} - -type DisallowedOperationOnFailoverHost struct { - RuntimeFault - - Host ManagedObjectReference `xml:"host"` - Hostname string `xml:"hostname"` -} - -func init() { - t["DisallowedOperationOnFailoverHost"] = reflect.TypeOf((*DisallowedOperationOnFailoverHost)(nil)).Elem() -} - -type DisallowedOperationOnFailoverHostFault DisallowedOperationOnFailoverHost - -func init() { - t["DisallowedOperationOnFailoverHostFault"] = reflect.TypeOf((*DisallowedOperationOnFailoverHostFault)(nil)).Elem() -} - -type DisconnectHostRequestType struct { - This ManagedObjectReference `xml:"_this"` -} - -func init() { - t["DisconnectHostRequestType"] = reflect.TypeOf((*DisconnectHostRequestType)(nil)).Elem() -} - -type DisconnectHost_Task DisconnectHostRequestType - -func init() { - t["DisconnectHost_Task"] = reflect.TypeOf((*DisconnectHost_Task)(nil)).Elem() -} - -type DisconnectHost_TaskResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type DiscoverFcoeHbas DiscoverFcoeHbasRequestType - -func init() { - t["DiscoverFcoeHbas"] = reflect.TypeOf((*DiscoverFcoeHbas)(nil)).Elem() -} - -type DiscoverFcoeHbasRequestType struct { - This ManagedObjectReference `xml:"_this"` - FcoeSpec FcoeConfigFcoeSpecification `xml:"fcoeSpec"` -} - -func init() { - t["DiscoverFcoeHbasRequestType"] = reflect.TypeOf((*DiscoverFcoeHbasRequestType)(nil)).Elem() -} - -type DiscoverFcoeHbasResponse struct { -} - -type DiskChangeExtent struct { - DynamicData - - Start int64 `xml:"start"` - Length int64 `xml:"length"` -} - -func init() { - t["DiskChangeExtent"] = reflect.TypeOf((*DiskChangeExtent)(nil)).Elem() -} - -type DiskChangeInfo struct { - DynamicData - - StartOffset int64 `xml:"startOffset"` - Length int64 `xml:"length"` - ChangedArea []DiskChangeExtent `xml:"changedArea,omitempty"` -} - -func init() { - t["DiskChangeInfo"] = reflect.TypeOf((*DiskChangeInfo)(nil)).Elem() -} - -type DiskHasPartitions struct { - VsanDiskFault -} - -func init() { - t["DiskHasPartitions"] = reflect.TypeOf((*DiskHasPartitions)(nil)).Elem() -} - -type DiskHasPartitionsFault DiskHasPartitions - -func init() { - t["DiskHasPartitionsFault"] = reflect.TypeOf((*DiskHasPartitionsFault)(nil)).Elem() -} - -type DiskIsLastRemainingNonSSD struct { - VsanDiskFault -} - -func init() { - t["DiskIsLastRemainingNonSSD"] = reflect.TypeOf((*DiskIsLastRemainingNonSSD)(nil)).Elem() -} - -type DiskIsLastRemainingNonSSDFault DiskIsLastRemainingNonSSD - -func init() { - t["DiskIsLastRemainingNonSSDFault"] = reflect.TypeOf((*DiskIsLastRemainingNonSSDFault)(nil)).Elem() -} - -type DiskIsNonLocal struct { - VsanDiskFault -} - -func init() { - t["DiskIsNonLocal"] = reflect.TypeOf((*DiskIsNonLocal)(nil)).Elem() -} - -type DiskIsNonLocalFault DiskIsNonLocal - -func init() { - t["DiskIsNonLocalFault"] = reflect.TypeOf((*DiskIsNonLocalFault)(nil)).Elem() -} - -type DiskIsUSB struct { - VsanDiskFault -} - -func init() { - t["DiskIsUSB"] = reflect.TypeOf((*DiskIsUSB)(nil)).Elem() -} - -type DiskIsUSBFault DiskIsUSB - -func init() { - t["DiskIsUSBFault"] = reflect.TypeOf((*DiskIsUSBFault)(nil)).Elem() -} - -type DiskMoveTypeNotSupported struct { - MigrationFault -} - -func init() { - t["DiskMoveTypeNotSupported"] = reflect.TypeOf((*DiskMoveTypeNotSupported)(nil)).Elem() -} - -type DiskMoveTypeNotSupportedFault DiskMoveTypeNotSupported - -func init() { - t["DiskMoveTypeNotSupportedFault"] = reflect.TypeOf((*DiskMoveTypeNotSupportedFault)(nil)).Elem() -} - -type DiskNotSupported struct { - VirtualHardwareCompatibilityIssue - - Disk int `xml:"disk"` -} - -func init() { - t["DiskNotSupported"] = reflect.TypeOf((*DiskNotSupported)(nil)).Elem() -} - -type DiskNotSupportedFault BaseDiskNotSupported - -func init() { - t["DiskNotSupportedFault"] = reflect.TypeOf((*DiskNotSupportedFault)(nil)).Elem() -} - -type DiskTooSmall struct { - VsanDiskFault -} - -func init() { - t["DiskTooSmall"] = reflect.TypeOf((*DiskTooSmall)(nil)).Elem() -} - -type DiskTooSmallFault DiskTooSmall - -func init() { - t["DiskTooSmallFault"] = reflect.TypeOf((*DiskTooSmallFault)(nil)).Elem() -} - -type DissociateProfile DissociateProfileRequestType - -func init() { - t["DissociateProfile"] = reflect.TypeOf((*DissociateProfile)(nil)).Elem() -} - -type DissociateProfileRequestType struct { - This ManagedObjectReference `xml:"_this"` - Entity []ManagedObjectReference `xml:"entity,omitempty"` -} - -func init() { - t["DissociateProfileRequestType"] = reflect.TypeOf((*DissociateProfileRequestType)(nil)).Elem() -} - -type DissociateProfileResponse struct { -} - -type DistributedVirtualPort struct { - DynamicData - - Key string `xml:"key"` - Config DVPortConfigInfo `xml:"config"` - DvsUuid string `xml:"dvsUuid"` - PortgroupKey string `xml:"portgroupKey,omitempty"` - ProxyHost *ManagedObjectReference `xml:"proxyHost,omitempty"` - Connectee *DistributedVirtualSwitchPortConnectee `xml:"connectee,omitempty"` - Conflict bool `xml:"conflict"` - ConflictPortKey string `xml:"conflictPortKey,omitempty"` - State *DVPortState `xml:"state,omitempty"` - ConnectionCookie int `xml:"connectionCookie,omitempty"` - LastStatusChange time.Time `xml:"lastStatusChange"` - HostLocalPort *bool `xml:"hostLocalPort"` -} - -func init() { - t["DistributedVirtualPort"] = reflect.TypeOf((*DistributedVirtualPort)(nil)).Elem() -} - -type DistributedVirtualPortgroupInfo struct { - DynamicData - - SwitchName string `xml:"switchName"` - SwitchUuid string `xml:"switchUuid"` - PortgroupName string `xml:"portgroupName"` - PortgroupKey string `xml:"portgroupKey"` - PortgroupType string `xml:"portgroupType"` - UplinkPortgroup bool `xml:"uplinkPortgroup"` - Portgroup ManagedObjectReference `xml:"portgroup"` -} - -func init() { - t["DistributedVirtualPortgroupInfo"] = reflect.TypeOf((*DistributedVirtualPortgroupInfo)(nil)).Elem() -} - -type DistributedVirtualSwitchHostMember struct { - DynamicData - - RuntimeState *DistributedVirtualSwitchHostMemberRuntimeState `xml:"runtimeState,omitempty"` - Config DistributedVirtualSwitchHostMemberConfigInfo `xml:"config"` - ProductInfo *DistributedVirtualSwitchProductSpec `xml:"productInfo,omitempty"` - UplinkPortKey []string `xml:"uplinkPortKey,omitempty"` - Status string `xml:"status"` - StatusDetail string `xml:"statusDetail,omitempty"` -} - -func init() { - t["DistributedVirtualSwitchHostMember"] = reflect.TypeOf((*DistributedVirtualSwitchHostMember)(nil)).Elem() -} - -type DistributedVirtualSwitchHostMemberBacking struct { - DynamicData -} - -func init() { - t["DistributedVirtualSwitchHostMemberBacking"] = reflect.TypeOf((*DistributedVirtualSwitchHostMemberBacking)(nil)).Elem() -} - -type DistributedVirtualSwitchHostMemberConfigInfo struct { - DynamicData - - Host *ManagedObjectReference `xml:"host,omitempty"` - MaxProxySwitchPorts int `xml:"maxProxySwitchPorts"` - VendorSpecificConfig []DistributedVirtualSwitchKeyedOpaqueBlob `xml:"vendorSpecificConfig,omitempty"` - Backing BaseDistributedVirtualSwitchHostMemberBacking `xml:"backing,typeattr"` -} - -func init() { - t["DistributedVirtualSwitchHostMemberConfigInfo"] = reflect.TypeOf((*DistributedVirtualSwitchHostMemberConfigInfo)(nil)).Elem() -} - -type DistributedVirtualSwitchHostMemberConfigSpec struct { - DynamicData - - Operation string `xml:"operation"` - Host ManagedObjectReference `xml:"host"` - Backing BaseDistributedVirtualSwitchHostMemberBacking `xml:"backing,omitempty,typeattr"` - MaxProxySwitchPorts int `xml:"maxProxySwitchPorts,omitempty"` - VendorSpecificConfig []DistributedVirtualSwitchKeyedOpaqueBlob `xml:"vendorSpecificConfig,omitempty"` -} - -func init() { - t["DistributedVirtualSwitchHostMemberConfigSpec"] = reflect.TypeOf((*DistributedVirtualSwitchHostMemberConfigSpec)(nil)).Elem() -} - -type DistributedVirtualSwitchHostMemberPnicBacking struct { - DistributedVirtualSwitchHostMemberBacking - - PnicSpec []DistributedVirtualSwitchHostMemberPnicSpec `xml:"pnicSpec,omitempty"` -} - -func init() { - t["DistributedVirtualSwitchHostMemberPnicBacking"] = reflect.TypeOf((*DistributedVirtualSwitchHostMemberPnicBacking)(nil)).Elem() -} - -type DistributedVirtualSwitchHostMemberPnicSpec struct { - DynamicData - - PnicDevice string `xml:"pnicDevice"` - UplinkPortKey string `xml:"uplinkPortKey,omitempty"` - UplinkPortgroupKey string `xml:"uplinkPortgroupKey,omitempty"` - ConnectionCookie int `xml:"connectionCookie,omitempty"` -} - -func init() { - t["DistributedVirtualSwitchHostMemberPnicSpec"] = reflect.TypeOf((*DistributedVirtualSwitchHostMemberPnicSpec)(nil)).Elem() -} - -type DistributedVirtualSwitchHostMemberRuntimeState struct { - DynamicData - - CurrentMaxProxySwitchPorts int `xml:"currentMaxProxySwitchPorts"` -} - -func init() { - t["DistributedVirtualSwitchHostMemberRuntimeState"] = reflect.TypeOf((*DistributedVirtualSwitchHostMemberRuntimeState)(nil)).Elem() -} - -type DistributedVirtualSwitchHostProductSpec struct { - DynamicData - - ProductLineId string `xml:"productLineId,omitempty"` - Version string `xml:"version,omitempty"` -} - -func init() { - t["DistributedVirtualSwitchHostProductSpec"] = reflect.TypeOf((*DistributedVirtualSwitchHostProductSpec)(nil)).Elem() -} - -type DistributedVirtualSwitchInfo struct { - DynamicData - - SwitchName string `xml:"switchName"` - SwitchUuid string `xml:"switchUuid"` - DistributedVirtualSwitch ManagedObjectReference `xml:"distributedVirtualSwitch"` -} - -func init() { - t["DistributedVirtualSwitchInfo"] = reflect.TypeOf((*DistributedVirtualSwitchInfo)(nil)).Elem() -} - -type DistributedVirtualSwitchKeyedOpaqueBlob struct { - DynamicData - - Key string `xml:"key"` - OpaqueData string `xml:"opaqueData"` -} - -func init() { - t["DistributedVirtualSwitchKeyedOpaqueBlob"] = reflect.TypeOf((*DistributedVirtualSwitchKeyedOpaqueBlob)(nil)).Elem() -} - -type DistributedVirtualSwitchManagerCompatibilityResult struct { - DynamicData - - Host ManagedObjectReference `xml:"host"` - Error []LocalizedMethodFault `xml:"error,omitempty"` -} - -func init() { - t["DistributedVirtualSwitchManagerCompatibilityResult"] = reflect.TypeOf((*DistributedVirtualSwitchManagerCompatibilityResult)(nil)).Elem() -} - -type DistributedVirtualSwitchManagerDvsProductSpec struct { - DynamicData - - NewSwitchProductSpec *DistributedVirtualSwitchProductSpec `xml:"newSwitchProductSpec,omitempty"` - DistributedVirtualSwitch *ManagedObjectReference `xml:"distributedVirtualSwitch,omitempty"` -} - -func init() { - t["DistributedVirtualSwitchManagerDvsProductSpec"] = reflect.TypeOf((*DistributedVirtualSwitchManagerDvsProductSpec)(nil)).Elem() -} - -type DistributedVirtualSwitchManagerHostArrayFilter struct { - DistributedVirtualSwitchManagerHostDvsFilterSpec - - Host []ManagedObjectReference `xml:"host"` -} - -func init() { - t["DistributedVirtualSwitchManagerHostArrayFilter"] = reflect.TypeOf((*DistributedVirtualSwitchManagerHostArrayFilter)(nil)).Elem() -} - -type DistributedVirtualSwitchManagerHostContainer struct { - DynamicData - - Container ManagedObjectReference `xml:"container"` - Recursive bool `xml:"recursive"` -} - -func init() { - t["DistributedVirtualSwitchManagerHostContainer"] = reflect.TypeOf((*DistributedVirtualSwitchManagerHostContainer)(nil)).Elem() -} - -type DistributedVirtualSwitchManagerHostContainerFilter struct { - DistributedVirtualSwitchManagerHostDvsFilterSpec - - HostContainer DistributedVirtualSwitchManagerHostContainer `xml:"hostContainer"` -} - -func init() { - t["DistributedVirtualSwitchManagerHostContainerFilter"] = reflect.TypeOf((*DistributedVirtualSwitchManagerHostContainerFilter)(nil)).Elem() -} - -type DistributedVirtualSwitchManagerHostDvsFilterSpec struct { - DynamicData - - Inclusive bool `xml:"inclusive"` -} - -func init() { - t["DistributedVirtualSwitchManagerHostDvsFilterSpec"] = reflect.TypeOf((*DistributedVirtualSwitchManagerHostDvsFilterSpec)(nil)).Elem() -} - -type DistributedVirtualSwitchManagerHostDvsMembershipFilter struct { - DistributedVirtualSwitchManagerHostDvsFilterSpec - - DistributedVirtualSwitch ManagedObjectReference `xml:"distributedVirtualSwitch"` -} - -func init() { - t["DistributedVirtualSwitchManagerHostDvsMembershipFilter"] = reflect.TypeOf((*DistributedVirtualSwitchManagerHostDvsMembershipFilter)(nil)).Elem() -} - -type DistributedVirtualSwitchManagerImportResult struct { - DynamicData - - DistributedVirtualSwitch []ManagedObjectReference `xml:"distributedVirtualSwitch,omitempty"` - DistributedVirtualPortgroup []ManagedObjectReference `xml:"distributedVirtualPortgroup,omitempty"` - ImportFault []ImportOperationBulkFaultFaultOnImport `xml:"importFault,omitempty"` -} - -func init() { - t["DistributedVirtualSwitchManagerImportResult"] = reflect.TypeOf((*DistributedVirtualSwitchManagerImportResult)(nil)).Elem() -} - -type DistributedVirtualSwitchPortConnectee struct { - DynamicData - - ConnectedEntity *ManagedObjectReference `xml:"connectedEntity,omitempty"` - NicKey string `xml:"nicKey,omitempty"` - Type string `xml:"type,omitempty"` - AddressHint string `xml:"addressHint,omitempty"` -} - -func init() { - t["DistributedVirtualSwitchPortConnectee"] = reflect.TypeOf((*DistributedVirtualSwitchPortConnectee)(nil)).Elem() -} - -type DistributedVirtualSwitchPortConnection struct { - DynamicData - - SwitchUuid string `xml:"switchUuid"` - PortgroupKey string `xml:"portgroupKey,omitempty"` - PortKey string `xml:"portKey,omitempty"` - ConnectionCookie int `xml:"connectionCookie,omitempty"` -} - -func init() { - t["DistributedVirtualSwitchPortConnection"] = reflect.TypeOf((*DistributedVirtualSwitchPortConnection)(nil)).Elem() -} - -type DistributedVirtualSwitchPortCriteria struct { - DynamicData - - Connected *bool `xml:"connected"` - Active *bool `xml:"active"` - UplinkPort *bool `xml:"uplinkPort"` - Scope *ManagedObjectReference `xml:"scope,omitempty"` - PortgroupKey []string `xml:"portgroupKey,omitempty"` - Inside *bool `xml:"inside"` - PortKey []string `xml:"portKey,omitempty"` -} - -func init() { - t["DistributedVirtualSwitchPortCriteria"] = reflect.TypeOf((*DistributedVirtualSwitchPortCriteria)(nil)).Elem() -} - -type DistributedVirtualSwitchPortStatistics struct { - DynamicData - - PacketsInMulticast int64 `xml:"packetsInMulticast"` - PacketsOutMulticast int64 `xml:"packetsOutMulticast"` - BytesInMulticast int64 `xml:"bytesInMulticast"` - BytesOutMulticast int64 `xml:"bytesOutMulticast"` - PacketsInUnicast int64 `xml:"packetsInUnicast"` - PacketsOutUnicast int64 `xml:"packetsOutUnicast"` - BytesInUnicast int64 `xml:"bytesInUnicast"` - BytesOutUnicast int64 `xml:"bytesOutUnicast"` - PacketsInBroadcast int64 `xml:"packetsInBroadcast"` - PacketsOutBroadcast int64 `xml:"packetsOutBroadcast"` - BytesInBroadcast int64 `xml:"bytesInBroadcast"` - BytesOutBroadcast int64 `xml:"bytesOutBroadcast"` - PacketsInDropped int64 `xml:"packetsInDropped"` - PacketsOutDropped int64 `xml:"packetsOutDropped"` - PacketsInException int64 `xml:"packetsInException"` - PacketsOutException int64 `xml:"packetsOutException"` -} - -func init() { - t["DistributedVirtualSwitchPortStatistics"] = reflect.TypeOf((*DistributedVirtualSwitchPortStatistics)(nil)).Elem() -} - -type DistributedVirtualSwitchProductSpec struct { - DynamicData - - Name string `xml:"name,omitempty"` - Vendor string `xml:"vendor,omitempty"` - Version string `xml:"version,omitempty"` - Build string `xml:"build,omitempty"` - ForwardingClass string `xml:"forwardingClass,omitempty"` - BundleId string `xml:"bundleId,omitempty"` - BundleUrl string `xml:"bundleUrl,omitempty"` -} - -func init() { - t["DistributedVirtualSwitchProductSpec"] = reflect.TypeOf((*DistributedVirtualSwitchProductSpec)(nil)).Elem() -} - -type DoesCustomizationSpecExist DoesCustomizationSpecExistRequestType - -func init() { - t["DoesCustomizationSpecExist"] = reflect.TypeOf((*DoesCustomizationSpecExist)(nil)).Elem() -} - -type DoesCustomizationSpecExistRequestType struct { - This ManagedObjectReference `xml:"_this"` - Name string `xml:"name"` -} - -func init() { - t["DoesCustomizationSpecExistRequestType"] = reflect.TypeOf((*DoesCustomizationSpecExistRequestType)(nil)).Elem() -} - -type DoesCustomizationSpecExistResponse struct { - Returnval bool `xml:"returnval"` -} - -type DomainNotFound struct { - ActiveDirectoryFault - - DomainName string `xml:"domainName"` -} - -func init() { - t["DomainNotFound"] = reflect.TypeOf((*DomainNotFound)(nil)).Elem() -} - -type DomainNotFoundFault DomainNotFound - -func init() { - t["DomainNotFoundFault"] = reflect.TypeOf((*DomainNotFoundFault)(nil)).Elem() -} - -type DrsDisabledEvent struct { - ClusterEvent -} - -func init() { - t["DrsDisabledEvent"] = reflect.TypeOf((*DrsDisabledEvent)(nil)).Elem() -} - -type DrsDisabledOnVm struct { - VimFault -} - -func init() { - t["DrsDisabledOnVm"] = reflect.TypeOf((*DrsDisabledOnVm)(nil)).Elem() -} - -type DrsDisabledOnVmFault DrsDisabledOnVm - -func init() { - t["DrsDisabledOnVmFault"] = reflect.TypeOf((*DrsDisabledOnVmFault)(nil)).Elem() -} - -type DrsEnabledEvent struct { - ClusterEvent - - Behavior string `xml:"behavior"` -} - -func init() { - t["DrsEnabledEvent"] = reflect.TypeOf((*DrsEnabledEvent)(nil)).Elem() -} - -type DrsEnteredStandbyModeEvent struct { - EnteredStandbyModeEvent -} - -func init() { - t["DrsEnteredStandbyModeEvent"] = reflect.TypeOf((*DrsEnteredStandbyModeEvent)(nil)).Elem() -} - -type DrsEnteringStandbyModeEvent struct { - EnteringStandbyModeEvent -} - -func init() { - t["DrsEnteringStandbyModeEvent"] = reflect.TypeOf((*DrsEnteringStandbyModeEvent)(nil)).Elem() -} - -type DrsExitStandbyModeFailedEvent struct { - ExitStandbyModeFailedEvent -} - -func init() { - t["DrsExitStandbyModeFailedEvent"] = reflect.TypeOf((*DrsExitStandbyModeFailedEvent)(nil)).Elem() -} - -type DrsExitedStandbyModeEvent struct { - ExitedStandbyModeEvent -} - -func init() { - t["DrsExitedStandbyModeEvent"] = reflect.TypeOf((*DrsExitedStandbyModeEvent)(nil)).Elem() -} - -type DrsExitingStandbyModeEvent struct { - ExitingStandbyModeEvent -} - -func init() { - t["DrsExitingStandbyModeEvent"] = reflect.TypeOf((*DrsExitingStandbyModeEvent)(nil)).Elem() -} - -type DrsInvocationFailedEvent struct { - ClusterEvent -} - -func init() { - t["DrsInvocationFailedEvent"] = reflect.TypeOf((*DrsInvocationFailedEvent)(nil)).Elem() -} - -type DrsRecoveredFromFailureEvent struct { - ClusterEvent -} - -func init() { - t["DrsRecoveredFromFailureEvent"] = reflect.TypeOf((*DrsRecoveredFromFailureEvent)(nil)).Elem() -} - -type DrsResourceConfigureFailedEvent struct { - HostEvent - - Reason LocalizedMethodFault `xml:"reason"` -} - -func init() { - t["DrsResourceConfigureFailedEvent"] = reflect.TypeOf((*DrsResourceConfigureFailedEvent)(nil)).Elem() -} - -type DrsResourceConfigureSyncedEvent struct { - HostEvent -} - -func init() { - t["DrsResourceConfigureSyncedEvent"] = reflect.TypeOf((*DrsResourceConfigureSyncedEvent)(nil)).Elem() -} - -type DrsRuleComplianceEvent struct { - VmEvent -} - -func init() { - t["DrsRuleComplianceEvent"] = reflect.TypeOf((*DrsRuleComplianceEvent)(nil)).Elem() -} - -type DrsRuleViolationEvent struct { - VmEvent -} - -func init() { - t["DrsRuleViolationEvent"] = reflect.TypeOf((*DrsRuleViolationEvent)(nil)).Elem() -} - -type DrsVmMigratedEvent struct { - VmMigratedEvent -} - -func init() { - t["DrsVmMigratedEvent"] = reflect.TypeOf((*DrsVmMigratedEvent)(nil)).Elem() -} - -type DrsVmPoweredOnEvent struct { - VmPoweredOnEvent -} - -func init() { - t["DrsVmPoweredOnEvent"] = reflect.TypeOf((*DrsVmPoweredOnEvent)(nil)).Elem() -} - -type DrsVmotionIncompatibleFault struct { - VirtualHardwareCompatibilityIssue - - Host ManagedObjectReference `xml:"host"` -} - -func init() { - t["DrsVmotionIncompatibleFault"] = reflect.TypeOf((*DrsVmotionIncompatibleFault)(nil)).Elem() -} - -type DrsVmotionIncompatibleFaultFault DrsVmotionIncompatibleFault - -func init() { - t["DrsVmotionIncompatibleFaultFault"] = reflect.TypeOf((*DrsVmotionIncompatibleFaultFault)(nil)).Elem() -} - -type DuplicateCustomizationSpec DuplicateCustomizationSpecRequestType - -func init() { - t["DuplicateCustomizationSpec"] = reflect.TypeOf((*DuplicateCustomizationSpec)(nil)).Elem() -} - -type DuplicateCustomizationSpecRequestType struct { - This ManagedObjectReference `xml:"_this"` - Name string `xml:"name"` - NewName string `xml:"newName"` -} - -func init() { - t["DuplicateCustomizationSpecRequestType"] = reflect.TypeOf((*DuplicateCustomizationSpecRequestType)(nil)).Elem() -} - -type DuplicateCustomizationSpecResponse struct { -} - -type DuplicateDisks struct { - VsanDiskFault -} - -func init() { - t["DuplicateDisks"] = reflect.TypeOf((*DuplicateDisks)(nil)).Elem() -} - -type DuplicateDisksFault DuplicateDisks - -func init() { - t["DuplicateDisksFault"] = reflect.TypeOf((*DuplicateDisksFault)(nil)).Elem() -} - -type DuplicateIpDetectedEvent struct { - HostEvent - - DuplicateIP string `xml:"duplicateIP"` - MacAddress string `xml:"macAddress"` -} - -func init() { - t["DuplicateIpDetectedEvent"] = reflect.TypeOf((*DuplicateIpDetectedEvent)(nil)).Elem() -} - -type DuplicateName struct { - VimFault - - Name string `xml:"name"` - Object ManagedObjectReference `xml:"object"` -} - -func init() { - t["DuplicateName"] = reflect.TypeOf((*DuplicateName)(nil)).Elem() -} - -type DuplicateNameFault DuplicateName - -func init() { - t["DuplicateNameFault"] = reflect.TypeOf((*DuplicateNameFault)(nil)).Elem() -} - -type DuplicateVsanNetworkInterface struct { - VsanFault - - Device string `xml:"device"` -} - -func init() { - t["DuplicateVsanNetworkInterface"] = reflect.TypeOf((*DuplicateVsanNetworkInterface)(nil)).Elem() -} - -type DuplicateVsanNetworkInterfaceFault DuplicateVsanNetworkInterface - -func init() { - t["DuplicateVsanNetworkInterfaceFault"] = reflect.TypeOf((*DuplicateVsanNetworkInterfaceFault)(nil)).Elem() -} - -type DvpgImportEvent struct { - DVPortgroupEvent - - ImportType string `xml:"importType"` -} - -func init() { - t["DvpgImportEvent"] = reflect.TypeOf((*DvpgImportEvent)(nil)).Elem() -} - -type DvpgRestoreEvent struct { - DVPortgroupEvent -} - -func init() { - t["DvpgRestoreEvent"] = reflect.TypeOf((*DvpgRestoreEvent)(nil)).Elem() -} - -type DvsAcceptNetworkRuleAction struct { - DvsNetworkRuleAction -} - -func init() { - t["DvsAcceptNetworkRuleAction"] = reflect.TypeOf((*DvsAcceptNetworkRuleAction)(nil)).Elem() -} - -type DvsApplyOperationFault struct { - DvsFault - - ObjectFault []DvsApplyOperationFaultFaultOnObject `xml:"objectFault"` -} - -func init() { - t["DvsApplyOperationFault"] = reflect.TypeOf((*DvsApplyOperationFault)(nil)).Elem() -} - -type DvsApplyOperationFaultFault DvsApplyOperationFault - -func init() { - t["DvsApplyOperationFaultFault"] = reflect.TypeOf((*DvsApplyOperationFaultFault)(nil)).Elem() -} - -type DvsApplyOperationFaultFaultOnObject struct { - DynamicData - - ObjectId string `xml:"objectId"` - Type string `xml:"type"` - Fault LocalizedMethodFault `xml:"fault"` -} - -func init() { - t["DvsApplyOperationFaultFaultOnObject"] = reflect.TypeOf((*DvsApplyOperationFaultFaultOnObject)(nil)).Elem() -} - -type DvsCopyNetworkRuleAction struct { - DvsNetworkRuleAction -} - -func init() { - t["DvsCopyNetworkRuleAction"] = reflect.TypeOf((*DvsCopyNetworkRuleAction)(nil)).Elem() -} - -type DvsCreatedEvent struct { - DvsEvent - - Parent FolderEventArgument `xml:"parent"` -} - -func init() { - t["DvsCreatedEvent"] = reflect.TypeOf((*DvsCreatedEvent)(nil)).Elem() -} - -type DvsDestroyedEvent struct { - DvsEvent -} - -func init() { - t["DvsDestroyedEvent"] = reflect.TypeOf((*DvsDestroyedEvent)(nil)).Elem() -} - -type DvsDropNetworkRuleAction struct { - DvsNetworkRuleAction -} - -func init() { - t["DvsDropNetworkRuleAction"] = reflect.TypeOf((*DvsDropNetworkRuleAction)(nil)).Elem() -} - -type DvsEvent struct { - Event -} - -func init() { - t["DvsEvent"] = reflect.TypeOf((*DvsEvent)(nil)).Elem() -} - -type DvsEventArgument struct { - EntityEventArgument - - Dvs ManagedObjectReference `xml:"dvs"` -} - -func init() { - t["DvsEventArgument"] = reflect.TypeOf((*DvsEventArgument)(nil)).Elem() -} - -type DvsFault struct { - VimFault -} - -func init() { - t["DvsFault"] = reflect.TypeOf((*DvsFault)(nil)).Elem() -} - -type DvsFaultFault BaseDvsFault - -func init() { - t["DvsFaultFault"] = reflect.TypeOf((*DvsFaultFault)(nil)).Elem() -} - -type DvsFilterConfig struct { - InheritablePolicy - - Key string `xml:"key,omitempty"` - AgentName string `xml:"agentName,omitempty"` - SlotNumber string `xml:"slotNumber,omitempty"` - Parameters *DvsFilterParameter `xml:"parameters,omitempty"` - OnFailure string `xml:"onFailure,omitempty"` -} - -func init() { - t["DvsFilterConfig"] = reflect.TypeOf((*DvsFilterConfig)(nil)).Elem() -} - -type DvsFilterConfigSpec struct { - DvsFilterConfig - - Operation string `xml:"operation"` -} - -func init() { - t["DvsFilterConfigSpec"] = reflect.TypeOf((*DvsFilterConfigSpec)(nil)).Elem() -} - -type DvsFilterParameter struct { - DynamicData - - Parameters []string `xml:"parameters,omitempty"` -} - -func init() { - t["DvsFilterParameter"] = reflect.TypeOf((*DvsFilterParameter)(nil)).Elem() -} - -type DvsFilterPolicy struct { - InheritablePolicy - - FilterConfig []BaseDvsFilterConfig `xml:"filterConfig,omitempty,typeattr"` -} - -func init() { - t["DvsFilterPolicy"] = reflect.TypeOf((*DvsFilterPolicy)(nil)).Elem() -} - -type DvsGreEncapNetworkRuleAction struct { - DvsNetworkRuleAction - - EncapsulationIp SingleIp `xml:"encapsulationIp"` -} - -func init() { - t["DvsGreEncapNetworkRuleAction"] = reflect.TypeOf((*DvsGreEncapNetworkRuleAction)(nil)).Elem() -} - -type DvsHealthStatusChangeEvent struct { - HostEvent - - SwitchUuid string `xml:"switchUuid"` - HealthResult BaseHostMemberHealthCheckResult `xml:"healthResult,omitempty,typeattr"` -} - -func init() { - t["DvsHealthStatusChangeEvent"] = reflect.TypeOf((*DvsHealthStatusChangeEvent)(nil)).Elem() -} - -type DvsHostBackInSyncEvent struct { - DvsEvent - - HostBackInSync HostEventArgument `xml:"hostBackInSync"` -} - -func init() { - t["DvsHostBackInSyncEvent"] = reflect.TypeOf((*DvsHostBackInSyncEvent)(nil)).Elem() -} - -type DvsHostJoinedEvent struct { - DvsEvent - - HostJoined HostEventArgument `xml:"hostJoined"` -} - -func init() { - t["DvsHostJoinedEvent"] = reflect.TypeOf((*DvsHostJoinedEvent)(nil)).Elem() -} - -type DvsHostLeftEvent struct { - DvsEvent - - HostLeft HostEventArgument `xml:"hostLeft"` -} - -func init() { - t["DvsHostLeftEvent"] = reflect.TypeOf((*DvsHostLeftEvent)(nil)).Elem() -} - -type DvsHostStatusUpdated struct { - DvsEvent - - HostMember HostEventArgument `xml:"hostMember"` - OldStatus string `xml:"oldStatus,omitempty"` - NewStatus string `xml:"newStatus,omitempty"` - OldStatusDetail string `xml:"oldStatusDetail,omitempty"` - NewStatusDetail string `xml:"newStatusDetail,omitempty"` -} - -func init() { - t["DvsHostStatusUpdated"] = reflect.TypeOf((*DvsHostStatusUpdated)(nil)).Elem() -} - -type DvsHostVNicProfile struct { - DvsVNicProfile -} - -func init() { - t["DvsHostVNicProfile"] = reflect.TypeOf((*DvsHostVNicProfile)(nil)).Elem() -} - -type DvsHostWentOutOfSyncEvent struct { - DvsEvent - - HostOutOfSync DvsOutOfSyncHostArgument `xml:"hostOutOfSync"` -} - -func init() { - t["DvsHostWentOutOfSyncEvent"] = reflect.TypeOf((*DvsHostWentOutOfSyncEvent)(nil)).Elem() -} - -type DvsImportEvent struct { - DvsEvent - - ImportType string `xml:"importType"` -} - -func init() { - t["DvsImportEvent"] = reflect.TypeOf((*DvsImportEvent)(nil)).Elem() -} - -type DvsIpNetworkRuleQualifier struct { - DvsNetworkRuleQualifier - - SourceAddress BaseIpAddress `xml:"sourceAddress,omitempty,typeattr"` - DestinationAddress BaseIpAddress `xml:"destinationAddress,omitempty,typeattr"` - Protocol *IntExpression `xml:"protocol,omitempty"` - SourceIpPort BaseDvsIpPort `xml:"sourceIpPort,omitempty,typeattr"` - DestinationIpPort BaseDvsIpPort `xml:"destinationIpPort,omitempty,typeattr"` - TcpFlags *IntExpression `xml:"tcpFlags,omitempty"` -} - -func init() { - t["DvsIpNetworkRuleQualifier"] = reflect.TypeOf((*DvsIpNetworkRuleQualifier)(nil)).Elem() -} - -type DvsIpPort struct { - NegatableExpression -} - -func init() { - t["DvsIpPort"] = reflect.TypeOf((*DvsIpPort)(nil)).Elem() -} - -type DvsIpPortRange struct { - DvsIpPort - - StartPortNumber int `xml:"startPortNumber"` - EndPortNumber int `xml:"endPortNumber"` -} - -func init() { - t["DvsIpPortRange"] = reflect.TypeOf((*DvsIpPortRange)(nil)).Elem() -} - -type DvsLogNetworkRuleAction struct { - DvsNetworkRuleAction -} - -func init() { - t["DvsLogNetworkRuleAction"] = reflect.TypeOf((*DvsLogNetworkRuleAction)(nil)).Elem() -} - -type DvsMacNetworkRuleQualifier struct { - DvsNetworkRuleQualifier - - SourceAddress BaseMacAddress `xml:"sourceAddress,omitempty,typeattr"` - DestinationAddress BaseMacAddress `xml:"destinationAddress,omitempty,typeattr"` - Protocol *IntExpression `xml:"protocol,omitempty"` - VlanId *IntExpression `xml:"vlanId,omitempty"` -} - -func init() { - t["DvsMacNetworkRuleQualifier"] = reflect.TypeOf((*DvsMacNetworkRuleQualifier)(nil)).Elem() -} - -type DvsMacRewriteNetworkRuleAction struct { - DvsNetworkRuleAction - - RewriteMac string `xml:"rewriteMac"` -} - -func init() { - t["DvsMacRewriteNetworkRuleAction"] = reflect.TypeOf((*DvsMacRewriteNetworkRuleAction)(nil)).Elem() -} - -type DvsMergedEvent struct { - DvsEvent - - SourceDvs DvsEventArgument `xml:"sourceDvs"` - DestinationDvs DvsEventArgument `xml:"destinationDvs"` -} - -func init() { - t["DvsMergedEvent"] = reflect.TypeOf((*DvsMergedEvent)(nil)).Elem() -} - -type DvsNetworkRuleAction struct { - DynamicData -} - -func init() { - t["DvsNetworkRuleAction"] = reflect.TypeOf((*DvsNetworkRuleAction)(nil)).Elem() -} - -type DvsNetworkRuleQualifier struct { - DynamicData - - Key string `xml:"key,omitempty"` -} - -func init() { - t["DvsNetworkRuleQualifier"] = reflect.TypeOf((*DvsNetworkRuleQualifier)(nil)).Elem() -} - -type DvsNotAuthorized struct { - DvsFault - - SessionExtensionKey string `xml:"sessionExtensionKey,omitempty"` - DvsExtensionKey string `xml:"dvsExtensionKey,omitempty"` -} - -func init() { - t["DvsNotAuthorized"] = reflect.TypeOf((*DvsNotAuthorized)(nil)).Elem() -} - -type DvsNotAuthorizedFault DvsNotAuthorized - -func init() { - t["DvsNotAuthorizedFault"] = reflect.TypeOf((*DvsNotAuthorizedFault)(nil)).Elem() -} - -type DvsOperationBulkFault struct { - DvsFault - - HostFault []DvsOperationBulkFaultFaultOnHost `xml:"hostFault"` -} - -func init() { - t["DvsOperationBulkFault"] = reflect.TypeOf((*DvsOperationBulkFault)(nil)).Elem() -} - -type DvsOperationBulkFaultFault DvsOperationBulkFault - -func init() { - t["DvsOperationBulkFaultFault"] = reflect.TypeOf((*DvsOperationBulkFaultFault)(nil)).Elem() -} - -type DvsOperationBulkFaultFaultOnHost struct { - DynamicData - - Host ManagedObjectReference `xml:"host"` - Fault LocalizedMethodFault `xml:"fault"` -} - -func init() { - t["DvsOperationBulkFaultFaultOnHost"] = reflect.TypeOf((*DvsOperationBulkFaultFaultOnHost)(nil)).Elem() -} - -type DvsOutOfSyncHostArgument struct { - DynamicData - - OutOfSyncHost HostEventArgument `xml:"outOfSyncHost"` - ConfigParamters []string `xml:"configParamters"` -} - -func init() { - t["DvsOutOfSyncHostArgument"] = reflect.TypeOf((*DvsOutOfSyncHostArgument)(nil)).Elem() -} - -type DvsPortBlockedEvent struct { - DvsEvent - - PortKey string `xml:"portKey"` - StatusDetail string `xml:"statusDetail,omitempty"` - RuntimeInfo *DVPortStatus `xml:"runtimeInfo,omitempty"` -} - -func init() { - t["DvsPortBlockedEvent"] = reflect.TypeOf((*DvsPortBlockedEvent)(nil)).Elem() -} - -type DvsPortConnectedEvent struct { - DvsEvent - - PortKey string `xml:"portKey"` - Connectee *DistributedVirtualSwitchPortConnectee `xml:"connectee,omitempty"` -} - -func init() { - t["DvsPortConnectedEvent"] = reflect.TypeOf((*DvsPortConnectedEvent)(nil)).Elem() -} - -type DvsPortCreatedEvent struct { - DvsEvent - - PortKey []string `xml:"portKey"` -} - -func init() { - t["DvsPortCreatedEvent"] = reflect.TypeOf((*DvsPortCreatedEvent)(nil)).Elem() -} - -type DvsPortDeletedEvent struct { - DvsEvent - - PortKey []string `xml:"portKey"` -} - -func init() { - t["DvsPortDeletedEvent"] = reflect.TypeOf((*DvsPortDeletedEvent)(nil)).Elem() -} - -type DvsPortDisconnectedEvent struct { - DvsEvent - - PortKey string `xml:"portKey"` - Connectee *DistributedVirtualSwitchPortConnectee `xml:"connectee,omitempty"` -} - -func init() { - t["DvsPortDisconnectedEvent"] = reflect.TypeOf((*DvsPortDisconnectedEvent)(nil)).Elem() -} - -type DvsPortEnteredPassthruEvent struct { - DvsEvent - - PortKey string `xml:"portKey"` - RuntimeInfo *DVPortStatus `xml:"runtimeInfo,omitempty"` -} - -func init() { - t["DvsPortEnteredPassthruEvent"] = reflect.TypeOf((*DvsPortEnteredPassthruEvent)(nil)).Elem() -} - -type DvsPortExitedPassthruEvent struct { - DvsEvent - - PortKey string `xml:"portKey"` - RuntimeInfo *DVPortStatus `xml:"runtimeInfo,omitempty"` -} - -func init() { - t["DvsPortExitedPassthruEvent"] = reflect.TypeOf((*DvsPortExitedPassthruEvent)(nil)).Elem() -} - -type DvsPortJoinPortgroupEvent struct { - DvsEvent - - PortKey string `xml:"portKey"` - PortgroupKey string `xml:"portgroupKey"` - PortgroupName string `xml:"portgroupName"` -} - -func init() { - t["DvsPortJoinPortgroupEvent"] = reflect.TypeOf((*DvsPortJoinPortgroupEvent)(nil)).Elem() -} - -type DvsPortLeavePortgroupEvent struct { - DvsEvent - - PortKey string `xml:"portKey"` - PortgroupKey string `xml:"portgroupKey"` - PortgroupName string `xml:"portgroupName"` -} - -func init() { - t["DvsPortLeavePortgroupEvent"] = reflect.TypeOf((*DvsPortLeavePortgroupEvent)(nil)).Elem() -} - -type DvsPortLinkDownEvent struct { - DvsEvent - - PortKey string `xml:"portKey"` - RuntimeInfo *DVPortStatus `xml:"runtimeInfo,omitempty"` -} - -func init() { - t["DvsPortLinkDownEvent"] = reflect.TypeOf((*DvsPortLinkDownEvent)(nil)).Elem() -} - -type DvsPortLinkUpEvent struct { - DvsEvent - - PortKey string `xml:"portKey"` - RuntimeInfo *DVPortStatus `xml:"runtimeInfo,omitempty"` -} - -func init() { - t["DvsPortLinkUpEvent"] = reflect.TypeOf((*DvsPortLinkUpEvent)(nil)).Elem() -} - -type DvsPortReconfiguredEvent struct { - DvsEvent - - PortKey []string `xml:"portKey"` -} - -func init() { - t["DvsPortReconfiguredEvent"] = reflect.TypeOf((*DvsPortReconfiguredEvent)(nil)).Elem() -} - -type DvsPortRuntimeChangeEvent struct { - DvsEvent - - PortKey string `xml:"portKey"` - RuntimeInfo DVPortStatus `xml:"runtimeInfo"` -} - -func init() { - t["DvsPortRuntimeChangeEvent"] = reflect.TypeOf((*DvsPortRuntimeChangeEvent)(nil)).Elem() -} - -type DvsPortUnblockedEvent struct { - DvsEvent - - PortKey string `xml:"portKey"` - RuntimeInfo *DVPortStatus `xml:"runtimeInfo,omitempty"` -} - -func init() { - t["DvsPortUnblockedEvent"] = reflect.TypeOf((*DvsPortUnblockedEvent)(nil)).Elem() -} - -type DvsPortVendorSpecificStateChangeEvent struct { - DvsEvent - - PortKey string `xml:"portKey"` -} - -func init() { - t["DvsPortVendorSpecificStateChangeEvent"] = reflect.TypeOf((*DvsPortVendorSpecificStateChangeEvent)(nil)).Elem() -} - -type DvsProfile struct { - ApplyProfile - - Key string `xml:"key"` - Name string `xml:"name"` - Uplink []PnicUplinkProfile `xml:"uplink,omitempty"` -} - -func init() { - t["DvsProfile"] = reflect.TypeOf((*DvsProfile)(nil)).Elem() -} - -type DvsPuntNetworkRuleAction struct { - DvsNetworkRuleAction -} - -func init() { - t["DvsPuntNetworkRuleAction"] = reflect.TypeOf((*DvsPuntNetworkRuleAction)(nil)).Elem() -} - -type DvsRateLimitNetworkRuleAction struct { - DvsNetworkRuleAction - - PacketsPerSecond int `xml:"packetsPerSecond"` -} - -func init() { - t["DvsRateLimitNetworkRuleAction"] = reflect.TypeOf((*DvsRateLimitNetworkRuleAction)(nil)).Elem() -} - -type DvsReconfiguredEvent struct { - DvsEvent - - ConfigSpec BaseDVSConfigSpec `xml:"configSpec,typeattr"` -} - -func init() { - t["DvsReconfiguredEvent"] = reflect.TypeOf((*DvsReconfiguredEvent)(nil)).Elem() -} - -type DvsRenamedEvent struct { - DvsEvent - - OldName string `xml:"oldName"` - NewName string `xml:"newName"` -} - -func init() { - t["DvsRenamedEvent"] = reflect.TypeOf((*DvsRenamedEvent)(nil)).Elem() -} - -type DvsRestoreEvent struct { - DvsEvent -} - -func init() { - t["DvsRestoreEvent"] = reflect.TypeOf((*DvsRestoreEvent)(nil)).Elem() -} - -type DvsScopeViolated struct { - DvsFault - - Scope []ManagedObjectReference `xml:"scope"` - Entity ManagedObjectReference `xml:"entity"` -} - -func init() { - t["DvsScopeViolated"] = reflect.TypeOf((*DvsScopeViolated)(nil)).Elem() -} - -type DvsScopeViolatedFault DvsScopeViolated - -func init() { - t["DvsScopeViolatedFault"] = reflect.TypeOf((*DvsScopeViolatedFault)(nil)).Elem() -} - -type DvsServiceConsoleVNicProfile struct { - DvsVNicProfile -} - -func init() { - t["DvsServiceConsoleVNicProfile"] = reflect.TypeOf((*DvsServiceConsoleVNicProfile)(nil)).Elem() -} - -type DvsSingleIpPort struct { - DvsIpPort - - PortNumber int `xml:"portNumber"` -} - -func init() { - t["DvsSingleIpPort"] = reflect.TypeOf((*DvsSingleIpPort)(nil)).Elem() -} - -type DvsSystemTrafficNetworkRuleQualifier struct { - DvsNetworkRuleQualifier - - TypeOfSystemTraffic *StringExpression `xml:"typeOfSystemTraffic,omitempty"` -} - -func init() { - t["DvsSystemTrafficNetworkRuleQualifier"] = reflect.TypeOf((*DvsSystemTrafficNetworkRuleQualifier)(nil)).Elem() -} - -type DvsTrafficFilterConfig struct { - DvsFilterConfig - - TrafficRuleset *DvsTrafficRuleset `xml:"trafficRuleset,omitempty"` -} - -func init() { - t["DvsTrafficFilterConfig"] = reflect.TypeOf((*DvsTrafficFilterConfig)(nil)).Elem() -} - -type DvsTrafficFilterConfigSpec struct { - DvsTrafficFilterConfig - - Operation string `xml:"operation"` -} - -func init() { - t["DvsTrafficFilterConfigSpec"] = reflect.TypeOf((*DvsTrafficFilterConfigSpec)(nil)).Elem() -} - -type DvsTrafficRule struct { - DynamicData - - Key string `xml:"key,omitempty"` - Description string `xml:"description,omitempty"` - Sequence int `xml:"sequence,omitempty"` - Qualifier []BaseDvsNetworkRuleQualifier `xml:"qualifier,omitempty,typeattr"` - Action BaseDvsNetworkRuleAction `xml:"action,omitempty,typeattr"` - Direction string `xml:"direction,omitempty"` -} - -func init() { - t["DvsTrafficRule"] = reflect.TypeOf((*DvsTrafficRule)(nil)).Elem() -} - -type DvsTrafficRuleset struct { - DynamicData - - Key string `xml:"key,omitempty"` - Enabled *bool `xml:"enabled"` - Precedence int `xml:"precedence,omitempty"` - Rules []DvsTrafficRule `xml:"rules,omitempty"` -} - -func init() { - t["DvsTrafficRuleset"] = reflect.TypeOf((*DvsTrafficRuleset)(nil)).Elem() -} - -type DvsUpdateTagNetworkRuleAction struct { - DvsNetworkRuleAction - - QosTag int `xml:"qosTag,omitempty"` - DscpTag int `xml:"dscpTag,omitempty"` -} - -func init() { - t["DvsUpdateTagNetworkRuleAction"] = reflect.TypeOf((*DvsUpdateTagNetworkRuleAction)(nil)).Elem() -} - -type DvsUpgradeAvailableEvent struct { - DvsEvent - - ProductInfo DistributedVirtualSwitchProductSpec `xml:"productInfo"` -} - -func init() { - t["DvsUpgradeAvailableEvent"] = reflect.TypeOf((*DvsUpgradeAvailableEvent)(nil)).Elem() -} - -type DvsUpgradeInProgressEvent struct { - DvsEvent - - ProductInfo DistributedVirtualSwitchProductSpec `xml:"productInfo"` -} - -func init() { - t["DvsUpgradeInProgressEvent"] = reflect.TypeOf((*DvsUpgradeInProgressEvent)(nil)).Elem() -} - -type DvsUpgradeRejectedEvent struct { - DvsEvent - - ProductInfo DistributedVirtualSwitchProductSpec `xml:"productInfo"` -} - -func init() { - t["DvsUpgradeRejectedEvent"] = reflect.TypeOf((*DvsUpgradeRejectedEvent)(nil)).Elem() -} - -type DvsUpgradedEvent struct { - DvsEvent - - ProductInfo DistributedVirtualSwitchProductSpec `xml:"productInfo"` -} - -func init() { - t["DvsUpgradedEvent"] = reflect.TypeOf((*DvsUpgradedEvent)(nil)).Elem() -} - -type DvsVNicProfile struct { - ApplyProfile - - Key string `xml:"key"` - IpConfig IpAddressProfile `xml:"ipConfig"` -} - -func init() { - t["DvsVNicProfile"] = reflect.TypeOf((*DvsVNicProfile)(nil)).Elem() -} - -type DynamicArray struct { - DynamicType string `xml:"dynamicType,omitempty"` - Val []AnyType `xml:"val,typeattr"` -} - -func init() { - t["DynamicArray"] = reflect.TypeOf((*DynamicArray)(nil)).Elem() -} - -type DynamicData struct { - DynamicType string `xml:"dynamicType,omitempty"` - DynamicProperty []DynamicProperty `xml:"dynamicProperty,omitempty"` -} - -func init() { - t["DynamicData"] = reflect.TypeOf((*DynamicData)(nil)).Elem() -} - -type DynamicProperty struct { - Name string `xml:"name"` - Val AnyType `xml:"val,typeattr"` -} - -func init() { - t["DynamicProperty"] = reflect.TypeOf((*DynamicProperty)(nil)).Elem() -} - -type EVCAdmissionFailed struct { - NotSupportedHostInCluster - - Faults []LocalizedMethodFault `xml:"faults,omitempty"` -} - -func init() { - t["EVCAdmissionFailed"] = reflect.TypeOf((*EVCAdmissionFailed)(nil)).Elem() -} - -type EVCAdmissionFailedCPUFeaturesForMode struct { - EVCAdmissionFailed - - CurrentEVCModeKey string `xml:"currentEVCModeKey"` -} - -func init() { - t["EVCAdmissionFailedCPUFeaturesForMode"] = reflect.TypeOf((*EVCAdmissionFailedCPUFeaturesForMode)(nil)).Elem() -} - -type EVCAdmissionFailedCPUFeaturesForModeFault EVCAdmissionFailedCPUFeaturesForMode - -func init() { - t["EVCAdmissionFailedCPUFeaturesForModeFault"] = reflect.TypeOf((*EVCAdmissionFailedCPUFeaturesForModeFault)(nil)).Elem() -} - -type EVCAdmissionFailedCPUModel struct { - EVCAdmissionFailed -} - -func init() { - t["EVCAdmissionFailedCPUModel"] = reflect.TypeOf((*EVCAdmissionFailedCPUModel)(nil)).Elem() -} - -type EVCAdmissionFailedCPUModelFault EVCAdmissionFailedCPUModel - -func init() { - t["EVCAdmissionFailedCPUModelFault"] = reflect.TypeOf((*EVCAdmissionFailedCPUModelFault)(nil)).Elem() -} - -type EVCAdmissionFailedCPUModelForMode struct { - EVCAdmissionFailed - - CurrentEVCModeKey string `xml:"currentEVCModeKey"` -} - -func init() { - t["EVCAdmissionFailedCPUModelForMode"] = reflect.TypeOf((*EVCAdmissionFailedCPUModelForMode)(nil)).Elem() -} - -type EVCAdmissionFailedCPUModelForModeFault EVCAdmissionFailedCPUModelForMode - -func init() { - t["EVCAdmissionFailedCPUModelForModeFault"] = reflect.TypeOf((*EVCAdmissionFailedCPUModelForModeFault)(nil)).Elem() -} - -type EVCAdmissionFailedCPUVendor struct { - EVCAdmissionFailed - - ClusterCPUVendor string `xml:"clusterCPUVendor"` - HostCPUVendor string `xml:"hostCPUVendor"` -} - -func init() { - t["EVCAdmissionFailedCPUVendor"] = reflect.TypeOf((*EVCAdmissionFailedCPUVendor)(nil)).Elem() -} - -type EVCAdmissionFailedCPUVendorFault EVCAdmissionFailedCPUVendor - -func init() { - t["EVCAdmissionFailedCPUVendorFault"] = reflect.TypeOf((*EVCAdmissionFailedCPUVendorFault)(nil)).Elem() -} - -type EVCAdmissionFailedCPUVendorUnknown struct { - EVCAdmissionFailed -} - -func init() { - t["EVCAdmissionFailedCPUVendorUnknown"] = reflect.TypeOf((*EVCAdmissionFailedCPUVendorUnknown)(nil)).Elem() -} - -type EVCAdmissionFailedCPUVendorUnknownFault EVCAdmissionFailedCPUVendorUnknown - -func init() { - t["EVCAdmissionFailedCPUVendorUnknownFault"] = reflect.TypeOf((*EVCAdmissionFailedCPUVendorUnknownFault)(nil)).Elem() -} - -type EVCAdmissionFailedFault BaseEVCAdmissionFailed - -func init() { - t["EVCAdmissionFailedFault"] = reflect.TypeOf((*EVCAdmissionFailedFault)(nil)).Elem() -} - -type EVCAdmissionFailedHostDisconnected struct { - EVCAdmissionFailed -} - -func init() { - t["EVCAdmissionFailedHostDisconnected"] = reflect.TypeOf((*EVCAdmissionFailedHostDisconnected)(nil)).Elem() -} - -type EVCAdmissionFailedHostDisconnectedFault EVCAdmissionFailedHostDisconnected - -func init() { - t["EVCAdmissionFailedHostDisconnectedFault"] = reflect.TypeOf((*EVCAdmissionFailedHostDisconnectedFault)(nil)).Elem() -} - -type EVCAdmissionFailedHostSoftware struct { - EVCAdmissionFailed -} - -func init() { - t["EVCAdmissionFailedHostSoftware"] = reflect.TypeOf((*EVCAdmissionFailedHostSoftware)(nil)).Elem() -} - -type EVCAdmissionFailedHostSoftwareFault EVCAdmissionFailedHostSoftware - -func init() { - t["EVCAdmissionFailedHostSoftwareFault"] = reflect.TypeOf((*EVCAdmissionFailedHostSoftwareFault)(nil)).Elem() -} - -type EVCAdmissionFailedHostSoftwareForMode struct { - EVCAdmissionFailed -} - -func init() { - t["EVCAdmissionFailedHostSoftwareForMode"] = reflect.TypeOf((*EVCAdmissionFailedHostSoftwareForMode)(nil)).Elem() -} - -type EVCAdmissionFailedHostSoftwareForModeFault EVCAdmissionFailedHostSoftwareForMode - -func init() { - t["EVCAdmissionFailedHostSoftwareForModeFault"] = reflect.TypeOf((*EVCAdmissionFailedHostSoftwareForModeFault)(nil)).Elem() -} - -type EVCAdmissionFailedVmActive struct { - EVCAdmissionFailed -} - -func init() { - t["EVCAdmissionFailedVmActive"] = reflect.TypeOf((*EVCAdmissionFailedVmActive)(nil)).Elem() -} - -type EVCAdmissionFailedVmActiveFault EVCAdmissionFailedVmActive - -func init() { - t["EVCAdmissionFailedVmActiveFault"] = reflect.TypeOf((*EVCAdmissionFailedVmActiveFault)(nil)).Elem() -} - -type EVCMode struct { - ElementDescription - - GuaranteedCPUFeatures []HostCpuIdInfo `xml:"guaranteedCPUFeatures,omitempty"` - FeatureCapability []HostFeatureCapability `xml:"featureCapability,omitempty"` - FeatureMask []HostFeatureMask `xml:"featureMask,omitempty"` - FeatureRequirement []VirtualMachineFeatureRequirement `xml:"featureRequirement,omitempty"` - Vendor string `xml:"vendor"` - Track []string `xml:"track,omitempty"` - VendorTier int `xml:"vendorTier"` -} - -func init() { - t["EVCMode"] = reflect.TypeOf((*EVCMode)(nil)).Elem() -} - -type EagerZeroVirtualDiskRequestType struct { - This ManagedObjectReference `xml:"_this"` - Name string `xml:"name"` - Datacenter *ManagedObjectReference `xml:"datacenter,omitempty"` -} - -func init() { - t["EagerZeroVirtualDiskRequestType"] = reflect.TypeOf((*EagerZeroVirtualDiskRequestType)(nil)).Elem() -} - -type EagerZeroVirtualDisk_Task EagerZeroVirtualDiskRequestType - -func init() { - t["EagerZeroVirtualDisk_Task"] = reflect.TypeOf((*EagerZeroVirtualDisk_Task)(nil)).Elem() -} - -type EagerZeroVirtualDisk_TaskResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type EightHostLimitViolated struct { - VmConfigFault -} - -func init() { - t["EightHostLimitViolated"] = reflect.TypeOf((*EightHostLimitViolated)(nil)).Elem() -} - -type EightHostLimitViolatedFault EightHostLimitViolated - -func init() { - t["EightHostLimitViolatedFault"] = reflect.TypeOf((*EightHostLimitViolatedFault)(nil)).Elem() -} - -type ElementDescription struct { - Description - - Key string `xml:"key"` -} - -func init() { - t["ElementDescription"] = reflect.TypeOf((*ElementDescription)(nil)).Elem() -} - -type EnableAlarmActions EnableAlarmActionsRequestType - -func init() { - t["EnableAlarmActions"] = reflect.TypeOf((*EnableAlarmActions)(nil)).Elem() -} - -type EnableAlarmActionsRequestType struct { - This ManagedObjectReference `xml:"_this"` - Entity ManagedObjectReference `xml:"entity"` - Enabled bool `xml:"enabled"` -} - -func init() { - t["EnableAlarmActionsRequestType"] = reflect.TypeOf((*EnableAlarmActionsRequestType)(nil)).Elem() -} - -type EnableAlarmActionsResponse struct { -} - -type EnableFeature EnableFeatureRequestType - -func init() { - t["EnableFeature"] = reflect.TypeOf((*EnableFeature)(nil)).Elem() -} - -type EnableFeatureRequestType struct { - This ManagedObjectReference `xml:"_this"` - Host *ManagedObjectReference `xml:"host,omitempty"` - FeatureKey string `xml:"featureKey"` -} - -func init() { - t["EnableFeatureRequestType"] = reflect.TypeOf((*EnableFeatureRequestType)(nil)).Elem() -} - -type EnableFeatureResponse struct { - Returnval bool `xml:"returnval"` -} - -type EnableHyperThreading EnableHyperThreadingRequestType - -func init() { - t["EnableHyperThreading"] = reflect.TypeOf((*EnableHyperThreading)(nil)).Elem() -} - -type EnableHyperThreadingRequestType struct { - This ManagedObjectReference `xml:"_this"` -} - -func init() { - t["EnableHyperThreadingRequestType"] = reflect.TypeOf((*EnableHyperThreadingRequestType)(nil)).Elem() -} - -type EnableHyperThreadingResponse struct { -} - -type EnableMultipathPath EnableMultipathPathRequestType - -func init() { - t["EnableMultipathPath"] = reflect.TypeOf((*EnableMultipathPath)(nil)).Elem() -} - -type EnableMultipathPathRequestType struct { - This ManagedObjectReference `xml:"_this"` - PathName string `xml:"pathName"` -} - -func init() { - t["EnableMultipathPathRequestType"] = reflect.TypeOf((*EnableMultipathPathRequestType)(nil)).Elem() -} - -type EnableMultipathPathResponse struct { -} - -type EnableNetworkResourceManagement EnableNetworkResourceManagementRequestType - -func init() { - t["EnableNetworkResourceManagement"] = reflect.TypeOf((*EnableNetworkResourceManagement)(nil)).Elem() -} - -type EnableNetworkResourceManagementRequestType struct { - This ManagedObjectReference `xml:"_this"` - Enable bool `xml:"enable"` -} - -func init() { - t["EnableNetworkResourceManagementRequestType"] = reflect.TypeOf((*EnableNetworkResourceManagementRequestType)(nil)).Elem() -} - -type EnableNetworkResourceManagementResponse struct { -} - -type EnableRuleset EnableRulesetRequestType - -func init() { - t["EnableRuleset"] = reflect.TypeOf((*EnableRuleset)(nil)).Elem() -} - -type EnableRulesetRequestType struct { - This ManagedObjectReference `xml:"_this"` - Id string `xml:"id"` -} - -func init() { - t["EnableRulesetRequestType"] = reflect.TypeOf((*EnableRulesetRequestType)(nil)).Elem() -} - -type EnableRulesetResponse struct { -} - -type EnableSecondaryVMRequestType struct { - This ManagedObjectReference `xml:"_this"` - Vm ManagedObjectReference `xml:"vm"` - Host *ManagedObjectReference `xml:"host,omitempty"` -} - -func init() { - t["EnableSecondaryVMRequestType"] = reflect.TypeOf((*EnableSecondaryVMRequestType)(nil)).Elem() -} - -type EnableSecondaryVM_Task EnableSecondaryVMRequestType - -func init() { - t["EnableSecondaryVM_Task"] = reflect.TypeOf((*EnableSecondaryVM_Task)(nil)).Elem() -} - -type EnableSecondaryVM_TaskResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type EnterLockdownMode EnterLockdownModeRequestType - -func init() { - t["EnterLockdownMode"] = reflect.TypeOf((*EnterLockdownMode)(nil)).Elem() -} - -type EnterLockdownModeRequestType struct { - This ManagedObjectReference `xml:"_this"` -} - -func init() { - t["EnterLockdownModeRequestType"] = reflect.TypeOf((*EnterLockdownModeRequestType)(nil)).Elem() -} - -type EnterLockdownModeResponse struct { -} - -type EnterMaintenanceModeRequestType struct { - This ManagedObjectReference `xml:"_this"` - Timeout int `xml:"timeout"` - EvacuatePoweredOffVms *bool `xml:"evacuatePoweredOffVms"` - MaintenanceSpec *HostMaintenanceSpec `xml:"maintenanceSpec,omitempty"` -} - -func init() { - t["EnterMaintenanceModeRequestType"] = reflect.TypeOf((*EnterMaintenanceModeRequestType)(nil)).Elem() -} - -type EnterMaintenanceMode_Task EnterMaintenanceModeRequestType - -func init() { - t["EnterMaintenanceMode_Task"] = reflect.TypeOf((*EnterMaintenanceMode_Task)(nil)).Elem() -} - -type EnterMaintenanceMode_TaskResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type EnteredMaintenanceModeEvent struct { - HostEvent -} - -func init() { - t["EnteredMaintenanceModeEvent"] = reflect.TypeOf((*EnteredMaintenanceModeEvent)(nil)).Elem() -} - -type EnteredStandbyModeEvent struct { - HostEvent -} - -func init() { - t["EnteredStandbyModeEvent"] = reflect.TypeOf((*EnteredStandbyModeEvent)(nil)).Elem() -} - -type EnteringMaintenanceModeEvent struct { - HostEvent -} - -func init() { - t["EnteringMaintenanceModeEvent"] = reflect.TypeOf((*EnteringMaintenanceModeEvent)(nil)).Elem() -} - -type EnteringStandbyModeEvent struct { - HostEvent -} - -func init() { - t["EnteringStandbyModeEvent"] = reflect.TypeOf((*EnteringStandbyModeEvent)(nil)).Elem() -} - -type EntityBackup struct { - DynamicData -} - -func init() { - t["EntityBackup"] = reflect.TypeOf((*EntityBackup)(nil)).Elem() -} - -type EntityBackupConfig struct { - DynamicData - - EntityType string `xml:"entityType"` - ConfigBlob []byte `xml:"configBlob"` - Key string `xml:"key,omitempty"` - Name string `xml:"name,omitempty"` - Container *ManagedObjectReference `xml:"container,omitempty"` - ConfigVersion string `xml:"configVersion,omitempty"` -} - -func init() { - t["EntityBackupConfig"] = reflect.TypeOf((*EntityBackupConfig)(nil)).Elem() -} - -type EntityEventArgument struct { - EventArgument - - Name string `xml:"name"` -} - -func init() { - t["EntityEventArgument"] = reflect.TypeOf((*EntityEventArgument)(nil)).Elem() -} - -type EntityPrivilege struct { - DynamicData - - Entity ManagedObjectReference `xml:"entity"` - PrivAvailability []PrivilegeAvailability `xml:"privAvailability"` -} - -func init() { - t["EntityPrivilege"] = reflect.TypeOf((*EntityPrivilege)(nil)).Elem() -} - -type EnumDescription struct { - DynamicData - - Key string `xml:"key"` - Tags []BaseElementDescription `xml:"tags,typeattr"` -} - -func init() { - t["EnumDescription"] = reflect.TypeOf((*EnumDescription)(nil)).Elem() -} - -type ErrorUpgradeEvent struct { - UpgradeEvent -} - -func init() { - t["ErrorUpgradeEvent"] = reflect.TypeOf((*ErrorUpgradeEvent)(nil)).Elem() -} - -type EstimateDatabaseSize EstimateDatabaseSizeRequestType - -func init() { - t["EstimateDatabaseSize"] = reflect.TypeOf((*EstimateDatabaseSize)(nil)).Elem() -} - -type EstimateDatabaseSizeRequestType struct { - This ManagedObjectReference `xml:"_this"` - DbSizeParam DatabaseSizeParam `xml:"dbSizeParam"` -} - -func init() { - t["EstimateDatabaseSizeRequestType"] = reflect.TypeOf((*EstimateDatabaseSizeRequestType)(nil)).Elem() -} - -type EstimateDatabaseSizeResponse struct { - Returnval DatabaseSizeEstimate `xml:"returnval"` -} - -type EstimateStorageForConsolidateSnapshotsRequestType struct { - This ManagedObjectReference `xml:"_this"` -} - -func init() { - t["EstimateStorageForConsolidateSnapshotsRequestType"] = reflect.TypeOf((*EstimateStorageForConsolidateSnapshotsRequestType)(nil)).Elem() -} - -type EstimateStorageForConsolidateSnapshots_Task EstimateStorageForConsolidateSnapshotsRequestType - -func init() { - t["EstimateStorageForConsolidateSnapshots_Task"] = reflect.TypeOf((*EstimateStorageForConsolidateSnapshots_Task)(nil)).Elem() -} - -type EstimateStorageForConsolidateSnapshots_TaskResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type EsxAgentHostManagerUpdateConfig EsxAgentHostManagerUpdateConfigRequestType - -func init() { - t["EsxAgentHostManagerUpdateConfig"] = reflect.TypeOf((*EsxAgentHostManagerUpdateConfig)(nil)).Elem() -} - -type EsxAgentHostManagerUpdateConfigRequestType struct { - This ManagedObjectReference `xml:"_this"` - ConfigInfo HostEsxAgentHostManagerConfigInfo `xml:"configInfo"` -} - -func init() { - t["EsxAgentHostManagerUpdateConfigRequestType"] = reflect.TypeOf((*EsxAgentHostManagerUpdateConfigRequestType)(nil)).Elem() -} - -type EsxAgentHostManagerUpdateConfigResponse struct { -} - -type EvaluationLicenseSource struct { - LicenseSource - - RemainingHours int64 `xml:"remainingHours,omitempty"` -} - -func init() { - t["EvaluationLicenseSource"] = reflect.TypeOf((*EvaluationLicenseSource)(nil)).Elem() -} - -type Event struct { - DynamicData - - Key int `xml:"key"` - ChainId int `xml:"chainId"` - CreatedTime time.Time `xml:"createdTime"` - UserName string `xml:"userName"` - Datacenter *DatacenterEventArgument `xml:"datacenter,omitempty"` - ComputeResource *ComputeResourceEventArgument `xml:"computeResource,omitempty"` - Host *HostEventArgument `xml:"host,omitempty"` - Vm *VmEventArgument `xml:"vm,omitempty"` - Ds *DatastoreEventArgument `xml:"ds,omitempty"` - Net *NetworkEventArgument `xml:"net,omitempty"` - Dvs *DvsEventArgument `xml:"dvs,omitempty"` - FullFormattedMessage string `xml:"fullFormattedMessage,omitempty"` - ChangeTag string `xml:"changeTag,omitempty"` -} - -func init() { - t["Event"] = reflect.TypeOf((*Event)(nil)).Elem() -} - -type EventAlarmExpression struct { - AlarmExpression - - Comparisons []EventAlarmExpressionComparison `xml:"comparisons,omitempty"` - EventType string `xml:"eventType"` - EventTypeId string `xml:"eventTypeId,omitempty"` - ObjectType string `xml:"objectType,omitempty"` - Status ManagedEntityStatus `xml:"status,omitempty"` -} - -func init() { - t["EventAlarmExpression"] = reflect.TypeOf((*EventAlarmExpression)(nil)).Elem() -} - -type EventAlarmExpressionComparison struct { - DynamicData - - AttributeName string `xml:"attributeName"` - Operator string `xml:"operator"` - Value string `xml:"value"` -} - -func init() { - t["EventAlarmExpressionComparison"] = reflect.TypeOf((*EventAlarmExpressionComparison)(nil)).Elem() -} - -type EventArgDesc struct { - DynamicData - - Name string `xml:"name"` - Type string `xml:"type"` - Description BaseElementDescription `xml:"description,omitempty,typeattr"` -} - -func init() { - t["EventArgDesc"] = reflect.TypeOf((*EventArgDesc)(nil)).Elem() -} - -type EventArgument struct { - DynamicData -} - -func init() { - t["EventArgument"] = reflect.TypeOf((*EventArgument)(nil)).Elem() -} - -type EventDescription struct { - DynamicData - - Category []BaseElementDescription `xml:"category,typeattr"` - EventInfo []EventDescriptionEventDetail `xml:"eventInfo"` - EnumeratedTypes []EnumDescription `xml:"enumeratedTypes,omitempty"` -} - -func init() { - t["EventDescription"] = reflect.TypeOf((*EventDescription)(nil)).Elem() -} - -type EventDescriptionEventDetail struct { - DynamicData - - Key string `xml:"key"` - Description string `xml:"description,omitempty"` - Category string `xml:"category"` - FormatOnDatacenter string `xml:"formatOnDatacenter"` - FormatOnComputeResource string `xml:"formatOnComputeResource"` - FormatOnHost string `xml:"formatOnHost"` - FormatOnVm string `xml:"formatOnVm"` - FullFormat string `xml:"fullFormat"` - LongDescription string `xml:"longDescription,omitempty"` -} - -func init() { - t["EventDescriptionEventDetail"] = reflect.TypeOf((*EventDescriptionEventDetail)(nil)).Elem() -} - -type EventEx struct { - Event - - EventTypeId string `xml:"eventTypeId"` - Severity string `xml:"severity,omitempty"` - Message string `xml:"message,omitempty"` - Arguments []KeyAnyValue `xml:"arguments,omitempty"` - ObjectId string `xml:"objectId,omitempty"` - ObjectType string `xml:"objectType,omitempty"` - ObjectName string `xml:"objectName,omitempty"` - Fault *LocalizedMethodFault `xml:"fault,omitempty"` -} - -func init() { - t["EventEx"] = reflect.TypeOf((*EventEx)(nil)).Elem() -} - -type EventFilterSpec struct { - DynamicData - - Entity *EventFilterSpecByEntity `xml:"entity,omitempty"` - Time *EventFilterSpecByTime `xml:"time,omitempty"` - UserName *EventFilterSpecByUsername `xml:"userName,omitempty"` - EventChainId int `xml:"eventChainId,omitempty"` - Alarm *ManagedObjectReference `xml:"alarm,omitempty"` - ScheduledTask *ManagedObjectReference `xml:"scheduledTask,omitempty"` - DisableFullMessage *bool `xml:"disableFullMessage"` - Category []string `xml:"category,omitempty"` - Type []string `xml:"type,omitempty"` - Tag []string `xml:"tag,omitempty"` - EventTypeId []string `xml:"eventTypeId,omitempty"` -} - -func init() { - t["EventFilterSpec"] = reflect.TypeOf((*EventFilterSpec)(nil)).Elem() -} - -type EventFilterSpecByEntity struct { - DynamicData - - Entity ManagedObjectReference `xml:"entity"` - Recursion EventFilterSpecRecursionOption `xml:"recursion"` -} - -func init() { - t["EventFilterSpecByEntity"] = reflect.TypeOf((*EventFilterSpecByEntity)(nil)).Elem() -} - -type EventFilterSpecByTime struct { - DynamicData - - BeginTime *time.Time `xml:"beginTime"` - EndTime *time.Time `xml:"endTime"` -} - -func init() { - t["EventFilterSpecByTime"] = reflect.TypeOf((*EventFilterSpecByTime)(nil)).Elem() -} - -type EventFilterSpecByUsername struct { - DynamicData - - SystemUser bool `xml:"systemUser"` - UserList []string `xml:"userList,omitempty"` -} - -func init() { - t["EventFilterSpecByUsername"] = reflect.TypeOf((*EventFilterSpecByUsername)(nil)).Elem() -} - -type ExecuteHostProfile ExecuteHostProfileRequestType - -func init() { - t["ExecuteHostProfile"] = reflect.TypeOf((*ExecuteHostProfile)(nil)).Elem() -} - -type ExecuteHostProfileRequestType struct { - This ManagedObjectReference `xml:"_this"` - Host ManagedObjectReference `xml:"host"` - DeferredParam []ProfileDeferredPolicyOptionParameter `xml:"deferredParam,omitempty"` -} - -func init() { - t["ExecuteHostProfileRequestType"] = reflect.TypeOf((*ExecuteHostProfileRequestType)(nil)).Elem() -} - -type ExecuteHostProfileResponse struct { - Returnval ProfileExecuteResult `xml:"returnval"` -} - -type ExecuteSimpleCommand ExecuteSimpleCommandRequestType - -func init() { - t["ExecuteSimpleCommand"] = reflect.TypeOf((*ExecuteSimpleCommand)(nil)).Elem() -} - -type ExecuteSimpleCommandRequestType struct { - This ManagedObjectReference `xml:"_this"` - Arguments []string `xml:"arguments,omitempty"` -} - -func init() { - t["ExecuteSimpleCommandRequestType"] = reflect.TypeOf((*ExecuteSimpleCommandRequestType)(nil)).Elem() -} - -type ExecuteSimpleCommandResponse struct { - Returnval string `xml:"returnval"` -} - -type ExitLockdownMode ExitLockdownModeRequestType - -func init() { - t["ExitLockdownMode"] = reflect.TypeOf((*ExitLockdownMode)(nil)).Elem() -} - -type ExitLockdownModeRequestType struct { - This ManagedObjectReference `xml:"_this"` -} - -func init() { - t["ExitLockdownModeRequestType"] = reflect.TypeOf((*ExitLockdownModeRequestType)(nil)).Elem() -} - -type ExitLockdownModeResponse struct { -} - -type ExitMaintenanceModeEvent struct { - HostEvent -} - -func init() { - t["ExitMaintenanceModeEvent"] = reflect.TypeOf((*ExitMaintenanceModeEvent)(nil)).Elem() -} - -type ExitMaintenanceModeRequestType struct { - This ManagedObjectReference `xml:"_this"` - Timeout int `xml:"timeout"` -} - -func init() { - t["ExitMaintenanceModeRequestType"] = reflect.TypeOf((*ExitMaintenanceModeRequestType)(nil)).Elem() -} - -type ExitMaintenanceMode_Task ExitMaintenanceModeRequestType - -func init() { - t["ExitMaintenanceMode_Task"] = reflect.TypeOf((*ExitMaintenanceMode_Task)(nil)).Elem() -} - -type ExitMaintenanceMode_TaskResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type ExitStandbyModeFailedEvent struct { - HostEvent -} - -func init() { - t["ExitStandbyModeFailedEvent"] = reflect.TypeOf((*ExitStandbyModeFailedEvent)(nil)).Elem() -} - -type ExitedStandbyModeEvent struct { - HostEvent -} - -func init() { - t["ExitedStandbyModeEvent"] = reflect.TypeOf((*ExitedStandbyModeEvent)(nil)).Elem() -} - -type ExitingStandbyModeEvent struct { - HostEvent -} - -func init() { - t["ExitingStandbyModeEvent"] = reflect.TypeOf((*ExitingStandbyModeEvent)(nil)).Elem() -} - -type ExpandVmfsDatastore ExpandVmfsDatastoreRequestType - -func init() { - t["ExpandVmfsDatastore"] = reflect.TypeOf((*ExpandVmfsDatastore)(nil)).Elem() -} - -type ExpandVmfsDatastoreRequestType struct { - This ManagedObjectReference `xml:"_this"` - Datastore ManagedObjectReference `xml:"datastore"` - Spec VmfsDatastoreExpandSpec `xml:"spec"` -} - -func init() { - t["ExpandVmfsDatastoreRequestType"] = reflect.TypeOf((*ExpandVmfsDatastoreRequestType)(nil)).Elem() -} - -type ExpandVmfsDatastoreResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type ExpandVmfsExtent ExpandVmfsExtentRequestType - -func init() { - t["ExpandVmfsExtent"] = reflect.TypeOf((*ExpandVmfsExtent)(nil)).Elem() -} - -type ExpandVmfsExtentRequestType struct { - This ManagedObjectReference `xml:"_this"` - VmfsPath string `xml:"vmfsPath"` - Extent HostScsiDiskPartition `xml:"extent"` -} - -func init() { - t["ExpandVmfsExtentRequestType"] = reflect.TypeOf((*ExpandVmfsExtentRequestType)(nil)).Elem() -} - -type ExpandVmfsExtentResponse struct { -} - -type ExpiredAddonLicense struct { - ExpiredFeatureLicense -} - -func init() { - t["ExpiredAddonLicense"] = reflect.TypeOf((*ExpiredAddonLicense)(nil)).Elem() -} - -type ExpiredAddonLicenseFault ExpiredAddonLicense - -func init() { - t["ExpiredAddonLicenseFault"] = reflect.TypeOf((*ExpiredAddonLicenseFault)(nil)).Elem() -} - -type ExpiredEditionLicense struct { - ExpiredFeatureLicense -} - -func init() { - t["ExpiredEditionLicense"] = reflect.TypeOf((*ExpiredEditionLicense)(nil)).Elem() -} - -type ExpiredEditionLicenseFault ExpiredEditionLicense - -func init() { - t["ExpiredEditionLicenseFault"] = reflect.TypeOf((*ExpiredEditionLicenseFault)(nil)).Elem() -} - -type ExpiredFeatureLicense struct { - NotEnoughLicenses - - Feature string `xml:"feature"` - Count int `xml:"count"` - ExpirationDate time.Time `xml:"expirationDate"` -} - -func init() { - t["ExpiredFeatureLicense"] = reflect.TypeOf((*ExpiredFeatureLicense)(nil)).Elem() -} - -type ExpiredFeatureLicenseFault BaseExpiredFeatureLicense - -func init() { - t["ExpiredFeatureLicenseFault"] = reflect.TypeOf((*ExpiredFeatureLicenseFault)(nil)).Elem() -} - -type ExportAnswerFileRequestType struct { - This ManagedObjectReference `xml:"_this"` - Host ManagedObjectReference `xml:"host"` -} - -func init() { - t["ExportAnswerFileRequestType"] = reflect.TypeOf((*ExportAnswerFileRequestType)(nil)).Elem() -} - -type ExportAnswerFile_Task ExportAnswerFileRequestType - -func init() { - t["ExportAnswerFile_Task"] = reflect.TypeOf((*ExportAnswerFile_Task)(nil)).Elem() -} - -type ExportAnswerFile_TaskResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type ExportProfile ExportProfileRequestType - -func init() { - t["ExportProfile"] = reflect.TypeOf((*ExportProfile)(nil)).Elem() -} - -type ExportProfileRequestType struct { - This ManagedObjectReference `xml:"_this"` -} - -func init() { - t["ExportProfileRequestType"] = reflect.TypeOf((*ExportProfileRequestType)(nil)).Elem() -} - -type ExportProfileResponse struct { - Returnval string `xml:"returnval"` -} - -type ExportSnapshot ExportSnapshotRequestType - -func init() { - t["ExportSnapshot"] = reflect.TypeOf((*ExportSnapshot)(nil)).Elem() -} - -type ExportSnapshotRequestType struct { - This ManagedObjectReference `xml:"_this"` -} - -func init() { - t["ExportSnapshotRequestType"] = reflect.TypeOf((*ExportSnapshotRequestType)(nil)).Elem() -} - -type ExportSnapshotResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type ExportVApp ExportVAppRequestType - -func init() { - t["ExportVApp"] = reflect.TypeOf((*ExportVApp)(nil)).Elem() -} - -type ExportVAppRequestType struct { - This ManagedObjectReference `xml:"_this"` -} - -func init() { - t["ExportVAppRequestType"] = reflect.TypeOf((*ExportVAppRequestType)(nil)).Elem() -} - -type ExportVAppResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type ExportVm ExportVmRequestType - -func init() { - t["ExportVm"] = reflect.TypeOf((*ExportVm)(nil)).Elem() -} - -type ExportVmRequestType struct { - This ManagedObjectReference `xml:"_this"` -} - -func init() { - t["ExportVmRequestType"] = reflect.TypeOf((*ExportVmRequestType)(nil)).Elem() -} - -type ExportVmResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type ExtExtendedProductInfo struct { - DynamicData - - CompanyUrl string `xml:"companyUrl,omitempty"` - ProductUrl string `xml:"productUrl,omitempty"` - ManagementUrl string `xml:"managementUrl,omitempty"` - Self *ManagedObjectReference `xml:"self,omitempty"` -} - -func init() { - t["ExtExtendedProductInfo"] = reflect.TypeOf((*ExtExtendedProductInfo)(nil)).Elem() -} - -type ExtManagedEntityInfo struct { - DynamicData - - Type string `xml:"type"` - SmallIconUrl string `xml:"smallIconUrl,omitempty"` - IconUrl string `xml:"iconUrl,omitempty"` - Description string `xml:"description,omitempty"` -} - -func init() { - t["ExtManagedEntityInfo"] = reflect.TypeOf((*ExtManagedEntityInfo)(nil)).Elem() -} - -type ExtSolutionManagerInfo struct { - DynamicData - - Tab []ExtSolutionManagerInfoTabInfo `xml:"tab,omitempty"` - SmallIconUrl string `xml:"smallIconUrl,omitempty"` -} - -func init() { - t["ExtSolutionManagerInfo"] = reflect.TypeOf((*ExtSolutionManagerInfo)(nil)).Elem() -} - -type ExtSolutionManagerInfoTabInfo struct { - DynamicData - - Label string `xml:"label"` - Url string `xml:"url"` -} - -func init() { - t["ExtSolutionManagerInfoTabInfo"] = reflect.TypeOf((*ExtSolutionManagerInfoTabInfo)(nil)).Elem() -} - -type ExtendVffs ExtendVffsRequestType - -func init() { - t["ExtendVffs"] = reflect.TypeOf((*ExtendVffs)(nil)).Elem() -} - -type ExtendVffsRequestType struct { - This ManagedObjectReference `xml:"_this"` - VffsPath string `xml:"vffsPath"` - DevicePath string `xml:"devicePath"` - Spec *HostDiskPartitionSpec `xml:"spec,omitempty"` -} - -func init() { - t["ExtendVffsRequestType"] = reflect.TypeOf((*ExtendVffsRequestType)(nil)).Elem() -} - -type ExtendVffsResponse struct { -} - -type ExtendVirtualDiskRequestType struct { - This ManagedObjectReference `xml:"_this"` - Name string `xml:"name"` - Datacenter *ManagedObjectReference `xml:"datacenter,omitempty"` - NewCapacityKb int64 `xml:"newCapacityKb"` - EagerZero *bool `xml:"eagerZero"` -} - -func init() { - t["ExtendVirtualDiskRequestType"] = reflect.TypeOf((*ExtendVirtualDiskRequestType)(nil)).Elem() -} - -type ExtendVirtualDisk_Task ExtendVirtualDiskRequestType - -func init() { - t["ExtendVirtualDisk_Task"] = reflect.TypeOf((*ExtendVirtualDisk_Task)(nil)).Elem() -} - -type ExtendVirtualDisk_TaskResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type ExtendVmfsDatastore ExtendVmfsDatastoreRequestType - -func init() { - t["ExtendVmfsDatastore"] = reflect.TypeOf((*ExtendVmfsDatastore)(nil)).Elem() -} - -type ExtendVmfsDatastoreRequestType struct { - This ManagedObjectReference `xml:"_this"` - Datastore ManagedObjectReference `xml:"datastore"` - Spec VmfsDatastoreExtendSpec `xml:"spec"` -} - -func init() { - t["ExtendVmfsDatastoreRequestType"] = reflect.TypeOf((*ExtendVmfsDatastoreRequestType)(nil)).Elem() -} - -type ExtendVmfsDatastoreResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type ExtendedDescription struct { - Description - - MessageCatalogKeyPrefix string `xml:"messageCatalogKeyPrefix"` - MessageArg []KeyAnyValue `xml:"messageArg,omitempty"` -} - -func init() { - t["ExtendedDescription"] = reflect.TypeOf((*ExtendedDescription)(nil)).Elem() -} - -type ExtendedElementDescription struct { - ElementDescription - - MessageCatalogKeyPrefix string `xml:"messageCatalogKeyPrefix"` - MessageArg []KeyAnyValue `xml:"messageArg,omitempty"` -} - -func init() { - t["ExtendedElementDescription"] = reflect.TypeOf((*ExtendedElementDescription)(nil)).Elem() -} - -type ExtendedEvent struct { - GeneralEvent - - EventTypeId string `xml:"eventTypeId"` - ManagedObject ManagedObjectReference `xml:"managedObject"` - Data []ExtendedEventPair `xml:"data,omitempty"` -} - -func init() { - t["ExtendedEvent"] = reflect.TypeOf((*ExtendedEvent)(nil)).Elem() -} - -type ExtendedEventPair struct { - DynamicData - - Key string `xml:"key"` - Value string `xml:"value"` -} - -func init() { - t["ExtendedEventPair"] = reflect.TypeOf((*ExtendedEventPair)(nil)).Elem() -} - -type ExtendedFault struct { - VimFault - - FaultTypeId string `xml:"faultTypeId"` - Data []KeyValue `xml:"data,omitempty"` -} - -func init() { - t["ExtendedFault"] = reflect.TypeOf((*ExtendedFault)(nil)).Elem() -} - -type ExtendedFaultFault ExtendedFault - -func init() { - t["ExtendedFaultFault"] = reflect.TypeOf((*ExtendedFaultFault)(nil)).Elem() -} - -type Extension struct { - DynamicData - - Description BaseDescription `xml:"description,typeattr"` - Key string `xml:"key"` - Company string `xml:"company,omitempty"` - Type string `xml:"type,omitempty"` - Version string `xml:"version"` - SubjectName string `xml:"subjectName,omitempty"` - Server []ExtensionServerInfo `xml:"server,omitempty"` - Client []ExtensionClientInfo `xml:"client,omitempty"` - TaskList []ExtensionTaskTypeInfo `xml:"taskList,omitempty"` - EventList []ExtensionEventTypeInfo `xml:"eventList,omitempty"` - FaultList []ExtensionFaultTypeInfo `xml:"faultList,omitempty"` - PrivilegeList []ExtensionPrivilegeInfo `xml:"privilegeList,omitempty"` - ResourceList []ExtensionResourceInfo `xml:"resourceList,omitempty"` - LastHeartbeatTime time.Time `xml:"lastHeartbeatTime"` - HealthInfo *ExtensionHealthInfo `xml:"healthInfo,omitempty"` - OvfConsumerInfo *ExtensionOvfConsumerInfo `xml:"ovfConsumerInfo,omitempty"` - ExtendedProductInfo *ExtExtendedProductInfo `xml:"extendedProductInfo,omitempty"` - ManagedEntityInfo []ExtManagedEntityInfo `xml:"managedEntityInfo,omitempty"` - ShownInSolutionManager *bool `xml:"shownInSolutionManager"` - SolutionManagerInfo *ExtSolutionManagerInfo `xml:"solutionManagerInfo,omitempty"` -} - -func init() { - t["Extension"] = reflect.TypeOf((*Extension)(nil)).Elem() -} - -type ExtensionClientInfo struct { - DynamicData - - Version string `xml:"version"` - Description BaseDescription `xml:"description,typeattr"` - Company string `xml:"company"` - Type string `xml:"type"` - Url string `xml:"url"` -} - -func init() { - t["ExtensionClientInfo"] = reflect.TypeOf((*ExtensionClientInfo)(nil)).Elem() -} - -type ExtensionEventTypeInfo struct { - DynamicData - - EventID string `xml:"eventID"` - EventTypeSchema string `xml:"eventTypeSchema,omitempty"` -} - -func init() { - t["ExtensionEventTypeInfo"] = reflect.TypeOf((*ExtensionEventTypeInfo)(nil)).Elem() -} - -type ExtensionFaultTypeInfo struct { - DynamicData - - FaultID string `xml:"faultID"` -} - -func init() { - t["ExtensionFaultTypeInfo"] = reflect.TypeOf((*ExtensionFaultTypeInfo)(nil)).Elem() -} - -type ExtensionHealthInfo struct { - DynamicData - - Url string `xml:"url"` -} - -func init() { - t["ExtensionHealthInfo"] = reflect.TypeOf((*ExtensionHealthInfo)(nil)).Elem() -} - -type ExtensionManagerIpAllocationUsage struct { - DynamicData - - ExtensionKey string `xml:"extensionKey"` - NumAddresses int `xml:"numAddresses"` -} - -func init() { - t["ExtensionManagerIpAllocationUsage"] = reflect.TypeOf((*ExtensionManagerIpAllocationUsage)(nil)).Elem() -} - -type ExtensionOvfConsumerInfo struct { - DynamicData - - CallbackUrl string `xml:"callbackUrl"` - SectionType []string `xml:"sectionType"` -} - -func init() { - t["ExtensionOvfConsumerInfo"] = reflect.TypeOf((*ExtensionOvfConsumerInfo)(nil)).Elem() -} - -type ExtensionPrivilegeInfo struct { - DynamicData - - PrivID string `xml:"privID"` - PrivGroupName string `xml:"privGroupName"` -} - -func init() { - t["ExtensionPrivilegeInfo"] = reflect.TypeOf((*ExtensionPrivilegeInfo)(nil)).Elem() -} - -type ExtensionResourceInfo struct { - DynamicData - - Locale string `xml:"locale"` - Module string `xml:"module"` - Data []KeyValue `xml:"data"` -} - -func init() { - t["ExtensionResourceInfo"] = reflect.TypeOf((*ExtensionResourceInfo)(nil)).Elem() -} - -type ExtensionServerInfo struct { - DynamicData - - Url string `xml:"url"` - Description BaseDescription `xml:"description,typeattr"` - Company string `xml:"company"` - Type string `xml:"type"` - AdminEmail []string `xml:"adminEmail"` - ServerThumbprint string `xml:"serverThumbprint,omitempty"` -} - -func init() { - t["ExtensionServerInfo"] = reflect.TypeOf((*ExtensionServerInfo)(nil)).Elem() -} - -type ExtensionTaskTypeInfo struct { - DynamicData - - TaskID string `xml:"taskID"` -} - -func init() { - t["ExtensionTaskTypeInfo"] = reflect.TypeOf((*ExtensionTaskTypeInfo)(nil)).Elem() -} - -type ExtractOvfEnvironment ExtractOvfEnvironmentRequestType - -func init() { - t["ExtractOvfEnvironment"] = reflect.TypeOf((*ExtractOvfEnvironment)(nil)).Elem() -} - -type ExtractOvfEnvironmentRequestType struct { - This ManagedObjectReference `xml:"_this"` -} - -func init() { - t["ExtractOvfEnvironmentRequestType"] = reflect.TypeOf((*ExtractOvfEnvironmentRequestType)(nil)).Elem() -} - -type ExtractOvfEnvironmentResponse struct { - Returnval string `xml:"returnval"` -} - -type FailToEnableSPBM struct { - NotEnoughLicenses - - Cs ManagedObjectReference `xml:"cs"` - CsName string `xml:"csName"` - HostLicenseStates []ComputeResourceHostSPBMLicenseInfo `xml:"hostLicenseStates"` -} - -func init() { - t["FailToEnableSPBM"] = reflect.TypeOf((*FailToEnableSPBM)(nil)).Elem() -} - -type FailToEnableSPBMFault FailToEnableSPBM - -func init() { - t["FailToEnableSPBMFault"] = reflect.TypeOf((*FailToEnableSPBMFault)(nil)).Elem() -} - -type FailToLockFaultToleranceVMs struct { - RuntimeFault - - VmName string `xml:"vmName"` - Vm ManagedObjectReference `xml:"vm"` - AlreadyLockedVm ManagedObjectReference `xml:"alreadyLockedVm"` -} - -func init() { - t["FailToLockFaultToleranceVMs"] = reflect.TypeOf((*FailToLockFaultToleranceVMs)(nil)).Elem() -} - -type FailToLockFaultToleranceVMsFault FailToLockFaultToleranceVMs - -func init() { - t["FailToLockFaultToleranceVMsFault"] = reflect.TypeOf((*FailToLockFaultToleranceVMsFault)(nil)).Elem() -} - -type FailoverLevelRestored struct { - ClusterEvent -} - -func init() { - t["FailoverLevelRestored"] = reflect.TypeOf((*FailoverLevelRestored)(nil)).Elem() -} - -type FaultToleranceAntiAffinityViolated struct { - MigrationFault - - HostName string `xml:"hostName"` - Host ManagedObjectReference `xml:"host"` -} - -func init() { - t["FaultToleranceAntiAffinityViolated"] = reflect.TypeOf((*FaultToleranceAntiAffinityViolated)(nil)).Elem() -} - -type FaultToleranceAntiAffinityViolatedFault FaultToleranceAntiAffinityViolated - -func init() { - t["FaultToleranceAntiAffinityViolatedFault"] = reflect.TypeOf((*FaultToleranceAntiAffinityViolatedFault)(nil)).Elem() -} - -type FaultToleranceCannotEditMem struct { - VmConfigFault - - VmName string `xml:"vmName"` - Vm ManagedObjectReference `xml:"vm"` -} - -func init() { - t["FaultToleranceCannotEditMem"] = reflect.TypeOf((*FaultToleranceCannotEditMem)(nil)).Elem() -} - -type FaultToleranceCannotEditMemFault FaultToleranceCannotEditMem - -func init() { - t["FaultToleranceCannotEditMemFault"] = reflect.TypeOf((*FaultToleranceCannotEditMemFault)(nil)).Elem() -} - -type FaultToleranceConfigInfo struct { - DynamicData - - Role int `xml:"role"` - InstanceUuids []string `xml:"instanceUuids"` - ConfigPaths []string `xml:"configPaths"` -} - -func init() { - t["FaultToleranceConfigInfo"] = reflect.TypeOf((*FaultToleranceConfigInfo)(nil)).Elem() -} - -type FaultToleranceCpuIncompatible struct { - CpuIncompatible - - Model bool `xml:"model"` - Family bool `xml:"family"` - Stepping bool `xml:"stepping"` -} - -func init() { - t["FaultToleranceCpuIncompatible"] = reflect.TypeOf((*FaultToleranceCpuIncompatible)(nil)).Elem() -} - -type FaultToleranceCpuIncompatibleFault FaultToleranceCpuIncompatible - -func init() { - t["FaultToleranceCpuIncompatibleFault"] = reflect.TypeOf((*FaultToleranceCpuIncompatibleFault)(nil)).Elem() -} - -type FaultToleranceNeedsThickDisk struct { - MigrationFault - - VmName string `xml:"vmName"` -} - -func init() { - t["FaultToleranceNeedsThickDisk"] = reflect.TypeOf((*FaultToleranceNeedsThickDisk)(nil)).Elem() -} - -type FaultToleranceNeedsThickDiskFault FaultToleranceNeedsThickDisk - -func init() { - t["FaultToleranceNeedsThickDiskFault"] = reflect.TypeOf((*FaultToleranceNeedsThickDiskFault)(nil)).Elem() -} - -type FaultToleranceNotLicensed struct { - VmFaultToleranceIssue - - HostName string `xml:"hostName,omitempty"` -} - -func init() { - t["FaultToleranceNotLicensed"] = reflect.TypeOf((*FaultToleranceNotLicensed)(nil)).Elem() -} - -type FaultToleranceNotLicensedFault FaultToleranceNotLicensed - -func init() { - t["FaultToleranceNotLicensedFault"] = reflect.TypeOf((*FaultToleranceNotLicensedFault)(nil)).Elem() -} - -type FaultToleranceNotSameBuild struct { - MigrationFault - - Build string `xml:"build"` -} - -func init() { - t["FaultToleranceNotSameBuild"] = reflect.TypeOf((*FaultToleranceNotSameBuild)(nil)).Elem() -} - -type FaultToleranceNotSameBuildFault FaultToleranceNotSameBuild - -func init() { - t["FaultToleranceNotSameBuildFault"] = reflect.TypeOf((*FaultToleranceNotSameBuildFault)(nil)).Elem() -} - -type FaultTolerancePrimaryConfigInfo struct { - FaultToleranceConfigInfo - - Secondaries []ManagedObjectReference `xml:"secondaries"` -} - -func init() { - t["FaultTolerancePrimaryConfigInfo"] = reflect.TypeOf((*FaultTolerancePrimaryConfigInfo)(nil)).Elem() -} - -type FaultTolerancePrimaryPowerOnNotAttempted struct { - VmFaultToleranceIssue - - SecondaryVm ManagedObjectReference `xml:"secondaryVm"` - PrimaryVm ManagedObjectReference `xml:"primaryVm"` -} - -func init() { - t["FaultTolerancePrimaryPowerOnNotAttempted"] = reflect.TypeOf((*FaultTolerancePrimaryPowerOnNotAttempted)(nil)).Elem() -} - -type FaultTolerancePrimaryPowerOnNotAttemptedFault FaultTolerancePrimaryPowerOnNotAttempted - -func init() { - t["FaultTolerancePrimaryPowerOnNotAttemptedFault"] = reflect.TypeOf((*FaultTolerancePrimaryPowerOnNotAttemptedFault)(nil)).Elem() -} - -type FaultToleranceSecondaryConfigInfo struct { - FaultToleranceConfigInfo - - PrimaryVM ManagedObjectReference `xml:"primaryVM"` -} - -func init() { - t["FaultToleranceSecondaryConfigInfo"] = reflect.TypeOf((*FaultToleranceSecondaryConfigInfo)(nil)).Elem() -} - -type FaultToleranceSecondaryOpResult struct { - DynamicData - - Vm ManagedObjectReference `xml:"vm"` - PowerOnAttempted bool `xml:"powerOnAttempted"` - PowerOnResult *ClusterPowerOnVmResult `xml:"powerOnResult,omitempty"` -} - -func init() { - t["FaultToleranceSecondaryOpResult"] = reflect.TypeOf((*FaultToleranceSecondaryOpResult)(nil)).Elem() -} - -type FaultToleranceVmNotDasProtected struct { - VimFault - - Vm ManagedObjectReference `xml:"vm"` - VmName string `xml:"vmName"` -} - -func init() { - t["FaultToleranceVmNotDasProtected"] = reflect.TypeOf((*FaultToleranceVmNotDasProtected)(nil)).Elem() -} - -type FaultToleranceVmNotDasProtectedFault FaultToleranceVmNotDasProtected - -func init() { - t["FaultToleranceVmNotDasProtectedFault"] = reflect.TypeOf((*FaultToleranceVmNotDasProtectedFault)(nil)).Elem() -} - -type FcoeConfig struct { - DynamicData - - PriorityClass int `xml:"priorityClass"` - SourceMac string `xml:"sourceMac"` - VlanRange []FcoeConfigVlanRange `xml:"vlanRange"` - Capabilities FcoeConfigFcoeCapabilities `xml:"capabilities"` - FcoeActive bool `xml:"fcoeActive"` -} - -func init() { - t["FcoeConfig"] = reflect.TypeOf((*FcoeConfig)(nil)).Elem() -} - -type FcoeConfigFcoeCapabilities struct { - DynamicData - - PriorityClass bool `xml:"priorityClass"` - SourceMacAddress bool `xml:"sourceMacAddress"` - VlanRange bool `xml:"vlanRange"` -} - -func init() { - t["FcoeConfigFcoeCapabilities"] = reflect.TypeOf((*FcoeConfigFcoeCapabilities)(nil)).Elem() -} - -type FcoeConfigFcoeSpecification struct { - DynamicData - - UnderlyingPnic string `xml:"underlyingPnic"` - PriorityClass int `xml:"priorityClass,omitempty"` - SourceMac string `xml:"sourceMac,omitempty"` - VlanRange []FcoeConfigVlanRange `xml:"vlanRange,omitempty"` -} - -func init() { - t["FcoeConfigFcoeSpecification"] = reflect.TypeOf((*FcoeConfigFcoeSpecification)(nil)).Elem() -} - -type FcoeConfigVlanRange struct { - DynamicData - - VlanLow int `xml:"vlanLow"` - VlanHigh int `xml:"vlanHigh"` -} - -func init() { - t["FcoeConfigVlanRange"] = reflect.TypeOf((*FcoeConfigVlanRange)(nil)).Elem() -} - -type FcoeFault struct { - VimFault -} - -func init() { - t["FcoeFault"] = reflect.TypeOf((*FcoeFault)(nil)).Elem() -} - -type FcoeFaultFault BaseFcoeFault - -func init() { - t["FcoeFaultFault"] = reflect.TypeOf((*FcoeFaultFault)(nil)).Elem() -} - -type FcoeFaultPnicHasNoPortSet struct { - FcoeFault - - NicDevice string `xml:"nicDevice"` -} - -func init() { - t["FcoeFaultPnicHasNoPortSet"] = reflect.TypeOf((*FcoeFaultPnicHasNoPortSet)(nil)).Elem() -} - -type FcoeFaultPnicHasNoPortSetFault FcoeFaultPnicHasNoPortSet - -func init() { - t["FcoeFaultPnicHasNoPortSetFault"] = reflect.TypeOf((*FcoeFaultPnicHasNoPortSetFault)(nil)).Elem() -} - -type FeatureRequirementsNotMet struct { - VirtualHardwareCompatibilityIssue - - FeatureRequirement []VirtualMachineFeatureRequirement `xml:"featureRequirement,omitempty"` - Vm *ManagedObjectReference `xml:"vm,omitempty"` - Host *ManagedObjectReference `xml:"host,omitempty"` -} - -func init() { - t["FeatureRequirementsNotMet"] = reflect.TypeOf((*FeatureRequirementsNotMet)(nil)).Elem() -} - -type FeatureRequirementsNotMetFault FeatureRequirementsNotMet - -func init() { - t["FeatureRequirementsNotMetFault"] = reflect.TypeOf((*FeatureRequirementsNotMetFault)(nil)).Elem() -} - -type FetchDVPortKeys FetchDVPortKeysRequestType - -func init() { - t["FetchDVPortKeys"] = reflect.TypeOf((*FetchDVPortKeys)(nil)).Elem() -} - -type FetchDVPortKeysRequestType struct { - This ManagedObjectReference `xml:"_this"` - Criteria *DistributedVirtualSwitchPortCriteria `xml:"criteria,omitempty"` -} - -func init() { - t["FetchDVPortKeysRequestType"] = reflect.TypeOf((*FetchDVPortKeysRequestType)(nil)).Elem() -} - -type FetchDVPortKeysResponse struct { - Returnval []string `xml:"returnval,omitempty"` -} - -type FetchDVPorts FetchDVPortsRequestType - -func init() { - t["FetchDVPorts"] = reflect.TypeOf((*FetchDVPorts)(nil)).Elem() -} - -type FetchDVPortsRequestType struct { - This ManagedObjectReference `xml:"_this"` - Criteria *DistributedVirtualSwitchPortCriteria `xml:"criteria,omitempty"` -} - -func init() { - t["FetchDVPortsRequestType"] = reflect.TypeOf((*FetchDVPortsRequestType)(nil)).Elem() -} - -type FetchDVPortsResponse struct { - Returnval []DistributedVirtualPort `xml:"returnval,omitempty"` -} - -type FileAlreadyExists struct { - FileFault -} - -func init() { - t["FileAlreadyExists"] = reflect.TypeOf((*FileAlreadyExists)(nil)).Elem() -} - -type FileAlreadyExistsFault FileAlreadyExists - -func init() { - t["FileAlreadyExistsFault"] = reflect.TypeOf((*FileAlreadyExistsFault)(nil)).Elem() -} - -type FileBackedPortNotSupported struct { - DeviceNotSupported -} - -func init() { - t["FileBackedPortNotSupported"] = reflect.TypeOf((*FileBackedPortNotSupported)(nil)).Elem() -} - -type FileBackedPortNotSupportedFault FileBackedPortNotSupported - -func init() { - t["FileBackedPortNotSupportedFault"] = reflect.TypeOf((*FileBackedPortNotSupportedFault)(nil)).Elem() -} - -type FileBackedVirtualDiskSpec struct { - VirtualDiskSpec - - CapacityKb int64 `xml:"capacityKb"` - Profile []BaseVirtualMachineProfileSpec `xml:"profile,omitempty,typeattr"` -} - -func init() { - t["FileBackedVirtualDiskSpec"] = reflect.TypeOf((*FileBackedVirtualDiskSpec)(nil)).Elem() -} - -type FileFault struct { - VimFault - - File string `xml:"file"` -} - -func init() { - t["FileFault"] = reflect.TypeOf((*FileFault)(nil)).Elem() -} - -type FileFaultFault BaseFileFault - -func init() { - t["FileFaultFault"] = reflect.TypeOf((*FileFaultFault)(nil)).Elem() -} - -type FileInfo struct { - DynamicData - - Path string `xml:"path"` - FileSize int64 `xml:"fileSize,omitempty"` - Modification *time.Time `xml:"modification"` - Owner string `xml:"owner,omitempty"` -} - -func init() { - t["FileInfo"] = reflect.TypeOf((*FileInfo)(nil)).Elem() -} - -type FileLocked struct { - FileFault -} - -func init() { - t["FileLocked"] = reflect.TypeOf((*FileLocked)(nil)).Elem() -} - -type FileLockedFault FileLocked - -func init() { - t["FileLockedFault"] = reflect.TypeOf((*FileLockedFault)(nil)).Elem() -} - -type FileNameTooLong struct { - FileFault -} - -func init() { - t["FileNameTooLong"] = reflect.TypeOf((*FileNameTooLong)(nil)).Elem() -} - -type FileNameTooLongFault FileNameTooLong - -func init() { - t["FileNameTooLongFault"] = reflect.TypeOf((*FileNameTooLongFault)(nil)).Elem() -} - -type FileNotFound struct { - FileFault -} - -func init() { - t["FileNotFound"] = reflect.TypeOf((*FileNotFound)(nil)).Elem() -} - -type FileNotFoundFault FileNotFound - -func init() { - t["FileNotFoundFault"] = reflect.TypeOf((*FileNotFoundFault)(nil)).Elem() -} - -type FileNotWritable struct { - FileFault -} - -func init() { - t["FileNotWritable"] = reflect.TypeOf((*FileNotWritable)(nil)).Elem() -} - -type FileNotWritableFault FileNotWritable - -func init() { - t["FileNotWritableFault"] = reflect.TypeOf((*FileNotWritableFault)(nil)).Elem() -} - -type FileQuery struct { - DynamicData -} - -func init() { - t["FileQuery"] = reflect.TypeOf((*FileQuery)(nil)).Elem() -} - -type FileQueryFlags struct { - DynamicData - - FileType bool `xml:"fileType"` - FileSize bool `xml:"fileSize"` - Modification bool `xml:"modification"` - FileOwner *bool `xml:"fileOwner"` -} - -func init() { - t["FileQueryFlags"] = reflect.TypeOf((*FileQueryFlags)(nil)).Elem() -} - -type FileTooLarge struct { - FileFault - - Datastore string `xml:"datastore"` - FileSize int64 `xml:"fileSize"` - MaxFileSize int64 `xml:"maxFileSize,omitempty"` -} - -func init() { - t["FileTooLarge"] = reflect.TypeOf((*FileTooLarge)(nil)).Elem() -} - -type FileTooLargeFault FileTooLarge - -func init() { - t["FileTooLargeFault"] = reflect.TypeOf((*FileTooLargeFault)(nil)).Elem() -} - -type FileTransferInformation struct { - DynamicData - - Attributes BaseGuestFileAttributes `xml:"attributes,typeattr"` - Size int64 `xml:"size"` - Url string `xml:"url"` -} - -func init() { - t["FileTransferInformation"] = reflect.TypeOf((*FileTransferInformation)(nil)).Elem() -} - -type FilesystemQuiesceFault struct { - SnapshotFault -} - -func init() { - t["FilesystemQuiesceFault"] = reflect.TypeOf((*FilesystemQuiesceFault)(nil)).Elem() -} - -type FilesystemQuiesceFaultFault FilesystemQuiesceFault - -func init() { - t["FilesystemQuiesceFaultFault"] = reflect.TypeOf((*FilesystemQuiesceFaultFault)(nil)).Elem() -} - -type FindAllByDnsName FindAllByDnsNameRequestType - -func init() { - t["FindAllByDnsName"] = reflect.TypeOf((*FindAllByDnsName)(nil)).Elem() -} - -type FindAllByDnsNameRequestType struct { - This ManagedObjectReference `xml:"_this"` - Datacenter *ManagedObjectReference `xml:"datacenter,omitempty"` - DnsName string `xml:"dnsName"` - VmSearch bool `xml:"vmSearch"` -} - -func init() { - t["FindAllByDnsNameRequestType"] = reflect.TypeOf((*FindAllByDnsNameRequestType)(nil)).Elem() -} - -type FindAllByDnsNameResponse struct { - Returnval []ManagedObjectReference `xml:"returnval"` -} - -type FindAllByIp FindAllByIpRequestType - -func init() { - t["FindAllByIp"] = reflect.TypeOf((*FindAllByIp)(nil)).Elem() -} - -type FindAllByIpRequestType struct { - This ManagedObjectReference `xml:"_this"` - Datacenter *ManagedObjectReference `xml:"datacenter,omitempty"` - Ip string `xml:"ip"` - VmSearch bool `xml:"vmSearch"` -} - -func init() { - t["FindAllByIpRequestType"] = reflect.TypeOf((*FindAllByIpRequestType)(nil)).Elem() -} - -type FindAllByIpResponse struct { - Returnval []ManagedObjectReference `xml:"returnval"` -} - -type FindAllByUuid FindAllByUuidRequestType - -func init() { - t["FindAllByUuid"] = reflect.TypeOf((*FindAllByUuid)(nil)).Elem() -} - -type FindAllByUuidRequestType struct { - This ManagedObjectReference `xml:"_this"` - Datacenter *ManagedObjectReference `xml:"datacenter,omitempty"` - Uuid string `xml:"uuid"` - VmSearch bool `xml:"vmSearch"` - InstanceUuid *bool `xml:"instanceUuid"` -} - -func init() { - t["FindAllByUuidRequestType"] = reflect.TypeOf((*FindAllByUuidRequestType)(nil)).Elem() -} - -type FindAllByUuidResponse struct { - Returnval []ManagedObjectReference `xml:"returnval"` -} - -type FindAssociatedProfile FindAssociatedProfileRequestType - -func init() { - t["FindAssociatedProfile"] = reflect.TypeOf((*FindAssociatedProfile)(nil)).Elem() -} - -type FindAssociatedProfileRequestType struct { - This ManagedObjectReference `xml:"_this"` - Entity ManagedObjectReference `xml:"entity"` -} - -func init() { - t["FindAssociatedProfileRequestType"] = reflect.TypeOf((*FindAssociatedProfileRequestType)(nil)).Elem() -} - -type FindAssociatedProfileResponse struct { - Returnval []ManagedObjectReference `xml:"returnval,omitempty"` -} - -type FindByDatastorePath FindByDatastorePathRequestType - -func init() { - t["FindByDatastorePath"] = reflect.TypeOf((*FindByDatastorePath)(nil)).Elem() -} - -type FindByDatastorePathRequestType struct { - This ManagedObjectReference `xml:"_this"` - Datacenter ManagedObjectReference `xml:"datacenter"` - Path string `xml:"path"` -} - -func init() { - t["FindByDatastorePathRequestType"] = reflect.TypeOf((*FindByDatastorePathRequestType)(nil)).Elem() -} - -type FindByDatastorePathResponse struct { - Returnval *ManagedObjectReference `xml:"returnval,omitempty"` -} - -type FindByDnsName FindByDnsNameRequestType - -func init() { - t["FindByDnsName"] = reflect.TypeOf((*FindByDnsName)(nil)).Elem() -} - -type FindByDnsNameRequestType struct { - This ManagedObjectReference `xml:"_this"` - Datacenter *ManagedObjectReference `xml:"datacenter,omitempty"` - DnsName string `xml:"dnsName"` - VmSearch bool `xml:"vmSearch"` -} - -func init() { - t["FindByDnsNameRequestType"] = reflect.TypeOf((*FindByDnsNameRequestType)(nil)).Elem() -} - -type FindByDnsNameResponse struct { - Returnval *ManagedObjectReference `xml:"returnval,omitempty"` -} - -type FindByInventoryPath FindByInventoryPathRequestType - -func init() { - t["FindByInventoryPath"] = reflect.TypeOf((*FindByInventoryPath)(nil)).Elem() -} - -type FindByInventoryPathRequestType struct { - This ManagedObjectReference `xml:"_this"` - InventoryPath string `xml:"inventoryPath"` -} - -func init() { - t["FindByInventoryPathRequestType"] = reflect.TypeOf((*FindByInventoryPathRequestType)(nil)).Elem() -} - -type FindByInventoryPathResponse struct { - Returnval *ManagedObjectReference `xml:"returnval,omitempty"` -} - -type FindByIp FindByIpRequestType - -func init() { - t["FindByIp"] = reflect.TypeOf((*FindByIp)(nil)).Elem() -} - -type FindByIpRequestType struct { - This ManagedObjectReference `xml:"_this"` - Datacenter *ManagedObjectReference `xml:"datacenter,omitempty"` - Ip string `xml:"ip"` - VmSearch bool `xml:"vmSearch"` -} - -func init() { - t["FindByIpRequestType"] = reflect.TypeOf((*FindByIpRequestType)(nil)).Elem() -} - -type FindByIpResponse struct { - Returnval *ManagedObjectReference `xml:"returnval,omitempty"` -} - -type FindByUuid FindByUuidRequestType - -func init() { - t["FindByUuid"] = reflect.TypeOf((*FindByUuid)(nil)).Elem() -} - -type FindByUuidRequestType struct { - This ManagedObjectReference `xml:"_this"` - Datacenter *ManagedObjectReference `xml:"datacenter,omitempty"` - Uuid string `xml:"uuid"` - VmSearch bool `xml:"vmSearch"` - InstanceUuid *bool `xml:"instanceUuid"` -} - -func init() { - t["FindByUuidRequestType"] = reflect.TypeOf((*FindByUuidRequestType)(nil)).Elem() -} - -type FindByUuidResponse struct { - Returnval *ManagedObjectReference `xml:"returnval,omitempty"` -} - -type FindChild FindChildRequestType - -func init() { - t["FindChild"] = reflect.TypeOf((*FindChild)(nil)).Elem() -} - -type FindChildRequestType struct { - This ManagedObjectReference `xml:"_this"` - Entity ManagedObjectReference `xml:"entity"` - Name string `xml:"name"` -} - -func init() { - t["FindChildRequestType"] = reflect.TypeOf((*FindChildRequestType)(nil)).Elem() -} - -type FindChildResponse struct { - Returnval *ManagedObjectReference `xml:"returnval,omitempty"` -} - -type FindExtension FindExtensionRequestType - -func init() { - t["FindExtension"] = reflect.TypeOf((*FindExtension)(nil)).Elem() -} - -type FindExtensionRequestType struct { - This ManagedObjectReference `xml:"_this"` - ExtensionKey string `xml:"extensionKey"` -} - -func init() { - t["FindExtensionRequestType"] = reflect.TypeOf((*FindExtensionRequestType)(nil)).Elem() -} - -type FindExtensionResponse struct { - Returnval *Extension `xml:"returnval,omitempty"` -} - -type FirewallProfile struct { - ApplyProfile - - Ruleset []FirewallProfileRulesetProfile `xml:"ruleset,omitempty"` -} - -func init() { - t["FirewallProfile"] = reflect.TypeOf((*FirewallProfile)(nil)).Elem() -} - -type FirewallProfileRulesetProfile struct { - ApplyProfile - - Key string `xml:"key"` -} - -func init() { - t["FirewallProfileRulesetProfile"] = reflect.TypeOf((*FirewallProfileRulesetProfile)(nil)).Elem() -} - -type FloatOption struct { - OptionType - - Min float32 `xml:"min"` - Max float32 `xml:"max"` - DefaultValue float32 `xml:"defaultValue"` -} - -func init() { - t["FloatOption"] = reflect.TypeOf((*FloatOption)(nil)).Elem() -} - -type FloppyImageFileInfo struct { - FileInfo -} - -func init() { - t["FloppyImageFileInfo"] = reflect.TypeOf((*FloppyImageFileInfo)(nil)).Elem() -} - -type FloppyImageFileQuery struct { - FileQuery -} - -func init() { - t["FloppyImageFileQuery"] = reflect.TypeOf((*FloppyImageFileQuery)(nil)).Elem() -} - -type FolderEventArgument struct { - EntityEventArgument - - Folder ManagedObjectReference `xml:"folder"` -} - -func init() { - t["FolderEventArgument"] = reflect.TypeOf((*FolderEventArgument)(nil)).Elem() -} - -type FolderFileInfo struct { - FileInfo -} - -func init() { - t["FolderFileInfo"] = reflect.TypeOf((*FolderFileInfo)(nil)).Elem() -} - -type FolderFileQuery struct { - FileQuery -} - -func init() { - t["FolderFileQuery"] = reflect.TypeOf((*FolderFileQuery)(nil)).Elem() -} - -type FormatVffs FormatVffsRequestType - -func init() { - t["FormatVffs"] = reflect.TypeOf((*FormatVffs)(nil)).Elem() -} - -type FormatVffsRequestType struct { - This ManagedObjectReference `xml:"_this"` - CreateSpec HostVffsSpec `xml:"createSpec"` -} - -func init() { - t["FormatVffsRequestType"] = reflect.TypeOf((*FormatVffsRequestType)(nil)).Elem() -} - -type FormatVffsResponse struct { - Returnval HostVffsVolume `xml:"returnval"` -} - -type FormatVmfs FormatVmfsRequestType - -func init() { - t["FormatVmfs"] = reflect.TypeOf((*FormatVmfs)(nil)).Elem() -} - -type FormatVmfsRequestType struct { - This ManagedObjectReference `xml:"_this"` - CreateSpec HostVmfsSpec `xml:"createSpec"` -} - -func init() { - t["FormatVmfsRequestType"] = reflect.TypeOf((*FormatVmfsRequestType)(nil)).Elem() -} - -type FormatVmfsResponse struct { - Returnval HostVmfsVolume `xml:"returnval"` -} - -type FtIssuesOnHost struct { - VmFaultToleranceIssue - - Host ManagedObjectReference `xml:"host"` - HostName string `xml:"hostName"` - Errors []LocalizedMethodFault `xml:"errors,omitempty"` -} - -func init() { - t["FtIssuesOnHost"] = reflect.TypeOf((*FtIssuesOnHost)(nil)).Elem() -} - -type FtIssuesOnHostFault FtIssuesOnHost - -func init() { - t["FtIssuesOnHostFault"] = reflect.TypeOf((*FtIssuesOnHostFault)(nil)).Elem() -} - -type FullStorageVMotionNotSupported struct { - MigrationFeatureNotSupported -} - -func init() { - t["FullStorageVMotionNotSupported"] = reflect.TypeOf((*FullStorageVMotionNotSupported)(nil)).Elem() -} - -type FullStorageVMotionNotSupportedFault FullStorageVMotionNotSupported - -func init() { - t["FullStorageVMotionNotSupportedFault"] = reflect.TypeOf((*FullStorageVMotionNotSupportedFault)(nil)).Elem() -} - -type GeneralEvent struct { - Event - - Message string `xml:"message"` -} - -func init() { - t["GeneralEvent"] = reflect.TypeOf((*GeneralEvent)(nil)).Elem() -} - -type GeneralHostErrorEvent struct { - GeneralEvent -} - -func init() { - t["GeneralHostErrorEvent"] = reflect.TypeOf((*GeneralHostErrorEvent)(nil)).Elem() -} - -type GeneralHostInfoEvent struct { - GeneralEvent -} - -func init() { - t["GeneralHostInfoEvent"] = reflect.TypeOf((*GeneralHostInfoEvent)(nil)).Elem() -} - -type GeneralHostWarningEvent struct { - GeneralEvent -} - -func init() { - t["GeneralHostWarningEvent"] = reflect.TypeOf((*GeneralHostWarningEvent)(nil)).Elem() -} - -type GeneralUserEvent struct { - GeneralEvent - - Entity *ManagedEntityEventArgument `xml:"entity,omitempty"` -} - -func init() { - t["GeneralUserEvent"] = reflect.TypeOf((*GeneralUserEvent)(nil)).Elem() -} - -type GeneralVmErrorEvent struct { - GeneralEvent -} - -func init() { - t["GeneralVmErrorEvent"] = reflect.TypeOf((*GeneralVmErrorEvent)(nil)).Elem() -} - -type GeneralVmInfoEvent struct { - GeneralEvent -} - -func init() { - t["GeneralVmInfoEvent"] = reflect.TypeOf((*GeneralVmInfoEvent)(nil)).Elem() -} - -type GeneralVmWarningEvent struct { - GeneralEvent -} - -func init() { - t["GeneralVmWarningEvent"] = reflect.TypeOf((*GeneralVmWarningEvent)(nil)).Elem() -} - -type GenerateConfigTaskList GenerateConfigTaskListRequestType - -func init() { - t["GenerateConfigTaskList"] = reflect.TypeOf((*GenerateConfigTaskList)(nil)).Elem() -} - -type GenerateConfigTaskListRequestType struct { - This ManagedObjectReference `xml:"_this"` - ConfigSpec HostConfigSpec `xml:"configSpec"` - Host ManagedObjectReference `xml:"host"` -} - -func init() { - t["GenerateConfigTaskListRequestType"] = reflect.TypeOf((*GenerateConfigTaskListRequestType)(nil)).Elem() -} - -type GenerateConfigTaskListResponse struct { - Returnval HostProfileManagerConfigTaskList `xml:"returnval"` -} - -type GenerateHostProfileTaskListRequestType struct { - This ManagedObjectReference `xml:"_this"` - ConfigSpec HostConfigSpec `xml:"configSpec"` - Host ManagedObjectReference `xml:"host"` -} - -func init() { - t["GenerateHostProfileTaskListRequestType"] = reflect.TypeOf((*GenerateHostProfileTaskListRequestType)(nil)).Elem() -} - -type GenerateHostProfileTaskList_Task GenerateHostProfileTaskListRequestType - -func init() { - t["GenerateHostProfileTaskList_Task"] = reflect.TypeOf((*GenerateHostProfileTaskList_Task)(nil)).Elem() -} - -type GenerateHostProfileTaskList_TaskResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type GenerateLogBundlesRequestType struct { - This ManagedObjectReference `xml:"_this"` - IncludeDefault bool `xml:"includeDefault"` - Host []ManagedObjectReference `xml:"host,omitempty"` -} - -func init() { - t["GenerateLogBundlesRequestType"] = reflect.TypeOf((*GenerateLogBundlesRequestType)(nil)).Elem() -} - -type GenerateLogBundles_Task GenerateLogBundlesRequestType - -func init() { - t["GenerateLogBundles_Task"] = reflect.TypeOf((*GenerateLogBundles_Task)(nil)).Elem() -} - -type GenerateLogBundles_TaskResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type GenericDrsFault struct { - VimFault - - HostFaults []LocalizedMethodFault `xml:"hostFaults,omitempty"` -} - -func init() { - t["GenericDrsFault"] = reflect.TypeOf((*GenericDrsFault)(nil)).Elem() -} - -type GenericDrsFaultFault GenericDrsFault - -func init() { - t["GenericDrsFaultFault"] = reflect.TypeOf((*GenericDrsFaultFault)(nil)).Elem() -} - -type GenericVmConfigFault struct { - VmConfigFault - - Reason string `xml:"reason"` -} - -func init() { - t["GenericVmConfigFault"] = reflect.TypeOf((*GenericVmConfigFault)(nil)).Elem() -} - -type GenericVmConfigFaultFault GenericVmConfigFault - -func init() { - t["GenericVmConfigFaultFault"] = reflect.TypeOf((*GenericVmConfigFaultFault)(nil)).Elem() -} - -type GetAlarm GetAlarmRequestType - -func init() { - t["GetAlarm"] = reflect.TypeOf((*GetAlarm)(nil)).Elem() -} - -type GetAlarmRequestType struct { - This ManagedObjectReference `xml:"_this"` - Entity *ManagedObjectReference `xml:"entity,omitempty"` -} - -func init() { - t["GetAlarmRequestType"] = reflect.TypeOf((*GetAlarmRequestType)(nil)).Elem() -} - -type GetAlarmResponse struct { - Returnval []ManagedObjectReference `xml:"returnval,omitempty"` -} - -type GetAlarmState GetAlarmStateRequestType - -func init() { - t["GetAlarmState"] = reflect.TypeOf((*GetAlarmState)(nil)).Elem() -} - -type GetAlarmStateRequestType struct { - This ManagedObjectReference `xml:"_this"` - Entity ManagedObjectReference `xml:"entity"` -} - -func init() { - t["GetAlarmStateRequestType"] = reflect.TypeOf((*GetAlarmStateRequestType)(nil)).Elem() -} - -type GetAlarmStateResponse struct { - Returnval []AlarmState `xml:"returnval,omitempty"` -} - -type GetCustomizationSpec GetCustomizationSpecRequestType - -func init() { - t["GetCustomizationSpec"] = reflect.TypeOf((*GetCustomizationSpec)(nil)).Elem() -} - -type GetCustomizationSpecRequestType struct { - This ManagedObjectReference `xml:"_this"` - Name string `xml:"name"` -} - -func init() { - t["GetCustomizationSpecRequestType"] = reflect.TypeOf((*GetCustomizationSpecRequestType)(nil)).Elem() -} - -type GetCustomizationSpecResponse struct { - Returnval CustomizationSpecItem `xml:"returnval"` -} - -type GetPublicKey GetPublicKeyRequestType - -func init() { - t["GetPublicKey"] = reflect.TypeOf((*GetPublicKey)(nil)).Elem() -} - -type GetPublicKeyRequestType struct { - This ManagedObjectReference `xml:"_this"` -} - -func init() { - t["GetPublicKeyRequestType"] = reflect.TypeOf((*GetPublicKeyRequestType)(nil)).Elem() -} - -type GetPublicKeyResponse struct { - Returnval string `xml:"returnval"` -} - -type GhostDvsProxySwitchDetectedEvent struct { - HostEvent - - SwitchUuid []string `xml:"switchUuid"` -} - -func init() { - t["GhostDvsProxySwitchDetectedEvent"] = reflect.TypeOf((*GhostDvsProxySwitchDetectedEvent)(nil)).Elem() -} - -type GhostDvsProxySwitchRemovedEvent struct { - HostEvent - - SwitchUuid []string `xml:"switchUuid"` -} - -func init() { - t["GhostDvsProxySwitchRemovedEvent"] = reflect.TypeOf((*GhostDvsProxySwitchRemovedEvent)(nil)).Elem() -} - -type GlobalMessageChangedEvent struct { - SessionEvent - - Message string `xml:"message"` -} - -func init() { - t["GlobalMessageChangedEvent"] = reflect.TypeOf((*GlobalMessageChangedEvent)(nil)).Elem() -} - -type GroupAlarmAction struct { - AlarmAction - - Action []BaseAlarmAction `xml:"action,typeattr"` -} - -func init() { - t["GroupAlarmAction"] = reflect.TypeOf((*GroupAlarmAction)(nil)).Elem() -} - -type GuestAuthentication struct { - DynamicData - - InteractiveSession bool `xml:"interactiveSession"` -} - -func init() { - t["GuestAuthentication"] = reflect.TypeOf((*GuestAuthentication)(nil)).Elem() -} - -type GuestAuthenticationChallenge struct { - GuestOperationsFault - - ServerChallenge BaseGuestAuthentication `xml:"serverChallenge,typeattr"` - SessionID int64 `xml:"sessionID"` -} - -func init() { - t["GuestAuthenticationChallenge"] = reflect.TypeOf((*GuestAuthenticationChallenge)(nil)).Elem() -} - -type GuestAuthenticationChallengeFault GuestAuthenticationChallenge - -func init() { - t["GuestAuthenticationChallengeFault"] = reflect.TypeOf((*GuestAuthenticationChallengeFault)(nil)).Elem() -} - -type GuestComponentsOutOfDate struct { - GuestOperationsFault -} - -func init() { - t["GuestComponentsOutOfDate"] = reflect.TypeOf((*GuestComponentsOutOfDate)(nil)).Elem() -} - -type GuestComponentsOutOfDateFault GuestComponentsOutOfDate - -func init() { - t["GuestComponentsOutOfDateFault"] = reflect.TypeOf((*GuestComponentsOutOfDateFault)(nil)).Elem() -} - -type GuestDiskInfo struct { - DynamicData - - DiskPath string `xml:"diskPath,omitempty"` - Capacity int64 `xml:"capacity,omitempty"` - FreeSpace int64 `xml:"freeSpace,omitempty"` -} - -func init() { - t["GuestDiskInfo"] = reflect.TypeOf((*GuestDiskInfo)(nil)).Elem() -} - -type GuestFileAttributes struct { - DynamicData - - ModificationTime *time.Time `xml:"modificationTime"` - AccessTime *time.Time `xml:"accessTime"` - SymlinkTarget string `xml:"symlinkTarget,omitempty"` -} - -func init() { - t["GuestFileAttributes"] = reflect.TypeOf((*GuestFileAttributes)(nil)).Elem() -} - -type GuestFileInfo struct { - DynamicData - - Path string `xml:"path"` - Type string `xml:"type"` - Size int64 `xml:"size"` - Attributes BaseGuestFileAttributes `xml:"attributes,typeattr"` -} - -func init() { - t["GuestFileInfo"] = reflect.TypeOf((*GuestFileInfo)(nil)).Elem() -} - -type GuestInfo struct { - DynamicData - - ToolsStatus VirtualMachineToolsStatus `xml:"toolsStatus,omitempty"` - ToolsVersionStatus string `xml:"toolsVersionStatus,omitempty"` - ToolsVersionStatus2 string `xml:"toolsVersionStatus2,omitempty"` - ToolsRunningStatus string `xml:"toolsRunningStatus,omitempty"` - ToolsVersion string `xml:"toolsVersion,omitempty"` - GuestId string `xml:"guestId,omitempty"` - GuestFamily string `xml:"guestFamily,omitempty"` - GuestFullName string `xml:"guestFullName,omitempty"` - HostName string `xml:"hostName,omitempty"` - IpAddress string `xml:"ipAddress,omitempty"` - Net []GuestNicInfo `xml:"net,omitempty"` - IpStack []GuestStackInfo `xml:"ipStack,omitempty"` - Disk []GuestDiskInfo `xml:"disk,omitempty"` - Screen *GuestScreenInfo `xml:"screen,omitempty"` - GuestState string `xml:"guestState"` - AppHeartbeatStatus string `xml:"appHeartbeatStatus,omitempty"` - AppState string `xml:"appState,omitempty"` - GuestOperationsReady *bool `xml:"guestOperationsReady"` - InteractiveGuestOperationsReady *bool `xml:"interactiveGuestOperationsReady"` - GenerationInfo []GuestInfoNamespaceGenerationInfo `xml:"generationInfo,omitempty"` -} - -func init() { - t["GuestInfo"] = reflect.TypeOf((*GuestInfo)(nil)).Elem() -} - -type GuestInfoNamespaceGenerationInfo struct { - DynamicData - - Key string `xml:"key"` - GenerationNo int `xml:"generationNo"` -} - -func init() { - t["GuestInfoNamespaceGenerationInfo"] = reflect.TypeOf((*GuestInfoNamespaceGenerationInfo)(nil)).Elem() -} - -type GuestListFileInfo struct { - DynamicData - - Files []GuestFileInfo `xml:"files,omitempty"` - Remaining int `xml:"remaining"` -} - -func init() { - t["GuestListFileInfo"] = reflect.TypeOf((*GuestListFileInfo)(nil)).Elem() -} - -type GuestNicInfo struct { - DynamicData - - Network string `xml:"network,omitempty"` - IpAddress []string `xml:"ipAddress,omitempty"` - MacAddress string `xml:"macAddress,omitempty"` - Connected bool `xml:"connected"` - DeviceConfigId int `xml:"deviceConfigId"` - DnsConfig *NetDnsConfigInfo `xml:"dnsConfig,omitempty"` - IpConfig *NetIpConfigInfo `xml:"ipConfig,omitempty"` - NetBIOSConfig BaseNetBIOSConfigInfo `xml:"netBIOSConfig,omitempty,typeattr"` -} - -func init() { - t["GuestNicInfo"] = reflect.TypeOf((*GuestNicInfo)(nil)).Elem() -} - -type GuestOperationsFault struct { - VimFault -} - -func init() { - t["GuestOperationsFault"] = reflect.TypeOf((*GuestOperationsFault)(nil)).Elem() -} - -type GuestOperationsFaultFault BaseGuestOperationsFault - -func init() { - t["GuestOperationsFaultFault"] = reflect.TypeOf((*GuestOperationsFaultFault)(nil)).Elem() -} - -type GuestOperationsUnavailable struct { - GuestOperationsFault -} - -func init() { - t["GuestOperationsUnavailable"] = reflect.TypeOf((*GuestOperationsUnavailable)(nil)).Elem() -} - -type GuestOperationsUnavailableFault GuestOperationsUnavailable - -func init() { - t["GuestOperationsUnavailableFault"] = reflect.TypeOf((*GuestOperationsUnavailableFault)(nil)).Elem() -} - -type GuestOsDescriptor struct { - DynamicData - - Id string `xml:"id"` - Family string `xml:"family"` - FullName string `xml:"fullName"` - SupportedMaxCPUs int `xml:"supportedMaxCPUs"` - NumSupportedPhysicalSockets int `xml:"numSupportedPhysicalSockets,omitempty"` - NumSupportedCoresPerSocket int `xml:"numSupportedCoresPerSocket,omitempty"` - SupportedMinMemMB int `xml:"supportedMinMemMB"` - SupportedMaxMemMB int `xml:"supportedMaxMemMB"` - RecommendedMemMB int `xml:"recommendedMemMB"` - RecommendedColorDepth int `xml:"recommendedColorDepth"` - SupportedDiskControllerList []string `xml:"supportedDiskControllerList"` - RecommendedSCSIController string `xml:"recommendedSCSIController,omitempty"` - RecommendedDiskController string `xml:"recommendedDiskController"` - SupportedNumDisks int `xml:"supportedNumDisks"` - RecommendedDiskSizeMB int `xml:"recommendedDiskSizeMB"` - RecommendedCdromController string `xml:"recommendedCdromController,omitempty"` - SupportedEthernetCard []string `xml:"supportedEthernetCard"` - RecommendedEthernetCard string `xml:"recommendedEthernetCard,omitempty"` - SupportsSlaveDisk *bool `xml:"supportsSlaveDisk"` - CpuFeatureMask []HostCpuIdInfo `xml:"cpuFeatureMask,omitempty"` - SmcRequired *bool `xml:"smcRequired"` - SupportsWakeOnLan bool `xml:"supportsWakeOnLan"` - SupportsVMI *bool `xml:"supportsVMI"` - SupportsMemoryHotAdd *bool `xml:"supportsMemoryHotAdd"` - SupportsCpuHotAdd *bool `xml:"supportsCpuHotAdd"` - SupportsCpuHotRemove *bool `xml:"supportsCpuHotRemove"` - SupportedFirmware []string `xml:"supportedFirmware,omitempty"` - RecommendedFirmware string `xml:"recommendedFirmware,omitempty"` - SupportedUSBControllerList []string `xml:"supportedUSBControllerList,omitempty"` - RecommendedUSBController string `xml:"recommendedUSBController,omitempty"` - Supports3D *bool `xml:"supports3D"` - Recommended3D *bool `xml:"recommended3D"` - SmcRecommended *bool `xml:"smcRecommended"` - Ich7mRecommended *bool `xml:"ich7mRecommended"` - UsbRecommended *bool `xml:"usbRecommended"` - SupportLevel string `xml:"supportLevel,omitempty"` - SupportedForCreate *bool `xml:"supportedForCreate"` - VRAMSizeInKB *IntOption `xml:"vRAMSizeInKB,omitempty"` -} - -func init() { - t["GuestOsDescriptor"] = reflect.TypeOf((*GuestOsDescriptor)(nil)).Elem() -} - -type GuestPermissionDenied struct { - GuestOperationsFault -} - -func init() { - t["GuestPermissionDenied"] = reflect.TypeOf((*GuestPermissionDenied)(nil)).Elem() -} - -type GuestPermissionDeniedFault GuestPermissionDenied - -func init() { - t["GuestPermissionDeniedFault"] = reflect.TypeOf((*GuestPermissionDeniedFault)(nil)).Elem() -} - -type GuestPosixFileAttributes struct { - GuestFileAttributes - - OwnerId int `xml:"ownerId,omitempty"` - GroupId int `xml:"groupId,omitempty"` - Permissions int64 `xml:"permissions,omitempty"` -} - -func init() { - t["GuestPosixFileAttributes"] = reflect.TypeOf((*GuestPosixFileAttributes)(nil)).Elem() -} - -type GuestProcessInfo struct { - DynamicData - - Name string `xml:"name"` - Pid int64 `xml:"pid"` - Owner string `xml:"owner"` - CmdLine string `xml:"cmdLine"` - StartTime time.Time `xml:"startTime"` - EndTime *time.Time `xml:"endTime"` - ExitCode int `xml:"exitCode,omitempty"` -} - -func init() { - t["GuestProcessInfo"] = reflect.TypeOf((*GuestProcessInfo)(nil)).Elem() -} - -type GuestProcessNotFound struct { - GuestOperationsFault - - Pid int64 `xml:"pid"` -} - -func init() { - t["GuestProcessNotFound"] = reflect.TypeOf((*GuestProcessNotFound)(nil)).Elem() -} - -type GuestProcessNotFoundFault GuestProcessNotFound - -func init() { - t["GuestProcessNotFoundFault"] = reflect.TypeOf((*GuestProcessNotFoundFault)(nil)).Elem() -} - -type GuestProgramSpec struct { - DynamicData - - ProgramPath string `xml:"programPath"` - Arguments string `xml:"arguments"` - WorkingDirectory string `xml:"workingDirectory,omitempty"` - EnvVariables []string `xml:"envVariables,omitempty"` -} - -func init() { - t["GuestProgramSpec"] = reflect.TypeOf((*GuestProgramSpec)(nil)).Elem() -} - -type GuestScreenInfo struct { - DynamicData - - Width int `xml:"width"` - Height int `xml:"height"` -} - -func init() { - t["GuestScreenInfo"] = reflect.TypeOf((*GuestScreenInfo)(nil)).Elem() -} - -type GuestStackInfo struct { - DynamicData - - DnsConfig *NetDnsConfigInfo `xml:"dnsConfig,omitempty"` - IpRouteConfig *NetIpRouteConfigInfo `xml:"ipRouteConfig,omitempty"` - IpStackConfig []KeyValue `xml:"ipStackConfig,omitempty"` - DhcpConfig *NetDhcpConfigInfo `xml:"dhcpConfig,omitempty"` -} - -func init() { - t["GuestStackInfo"] = reflect.TypeOf((*GuestStackInfo)(nil)).Elem() -} - -type GuestWindowsFileAttributes struct { - GuestFileAttributes - - Hidden *bool `xml:"hidden"` - ReadOnly *bool `xml:"readOnly"` - CreateTime *time.Time `xml:"createTime"` -} - -func init() { - t["GuestWindowsFileAttributes"] = reflect.TypeOf((*GuestWindowsFileAttributes)(nil)).Elem() -} - -type GuestWindowsProgramSpec struct { - GuestProgramSpec - - StartMinimized bool `xml:"startMinimized"` -} - -func init() { - t["GuestWindowsProgramSpec"] = reflect.TypeOf((*GuestWindowsProgramSpec)(nil)).Elem() -} - -type HAErrorsAtDest struct { - MigrationFault -} - -func init() { - t["HAErrorsAtDest"] = reflect.TypeOf((*HAErrorsAtDest)(nil)).Elem() -} - -type HAErrorsAtDestFault HAErrorsAtDest - -func init() { - t["HAErrorsAtDestFault"] = reflect.TypeOf((*HAErrorsAtDestFault)(nil)).Elem() -} - -type HasPrivilegeOnEntities HasPrivilegeOnEntitiesRequestType - -func init() { - t["HasPrivilegeOnEntities"] = reflect.TypeOf((*HasPrivilegeOnEntities)(nil)).Elem() -} - -type HasPrivilegeOnEntitiesRequestType struct { - This ManagedObjectReference `xml:"_this"` - Entity []ManagedObjectReference `xml:"entity"` - SessionId string `xml:"sessionId"` - PrivId []string `xml:"privId,omitempty"` -} - -func init() { - t["HasPrivilegeOnEntitiesRequestType"] = reflect.TypeOf((*HasPrivilegeOnEntitiesRequestType)(nil)).Elem() -} - -type HasPrivilegeOnEntitiesResponse struct { - Returnval []EntityPrivilege `xml:"returnval,omitempty"` -} - -type HasPrivilegeOnEntity HasPrivilegeOnEntityRequestType - -func init() { - t["HasPrivilegeOnEntity"] = reflect.TypeOf((*HasPrivilegeOnEntity)(nil)).Elem() -} - -type HasPrivilegeOnEntityRequestType struct { - This ManagedObjectReference `xml:"_this"` - Entity ManagedObjectReference `xml:"entity"` - SessionId string `xml:"sessionId"` - PrivId []string `xml:"privId,omitempty"` -} - -func init() { - t["HasPrivilegeOnEntityRequestType"] = reflect.TypeOf((*HasPrivilegeOnEntityRequestType)(nil)).Elem() -} - -type HasPrivilegeOnEntityResponse struct { - Returnval []bool `xml:"returnval,omitempty"` -} - -type HbrManagerReplicationVmInfo struct { - DynamicData - - State string `xml:"state"` - ProgressInfo *ReplicationVmProgressInfo `xml:"progressInfo,omitempty"` - ImageId string `xml:"imageId,omitempty"` - LastError *LocalizedMethodFault `xml:"lastError,omitempty"` -} - -func init() { - t["HbrManagerReplicationVmInfo"] = reflect.TypeOf((*HbrManagerReplicationVmInfo)(nil)).Elem() -} - -type HealthStatusChangedEvent struct { - Event - - ComponentId string `xml:"componentId"` - OldStatus string `xml:"oldStatus"` - NewStatus string `xml:"newStatus"` - ComponentName string `xml:"componentName"` -} - -func init() { - t["HealthStatusChangedEvent"] = reflect.TypeOf((*HealthStatusChangedEvent)(nil)).Elem() -} - -type HealthSystemRuntime struct { - DynamicData - - SystemHealthInfo *HostSystemHealthInfo `xml:"systemHealthInfo,omitempty"` - HardwareStatusInfo *HostHardwareStatusInfo `xml:"hardwareStatusInfo,omitempty"` -} - -func init() { - t["HealthSystemRuntime"] = reflect.TypeOf((*HealthSystemRuntime)(nil)).Elem() -} - -type HostAccessRestrictedToManagementServer struct { - NotSupported - - ManagementServer string `xml:"managementServer"` -} - -func init() { - t["HostAccessRestrictedToManagementServer"] = reflect.TypeOf((*HostAccessRestrictedToManagementServer)(nil)).Elem() -} - -type HostAccessRestrictedToManagementServerFault HostAccessRestrictedToManagementServer - -func init() { - t["HostAccessRestrictedToManagementServerFault"] = reflect.TypeOf((*HostAccessRestrictedToManagementServerFault)(nil)).Elem() -} - -type HostAccountSpec struct { - DynamicData - - Id string `xml:"id"` - Password string `xml:"password,omitempty"` - Description string `xml:"description,omitempty"` -} - -func init() { - t["HostAccountSpec"] = reflect.TypeOf((*HostAccountSpec)(nil)).Elem() -} - -type HostActiveDirectory struct { - DynamicData - - ChangeOperation string `xml:"changeOperation"` - Spec *HostActiveDirectorySpec `xml:"spec,omitempty"` -} - -func init() { - t["HostActiveDirectory"] = reflect.TypeOf((*HostActiveDirectory)(nil)).Elem() -} - -type HostActiveDirectoryInfo struct { - HostDirectoryStoreInfo - - JoinedDomain string `xml:"joinedDomain,omitempty"` - TrustedDomain []string `xml:"trustedDomain,omitempty"` - DomainMembershipStatus string `xml:"domainMembershipStatus,omitempty"` -} - -func init() { - t["HostActiveDirectoryInfo"] = reflect.TypeOf((*HostActiveDirectoryInfo)(nil)).Elem() -} - -type HostActiveDirectorySpec struct { - DynamicData - - DomainName string `xml:"domainName,omitempty"` - UserName string `xml:"userName,omitempty"` - Password string `xml:"password,omitempty"` - CamServer string `xml:"camServer,omitempty"` - Thumbprint string `xml:"thumbprint,omitempty"` -} - -func init() { - t["HostActiveDirectorySpec"] = reflect.TypeOf((*HostActiveDirectorySpec)(nil)).Elem() -} - -type HostAddFailedEvent struct { - HostEvent - - Hostname string `xml:"hostname"` -} - -func init() { - t["HostAddFailedEvent"] = reflect.TypeOf((*HostAddFailedEvent)(nil)).Elem() -} - -type HostAddedEvent struct { - HostEvent -} - -func init() { - t["HostAddedEvent"] = reflect.TypeOf((*HostAddedEvent)(nil)).Elem() -} - -type HostAdminDisableEvent struct { - HostEvent -} - -func init() { - t["HostAdminDisableEvent"] = reflect.TypeOf((*HostAdminDisableEvent)(nil)).Elem() -} - -type HostAdminEnableEvent struct { - HostEvent -} - -func init() { - t["HostAdminEnableEvent"] = reflect.TypeOf((*HostAdminEnableEvent)(nil)).Elem() -} - -type HostApplyProfile struct { - ApplyProfile - - Memory *HostMemoryProfile `xml:"memory,omitempty"` - Storage *StorageProfile `xml:"storage,omitempty"` - Network *NetworkProfile `xml:"network,omitempty"` - Datetime *DateTimeProfile `xml:"datetime,omitempty"` - Firewall *FirewallProfile `xml:"firewall,omitempty"` - Security *SecurityProfile `xml:"security,omitempty"` - Service []ServiceProfile `xml:"service,omitempty"` - Option []OptionProfile `xml:"option,omitempty"` - UserAccount []UserProfile `xml:"userAccount,omitempty"` - UsergroupAccount []UserGroupProfile `xml:"usergroupAccount,omitempty"` - Authentication *AuthenticationProfile `xml:"authentication,omitempty"` -} - -func init() { - t["HostApplyProfile"] = reflect.TypeOf((*HostApplyProfile)(nil)).Elem() -} - -type HostAuthenticationManagerInfo struct { - DynamicData - - AuthConfig []BaseHostAuthenticationStoreInfo `xml:"authConfig,typeattr"` -} - -func init() { - t["HostAuthenticationManagerInfo"] = reflect.TypeOf((*HostAuthenticationManagerInfo)(nil)).Elem() -} - -type HostAuthenticationStoreInfo struct { - DynamicData - - Enabled bool `xml:"enabled"` -} - -func init() { - t["HostAuthenticationStoreInfo"] = reflect.TypeOf((*HostAuthenticationStoreInfo)(nil)).Elem() -} - -type HostAutoStartManagerConfig struct { - DynamicData - - Defaults *AutoStartDefaults `xml:"defaults,omitempty"` - PowerInfo []AutoStartPowerInfo `xml:"powerInfo,omitempty"` -} - -func init() { - t["HostAutoStartManagerConfig"] = reflect.TypeOf((*HostAutoStartManagerConfig)(nil)).Elem() -} - -type HostBIOSInfo struct { - DynamicData - - BiosVersion string `xml:"biosVersion,omitempty"` - ReleaseDate *time.Time `xml:"releaseDate"` -} - -func init() { - t["HostBIOSInfo"] = reflect.TypeOf((*HostBIOSInfo)(nil)).Elem() -} - -type HostBlockAdapterTargetTransport struct { - HostTargetTransport -} - -func init() { - t["HostBlockAdapterTargetTransport"] = reflect.TypeOf((*HostBlockAdapterTargetTransport)(nil)).Elem() -} - -type HostBlockHba struct { - HostHostBusAdapter -} - -func init() { - t["HostBlockHba"] = reflect.TypeOf((*HostBlockHba)(nil)).Elem() -} - -type HostBootDevice struct { - DynamicData - - Key string `xml:"key"` - Description string `xml:"description"` -} - -func init() { - t["HostBootDevice"] = reflect.TypeOf((*HostBootDevice)(nil)).Elem() -} - -type HostBootDeviceInfo struct { - DynamicData - - BootDevices []HostBootDevice `xml:"bootDevices,omitempty"` - CurrentBootDeviceKey string `xml:"currentBootDeviceKey,omitempty"` -} - -func init() { - t["HostBootDeviceInfo"] = reflect.TypeOf((*HostBootDeviceInfo)(nil)).Elem() -} - -type HostCacheConfigurationInfo struct { - DynamicData - - Key ManagedObjectReference `xml:"key"` - SwapSize int64 `xml:"swapSize"` -} - -func init() { - t["HostCacheConfigurationInfo"] = reflect.TypeOf((*HostCacheConfigurationInfo)(nil)).Elem() -} - -type HostCacheConfigurationSpec struct { - DynamicData - - Datastore ManagedObjectReference `xml:"datastore"` - SwapSize int64 `xml:"swapSize"` -} - -func init() { - t["HostCacheConfigurationSpec"] = reflect.TypeOf((*HostCacheConfigurationSpec)(nil)).Elem() -} - -type HostCapability struct { - DynamicData - - RecursiveResourcePoolsSupported bool `xml:"recursiveResourcePoolsSupported"` - CpuMemoryResourceConfigurationSupported bool `xml:"cpuMemoryResourceConfigurationSupported"` - RebootSupported bool `xml:"rebootSupported"` - ShutdownSupported bool `xml:"shutdownSupported"` - VmotionSupported bool `xml:"vmotionSupported"` - StandbySupported bool `xml:"standbySupported"` - IpmiSupported *bool `xml:"ipmiSupported"` - MaxSupportedVMs int `xml:"maxSupportedVMs,omitempty"` - MaxRunningVMs int `xml:"maxRunningVMs,omitempty"` - MaxSupportedVcpus int `xml:"maxSupportedVcpus,omitempty"` - MaxRegisteredVMs int `xml:"maxRegisteredVMs,omitempty"` - DatastorePrincipalSupported bool `xml:"datastorePrincipalSupported"` - SanSupported bool `xml:"sanSupported"` - NfsSupported bool `xml:"nfsSupported"` - IscsiSupported bool `xml:"iscsiSupported"` - VlanTaggingSupported bool `xml:"vlanTaggingSupported"` - NicTeamingSupported bool `xml:"nicTeamingSupported"` - HighGuestMemSupported bool `xml:"highGuestMemSupported"` - MaintenanceModeSupported bool `xml:"maintenanceModeSupported"` - SuspendedRelocateSupported bool `xml:"suspendedRelocateSupported"` - RestrictedSnapshotRelocateSupported bool `xml:"restrictedSnapshotRelocateSupported"` - PerVmSwapFiles bool `xml:"perVmSwapFiles"` - LocalSwapDatastoreSupported bool `xml:"localSwapDatastoreSupported"` - UnsharedSwapVMotionSupported bool `xml:"unsharedSwapVMotionSupported"` - BackgroundSnapshotsSupported bool `xml:"backgroundSnapshotsSupported"` - PreAssignedPCIUnitNumbersSupported bool `xml:"preAssignedPCIUnitNumbersSupported"` - ScreenshotSupported bool `xml:"screenshotSupported"` - ScaledScreenshotSupported bool `xml:"scaledScreenshotSupported"` - StorageVMotionSupported *bool `xml:"storageVMotionSupported"` - VmotionWithStorageVMotionSupported *bool `xml:"vmotionWithStorageVMotionSupported"` - VmotionAcrossNetworkSupported *bool `xml:"vmotionAcrossNetworkSupported"` - HbrNicSelectionSupported *bool `xml:"hbrNicSelectionSupported"` - RecordReplaySupported *bool `xml:"recordReplaySupported"` - FtSupported *bool `xml:"ftSupported"` - ReplayUnsupportedReason string `xml:"replayUnsupportedReason,omitempty"` - ReplayCompatibilityIssues []string `xml:"replayCompatibilityIssues,omitempty"` - FtCompatibilityIssues []string `xml:"ftCompatibilityIssues,omitempty"` - LoginBySSLThumbprintSupported *bool `xml:"loginBySSLThumbprintSupported"` - CloneFromSnapshotSupported *bool `xml:"cloneFromSnapshotSupported"` - DeltaDiskBackingsSupported *bool `xml:"deltaDiskBackingsSupported"` - PerVMNetworkTrafficShapingSupported *bool `xml:"perVMNetworkTrafficShapingSupported"` - TpmSupported *bool `xml:"tpmSupported"` - SupportedCpuFeature []HostCpuIdInfo `xml:"supportedCpuFeature,omitempty"` - VirtualExecUsageSupported *bool `xml:"virtualExecUsageSupported"` - StorageIORMSupported *bool `xml:"storageIORMSupported"` - VmDirectPathGen2Supported *bool `xml:"vmDirectPathGen2Supported"` - VmDirectPathGen2UnsupportedReason []string `xml:"vmDirectPathGen2UnsupportedReason,omitempty"` - VmDirectPathGen2UnsupportedReasonExtended string `xml:"vmDirectPathGen2UnsupportedReasonExtended,omitempty"` - SupportedVmfsMajorVersion []int `xml:"supportedVmfsMajorVersion,omitempty"` - VStorageCapable *bool `xml:"vStorageCapable"` - SnapshotRelayoutSupported *bool `xml:"snapshotRelayoutSupported"` - FirewallIpRulesSupported *bool `xml:"firewallIpRulesSupported"` - ServicePackageInfoSupported *bool `xml:"servicePackageInfoSupported"` - MaxHostRunningVms int `xml:"maxHostRunningVms,omitempty"` - MaxHostSupportedVcpus int `xml:"maxHostSupportedVcpus,omitempty"` - VmfsDatastoreMountCapable *bool `xml:"vmfsDatastoreMountCapable"` - EightPlusHostVmfsSharedAccessSupported *bool `xml:"eightPlusHostVmfsSharedAccessSupported"` - NestedHVSupported *bool `xml:"nestedHVSupported"` - VPMCSupported *bool `xml:"vPMCSupported"` - InterVMCommunicationThroughVMCISupported *bool `xml:"interVMCommunicationThroughVMCISupported"` - ScheduledHardwareUpgradeSupported *bool `xml:"scheduledHardwareUpgradeSupported"` - FeatureCapabilitiesSupported *bool `xml:"featureCapabilitiesSupported"` - LatencySensitivitySupported *bool `xml:"latencySensitivitySupported"` - StoragePolicySupported *bool `xml:"storagePolicySupported"` - Accel3dSupported *bool `xml:"accel3dSupported"` - ReliableMemoryAware *bool `xml:"reliableMemoryAware"` - MultipleNetworkStackInstanceSupported *bool `xml:"multipleNetworkStackInstanceSupported"` - VsanSupported *bool `xml:"vsanSupported"` - VFlashSupported *bool `xml:"vFlashSupported"` -} - -func init() { - t["HostCapability"] = reflect.TypeOf((*HostCapability)(nil)).Elem() -} - -type HostCnxFailedAccountFailedEvent struct { - HostEvent -} - -func init() { - t["HostCnxFailedAccountFailedEvent"] = reflect.TypeOf((*HostCnxFailedAccountFailedEvent)(nil)).Elem() -} - -type HostCnxFailedAlreadyManagedEvent struct { - HostEvent - - ServerName string `xml:"serverName"` -} - -func init() { - t["HostCnxFailedAlreadyManagedEvent"] = reflect.TypeOf((*HostCnxFailedAlreadyManagedEvent)(nil)).Elem() -} - -type HostCnxFailedBadCcagentEvent struct { - HostEvent -} - -func init() { - t["HostCnxFailedBadCcagentEvent"] = reflect.TypeOf((*HostCnxFailedBadCcagentEvent)(nil)).Elem() -} - -type HostCnxFailedBadUsernameEvent struct { - HostEvent -} - -func init() { - t["HostCnxFailedBadUsernameEvent"] = reflect.TypeOf((*HostCnxFailedBadUsernameEvent)(nil)).Elem() -} - -type HostCnxFailedBadVersionEvent struct { - HostEvent -} - -func init() { - t["HostCnxFailedBadVersionEvent"] = reflect.TypeOf((*HostCnxFailedBadVersionEvent)(nil)).Elem() -} - -type HostCnxFailedCcagentUpgradeEvent struct { - HostEvent -} - -func init() { - t["HostCnxFailedCcagentUpgradeEvent"] = reflect.TypeOf((*HostCnxFailedCcagentUpgradeEvent)(nil)).Elem() -} - -type HostCnxFailedEvent struct { - HostEvent -} - -func init() { - t["HostCnxFailedEvent"] = reflect.TypeOf((*HostCnxFailedEvent)(nil)).Elem() -} - -type HostCnxFailedNetworkErrorEvent struct { - HostEvent -} - -func init() { - t["HostCnxFailedNetworkErrorEvent"] = reflect.TypeOf((*HostCnxFailedNetworkErrorEvent)(nil)).Elem() -} - -type HostCnxFailedNoAccessEvent struct { - HostEvent -} - -func init() { - t["HostCnxFailedNoAccessEvent"] = reflect.TypeOf((*HostCnxFailedNoAccessEvent)(nil)).Elem() -} - -type HostCnxFailedNoConnectionEvent struct { - HostEvent -} - -func init() { - t["HostCnxFailedNoConnectionEvent"] = reflect.TypeOf((*HostCnxFailedNoConnectionEvent)(nil)).Elem() -} - -type HostCnxFailedNoLicenseEvent struct { - HostEvent -} - -func init() { - t["HostCnxFailedNoLicenseEvent"] = reflect.TypeOf((*HostCnxFailedNoLicenseEvent)(nil)).Elem() -} - -type HostCnxFailedNotFoundEvent struct { - HostEvent -} - -func init() { - t["HostCnxFailedNotFoundEvent"] = reflect.TypeOf((*HostCnxFailedNotFoundEvent)(nil)).Elem() -} - -type HostCnxFailedTimeoutEvent struct { - HostEvent -} - -func init() { - t["HostCnxFailedTimeoutEvent"] = reflect.TypeOf((*HostCnxFailedTimeoutEvent)(nil)).Elem() -} - -type HostCommunication struct { - RuntimeFault -} - -func init() { - t["HostCommunication"] = reflect.TypeOf((*HostCommunication)(nil)).Elem() -} - -type HostCommunicationFault BaseHostCommunication - -func init() { - t["HostCommunicationFault"] = reflect.TypeOf((*HostCommunicationFault)(nil)).Elem() -} - -type HostComplianceCheckedEvent struct { - HostEvent - - Profile ProfileEventArgument `xml:"profile"` -} - -func init() { - t["HostComplianceCheckedEvent"] = reflect.TypeOf((*HostComplianceCheckedEvent)(nil)).Elem() -} - -type HostCompliantEvent struct { - HostEvent -} - -func init() { - t["HostCompliantEvent"] = reflect.TypeOf((*HostCompliantEvent)(nil)).Elem() -} - -type HostConfigAppliedEvent struct { - HostEvent -} - -func init() { - t["HostConfigAppliedEvent"] = reflect.TypeOf((*HostConfigAppliedEvent)(nil)).Elem() -} - -type HostConfigChange struct { - DynamicData -} - -func init() { - t["HostConfigChange"] = reflect.TypeOf((*HostConfigChange)(nil)).Elem() -} - -type HostConfigFailed struct { - HostConfigFault - - Failure []LocalizedMethodFault `xml:"failure"` -} - -func init() { - t["HostConfigFailed"] = reflect.TypeOf((*HostConfigFailed)(nil)).Elem() -} - -type HostConfigFailedFault HostConfigFailed - -func init() { - t["HostConfigFailedFault"] = reflect.TypeOf((*HostConfigFailedFault)(nil)).Elem() -} - -type HostConfigFault struct { - VimFault -} - -func init() { - t["HostConfigFault"] = reflect.TypeOf((*HostConfigFault)(nil)).Elem() -} - -type HostConfigFaultFault BaseHostConfigFault - -func init() { - t["HostConfigFaultFault"] = reflect.TypeOf((*HostConfigFaultFault)(nil)).Elem() -} - -type HostConfigInfo struct { - DynamicData - - Host ManagedObjectReference `xml:"host"` - Product AboutInfo `xml:"product"` - HyperThread *HostHyperThreadScheduleInfo `xml:"hyperThread,omitempty"` - ConsoleReservation *ServiceConsoleReservationInfo `xml:"consoleReservation,omitempty"` - VirtualMachineReservation *VirtualMachineMemoryReservationInfo `xml:"virtualMachineReservation,omitempty"` - StorageDevice *HostStorageDeviceInfo `xml:"storageDevice,omitempty"` - MultipathState *HostMultipathStateInfo `xml:"multipathState,omitempty"` - FileSystemVolume *HostFileSystemVolumeInfo `xml:"fileSystemVolume,omitempty"` - SystemFile []string `xml:"systemFile,omitempty"` - Network *HostNetworkInfo `xml:"network,omitempty"` - Vmotion *HostVMotionInfo `xml:"vmotion,omitempty"` - VirtualNicManagerInfo *HostVirtualNicManagerInfo `xml:"virtualNicManagerInfo,omitempty"` - Capabilities *HostNetCapabilities `xml:"capabilities,omitempty"` - DatastoreCapabilities *HostDatastoreSystemCapabilities `xml:"datastoreCapabilities,omitempty"` - OffloadCapabilities *HostNetOffloadCapabilities `xml:"offloadCapabilities,omitempty"` - Service *HostServiceInfo `xml:"service,omitempty"` - Firewall *HostFirewallInfo `xml:"firewall,omitempty"` - AutoStart *HostAutoStartManagerConfig `xml:"autoStart,omitempty"` - ActiveDiagnosticPartition *HostDiagnosticPartition `xml:"activeDiagnosticPartition,omitempty"` - Option []BaseOptionValue `xml:"option,omitempty,typeattr"` - OptionDef []OptionDef `xml:"optionDef,omitempty"` - DatastorePrincipal string `xml:"datastorePrincipal,omitempty"` - LocalSwapDatastore *ManagedObjectReference `xml:"localSwapDatastore,omitempty"` - SystemSwapConfiguration *HostSystemSwapConfiguration `xml:"systemSwapConfiguration,omitempty"` - SystemResources *HostSystemResourceInfo `xml:"systemResources,omitempty"` - DateTimeInfo *HostDateTimeInfo `xml:"dateTimeInfo,omitempty"` - Flags *HostFlagInfo `xml:"flags,omitempty"` - AdminDisabled *bool `xml:"adminDisabled"` - Ipmi *HostIpmiInfo `xml:"ipmi,omitempty"` - SslThumbprintInfo *HostSslThumbprintInfo `xml:"sslThumbprintInfo,omitempty"` - SslThumbprintData []HostSslThumbprintInfo `xml:"sslThumbprintData,omitempty"` - Certificate []byte `xml:"certificate,omitempty"` - PciPassthruInfo []BaseHostPciPassthruInfo `xml:"pciPassthruInfo,omitempty,typeattr"` - AuthenticationManagerInfo *HostAuthenticationManagerInfo `xml:"authenticationManagerInfo,omitempty"` - FeatureVersion []HostFeatureVersionInfo `xml:"featureVersion,omitempty"` - PowerSystemCapability *PowerSystemCapability `xml:"powerSystemCapability,omitempty"` - PowerSystemInfo *PowerSystemInfo `xml:"powerSystemInfo,omitempty"` - CacheConfigurationInfo []HostCacheConfigurationInfo `xml:"cacheConfigurationInfo,omitempty"` - WakeOnLanCapable *bool `xml:"wakeOnLanCapable"` - FeatureCapability []HostFeatureCapability `xml:"featureCapability,omitempty"` - MaskedFeatureCapability []HostFeatureCapability `xml:"maskedFeatureCapability,omitempty"` - VFlashConfigInfo *HostVFlashManagerVFlashConfigInfo `xml:"vFlashConfigInfo,omitempty"` - VsanHostConfig *VsanHostConfigInfo `xml:"vsanHostConfig,omitempty"` - GraphicsInfo []HostGraphicsInfo `xml:"graphicsInfo,omitempty"` -} - -func init() { - t["HostConfigInfo"] = reflect.TypeOf((*HostConfigInfo)(nil)).Elem() -} - -type HostConfigManager struct { - DynamicData - - CpuScheduler *ManagedObjectReference `xml:"cpuScheduler,omitempty"` - DatastoreSystem *ManagedObjectReference `xml:"datastoreSystem,omitempty"` - MemoryManager *ManagedObjectReference `xml:"memoryManager,omitempty"` - StorageSystem *ManagedObjectReference `xml:"storageSystem,omitempty"` - NetworkSystem *ManagedObjectReference `xml:"networkSystem,omitempty"` - VmotionSystem *ManagedObjectReference `xml:"vmotionSystem,omitempty"` - VirtualNicManager *ManagedObjectReference `xml:"virtualNicManager,omitempty"` - ServiceSystem *ManagedObjectReference `xml:"serviceSystem,omitempty"` - FirewallSystem *ManagedObjectReference `xml:"firewallSystem,omitempty"` - AdvancedOption *ManagedObjectReference `xml:"advancedOption,omitempty"` - DiagnosticSystem *ManagedObjectReference `xml:"diagnosticSystem,omitempty"` - AutoStartManager *ManagedObjectReference `xml:"autoStartManager,omitempty"` - SnmpSystem *ManagedObjectReference `xml:"snmpSystem,omitempty"` - DateTimeSystem *ManagedObjectReference `xml:"dateTimeSystem,omitempty"` - PatchManager *ManagedObjectReference `xml:"patchManager,omitempty"` - ImageConfigManager *ManagedObjectReference `xml:"imageConfigManager,omitempty"` - BootDeviceSystem *ManagedObjectReference `xml:"bootDeviceSystem,omitempty"` - FirmwareSystem *ManagedObjectReference `xml:"firmwareSystem,omitempty"` - HealthStatusSystem *ManagedObjectReference `xml:"healthStatusSystem,omitempty"` - PciPassthruSystem *ManagedObjectReference `xml:"pciPassthruSystem,omitempty"` - LicenseManager *ManagedObjectReference `xml:"licenseManager,omitempty"` - KernelModuleSystem *ManagedObjectReference `xml:"kernelModuleSystem,omitempty"` - AuthenticationManager *ManagedObjectReference `xml:"authenticationManager,omitempty"` - PowerSystem *ManagedObjectReference `xml:"powerSystem,omitempty"` - CacheConfigurationManager *ManagedObjectReference `xml:"cacheConfigurationManager,omitempty"` - EsxAgentHostManager *ManagedObjectReference `xml:"esxAgentHostManager,omitempty"` - IscsiManager *ManagedObjectReference `xml:"iscsiManager,omitempty"` - VFlashManager *ManagedObjectReference `xml:"vFlashManager,omitempty"` - VsanSystem *ManagedObjectReference `xml:"vsanSystem,omitempty"` - GraphicsManager *ManagedObjectReference `xml:"graphicsManager,omitempty"` - VsanInternalSystem *ManagedObjectReference `xml:"vsanInternalSystem,omitempty"` -} - -func init() { - t["HostConfigManager"] = reflect.TypeOf((*HostConfigManager)(nil)).Elem() -} - -type HostConfigSpec struct { - DynamicData - - NasDatastore []HostNasVolumeConfig `xml:"nasDatastore,omitempty"` - Network *HostNetworkConfig `xml:"network,omitempty"` - NicTypeSelection []HostVirtualNicManagerNicTypeSelection `xml:"nicTypeSelection,omitempty"` - Service []HostServiceConfig `xml:"service,omitempty"` - Firewall *HostFirewallConfig `xml:"firewall,omitempty"` - Option []BaseOptionValue `xml:"option,omitempty,typeattr"` - DatastorePrincipal string `xml:"datastorePrincipal,omitempty"` - DatastorePrincipalPasswd string `xml:"datastorePrincipalPasswd,omitempty"` - Datetime *HostDateTimeConfig `xml:"datetime,omitempty"` - StorageDevice *HostStorageDeviceInfo `xml:"storageDevice,omitempty"` - License *HostLicenseSpec `xml:"license,omitempty"` - Security *HostSecuritySpec `xml:"security,omitempty"` - UserAccount []BaseHostAccountSpec `xml:"userAccount,omitempty,typeattr"` - UsergroupAccount []BaseHostAccountSpec `xml:"usergroupAccount,omitempty,typeattr"` - Memory *HostMemorySpec `xml:"memory,omitempty"` - ActiveDirectory []HostActiveDirectory `xml:"activeDirectory,omitempty"` - GenericConfig []KeyAnyValue `xml:"genericConfig,omitempty"` -} - -func init() { - t["HostConfigSpec"] = reflect.TypeOf((*HostConfigSpec)(nil)).Elem() -} - -type HostConfigSummary struct { - DynamicData - - Name string `xml:"name"` - Port int `xml:"port"` - SslThumbprint string `xml:"sslThumbprint,omitempty"` - Product *AboutInfo `xml:"product,omitempty"` - VmotionEnabled bool `xml:"vmotionEnabled"` - FaultToleranceEnabled *bool `xml:"faultToleranceEnabled"` - FeatureVersion []HostFeatureVersionInfo `xml:"featureVersion,omitempty"` - AgentVmDatastore *ManagedObjectReference `xml:"agentVmDatastore,omitempty"` - AgentVmNetwork *ManagedObjectReference `xml:"agentVmNetwork,omitempty"` -} - -func init() { - t["HostConfigSummary"] = reflect.TypeOf((*HostConfigSummary)(nil)).Elem() -} - -type HostConfigVFlashCache HostConfigVFlashCacheRequestType - -func init() { - t["HostConfigVFlashCache"] = reflect.TypeOf((*HostConfigVFlashCache)(nil)).Elem() -} - -type HostConfigVFlashCacheRequestType struct { - This ManagedObjectReference `xml:"_this"` - Spec HostVFlashManagerVFlashCacheConfigSpec `xml:"spec"` -} - -func init() { - t["HostConfigVFlashCacheRequestType"] = reflect.TypeOf((*HostConfigVFlashCacheRequestType)(nil)).Elem() -} - -type HostConfigVFlashCacheResponse struct { -} - -type HostConfigureVFlashResource HostConfigureVFlashResourceRequestType - -func init() { - t["HostConfigureVFlashResource"] = reflect.TypeOf((*HostConfigureVFlashResource)(nil)).Elem() -} - -type HostConfigureVFlashResourceRequestType struct { - This ManagedObjectReference `xml:"_this"` - Spec HostVFlashManagerVFlashResourceConfigSpec `xml:"spec"` -} - -func init() { - t["HostConfigureVFlashResourceRequestType"] = reflect.TypeOf((*HostConfigureVFlashResourceRequestType)(nil)).Elem() -} - -type HostConfigureVFlashResourceResponse struct { -} - -type HostConnectFault struct { - VimFault -} - -func init() { - t["HostConnectFault"] = reflect.TypeOf((*HostConnectFault)(nil)).Elem() -} - -type HostConnectFaultFault BaseHostConnectFault - -func init() { - t["HostConnectFaultFault"] = reflect.TypeOf((*HostConnectFaultFault)(nil)).Elem() -} - -type HostConnectInfo struct { - DynamicData - - ServerIp string `xml:"serverIp,omitempty"` - InDasCluster *bool `xml:"inDasCluster"` - Host HostListSummary `xml:"host"` - Vm []VirtualMachineSummary `xml:"vm,omitempty"` - VimAccountNameRequired *bool `xml:"vimAccountNameRequired"` - ClusterSupported *bool `xml:"clusterSupported"` - Network []BaseHostConnectInfoNetworkInfo `xml:"network,omitempty,typeattr"` - Datastore []BaseHostDatastoreConnectInfo `xml:"datastore,omitempty,typeattr"` - License *HostLicenseConnectInfo `xml:"license,omitempty"` -} - -func init() { - t["HostConnectInfo"] = reflect.TypeOf((*HostConnectInfo)(nil)).Elem() -} - -type HostConnectInfoNetworkInfo struct { - DynamicData - - Summary BaseNetworkSummary `xml:"summary,typeattr"` -} - -func init() { - t["HostConnectInfoNetworkInfo"] = reflect.TypeOf((*HostConnectInfoNetworkInfo)(nil)).Elem() -} - -type HostConnectSpec struct { - DynamicData - - HostName string `xml:"hostName,omitempty"` - Port int `xml:"port,omitempty"` - SslThumbprint string `xml:"sslThumbprint,omitempty"` - UserName string `xml:"userName,omitempty"` - Password string `xml:"password,omitempty"` - VmFolder *ManagedObjectReference `xml:"vmFolder,omitempty"` - Force bool `xml:"force"` - VimAccountName string `xml:"vimAccountName,omitempty"` - VimAccountPassword string `xml:"vimAccountPassword,omitempty"` - ManagementIp string `xml:"managementIp,omitempty"` -} - -func init() { - t["HostConnectSpec"] = reflect.TypeOf((*HostConnectSpec)(nil)).Elem() -} - -type HostConnectedEvent struct { - HostEvent -} - -func init() { - t["HostConnectedEvent"] = reflect.TypeOf((*HostConnectedEvent)(nil)).Elem() -} - -type HostConnectionLostEvent struct { - HostEvent -} - -func init() { - t["HostConnectionLostEvent"] = reflect.TypeOf((*HostConnectionLostEvent)(nil)).Elem() -} - -type HostCpuIdInfo struct { - DynamicData - - Level int `xml:"level"` - Vendor string `xml:"vendor,omitempty"` - Eax string `xml:"eax,omitempty"` - Ebx string `xml:"ebx,omitempty"` - Ecx string `xml:"ecx,omitempty"` - Edx string `xml:"edx,omitempty"` -} - -func init() { - t["HostCpuIdInfo"] = reflect.TypeOf((*HostCpuIdInfo)(nil)).Elem() -} - -type HostCpuInfo struct { - DynamicData - - NumCpuPackages int16 `xml:"numCpuPackages"` - NumCpuCores int16 `xml:"numCpuCores"` - NumCpuThreads int16 `xml:"numCpuThreads"` - Hz int64 `xml:"hz"` -} - -func init() { - t["HostCpuInfo"] = reflect.TypeOf((*HostCpuInfo)(nil)).Elem() -} - -type HostCpuPackage struct { - DynamicData - - Index int16 `xml:"index"` - Vendor string `xml:"vendor"` - Hz int64 `xml:"hz"` - BusHz int64 `xml:"busHz"` - Description string `xml:"description"` - ThreadId []int16 `xml:"threadId"` - CpuFeature []HostCpuIdInfo `xml:"cpuFeature,omitempty"` -} - -func init() { - t["HostCpuPackage"] = reflect.TypeOf((*HostCpuPackage)(nil)).Elem() -} - -type HostCpuPowerManagementInfo struct { - DynamicData - - CurrentPolicy string `xml:"currentPolicy,omitempty"` - HardwareSupport string `xml:"hardwareSupport,omitempty"` -} - -func init() { - t["HostCpuPowerManagementInfo"] = reflect.TypeOf((*HostCpuPowerManagementInfo)(nil)).Elem() -} - -type HostDasDisabledEvent struct { - HostEvent -} - -func init() { - t["HostDasDisabledEvent"] = reflect.TypeOf((*HostDasDisabledEvent)(nil)).Elem() -} - -type HostDasDisablingEvent struct { - HostEvent -} - -func init() { - t["HostDasDisablingEvent"] = reflect.TypeOf((*HostDasDisablingEvent)(nil)).Elem() -} - -type HostDasEnabledEvent struct { - HostEvent -} - -func init() { - t["HostDasEnabledEvent"] = reflect.TypeOf((*HostDasEnabledEvent)(nil)).Elem() -} - -type HostDasEnablingEvent struct { - HostEvent -} - -func init() { - t["HostDasEnablingEvent"] = reflect.TypeOf((*HostDasEnablingEvent)(nil)).Elem() -} - -type HostDasErrorEvent struct { - HostEvent - - Message string `xml:"message,omitempty"` - Reason string `xml:"reason,omitempty"` -} - -func init() { - t["HostDasErrorEvent"] = reflect.TypeOf((*HostDasErrorEvent)(nil)).Elem() -} - -type HostDasEvent struct { - HostEvent -} - -func init() { - t["HostDasEvent"] = reflect.TypeOf((*HostDasEvent)(nil)).Elem() -} - -type HostDasOkEvent struct { - HostEvent -} - -func init() { - t["HostDasOkEvent"] = reflect.TypeOf((*HostDasOkEvent)(nil)).Elem() -} - -type HostDatastoreBrowserSearchResults struct { - DynamicData - - Datastore *ManagedObjectReference `xml:"datastore,omitempty"` - FolderPath string `xml:"folderPath,omitempty"` - File []BaseFileInfo `xml:"file,omitempty,typeattr"` -} - -func init() { - t["HostDatastoreBrowserSearchResults"] = reflect.TypeOf((*HostDatastoreBrowserSearchResults)(nil)).Elem() -} - -type HostDatastoreBrowserSearchSpec struct { - DynamicData - - Query []BaseFileQuery `xml:"query,omitempty,typeattr"` - Details *FileQueryFlags `xml:"details,omitempty"` - SearchCaseInsensitive *bool `xml:"searchCaseInsensitive"` - MatchPattern []string `xml:"matchPattern,omitempty"` - SortFoldersFirst *bool `xml:"sortFoldersFirst"` -} - -func init() { - t["HostDatastoreBrowserSearchSpec"] = reflect.TypeOf((*HostDatastoreBrowserSearchSpec)(nil)).Elem() -} - -type HostDatastoreConnectInfo struct { - DynamicData - - Summary DatastoreSummary `xml:"summary"` -} - -func init() { - t["HostDatastoreConnectInfo"] = reflect.TypeOf((*HostDatastoreConnectInfo)(nil)).Elem() -} - -type HostDatastoreExistsConnectInfo struct { - HostDatastoreConnectInfo - - NewDatastoreName string `xml:"newDatastoreName"` -} - -func init() { - t["HostDatastoreExistsConnectInfo"] = reflect.TypeOf((*HostDatastoreExistsConnectInfo)(nil)).Elem() -} - -type HostDatastoreNameConflictConnectInfo struct { - HostDatastoreConnectInfo - - NewDatastoreName string `xml:"newDatastoreName"` -} - -func init() { - t["HostDatastoreNameConflictConnectInfo"] = reflect.TypeOf((*HostDatastoreNameConflictConnectInfo)(nil)).Elem() -} - -type HostDatastoreSystemCapabilities struct { - DynamicData - - NfsMountCreationRequired bool `xml:"nfsMountCreationRequired"` - NfsMountCreationSupported bool `xml:"nfsMountCreationSupported"` - LocalDatastoreSupported bool `xml:"localDatastoreSupported"` - VmfsExtentExpansionSupported *bool `xml:"vmfsExtentExpansionSupported"` -} - -func init() { - t["HostDatastoreSystemCapabilities"] = reflect.TypeOf((*HostDatastoreSystemCapabilities)(nil)).Elem() -} - -type HostDateTimeConfig struct { - DynamicData - - TimeZone string `xml:"timeZone,omitempty"` - NtpConfig *HostNtpConfig `xml:"ntpConfig,omitempty"` -} - -func init() { - t["HostDateTimeConfig"] = reflect.TypeOf((*HostDateTimeConfig)(nil)).Elem() -} - -type HostDateTimeInfo struct { - DynamicData - - TimeZone HostDateTimeSystemTimeZone `xml:"timeZone"` - NtpConfig *HostNtpConfig `xml:"ntpConfig,omitempty"` -} - -func init() { - t["HostDateTimeInfo"] = reflect.TypeOf((*HostDateTimeInfo)(nil)).Elem() -} - -type HostDateTimeSystemTimeZone struct { - DynamicData - - Key string `xml:"key"` - Name string `xml:"name"` - Description string `xml:"description"` - GmtOffset int `xml:"gmtOffset"` -} - -func init() { - t["HostDateTimeSystemTimeZone"] = reflect.TypeOf((*HostDateTimeSystemTimeZone)(nil)).Elem() -} - -type HostDevice struct { - DynamicData - - DeviceName string `xml:"deviceName"` - DeviceType string `xml:"deviceType"` -} - -func init() { - t["HostDevice"] = reflect.TypeOf((*HostDevice)(nil)).Elem() -} - -type HostDhcpService struct { - DynamicData - - Key string `xml:"key"` - Spec HostDhcpServiceSpec `xml:"spec"` -} - -func init() { - t["HostDhcpService"] = reflect.TypeOf((*HostDhcpService)(nil)).Elem() -} - -type HostDhcpServiceConfig struct { - DynamicData - - ChangeOperation string `xml:"changeOperation,omitempty"` - Key string `xml:"key"` - Spec HostDhcpServiceSpec `xml:"spec"` -} - -func init() { - t["HostDhcpServiceConfig"] = reflect.TypeOf((*HostDhcpServiceConfig)(nil)).Elem() -} - -type HostDhcpServiceSpec struct { - DynamicData - - VirtualSwitch string `xml:"virtualSwitch"` - DefaultLeaseDuration int `xml:"defaultLeaseDuration"` - LeaseBeginIp string `xml:"leaseBeginIp"` - LeaseEndIp string `xml:"leaseEndIp"` - MaxLeaseDuration int `xml:"maxLeaseDuration"` - UnlimitedLease bool `xml:"unlimitedLease"` - IpSubnetAddr string `xml:"ipSubnetAddr"` - IpSubnetMask string `xml:"ipSubnetMask"` -} - -func init() { - t["HostDhcpServiceSpec"] = reflect.TypeOf((*HostDhcpServiceSpec)(nil)).Elem() -} - -type HostDiagnosticPartition struct { - DynamicData - - StorageType string `xml:"storageType"` - DiagnosticType string `xml:"diagnosticType"` - Slots int `xml:"slots"` - Id HostScsiDiskPartition `xml:"id"` -} - -func init() { - t["HostDiagnosticPartition"] = reflect.TypeOf((*HostDiagnosticPartition)(nil)).Elem() -} - -type HostDiagnosticPartitionCreateDescription struct { - DynamicData - - Layout HostDiskPartitionLayout `xml:"layout"` - DiskUuid string `xml:"diskUuid"` - Spec HostDiagnosticPartitionCreateSpec `xml:"spec"` -} - -func init() { - t["HostDiagnosticPartitionCreateDescription"] = reflect.TypeOf((*HostDiagnosticPartitionCreateDescription)(nil)).Elem() -} - -type HostDiagnosticPartitionCreateOption struct { - DynamicData - - StorageType string `xml:"storageType"` - DiagnosticType string `xml:"diagnosticType"` - Disk HostScsiDisk `xml:"disk"` -} - -func init() { - t["HostDiagnosticPartitionCreateOption"] = reflect.TypeOf((*HostDiagnosticPartitionCreateOption)(nil)).Elem() -} - -type HostDiagnosticPartitionCreateSpec struct { - DynamicData - - StorageType string `xml:"storageType"` - DiagnosticType string `xml:"diagnosticType"` - Id HostScsiDiskPartition `xml:"id"` - Partition HostDiskPartitionSpec `xml:"partition"` - Active *bool `xml:"active"` -} - -func init() { - t["HostDiagnosticPartitionCreateSpec"] = reflect.TypeOf((*HostDiagnosticPartitionCreateSpec)(nil)).Elem() -} - -type HostDigestInfo struct { - DynamicData - - DigestMethod string `xml:"digestMethod"` - DigestValue []byte `xml:"digestValue"` - ObjectName string `xml:"objectName,omitempty"` -} - -func init() { - t["HostDigestInfo"] = reflect.TypeOf((*HostDigestInfo)(nil)).Elem() -} - -type HostDirectoryStoreInfo struct { - HostAuthenticationStoreInfo -} - -func init() { - t["HostDirectoryStoreInfo"] = reflect.TypeOf((*HostDirectoryStoreInfo)(nil)).Elem() -} - -type HostDisconnectedEvent struct { - HostEvent - - Reason string `xml:"reason,omitempty"` -} - -func init() { - t["HostDisconnectedEvent"] = reflect.TypeOf((*HostDisconnectedEvent)(nil)).Elem() -} - -type HostDiskConfigurationResult struct { - DynamicData - - DevicePath string `xml:"devicePath,omitempty"` - Success *bool `xml:"success"` - Fault *LocalizedMethodFault `xml:"fault,omitempty"` -} - -func init() { - t["HostDiskConfigurationResult"] = reflect.TypeOf((*HostDiskConfigurationResult)(nil)).Elem() -} - -type HostDiskDimensions struct { - DynamicData -} - -func init() { - t["HostDiskDimensions"] = reflect.TypeOf((*HostDiskDimensions)(nil)).Elem() -} - -type HostDiskDimensionsChs struct { - DynamicData - - Cylinder int64 `xml:"cylinder"` - Head int `xml:"head"` - Sector int `xml:"sector"` -} - -func init() { - t["HostDiskDimensionsChs"] = reflect.TypeOf((*HostDiskDimensionsChs)(nil)).Elem() -} - -type HostDiskDimensionsLba struct { - DynamicData - - BlockSize int `xml:"blockSize"` - Block int64 `xml:"block"` -} - -func init() { - t["HostDiskDimensionsLba"] = reflect.TypeOf((*HostDiskDimensionsLba)(nil)).Elem() -} - -type HostDiskMappingInfo struct { - DynamicData - - PhysicalPartition *HostDiskMappingPartitionInfo `xml:"physicalPartition,omitempty"` - Name string `xml:"name"` - Exclusive *bool `xml:"exclusive"` -} - -func init() { - t["HostDiskMappingInfo"] = reflect.TypeOf((*HostDiskMappingInfo)(nil)).Elem() -} - -type HostDiskMappingOption struct { - DynamicData - - PhysicalPartition []HostDiskMappingPartitionOption `xml:"physicalPartition,omitempty"` - Name string `xml:"name"` -} - -func init() { - t["HostDiskMappingOption"] = reflect.TypeOf((*HostDiskMappingOption)(nil)).Elem() -} - -type HostDiskMappingPartitionInfo struct { - DynamicData - - Name string `xml:"name"` - FileSystem string `xml:"fileSystem"` - CapacityInKb int64 `xml:"capacityInKb"` -} - -func init() { - t["HostDiskMappingPartitionInfo"] = reflect.TypeOf((*HostDiskMappingPartitionInfo)(nil)).Elem() -} - -type HostDiskMappingPartitionOption struct { - DynamicData - - Name string `xml:"name"` - FileSystem string `xml:"fileSystem"` - CapacityInKb int64 `xml:"capacityInKb"` -} - -func init() { - t["HostDiskMappingPartitionOption"] = reflect.TypeOf((*HostDiskMappingPartitionOption)(nil)).Elem() -} - -type HostDiskPartitionAttributes struct { - DynamicData - - Partition int `xml:"partition"` - StartSector int64 `xml:"startSector"` - EndSector int64 `xml:"endSector"` - Type string `xml:"type"` - Guid string `xml:"guid,omitempty"` - Logical bool `xml:"logical"` - Attributes byte `xml:"attributes"` - PartitionAlignment int64 `xml:"partitionAlignment,omitempty"` -} - -func init() { - t["HostDiskPartitionAttributes"] = reflect.TypeOf((*HostDiskPartitionAttributes)(nil)).Elem() -} - -type HostDiskPartitionBlockRange struct { - DynamicData - - Partition int `xml:"partition,omitempty"` - Type string `xml:"type"` - Start HostDiskDimensionsLba `xml:"start"` - End HostDiskDimensionsLba `xml:"end"` -} - -func init() { - t["HostDiskPartitionBlockRange"] = reflect.TypeOf((*HostDiskPartitionBlockRange)(nil)).Elem() -} - -type HostDiskPartitionInfo struct { - DynamicData - - DeviceName string `xml:"deviceName"` - Spec HostDiskPartitionSpec `xml:"spec"` - Layout HostDiskPartitionLayout `xml:"layout"` -} - -func init() { - t["HostDiskPartitionInfo"] = reflect.TypeOf((*HostDiskPartitionInfo)(nil)).Elem() -} - -type HostDiskPartitionLayout struct { - DynamicData - - Total *HostDiskDimensionsLba `xml:"total,omitempty"` - Partition []HostDiskPartitionBlockRange `xml:"partition"` -} - -func init() { - t["HostDiskPartitionLayout"] = reflect.TypeOf((*HostDiskPartitionLayout)(nil)).Elem() -} - -type HostDiskPartitionSpec struct { - DynamicData - - PartitionFormat string `xml:"partitionFormat,omitempty"` - Chs *HostDiskDimensionsChs `xml:"chs,omitempty"` - TotalSectors int64 `xml:"totalSectors,omitempty"` - Partition []HostDiskPartitionAttributes `xml:"partition,omitempty"` -} - -func init() { - t["HostDiskPartitionSpec"] = reflect.TypeOf((*HostDiskPartitionSpec)(nil)).Elem() -} - -type HostDnsConfig struct { - DynamicData - - Dhcp bool `xml:"dhcp"` - VirtualNicDevice string `xml:"virtualNicDevice,omitempty"` - HostName string `xml:"hostName"` - DomainName string `xml:"domainName"` - Address []string `xml:"address,omitempty"` - SearchDomain []string `xml:"searchDomain,omitempty"` -} - -func init() { - t["HostDnsConfig"] = reflect.TypeOf((*HostDnsConfig)(nil)).Elem() -} - -type HostDnsConfigSpec struct { - HostDnsConfig - - VirtualNicConnection *HostVirtualNicConnection `xml:"virtualNicConnection,omitempty"` -} - -func init() { - t["HostDnsConfigSpec"] = reflect.TypeOf((*HostDnsConfigSpec)(nil)).Elem() -} - -type HostEnableAdminFailedEvent struct { - HostEvent - - Permissions []Permission `xml:"permissions"` -} - -func init() { - t["HostEnableAdminFailedEvent"] = reflect.TypeOf((*HostEnableAdminFailedEvent)(nil)).Elem() -} - -type HostEsxAgentHostManagerConfigInfo struct { - DynamicData - - AgentVmDatastore *ManagedObjectReference `xml:"agentVmDatastore,omitempty"` - AgentVmNetwork *ManagedObjectReference `xml:"agentVmNetwork,omitempty"` -} - -func init() { - t["HostEsxAgentHostManagerConfigInfo"] = reflect.TypeOf((*HostEsxAgentHostManagerConfigInfo)(nil)).Elem() -} - -type HostEvent struct { - Event -} - -func init() { - t["HostEvent"] = reflect.TypeOf((*HostEvent)(nil)).Elem() -} - -type HostEventArgument struct { - EntityEventArgument - - Host ManagedObjectReference `xml:"host"` -} - -func init() { - t["HostEventArgument"] = reflect.TypeOf((*HostEventArgument)(nil)).Elem() -} - -type HostExtraNetworksEvent struct { - HostDasEvent - - Ips string `xml:"ips,omitempty"` -} - -func init() { - t["HostExtraNetworksEvent"] = reflect.TypeOf((*HostExtraNetworksEvent)(nil)).Elem() -} - -type HostFeatureCapability struct { - DynamicData - - Key string `xml:"key"` - FeatureName string `xml:"featureName"` - Value string `xml:"value"` -} - -func init() { - t["HostFeatureCapability"] = reflect.TypeOf((*HostFeatureCapability)(nil)).Elem() -} - -type HostFeatureMask struct { - DynamicData - - Key string `xml:"key"` - FeatureName string `xml:"featureName"` - Value string `xml:"value"` -} - -func init() { - t["HostFeatureMask"] = reflect.TypeOf((*HostFeatureMask)(nil)).Elem() -} - -type HostFeatureVersionInfo struct { - DynamicData - - Key string `xml:"key"` - Value string `xml:"value"` -} - -func init() { - t["HostFeatureVersionInfo"] = reflect.TypeOf((*HostFeatureVersionInfo)(nil)).Elem() -} - -type HostFibreChannelHba struct { - HostHostBusAdapter - - PortWorldWideName int64 `xml:"portWorldWideName"` - NodeWorldWideName int64 `xml:"nodeWorldWideName"` - PortType FibreChannelPortType `xml:"portType"` - Speed int64 `xml:"speed"` -} - -func init() { - t["HostFibreChannelHba"] = reflect.TypeOf((*HostFibreChannelHba)(nil)).Elem() -} - -type HostFibreChannelOverEthernetHba struct { - HostFibreChannelHba - - UnderlyingNic string `xml:"underlyingNic"` - LinkInfo HostFibreChannelOverEthernetHbaLinkInfo `xml:"linkInfo"` - IsSoftwareFcoe bool `xml:"isSoftwareFcoe"` - MarkedForRemoval bool `xml:"markedForRemoval"` -} - -func init() { - t["HostFibreChannelOverEthernetHba"] = reflect.TypeOf((*HostFibreChannelOverEthernetHba)(nil)).Elem() -} - -type HostFibreChannelOverEthernetHbaLinkInfo struct { - DynamicData - - VnportMac string `xml:"vnportMac"` - FcfMac string `xml:"fcfMac"` - VlanId int `xml:"vlanId"` -} - -func init() { - t["HostFibreChannelOverEthernetHbaLinkInfo"] = reflect.TypeOf((*HostFibreChannelOverEthernetHbaLinkInfo)(nil)).Elem() -} - -type HostFibreChannelOverEthernetTargetTransport struct { - HostFibreChannelTargetTransport - - VnportMac string `xml:"vnportMac"` - FcfMac string `xml:"fcfMac"` - VlanId int `xml:"vlanId"` -} - -func init() { - t["HostFibreChannelOverEthernetTargetTransport"] = reflect.TypeOf((*HostFibreChannelOverEthernetTargetTransport)(nil)).Elem() -} - -type HostFibreChannelTargetTransport struct { - HostTargetTransport - - PortWorldWideName int64 `xml:"portWorldWideName"` - NodeWorldWideName int64 `xml:"nodeWorldWideName"` -} - -func init() { - t["HostFibreChannelTargetTransport"] = reflect.TypeOf((*HostFibreChannelTargetTransport)(nil)).Elem() -} - -type HostFileAccess struct { - DynamicData - - Who string `xml:"who"` - What string `xml:"what"` -} - -func init() { - t["HostFileAccess"] = reflect.TypeOf((*HostFileAccess)(nil)).Elem() -} - -type HostFileSystemMountInfo struct { - DynamicData - - MountInfo HostMountInfo `xml:"mountInfo"` - Volume BaseHostFileSystemVolume `xml:"volume,typeattr"` - VStorageSupport string `xml:"vStorageSupport,omitempty"` -} - -func init() { - t["HostFileSystemMountInfo"] = reflect.TypeOf((*HostFileSystemMountInfo)(nil)).Elem() -} - -type HostFileSystemVolume struct { - DynamicData - - Type string `xml:"type"` - Name string `xml:"name"` - Capacity int64 `xml:"capacity"` -} - -func init() { - t["HostFileSystemVolume"] = reflect.TypeOf((*HostFileSystemVolume)(nil)).Elem() -} - -type HostFileSystemVolumeInfo struct { - DynamicData - - VolumeTypeList []string `xml:"volumeTypeList,omitempty"` - MountInfo []HostFileSystemMountInfo `xml:"mountInfo,omitempty"` -} - -func init() { - t["HostFileSystemVolumeInfo"] = reflect.TypeOf((*HostFileSystemVolumeInfo)(nil)).Elem() -} - -type HostFirewallConfig struct { - DynamicData - - Rule []HostFirewallConfigRuleSetConfig `xml:"rule,omitempty"` - DefaultBlockingPolicy HostFirewallDefaultPolicy `xml:"defaultBlockingPolicy"` -} - -func init() { - t["HostFirewallConfig"] = reflect.TypeOf((*HostFirewallConfig)(nil)).Elem() -} - -type HostFirewallConfigRuleSetConfig struct { - DynamicData - - RulesetId string `xml:"rulesetId"` - Enabled bool `xml:"enabled"` - AllowedHosts *HostFirewallRulesetIpList `xml:"allowedHosts,omitempty"` -} - -func init() { - t["HostFirewallConfigRuleSetConfig"] = reflect.TypeOf((*HostFirewallConfigRuleSetConfig)(nil)).Elem() -} - -type HostFirewallDefaultPolicy struct { - DynamicData - - IncomingBlocked *bool `xml:"incomingBlocked"` - OutgoingBlocked *bool `xml:"outgoingBlocked"` -} - -func init() { - t["HostFirewallDefaultPolicy"] = reflect.TypeOf((*HostFirewallDefaultPolicy)(nil)).Elem() -} - -type HostFirewallInfo struct { - DynamicData - - DefaultPolicy HostFirewallDefaultPolicy `xml:"defaultPolicy"` - Ruleset []HostFirewallRuleset `xml:"ruleset,omitempty"` -} - -func init() { - t["HostFirewallInfo"] = reflect.TypeOf((*HostFirewallInfo)(nil)).Elem() -} - -type HostFirewallRule struct { - DynamicData - - Port int `xml:"port"` - EndPort int `xml:"endPort,omitempty"` - Direction HostFirewallRuleDirection `xml:"direction"` - PortType HostFirewallRulePortType `xml:"portType,omitempty"` - Protocol string `xml:"protocol"` -} - -func init() { - t["HostFirewallRule"] = reflect.TypeOf((*HostFirewallRule)(nil)).Elem() -} - -type HostFirewallRuleset struct { - DynamicData - - Key string `xml:"key"` - Label string `xml:"label"` - Required bool `xml:"required"` - Rule []HostFirewallRule `xml:"rule"` - Service string `xml:"service,omitempty"` - Enabled bool `xml:"enabled"` - AllowedHosts *HostFirewallRulesetIpList `xml:"allowedHosts,omitempty"` -} - -func init() { - t["HostFirewallRuleset"] = reflect.TypeOf((*HostFirewallRuleset)(nil)).Elem() -} - -type HostFirewallRulesetIpList struct { - DynamicData - - IpAddress []string `xml:"ipAddress,omitempty"` - IpNetwork []HostFirewallRulesetIpNetwork `xml:"ipNetwork,omitempty"` - AllIp bool `xml:"allIp"` -} - -func init() { - t["HostFirewallRulesetIpList"] = reflect.TypeOf((*HostFirewallRulesetIpList)(nil)).Elem() -} - -type HostFirewallRulesetIpNetwork struct { - DynamicData - - Network string `xml:"network"` - PrefixLength int `xml:"prefixLength"` -} - -func init() { - t["HostFirewallRulesetIpNetwork"] = reflect.TypeOf((*HostFirewallRulesetIpNetwork)(nil)).Elem() -} - -type HostFirewallRulesetRulesetSpec struct { - DynamicData - - AllowedHosts HostFirewallRulesetIpList `xml:"allowedHosts"` -} - -func init() { - t["HostFirewallRulesetRulesetSpec"] = reflect.TypeOf((*HostFirewallRulesetRulesetSpec)(nil)).Elem() -} - -type HostFlagInfo struct { - DynamicData - - BackgroundSnapshotsEnabled *bool `xml:"backgroundSnapshotsEnabled"` -} - -func init() { - t["HostFlagInfo"] = reflect.TypeOf((*HostFlagInfo)(nil)).Elem() -} - -type HostForceMountedInfo struct { - DynamicData - - Persist bool `xml:"persist"` - Mounted bool `xml:"mounted"` -} - -func init() { - t["HostForceMountedInfo"] = reflect.TypeOf((*HostForceMountedInfo)(nil)).Elem() -} - -type HostGetShortNameFailedEvent struct { - HostEvent -} - -func init() { - t["HostGetShortNameFailedEvent"] = reflect.TypeOf((*HostGetShortNameFailedEvent)(nil)).Elem() -} - -type HostGetVFlashModuleDefaultConfig HostGetVFlashModuleDefaultConfigRequestType - -func init() { - t["HostGetVFlashModuleDefaultConfig"] = reflect.TypeOf((*HostGetVFlashModuleDefaultConfig)(nil)).Elem() -} - -type HostGetVFlashModuleDefaultConfigRequestType struct { - This ManagedObjectReference `xml:"_this"` - VFlashModule string `xml:"vFlashModule"` -} - -func init() { - t["HostGetVFlashModuleDefaultConfigRequestType"] = reflect.TypeOf((*HostGetVFlashModuleDefaultConfigRequestType)(nil)).Elem() -} - -type HostGetVFlashModuleDefaultConfigResponse struct { - Returnval VirtualDiskVFlashCacheConfigInfo `xml:"returnval"` -} - -type HostGraphicsInfo struct { - DynamicData - - DeviceName string `xml:"deviceName"` - VendorName string `xml:"vendorName"` - PciId string `xml:"pciId"` - GraphicsType string `xml:"graphicsType"` - MemorySizeInKB int64 `xml:"memorySizeInKB"` - Vm []ManagedObjectReference `xml:"vm,omitempty"` -} - -func init() { - t["HostGraphicsInfo"] = reflect.TypeOf((*HostGraphicsInfo)(nil)).Elem() -} - -type HostHardwareElementInfo struct { - DynamicData - - Name string `xml:"name"` - Status BaseElementDescription `xml:"status,typeattr"` -} - -func init() { - t["HostHardwareElementInfo"] = reflect.TypeOf((*HostHardwareElementInfo)(nil)).Elem() -} - -type HostHardwareInfo struct { - DynamicData - - SystemInfo HostSystemInfo `xml:"systemInfo"` - CpuPowerManagementInfo *HostCpuPowerManagementInfo `xml:"cpuPowerManagementInfo,omitempty"` - CpuInfo HostCpuInfo `xml:"cpuInfo"` - CpuPkg []HostCpuPackage `xml:"cpuPkg"` - MemorySize int64 `xml:"memorySize"` - NumaInfo *HostNumaInfo `xml:"numaInfo,omitempty"` - SmcPresent *bool `xml:"smcPresent"` - PciDevice []HostPciDevice `xml:"pciDevice,omitempty"` - CpuFeature []HostCpuIdInfo `xml:"cpuFeature,omitempty"` - BiosInfo *HostBIOSInfo `xml:"biosInfo,omitempty"` - ReliableMemoryInfo *HostReliableMemoryInfo `xml:"reliableMemoryInfo,omitempty"` -} - -func init() { - t["HostHardwareInfo"] = reflect.TypeOf((*HostHardwareInfo)(nil)).Elem() -} - -type HostHardwareStatusInfo struct { - DynamicData - - MemoryStatusInfo []BaseHostHardwareElementInfo `xml:"memoryStatusInfo,omitempty,typeattr"` - CpuStatusInfo []BaseHostHardwareElementInfo `xml:"cpuStatusInfo,omitempty,typeattr"` - StorageStatusInfo []HostStorageElementInfo `xml:"storageStatusInfo,omitempty"` -} - -func init() { - t["HostHardwareStatusInfo"] = reflect.TypeOf((*HostHardwareStatusInfo)(nil)).Elem() -} - -type HostHardwareSummary struct { - DynamicData - - Vendor string `xml:"vendor"` - Model string `xml:"model"` - Uuid string `xml:"uuid"` - OtherIdentifyingInfo []HostSystemIdentificationInfo `xml:"otherIdentifyingInfo,omitempty"` - MemorySize int64 `xml:"memorySize"` - CpuModel string `xml:"cpuModel"` - CpuMhz int `xml:"cpuMhz"` - NumCpuPkgs int16 `xml:"numCpuPkgs"` - NumCpuCores int16 `xml:"numCpuCores"` - NumCpuThreads int16 `xml:"numCpuThreads"` - NumNics int `xml:"numNics"` - NumHBAs int `xml:"numHBAs"` -} - -func init() { - t["HostHardwareSummary"] = reflect.TypeOf((*HostHardwareSummary)(nil)).Elem() -} - -type HostHostBusAdapter struct { - DynamicData - - Key string `xml:"key,omitempty"` - Device string `xml:"device"` - Bus int `xml:"bus"` - Status string `xml:"status"` - Model string `xml:"model"` - Driver string `xml:"driver,omitempty"` - Pci string `xml:"pci,omitempty"` -} - -func init() { - t["HostHostBusAdapter"] = reflect.TypeOf((*HostHostBusAdapter)(nil)).Elem() -} - -type HostHyperThreadScheduleInfo struct { - DynamicData - - Available bool `xml:"available"` - Active bool `xml:"active"` - Config bool `xml:"config"` -} - -func init() { - t["HostHyperThreadScheduleInfo"] = reflect.TypeOf((*HostHyperThreadScheduleInfo)(nil)).Elem() -} - -type HostImageConfigGetAcceptance HostImageConfigGetAcceptanceRequestType - -func init() { - t["HostImageConfigGetAcceptance"] = reflect.TypeOf((*HostImageConfigGetAcceptance)(nil)).Elem() -} - -type HostImageConfigGetAcceptanceRequestType struct { - This ManagedObjectReference `xml:"_this"` -} - -func init() { - t["HostImageConfigGetAcceptanceRequestType"] = reflect.TypeOf((*HostImageConfigGetAcceptanceRequestType)(nil)).Elem() -} - -type HostImageConfigGetAcceptanceResponse struct { - Returnval string `xml:"returnval"` -} - -type HostImageConfigGetProfile HostImageConfigGetProfileRequestType - -func init() { - t["HostImageConfigGetProfile"] = reflect.TypeOf((*HostImageConfigGetProfile)(nil)).Elem() -} - -type HostImageConfigGetProfileRequestType struct { - This ManagedObjectReference `xml:"_this"` -} - -func init() { - t["HostImageConfigGetProfileRequestType"] = reflect.TypeOf((*HostImageConfigGetProfileRequestType)(nil)).Elem() -} - -type HostImageConfigGetProfileResponse struct { - Returnval HostImageProfileSummary `xml:"returnval"` -} - -type HostImageProfileSummary struct { - DynamicData - - Name string `xml:"name"` - Vendor string `xml:"vendor"` -} - -func init() { - t["HostImageProfileSummary"] = reflect.TypeOf((*HostImageProfileSummary)(nil)).Elem() -} - -type HostInAuditModeEvent struct { - HostEvent -} - -func init() { - t["HostInAuditModeEvent"] = reflect.TypeOf((*HostInAuditModeEvent)(nil)).Elem() -} - -type HostInDomain struct { - HostConfigFault -} - -func init() { - t["HostInDomain"] = reflect.TypeOf((*HostInDomain)(nil)).Elem() -} - -type HostInDomainFault HostInDomain - -func init() { - t["HostInDomainFault"] = reflect.TypeOf((*HostInDomainFault)(nil)).Elem() -} - -type HostIncompatibleForFaultTolerance struct { - VmFaultToleranceIssue - - HostName string `xml:"hostName,omitempty"` - Reason string `xml:"reason,omitempty"` -} - -func init() { - t["HostIncompatibleForFaultTolerance"] = reflect.TypeOf((*HostIncompatibleForFaultTolerance)(nil)).Elem() -} - -type HostIncompatibleForFaultToleranceFault HostIncompatibleForFaultTolerance - -func init() { - t["HostIncompatibleForFaultToleranceFault"] = reflect.TypeOf((*HostIncompatibleForFaultToleranceFault)(nil)).Elem() -} - -type HostIncompatibleForRecordReplay struct { - VimFault - - HostName string `xml:"hostName,omitempty"` - Reason string `xml:"reason,omitempty"` -} - -func init() { - t["HostIncompatibleForRecordReplay"] = reflect.TypeOf((*HostIncompatibleForRecordReplay)(nil)).Elem() -} - -type HostIncompatibleForRecordReplayFault HostIncompatibleForRecordReplay - -func init() { - t["HostIncompatibleForRecordReplayFault"] = reflect.TypeOf((*HostIncompatibleForRecordReplayFault)(nil)).Elem() -} - -type HostInternetScsiHba struct { - HostHostBusAdapter - - IsSoftwareBased bool `xml:"isSoftwareBased"` - CanBeDisabled *bool `xml:"canBeDisabled"` - NetworkBindingSupport HostInternetScsiHbaNetworkBindingSupportType `xml:"networkBindingSupport,omitempty"` - DiscoveryCapabilities HostInternetScsiHbaDiscoveryCapabilities `xml:"discoveryCapabilities"` - DiscoveryProperties HostInternetScsiHbaDiscoveryProperties `xml:"discoveryProperties"` - AuthenticationCapabilities HostInternetScsiHbaAuthenticationCapabilities `xml:"authenticationCapabilities"` - AuthenticationProperties HostInternetScsiHbaAuthenticationProperties `xml:"authenticationProperties"` - DigestCapabilities *HostInternetScsiHbaDigestCapabilities `xml:"digestCapabilities,omitempty"` - DigestProperties *HostInternetScsiHbaDigestProperties `xml:"digestProperties,omitempty"` - IpCapabilities HostInternetScsiHbaIPCapabilities `xml:"ipCapabilities"` - IpProperties HostInternetScsiHbaIPProperties `xml:"ipProperties"` - SupportedAdvancedOptions []OptionDef `xml:"supportedAdvancedOptions,omitempty"` - AdvancedOptions []HostInternetScsiHbaParamValue `xml:"advancedOptions,omitempty"` - IScsiName string `xml:"iScsiName"` - IScsiAlias string `xml:"iScsiAlias,omitempty"` - ConfiguredSendTarget []HostInternetScsiHbaSendTarget `xml:"configuredSendTarget,omitempty"` - ConfiguredStaticTarget []HostInternetScsiHbaStaticTarget `xml:"configuredStaticTarget,omitempty"` - MaxSpeedMb int `xml:"maxSpeedMb,omitempty"` - CurrentSpeedMb int `xml:"currentSpeedMb,omitempty"` -} - -func init() { - t["HostInternetScsiHba"] = reflect.TypeOf((*HostInternetScsiHba)(nil)).Elem() -} - -type HostInternetScsiHbaAuthenticationCapabilities struct { - DynamicData - - ChapAuthSettable bool `xml:"chapAuthSettable"` - Krb5AuthSettable bool `xml:"krb5AuthSettable"` - SrpAuthSettable bool `xml:"srpAuthSettable"` - SpkmAuthSettable bool `xml:"spkmAuthSettable"` - MutualChapSettable *bool `xml:"mutualChapSettable"` - TargetChapSettable *bool `xml:"targetChapSettable"` - TargetMutualChapSettable *bool `xml:"targetMutualChapSettable"` -} - -func init() { - t["HostInternetScsiHbaAuthenticationCapabilities"] = reflect.TypeOf((*HostInternetScsiHbaAuthenticationCapabilities)(nil)).Elem() -} - -type HostInternetScsiHbaAuthenticationProperties struct { - DynamicData - - ChapAuthEnabled bool `xml:"chapAuthEnabled"` - ChapName string `xml:"chapName,omitempty"` - ChapSecret string `xml:"chapSecret,omitempty"` - ChapAuthenticationType string `xml:"chapAuthenticationType,omitempty"` - ChapInherited *bool `xml:"chapInherited"` - MutualChapName string `xml:"mutualChapName,omitempty"` - MutualChapSecret string `xml:"mutualChapSecret,omitempty"` - MutualChapAuthenticationType string `xml:"mutualChapAuthenticationType,omitempty"` - MutualChapInherited *bool `xml:"mutualChapInherited"` -} - -func init() { - t["HostInternetScsiHbaAuthenticationProperties"] = reflect.TypeOf((*HostInternetScsiHbaAuthenticationProperties)(nil)).Elem() -} - -type HostInternetScsiHbaDigestCapabilities struct { - DynamicData - - HeaderDigestSettable *bool `xml:"headerDigestSettable"` - DataDigestSettable *bool `xml:"dataDigestSettable"` - TargetHeaderDigestSettable *bool `xml:"targetHeaderDigestSettable"` - TargetDataDigestSettable *bool `xml:"targetDataDigestSettable"` -} - -func init() { - t["HostInternetScsiHbaDigestCapabilities"] = reflect.TypeOf((*HostInternetScsiHbaDigestCapabilities)(nil)).Elem() -} - -type HostInternetScsiHbaDigestProperties struct { - DynamicData - - HeaderDigestType string `xml:"headerDigestType,omitempty"` - HeaderDigestInherited *bool `xml:"headerDigestInherited"` - DataDigestType string `xml:"dataDigestType,omitempty"` - DataDigestInherited *bool `xml:"dataDigestInherited"` -} - -func init() { - t["HostInternetScsiHbaDigestProperties"] = reflect.TypeOf((*HostInternetScsiHbaDigestProperties)(nil)).Elem() -} - -type HostInternetScsiHbaDiscoveryCapabilities struct { - DynamicData - - ISnsDiscoverySettable bool `xml:"iSnsDiscoverySettable"` - SlpDiscoverySettable bool `xml:"slpDiscoverySettable"` - StaticTargetDiscoverySettable bool `xml:"staticTargetDiscoverySettable"` - SendTargetsDiscoverySettable bool `xml:"sendTargetsDiscoverySettable"` -} - -func init() { - t["HostInternetScsiHbaDiscoveryCapabilities"] = reflect.TypeOf((*HostInternetScsiHbaDiscoveryCapabilities)(nil)).Elem() -} - -type HostInternetScsiHbaDiscoveryProperties struct { - DynamicData - - ISnsDiscoveryEnabled bool `xml:"iSnsDiscoveryEnabled"` - ISnsDiscoveryMethod string `xml:"iSnsDiscoveryMethod,omitempty"` - ISnsHost string `xml:"iSnsHost,omitempty"` - SlpDiscoveryEnabled bool `xml:"slpDiscoveryEnabled"` - SlpDiscoveryMethod string `xml:"slpDiscoveryMethod,omitempty"` - SlpHost string `xml:"slpHost,omitempty"` - StaticTargetDiscoveryEnabled bool `xml:"staticTargetDiscoveryEnabled"` - SendTargetsDiscoveryEnabled bool `xml:"sendTargetsDiscoveryEnabled"` -} - -func init() { - t["HostInternetScsiHbaDiscoveryProperties"] = reflect.TypeOf((*HostInternetScsiHbaDiscoveryProperties)(nil)).Elem() -} - -type HostInternetScsiHbaIPCapabilities struct { - DynamicData - - AddressSettable bool `xml:"addressSettable"` - IpConfigurationMethodSettable bool `xml:"ipConfigurationMethodSettable"` - SubnetMaskSettable bool `xml:"subnetMaskSettable"` - DefaultGatewaySettable bool `xml:"defaultGatewaySettable"` - PrimaryDnsServerAddressSettable bool `xml:"primaryDnsServerAddressSettable"` - AlternateDnsServerAddressSettable bool `xml:"alternateDnsServerAddressSettable"` - Ipv6Supported *bool `xml:"ipv6Supported"` - ArpRedirectSettable *bool `xml:"arpRedirectSettable"` - MtuSettable *bool `xml:"mtuSettable"` - HostNameAsTargetAddress *bool `xml:"hostNameAsTargetAddress"` - NameAliasSettable *bool `xml:"nameAliasSettable"` -} - -func init() { - t["HostInternetScsiHbaIPCapabilities"] = reflect.TypeOf((*HostInternetScsiHbaIPCapabilities)(nil)).Elem() -} - -type HostInternetScsiHbaIPProperties struct { - DynamicData - - Mac string `xml:"mac,omitempty"` - Address string `xml:"address,omitempty"` - DhcpConfigurationEnabled bool `xml:"dhcpConfigurationEnabled"` - SubnetMask string `xml:"subnetMask,omitempty"` - DefaultGateway string `xml:"defaultGateway,omitempty"` - PrimaryDnsServerAddress string `xml:"primaryDnsServerAddress,omitempty"` - AlternateDnsServerAddress string `xml:"alternateDnsServerAddress,omitempty"` - Ipv6Address string `xml:"ipv6Address,omitempty"` - Ipv6SubnetMask string `xml:"ipv6SubnetMask,omitempty"` - Ipv6DefaultGateway string `xml:"ipv6DefaultGateway,omitempty"` - ArpRedirectEnabled *bool `xml:"arpRedirectEnabled"` - Mtu int `xml:"mtu,omitempty"` - JumboFramesEnabled *bool `xml:"jumboFramesEnabled"` -} - -func init() { - t["HostInternetScsiHbaIPProperties"] = reflect.TypeOf((*HostInternetScsiHbaIPProperties)(nil)).Elem() -} - -type HostInternetScsiHbaParamValue struct { - OptionValue - - IsInherited *bool `xml:"isInherited"` -} - -func init() { - t["HostInternetScsiHbaParamValue"] = reflect.TypeOf((*HostInternetScsiHbaParamValue)(nil)).Elem() -} - -type HostInternetScsiHbaSendTarget struct { - DynamicData - - Address string `xml:"address"` - Port int `xml:"port,omitempty"` - AuthenticationProperties *HostInternetScsiHbaAuthenticationProperties `xml:"authenticationProperties,omitempty"` - DigestProperties *HostInternetScsiHbaDigestProperties `xml:"digestProperties,omitempty"` - SupportedAdvancedOptions []OptionDef `xml:"supportedAdvancedOptions,omitempty"` - AdvancedOptions []HostInternetScsiHbaParamValue `xml:"advancedOptions,omitempty"` - Parent string `xml:"parent,omitempty"` -} - -func init() { - t["HostInternetScsiHbaSendTarget"] = reflect.TypeOf((*HostInternetScsiHbaSendTarget)(nil)).Elem() -} - -type HostInternetScsiHbaStaticTarget struct { - DynamicData - - Address string `xml:"address"` - Port int `xml:"port,omitempty"` - IScsiName string `xml:"iScsiName"` - DiscoveryMethod string `xml:"discoveryMethod,omitempty"` - AuthenticationProperties *HostInternetScsiHbaAuthenticationProperties `xml:"authenticationProperties,omitempty"` - DigestProperties *HostInternetScsiHbaDigestProperties `xml:"digestProperties,omitempty"` - SupportedAdvancedOptions []OptionDef `xml:"supportedAdvancedOptions,omitempty"` - AdvancedOptions []HostInternetScsiHbaParamValue `xml:"advancedOptions,omitempty"` - Parent string `xml:"parent,omitempty"` -} - -func init() { - t["HostInternetScsiHbaStaticTarget"] = reflect.TypeOf((*HostInternetScsiHbaStaticTarget)(nil)).Elem() -} - -type HostInternetScsiHbaTargetSet struct { - DynamicData - - StaticTargets []HostInternetScsiHbaStaticTarget `xml:"staticTargets,omitempty"` - SendTargets []HostInternetScsiHbaSendTarget `xml:"sendTargets,omitempty"` -} - -func init() { - t["HostInternetScsiHbaTargetSet"] = reflect.TypeOf((*HostInternetScsiHbaTargetSet)(nil)).Elem() -} - -type HostInternetScsiTargetTransport struct { - HostTargetTransport - - IScsiName string `xml:"iScsiName"` - IScsiAlias string `xml:"iScsiAlias"` - Address []string `xml:"address,omitempty"` -} - -func init() { - t["HostInternetScsiTargetTransport"] = reflect.TypeOf((*HostInternetScsiTargetTransport)(nil)).Elem() -} - -type HostInventoryFull struct { - NotEnoughLicenses - - Capacity int `xml:"capacity"` -} - -func init() { - t["HostInventoryFull"] = reflect.TypeOf((*HostInventoryFull)(nil)).Elem() -} - -type HostInventoryFullEvent struct { - LicenseEvent - - Capacity int `xml:"capacity"` -} - -func init() { - t["HostInventoryFullEvent"] = reflect.TypeOf((*HostInventoryFullEvent)(nil)).Elem() -} - -type HostInventoryFullFault HostInventoryFull - -func init() { - t["HostInventoryFullFault"] = reflect.TypeOf((*HostInventoryFullFault)(nil)).Elem() -} - -type HostInventoryUnreadableEvent struct { - Event -} - -func init() { - t["HostInventoryUnreadableEvent"] = reflect.TypeOf((*HostInventoryUnreadableEvent)(nil)).Elem() -} - -type HostIpChangedEvent struct { - HostEvent - - OldIP string `xml:"oldIP"` - NewIP string `xml:"newIP"` -} - -func init() { - t["HostIpChangedEvent"] = reflect.TypeOf((*HostIpChangedEvent)(nil)).Elem() -} - -type HostIpConfig struct { - DynamicData - - Dhcp bool `xml:"dhcp"` - IpAddress string `xml:"ipAddress,omitempty"` - SubnetMask string `xml:"subnetMask,omitempty"` - IpV6Config *HostIpConfigIpV6AddressConfiguration `xml:"ipV6Config,omitempty"` -} - -func init() { - t["HostIpConfig"] = reflect.TypeOf((*HostIpConfig)(nil)).Elem() -} - -type HostIpConfigIpV6Address struct { - DynamicData - - IpAddress string `xml:"ipAddress"` - PrefixLength int `xml:"prefixLength"` - Origin string `xml:"origin,omitempty"` - DadState string `xml:"dadState,omitempty"` - Lifetime *time.Time `xml:"lifetime"` - Operation string `xml:"operation,omitempty"` -} - -func init() { - t["HostIpConfigIpV6Address"] = reflect.TypeOf((*HostIpConfigIpV6Address)(nil)).Elem() -} - -type HostIpConfigIpV6AddressConfiguration struct { - DynamicData - - IpV6Address []HostIpConfigIpV6Address `xml:"ipV6Address,omitempty"` - AutoConfigurationEnabled *bool `xml:"autoConfigurationEnabled"` - DhcpV6Enabled *bool `xml:"dhcpV6Enabled"` -} - -func init() { - t["HostIpConfigIpV6AddressConfiguration"] = reflect.TypeOf((*HostIpConfigIpV6AddressConfiguration)(nil)).Elem() -} - -type HostIpInconsistentEvent struct { - HostEvent - - IpAddress string `xml:"ipAddress"` - IpAddress2 string `xml:"ipAddress2"` -} - -func init() { - t["HostIpInconsistentEvent"] = reflect.TypeOf((*HostIpInconsistentEvent)(nil)).Elem() -} - -type HostIpRouteConfig struct { - DynamicData - - DefaultGateway string `xml:"defaultGateway,omitempty"` - GatewayDevice string `xml:"gatewayDevice,omitempty"` - IpV6DefaultGateway string `xml:"ipV6DefaultGateway,omitempty"` - IpV6GatewayDevice string `xml:"ipV6GatewayDevice,omitempty"` -} - -func init() { - t["HostIpRouteConfig"] = reflect.TypeOf((*HostIpRouteConfig)(nil)).Elem() -} - -type HostIpRouteConfigSpec struct { - HostIpRouteConfig - - GatewayDeviceConnection *HostVirtualNicConnection `xml:"gatewayDeviceConnection,omitempty"` - IpV6GatewayDeviceConnection *HostVirtualNicConnection `xml:"ipV6GatewayDeviceConnection,omitempty"` -} - -func init() { - t["HostIpRouteConfigSpec"] = reflect.TypeOf((*HostIpRouteConfigSpec)(nil)).Elem() -} - -type HostIpRouteEntry struct { - DynamicData - - Network string `xml:"network"` - PrefixLength int `xml:"prefixLength"` - Gateway string `xml:"gateway"` - DeviceName string `xml:"deviceName,omitempty"` -} - -func init() { - t["HostIpRouteEntry"] = reflect.TypeOf((*HostIpRouteEntry)(nil)).Elem() -} - -type HostIpRouteOp struct { - DynamicData - - ChangeOperation string `xml:"changeOperation"` - Route HostIpRouteEntry `xml:"route"` -} - -func init() { - t["HostIpRouteOp"] = reflect.TypeOf((*HostIpRouteOp)(nil)).Elem() -} - -type HostIpRouteTableConfig struct { - DynamicData - - IpRoute []HostIpRouteOp `xml:"ipRoute,omitempty"` - Ipv6Route []HostIpRouteOp `xml:"ipv6Route,omitempty"` -} - -func init() { - t["HostIpRouteTableConfig"] = reflect.TypeOf((*HostIpRouteTableConfig)(nil)).Elem() -} - -type HostIpRouteTableInfo struct { - DynamicData - - IpRoute []HostIpRouteEntry `xml:"ipRoute,omitempty"` - Ipv6Route []HostIpRouteEntry `xml:"ipv6Route,omitempty"` -} - -func init() { - t["HostIpRouteTableInfo"] = reflect.TypeOf((*HostIpRouteTableInfo)(nil)).Elem() -} - -type HostIpToShortNameFailedEvent struct { - HostEvent -} - -func init() { - t["HostIpToShortNameFailedEvent"] = reflect.TypeOf((*HostIpToShortNameFailedEvent)(nil)).Elem() -} - -type HostIpmiInfo struct { - DynamicData - - BmcIpAddress string `xml:"bmcIpAddress,omitempty"` - BmcMacAddress string `xml:"bmcMacAddress,omitempty"` - Login string `xml:"login,omitempty"` - Password string `xml:"password,omitempty"` -} - -func init() { - t["HostIpmiInfo"] = reflect.TypeOf((*HostIpmiInfo)(nil)).Elem() -} - -type HostIsolationIpPingFailedEvent struct { - HostDasEvent - - IsolationIp string `xml:"isolationIp"` -} - -func init() { - t["HostIsolationIpPingFailedEvent"] = reflect.TypeOf((*HostIsolationIpPingFailedEvent)(nil)).Elem() -} - -type HostLicensableResourceInfo struct { - DynamicData - - Resource []KeyAnyValue `xml:"resource"` -} - -func init() { - t["HostLicensableResourceInfo"] = reflect.TypeOf((*HostLicensableResourceInfo)(nil)).Elem() -} - -type HostLicenseConnectInfo struct { - DynamicData - - License LicenseManagerLicenseInfo `xml:"license"` - Evaluation LicenseManagerEvaluationInfo `xml:"evaluation"` - Resource *HostLicensableResourceInfo `xml:"resource,omitempty"` -} - -func init() { - t["HostLicenseConnectInfo"] = reflect.TypeOf((*HostLicenseConnectInfo)(nil)).Elem() -} - -type HostLicenseExpiredEvent struct { - LicenseEvent -} - -func init() { - t["HostLicenseExpiredEvent"] = reflect.TypeOf((*HostLicenseExpiredEvent)(nil)).Elem() -} - -type HostLicenseSpec struct { - DynamicData - - Source BaseLicenseSource `xml:"source,omitempty,typeattr"` - EditionKey string `xml:"editionKey,omitempty"` - DisabledFeatureKey []string `xml:"disabledFeatureKey,omitempty"` - EnabledFeatureKey []string `xml:"enabledFeatureKey,omitempty"` -} - -func init() { - t["HostLicenseSpec"] = reflect.TypeOf((*HostLicenseSpec)(nil)).Elem() -} - -type HostListSummary struct { - DynamicData - - Host *ManagedObjectReference `xml:"host,omitempty"` - Hardware *HostHardwareSummary `xml:"hardware,omitempty"` - Runtime *HostRuntimeInfo `xml:"runtime,omitempty"` - Config HostConfigSummary `xml:"config"` - QuickStats HostListSummaryQuickStats `xml:"quickStats"` - OverallStatus ManagedEntityStatus `xml:"overallStatus"` - RebootRequired bool `xml:"rebootRequired"` - CustomValue []BaseCustomFieldValue `xml:"customValue,omitempty,typeattr"` - ManagementServerIp string `xml:"managementServerIp,omitempty"` - MaxEVCModeKey string `xml:"maxEVCModeKey,omitempty"` - CurrentEVCModeKey string `xml:"currentEVCModeKey,omitempty"` -} - -func init() { - t["HostListSummary"] = reflect.TypeOf((*HostListSummary)(nil)).Elem() -} - -type HostListSummaryQuickStats struct { - DynamicData - - OverallCpuUsage int `xml:"overallCpuUsage,omitempty"` - OverallMemoryUsage int `xml:"overallMemoryUsage,omitempty"` - DistributedCpuFairness int `xml:"distributedCpuFairness,omitempty"` - DistributedMemoryFairness int `xml:"distributedMemoryFairness,omitempty"` - Uptime int `xml:"uptime,omitempty"` -} - -func init() { - t["HostListSummaryQuickStats"] = reflect.TypeOf((*HostListSummaryQuickStats)(nil)).Elem() -} - -type HostLocalAuthenticationInfo struct { - HostAuthenticationStoreInfo -} - -func init() { - t["HostLocalAuthenticationInfo"] = reflect.TypeOf((*HostLocalAuthenticationInfo)(nil)).Elem() -} - -type HostLocalFileSystemVolume struct { - HostFileSystemVolume - - Device string `xml:"device"` -} - -func init() { - t["HostLocalFileSystemVolume"] = reflect.TypeOf((*HostLocalFileSystemVolume)(nil)).Elem() -} - -type HostLocalFileSystemVolumeSpec struct { - DynamicData - - Device string `xml:"device"` - LocalPath string `xml:"localPath"` -} - -func init() { - t["HostLocalFileSystemVolumeSpec"] = reflect.TypeOf((*HostLocalFileSystemVolumeSpec)(nil)).Elem() -} - -type HostLocalPortCreatedEvent struct { - DvsEvent - - HostLocalPort DVSHostLocalPortInfo `xml:"hostLocalPort"` -} - -func init() { - t["HostLocalPortCreatedEvent"] = reflect.TypeOf((*HostLocalPortCreatedEvent)(nil)).Elem() -} - -type HostLowLevelProvisioningManagerDiskLayoutSpec struct { - DynamicData - - ControllerType string `xml:"controllerType"` - BusNumber int `xml:"busNumber"` - UnitNumber int `xml:"unitNumber"` - SrcFilename string `xml:"srcFilename"` - DstFilename string `xml:"dstFilename"` -} - -func init() { - t["HostLowLevelProvisioningManagerDiskLayoutSpec"] = reflect.TypeOf((*HostLowLevelProvisioningManagerDiskLayoutSpec)(nil)).Elem() -} - -type HostLowLevelProvisioningManagerSnapshotLayoutSpec struct { - DynamicData - - Id int `xml:"id"` - SrcFilename string `xml:"srcFilename"` - DstFilename string `xml:"dstFilename"` - Disk []HostLowLevelProvisioningManagerDiskLayoutSpec `xml:"disk,omitempty"` -} - -func init() { - t["HostLowLevelProvisioningManagerSnapshotLayoutSpec"] = reflect.TypeOf((*HostLowLevelProvisioningManagerSnapshotLayoutSpec)(nil)).Elem() -} - -type HostLowLevelProvisioningManagerVmMigrationStatus struct { - DynamicData - - MigrationId int64 `xml:"migrationId"` - Type string `xml:"type"` - Source bool `xml:"source"` - ConsideredSuccessful bool `xml:"consideredSuccessful"` -} - -func init() { - t["HostLowLevelProvisioningManagerVmMigrationStatus"] = reflect.TypeOf((*HostLowLevelProvisioningManagerVmMigrationStatus)(nil)).Elem() -} - -type HostLowLevelProvisioningManagerVmRecoveryInfo struct { - DynamicData - - Version string `xml:"version"` - BiosUUID string `xml:"biosUUID"` - InstanceUUID string `xml:"instanceUUID"` - FtInfo BaseFaultToleranceConfigInfo `xml:"ftInfo,omitempty,typeattr"` -} - -func init() { - t["HostLowLevelProvisioningManagerVmRecoveryInfo"] = reflect.TypeOf((*HostLowLevelProvisioningManagerVmRecoveryInfo)(nil)).Elem() -} - -type HostMaintenanceSpec struct { - DynamicData - - VsanMode *VsanHostDecommissionMode `xml:"vsanMode,omitempty"` -} - -func init() { - t["HostMaintenanceSpec"] = reflect.TypeOf((*HostMaintenanceSpec)(nil)).Elem() -} - -type HostMemberHealthCheckResult struct { - DynamicData - - Summary string `xml:"summary,omitempty"` -} - -func init() { - t["HostMemberHealthCheckResult"] = reflect.TypeOf((*HostMemberHealthCheckResult)(nil)).Elem() -} - -type HostMemberRuntimeInfo struct { - DynamicData - - Host ManagedObjectReference `xml:"host"` - Status string `xml:"status,omitempty"` - StatusDetail string `xml:"statusDetail,omitempty"` - HealthCheckResult []BaseHostMemberHealthCheckResult `xml:"healthCheckResult,omitempty,typeattr"` -} - -func init() { - t["HostMemberRuntimeInfo"] = reflect.TypeOf((*HostMemberRuntimeInfo)(nil)).Elem() -} - -type HostMemberUplinkHealthCheckResult struct { - HostMemberHealthCheckResult - - UplinkPortKey string `xml:"uplinkPortKey"` -} - -func init() { - t["HostMemberUplinkHealthCheckResult"] = reflect.TypeOf((*HostMemberUplinkHealthCheckResult)(nil)).Elem() -} - -type HostMemoryProfile struct { - ApplyProfile -} - -func init() { - t["HostMemoryProfile"] = reflect.TypeOf((*HostMemoryProfile)(nil)).Elem() -} - -type HostMemorySpec struct { - DynamicData - - ServiceConsoleReservation int64 `xml:"serviceConsoleReservation,omitempty"` -} - -func init() { - t["HostMemorySpec"] = reflect.TypeOf((*HostMemorySpec)(nil)).Elem() -} - -type HostMissingNetworksEvent struct { - HostDasEvent - - Ips string `xml:"ips,omitempty"` -} - -func init() { - t["HostMissingNetworksEvent"] = reflect.TypeOf((*HostMissingNetworksEvent)(nil)).Elem() -} - -type HostMonitoringStateChangedEvent struct { - ClusterEvent - - State string `xml:"state"` -} - -func init() { - t["HostMonitoringStateChangedEvent"] = reflect.TypeOf((*HostMonitoringStateChangedEvent)(nil)).Elem() -} - -type HostMountInfo struct { - DynamicData - - Path string `xml:"path,omitempty"` - AccessMode string `xml:"accessMode"` - Mounted *bool `xml:"mounted"` - Accessible *bool `xml:"accessible"` - InaccessibleReason string `xml:"inaccessibleReason,omitempty"` -} - -func init() { - t["HostMountInfo"] = reflect.TypeOf((*HostMountInfo)(nil)).Elem() -} - -type HostMultipathInfo struct { - DynamicData - - Lun []HostMultipathInfoLogicalUnit `xml:"lun,omitempty"` -} - -func init() { - t["HostMultipathInfo"] = reflect.TypeOf((*HostMultipathInfo)(nil)).Elem() -} - -type HostMultipathInfoFixedLogicalUnitPolicy struct { - HostMultipathInfoLogicalUnitPolicy - - Prefer string `xml:"prefer"` -} - -func init() { - t["HostMultipathInfoFixedLogicalUnitPolicy"] = reflect.TypeOf((*HostMultipathInfoFixedLogicalUnitPolicy)(nil)).Elem() -} - -type HostMultipathInfoLogicalUnit struct { - DynamicData - - Key string `xml:"key"` - Id string `xml:"id"` - Lun string `xml:"lun"` - Path []HostMultipathInfoPath `xml:"path"` - Policy BaseHostMultipathInfoLogicalUnitPolicy `xml:"policy,typeattr"` - StorageArrayTypePolicy *HostMultipathInfoLogicalUnitStorageArrayTypePolicy `xml:"storageArrayTypePolicy,omitempty"` -} - -func init() { - t["HostMultipathInfoLogicalUnit"] = reflect.TypeOf((*HostMultipathInfoLogicalUnit)(nil)).Elem() -} - -type HostMultipathInfoLogicalUnitPolicy struct { - DynamicData - - Policy string `xml:"policy"` -} - -func init() { - t["HostMultipathInfoLogicalUnitPolicy"] = reflect.TypeOf((*HostMultipathInfoLogicalUnitPolicy)(nil)).Elem() -} - -type HostMultipathInfoLogicalUnitStorageArrayTypePolicy struct { - DynamicData - - Policy string `xml:"policy"` -} - -func init() { - t["HostMultipathInfoLogicalUnitStorageArrayTypePolicy"] = reflect.TypeOf((*HostMultipathInfoLogicalUnitStorageArrayTypePolicy)(nil)).Elem() -} - -type HostMultipathInfoPath struct { - DynamicData - - Key string `xml:"key"` - Name string `xml:"name"` - PathState string `xml:"pathState"` - State string `xml:"state,omitempty"` - IsWorkingPath *bool `xml:"isWorkingPath"` - Adapter string `xml:"adapter"` - Lun string `xml:"lun"` - Transport BaseHostTargetTransport `xml:"transport,omitempty,typeattr"` -} - -func init() { - t["HostMultipathInfoPath"] = reflect.TypeOf((*HostMultipathInfoPath)(nil)).Elem() -} - -type HostMultipathStateInfo struct { - DynamicData - - Path []HostMultipathStateInfoPath `xml:"path,omitempty"` -} - -func init() { - t["HostMultipathStateInfo"] = reflect.TypeOf((*HostMultipathStateInfo)(nil)).Elem() -} - -type HostMultipathStateInfoPath struct { - DynamicData - - Name string `xml:"name"` - PathState string `xml:"pathState"` -} - -func init() { - t["HostMultipathStateInfoPath"] = reflect.TypeOf((*HostMultipathStateInfoPath)(nil)).Elem() -} - -type HostNasVolume struct { - HostFileSystemVolume - - RemoteHost string `xml:"remoteHost"` - RemotePath string `xml:"remotePath"` - UserName string `xml:"userName,omitempty"` -} - -func init() { - t["HostNasVolume"] = reflect.TypeOf((*HostNasVolume)(nil)).Elem() -} - -type HostNasVolumeConfig struct { - DynamicData - - ChangeOperation string `xml:"changeOperation,omitempty"` - Spec *HostNasVolumeSpec `xml:"spec,omitempty"` -} - -func init() { - t["HostNasVolumeConfig"] = reflect.TypeOf((*HostNasVolumeConfig)(nil)).Elem() -} - -type HostNasVolumeSpec struct { - DynamicData - - RemoteHost string `xml:"remoteHost"` - RemotePath string `xml:"remotePath"` - LocalPath string `xml:"localPath"` - AccessMode string `xml:"accessMode"` - Type string `xml:"type,omitempty"` - UserName string `xml:"userName,omitempty"` - Password string `xml:"password,omitempty"` -} - -func init() { - t["HostNasVolumeSpec"] = reflect.TypeOf((*HostNasVolumeSpec)(nil)).Elem() -} - -type HostNatService struct { - DynamicData - - Key string `xml:"key"` - Spec HostNatServiceSpec `xml:"spec"` -} - -func init() { - t["HostNatService"] = reflect.TypeOf((*HostNatService)(nil)).Elem() -} - -type HostNatServiceConfig struct { - DynamicData - - ChangeOperation string `xml:"changeOperation,omitempty"` - Key string `xml:"key"` - Spec HostNatServiceSpec `xml:"spec"` -} - -func init() { - t["HostNatServiceConfig"] = reflect.TypeOf((*HostNatServiceConfig)(nil)).Elem() -} - -type HostNatServiceNameServiceSpec struct { - DynamicData - - DnsAutoDetect bool `xml:"dnsAutoDetect"` - DnsPolicy string `xml:"dnsPolicy"` - DnsRetries int `xml:"dnsRetries"` - DnsTimeout int `xml:"dnsTimeout"` - DnsNameServer []string `xml:"dnsNameServer,omitempty"` - NbdsTimeout int `xml:"nbdsTimeout"` - NbnsRetries int `xml:"nbnsRetries"` - NbnsTimeout int `xml:"nbnsTimeout"` -} - -func init() { - t["HostNatServiceNameServiceSpec"] = reflect.TypeOf((*HostNatServiceNameServiceSpec)(nil)).Elem() -} - -type HostNatServicePortForwardSpec struct { - DynamicData - - Type string `xml:"type"` - Name string `xml:"name"` - HostPort int `xml:"hostPort"` - GuestPort int `xml:"guestPort"` - GuestIpAddress string `xml:"guestIpAddress"` -} - -func init() { - t["HostNatServicePortForwardSpec"] = reflect.TypeOf((*HostNatServicePortForwardSpec)(nil)).Elem() -} - -type HostNatServiceSpec struct { - DynamicData - - VirtualSwitch string `xml:"virtualSwitch"` - ActiveFtp bool `xml:"activeFtp"` - AllowAnyOui bool `xml:"allowAnyOui"` - ConfigPort bool `xml:"configPort"` - IpGatewayAddress string `xml:"ipGatewayAddress"` - UdpTimeout int `xml:"udpTimeout"` - PortForward []HostNatServicePortForwardSpec `xml:"portForward,omitempty"` - NameService *HostNatServiceNameServiceSpec `xml:"nameService,omitempty"` -} - -func init() { - t["HostNatServiceSpec"] = reflect.TypeOf((*HostNatServiceSpec)(nil)).Elem() -} - -type HostNetCapabilities struct { - DynamicData - - CanSetPhysicalNicLinkSpeed bool `xml:"canSetPhysicalNicLinkSpeed"` - SupportsNicTeaming bool `xml:"supportsNicTeaming"` - NicTeamingPolicy []string `xml:"nicTeamingPolicy,omitempty"` - SupportsVlan bool `xml:"supportsVlan"` - UsesServiceConsoleNic bool `xml:"usesServiceConsoleNic"` - SupportsNetworkHints bool `xml:"supportsNetworkHints"` - MaxPortGroupsPerVswitch int `xml:"maxPortGroupsPerVswitch,omitempty"` - VswitchConfigSupported bool `xml:"vswitchConfigSupported"` - VnicConfigSupported bool `xml:"vnicConfigSupported"` - IpRouteConfigSupported bool `xml:"ipRouteConfigSupported"` - DnsConfigSupported bool `xml:"dnsConfigSupported"` - DhcpOnVnicSupported bool `xml:"dhcpOnVnicSupported"` - IpV6Supported *bool `xml:"ipV6Supported"` -} - -func init() { - t["HostNetCapabilities"] = reflect.TypeOf((*HostNetCapabilities)(nil)).Elem() -} - -type HostNetOffloadCapabilities struct { - DynamicData - - CsumOffload *bool `xml:"csumOffload"` - TcpSegmentation *bool `xml:"tcpSegmentation"` - ZeroCopyXmit *bool `xml:"zeroCopyXmit"` -} - -func init() { - t["HostNetOffloadCapabilities"] = reflect.TypeOf((*HostNetOffloadCapabilities)(nil)).Elem() -} - -type HostNetStackInstance struct { - DynamicData - - Key string `xml:"key,omitempty"` - Name string `xml:"name,omitempty"` - DnsConfig BaseHostDnsConfig `xml:"dnsConfig,omitempty,typeattr"` - IpRouteConfig BaseHostIpRouteConfig `xml:"ipRouteConfig,omitempty,typeattr"` - RequestedMaxNumberOfConnections int `xml:"requestedMaxNumberOfConnections,omitempty"` - CongestionControlAlgorithm string `xml:"congestionControlAlgorithm,omitempty"` - IpV6Enabled *bool `xml:"ipV6Enabled"` - RouteTableConfig *HostIpRouteTableConfig `xml:"routeTableConfig,omitempty"` -} - -func init() { - t["HostNetStackInstance"] = reflect.TypeOf((*HostNetStackInstance)(nil)).Elem() -} - -type HostNetworkConfig struct { - DynamicData - - Vswitch []HostVirtualSwitchConfig `xml:"vswitch,omitempty"` - ProxySwitch []HostProxySwitchConfig `xml:"proxySwitch,omitempty"` - Portgroup []HostPortGroupConfig `xml:"portgroup,omitempty"` - Pnic []PhysicalNicConfig `xml:"pnic,omitempty"` - Vnic []HostVirtualNicConfig `xml:"vnic,omitempty"` - ConsoleVnic []HostVirtualNicConfig `xml:"consoleVnic,omitempty"` - DnsConfig BaseHostDnsConfig `xml:"dnsConfig,omitempty,typeattr"` - IpRouteConfig BaseHostIpRouteConfig `xml:"ipRouteConfig,omitempty,typeattr"` - ConsoleIpRouteConfig BaseHostIpRouteConfig `xml:"consoleIpRouteConfig,omitempty,typeattr"` - RouteTableConfig *HostIpRouteTableConfig `xml:"routeTableConfig,omitempty"` - Dhcp []HostDhcpServiceConfig `xml:"dhcp,omitempty"` - Nat []HostNatServiceConfig `xml:"nat,omitempty"` - IpV6Enabled *bool `xml:"ipV6Enabled"` - NetStackSpec []HostNetworkConfigNetStackSpec `xml:"netStackSpec,omitempty"` -} - -func init() { - t["HostNetworkConfig"] = reflect.TypeOf((*HostNetworkConfig)(nil)).Elem() -} - -type HostNetworkConfigNetStackSpec struct { - DynamicData - - NetStackInstance HostNetStackInstance `xml:"netStackInstance"` - Operation string `xml:"operation,omitempty"` -} - -func init() { - t["HostNetworkConfigNetStackSpec"] = reflect.TypeOf((*HostNetworkConfigNetStackSpec)(nil)).Elem() -} - -type HostNetworkConfigResult struct { - DynamicData - - VnicDevice []string `xml:"vnicDevice,omitempty"` - ConsoleVnicDevice []string `xml:"consoleVnicDevice,omitempty"` -} - -func init() { - t["HostNetworkConfigResult"] = reflect.TypeOf((*HostNetworkConfigResult)(nil)).Elem() -} - -type HostNetworkInfo struct { - DynamicData - - Vswitch []HostVirtualSwitch `xml:"vswitch,omitempty"` - ProxySwitch []HostProxySwitch `xml:"proxySwitch,omitempty"` - Portgroup []HostPortGroup `xml:"portgroup,omitempty"` - Pnic []PhysicalNic `xml:"pnic,omitempty"` - Vnic []HostVirtualNic `xml:"vnic,omitempty"` - ConsoleVnic []HostVirtualNic `xml:"consoleVnic,omitempty"` - DnsConfig BaseHostDnsConfig `xml:"dnsConfig,omitempty,typeattr"` - IpRouteConfig BaseHostIpRouteConfig `xml:"ipRouteConfig,omitempty,typeattr"` - ConsoleIpRouteConfig BaseHostIpRouteConfig `xml:"consoleIpRouteConfig,omitempty,typeattr"` - RouteTableInfo *HostIpRouteTableInfo `xml:"routeTableInfo,omitempty"` - Dhcp []HostDhcpService `xml:"dhcp,omitempty"` - Nat []HostNatService `xml:"nat,omitempty"` - IpV6Enabled *bool `xml:"ipV6Enabled"` - AtBootIpV6Enabled *bool `xml:"atBootIpV6Enabled"` - NetStackInstance []HostNetStackInstance `xml:"netStackInstance,omitempty"` - OpaqueSwitch []HostOpaqueSwitch `xml:"opaqueSwitch,omitempty"` - OpaqueNetwork []HostOpaqueNetworkInfo `xml:"opaqueNetwork,omitempty"` -} - -func init() { - t["HostNetworkInfo"] = reflect.TypeOf((*HostNetworkInfo)(nil)).Elem() -} - -type HostNetworkPolicy struct { - DynamicData - - Security *HostNetworkSecurityPolicy `xml:"security,omitempty"` - NicTeaming *HostNicTeamingPolicy `xml:"nicTeaming,omitempty"` - OffloadPolicy *HostNetOffloadCapabilities `xml:"offloadPolicy,omitempty"` - ShapingPolicy *HostNetworkTrafficShapingPolicy `xml:"shapingPolicy,omitempty"` -} - -func init() { - t["HostNetworkPolicy"] = reflect.TypeOf((*HostNetworkPolicy)(nil)).Elem() -} - -type HostNetworkSecurityPolicy struct { - DynamicData - - AllowPromiscuous *bool `xml:"allowPromiscuous"` - MacChanges *bool `xml:"macChanges"` - ForgedTransmits *bool `xml:"forgedTransmits"` -} - -func init() { - t["HostNetworkSecurityPolicy"] = reflect.TypeOf((*HostNetworkSecurityPolicy)(nil)).Elem() -} - -type HostNetworkTrafficShapingPolicy struct { - DynamicData - - Enabled *bool `xml:"enabled"` - AverageBandwidth int64 `xml:"averageBandwidth,omitempty"` - PeakBandwidth int64 `xml:"peakBandwidth,omitempty"` - BurstSize int64 `xml:"burstSize,omitempty"` -} - -func init() { - t["HostNetworkTrafficShapingPolicy"] = reflect.TypeOf((*HostNetworkTrafficShapingPolicy)(nil)).Elem() -} - -type HostNewNetworkConnectInfo struct { - HostConnectInfoNetworkInfo -} - -func init() { - t["HostNewNetworkConnectInfo"] = reflect.TypeOf((*HostNewNetworkConnectInfo)(nil)).Elem() -} - -type HostNicFailureCriteria struct { - DynamicData - - CheckSpeed string `xml:"checkSpeed,omitempty"` - Speed int `xml:"speed,omitempty"` - CheckDuplex *bool `xml:"checkDuplex"` - FullDuplex *bool `xml:"fullDuplex"` - CheckErrorPercent *bool `xml:"checkErrorPercent"` - Percentage int `xml:"percentage,omitempty"` - CheckBeacon *bool `xml:"checkBeacon"` -} - -func init() { - t["HostNicFailureCriteria"] = reflect.TypeOf((*HostNicFailureCriteria)(nil)).Elem() -} - -type HostNicOrderPolicy struct { - DynamicData - - ActiveNic []string `xml:"activeNic,omitempty"` - StandbyNic []string `xml:"standbyNic,omitempty"` -} - -func init() { - t["HostNicOrderPolicy"] = reflect.TypeOf((*HostNicOrderPolicy)(nil)).Elem() -} - -type HostNicTeamingPolicy struct { - DynamicData - - Policy string `xml:"policy,omitempty"` - ReversePolicy *bool `xml:"reversePolicy"` - NotifySwitches *bool `xml:"notifySwitches"` - RollingOrder *bool `xml:"rollingOrder"` - FailureCriteria *HostNicFailureCriteria `xml:"failureCriteria,omitempty"` - NicOrder *HostNicOrderPolicy `xml:"nicOrder,omitempty"` -} - -func init() { - t["HostNicTeamingPolicy"] = reflect.TypeOf((*HostNicTeamingPolicy)(nil)).Elem() -} - -type HostNoAvailableNetworksEvent struct { - HostDasEvent - - Ips string `xml:"ips,omitempty"` -} - -func init() { - t["HostNoAvailableNetworksEvent"] = reflect.TypeOf((*HostNoAvailableNetworksEvent)(nil)).Elem() -} - -type HostNoHAEnabledPortGroupsEvent struct { - HostDasEvent -} - -func init() { - t["HostNoHAEnabledPortGroupsEvent"] = reflect.TypeOf((*HostNoHAEnabledPortGroupsEvent)(nil)).Elem() -} - -type HostNoRedundantManagementNetworkEvent struct { - HostDasEvent -} - -func init() { - t["HostNoRedundantManagementNetworkEvent"] = reflect.TypeOf((*HostNoRedundantManagementNetworkEvent)(nil)).Elem() -} - -type HostNonCompliantEvent struct { - HostEvent -} - -func init() { - t["HostNonCompliantEvent"] = reflect.TypeOf((*HostNonCompliantEvent)(nil)).Elem() -} - -type HostNotConnected struct { - HostCommunication -} - -func init() { - t["HostNotConnected"] = reflect.TypeOf((*HostNotConnected)(nil)).Elem() -} - -type HostNotConnectedFault HostNotConnected - -func init() { - t["HostNotConnectedFault"] = reflect.TypeOf((*HostNotConnectedFault)(nil)).Elem() -} - -type HostNotInClusterEvent struct { - HostDasEvent -} - -func init() { - t["HostNotInClusterEvent"] = reflect.TypeOf((*HostNotInClusterEvent)(nil)).Elem() -} - -type HostNotReachable struct { - HostCommunication -} - -func init() { - t["HostNotReachable"] = reflect.TypeOf((*HostNotReachable)(nil)).Elem() -} - -type HostNotReachableFault HostNotReachable - -func init() { - t["HostNotReachableFault"] = reflect.TypeOf((*HostNotReachableFault)(nil)).Elem() -} - -type HostNtpConfig struct { - DynamicData - - Server []string `xml:"server,omitempty"` -} - -func init() { - t["HostNtpConfig"] = reflect.TypeOf((*HostNtpConfig)(nil)).Elem() -} - -type HostNumaInfo struct { - DynamicData - - Type string `xml:"type"` - NumNodes int `xml:"numNodes"` - NumaNode []HostNumaNode `xml:"numaNode,omitempty"` -} - -func init() { - t["HostNumaInfo"] = reflect.TypeOf((*HostNumaInfo)(nil)).Elem() -} - -type HostNumaNode struct { - DynamicData - - TypeId byte `xml:"typeId"` - CpuID []int16 `xml:"cpuID"` - MemoryRangeBegin int64 `xml:"memoryRangeBegin"` - MemoryRangeLength int64 `xml:"memoryRangeLength"` -} - -func init() { - t["HostNumaNode"] = reflect.TypeOf((*HostNumaNode)(nil)).Elem() -} - -type HostNumericSensorInfo struct { - DynamicData - - Name string `xml:"name"` - HealthState BaseElementDescription `xml:"healthState,omitempty,typeattr"` - CurrentReading int64 `xml:"currentReading"` - UnitModifier int `xml:"unitModifier"` - BaseUnits string `xml:"baseUnits"` - RateUnits string `xml:"rateUnits,omitempty"` - SensorType string `xml:"sensorType"` -} - -func init() { - t["HostNumericSensorInfo"] = reflect.TypeOf((*HostNumericSensorInfo)(nil)).Elem() -} - -type HostOpaqueNetworkInfo struct { - DynamicData - - OpaqueNetworkId string `xml:"opaqueNetworkId"` - OpaqueNetworkName string `xml:"opaqueNetworkName"` - OpaqueNetworkType string `xml:"opaqueNetworkType"` -} - -func init() { - t["HostOpaqueNetworkInfo"] = reflect.TypeOf((*HostOpaqueNetworkInfo)(nil)).Elem() -} - -type HostOpaqueSwitch struct { - DynamicData - - Key string `xml:"key"` - Name string `xml:"name,omitempty"` - Pnic []string `xml:"pnic,omitempty"` -} - -func init() { - t["HostOpaqueSwitch"] = reflect.TypeOf((*HostOpaqueSwitch)(nil)).Elem() -} - -type HostOvercommittedEvent struct { - ClusterOvercommittedEvent -} - -func init() { - t["HostOvercommittedEvent"] = reflect.TypeOf((*HostOvercommittedEvent)(nil)).Elem() -} - -type HostParallelScsiHba struct { - HostHostBusAdapter -} - -func init() { - t["HostParallelScsiHba"] = reflect.TypeOf((*HostParallelScsiHba)(nil)).Elem() -} - -type HostParallelScsiTargetTransport struct { - HostTargetTransport -} - -func init() { - t["HostParallelScsiTargetTransport"] = reflect.TypeOf((*HostParallelScsiTargetTransport)(nil)).Elem() -} - -type HostPatchManagerLocator struct { - DynamicData - - Url string `xml:"url"` - Proxy string `xml:"proxy,omitempty"` -} - -func init() { - t["HostPatchManagerLocator"] = reflect.TypeOf((*HostPatchManagerLocator)(nil)).Elem() -} - -type HostPatchManagerPatchManagerOperationSpec struct { - DynamicData - - Proxy string `xml:"proxy,omitempty"` - Port int `xml:"port,omitempty"` - UserName string `xml:"userName,omitempty"` - Password string `xml:"password,omitempty"` - CmdOption string `xml:"cmdOption,omitempty"` -} - -func init() { - t["HostPatchManagerPatchManagerOperationSpec"] = reflect.TypeOf((*HostPatchManagerPatchManagerOperationSpec)(nil)).Elem() -} - -type HostPatchManagerResult struct { - DynamicData - - Version string `xml:"version"` - Status []HostPatchManagerStatus `xml:"status,omitempty"` - XmlResult string `xml:"xmlResult,omitempty"` -} - -func init() { - t["HostPatchManagerResult"] = reflect.TypeOf((*HostPatchManagerResult)(nil)).Elem() -} - -type HostPatchManagerStatus struct { - DynamicData - - Id string `xml:"id"` - Applicable bool `xml:"applicable"` - Reason []string `xml:"reason,omitempty"` - Integrity string `xml:"integrity,omitempty"` - Installed bool `xml:"installed"` - InstallState []string `xml:"installState,omitempty"` - PrerequisitePatch []HostPatchManagerStatusPrerequisitePatch `xml:"prerequisitePatch,omitempty"` - RestartRequired bool `xml:"restartRequired"` - ReconnectRequired bool `xml:"reconnectRequired"` - VmOffRequired bool `xml:"vmOffRequired"` - SupersededPatchIds []string `xml:"supersededPatchIds,omitempty"` -} - -func init() { - t["HostPatchManagerStatus"] = reflect.TypeOf((*HostPatchManagerStatus)(nil)).Elem() -} - -type HostPatchManagerStatusPrerequisitePatch struct { - DynamicData - - Id string `xml:"id"` - InstallState []string `xml:"installState,omitempty"` -} - -func init() { - t["HostPatchManagerStatusPrerequisitePatch"] = reflect.TypeOf((*HostPatchManagerStatusPrerequisitePatch)(nil)).Elem() -} - -type HostPathSelectionPolicyOption struct { - DynamicData - - Policy BaseElementDescription `xml:"policy,typeattr"` -} - -func init() { - t["HostPathSelectionPolicyOption"] = reflect.TypeOf((*HostPathSelectionPolicyOption)(nil)).Elem() -} - -type HostPciDevice struct { - DynamicData - - Id string `xml:"id"` - ClassId int16 `xml:"classId"` - Bus byte `xml:"bus"` - Slot byte `xml:"slot"` - Function byte `xml:"function"` - VendorId int16 `xml:"vendorId"` - SubVendorId int16 `xml:"subVendorId"` - VendorName string `xml:"vendorName"` - DeviceId int16 `xml:"deviceId"` - SubDeviceId int16 `xml:"subDeviceId"` - ParentBridge string `xml:"parentBridge,omitempty"` - DeviceName string `xml:"deviceName"` -} - -func init() { - t["HostPciDevice"] = reflect.TypeOf((*HostPciDevice)(nil)).Elem() -} - -type HostPciPassthruConfig struct { - DynamicData - - Id string `xml:"id"` - PassthruEnabled bool `xml:"passthruEnabled"` -} - -func init() { - t["HostPciPassthruConfig"] = reflect.TypeOf((*HostPciPassthruConfig)(nil)).Elem() -} - -type HostPciPassthruInfo struct { - DynamicData - - Id string `xml:"id"` - DependentDevice string `xml:"dependentDevice"` - PassthruEnabled bool `xml:"passthruEnabled"` - PassthruCapable bool `xml:"passthruCapable"` - PassthruActive bool `xml:"passthruActive"` -} - -func init() { - t["HostPciPassthruInfo"] = reflect.TypeOf((*HostPciPassthruInfo)(nil)).Elem() -} - -type HostPlugStoreTopology struct { - DynamicData - - Adapter []HostPlugStoreTopologyAdapter `xml:"adapter,omitempty"` - Path []HostPlugStoreTopologyPath `xml:"path,omitempty"` - Target []HostPlugStoreTopologyTarget `xml:"target,omitempty"` - Device []HostPlugStoreTopologyDevice `xml:"device,omitempty"` - Plugin []HostPlugStoreTopologyPlugin `xml:"plugin,omitempty"` -} - -func init() { - t["HostPlugStoreTopology"] = reflect.TypeOf((*HostPlugStoreTopology)(nil)).Elem() -} - -type HostPlugStoreTopologyAdapter struct { - DynamicData - - Key string `xml:"key"` - Adapter string `xml:"adapter"` - Path []string `xml:"path,omitempty"` -} - -func init() { - t["HostPlugStoreTopologyAdapter"] = reflect.TypeOf((*HostPlugStoreTopologyAdapter)(nil)).Elem() -} - -type HostPlugStoreTopologyDevice struct { - DynamicData - - Key string `xml:"key"` - Lun string `xml:"lun"` - Path []string `xml:"path,omitempty"` -} - -func init() { - t["HostPlugStoreTopologyDevice"] = reflect.TypeOf((*HostPlugStoreTopologyDevice)(nil)).Elem() -} - -type HostPlugStoreTopologyPath struct { - DynamicData - - Key string `xml:"key"` - Name string `xml:"name"` - ChannelNumber int `xml:"channelNumber,omitempty"` - TargetNumber int `xml:"targetNumber,omitempty"` - LunNumber int `xml:"lunNumber,omitempty"` - Adapter string `xml:"adapter,omitempty"` - Target string `xml:"target,omitempty"` - Device string `xml:"device,omitempty"` -} - -func init() { - t["HostPlugStoreTopologyPath"] = reflect.TypeOf((*HostPlugStoreTopologyPath)(nil)).Elem() -} - -type HostPlugStoreTopologyPlugin struct { - DynamicData - - Key string `xml:"key"` - Name string `xml:"name"` - Device []string `xml:"device,omitempty"` - ClaimedPath []string `xml:"claimedPath,omitempty"` -} - -func init() { - t["HostPlugStoreTopologyPlugin"] = reflect.TypeOf((*HostPlugStoreTopologyPlugin)(nil)).Elem() -} - -type HostPlugStoreTopologyTarget struct { - DynamicData - - Key string `xml:"key"` - Transport BaseHostTargetTransport `xml:"transport,omitempty,typeattr"` -} - -func init() { - t["HostPlugStoreTopologyTarget"] = reflect.TypeOf((*HostPlugStoreTopologyTarget)(nil)).Elem() -} - -type HostPortGroup struct { - DynamicData - - Key string `xml:"key,omitempty"` - Port []HostPortGroupPort `xml:"port,omitempty"` - Vswitch string `xml:"vswitch,omitempty"` - ComputedPolicy HostNetworkPolicy `xml:"computedPolicy"` - Spec HostPortGroupSpec `xml:"spec"` -} - -func init() { - t["HostPortGroup"] = reflect.TypeOf((*HostPortGroup)(nil)).Elem() -} - -type HostPortGroupConfig struct { - DynamicData - - ChangeOperation string `xml:"changeOperation,omitempty"` - Spec *HostPortGroupSpec `xml:"spec,omitempty"` -} - -func init() { - t["HostPortGroupConfig"] = reflect.TypeOf((*HostPortGroupConfig)(nil)).Elem() -} - -type HostPortGroupPort struct { - DynamicData - - Key string `xml:"key,omitempty"` - Mac []string `xml:"mac,omitempty"` - Type string `xml:"type"` -} - -func init() { - t["HostPortGroupPort"] = reflect.TypeOf((*HostPortGroupPort)(nil)).Elem() -} - -type HostPortGroupProfile struct { - PortGroupProfile - - IpConfig IpAddressProfile `xml:"ipConfig"` -} - -func init() { - t["HostPortGroupProfile"] = reflect.TypeOf((*HostPortGroupProfile)(nil)).Elem() -} - -type HostPortGroupSpec struct { - DynamicData - - Name string `xml:"name"` - VlanId int `xml:"vlanId"` - VswitchName string `xml:"vswitchName"` - Policy HostNetworkPolicy `xml:"policy"` -} - -func init() { - t["HostPortGroupSpec"] = reflect.TypeOf((*HostPortGroupSpec)(nil)).Elem() -} - -type HostPosixAccountSpec struct { - HostAccountSpec - - PosixId int `xml:"posixId,omitempty"` - ShellAccess *bool `xml:"shellAccess"` -} - -func init() { - t["HostPosixAccountSpec"] = reflect.TypeOf((*HostPosixAccountSpec)(nil)).Elem() -} - -type HostPowerOpFailed struct { - VimFault -} - -func init() { - t["HostPowerOpFailed"] = reflect.TypeOf((*HostPowerOpFailed)(nil)).Elem() -} - -type HostPowerOpFailedFault BaseHostPowerOpFailed - -func init() { - t["HostPowerOpFailedFault"] = reflect.TypeOf((*HostPowerOpFailedFault)(nil)).Elem() -} - -type HostPowerPolicy struct { - DynamicData - - Key int `xml:"key"` - Name string `xml:"name"` - ShortName string `xml:"shortName"` - Description string `xml:"description"` -} - -func init() { - t["HostPowerPolicy"] = reflect.TypeOf((*HostPowerPolicy)(nil)).Elem() -} - -type HostPrimaryAgentNotShortNameEvent struct { - HostDasEvent - - PrimaryAgent string `xml:"primaryAgent"` -} - -func init() { - t["HostPrimaryAgentNotShortNameEvent"] = reflect.TypeOf((*HostPrimaryAgentNotShortNameEvent)(nil)).Elem() -} - -type HostProfileAppliedEvent struct { - HostEvent - - Profile ProfileEventArgument `xml:"profile"` -} - -func init() { - t["HostProfileAppliedEvent"] = reflect.TypeOf((*HostProfileAppliedEvent)(nil)).Elem() -} - -type HostProfileCompleteConfigSpec struct { - HostProfileConfigSpec - - ApplyProfile *HostApplyProfile `xml:"applyProfile,omitempty"` - CustomComplyProfile *ComplianceProfile `xml:"customComplyProfile,omitempty"` - DisabledExpressionListChanged bool `xml:"disabledExpressionListChanged"` - DisabledExpressionList []string `xml:"disabledExpressionList,omitempty"` - ValidatorHost *ManagedObjectReference `xml:"validatorHost,omitempty"` -} - -func init() { - t["HostProfileCompleteConfigSpec"] = reflect.TypeOf((*HostProfileCompleteConfigSpec)(nil)).Elem() -} - -type HostProfileConfigInfo struct { - ProfileConfigInfo - - ApplyProfile *HostApplyProfile `xml:"applyProfile,omitempty"` - DefaultComplyProfile *ComplianceProfile `xml:"defaultComplyProfile,omitempty"` - DefaultComplyLocator []ComplianceLocator `xml:"defaultComplyLocator,omitempty"` - CustomComplyProfile *ComplianceProfile `xml:"customComplyProfile,omitempty"` - DisabledExpressionList []string `xml:"disabledExpressionList,omitempty"` -} - -func init() { - t["HostProfileConfigInfo"] = reflect.TypeOf((*HostProfileConfigInfo)(nil)).Elem() -} - -type HostProfileConfigSpec struct { - ProfileCreateSpec -} - -func init() { - t["HostProfileConfigSpec"] = reflect.TypeOf((*HostProfileConfigSpec)(nil)).Elem() -} - -type HostProfileHostBasedConfigSpec struct { - HostProfileConfigSpec - - Host ManagedObjectReference `xml:"host"` - UseHostProfileEngine *bool `xml:"useHostProfileEngine"` -} - -func init() { - t["HostProfileHostBasedConfigSpec"] = reflect.TypeOf((*HostProfileHostBasedConfigSpec)(nil)).Elem() -} - -type HostProfileManagerConfigTaskList struct { - DynamicData - - ConfigSpec *HostConfigSpec `xml:"configSpec,omitempty"` - TaskDescription []LocalizableMessage `xml:"taskDescription,omitempty"` -} - -func init() { - t["HostProfileManagerConfigTaskList"] = reflect.TypeOf((*HostProfileManagerConfigTaskList)(nil)).Elem() -} - -type HostProfileSerializedHostProfileSpec struct { - ProfileSerializedCreateSpec - - ValidatorHost *ManagedObjectReference `xml:"validatorHost,omitempty"` -} - -func init() { - t["HostProfileSerializedHostProfileSpec"] = reflect.TypeOf((*HostProfileSerializedHostProfileSpec)(nil)).Elem() -} - -type HostProxySwitch struct { - DynamicData - - DvsUuid string `xml:"dvsUuid"` - DvsName string `xml:"dvsName"` - Key string `xml:"key"` - NumPorts int `xml:"numPorts"` - ConfigNumPorts int `xml:"configNumPorts,omitempty"` - NumPortsAvailable int `xml:"numPortsAvailable"` - UplinkPort []KeyValue `xml:"uplinkPort,omitempty"` - Mtu int `xml:"mtu,omitempty"` - Pnic []string `xml:"pnic,omitempty"` - Spec HostProxySwitchSpec `xml:"spec"` - HostLag []HostProxySwitchHostLagConfig `xml:"hostLag,omitempty"` - NetworkReservationSupported *bool `xml:"networkReservationSupported"` -} - -func init() { - t["HostProxySwitch"] = reflect.TypeOf((*HostProxySwitch)(nil)).Elem() -} - -type HostProxySwitchConfig struct { - DynamicData - - ChangeOperation string `xml:"changeOperation,omitempty"` - Uuid string `xml:"uuid"` - Spec *HostProxySwitchSpec `xml:"spec,omitempty"` -} - -func init() { - t["HostProxySwitchConfig"] = reflect.TypeOf((*HostProxySwitchConfig)(nil)).Elem() -} - -type HostProxySwitchHostLagConfig struct { - DynamicData - - LagKey string `xml:"lagKey"` - LagName string `xml:"lagName,omitempty"` - UplinkPort []KeyValue `xml:"uplinkPort,omitempty"` -} - -func init() { - t["HostProxySwitchHostLagConfig"] = reflect.TypeOf((*HostProxySwitchHostLagConfig)(nil)).Elem() -} - -type HostProxySwitchSpec struct { - DynamicData - - Backing BaseDistributedVirtualSwitchHostMemberBacking `xml:"backing,omitempty,typeattr"` -} - -func init() { - t["HostProxySwitchSpec"] = reflect.TypeOf((*HostProxySwitchSpec)(nil)).Elem() -} - -type HostReconnectionFailedEvent struct { - HostEvent -} - -func init() { - t["HostReconnectionFailedEvent"] = reflect.TypeOf((*HostReconnectionFailedEvent)(nil)).Elem() -} - -type HostReliableMemoryInfo struct { - DynamicData - - MemorySize int64 `xml:"memorySize"` -} - -func init() { - t["HostReliableMemoryInfo"] = reflect.TypeOf((*HostReliableMemoryInfo)(nil)).Elem() -} - -type HostRemoveVFlashResource HostRemoveVFlashResourceRequestType - -func init() { - t["HostRemoveVFlashResource"] = reflect.TypeOf((*HostRemoveVFlashResource)(nil)).Elem() -} - -type HostRemoveVFlashResourceRequestType struct { - This ManagedObjectReference `xml:"_this"` -} - -func init() { - t["HostRemoveVFlashResourceRequestType"] = reflect.TypeOf((*HostRemoveVFlashResourceRequestType)(nil)).Elem() -} - -type HostRemoveVFlashResourceResponse struct { -} - -type HostRemovedEvent struct { - HostEvent -} - -func init() { - t["HostRemovedEvent"] = reflect.TypeOf((*HostRemovedEvent)(nil)).Elem() -} - -type HostResignatureRescanResult struct { - DynamicData - - Rescan []HostVmfsRescanResult `xml:"rescan,omitempty"` - Result ManagedObjectReference `xml:"result"` -} - -func init() { - t["HostResignatureRescanResult"] = reflect.TypeOf((*HostResignatureRescanResult)(nil)).Elem() -} - -type HostRuntimeInfo struct { - DynamicData - - ConnectionState HostSystemConnectionState `xml:"connectionState"` - PowerState HostSystemPowerState `xml:"powerState"` - StandbyMode string `xml:"standbyMode,omitempty"` - InMaintenanceMode bool `xml:"inMaintenanceMode"` - BootTime *time.Time `xml:"bootTime"` - HealthSystemRuntime *HealthSystemRuntime `xml:"healthSystemRuntime,omitempty"` - DasHostState *ClusterDasFdmHostState `xml:"dasHostState,omitempty"` - TpmPcrValues []HostTpmDigestInfo `xml:"tpmPcrValues,omitempty"` - VsanRuntimeInfo *VsanHostRuntimeInfo `xml:"vsanRuntimeInfo,omitempty"` - NetworkRuntimeInfo *HostRuntimeInfoNetworkRuntimeInfo `xml:"networkRuntimeInfo,omitempty"` - VFlashResourceRuntimeInfo *HostVFlashManagerVFlashResourceRunTimeInfo `xml:"vFlashResourceRuntimeInfo,omitempty"` - HostMaxVirtualDiskCapacity int64 `xml:"hostMaxVirtualDiskCapacity,omitempty"` -} - -func init() { - t["HostRuntimeInfo"] = reflect.TypeOf((*HostRuntimeInfo)(nil)).Elem() -} - -type HostRuntimeInfoNetStackInstanceRuntimeInfo struct { - DynamicData - - NetStackInstanceKey string `xml:"netStackInstanceKey"` - State string `xml:"state,omitempty"` - VmknicKeys []string `xml:"vmknicKeys,omitempty"` - MaxNumberOfConnections int `xml:"maxNumberOfConnections,omitempty"` - CurrentIpV6Enabled *bool `xml:"currentIpV6Enabled"` -} - -func init() { - t["HostRuntimeInfoNetStackInstanceRuntimeInfo"] = reflect.TypeOf((*HostRuntimeInfoNetStackInstanceRuntimeInfo)(nil)).Elem() -} - -type HostRuntimeInfoNetworkRuntimeInfo struct { - DynamicData - - NetStackInstanceRuntimeInfo []HostRuntimeInfoNetStackInstanceRuntimeInfo `xml:"netStackInstanceRuntimeInfo,omitempty"` -} - -func init() { - t["HostRuntimeInfoNetworkRuntimeInfo"] = reflect.TypeOf((*HostRuntimeInfoNetworkRuntimeInfo)(nil)).Elem() -} - -type HostScsiDisk struct { - ScsiLun - - Capacity HostDiskDimensionsLba `xml:"capacity"` - DevicePath string `xml:"devicePath"` - Ssd *bool `xml:"ssd"` -} - -func init() { - t["HostScsiDisk"] = reflect.TypeOf((*HostScsiDisk)(nil)).Elem() -} - -type HostScsiDiskPartition struct { - DynamicData - - DiskName string `xml:"diskName"` - Partition int `xml:"partition"` -} - -func init() { - t["HostScsiDiskPartition"] = reflect.TypeOf((*HostScsiDiskPartition)(nil)).Elem() -} - -type HostScsiTopology struct { - DynamicData - - Adapter []HostScsiTopologyInterface `xml:"adapter,omitempty"` -} - -func init() { - t["HostScsiTopology"] = reflect.TypeOf((*HostScsiTopology)(nil)).Elem() -} - -type HostScsiTopologyInterface struct { - DynamicData - - Key string `xml:"key"` - Adapter string `xml:"adapter"` - Target []HostScsiTopologyTarget `xml:"target,omitempty"` -} - -func init() { - t["HostScsiTopologyInterface"] = reflect.TypeOf((*HostScsiTopologyInterface)(nil)).Elem() -} - -type HostScsiTopologyLun struct { - DynamicData - - Key string `xml:"key"` - Lun int `xml:"lun"` - ScsiLun string `xml:"scsiLun"` -} - -func init() { - t["HostScsiTopologyLun"] = reflect.TypeOf((*HostScsiTopologyLun)(nil)).Elem() -} - -type HostScsiTopologyTarget struct { - DynamicData - - Key string `xml:"key"` - Target int `xml:"target"` - Lun []HostScsiTopologyLun `xml:"lun,omitempty"` - Transport BaseHostTargetTransport `xml:"transport,omitempty,typeattr"` -} - -func init() { - t["HostScsiTopologyTarget"] = reflect.TypeOf((*HostScsiTopologyTarget)(nil)).Elem() -} - -type HostSecuritySpec struct { - DynamicData - - AdminPassword string `xml:"adminPassword,omitempty"` - RemovePermission []Permission `xml:"removePermission,omitempty"` - AddPermission []Permission `xml:"addPermission,omitempty"` -} - -func init() { - t["HostSecuritySpec"] = reflect.TypeOf((*HostSecuritySpec)(nil)).Elem() -} - -type HostService struct { - DynamicData - - Key string `xml:"key"` - Label string `xml:"label"` - Required bool `xml:"required"` - Uninstallable bool `xml:"uninstallable"` - Running bool `xml:"running"` - Ruleset []string `xml:"ruleset,omitempty"` - Policy string `xml:"policy"` - SourcePackage *HostServiceSourcePackage `xml:"sourcePackage,omitempty"` -} - -func init() { - t["HostService"] = reflect.TypeOf((*HostService)(nil)).Elem() -} - -type HostServiceConfig struct { - DynamicData - - ServiceId string `xml:"serviceId"` - StartupPolicy string `xml:"startupPolicy"` -} - -func init() { - t["HostServiceConfig"] = reflect.TypeOf((*HostServiceConfig)(nil)).Elem() -} - -type HostServiceInfo struct { - DynamicData - - Service []HostService `xml:"service,omitempty"` -} - -func init() { - t["HostServiceInfo"] = reflect.TypeOf((*HostServiceInfo)(nil)).Elem() -} - -type HostServiceSourcePackage struct { - DynamicData - - SourcePackageName string `xml:"sourcePackageName"` - Description string `xml:"description"` -} - -func init() { - t["HostServiceSourcePackage"] = reflect.TypeOf((*HostServiceSourcePackage)(nil)).Elem() -} - -type HostServiceTicket struct { - DynamicData - - Host string `xml:"host,omitempty"` - Port int `xml:"port,omitempty"` - SslThumbprint string `xml:"sslThumbprint,omitempty"` - Service string `xml:"service"` - ServiceVersion string `xml:"serviceVersion"` - SessionId string `xml:"sessionId"` -} - -func init() { - t["HostServiceTicket"] = reflect.TypeOf((*HostServiceTicket)(nil)).Elem() -} - -type HostShortNameInconsistentEvent struct { - HostDasEvent - - ShortName string `xml:"shortName"` - ShortName2 string `xml:"shortName2"` -} - -func init() { - t["HostShortNameInconsistentEvent"] = reflect.TypeOf((*HostShortNameInconsistentEvent)(nil)).Elem() -} - -type HostShortNameToIpFailedEvent struct { - HostEvent - - ShortName string `xml:"shortName"` -} - -func init() { - t["HostShortNameToIpFailedEvent"] = reflect.TypeOf((*HostShortNameToIpFailedEvent)(nil)).Elem() -} - -type HostShutdownEvent struct { - HostEvent - - Reason string `xml:"reason"` -} - -func init() { - t["HostShutdownEvent"] = reflect.TypeOf((*HostShutdownEvent)(nil)).Elem() -} - -type HostSnmpConfigSpec struct { - DynamicData - - Enabled *bool `xml:"enabled"` - Port int `xml:"port,omitempty"` - ReadOnlyCommunities []string `xml:"readOnlyCommunities,omitempty"` - TrapTargets []HostSnmpDestination `xml:"trapTargets,omitempty"` - Option []KeyValue `xml:"option,omitempty"` -} - -func init() { - t["HostSnmpConfigSpec"] = reflect.TypeOf((*HostSnmpConfigSpec)(nil)).Elem() -} - -type HostSnmpDestination struct { - DynamicData - - HostName string `xml:"hostName"` - Port int `xml:"port"` - Community string `xml:"community"` -} - -func init() { - t["HostSnmpDestination"] = reflect.TypeOf((*HostSnmpDestination)(nil)).Elem() -} - -type HostSnmpSystemAgentLimits struct { - DynamicData - - MaxReadOnlyCommunities int `xml:"maxReadOnlyCommunities"` - MaxTrapDestinations int `xml:"maxTrapDestinations"` - MaxCommunityLength int `xml:"maxCommunityLength"` - MaxBufferSize int `xml:"maxBufferSize"` - Capability HostSnmpAgentCapability `xml:"capability,omitempty"` -} - -func init() { - t["HostSnmpSystemAgentLimits"] = reflect.TypeOf((*HostSnmpSystemAgentLimits)(nil)).Elem() -} - -type HostSriovConfig struct { - HostPciPassthruConfig - - SriovEnabled bool `xml:"sriovEnabled"` - NumVirtualFunction int `xml:"numVirtualFunction"` -} - -func init() { - t["HostSriovConfig"] = reflect.TypeOf((*HostSriovConfig)(nil)).Elem() -} - -type HostSriovInfo struct { - HostPciPassthruInfo - - SriovEnabled bool `xml:"sriovEnabled"` - SriovCapable bool `xml:"sriovCapable"` - SriovActive bool `xml:"sriovActive"` - NumVirtualFunctionRequested int `xml:"numVirtualFunctionRequested"` - NumVirtualFunction int `xml:"numVirtualFunction"` - MaxVirtualFunctionSupported int `xml:"maxVirtualFunctionSupported"` -} - -func init() { - t["HostSriovInfo"] = reflect.TypeOf((*HostSriovInfo)(nil)).Elem() -} - -type HostSslThumbprintInfo struct { - DynamicData - - Principal string `xml:"principal"` - OwnerTag string `xml:"ownerTag,omitempty"` - SslThumbprints []string `xml:"sslThumbprints,omitempty"` -} - -func init() { - t["HostSslThumbprintInfo"] = reflect.TypeOf((*HostSslThumbprintInfo)(nil)).Elem() -} - -type HostStatusChangedEvent struct { - ClusterStatusChangedEvent -} - -func init() { - t["HostStatusChangedEvent"] = reflect.TypeOf((*HostStatusChangedEvent)(nil)).Elem() -} - -type HostStorageArrayTypePolicyOption struct { - DynamicData - - Policy BaseElementDescription `xml:"policy,typeattr"` -} - -func init() { - t["HostStorageArrayTypePolicyOption"] = reflect.TypeOf((*HostStorageArrayTypePolicyOption)(nil)).Elem() -} - -type HostStorageDeviceInfo struct { - DynamicData - - HostBusAdapter []BaseHostHostBusAdapter `xml:"hostBusAdapter,omitempty,typeattr"` - ScsiLun []BaseScsiLun `xml:"scsiLun,omitempty,typeattr"` - ScsiTopology *HostScsiTopology `xml:"scsiTopology,omitempty"` - MultipathInfo *HostMultipathInfo `xml:"multipathInfo,omitempty"` - PlugStoreTopology *HostPlugStoreTopology `xml:"plugStoreTopology,omitempty"` - SoftwareInternetScsiEnabled bool `xml:"softwareInternetScsiEnabled"` -} - -func init() { - t["HostStorageDeviceInfo"] = reflect.TypeOf((*HostStorageDeviceInfo)(nil)).Elem() -} - -type HostStorageElementInfo struct { - HostHardwareElementInfo - - OperationalInfo []HostStorageOperationalInfo `xml:"operationalInfo,omitempty"` -} - -func init() { - t["HostStorageElementInfo"] = reflect.TypeOf((*HostStorageElementInfo)(nil)).Elem() -} - -type HostStorageOperationalInfo struct { - DynamicData - - Property string `xml:"property"` - Value string `xml:"value"` -} - -func init() { - t["HostStorageOperationalInfo"] = reflect.TypeOf((*HostStorageOperationalInfo)(nil)).Elem() -} - -type HostSyncFailedEvent struct { - HostEvent - - Reason LocalizedMethodFault `xml:"reason"` -} - -func init() { - t["HostSyncFailedEvent"] = reflect.TypeOf((*HostSyncFailedEvent)(nil)).Elem() -} - -type HostSystemHealthInfo struct { - DynamicData - - NumericSensorInfo []HostNumericSensorInfo `xml:"numericSensorInfo,omitempty"` -} - -func init() { - t["HostSystemHealthInfo"] = reflect.TypeOf((*HostSystemHealthInfo)(nil)).Elem() -} - -type HostSystemIdentificationInfo struct { - DynamicData - - IdentifierValue string `xml:"identifierValue"` - IdentifierType BaseElementDescription `xml:"identifierType,typeattr"` -} - -func init() { - t["HostSystemIdentificationInfo"] = reflect.TypeOf((*HostSystemIdentificationInfo)(nil)).Elem() -} - -type HostSystemInfo struct { - DynamicData - - Vendor string `xml:"vendor"` - Model string `xml:"model"` - Uuid string `xml:"uuid"` - OtherIdentifyingInfo []HostSystemIdentificationInfo `xml:"otherIdentifyingInfo,omitempty"` -} - -func init() { - t["HostSystemInfo"] = reflect.TypeOf((*HostSystemInfo)(nil)).Elem() -} - -type HostSystemReconnectSpec struct { - DynamicData - - SyncState *bool `xml:"syncState"` -} - -func init() { - t["HostSystemReconnectSpec"] = reflect.TypeOf((*HostSystemReconnectSpec)(nil)).Elem() -} - -type HostSystemResourceInfo struct { - DynamicData - - Key string `xml:"key"` - Config *ResourceConfigSpec `xml:"config,omitempty"` - Child []HostSystemResourceInfo `xml:"child,omitempty"` -} - -func init() { - t["HostSystemResourceInfo"] = reflect.TypeOf((*HostSystemResourceInfo)(nil)).Elem() -} - -type HostSystemSwapConfiguration struct { - DynamicData - - Option []BaseHostSystemSwapConfigurationSystemSwapOption `xml:"option,omitempty,typeattr"` -} - -func init() { - t["HostSystemSwapConfiguration"] = reflect.TypeOf((*HostSystemSwapConfiguration)(nil)).Elem() -} - -type HostSystemSwapConfigurationDatastoreOption struct { - HostSystemSwapConfigurationSystemSwapOption - - Datastore string `xml:"datastore"` -} - -func init() { - t["HostSystemSwapConfigurationDatastoreOption"] = reflect.TypeOf((*HostSystemSwapConfigurationDatastoreOption)(nil)).Elem() -} - -type HostSystemSwapConfigurationDisabledOption struct { - HostSystemSwapConfigurationSystemSwapOption -} - -func init() { - t["HostSystemSwapConfigurationDisabledOption"] = reflect.TypeOf((*HostSystemSwapConfigurationDisabledOption)(nil)).Elem() -} - -type HostSystemSwapConfigurationHostCacheOption struct { - HostSystemSwapConfigurationSystemSwapOption -} - -func init() { - t["HostSystemSwapConfigurationHostCacheOption"] = reflect.TypeOf((*HostSystemSwapConfigurationHostCacheOption)(nil)).Elem() -} - -type HostSystemSwapConfigurationHostLocalSwapOption struct { - HostSystemSwapConfigurationSystemSwapOption -} - -func init() { - t["HostSystemSwapConfigurationHostLocalSwapOption"] = reflect.TypeOf((*HostSystemSwapConfigurationHostLocalSwapOption)(nil)).Elem() -} - -type HostSystemSwapConfigurationSystemSwapOption struct { - DynamicData - - Key int `xml:"key"` -} - -func init() { - t["HostSystemSwapConfigurationSystemSwapOption"] = reflect.TypeOf((*HostSystemSwapConfigurationSystemSwapOption)(nil)).Elem() -} - -type HostTargetTransport struct { - DynamicData -} - -func init() { - t["HostTargetTransport"] = reflect.TypeOf((*HostTargetTransport)(nil)).Elem() -} - -type HostTpmAttestationReport struct { - DynamicData - - TpmPcrValues []HostTpmDigestInfo `xml:"tpmPcrValues"` - TpmEvents []HostTpmEventLogEntry `xml:"tpmEvents"` - TpmLogReliable bool `xml:"tpmLogReliable"` -} - -func init() { - t["HostTpmAttestationReport"] = reflect.TypeOf((*HostTpmAttestationReport)(nil)).Elem() -} - -type HostTpmBootSecurityOptionEventDetails struct { - HostTpmEventDetails - - BootSecurityOption string `xml:"bootSecurityOption"` -} - -func init() { - t["HostTpmBootSecurityOptionEventDetails"] = reflect.TypeOf((*HostTpmBootSecurityOptionEventDetails)(nil)).Elem() -} - -type HostTpmCommandEventDetails struct { - HostTpmEventDetails - - CommandLine string `xml:"commandLine"` -} - -func init() { - t["HostTpmCommandEventDetails"] = reflect.TypeOf((*HostTpmCommandEventDetails)(nil)).Elem() -} - -type HostTpmDigestInfo struct { - HostDigestInfo - - PcrNumber int `xml:"pcrNumber"` -} - -func init() { - t["HostTpmDigestInfo"] = reflect.TypeOf((*HostTpmDigestInfo)(nil)).Elem() -} - -type HostTpmEventDetails struct { - DynamicData - - DataHash []byte `xml:"dataHash"` -} - -func init() { - t["HostTpmEventDetails"] = reflect.TypeOf((*HostTpmEventDetails)(nil)).Elem() -} - -type HostTpmEventLogEntry struct { - DynamicData - - PcrIndex int `xml:"pcrIndex"` - EventDetails BaseHostTpmEventDetails `xml:"eventDetails,typeattr"` -} - -func init() { - t["HostTpmEventLogEntry"] = reflect.TypeOf((*HostTpmEventLogEntry)(nil)).Elem() -} - -type HostTpmOptionEventDetails struct { - HostTpmEventDetails - - OptionsFileName string `xml:"optionsFileName"` - BootOptions []byte `xml:"bootOptions,omitempty"` -} - -func init() { - t["HostTpmOptionEventDetails"] = reflect.TypeOf((*HostTpmOptionEventDetails)(nil)).Elem() -} - -type HostTpmSoftwareComponentEventDetails struct { - HostTpmEventDetails - - ComponentName string `xml:"componentName"` - VibName string `xml:"vibName"` - VibVersion string `xml:"vibVersion"` - VibVendor string `xml:"vibVendor"` -} - -func init() { - t["HostTpmSoftwareComponentEventDetails"] = reflect.TypeOf((*HostTpmSoftwareComponentEventDetails)(nil)).Elem() -} - -type HostUnresolvedVmfsExtent struct { - DynamicData - - Device HostScsiDiskPartition `xml:"device"` - DevicePath string `xml:"devicePath"` - VmfsUuid string `xml:"vmfsUuid"` - IsHeadExtent bool `xml:"isHeadExtent"` - Ordinal int `xml:"ordinal"` - StartBlock int `xml:"startBlock"` - EndBlock int `xml:"endBlock"` - Reason string `xml:"reason"` -} - -func init() { - t["HostUnresolvedVmfsExtent"] = reflect.TypeOf((*HostUnresolvedVmfsExtent)(nil)).Elem() -} - -type HostUnresolvedVmfsResignatureSpec struct { - DynamicData - - ExtentDevicePath []string `xml:"extentDevicePath"` -} - -func init() { - t["HostUnresolvedVmfsResignatureSpec"] = reflect.TypeOf((*HostUnresolvedVmfsResignatureSpec)(nil)).Elem() -} - -type HostUnresolvedVmfsResolutionResult struct { - DynamicData - - Spec HostUnresolvedVmfsResolutionSpec `xml:"spec"` - Vmfs *HostVmfsVolume `xml:"vmfs,omitempty"` - Fault *LocalizedMethodFault `xml:"fault,omitempty"` -} - -func init() { - t["HostUnresolvedVmfsResolutionResult"] = reflect.TypeOf((*HostUnresolvedVmfsResolutionResult)(nil)).Elem() -} - -type HostUnresolvedVmfsResolutionSpec struct { - DynamicData - - ExtentDevicePath []string `xml:"extentDevicePath"` - UuidResolution string `xml:"uuidResolution"` -} - -func init() { - t["HostUnresolvedVmfsResolutionSpec"] = reflect.TypeOf((*HostUnresolvedVmfsResolutionSpec)(nil)).Elem() -} - -type HostUnresolvedVmfsVolume struct { - DynamicData - - Extent []HostUnresolvedVmfsExtent `xml:"extent"` - VmfsLabel string `xml:"vmfsLabel"` - VmfsUuid string `xml:"vmfsUuid"` - TotalBlocks int `xml:"totalBlocks"` - ResolveStatus HostUnresolvedVmfsVolumeResolveStatus `xml:"resolveStatus"` -} - -func init() { - t["HostUnresolvedVmfsVolume"] = reflect.TypeOf((*HostUnresolvedVmfsVolume)(nil)).Elem() -} - -type HostUnresolvedVmfsVolumeResolveStatus struct { - DynamicData - - Resolvable bool `xml:"resolvable"` - IncompleteExtents *bool `xml:"incompleteExtents"` - MultipleCopies *bool `xml:"multipleCopies"` -} - -func init() { - t["HostUnresolvedVmfsVolumeResolveStatus"] = reflect.TypeOf((*HostUnresolvedVmfsVolumeResolveStatus)(nil)).Elem() -} - -type HostUpgradeFailedEvent struct { - HostEvent -} - -func init() { - t["HostUpgradeFailedEvent"] = reflect.TypeOf((*HostUpgradeFailedEvent)(nil)).Elem() -} - -type HostUserWorldSwapNotEnabledEvent struct { - HostEvent -} - -func init() { - t["HostUserWorldSwapNotEnabledEvent"] = reflect.TypeOf((*HostUserWorldSwapNotEnabledEvent)(nil)).Elem() -} - -type HostVFlashManagerVFlashCacheConfigInfo struct { - DynamicData - - VFlashModuleConfigOption []HostVFlashManagerVFlashCacheConfigInfoVFlashModuleConfigOption `xml:"vFlashModuleConfigOption,omitempty"` - DefaultVFlashModule string `xml:"defaultVFlashModule,omitempty"` - SwapCacheReservationInGB int64 `xml:"swapCacheReservationInGB,omitempty"` -} - -func init() { - t["HostVFlashManagerVFlashCacheConfigInfo"] = reflect.TypeOf((*HostVFlashManagerVFlashCacheConfigInfo)(nil)).Elem() -} - -type HostVFlashManagerVFlashCacheConfigInfoVFlashModuleConfigOption struct { - DynamicData - - VFlashModule string `xml:"vFlashModule"` - VFlashModuleVersion string `xml:"vFlashModuleVersion"` - MinSupportedModuleVersion string `xml:"minSupportedModuleVersion"` - CacheConsistencyType ChoiceOption `xml:"cacheConsistencyType"` - CacheMode ChoiceOption `xml:"cacheMode"` - BlockSizeInKBOption LongOption `xml:"blockSizeInKBOption"` - ReservationInMBOption LongOption `xml:"reservationInMBOption"` - MaxDiskSizeInKB int64 `xml:"maxDiskSizeInKB"` -} - -func init() { - t["HostVFlashManagerVFlashCacheConfigInfoVFlashModuleConfigOption"] = reflect.TypeOf((*HostVFlashManagerVFlashCacheConfigInfoVFlashModuleConfigOption)(nil)).Elem() -} - -type HostVFlashManagerVFlashCacheConfigSpec struct { - DynamicData - - DefaultVFlashModule string `xml:"defaultVFlashModule"` - SwapCacheReservationInGB int64 `xml:"swapCacheReservationInGB"` -} - -func init() { - t["HostVFlashManagerVFlashCacheConfigSpec"] = reflect.TypeOf((*HostVFlashManagerVFlashCacheConfigSpec)(nil)).Elem() -} - -type HostVFlashManagerVFlashConfigInfo struct { - DynamicData - - VFlashResourceConfigInfo *HostVFlashManagerVFlashResourceConfigInfo `xml:"vFlashResourceConfigInfo,omitempty"` - VFlashCacheConfigInfo *HostVFlashManagerVFlashCacheConfigInfo `xml:"vFlashCacheConfigInfo,omitempty"` -} - -func init() { - t["HostVFlashManagerVFlashConfigInfo"] = reflect.TypeOf((*HostVFlashManagerVFlashConfigInfo)(nil)).Elem() -} - -type HostVFlashManagerVFlashResourceConfigInfo struct { - DynamicData - - Vffs *HostVffsVolume `xml:"vffs,omitempty"` - Capacity int64 `xml:"capacity"` -} - -func init() { - t["HostVFlashManagerVFlashResourceConfigInfo"] = reflect.TypeOf((*HostVFlashManagerVFlashResourceConfigInfo)(nil)).Elem() -} - -type HostVFlashManagerVFlashResourceConfigSpec struct { - DynamicData - - VffsUuid string `xml:"vffsUuid"` -} - -func init() { - t["HostVFlashManagerVFlashResourceConfigSpec"] = reflect.TypeOf((*HostVFlashManagerVFlashResourceConfigSpec)(nil)).Elem() -} - -type HostVFlashManagerVFlashResourceRunTimeInfo struct { - DynamicData - - Usage int64 `xml:"usage"` - Capacity int64 `xml:"capacity"` - Accessible bool `xml:"accessible"` - CapacityForVmCache int64 `xml:"capacityForVmCache"` - FreeForVmCache int64 `xml:"freeForVmCache"` -} - -func init() { - t["HostVFlashManagerVFlashResourceRunTimeInfo"] = reflect.TypeOf((*HostVFlashManagerVFlashResourceRunTimeInfo)(nil)).Elem() -} - -type HostVFlashResourceConfigurationResult struct { - DynamicData - - DevicePath []string `xml:"devicePath,omitempty"` - Vffs *HostVffsVolume `xml:"vffs,omitempty"` - DiskConfigurationResult []HostDiskConfigurationResult `xml:"diskConfigurationResult,omitempty"` -} - -func init() { - t["HostVFlashResourceConfigurationResult"] = reflect.TypeOf((*HostVFlashResourceConfigurationResult)(nil)).Elem() -} - -type HostVMotionCompatibility struct { - DynamicData - - Host ManagedObjectReference `xml:"host"` - Compatibility []string `xml:"compatibility,omitempty"` -} - -func init() { - t["HostVMotionCompatibility"] = reflect.TypeOf((*HostVMotionCompatibility)(nil)).Elem() -} - -type HostVMotionConfig struct { - DynamicData - - VmotionNicKey string `xml:"vmotionNicKey,omitempty"` - Enabled bool `xml:"enabled"` -} - -func init() { - t["HostVMotionConfig"] = reflect.TypeOf((*HostVMotionConfig)(nil)).Elem() -} - -type HostVMotionInfo struct { - DynamicData - - NetConfig *HostVMotionNetConfig `xml:"netConfig,omitempty"` - IpConfig *HostIpConfig `xml:"ipConfig,omitempty"` -} - -func init() { - t["HostVMotionInfo"] = reflect.TypeOf((*HostVMotionInfo)(nil)).Elem() -} - -type HostVMotionNetConfig struct { - DynamicData - - CandidateVnic []HostVirtualNic `xml:"candidateVnic,omitempty"` - SelectedVnic string `xml:"selectedVnic,omitempty"` -} - -func init() { - t["HostVMotionNetConfig"] = reflect.TypeOf((*HostVMotionNetConfig)(nil)).Elem() -} - -type HostVfatVolume struct { - HostFileSystemVolume -} - -func init() { - t["HostVfatVolume"] = reflect.TypeOf((*HostVfatVolume)(nil)).Elem() -} - -type HostVffsSpec struct { - DynamicData - - DevicePath string `xml:"devicePath"` - Partition *HostDiskPartitionSpec `xml:"partition,omitempty"` - MajorVersion int `xml:"majorVersion"` - VolumeName string `xml:"volumeName"` -} - -func init() { - t["HostVffsSpec"] = reflect.TypeOf((*HostVffsSpec)(nil)).Elem() -} - -type HostVffsVolume struct { - HostFileSystemVolume - - MajorVersion int `xml:"majorVersion"` - Version string `xml:"version"` - Uuid string `xml:"uuid"` - Extent []HostScsiDiskPartition `xml:"extent"` -} - -func init() { - t["HostVffsVolume"] = reflect.TypeOf((*HostVffsVolume)(nil)).Elem() -} - -type HostVirtualNic struct { - DynamicData - - Device string `xml:"device"` - Key string `xml:"key"` - Portgroup string `xml:"portgroup"` - Spec HostVirtualNicSpec `xml:"spec"` - Port string `xml:"port,omitempty"` -} - -func init() { - t["HostVirtualNic"] = reflect.TypeOf((*HostVirtualNic)(nil)).Elem() -} - -type HostVirtualNicConfig struct { - DynamicData - - ChangeOperation string `xml:"changeOperation,omitempty"` - Device string `xml:"device,omitempty"` - Portgroup string `xml:"portgroup"` - Spec *HostVirtualNicSpec `xml:"spec,omitempty"` -} - -func init() { - t["HostVirtualNicConfig"] = reflect.TypeOf((*HostVirtualNicConfig)(nil)).Elem() -} - -type HostVirtualNicConnection struct { - DynamicData - - Portgroup string `xml:"portgroup,omitempty"` - DvPort *DistributedVirtualSwitchPortConnection `xml:"dvPort,omitempty"` -} - -func init() { - t["HostVirtualNicConnection"] = reflect.TypeOf((*HostVirtualNicConnection)(nil)).Elem() -} - -type HostVirtualNicManagerInfo struct { - DynamicData - - NetConfig []VirtualNicManagerNetConfig `xml:"netConfig,omitempty"` -} - -func init() { - t["HostVirtualNicManagerInfo"] = reflect.TypeOf((*HostVirtualNicManagerInfo)(nil)).Elem() -} - -type HostVirtualNicManagerNicTypeSelection struct { - DynamicData - - Vnic HostVirtualNicConnection `xml:"vnic"` - NicType []string `xml:"nicType,omitempty"` -} - -func init() { - t["HostVirtualNicManagerNicTypeSelection"] = reflect.TypeOf((*HostVirtualNicManagerNicTypeSelection)(nil)).Elem() -} - -type HostVirtualNicSpec struct { - DynamicData - - Ip *HostIpConfig `xml:"ip,omitempty"` - Mac string `xml:"mac,omitempty"` - DistributedVirtualPort *DistributedVirtualSwitchPortConnection `xml:"distributedVirtualPort,omitempty"` - Portgroup string `xml:"portgroup,omitempty"` - Mtu int `xml:"mtu,omitempty"` - TsoEnabled *bool `xml:"tsoEnabled"` - NetStackInstanceKey string `xml:"netStackInstanceKey,omitempty"` -} - -func init() { - t["HostVirtualNicSpec"] = reflect.TypeOf((*HostVirtualNicSpec)(nil)).Elem() -} - -type HostVirtualSwitch struct { - DynamicData - - Name string `xml:"name"` - Key string `xml:"key"` - NumPorts int `xml:"numPorts"` - NumPortsAvailable int `xml:"numPortsAvailable"` - Mtu int `xml:"mtu,omitempty"` - Portgroup []string `xml:"portgroup,omitempty"` - Pnic []string `xml:"pnic,omitempty"` - Spec HostVirtualSwitchSpec `xml:"spec"` -} - -func init() { - t["HostVirtualSwitch"] = reflect.TypeOf((*HostVirtualSwitch)(nil)).Elem() -} - -type HostVirtualSwitchAutoBridge struct { - HostVirtualSwitchBridge - - ExcludedNicDevice []string `xml:"excludedNicDevice,omitempty"` -} - -func init() { - t["HostVirtualSwitchAutoBridge"] = reflect.TypeOf((*HostVirtualSwitchAutoBridge)(nil)).Elem() -} - -type HostVirtualSwitchBeaconConfig struct { - DynamicData - - Interval int `xml:"interval"` -} - -func init() { - t["HostVirtualSwitchBeaconConfig"] = reflect.TypeOf((*HostVirtualSwitchBeaconConfig)(nil)).Elem() -} - -type HostVirtualSwitchBondBridge struct { - HostVirtualSwitchBridge - - NicDevice []string `xml:"nicDevice"` - Beacon *HostVirtualSwitchBeaconConfig `xml:"beacon,omitempty"` - LinkDiscoveryProtocolConfig *LinkDiscoveryProtocolConfig `xml:"linkDiscoveryProtocolConfig,omitempty"` -} - -func init() { - t["HostVirtualSwitchBondBridge"] = reflect.TypeOf((*HostVirtualSwitchBondBridge)(nil)).Elem() -} - -type HostVirtualSwitchBridge struct { - DynamicData -} - -func init() { - t["HostVirtualSwitchBridge"] = reflect.TypeOf((*HostVirtualSwitchBridge)(nil)).Elem() -} - -type HostVirtualSwitchConfig struct { - DynamicData - - ChangeOperation string `xml:"changeOperation,omitempty"` - Name string `xml:"name"` - Spec *HostVirtualSwitchSpec `xml:"spec,omitempty"` -} - -func init() { - t["HostVirtualSwitchConfig"] = reflect.TypeOf((*HostVirtualSwitchConfig)(nil)).Elem() -} - -type HostVirtualSwitchSimpleBridge struct { - HostVirtualSwitchBridge - - NicDevice string `xml:"nicDevice"` -} - -func init() { - t["HostVirtualSwitchSimpleBridge"] = reflect.TypeOf((*HostVirtualSwitchSimpleBridge)(nil)).Elem() -} - -type HostVirtualSwitchSpec struct { - DynamicData - - NumPorts int `xml:"numPorts"` - Bridge BaseHostVirtualSwitchBridge `xml:"bridge,omitempty,typeattr"` - Policy *HostNetworkPolicy `xml:"policy,omitempty"` - Mtu int `xml:"mtu,omitempty"` -} - -func init() { - t["HostVirtualSwitchSpec"] = reflect.TypeOf((*HostVirtualSwitchSpec)(nil)).Elem() -} - -type HostVmciAccessManagerAccessSpec struct { - DynamicData - - Vm ManagedObjectReference `xml:"vm"` - Services []string `xml:"services,omitempty"` - Mode string `xml:"mode"` -} - -func init() { - t["HostVmciAccessManagerAccessSpec"] = reflect.TypeOf((*HostVmciAccessManagerAccessSpec)(nil)).Elem() -} - -type HostVmfsRescanResult struct { - DynamicData - - Host ManagedObjectReference `xml:"host"` - Fault *LocalizedMethodFault `xml:"fault,omitempty"` -} - -func init() { - t["HostVmfsRescanResult"] = reflect.TypeOf((*HostVmfsRescanResult)(nil)).Elem() -} - -type HostVmfsSpec struct { - DynamicData - - Extent HostScsiDiskPartition `xml:"extent"` - BlockSizeMb int `xml:"blockSizeMb,omitempty"` - MajorVersion int `xml:"majorVersion"` - VolumeName string `xml:"volumeName"` -} - -func init() { - t["HostVmfsSpec"] = reflect.TypeOf((*HostVmfsSpec)(nil)).Elem() -} - -type HostVmfsVolume struct { - HostFileSystemVolume - - BlockSizeMb int `xml:"blockSizeMb"` - MaxBlocks int `xml:"maxBlocks"` - MajorVersion int `xml:"majorVersion"` - Version string `xml:"version"` - Uuid string `xml:"uuid"` - Extent []HostScsiDiskPartition `xml:"extent"` - VmfsUpgradable bool `xml:"vmfsUpgradable"` - ForceMountedInfo *HostForceMountedInfo `xml:"forceMountedInfo,omitempty"` - Ssd *bool `xml:"ssd"` - Local *bool `xml:"local"` -} - -func init() { - t["HostVmfsVolume"] = reflect.TypeOf((*HostVmfsVolume)(nil)).Elem() -} - -type HostVnicConnectedToCustomizedDVPortEvent struct { - HostEvent - - Vnic VnicPortArgument `xml:"vnic"` -} - -func init() { - t["HostVnicConnectedToCustomizedDVPortEvent"] = reflect.TypeOf((*HostVnicConnectedToCustomizedDVPortEvent)(nil)).Elem() -} - -type HostVsanInternalSystemCmmdsQuery struct { - DynamicData - - Type string `xml:"type,omitempty"` - Uuid string `xml:"uuid,omitempty"` - Owner string `xml:"owner,omitempty"` -} - -func init() { - t["HostVsanInternalSystemCmmdsQuery"] = reflect.TypeOf((*HostVsanInternalSystemCmmdsQuery)(nil)).Elem() -} - -type HostWwnChangedEvent struct { - HostEvent - - OldNodeWwns []int64 `xml:"oldNodeWwns,omitempty"` - OldPortWwns []int64 `xml:"oldPortWwns,omitempty"` - NewNodeWwns []int64 `xml:"newNodeWwns,omitempty"` - NewPortWwns []int64 `xml:"newPortWwns,omitempty"` -} - -func init() { - t["HostWwnChangedEvent"] = reflect.TypeOf((*HostWwnChangedEvent)(nil)).Elem() -} - -type HostWwnConflictEvent struct { - HostEvent - - ConflictedVms []VmEventArgument `xml:"conflictedVms,omitempty"` - ConflictedHosts []HostEventArgument `xml:"conflictedHosts,omitempty"` - Wwn int64 `xml:"wwn"` -} - -func init() { - t["HostWwnConflictEvent"] = reflect.TypeOf((*HostWwnConflictEvent)(nil)).Elem() -} - -type HotSnapshotMoveNotSupported struct { - SnapshotCopyNotSupported -} - -func init() { - t["HotSnapshotMoveNotSupported"] = reflect.TypeOf((*HotSnapshotMoveNotSupported)(nil)).Elem() -} - -type HotSnapshotMoveNotSupportedFault HotSnapshotMoveNotSupported - -func init() { - t["HotSnapshotMoveNotSupportedFault"] = reflect.TypeOf((*HotSnapshotMoveNotSupportedFault)(nil)).Elem() -} - -type HourlyTaskScheduler struct { - RecurrentTaskScheduler - - Minute int `xml:"minute"` -} - -func init() { - t["HourlyTaskScheduler"] = reflect.TypeOf((*HourlyTaskScheduler)(nil)).Elem() -} - -type HttpNfcLeaseAbort HttpNfcLeaseAbortRequestType - -func init() { - t["HttpNfcLeaseAbort"] = reflect.TypeOf((*HttpNfcLeaseAbort)(nil)).Elem() -} - -type HttpNfcLeaseAbortRequestType struct { - This ManagedObjectReference `xml:"_this"` - Fault *LocalizedMethodFault `xml:"fault,omitempty"` -} - -func init() { - t["HttpNfcLeaseAbortRequestType"] = reflect.TypeOf((*HttpNfcLeaseAbortRequestType)(nil)).Elem() -} - -type HttpNfcLeaseAbortResponse struct { -} - -type HttpNfcLeaseComplete HttpNfcLeaseCompleteRequestType - -func init() { - t["HttpNfcLeaseComplete"] = reflect.TypeOf((*HttpNfcLeaseComplete)(nil)).Elem() -} - -type HttpNfcLeaseCompleteRequestType struct { - This ManagedObjectReference `xml:"_this"` -} - -func init() { - t["HttpNfcLeaseCompleteRequestType"] = reflect.TypeOf((*HttpNfcLeaseCompleteRequestType)(nil)).Elem() -} - -type HttpNfcLeaseCompleteResponse struct { -} - -type HttpNfcLeaseDatastoreLeaseInfo struct { - DynamicData - - DatastoreKey string `xml:"datastoreKey"` - Hosts []HttpNfcLeaseHostInfo `xml:"hosts"` -} - -func init() { - t["HttpNfcLeaseDatastoreLeaseInfo"] = reflect.TypeOf((*HttpNfcLeaseDatastoreLeaseInfo)(nil)).Elem() -} - -type HttpNfcLeaseDeviceUrl struct { - DynamicData - - Key string `xml:"key"` - ImportKey string `xml:"importKey"` - Url string `xml:"url"` - SslThumbprint string `xml:"sslThumbprint"` - Disk *bool `xml:"disk"` - TargetId string `xml:"targetId,omitempty"` - DatastoreKey string `xml:"datastoreKey,omitempty"` - FileSize int64 `xml:"fileSize,omitempty"` -} - -func init() { - t["HttpNfcLeaseDeviceUrl"] = reflect.TypeOf((*HttpNfcLeaseDeviceUrl)(nil)).Elem() -} - -type HttpNfcLeaseGetManifest HttpNfcLeaseGetManifestRequestType - -func init() { - t["HttpNfcLeaseGetManifest"] = reflect.TypeOf((*HttpNfcLeaseGetManifest)(nil)).Elem() -} - -type HttpNfcLeaseGetManifestRequestType struct { - This ManagedObjectReference `xml:"_this"` -} - -func init() { - t["HttpNfcLeaseGetManifestRequestType"] = reflect.TypeOf((*HttpNfcLeaseGetManifestRequestType)(nil)).Elem() -} - -type HttpNfcLeaseGetManifestResponse struct { - Returnval []HttpNfcLeaseManifestEntry `xml:"returnval,omitempty"` -} - -type HttpNfcLeaseHostInfo struct { - DynamicData - - Url string `xml:"url"` - SslThumbprint string `xml:"sslThumbprint"` -} - -func init() { - t["HttpNfcLeaseHostInfo"] = reflect.TypeOf((*HttpNfcLeaseHostInfo)(nil)).Elem() -} - -type HttpNfcLeaseInfo struct { - DynamicData - - Lease ManagedObjectReference `xml:"lease"` - Entity ManagedObjectReference `xml:"entity"` - DeviceUrl []HttpNfcLeaseDeviceUrl `xml:"deviceUrl,omitempty"` - TotalDiskCapacityInKB int64 `xml:"totalDiskCapacityInKB"` - LeaseTimeout int `xml:"leaseTimeout"` - HostMap []HttpNfcLeaseDatastoreLeaseInfo `xml:"hostMap,omitempty"` -} - -func init() { - t["HttpNfcLeaseInfo"] = reflect.TypeOf((*HttpNfcLeaseInfo)(nil)).Elem() -} - -type HttpNfcLeaseManifestEntry struct { - DynamicData - - Key string `xml:"key"` - Sha1 string `xml:"sha1"` - Size int64 `xml:"size"` - Disk bool `xml:"disk"` - Capacity int64 `xml:"capacity,omitempty"` - PopulatedSize int64 `xml:"populatedSize,omitempty"` -} - -func init() { - t["HttpNfcLeaseManifestEntry"] = reflect.TypeOf((*HttpNfcLeaseManifestEntry)(nil)).Elem() -} - -type HttpNfcLeaseProgress HttpNfcLeaseProgressRequestType - -func init() { - t["HttpNfcLeaseProgress"] = reflect.TypeOf((*HttpNfcLeaseProgress)(nil)).Elem() -} - -type HttpNfcLeaseProgressRequestType struct { - This ManagedObjectReference `xml:"_this"` - Percent int `xml:"percent"` -} - -func init() { - t["HttpNfcLeaseProgressRequestType"] = reflect.TypeOf((*HttpNfcLeaseProgressRequestType)(nil)).Elem() -} - -type HttpNfcLeaseProgressResponse struct { -} - -type IDEDiskNotSupported struct { - DiskNotSupported -} - -func init() { - t["IDEDiskNotSupported"] = reflect.TypeOf((*IDEDiskNotSupported)(nil)).Elem() -} - -type IDEDiskNotSupportedFault IDEDiskNotSupported - -func init() { - t["IDEDiskNotSupportedFault"] = reflect.TypeOf((*IDEDiskNotSupportedFault)(nil)).Elem() -} - -type IORMNotSupportedHostOnDatastore struct { - VimFault - - Datastore ManagedObjectReference `xml:"datastore"` - DatastoreName string `xml:"datastoreName"` - Host []ManagedObjectReference `xml:"host,omitempty"` -} - -func init() { - t["IORMNotSupportedHostOnDatastore"] = reflect.TypeOf((*IORMNotSupportedHostOnDatastore)(nil)).Elem() -} - -type IORMNotSupportedHostOnDatastoreFault IORMNotSupportedHostOnDatastore - -func init() { - t["IORMNotSupportedHostOnDatastoreFault"] = reflect.TypeOf((*IORMNotSupportedHostOnDatastoreFault)(nil)).Elem() -} - -type IScsiBootFailureEvent struct { - HostEvent -} - -func init() { - t["IScsiBootFailureEvent"] = reflect.TypeOf((*IScsiBootFailureEvent)(nil)).Elem() -} - -type ImpersonateUser ImpersonateUserRequestType - -func init() { - t["ImpersonateUser"] = reflect.TypeOf((*ImpersonateUser)(nil)).Elem() -} - -type ImpersonateUserRequestType struct { - This ManagedObjectReference `xml:"_this"` - UserName string `xml:"userName"` - Locale string `xml:"locale,omitempty"` -} - -func init() { - t["ImpersonateUserRequestType"] = reflect.TypeOf((*ImpersonateUserRequestType)(nil)).Elem() -} - -type ImpersonateUserResponse struct { - Returnval UserSession `xml:"returnval"` -} - -type ImportCertificateForCAMRequestType struct { - This ManagedObjectReference `xml:"_this"` - CertPath string `xml:"certPath"` - CamServer string `xml:"camServer"` -} - -func init() { - t["ImportCertificateForCAMRequestType"] = reflect.TypeOf((*ImportCertificateForCAMRequestType)(nil)).Elem() -} - -type ImportCertificateForCAM_Task ImportCertificateForCAMRequestType - -func init() { - t["ImportCertificateForCAM_Task"] = reflect.TypeOf((*ImportCertificateForCAM_Task)(nil)).Elem() -} - -type ImportCertificateForCAM_TaskResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type ImportHostAddFailure struct { - DvsFault - - HostIp []string `xml:"hostIp"` -} - -func init() { - t["ImportHostAddFailure"] = reflect.TypeOf((*ImportHostAddFailure)(nil)).Elem() -} - -type ImportHostAddFailureFault ImportHostAddFailure - -func init() { - t["ImportHostAddFailureFault"] = reflect.TypeOf((*ImportHostAddFailureFault)(nil)).Elem() -} - -type ImportOperationBulkFault struct { - DvsFault - - ImportFaults []ImportOperationBulkFaultFaultOnImport `xml:"importFaults"` -} - -func init() { - t["ImportOperationBulkFault"] = reflect.TypeOf((*ImportOperationBulkFault)(nil)).Elem() -} - -type ImportOperationBulkFaultFault ImportOperationBulkFault - -func init() { - t["ImportOperationBulkFaultFault"] = reflect.TypeOf((*ImportOperationBulkFaultFault)(nil)).Elem() -} - -type ImportOperationBulkFaultFaultOnImport struct { - DynamicData - - EntityType string `xml:"entityType,omitempty"` - Key string `xml:"key,omitempty"` - Fault LocalizedMethodFault `xml:"fault"` -} - -func init() { - t["ImportOperationBulkFaultFaultOnImport"] = reflect.TypeOf((*ImportOperationBulkFaultFaultOnImport)(nil)).Elem() -} - -type ImportSpec struct { - DynamicData - - EntityConfig *VAppEntityConfigInfo `xml:"entityConfig,omitempty"` - InstantiationOst *OvfConsumerOstNode `xml:"instantiationOst,omitempty"` -} - -func init() { - t["ImportSpec"] = reflect.TypeOf((*ImportSpec)(nil)).Elem() -} - -type ImportVApp ImportVAppRequestType - -func init() { - t["ImportVApp"] = reflect.TypeOf((*ImportVApp)(nil)).Elem() -} - -type ImportVAppRequestType struct { - This ManagedObjectReference `xml:"_this"` - Spec BaseImportSpec `xml:"spec,typeattr"` - Folder *ManagedObjectReference `xml:"folder,omitempty"` - Host *ManagedObjectReference `xml:"host,omitempty"` -} - -func init() { - t["ImportVAppRequestType"] = reflect.TypeOf((*ImportVAppRequestType)(nil)).Elem() -} - -type ImportVAppResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type InUseFeatureManipulationDisallowed struct { - NotEnoughLicenses -} - -func init() { - t["InUseFeatureManipulationDisallowed"] = reflect.TypeOf((*InUseFeatureManipulationDisallowed)(nil)).Elem() -} - -type InUseFeatureManipulationDisallowedFault InUseFeatureManipulationDisallowed - -func init() { - t["InUseFeatureManipulationDisallowedFault"] = reflect.TypeOf((*InUseFeatureManipulationDisallowedFault)(nil)).Elem() -} - -type InaccessibleDatastore struct { - InvalidDatastore - - Detail string `xml:"detail,omitempty"` -} - -func init() { - t["InaccessibleDatastore"] = reflect.TypeOf((*InaccessibleDatastore)(nil)).Elem() -} - -type InaccessibleDatastoreFault InaccessibleDatastore - -func init() { - t["InaccessibleDatastoreFault"] = reflect.TypeOf((*InaccessibleDatastoreFault)(nil)).Elem() -} - -type InaccessibleVFlashSource struct { - VimFault - - HostName string `xml:"hostName"` -} - -func init() { - t["InaccessibleVFlashSource"] = reflect.TypeOf((*InaccessibleVFlashSource)(nil)).Elem() -} - -type InaccessibleVFlashSourceFault InaccessibleVFlashSource - -func init() { - t["InaccessibleVFlashSourceFault"] = reflect.TypeOf((*InaccessibleVFlashSourceFault)(nil)).Elem() -} - -type IncompatibleDefaultDevice struct { - MigrationFault - - Device string `xml:"device"` -} - -func init() { - t["IncompatibleDefaultDevice"] = reflect.TypeOf((*IncompatibleDefaultDevice)(nil)).Elem() -} - -type IncompatibleDefaultDeviceFault IncompatibleDefaultDevice - -func init() { - t["IncompatibleDefaultDeviceFault"] = reflect.TypeOf((*IncompatibleDefaultDeviceFault)(nil)).Elem() -} - -type IncompatibleHostForFtSecondary struct { - VmFaultToleranceIssue - - Host ManagedObjectReference `xml:"host"` - Error []LocalizedMethodFault `xml:"error,omitempty"` -} - -func init() { - t["IncompatibleHostForFtSecondary"] = reflect.TypeOf((*IncompatibleHostForFtSecondary)(nil)).Elem() -} - -type IncompatibleHostForFtSecondaryFault IncompatibleHostForFtSecondary - -func init() { - t["IncompatibleHostForFtSecondaryFault"] = reflect.TypeOf((*IncompatibleHostForFtSecondaryFault)(nil)).Elem() -} - -type IncompatibleSetting struct { - InvalidArgument - - ConflictingProperty string `xml:"conflictingProperty"` -} - -func init() { - t["IncompatibleSetting"] = reflect.TypeOf((*IncompatibleSetting)(nil)).Elem() -} - -type IncompatibleSettingFault IncompatibleSetting - -func init() { - t["IncompatibleSettingFault"] = reflect.TypeOf((*IncompatibleSettingFault)(nil)).Elem() -} - -type IncorrectFileType struct { - FileFault -} - -func init() { - t["IncorrectFileType"] = reflect.TypeOf((*IncorrectFileType)(nil)).Elem() -} - -type IncorrectFileTypeFault IncorrectFileType - -func init() { - t["IncorrectFileTypeFault"] = reflect.TypeOf((*IncorrectFileTypeFault)(nil)).Elem() -} - -type IncorrectHostInformation struct { - NotEnoughLicenses -} - -func init() { - t["IncorrectHostInformation"] = reflect.TypeOf((*IncorrectHostInformation)(nil)).Elem() -} - -type IncorrectHostInformationEvent struct { - LicenseEvent -} - -func init() { - t["IncorrectHostInformationEvent"] = reflect.TypeOf((*IncorrectHostInformationEvent)(nil)).Elem() -} - -type IncorrectHostInformationFault IncorrectHostInformation - -func init() { - t["IncorrectHostInformationFault"] = reflect.TypeOf((*IncorrectHostInformationFault)(nil)).Elem() -} - -type IndependentDiskVMotionNotSupported struct { - MigrationFeatureNotSupported -} - -func init() { - t["IndependentDiskVMotionNotSupported"] = reflect.TypeOf((*IndependentDiskVMotionNotSupported)(nil)).Elem() -} - -type IndependentDiskVMotionNotSupportedFault IndependentDiskVMotionNotSupported - -func init() { - t["IndependentDiskVMotionNotSupportedFault"] = reflect.TypeOf((*IndependentDiskVMotionNotSupportedFault)(nil)).Elem() -} - -type InflateVirtualDiskRequestType struct { - This ManagedObjectReference `xml:"_this"` - Name string `xml:"name"` - Datacenter *ManagedObjectReference `xml:"datacenter,omitempty"` -} - -func init() { - t["InflateVirtualDiskRequestType"] = reflect.TypeOf((*InflateVirtualDiskRequestType)(nil)).Elem() -} - -type InflateVirtualDisk_Task InflateVirtualDiskRequestType - -func init() { - t["InflateVirtualDisk_Task"] = reflect.TypeOf((*InflateVirtualDisk_Task)(nil)).Elem() -} - -type InflateVirtualDisk_TaskResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type InfoUpgradeEvent struct { - UpgradeEvent -} - -func init() { - t["InfoUpgradeEvent"] = reflect.TypeOf((*InfoUpgradeEvent)(nil)).Elem() -} - -type InheritablePolicy struct { - DynamicData - - Inherited bool `xml:"inherited"` -} - -func init() { - t["InheritablePolicy"] = reflect.TypeOf((*InheritablePolicy)(nil)).Elem() -} - -type InitializeDisksRequestType struct { - This ManagedObjectReference `xml:"_this"` - Mapping []VsanHostDiskMapping `xml:"mapping"` -} - -func init() { - t["InitializeDisksRequestType"] = reflect.TypeOf((*InitializeDisksRequestType)(nil)).Elem() -} - -type InitializeDisks_Task InitializeDisksRequestType - -func init() { - t["InitializeDisks_Task"] = reflect.TypeOf((*InitializeDisks_Task)(nil)).Elem() -} - -type InitializeDisks_TaskResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type InitiateFileTransferFromGuest InitiateFileTransferFromGuestRequestType - -func init() { - t["InitiateFileTransferFromGuest"] = reflect.TypeOf((*InitiateFileTransferFromGuest)(nil)).Elem() -} - -type InitiateFileTransferFromGuestRequestType struct { - This ManagedObjectReference `xml:"_this"` - Vm ManagedObjectReference `xml:"vm"` - Auth BaseGuestAuthentication `xml:"auth,typeattr"` - GuestFilePath string `xml:"guestFilePath"` -} - -func init() { - t["InitiateFileTransferFromGuestRequestType"] = reflect.TypeOf((*InitiateFileTransferFromGuestRequestType)(nil)).Elem() -} - -type InitiateFileTransferFromGuestResponse struct { - Returnval FileTransferInformation `xml:"returnval"` -} - -type InitiateFileTransferToGuest InitiateFileTransferToGuestRequestType - -func init() { - t["InitiateFileTransferToGuest"] = reflect.TypeOf((*InitiateFileTransferToGuest)(nil)).Elem() -} - -type InitiateFileTransferToGuestRequestType struct { - This ManagedObjectReference `xml:"_this"` - Vm ManagedObjectReference `xml:"vm"` - Auth BaseGuestAuthentication `xml:"auth,typeattr"` - GuestFilePath string `xml:"guestFilePath"` - FileAttributes BaseGuestFileAttributes `xml:"fileAttributes,typeattr"` - FileSize int64 `xml:"fileSize"` - Overwrite bool `xml:"overwrite"` -} - -func init() { - t["InitiateFileTransferToGuestRequestType"] = reflect.TypeOf((*InitiateFileTransferToGuestRequestType)(nil)).Elem() -} - -type InitiateFileTransferToGuestResponse struct { - Returnval string `xml:"returnval"` -} - -type InstallHostPatchRequestType struct { - This ManagedObjectReference `xml:"_this"` - Repository HostPatchManagerLocator `xml:"repository"` - UpdateID string `xml:"updateID"` - Force *bool `xml:"force"` -} - -func init() { - t["InstallHostPatchRequestType"] = reflect.TypeOf((*InstallHostPatchRequestType)(nil)).Elem() -} - -type InstallHostPatchV2RequestType struct { - This ManagedObjectReference `xml:"_this"` - MetaUrls []string `xml:"metaUrls,omitempty"` - BundleUrls []string `xml:"bundleUrls,omitempty"` - VibUrls []string `xml:"vibUrls,omitempty"` - Spec *HostPatchManagerPatchManagerOperationSpec `xml:"spec,omitempty"` -} - -func init() { - t["InstallHostPatchV2RequestType"] = reflect.TypeOf((*InstallHostPatchV2RequestType)(nil)).Elem() -} - -type InstallHostPatchV2_Task InstallHostPatchV2RequestType - -func init() { - t["InstallHostPatchV2_Task"] = reflect.TypeOf((*InstallHostPatchV2_Task)(nil)).Elem() -} - -type InstallHostPatchV2_TaskResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type InstallHostPatch_Task InstallHostPatchRequestType - -func init() { - t["InstallHostPatch_Task"] = reflect.TypeOf((*InstallHostPatch_Task)(nil)).Elem() -} - -type InstallHostPatch_TaskResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type InsufficientAgentVmsDeployed struct { - InsufficientResourcesFault - - HostName string `xml:"hostName"` - RequiredNumAgentVms int `xml:"requiredNumAgentVms"` - CurrentNumAgentVms int `xml:"currentNumAgentVms"` -} - -func init() { - t["InsufficientAgentVmsDeployed"] = reflect.TypeOf((*InsufficientAgentVmsDeployed)(nil)).Elem() -} - -type InsufficientAgentVmsDeployedFault InsufficientAgentVmsDeployed - -func init() { - t["InsufficientAgentVmsDeployedFault"] = reflect.TypeOf((*InsufficientAgentVmsDeployedFault)(nil)).Elem() -} - -type InsufficientCpuResourcesFault struct { - InsufficientResourcesFault - - Unreserved int64 `xml:"unreserved"` - Requested int64 `xml:"requested"` -} - -func init() { - t["InsufficientCpuResourcesFault"] = reflect.TypeOf((*InsufficientCpuResourcesFault)(nil)).Elem() -} - -type InsufficientCpuResourcesFaultFault InsufficientCpuResourcesFault - -func init() { - t["InsufficientCpuResourcesFaultFault"] = reflect.TypeOf((*InsufficientCpuResourcesFaultFault)(nil)).Elem() -} - -type InsufficientDisks struct { - VsanDiskFault -} - -func init() { - t["InsufficientDisks"] = reflect.TypeOf((*InsufficientDisks)(nil)).Elem() -} - -type InsufficientDisksFault InsufficientDisks - -func init() { - t["InsufficientDisksFault"] = reflect.TypeOf((*InsufficientDisksFault)(nil)).Elem() -} - -type InsufficientFailoverResourcesEvent struct { - ClusterEvent -} - -func init() { - t["InsufficientFailoverResourcesEvent"] = reflect.TypeOf((*InsufficientFailoverResourcesEvent)(nil)).Elem() -} - -type InsufficientFailoverResourcesFault struct { - InsufficientResourcesFault -} - -func init() { - t["InsufficientFailoverResourcesFault"] = reflect.TypeOf((*InsufficientFailoverResourcesFault)(nil)).Elem() -} - -type InsufficientFailoverResourcesFaultFault InsufficientFailoverResourcesFault - -func init() { - t["InsufficientFailoverResourcesFaultFault"] = reflect.TypeOf((*InsufficientFailoverResourcesFaultFault)(nil)).Elem() -} - -type InsufficientHostCapacityFault struct { - InsufficientResourcesFault - - Host *ManagedObjectReference `xml:"host,omitempty"` -} - -func init() { - t["InsufficientHostCapacityFault"] = reflect.TypeOf((*InsufficientHostCapacityFault)(nil)).Elem() -} - -type InsufficientHostCapacityFaultFault BaseInsufficientHostCapacityFault - -func init() { - t["InsufficientHostCapacityFaultFault"] = reflect.TypeOf((*InsufficientHostCapacityFaultFault)(nil)).Elem() -} - -type InsufficientHostCpuCapacityFault struct { - InsufficientHostCapacityFault - - Unreserved int64 `xml:"unreserved"` - Requested int64 `xml:"requested"` -} - -func init() { - t["InsufficientHostCpuCapacityFault"] = reflect.TypeOf((*InsufficientHostCpuCapacityFault)(nil)).Elem() -} - -type InsufficientHostCpuCapacityFaultFault InsufficientHostCpuCapacityFault - -func init() { - t["InsufficientHostCpuCapacityFaultFault"] = reflect.TypeOf((*InsufficientHostCpuCapacityFaultFault)(nil)).Elem() -} - -type InsufficientHostMemoryCapacityFault struct { - InsufficientHostCapacityFault - - Unreserved int64 `xml:"unreserved"` - Requested int64 `xml:"requested"` -} - -func init() { - t["InsufficientHostMemoryCapacityFault"] = reflect.TypeOf((*InsufficientHostMemoryCapacityFault)(nil)).Elem() -} - -type InsufficientHostMemoryCapacityFaultFault InsufficientHostMemoryCapacityFault - -func init() { - t["InsufficientHostMemoryCapacityFaultFault"] = reflect.TypeOf((*InsufficientHostMemoryCapacityFaultFault)(nil)).Elem() -} - -type InsufficientMemoryResourcesFault struct { - InsufficientResourcesFault - - Unreserved int64 `xml:"unreserved"` - Requested int64 `xml:"requested"` -} - -func init() { - t["InsufficientMemoryResourcesFault"] = reflect.TypeOf((*InsufficientMemoryResourcesFault)(nil)).Elem() -} - -type InsufficientMemoryResourcesFaultFault InsufficientMemoryResourcesFault - -func init() { - t["InsufficientMemoryResourcesFaultFault"] = reflect.TypeOf((*InsufficientMemoryResourcesFaultFault)(nil)).Elem() -} - -type InsufficientPerCpuCapacity struct { - InsufficientHostCapacityFault -} - -func init() { - t["InsufficientPerCpuCapacity"] = reflect.TypeOf((*InsufficientPerCpuCapacity)(nil)).Elem() -} - -type InsufficientPerCpuCapacityFault InsufficientPerCpuCapacity - -func init() { - t["InsufficientPerCpuCapacityFault"] = reflect.TypeOf((*InsufficientPerCpuCapacityFault)(nil)).Elem() -} - -type InsufficientResourcesFault struct { - VimFault -} - -func init() { - t["InsufficientResourcesFault"] = reflect.TypeOf((*InsufficientResourcesFault)(nil)).Elem() -} - -type InsufficientResourcesFaultFault BaseInsufficientResourcesFault - -func init() { - t["InsufficientResourcesFaultFault"] = reflect.TypeOf((*InsufficientResourcesFaultFault)(nil)).Elem() -} - -type InsufficientStandbyCpuResource struct { - InsufficientStandbyResource - - Available int64 `xml:"available"` - Requested int64 `xml:"requested"` -} - -func init() { - t["InsufficientStandbyCpuResource"] = reflect.TypeOf((*InsufficientStandbyCpuResource)(nil)).Elem() -} - -type InsufficientStandbyCpuResourceFault InsufficientStandbyCpuResource - -func init() { - t["InsufficientStandbyCpuResourceFault"] = reflect.TypeOf((*InsufficientStandbyCpuResourceFault)(nil)).Elem() -} - -type InsufficientStandbyMemoryResource struct { - InsufficientStandbyResource - - Available int64 `xml:"available"` - Requested int64 `xml:"requested"` -} - -func init() { - t["InsufficientStandbyMemoryResource"] = reflect.TypeOf((*InsufficientStandbyMemoryResource)(nil)).Elem() -} - -type InsufficientStandbyMemoryResourceFault InsufficientStandbyMemoryResource - -func init() { - t["InsufficientStandbyMemoryResourceFault"] = reflect.TypeOf((*InsufficientStandbyMemoryResourceFault)(nil)).Elem() -} - -type InsufficientStandbyResource struct { - InsufficientResourcesFault -} - -func init() { - t["InsufficientStandbyResource"] = reflect.TypeOf((*InsufficientStandbyResource)(nil)).Elem() -} - -type InsufficientStandbyResourceFault BaseInsufficientStandbyResource - -func init() { - t["InsufficientStandbyResourceFault"] = reflect.TypeOf((*InsufficientStandbyResourceFault)(nil)).Elem() -} - -type InsufficientStorageSpace struct { - InsufficientResourcesFault -} - -func init() { - t["InsufficientStorageSpace"] = reflect.TypeOf((*InsufficientStorageSpace)(nil)).Elem() -} - -type InsufficientStorageSpaceFault InsufficientStorageSpace - -func init() { - t["InsufficientStorageSpaceFault"] = reflect.TypeOf((*InsufficientStorageSpaceFault)(nil)).Elem() -} - -type InsufficientVFlashResourcesFault struct { - InsufficientResourcesFault - - FreeSpace int64 `xml:"freeSpace"` - RequestedSpace int64 `xml:"requestedSpace"` -} - -func init() { - t["InsufficientVFlashResourcesFault"] = reflect.TypeOf((*InsufficientVFlashResourcesFault)(nil)).Elem() -} - -type InsufficientVFlashResourcesFaultFault InsufficientVFlashResourcesFault - -func init() { - t["InsufficientVFlashResourcesFaultFault"] = reflect.TypeOf((*InsufficientVFlashResourcesFaultFault)(nil)).Elem() -} - -type IntExpression struct { - NegatableExpression - - Value int `xml:"value,omitempty"` -} - -func init() { - t["IntExpression"] = reflect.TypeOf((*IntExpression)(nil)).Elem() -} - -type IntOption struct { - OptionType - - Min int `xml:"min"` - Max int `xml:"max"` - DefaultValue int `xml:"defaultValue"` -} - -func init() { - t["IntOption"] = reflect.TypeOf((*IntOption)(nil)).Elem() -} - -type IntPolicy struct { - InheritablePolicy - - Value int `xml:"value,omitempty"` -} - -func init() { - t["IntPolicy"] = reflect.TypeOf((*IntPolicy)(nil)).Elem() -} - -type InvalidAffinitySettingFault struct { - VimFault -} - -func init() { - t["InvalidAffinitySettingFault"] = reflect.TypeOf((*InvalidAffinitySettingFault)(nil)).Elem() -} - -type InvalidAffinitySettingFaultFault InvalidAffinitySettingFault - -func init() { - t["InvalidAffinitySettingFaultFault"] = reflect.TypeOf((*InvalidAffinitySettingFaultFault)(nil)).Elem() -} - -type InvalidArgument struct { - RuntimeFault - - InvalidProperty string `xml:"invalidProperty,omitempty"` -} - -func init() { - t["InvalidArgument"] = reflect.TypeOf((*InvalidArgument)(nil)).Elem() -} - -type InvalidArgumentFault BaseInvalidArgument - -func init() { - t["InvalidArgumentFault"] = reflect.TypeOf((*InvalidArgumentFault)(nil)).Elem() -} - -type InvalidBmcRole struct { - VimFault -} - -func init() { - t["InvalidBmcRole"] = reflect.TypeOf((*InvalidBmcRole)(nil)).Elem() -} - -type InvalidBmcRoleFault InvalidBmcRole - -func init() { - t["InvalidBmcRoleFault"] = reflect.TypeOf((*InvalidBmcRoleFault)(nil)).Elem() -} - -type InvalidBundle struct { - PlatformConfigFault -} - -func init() { - t["InvalidBundle"] = reflect.TypeOf((*InvalidBundle)(nil)).Elem() -} - -type InvalidBundleFault InvalidBundle - -func init() { - t["InvalidBundleFault"] = reflect.TypeOf((*InvalidBundleFault)(nil)).Elem() -} - -type InvalidCAMCertificate struct { - InvalidCAMServer -} - -func init() { - t["InvalidCAMCertificate"] = reflect.TypeOf((*InvalidCAMCertificate)(nil)).Elem() -} - -type InvalidCAMCertificateFault InvalidCAMCertificate - -func init() { - t["InvalidCAMCertificateFault"] = reflect.TypeOf((*InvalidCAMCertificateFault)(nil)).Elem() -} - -type InvalidCAMServer struct { - ActiveDirectoryFault - - CamServer string `xml:"camServer"` -} - -func init() { - t["InvalidCAMServer"] = reflect.TypeOf((*InvalidCAMServer)(nil)).Elem() -} - -type InvalidCAMServerFault BaseInvalidCAMServer - -func init() { - t["InvalidCAMServerFault"] = reflect.TypeOf((*InvalidCAMServerFault)(nil)).Elem() -} - -type InvalidClientCertificate struct { - InvalidLogin -} - -func init() { - t["InvalidClientCertificate"] = reflect.TypeOf((*InvalidClientCertificate)(nil)).Elem() -} - -type InvalidClientCertificateFault InvalidClientCertificate - -func init() { - t["InvalidClientCertificateFault"] = reflect.TypeOf((*InvalidClientCertificateFault)(nil)).Elem() -} - -type InvalidCollectorVersion struct { - MethodFault -} - -func init() { - t["InvalidCollectorVersion"] = reflect.TypeOf((*InvalidCollectorVersion)(nil)).Elem() -} - -type InvalidCollectorVersionFault InvalidCollectorVersion - -func init() { - t["InvalidCollectorVersionFault"] = reflect.TypeOf((*InvalidCollectorVersionFault)(nil)).Elem() -} - -type InvalidController struct { - InvalidDeviceSpec - - ControllerKey int `xml:"controllerKey"` -} - -func init() { - t["InvalidController"] = reflect.TypeOf((*InvalidController)(nil)).Elem() -} - -type InvalidControllerFault InvalidController - -func init() { - t["InvalidControllerFault"] = reflect.TypeOf((*InvalidControllerFault)(nil)).Elem() -} - -type InvalidDasConfigArgument struct { - InvalidArgument - - Entry string `xml:"entry,omitempty"` - ClusterName string `xml:"clusterName,omitempty"` -} - -func init() { - t["InvalidDasConfigArgument"] = reflect.TypeOf((*InvalidDasConfigArgument)(nil)).Elem() -} - -type InvalidDasConfigArgumentFault InvalidDasConfigArgument - -func init() { - t["InvalidDasConfigArgumentFault"] = reflect.TypeOf((*InvalidDasConfigArgumentFault)(nil)).Elem() -} - -type InvalidDasRestartPriorityForFtVm struct { - InvalidArgument - - Vm ManagedObjectReference `xml:"vm"` - VmName string `xml:"vmName"` -} - -func init() { - t["InvalidDasRestartPriorityForFtVm"] = reflect.TypeOf((*InvalidDasRestartPriorityForFtVm)(nil)).Elem() -} - -type InvalidDasRestartPriorityForFtVmFault InvalidDasRestartPriorityForFtVm - -func init() { - t["InvalidDasRestartPriorityForFtVmFault"] = reflect.TypeOf((*InvalidDasRestartPriorityForFtVmFault)(nil)).Elem() -} - -type InvalidDatastore struct { - VimFault - - Datastore *ManagedObjectReference `xml:"datastore,omitempty"` - Name string `xml:"name,omitempty"` -} - -func init() { - t["InvalidDatastore"] = reflect.TypeOf((*InvalidDatastore)(nil)).Elem() -} - -type InvalidDatastoreFault BaseInvalidDatastore - -func init() { - t["InvalidDatastoreFault"] = reflect.TypeOf((*InvalidDatastoreFault)(nil)).Elem() -} - -type InvalidDatastorePath struct { - InvalidDatastore - - DatastorePath string `xml:"datastorePath"` -} - -func init() { - t["InvalidDatastorePath"] = reflect.TypeOf((*InvalidDatastorePath)(nil)).Elem() -} - -type InvalidDatastorePathFault InvalidDatastorePath - -func init() { - t["InvalidDatastorePathFault"] = reflect.TypeOf((*InvalidDatastorePathFault)(nil)).Elem() -} - -type InvalidDatastoreState struct { - InvalidState - - DatastoreName string `xml:"datastoreName,omitempty"` -} - -func init() { - t["InvalidDatastoreState"] = reflect.TypeOf((*InvalidDatastoreState)(nil)).Elem() -} - -type InvalidDatastoreStateFault InvalidDatastoreState - -func init() { - t["InvalidDatastoreStateFault"] = reflect.TypeOf((*InvalidDatastoreStateFault)(nil)).Elem() -} - -type InvalidDeviceBacking struct { - InvalidDeviceSpec -} - -func init() { - t["InvalidDeviceBacking"] = reflect.TypeOf((*InvalidDeviceBacking)(nil)).Elem() -} - -type InvalidDeviceBackingFault InvalidDeviceBacking - -func init() { - t["InvalidDeviceBackingFault"] = reflect.TypeOf((*InvalidDeviceBackingFault)(nil)).Elem() -} - -type InvalidDeviceOperation struct { - InvalidDeviceSpec - - BadOp VirtualDeviceConfigSpecOperation `xml:"badOp,omitempty"` - BadFileOp VirtualDeviceConfigSpecFileOperation `xml:"badFileOp,omitempty"` -} - -func init() { - t["InvalidDeviceOperation"] = reflect.TypeOf((*InvalidDeviceOperation)(nil)).Elem() -} - -type InvalidDeviceOperationFault InvalidDeviceOperation - -func init() { - t["InvalidDeviceOperationFault"] = reflect.TypeOf((*InvalidDeviceOperationFault)(nil)).Elem() -} - -type InvalidDeviceSpec struct { - InvalidVmConfig - - DeviceIndex int `xml:"deviceIndex"` -} - -func init() { - t["InvalidDeviceSpec"] = reflect.TypeOf((*InvalidDeviceSpec)(nil)).Elem() -} - -type InvalidDeviceSpecFault BaseInvalidDeviceSpec - -func init() { - t["InvalidDeviceSpecFault"] = reflect.TypeOf((*InvalidDeviceSpecFault)(nil)).Elem() -} - -type InvalidDiskFormat struct { - InvalidFormat -} - -func init() { - t["InvalidDiskFormat"] = reflect.TypeOf((*InvalidDiskFormat)(nil)).Elem() -} - -type InvalidDiskFormatFault InvalidDiskFormat - -func init() { - t["InvalidDiskFormatFault"] = reflect.TypeOf((*InvalidDiskFormatFault)(nil)).Elem() -} - -type InvalidDrsBehaviorForFtVm struct { - InvalidArgument - - Vm ManagedObjectReference `xml:"vm"` - VmName string `xml:"vmName"` -} - -func init() { - t["InvalidDrsBehaviorForFtVm"] = reflect.TypeOf((*InvalidDrsBehaviorForFtVm)(nil)).Elem() -} - -type InvalidDrsBehaviorForFtVmFault InvalidDrsBehaviorForFtVm - -func init() { - t["InvalidDrsBehaviorForFtVmFault"] = reflect.TypeOf((*InvalidDrsBehaviorForFtVmFault)(nil)).Elem() -} - -type InvalidEditionEvent struct { - LicenseEvent - - Feature string `xml:"feature"` -} - -func init() { - t["InvalidEditionEvent"] = reflect.TypeOf((*InvalidEditionEvent)(nil)).Elem() -} - -type InvalidEditionLicense struct { - NotEnoughLicenses - - Feature string `xml:"feature"` -} - -func init() { - t["InvalidEditionLicense"] = reflect.TypeOf((*InvalidEditionLicense)(nil)).Elem() -} - -type InvalidEditionLicenseFault InvalidEditionLicense - -func init() { - t["InvalidEditionLicenseFault"] = reflect.TypeOf((*InvalidEditionLicenseFault)(nil)).Elem() -} - -type InvalidEvent struct { - VimFault -} - -func init() { - t["InvalidEvent"] = reflect.TypeOf((*InvalidEvent)(nil)).Elem() -} - -type InvalidEventFault InvalidEvent - -func init() { - t["InvalidEventFault"] = reflect.TypeOf((*InvalidEventFault)(nil)).Elem() -} - -type InvalidFolder struct { - VimFault - - Target ManagedObjectReference `xml:"target"` -} - -func init() { - t["InvalidFolder"] = reflect.TypeOf((*InvalidFolder)(nil)).Elem() -} - -type InvalidFolderFault BaseInvalidFolder - -func init() { - t["InvalidFolderFault"] = reflect.TypeOf((*InvalidFolderFault)(nil)).Elem() -} - -type InvalidFormat struct { - VmConfigFault -} - -func init() { - t["InvalidFormat"] = reflect.TypeOf((*InvalidFormat)(nil)).Elem() -} - -type InvalidFormatFault BaseInvalidFormat - -func init() { - t["InvalidFormatFault"] = reflect.TypeOf((*InvalidFormatFault)(nil)).Elem() -} - -type InvalidGuestLogin struct { - GuestOperationsFault -} - -func init() { - t["InvalidGuestLogin"] = reflect.TypeOf((*InvalidGuestLogin)(nil)).Elem() -} - -type InvalidGuestLoginFault InvalidGuestLogin - -func init() { - t["InvalidGuestLoginFault"] = reflect.TypeOf((*InvalidGuestLoginFault)(nil)).Elem() -} - -type InvalidHostConnectionState struct { - InvalidHostState -} - -func init() { - t["InvalidHostConnectionState"] = reflect.TypeOf((*InvalidHostConnectionState)(nil)).Elem() -} - -type InvalidHostConnectionStateFault InvalidHostConnectionState - -func init() { - t["InvalidHostConnectionStateFault"] = reflect.TypeOf((*InvalidHostConnectionStateFault)(nil)).Elem() -} - -type InvalidHostName struct { - HostConfigFault -} - -func init() { - t["InvalidHostName"] = reflect.TypeOf((*InvalidHostName)(nil)).Elem() -} - -type InvalidHostNameFault InvalidHostName - -func init() { - t["InvalidHostNameFault"] = reflect.TypeOf((*InvalidHostNameFault)(nil)).Elem() -} - -type InvalidHostState struct { - InvalidState - - Host *ManagedObjectReference `xml:"host,omitempty"` -} - -func init() { - t["InvalidHostState"] = reflect.TypeOf((*InvalidHostState)(nil)).Elem() -} - -type InvalidHostStateFault BaseInvalidHostState - -func init() { - t["InvalidHostStateFault"] = reflect.TypeOf((*InvalidHostStateFault)(nil)).Elem() -} - -type InvalidIndexArgument struct { - InvalidArgument - - Key string `xml:"key"` -} - -func init() { - t["InvalidIndexArgument"] = reflect.TypeOf((*InvalidIndexArgument)(nil)).Elem() -} - -type InvalidIndexArgumentFault InvalidIndexArgument - -func init() { - t["InvalidIndexArgumentFault"] = reflect.TypeOf((*InvalidIndexArgumentFault)(nil)).Elem() -} - -type InvalidIpfixConfig struct { - DvsFault - - Property string `xml:"property,omitempty"` -} - -func init() { - t["InvalidIpfixConfig"] = reflect.TypeOf((*InvalidIpfixConfig)(nil)).Elem() -} - -type InvalidIpfixConfigFault InvalidIpfixConfig - -func init() { - t["InvalidIpfixConfigFault"] = reflect.TypeOf((*InvalidIpfixConfigFault)(nil)).Elem() -} - -type InvalidIpmiLoginInfo struct { - VimFault -} - -func init() { - t["InvalidIpmiLoginInfo"] = reflect.TypeOf((*InvalidIpmiLoginInfo)(nil)).Elem() -} - -type InvalidIpmiLoginInfoFault InvalidIpmiLoginInfo - -func init() { - t["InvalidIpmiLoginInfoFault"] = reflect.TypeOf((*InvalidIpmiLoginInfoFault)(nil)).Elem() -} - -type InvalidIpmiMacAddress struct { - VimFault - - UserProvidedMacAddress string `xml:"userProvidedMacAddress"` - ObservedMacAddress string `xml:"observedMacAddress"` -} - -func init() { - t["InvalidIpmiMacAddress"] = reflect.TypeOf((*InvalidIpmiMacAddress)(nil)).Elem() -} - -type InvalidIpmiMacAddressFault InvalidIpmiMacAddress - -func init() { - t["InvalidIpmiMacAddressFault"] = reflect.TypeOf((*InvalidIpmiMacAddressFault)(nil)).Elem() -} - -type InvalidLicense struct { - VimFault - - LicenseContent string `xml:"licenseContent"` -} - -func init() { - t["InvalidLicense"] = reflect.TypeOf((*InvalidLicense)(nil)).Elem() -} - -type InvalidLicenseFault InvalidLicense - -func init() { - t["InvalidLicenseFault"] = reflect.TypeOf((*InvalidLicenseFault)(nil)).Elem() -} - -type InvalidLocale struct { - VimFault -} - -func init() { - t["InvalidLocale"] = reflect.TypeOf((*InvalidLocale)(nil)).Elem() -} - -type InvalidLocaleFault InvalidLocale - -func init() { - t["InvalidLocaleFault"] = reflect.TypeOf((*InvalidLocaleFault)(nil)).Elem() -} - -type InvalidLogin struct { - VimFault -} - -func init() { - t["InvalidLogin"] = reflect.TypeOf((*InvalidLogin)(nil)).Elem() -} - -type InvalidLoginFault BaseInvalidLogin - -func init() { - t["InvalidLoginFault"] = reflect.TypeOf((*InvalidLoginFault)(nil)).Elem() -} - -type InvalidName struct { - VimFault - - Name string `xml:"name"` - Entity *ManagedObjectReference `xml:"entity,omitempty"` -} - -func init() { - t["InvalidName"] = reflect.TypeOf((*InvalidName)(nil)).Elem() -} - -type InvalidNameFault InvalidName - -func init() { - t["InvalidNameFault"] = reflect.TypeOf((*InvalidNameFault)(nil)).Elem() -} - -type InvalidNasCredentials struct { - NasConfigFault - - UserName string `xml:"userName"` -} - -func init() { - t["InvalidNasCredentials"] = reflect.TypeOf((*InvalidNasCredentials)(nil)).Elem() -} - -type InvalidNasCredentialsFault InvalidNasCredentials - -func init() { - t["InvalidNasCredentialsFault"] = reflect.TypeOf((*InvalidNasCredentialsFault)(nil)).Elem() -} - -type InvalidNetworkInType struct { - VAppPropertyFault -} - -func init() { - t["InvalidNetworkInType"] = reflect.TypeOf((*InvalidNetworkInType)(nil)).Elem() -} - -type InvalidNetworkInTypeFault InvalidNetworkInType - -func init() { - t["InvalidNetworkInTypeFault"] = reflect.TypeOf((*InvalidNetworkInTypeFault)(nil)).Elem() -} - -type InvalidNetworkResource struct { - NasConfigFault - - RemoteHost string `xml:"remoteHost"` - RemotePath string `xml:"remotePath"` -} - -func init() { - t["InvalidNetworkResource"] = reflect.TypeOf((*InvalidNetworkResource)(nil)).Elem() -} - -type InvalidNetworkResourceFault InvalidNetworkResource - -func init() { - t["InvalidNetworkResourceFault"] = reflect.TypeOf((*InvalidNetworkResourceFault)(nil)).Elem() -} - -type InvalidOperationOnSecondaryVm struct { - VmFaultToleranceIssue - - InstanceUuid string `xml:"instanceUuid,omitempty"` -} - -func init() { - t["InvalidOperationOnSecondaryVm"] = reflect.TypeOf((*InvalidOperationOnSecondaryVm)(nil)).Elem() -} - -type InvalidOperationOnSecondaryVmFault InvalidOperationOnSecondaryVm - -func init() { - t["InvalidOperationOnSecondaryVmFault"] = reflect.TypeOf((*InvalidOperationOnSecondaryVmFault)(nil)).Elem() -} - -type InvalidPowerState struct { - InvalidState - - RequestedState VirtualMachinePowerState `xml:"requestedState,omitempty"` - ExistingState VirtualMachinePowerState `xml:"existingState"` -} - -func init() { - t["InvalidPowerState"] = reflect.TypeOf((*InvalidPowerState)(nil)).Elem() -} - -type InvalidPowerStateFault InvalidPowerState - -func init() { - t["InvalidPowerStateFault"] = reflect.TypeOf((*InvalidPowerStateFault)(nil)).Elem() -} - -type InvalidPrivilege struct { - VimFault - - Privilege string `xml:"privilege"` -} - -func init() { - t["InvalidPrivilege"] = reflect.TypeOf((*InvalidPrivilege)(nil)).Elem() -} - -type InvalidPrivilegeFault InvalidPrivilege - -func init() { - t["InvalidPrivilegeFault"] = reflect.TypeOf((*InvalidPrivilegeFault)(nil)).Elem() -} - -type InvalidProfileReferenceHost struct { - RuntimeFault - - Reason string `xml:"reason,omitempty"` - Host *ManagedObjectReference `xml:"host,omitempty"` - Profile *ManagedObjectReference `xml:"profile,omitempty"` -} - -func init() { - t["InvalidProfileReferenceHost"] = reflect.TypeOf((*InvalidProfileReferenceHost)(nil)).Elem() -} - -type InvalidProfileReferenceHostFault InvalidProfileReferenceHost - -func init() { - t["InvalidProfileReferenceHostFault"] = reflect.TypeOf((*InvalidProfileReferenceHostFault)(nil)).Elem() -} - -type InvalidProperty struct { - MethodFault - - Name string `xml:"name"` -} - -func init() { - t["InvalidProperty"] = reflect.TypeOf((*InvalidProperty)(nil)).Elem() -} - -type InvalidPropertyFault InvalidProperty - -func init() { - t["InvalidPropertyFault"] = reflect.TypeOf((*InvalidPropertyFault)(nil)).Elem() -} - -type InvalidPropertyType struct { - VAppPropertyFault -} - -func init() { - t["InvalidPropertyType"] = reflect.TypeOf((*InvalidPropertyType)(nil)).Elem() -} - -type InvalidPropertyTypeFault InvalidPropertyType - -func init() { - t["InvalidPropertyTypeFault"] = reflect.TypeOf((*InvalidPropertyTypeFault)(nil)).Elem() -} - -type InvalidPropertyValue struct { - VAppPropertyFault -} - -func init() { - t["InvalidPropertyValue"] = reflect.TypeOf((*InvalidPropertyValue)(nil)).Elem() -} - -type InvalidPropertyValueFault BaseInvalidPropertyValue - -func init() { - t["InvalidPropertyValueFault"] = reflect.TypeOf((*InvalidPropertyValueFault)(nil)).Elem() -} - -type InvalidRequest struct { - RuntimeFault -} - -func init() { - t["InvalidRequest"] = reflect.TypeOf((*InvalidRequest)(nil)).Elem() -} - -type InvalidRequestFault BaseInvalidRequest - -func init() { - t["InvalidRequestFault"] = reflect.TypeOf((*InvalidRequestFault)(nil)).Elem() -} - -type InvalidResourcePoolStructureFault struct { - InsufficientResourcesFault -} - -func init() { - t["InvalidResourcePoolStructureFault"] = reflect.TypeOf((*InvalidResourcePoolStructureFault)(nil)).Elem() -} - -type InvalidResourcePoolStructureFaultFault InvalidResourcePoolStructureFault - -func init() { - t["InvalidResourcePoolStructureFaultFault"] = reflect.TypeOf((*InvalidResourcePoolStructureFaultFault)(nil)).Elem() -} - -type InvalidSnapshotFormat struct { - InvalidFormat -} - -func init() { - t["InvalidSnapshotFormat"] = reflect.TypeOf((*InvalidSnapshotFormat)(nil)).Elem() -} - -type InvalidSnapshotFormatFault InvalidSnapshotFormat - -func init() { - t["InvalidSnapshotFormatFault"] = reflect.TypeOf((*InvalidSnapshotFormatFault)(nil)).Elem() -} - -type InvalidState struct { - VimFault -} - -func init() { - t["InvalidState"] = reflect.TypeOf((*InvalidState)(nil)).Elem() -} - -type InvalidStateFault BaseInvalidState - -func init() { - t["InvalidStateFault"] = reflect.TypeOf((*InvalidStateFault)(nil)).Elem() -} - -type InvalidType struct { - InvalidRequest - - Argument string `xml:"argument,omitempty"` -} - -func init() { - t["InvalidType"] = reflect.TypeOf((*InvalidType)(nil)).Elem() -} - -type InvalidTypeFault InvalidType - -func init() { - t["InvalidTypeFault"] = reflect.TypeOf((*InvalidTypeFault)(nil)).Elem() -} - -type InvalidVmConfig struct { - VmConfigFault - - Property string `xml:"property,omitempty"` -} - -func init() { - t["InvalidVmConfig"] = reflect.TypeOf((*InvalidVmConfig)(nil)).Elem() -} - -type InvalidVmConfigFault BaseInvalidVmConfig - -func init() { - t["InvalidVmConfigFault"] = reflect.TypeOf((*InvalidVmConfigFault)(nil)).Elem() -} - -type InventoryDescription struct { - DynamicData - - NumHosts int `xml:"numHosts"` - NumVirtualMachines int `xml:"numVirtualMachines"` - NumResourcePools int `xml:"numResourcePools,omitempty"` - NumClusters int `xml:"numClusters,omitempty"` - NumCpuDev int `xml:"numCpuDev,omitempty"` - NumNetDev int `xml:"numNetDev,omitempty"` - NumDiskDev int `xml:"numDiskDev,omitempty"` - NumvCpuDev int `xml:"numvCpuDev,omitempty"` - NumvNetDev int `xml:"numvNetDev,omitempty"` - NumvDiskDev int `xml:"numvDiskDev,omitempty"` -} - -func init() { - t["InventoryDescription"] = reflect.TypeOf((*InventoryDescription)(nil)).Elem() -} - -type InventoryHasStandardAloneHosts struct { - NotEnoughLicenses - - Hosts []string `xml:"hosts"` -} - -func init() { - t["InventoryHasStandardAloneHosts"] = reflect.TypeOf((*InventoryHasStandardAloneHosts)(nil)).Elem() -} - -type InventoryHasStandardAloneHostsFault InventoryHasStandardAloneHosts - -func init() { - t["InventoryHasStandardAloneHostsFault"] = reflect.TypeOf((*InventoryHasStandardAloneHostsFault)(nil)).Elem() -} - -type IpAddress struct { - NegatableExpression -} - -func init() { - t["IpAddress"] = reflect.TypeOf((*IpAddress)(nil)).Elem() -} - -type IpAddressProfile struct { - ApplyProfile -} - -func init() { - t["IpAddressProfile"] = reflect.TypeOf((*IpAddressProfile)(nil)).Elem() -} - -type IpHostnameGeneratorError struct { - CustomizationFault -} - -func init() { - t["IpHostnameGeneratorError"] = reflect.TypeOf((*IpHostnameGeneratorError)(nil)).Elem() -} - -type IpHostnameGeneratorErrorFault IpHostnameGeneratorError - -func init() { - t["IpHostnameGeneratorErrorFault"] = reflect.TypeOf((*IpHostnameGeneratorErrorFault)(nil)).Elem() -} - -type IpPool struct { - DynamicData - - Id int `xml:"id,omitempty"` - Name string `xml:"name,omitempty"` - Ipv4Config *IpPoolIpPoolConfigInfo `xml:"ipv4Config,omitempty"` - Ipv6Config *IpPoolIpPoolConfigInfo `xml:"ipv6Config,omitempty"` - DnsDomain string `xml:"dnsDomain,omitempty"` - DnsSearchPath string `xml:"dnsSearchPath,omitempty"` - HostPrefix string `xml:"hostPrefix,omitempty"` - HttpProxy string `xml:"httpProxy,omitempty"` - NetworkAssociation []IpPoolAssociation `xml:"networkAssociation,omitempty"` - AvailableIpv4Addresses int `xml:"availableIpv4Addresses,omitempty"` - AvailableIpv6Addresses int `xml:"availableIpv6Addresses,omitempty"` - AllocatedIpv4Addresses int `xml:"allocatedIpv4Addresses,omitempty"` - AllocatedIpv6Addresses int `xml:"allocatedIpv6Addresses,omitempty"` -} - -func init() { - t["IpPool"] = reflect.TypeOf((*IpPool)(nil)).Elem() -} - -type IpPoolAssociation struct { - DynamicData - - Network *ManagedObjectReference `xml:"network,omitempty"` - NetworkName string `xml:"networkName"` -} - -func init() { - t["IpPoolAssociation"] = reflect.TypeOf((*IpPoolAssociation)(nil)).Elem() -} - -type IpPoolIpPoolConfigInfo struct { - DynamicData - - SubnetAddress string `xml:"subnetAddress,omitempty"` - Netmask string `xml:"netmask,omitempty"` - Gateway string `xml:"gateway,omitempty"` - Range string `xml:"range,omitempty"` - Dns []string `xml:"dns,omitempty"` - DhcpServerAvailable *bool `xml:"dhcpServerAvailable"` - IpPoolEnabled *bool `xml:"ipPoolEnabled"` -} - -func init() { - t["IpPoolIpPoolConfigInfo"] = reflect.TypeOf((*IpPoolIpPoolConfigInfo)(nil)).Elem() -} - -type IpPoolManagerIpAllocation struct { - DynamicData - - IpAddress string `xml:"ipAddress"` - AllocationId string `xml:"allocationId"` -} - -func init() { - t["IpPoolManagerIpAllocation"] = reflect.TypeOf((*IpPoolManagerIpAllocation)(nil)).Elem() -} - -type IpRange struct { - IpAddress - - AddressPrefix string `xml:"addressPrefix"` - PrefixLength int `xml:"prefixLength,omitempty"` -} - -func init() { - t["IpRange"] = reflect.TypeOf((*IpRange)(nil)).Elem() -} - -type IpRouteProfile struct { - ApplyProfile - - StaticRoute []StaticRouteProfile `xml:"staticRoute,omitempty"` -} - -func init() { - t["IpRouteProfile"] = reflect.TypeOf((*IpRouteProfile)(nil)).Elem() -} - -type IsSharedGraphicsActive IsSharedGraphicsActiveRequestType - -func init() { - t["IsSharedGraphicsActive"] = reflect.TypeOf((*IsSharedGraphicsActive)(nil)).Elem() -} - -type IsSharedGraphicsActiveRequestType struct { - This ManagedObjectReference `xml:"_this"` -} - -func init() { - t["IsSharedGraphicsActiveRequestType"] = reflect.TypeOf((*IsSharedGraphicsActiveRequestType)(nil)).Elem() -} - -type IsSharedGraphicsActiveResponse struct { - Returnval bool `xml:"returnval"` -} - -type IscsiDependencyEntity struct { - DynamicData - - PnicDevice string `xml:"pnicDevice"` - VnicDevice string `xml:"vnicDevice"` - VmhbaName string `xml:"vmhbaName"` -} - -func init() { - t["IscsiDependencyEntity"] = reflect.TypeOf((*IscsiDependencyEntity)(nil)).Elem() -} - -type IscsiFault struct { - VimFault -} - -func init() { - t["IscsiFault"] = reflect.TypeOf((*IscsiFault)(nil)).Elem() -} - -type IscsiFaultFault BaseIscsiFault - -func init() { - t["IscsiFaultFault"] = reflect.TypeOf((*IscsiFaultFault)(nil)).Elem() -} - -type IscsiFaultInvalidVnic struct { - IscsiFault - - VnicDevice string `xml:"vnicDevice"` -} - -func init() { - t["IscsiFaultInvalidVnic"] = reflect.TypeOf((*IscsiFaultInvalidVnic)(nil)).Elem() -} - -type IscsiFaultInvalidVnicFault IscsiFaultInvalidVnic - -func init() { - t["IscsiFaultInvalidVnicFault"] = reflect.TypeOf((*IscsiFaultInvalidVnicFault)(nil)).Elem() -} - -type IscsiFaultPnicInUse struct { - IscsiFault - - PnicDevice string `xml:"pnicDevice"` -} - -func init() { - t["IscsiFaultPnicInUse"] = reflect.TypeOf((*IscsiFaultPnicInUse)(nil)).Elem() -} - -type IscsiFaultPnicInUseFault IscsiFaultPnicInUse - -func init() { - t["IscsiFaultPnicInUseFault"] = reflect.TypeOf((*IscsiFaultPnicInUseFault)(nil)).Elem() -} - -type IscsiFaultVnicAlreadyBound struct { - IscsiFault - - VnicDevice string `xml:"vnicDevice"` -} - -func init() { - t["IscsiFaultVnicAlreadyBound"] = reflect.TypeOf((*IscsiFaultVnicAlreadyBound)(nil)).Elem() -} - -type IscsiFaultVnicAlreadyBoundFault IscsiFaultVnicAlreadyBound - -func init() { - t["IscsiFaultVnicAlreadyBoundFault"] = reflect.TypeOf((*IscsiFaultVnicAlreadyBoundFault)(nil)).Elem() -} - -type IscsiFaultVnicHasActivePaths struct { - IscsiFault - - VnicDevice string `xml:"vnicDevice"` -} - -func init() { - t["IscsiFaultVnicHasActivePaths"] = reflect.TypeOf((*IscsiFaultVnicHasActivePaths)(nil)).Elem() -} - -type IscsiFaultVnicHasActivePathsFault IscsiFaultVnicHasActivePaths - -func init() { - t["IscsiFaultVnicHasActivePathsFault"] = reflect.TypeOf((*IscsiFaultVnicHasActivePathsFault)(nil)).Elem() -} - -type IscsiFaultVnicHasMultipleUplinks struct { - IscsiFault - - VnicDevice string `xml:"vnicDevice"` -} - -func init() { - t["IscsiFaultVnicHasMultipleUplinks"] = reflect.TypeOf((*IscsiFaultVnicHasMultipleUplinks)(nil)).Elem() -} - -type IscsiFaultVnicHasMultipleUplinksFault IscsiFaultVnicHasMultipleUplinks - -func init() { - t["IscsiFaultVnicHasMultipleUplinksFault"] = reflect.TypeOf((*IscsiFaultVnicHasMultipleUplinksFault)(nil)).Elem() -} - -type IscsiFaultVnicHasNoUplinks struct { - IscsiFault - - VnicDevice string `xml:"vnicDevice"` -} - -func init() { - t["IscsiFaultVnicHasNoUplinks"] = reflect.TypeOf((*IscsiFaultVnicHasNoUplinks)(nil)).Elem() -} - -type IscsiFaultVnicHasNoUplinksFault IscsiFaultVnicHasNoUplinks - -func init() { - t["IscsiFaultVnicHasNoUplinksFault"] = reflect.TypeOf((*IscsiFaultVnicHasNoUplinksFault)(nil)).Elem() -} - -type IscsiFaultVnicHasWrongUplink struct { - IscsiFault - - VnicDevice string `xml:"vnicDevice"` -} - -func init() { - t["IscsiFaultVnicHasWrongUplink"] = reflect.TypeOf((*IscsiFaultVnicHasWrongUplink)(nil)).Elem() -} - -type IscsiFaultVnicHasWrongUplinkFault IscsiFaultVnicHasWrongUplink - -func init() { - t["IscsiFaultVnicHasWrongUplinkFault"] = reflect.TypeOf((*IscsiFaultVnicHasWrongUplinkFault)(nil)).Elem() -} - -type IscsiFaultVnicInUse struct { - IscsiFault - - VnicDevice string `xml:"vnicDevice"` -} - -func init() { - t["IscsiFaultVnicInUse"] = reflect.TypeOf((*IscsiFaultVnicInUse)(nil)).Elem() -} - -type IscsiFaultVnicInUseFault IscsiFaultVnicInUse - -func init() { - t["IscsiFaultVnicInUseFault"] = reflect.TypeOf((*IscsiFaultVnicInUseFault)(nil)).Elem() -} - -type IscsiFaultVnicIsLastPath struct { - IscsiFault - - VnicDevice string `xml:"vnicDevice"` -} - -func init() { - t["IscsiFaultVnicIsLastPath"] = reflect.TypeOf((*IscsiFaultVnicIsLastPath)(nil)).Elem() -} - -type IscsiFaultVnicIsLastPathFault IscsiFaultVnicIsLastPath - -func init() { - t["IscsiFaultVnicIsLastPathFault"] = reflect.TypeOf((*IscsiFaultVnicIsLastPathFault)(nil)).Elem() -} - -type IscsiFaultVnicNotBound struct { - IscsiFault - - VnicDevice string `xml:"vnicDevice"` -} - -func init() { - t["IscsiFaultVnicNotBound"] = reflect.TypeOf((*IscsiFaultVnicNotBound)(nil)).Elem() -} - -type IscsiFaultVnicNotBoundFault IscsiFaultVnicNotBound - -func init() { - t["IscsiFaultVnicNotBoundFault"] = reflect.TypeOf((*IscsiFaultVnicNotBoundFault)(nil)).Elem() -} - -type IscsiFaultVnicNotFound struct { - IscsiFault - - VnicDevice string `xml:"vnicDevice"` -} - -func init() { - t["IscsiFaultVnicNotFound"] = reflect.TypeOf((*IscsiFaultVnicNotFound)(nil)).Elem() -} - -type IscsiFaultVnicNotFoundFault IscsiFaultVnicNotFound - -func init() { - t["IscsiFaultVnicNotFoundFault"] = reflect.TypeOf((*IscsiFaultVnicNotFoundFault)(nil)).Elem() -} - -type IscsiMigrationDependency struct { - DynamicData - - MigrationAllowed bool `xml:"migrationAllowed"` - DisallowReason *IscsiStatus `xml:"disallowReason,omitempty"` - Dependency []IscsiDependencyEntity `xml:"dependency,omitempty"` -} - -func init() { - t["IscsiMigrationDependency"] = reflect.TypeOf((*IscsiMigrationDependency)(nil)).Elem() -} - -type IscsiPortInfo struct { - DynamicData - - VnicDevice string `xml:"vnicDevice,omitempty"` - Vnic *HostVirtualNic `xml:"vnic,omitempty"` - PnicDevice string `xml:"pnicDevice,omitempty"` - Pnic *PhysicalNic `xml:"pnic,omitempty"` - SwitchName string `xml:"switchName,omitempty"` - SwitchUuid string `xml:"switchUuid,omitempty"` - PortgroupName string `xml:"portgroupName,omitempty"` - PortgroupKey string `xml:"portgroupKey,omitempty"` - PortKey string `xml:"portKey,omitempty"` - ComplianceStatus *IscsiStatus `xml:"complianceStatus,omitempty"` - PathStatus string `xml:"pathStatus,omitempty"` -} - -func init() { - t["IscsiPortInfo"] = reflect.TypeOf((*IscsiPortInfo)(nil)).Elem() -} - -type IscsiStatus struct { - DynamicData - - Reason []LocalizedMethodFault `xml:"reason,omitempty"` -} - -func init() { - t["IscsiStatus"] = reflect.TypeOf((*IscsiStatus)(nil)).Elem() -} - -type IsoImageFileInfo struct { - FileInfo -} - -func init() { - t["IsoImageFileInfo"] = reflect.TypeOf((*IsoImageFileInfo)(nil)).Elem() -} - -type IsoImageFileQuery struct { - FileQuery -} - -func init() { - t["IsoImageFileQuery"] = reflect.TypeOf((*IsoImageFileQuery)(nil)).Elem() -} - -type JoinDomainRequestType struct { - This ManagedObjectReference `xml:"_this"` - DomainName string `xml:"domainName"` - UserName string `xml:"userName"` - Password string `xml:"password"` -} - -func init() { - t["JoinDomainRequestType"] = reflect.TypeOf((*JoinDomainRequestType)(nil)).Elem() -} - -type JoinDomainWithCAMRequestType struct { - This ManagedObjectReference `xml:"_this"` - DomainName string `xml:"domainName"` - CamServer string `xml:"camServer"` -} - -func init() { - t["JoinDomainWithCAMRequestType"] = reflect.TypeOf((*JoinDomainWithCAMRequestType)(nil)).Elem() -} - -type JoinDomainWithCAM_Task JoinDomainWithCAMRequestType - -func init() { - t["JoinDomainWithCAM_Task"] = reflect.TypeOf((*JoinDomainWithCAM_Task)(nil)).Elem() -} - -type JoinDomainWithCAM_TaskResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type JoinDomain_Task JoinDomainRequestType - -func init() { - t["JoinDomain_Task"] = reflect.TypeOf((*JoinDomain_Task)(nil)).Elem() -} - -type JoinDomain_TaskResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type KernelModuleInfo struct { - DynamicData - - Id int `xml:"id"` - Name string `xml:"name"` - Version string `xml:"version"` - Filename string `xml:"filename"` - OptionString string `xml:"optionString"` - Loaded bool `xml:"loaded"` - Enabled bool `xml:"enabled"` - UseCount int `xml:"useCount"` - ReadOnlySection KernelModuleSectionInfo `xml:"readOnlySection"` - WritableSection KernelModuleSectionInfo `xml:"writableSection"` - TextSection KernelModuleSectionInfo `xml:"textSection"` - DataSection KernelModuleSectionInfo `xml:"dataSection"` - BssSection KernelModuleSectionInfo `xml:"bssSection"` -} - -func init() { - t["KernelModuleInfo"] = reflect.TypeOf((*KernelModuleInfo)(nil)).Elem() -} - -type KernelModuleSectionInfo struct { - DynamicData - - Address int64 `xml:"address"` - Length int `xml:"length,omitempty"` -} - -func init() { - t["KernelModuleSectionInfo"] = reflect.TypeOf((*KernelModuleSectionInfo)(nil)).Elem() -} - -type KeyAnyValue struct { - DynamicData - - Key string `xml:"key"` - Value AnyType `xml:"value,typeattr"` -} - -func init() { - t["KeyAnyValue"] = reflect.TypeOf((*KeyAnyValue)(nil)).Elem() -} - -type KeyValue struct { - DynamicData - - Key string `xml:"key"` - Value string `xml:"value"` -} - -func init() { - t["KeyValue"] = reflect.TypeOf((*KeyValue)(nil)).Elem() -} - -type LargeRDMConversionNotSupported struct { - MigrationFault - - Device string `xml:"device"` -} - -func init() { - t["LargeRDMConversionNotSupported"] = reflect.TypeOf((*LargeRDMConversionNotSupported)(nil)).Elem() -} - -type LargeRDMConversionNotSupportedFault LargeRDMConversionNotSupported - -func init() { - t["LargeRDMConversionNotSupportedFault"] = reflect.TypeOf((*LargeRDMConversionNotSupportedFault)(nil)).Elem() -} - -type LargeRDMNotSupportedOnDatastore struct { - VmConfigFault - - Device string `xml:"device"` - Datastore ManagedObjectReference `xml:"datastore"` - DatastoreName string `xml:"datastoreName"` -} - -func init() { - t["LargeRDMNotSupportedOnDatastore"] = reflect.TypeOf((*LargeRDMNotSupportedOnDatastore)(nil)).Elem() -} - -type LargeRDMNotSupportedOnDatastoreFault LargeRDMNotSupportedOnDatastore - -func init() { - t["LargeRDMNotSupportedOnDatastoreFault"] = reflect.TypeOf((*LargeRDMNotSupportedOnDatastoreFault)(nil)).Elem() -} - -type LatencySensitivity struct { - DynamicData - - Level LatencySensitivitySensitivityLevel `xml:"level"` - Sensitivity int `xml:"sensitivity,omitempty"` -} - -func init() { - t["LatencySensitivity"] = reflect.TypeOf((*LatencySensitivity)(nil)).Elem() -} - -type LeaveCurrentDomainRequestType struct { - This ManagedObjectReference `xml:"_this"` - Force bool `xml:"force"` -} - -func init() { - t["LeaveCurrentDomainRequestType"] = reflect.TypeOf((*LeaveCurrentDomainRequestType)(nil)).Elem() -} - -type LeaveCurrentDomain_Task LeaveCurrentDomainRequestType - -func init() { - t["LeaveCurrentDomain_Task"] = reflect.TypeOf((*LeaveCurrentDomain_Task)(nil)).Elem() -} - -type LeaveCurrentDomain_TaskResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type LegacyNetworkInterfaceInUse struct { - CannotAccessNetwork -} - -func init() { - t["LegacyNetworkInterfaceInUse"] = reflect.TypeOf((*LegacyNetworkInterfaceInUse)(nil)).Elem() -} - -type LegacyNetworkInterfaceInUseFault LegacyNetworkInterfaceInUse - -func init() { - t["LegacyNetworkInterfaceInUseFault"] = reflect.TypeOf((*LegacyNetworkInterfaceInUseFault)(nil)).Elem() -} - -type LicenseAssignmentFailed struct { - RuntimeFault - - Reason string `xml:"reason,omitempty"` -} - -func init() { - t["LicenseAssignmentFailed"] = reflect.TypeOf((*LicenseAssignmentFailed)(nil)).Elem() -} - -type LicenseAssignmentFailedFault LicenseAssignmentFailed - -func init() { - t["LicenseAssignmentFailedFault"] = reflect.TypeOf((*LicenseAssignmentFailedFault)(nil)).Elem() -} - -type LicenseAssignmentManagerLicenseAssignment struct { - DynamicData - - EntityId string `xml:"entityId"` - Scope string `xml:"scope,omitempty"` - EntityDisplayName string `xml:"entityDisplayName,omitempty"` - AssignedLicense LicenseManagerLicenseInfo `xml:"assignedLicense"` - Properties []KeyAnyValue `xml:"properties,omitempty"` -} - -func init() { - t["LicenseAssignmentManagerLicenseAssignment"] = reflect.TypeOf((*LicenseAssignmentManagerLicenseAssignment)(nil)).Elem() -} - -type LicenseAvailabilityInfo struct { - DynamicData - - Feature LicenseFeatureInfo `xml:"feature"` - Total int `xml:"total"` - Available int `xml:"available"` -} - -func init() { - t["LicenseAvailabilityInfo"] = reflect.TypeOf((*LicenseAvailabilityInfo)(nil)).Elem() -} - -type LicenseDiagnostics struct { - DynamicData - - SourceLastChanged time.Time `xml:"sourceLastChanged"` - SourceLost string `xml:"sourceLost"` - SourceLatency float32 `xml:"sourceLatency"` - LicenseRequests string `xml:"licenseRequests"` - LicenseRequestFailures string `xml:"licenseRequestFailures"` - LicenseFeatureUnknowns string `xml:"licenseFeatureUnknowns"` - OpState LicenseManagerState `xml:"opState"` - LastStatusUpdate time.Time `xml:"lastStatusUpdate"` - OpFailureMessage string `xml:"opFailureMessage"` -} - -func init() { - t["LicenseDiagnostics"] = reflect.TypeOf((*LicenseDiagnostics)(nil)).Elem() -} - -type LicenseDowngradeDisallowed struct { - NotEnoughLicenses - - Edition string `xml:"edition"` - EntityId string `xml:"entityId"` - Features []KeyAnyValue `xml:"features"` -} - -func init() { - t["LicenseDowngradeDisallowed"] = reflect.TypeOf((*LicenseDowngradeDisallowed)(nil)).Elem() -} - -type LicenseDowngradeDisallowedFault LicenseDowngradeDisallowed - -func init() { - t["LicenseDowngradeDisallowedFault"] = reflect.TypeOf((*LicenseDowngradeDisallowedFault)(nil)).Elem() -} - -type LicenseEntityNotFound struct { - VimFault - - EntityId string `xml:"entityId"` -} - -func init() { - t["LicenseEntityNotFound"] = reflect.TypeOf((*LicenseEntityNotFound)(nil)).Elem() -} - -type LicenseEntityNotFoundFault LicenseEntityNotFound - -func init() { - t["LicenseEntityNotFoundFault"] = reflect.TypeOf((*LicenseEntityNotFoundFault)(nil)).Elem() -} - -type LicenseEvent struct { - Event -} - -func init() { - t["LicenseEvent"] = reflect.TypeOf((*LicenseEvent)(nil)).Elem() -} - -type LicenseExpired struct { - NotEnoughLicenses - - LicenseKey string `xml:"licenseKey"` -} - -func init() { - t["LicenseExpired"] = reflect.TypeOf((*LicenseExpired)(nil)).Elem() -} - -type LicenseExpiredEvent struct { - Event - - Feature LicenseFeatureInfo `xml:"feature"` -} - -func init() { - t["LicenseExpiredEvent"] = reflect.TypeOf((*LicenseExpiredEvent)(nil)).Elem() -} - -type LicenseExpiredFault LicenseExpired - -func init() { - t["LicenseExpiredFault"] = reflect.TypeOf((*LicenseExpiredFault)(nil)).Elem() -} - -type LicenseFeatureInfo struct { - DynamicData - - Key string `xml:"key"` - FeatureName string `xml:"featureName"` - FeatureDescription string `xml:"featureDescription,omitempty"` - State LicenseFeatureInfoState `xml:"state,omitempty"` - CostUnit string `xml:"costUnit"` - SourceRestriction string `xml:"sourceRestriction,omitempty"` - DependentKey []string `xml:"dependentKey,omitempty"` - Edition *bool `xml:"edition"` - ExpiresOn *time.Time `xml:"expiresOn"` -} - -func init() { - t["LicenseFeatureInfo"] = reflect.TypeOf((*LicenseFeatureInfo)(nil)).Elem() -} - -type LicenseKeyEntityMismatch struct { - NotEnoughLicenses -} - -func init() { - t["LicenseKeyEntityMismatch"] = reflect.TypeOf((*LicenseKeyEntityMismatch)(nil)).Elem() -} - -type LicenseKeyEntityMismatchFault LicenseKeyEntityMismatch - -func init() { - t["LicenseKeyEntityMismatchFault"] = reflect.TypeOf((*LicenseKeyEntityMismatchFault)(nil)).Elem() -} - -type LicenseManagerEvaluationInfo struct { - DynamicData - - Properties []KeyAnyValue `xml:"properties"` -} - -func init() { - t["LicenseManagerEvaluationInfo"] = reflect.TypeOf((*LicenseManagerEvaluationInfo)(nil)).Elem() -} - -type LicenseManagerLicenseInfo struct { - DynamicData - - LicenseKey string `xml:"licenseKey"` - EditionKey string `xml:"editionKey"` - Name string `xml:"name"` - Total int `xml:"total"` - Used int `xml:"used,omitempty"` - CostUnit string `xml:"costUnit"` - Properties []KeyAnyValue `xml:"properties,omitempty"` - Labels []KeyValue `xml:"labels,omitempty"` -} - -func init() { - t["LicenseManagerLicenseInfo"] = reflect.TypeOf((*LicenseManagerLicenseInfo)(nil)).Elem() -} - -type LicenseNonComplianceEvent struct { - LicenseEvent - - Url string `xml:"url"` -} - -func init() { - t["LicenseNonComplianceEvent"] = reflect.TypeOf((*LicenseNonComplianceEvent)(nil)).Elem() -} - -type LicenseReservationInfo struct { - DynamicData - - Key string `xml:"key"` - State LicenseReservationInfoState `xml:"state"` - Required int `xml:"required"` -} - -func init() { - t["LicenseReservationInfo"] = reflect.TypeOf((*LicenseReservationInfo)(nil)).Elem() -} - -type LicenseRestricted struct { - NotEnoughLicenses -} - -func init() { - t["LicenseRestricted"] = reflect.TypeOf((*LicenseRestricted)(nil)).Elem() -} - -type LicenseRestrictedEvent struct { - LicenseEvent -} - -func init() { - t["LicenseRestrictedEvent"] = reflect.TypeOf((*LicenseRestrictedEvent)(nil)).Elem() -} - -type LicenseRestrictedFault LicenseRestricted - -func init() { - t["LicenseRestrictedFault"] = reflect.TypeOf((*LicenseRestrictedFault)(nil)).Elem() -} - -type LicenseServerAvailableEvent struct { - LicenseEvent - - LicenseServer string `xml:"licenseServer"` -} - -func init() { - t["LicenseServerAvailableEvent"] = reflect.TypeOf((*LicenseServerAvailableEvent)(nil)).Elem() -} - -type LicenseServerSource struct { - LicenseSource - - LicenseServer string `xml:"licenseServer"` -} - -func init() { - t["LicenseServerSource"] = reflect.TypeOf((*LicenseServerSource)(nil)).Elem() -} - -type LicenseServerUnavailable struct { - VimFault - - LicenseServer string `xml:"licenseServer"` -} - -func init() { - t["LicenseServerUnavailable"] = reflect.TypeOf((*LicenseServerUnavailable)(nil)).Elem() -} - -type LicenseServerUnavailableEvent struct { - LicenseEvent - - LicenseServer string `xml:"licenseServer"` -} - -func init() { - t["LicenseServerUnavailableEvent"] = reflect.TypeOf((*LicenseServerUnavailableEvent)(nil)).Elem() -} - -type LicenseServerUnavailableFault LicenseServerUnavailable - -func init() { - t["LicenseServerUnavailableFault"] = reflect.TypeOf((*LicenseServerUnavailableFault)(nil)).Elem() -} - -type LicenseSource struct { - DynamicData -} - -func init() { - t["LicenseSource"] = reflect.TypeOf((*LicenseSource)(nil)).Elem() -} - -type LicenseSourceUnavailable struct { - NotEnoughLicenses - - LicenseSource BaseLicenseSource `xml:"licenseSource,typeattr"` -} - -func init() { - t["LicenseSourceUnavailable"] = reflect.TypeOf((*LicenseSourceUnavailable)(nil)).Elem() -} - -type LicenseSourceUnavailableFault LicenseSourceUnavailable - -func init() { - t["LicenseSourceUnavailableFault"] = reflect.TypeOf((*LicenseSourceUnavailableFault)(nil)).Elem() -} - -type LicenseUsageInfo struct { - DynamicData - - Source BaseLicenseSource `xml:"source,typeattr"` - SourceAvailable bool `xml:"sourceAvailable"` - ReservationInfo []LicenseReservationInfo `xml:"reservationInfo,omitempty"` - FeatureInfo []LicenseFeatureInfo `xml:"featureInfo,omitempty"` -} - -func init() { - t["LicenseUsageInfo"] = reflect.TypeOf((*LicenseUsageInfo)(nil)).Elem() -} - -type LimitExceeded struct { - VimFault - - Property string `xml:"property,omitempty"` - Limit int `xml:"limit,omitempty"` -} - -func init() { - t["LimitExceeded"] = reflect.TypeOf((*LimitExceeded)(nil)).Elem() -} - -type LimitExceededFault LimitExceeded - -func init() { - t["LimitExceededFault"] = reflect.TypeOf((*LimitExceededFault)(nil)).Elem() -} - -type LinkDiscoveryProtocolConfig struct { - DynamicData - - Protocol string `xml:"protocol"` - Operation string `xml:"operation"` -} - -func init() { - t["LinkDiscoveryProtocolConfig"] = reflect.TypeOf((*LinkDiscoveryProtocolConfig)(nil)).Elem() -} - -type LinkLayerDiscoveryProtocolInfo struct { - DynamicData - - ChassisId string `xml:"chassisId"` - PortId string `xml:"portId"` - TimeToLive int `xml:"timeToLive"` - Parameter []KeyAnyValue `xml:"parameter,omitempty"` -} - -func init() { - t["LinkLayerDiscoveryProtocolInfo"] = reflect.TypeOf((*LinkLayerDiscoveryProtocolInfo)(nil)).Elem() -} - -type LinkProfile struct { - ApplyProfile -} - -func init() { - t["LinkProfile"] = reflect.TypeOf((*LinkProfile)(nil)).Elem() -} - -type LinuxVolumeNotClean struct { - CustomizationFault -} - -func init() { - t["LinuxVolumeNotClean"] = reflect.TypeOf((*LinuxVolumeNotClean)(nil)).Elem() -} - -type LinuxVolumeNotCleanFault LinuxVolumeNotClean - -func init() { - t["LinuxVolumeNotCleanFault"] = reflect.TypeOf((*LinuxVolumeNotCleanFault)(nil)).Elem() -} - -type ListFilesInGuest ListFilesInGuestRequestType - -func init() { - t["ListFilesInGuest"] = reflect.TypeOf((*ListFilesInGuest)(nil)).Elem() -} - -type ListFilesInGuestRequestType struct { - This ManagedObjectReference `xml:"_this"` - Vm ManagedObjectReference `xml:"vm"` - Auth BaseGuestAuthentication `xml:"auth,typeattr"` - FilePath string `xml:"filePath"` - Index int `xml:"index,omitempty"` - MaxResults int `xml:"maxResults,omitempty"` - MatchPattern string `xml:"matchPattern,omitempty"` -} - -func init() { - t["ListFilesInGuestRequestType"] = reflect.TypeOf((*ListFilesInGuestRequestType)(nil)).Elem() -} - -type ListFilesInGuestResponse struct { - Returnval GuestListFileInfo `xml:"returnval"` -} - -type ListProcessesInGuest ListProcessesInGuestRequestType - -func init() { - t["ListProcessesInGuest"] = reflect.TypeOf((*ListProcessesInGuest)(nil)).Elem() -} - -type ListProcessesInGuestRequestType struct { - This ManagedObjectReference `xml:"_this"` - Vm ManagedObjectReference `xml:"vm"` - Auth BaseGuestAuthentication `xml:"auth,typeattr"` - Pids []int64 `xml:"pids,omitempty"` -} - -func init() { - t["ListProcessesInGuestRequestType"] = reflect.TypeOf((*ListProcessesInGuestRequestType)(nil)).Elem() -} - -type ListProcessesInGuestResponse struct { - Returnval []GuestProcessInfo `xml:"returnval,omitempty"` -} - -type LocalDatastoreCreatedEvent struct { - HostEvent - - Datastore DatastoreEventArgument `xml:"datastore"` -} - -func init() { - t["LocalDatastoreCreatedEvent"] = reflect.TypeOf((*LocalDatastoreCreatedEvent)(nil)).Elem() -} - -type LocalDatastoreInfo struct { - DatastoreInfo - - Path string `xml:"path,omitempty"` -} - -func init() { - t["LocalDatastoreInfo"] = reflect.TypeOf((*LocalDatastoreInfo)(nil)).Elem() -} - -type LocalLicenseSource struct { - LicenseSource - - LicenseKeys string `xml:"licenseKeys"` -} - -func init() { - t["LocalLicenseSource"] = reflect.TypeOf((*LocalLicenseSource)(nil)).Elem() -} - -type LocalTSMEnabledEvent struct { - HostEvent -} - -func init() { - t["LocalTSMEnabledEvent"] = reflect.TypeOf((*LocalTSMEnabledEvent)(nil)).Elem() -} - -type LocalizableMessage struct { - DynamicData - - Key string `xml:"key"` - Arg []KeyAnyValue `xml:"arg,omitempty"` - Message string `xml:"message,omitempty"` -} - -func init() { - t["LocalizableMessage"] = reflect.TypeOf((*LocalizableMessage)(nil)).Elem() -} - -type LocalizationManagerMessageCatalog struct { - DynamicData - - ModuleName string `xml:"moduleName"` - CatalogName string `xml:"catalogName"` - Locale string `xml:"locale"` - CatalogUri string `xml:"catalogUri"` - LastModified *time.Time `xml:"lastModified"` - Md5sum string `xml:"md5sum,omitempty"` - Version string `xml:"version,omitempty"` -} - -func init() { - t["LocalizationManagerMessageCatalog"] = reflect.TypeOf((*LocalizationManagerMessageCatalog)(nil)).Elem() -} - -type LocalizedMethodFault struct { - DynamicData - - Fault BaseMethodFault `xml:"fault,typeattr"` - LocalizedMessage string `xml:"localizedMessage,omitempty"` -} - -func init() { - t["LocalizedMethodFault"] = reflect.TypeOf((*LocalizedMethodFault)(nil)).Elem() -} - -type LockerMisconfiguredEvent struct { - Event - - Datastore DatastoreEventArgument `xml:"datastore"` -} - -func init() { - t["LockerMisconfiguredEvent"] = reflect.TypeOf((*LockerMisconfiguredEvent)(nil)).Elem() -} - -type LockerReconfiguredEvent struct { - Event - - OldDatastore *DatastoreEventArgument `xml:"oldDatastore,omitempty"` - NewDatastore *DatastoreEventArgument `xml:"newDatastore,omitempty"` -} - -func init() { - t["LockerReconfiguredEvent"] = reflect.TypeOf((*LockerReconfiguredEvent)(nil)).Elem() -} - -type LogBundlingFailed struct { - VimFault -} - -func init() { - t["LogBundlingFailed"] = reflect.TypeOf((*LogBundlingFailed)(nil)).Elem() -} - -type LogBundlingFailedFault LogBundlingFailed - -func init() { - t["LogBundlingFailedFault"] = reflect.TypeOf((*LogBundlingFailedFault)(nil)).Elem() -} - -type LogUserEvent LogUserEventRequestType - -func init() { - t["LogUserEvent"] = reflect.TypeOf((*LogUserEvent)(nil)).Elem() -} - -type LogUserEventRequestType struct { - This ManagedObjectReference `xml:"_this"` - Entity ManagedObjectReference `xml:"entity"` - Msg string `xml:"msg"` -} - -func init() { - t["LogUserEventRequestType"] = reflect.TypeOf((*LogUserEventRequestType)(nil)).Elem() -} - -type LogUserEventResponse struct { -} - -type Login LoginRequestType - -func init() { - t["Login"] = reflect.TypeOf((*Login)(nil)).Elem() -} - -type LoginBySSPI LoginBySSPIRequestType - -func init() { - t["LoginBySSPI"] = reflect.TypeOf((*LoginBySSPI)(nil)).Elem() -} - -type LoginBySSPIRequestType struct { - This ManagedObjectReference `xml:"_this"` - Base64Token string `xml:"base64Token"` - Locale string `xml:"locale,omitempty"` -} - -func init() { - t["LoginBySSPIRequestType"] = reflect.TypeOf((*LoginBySSPIRequestType)(nil)).Elem() -} - -type LoginBySSPIResponse struct { - Returnval UserSession `xml:"returnval"` -} - -type LoginByToken LoginByTokenRequestType - -func init() { - t["LoginByToken"] = reflect.TypeOf((*LoginByToken)(nil)).Elem() -} - -type LoginByTokenRequestType struct { - This ManagedObjectReference `xml:"_this"` - Locale string `xml:"locale,omitempty"` -} - -func init() { - t["LoginByTokenRequestType"] = reflect.TypeOf((*LoginByTokenRequestType)(nil)).Elem() -} - -type LoginByTokenResponse struct { - Returnval UserSession `xml:"returnval"` -} - -type LoginExtensionByCertificate LoginExtensionByCertificateRequestType - -func init() { - t["LoginExtensionByCertificate"] = reflect.TypeOf((*LoginExtensionByCertificate)(nil)).Elem() -} - -type LoginExtensionByCertificateRequestType struct { - This ManagedObjectReference `xml:"_this"` - ExtensionKey string `xml:"extensionKey"` - Locale string `xml:"locale,omitempty"` -} - -func init() { - t["LoginExtensionByCertificateRequestType"] = reflect.TypeOf((*LoginExtensionByCertificateRequestType)(nil)).Elem() -} - -type LoginExtensionByCertificateResponse struct { - Returnval UserSession `xml:"returnval"` -} - -type LoginExtensionBySubjectName LoginExtensionBySubjectNameRequestType - -func init() { - t["LoginExtensionBySubjectName"] = reflect.TypeOf((*LoginExtensionBySubjectName)(nil)).Elem() -} - -type LoginExtensionBySubjectNameRequestType struct { - This ManagedObjectReference `xml:"_this"` - ExtensionKey string `xml:"extensionKey"` - Locale string `xml:"locale,omitempty"` -} - -func init() { - t["LoginExtensionBySubjectNameRequestType"] = reflect.TypeOf((*LoginExtensionBySubjectNameRequestType)(nil)).Elem() -} - -type LoginExtensionBySubjectNameResponse struct { - Returnval UserSession `xml:"returnval"` -} - -type LoginRequestType struct { - This ManagedObjectReference `xml:"_this"` - UserName string `xml:"userName"` - Password string `xml:"password"` - Locale string `xml:"locale,omitempty"` -} - -func init() { - t["LoginRequestType"] = reflect.TypeOf((*LoginRequestType)(nil)).Elem() -} - -type LoginResponse struct { - Returnval UserSession `xml:"returnval"` -} - -type Logout LogoutRequestType - -func init() { - t["Logout"] = reflect.TypeOf((*Logout)(nil)).Elem() -} - -type LogoutRequestType struct { - This ManagedObjectReference `xml:"_this"` -} - -func init() { - t["LogoutRequestType"] = reflect.TypeOf((*LogoutRequestType)(nil)).Elem() -} - -type LogoutResponse struct { -} - -type LongOption struct { - OptionType - - Min int64 `xml:"min"` - Max int64 `xml:"max"` - DefaultValue int64 `xml:"defaultValue"` -} - -func init() { - t["LongOption"] = reflect.TypeOf((*LongOption)(nil)).Elem() -} - -type LongPolicy struct { - InheritablePolicy - - Value int64 `xml:"value,omitempty"` -} - -func init() { - t["LongPolicy"] = reflect.TypeOf((*LongPolicy)(nil)).Elem() -} - -type LookupDvPortGroup LookupDvPortGroupRequestType - -func init() { - t["LookupDvPortGroup"] = reflect.TypeOf((*LookupDvPortGroup)(nil)).Elem() -} - -type LookupDvPortGroupRequestType struct { - This ManagedObjectReference `xml:"_this"` - PortgroupKey string `xml:"portgroupKey"` -} - -func init() { - t["LookupDvPortGroupRequestType"] = reflect.TypeOf((*LookupDvPortGroupRequestType)(nil)).Elem() -} - -type LookupDvPortGroupResponse struct { - Returnval *ManagedObjectReference `xml:"returnval,omitempty"` -} - -type MacAddress struct { - NegatableExpression -} - -func init() { - t["MacAddress"] = reflect.TypeOf((*MacAddress)(nil)).Elem() -} - -type MacRange struct { - MacAddress - - Address string `xml:"address"` - Mask string `xml:"mask"` -} - -func init() { - t["MacRange"] = reflect.TypeOf((*MacRange)(nil)).Elem() -} - -type MaintenanceModeFileMove struct { - MigrationFault -} - -func init() { - t["MaintenanceModeFileMove"] = reflect.TypeOf((*MaintenanceModeFileMove)(nil)).Elem() -} - -type MaintenanceModeFileMoveFault MaintenanceModeFileMove - -func init() { - t["MaintenanceModeFileMoveFault"] = reflect.TypeOf((*MaintenanceModeFileMoveFault)(nil)).Elem() -} - -type MakeDirectory MakeDirectoryRequestType - -func init() { - t["MakeDirectory"] = reflect.TypeOf((*MakeDirectory)(nil)).Elem() -} - -type MakeDirectoryInGuest MakeDirectoryInGuestRequestType - -func init() { - t["MakeDirectoryInGuest"] = reflect.TypeOf((*MakeDirectoryInGuest)(nil)).Elem() -} - -type MakeDirectoryInGuestRequestType struct { - This ManagedObjectReference `xml:"_this"` - Vm ManagedObjectReference `xml:"vm"` - Auth BaseGuestAuthentication `xml:"auth,typeattr"` - DirectoryPath string `xml:"directoryPath"` - CreateParentDirectories bool `xml:"createParentDirectories"` -} - -func init() { - t["MakeDirectoryInGuestRequestType"] = reflect.TypeOf((*MakeDirectoryInGuestRequestType)(nil)).Elem() -} - -type MakeDirectoryInGuestResponse struct { -} - -type MakeDirectoryRequestType struct { - This ManagedObjectReference `xml:"_this"` - Name string `xml:"name"` - Datacenter *ManagedObjectReference `xml:"datacenter,omitempty"` - CreateParentDirectories *bool `xml:"createParentDirectories"` -} - -func init() { - t["MakeDirectoryRequestType"] = reflect.TypeOf((*MakeDirectoryRequestType)(nil)).Elem() -} - -type MakeDirectoryResponse struct { -} - -type MakePrimaryVMRequestType struct { - This ManagedObjectReference `xml:"_this"` - Vm ManagedObjectReference `xml:"vm"` -} - -func init() { - t["MakePrimaryVMRequestType"] = reflect.TypeOf((*MakePrimaryVMRequestType)(nil)).Elem() -} - -type MakePrimaryVM_Task MakePrimaryVMRequestType - -func init() { - t["MakePrimaryVM_Task"] = reflect.TypeOf((*MakePrimaryVM_Task)(nil)).Elem() -} - -type MakePrimaryVM_TaskResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type ManagedByInfo struct { - DynamicData - - ExtensionKey string `xml:"extensionKey"` - Type string `xml:"type"` -} - -func init() { - t["ManagedByInfo"] = reflect.TypeOf((*ManagedByInfo)(nil)).Elem() -} - -type ManagedEntityEventArgument struct { - EntityEventArgument - - Entity ManagedObjectReference `xml:"entity"` -} - -func init() { - t["ManagedEntityEventArgument"] = reflect.TypeOf((*ManagedEntityEventArgument)(nil)).Elem() -} - -type ManagedObjectNotFound struct { - RuntimeFault - - Obj ManagedObjectReference `xml:"obj"` -} - -func init() { - t["ManagedObjectNotFound"] = reflect.TypeOf((*ManagedObjectNotFound)(nil)).Elem() -} - -type ManagedObjectNotFoundFault ManagedObjectNotFound - -func init() { - t["ManagedObjectNotFoundFault"] = reflect.TypeOf((*ManagedObjectNotFoundFault)(nil)).Elem() -} - -type ManagedObjectReference struct { - Type string `xml:"type,attr"` - Value string `xml:",chardata"` -} - -func init() { - t["ManagedObjectReference"] = reflect.TypeOf((*ManagedObjectReference)(nil)).Elem() -} - -type MarkAsTemplate MarkAsTemplateRequestType - -func init() { - t["MarkAsTemplate"] = reflect.TypeOf((*MarkAsTemplate)(nil)).Elem() -} - -type MarkAsTemplateRequestType struct { - This ManagedObjectReference `xml:"_this"` -} - -func init() { - t["MarkAsTemplateRequestType"] = reflect.TypeOf((*MarkAsTemplateRequestType)(nil)).Elem() -} - -type MarkAsTemplateResponse struct { -} - -type MarkAsVirtualMachine MarkAsVirtualMachineRequestType - -func init() { - t["MarkAsVirtualMachine"] = reflect.TypeOf((*MarkAsVirtualMachine)(nil)).Elem() -} - -type MarkAsVirtualMachineRequestType struct { - This ManagedObjectReference `xml:"_this"` - Pool ManagedObjectReference `xml:"pool"` - Host *ManagedObjectReference `xml:"host,omitempty"` -} - -func init() { - t["MarkAsVirtualMachineRequestType"] = reflect.TypeOf((*MarkAsVirtualMachineRequestType)(nil)).Elem() -} - -type MarkAsVirtualMachineResponse struct { -} - -type MarkForRemoval MarkForRemovalRequestType - -func init() { - t["MarkForRemoval"] = reflect.TypeOf((*MarkForRemoval)(nil)).Elem() -} - -type MarkForRemovalRequestType struct { - This ManagedObjectReference `xml:"_this"` - HbaName string `xml:"hbaName"` - Remove bool `xml:"remove"` -} - -func init() { - t["MarkForRemovalRequestType"] = reflect.TypeOf((*MarkForRemovalRequestType)(nil)).Elem() -} - -type MarkForRemovalResponse struct { -} - -type MemoryHotPlugNotSupported struct { - VmConfigFault -} - -func init() { - t["MemoryHotPlugNotSupported"] = reflect.TypeOf((*MemoryHotPlugNotSupported)(nil)).Elem() -} - -type MemoryHotPlugNotSupportedFault MemoryHotPlugNotSupported - -func init() { - t["MemoryHotPlugNotSupportedFault"] = reflect.TypeOf((*MemoryHotPlugNotSupportedFault)(nil)).Elem() -} - -type MemorySizeNotRecommended struct { - VirtualHardwareCompatibilityIssue - - MemorySizeMB int `xml:"memorySizeMB"` - MinMemorySizeMB int `xml:"minMemorySizeMB"` - MaxMemorySizeMB int `xml:"maxMemorySizeMB"` -} - -func init() { - t["MemorySizeNotRecommended"] = reflect.TypeOf((*MemorySizeNotRecommended)(nil)).Elem() -} - -type MemorySizeNotRecommendedFault MemorySizeNotRecommended - -func init() { - t["MemorySizeNotRecommendedFault"] = reflect.TypeOf((*MemorySizeNotRecommendedFault)(nil)).Elem() -} - -type MemorySizeNotSupported struct { - VirtualHardwareCompatibilityIssue - - MemorySizeMB int `xml:"memorySizeMB"` - MinMemorySizeMB int `xml:"minMemorySizeMB"` - MaxMemorySizeMB int `xml:"maxMemorySizeMB"` -} - -func init() { - t["MemorySizeNotSupported"] = reflect.TypeOf((*MemorySizeNotSupported)(nil)).Elem() -} - -type MemorySizeNotSupportedByDatastore struct { - VirtualHardwareCompatibilityIssue - - Datastore ManagedObjectReference `xml:"datastore"` - MemorySizeMB int `xml:"memorySizeMB"` - MaxMemorySizeMB int `xml:"maxMemorySizeMB"` -} - -func init() { - t["MemorySizeNotSupportedByDatastore"] = reflect.TypeOf((*MemorySizeNotSupportedByDatastore)(nil)).Elem() -} - -type MemorySizeNotSupportedByDatastoreFault MemorySizeNotSupportedByDatastore - -func init() { - t["MemorySizeNotSupportedByDatastoreFault"] = reflect.TypeOf((*MemorySizeNotSupportedByDatastoreFault)(nil)).Elem() -} - -type MemorySizeNotSupportedFault MemorySizeNotSupported - -func init() { - t["MemorySizeNotSupportedFault"] = reflect.TypeOf((*MemorySizeNotSupportedFault)(nil)).Elem() -} - -type MemorySnapshotOnIndependentDisk struct { - SnapshotFault -} - -func init() { - t["MemorySnapshotOnIndependentDisk"] = reflect.TypeOf((*MemorySnapshotOnIndependentDisk)(nil)).Elem() -} - -type MemorySnapshotOnIndependentDiskFault MemorySnapshotOnIndependentDisk - -func init() { - t["MemorySnapshotOnIndependentDiskFault"] = reflect.TypeOf((*MemorySnapshotOnIndependentDiskFault)(nil)).Elem() -} - -type MergeDvsRequestType struct { - This ManagedObjectReference `xml:"_this"` - Dvs ManagedObjectReference `xml:"dvs"` -} - -func init() { - t["MergeDvsRequestType"] = reflect.TypeOf((*MergeDvsRequestType)(nil)).Elem() -} - -type MergeDvs_Task MergeDvsRequestType - -func init() { - t["MergeDvs_Task"] = reflect.TypeOf((*MergeDvs_Task)(nil)).Elem() -} - -type MergeDvs_TaskResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type MergePermissions MergePermissionsRequestType - -func init() { - t["MergePermissions"] = reflect.TypeOf((*MergePermissions)(nil)).Elem() -} - -type MergePermissionsRequestType struct { - This ManagedObjectReference `xml:"_this"` - SrcRoleId int `xml:"srcRoleId"` - DstRoleId int `xml:"dstRoleId"` -} - -func init() { - t["MergePermissionsRequestType"] = reflect.TypeOf((*MergePermissionsRequestType)(nil)).Elem() -} - -type MergePermissionsResponse struct { -} - -type MethodAction struct { - Action - - Name string `xml:"name"` - Argument []MethodActionArgument `xml:"argument,omitempty"` -} - -func init() { - t["MethodAction"] = reflect.TypeOf((*MethodAction)(nil)).Elem() -} - -type MethodActionArgument struct { - DynamicData - - Value AnyType `xml:"value,omitempty,typeattr"` -} - -func init() { - t["MethodActionArgument"] = reflect.TypeOf((*MethodActionArgument)(nil)).Elem() -} - -type MethodAlreadyDisabledFault struct { - RuntimeFault - - SourceId string `xml:"sourceId"` -} - -func init() { - t["MethodAlreadyDisabledFault"] = reflect.TypeOf((*MethodAlreadyDisabledFault)(nil)).Elem() -} - -type MethodAlreadyDisabledFaultFault MethodAlreadyDisabledFault - -func init() { - t["MethodAlreadyDisabledFaultFault"] = reflect.TypeOf((*MethodAlreadyDisabledFaultFault)(nil)).Elem() -} - -type MethodDescription struct { - Description - - Key string `xml:"key"` -} - -func init() { - t["MethodDescription"] = reflect.TypeOf((*MethodDescription)(nil)).Elem() -} - -type MethodDisabled struct { - RuntimeFault - - Source string `xml:"source,omitempty"` -} - -func init() { - t["MethodDisabled"] = reflect.TypeOf((*MethodDisabled)(nil)).Elem() -} - -type MethodDisabledFault MethodDisabled - -func init() { - t["MethodDisabledFault"] = reflect.TypeOf((*MethodDisabledFault)(nil)).Elem() -} - -type MethodFault struct { - DynamicType string `xml:"dynamicType,omitempty"` - DynamicProperty []DynamicProperty `xml:"dynamicProperty,omitempty"` - FaultCause *LocalizedMethodFault `xml:"faultCause,omitempty"` - FaultMessage []LocalizableMessage `xml:"faultMessage,omitempty"` -} - -func init() { - t["MethodFault"] = reflect.TypeOf((*MethodFault)(nil)).Elem() -} - -type MethodFaultFault BaseMethodFault - -func init() { - t["MethodFaultFault"] = reflect.TypeOf((*MethodFaultFault)(nil)).Elem() -} - -type MethodNotFound struct { - InvalidRequest - - Receiver ManagedObjectReference `xml:"receiver"` - Method string `xml:"method"` -} - -func init() { - t["MethodNotFound"] = reflect.TypeOf((*MethodNotFound)(nil)).Elem() -} - -type MethodNotFoundFault MethodNotFound - -func init() { - t["MethodNotFoundFault"] = reflect.TypeOf((*MethodNotFoundFault)(nil)).Elem() -} - -type MetricAlarmExpression struct { - AlarmExpression - - Operator MetricAlarmOperator `xml:"operator"` - Type string `xml:"type"` - Metric PerfMetricId `xml:"metric"` - Yellow int `xml:"yellow,omitempty"` - YellowInterval int `xml:"yellowInterval,omitempty"` - Red int `xml:"red,omitempty"` - RedInterval int `xml:"redInterval,omitempty"` -} - -func init() { - t["MetricAlarmExpression"] = reflect.TypeOf((*MetricAlarmExpression)(nil)).Elem() -} - -type MigrateVMRequestType struct { - This ManagedObjectReference `xml:"_this"` - Pool *ManagedObjectReference `xml:"pool,omitempty"` - Host *ManagedObjectReference `xml:"host,omitempty"` - Priority VirtualMachineMovePriority `xml:"priority"` - State VirtualMachinePowerState `xml:"state,omitempty"` -} - -func init() { - t["MigrateVMRequestType"] = reflect.TypeOf((*MigrateVMRequestType)(nil)).Elem() -} - -type MigrateVM_Task MigrateVMRequestType - -func init() { - t["MigrateVM_Task"] = reflect.TypeOf((*MigrateVM_Task)(nil)).Elem() -} - -type MigrateVM_TaskResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type MigrationDisabled struct { - MigrationFault -} - -func init() { - t["MigrationDisabled"] = reflect.TypeOf((*MigrationDisabled)(nil)).Elem() -} - -type MigrationDisabledFault MigrationDisabled - -func init() { - t["MigrationDisabledFault"] = reflect.TypeOf((*MigrationDisabledFault)(nil)).Elem() -} - -type MigrationErrorEvent struct { - MigrationEvent -} - -func init() { - t["MigrationErrorEvent"] = reflect.TypeOf((*MigrationErrorEvent)(nil)).Elem() -} - -type MigrationEvent struct { - VmEvent - - Fault LocalizedMethodFault `xml:"fault"` -} - -func init() { - t["MigrationEvent"] = reflect.TypeOf((*MigrationEvent)(nil)).Elem() -} - -type MigrationFault struct { - VimFault -} - -func init() { - t["MigrationFault"] = reflect.TypeOf((*MigrationFault)(nil)).Elem() -} - -type MigrationFaultFault BaseMigrationFault - -func init() { - t["MigrationFaultFault"] = reflect.TypeOf((*MigrationFaultFault)(nil)).Elem() -} - -type MigrationFeatureNotSupported struct { - MigrationFault - - AtSourceHost bool `xml:"atSourceHost"` - FailedHostName string `xml:"failedHostName"` - FailedHost ManagedObjectReference `xml:"failedHost"` -} - -func init() { - t["MigrationFeatureNotSupported"] = reflect.TypeOf((*MigrationFeatureNotSupported)(nil)).Elem() -} - -type MigrationFeatureNotSupportedFault BaseMigrationFeatureNotSupported - -func init() { - t["MigrationFeatureNotSupportedFault"] = reflect.TypeOf((*MigrationFeatureNotSupportedFault)(nil)).Elem() -} - -type MigrationHostErrorEvent struct { - MigrationEvent - - DstHost HostEventArgument `xml:"dstHost"` -} - -func init() { - t["MigrationHostErrorEvent"] = reflect.TypeOf((*MigrationHostErrorEvent)(nil)).Elem() -} - -type MigrationHostWarningEvent struct { - MigrationEvent - - DstHost HostEventArgument `xml:"dstHost"` -} - -func init() { - t["MigrationHostWarningEvent"] = reflect.TypeOf((*MigrationHostWarningEvent)(nil)).Elem() -} - -type MigrationNotReady struct { - MigrationFault - - Reason string `xml:"reason"` -} - -func init() { - t["MigrationNotReady"] = reflect.TypeOf((*MigrationNotReady)(nil)).Elem() -} - -type MigrationNotReadyFault MigrationNotReady - -func init() { - t["MigrationNotReadyFault"] = reflect.TypeOf((*MigrationNotReadyFault)(nil)).Elem() -} - -type MigrationResourceErrorEvent struct { - MigrationEvent - - DstPool ResourcePoolEventArgument `xml:"dstPool"` - DstHost HostEventArgument `xml:"dstHost"` -} - -func init() { - t["MigrationResourceErrorEvent"] = reflect.TypeOf((*MigrationResourceErrorEvent)(nil)).Elem() -} - -type MigrationResourceWarningEvent struct { - MigrationEvent - - DstPool ResourcePoolEventArgument `xml:"dstPool"` - DstHost HostEventArgument `xml:"dstHost"` -} - -func init() { - t["MigrationResourceWarningEvent"] = reflect.TypeOf((*MigrationResourceWarningEvent)(nil)).Elem() -} - -type MigrationWarningEvent struct { - MigrationEvent -} - -func init() { - t["MigrationWarningEvent"] = reflect.TypeOf((*MigrationWarningEvent)(nil)).Elem() -} - -type MismatchedBundle struct { - VimFault - - BundleUuid string `xml:"bundleUuid"` - HostUuid string `xml:"hostUuid"` - BundleBuildNumber int `xml:"bundleBuildNumber"` - HostBuildNumber int `xml:"hostBuildNumber"` -} - -func init() { - t["MismatchedBundle"] = reflect.TypeOf((*MismatchedBundle)(nil)).Elem() -} - -type MismatchedBundleFault MismatchedBundle - -func init() { - t["MismatchedBundleFault"] = reflect.TypeOf((*MismatchedBundleFault)(nil)).Elem() -} - -type MismatchedNetworkPolicies struct { - MigrationFault - - Device string `xml:"device"` - Backing string `xml:"backing"` - Connected bool `xml:"connected"` -} - -func init() { - t["MismatchedNetworkPolicies"] = reflect.TypeOf((*MismatchedNetworkPolicies)(nil)).Elem() -} - -type MismatchedNetworkPoliciesFault MismatchedNetworkPolicies - -func init() { - t["MismatchedNetworkPoliciesFault"] = reflect.TypeOf((*MismatchedNetworkPoliciesFault)(nil)).Elem() -} - -type MismatchedVMotionNetworkNames struct { - MigrationFault - - SourceNetwork string `xml:"sourceNetwork"` - DestNetwork string `xml:"destNetwork"` -} - -func init() { - t["MismatchedVMotionNetworkNames"] = reflect.TypeOf((*MismatchedVMotionNetworkNames)(nil)).Elem() -} - -type MismatchedVMotionNetworkNamesFault MismatchedVMotionNetworkNames - -func init() { - t["MismatchedVMotionNetworkNamesFault"] = reflect.TypeOf((*MismatchedVMotionNetworkNamesFault)(nil)).Elem() -} - -type MissingBmcSupport struct { - VimFault -} - -func init() { - t["MissingBmcSupport"] = reflect.TypeOf((*MissingBmcSupport)(nil)).Elem() -} - -type MissingBmcSupportFault MissingBmcSupport - -func init() { - t["MissingBmcSupportFault"] = reflect.TypeOf((*MissingBmcSupportFault)(nil)).Elem() -} - -type MissingController struct { - InvalidDeviceSpec -} - -func init() { - t["MissingController"] = reflect.TypeOf((*MissingController)(nil)).Elem() -} - -type MissingControllerFault MissingController - -func init() { - t["MissingControllerFault"] = reflect.TypeOf((*MissingControllerFault)(nil)).Elem() -} - -type MissingIpPool struct { - VAppPropertyFault -} - -func init() { - t["MissingIpPool"] = reflect.TypeOf((*MissingIpPool)(nil)).Elem() -} - -type MissingIpPoolFault MissingIpPool - -func init() { - t["MissingIpPoolFault"] = reflect.TypeOf((*MissingIpPoolFault)(nil)).Elem() -} - -type MissingLinuxCustResources struct { - CustomizationFault -} - -func init() { - t["MissingLinuxCustResources"] = reflect.TypeOf((*MissingLinuxCustResources)(nil)).Elem() -} - -type MissingLinuxCustResourcesFault MissingLinuxCustResources - -func init() { - t["MissingLinuxCustResourcesFault"] = reflect.TypeOf((*MissingLinuxCustResourcesFault)(nil)).Elem() -} - -type MissingNetworkIpConfig struct { - VAppPropertyFault -} - -func init() { - t["MissingNetworkIpConfig"] = reflect.TypeOf((*MissingNetworkIpConfig)(nil)).Elem() -} - -type MissingNetworkIpConfigFault MissingNetworkIpConfig - -func init() { - t["MissingNetworkIpConfigFault"] = reflect.TypeOf((*MissingNetworkIpConfigFault)(nil)).Elem() -} - -type MissingObject struct { - DynamicData - - Obj ManagedObjectReference `xml:"obj"` - Fault LocalizedMethodFault `xml:"fault"` -} - -func init() { - t["MissingObject"] = reflect.TypeOf((*MissingObject)(nil)).Elem() -} - -type MissingPowerOffConfiguration struct { - VAppConfigFault -} - -func init() { - t["MissingPowerOffConfiguration"] = reflect.TypeOf((*MissingPowerOffConfiguration)(nil)).Elem() -} - -type MissingPowerOffConfigurationFault MissingPowerOffConfiguration - -func init() { - t["MissingPowerOffConfigurationFault"] = reflect.TypeOf((*MissingPowerOffConfigurationFault)(nil)).Elem() -} - -type MissingPowerOnConfiguration struct { - VAppConfigFault -} - -func init() { - t["MissingPowerOnConfiguration"] = reflect.TypeOf((*MissingPowerOnConfiguration)(nil)).Elem() -} - -type MissingPowerOnConfigurationFault MissingPowerOnConfiguration - -func init() { - t["MissingPowerOnConfigurationFault"] = reflect.TypeOf((*MissingPowerOnConfigurationFault)(nil)).Elem() -} - -type MissingProperty struct { - DynamicData - - Path string `xml:"path"` - Fault LocalizedMethodFault `xml:"fault"` -} - -func init() { - t["MissingProperty"] = reflect.TypeOf((*MissingProperty)(nil)).Elem() -} - -type MissingWindowsCustResources struct { - CustomizationFault -} - -func init() { - t["MissingWindowsCustResources"] = reflect.TypeOf((*MissingWindowsCustResources)(nil)).Elem() -} - -type MissingWindowsCustResourcesFault MissingWindowsCustResources - -func init() { - t["MissingWindowsCustResourcesFault"] = reflect.TypeOf((*MissingWindowsCustResourcesFault)(nil)).Elem() -} - -type MksConnectionLimitReached struct { - InvalidState - - ConnectionLimit int `xml:"connectionLimit"` -} - -func init() { - t["MksConnectionLimitReached"] = reflect.TypeOf((*MksConnectionLimitReached)(nil)).Elem() -} - -type MksConnectionLimitReachedFault MksConnectionLimitReached - -func init() { - t["MksConnectionLimitReachedFault"] = reflect.TypeOf((*MksConnectionLimitReachedFault)(nil)).Elem() -} - -type ModeInfo struct { - DynamicData - - Browse string `xml:"browse,omitempty"` - Read string `xml:"read"` - Modify string `xml:"modify"` - Use string `xml:"use"` - Admin string `xml:"admin,omitempty"` - Full string `xml:"full"` -} - -func init() { - t["ModeInfo"] = reflect.TypeOf((*ModeInfo)(nil)).Elem() -} - -type ModifyListView ModifyListViewRequestType - -func init() { - t["ModifyListView"] = reflect.TypeOf((*ModifyListView)(nil)).Elem() -} - -type ModifyListViewRequestType struct { - This ManagedObjectReference `xml:"_this"` - Add []ManagedObjectReference `xml:"add,omitempty"` - Remove []ManagedObjectReference `xml:"remove,omitempty"` -} - -func init() { - t["ModifyListViewRequestType"] = reflect.TypeOf((*ModifyListViewRequestType)(nil)).Elem() -} - -type ModifyListViewResponse struct { - Returnval []ManagedObjectReference `xml:"returnval,omitempty"` -} - -type MonthlyByDayTaskScheduler struct { - MonthlyTaskScheduler - - Day int `xml:"day"` -} - -func init() { - t["MonthlyByDayTaskScheduler"] = reflect.TypeOf((*MonthlyByDayTaskScheduler)(nil)).Elem() -} - -type MonthlyByWeekdayTaskScheduler struct { - MonthlyTaskScheduler - - Offset WeekOfMonth `xml:"offset"` - Weekday DayOfWeek `xml:"weekday"` -} - -func init() { - t["MonthlyByWeekdayTaskScheduler"] = reflect.TypeOf((*MonthlyByWeekdayTaskScheduler)(nil)).Elem() -} - -type MonthlyTaskScheduler struct { - DailyTaskScheduler -} - -func init() { - t["MonthlyTaskScheduler"] = reflect.TypeOf((*MonthlyTaskScheduler)(nil)).Elem() -} - -type MountError struct { - CustomizationFault - - Vm ManagedObjectReference `xml:"vm"` - DiskIndex int `xml:"diskIndex"` -} - -func init() { - t["MountError"] = reflect.TypeOf((*MountError)(nil)).Elem() -} - -type MountErrorFault MountError - -func init() { - t["MountErrorFault"] = reflect.TypeOf((*MountErrorFault)(nil)).Elem() -} - -type MountToolsInstaller MountToolsInstallerRequestType - -func init() { - t["MountToolsInstaller"] = reflect.TypeOf((*MountToolsInstaller)(nil)).Elem() -} - -type MountToolsInstallerRequestType struct { - This ManagedObjectReference `xml:"_this"` -} - -func init() { - t["MountToolsInstallerRequestType"] = reflect.TypeOf((*MountToolsInstallerRequestType)(nil)).Elem() -} - -type MountToolsInstallerResponse struct { -} - -type MountVffsVolume MountVffsVolumeRequestType - -func init() { - t["MountVffsVolume"] = reflect.TypeOf((*MountVffsVolume)(nil)).Elem() -} - -type MountVffsVolumeRequestType struct { - This ManagedObjectReference `xml:"_this"` - VffsUuid string `xml:"vffsUuid"` -} - -func init() { - t["MountVffsVolumeRequestType"] = reflect.TypeOf((*MountVffsVolumeRequestType)(nil)).Elem() -} - -type MountVffsVolumeResponse struct { -} - -type MountVmfsVolume MountVmfsVolumeRequestType - -func init() { - t["MountVmfsVolume"] = reflect.TypeOf((*MountVmfsVolume)(nil)).Elem() -} - -type MountVmfsVolumeRequestType struct { - This ManagedObjectReference `xml:"_this"` - VmfsUuid string `xml:"vmfsUuid"` -} - -func init() { - t["MountVmfsVolumeRequestType"] = reflect.TypeOf((*MountVmfsVolumeRequestType)(nil)).Elem() -} - -type MountVmfsVolumeResponse struct { -} - -type MoveDVPortRequestType struct { - This ManagedObjectReference `xml:"_this"` - PortKey []string `xml:"portKey"` - DestinationPortgroupKey string `xml:"destinationPortgroupKey,omitempty"` -} - -func init() { - t["MoveDVPortRequestType"] = reflect.TypeOf((*MoveDVPortRequestType)(nil)).Elem() -} - -type MoveDVPort_Task MoveDVPortRequestType - -func init() { - t["MoveDVPort_Task"] = reflect.TypeOf((*MoveDVPort_Task)(nil)).Elem() -} - -type MoveDVPort_TaskResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type MoveDatastoreFileRequestType struct { - This ManagedObjectReference `xml:"_this"` - SourceName string `xml:"sourceName"` - SourceDatacenter *ManagedObjectReference `xml:"sourceDatacenter,omitempty"` - DestinationName string `xml:"destinationName"` - DestinationDatacenter *ManagedObjectReference `xml:"destinationDatacenter,omitempty"` - Force *bool `xml:"force"` -} - -func init() { - t["MoveDatastoreFileRequestType"] = reflect.TypeOf((*MoveDatastoreFileRequestType)(nil)).Elem() -} - -type MoveDatastoreFile_Task MoveDatastoreFileRequestType - -func init() { - t["MoveDatastoreFile_Task"] = reflect.TypeOf((*MoveDatastoreFile_Task)(nil)).Elem() -} - -type MoveDatastoreFile_TaskResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type MoveDirectoryInGuest MoveDirectoryInGuestRequestType - -func init() { - t["MoveDirectoryInGuest"] = reflect.TypeOf((*MoveDirectoryInGuest)(nil)).Elem() -} - -type MoveDirectoryInGuestRequestType struct { - This ManagedObjectReference `xml:"_this"` - Vm ManagedObjectReference `xml:"vm"` - Auth BaseGuestAuthentication `xml:"auth,typeattr"` - SrcDirectoryPath string `xml:"srcDirectoryPath"` - DstDirectoryPath string `xml:"dstDirectoryPath"` -} - -func init() { - t["MoveDirectoryInGuestRequestType"] = reflect.TypeOf((*MoveDirectoryInGuestRequestType)(nil)).Elem() -} - -type MoveDirectoryInGuestResponse struct { -} - -type MoveFileInGuest MoveFileInGuestRequestType - -func init() { - t["MoveFileInGuest"] = reflect.TypeOf((*MoveFileInGuest)(nil)).Elem() -} - -type MoveFileInGuestRequestType struct { - This ManagedObjectReference `xml:"_this"` - Vm ManagedObjectReference `xml:"vm"` - Auth BaseGuestAuthentication `xml:"auth,typeattr"` - SrcFilePath string `xml:"srcFilePath"` - DstFilePath string `xml:"dstFilePath"` - Overwrite bool `xml:"overwrite"` -} - -func init() { - t["MoveFileInGuestRequestType"] = reflect.TypeOf((*MoveFileInGuestRequestType)(nil)).Elem() -} - -type MoveFileInGuestResponse struct { -} - -type MoveHostIntoRequestType struct { - This ManagedObjectReference `xml:"_this"` - Host ManagedObjectReference `xml:"host"` - ResourcePool *ManagedObjectReference `xml:"resourcePool,omitempty"` -} - -func init() { - t["MoveHostIntoRequestType"] = reflect.TypeOf((*MoveHostIntoRequestType)(nil)).Elem() -} - -type MoveHostInto_Task MoveHostIntoRequestType - -func init() { - t["MoveHostInto_Task"] = reflect.TypeOf((*MoveHostInto_Task)(nil)).Elem() -} - -type MoveHostInto_TaskResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type MoveIntoFolderRequestType struct { - This ManagedObjectReference `xml:"_this"` - List []ManagedObjectReference `xml:"list"` -} - -func init() { - t["MoveIntoFolderRequestType"] = reflect.TypeOf((*MoveIntoFolderRequestType)(nil)).Elem() -} - -type MoveIntoFolder_Task MoveIntoFolderRequestType - -func init() { - t["MoveIntoFolder_Task"] = reflect.TypeOf((*MoveIntoFolder_Task)(nil)).Elem() -} - -type MoveIntoFolder_TaskResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type MoveIntoRequestType struct { - This ManagedObjectReference `xml:"_this"` - Host []ManagedObjectReference `xml:"host"` -} - -func init() { - t["MoveIntoRequestType"] = reflect.TypeOf((*MoveIntoRequestType)(nil)).Elem() -} - -type MoveIntoResourcePool MoveIntoResourcePoolRequestType - -func init() { - t["MoveIntoResourcePool"] = reflect.TypeOf((*MoveIntoResourcePool)(nil)).Elem() -} - -type MoveIntoResourcePoolRequestType struct { - This ManagedObjectReference `xml:"_this"` - List []ManagedObjectReference `xml:"list"` -} - -func init() { - t["MoveIntoResourcePoolRequestType"] = reflect.TypeOf((*MoveIntoResourcePoolRequestType)(nil)).Elem() -} - -type MoveIntoResourcePoolResponse struct { -} - -type MoveInto_Task MoveIntoRequestType - -func init() { - t["MoveInto_Task"] = reflect.TypeOf((*MoveInto_Task)(nil)).Elem() -} - -type MoveInto_TaskResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type MoveVirtualDiskRequestType struct { - This ManagedObjectReference `xml:"_this"` - SourceName string `xml:"sourceName"` - SourceDatacenter *ManagedObjectReference `xml:"sourceDatacenter,omitempty"` - DestName string `xml:"destName"` - DestDatacenter *ManagedObjectReference `xml:"destDatacenter,omitempty"` - Force *bool `xml:"force"` - Profile []BaseVirtualMachineProfileSpec `xml:"profile,omitempty,typeattr"` -} - -func init() { - t["MoveVirtualDiskRequestType"] = reflect.TypeOf((*MoveVirtualDiskRequestType)(nil)).Elem() -} - -type MoveVirtualDisk_Task MoveVirtualDiskRequestType - -func init() { - t["MoveVirtualDisk_Task"] = reflect.TypeOf((*MoveVirtualDisk_Task)(nil)).Elem() -} - -type MoveVirtualDisk_TaskResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type MtuMatchEvent struct { - DvsHealthStatusChangeEvent -} - -func init() { - t["MtuMatchEvent"] = reflect.TypeOf((*MtuMatchEvent)(nil)).Elem() -} - -type MtuMismatchEvent struct { - DvsHealthStatusChangeEvent -} - -func init() { - t["MtuMismatchEvent"] = reflect.TypeOf((*MtuMismatchEvent)(nil)).Elem() -} - -type MultipleCertificatesVerifyFault struct { - HostConnectFault - - ThumbprintData []MultipleCertificatesVerifyFaultThumbprintData `xml:"thumbprintData"` -} - -func init() { - t["MultipleCertificatesVerifyFault"] = reflect.TypeOf((*MultipleCertificatesVerifyFault)(nil)).Elem() -} - -type MultipleCertificatesVerifyFaultFault MultipleCertificatesVerifyFault - -func init() { - t["MultipleCertificatesVerifyFaultFault"] = reflect.TypeOf((*MultipleCertificatesVerifyFaultFault)(nil)).Elem() -} - -type MultipleCertificatesVerifyFaultThumbprintData struct { - DynamicData - - Port int `xml:"port"` - Thumbprint string `xml:"thumbprint"` -} - -func init() { - t["MultipleCertificatesVerifyFaultThumbprintData"] = reflect.TypeOf((*MultipleCertificatesVerifyFaultThumbprintData)(nil)).Elem() -} - -type MultipleSnapshotsNotSupported struct { - SnapshotFault -} - -func init() { - t["MultipleSnapshotsNotSupported"] = reflect.TypeOf((*MultipleSnapshotsNotSupported)(nil)).Elem() -} - -type MultipleSnapshotsNotSupportedFault MultipleSnapshotsNotSupported - -func init() { - t["MultipleSnapshotsNotSupportedFault"] = reflect.TypeOf((*MultipleSnapshotsNotSupportedFault)(nil)).Elem() -} - -type NASDatastoreCreatedEvent struct { - HostEvent - - Datastore DatastoreEventArgument `xml:"datastore"` -} - -func init() { - t["NASDatastoreCreatedEvent"] = reflect.TypeOf((*NASDatastoreCreatedEvent)(nil)).Elem() -} - -type NamePasswordAuthentication struct { - GuestAuthentication - - Username string `xml:"username"` - Password string `xml:"password"` -} - -func init() { - t["NamePasswordAuthentication"] = reflect.TypeOf((*NamePasswordAuthentication)(nil)).Elem() -} - -type NamespaceFull struct { - VimFault - - Name string `xml:"name"` - CurrentMaxSize int64 `xml:"currentMaxSize"` - RequiredSize int64 `xml:"requiredSize,omitempty"` -} - -func init() { - t["NamespaceFull"] = reflect.TypeOf((*NamespaceFull)(nil)).Elem() -} - -type NamespaceFullFault NamespaceFull - -func init() { - t["NamespaceFullFault"] = reflect.TypeOf((*NamespaceFullFault)(nil)).Elem() -} - -type NamespaceLimitReached struct { - VimFault - - Limit int `xml:"limit,omitempty"` -} - -func init() { - t["NamespaceLimitReached"] = reflect.TypeOf((*NamespaceLimitReached)(nil)).Elem() -} - -type NamespaceLimitReachedFault NamespaceLimitReached - -func init() { - t["NamespaceLimitReachedFault"] = reflect.TypeOf((*NamespaceLimitReachedFault)(nil)).Elem() -} - -type NamespaceWriteProtected struct { - VimFault - - Name string `xml:"name"` -} - -func init() { - t["NamespaceWriteProtected"] = reflect.TypeOf((*NamespaceWriteProtected)(nil)).Elem() -} - -type NamespaceWriteProtectedFault NamespaceWriteProtected - -func init() { - t["NamespaceWriteProtectedFault"] = reflect.TypeOf((*NamespaceWriteProtectedFault)(nil)).Elem() -} - -type NasConfigFault struct { - HostConfigFault - - Name string `xml:"name"` -} - -func init() { - t["NasConfigFault"] = reflect.TypeOf((*NasConfigFault)(nil)).Elem() -} - -type NasConfigFaultFault BaseNasConfigFault - -func init() { - t["NasConfigFaultFault"] = reflect.TypeOf((*NasConfigFaultFault)(nil)).Elem() -} - -type NasConnectionLimitReached struct { - NasConfigFault - - RemoteHost string `xml:"remoteHost"` - RemotePath string `xml:"remotePath"` -} - -func init() { - t["NasConnectionLimitReached"] = reflect.TypeOf((*NasConnectionLimitReached)(nil)).Elem() -} - -type NasConnectionLimitReachedFault NasConnectionLimitReached - -func init() { - t["NasConnectionLimitReachedFault"] = reflect.TypeOf((*NasConnectionLimitReachedFault)(nil)).Elem() -} - -type NasDatastoreInfo struct { - DatastoreInfo - - Nas *HostNasVolume `xml:"nas,omitempty"` -} - -func init() { - t["NasDatastoreInfo"] = reflect.TypeOf((*NasDatastoreInfo)(nil)).Elem() -} - -type NasSessionCredentialConflict struct { - NasConfigFault - - RemoteHost string `xml:"remoteHost"` - RemotePath string `xml:"remotePath"` - UserName string `xml:"userName"` -} - -func init() { - t["NasSessionCredentialConflict"] = reflect.TypeOf((*NasSessionCredentialConflict)(nil)).Elem() -} - -type NasSessionCredentialConflictFault NasSessionCredentialConflict - -func init() { - t["NasSessionCredentialConflictFault"] = reflect.TypeOf((*NasSessionCredentialConflictFault)(nil)).Elem() -} - -type NasStorageProfile struct { - ApplyProfile - - Key string `xml:"key"` -} - -func init() { - t["NasStorageProfile"] = reflect.TypeOf((*NasStorageProfile)(nil)).Elem() -} - -type NasVolumeNotMounted struct { - NasConfigFault - - RemoteHost string `xml:"remoteHost"` - RemotePath string `xml:"remotePath"` -} - -func init() { - t["NasVolumeNotMounted"] = reflect.TypeOf((*NasVolumeNotMounted)(nil)).Elem() -} - -type NasVolumeNotMountedFault NasVolumeNotMounted - -func init() { - t["NasVolumeNotMountedFault"] = reflect.TypeOf((*NasVolumeNotMountedFault)(nil)).Elem() -} - -type NegatableExpression struct { - DynamicData - - Negate *bool `xml:"negate"` -} - -func init() { - t["NegatableExpression"] = reflect.TypeOf((*NegatableExpression)(nil)).Elem() -} - -type NetBIOSConfigInfo struct { - DynamicData - - Mode string `xml:"mode"` -} - -func init() { - t["NetBIOSConfigInfo"] = reflect.TypeOf((*NetBIOSConfigInfo)(nil)).Elem() -} - -type NetDhcpConfigInfo struct { - DynamicData - - Ipv6 *NetDhcpConfigInfoDhcpOptions `xml:"ipv6,omitempty"` - Ipv4 *NetDhcpConfigInfoDhcpOptions `xml:"ipv4,omitempty"` -} - -func init() { - t["NetDhcpConfigInfo"] = reflect.TypeOf((*NetDhcpConfigInfo)(nil)).Elem() -} - -type NetDhcpConfigInfoDhcpOptions struct { - DynamicData - - Enable bool `xml:"enable"` - Config []KeyValue `xml:"config,omitempty"` -} - -func init() { - t["NetDhcpConfigInfoDhcpOptions"] = reflect.TypeOf((*NetDhcpConfigInfoDhcpOptions)(nil)).Elem() -} - -type NetDhcpConfigSpec struct { - DynamicData - - Ipv6 *NetDhcpConfigSpecDhcpOptionsSpec `xml:"ipv6,omitempty"` - Ipv4 *NetDhcpConfigSpecDhcpOptionsSpec `xml:"ipv4,omitempty"` -} - -func init() { - t["NetDhcpConfigSpec"] = reflect.TypeOf((*NetDhcpConfigSpec)(nil)).Elem() -} - -type NetDhcpConfigSpecDhcpOptionsSpec struct { - DynamicData - - Enable *bool `xml:"enable"` - Config []KeyValue `xml:"config"` - Operation string `xml:"operation"` -} - -func init() { - t["NetDhcpConfigSpecDhcpOptionsSpec"] = reflect.TypeOf((*NetDhcpConfigSpecDhcpOptionsSpec)(nil)).Elem() -} - -type NetDnsConfigInfo struct { - DynamicData - - Dhcp bool `xml:"dhcp"` - HostName string `xml:"hostName"` - DomainName string `xml:"domainName"` - IpAddress []string `xml:"ipAddress,omitempty"` - SearchDomain []string `xml:"searchDomain,omitempty"` -} - -func init() { - t["NetDnsConfigInfo"] = reflect.TypeOf((*NetDnsConfigInfo)(nil)).Elem() -} - -type NetDnsConfigSpec struct { - DynamicData - - Dhcp *bool `xml:"dhcp"` - HostName string `xml:"hostName,omitempty"` - DomainName string `xml:"domainName,omitempty"` - IpAddress []string `xml:"ipAddress,omitempty"` - SearchDomain []string `xml:"searchDomain,omitempty"` -} - -func init() { - t["NetDnsConfigSpec"] = reflect.TypeOf((*NetDnsConfigSpec)(nil)).Elem() -} - -type NetIpConfigInfo struct { - DynamicData - - IpAddress []NetIpConfigInfoIpAddress `xml:"ipAddress,omitempty"` - Dhcp *NetDhcpConfigInfo `xml:"dhcp,omitempty"` - AutoConfigurationEnabled *bool `xml:"autoConfigurationEnabled"` -} - -func init() { - t["NetIpConfigInfo"] = reflect.TypeOf((*NetIpConfigInfo)(nil)).Elem() -} - -type NetIpConfigInfoIpAddress struct { - DynamicData - - IpAddress string `xml:"ipAddress"` - PrefixLength int `xml:"prefixLength"` - Origin string `xml:"origin,omitempty"` - State string `xml:"state,omitempty"` - Lifetime *time.Time `xml:"lifetime"` -} - -func init() { - t["NetIpConfigInfoIpAddress"] = reflect.TypeOf((*NetIpConfigInfoIpAddress)(nil)).Elem() -} - -type NetIpConfigSpec struct { - DynamicData - - IpAddress []NetIpConfigSpecIpAddressSpec `xml:"ipAddress,omitempty"` - Dhcp *NetDhcpConfigSpec `xml:"dhcp,omitempty"` - AutoConfigurationEnabled *bool `xml:"autoConfigurationEnabled"` -} - -func init() { - t["NetIpConfigSpec"] = reflect.TypeOf((*NetIpConfigSpec)(nil)).Elem() -} - -type NetIpConfigSpecIpAddressSpec struct { - DynamicData - - IpAddress string `xml:"ipAddress"` - PrefixLength int `xml:"prefixLength"` - Operation string `xml:"operation"` -} - -func init() { - t["NetIpConfigSpecIpAddressSpec"] = reflect.TypeOf((*NetIpConfigSpecIpAddressSpec)(nil)).Elem() -} - -type NetIpRouteConfigInfo struct { - DynamicData - - IpRoute []NetIpRouteConfigInfoIpRoute `xml:"ipRoute,omitempty"` -} - -func init() { - t["NetIpRouteConfigInfo"] = reflect.TypeOf((*NetIpRouteConfigInfo)(nil)).Elem() -} - -type NetIpRouteConfigInfoGateway struct { - DynamicData - - IpAddress string `xml:"ipAddress,omitempty"` - Device string `xml:"device,omitempty"` -} - -func init() { - t["NetIpRouteConfigInfoGateway"] = reflect.TypeOf((*NetIpRouteConfigInfoGateway)(nil)).Elem() -} - -type NetIpRouteConfigInfoIpRoute struct { - DynamicData - - Network string `xml:"network"` - PrefixLength int `xml:"prefixLength"` - Gateway NetIpRouteConfigInfoGateway `xml:"gateway"` -} - -func init() { - t["NetIpRouteConfigInfoIpRoute"] = reflect.TypeOf((*NetIpRouteConfigInfoIpRoute)(nil)).Elem() -} - -type NetIpRouteConfigSpec struct { - DynamicData - - IpRoute []NetIpRouteConfigSpecIpRouteSpec `xml:"ipRoute,omitempty"` -} - -func init() { - t["NetIpRouteConfigSpec"] = reflect.TypeOf((*NetIpRouteConfigSpec)(nil)).Elem() -} - -type NetIpRouteConfigSpecGatewaySpec struct { - DynamicData - - IpAddress string `xml:"ipAddress,omitempty"` - Device string `xml:"device,omitempty"` -} - -func init() { - t["NetIpRouteConfigSpecGatewaySpec"] = reflect.TypeOf((*NetIpRouteConfigSpecGatewaySpec)(nil)).Elem() -} - -type NetIpRouteConfigSpecIpRouteSpec struct { - DynamicData - - Network string `xml:"network"` - PrefixLength int `xml:"prefixLength"` - Gateway NetIpRouteConfigSpecGatewaySpec `xml:"gateway"` - Operation string `xml:"operation"` -} - -func init() { - t["NetIpRouteConfigSpecIpRouteSpec"] = reflect.TypeOf((*NetIpRouteConfigSpecIpRouteSpec)(nil)).Elem() -} - -type NetIpStackInfo struct { - DynamicData - - Neighbor []NetIpStackInfoNetToMedia `xml:"neighbor,omitempty"` - DefaultRouter []NetIpStackInfoDefaultRouter `xml:"defaultRouter,omitempty"` -} - -func init() { - t["NetIpStackInfo"] = reflect.TypeOf((*NetIpStackInfo)(nil)).Elem() -} - -type NetIpStackInfoDefaultRouter struct { - DynamicData - - IpAddress string `xml:"ipAddress"` - Device string `xml:"device"` - Lifetime time.Time `xml:"lifetime"` - Preference string `xml:"preference"` -} - -func init() { - t["NetIpStackInfoDefaultRouter"] = reflect.TypeOf((*NetIpStackInfoDefaultRouter)(nil)).Elem() -} - -type NetIpStackInfoNetToMedia struct { - DynamicData - - IpAddress string `xml:"ipAddress"` - PhysicalAddress string `xml:"physicalAddress"` - Device string `xml:"device"` - Type string `xml:"type"` -} - -func init() { - t["NetIpStackInfoNetToMedia"] = reflect.TypeOf((*NetIpStackInfoNetToMedia)(nil)).Elem() -} - -type NetStackInstanceProfile struct { - ApplyProfile - - Key string `xml:"key"` - DnsConfig NetworkProfileDnsConfigProfile `xml:"dnsConfig"` - IpRouteConfig IpRouteProfile `xml:"ipRouteConfig"` -} - -func init() { - t["NetStackInstanceProfile"] = reflect.TypeOf((*NetStackInstanceProfile)(nil)).Elem() -} - -type NetworkCopyFault struct { - FileFault -} - -func init() { - t["NetworkCopyFault"] = reflect.TypeOf((*NetworkCopyFault)(nil)).Elem() -} - -type NetworkCopyFaultFault NetworkCopyFault - -func init() { - t["NetworkCopyFaultFault"] = reflect.TypeOf((*NetworkCopyFaultFault)(nil)).Elem() -} - -type NetworkDisruptedAndConfigRolledBack struct { - VimFault - - Host string `xml:"host"` -} - -func init() { - t["NetworkDisruptedAndConfigRolledBack"] = reflect.TypeOf((*NetworkDisruptedAndConfigRolledBack)(nil)).Elem() -} - -type NetworkDisruptedAndConfigRolledBackFault NetworkDisruptedAndConfigRolledBack - -func init() { - t["NetworkDisruptedAndConfigRolledBackFault"] = reflect.TypeOf((*NetworkDisruptedAndConfigRolledBackFault)(nil)).Elem() -} - -type NetworkEventArgument struct { - EntityEventArgument - - Network ManagedObjectReference `xml:"network"` -} - -func init() { - t["NetworkEventArgument"] = reflect.TypeOf((*NetworkEventArgument)(nil)).Elem() -} - -type NetworkInaccessible struct { - NasConfigFault -} - -func init() { - t["NetworkInaccessible"] = reflect.TypeOf((*NetworkInaccessible)(nil)).Elem() -} - -type NetworkInaccessibleFault NetworkInaccessible - -func init() { - t["NetworkInaccessibleFault"] = reflect.TypeOf((*NetworkInaccessibleFault)(nil)).Elem() -} - -type NetworkPolicyProfile struct { - ApplyProfile -} - -func init() { - t["NetworkPolicyProfile"] = reflect.TypeOf((*NetworkPolicyProfile)(nil)).Elem() -} - -type NetworkProfile struct { - ApplyProfile - - Vswitch []VirtualSwitchProfile `xml:"vswitch,omitempty"` - VmPortGroup []VmPortGroupProfile `xml:"vmPortGroup,omitempty"` - HostPortGroup []HostPortGroupProfile `xml:"hostPortGroup,omitempty"` - ServiceConsolePortGroup []ServiceConsolePortGroupProfile `xml:"serviceConsolePortGroup,omitempty"` - DnsConfig *NetworkProfileDnsConfigProfile `xml:"dnsConfig,omitempty"` - IpRouteConfig *IpRouteProfile `xml:"ipRouteConfig,omitempty"` - ConsoleIpRouteConfig *IpRouteProfile `xml:"consoleIpRouteConfig,omitempty"` - Pnic []PhysicalNicProfile `xml:"pnic,omitempty"` - Dvswitch []DvsProfile `xml:"dvswitch,omitempty"` - DvsServiceConsoleNic []DvsServiceConsoleVNicProfile `xml:"dvsServiceConsoleNic,omitempty"` - DvsHostNic []DvsHostVNicProfile `xml:"dvsHostNic,omitempty"` - NetStackInstance []NetStackInstanceProfile `xml:"netStackInstance,omitempty"` -} - -func init() { - t["NetworkProfile"] = reflect.TypeOf((*NetworkProfile)(nil)).Elem() -} - -type NetworkProfileDnsConfigProfile struct { - ApplyProfile -} - -func init() { - t["NetworkProfileDnsConfigProfile"] = reflect.TypeOf((*NetworkProfileDnsConfigProfile)(nil)).Elem() -} - -type NetworkRollbackEvent struct { - Event - - MethodName string `xml:"methodName"` - TransactionId string `xml:"transactionId"` -} - -func init() { - t["NetworkRollbackEvent"] = reflect.TypeOf((*NetworkRollbackEvent)(nil)).Elem() -} - -type NetworkSummary struct { - DynamicData - - Network *ManagedObjectReference `xml:"network,omitempty"` - Name string `xml:"name"` - Accessible bool `xml:"accessible"` - IpPoolName string `xml:"ipPoolName,omitempty"` - IpPoolId int `xml:"ipPoolId,omitempty"` -} - -func init() { - t["NetworkSummary"] = reflect.TypeOf((*NetworkSummary)(nil)).Elem() -} - -type NetworksMayNotBeTheSame struct { - MigrationFault - - Name string `xml:"name,omitempty"` -} - -func init() { - t["NetworksMayNotBeTheSame"] = reflect.TypeOf((*NetworksMayNotBeTheSame)(nil)).Elem() -} - -type NetworksMayNotBeTheSameFault NetworksMayNotBeTheSame - -func init() { - t["NetworksMayNotBeTheSameFault"] = reflect.TypeOf((*NetworksMayNotBeTheSameFault)(nil)).Elem() -} - -type NicSettingMismatch struct { - CustomizationFault - - NumberOfNicsInSpec int `xml:"numberOfNicsInSpec"` - NumberOfNicsInVM int `xml:"numberOfNicsInVM"` -} - -func init() { - t["NicSettingMismatch"] = reflect.TypeOf((*NicSettingMismatch)(nil)).Elem() -} - -type NicSettingMismatchFault NicSettingMismatch - -func init() { - t["NicSettingMismatchFault"] = reflect.TypeOf((*NicSettingMismatchFault)(nil)).Elem() -} - -type NoAccessUserEvent struct { - SessionEvent - - IpAddress string `xml:"ipAddress"` -} - -func init() { - t["NoAccessUserEvent"] = reflect.TypeOf((*NoAccessUserEvent)(nil)).Elem() -} - -type NoActiveHostInCluster struct { - InvalidState - - ComputeResource ManagedObjectReference `xml:"computeResource"` -} - -func init() { - t["NoActiveHostInCluster"] = reflect.TypeOf((*NoActiveHostInCluster)(nil)).Elem() -} - -type NoActiveHostInClusterFault NoActiveHostInCluster - -func init() { - t["NoActiveHostInClusterFault"] = reflect.TypeOf((*NoActiveHostInClusterFault)(nil)).Elem() -} - -type NoAvailableIp struct { - VAppPropertyFault - - Network ManagedObjectReference `xml:"network"` -} - -func init() { - t["NoAvailableIp"] = reflect.TypeOf((*NoAvailableIp)(nil)).Elem() -} - -type NoAvailableIpFault NoAvailableIp - -func init() { - t["NoAvailableIpFault"] = reflect.TypeOf((*NoAvailableIpFault)(nil)).Elem() -} - -type NoClientCertificate struct { - VimFault -} - -func init() { - t["NoClientCertificate"] = reflect.TypeOf((*NoClientCertificate)(nil)).Elem() -} - -type NoClientCertificateFault NoClientCertificate - -func init() { - t["NoClientCertificateFault"] = reflect.TypeOf((*NoClientCertificateFault)(nil)).Elem() -} - -type NoCompatibleDatastore struct { - VimFault -} - -func init() { - t["NoCompatibleDatastore"] = reflect.TypeOf((*NoCompatibleDatastore)(nil)).Elem() -} - -type NoCompatibleDatastoreFault NoCompatibleDatastore - -func init() { - t["NoCompatibleDatastoreFault"] = reflect.TypeOf((*NoCompatibleDatastoreFault)(nil)).Elem() -} - -type NoCompatibleHardAffinityHost struct { - VmConfigFault - - VmName string `xml:"vmName"` -} - -func init() { - t["NoCompatibleHardAffinityHost"] = reflect.TypeOf((*NoCompatibleHardAffinityHost)(nil)).Elem() -} - -type NoCompatibleHardAffinityHostFault NoCompatibleHardAffinityHost - -func init() { - t["NoCompatibleHardAffinityHostFault"] = reflect.TypeOf((*NoCompatibleHardAffinityHostFault)(nil)).Elem() -} - -type NoCompatibleHost struct { - VimFault - - Host []ManagedObjectReference `xml:"host,omitempty"` - Error []LocalizedMethodFault `xml:"error,omitempty"` -} - -func init() { - t["NoCompatibleHost"] = reflect.TypeOf((*NoCompatibleHost)(nil)).Elem() -} - -type NoCompatibleHostFault BaseNoCompatibleHost - -func init() { - t["NoCompatibleHostFault"] = reflect.TypeOf((*NoCompatibleHostFault)(nil)).Elem() -} - -type NoCompatibleHostWithAccessToDevice struct { - NoCompatibleHost -} - -func init() { - t["NoCompatibleHostWithAccessToDevice"] = reflect.TypeOf((*NoCompatibleHostWithAccessToDevice)(nil)).Elem() -} - -type NoCompatibleHostWithAccessToDeviceFault NoCompatibleHostWithAccessToDevice - -func init() { - t["NoCompatibleHostWithAccessToDeviceFault"] = reflect.TypeOf((*NoCompatibleHostWithAccessToDeviceFault)(nil)).Elem() -} - -type NoCompatibleSoftAffinityHost struct { - VmConfigFault - - VmName string `xml:"vmName"` -} - -func init() { - t["NoCompatibleSoftAffinityHost"] = reflect.TypeOf((*NoCompatibleSoftAffinityHost)(nil)).Elem() -} - -type NoCompatibleSoftAffinityHostFault NoCompatibleSoftAffinityHost - -func init() { - t["NoCompatibleSoftAffinityHostFault"] = reflect.TypeOf((*NoCompatibleSoftAffinityHostFault)(nil)).Elem() -} - -type NoConnectedDatastore struct { - VimFault -} - -func init() { - t["NoConnectedDatastore"] = reflect.TypeOf((*NoConnectedDatastore)(nil)).Elem() -} - -type NoConnectedDatastoreFault NoConnectedDatastore - -func init() { - t["NoConnectedDatastoreFault"] = reflect.TypeOf((*NoConnectedDatastoreFault)(nil)).Elem() -} - -type NoDatastoresConfiguredEvent struct { - HostEvent -} - -func init() { - t["NoDatastoresConfiguredEvent"] = reflect.TypeOf((*NoDatastoresConfiguredEvent)(nil)).Elem() -} - -type NoDiskFound struct { - VimFault -} - -func init() { - t["NoDiskFound"] = reflect.TypeOf((*NoDiskFound)(nil)).Elem() -} - -type NoDiskFoundFault NoDiskFound - -func init() { - t["NoDiskFoundFault"] = reflect.TypeOf((*NoDiskFoundFault)(nil)).Elem() -} - -type NoDiskSpace struct { - FileFault - - Datastore string `xml:"datastore"` -} - -func init() { - t["NoDiskSpace"] = reflect.TypeOf((*NoDiskSpace)(nil)).Elem() -} - -type NoDiskSpaceFault NoDiskSpace - -func init() { - t["NoDiskSpaceFault"] = reflect.TypeOf((*NoDiskSpaceFault)(nil)).Elem() -} - -type NoDisksToCustomize struct { - CustomizationFault -} - -func init() { - t["NoDisksToCustomize"] = reflect.TypeOf((*NoDisksToCustomize)(nil)).Elem() -} - -type NoDisksToCustomizeFault NoDisksToCustomize - -func init() { - t["NoDisksToCustomizeFault"] = reflect.TypeOf((*NoDisksToCustomizeFault)(nil)).Elem() -} - -type NoGateway struct { - HostConfigFault -} - -func init() { - t["NoGateway"] = reflect.TypeOf((*NoGateway)(nil)).Elem() -} - -type NoGatewayFault NoGateway - -func init() { - t["NoGatewayFault"] = reflect.TypeOf((*NoGatewayFault)(nil)).Elem() -} - -type NoGuestHeartbeat struct { - MigrationFault -} - -func init() { - t["NoGuestHeartbeat"] = reflect.TypeOf((*NoGuestHeartbeat)(nil)).Elem() -} - -type NoGuestHeartbeatFault NoGuestHeartbeat - -func init() { - t["NoGuestHeartbeatFault"] = reflect.TypeOf((*NoGuestHeartbeatFault)(nil)).Elem() -} - -type NoHost struct { - HostConnectFault - - Name string `xml:"name,omitempty"` -} - -func init() { - t["NoHost"] = reflect.TypeOf((*NoHost)(nil)).Elem() -} - -type NoHostFault NoHost - -func init() { - t["NoHostFault"] = reflect.TypeOf((*NoHostFault)(nil)).Elem() -} - -type NoHostSuitableForFtSecondary struct { - VmFaultToleranceIssue - - Vm ManagedObjectReference `xml:"vm"` - VmName string `xml:"vmName"` -} - -func init() { - t["NoHostSuitableForFtSecondary"] = reflect.TypeOf((*NoHostSuitableForFtSecondary)(nil)).Elem() -} - -type NoHostSuitableForFtSecondaryFault NoHostSuitableForFtSecondary - -func init() { - t["NoHostSuitableForFtSecondaryFault"] = reflect.TypeOf((*NoHostSuitableForFtSecondaryFault)(nil)).Elem() -} - -type NoLicenseEvent struct { - LicenseEvent - - Feature LicenseFeatureInfo `xml:"feature"` -} - -func init() { - t["NoLicenseEvent"] = reflect.TypeOf((*NoLicenseEvent)(nil)).Elem() -} - -type NoLicenseServerConfigured struct { - NotEnoughLicenses -} - -func init() { - t["NoLicenseServerConfigured"] = reflect.TypeOf((*NoLicenseServerConfigured)(nil)).Elem() -} - -type NoLicenseServerConfiguredFault NoLicenseServerConfigured - -func init() { - t["NoLicenseServerConfiguredFault"] = reflect.TypeOf((*NoLicenseServerConfiguredFault)(nil)).Elem() -} - -type NoMaintenanceModeDrsRecommendationForVM struct { - VmEvent -} - -func init() { - t["NoMaintenanceModeDrsRecommendationForVM"] = reflect.TypeOf((*NoMaintenanceModeDrsRecommendationForVM)(nil)).Elem() -} - -type NoPeerHostFound struct { - HostPowerOpFailed -} - -func init() { - t["NoPeerHostFound"] = reflect.TypeOf((*NoPeerHostFound)(nil)).Elem() -} - -type NoPeerHostFoundFault NoPeerHostFound - -func init() { - t["NoPeerHostFoundFault"] = reflect.TypeOf((*NoPeerHostFoundFault)(nil)).Elem() -} - -type NoPermission struct { - SecurityError - - Object ManagedObjectReference `xml:"object"` - PrivilegeId string `xml:"privilegeId"` -} - -func init() { - t["NoPermission"] = reflect.TypeOf((*NoPermission)(nil)).Elem() -} - -type NoPermissionFault BaseNoPermission - -func init() { - t["NoPermissionFault"] = reflect.TypeOf((*NoPermissionFault)(nil)).Elem() -} - -type NoPermissionOnAD struct { - ActiveDirectoryFault -} - -func init() { - t["NoPermissionOnAD"] = reflect.TypeOf((*NoPermissionOnAD)(nil)).Elem() -} - -type NoPermissionOnADFault NoPermissionOnAD - -func init() { - t["NoPermissionOnADFault"] = reflect.TypeOf((*NoPermissionOnADFault)(nil)).Elem() -} - -type NoPermissionOnHost struct { - HostConnectFault -} - -func init() { - t["NoPermissionOnHost"] = reflect.TypeOf((*NoPermissionOnHost)(nil)).Elem() -} - -type NoPermissionOnHostFault NoPermissionOnHost - -func init() { - t["NoPermissionOnHostFault"] = reflect.TypeOf((*NoPermissionOnHostFault)(nil)).Elem() -} - -type NoPermissionOnNasVolume struct { - NasConfigFault - - UserName string `xml:"userName,omitempty"` -} - -func init() { - t["NoPermissionOnNasVolume"] = reflect.TypeOf((*NoPermissionOnNasVolume)(nil)).Elem() -} - -type NoPermissionOnNasVolumeFault NoPermissionOnNasVolume - -func init() { - t["NoPermissionOnNasVolumeFault"] = reflect.TypeOf((*NoPermissionOnNasVolumeFault)(nil)).Elem() -} - -type NoSubjectName struct { - VimFault -} - -func init() { - t["NoSubjectName"] = reflect.TypeOf((*NoSubjectName)(nil)).Elem() -} - -type NoSubjectNameFault NoSubjectName - -func init() { - t["NoSubjectNameFault"] = reflect.TypeOf((*NoSubjectNameFault)(nil)).Elem() -} - -type NoVcManagedIpConfigured struct { - VAppPropertyFault -} - -func init() { - t["NoVcManagedIpConfigured"] = reflect.TypeOf((*NoVcManagedIpConfigured)(nil)).Elem() -} - -type NoVcManagedIpConfiguredFault NoVcManagedIpConfigured - -func init() { - t["NoVcManagedIpConfiguredFault"] = reflect.TypeOf((*NoVcManagedIpConfiguredFault)(nil)).Elem() -} - -type NoVirtualNic struct { - HostConfigFault -} - -func init() { - t["NoVirtualNic"] = reflect.TypeOf((*NoVirtualNic)(nil)).Elem() -} - -type NoVirtualNicFault NoVirtualNic - -func init() { - t["NoVirtualNicFault"] = reflect.TypeOf((*NoVirtualNicFault)(nil)).Elem() -} - -type NoVmInVApp struct { - VAppConfigFault -} - -func init() { - t["NoVmInVApp"] = reflect.TypeOf((*NoVmInVApp)(nil)).Elem() -} - -type NoVmInVAppFault NoVmInVApp - -func init() { - t["NoVmInVAppFault"] = reflect.TypeOf((*NoVmInVAppFault)(nil)).Elem() -} - -type NonADUserRequired struct { - ActiveDirectoryFault -} - -func init() { - t["NonADUserRequired"] = reflect.TypeOf((*NonADUserRequired)(nil)).Elem() -} - -type NonADUserRequiredFault NonADUserRequired - -func init() { - t["NonADUserRequiredFault"] = reflect.TypeOf((*NonADUserRequiredFault)(nil)).Elem() -} - -type NonHomeRDMVMotionNotSupported struct { - MigrationFeatureNotSupported - - Device string `xml:"device"` -} - -func init() { - t["NonHomeRDMVMotionNotSupported"] = reflect.TypeOf((*NonHomeRDMVMotionNotSupported)(nil)).Elem() -} - -type NonHomeRDMVMotionNotSupportedFault NonHomeRDMVMotionNotSupported - -func init() { - t["NonHomeRDMVMotionNotSupportedFault"] = reflect.TypeOf((*NonHomeRDMVMotionNotSupportedFault)(nil)).Elem() -} - -type NonPersistentDisksNotSupported struct { - DeviceNotSupported -} - -func init() { - t["NonPersistentDisksNotSupported"] = reflect.TypeOf((*NonPersistentDisksNotSupported)(nil)).Elem() -} - -type NonPersistentDisksNotSupportedFault NonPersistentDisksNotSupported - -func init() { - t["NonPersistentDisksNotSupportedFault"] = reflect.TypeOf((*NonPersistentDisksNotSupportedFault)(nil)).Elem() -} - -type NonVIWorkloadDetectedOnDatastoreEvent struct { - DatastoreEvent -} - -func init() { - t["NonVIWorkloadDetectedOnDatastoreEvent"] = reflect.TypeOf((*NonVIWorkloadDetectedOnDatastoreEvent)(nil)).Elem() -} - -type NonVmwareOuiMacNotSupportedHost struct { - NotSupportedHost - - HostName string `xml:"hostName"` -} - -func init() { - t["NonVmwareOuiMacNotSupportedHost"] = reflect.TypeOf((*NonVmwareOuiMacNotSupportedHost)(nil)).Elem() -} - -type NonVmwareOuiMacNotSupportedHostFault NonVmwareOuiMacNotSupportedHost - -func init() { - t["NonVmwareOuiMacNotSupportedHostFault"] = reflect.TypeOf((*NonVmwareOuiMacNotSupportedHostFault)(nil)).Elem() -} - -type NotADirectory struct { - FileFault -} - -func init() { - t["NotADirectory"] = reflect.TypeOf((*NotADirectory)(nil)).Elem() -} - -type NotADirectoryFault NotADirectory - -func init() { - t["NotADirectoryFault"] = reflect.TypeOf((*NotADirectoryFault)(nil)).Elem() -} - -type NotAFile struct { - FileFault -} - -func init() { - t["NotAFile"] = reflect.TypeOf((*NotAFile)(nil)).Elem() -} - -type NotAFileFault NotAFile - -func init() { - t["NotAFileFault"] = reflect.TypeOf((*NotAFileFault)(nil)).Elem() -} - -type NotAuthenticated struct { - NoPermission -} - -func init() { - t["NotAuthenticated"] = reflect.TypeOf((*NotAuthenticated)(nil)).Elem() -} - -type NotAuthenticatedFault NotAuthenticated - -func init() { - t["NotAuthenticatedFault"] = reflect.TypeOf((*NotAuthenticatedFault)(nil)).Elem() -} - -type NotEnoughCpus struct { - VirtualHardwareCompatibilityIssue - - NumCpuDest int `xml:"numCpuDest"` - NumCpuVm int `xml:"numCpuVm"` -} - -func init() { - t["NotEnoughCpus"] = reflect.TypeOf((*NotEnoughCpus)(nil)).Elem() -} - -type NotEnoughCpusFault BaseNotEnoughCpus - -func init() { - t["NotEnoughCpusFault"] = reflect.TypeOf((*NotEnoughCpusFault)(nil)).Elem() -} - -type NotEnoughLicenses struct { - RuntimeFault -} - -func init() { - t["NotEnoughLicenses"] = reflect.TypeOf((*NotEnoughLicenses)(nil)).Elem() -} - -type NotEnoughLicensesFault BaseNotEnoughLicenses - -func init() { - t["NotEnoughLicensesFault"] = reflect.TypeOf((*NotEnoughLicensesFault)(nil)).Elem() -} - -type NotEnoughLogicalCpus struct { - NotEnoughCpus - - Host *ManagedObjectReference `xml:"host,omitempty"` -} - -func init() { - t["NotEnoughLogicalCpus"] = reflect.TypeOf((*NotEnoughLogicalCpus)(nil)).Elem() -} - -type NotEnoughLogicalCpusFault NotEnoughLogicalCpus - -func init() { - t["NotEnoughLogicalCpusFault"] = reflect.TypeOf((*NotEnoughLogicalCpusFault)(nil)).Elem() -} - -type NotEnoughResourcesToStartVmEvent struct { - VmEvent -} - -func init() { - t["NotEnoughResourcesToStartVmEvent"] = reflect.TypeOf((*NotEnoughResourcesToStartVmEvent)(nil)).Elem() -} - -type NotFound struct { - VimFault -} - -func init() { - t["NotFound"] = reflect.TypeOf((*NotFound)(nil)).Elem() -} - -type NotFoundFault NotFound - -func init() { - t["NotFoundFault"] = reflect.TypeOf((*NotFoundFault)(nil)).Elem() -} - -type NotImplemented struct { - RuntimeFault -} - -func init() { - t["NotImplemented"] = reflect.TypeOf((*NotImplemented)(nil)).Elem() -} - -type NotImplementedFault NotImplemented - -func init() { - t["NotImplementedFault"] = reflect.TypeOf((*NotImplementedFault)(nil)).Elem() -} - -type NotSupported struct { - RuntimeFault -} - -func init() { - t["NotSupported"] = reflect.TypeOf((*NotSupported)(nil)).Elem() -} - -type NotSupportedDeviceForFT struct { - VmFaultToleranceIssue - - Host ManagedObjectReference `xml:"host"` - HostName string `xml:"hostName,omitempty"` - Vm ManagedObjectReference `xml:"vm"` - VmName string `xml:"vmName,omitempty"` - DeviceType string `xml:"deviceType"` - DeviceLabel string `xml:"deviceLabel,omitempty"` -} - -func init() { - t["NotSupportedDeviceForFT"] = reflect.TypeOf((*NotSupportedDeviceForFT)(nil)).Elem() -} - -type NotSupportedDeviceForFTFault NotSupportedDeviceForFT - -func init() { - t["NotSupportedDeviceForFTFault"] = reflect.TypeOf((*NotSupportedDeviceForFTFault)(nil)).Elem() -} - -type NotSupportedFault BaseNotSupported - -func init() { - t["NotSupportedFault"] = reflect.TypeOf((*NotSupportedFault)(nil)).Elem() -} - -type NotSupportedHost struct { - HostConnectFault - - ProductName string `xml:"productName,omitempty"` - ProductVersion string `xml:"productVersion,omitempty"` -} - -func init() { - t["NotSupportedHost"] = reflect.TypeOf((*NotSupportedHost)(nil)).Elem() -} - -type NotSupportedHostFault BaseNotSupportedHost - -func init() { - t["NotSupportedHostFault"] = reflect.TypeOf((*NotSupportedHostFault)(nil)).Elem() -} - -type NotSupportedHostForVFlash struct { - NotSupportedHost - - HostName string `xml:"hostName"` -} - -func init() { - t["NotSupportedHostForVFlash"] = reflect.TypeOf((*NotSupportedHostForVFlash)(nil)).Elem() -} - -type NotSupportedHostForVFlashFault NotSupportedHostForVFlash - -func init() { - t["NotSupportedHostForVFlashFault"] = reflect.TypeOf((*NotSupportedHostForVFlashFault)(nil)).Elem() -} - -type NotSupportedHostForVsan struct { - NotSupportedHost - - HostName string `xml:"hostName"` -} - -func init() { - t["NotSupportedHostForVsan"] = reflect.TypeOf((*NotSupportedHostForVsan)(nil)).Elem() -} - -type NotSupportedHostForVsanFault NotSupportedHostForVsan - -func init() { - t["NotSupportedHostForVsanFault"] = reflect.TypeOf((*NotSupportedHostForVsanFault)(nil)).Elem() -} - -type NotSupportedHostInCluster struct { - NotSupportedHost -} - -func init() { - t["NotSupportedHostInCluster"] = reflect.TypeOf((*NotSupportedHostInCluster)(nil)).Elem() -} - -type NotSupportedHostInClusterFault BaseNotSupportedHostInCluster - -func init() { - t["NotSupportedHostInClusterFault"] = reflect.TypeOf((*NotSupportedHostInClusterFault)(nil)).Elem() -} - -type NotSupportedHostInDvs struct { - NotSupportedHost - - SwitchProductSpec DistributedVirtualSwitchProductSpec `xml:"switchProductSpec"` -} - -func init() { - t["NotSupportedHostInDvs"] = reflect.TypeOf((*NotSupportedHostInDvs)(nil)).Elem() -} - -type NotSupportedHostInDvsFault NotSupportedHostInDvs - -func init() { - t["NotSupportedHostInDvsFault"] = reflect.TypeOf((*NotSupportedHostInDvsFault)(nil)).Elem() -} - -type NotSupportedHostInHACluster struct { - NotSupportedHost - - HostName string `xml:"hostName"` - Build string `xml:"build"` -} - -func init() { - t["NotSupportedHostInHACluster"] = reflect.TypeOf((*NotSupportedHostInHACluster)(nil)).Elem() -} - -type NotSupportedHostInHAClusterFault NotSupportedHostInHACluster - -func init() { - t["NotSupportedHostInHAClusterFault"] = reflect.TypeOf((*NotSupportedHostInHAClusterFault)(nil)).Elem() -} - -type NotUserConfigurableProperty struct { - VAppPropertyFault -} - -func init() { - t["NotUserConfigurableProperty"] = reflect.TypeOf((*NotUserConfigurableProperty)(nil)).Elem() -} - -type NotUserConfigurablePropertyFault NotUserConfigurableProperty - -func init() { - t["NotUserConfigurablePropertyFault"] = reflect.TypeOf((*NotUserConfigurablePropertyFault)(nil)).Elem() -} - -type NumPortsProfile struct { - ApplyProfile -} - -func init() { - t["NumPortsProfile"] = reflect.TypeOf((*NumPortsProfile)(nil)).Elem() -} - -type NumVirtualCoresPerSocketNotSupported struct { - VirtualHardwareCompatibilityIssue - - MaxSupportedCoresPerSocketDest int `xml:"maxSupportedCoresPerSocketDest"` - NumCoresPerSocketVm int `xml:"numCoresPerSocketVm"` -} - -func init() { - t["NumVirtualCoresPerSocketNotSupported"] = reflect.TypeOf((*NumVirtualCoresPerSocketNotSupported)(nil)).Elem() -} - -type NumVirtualCoresPerSocketNotSupportedFault NumVirtualCoresPerSocketNotSupported - -func init() { - t["NumVirtualCoresPerSocketNotSupportedFault"] = reflect.TypeOf((*NumVirtualCoresPerSocketNotSupportedFault)(nil)).Elem() -} - -type NumVirtualCpusExceedsLimit struct { - InsufficientResourcesFault - - MaxSupportedVcpus int `xml:"maxSupportedVcpus"` -} - -func init() { - t["NumVirtualCpusExceedsLimit"] = reflect.TypeOf((*NumVirtualCpusExceedsLimit)(nil)).Elem() -} - -type NumVirtualCpusExceedsLimitFault NumVirtualCpusExceedsLimit - -func init() { - t["NumVirtualCpusExceedsLimitFault"] = reflect.TypeOf((*NumVirtualCpusExceedsLimitFault)(nil)).Elem() -} - -type NumVirtualCpusIncompatible struct { - VmConfigFault - - Reason string `xml:"reason"` - NumCpu int `xml:"numCpu"` -} - -func init() { - t["NumVirtualCpusIncompatible"] = reflect.TypeOf((*NumVirtualCpusIncompatible)(nil)).Elem() -} - -type NumVirtualCpusIncompatibleFault NumVirtualCpusIncompatible - -func init() { - t["NumVirtualCpusIncompatibleFault"] = reflect.TypeOf((*NumVirtualCpusIncompatibleFault)(nil)).Elem() -} - -type NumVirtualCpusNotSupported struct { - VirtualHardwareCompatibilityIssue - - MaxSupportedVcpusDest int `xml:"maxSupportedVcpusDest"` - NumCpuVm int `xml:"numCpuVm"` -} - -func init() { - t["NumVirtualCpusNotSupported"] = reflect.TypeOf((*NumVirtualCpusNotSupported)(nil)).Elem() -} - -type NumVirtualCpusNotSupportedFault NumVirtualCpusNotSupported - -func init() { - t["NumVirtualCpusNotSupportedFault"] = reflect.TypeOf((*NumVirtualCpusNotSupportedFault)(nil)).Elem() -} - -type NumericRange struct { - DynamicData - - Start int `xml:"start"` - End int `xml:"end"` -} - -func init() { - t["NumericRange"] = reflect.TypeOf((*NumericRange)(nil)).Elem() -} - -type ObjectContent struct { - DynamicData - - Obj ManagedObjectReference `xml:"obj"` - PropSet []DynamicProperty `xml:"propSet,omitempty"` - MissingSet []MissingProperty `xml:"missingSet,omitempty"` -} - -func init() { - t["ObjectContent"] = reflect.TypeOf((*ObjectContent)(nil)).Elem() -} - -type ObjectSpec struct { - DynamicData - - Obj ManagedObjectReference `xml:"obj"` - Skip *bool `xml:"skip"` - SelectSet []BaseSelectionSpec `xml:"selectSet,omitempty,typeattr"` -} - -func init() { - t["ObjectSpec"] = reflect.TypeOf((*ObjectSpec)(nil)).Elem() -} - -type ObjectUpdate struct { - DynamicData - - Kind ObjectUpdateKind `xml:"kind"` - Obj ManagedObjectReference `xml:"obj"` - ChangeSet []PropertyChange `xml:"changeSet,omitempty"` - MissingSet []MissingProperty `xml:"missingSet,omitempty"` -} - -func init() { - t["ObjectUpdate"] = reflect.TypeOf((*ObjectUpdate)(nil)).Elem() -} - -type OnceTaskScheduler struct { - TaskScheduler - - RunAt *time.Time `xml:"runAt"` -} - -func init() { - t["OnceTaskScheduler"] = reflect.TypeOf((*OnceTaskScheduler)(nil)).Elem() -} - -type OpaqueNetworkSummary struct { - NetworkSummary - - OpaqueNetworkId string `xml:"opaqueNetworkId"` - OpaqueNetworkType string `xml:"opaqueNetworkType"` -} - -func init() { - t["OpaqueNetworkSummary"] = reflect.TypeOf((*OpaqueNetworkSummary)(nil)).Elem() -} - -type OpaqueNetworkTargetInfo struct { - VirtualMachineTargetInfo - - Network OpaqueNetworkSummary `xml:"network"` -} - -func init() { - t["OpaqueNetworkTargetInfo"] = reflect.TypeOf((*OpaqueNetworkTargetInfo)(nil)).Elem() -} - -type OpenInventoryViewFolder OpenInventoryViewFolderRequestType - -func init() { - t["OpenInventoryViewFolder"] = reflect.TypeOf((*OpenInventoryViewFolder)(nil)).Elem() -} - -type OpenInventoryViewFolderRequestType struct { - This ManagedObjectReference `xml:"_this"` - Entity []ManagedObjectReference `xml:"entity"` -} - -func init() { - t["OpenInventoryViewFolderRequestType"] = reflect.TypeOf((*OpenInventoryViewFolderRequestType)(nil)).Elem() -} - -type OpenInventoryViewFolderResponse struct { - Returnval []ManagedObjectReference `xml:"returnval,omitempty"` -} - -type OperationDisabledByGuest struct { - GuestOperationsFault -} - -func init() { - t["OperationDisabledByGuest"] = reflect.TypeOf((*OperationDisabledByGuest)(nil)).Elem() -} - -type OperationDisabledByGuestFault OperationDisabledByGuest - -func init() { - t["OperationDisabledByGuestFault"] = reflect.TypeOf((*OperationDisabledByGuestFault)(nil)).Elem() -} - -type OperationDisallowedOnHost struct { - RuntimeFault -} - -func init() { - t["OperationDisallowedOnHost"] = reflect.TypeOf((*OperationDisallowedOnHost)(nil)).Elem() -} - -type OperationDisallowedOnHostFault OperationDisallowedOnHost - -func init() { - t["OperationDisallowedOnHostFault"] = reflect.TypeOf((*OperationDisallowedOnHostFault)(nil)).Elem() -} - -type OperationNotSupportedByGuest struct { - GuestOperationsFault -} - -func init() { - t["OperationNotSupportedByGuest"] = reflect.TypeOf((*OperationNotSupportedByGuest)(nil)).Elem() -} - -type OperationNotSupportedByGuestFault OperationNotSupportedByGuest - -func init() { - t["OperationNotSupportedByGuestFault"] = reflect.TypeOf((*OperationNotSupportedByGuestFault)(nil)).Elem() -} - -type OptionDef struct { - ElementDescription - - OptionType BaseOptionType `xml:"optionType,typeattr"` -} - -func init() { - t["OptionDef"] = reflect.TypeOf((*OptionDef)(nil)).Elem() -} - -type OptionProfile struct { - ApplyProfile - - Key string `xml:"key"` -} - -func init() { - t["OptionProfile"] = reflect.TypeOf((*OptionProfile)(nil)).Elem() -} - -type OptionType struct { - DynamicData - - ValueIsReadonly *bool `xml:"valueIsReadonly"` -} - -func init() { - t["OptionType"] = reflect.TypeOf((*OptionType)(nil)).Elem() -} - -type OptionValue struct { - DynamicData - - Key string `xml:"key"` - Value AnyType `xml:"value,omitempty,typeattr"` -} - -func init() { - t["OptionValue"] = reflect.TypeOf((*OptionValue)(nil)).Elem() -} - -type OrAlarmExpression struct { - AlarmExpression - - Expression []BaseAlarmExpression `xml:"expression,typeattr"` -} - -func init() { - t["OrAlarmExpression"] = reflect.TypeOf((*OrAlarmExpression)(nil)).Elem() -} - -type OutOfBounds struct { - VimFault - - ArgumentName string `xml:"argumentName"` -} - -func init() { - t["OutOfBounds"] = reflect.TypeOf((*OutOfBounds)(nil)).Elem() -} - -type OutOfBoundsFault OutOfBounds - -func init() { - t["OutOfBoundsFault"] = reflect.TypeOf((*OutOfBoundsFault)(nil)).Elem() -} - -type OutOfSyncDvsHost struct { - DvsEvent - - HostOutOfSync []DvsOutOfSyncHostArgument `xml:"hostOutOfSync"` -} - -func init() { - t["OutOfSyncDvsHost"] = reflect.TypeOf((*OutOfSyncDvsHost)(nil)).Elem() -} - -type OverwriteCustomizationSpec OverwriteCustomizationSpecRequestType - -func init() { - t["OverwriteCustomizationSpec"] = reflect.TypeOf((*OverwriteCustomizationSpec)(nil)).Elem() -} - -type OverwriteCustomizationSpecRequestType struct { - This ManagedObjectReference `xml:"_this"` - Item CustomizationSpecItem `xml:"item"` -} - -func init() { - t["OverwriteCustomizationSpecRequestType"] = reflect.TypeOf((*OverwriteCustomizationSpecRequestType)(nil)).Elem() -} - -type OverwriteCustomizationSpecResponse struct { -} - -type OvfAttribute struct { - OvfInvalidPackage - - ElementName string `xml:"elementName"` - AttributeName string `xml:"attributeName"` -} - -func init() { - t["OvfAttribute"] = reflect.TypeOf((*OvfAttribute)(nil)).Elem() -} - -type OvfAttributeFault BaseOvfAttribute - -func init() { - t["OvfAttributeFault"] = reflect.TypeOf((*OvfAttributeFault)(nil)).Elem() -} - -type OvfConnectedDevice struct { - OvfHardwareExport -} - -func init() { - t["OvfConnectedDevice"] = reflect.TypeOf((*OvfConnectedDevice)(nil)).Elem() -} - -type OvfConnectedDeviceFault BaseOvfConnectedDevice - -func init() { - t["OvfConnectedDeviceFault"] = reflect.TypeOf((*OvfConnectedDeviceFault)(nil)).Elem() -} - -type OvfConnectedDeviceFloppy struct { - OvfConnectedDevice - - Filename string `xml:"filename"` -} - -func init() { - t["OvfConnectedDeviceFloppy"] = reflect.TypeOf((*OvfConnectedDeviceFloppy)(nil)).Elem() -} - -type OvfConnectedDeviceFloppyFault OvfConnectedDeviceFloppy - -func init() { - t["OvfConnectedDeviceFloppyFault"] = reflect.TypeOf((*OvfConnectedDeviceFloppyFault)(nil)).Elem() -} - -type OvfConnectedDeviceIso struct { - OvfConnectedDevice - - Filename string `xml:"filename"` -} - -func init() { - t["OvfConnectedDeviceIso"] = reflect.TypeOf((*OvfConnectedDeviceIso)(nil)).Elem() -} - -type OvfConnectedDeviceIsoFault OvfConnectedDeviceIso - -func init() { - t["OvfConnectedDeviceIsoFault"] = reflect.TypeOf((*OvfConnectedDeviceIsoFault)(nil)).Elem() -} - -type OvfConstraint struct { - OvfInvalidPackage - - Name string `xml:"name"` -} - -func init() { - t["OvfConstraint"] = reflect.TypeOf((*OvfConstraint)(nil)).Elem() -} - -type OvfConstraintFault BaseOvfConstraint - -func init() { - t["OvfConstraintFault"] = reflect.TypeOf((*OvfConstraintFault)(nil)).Elem() -} - -type OvfConsumerCallbackFault struct { - OvfFault - - ExtensionKey string `xml:"extensionKey"` - ExtensionName string `xml:"extensionName"` -} - -func init() { - t["OvfConsumerCallbackFault"] = reflect.TypeOf((*OvfConsumerCallbackFault)(nil)).Elem() -} - -type OvfConsumerCallbackFaultFault BaseOvfConsumerCallbackFault - -func init() { - t["OvfConsumerCallbackFaultFault"] = reflect.TypeOf((*OvfConsumerCallbackFaultFault)(nil)).Elem() -} - -type OvfConsumerCommunicationError struct { - OvfConsumerCallbackFault - - Description string `xml:"description"` -} - -func init() { - t["OvfConsumerCommunicationError"] = reflect.TypeOf((*OvfConsumerCommunicationError)(nil)).Elem() -} - -type OvfConsumerCommunicationErrorFault OvfConsumerCommunicationError - -func init() { - t["OvfConsumerCommunicationErrorFault"] = reflect.TypeOf((*OvfConsumerCommunicationErrorFault)(nil)).Elem() -} - -type OvfConsumerFault struct { - OvfConsumerCallbackFault - - ErrorKey string `xml:"errorKey"` - Message string `xml:"message"` - Params []KeyValue `xml:"params,omitempty"` -} - -func init() { - t["OvfConsumerFault"] = reflect.TypeOf((*OvfConsumerFault)(nil)).Elem() -} - -type OvfConsumerFaultFault OvfConsumerFault - -func init() { - t["OvfConsumerFaultFault"] = reflect.TypeOf((*OvfConsumerFaultFault)(nil)).Elem() -} - -type OvfConsumerInvalidSection struct { - OvfConsumerCallbackFault - - LineNumber int `xml:"lineNumber"` - Description string `xml:"description"` -} - -func init() { - t["OvfConsumerInvalidSection"] = reflect.TypeOf((*OvfConsumerInvalidSection)(nil)).Elem() -} - -type OvfConsumerInvalidSectionFault OvfConsumerInvalidSection - -func init() { - t["OvfConsumerInvalidSectionFault"] = reflect.TypeOf((*OvfConsumerInvalidSectionFault)(nil)).Elem() -} - -type OvfConsumerOstNode struct { - DynamicData - - Id string `xml:"id"` - Type string `xml:"type"` - Section []OvfConsumerOvfSection `xml:"section,omitempty"` - Child []OvfConsumerOstNode `xml:"child,omitempty"` - Entity *ManagedObjectReference `xml:"entity,omitempty"` -} - -func init() { - t["OvfConsumerOstNode"] = reflect.TypeOf((*OvfConsumerOstNode)(nil)).Elem() -} - -type OvfConsumerOvfSection struct { - DynamicData - - LineNumber int `xml:"lineNumber"` - Xml string `xml:"xml"` -} - -func init() { - t["OvfConsumerOvfSection"] = reflect.TypeOf((*OvfConsumerOvfSection)(nil)).Elem() -} - -type OvfConsumerPowerOnFault struct { - InvalidState - - ExtensionKey string `xml:"extensionKey"` - ExtensionName string `xml:"extensionName"` - Description string `xml:"description"` -} - -func init() { - t["OvfConsumerPowerOnFault"] = reflect.TypeOf((*OvfConsumerPowerOnFault)(nil)).Elem() -} - -type OvfConsumerPowerOnFaultFault OvfConsumerPowerOnFault - -func init() { - t["OvfConsumerPowerOnFaultFault"] = reflect.TypeOf((*OvfConsumerPowerOnFaultFault)(nil)).Elem() -} - -type OvfConsumerUndeclaredSection struct { - OvfConsumerCallbackFault - - QualifiedSectionType string `xml:"qualifiedSectionType"` -} - -func init() { - t["OvfConsumerUndeclaredSection"] = reflect.TypeOf((*OvfConsumerUndeclaredSection)(nil)).Elem() -} - -type OvfConsumerUndeclaredSectionFault OvfConsumerUndeclaredSection - -func init() { - t["OvfConsumerUndeclaredSectionFault"] = reflect.TypeOf((*OvfConsumerUndeclaredSectionFault)(nil)).Elem() -} - -type OvfConsumerUndefinedPrefix struct { - OvfConsumerCallbackFault - - Prefix string `xml:"prefix"` -} - -func init() { - t["OvfConsumerUndefinedPrefix"] = reflect.TypeOf((*OvfConsumerUndefinedPrefix)(nil)).Elem() -} - -type OvfConsumerUndefinedPrefixFault OvfConsumerUndefinedPrefix - -func init() { - t["OvfConsumerUndefinedPrefixFault"] = reflect.TypeOf((*OvfConsumerUndefinedPrefixFault)(nil)).Elem() -} - -type OvfConsumerValidationFault struct { - VmConfigFault - - ExtensionKey string `xml:"extensionKey"` - ExtensionName string `xml:"extensionName"` - Message string `xml:"message"` -} - -func init() { - t["OvfConsumerValidationFault"] = reflect.TypeOf((*OvfConsumerValidationFault)(nil)).Elem() -} - -type OvfConsumerValidationFaultFault OvfConsumerValidationFault - -func init() { - t["OvfConsumerValidationFaultFault"] = reflect.TypeOf((*OvfConsumerValidationFaultFault)(nil)).Elem() -} - -type OvfCpuCompatibility struct { - OvfImport - - RegisterName string `xml:"registerName"` - Level int `xml:"level"` - RegisterValue string `xml:"registerValue"` - DesiredRegisterValue string `xml:"desiredRegisterValue"` -} - -func init() { - t["OvfCpuCompatibility"] = reflect.TypeOf((*OvfCpuCompatibility)(nil)).Elem() -} - -type OvfCpuCompatibilityCheckNotSupported struct { - OvfImport -} - -func init() { - t["OvfCpuCompatibilityCheckNotSupported"] = reflect.TypeOf((*OvfCpuCompatibilityCheckNotSupported)(nil)).Elem() -} - -type OvfCpuCompatibilityCheckNotSupportedFault OvfCpuCompatibilityCheckNotSupported - -func init() { - t["OvfCpuCompatibilityCheckNotSupportedFault"] = reflect.TypeOf((*OvfCpuCompatibilityCheckNotSupportedFault)(nil)).Elem() -} - -type OvfCpuCompatibilityFault OvfCpuCompatibility - -func init() { - t["OvfCpuCompatibilityFault"] = reflect.TypeOf((*OvfCpuCompatibilityFault)(nil)).Elem() -} - -type OvfCreateDescriptorParams struct { - DynamicData - - OvfFiles []OvfFile `xml:"ovfFiles,omitempty"` - Name string `xml:"name,omitempty"` - Description string `xml:"description,omitempty"` - IncludeImageFiles *bool `xml:"includeImageFiles"` - ExportOption []string `xml:"exportOption,omitempty"` - Snapshot *ManagedObjectReference `xml:"snapshot,omitempty"` -} - -func init() { - t["OvfCreateDescriptorParams"] = reflect.TypeOf((*OvfCreateDescriptorParams)(nil)).Elem() -} - -type OvfCreateDescriptorResult struct { - DynamicData - - OvfDescriptor string `xml:"ovfDescriptor"` - Error []LocalizedMethodFault `xml:"error,omitempty"` - Warning []LocalizedMethodFault `xml:"warning,omitempty"` - IncludeImageFiles *bool `xml:"includeImageFiles"` -} - -func init() { - t["OvfCreateDescriptorResult"] = reflect.TypeOf((*OvfCreateDescriptorResult)(nil)).Elem() -} - -type OvfCreateImportSpecParams struct { - OvfManagerCommonParams - - EntityName string `xml:"entityName"` - HostSystem *ManagedObjectReference `xml:"hostSystem,omitempty"` - NetworkMapping []OvfNetworkMapping `xml:"networkMapping,omitempty"` - IpAllocationPolicy string `xml:"ipAllocationPolicy,omitempty"` - IpProtocol string `xml:"ipProtocol,omitempty"` - PropertyMapping []KeyValue `xml:"propertyMapping,omitempty"` - ResourceMapping []OvfResourceMap `xml:"resourceMapping,omitempty"` - DiskProvisioning string `xml:"diskProvisioning,omitempty"` - InstantiationOst *OvfConsumerOstNode `xml:"instantiationOst,omitempty"` -} - -func init() { - t["OvfCreateImportSpecParams"] = reflect.TypeOf((*OvfCreateImportSpecParams)(nil)).Elem() -} - -type OvfCreateImportSpecResult struct { - DynamicData - - ImportSpec BaseImportSpec `xml:"importSpec,omitempty,typeattr"` - FileItem []OvfFileItem `xml:"fileItem,omitempty"` - Warning []LocalizedMethodFault `xml:"warning,omitempty"` - Error []LocalizedMethodFault `xml:"error,omitempty"` -} - -func init() { - t["OvfCreateImportSpecResult"] = reflect.TypeOf((*OvfCreateImportSpecResult)(nil)).Elem() -} - -type OvfDeploymentOption struct { - DynamicData - - Key string `xml:"key"` - Label string `xml:"label"` - Description string `xml:"description"` -} - -func init() { - t["OvfDeploymentOption"] = reflect.TypeOf((*OvfDeploymentOption)(nil)).Elem() -} - -type OvfDiskMappingNotFound struct { - OvfSystemFault - - DiskName string `xml:"diskName"` - VmName string `xml:"vmName"` -} - -func init() { - t["OvfDiskMappingNotFound"] = reflect.TypeOf((*OvfDiskMappingNotFound)(nil)).Elem() -} - -type OvfDiskMappingNotFoundFault OvfDiskMappingNotFound - -func init() { - t["OvfDiskMappingNotFoundFault"] = reflect.TypeOf((*OvfDiskMappingNotFoundFault)(nil)).Elem() -} - -type OvfDiskOrderConstraint struct { - OvfConstraint -} - -func init() { - t["OvfDiskOrderConstraint"] = reflect.TypeOf((*OvfDiskOrderConstraint)(nil)).Elem() -} - -type OvfDiskOrderConstraintFault OvfDiskOrderConstraint - -func init() { - t["OvfDiskOrderConstraintFault"] = reflect.TypeOf((*OvfDiskOrderConstraintFault)(nil)).Elem() -} - -type OvfDuplicateElement struct { - OvfElement -} - -func init() { - t["OvfDuplicateElement"] = reflect.TypeOf((*OvfDuplicateElement)(nil)).Elem() -} - -type OvfDuplicateElementFault OvfDuplicateElement - -func init() { - t["OvfDuplicateElementFault"] = reflect.TypeOf((*OvfDuplicateElementFault)(nil)).Elem() -} - -type OvfDuplicatedElementBoundary struct { - OvfElement - - Boundary string `xml:"boundary"` -} - -func init() { - t["OvfDuplicatedElementBoundary"] = reflect.TypeOf((*OvfDuplicatedElementBoundary)(nil)).Elem() -} - -type OvfDuplicatedElementBoundaryFault OvfDuplicatedElementBoundary - -func init() { - t["OvfDuplicatedElementBoundaryFault"] = reflect.TypeOf((*OvfDuplicatedElementBoundaryFault)(nil)).Elem() -} - -type OvfDuplicatedPropertyIdExport struct { - OvfExport - - Fqid string `xml:"fqid"` -} - -func init() { - t["OvfDuplicatedPropertyIdExport"] = reflect.TypeOf((*OvfDuplicatedPropertyIdExport)(nil)).Elem() -} - -type OvfDuplicatedPropertyIdExportFault OvfDuplicatedPropertyIdExport - -func init() { - t["OvfDuplicatedPropertyIdExportFault"] = reflect.TypeOf((*OvfDuplicatedPropertyIdExportFault)(nil)).Elem() -} - -type OvfDuplicatedPropertyIdImport struct { - OvfExport -} - -func init() { - t["OvfDuplicatedPropertyIdImport"] = reflect.TypeOf((*OvfDuplicatedPropertyIdImport)(nil)).Elem() -} - -type OvfDuplicatedPropertyIdImportFault OvfDuplicatedPropertyIdImport - -func init() { - t["OvfDuplicatedPropertyIdImportFault"] = reflect.TypeOf((*OvfDuplicatedPropertyIdImportFault)(nil)).Elem() -} - -type OvfElement struct { - OvfInvalidPackage - - Name string `xml:"name"` -} - -func init() { - t["OvfElement"] = reflect.TypeOf((*OvfElement)(nil)).Elem() -} - -type OvfElementFault BaseOvfElement - -func init() { - t["OvfElementFault"] = reflect.TypeOf((*OvfElementFault)(nil)).Elem() -} - -type OvfElementInvalidValue struct { - OvfElement - - Value string `xml:"value"` -} - -func init() { - t["OvfElementInvalidValue"] = reflect.TypeOf((*OvfElementInvalidValue)(nil)).Elem() -} - -type OvfElementInvalidValueFault OvfElementInvalidValue - -func init() { - t["OvfElementInvalidValueFault"] = reflect.TypeOf((*OvfElementInvalidValueFault)(nil)).Elem() -} - -type OvfExport struct { - OvfFault -} - -func init() { - t["OvfExport"] = reflect.TypeOf((*OvfExport)(nil)).Elem() -} - -type OvfExportFailed struct { - OvfExport -} - -func init() { - t["OvfExportFailed"] = reflect.TypeOf((*OvfExportFailed)(nil)).Elem() -} - -type OvfExportFailedFault OvfExportFailed - -func init() { - t["OvfExportFailedFault"] = reflect.TypeOf((*OvfExportFailedFault)(nil)).Elem() -} - -type OvfExportFault BaseOvfExport - -func init() { - t["OvfExportFault"] = reflect.TypeOf((*OvfExportFault)(nil)).Elem() -} - -type OvfFault struct { - VimFault -} - -func init() { - t["OvfFault"] = reflect.TypeOf((*OvfFault)(nil)).Elem() -} - -type OvfFaultFault BaseOvfFault - -func init() { - t["OvfFaultFault"] = reflect.TypeOf((*OvfFaultFault)(nil)).Elem() -} - -type OvfFile struct { - DynamicData - - DeviceId string `xml:"deviceId"` - Path string `xml:"path"` - CompressionMethod string `xml:"compressionMethod,omitempty"` - ChunkSize int64 `xml:"chunkSize,omitempty"` - Size int64 `xml:"size"` - Capacity int64 `xml:"capacity,omitempty"` - PopulatedSize int64 `xml:"populatedSize,omitempty"` -} - -func init() { - t["OvfFile"] = reflect.TypeOf((*OvfFile)(nil)).Elem() -} - -type OvfFileItem struct { - DynamicData - - DeviceId string `xml:"deviceId"` - Path string `xml:"path"` - CompressionMethod string `xml:"compressionMethod,omitempty"` - ChunkSize int64 `xml:"chunkSize,omitempty"` - Size int64 `xml:"size,omitempty"` - CimType int `xml:"cimType"` - Create bool `xml:"create"` -} - -func init() { - t["OvfFileItem"] = reflect.TypeOf((*OvfFileItem)(nil)).Elem() -} - -type OvfHardwareCheck struct { - OvfImport -} - -func init() { - t["OvfHardwareCheck"] = reflect.TypeOf((*OvfHardwareCheck)(nil)).Elem() -} - -type OvfHardwareCheckFault OvfHardwareCheck - -func init() { - t["OvfHardwareCheckFault"] = reflect.TypeOf((*OvfHardwareCheckFault)(nil)).Elem() -} - -type OvfHardwareExport struct { - OvfExport - - Device BaseVirtualDevice `xml:"device,omitempty,typeattr"` - VmPath string `xml:"vmPath"` -} - -func init() { - t["OvfHardwareExport"] = reflect.TypeOf((*OvfHardwareExport)(nil)).Elem() -} - -type OvfHardwareExportFault BaseOvfHardwareExport - -func init() { - t["OvfHardwareExportFault"] = reflect.TypeOf((*OvfHardwareExportFault)(nil)).Elem() -} - -type OvfHostResourceConstraint struct { - OvfConstraint - - Value string `xml:"value"` -} - -func init() { - t["OvfHostResourceConstraint"] = reflect.TypeOf((*OvfHostResourceConstraint)(nil)).Elem() -} - -type OvfHostResourceConstraintFault OvfHostResourceConstraint - -func init() { - t["OvfHostResourceConstraintFault"] = reflect.TypeOf((*OvfHostResourceConstraintFault)(nil)).Elem() -} - -type OvfHostValueNotParsed struct { - OvfSystemFault - - Property string `xml:"property"` - Value string `xml:"value"` -} - -func init() { - t["OvfHostValueNotParsed"] = reflect.TypeOf((*OvfHostValueNotParsed)(nil)).Elem() -} - -type OvfHostValueNotParsedFault OvfHostValueNotParsed - -func init() { - t["OvfHostValueNotParsedFault"] = reflect.TypeOf((*OvfHostValueNotParsedFault)(nil)).Elem() -} - -type OvfImport struct { - OvfFault -} - -func init() { - t["OvfImport"] = reflect.TypeOf((*OvfImport)(nil)).Elem() -} - -type OvfImportFailed struct { - OvfImport -} - -func init() { - t["OvfImportFailed"] = reflect.TypeOf((*OvfImportFailed)(nil)).Elem() -} - -type OvfImportFailedFault OvfImportFailed - -func init() { - t["OvfImportFailedFault"] = reflect.TypeOf((*OvfImportFailedFault)(nil)).Elem() -} - -type OvfImportFault BaseOvfImport - -func init() { - t["OvfImportFault"] = reflect.TypeOf((*OvfImportFault)(nil)).Elem() -} - -type OvfInternalError struct { - OvfSystemFault -} - -func init() { - t["OvfInternalError"] = reflect.TypeOf((*OvfInternalError)(nil)).Elem() -} - -type OvfInternalErrorFault OvfInternalError - -func init() { - t["OvfInternalErrorFault"] = reflect.TypeOf((*OvfInternalErrorFault)(nil)).Elem() -} - -type OvfInvalidPackage struct { - OvfFault - - LineNumber int `xml:"lineNumber"` -} - -func init() { - t["OvfInvalidPackage"] = reflect.TypeOf((*OvfInvalidPackage)(nil)).Elem() -} - -type OvfInvalidPackageFault BaseOvfInvalidPackage - -func init() { - t["OvfInvalidPackageFault"] = reflect.TypeOf((*OvfInvalidPackageFault)(nil)).Elem() -} - -type OvfInvalidValue struct { - OvfAttribute - - Value string `xml:"value"` -} - -func init() { - t["OvfInvalidValue"] = reflect.TypeOf((*OvfInvalidValue)(nil)).Elem() -} - -type OvfInvalidValueConfiguration struct { - OvfInvalidValue -} - -func init() { - t["OvfInvalidValueConfiguration"] = reflect.TypeOf((*OvfInvalidValueConfiguration)(nil)).Elem() -} - -type OvfInvalidValueConfigurationFault OvfInvalidValueConfiguration - -func init() { - t["OvfInvalidValueConfigurationFault"] = reflect.TypeOf((*OvfInvalidValueConfigurationFault)(nil)).Elem() -} - -type OvfInvalidValueEmpty struct { - OvfInvalidValue -} - -func init() { - t["OvfInvalidValueEmpty"] = reflect.TypeOf((*OvfInvalidValueEmpty)(nil)).Elem() -} - -type OvfInvalidValueEmptyFault OvfInvalidValueEmpty - -func init() { - t["OvfInvalidValueEmptyFault"] = reflect.TypeOf((*OvfInvalidValueEmptyFault)(nil)).Elem() -} - -type OvfInvalidValueFault BaseOvfInvalidValue - -func init() { - t["OvfInvalidValueFault"] = reflect.TypeOf((*OvfInvalidValueFault)(nil)).Elem() -} - -type OvfInvalidValueFormatMalformed struct { - OvfInvalidValue -} - -func init() { - t["OvfInvalidValueFormatMalformed"] = reflect.TypeOf((*OvfInvalidValueFormatMalformed)(nil)).Elem() -} - -type OvfInvalidValueFormatMalformedFault OvfInvalidValueFormatMalformed - -func init() { - t["OvfInvalidValueFormatMalformedFault"] = reflect.TypeOf((*OvfInvalidValueFormatMalformedFault)(nil)).Elem() -} - -type OvfInvalidValueReference struct { - OvfInvalidValue -} - -func init() { - t["OvfInvalidValueReference"] = reflect.TypeOf((*OvfInvalidValueReference)(nil)).Elem() -} - -type OvfInvalidValueReferenceFault OvfInvalidValueReference - -func init() { - t["OvfInvalidValueReferenceFault"] = reflect.TypeOf((*OvfInvalidValueReferenceFault)(nil)).Elem() -} - -type OvfInvalidVmName struct { - OvfUnsupportedPackage - - Name string `xml:"name"` -} - -func init() { - t["OvfInvalidVmName"] = reflect.TypeOf((*OvfInvalidVmName)(nil)).Elem() -} - -type OvfInvalidVmNameFault OvfInvalidVmName - -func init() { - t["OvfInvalidVmNameFault"] = reflect.TypeOf((*OvfInvalidVmNameFault)(nil)).Elem() -} - -type OvfManagerCommonParams struct { - DynamicData - - Locale string `xml:"locale"` - DeploymentOption string `xml:"deploymentOption"` - MsgBundle []KeyValue `xml:"msgBundle,omitempty"` - ImportOption []string `xml:"importOption,omitempty"` -} - -func init() { - t["OvfManagerCommonParams"] = reflect.TypeOf((*OvfManagerCommonParams)(nil)).Elem() -} - -type OvfMappedOsId struct { - OvfImport - - OvfId int `xml:"ovfId"` - OvfDescription string `xml:"ovfDescription"` - TargetDescription string `xml:"targetDescription"` -} - -func init() { - t["OvfMappedOsId"] = reflect.TypeOf((*OvfMappedOsId)(nil)).Elem() -} - -type OvfMappedOsIdFault OvfMappedOsId - -func init() { - t["OvfMappedOsIdFault"] = reflect.TypeOf((*OvfMappedOsIdFault)(nil)).Elem() -} - -type OvfMissingAttribute struct { - OvfAttribute -} - -func init() { - t["OvfMissingAttribute"] = reflect.TypeOf((*OvfMissingAttribute)(nil)).Elem() -} - -type OvfMissingAttributeFault OvfMissingAttribute - -func init() { - t["OvfMissingAttributeFault"] = reflect.TypeOf((*OvfMissingAttributeFault)(nil)).Elem() -} - -type OvfMissingElement struct { - OvfElement -} - -func init() { - t["OvfMissingElement"] = reflect.TypeOf((*OvfMissingElement)(nil)).Elem() -} - -type OvfMissingElementFault BaseOvfMissingElement - -func init() { - t["OvfMissingElementFault"] = reflect.TypeOf((*OvfMissingElementFault)(nil)).Elem() -} - -type OvfMissingElementNormalBoundary struct { - OvfMissingElement - - Boundary string `xml:"boundary"` -} - -func init() { - t["OvfMissingElementNormalBoundary"] = reflect.TypeOf((*OvfMissingElementNormalBoundary)(nil)).Elem() -} - -type OvfMissingElementNormalBoundaryFault OvfMissingElementNormalBoundary - -func init() { - t["OvfMissingElementNormalBoundaryFault"] = reflect.TypeOf((*OvfMissingElementNormalBoundaryFault)(nil)).Elem() -} - -type OvfMissingHardware struct { - OvfImport - - Name string `xml:"name"` - ResourceType int `xml:"resourceType"` -} - -func init() { - t["OvfMissingHardware"] = reflect.TypeOf((*OvfMissingHardware)(nil)).Elem() -} - -type OvfMissingHardwareFault OvfMissingHardware - -func init() { - t["OvfMissingHardwareFault"] = reflect.TypeOf((*OvfMissingHardwareFault)(nil)).Elem() -} - -type OvfNetworkInfo struct { - DynamicData - - Name string `xml:"name"` - Description string `xml:"description"` -} - -func init() { - t["OvfNetworkInfo"] = reflect.TypeOf((*OvfNetworkInfo)(nil)).Elem() -} - -type OvfNetworkMapping struct { - DynamicData - - Name string `xml:"name"` - Network ManagedObjectReference `xml:"network"` -} - -func init() { - t["OvfNetworkMapping"] = reflect.TypeOf((*OvfNetworkMapping)(nil)).Elem() -} - -type OvfNetworkMappingNotSupported struct { - OvfImport -} - -func init() { - t["OvfNetworkMappingNotSupported"] = reflect.TypeOf((*OvfNetworkMappingNotSupported)(nil)).Elem() -} - -type OvfNetworkMappingNotSupportedFault OvfNetworkMappingNotSupported - -func init() { - t["OvfNetworkMappingNotSupportedFault"] = reflect.TypeOf((*OvfNetworkMappingNotSupportedFault)(nil)).Elem() -} - -type OvfNoHostNic struct { - OvfUnsupportedPackage -} - -func init() { - t["OvfNoHostNic"] = reflect.TypeOf((*OvfNoHostNic)(nil)).Elem() -} - -type OvfNoHostNicFault OvfNoHostNic - -func init() { - t["OvfNoHostNicFault"] = reflect.TypeOf((*OvfNoHostNicFault)(nil)).Elem() -} - -type OvfNoSpaceOnController struct { - OvfUnsupportedElement - - Parent string `xml:"parent"` -} - -func init() { - t["OvfNoSpaceOnController"] = reflect.TypeOf((*OvfNoSpaceOnController)(nil)).Elem() -} - -type OvfNoSpaceOnControllerFault OvfNoSpaceOnController - -func init() { - t["OvfNoSpaceOnControllerFault"] = reflect.TypeOf((*OvfNoSpaceOnControllerFault)(nil)).Elem() -} - -type OvfNoSupportedHardwareFamily struct { - OvfUnsupportedPackage - - Version string `xml:"version"` -} - -func init() { - t["OvfNoSupportedHardwareFamily"] = reflect.TypeOf((*OvfNoSupportedHardwareFamily)(nil)).Elem() -} - -type OvfNoSupportedHardwareFamilyFault OvfNoSupportedHardwareFamily - -func init() { - t["OvfNoSupportedHardwareFamilyFault"] = reflect.TypeOf((*OvfNoSupportedHardwareFamilyFault)(nil)).Elem() -} - -type OvfOptionInfo struct { - DynamicData - - Option string `xml:"option"` - Description LocalizableMessage `xml:"description"` -} - -func init() { - t["OvfOptionInfo"] = reflect.TypeOf((*OvfOptionInfo)(nil)).Elem() -} - -type OvfParseDescriptorParams struct { - OvfManagerCommonParams -} - -func init() { - t["OvfParseDescriptorParams"] = reflect.TypeOf((*OvfParseDescriptorParams)(nil)).Elem() -} - -type OvfParseDescriptorResult struct { - DynamicData - - Eula []string `xml:"eula,omitempty"` - Network []OvfNetworkInfo `xml:"network,omitempty"` - IpAllocationScheme []string `xml:"ipAllocationScheme,omitempty"` - IpProtocols []string `xml:"ipProtocols,omitempty"` - Property []VAppPropertyInfo `xml:"property,omitempty"` - ProductInfo *VAppProductInfo `xml:"productInfo,omitempty"` - Annotation string `xml:"annotation"` - ApproximateDownloadSize int64 `xml:"approximateDownloadSize,omitempty"` - ApproximateFlatDeploymentSize int64 `xml:"approximateFlatDeploymentSize,omitempty"` - ApproximateSparseDeploymentSize int64 `xml:"approximateSparseDeploymentSize,omitempty"` - DefaultEntityName string `xml:"defaultEntityName"` - VirtualApp bool `xml:"virtualApp"` - DeploymentOption []OvfDeploymentOption `xml:"deploymentOption,omitempty"` - DefaultDeploymentOption string `xml:"defaultDeploymentOption"` - EntityName []KeyValue `xml:"entityName,omitempty"` - AnnotatedOst *OvfConsumerOstNode `xml:"annotatedOst,omitempty"` - Error []LocalizedMethodFault `xml:"error,omitempty"` - Warning []LocalizedMethodFault `xml:"warning,omitempty"` -} - -func init() { - t["OvfParseDescriptorResult"] = reflect.TypeOf((*OvfParseDescriptorResult)(nil)).Elem() -} - -type OvfProperty struct { - OvfInvalidPackage - - Type string `xml:"type"` - Value string `xml:"value"` -} - -func init() { - t["OvfProperty"] = reflect.TypeOf((*OvfProperty)(nil)).Elem() -} - -type OvfPropertyExport struct { - OvfExport - - Type string `xml:"type"` - Value string `xml:"value"` -} - -func init() { - t["OvfPropertyExport"] = reflect.TypeOf((*OvfPropertyExport)(nil)).Elem() -} - -type OvfPropertyExportFault OvfPropertyExport - -func init() { - t["OvfPropertyExportFault"] = reflect.TypeOf((*OvfPropertyExportFault)(nil)).Elem() -} - -type OvfPropertyFault BaseOvfProperty - -func init() { - t["OvfPropertyFault"] = reflect.TypeOf((*OvfPropertyFault)(nil)).Elem() -} - -type OvfPropertyNetwork struct { - OvfProperty -} - -func init() { - t["OvfPropertyNetwork"] = reflect.TypeOf((*OvfPropertyNetwork)(nil)).Elem() -} - -type OvfPropertyNetworkExport struct { - OvfExport - - Network string `xml:"network"` -} - -func init() { - t["OvfPropertyNetworkExport"] = reflect.TypeOf((*OvfPropertyNetworkExport)(nil)).Elem() -} - -type OvfPropertyNetworkExportFault OvfPropertyNetworkExport - -func init() { - t["OvfPropertyNetworkExportFault"] = reflect.TypeOf((*OvfPropertyNetworkExportFault)(nil)).Elem() -} - -type OvfPropertyNetworkFault OvfPropertyNetwork - -func init() { - t["OvfPropertyNetworkFault"] = reflect.TypeOf((*OvfPropertyNetworkFault)(nil)).Elem() -} - -type OvfPropertyQualifier struct { - OvfProperty - - Qualifier string `xml:"qualifier"` -} - -func init() { - t["OvfPropertyQualifier"] = reflect.TypeOf((*OvfPropertyQualifier)(nil)).Elem() -} - -type OvfPropertyQualifierDuplicate struct { - OvfProperty - - Qualifier string `xml:"qualifier"` -} - -func init() { - t["OvfPropertyQualifierDuplicate"] = reflect.TypeOf((*OvfPropertyQualifierDuplicate)(nil)).Elem() -} - -type OvfPropertyQualifierDuplicateFault OvfPropertyQualifierDuplicate - -func init() { - t["OvfPropertyQualifierDuplicateFault"] = reflect.TypeOf((*OvfPropertyQualifierDuplicateFault)(nil)).Elem() -} - -type OvfPropertyQualifierFault OvfPropertyQualifier - -func init() { - t["OvfPropertyQualifierFault"] = reflect.TypeOf((*OvfPropertyQualifierFault)(nil)).Elem() -} - -type OvfPropertyQualifierIgnored struct { - OvfProperty - - Qualifier string `xml:"qualifier"` -} - -func init() { - t["OvfPropertyQualifierIgnored"] = reflect.TypeOf((*OvfPropertyQualifierIgnored)(nil)).Elem() -} - -type OvfPropertyQualifierIgnoredFault OvfPropertyQualifierIgnored - -func init() { - t["OvfPropertyQualifierIgnoredFault"] = reflect.TypeOf((*OvfPropertyQualifierIgnoredFault)(nil)).Elem() -} - -type OvfPropertyType struct { - OvfProperty -} - -func init() { - t["OvfPropertyType"] = reflect.TypeOf((*OvfPropertyType)(nil)).Elem() -} - -type OvfPropertyTypeFault OvfPropertyType - -func init() { - t["OvfPropertyTypeFault"] = reflect.TypeOf((*OvfPropertyTypeFault)(nil)).Elem() -} - -type OvfPropertyValue struct { - OvfProperty -} - -func init() { - t["OvfPropertyValue"] = reflect.TypeOf((*OvfPropertyValue)(nil)).Elem() -} - -type OvfPropertyValueFault OvfPropertyValue - -func init() { - t["OvfPropertyValueFault"] = reflect.TypeOf((*OvfPropertyValueFault)(nil)).Elem() -} - -type OvfResourceMap struct { - DynamicData - - Source string `xml:"source"` - Parent *ManagedObjectReference `xml:"parent,omitempty"` - ResourceSpec *ResourceConfigSpec `xml:"resourceSpec,omitempty"` - Datastore *ManagedObjectReference `xml:"datastore,omitempty"` -} - -func init() { - t["OvfResourceMap"] = reflect.TypeOf((*OvfResourceMap)(nil)).Elem() -} - -type OvfSystemFault struct { - OvfFault -} - -func init() { - t["OvfSystemFault"] = reflect.TypeOf((*OvfSystemFault)(nil)).Elem() -} - -type OvfSystemFaultFault BaseOvfSystemFault - -func init() { - t["OvfSystemFaultFault"] = reflect.TypeOf((*OvfSystemFaultFault)(nil)).Elem() -} - -type OvfToXmlUnsupportedElement struct { - OvfSystemFault - - Name string `xml:"name,omitempty"` -} - -func init() { - t["OvfToXmlUnsupportedElement"] = reflect.TypeOf((*OvfToXmlUnsupportedElement)(nil)).Elem() -} - -type OvfToXmlUnsupportedElementFault OvfToXmlUnsupportedElement - -func init() { - t["OvfToXmlUnsupportedElementFault"] = reflect.TypeOf((*OvfToXmlUnsupportedElementFault)(nil)).Elem() -} - -type OvfUnableToExportDisk struct { - OvfHardwareExport - - DiskName string `xml:"diskName"` -} - -func init() { - t["OvfUnableToExportDisk"] = reflect.TypeOf((*OvfUnableToExportDisk)(nil)).Elem() -} - -type OvfUnableToExportDiskFault OvfUnableToExportDisk - -func init() { - t["OvfUnableToExportDiskFault"] = reflect.TypeOf((*OvfUnableToExportDiskFault)(nil)).Elem() -} - -type OvfUnexpectedElement struct { - OvfElement -} - -func init() { - t["OvfUnexpectedElement"] = reflect.TypeOf((*OvfUnexpectedElement)(nil)).Elem() -} - -type OvfUnexpectedElementFault OvfUnexpectedElement - -func init() { - t["OvfUnexpectedElementFault"] = reflect.TypeOf((*OvfUnexpectedElementFault)(nil)).Elem() -} - -type OvfUnknownDevice struct { - OvfSystemFault - - Device BaseVirtualDevice `xml:"device,omitempty,typeattr"` - VmName string `xml:"vmName"` -} - -func init() { - t["OvfUnknownDevice"] = reflect.TypeOf((*OvfUnknownDevice)(nil)).Elem() -} - -type OvfUnknownDeviceBacking struct { - OvfHardwareExport - - Backing BaseVirtualDeviceBackingInfo `xml:"backing,typeattr"` -} - -func init() { - t["OvfUnknownDeviceBacking"] = reflect.TypeOf((*OvfUnknownDeviceBacking)(nil)).Elem() -} - -type OvfUnknownDeviceBackingFault OvfUnknownDeviceBacking - -func init() { - t["OvfUnknownDeviceBackingFault"] = reflect.TypeOf((*OvfUnknownDeviceBackingFault)(nil)).Elem() -} - -type OvfUnknownDeviceFault OvfUnknownDevice - -func init() { - t["OvfUnknownDeviceFault"] = reflect.TypeOf((*OvfUnknownDeviceFault)(nil)).Elem() -} - -type OvfUnknownEntity struct { - OvfSystemFault - - LineNumber int `xml:"lineNumber"` -} - -func init() { - t["OvfUnknownEntity"] = reflect.TypeOf((*OvfUnknownEntity)(nil)).Elem() -} - -type OvfUnknownEntityFault OvfUnknownEntity - -func init() { - t["OvfUnknownEntityFault"] = reflect.TypeOf((*OvfUnknownEntityFault)(nil)).Elem() -} - -type OvfUnsupportedAttribute struct { - OvfUnsupportedPackage - - ElementName string `xml:"elementName"` - AttributeName string `xml:"attributeName"` -} - -func init() { - t["OvfUnsupportedAttribute"] = reflect.TypeOf((*OvfUnsupportedAttribute)(nil)).Elem() -} - -type OvfUnsupportedAttributeFault BaseOvfUnsupportedAttribute - -func init() { - t["OvfUnsupportedAttributeFault"] = reflect.TypeOf((*OvfUnsupportedAttributeFault)(nil)).Elem() -} - -type OvfUnsupportedAttributeValue struct { - OvfUnsupportedAttribute - - Value string `xml:"value"` -} - -func init() { - t["OvfUnsupportedAttributeValue"] = reflect.TypeOf((*OvfUnsupportedAttributeValue)(nil)).Elem() -} - -type OvfUnsupportedAttributeValueFault OvfUnsupportedAttributeValue - -func init() { - t["OvfUnsupportedAttributeValueFault"] = reflect.TypeOf((*OvfUnsupportedAttributeValueFault)(nil)).Elem() -} - -type OvfUnsupportedDeviceBackingInfo struct { - OvfSystemFault - - ElementName string `xml:"elementName,omitempty"` - InstanceId string `xml:"instanceId,omitempty"` - DeviceName string `xml:"deviceName"` - BackingName string `xml:"backingName,omitempty"` -} - -func init() { - t["OvfUnsupportedDeviceBackingInfo"] = reflect.TypeOf((*OvfUnsupportedDeviceBackingInfo)(nil)).Elem() -} - -type OvfUnsupportedDeviceBackingInfoFault OvfUnsupportedDeviceBackingInfo - -func init() { - t["OvfUnsupportedDeviceBackingInfoFault"] = reflect.TypeOf((*OvfUnsupportedDeviceBackingInfoFault)(nil)).Elem() -} - -type OvfUnsupportedDeviceBackingOption struct { - OvfSystemFault - - ElementName string `xml:"elementName,omitempty"` - InstanceId string `xml:"instanceId,omitempty"` - DeviceName string `xml:"deviceName"` - BackingName string `xml:"backingName,omitempty"` -} - -func init() { - t["OvfUnsupportedDeviceBackingOption"] = reflect.TypeOf((*OvfUnsupportedDeviceBackingOption)(nil)).Elem() -} - -type OvfUnsupportedDeviceBackingOptionFault OvfUnsupportedDeviceBackingOption - -func init() { - t["OvfUnsupportedDeviceBackingOptionFault"] = reflect.TypeOf((*OvfUnsupportedDeviceBackingOptionFault)(nil)).Elem() -} - -type OvfUnsupportedDeviceExport struct { - OvfHardwareExport -} - -func init() { - t["OvfUnsupportedDeviceExport"] = reflect.TypeOf((*OvfUnsupportedDeviceExport)(nil)).Elem() -} - -type OvfUnsupportedDeviceExportFault OvfUnsupportedDeviceExport - -func init() { - t["OvfUnsupportedDeviceExportFault"] = reflect.TypeOf((*OvfUnsupportedDeviceExportFault)(nil)).Elem() -} - -type OvfUnsupportedDiskProvisioning struct { - OvfImport - - DiskProvisioning string `xml:"diskProvisioning"` - SupportedDiskProvisioning string `xml:"supportedDiskProvisioning"` -} - -func init() { - t["OvfUnsupportedDiskProvisioning"] = reflect.TypeOf((*OvfUnsupportedDiskProvisioning)(nil)).Elem() -} - -type OvfUnsupportedDiskProvisioningFault OvfUnsupportedDiskProvisioning - -func init() { - t["OvfUnsupportedDiskProvisioningFault"] = reflect.TypeOf((*OvfUnsupportedDiskProvisioningFault)(nil)).Elem() -} - -type OvfUnsupportedElement struct { - OvfUnsupportedPackage - - Name string `xml:"name"` -} - -func init() { - t["OvfUnsupportedElement"] = reflect.TypeOf((*OvfUnsupportedElement)(nil)).Elem() -} - -type OvfUnsupportedElementFault BaseOvfUnsupportedElement - -func init() { - t["OvfUnsupportedElementFault"] = reflect.TypeOf((*OvfUnsupportedElementFault)(nil)).Elem() -} - -type OvfUnsupportedElementValue struct { - OvfUnsupportedElement - - Value string `xml:"value"` -} - -func init() { - t["OvfUnsupportedElementValue"] = reflect.TypeOf((*OvfUnsupportedElementValue)(nil)).Elem() -} - -type OvfUnsupportedElementValueFault OvfUnsupportedElementValue - -func init() { - t["OvfUnsupportedElementValueFault"] = reflect.TypeOf((*OvfUnsupportedElementValueFault)(nil)).Elem() -} - -type OvfUnsupportedPackage struct { - OvfFault - - LineNumber int `xml:"lineNumber,omitempty"` -} - -func init() { - t["OvfUnsupportedPackage"] = reflect.TypeOf((*OvfUnsupportedPackage)(nil)).Elem() -} - -type OvfUnsupportedPackageFault BaseOvfUnsupportedPackage - -func init() { - t["OvfUnsupportedPackageFault"] = reflect.TypeOf((*OvfUnsupportedPackageFault)(nil)).Elem() -} - -type OvfUnsupportedSection struct { - OvfUnsupportedElement - - Info string `xml:"info"` -} - -func init() { - t["OvfUnsupportedSection"] = reflect.TypeOf((*OvfUnsupportedSection)(nil)).Elem() -} - -type OvfUnsupportedSectionFault OvfUnsupportedSection - -func init() { - t["OvfUnsupportedSectionFault"] = reflect.TypeOf((*OvfUnsupportedSectionFault)(nil)).Elem() -} - -type OvfUnsupportedSubType struct { - OvfUnsupportedPackage - - ElementName string `xml:"elementName"` - InstanceId string `xml:"instanceId"` - DeviceType int `xml:"deviceType"` - DeviceSubType string `xml:"deviceSubType"` -} - -func init() { - t["OvfUnsupportedSubType"] = reflect.TypeOf((*OvfUnsupportedSubType)(nil)).Elem() -} - -type OvfUnsupportedSubTypeFault OvfUnsupportedSubType - -func init() { - t["OvfUnsupportedSubTypeFault"] = reflect.TypeOf((*OvfUnsupportedSubTypeFault)(nil)).Elem() -} - -type OvfUnsupportedType struct { - OvfUnsupportedPackage - - Name string `xml:"name"` - InstanceId string `xml:"instanceId"` - DeviceType int `xml:"deviceType"` -} - -func init() { - t["OvfUnsupportedType"] = reflect.TypeOf((*OvfUnsupportedType)(nil)).Elem() -} - -type OvfUnsupportedTypeFault OvfUnsupportedType - -func init() { - t["OvfUnsupportedTypeFault"] = reflect.TypeOf((*OvfUnsupportedTypeFault)(nil)).Elem() -} - -type OvfValidateHostParams struct { - OvfManagerCommonParams -} - -func init() { - t["OvfValidateHostParams"] = reflect.TypeOf((*OvfValidateHostParams)(nil)).Elem() -} - -type OvfValidateHostResult struct { - DynamicData - - DownloadSize int64 `xml:"downloadSize,omitempty"` - FlatDeploymentSize int64 `xml:"flatDeploymentSize,omitempty"` - SparseDeploymentSize int64 `xml:"sparseDeploymentSize,omitempty"` - Error []LocalizedMethodFault `xml:"error,omitempty"` - Warning []LocalizedMethodFault `xml:"warning,omitempty"` - SupportedDiskProvisioning []string `xml:"supportedDiskProvisioning,omitempty"` -} - -func init() { - t["OvfValidateHostResult"] = reflect.TypeOf((*OvfValidateHostResult)(nil)).Elem() -} - -type OvfWrongElement struct { - OvfElement -} - -func init() { - t["OvfWrongElement"] = reflect.TypeOf((*OvfWrongElement)(nil)).Elem() -} - -type OvfWrongElementFault OvfWrongElement - -func init() { - t["OvfWrongElementFault"] = reflect.TypeOf((*OvfWrongElementFault)(nil)).Elem() -} - -type OvfWrongNamespace struct { - OvfInvalidPackage - - NamespaceName string `xml:"namespaceName"` -} - -func init() { - t["OvfWrongNamespace"] = reflect.TypeOf((*OvfWrongNamespace)(nil)).Elem() -} - -type OvfWrongNamespaceFault OvfWrongNamespace - -func init() { - t["OvfWrongNamespaceFault"] = reflect.TypeOf((*OvfWrongNamespaceFault)(nil)).Elem() -} - -type OvfXmlFormat struct { - OvfInvalidPackage - - Description string `xml:"description"` -} - -func init() { - t["OvfXmlFormat"] = reflect.TypeOf((*OvfXmlFormat)(nil)).Elem() -} - -type OvfXmlFormatFault OvfXmlFormat - -func init() { - t["OvfXmlFormatFault"] = reflect.TypeOf((*OvfXmlFormatFault)(nil)).Elem() -} - -type ParaVirtualSCSIController struct { - VirtualSCSIController -} - -func init() { - t["ParaVirtualSCSIController"] = reflect.TypeOf((*ParaVirtualSCSIController)(nil)).Elem() -} - -type ParaVirtualSCSIControllerOption struct { - VirtualSCSIControllerOption -} - -func init() { - t["ParaVirtualSCSIControllerOption"] = reflect.TypeOf((*ParaVirtualSCSIControllerOption)(nil)).Elem() -} - -type ParseDescriptor ParseDescriptorRequestType - -func init() { - t["ParseDescriptor"] = reflect.TypeOf((*ParseDescriptor)(nil)).Elem() -} - -type ParseDescriptorRequestType struct { - This ManagedObjectReference `xml:"_this"` - OvfDescriptor string `xml:"ovfDescriptor"` - Pdp OvfParseDescriptorParams `xml:"pdp"` -} - -func init() { - t["ParseDescriptorRequestType"] = reflect.TypeOf((*ParseDescriptorRequestType)(nil)).Elem() -} - -type ParseDescriptorResponse struct { - Returnval OvfParseDescriptorResult `xml:"returnval"` -} - -type PasswordField struct { - DynamicData - - Value string `xml:"value"` -} - -func init() { - t["PasswordField"] = reflect.TypeOf((*PasswordField)(nil)).Elem() -} - -type PatchAlreadyInstalled struct { - PatchNotApplicable -} - -func init() { - t["PatchAlreadyInstalled"] = reflect.TypeOf((*PatchAlreadyInstalled)(nil)).Elem() -} - -type PatchAlreadyInstalledFault PatchAlreadyInstalled - -func init() { - t["PatchAlreadyInstalledFault"] = reflect.TypeOf((*PatchAlreadyInstalledFault)(nil)).Elem() -} - -type PatchBinariesNotFound struct { - VimFault - - PatchID string `xml:"patchID"` - Binary []string `xml:"binary,omitempty"` -} - -func init() { - t["PatchBinariesNotFound"] = reflect.TypeOf((*PatchBinariesNotFound)(nil)).Elem() -} - -type PatchBinariesNotFoundFault PatchBinariesNotFound - -func init() { - t["PatchBinariesNotFoundFault"] = reflect.TypeOf((*PatchBinariesNotFoundFault)(nil)).Elem() -} - -type PatchInstallFailed struct { - PlatformConfigFault - - RolledBack bool `xml:"rolledBack"` -} - -func init() { - t["PatchInstallFailed"] = reflect.TypeOf((*PatchInstallFailed)(nil)).Elem() -} - -type PatchInstallFailedFault PatchInstallFailed - -func init() { - t["PatchInstallFailedFault"] = reflect.TypeOf((*PatchInstallFailedFault)(nil)).Elem() -} - -type PatchIntegrityError struct { - PlatformConfigFault -} - -func init() { - t["PatchIntegrityError"] = reflect.TypeOf((*PatchIntegrityError)(nil)).Elem() -} - -type PatchIntegrityErrorFault PatchIntegrityError - -func init() { - t["PatchIntegrityErrorFault"] = reflect.TypeOf((*PatchIntegrityErrorFault)(nil)).Elem() -} - -type PatchMetadataCorrupted struct { - PatchMetadataInvalid -} - -func init() { - t["PatchMetadataCorrupted"] = reflect.TypeOf((*PatchMetadataCorrupted)(nil)).Elem() -} - -type PatchMetadataCorruptedFault PatchMetadataCorrupted - -func init() { - t["PatchMetadataCorruptedFault"] = reflect.TypeOf((*PatchMetadataCorruptedFault)(nil)).Elem() -} - -type PatchMetadataInvalid struct { - VimFault - - PatchID string `xml:"patchID"` - MetaData []string `xml:"metaData,omitempty"` -} - -func init() { - t["PatchMetadataInvalid"] = reflect.TypeOf((*PatchMetadataInvalid)(nil)).Elem() -} - -type PatchMetadataInvalidFault BasePatchMetadataInvalid - -func init() { - t["PatchMetadataInvalidFault"] = reflect.TypeOf((*PatchMetadataInvalidFault)(nil)).Elem() -} - -type PatchMetadataNotFound struct { - PatchMetadataInvalid -} - -func init() { - t["PatchMetadataNotFound"] = reflect.TypeOf((*PatchMetadataNotFound)(nil)).Elem() -} - -type PatchMetadataNotFoundFault PatchMetadataNotFound - -func init() { - t["PatchMetadataNotFoundFault"] = reflect.TypeOf((*PatchMetadataNotFoundFault)(nil)).Elem() -} - -type PatchMissingDependencies struct { - PatchNotApplicable - - PrerequisitePatch []string `xml:"prerequisitePatch,omitempty"` - PrerequisiteLib []string `xml:"prerequisiteLib,omitempty"` -} - -func init() { - t["PatchMissingDependencies"] = reflect.TypeOf((*PatchMissingDependencies)(nil)).Elem() -} - -type PatchMissingDependenciesFault PatchMissingDependencies - -func init() { - t["PatchMissingDependenciesFault"] = reflect.TypeOf((*PatchMissingDependenciesFault)(nil)).Elem() -} - -type PatchNotApplicable struct { - VimFault - - PatchID string `xml:"patchID"` -} - -func init() { - t["PatchNotApplicable"] = reflect.TypeOf((*PatchNotApplicable)(nil)).Elem() -} - -type PatchNotApplicableFault BasePatchNotApplicable - -func init() { - t["PatchNotApplicableFault"] = reflect.TypeOf((*PatchNotApplicableFault)(nil)).Elem() -} - -type PatchSuperseded struct { - PatchNotApplicable - - Supersede []string `xml:"supersede,omitempty"` -} - -func init() { - t["PatchSuperseded"] = reflect.TypeOf((*PatchSuperseded)(nil)).Elem() -} - -type PatchSupersededFault PatchSuperseded - -func init() { - t["PatchSupersededFault"] = reflect.TypeOf((*PatchSupersededFault)(nil)).Elem() -} - -type PerfCompositeMetric struct { - DynamicData - - Entity BasePerfEntityMetricBase `xml:"entity,omitempty,typeattr"` - ChildEntity []BasePerfEntityMetricBase `xml:"childEntity,omitempty,typeattr"` -} - -func init() { - t["PerfCompositeMetric"] = reflect.TypeOf((*PerfCompositeMetric)(nil)).Elem() -} - -type PerfCounterInfo struct { - DynamicData - - Key int `xml:"key"` - NameInfo BaseElementDescription `xml:"nameInfo,typeattr"` - GroupInfo BaseElementDescription `xml:"groupInfo,typeattr"` - UnitInfo BaseElementDescription `xml:"unitInfo,typeattr"` - RollupType PerfSummaryType `xml:"rollupType"` - StatsType PerfStatsType `xml:"statsType"` - Level int `xml:"level,omitempty"` - PerDeviceLevel int `xml:"perDeviceLevel,omitempty"` - AssociatedCounterId []int `xml:"associatedCounterId,omitempty"` -} - -func init() { - t["PerfCounterInfo"] = reflect.TypeOf((*PerfCounterInfo)(nil)).Elem() -} - -type PerfEntityMetric struct { - PerfEntityMetricBase - - SampleInfo []PerfSampleInfo `xml:"sampleInfo,omitempty"` - Value []BasePerfMetricSeries `xml:"value,omitempty,typeattr"` -} - -func init() { - t["PerfEntityMetric"] = reflect.TypeOf((*PerfEntityMetric)(nil)).Elem() -} - -type PerfEntityMetricBase struct { - DynamicData - - Entity ManagedObjectReference `xml:"entity"` -} - -func init() { - t["PerfEntityMetricBase"] = reflect.TypeOf((*PerfEntityMetricBase)(nil)).Elem() -} - -type PerfEntityMetricCSV struct { - PerfEntityMetricBase - - SampleInfoCSV string `xml:"sampleInfoCSV"` - Value []PerfMetricSeriesCSV `xml:"value,omitempty"` -} - -func init() { - t["PerfEntityMetricCSV"] = reflect.TypeOf((*PerfEntityMetricCSV)(nil)).Elem() -} - -type PerfInterval struct { - DynamicData - - Key int `xml:"key"` - SamplingPeriod int `xml:"samplingPeriod"` - Name string `xml:"name"` - Length int `xml:"length"` - Level int `xml:"level,omitempty"` - Enabled bool `xml:"enabled"` -} - -func init() { - t["PerfInterval"] = reflect.TypeOf((*PerfInterval)(nil)).Elem() -} - -type PerfMetricId struct { - DynamicData - - CounterId int `xml:"counterId"` - Instance string `xml:"instance"` -} - -func init() { - t["PerfMetricId"] = reflect.TypeOf((*PerfMetricId)(nil)).Elem() -} - -type PerfMetricIntSeries struct { - PerfMetricSeries - - Value []int64 `xml:"value,omitempty"` -} - -func init() { - t["PerfMetricIntSeries"] = reflect.TypeOf((*PerfMetricIntSeries)(nil)).Elem() -} - -type PerfMetricSeries struct { - DynamicData - - Id PerfMetricId `xml:"id"` -} - -func init() { - t["PerfMetricSeries"] = reflect.TypeOf((*PerfMetricSeries)(nil)).Elem() -} - -type PerfMetricSeriesCSV struct { - PerfMetricSeries - - Value string `xml:"value,omitempty"` -} - -func init() { - t["PerfMetricSeriesCSV"] = reflect.TypeOf((*PerfMetricSeriesCSV)(nil)).Elem() -} - -type PerfProviderSummary struct { - DynamicData - - Entity ManagedObjectReference `xml:"entity"` - CurrentSupported bool `xml:"currentSupported"` - SummarySupported bool `xml:"summarySupported"` - RefreshRate int `xml:"refreshRate,omitempty"` -} - -func init() { - t["PerfProviderSummary"] = reflect.TypeOf((*PerfProviderSummary)(nil)).Elem() -} - -type PerfQuerySpec struct { - DynamicData - - Entity ManagedObjectReference `xml:"entity"` - StartTime *time.Time `xml:"startTime"` - EndTime *time.Time `xml:"endTime"` - MaxSample int `xml:"maxSample,omitempty"` - MetricId []PerfMetricId `xml:"metricId,omitempty"` - IntervalId int `xml:"intervalId,omitempty"` - Format string `xml:"format,omitempty"` -} - -func init() { - t["PerfQuerySpec"] = reflect.TypeOf((*PerfQuerySpec)(nil)).Elem() -} - -type PerfSampleInfo struct { - DynamicData - - Timestamp time.Time `xml:"timestamp"` - Interval int `xml:"interval"` -} - -func init() { - t["PerfSampleInfo"] = reflect.TypeOf((*PerfSampleInfo)(nil)).Elem() -} - -type PerformDvsProductSpecOperationRequestType struct { - This ManagedObjectReference `xml:"_this"` - Operation string `xml:"operation"` - ProductSpec *DistributedVirtualSwitchProductSpec `xml:"productSpec,omitempty"` -} - -func init() { - t["PerformDvsProductSpecOperationRequestType"] = reflect.TypeOf((*PerformDvsProductSpecOperationRequestType)(nil)).Elem() -} - -type PerformDvsProductSpecOperation_Task PerformDvsProductSpecOperationRequestType - -func init() { - t["PerformDvsProductSpecOperation_Task"] = reflect.TypeOf((*PerformDvsProductSpecOperation_Task)(nil)).Elem() -} - -type PerformDvsProductSpecOperation_TaskResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type PerformanceDescription struct { - DynamicData - - CounterType []BaseElementDescription `xml:"counterType,typeattr"` - StatsType []BaseElementDescription `xml:"statsType,typeattr"` -} - -func init() { - t["PerformanceDescription"] = reflect.TypeOf((*PerformanceDescription)(nil)).Elem() -} - -type PerformanceManagerCounterLevelMapping struct { - DynamicData - - CounterId int `xml:"counterId"` - AggregateLevel int `xml:"aggregateLevel,omitempty"` - PerDeviceLevel int `xml:"perDeviceLevel,omitempty"` -} - -func init() { - t["PerformanceManagerCounterLevelMapping"] = reflect.TypeOf((*PerformanceManagerCounterLevelMapping)(nil)).Elem() -} - -type PerformanceStatisticsDescription struct { - DynamicData - - Intervals []PerfInterval `xml:"intervals,omitempty"` -} - -func init() { - t["PerformanceStatisticsDescription"] = reflect.TypeOf((*PerformanceStatisticsDescription)(nil)).Elem() -} - -type Permission struct { - DynamicData - - Entity *ManagedObjectReference `xml:"entity,omitempty"` - Principal string `xml:"principal"` - Group bool `xml:"group"` - RoleId int `xml:"roleId"` - Propagate bool `xml:"propagate"` -} - -func init() { - t["Permission"] = reflect.TypeOf((*Permission)(nil)).Elem() -} - -type PermissionAddedEvent struct { - PermissionEvent - - Role RoleEventArgument `xml:"role"` - Propagate bool `xml:"propagate"` -} - -func init() { - t["PermissionAddedEvent"] = reflect.TypeOf((*PermissionAddedEvent)(nil)).Elem() -} - -type PermissionEvent struct { - AuthorizationEvent - - Entity ManagedEntityEventArgument `xml:"entity"` - Principal string `xml:"principal"` - Group bool `xml:"group"` -} - -func init() { - t["PermissionEvent"] = reflect.TypeOf((*PermissionEvent)(nil)).Elem() -} - -type PermissionProfile struct { - ApplyProfile - - Key string `xml:"key"` -} - -func init() { - t["PermissionProfile"] = reflect.TypeOf((*PermissionProfile)(nil)).Elem() -} - -type PermissionRemovedEvent struct { - PermissionEvent -} - -func init() { - t["PermissionRemovedEvent"] = reflect.TypeOf((*PermissionRemovedEvent)(nil)).Elem() -} - -type PermissionUpdatedEvent struct { - PermissionEvent - - Role RoleEventArgument `xml:"role"` - Propagate bool `xml:"propagate"` -} - -func init() { - t["PermissionUpdatedEvent"] = reflect.TypeOf((*PermissionUpdatedEvent)(nil)).Elem() -} - -type PhysCompatRDMNotSupported struct { - RDMNotSupported -} - -func init() { - t["PhysCompatRDMNotSupported"] = reflect.TypeOf((*PhysCompatRDMNotSupported)(nil)).Elem() -} - -type PhysCompatRDMNotSupportedFault PhysCompatRDMNotSupported - -func init() { - t["PhysCompatRDMNotSupportedFault"] = reflect.TypeOf((*PhysCompatRDMNotSupportedFault)(nil)).Elem() -} - -type PhysicalNic struct { - DynamicData - - Key string `xml:"key,omitempty"` - Device string `xml:"device"` - Pci string `xml:"pci"` - Driver string `xml:"driver,omitempty"` - LinkSpeed *PhysicalNicLinkInfo `xml:"linkSpeed,omitempty"` - ValidLinkSpecification []PhysicalNicLinkInfo `xml:"validLinkSpecification,omitempty"` - Spec PhysicalNicSpec `xml:"spec"` - WakeOnLanSupported bool `xml:"wakeOnLanSupported"` - Mac string `xml:"mac"` - FcoeConfiguration *FcoeConfig `xml:"fcoeConfiguration,omitempty"` - VmDirectPathGen2Supported *bool `xml:"vmDirectPathGen2Supported"` - VmDirectPathGen2SupportedMode string `xml:"vmDirectPathGen2SupportedMode,omitempty"` - ResourcePoolSchedulerAllowed *bool `xml:"resourcePoolSchedulerAllowed"` - ResourcePoolSchedulerDisallowedReason []string `xml:"resourcePoolSchedulerDisallowedReason,omitempty"` - AutoNegotiateSupported *bool `xml:"autoNegotiateSupported"` -} - -func init() { - t["PhysicalNic"] = reflect.TypeOf((*PhysicalNic)(nil)).Elem() -} - -type PhysicalNicCdpDeviceCapability struct { - DynamicData - - Router bool `xml:"router"` - TransparentBridge bool `xml:"transparentBridge"` - SourceRouteBridge bool `xml:"sourceRouteBridge"` - NetworkSwitch bool `xml:"networkSwitch"` - Host bool `xml:"host"` - IgmpEnabled bool `xml:"igmpEnabled"` - Repeater bool `xml:"repeater"` -} - -func init() { - t["PhysicalNicCdpDeviceCapability"] = reflect.TypeOf((*PhysicalNicCdpDeviceCapability)(nil)).Elem() -} - -type PhysicalNicCdpInfo struct { - DynamicData - - CdpVersion int `xml:"cdpVersion,omitempty"` - Timeout int `xml:"timeout,omitempty"` - Ttl int `xml:"ttl,omitempty"` - Samples int `xml:"samples,omitempty"` - DevId string `xml:"devId,omitempty"` - Address string `xml:"address,omitempty"` - PortId string `xml:"portId,omitempty"` - DeviceCapability *PhysicalNicCdpDeviceCapability `xml:"deviceCapability,omitempty"` - SoftwareVersion string `xml:"softwareVersion,omitempty"` - HardwarePlatform string `xml:"hardwarePlatform,omitempty"` - IpPrefix string `xml:"ipPrefix,omitempty"` - IpPrefixLen int `xml:"ipPrefixLen,omitempty"` - Vlan int `xml:"vlan,omitempty"` - FullDuplex *bool `xml:"fullDuplex"` - Mtu int `xml:"mtu,omitempty"` - SystemName string `xml:"systemName,omitempty"` - SystemOID string `xml:"systemOID,omitempty"` - MgmtAddr string `xml:"mgmtAddr,omitempty"` - Location string `xml:"location,omitempty"` -} - -func init() { - t["PhysicalNicCdpInfo"] = reflect.TypeOf((*PhysicalNicCdpInfo)(nil)).Elem() -} - -type PhysicalNicConfig struct { - DynamicData - - Device string `xml:"device"` - Spec PhysicalNicSpec `xml:"spec"` -} - -func init() { - t["PhysicalNicConfig"] = reflect.TypeOf((*PhysicalNicConfig)(nil)).Elem() -} - -type PhysicalNicHint struct { - DynamicData - - VlanId int `xml:"vlanId,omitempty"` -} - -func init() { - t["PhysicalNicHint"] = reflect.TypeOf((*PhysicalNicHint)(nil)).Elem() -} - -type PhysicalNicHintInfo struct { - DynamicData - - Device string `xml:"device"` - Subnet []PhysicalNicIpHint `xml:"subnet,omitempty"` - Network []PhysicalNicNameHint `xml:"network,omitempty"` - ConnectedSwitchPort *PhysicalNicCdpInfo `xml:"connectedSwitchPort,omitempty"` - LldpInfo *LinkLayerDiscoveryProtocolInfo `xml:"lldpInfo,omitempty"` -} - -func init() { - t["PhysicalNicHintInfo"] = reflect.TypeOf((*PhysicalNicHintInfo)(nil)).Elem() -} - -type PhysicalNicIpHint struct { - PhysicalNicHint - - IpSubnet string `xml:"ipSubnet"` -} - -func init() { - t["PhysicalNicIpHint"] = reflect.TypeOf((*PhysicalNicIpHint)(nil)).Elem() -} - -type PhysicalNicLinkInfo struct { - DynamicData - - SpeedMb int `xml:"speedMb"` - Duplex bool `xml:"duplex"` -} - -func init() { - t["PhysicalNicLinkInfo"] = reflect.TypeOf((*PhysicalNicLinkInfo)(nil)).Elem() -} - -type PhysicalNicNameHint struct { - PhysicalNicHint - - Network string `xml:"network"` -} - -func init() { - t["PhysicalNicNameHint"] = reflect.TypeOf((*PhysicalNicNameHint)(nil)).Elem() -} - -type PhysicalNicProfile struct { - ApplyProfile - - Key string `xml:"key"` -} - -func init() { - t["PhysicalNicProfile"] = reflect.TypeOf((*PhysicalNicProfile)(nil)).Elem() -} - -type PhysicalNicSpec struct { - DynamicData - - Ip *HostIpConfig `xml:"ip,omitempty"` - LinkSpeed *PhysicalNicLinkInfo `xml:"linkSpeed,omitempty"` -} - -func init() { - t["PhysicalNicSpec"] = reflect.TypeOf((*PhysicalNicSpec)(nil)).Elem() -} - -type PlatformConfigFault struct { - HostConfigFault - - Text string `xml:"text"` -} - -func init() { - t["PlatformConfigFault"] = reflect.TypeOf((*PlatformConfigFault)(nil)).Elem() -} - -type PlatformConfigFaultFault BasePlatformConfigFault - -func init() { - t["PlatformConfigFaultFault"] = reflect.TypeOf((*PlatformConfigFaultFault)(nil)).Elem() -} - -type PnicUplinkProfile struct { - ApplyProfile - - Key string `xml:"key"` -} - -func init() { - t["PnicUplinkProfile"] = reflect.TypeOf((*PnicUplinkProfile)(nil)).Elem() -} - -type PodDiskLocator struct { - DynamicData - - DiskId int `xml:"diskId"` - DiskMoveType string `xml:"diskMoveType,omitempty"` - DiskBackingInfo BaseVirtualDeviceBackingInfo `xml:"diskBackingInfo,omitempty,typeattr"` - Profile []BaseVirtualMachineProfileSpec `xml:"profile,omitempty,typeattr"` -} - -func init() { - t["PodDiskLocator"] = reflect.TypeOf((*PodDiskLocator)(nil)).Elem() -} - -type PodStorageDrsEntry struct { - DynamicData - - StorageDrsConfig StorageDrsConfigInfo `xml:"storageDrsConfig"` - Recommendation []ClusterRecommendation `xml:"recommendation,omitempty"` - DrsFault []ClusterDrsFaults `xml:"drsFault,omitempty"` - ActionHistory []ClusterActionHistory `xml:"actionHistory,omitempty"` -} - -func init() { - t["PodStorageDrsEntry"] = reflect.TypeOf((*PodStorageDrsEntry)(nil)).Elem() -} - -type PolicyOption struct { - DynamicData - - Id string `xml:"id"` - Parameter []KeyAnyValue `xml:"parameter,omitempty"` -} - -func init() { - t["PolicyOption"] = reflect.TypeOf((*PolicyOption)(nil)).Elem() -} - -type PortGroupProfile struct { - ApplyProfile - - Key string `xml:"key"` - Name string `xml:"name"` - Vlan VlanProfile `xml:"vlan"` - Vswitch VirtualSwitchSelectionProfile `xml:"vswitch"` - NetworkPolicy NetworkPolicyProfile `xml:"networkPolicy"` -} - -func init() { - t["PortGroupProfile"] = reflect.TypeOf((*PortGroupProfile)(nil)).Elem() -} - -type PosixUserSearchResult struct { - UserSearchResult - - Id int `xml:"id"` - ShellAccess *bool `xml:"shellAccess"` -} - -func init() { - t["PosixUserSearchResult"] = reflect.TypeOf((*PosixUserSearchResult)(nil)).Elem() -} - -type PostEvent PostEventRequestType - -func init() { - t["PostEvent"] = reflect.TypeOf((*PostEvent)(nil)).Elem() -} - -type PostEventRequestType struct { - This ManagedObjectReference `xml:"_this"` - EventToPost BaseEvent `xml:"eventToPost,typeattr"` - TaskInfo *TaskInfo `xml:"taskInfo,omitempty"` -} - -func init() { - t["PostEventRequestType"] = reflect.TypeOf((*PostEventRequestType)(nil)).Elem() -} - -type PostEventResponse struct { -} - -type PowerDownHostToStandByRequestType struct { - This ManagedObjectReference `xml:"_this"` - TimeoutSec int `xml:"timeoutSec"` - EvacuatePoweredOffVms *bool `xml:"evacuatePoweredOffVms"` -} - -func init() { - t["PowerDownHostToStandByRequestType"] = reflect.TypeOf((*PowerDownHostToStandByRequestType)(nil)).Elem() -} - -type PowerDownHostToStandBy_Task PowerDownHostToStandByRequestType - -func init() { - t["PowerDownHostToStandBy_Task"] = reflect.TypeOf((*PowerDownHostToStandBy_Task)(nil)).Elem() -} - -type PowerDownHostToStandBy_TaskResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type PowerOffVAppRequestType struct { - This ManagedObjectReference `xml:"_this"` - Force bool `xml:"force"` -} - -func init() { - t["PowerOffVAppRequestType"] = reflect.TypeOf((*PowerOffVAppRequestType)(nil)).Elem() -} - -type PowerOffVApp_Task PowerOffVAppRequestType - -func init() { - t["PowerOffVApp_Task"] = reflect.TypeOf((*PowerOffVApp_Task)(nil)).Elem() -} - -type PowerOffVApp_TaskResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type PowerOffVMRequestType struct { - This ManagedObjectReference `xml:"_this"` -} - -func init() { - t["PowerOffVMRequestType"] = reflect.TypeOf((*PowerOffVMRequestType)(nil)).Elem() -} - -type PowerOffVM_Task PowerOffVMRequestType - -func init() { - t["PowerOffVM_Task"] = reflect.TypeOf((*PowerOffVM_Task)(nil)).Elem() -} - -type PowerOffVM_TaskResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type PowerOnFtSecondaryFailed struct { - VmFaultToleranceIssue - - Vm ManagedObjectReference `xml:"vm"` - VmName string `xml:"vmName"` - HostSelectionBy FtIssuesOnHostHostSelectionType `xml:"hostSelectionBy"` - HostErrors []LocalizedMethodFault `xml:"hostErrors,omitempty"` - RootCause LocalizedMethodFault `xml:"rootCause"` -} - -func init() { - t["PowerOnFtSecondaryFailed"] = reflect.TypeOf((*PowerOnFtSecondaryFailed)(nil)).Elem() -} - -type PowerOnFtSecondaryFailedFault PowerOnFtSecondaryFailed - -func init() { - t["PowerOnFtSecondaryFailedFault"] = reflect.TypeOf((*PowerOnFtSecondaryFailedFault)(nil)).Elem() -} - -type PowerOnFtSecondaryTimedout struct { - Timedout - - Vm ManagedObjectReference `xml:"vm"` - VmName string `xml:"vmName"` - Timeout int `xml:"timeout"` -} - -func init() { - t["PowerOnFtSecondaryTimedout"] = reflect.TypeOf((*PowerOnFtSecondaryTimedout)(nil)).Elem() -} - -type PowerOnFtSecondaryTimedoutFault PowerOnFtSecondaryTimedout - -func init() { - t["PowerOnFtSecondaryTimedoutFault"] = reflect.TypeOf((*PowerOnFtSecondaryTimedoutFault)(nil)).Elem() -} - -type PowerOnMultiVMRequestType struct { - This ManagedObjectReference `xml:"_this"` - Vm []ManagedObjectReference `xml:"vm"` - Option []BaseOptionValue `xml:"option,omitempty,typeattr"` -} - -func init() { - t["PowerOnMultiVMRequestType"] = reflect.TypeOf((*PowerOnMultiVMRequestType)(nil)).Elem() -} - -type PowerOnMultiVM_Task PowerOnMultiVMRequestType - -func init() { - t["PowerOnMultiVM_Task"] = reflect.TypeOf((*PowerOnMultiVM_Task)(nil)).Elem() -} - -type PowerOnMultiVM_TaskResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type PowerOnVAppRequestType struct { - This ManagedObjectReference `xml:"_this"` -} - -func init() { - t["PowerOnVAppRequestType"] = reflect.TypeOf((*PowerOnVAppRequestType)(nil)).Elem() -} - -type PowerOnVApp_Task PowerOnVAppRequestType - -func init() { - t["PowerOnVApp_Task"] = reflect.TypeOf((*PowerOnVApp_Task)(nil)).Elem() -} - -type PowerOnVApp_TaskResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type PowerOnVMRequestType struct { - This ManagedObjectReference `xml:"_this"` - Host *ManagedObjectReference `xml:"host,omitempty"` -} - -func init() { - t["PowerOnVMRequestType"] = reflect.TypeOf((*PowerOnVMRequestType)(nil)).Elem() -} - -type PowerOnVM_Task PowerOnVMRequestType - -func init() { - t["PowerOnVM_Task"] = reflect.TypeOf((*PowerOnVM_Task)(nil)).Elem() -} - -type PowerOnVM_TaskResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type PowerSystemCapability struct { - DynamicData - - AvailablePolicy []HostPowerPolicy `xml:"availablePolicy"` -} - -func init() { - t["PowerSystemCapability"] = reflect.TypeOf((*PowerSystemCapability)(nil)).Elem() -} - -type PowerSystemInfo struct { - DynamicData - - CurrentPolicy HostPowerPolicy `xml:"currentPolicy"` -} - -func init() { - t["PowerSystemInfo"] = reflect.TypeOf((*PowerSystemInfo)(nil)).Elem() -} - -type PowerUpHostFromStandByRequestType struct { - This ManagedObjectReference `xml:"_this"` - TimeoutSec int `xml:"timeoutSec"` -} - -func init() { - t["PowerUpHostFromStandByRequestType"] = reflect.TypeOf((*PowerUpHostFromStandByRequestType)(nil)).Elem() -} - -type PowerUpHostFromStandBy_Task PowerUpHostFromStandByRequestType - -func init() { - t["PowerUpHostFromStandBy_Task"] = reflect.TypeOf((*PowerUpHostFromStandBy_Task)(nil)).Elem() -} - -type PowerUpHostFromStandBy_TaskResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type PrivilegeAvailability struct { - DynamicData - - PrivId string `xml:"privId"` - IsGranted bool `xml:"isGranted"` -} - -func init() { - t["PrivilegeAvailability"] = reflect.TypeOf((*PrivilegeAvailability)(nil)).Elem() -} - -type PrivilegePolicyDef struct { - DynamicData - - CreatePrivilege string `xml:"createPrivilege"` - ReadPrivilege string `xml:"readPrivilege"` - UpdatePrivilege string `xml:"updatePrivilege"` - DeletePrivilege string `xml:"deletePrivilege"` -} - -func init() { - t["PrivilegePolicyDef"] = reflect.TypeOf((*PrivilegePolicyDef)(nil)).Elem() -} - -type ProductComponentInfo struct { - DynamicData - - Id string `xml:"id"` - Name string `xml:"name"` - Version string `xml:"version"` - Release int `xml:"release"` -} - -func init() { - t["ProductComponentInfo"] = reflect.TypeOf((*ProductComponentInfo)(nil)).Elem() -} - -type ProfileApplyProfileElement struct { - ApplyProfile - - Key string `xml:"key"` -} - -func init() { - t["ProfileApplyProfileElement"] = reflect.TypeOf((*ProfileApplyProfileElement)(nil)).Elem() -} - -type ProfileApplyProfileProperty struct { - DynamicData - - PropertyName string `xml:"propertyName"` - Array bool `xml:"array"` - Profile []BaseApplyProfile `xml:"profile,omitempty,typeattr"` -} - -func init() { - t["ProfileApplyProfileProperty"] = reflect.TypeOf((*ProfileApplyProfileProperty)(nil)).Elem() -} - -type ProfileAssociatedEvent struct { - ProfileEvent -} - -func init() { - t["ProfileAssociatedEvent"] = reflect.TypeOf((*ProfileAssociatedEvent)(nil)).Elem() -} - -type ProfileChangedEvent struct { - ProfileEvent -} - -func init() { - t["ProfileChangedEvent"] = reflect.TypeOf((*ProfileChangedEvent)(nil)).Elem() -} - -type ProfileCompositeExpression struct { - ProfileExpression - - Operator string `xml:"operator"` - ExpressionName []string `xml:"expressionName"` -} - -func init() { - t["ProfileCompositeExpression"] = reflect.TypeOf((*ProfileCompositeExpression)(nil)).Elem() -} - -type ProfileCompositePolicyOptionMetadata struct { - ProfilePolicyOptionMetadata - - Option []string `xml:"option"` -} - -func init() { - t["ProfileCompositePolicyOptionMetadata"] = reflect.TypeOf((*ProfileCompositePolicyOptionMetadata)(nil)).Elem() -} - -type ProfileConfigInfo struct { - DynamicData - - Name string `xml:"name"` - Annotation string `xml:"annotation,omitempty"` - Enabled bool `xml:"enabled"` -} - -func init() { - t["ProfileConfigInfo"] = reflect.TypeOf((*ProfileConfigInfo)(nil)).Elem() -} - -type ProfileCreateSpec struct { - DynamicData - - Name string `xml:"name,omitempty"` - Annotation string `xml:"annotation,omitempty"` - Enabled *bool `xml:"enabled"` -} - -func init() { - t["ProfileCreateSpec"] = reflect.TypeOf((*ProfileCreateSpec)(nil)).Elem() -} - -type ProfileCreatedEvent struct { - ProfileEvent -} - -func init() { - t["ProfileCreatedEvent"] = reflect.TypeOf((*ProfileCreatedEvent)(nil)).Elem() -} - -type ProfileDeferredPolicyOptionParameter struct { - DynamicData - - InputPath ProfilePropertyPath `xml:"inputPath"` - Parameter []KeyAnyValue `xml:"parameter,omitempty"` -} - -func init() { - t["ProfileDeferredPolicyOptionParameter"] = reflect.TypeOf((*ProfileDeferredPolicyOptionParameter)(nil)).Elem() -} - -type ProfileDescription struct { - DynamicData - - Section []ProfileDescriptionSection `xml:"section"` -} - -func init() { - t["ProfileDescription"] = reflect.TypeOf((*ProfileDescription)(nil)).Elem() -} - -type ProfileDescriptionSection struct { - DynamicData - - Description ExtendedElementDescription `xml:"description"` - Message []LocalizableMessage `xml:"message,omitempty"` -} - -func init() { - t["ProfileDescriptionSection"] = reflect.TypeOf((*ProfileDescriptionSection)(nil)).Elem() -} - -type ProfileDissociatedEvent struct { - ProfileEvent -} - -func init() { - t["ProfileDissociatedEvent"] = reflect.TypeOf((*ProfileDissociatedEvent)(nil)).Elem() -} - -type ProfileEvent struct { - Event - - Profile ProfileEventArgument `xml:"profile"` -} - -func init() { - t["ProfileEvent"] = reflect.TypeOf((*ProfileEvent)(nil)).Elem() -} - -type ProfileEventArgument struct { - EventArgument - - Profile ManagedObjectReference `xml:"profile"` - Name string `xml:"name"` -} - -func init() { - t["ProfileEventArgument"] = reflect.TypeOf((*ProfileEventArgument)(nil)).Elem() -} - -type ProfileExecuteError struct { - DynamicData - - Path *ProfilePropertyPath `xml:"path,omitempty"` - Message LocalizableMessage `xml:"message"` -} - -func init() { - t["ProfileExecuteError"] = reflect.TypeOf((*ProfileExecuteError)(nil)).Elem() -} - -type ProfileExecuteResult struct { - DynamicData - - Status string `xml:"status"` - ConfigSpec *HostConfigSpec `xml:"configSpec,omitempty"` - InapplicablePath []string `xml:"inapplicablePath,omitempty"` - RequireInput []ProfileDeferredPolicyOptionParameter `xml:"requireInput,omitempty"` - Error []ProfileExecuteError `xml:"error,omitempty"` -} - -func init() { - t["ProfileExecuteResult"] = reflect.TypeOf((*ProfileExecuteResult)(nil)).Elem() -} - -type ProfileExpression struct { - DynamicData - - Id string `xml:"id"` - DisplayName string `xml:"displayName"` - Negated bool `xml:"negated"` -} - -func init() { - t["ProfileExpression"] = reflect.TypeOf((*ProfileExpression)(nil)).Elem() -} - -type ProfileExpressionMetadata struct { - DynamicData - - ExpressionId ExtendedElementDescription `xml:"expressionId"` - Parameter []ProfileParameterMetadata `xml:"parameter,omitempty"` -} - -func init() { - t["ProfileExpressionMetadata"] = reflect.TypeOf((*ProfileExpressionMetadata)(nil)).Elem() -} - -type ProfileMetadata struct { - DynamicData - - Key string `xml:"key"` - ProfileTypeName string `xml:"profileTypeName,omitempty"` - Description *ExtendedDescription `xml:"description,omitempty"` - SortSpec []ProfileMetadataProfileSortSpec `xml:"sortSpec,omitempty"` - ProfileCategory string `xml:"profileCategory,omitempty"` - ProfileComponent string `xml:"profileComponent,omitempty"` -} - -func init() { - t["ProfileMetadata"] = reflect.TypeOf((*ProfileMetadata)(nil)).Elem() -} - -type ProfileMetadataProfileSortSpec struct { - DynamicData - - PolicyId string `xml:"policyId"` - Parameter string `xml:"parameter"` -} - -func init() { - t["ProfileMetadataProfileSortSpec"] = reflect.TypeOf((*ProfileMetadataProfileSortSpec)(nil)).Elem() -} - -type ProfileParameterMetadata struct { - DynamicData - - Id ExtendedElementDescription `xml:"id"` - Type string `xml:"type"` - Optional bool `xml:"optional"` - DefaultValue AnyType `xml:"defaultValue,omitempty,typeattr"` -} - -func init() { - t["ProfileParameterMetadata"] = reflect.TypeOf((*ProfileParameterMetadata)(nil)).Elem() -} - -type ProfilePolicy struct { - DynamicData - - Id string `xml:"id"` - PolicyOption BasePolicyOption `xml:"policyOption,typeattr"` -} - -func init() { - t["ProfilePolicy"] = reflect.TypeOf((*ProfilePolicy)(nil)).Elem() -} - -type ProfilePolicyMetadata struct { - DynamicData - - Id ExtendedElementDescription `xml:"id"` - PossibleOption []BaseProfilePolicyOptionMetadata `xml:"possibleOption,typeattr"` -} - -func init() { - t["ProfilePolicyMetadata"] = reflect.TypeOf((*ProfilePolicyMetadata)(nil)).Elem() -} - -type ProfilePolicyOptionMetadata struct { - DynamicData - - Id ExtendedElementDescription `xml:"id"` - Parameter []ProfileParameterMetadata `xml:"parameter,omitempty"` -} - -func init() { - t["ProfilePolicyOptionMetadata"] = reflect.TypeOf((*ProfilePolicyOptionMetadata)(nil)).Elem() -} - -type ProfileProfileStructure struct { - DynamicData - - ProfileTypeName string `xml:"profileTypeName"` - Child []ProfileProfileStructureProperty `xml:"child,omitempty"` -} - -func init() { - t["ProfileProfileStructure"] = reflect.TypeOf((*ProfileProfileStructure)(nil)).Elem() -} - -type ProfileProfileStructureProperty struct { - DynamicData - - PropertyName string `xml:"propertyName"` - Array bool `xml:"array"` - Element ProfileProfileStructure `xml:"element"` -} - -func init() { - t["ProfileProfileStructureProperty"] = reflect.TypeOf((*ProfileProfileStructureProperty)(nil)).Elem() -} - -type ProfilePropertyPath struct { - DynamicData - - ProfilePath string `xml:"profilePath"` - PolicyId string `xml:"policyId,omitempty"` - ParameterId string `xml:"parameterId,omitempty"` -} - -func init() { - t["ProfilePropertyPath"] = reflect.TypeOf((*ProfilePropertyPath)(nil)).Elem() -} - -type ProfileReferenceHostChangedEvent struct { - ProfileEvent - - ReferenceHost *ManagedObjectReference `xml:"referenceHost,omitempty"` -} - -func init() { - t["ProfileReferenceHostChangedEvent"] = reflect.TypeOf((*ProfileReferenceHostChangedEvent)(nil)).Elem() -} - -type ProfileRemovedEvent struct { - ProfileEvent -} - -func init() { - t["ProfileRemovedEvent"] = reflect.TypeOf((*ProfileRemovedEvent)(nil)).Elem() -} - -type ProfileSerializedCreateSpec struct { - ProfileCreateSpec - - ProfileConfigString string `xml:"profileConfigString"` -} - -func init() { - t["ProfileSerializedCreateSpec"] = reflect.TypeOf((*ProfileSerializedCreateSpec)(nil)).Elem() -} - -type ProfileSimpleExpression struct { - ProfileExpression - - ExpressionType string `xml:"expressionType"` - Parameter []KeyAnyValue `xml:"parameter,omitempty"` -} - -func init() { - t["ProfileSimpleExpression"] = reflect.TypeOf((*ProfileSimpleExpression)(nil)).Elem() -} - -type ProfileUpdateFailed struct { - VimFault - - Failure []ProfileUpdateFailedUpdateFailure `xml:"failure"` -} - -func init() { - t["ProfileUpdateFailed"] = reflect.TypeOf((*ProfileUpdateFailed)(nil)).Elem() -} - -type ProfileUpdateFailedFault ProfileUpdateFailed - -func init() { - t["ProfileUpdateFailedFault"] = reflect.TypeOf((*ProfileUpdateFailedFault)(nil)).Elem() -} - -type ProfileUpdateFailedUpdateFailure struct { - DynamicData - - ProfilePath ProfilePropertyPath `xml:"profilePath"` - ErrMsg LocalizableMessage `xml:"errMsg"` -} - -func init() { - t["ProfileUpdateFailedUpdateFailure"] = reflect.TypeOf((*ProfileUpdateFailedUpdateFailure)(nil)).Elem() -} - -type PromoteDisksRequestType struct { - This ManagedObjectReference `xml:"_this"` - Unlink bool `xml:"unlink"` - Disks []VirtualDisk `xml:"disks,omitempty"` -} - -func init() { - t["PromoteDisksRequestType"] = reflect.TypeOf((*PromoteDisksRequestType)(nil)).Elem() -} - -type PromoteDisks_Task PromoteDisksRequestType - -func init() { - t["PromoteDisks_Task"] = reflect.TypeOf((*PromoteDisks_Task)(nil)).Elem() -} - -type PromoteDisks_TaskResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type PropertyChange struct { - DynamicData - - Name string `xml:"name"` - Op PropertyChangeOp `xml:"op"` - Val AnyType `xml:"val,omitempty,typeattr"` -} - -func init() { - t["PropertyChange"] = reflect.TypeOf((*PropertyChange)(nil)).Elem() -} - -type PropertyFilterSpec struct { - DynamicData - - PropSet []PropertySpec `xml:"propSet"` - ObjectSet []ObjectSpec `xml:"objectSet"` - ReportMissingObjectsInResults *bool `xml:"reportMissingObjectsInResults"` -} - -func init() { - t["PropertyFilterSpec"] = reflect.TypeOf((*PropertyFilterSpec)(nil)).Elem() -} - -type PropertyFilterUpdate struct { - DynamicData - - Filter ManagedObjectReference `xml:"filter"` - ObjectSet []ObjectUpdate `xml:"objectSet,omitempty"` - MissingSet []MissingObject `xml:"missingSet,omitempty"` -} - -func init() { - t["PropertyFilterUpdate"] = reflect.TypeOf((*PropertyFilterUpdate)(nil)).Elem() -} - -type PropertySpec struct { - DynamicData - - Type string `xml:"type"` - All *bool `xml:"all"` - PathSet []string `xml:"pathSet,omitempty"` -} - -func init() { - t["PropertySpec"] = reflect.TypeOf((*PropertySpec)(nil)).Elem() -} - -type QueryAnswerFileStatus QueryAnswerFileStatusRequestType - -func init() { - t["QueryAnswerFileStatus"] = reflect.TypeOf((*QueryAnswerFileStatus)(nil)).Elem() -} - -type QueryAnswerFileStatusRequestType struct { - This ManagedObjectReference `xml:"_this"` - Host []ManagedObjectReference `xml:"host"` -} - -func init() { - t["QueryAnswerFileStatusRequestType"] = reflect.TypeOf((*QueryAnswerFileStatusRequestType)(nil)).Elem() -} - -type QueryAnswerFileStatusResponse struct { - Returnval []AnswerFileStatusResult `xml:"returnval,omitempty"` -} - -type QueryAssignedLicenses QueryAssignedLicensesRequestType - -func init() { - t["QueryAssignedLicenses"] = reflect.TypeOf((*QueryAssignedLicenses)(nil)).Elem() -} - -type QueryAssignedLicensesRequestType struct { - This ManagedObjectReference `xml:"_this"` - EntityId string `xml:"entityId,omitempty"` -} - -func init() { - t["QueryAssignedLicensesRequestType"] = reflect.TypeOf((*QueryAssignedLicensesRequestType)(nil)).Elem() -} - -type QueryAssignedLicensesResponse struct { - Returnval []LicenseAssignmentManagerLicenseAssignment `xml:"returnval"` -} - -type QueryAvailableDisksForVmfs QueryAvailableDisksForVmfsRequestType - -func init() { - t["QueryAvailableDisksForVmfs"] = reflect.TypeOf((*QueryAvailableDisksForVmfs)(nil)).Elem() -} - -type QueryAvailableDisksForVmfsRequestType struct { - This ManagedObjectReference `xml:"_this"` - Datastore *ManagedObjectReference `xml:"datastore,omitempty"` -} - -func init() { - t["QueryAvailableDisksForVmfsRequestType"] = reflect.TypeOf((*QueryAvailableDisksForVmfsRequestType)(nil)).Elem() -} - -type QueryAvailableDisksForVmfsResponse struct { - Returnval []HostScsiDisk `xml:"returnval,omitempty"` -} - -type QueryAvailableDvsSpec QueryAvailableDvsSpecRequestType - -func init() { - t["QueryAvailableDvsSpec"] = reflect.TypeOf((*QueryAvailableDvsSpec)(nil)).Elem() -} - -type QueryAvailableDvsSpecRequestType struct { - This ManagedObjectReference `xml:"_this"` -} - -func init() { - t["QueryAvailableDvsSpecRequestType"] = reflect.TypeOf((*QueryAvailableDvsSpecRequestType)(nil)).Elem() -} - -type QueryAvailableDvsSpecResponse struct { - Returnval []DistributedVirtualSwitchProductSpec `xml:"returnval,omitempty"` -} - -type QueryAvailablePartition QueryAvailablePartitionRequestType - -func init() { - t["QueryAvailablePartition"] = reflect.TypeOf((*QueryAvailablePartition)(nil)).Elem() -} - -type QueryAvailablePartitionRequestType struct { - This ManagedObjectReference `xml:"_this"` -} - -func init() { - t["QueryAvailablePartitionRequestType"] = reflect.TypeOf((*QueryAvailablePartitionRequestType)(nil)).Elem() -} - -type QueryAvailablePartitionResponse struct { - Returnval []HostDiagnosticPartition `xml:"returnval,omitempty"` -} - -type QueryAvailablePerfMetric QueryAvailablePerfMetricRequestType - -func init() { - t["QueryAvailablePerfMetric"] = reflect.TypeOf((*QueryAvailablePerfMetric)(nil)).Elem() -} - -type QueryAvailablePerfMetricRequestType struct { - This ManagedObjectReference `xml:"_this"` - Entity ManagedObjectReference `xml:"entity"` - BeginTime *time.Time `xml:"beginTime"` - EndTime *time.Time `xml:"endTime"` - IntervalId int `xml:"intervalId,omitempty"` -} - -func init() { - t["QueryAvailablePerfMetricRequestType"] = reflect.TypeOf((*QueryAvailablePerfMetricRequestType)(nil)).Elem() -} - -type QueryAvailablePerfMetricResponse struct { - Returnval []PerfMetricId `xml:"returnval,omitempty"` -} - -type QueryAvailableSsds QueryAvailableSsdsRequestType - -func init() { - t["QueryAvailableSsds"] = reflect.TypeOf((*QueryAvailableSsds)(nil)).Elem() -} - -type QueryAvailableSsdsRequestType struct { - This ManagedObjectReference `xml:"_this"` - VffsPath string `xml:"vffsPath,omitempty"` -} - -func init() { - t["QueryAvailableSsdsRequestType"] = reflect.TypeOf((*QueryAvailableSsdsRequestType)(nil)).Elem() -} - -type QueryAvailableSsdsResponse struct { - Returnval []HostScsiDisk `xml:"returnval,omitempty"` -} - -type QueryAvailableTimeZones QueryAvailableTimeZonesRequestType - -func init() { - t["QueryAvailableTimeZones"] = reflect.TypeOf((*QueryAvailableTimeZones)(nil)).Elem() -} - -type QueryAvailableTimeZonesRequestType struct { - This ManagedObjectReference `xml:"_this"` -} - -func init() { - t["QueryAvailableTimeZonesRequestType"] = reflect.TypeOf((*QueryAvailableTimeZonesRequestType)(nil)).Elem() -} - -type QueryAvailableTimeZonesResponse struct { - Returnval []HostDateTimeSystemTimeZone `xml:"returnval,omitempty"` -} - -type QueryBootDevices QueryBootDevicesRequestType - -func init() { - t["QueryBootDevices"] = reflect.TypeOf((*QueryBootDevices)(nil)).Elem() -} - -type QueryBootDevicesRequestType struct { - This ManagedObjectReference `xml:"_this"` -} - -func init() { - t["QueryBootDevicesRequestType"] = reflect.TypeOf((*QueryBootDevicesRequestType)(nil)).Elem() -} - -type QueryBootDevicesResponse struct { - Returnval *HostBootDeviceInfo `xml:"returnval,omitempty"` -} - -type QueryBoundVnics QueryBoundVnicsRequestType - -func init() { - t["QueryBoundVnics"] = reflect.TypeOf((*QueryBoundVnics)(nil)).Elem() -} - -type QueryBoundVnicsRequestType struct { - This ManagedObjectReference `xml:"_this"` - IScsiHbaName string `xml:"iScsiHbaName"` -} - -func init() { - t["QueryBoundVnicsRequestType"] = reflect.TypeOf((*QueryBoundVnicsRequestType)(nil)).Elem() -} - -type QueryBoundVnicsResponse struct { - Returnval []IscsiPortInfo `xml:"returnval,omitempty"` -} - -type QueryCandidateNics QueryCandidateNicsRequestType - -func init() { - t["QueryCandidateNics"] = reflect.TypeOf((*QueryCandidateNics)(nil)).Elem() -} - -type QueryCandidateNicsRequestType struct { - This ManagedObjectReference `xml:"_this"` - IScsiHbaName string `xml:"iScsiHbaName"` -} - -func init() { - t["QueryCandidateNicsRequestType"] = reflect.TypeOf((*QueryCandidateNicsRequestType)(nil)).Elem() -} - -type QueryCandidateNicsResponse struct { - Returnval []IscsiPortInfo `xml:"returnval,omitempty"` -} - -type QueryChangedDiskAreas QueryChangedDiskAreasRequestType - -func init() { - t["QueryChangedDiskAreas"] = reflect.TypeOf((*QueryChangedDiskAreas)(nil)).Elem() -} - -type QueryChangedDiskAreasRequestType struct { - This ManagedObjectReference `xml:"_this"` - Snapshot *ManagedObjectReference `xml:"snapshot,omitempty"` - DeviceKey int `xml:"deviceKey"` - StartOffset int64 `xml:"startOffset"` - ChangeId string `xml:"changeId"` -} - -func init() { - t["QueryChangedDiskAreasRequestType"] = reflect.TypeOf((*QueryChangedDiskAreasRequestType)(nil)).Elem() -} - -type QueryChangedDiskAreasResponse struct { - Returnval DiskChangeInfo `xml:"returnval"` -} - -type QueryCmmds QueryCmmdsRequestType - -func init() { - t["QueryCmmds"] = reflect.TypeOf((*QueryCmmds)(nil)).Elem() -} - -type QueryCmmdsRequestType struct { - This ManagedObjectReference `xml:"_this"` - Queries []HostVsanInternalSystemCmmdsQuery `xml:"queries"` -} - -func init() { - t["QueryCmmdsRequestType"] = reflect.TypeOf((*QueryCmmdsRequestType)(nil)).Elem() -} - -type QueryCmmdsResponse struct { - Returnval string `xml:"returnval"` -} - -type QueryCompatibleHostForExistingDvs QueryCompatibleHostForExistingDvsRequestType - -func init() { - t["QueryCompatibleHostForExistingDvs"] = reflect.TypeOf((*QueryCompatibleHostForExistingDvs)(nil)).Elem() -} - -type QueryCompatibleHostForExistingDvsRequestType struct { - This ManagedObjectReference `xml:"_this"` - Container ManagedObjectReference `xml:"container"` - Recursive bool `xml:"recursive"` - Dvs ManagedObjectReference `xml:"dvs"` -} - -func init() { - t["QueryCompatibleHostForExistingDvsRequestType"] = reflect.TypeOf((*QueryCompatibleHostForExistingDvsRequestType)(nil)).Elem() -} - -type QueryCompatibleHostForExistingDvsResponse struct { - Returnval []ManagedObjectReference `xml:"returnval,omitempty"` -} - -type QueryCompatibleHostForNewDvs QueryCompatibleHostForNewDvsRequestType - -func init() { - t["QueryCompatibleHostForNewDvs"] = reflect.TypeOf((*QueryCompatibleHostForNewDvs)(nil)).Elem() -} - -type QueryCompatibleHostForNewDvsRequestType struct { - This ManagedObjectReference `xml:"_this"` - Container ManagedObjectReference `xml:"container"` - Recursive bool `xml:"recursive"` - SwitchProductSpec *DistributedVirtualSwitchProductSpec `xml:"switchProductSpec,omitempty"` -} - -func init() { - t["QueryCompatibleHostForNewDvsRequestType"] = reflect.TypeOf((*QueryCompatibleHostForNewDvsRequestType)(nil)).Elem() -} - -type QueryCompatibleHostForNewDvsResponse struct { - Returnval []ManagedObjectReference `xml:"returnval,omitempty"` -} - -type QueryComplianceStatus QueryComplianceStatusRequestType - -func init() { - t["QueryComplianceStatus"] = reflect.TypeOf((*QueryComplianceStatus)(nil)).Elem() -} - -type QueryComplianceStatusRequestType struct { - This ManagedObjectReference `xml:"_this"` - Profile []ManagedObjectReference `xml:"profile,omitempty"` - Entity []ManagedObjectReference `xml:"entity,omitempty"` -} - -func init() { - t["QueryComplianceStatusRequestType"] = reflect.TypeOf((*QueryComplianceStatusRequestType)(nil)).Elem() -} - -type QueryComplianceStatusResponse struct { - Returnval []ComplianceResult `xml:"returnval,omitempty"` -} - -type QueryConfigOption QueryConfigOptionRequestType - -func init() { - t["QueryConfigOption"] = reflect.TypeOf((*QueryConfigOption)(nil)).Elem() -} - -type QueryConfigOptionDescriptor QueryConfigOptionDescriptorRequestType - -func init() { - t["QueryConfigOptionDescriptor"] = reflect.TypeOf((*QueryConfigOptionDescriptor)(nil)).Elem() -} - -type QueryConfigOptionDescriptorRequestType struct { - This ManagedObjectReference `xml:"_this"` -} - -func init() { - t["QueryConfigOptionDescriptorRequestType"] = reflect.TypeOf((*QueryConfigOptionDescriptorRequestType)(nil)).Elem() -} - -type QueryConfigOptionDescriptorResponse struct { - Returnval []VirtualMachineConfigOptionDescriptor `xml:"returnval,omitempty"` -} - -type QueryConfigOptionRequestType struct { - This ManagedObjectReference `xml:"_this"` - Key string `xml:"key,omitempty"` - Host *ManagedObjectReference `xml:"host,omitempty"` -} - -func init() { - t["QueryConfigOptionRequestType"] = reflect.TypeOf((*QueryConfigOptionRequestType)(nil)).Elem() -} - -type QueryConfigOptionResponse struct { - Returnval *VirtualMachineConfigOption `xml:"returnval,omitempty"` -} - -type QueryConfigTarget QueryConfigTargetRequestType - -func init() { - t["QueryConfigTarget"] = reflect.TypeOf((*QueryConfigTarget)(nil)).Elem() -} - -type QueryConfigTargetRequestType struct { - This ManagedObjectReference `xml:"_this"` - Host *ManagedObjectReference `xml:"host,omitempty"` -} - -func init() { - t["QueryConfigTargetRequestType"] = reflect.TypeOf((*QueryConfigTargetRequestType)(nil)).Elem() -} - -type QueryConfigTargetResponse struct { - Returnval *ConfigTarget `xml:"returnval,omitempty"` -} - -type QueryConfiguredModuleOptionString QueryConfiguredModuleOptionStringRequestType - -func init() { - t["QueryConfiguredModuleOptionString"] = reflect.TypeOf((*QueryConfiguredModuleOptionString)(nil)).Elem() -} - -type QueryConfiguredModuleOptionStringRequestType struct { - This ManagedObjectReference `xml:"_this"` - Name string `xml:"name"` -} - -func init() { - t["QueryConfiguredModuleOptionStringRequestType"] = reflect.TypeOf((*QueryConfiguredModuleOptionStringRequestType)(nil)).Elem() -} - -type QueryConfiguredModuleOptionStringResponse struct { - Returnval string `xml:"returnval"` -} - -type QueryConnectionInfo QueryConnectionInfoRequestType - -func init() { - t["QueryConnectionInfo"] = reflect.TypeOf((*QueryConnectionInfo)(nil)).Elem() -} - -type QueryConnectionInfoRequestType struct { - This ManagedObjectReference `xml:"_this"` - Hostname string `xml:"hostname"` - Port int `xml:"port"` - Username string `xml:"username"` - Password string `xml:"password"` - SslThumbprint string `xml:"sslThumbprint,omitempty"` -} - -func init() { - t["QueryConnectionInfoRequestType"] = reflect.TypeOf((*QueryConnectionInfoRequestType)(nil)).Elem() -} - -type QueryConnectionInfoResponse struct { - Returnval HostConnectInfo `xml:"returnval"` -} - -type QueryDatastorePerformanceSummary QueryDatastorePerformanceSummaryRequestType - -func init() { - t["QueryDatastorePerformanceSummary"] = reflect.TypeOf((*QueryDatastorePerformanceSummary)(nil)).Elem() -} - -type QueryDatastorePerformanceSummaryRequestType struct { - This ManagedObjectReference `xml:"_this"` - Datastore ManagedObjectReference `xml:"datastore"` -} - -func init() { - t["QueryDatastorePerformanceSummaryRequestType"] = reflect.TypeOf((*QueryDatastorePerformanceSummaryRequestType)(nil)).Elem() -} - -type QueryDatastorePerformanceSummaryResponse struct { - Returnval []StoragePerformanceSummary `xml:"returnval,omitempty"` -} - -type QueryDateTime QueryDateTimeRequestType - -func init() { - t["QueryDateTime"] = reflect.TypeOf((*QueryDateTime)(nil)).Elem() -} - -type QueryDateTimeRequestType struct { - This ManagedObjectReference `xml:"_this"` -} - -func init() { - t["QueryDateTimeRequestType"] = reflect.TypeOf((*QueryDateTimeRequestType)(nil)).Elem() -} - -type QueryDateTimeResponse struct { - Returnval time.Time `xml:"returnval"` -} - -type QueryDescriptions QueryDescriptionsRequestType - -func init() { - t["QueryDescriptions"] = reflect.TypeOf((*QueryDescriptions)(nil)).Elem() -} - -type QueryDescriptionsRequestType struct { - This ManagedObjectReference `xml:"_this"` - Host *ManagedObjectReference `xml:"host,omitempty"` -} - -func init() { - t["QueryDescriptionsRequestType"] = reflect.TypeOf((*QueryDescriptionsRequestType)(nil)).Elem() -} - -type QueryDescriptionsResponse struct { - Returnval []DiagnosticManagerLogDescriptor `xml:"returnval,omitempty"` -} - -type QueryDisksForVsan QueryDisksForVsanRequestType - -func init() { - t["QueryDisksForVsan"] = reflect.TypeOf((*QueryDisksForVsan)(nil)).Elem() -} - -type QueryDisksForVsanRequestType struct { - This ManagedObjectReference `xml:"_this"` - CanonicalName []string `xml:"canonicalName,omitempty"` -} - -func init() { - t["QueryDisksForVsanRequestType"] = reflect.TypeOf((*QueryDisksForVsanRequestType)(nil)).Elem() -} - -type QueryDisksForVsanResponse struct { - Returnval []VsanHostDiskResult `xml:"returnval,omitempty"` -} - -type QueryDvsByUuid QueryDvsByUuidRequestType - -func init() { - t["QueryDvsByUuid"] = reflect.TypeOf((*QueryDvsByUuid)(nil)).Elem() -} - -type QueryDvsByUuidRequestType struct { - This ManagedObjectReference `xml:"_this"` - Uuid string `xml:"uuid"` -} - -func init() { - t["QueryDvsByUuidRequestType"] = reflect.TypeOf((*QueryDvsByUuidRequestType)(nil)).Elem() -} - -type QueryDvsByUuidResponse struct { - Returnval *ManagedObjectReference `xml:"returnval,omitempty"` -} - -type QueryDvsCheckCompatibility QueryDvsCheckCompatibilityRequestType - -func init() { - t["QueryDvsCheckCompatibility"] = reflect.TypeOf((*QueryDvsCheckCompatibility)(nil)).Elem() -} - -type QueryDvsCheckCompatibilityRequestType struct { - This ManagedObjectReference `xml:"_this"` - HostContainer DistributedVirtualSwitchManagerHostContainer `xml:"hostContainer"` - DvsProductSpec *DistributedVirtualSwitchManagerDvsProductSpec `xml:"dvsProductSpec,omitempty"` - HostFilterSpec []BaseDistributedVirtualSwitchManagerHostDvsFilterSpec `xml:"hostFilterSpec,omitempty,typeattr"` -} - -func init() { - t["QueryDvsCheckCompatibilityRequestType"] = reflect.TypeOf((*QueryDvsCheckCompatibilityRequestType)(nil)).Elem() -} - -type QueryDvsCheckCompatibilityResponse struct { - Returnval []DistributedVirtualSwitchManagerCompatibilityResult `xml:"returnval,omitempty"` -} - -type QueryDvsCompatibleHostSpec QueryDvsCompatibleHostSpecRequestType - -func init() { - t["QueryDvsCompatibleHostSpec"] = reflect.TypeOf((*QueryDvsCompatibleHostSpec)(nil)).Elem() -} - -type QueryDvsCompatibleHostSpecRequestType struct { - This ManagedObjectReference `xml:"_this"` - SwitchProductSpec *DistributedVirtualSwitchProductSpec `xml:"switchProductSpec,omitempty"` -} - -func init() { - t["QueryDvsCompatibleHostSpecRequestType"] = reflect.TypeOf((*QueryDvsCompatibleHostSpecRequestType)(nil)).Elem() -} - -type QueryDvsCompatibleHostSpecResponse struct { - Returnval []DistributedVirtualSwitchHostProductSpec `xml:"returnval,omitempty"` -} - -type QueryDvsConfigTarget QueryDvsConfigTargetRequestType - -func init() { - t["QueryDvsConfigTarget"] = reflect.TypeOf((*QueryDvsConfigTarget)(nil)).Elem() -} - -type QueryDvsConfigTargetRequestType struct { - This ManagedObjectReference `xml:"_this"` - Host *ManagedObjectReference `xml:"host,omitempty"` - Dvs *ManagedObjectReference `xml:"dvs,omitempty"` -} - -func init() { - t["QueryDvsConfigTargetRequestType"] = reflect.TypeOf((*QueryDvsConfigTargetRequestType)(nil)).Elem() -} - -type QueryDvsConfigTargetResponse struct { - Returnval DVSManagerDvsConfigTarget `xml:"returnval"` -} - -type QueryDvsFeatureCapability QueryDvsFeatureCapabilityRequestType - -func init() { - t["QueryDvsFeatureCapability"] = reflect.TypeOf((*QueryDvsFeatureCapability)(nil)).Elem() -} - -type QueryDvsFeatureCapabilityRequestType struct { - This ManagedObjectReference `xml:"_this"` - SwitchProductSpec *DistributedVirtualSwitchProductSpec `xml:"switchProductSpec,omitempty"` -} - -func init() { - t["QueryDvsFeatureCapabilityRequestType"] = reflect.TypeOf((*QueryDvsFeatureCapabilityRequestType)(nil)).Elem() -} - -type QueryDvsFeatureCapabilityResponse struct { - Returnval BaseDVSFeatureCapability `xml:"returnval,omitempty,typeattr"` -} - -type QueryEvents QueryEventsRequestType - -func init() { - t["QueryEvents"] = reflect.TypeOf((*QueryEvents)(nil)).Elem() -} - -type QueryEventsRequestType struct { - This ManagedObjectReference `xml:"_this"` - Filter EventFilterSpec `xml:"filter"` -} - -func init() { - t["QueryEventsRequestType"] = reflect.TypeOf((*QueryEventsRequestType)(nil)).Elem() -} - -type QueryEventsResponse struct { - Returnval []BaseEvent `xml:"returnval,omitempty,typeattr"` -} - -type QueryExpressionMetadata QueryExpressionMetadataRequestType - -func init() { - t["QueryExpressionMetadata"] = reflect.TypeOf((*QueryExpressionMetadata)(nil)).Elem() -} - -type QueryExpressionMetadataRequestType struct { - This ManagedObjectReference `xml:"_this"` - ExpressionName []string `xml:"expressionName,omitempty"` - Profile *ManagedObjectReference `xml:"profile,omitempty"` -} - -func init() { - t["QueryExpressionMetadataRequestType"] = reflect.TypeOf((*QueryExpressionMetadataRequestType)(nil)).Elem() -} - -type QueryExpressionMetadataResponse struct { - Returnval []ProfileExpressionMetadata `xml:"returnval,omitempty"` -} - -type QueryExtensionIpAllocationUsage QueryExtensionIpAllocationUsageRequestType - -func init() { - t["QueryExtensionIpAllocationUsage"] = reflect.TypeOf((*QueryExtensionIpAllocationUsage)(nil)).Elem() -} - -type QueryExtensionIpAllocationUsageRequestType struct { - This ManagedObjectReference `xml:"_this"` - ExtensionKeys []string `xml:"extensionKeys,omitempty"` -} - -func init() { - t["QueryExtensionIpAllocationUsageRequestType"] = reflect.TypeOf((*QueryExtensionIpAllocationUsageRequestType)(nil)).Elem() -} - -type QueryExtensionIpAllocationUsageResponse struct { - Returnval []ExtensionManagerIpAllocationUsage `xml:"returnval,omitempty"` -} - -type QueryFaultToleranceCompatibility QueryFaultToleranceCompatibilityRequestType - -func init() { - t["QueryFaultToleranceCompatibility"] = reflect.TypeOf((*QueryFaultToleranceCompatibility)(nil)).Elem() -} - -type QueryFaultToleranceCompatibilityRequestType struct { - This ManagedObjectReference `xml:"_this"` -} - -func init() { - t["QueryFaultToleranceCompatibilityRequestType"] = reflect.TypeOf((*QueryFaultToleranceCompatibilityRequestType)(nil)).Elem() -} - -type QueryFaultToleranceCompatibilityResponse struct { - Returnval []LocalizedMethodFault `xml:"returnval,omitempty"` -} - -type QueryFirmwareConfigUploadURL QueryFirmwareConfigUploadURLRequestType - -func init() { - t["QueryFirmwareConfigUploadURL"] = reflect.TypeOf((*QueryFirmwareConfigUploadURL)(nil)).Elem() -} - -type QueryFirmwareConfigUploadURLRequestType struct { - This ManagedObjectReference `xml:"_this"` -} - -func init() { - t["QueryFirmwareConfigUploadURLRequestType"] = reflect.TypeOf((*QueryFirmwareConfigUploadURLRequestType)(nil)).Elem() -} - -type QueryFirmwareConfigUploadURLResponse struct { - Returnval string `xml:"returnval"` -} - -type QueryHostConnectionInfo QueryHostConnectionInfoRequestType - -func init() { - t["QueryHostConnectionInfo"] = reflect.TypeOf((*QueryHostConnectionInfo)(nil)).Elem() -} - -type QueryHostConnectionInfoRequestType struct { - This ManagedObjectReference `xml:"_this"` -} - -func init() { - t["QueryHostConnectionInfoRequestType"] = reflect.TypeOf((*QueryHostConnectionInfoRequestType)(nil)).Elem() -} - -type QueryHostConnectionInfoResponse struct { - Returnval HostConnectInfo `xml:"returnval"` -} - -type QueryHostPatchRequestType struct { - This ManagedObjectReference `xml:"_this"` - Spec *HostPatchManagerPatchManagerOperationSpec `xml:"spec,omitempty"` -} - -func init() { - t["QueryHostPatchRequestType"] = reflect.TypeOf((*QueryHostPatchRequestType)(nil)).Elem() -} - -type QueryHostPatch_Task QueryHostPatchRequestType - -func init() { - t["QueryHostPatch_Task"] = reflect.TypeOf((*QueryHostPatch_Task)(nil)).Elem() -} - -type QueryHostPatch_TaskResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type QueryHostProfileMetadata QueryHostProfileMetadataRequestType - -func init() { - t["QueryHostProfileMetadata"] = reflect.TypeOf((*QueryHostProfileMetadata)(nil)).Elem() -} - -type QueryHostProfileMetadataRequestType struct { - This ManagedObjectReference `xml:"_this"` - ProfileName []string `xml:"profileName,omitempty"` - Profile *ManagedObjectReference `xml:"profile,omitempty"` -} - -func init() { - t["QueryHostProfileMetadataRequestType"] = reflect.TypeOf((*QueryHostProfileMetadataRequestType)(nil)).Elem() -} - -type QueryHostProfileMetadataResponse struct { - Returnval []ProfileMetadata `xml:"returnval,omitempty"` -} - -type QueryHostStatus QueryHostStatusRequestType - -func init() { - t["QueryHostStatus"] = reflect.TypeOf((*QueryHostStatus)(nil)).Elem() -} - -type QueryHostStatusRequestType struct { - This ManagedObjectReference `xml:"_this"` -} - -func init() { - t["QueryHostStatusRequestType"] = reflect.TypeOf((*QueryHostStatusRequestType)(nil)).Elem() -} - -type QueryHostStatusResponse struct { - Returnval VsanHostClusterStatus `xml:"returnval"` -} - -type QueryIORMConfigOption QueryIORMConfigOptionRequestType - -func init() { - t["QueryIORMConfigOption"] = reflect.TypeOf((*QueryIORMConfigOption)(nil)).Elem() -} - -type QueryIORMConfigOptionRequestType struct { - This ManagedObjectReference `xml:"_this"` - Host ManagedObjectReference `xml:"host"` -} - -func init() { - t["QueryIORMConfigOptionRequestType"] = reflect.TypeOf((*QueryIORMConfigOptionRequestType)(nil)).Elem() -} - -type QueryIORMConfigOptionResponse struct { - Returnval StorageIORMConfigOption `xml:"returnval"` -} - -type QueryIPAllocations QueryIPAllocationsRequestType - -func init() { - t["QueryIPAllocations"] = reflect.TypeOf((*QueryIPAllocations)(nil)).Elem() -} - -type QueryIPAllocationsRequestType struct { - This ManagedObjectReference `xml:"_this"` - Dc ManagedObjectReference `xml:"dc"` - PoolId int `xml:"poolId"` - ExtensionKey string `xml:"extensionKey"` -} - -func init() { - t["QueryIPAllocationsRequestType"] = reflect.TypeOf((*QueryIPAllocationsRequestType)(nil)).Elem() -} - -type QueryIPAllocationsResponse struct { - Returnval []IpPoolManagerIpAllocation `xml:"returnval"` -} - -type QueryIpPools QueryIpPoolsRequestType - -func init() { - t["QueryIpPools"] = reflect.TypeOf((*QueryIpPools)(nil)).Elem() -} - -type QueryIpPoolsRequestType struct { - This ManagedObjectReference `xml:"_this"` - Dc ManagedObjectReference `xml:"dc"` -} - -func init() { - t["QueryIpPoolsRequestType"] = reflect.TypeOf((*QueryIpPoolsRequestType)(nil)).Elem() -} - -type QueryIpPoolsResponse struct { - Returnval []IpPool `xml:"returnval,omitempty"` -} - -type QueryLicenseSourceAvailability QueryLicenseSourceAvailabilityRequestType - -func init() { - t["QueryLicenseSourceAvailability"] = reflect.TypeOf((*QueryLicenseSourceAvailability)(nil)).Elem() -} - -type QueryLicenseSourceAvailabilityRequestType struct { - This ManagedObjectReference `xml:"_this"` - Host *ManagedObjectReference `xml:"host,omitempty"` -} - -func init() { - t["QueryLicenseSourceAvailabilityRequestType"] = reflect.TypeOf((*QueryLicenseSourceAvailabilityRequestType)(nil)).Elem() -} - -type QueryLicenseSourceAvailabilityResponse struct { - Returnval []LicenseAvailabilityInfo `xml:"returnval,omitempty"` -} - -type QueryLicenseUsage QueryLicenseUsageRequestType - -func init() { - t["QueryLicenseUsage"] = reflect.TypeOf((*QueryLicenseUsage)(nil)).Elem() -} - -type QueryLicenseUsageRequestType struct { - This ManagedObjectReference `xml:"_this"` - Host *ManagedObjectReference `xml:"host,omitempty"` -} - -func init() { - t["QueryLicenseUsageRequestType"] = reflect.TypeOf((*QueryLicenseUsageRequestType)(nil)).Elem() -} - -type QueryLicenseUsageResponse struct { - Returnval LicenseUsageInfo `xml:"returnval"` -} - -type QueryManagedBy QueryManagedByRequestType - -func init() { - t["QueryManagedBy"] = reflect.TypeOf((*QueryManagedBy)(nil)).Elem() -} - -type QueryManagedByRequestType struct { - This ManagedObjectReference `xml:"_this"` - ExtensionKey string `xml:"extensionKey"` -} - -func init() { - t["QueryManagedByRequestType"] = reflect.TypeOf((*QueryManagedByRequestType)(nil)).Elem() -} - -type QueryManagedByResponse struct { - Returnval []ManagedObjectReference `xml:"returnval,omitempty"` -} - -type QueryMemoryOverhead QueryMemoryOverheadRequestType - -func init() { - t["QueryMemoryOverhead"] = reflect.TypeOf((*QueryMemoryOverhead)(nil)).Elem() -} - -type QueryMemoryOverheadEx QueryMemoryOverheadExRequestType - -func init() { - t["QueryMemoryOverheadEx"] = reflect.TypeOf((*QueryMemoryOverheadEx)(nil)).Elem() -} - -type QueryMemoryOverheadExRequestType struct { - This ManagedObjectReference `xml:"_this"` - VmConfigInfo VirtualMachineConfigInfo `xml:"vmConfigInfo"` -} - -func init() { - t["QueryMemoryOverheadExRequestType"] = reflect.TypeOf((*QueryMemoryOverheadExRequestType)(nil)).Elem() -} - -type QueryMemoryOverheadExResponse struct { - Returnval int64 `xml:"returnval"` -} - -type QueryMemoryOverheadRequestType struct { - This ManagedObjectReference `xml:"_this"` - MemorySize int64 `xml:"memorySize"` - VideoRamSize int `xml:"videoRamSize,omitempty"` - NumVcpus int `xml:"numVcpus"` -} - -func init() { - t["QueryMemoryOverheadRequestType"] = reflect.TypeOf((*QueryMemoryOverheadRequestType)(nil)).Elem() -} - -type QueryMemoryOverheadResponse struct { - Returnval int64 `xml:"returnval"` -} - -type QueryMigrationDependencies QueryMigrationDependenciesRequestType - -func init() { - t["QueryMigrationDependencies"] = reflect.TypeOf((*QueryMigrationDependencies)(nil)).Elem() -} - -type QueryMigrationDependenciesRequestType struct { - This ManagedObjectReference `xml:"_this"` - PnicDevice []string `xml:"pnicDevice"` -} - -func init() { - t["QueryMigrationDependenciesRequestType"] = reflect.TypeOf((*QueryMigrationDependenciesRequestType)(nil)).Elem() -} - -type QueryMigrationDependenciesResponse struct { - Returnval IscsiMigrationDependency `xml:"returnval"` -} - -type QueryModules QueryModulesRequestType - -func init() { - t["QueryModules"] = reflect.TypeOf((*QueryModules)(nil)).Elem() -} - -type QueryModulesRequestType struct { - This ManagedObjectReference `xml:"_this"` -} - -func init() { - t["QueryModulesRequestType"] = reflect.TypeOf((*QueryModulesRequestType)(nil)).Elem() -} - -type QueryModulesResponse struct { - Returnval []KernelModuleInfo `xml:"returnval,omitempty"` -} - -type QueryNetConfig QueryNetConfigRequestType - -func init() { - t["QueryNetConfig"] = reflect.TypeOf((*QueryNetConfig)(nil)).Elem() -} - -type QueryNetConfigRequestType struct { - This ManagedObjectReference `xml:"_this"` - NicType string `xml:"nicType"` -} - -func init() { - t["QueryNetConfigRequestType"] = reflect.TypeOf((*QueryNetConfigRequestType)(nil)).Elem() -} - -type QueryNetConfigResponse struct { - Returnval *VirtualNicManagerNetConfig `xml:"returnval,omitempty"` -} - -type QueryNetworkHint QueryNetworkHintRequestType - -func init() { - t["QueryNetworkHint"] = reflect.TypeOf((*QueryNetworkHint)(nil)).Elem() -} - -type QueryNetworkHintRequestType struct { - This ManagedObjectReference `xml:"_this"` - Device []string `xml:"device,omitempty"` -} - -func init() { - t["QueryNetworkHintRequestType"] = reflect.TypeOf((*QueryNetworkHintRequestType)(nil)).Elem() -} - -type QueryNetworkHintResponse struct { - Returnval []PhysicalNicHintInfo `xml:"returnval,omitempty"` -} - -type QueryObjectsOnPhysicalVsanDisk QueryObjectsOnPhysicalVsanDiskRequestType - -func init() { - t["QueryObjectsOnPhysicalVsanDisk"] = reflect.TypeOf((*QueryObjectsOnPhysicalVsanDisk)(nil)).Elem() -} - -type QueryObjectsOnPhysicalVsanDiskRequestType struct { - This ManagedObjectReference `xml:"_this"` - Disks []string `xml:"disks"` -} - -func init() { - t["QueryObjectsOnPhysicalVsanDiskRequestType"] = reflect.TypeOf((*QueryObjectsOnPhysicalVsanDiskRequestType)(nil)).Elem() -} - -type QueryObjectsOnPhysicalVsanDiskResponse struct { - Returnval string `xml:"returnval"` -} - -type QueryOptions QueryOptionsRequestType - -func init() { - t["QueryOptions"] = reflect.TypeOf((*QueryOptions)(nil)).Elem() -} - -type QueryOptionsRequestType struct { - This ManagedObjectReference `xml:"_this"` - Name string `xml:"name,omitempty"` -} - -func init() { - t["QueryOptionsRequestType"] = reflect.TypeOf((*QueryOptionsRequestType)(nil)).Elem() -} - -type QueryOptionsResponse struct { - Returnval []BaseOptionValue `xml:"returnval,omitempty,typeattr"` -} - -type QueryPartitionCreateDesc QueryPartitionCreateDescRequestType - -func init() { - t["QueryPartitionCreateDesc"] = reflect.TypeOf((*QueryPartitionCreateDesc)(nil)).Elem() -} - -type QueryPartitionCreateDescRequestType struct { - This ManagedObjectReference `xml:"_this"` - DiskUuid string `xml:"diskUuid"` - DiagnosticType string `xml:"diagnosticType"` -} - -func init() { - t["QueryPartitionCreateDescRequestType"] = reflect.TypeOf((*QueryPartitionCreateDescRequestType)(nil)).Elem() -} - -type QueryPartitionCreateDescResponse struct { - Returnval HostDiagnosticPartitionCreateDescription `xml:"returnval"` -} - -type QueryPartitionCreateOptions QueryPartitionCreateOptionsRequestType - -func init() { - t["QueryPartitionCreateOptions"] = reflect.TypeOf((*QueryPartitionCreateOptions)(nil)).Elem() -} - -type QueryPartitionCreateOptionsRequestType struct { - This ManagedObjectReference `xml:"_this"` - StorageType string `xml:"storageType"` - DiagnosticType string `xml:"diagnosticType"` -} - -func init() { - t["QueryPartitionCreateOptionsRequestType"] = reflect.TypeOf((*QueryPartitionCreateOptionsRequestType)(nil)).Elem() -} - -type QueryPartitionCreateOptionsResponse struct { - Returnval []HostDiagnosticPartitionCreateOption `xml:"returnval,omitempty"` -} - -type QueryPathSelectionPolicyOptions QueryPathSelectionPolicyOptionsRequestType - -func init() { - t["QueryPathSelectionPolicyOptions"] = reflect.TypeOf((*QueryPathSelectionPolicyOptions)(nil)).Elem() -} - -type QueryPathSelectionPolicyOptionsRequestType struct { - This ManagedObjectReference `xml:"_this"` -} - -func init() { - t["QueryPathSelectionPolicyOptionsRequestType"] = reflect.TypeOf((*QueryPathSelectionPolicyOptionsRequestType)(nil)).Elem() -} - -type QueryPathSelectionPolicyOptionsResponse struct { - Returnval []HostPathSelectionPolicyOption `xml:"returnval,omitempty"` -} - -type QueryPerf QueryPerfRequestType - -func init() { - t["QueryPerf"] = reflect.TypeOf((*QueryPerf)(nil)).Elem() -} - -type QueryPerfComposite QueryPerfCompositeRequestType - -func init() { - t["QueryPerfComposite"] = reflect.TypeOf((*QueryPerfComposite)(nil)).Elem() -} - -type QueryPerfCompositeRequestType struct { - This ManagedObjectReference `xml:"_this"` - QuerySpec PerfQuerySpec `xml:"querySpec"` -} - -func init() { - t["QueryPerfCompositeRequestType"] = reflect.TypeOf((*QueryPerfCompositeRequestType)(nil)).Elem() -} - -type QueryPerfCompositeResponse struct { - Returnval PerfCompositeMetric `xml:"returnval"` -} - -type QueryPerfCounter QueryPerfCounterRequestType - -func init() { - t["QueryPerfCounter"] = reflect.TypeOf((*QueryPerfCounter)(nil)).Elem() -} - -type QueryPerfCounterByLevel QueryPerfCounterByLevelRequestType - -func init() { - t["QueryPerfCounterByLevel"] = reflect.TypeOf((*QueryPerfCounterByLevel)(nil)).Elem() -} - -type QueryPerfCounterByLevelRequestType struct { - This ManagedObjectReference `xml:"_this"` - Level int `xml:"level"` -} - -func init() { - t["QueryPerfCounterByLevelRequestType"] = reflect.TypeOf((*QueryPerfCounterByLevelRequestType)(nil)).Elem() -} - -type QueryPerfCounterByLevelResponse struct { - Returnval []PerfCounterInfo `xml:"returnval"` -} - -type QueryPerfCounterRequestType struct { - This ManagedObjectReference `xml:"_this"` - CounterId []int `xml:"counterId"` -} - -func init() { - t["QueryPerfCounterRequestType"] = reflect.TypeOf((*QueryPerfCounterRequestType)(nil)).Elem() -} - -type QueryPerfCounterResponse struct { - Returnval []PerfCounterInfo `xml:"returnval,omitempty"` -} - -type QueryPerfProviderSummary QueryPerfProviderSummaryRequestType - -func init() { - t["QueryPerfProviderSummary"] = reflect.TypeOf((*QueryPerfProviderSummary)(nil)).Elem() -} - -type QueryPerfProviderSummaryRequestType struct { - This ManagedObjectReference `xml:"_this"` - Entity ManagedObjectReference `xml:"entity"` -} - -func init() { - t["QueryPerfProviderSummaryRequestType"] = reflect.TypeOf((*QueryPerfProviderSummaryRequestType)(nil)).Elem() -} - -type QueryPerfProviderSummaryResponse struct { - Returnval PerfProviderSummary `xml:"returnval"` -} - -type QueryPerfRequestType struct { - This ManagedObjectReference `xml:"_this"` - QuerySpec []PerfQuerySpec `xml:"querySpec"` -} - -func init() { - t["QueryPerfRequestType"] = reflect.TypeOf((*QueryPerfRequestType)(nil)).Elem() -} - -type QueryPerfResponse struct { - Returnval []BasePerfEntityMetricBase `xml:"returnval,omitempty,typeattr"` -} - -type QueryPhysicalVsanDisks QueryPhysicalVsanDisksRequestType - -func init() { - t["QueryPhysicalVsanDisks"] = reflect.TypeOf((*QueryPhysicalVsanDisks)(nil)).Elem() -} - -type QueryPhysicalVsanDisksRequestType struct { - This ManagedObjectReference `xml:"_this"` - Props []string `xml:"props,omitempty"` -} - -func init() { - t["QueryPhysicalVsanDisksRequestType"] = reflect.TypeOf((*QueryPhysicalVsanDisksRequestType)(nil)).Elem() -} - -type QueryPhysicalVsanDisksResponse struct { - Returnval string `xml:"returnval"` -} - -type QueryPnicStatus QueryPnicStatusRequestType - -func init() { - t["QueryPnicStatus"] = reflect.TypeOf((*QueryPnicStatus)(nil)).Elem() -} - -type QueryPnicStatusRequestType struct { - This ManagedObjectReference `xml:"_this"` - PnicDevice string `xml:"pnicDevice"` -} - -func init() { - t["QueryPnicStatusRequestType"] = reflect.TypeOf((*QueryPnicStatusRequestType)(nil)).Elem() -} - -type QueryPnicStatusResponse struct { - Returnval IscsiStatus `xml:"returnval"` -} - -type QueryPolicyMetadata QueryPolicyMetadataRequestType - -func init() { - t["QueryPolicyMetadata"] = reflect.TypeOf((*QueryPolicyMetadata)(nil)).Elem() -} - -type QueryPolicyMetadataRequestType struct { - This ManagedObjectReference `xml:"_this"` - PolicyName []string `xml:"policyName,omitempty"` - Profile *ManagedObjectReference `xml:"profile,omitempty"` -} - -func init() { - t["QueryPolicyMetadataRequestType"] = reflect.TypeOf((*QueryPolicyMetadataRequestType)(nil)).Elem() -} - -type QueryPolicyMetadataResponse struct { - Returnval []ProfilePolicyMetadata `xml:"returnval,omitempty"` -} - -type QueryProfileStructure QueryProfileStructureRequestType - -func init() { - t["QueryProfileStructure"] = reflect.TypeOf((*QueryProfileStructure)(nil)).Elem() -} - -type QueryProfileStructureRequestType struct { - This ManagedObjectReference `xml:"_this"` - Profile *ManagedObjectReference `xml:"profile,omitempty"` -} - -func init() { - t["QueryProfileStructureRequestType"] = reflect.TypeOf((*QueryProfileStructureRequestType)(nil)).Elem() -} - -type QueryProfileStructureResponse struct { - Returnval ProfileProfileStructure `xml:"returnval"` -} - -type QueryResourceConfigOption QueryResourceConfigOptionRequestType - -func init() { - t["QueryResourceConfigOption"] = reflect.TypeOf((*QueryResourceConfigOption)(nil)).Elem() -} - -type QueryResourceConfigOptionRequestType struct { - This ManagedObjectReference `xml:"_this"` -} - -func init() { - t["QueryResourceConfigOptionRequestType"] = reflect.TypeOf((*QueryResourceConfigOptionRequestType)(nil)).Elem() -} - -type QueryResourceConfigOptionResponse struct { - Returnval ResourceConfigOption `xml:"returnval"` -} - -type QueryServiceList QueryServiceListRequestType - -func init() { - t["QueryServiceList"] = reflect.TypeOf((*QueryServiceList)(nil)).Elem() -} - -type QueryServiceListRequestType struct { - This ManagedObjectReference `xml:"_this"` - ServiceName string `xml:"serviceName,omitempty"` - Location []string `xml:"location,omitempty"` -} - -func init() { - t["QueryServiceListRequestType"] = reflect.TypeOf((*QueryServiceListRequestType)(nil)).Elem() -} - -type QueryServiceListResponse struct { - Returnval []ServiceManagerServiceInfo `xml:"returnval,omitempty"` -} - -type QueryStorageArrayTypePolicyOptions QueryStorageArrayTypePolicyOptionsRequestType - -func init() { - t["QueryStorageArrayTypePolicyOptions"] = reflect.TypeOf((*QueryStorageArrayTypePolicyOptions)(nil)).Elem() -} - -type QueryStorageArrayTypePolicyOptionsRequestType struct { - This ManagedObjectReference `xml:"_this"` -} - -func init() { - t["QueryStorageArrayTypePolicyOptionsRequestType"] = reflect.TypeOf((*QueryStorageArrayTypePolicyOptionsRequestType)(nil)).Elem() -} - -type QueryStorageArrayTypePolicyOptionsResponse struct { - Returnval []HostStorageArrayTypePolicyOption `xml:"returnval,omitempty"` -} - -type QuerySupportedFeatures QuerySupportedFeaturesRequestType - -func init() { - t["QuerySupportedFeatures"] = reflect.TypeOf((*QuerySupportedFeatures)(nil)).Elem() -} - -type QuerySupportedFeaturesRequestType struct { - This ManagedObjectReference `xml:"_this"` - Host *ManagedObjectReference `xml:"host,omitempty"` -} - -func init() { - t["QuerySupportedFeaturesRequestType"] = reflect.TypeOf((*QuerySupportedFeaturesRequestType)(nil)).Elem() -} - -type QuerySupportedFeaturesResponse struct { - Returnval []LicenseFeatureInfo `xml:"returnval,omitempty"` -} - -type QueryTargetCapabilities QueryTargetCapabilitiesRequestType - -func init() { - t["QueryTargetCapabilities"] = reflect.TypeOf((*QueryTargetCapabilities)(nil)).Elem() -} - -type QueryTargetCapabilitiesRequestType struct { - This ManagedObjectReference `xml:"_this"` - Host *ManagedObjectReference `xml:"host,omitempty"` -} - -func init() { - t["QueryTargetCapabilitiesRequestType"] = reflect.TypeOf((*QueryTargetCapabilitiesRequestType)(nil)).Elem() -} - -type QueryTargetCapabilitiesResponse struct { - Returnval *HostCapability `xml:"returnval,omitempty"` -} - -type QueryTpmAttestationReport QueryTpmAttestationReportRequestType - -func init() { - t["QueryTpmAttestationReport"] = reflect.TypeOf((*QueryTpmAttestationReport)(nil)).Elem() -} - -type QueryTpmAttestationReportRequestType struct { - This ManagedObjectReference `xml:"_this"` -} - -func init() { - t["QueryTpmAttestationReportRequestType"] = reflect.TypeOf((*QueryTpmAttestationReportRequestType)(nil)).Elem() -} - -type QueryTpmAttestationReportResponse struct { - Returnval *HostTpmAttestationReport `xml:"returnval,omitempty"` -} - -type QueryUnownedFiles QueryUnownedFilesRequestType - -func init() { - t["QueryUnownedFiles"] = reflect.TypeOf((*QueryUnownedFiles)(nil)).Elem() -} - -type QueryUnownedFilesRequestType struct { - This ManagedObjectReference `xml:"_this"` -} - -func init() { - t["QueryUnownedFilesRequestType"] = reflect.TypeOf((*QueryUnownedFilesRequestType)(nil)).Elem() -} - -type QueryUnownedFilesResponse struct { - Returnval []string `xml:"returnval,omitempty"` -} - -type QueryUnresolvedVmfsVolume QueryUnresolvedVmfsVolumeRequestType - -func init() { - t["QueryUnresolvedVmfsVolume"] = reflect.TypeOf((*QueryUnresolvedVmfsVolume)(nil)).Elem() -} - -type QueryUnresolvedVmfsVolumeRequestType struct { - This ManagedObjectReference `xml:"_this"` -} - -func init() { - t["QueryUnresolvedVmfsVolumeRequestType"] = reflect.TypeOf((*QueryUnresolvedVmfsVolumeRequestType)(nil)).Elem() -} - -type QueryUnresolvedVmfsVolumeResponse struct { - Returnval []HostUnresolvedVmfsVolume `xml:"returnval,omitempty"` -} - -type QueryUnresolvedVmfsVolumes QueryUnresolvedVmfsVolumesRequestType - -func init() { - t["QueryUnresolvedVmfsVolumes"] = reflect.TypeOf((*QueryUnresolvedVmfsVolumes)(nil)).Elem() -} - -type QueryUnresolvedVmfsVolumesRequestType struct { - This ManagedObjectReference `xml:"_this"` -} - -func init() { - t["QueryUnresolvedVmfsVolumesRequestType"] = reflect.TypeOf((*QueryUnresolvedVmfsVolumesRequestType)(nil)).Elem() -} - -type QueryUnresolvedVmfsVolumesResponse struct { - Returnval []HostUnresolvedVmfsVolume `xml:"returnval,omitempty"` -} - -type QueryUsedVlanIdInDvs QueryUsedVlanIdInDvsRequestType - -func init() { - t["QueryUsedVlanIdInDvs"] = reflect.TypeOf((*QueryUsedVlanIdInDvs)(nil)).Elem() -} - -type QueryUsedVlanIdInDvsRequestType struct { - This ManagedObjectReference `xml:"_this"` -} - -func init() { - t["QueryUsedVlanIdInDvsRequestType"] = reflect.TypeOf((*QueryUsedVlanIdInDvsRequestType)(nil)).Elem() -} - -type QueryUsedVlanIdInDvsResponse struct { - Returnval []int `xml:"returnval,omitempty"` -} - -type QueryVMotionCompatibility QueryVMotionCompatibilityRequestType - -func init() { - t["QueryVMotionCompatibility"] = reflect.TypeOf((*QueryVMotionCompatibility)(nil)).Elem() -} - -type QueryVMotionCompatibilityExRequestType struct { - This ManagedObjectReference `xml:"_this"` - Vm []ManagedObjectReference `xml:"vm"` - Host []ManagedObjectReference `xml:"host"` -} - -func init() { - t["QueryVMotionCompatibilityExRequestType"] = reflect.TypeOf((*QueryVMotionCompatibilityExRequestType)(nil)).Elem() -} - -type QueryVMotionCompatibilityEx_Task QueryVMotionCompatibilityExRequestType - -func init() { - t["QueryVMotionCompatibilityEx_Task"] = reflect.TypeOf((*QueryVMotionCompatibilityEx_Task)(nil)).Elem() -} - -type QueryVMotionCompatibilityEx_TaskResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type QueryVMotionCompatibilityRequestType struct { - This ManagedObjectReference `xml:"_this"` - Vm ManagedObjectReference `xml:"vm"` - Host []ManagedObjectReference `xml:"host"` - Compatibility []string `xml:"compatibility,omitempty"` -} - -func init() { - t["QueryVMotionCompatibilityRequestType"] = reflect.TypeOf((*QueryVMotionCompatibilityRequestType)(nil)).Elem() -} - -type QueryVMotionCompatibilityResponse struct { - Returnval []HostVMotionCompatibility `xml:"returnval,omitempty"` -} - -type QueryVirtualDiskFragmentation QueryVirtualDiskFragmentationRequestType - -func init() { - t["QueryVirtualDiskFragmentation"] = reflect.TypeOf((*QueryVirtualDiskFragmentation)(nil)).Elem() -} - -type QueryVirtualDiskFragmentationRequestType struct { - This ManagedObjectReference `xml:"_this"` - Name string `xml:"name"` - Datacenter *ManagedObjectReference `xml:"datacenter,omitempty"` -} - -func init() { - t["QueryVirtualDiskFragmentationRequestType"] = reflect.TypeOf((*QueryVirtualDiskFragmentationRequestType)(nil)).Elem() -} - -type QueryVirtualDiskFragmentationResponse struct { - Returnval int `xml:"returnval"` -} - -type QueryVirtualDiskGeometry QueryVirtualDiskGeometryRequestType - -func init() { - t["QueryVirtualDiskGeometry"] = reflect.TypeOf((*QueryVirtualDiskGeometry)(nil)).Elem() -} - -type QueryVirtualDiskGeometryRequestType struct { - This ManagedObjectReference `xml:"_this"` - Name string `xml:"name"` - Datacenter *ManagedObjectReference `xml:"datacenter,omitempty"` -} - -func init() { - t["QueryVirtualDiskGeometryRequestType"] = reflect.TypeOf((*QueryVirtualDiskGeometryRequestType)(nil)).Elem() -} - -type QueryVirtualDiskGeometryResponse struct { - Returnval HostDiskDimensionsChs `xml:"returnval"` -} - -type QueryVirtualDiskUuid QueryVirtualDiskUuidRequestType - -func init() { - t["QueryVirtualDiskUuid"] = reflect.TypeOf((*QueryVirtualDiskUuid)(nil)).Elem() -} - -type QueryVirtualDiskUuidRequestType struct { - This ManagedObjectReference `xml:"_this"` - Name string `xml:"name"` - Datacenter *ManagedObjectReference `xml:"datacenter,omitempty"` -} - -func init() { - t["QueryVirtualDiskUuidRequestType"] = reflect.TypeOf((*QueryVirtualDiskUuidRequestType)(nil)).Elem() -} - -type QueryVirtualDiskUuidResponse struct { - Returnval string `xml:"returnval"` -} - -type QueryVmfsDatastoreCreateOptions QueryVmfsDatastoreCreateOptionsRequestType - -func init() { - t["QueryVmfsDatastoreCreateOptions"] = reflect.TypeOf((*QueryVmfsDatastoreCreateOptions)(nil)).Elem() -} - -type QueryVmfsDatastoreCreateOptionsRequestType struct { - This ManagedObjectReference `xml:"_this"` - DevicePath string `xml:"devicePath"` - VmfsMajorVersion int `xml:"vmfsMajorVersion,omitempty"` -} - -func init() { - t["QueryVmfsDatastoreCreateOptionsRequestType"] = reflect.TypeOf((*QueryVmfsDatastoreCreateOptionsRequestType)(nil)).Elem() -} - -type QueryVmfsDatastoreCreateOptionsResponse struct { - Returnval []VmfsDatastoreOption `xml:"returnval,omitempty"` -} - -type QueryVmfsDatastoreExpandOptions QueryVmfsDatastoreExpandOptionsRequestType - -func init() { - t["QueryVmfsDatastoreExpandOptions"] = reflect.TypeOf((*QueryVmfsDatastoreExpandOptions)(nil)).Elem() -} - -type QueryVmfsDatastoreExpandOptionsRequestType struct { - This ManagedObjectReference `xml:"_this"` - Datastore ManagedObjectReference `xml:"datastore"` -} - -func init() { - t["QueryVmfsDatastoreExpandOptionsRequestType"] = reflect.TypeOf((*QueryVmfsDatastoreExpandOptionsRequestType)(nil)).Elem() -} - -type QueryVmfsDatastoreExpandOptionsResponse struct { - Returnval []VmfsDatastoreOption `xml:"returnval,omitempty"` -} - -type QueryVmfsDatastoreExtendOptions QueryVmfsDatastoreExtendOptionsRequestType - -func init() { - t["QueryVmfsDatastoreExtendOptions"] = reflect.TypeOf((*QueryVmfsDatastoreExtendOptions)(nil)).Elem() -} - -type QueryVmfsDatastoreExtendOptionsRequestType struct { - This ManagedObjectReference `xml:"_this"` - Datastore ManagedObjectReference `xml:"datastore"` - DevicePath string `xml:"devicePath"` - SuppressExpandCandidates *bool `xml:"suppressExpandCandidates"` -} - -func init() { - t["QueryVmfsDatastoreExtendOptionsRequestType"] = reflect.TypeOf((*QueryVmfsDatastoreExtendOptionsRequestType)(nil)).Elem() -} - -type QueryVmfsDatastoreExtendOptionsResponse struct { - Returnval []VmfsDatastoreOption `xml:"returnval,omitempty"` -} - -type QueryVnicStatus QueryVnicStatusRequestType - -func init() { - t["QueryVnicStatus"] = reflect.TypeOf((*QueryVnicStatus)(nil)).Elem() -} - -type QueryVnicStatusRequestType struct { - This ManagedObjectReference `xml:"_this"` - VnicDevice string `xml:"vnicDevice"` -} - -func init() { - t["QueryVnicStatusRequestType"] = reflect.TypeOf((*QueryVnicStatusRequestType)(nil)).Elem() -} - -type QueryVnicStatusResponse struct { - Returnval IscsiStatus `xml:"returnval"` -} - -type QueryVsanObjects QueryVsanObjectsRequestType - -func init() { - t["QueryVsanObjects"] = reflect.TypeOf((*QueryVsanObjects)(nil)).Elem() -} - -type QueryVsanObjectsRequestType struct { - This ManagedObjectReference `xml:"_this"` - Uuids []string `xml:"uuids,omitempty"` -} - -func init() { - t["QueryVsanObjectsRequestType"] = reflect.TypeOf((*QueryVsanObjectsRequestType)(nil)).Elem() -} - -type QueryVsanObjectsResponse struct { - Returnval string `xml:"returnval"` -} - -type QuestionPending struct { - InvalidState - - Text string `xml:"text"` -} - -func init() { - t["QuestionPending"] = reflect.TypeOf((*QuestionPending)(nil)).Elem() -} - -type QuestionPendingFault QuestionPending - -func init() { - t["QuestionPendingFault"] = reflect.TypeOf((*QuestionPendingFault)(nil)).Elem() -} - -type QuiesceDatastoreIOForHAFailed struct { - ResourceInUse - - Host ManagedObjectReference `xml:"host"` - HostName string `xml:"hostName"` - Ds ManagedObjectReference `xml:"ds"` - DsName string `xml:"dsName"` -} - -func init() { - t["QuiesceDatastoreIOForHAFailed"] = reflect.TypeOf((*QuiesceDatastoreIOForHAFailed)(nil)).Elem() -} - -type QuiesceDatastoreIOForHAFailedFault QuiesceDatastoreIOForHAFailed - -func init() { - t["QuiesceDatastoreIOForHAFailedFault"] = reflect.TypeOf((*QuiesceDatastoreIOForHAFailedFault)(nil)).Elem() -} - -type RDMConversionNotSupported struct { - MigrationFault - - Device string `xml:"device"` -} - -func init() { - t["RDMConversionNotSupported"] = reflect.TypeOf((*RDMConversionNotSupported)(nil)).Elem() -} - -type RDMConversionNotSupportedFault RDMConversionNotSupported - -func init() { - t["RDMConversionNotSupportedFault"] = reflect.TypeOf((*RDMConversionNotSupportedFault)(nil)).Elem() -} - -type RDMNotPreserved struct { - MigrationFault - - Device string `xml:"device"` -} - -func init() { - t["RDMNotPreserved"] = reflect.TypeOf((*RDMNotPreserved)(nil)).Elem() -} - -type RDMNotPreservedFault RDMNotPreserved - -func init() { - t["RDMNotPreservedFault"] = reflect.TypeOf((*RDMNotPreservedFault)(nil)).Elem() -} - -type RDMNotSupported struct { - DeviceNotSupported -} - -func init() { - t["RDMNotSupported"] = reflect.TypeOf((*RDMNotSupported)(nil)).Elem() -} - -type RDMNotSupportedFault BaseRDMNotSupported - -func init() { - t["RDMNotSupportedFault"] = reflect.TypeOf((*RDMNotSupportedFault)(nil)).Elem() -} - -type RDMNotSupportedOnDatastore struct { - VmConfigFault - - Device string `xml:"device"` - Datastore ManagedObjectReference `xml:"datastore"` - DatastoreName string `xml:"datastoreName"` -} - -func init() { - t["RDMNotSupportedOnDatastore"] = reflect.TypeOf((*RDMNotSupportedOnDatastore)(nil)).Elem() -} - -type RDMNotSupportedOnDatastoreFault RDMNotSupportedOnDatastore - -func init() { - t["RDMNotSupportedOnDatastoreFault"] = reflect.TypeOf((*RDMNotSupportedOnDatastoreFault)(nil)).Elem() -} - -type RDMPointsToInaccessibleDisk struct { - CannotAccessVmDisk -} - -func init() { - t["RDMPointsToInaccessibleDisk"] = reflect.TypeOf((*RDMPointsToInaccessibleDisk)(nil)).Elem() -} - -type RDMPointsToInaccessibleDiskFault RDMPointsToInaccessibleDisk - -func init() { - t["RDMPointsToInaccessibleDiskFault"] = reflect.TypeOf((*RDMPointsToInaccessibleDiskFault)(nil)).Elem() -} - -type RawDiskNotSupported struct { - DeviceNotSupported -} - -func init() { - t["RawDiskNotSupported"] = reflect.TypeOf((*RawDiskNotSupported)(nil)).Elem() -} - -type RawDiskNotSupportedFault RawDiskNotSupported - -func init() { - t["RawDiskNotSupportedFault"] = reflect.TypeOf((*RawDiskNotSupportedFault)(nil)).Elem() -} - -type ReadEnvironmentVariableInGuest ReadEnvironmentVariableInGuestRequestType - -func init() { - t["ReadEnvironmentVariableInGuest"] = reflect.TypeOf((*ReadEnvironmentVariableInGuest)(nil)).Elem() -} - -type ReadEnvironmentVariableInGuestRequestType struct { - This ManagedObjectReference `xml:"_this"` - Vm ManagedObjectReference `xml:"vm"` - Auth BaseGuestAuthentication `xml:"auth,typeattr"` - Names []string `xml:"names,omitempty"` -} - -func init() { - t["ReadEnvironmentVariableInGuestRequestType"] = reflect.TypeOf((*ReadEnvironmentVariableInGuestRequestType)(nil)).Elem() -} - -type ReadEnvironmentVariableInGuestResponse struct { - Returnval []string `xml:"returnval,omitempty"` -} - -type ReadHostResourcePoolTreeFailed struct { - HostConnectFault -} - -func init() { - t["ReadHostResourcePoolTreeFailed"] = reflect.TypeOf((*ReadHostResourcePoolTreeFailed)(nil)).Elem() -} - -type ReadHostResourcePoolTreeFailedFault ReadHostResourcePoolTreeFailed - -func init() { - t["ReadHostResourcePoolTreeFailedFault"] = reflect.TypeOf((*ReadHostResourcePoolTreeFailedFault)(nil)).Elem() -} - -type ReadNextEvents ReadNextEventsRequestType - -func init() { - t["ReadNextEvents"] = reflect.TypeOf((*ReadNextEvents)(nil)).Elem() -} - -type ReadNextEventsRequestType struct { - This ManagedObjectReference `xml:"_this"` - MaxCount int `xml:"maxCount"` -} - -func init() { - t["ReadNextEventsRequestType"] = reflect.TypeOf((*ReadNextEventsRequestType)(nil)).Elem() -} - -type ReadNextEventsResponse struct { - Returnval []BaseEvent `xml:"returnval,omitempty,typeattr"` -} - -type ReadNextTasks ReadNextTasksRequestType - -func init() { - t["ReadNextTasks"] = reflect.TypeOf((*ReadNextTasks)(nil)).Elem() -} - -type ReadNextTasksRequestType struct { - This ManagedObjectReference `xml:"_this"` - MaxCount int `xml:"maxCount"` -} - -func init() { - t["ReadNextTasksRequestType"] = reflect.TypeOf((*ReadNextTasksRequestType)(nil)).Elem() -} - -type ReadNextTasksResponse struct { - Returnval []TaskInfo `xml:"returnval,omitempty"` -} - -type ReadOnlyDisksWithLegacyDestination struct { - MigrationFault - - RoDiskCount int `xml:"roDiskCount"` - TimeoutDanger bool `xml:"timeoutDanger"` -} - -func init() { - t["ReadOnlyDisksWithLegacyDestination"] = reflect.TypeOf((*ReadOnlyDisksWithLegacyDestination)(nil)).Elem() -} - -type ReadOnlyDisksWithLegacyDestinationFault ReadOnlyDisksWithLegacyDestination - -func init() { - t["ReadOnlyDisksWithLegacyDestinationFault"] = reflect.TypeOf((*ReadOnlyDisksWithLegacyDestinationFault)(nil)).Elem() -} - -type ReadPreviousEvents ReadPreviousEventsRequestType - -func init() { - t["ReadPreviousEvents"] = reflect.TypeOf((*ReadPreviousEvents)(nil)).Elem() -} - -type ReadPreviousEventsRequestType struct { - This ManagedObjectReference `xml:"_this"` - MaxCount int `xml:"maxCount"` -} - -func init() { - t["ReadPreviousEventsRequestType"] = reflect.TypeOf((*ReadPreviousEventsRequestType)(nil)).Elem() -} - -type ReadPreviousEventsResponse struct { - Returnval []BaseEvent `xml:"returnval,omitempty,typeattr"` -} - -type ReadPreviousTasks ReadPreviousTasksRequestType - -func init() { - t["ReadPreviousTasks"] = reflect.TypeOf((*ReadPreviousTasks)(nil)).Elem() -} - -type ReadPreviousTasksRequestType struct { - This ManagedObjectReference `xml:"_this"` - MaxCount int `xml:"maxCount"` -} - -func init() { - t["ReadPreviousTasksRequestType"] = reflect.TypeOf((*ReadPreviousTasksRequestType)(nil)).Elem() -} - -type ReadPreviousTasksResponse struct { - Returnval []TaskInfo `xml:"returnval,omitempty"` -} - -type RebootGuest RebootGuestRequestType - -func init() { - t["RebootGuest"] = reflect.TypeOf((*RebootGuest)(nil)).Elem() -} - -type RebootGuestRequestType struct { - This ManagedObjectReference `xml:"_this"` -} - -func init() { - t["RebootGuestRequestType"] = reflect.TypeOf((*RebootGuestRequestType)(nil)).Elem() -} - -type RebootGuestResponse struct { -} - -type RebootHostRequestType struct { - This ManagedObjectReference `xml:"_this"` - Force bool `xml:"force"` -} - -func init() { - t["RebootHostRequestType"] = reflect.TypeOf((*RebootHostRequestType)(nil)).Elem() -} - -type RebootHost_Task RebootHostRequestType - -func init() { - t["RebootHost_Task"] = reflect.TypeOf((*RebootHost_Task)(nil)).Elem() -} - -type RebootHost_TaskResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type RebootRequired struct { - VimFault - - Patch string `xml:"patch,omitempty"` -} - -func init() { - t["RebootRequired"] = reflect.TypeOf((*RebootRequired)(nil)).Elem() -} - -type RebootRequiredFault RebootRequired - -func init() { - t["RebootRequiredFault"] = reflect.TypeOf((*RebootRequiredFault)(nil)).Elem() -} - -type RecommendDatastores RecommendDatastoresRequestType - -func init() { - t["RecommendDatastores"] = reflect.TypeOf((*RecommendDatastores)(nil)).Elem() -} - -type RecommendDatastoresRequestType struct { - This ManagedObjectReference `xml:"_this"` - StorageSpec StoragePlacementSpec `xml:"storageSpec"` -} - -func init() { - t["RecommendDatastoresRequestType"] = reflect.TypeOf((*RecommendDatastoresRequestType)(nil)).Elem() -} - -type RecommendDatastoresResponse struct { - Returnval StoragePlacementResult `xml:"returnval"` -} - -type RecommendHostsForVm RecommendHostsForVmRequestType - -func init() { - t["RecommendHostsForVm"] = reflect.TypeOf((*RecommendHostsForVm)(nil)).Elem() -} - -type RecommendHostsForVmRequestType struct { - This ManagedObjectReference `xml:"_this"` - Vm ManagedObjectReference `xml:"vm"` - Pool *ManagedObjectReference `xml:"pool,omitempty"` -} - -func init() { - t["RecommendHostsForVmRequestType"] = reflect.TypeOf((*RecommendHostsForVmRequestType)(nil)).Elem() -} - -type RecommendHostsForVmResponse struct { - Returnval []ClusterHostRecommendation `xml:"returnval,omitempty"` -} - -type ReconfigVMRequestType struct { - This ManagedObjectReference `xml:"_this"` - Spec VirtualMachineConfigSpec `xml:"spec"` -} - -func init() { - t["ReconfigVMRequestType"] = reflect.TypeOf((*ReconfigVMRequestType)(nil)).Elem() -} - -type ReconfigVM_Task ReconfigVMRequestType - -func init() { - t["ReconfigVM_Task"] = reflect.TypeOf((*ReconfigVM_Task)(nil)).Elem() -} - -type ReconfigVM_TaskResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type ReconfigureAlarm ReconfigureAlarmRequestType - -func init() { - t["ReconfigureAlarm"] = reflect.TypeOf((*ReconfigureAlarm)(nil)).Elem() -} - -type ReconfigureAlarmRequestType struct { - This ManagedObjectReference `xml:"_this"` - Spec BaseAlarmSpec `xml:"spec,typeattr"` -} - -func init() { - t["ReconfigureAlarmRequestType"] = reflect.TypeOf((*ReconfigureAlarmRequestType)(nil)).Elem() -} - -type ReconfigureAlarmResponse struct { -} - -type ReconfigureAutostart ReconfigureAutostartRequestType - -func init() { - t["ReconfigureAutostart"] = reflect.TypeOf((*ReconfigureAutostart)(nil)).Elem() -} - -type ReconfigureAutostartRequestType struct { - This ManagedObjectReference `xml:"_this"` - Spec HostAutoStartManagerConfig `xml:"spec"` -} - -func init() { - t["ReconfigureAutostartRequestType"] = reflect.TypeOf((*ReconfigureAutostartRequestType)(nil)).Elem() -} - -type ReconfigureAutostartResponse struct { -} - -type ReconfigureClusterRequestType struct { - This ManagedObjectReference `xml:"_this"` - Spec ClusterConfigSpec `xml:"spec"` - Modify bool `xml:"modify"` -} - -func init() { - t["ReconfigureClusterRequestType"] = reflect.TypeOf((*ReconfigureClusterRequestType)(nil)).Elem() -} - -type ReconfigureCluster_Task ReconfigureClusterRequestType - -func init() { - t["ReconfigureCluster_Task"] = reflect.TypeOf((*ReconfigureCluster_Task)(nil)).Elem() -} - -type ReconfigureCluster_TaskResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type ReconfigureComputeResourceRequestType struct { - This ManagedObjectReference `xml:"_this"` - Spec BaseComputeResourceConfigSpec `xml:"spec,typeattr"` - Modify bool `xml:"modify"` -} - -func init() { - t["ReconfigureComputeResourceRequestType"] = reflect.TypeOf((*ReconfigureComputeResourceRequestType)(nil)).Elem() -} - -type ReconfigureComputeResource_Task ReconfigureComputeResourceRequestType - -func init() { - t["ReconfigureComputeResource_Task"] = reflect.TypeOf((*ReconfigureComputeResource_Task)(nil)).Elem() -} - -type ReconfigureComputeResource_TaskResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type ReconfigureDVPortRequestType struct { - This ManagedObjectReference `xml:"_this"` - Port []DVPortConfigSpec `xml:"port"` -} - -func init() { - t["ReconfigureDVPortRequestType"] = reflect.TypeOf((*ReconfigureDVPortRequestType)(nil)).Elem() -} - -type ReconfigureDVPort_Task ReconfigureDVPortRequestType - -func init() { - t["ReconfigureDVPort_Task"] = reflect.TypeOf((*ReconfigureDVPort_Task)(nil)).Elem() -} - -type ReconfigureDVPort_TaskResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type ReconfigureDVPortgroupRequestType struct { - This ManagedObjectReference `xml:"_this"` - Spec DVPortgroupConfigSpec `xml:"spec"` -} - -func init() { - t["ReconfigureDVPortgroupRequestType"] = reflect.TypeOf((*ReconfigureDVPortgroupRequestType)(nil)).Elem() -} - -type ReconfigureDVPortgroup_Task ReconfigureDVPortgroupRequestType - -func init() { - t["ReconfigureDVPortgroup_Task"] = reflect.TypeOf((*ReconfigureDVPortgroup_Task)(nil)).Elem() -} - -type ReconfigureDVPortgroup_TaskResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type ReconfigureDatacenterRequestType struct { - This ManagedObjectReference `xml:"_this"` - Spec DatacenterConfigSpec `xml:"spec"` - Modify bool `xml:"modify"` -} - -func init() { - t["ReconfigureDatacenterRequestType"] = reflect.TypeOf((*ReconfigureDatacenterRequestType)(nil)).Elem() -} - -type ReconfigureDatacenter_Task ReconfigureDatacenterRequestType - -func init() { - t["ReconfigureDatacenter_Task"] = reflect.TypeOf((*ReconfigureDatacenter_Task)(nil)).Elem() -} - -type ReconfigureDatacenter_TaskResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type ReconfigureDvsRequestType struct { - This ManagedObjectReference `xml:"_this"` - Spec BaseDVSConfigSpec `xml:"spec,typeattr"` -} - -func init() { - t["ReconfigureDvsRequestType"] = reflect.TypeOf((*ReconfigureDvsRequestType)(nil)).Elem() -} - -type ReconfigureDvs_Task ReconfigureDvsRequestType - -func init() { - t["ReconfigureDvs_Task"] = reflect.TypeOf((*ReconfigureDvs_Task)(nil)).Elem() -} - -type ReconfigureDvs_TaskResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type ReconfigureHostForDASRequestType struct { - This ManagedObjectReference `xml:"_this"` -} - -func init() { - t["ReconfigureHostForDASRequestType"] = reflect.TypeOf((*ReconfigureHostForDASRequestType)(nil)).Elem() -} - -type ReconfigureHostForDAS_Task ReconfigureHostForDASRequestType - -func init() { - t["ReconfigureHostForDAS_Task"] = reflect.TypeOf((*ReconfigureHostForDAS_Task)(nil)).Elem() -} - -type ReconfigureHostForDAS_TaskResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type ReconfigureScheduledTask ReconfigureScheduledTaskRequestType - -func init() { - t["ReconfigureScheduledTask"] = reflect.TypeOf((*ReconfigureScheduledTask)(nil)).Elem() -} - -type ReconfigureScheduledTaskRequestType struct { - This ManagedObjectReference `xml:"_this"` - Spec BaseScheduledTaskSpec `xml:"spec,typeattr"` -} - -func init() { - t["ReconfigureScheduledTaskRequestType"] = reflect.TypeOf((*ReconfigureScheduledTaskRequestType)(nil)).Elem() -} - -type ReconfigureScheduledTaskResponse struct { -} - -type ReconfigureServiceConsoleReservation ReconfigureServiceConsoleReservationRequestType - -func init() { - t["ReconfigureServiceConsoleReservation"] = reflect.TypeOf((*ReconfigureServiceConsoleReservation)(nil)).Elem() -} - -type ReconfigureServiceConsoleReservationRequestType struct { - This ManagedObjectReference `xml:"_this"` - CfgBytes int64 `xml:"cfgBytes"` -} - -func init() { - t["ReconfigureServiceConsoleReservationRequestType"] = reflect.TypeOf((*ReconfigureServiceConsoleReservationRequestType)(nil)).Elem() -} - -type ReconfigureServiceConsoleReservationResponse struct { -} - -type ReconfigureSnmpAgent ReconfigureSnmpAgentRequestType - -func init() { - t["ReconfigureSnmpAgent"] = reflect.TypeOf((*ReconfigureSnmpAgent)(nil)).Elem() -} - -type ReconfigureSnmpAgentRequestType struct { - This ManagedObjectReference `xml:"_this"` - Spec HostSnmpConfigSpec `xml:"spec"` -} - -func init() { - t["ReconfigureSnmpAgentRequestType"] = reflect.TypeOf((*ReconfigureSnmpAgentRequestType)(nil)).Elem() -} - -type ReconfigureSnmpAgentResponse struct { -} - -type ReconfigureVirtualMachineReservation ReconfigureVirtualMachineReservationRequestType - -func init() { - t["ReconfigureVirtualMachineReservation"] = reflect.TypeOf((*ReconfigureVirtualMachineReservation)(nil)).Elem() -} - -type ReconfigureVirtualMachineReservationRequestType struct { - This ManagedObjectReference `xml:"_this"` - Spec VirtualMachineMemoryReservationSpec `xml:"spec"` -} - -func init() { - t["ReconfigureVirtualMachineReservationRequestType"] = reflect.TypeOf((*ReconfigureVirtualMachineReservationRequestType)(nil)).Elem() -} - -type ReconfigureVirtualMachineReservationResponse struct { -} - -type ReconnectHostRequestType struct { - This ManagedObjectReference `xml:"_this"` - CnxSpec *HostConnectSpec `xml:"cnxSpec,omitempty"` - ReconnectSpec *HostSystemReconnectSpec `xml:"reconnectSpec,omitempty"` -} - -func init() { - t["ReconnectHostRequestType"] = reflect.TypeOf((*ReconnectHostRequestType)(nil)).Elem() -} - -type ReconnectHost_Task ReconnectHostRequestType - -func init() { - t["ReconnectHost_Task"] = reflect.TypeOf((*ReconnectHost_Task)(nil)).Elem() -} - -type ReconnectHost_TaskResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type RecordReplayDisabled struct { - VimFault -} - -func init() { - t["RecordReplayDisabled"] = reflect.TypeOf((*RecordReplayDisabled)(nil)).Elem() -} - -type RecordReplayDisabledFault RecordReplayDisabled - -func init() { - t["RecordReplayDisabledFault"] = reflect.TypeOf((*RecordReplayDisabledFault)(nil)).Elem() -} - -type RecoveryEvent struct { - DvsEvent - - HostName string `xml:"hostName"` - PortKey string `xml:"portKey"` - DvsUuid string `xml:"dvsUuid,omitempty"` - Vnic string `xml:"vnic,omitempty"` -} - -func init() { - t["RecoveryEvent"] = reflect.TypeOf((*RecoveryEvent)(nil)).Elem() -} - -type RectifyDvsHostRequestType struct { - This ManagedObjectReference `xml:"_this"` - Hosts []ManagedObjectReference `xml:"hosts,omitempty"` -} - -func init() { - t["RectifyDvsHostRequestType"] = reflect.TypeOf((*RectifyDvsHostRequestType)(nil)).Elem() -} - -type RectifyDvsHost_Task RectifyDvsHostRequestType - -func init() { - t["RectifyDvsHost_Task"] = reflect.TypeOf((*RectifyDvsHost_Task)(nil)).Elem() -} - -type RectifyDvsHost_TaskResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type RectifyDvsOnHostRequestType struct { - This ManagedObjectReference `xml:"_this"` - Hosts []ManagedObjectReference `xml:"hosts"` -} - -func init() { - t["RectifyDvsOnHostRequestType"] = reflect.TypeOf((*RectifyDvsOnHostRequestType)(nil)).Elem() -} - -type RectifyDvsOnHost_Task RectifyDvsOnHostRequestType - -func init() { - t["RectifyDvsOnHost_Task"] = reflect.TypeOf((*RectifyDvsOnHost_Task)(nil)).Elem() -} - -type RectifyDvsOnHost_TaskResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type RecurrentTaskScheduler struct { - TaskScheduler - - Interval int `xml:"interval"` -} - -func init() { - t["RecurrentTaskScheduler"] = reflect.TypeOf((*RecurrentTaskScheduler)(nil)).Elem() -} - -type Refresh RefreshRequestType - -func init() { - t["Refresh"] = reflect.TypeOf((*Refresh)(nil)).Elem() -} - -type RefreshDVPortState RefreshDVPortStateRequestType - -func init() { - t["RefreshDVPortState"] = reflect.TypeOf((*RefreshDVPortState)(nil)).Elem() -} - -type RefreshDVPortStateRequestType struct { - This ManagedObjectReference `xml:"_this"` - PortKeys []string `xml:"portKeys,omitempty"` -} - -func init() { - t["RefreshDVPortStateRequestType"] = reflect.TypeOf((*RefreshDVPortStateRequestType)(nil)).Elem() -} - -type RefreshDVPortStateResponse struct { -} - -type RefreshDatastore RefreshDatastoreRequestType - -func init() { - t["RefreshDatastore"] = reflect.TypeOf((*RefreshDatastore)(nil)).Elem() -} - -type RefreshDatastoreRequestType struct { - This ManagedObjectReference `xml:"_this"` -} - -func init() { - t["RefreshDatastoreRequestType"] = reflect.TypeOf((*RefreshDatastoreRequestType)(nil)).Elem() -} - -type RefreshDatastoreResponse struct { -} - -type RefreshDatastoreStorageInfo RefreshDatastoreStorageInfoRequestType - -func init() { - t["RefreshDatastoreStorageInfo"] = reflect.TypeOf((*RefreshDatastoreStorageInfo)(nil)).Elem() -} - -type RefreshDatastoreStorageInfoRequestType struct { - This ManagedObjectReference `xml:"_this"` -} - -func init() { - t["RefreshDatastoreStorageInfoRequestType"] = reflect.TypeOf((*RefreshDatastoreStorageInfoRequestType)(nil)).Elem() -} - -type RefreshDatastoreStorageInfoResponse struct { -} - -type RefreshDateTimeSystem RefreshDateTimeSystemRequestType - -func init() { - t["RefreshDateTimeSystem"] = reflect.TypeOf((*RefreshDateTimeSystem)(nil)).Elem() -} - -type RefreshDateTimeSystemRequestType struct { - This ManagedObjectReference `xml:"_this"` -} - -func init() { - t["RefreshDateTimeSystemRequestType"] = reflect.TypeOf((*RefreshDateTimeSystemRequestType)(nil)).Elem() -} - -type RefreshDateTimeSystemResponse struct { -} - -type RefreshFirewall RefreshFirewallRequestType - -func init() { - t["RefreshFirewall"] = reflect.TypeOf((*RefreshFirewall)(nil)).Elem() -} - -type RefreshFirewallRequestType struct { - This ManagedObjectReference `xml:"_this"` -} - -func init() { - t["RefreshFirewallRequestType"] = reflect.TypeOf((*RefreshFirewallRequestType)(nil)).Elem() -} - -type RefreshFirewallResponse struct { -} - -type RefreshGraphicsManager RefreshGraphicsManagerRequestType - -func init() { - t["RefreshGraphicsManager"] = reflect.TypeOf((*RefreshGraphicsManager)(nil)).Elem() -} - -type RefreshGraphicsManagerRequestType struct { - This ManagedObjectReference `xml:"_this"` -} - -func init() { - t["RefreshGraphicsManagerRequestType"] = reflect.TypeOf((*RefreshGraphicsManagerRequestType)(nil)).Elem() -} - -type RefreshGraphicsManagerResponse struct { -} - -type RefreshHealthStatusSystem RefreshHealthStatusSystemRequestType - -func init() { - t["RefreshHealthStatusSystem"] = reflect.TypeOf((*RefreshHealthStatusSystem)(nil)).Elem() -} - -type RefreshHealthStatusSystemRequestType struct { - This ManagedObjectReference `xml:"_this"` -} - -func init() { - t["RefreshHealthStatusSystemRequestType"] = reflect.TypeOf((*RefreshHealthStatusSystemRequestType)(nil)).Elem() -} - -type RefreshHealthStatusSystemResponse struct { -} - -type RefreshNetworkSystem RefreshNetworkSystemRequestType - -func init() { - t["RefreshNetworkSystem"] = reflect.TypeOf((*RefreshNetworkSystem)(nil)).Elem() -} - -type RefreshNetworkSystemRequestType struct { - This ManagedObjectReference `xml:"_this"` -} - -func init() { - t["RefreshNetworkSystemRequestType"] = reflect.TypeOf((*RefreshNetworkSystemRequestType)(nil)).Elem() -} - -type RefreshNetworkSystemResponse struct { -} - -type RefreshRecommendation RefreshRecommendationRequestType - -func init() { - t["RefreshRecommendation"] = reflect.TypeOf((*RefreshRecommendation)(nil)).Elem() -} - -type RefreshRecommendationRequestType struct { - This ManagedObjectReference `xml:"_this"` -} - -func init() { - t["RefreshRecommendationRequestType"] = reflect.TypeOf((*RefreshRecommendationRequestType)(nil)).Elem() -} - -type RefreshRecommendationResponse struct { -} - -type RefreshRequestType struct { - This ManagedObjectReference `xml:"_this"` -} - -func init() { - t["RefreshRequestType"] = reflect.TypeOf((*RefreshRequestType)(nil)).Elem() -} - -type RefreshResponse struct { -} - -type RefreshRuntime RefreshRuntimeRequestType - -func init() { - t["RefreshRuntime"] = reflect.TypeOf((*RefreshRuntime)(nil)).Elem() -} - -type RefreshRuntimeRequestType struct { - This ManagedObjectReference `xml:"_this"` -} - -func init() { - t["RefreshRuntimeRequestType"] = reflect.TypeOf((*RefreshRuntimeRequestType)(nil)).Elem() -} - -type RefreshRuntimeResponse struct { -} - -type RefreshServices RefreshServicesRequestType - -func init() { - t["RefreshServices"] = reflect.TypeOf((*RefreshServices)(nil)).Elem() -} - -type RefreshServicesRequestType struct { - This ManagedObjectReference `xml:"_this"` -} - -func init() { - t["RefreshServicesRequestType"] = reflect.TypeOf((*RefreshServicesRequestType)(nil)).Elem() -} - -type RefreshServicesResponse struct { -} - -type RefreshStorageDrsRecommendation RefreshStorageDrsRecommendationRequestType - -func init() { - t["RefreshStorageDrsRecommendation"] = reflect.TypeOf((*RefreshStorageDrsRecommendation)(nil)).Elem() -} - -type RefreshStorageDrsRecommendationRequestType struct { - This ManagedObjectReference `xml:"_this"` - Pod ManagedObjectReference `xml:"pod"` -} - -func init() { - t["RefreshStorageDrsRecommendationRequestType"] = reflect.TypeOf((*RefreshStorageDrsRecommendationRequestType)(nil)).Elem() -} - -type RefreshStorageDrsRecommendationResponse struct { -} - -type RefreshStorageInfo RefreshStorageInfoRequestType - -func init() { - t["RefreshStorageInfo"] = reflect.TypeOf((*RefreshStorageInfo)(nil)).Elem() -} - -type RefreshStorageInfoRequestType struct { - This ManagedObjectReference `xml:"_this"` -} - -func init() { - t["RefreshStorageInfoRequestType"] = reflect.TypeOf((*RefreshStorageInfoRequestType)(nil)).Elem() -} - -type RefreshStorageInfoResponse struct { -} - -type RefreshStorageSystem RefreshStorageSystemRequestType - -func init() { - t["RefreshStorageSystem"] = reflect.TypeOf((*RefreshStorageSystem)(nil)).Elem() -} - -type RefreshStorageSystemRequestType struct { - This ManagedObjectReference `xml:"_this"` -} - -func init() { - t["RefreshStorageSystemRequestType"] = reflect.TypeOf((*RefreshStorageSystemRequestType)(nil)).Elem() -} - -type RefreshStorageSystemResponse struct { -} - -type RegisterChildVMRequestType struct { - This ManagedObjectReference `xml:"_this"` - Path string `xml:"path"` - Name string `xml:"name,omitempty"` - Host *ManagedObjectReference `xml:"host,omitempty"` -} - -func init() { - t["RegisterChildVMRequestType"] = reflect.TypeOf((*RegisterChildVMRequestType)(nil)).Elem() -} - -type RegisterChildVM_Task RegisterChildVMRequestType - -func init() { - t["RegisterChildVM_Task"] = reflect.TypeOf((*RegisterChildVM_Task)(nil)).Elem() -} - -type RegisterChildVM_TaskResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type RegisterExtension RegisterExtensionRequestType - -func init() { - t["RegisterExtension"] = reflect.TypeOf((*RegisterExtension)(nil)).Elem() -} - -type RegisterExtensionRequestType struct { - This ManagedObjectReference `xml:"_this"` - Extension Extension `xml:"extension"` -} - -func init() { - t["RegisterExtensionRequestType"] = reflect.TypeOf((*RegisterExtensionRequestType)(nil)).Elem() -} - -type RegisterExtensionResponse struct { -} - -type RegisterVMRequestType struct { - This ManagedObjectReference `xml:"_this"` - Path string `xml:"path"` - Name string `xml:"name,omitempty"` - AsTemplate bool `xml:"asTemplate"` - Pool *ManagedObjectReference `xml:"pool,omitempty"` - Host *ManagedObjectReference `xml:"host,omitempty"` -} - -func init() { - t["RegisterVMRequestType"] = reflect.TypeOf((*RegisterVMRequestType)(nil)).Elem() -} - -type RegisterVM_Task RegisterVMRequestType - -func init() { - t["RegisterVM_Task"] = reflect.TypeOf((*RegisterVM_Task)(nil)).Elem() -} - -type RegisterVM_TaskResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type ReleaseCredentialsInGuest ReleaseCredentialsInGuestRequestType - -func init() { - t["ReleaseCredentialsInGuest"] = reflect.TypeOf((*ReleaseCredentialsInGuest)(nil)).Elem() -} - -type ReleaseCredentialsInGuestRequestType struct { - This ManagedObjectReference `xml:"_this"` - Vm ManagedObjectReference `xml:"vm"` - Auth BaseGuestAuthentication `xml:"auth,typeattr"` -} - -func init() { - t["ReleaseCredentialsInGuestRequestType"] = reflect.TypeOf((*ReleaseCredentialsInGuestRequestType)(nil)).Elem() -} - -type ReleaseCredentialsInGuestResponse struct { -} - -type ReleaseIpAllocation ReleaseIpAllocationRequestType - -func init() { - t["ReleaseIpAllocation"] = reflect.TypeOf((*ReleaseIpAllocation)(nil)).Elem() -} - -type ReleaseIpAllocationRequestType struct { - This ManagedObjectReference `xml:"_this"` - Dc ManagedObjectReference `xml:"dc"` - PoolId int `xml:"poolId"` - AllocationId string `xml:"allocationId"` -} - -func init() { - t["ReleaseIpAllocationRequestType"] = reflect.TypeOf((*ReleaseIpAllocationRequestType)(nil)).Elem() -} - -type ReleaseIpAllocationResponse struct { -} - -type Reload ReloadRequestType - -func init() { - t["Reload"] = reflect.TypeOf((*Reload)(nil)).Elem() -} - -type ReloadRequestType struct { - This ManagedObjectReference `xml:"_this"` -} - -func init() { - t["ReloadRequestType"] = reflect.TypeOf((*ReloadRequestType)(nil)).Elem() -} - -type ReloadResponse struct { -} - -type RelocateVMRequestType struct { - This ManagedObjectReference `xml:"_this"` - Spec VirtualMachineRelocateSpec `xml:"spec"` - Priority VirtualMachineMovePriority `xml:"priority,omitempty"` -} - -func init() { - t["RelocateVMRequestType"] = reflect.TypeOf((*RelocateVMRequestType)(nil)).Elem() -} - -type RelocateVM_Task RelocateVMRequestType - -func init() { - t["RelocateVM_Task"] = reflect.TypeOf((*RelocateVM_Task)(nil)).Elem() -} - -type RelocateVM_TaskResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type RemoteDeviceNotSupported struct { - DeviceNotSupported -} - -func init() { - t["RemoteDeviceNotSupported"] = reflect.TypeOf((*RemoteDeviceNotSupported)(nil)).Elem() -} - -type RemoteDeviceNotSupportedFault RemoteDeviceNotSupported - -func init() { - t["RemoteDeviceNotSupportedFault"] = reflect.TypeOf((*RemoteDeviceNotSupportedFault)(nil)).Elem() -} - -type RemoteTSMEnabledEvent struct { - HostEvent -} - -func init() { - t["RemoteTSMEnabledEvent"] = reflect.TypeOf((*RemoteTSMEnabledEvent)(nil)).Elem() -} - -type RemoveAlarm RemoveAlarmRequestType - -func init() { - t["RemoveAlarm"] = reflect.TypeOf((*RemoveAlarm)(nil)).Elem() -} - -type RemoveAlarmRequestType struct { - This ManagedObjectReference `xml:"_this"` -} - -func init() { - t["RemoveAlarmRequestType"] = reflect.TypeOf((*RemoveAlarmRequestType)(nil)).Elem() -} - -type RemoveAlarmResponse struct { -} - -type RemoveAllSnapshotsRequestType struct { - This ManagedObjectReference `xml:"_this"` - Consolidate *bool `xml:"consolidate"` -} - -func init() { - t["RemoveAllSnapshotsRequestType"] = reflect.TypeOf((*RemoveAllSnapshotsRequestType)(nil)).Elem() -} - -type RemoveAllSnapshots_Task RemoveAllSnapshotsRequestType - -func init() { - t["RemoveAllSnapshots_Task"] = reflect.TypeOf((*RemoveAllSnapshots_Task)(nil)).Elem() -} - -type RemoveAllSnapshots_TaskResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type RemoveAssignedLicense RemoveAssignedLicenseRequestType - -func init() { - t["RemoveAssignedLicense"] = reflect.TypeOf((*RemoveAssignedLicense)(nil)).Elem() -} - -type RemoveAssignedLicenseRequestType struct { - This ManagedObjectReference `xml:"_this"` - EntityId string `xml:"entityId"` -} - -func init() { - t["RemoveAssignedLicenseRequestType"] = reflect.TypeOf((*RemoveAssignedLicenseRequestType)(nil)).Elem() -} - -type RemoveAssignedLicenseResponse struct { -} - -type RemoveAuthorizationRole RemoveAuthorizationRoleRequestType - -func init() { - t["RemoveAuthorizationRole"] = reflect.TypeOf((*RemoveAuthorizationRole)(nil)).Elem() -} - -type RemoveAuthorizationRoleRequestType struct { - This ManagedObjectReference `xml:"_this"` - RoleId int `xml:"roleId"` - FailIfUsed bool `xml:"failIfUsed"` -} - -func init() { - t["RemoveAuthorizationRoleRequestType"] = reflect.TypeOf((*RemoveAuthorizationRoleRequestType)(nil)).Elem() -} - -type RemoveAuthorizationRoleResponse struct { -} - -type RemoveCustomFieldDef RemoveCustomFieldDefRequestType - -func init() { - t["RemoveCustomFieldDef"] = reflect.TypeOf((*RemoveCustomFieldDef)(nil)).Elem() -} - -type RemoveCustomFieldDefRequestType struct { - This ManagedObjectReference `xml:"_this"` - Key int `xml:"key"` -} - -func init() { - t["RemoveCustomFieldDefRequestType"] = reflect.TypeOf((*RemoveCustomFieldDefRequestType)(nil)).Elem() -} - -type RemoveCustomFieldDefResponse struct { -} - -type RemoveDatastore RemoveDatastoreRequestType - -func init() { - t["RemoveDatastore"] = reflect.TypeOf((*RemoveDatastore)(nil)).Elem() -} - -type RemoveDatastoreRequestType struct { - This ManagedObjectReference `xml:"_this"` - Datastore ManagedObjectReference `xml:"datastore"` -} - -func init() { - t["RemoveDatastoreRequestType"] = reflect.TypeOf((*RemoveDatastoreRequestType)(nil)).Elem() -} - -type RemoveDatastoreResponse struct { -} - -type RemoveDiskMappingRequestType struct { - This ManagedObjectReference `xml:"_this"` - Mapping []VsanHostDiskMapping `xml:"mapping"` -} - -func init() { - t["RemoveDiskMappingRequestType"] = reflect.TypeOf((*RemoveDiskMappingRequestType)(nil)).Elem() -} - -type RemoveDiskMapping_Task RemoveDiskMappingRequestType - -func init() { - t["RemoveDiskMapping_Task"] = reflect.TypeOf((*RemoveDiskMapping_Task)(nil)).Elem() -} - -type RemoveDiskMapping_TaskResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type RemoveDiskRequestType struct { - This ManagedObjectReference `xml:"_this"` - Disk []HostScsiDisk `xml:"disk"` -} - -func init() { - t["RemoveDiskRequestType"] = reflect.TypeOf((*RemoveDiskRequestType)(nil)).Elem() -} - -type RemoveDisk_Task RemoveDiskRequestType - -func init() { - t["RemoveDisk_Task"] = reflect.TypeOf((*RemoveDisk_Task)(nil)).Elem() -} - -type RemoveDisk_TaskResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type RemoveEntityPermission RemoveEntityPermissionRequestType - -func init() { - t["RemoveEntityPermission"] = reflect.TypeOf((*RemoveEntityPermission)(nil)).Elem() -} - -type RemoveEntityPermissionRequestType struct { - This ManagedObjectReference `xml:"_this"` - Entity ManagedObjectReference `xml:"entity"` - User string `xml:"user"` - IsGroup bool `xml:"isGroup"` -} - -func init() { - t["RemoveEntityPermissionRequestType"] = reflect.TypeOf((*RemoveEntityPermissionRequestType)(nil)).Elem() -} - -type RemoveEntityPermissionResponse struct { -} - -type RemoveFailed struct { - VimFault -} - -func init() { - t["RemoveFailed"] = reflect.TypeOf((*RemoveFailed)(nil)).Elem() -} - -type RemoveFailedFault RemoveFailed - -func init() { - t["RemoveFailedFault"] = reflect.TypeOf((*RemoveFailedFault)(nil)).Elem() -} - -type RemoveGroup RemoveGroupRequestType - -func init() { - t["RemoveGroup"] = reflect.TypeOf((*RemoveGroup)(nil)).Elem() -} - -type RemoveGroupRequestType struct { - This ManagedObjectReference `xml:"_this"` - GroupName string `xml:"groupName"` -} - -func init() { - t["RemoveGroupRequestType"] = reflect.TypeOf((*RemoveGroupRequestType)(nil)).Elem() -} - -type RemoveGroupResponse struct { -} - -type RemoveInternetScsiSendTargets RemoveInternetScsiSendTargetsRequestType - -func init() { - t["RemoveInternetScsiSendTargets"] = reflect.TypeOf((*RemoveInternetScsiSendTargets)(nil)).Elem() -} - -type RemoveInternetScsiSendTargetsRequestType struct { - This ManagedObjectReference `xml:"_this"` - IScsiHbaDevice string `xml:"iScsiHbaDevice"` - Targets []HostInternetScsiHbaSendTarget `xml:"targets"` -} - -func init() { - t["RemoveInternetScsiSendTargetsRequestType"] = reflect.TypeOf((*RemoveInternetScsiSendTargetsRequestType)(nil)).Elem() -} - -type RemoveInternetScsiSendTargetsResponse struct { -} - -type RemoveInternetScsiStaticTargets RemoveInternetScsiStaticTargetsRequestType - -func init() { - t["RemoveInternetScsiStaticTargets"] = reflect.TypeOf((*RemoveInternetScsiStaticTargets)(nil)).Elem() -} - -type RemoveInternetScsiStaticTargetsRequestType struct { - This ManagedObjectReference `xml:"_this"` - IScsiHbaDevice string `xml:"iScsiHbaDevice"` - Targets []HostInternetScsiHbaStaticTarget `xml:"targets"` -} - -func init() { - t["RemoveInternetScsiStaticTargetsRequestType"] = reflect.TypeOf((*RemoveInternetScsiStaticTargetsRequestType)(nil)).Elem() -} - -type RemoveInternetScsiStaticTargetsResponse struct { -} - -type RemoveLicense RemoveLicenseRequestType - -func init() { - t["RemoveLicense"] = reflect.TypeOf((*RemoveLicense)(nil)).Elem() -} - -type RemoveLicenseLabel RemoveLicenseLabelRequestType - -func init() { - t["RemoveLicenseLabel"] = reflect.TypeOf((*RemoveLicenseLabel)(nil)).Elem() -} - -type RemoveLicenseLabelRequestType struct { - This ManagedObjectReference `xml:"_this"` - LicenseKey string `xml:"licenseKey"` - LabelKey string `xml:"labelKey"` -} - -func init() { - t["RemoveLicenseLabelRequestType"] = reflect.TypeOf((*RemoveLicenseLabelRequestType)(nil)).Elem() -} - -type RemoveLicenseLabelResponse struct { -} - -type RemoveLicenseRequestType struct { - This ManagedObjectReference `xml:"_this"` - LicenseKey string `xml:"licenseKey"` -} - -func init() { - t["RemoveLicenseRequestType"] = reflect.TypeOf((*RemoveLicenseRequestType)(nil)).Elem() -} - -type RemoveLicenseResponse struct { -} - -type RemoveNetworkResourcePool RemoveNetworkResourcePoolRequestType - -func init() { - t["RemoveNetworkResourcePool"] = reflect.TypeOf((*RemoveNetworkResourcePool)(nil)).Elem() -} - -type RemoveNetworkResourcePoolRequestType struct { - This ManagedObjectReference `xml:"_this"` - Key []string `xml:"key"` -} - -func init() { - t["RemoveNetworkResourcePoolRequestType"] = reflect.TypeOf((*RemoveNetworkResourcePoolRequestType)(nil)).Elem() -} - -type RemoveNetworkResourcePoolResponse struct { -} - -type RemovePerfInterval RemovePerfIntervalRequestType - -func init() { - t["RemovePerfInterval"] = reflect.TypeOf((*RemovePerfInterval)(nil)).Elem() -} - -type RemovePerfIntervalRequestType struct { - This ManagedObjectReference `xml:"_this"` - SamplePeriod int `xml:"samplePeriod"` -} - -func init() { - t["RemovePerfIntervalRequestType"] = reflect.TypeOf((*RemovePerfIntervalRequestType)(nil)).Elem() -} - -type RemovePerfIntervalResponse struct { -} - -type RemovePortGroup RemovePortGroupRequestType - -func init() { - t["RemovePortGroup"] = reflect.TypeOf((*RemovePortGroup)(nil)).Elem() -} - -type RemovePortGroupRequestType struct { - This ManagedObjectReference `xml:"_this"` - PgName string `xml:"pgName"` -} - -func init() { - t["RemovePortGroupRequestType"] = reflect.TypeOf((*RemovePortGroupRequestType)(nil)).Elem() -} - -type RemovePortGroupResponse struct { -} - -type RemoveScheduledTask RemoveScheduledTaskRequestType - -func init() { - t["RemoveScheduledTask"] = reflect.TypeOf((*RemoveScheduledTask)(nil)).Elem() -} - -type RemoveScheduledTaskRequestType struct { - This ManagedObjectReference `xml:"_this"` -} - -func init() { - t["RemoveScheduledTaskRequestType"] = reflect.TypeOf((*RemoveScheduledTaskRequestType)(nil)).Elem() -} - -type RemoveScheduledTaskResponse struct { -} - -type RemoveServiceConsoleVirtualNic RemoveServiceConsoleVirtualNicRequestType - -func init() { - t["RemoveServiceConsoleVirtualNic"] = reflect.TypeOf((*RemoveServiceConsoleVirtualNic)(nil)).Elem() -} - -type RemoveServiceConsoleVirtualNicRequestType struct { - This ManagedObjectReference `xml:"_this"` - Device string `xml:"device"` -} - -func init() { - t["RemoveServiceConsoleVirtualNicRequestType"] = reflect.TypeOf((*RemoveServiceConsoleVirtualNicRequestType)(nil)).Elem() -} - -type RemoveServiceConsoleVirtualNicResponse struct { -} - -type RemoveSnapshotRequestType struct { - This ManagedObjectReference `xml:"_this"` - RemoveChildren bool `xml:"removeChildren"` - Consolidate *bool `xml:"consolidate"` -} - -func init() { - t["RemoveSnapshotRequestType"] = reflect.TypeOf((*RemoveSnapshotRequestType)(nil)).Elem() -} - -type RemoveSnapshot_Task RemoveSnapshotRequestType - -func init() { - t["RemoveSnapshot_Task"] = reflect.TypeOf((*RemoveSnapshot_Task)(nil)).Elem() -} - -type RemoveSnapshot_TaskResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type RemoveUser RemoveUserRequestType - -func init() { - t["RemoveUser"] = reflect.TypeOf((*RemoveUser)(nil)).Elem() -} - -type RemoveUserRequestType struct { - This ManagedObjectReference `xml:"_this"` - UserName string `xml:"userName"` -} - -func init() { - t["RemoveUserRequestType"] = reflect.TypeOf((*RemoveUserRequestType)(nil)).Elem() -} - -type RemoveUserResponse struct { -} - -type RemoveVirtualNic RemoveVirtualNicRequestType - -func init() { - t["RemoveVirtualNic"] = reflect.TypeOf((*RemoveVirtualNic)(nil)).Elem() -} - -type RemoveVirtualNicRequestType struct { - This ManagedObjectReference `xml:"_this"` - Device string `xml:"device"` -} - -func init() { - t["RemoveVirtualNicRequestType"] = reflect.TypeOf((*RemoveVirtualNicRequestType)(nil)).Elem() -} - -type RemoveVirtualNicResponse struct { -} - -type RemoveVirtualSwitch RemoveVirtualSwitchRequestType - -func init() { - t["RemoveVirtualSwitch"] = reflect.TypeOf((*RemoveVirtualSwitch)(nil)).Elem() -} - -type RemoveVirtualSwitchRequestType struct { - This ManagedObjectReference `xml:"_this"` - VswitchName string `xml:"vswitchName"` -} - -func init() { - t["RemoveVirtualSwitchRequestType"] = reflect.TypeOf((*RemoveVirtualSwitchRequestType)(nil)).Elem() -} - -type RemoveVirtualSwitchResponse struct { -} - -type RenameCustomFieldDef RenameCustomFieldDefRequestType - -func init() { - t["RenameCustomFieldDef"] = reflect.TypeOf((*RenameCustomFieldDef)(nil)).Elem() -} - -type RenameCustomFieldDefRequestType struct { - This ManagedObjectReference `xml:"_this"` - Key int `xml:"key"` - Name string `xml:"name"` -} - -func init() { - t["RenameCustomFieldDefRequestType"] = reflect.TypeOf((*RenameCustomFieldDefRequestType)(nil)).Elem() -} - -type RenameCustomFieldDefResponse struct { -} - -type RenameCustomizationSpec RenameCustomizationSpecRequestType - -func init() { - t["RenameCustomizationSpec"] = reflect.TypeOf((*RenameCustomizationSpec)(nil)).Elem() -} - -type RenameCustomizationSpecRequestType struct { - This ManagedObjectReference `xml:"_this"` - Name string `xml:"name"` - NewName string `xml:"newName"` -} - -func init() { - t["RenameCustomizationSpecRequestType"] = reflect.TypeOf((*RenameCustomizationSpecRequestType)(nil)).Elem() -} - -type RenameCustomizationSpecResponse struct { -} - -type RenameDatastore RenameDatastoreRequestType - -func init() { - t["RenameDatastore"] = reflect.TypeOf((*RenameDatastore)(nil)).Elem() -} - -type RenameDatastoreRequestType struct { - This ManagedObjectReference `xml:"_this"` - NewName string `xml:"newName"` -} - -func init() { - t["RenameDatastoreRequestType"] = reflect.TypeOf((*RenameDatastoreRequestType)(nil)).Elem() -} - -type RenameDatastoreResponse struct { -} - -type RenameRequestType struct { - This ManagedObjectReference `xml:"_this"` - NewName string `xml:"newName"` -} - -func init() { - t["RenameRequestType"] = reflect.TypeOf((*RenameRequestType)(nil)).Elem() -} - -type RenameSnapshot RenameSnapshotRequestType - -func init() { - t["RenameSnapshot"] = reflect.TypeOf((*RenameSnapshot)(nil)).Elem() -} - -type RenameSnapshotRequestType struct { - This ManagedObjectReference `xml:"_this"` - Name string `xml:"name,omitempty"` - Description string `xml:"description,omitempty"` -} - -func init() { - t["RenameSnapshotRequestType"] = reflect.TypeOf((*RenameSnapshotRequestType)(nil)).Elem() -} - -type RenameSnapshotResponse struct { -} - -type Rename_Task RenameRequestType - -func init() { - t["Rename_Task"] = reflect.TypeOf((*Rename_Task)(nil)).Elem() -} - -type Rename_TaskResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type ReplicationConfigFault struct { - ReplicationFault -} - -func init() { - t["ReplicationConfigFault"] = reflect.TypeOf((*ReplicationConfigFault)(nil)).Elem() -} - -type ReplicationConfigFaultFault BaseReplicationConfigFault - -func init() { - t["ReplicationConfigFaultFault"] = reflect.TypeOf((*ReplicationConfigFaultFault)(nil)).Elem() -} - -type ReplicationDiskConfigFault struct { - ReplicationConfigFault - - Reason string `xml:"reason,omitempty"` - VmRef *ManagedObjectReference `xml:"vmRef,omitempty"` - Key int `xml:"key,omitempty"` -} - -func init() { - t["ReplicationDiskConfigFault"] = reflect.TypeOf((*ReplicationDiskConfigFault)(nil)).Elem() -} - -type ReplicationDiskConfigFaultFault ReplicationDiskConfigFault - -func init() { - t["ReplicationDiskConfigFaultFault"] = reflect.TypeOf((*ReplicationDiskConfigFaultFault)(nil)).Elem() -} - -type ReplicationFault struct { - VimFault -} - -func init() { - t["ReplicationFault"] = reflect.TypeOf((*ReplicationFault)(nil)).Elem() -} - -type ReplicationFaultFault BaseReplicationFault - -func init() { - t["ReplicationFaultFault"] = reflect.TypeOf((*ReplicationFaultFault)(nil)).Elem() -} - -type ReplicationIncompatibleWithFT struct { - ReplicationFault -} - -func init() { - t["ReplicationIncompatibleWithFT"] = reflect.TypeOf((*ReplicationIncompatibleWithFT)(nil)).Elem() -} - -type ReplicationIncompatibleWithFTFault ReplicationIncompatibleWithFT - -func init() { - t["ReplicationIncompatibleWithFTFault"] = reflect.TypeOf((*ReplicationIncompatibleWithFTFault)(nil)).Elem() -} - -type ReplicationInfoDiskSettings struct { - DynamicData - - Key int `xml:"key"` - DiskReplicationId string `xml:"diskReplicationId"` -} - -func init() { - t["ReplicationInfoDiskSettings"] = reflect.TypeOf((*ReplicationInfoDiskSettings)(nil)).Elem() -} - -type ReplicationInvalidOptions struct { - ReplicationFault - - Options string `xml:"options"` - Entity *ManagedObjectReference `xml:"entity,omitempty"` -} - -func init() { - t["ReplicationInvalidOptions"] = reflect.TypeOf((*ReplicationInvalidOptions)(nil)).Elem() -} - -type ReplicationInvalidOptionsFault ReplicationInvalidOptions - -func init() { - t["ReplicationInvalidOptionsFault"] = reflect.TypeOf((*ReplicationInvalidOptionsFault)(nil)).Elem() -} - -type ReplicationNotSupportedOnHost struct { - ReplicationFault -} - -func init() { - t["ReplicationNotSupportedOnHost"] = reflect.TypeOf((*ReplicationNotSupportedOnHost)(nil)).Elem() -} - -type ReplicationNotSupportedOnHostFault ReplicationNotSupportedOnHost - -func init() { - t["ReplicationNotSupportedOnHostFault"] = reflect.TypeOf((*ReplicationNotSupportedOnHostFault)(nil)).Elem() -} - -type ReplicationVmConfigFault struct { - ReplicationConfigFault - - Reason string `xml:"reason,omitempty"` - VmRef *ManagedObjectReference `xml:"vmRef,omitempty"` -} - -func init() { - t["ReplicationVmConfigFault"] = reflect.TypeOf((*ReplicationVmConfigFault)(nil)).Elem() -} - -type ReplicationVmConfigFaultFault ReplicationVmConfigFault - -func init() { - t["ReplicationVmConfigFaultFault"] = reflect.TypeOf((*ReplicationVmConfigFaultFault)(nil)).Elem() -} - -type ReplicationVmFault struct { - ReplicationFault - - Reason string `xml:"reason,omitempty"` - State string `xml:"state,omitempty"` - InstanceId string `xml:"instanceId,omitempty"` - Vm *ManagedObjectReference `xml:"vm,omitempty"` -} - -func init() { - t["ReplicationVmFault"] = reflect.TypeOf((*ReplicationVmFault)(nil)).Elem() -} - -type ReplicationVmFaultFault ReplicationVmFault - -func init() { - t["ReplicationVmFaultFault"] = reflect.TypeOf((*ReplicationVmFaultFault)(nil)).Elem() -} - -type ReplicationVmProgressInfo struct { - DynamicData - - Progress int `xml:"progress"` - BytesTransferred int64 `xml:"bytesTransferred"` - BytesToTransfer int64 `xml:"bytesToTransfer"` - ChecksumTotalBytes int64 `xml:"checksumTotalBytes,omitempty"` - ChecksumComparedBytes int64 `xml:"checksumComparedBytes,omitempty"` -} - -func init() { - t["ReplicationVmProgressInfo"] = reflect.TypeOf((*ReplicationVmProgressInfo)(nil)).Elem() -} - -type RequestCanceled struct { - RuntimeFault -} - -func init() { - t["RequestCanceled"] = reflect.TypeOf((*RequestCanceled)(nil)).Elem() -} - -type RequestCanceledFault RequestCanceled - -func init() { - t["RequestCanceledFault"] = reflect.TypeOf((*RequestCanceledFault)(nil)).Elem() -} - -type RescanAllHba RescanAllHbaRequestType - -func init() { - t["RescanAllHba"] = reflect.TypeOf((*RescanAllHba)(nil)).Elem() -} - -type RescanAllHbaRequestType struct { - This ManagedObjectReference `xml:"_this"` -} - -func init() { - t["RescanAllHbaRequestType"] = reflect.TypeOf((*RescanAllHbaRequestType)(nil)).Elem() -} - -type RescanAllHbaResponse struct { -} - -type RescanHba RescanHbaRequestType - -func init() { - t["RescanHba"] = reflect.TypeOf((*RescanHba)(nil)).Elem() -} - -type RescanHbaRequestType struct { - This ManagedObjectReference `xml:"_this"` - HbaDevice string `xml:"hbaDevice"` -} - -func init() { - t["RescanHbaRequestType"] = reflect.TypeOf((*RescanHbaRequestType)(nil)).Elem() -} - -type RescanHbaResponse struct { -} - -type RescanVffs RescanVffsRequestType - -func init() { - t["RescanVffs"] = reflect.TypeOf((*RescanVffs)(nil)).Elem() -} - -type RescanVffsRequestType struct { - This ManagedObjectReference `xml:"_this"` -} - -func init() { - t["RescanVffsRequestType"] = reflect.TypeOf((*RescanVffsRequestType)(nil)).Elem() -} - -type RescanVffsResponse struct { -} - -type RescanVmfs RescanVmfsRequestType - -func init() { - t["RescanVmfs"] = reflect.TypeOf((*RescanVmfs)(nil)).Elem() -} - -type RescanVmfsRequestType struct { - This ManagedObjectReference `xml:"_this"` -} - -func init() { - t["RescanVmfsRequestType"] = reflect.TypeOf((*RescanVmfsRequestType)(nil)).Elem() -} - -type RescanVmfsResponse struct { -} - -type ResetCollector ResetCollectorRequestType - -func init() { - t["ResetCollector"] = reflect.TypeOf((*ResetCollector)(nil)).Elem() -} - -type ResetCollectorRequestType struct { - This ManagedObjectReference `xml:"_this"` -} - -func init() { - t["ResetCollectorRequestType"] = reflect.TypeOf((*ResetCollectorRequestType)(nil)).Elem() -} - -type ResetCollectorResponse struct { -} - -type ResetCounterLevelMapping ResetCounterLevelMappingRequestType - -func init() { - t["ResetCounterLevelMapping"] = reflect.TypeOf((*ResetCounterLevelMapping)(nil)).Elem() -} - -type ResetCounterLevelMappingRequestType struct { - This ManagedObjectReference `xml:"_this"` - Counters []int `xml:"counters"` -} - -func init() { - t["ResetCounterLevelMappingRequestType"] = reflect.TypeOf((*ResetCounterLevelMappingRequestType)(nil)).Elem() -} - -type ResetCounterLevelMappingResponse struct { -} - -type ResetEntityPermissions ResetEntityPermissionsRequestType - -func init() { - t["ResetEntityPermissions"] = reflect.TypeOf((*ResetEntityPermissions)(nil)).Elem() -} - -type ResetEntityPermissionsRequestType struct { - This ManagedObjectReference `xml:"_this"` - Entity ManagedObjectReference `xml:"entity"` - Permission []Permission `xml:"permission,omitempty"` -} - -func init() { - t["ResetEntityPermissionsRequestType"] = reflect.TypeOf((*ResetEntityPermissionsRequestType)(nil)).Elem() -} - -type ResetEntityPermissionsResponse struct { -} - -type ResetFirmwareToFactoryDefaults ResetFirmwareToFactoryDefaultsRequestType - -func init() { - t["ResetFirmwareToFactoryDefaults"] = reflect.TypeOf((*ResetFirmwareToFactoryDefaults)(nil)).Elem() -} - -type ResetFirmwareToFactoryDefaultsRequestType struct { - This ManagedObjectReference `xml:"_this"` -} - -func init() { - t["ResetFirmwareToFactoryDefaultsRequestType"] = reflect.TypeOf((*ResetFirmwareToFactoryDefaultsRequestType)(nil)).Elem() -} - -type ResetFirmwareToFactoryDefaultsResponse struct { -} - -type ResetGuestInformation ResetGuestInformationRequestType - -func init() { - t["ResetGuestInformation"] = reflect.TypeOf((*ResetGuestInformation)(nil)).Elem() -} - -type ResetGuestInformationRequestType struct { - This ManagedObjectReference `xml:"_this"` -} - -func init() { - t["ResetGuestInformationRequestType"] = reflect.TypeOf((*ResetGuestInformationRequestType)(nil)).Elem() -} - -type ResetGuestInformationResponse struct { -} - -type ResetListView ResetListViewRequestType - -func init() { - t["ResetListView"] = reflect.TypeOf((*ResetListView)(nil)).Elem() -} - -type ResetListViewFromView ResetListViewFromViewRequestType - -func init() { - t["ResetListViewFromView"] = reflect.TypeOf((*ResetListViewFromView)(nil)).Elem() -} - -type ResetListViewFromViewRequestType struct { - This ManagedObjectReference `xml:"_this"` - View ManagedObjectReference `xml:"view"` -} - -func init() { - t["ResetListViewFromViewRequestType"] = reflect.TypeOf((*ResetListViewFromViewRequestType)(nil)).Elem() -} - -type ResetListViewFromViewResponse struct { -} - -type ResetListViewRequestType struct { - This ManagedObjectReference `xml:"_this"` - Obj []ManagedObjectReference `xml:"obj,omitempty"` -} - -func init() { - t["ResetListViewRequestType"] = reflect.TypeOf((*ResetListViewRequestType)(nil)).Elem() -} - -type ResetListViewResponse struct { - Returnval []ManagedObjectReference `xml:"returnval,omitempty"` -} - -type ResetSystemHealthInfo ResetSystemHealthInfoRequestType - -func init() { - t["ResetSystemHealthInfo"] = reflect.TypeOf((*ResetSystemHealthInfo)(nil)).Elem() -} - -type ResetSystemHealthInfoRequestType struct { - This ManagedObjectReference `xml:"_this"` -} - -func init() { - t["ResetSystemHealthInfoRequestType"] = reflect.TypeOf((*ResetSystemHealthInfoRequestType)(nil)).Elem() -} - -type ResetSystemHealthInfoResponse struct { -} - -type ResetVMRequestType struct { - This ManagedObjectReference `xml:"_this"` -} - -func init() { - t["ResetVMRequestType"] = reflect.TypeOf((*ResetVMRequestType)(nil)).Elem() -} - -type ResetVM_Task ResetVMRequestType - -func init() { - t["ResetVM_Task"] = reflect.TypeOf((*ResetVM_Task)(nil)).Elem() -} - -type ResetVM_TaskResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type ResignatureUnresolvedVmfsVolumeRequestType struct { - This ManagedObjectReference `xml:"_this"` - ResolutionSpec HostUnresolvedVmfsResignatureSpec `xml:"resolutionSpec"` -} - -func init() { - t["ResignatureUnresolvedVmfsVolumeRequestType"] = reflect.TypeOf((*ResignatureUnresolvedVmfsVolumeRequestType)(nil)).Elem() -} - -type ResignatureUnresolvedVmfsVolume_Task ResignatureUnresolvedVmfsVolumeRequestType - -func init() { - t["ResignatureUnresolvedVmfsVolume_Task"] = reflect.TypeOf((*ResignatureUnresolvedVmfsVolume_Task)(nil)).Elem() -} - -type ResignatureUnresolvedVmfsVolume_TaskResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type ResolveMultipleUnresolvedVmfsVolumes ResolveMultipleUnresolvedVmfsVolumesRequestType - -func init() { - t["ResolveMultipleUnresolvedVmfsVolumes"] = reflect.TypeOf((*ResolveMultipleUnresolvedVmfsVolumes)(nil)).Elem() -} - -type ResolveMultipleUnresolvedVmfsVolumesExRequestType struct { - This ManagedObjectReference `xml:"_this"` - ResolutionSpec []HostUnresolvedVmfsResolutionSpec `xml:"resolutionSpec"` -} - -func init() { - t["ResolveMultipleUnresolvedVmfsVolumesExRequestType"] = reflect.TypeOf((*ResolveMultipleUnresolvedVmfsVolumesExRequestType)(nil)).Elem() -} - -type ResolveMultipleUnresolvedVmfsVolumesEx_Task ResolveMultipleUnresolvedVmfsVolumesExRequestType - -func init() { - t["ResolveMultipleUnresolvedVmfsVolumesEx_Task"] = reflect.TypeOf((*ResolveMultipleUnresolvedVmfsVolumesEx_Task)(nil)).Elem() -} - -type ResolveMultipleUnresolvedVmfsVolumesEx_TaskResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type ResolveMultipleUnresolvedVmfsVolumesRequestType struct { - This ManagedObjectReference `xml:"_this"` - ResolutionSpec []HostUnresolvedVmfsResolutionSpec `xml:"resolutionSpec"` -} - -func init() { - t["ResolveMultipleUnresolvedVmfsVolumesRequestType"] = reflect.TypeOf((*ResolveMultipleUnresolvedVmfsVolumesRequestType)(nil)).Elem() -} - -type ResolveMultipleUnresolvedVmfsVolumesResponse struct { - Returnval []HostUnresolvedVmfsResolutionResult `xml:"returnval,omitempty"` -} - -type ResourceAllocationInfo struct { - DynamicData - - Reservation int64 `xml:"reservation,omitempty"` - ExpandableReservation *bool `xml:"expandableReservation"` - Limit int64 `xml:"limit,omitempty"` - Shares *SharesInfo `xml:"shares,omitempty"` - OverheadLimit int64 `xml:"overheadLimit,omitempty"` -} - -func init() { - t["ResourceAllocationInfo"] = reflect.TypeOf((*ResourceAllocationInfo)(nil)).Elem() -} - -type ResourceAllocationOption struct { - DynamicData - - SharesOption SharesOption `xml:"sharesOption"` -} - -func init() { - t["ResourceAllocationOption"] = reflect.TypeOf((*ResourceAllocationOption)(nil)).Elem() -} - -type ResourceConfigOption struct { - DynamicData - - CpuAllocationOption ResourceAllocationOption `xml:"cpuAllocationOption"` - MemoryAllocationOption ResourceAllocationOption `xml:"memoryAllocationOption"` -} - -func init() { - t["ResourceConfigOption"] = reflect.TypeOf((*ResourceConfigOption)(nil)).Elem() -} - -type ResourceConfigSpec struct { - DynamicData - - Entity *ManagedObjectReference `xml:"entity,omitempty"` - ChangeVersion string `xml:"changeVersion,omitempty"` - LastModified *time.Time `xml:"lastModified"` - CpuAllocation ResourceAllocationInfo `xml:"cpuAllocation"` - MemoryAllocation ResourceAllocationInfo `xml:"memoryAllocation"` -} - -func init() { - t["ResourceConfigSpec"] = reflect.TypeOf((*ResourceConfigSpec)(nil)).Elem() -} - -type ResourceInUse struct { - VimFault - - Type string `xml:"type,omitempty"` - Name string `xml:"name,omitempty"` -} - -func init() { - t["ResourceInUse"] = reflect.TypeOf((*ResourceInUse)(nil)).Elem() -} - -type ResourceInUseFault BaseResourceInUse - -func init() { - t["ResourceInUseFault"] = reflect.TypeOf((*ResourceInUseFault)(nil)).Elem() -} - -type ResourceNotAvailable struct { - VimFault - - ContainerType string `xml:"containerType,omitempty"` - ContainerName string `xml:"containerName,omitempty"` - Type string `xml:"type,omitempty"` -} - -func init() { - t["ResourceNotAvailable"] = reflect.TypeOf((*ResourceNotAvailable)(nil)).Elem() -} - -type ResourceNotAvailableFault ResourceNotAvailable - -func init() { - t["ResourceNotAvailableFault"] = reflect.TypeOf((*ResourceNotAvailableFault)(nil)).Elem() -} - -type ResourcePoolCreatedEvent struct { - ResourcePoolEvent - - Parent ResourcePoolEventArgument `xml:"parent"` -} - -func init() { - t["ResourcePoolCreatedEvent"] = reflect.TypeOf((*ResourcePoolCreatedEvent)(nil)).Elem() -} - -type ResourcePoolDestroyedEvent struct { - ResourcePoolEvent -} - -func init() { - t["ResourcePoolDestroyedEvent"] = reflect.TypeOf((*ResourcePoolDestroyedEvent)(nil)).Elem() -} - -type ResourcePoolEvent struct { - Event - - ResourcePool ResourcePoolEventArgument `xml:"resourcePool"` -} - -func init() { - t["ResourcePoolEvent"] = reflect.TypeOf((*ResourcePoolEvent)(nil)).Elem() -} - -type ResourcePoolEventArgument struct { - EntityEventArgument - - ResourcePool ManagedObjectReference `xml:"resourcePool"` -} - -func init() { - t["ResourcePoolEventArgument"] = reflect.TypeOf((*ResourcePoolEventArgument)(nil)).Elem() -} - -type ResourcePoolMovedEvent struct { - ResourcePoolEvent - - OldParent ResourcePoolEventArgument `xml:"oldParent"` - NewParent ResourcePoolEventArgument `xml:"newParent"` -} - -func init() { - t["ResourcePoolMovedEvent"] = reflect.TypeOf((*ResourcePoolMovedEvent)(nil)).Elem() -} - -type ResourcePoolQuickStats struct { - DynamicData - - OverallCpuUsage int64 `xml:"overallCpuUsage,omitempty"` - OverallCpuDemand int64 `xml:"overallCpuDemand,omitempty"` - GuestMemoryUsage int64 `xml:"guestMemoryUsage,omitempty"` - HostMemoryUsage int64 `xml:"hostMemoryUsage,omitempty"` - DistributedCpuEntitlement int64 `xml:"distributedCpuEntitlement,omitempty"` - DistributedMemoryEntitlement int64 `xml:"distributedMemoryEntitlement,omitempty"` - StaticCpuEntitlement int `xml:"staticCpuEntitlement,omitempty"` - StaticMemoryEntitlement int `xml:"staticMemoryEntitlement,omitempty"` - PrivateMemory int64 `xml:"privateMemory,omitempty"` - SharedMemory int64 `xml:"sharedMemory,omitempty"` - SwappedMemory int64 `xml:"swappedMemory,omitempty"` - BalloonedMemory int64 `xml:"balloonedMemory,omitempty"` - OverheadMemory int64 `xml:"overheadMemory,omitempty"` - ConsumedOverheadMemory int64 `xml:"consumedOverheadMemory,omitempty"` - CompressedMemory int64 `xml:"compressedMemory,omitempty"` -} - -func init() { - t["ResourcePoolQuickStats"] = reflect.TypeOf((*ResourcePoolQuickStats)(nil)).Elem() -} - -type ResourcePoolReconfiguredEvent struct { - ResourcePoolEvent -} - -func init() { - t["ResourcePoolReconfiguredEvent"] = reflect.TypeOf((*ResourcePoolReconfiguredEvent)(nil)).Elem() -} - -type ResourcePoolResourceUsage struct { - DynamicData - - ReservationUsed int64 `xml:"reservationUsed"` - ReservationUsedForVm int64 `xml:"reservationUsedForVm"` - UnreservedForPool int64 `xml:"unreservedForPool"` - UnreservedForVm int64 `xml:"unreservedForVm"` - OverallUsage int64 `xml:"overallUsage"` - MaxUsage int64 `xml:"maxUsage"` -} - -func init() { - t["ResourcePoolResourceUsage"] = reflect.TypeOf((*ResourcePoolResourceUsage)(nil)).Elem() -} - -type ResourcePoolRuntimeInfo struct { - DynamicData - - Memory ResourcePoolResourceUsage `xml:"memory"` - Cpu ResourcePoolResourceUsage `xml:"cpu"` - OverallStatus ManagedEntityStatus `xml:"overallStatus"` -} - -func init() { - t["ResourcePoolRuntimeInfo"] = reflect.TypeOf((*ResourcePoolRuntimeInfo)(nil)).Elem() -} - -type ResourcePoolSummary struct { - DynamicData - - Name string `xml:"name"` - Config ResourceConfigSpec `xml:"config"` - Runtime ResourcePoolRuntimeInfo `xml:"runtime"` - QuickStats *ResourcePoolQuickStats `xml:"quickStats,omitempty"` - ConfiguredMemoryMB int `xml:"configuredMemoryMB,omitempty"` -} - -func init() { - t["ResourcePoolSummary"] = reflect.TypeOf((*ResourcePoolSummary)(nil)).Elem() -} - -type ResourceViolatedEvent struct { - ResourcePoolEvent -} - -func init() { - t["ResourceViolatedEvent"] = reflect.TypeOf((*ResourceViolatedEvent)(nil)).Elem() -} - -type RestartService RestartServiceRequestType - -func init() { - t["RestartService"] = reflect.TypeOf((*RestartService)(nil)).Elem() -} - -type RestartServiceConsoleVirtualNic RestartServiceConsoleVirtualNicRequestType - -func init() { - t["RestartServiceConsoleVirtualNic"] = reflect.TypeOf((*RestartServiceConsoleVirtualNic)(nil)).Elem() -} - -type RestartServiceConsoleVirtualNicRequestType struct { - This ManagedObjectReference `xml:"_this"` - Device string `xml:"device"` -} - -func init() { - t["RestartServiceConsoleVirtualNicRequestType"] = reflect.TypeOf((*RestartServiceConsoleVirtualNicRequestType)(nil)).Elem() -} - -type RestartServiceConsoleVirtualNicResponse struct { -} - -type RestartServiceRequestType struct { - This ManagedObjectReference `xml:"_this"` - Id string `xml:"id"` -} - -func init() { - t["RestartServiceRequestType"] = reflect.TypeOf((*RestartServiceRequestType)(nil)).Elem() -} - -type RestartServiceResponse struct { -} - -type RestoreFirmwareConfiguration RestoreFirmwareConfigurationRequestType - -func init() { - t["RestoreFirmwareConfiguration"] = reflect.TypeOf((*RestoreFirmwareConfiguration)(nil)).Elem() -} - -type RestoreFirmwareConfigurationRequestType struct { - This ManagedObjectReference `xml:"_this"` - Force bool `xml:"force"` -} - -func init() { - t["RestoreFirmwareConfigurationRequestType"] = reflect.TypeOf((*RestoreFirmwareConfigurationRequestType)(nil)).Elem() -} - -type RestoreFirmwareConfigurationResponse struct { -} - -type RestrictedVersion struct { - SecurityError -} - -func init() { - t["RestrictedVersion"] = reflect.TypeOf((*RestrictedVersion)(nil)).Elem() -} - -type RestrictedVersionFault RestrictedVersion - -func init() { - t["RestrictedVersionFault"] = reflect.TypeOf((*RestrictedVersionFault)(nil)).Elem() -} - -type RetrieveAllPermissions RetrieveAllPermissionsRequestType - -func init() { - t["RetrieveAllPermissions"] = reflect.TypeOf((*RetrieveAllPermissions)(nil)).Elem() -} - -type RetrieveAllPermissionsRequestType struct { - This ManagedObjectReference `xml:"_this"` -} - -func init() { - t["RetrieveAllPermissionsRequestType"] = reflect.TypeOf((*RetrieveAllPermissionsRequestType)(nil)).Elem() -} - -type RetrieveAllPermissionsResponse struct { - Returnval []Permission `xml:"returnval,omitempty"` -} - -type RetrieveAnswerFile RetrieveAnswerFileRequestType - -func init() { - t["RetrieveAnswerFile"] = reflect.TypeOf((*RetrieveAnswerFile)(nil)).Elem() -} - -type RetrieveAnswerFileForProfile RetrieveAnswerFileForProfileRequestType - -func init() { - t["RetrieveAnswerFileForProfile"] = reflect.TypeOf((*RetrieveAnswerFileForProfile)(nil)).Elem() -} - -type RetrieveAnswerFileForProfileRequestType struct { - This ManagedObjectReference `xml:"_this"` - Host ManagedObjectReference `xml:"host"` - ApplyProfile HostApplyProfile `xml:"applyProfile"` -} - -func init() { - t["RetrieveAnswerFileForProfileRequestType"] = reflect.TypeOf((*RetrieveAnswerFileForProfileRequestType)(nil)).Elem() -} - -type RetrieveAnswerFileForProfileResponse struct { - Returnval *AnswerFile `xml:"returnval,omitempty"` -} - -type RetrieveAnswerFileRequestType struct { - This ManagedObjectReference `xml:"_this"` - Host ManagedObjectReference `xml:"host"` -} - -func init() { - t["RetrieveAnswerFileRequestType"] = reflect.TypeOf((*RetrieveAnswerFileRequestType)(nil)).Elem() -} - -type RetrieveAnswerFileResponse struct { - Returnval *AnswerFile `xml:"returnval,omitempty"` -} - -type RetrieveArgumentDescription RetrieveArgumentDescriptionRequestType - -func init() { - t["RetrieveArgumentDescription"] = reflect.TypeOf((*RetrieveArgumentDescription)(nil)).Elem() -} - -type RetrieveArgumentDescriptionRequestType struct { - This ManagedObjectReference `xml:"_this"` - EventTypeId string `xml:"eventTypeId"` -} - -func init() { - t["RetrieveArgumentDescriptionRequestType"] = reflect.TypeOf((*RetrieveArgumentDescriptionRequestType)(nil)).Elem() -} - -type RetrieveArgumentDescriptionResponse struct { - Returnval []EventArgDesc `xml:"returnval,omitempty"` -} - -type RetrieveDasAdvancedRuntimeInfo RetrieveDasAdvancedRuntimeInfoRequestType - -func init() { - t["RetrieveDasAdvancedRuntimeInfo"] = reflect.TypeOf((*RetrieveDasAdvancedRuntimeInfo)(nil)).Elem() -} - -type RetrieveDasAdvancedRuntimeInfoRequestType struct { - This ManagedObjectReference `xml:"_this"` -} - -func init() { - t["RetrieveDasAdvancedRuntimeInfoRequestType"] = reflect.TypeOf((*RetrieveDasAdvancedRuntimeInfoRequestType)(nil)).Elem() -} - -type RetrieveDasAdvancedRuntimeInfoResponse struct { - Returnval BaseClusterDasAdvancedRuntimeInfo `xml:"returnval,omitempty,typeattr"` -} - -type RetrieveDescription RetrieveDescriptionRequestType - -func init() { - t["RetrieveDescription"] = reflect.TypeOf((*RetrieveDescription)(nil)).Elem() -} - -type RetrieveDescriptionRequestType struct { - This ManagedObjectReference `xml:"_this"` -} - -func init() { - t["RetrieveDescriptionRequestType"] = reflect.TypeOf((*RetrieveDescriptionRequestType)(nil)).Elem() -} - -type RetrieveDescriptionResponse struct { - Returnval *ProfileDescription `xml:"returnval,omitempty"` -} - -type RetrieveDiskPartitionInfo RetrieveDiskPartitionInfoRequestType - -func init() { - t["RetrieveDiskPartitionInfo"] = reflect.TypeOf((*RetrieveDiskPartitionInfo)(nil)).Elem() -} - -type RetrieveDiskPartitionInfoRequestType struct { - This ManagedObjectReference `xml:"_this"` - DevicePath []string `xml:"devicePath"` -} - -func init() { - t["RetrieveDiskPartitionInfoRequestType"] = reflect.TypeOf((*RetrieveDiskPartitionInfoRequestType)(nil)).Elem() -} - -type RetrieveDiskPartitionInfoResponse struct { - Returnval []HostDiskPartitionInfo `xml:"returnval,omitempty"` -} - -type RetrieveEntityPermissions RetrieveEntityPermissionsRequestType - -func init() { - t["RetrieveEntityPermissions"] = reflect.TypeOf((*RetrieveEntityPermissions)(nil)).Elem() -} - -type RetrieveEntityPermissionsRequestType struct { - This ManagedObjectReference `xml:"_this"` - Entity ManagedObjectReference `xml:"entity"` - Inherited bool `xml:"inherited"` -} - -func init() { - t["RetrieveEntityPermissionsRequestType"] = reflect.TypeOf((*RetrieveEntityPermissionsRequestType)(nil)).Elem() -} - -type RetrieveEntityPermissionsResponse struct { - Returnval []Permission `xml:"returnval,omitempty"` -} - -type RetrieveEntityScheduledTask RetrieveEntityScheduledTaskRequestType - -func init() { - t["RetrieveEntityScheduledTask"] = reflect.TypeOf((*RetrieveEntityScheduledTask)(nil)).Elem() -} - -type RetrieveEntityScheduledTaskRequestType struct { - This ManagedObjectReference `xml:"_this"` - Entity *ManagedObjectReference `xml:"entity,omitempty"` -} - -func init() { - t["RetrieveEntityScheduledTaskRequestType"] = reflect.TypeOf((*RetrieveEntityScheduledTaskRequestType)(nil)).Elem() -} - -type RetrieveEntityScheduledTaskResponse struct { - Returnval []ManagedObjectReference `xml:"returnval,omitempty"` -} - -type RetrieveHardwareUptime RetrieveHardwareUptimeRequestType - -func init() { - t["RetrieveHardwareUptime"] = reflect.TypeOf((*RetrieveHardwareUptime)(nil)).Elem() -} - -type RetrieveHardwareUptimeRequestType struct { - This ManagedObjectReference `xml:"_this"` -} - -func init() { - t["RetrieveHardwareUptimeRequestType"] = reflect.TypeOf((*RetrieveHardwareUptimeRequestType)(nil)).Elem() -} - -type RetrieveHardwareUptimeResponse struct { - Returnval int64 `xml:"returnval"` -} - -type RetrieveObjectScheduledTask RetrieveObjectScheduledTaskRequestType - -func init() { - t["RetrieveObjectScheduledTask"] = reflect.TypeOf((*RetrieveObjectScheduledTask)(nil)).Elem() -} - -type RetrieveObjectScheduledTaskRequestType struct { - This ManagedObjectReference `xml:"_this"` - Obj *ManagedObjectReference `xml:"obj,omitempty"` -} - -func init() { - t["RetrieveObjectScheduledTaskRequestType"] = reflect.TypeOf((*RetrieveObjectScheduledTaskRequestType)(nil)).Elem() -} - -type RetrieveObjectScheduledTaskResponse struct { - Returnval []ManagedObjectReference `xml:"returnval,omitempty"` -} - -type RetrieveOptions struct { - DynamicData - - MaxObjects int `xml:"maxObjects,omitempty"` -} - -func init() { - t["RetrieveOptions"] = reflect.TypeOf((*RetrieveOptions)(nil)).Elem() -} - -type RetrieveProductComponents RetrieveProductComponentsRequestType - -func init() { - t["RetrieveProductComponents"] = reflect.TypeOf((*RetrieveProductComponents)(nil)).Elem() -} - -type RetrieveProductComponentsRequestType struct { - This ManagedObjectReference `xml:"_this"` -} - -func init() { - t["RetrieveProductComponentsRequestType"] = reflect.TypeOf((*RetrieveProductComponentsRequestType)(nil)).Elem() -} - -type RetrieveProductComponentsResponse struct { - Returnval []ProductComponentInfo `xml:"returnval,omitempty"` -} - -type RetrieveProperties RetrievePropertiesRequestType - -func init() { - t["RetrieveProperties"] = reflect.TypeOf((*RetrieveProperties)(nil)).Elem() -} - -type RetrievePropertiesEx RetrievePropertiesExRequestType - -func init() { - t["RetrievePropertiesEx"] = reflect.TypeOf((*RetrievePropertiesEx)(nil)).Elem() -} - -type RetrievePropertiesExRequestType struct { - This ManagedObjectReference `xml:"_this"` - SpecSet []PropertyFilterSpec `xml:"specSet"` - Options RetrieveOptions `xml:"options"` -} - -func init() { - t["RetrievePropertiesExRequestType"] = reflect.TypeOf((*RetrievePropertiesExRequestType)(nil)).Elem() -} - -type RetrievePropertiesExResponse struct { - Returnval *RetrieveResult `xml:"returnval,omitempty"` -} - -type RetrievePropertiesRequestType struct { - This ManagedObjectReference `xml:"_this"` - SpecSet []PropertyFilterSpec `xml:"specSet"` -} - -func init() { - t["RetrievePropertiesRequestType"] = reflect.TypeOf((*RetrievePropertiesRequestType)(nil)).Elem() -} - -type RetrievePropertiesResponse struct { - Returnval []ObjectContent `xml:"returnval,omitempty"` -} - -type RetrieveResult struct { - DynamicData - - Token string `xml:"token,omitempty"` - Objects []ObjectContent `xml:"objects"` -} - -func init() { - t["RetrieveResult"] = reflect.TypeOf((*RetrieveResult)(nil)).Elem() -} - -type RetrieveRolePermissions RetrieveRolePermissionsRequestType - -func init() { - t["RetrieveRolePermissions"] = reflect.TypeOf((*RetrieveRolePermissions)(nil)).Elem() -} - -type RetrieveRolePermissionsRequestType struct { - This ManagedObjectReference `xml:"_this"` - RoleId int `xml:"roleId"` -} - -func init() { - t["RetrieveRolePermissionsRequestType"] = reflect.TypeOf((*RetrieveRolePermissionsRequestType)(nil)).Elem() -} - -type RetrieveRolePermissionsResponse struct { - Returnval []Permission `xml:"returnval,omitempty"` -} - -type RetrieveServiceContent RetrieveServiceContentRequestType - -func init() { - t["RetrieveServiceContent"] = reflect.TypeOf((*RetrieveServiceContent)(nil)).Elem() -} - -type RetrieveServiceContentRequestType struct { - This ManagedObjectReference `xml:"_this"` -} - -func init() { - t["RetrieveServiceContentRequestType"] = reflect.TypeOf((*RetrieveServiceContentRequestType)(nil)).Elem() -} - -type RetrieveServiceContentResponse struct { - Returnval ServiceContent `xml:"returnval"` -} - -type RetrieveUserGroups RetrieveUserGroupsRequestType - -func init() { - t["RetrieveUserGroups"] = reflect.TypeOf((*RetrieveUserGroups)(nil)).Elem() -} - -type RetrieveUserGroupsRequestType struct { - This ManagedObjectReference `xml:"_this"` - Domain string `xml:"domain,omitempty"` - SearchStr string `xml:"searchStr"` - BelongsToGroup string `xml:"belongsToGroup,omitempty"` - BelongsToUser string `xml:"belongsToUser,omitempty"` - ExactMatch bool `xml:"exactMatch"` - FindUsers bool `xml:"findUsers"` - FindGroups bool `xml:"findGroups"` -} - -func init() { - t["RetrieveUserGroupsRequestType"] = reflect.TypeOf((*RetrieveUserGroupsRequestType)(nil)).Elem() -} - -type RetrieveUserGroupsResponse struct { - Returnval []BaseUserSearchResult `xml:"returnval,omitempty,typeattr"` -} - -type RevertToCurrentSnapshotRequestType struct { - This ManagedObjectReference `xml:"_this"` - Host *ManagedObjectReference `xml:"host,omitempty"` - SuppressPowerOn *bool `xml:"suppressPowerOn"` -} - -func init() { - t["RevertToCurrentSnapshotRequestType"] = reflect.TypeOf((*RevertToCurrentSnapshotRequestType)(nil)).Elem() -} - -type RevertToCurrentSnapshot_Task RevertToCurrentSnapshotRequestType - -func init() { - t["RevertToCurrentSnapshot_Task"] = reflect.TypeOf((*RevertToCurrentSnapshot_Task)(nil)).Elem() -} - -type RevertToCurrentSnapshot_TaskResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type RevertToSnapshotRequestType struct { - This ManagedObjectReference `xml:"_this"` - Host *ManagedObjectReference `xml:"host,omitempty"` - SuppressPowerOn *bool `xml:"suppressPowerOn"` -} - -func init() { - t["RevertToSnapshotRequestType"] = reflect.TypeOf((*RevertToSnapshotRequestType)(nil)).Elem() -} - -type RevertToSnapshot_Task RevertToSnapshotRequestType - -func init() { - t["RevertToSnapshot_Task"] = reflect.TypeOf((*RevertToSnapshot_Task)(nil)).Elem() -} - -type RevertToSnapshot_TaskResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type RewindCollector RewindCollectorRequestType - -func init() { - t["RewindCollector"] = reflect.TypeOf((*RewindCollector)(nil)).Elem() -} - -type RewindCollectorRequestType struct { - This ManagedObjectReference `xml:"_this"` -} - -func init() { - t["RewindCollectorRequestType"] = reflect.TypeOf((*RewindCollectorRequestType)(nil)).Elem() -} - -type RewindCollectorResponse struct { -} - -type RoleAddedEvent struct { - RoleEvent - - PrivilegeList []string `xml:"privilegeList,omitempty"` -} - -func init() { - t["RoleAddedEvent"] = reflect.TypeOf((*RoleAddedEvent)(nil)).Elem() -} - -type RoleEvent struct { - AuthorizationEvent - - Role RoleEventArgument `xml:"role"` -} - -func init() { - t["RoleEvent"] = reflect.TypeOf((*RoleEvent)(nil)).Elem() -} - -type RoleEventArgument struct { - EventArgument - - RoleId int `xml:"roleId"` - Name string `xml:"name"` -} - -func init() { - t["RoleEventArgument"] = reflect.TypeOf((*RoleEventArgument)(nil)).Elem() -} - -type RoleRemovedEvent struct { - RoleEvent -} - -func init() { - t["RoleRemovedEvent"] = reflect.TypeOf((*RoleRemovedEvent)(nil)).Elem() -} - -type RoleUpdatedEvent struct { - RoleEvent - - PrivilegeList []string `xml:"privilegeList,omitempty"` -} - -func init() { - t["RoleUpdatedEvent"] = reflect.TypeOf((*RoleUpdatedEvent)(nil)).Elem() -} - -type RollbackEvent struct { - DvsEvent - - HostName string `xml:"hostName"` - MethodName string `xml:"methodName,omitempty"` -} - -func init() { - t["RollbackEvent"] = reflect.TypeOf((*RollbackEvent)(nil)).Elem() -} - -type RollbackFailure struct { - DvsFault - - EntityName string `xml:"entityName"` - EntityType string `xml:"entityType"` -} - -func init() { - t["RollbackFailure"] = reflect.TypeOf((*RollbackFailure)(nil)).Elem() -} - -type RollbackFailureFault RollbackFailure - -func init() { - t["RollbackFailureFault"] = reflect.TypeOf((*RollbackFailureFault)(nil)).Elem() -} - -type RuleViolation struct { - VmConfigFault - - Host *ManagedObjectReference `xml:"host,omitempty"` - Rule BaseClusterRuleInfo `xml:"rule,omitempty,typeattr"` -} - -func init() { - t["RuleViolation"] = reflect.TypeOf((*RuleViolation)(nil)).Elem() -} - -type RuleViolationFault RuleViolation - -func init() { - t["RuleViolationFault"] = reflect.TypeOf((*RuleViolationFault)(nil)).Elem() -} - -type RunScheduledTask RunScheduledTaskRequestType - -func init() { - t["RunScheduledTask"] = reflect.TypeOf((*RunScheduledTask)(nil)).Elem() -} - -type RunScheduledTaskRequestType struct { - This ManagedObjectReference `xml:"_this"` -} - -func init() { - t["RunScheduledTaskRequestType"] = reflect.TypeOf((*RunScheduledTaskRequestType)(nil)).Elem() -} - -type RunScheduledTaskResponse struct { -} - -type RunScriptAction struct { - Action - - Script string `xml:"script"` -} - -func init() { - t["RunScriptAction"] = reflect.TypeOf((*RunScriptAction)(nil)).Elem() -} - -type RuntimeFault struct { - MethodFault -} - -func init() { - t["RuntimeFault"] = reflect.TypeOf((*RuntimeFault)(nil)).Elem() -} - -type RuntimeFaultFault BaseRuntimeFault - -func init() { - t["RuntimeFaultFault"] = reflect.TypeOf((*RuntimeFaultFault)(nil)).Elem() -} - -type SSLDisabledFault struct { - HostConnectFault -} - -func init() { - t["SSLDisabledFault"] = reflect.TypeOf((*SSLDisabledFault)(nil)).Elem() -} - -type SSLDisabledFaultFault SSLDisabledFault - -func init() { - t["SSLDisabledFaultFault"] = reflect.TypeOf((*SSLDisabledFaultFault)(nil)).Elem() -} - -type SSLVerifyFault struct { - HostConnectFault - - SelfSigned bool `xml:"selfSigned"` - Thumbprint string `xml:"thumbprint"` -} - -func init() { - t["SSLVerifyFault"] = reflect.TypeOf((*SSLVerifyFault)(nil)).Elem() -} - -type SSLVerifyFaultFault SSLVerifyFault - -func init() { - t["SSLVerifyFaultFault"] = reflect.TypeOf((*SSLVerifyFaultFault)(nil)).Elem() -} - -type SSPIAuthentication struct { - GuestAuthentication - - SspiToken string `xml:"sspiToken"` -} - -func init() { - t["SSPIAuthentication"] = reflect.TypeOf((*SSPIAuthentication)(nil)).Elem() -} - -type SSPIChallenge struct { - VimFault - - Base64Token string `xml:"base64Token"` -} - -func init() { - t["SSPIChallenge"] = reflect.TypeOf((*SSPIChallenge)(nil)).Elem() -} - -type SSPIChallengeFault SSPIChallenge - -func init() { - t["SSPIChallengeFault"] = reflect.TypeOf((*SSPIChallengeFault)(nil)).Elem() -} - -type ScanHostPatchRequestType struct { - This ManagedObjectReference `xml:"_this"` - Repository HostPatchManagerLocator `xml:"repository"` - UpdateID []string `xml:"updateID,omitempty"` -} - -func init() { - t["ScanHostPatchRequestType"] = reflect.TypeOf((*ScanHostPatchRequestType)(nil)).Elem() -} - -type ScanHostPatchV2RequestType struct { - This ManagedObjectReference `xml:"_this"` - MetaUrls []string `xml:"metaUrls,omitempty"` - BundleUrls []string `xml:"bundleUrls,omitempty"` - Spec *HostPatchManagerPatchManagerOperationSpec `xml:"spec,omitempty"` -} - -func init() { - t["ScanHostPatchV2RequestType"] = reflect.TypeOf((*ScanHostPatchV2RequestType)(nil)).Elem() -} - -type ScanHostPatchV2_Task ScanHostPatchV2RequestType - -func init() { - t["ScanHostPatchV2_Task"] = reflect.TypeOf((*ScanHostPatchV2_Task)(nil)).Elem() -} - -type ScanHostPatchV2_TaskResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type ScanHostPatch_Task ScanHostPatchRequestType - -func init() { - t["ScanHostPatch_Task"] = reflect.TypeOf((*ScanHostPatch_Task)(nil)).Elem() -} - -type ScanHostPatch_TaskResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type ScheduledHardwareUpgradeInfo struct { - DynamicData - - UpgradePolicy string `xml:"upgradePolicy,omitempty"` - VersionKey string `xml:"versionKey,omitempty"` - ScheduledHardwareUpgradeStatus string `xml:"scheduledHardwareUpgradeStatus,omitempty"` - Fault *LocalizedMethodFault `xml:"fault,omitempty"` -} - -func init() { - t["ScheduledHardwareUpgradeInfo"] = reflect.TypeOf((*ScheduledHardwareUpgradeInfo)(nil)).Elem() -} - -type ScheduledTaskCompletedEvent struct { - ScheduledTaskEvent -} - -func init() { - t["ScheduledTaskCompletedEvent"] = reflect.TypeOf((*ScheduledTaskCompletedEvent)(nil)).Elem() -} - -type ScheduledTaskCreatedEvent struct { - ScheduledTaskEvent -} - -func init() { - t["ScheduledTaskCreatedEvent"] = reflect.TypeOf((*ScheduledTaskCreatedEvent)(nil)).Elem() -} - -type ScheduledTaskDescription struct { - DynamicData - - Action []BaseTypeDescription `xml:"action,typeattr"` - SchedulerInfo []ScheduledTaskDetail `xml:"schedulerInfo"` - State []BaseElementDescription `xml:"state,typeattr"` - DayOfWeek []BaseElementDescription `xml:"dayOfWeek,typeattr"` - WeekOfMonth []BaseElementDescription `xml:"weekOfMonth,typeattr"` -} - -func init() { - t["ScheduledTaskDescription"] = reflect.TypeOf((*ScheduledTaskDescription)(nil)).Elem() -} - -type ScheduledTaskDetail struct { - TypeDescription - - Frequency string `xml:"frequency"` -} - -func init() { - t["ScheduledTaskDetail"] = reflect.TypeOf((*ScheduledTaskDetail)(nil)).Elem() -} - -type ScheduledTaskEmailCompletedEvent struct { - ScheduledTaskEvent - - To string `xml:"to"` -} - -func init() { - t["ScheduledTaskEmailCompletedEvent"] = reflect.TypeOf((*ScheduledTaskEmailCompletedEvent)(nil)).Elem() -} - -type ScheduledTaskEmailFailedEvent struct { - ScheduledTaskEvent - - To string `xml:"to"` - Reason LocalizedMethodFault `xml:"reason"` -} - -func init() { - t["ScheduledTaskEmailFailedEvent"] = reflect.TypeOf((*ScheduledTaskEmailFailedEvent)(nil)).Elem() -} - -type ScheduledTaskEvent struct { - Event - - ScheduledTask ScheduledTaskEventArgument `xml:"scheduledTask"` - Entity ManagedEntityEventArgument `xml:"entity"` -} - -func init() { - t["ScheduledTaskEvent"] = reflect.TypeOf((*ScheduledTaskEvent)(nil)).Elem() -} - -type ScheduledTaskEventArgument struct { - EntityEventArgument - - ScheduledTask ManagedObjectReference `xml:"scheduledTask"` -} - -func init() { - t["ScheduledTaskEventArgument"] = reflect.TypeOf((*ScheduledTaskEventArgument)(nil)).Elem() -} - -type ScheduledTaskFailedEvent struct { - ScheduledTaskEvent - - Reason LocalizedMethodFault `xml:"reason"` -} - -func init() { - t["ScheduledTaskFailedEvent"] = reflect.TypeOf((*ScheduledTaskFailedEvent)(nil)).Elem() -} - -type ScheduledTaskInfo struct { - ScheduledTaskSpec - - ScheduledTask ManagedObjectReference `xml:"scheduledTask"` - Entity ManagedObjectReference `xml:"entity"` - LastModifiedTime time.Time `xml:"lastModifiedTime"` - LastModifiedUser string `xml:"lastModifiedUser"` - NextRunTime *time.Time `xml:"nextRunTime"` - PrevRunTime *time.Time `xml:"prevRunTime"` - State TaskInfoState `xml:"state"` - Error *LocalizedMethodFault `xml:"error,omitempty"` - Result AnyType `xml:"result,omitempty,typeattr"` - Progress int `xml:"progress,omitempty"` - ActiveTask *ManagedObjectReference `xml:"activeTask,omitempty"` - TaskObject *ManagedObjectReference `xml:"taskObject,omitempty"` -} - -func init() { - t["ScheduledTaskInfo"] = reflect.TypeOf((*ScheduledTaskInfo)(nil)).Elem() -} - -type ScheduledTaskReconfiguredEvent struct { - ScheduledTaskEvent -} - -func init() { - t["ScheduledTaskReconfiguredEvent"] = reflect.TypeOf((*ScheduledTaskReconfiguredEvent)(nil)).Elem() -} - -type ScheduledTaskRemovedEvent struct { - ScheduledTaskEvent -} - -func init() { - t["ScheduledTaskRemovedEvent"] = reflect.TypeOf((*ScheduledTaskRemovedEvent)(nil)).Elem() -} - -type ScheduledTaskSpec struct { - DynamicData - - Name string `xml:"name"` - Description string `xml:"description"` - Enabled bool `xml:"enabled"` - Scheduler BaseTaskScheduler `xml:"scheduler,typeattr"` - Action BaseAction `xml:"action,typeattr"` - Notification string `xml:"notification,omitempty"` -} - -func init() { - t["ScheduledTaskSpec"] = reflect.TypeOf((*ScheduledTaskSpec)(nil)).Elem() -} - -type ScheduledTaskStartedEvent struct { - ScheduledTaskEvent -} - -func init() { - t["ScheduledTaskStartedEvent"] = reflect.TypeOf((*ScheduledTaskStartedEvent)(nil)).Elem() -} - -type ScsiLun struct { - HostDevice - - Key string `xml:"key,omitempty"` - Uuid string `xml:"uuid"` - Descriptor []ScsiLunDescriptor `xml:"descriptor,omitempty"` - CanonicalName string `xml:"canonicalName,omitempty"` - DisplayName string `xml:"displayName,omitempty"` - LunType string `xml:"lunType"` - Vendor string `xml:"vendor,omitempty"` - Model string `xml:"model,omitempty"` - Revision string `xml:"revision,omitempty"` - ScsiLevel int `xml:"scsiLevel,omitempty"` - SerialNumber string `xml:"serialNumber,omitempty"` - DurableName *ScsiLunDurableName `xml:"durableName,omitempty"` - AlternateName []ScsiLunDurableName `xml:"alternateName,omitempty"` - StandardInquiry []byte `xml:"standardInquiry,omitempty"` - QueueDepth int `xml:"queueDepth,omitempty"` - OperationalState []string `xml:"operationalState"` - Capabilities *ScsiLunCapabilities `xml:"capabilities,omitempty"` - VStorageSupport string `xml:"vStorageSupport,omitempty"` -} - -func init() { - t["ScsiLun"] = reflect.TypeOf((*ScsiLun)(nil)).Elem() -} - -type ScsiLunCapabilities struct { - DynamicData - - UpdateDisplayNameSupported bool `xml:"updateDisplayNameSupported"` -} - -func init() { - t["ScsiLunCapabilities"] = reflect.TypeOf((*ScsiLunCapabilities)(nil)).Elem() -} - -type ScsiLunDescriptor struct { - DynamicData - - Quality string `xml:"quality"` - Id string `xml:"id"` -} - -func init() { - t["ScsiLunDescriptor"] = reflect.TypeOf((*ScsiLunDescriptor)(nil)).Elem() -} - -type ScsiLunDurableName struct { - DynamicData - - Namespace string `xml:"namespace"` - NamespaceId byte `xml:"namespaceId"` - Data []byte `xml:"data,omitempty"` -} - -func init() { - t["ScsiLunDurableName"] = reflect.TypeOf((*ScsiLunDurableName)(nil)).Elem() -} - -type SeSparseVirtualDiskSpec struct { - FileBackedVirtualDiskSpec - - GrainSizeKb int `xml:"grainSizeKb,omitempty"` -} - -func init() { - t["SeSparseVirtualDiskSpec"] = reflect.TypeOf((*SeSparseVirtualDiskSpec)(nil)).Elem() -} - -type SearchDatastoreRequestType struct { - This ManagedObjectReference `xml:"_this"` - DatastorePath string `xml:"datastorePath"` - SearchSpec *HostDatastoreBrowserSearchSpec `xml:"searchSpec,omitempty"` -} - -func init() { - t["SearchDatastoreRequestType"] = reflect.TypeOf((*SearchDatastoreRequestType)(nil)).Elem() -} - -type SearchDatastoreSubFoldersRequestType struct { - This ManagedObjectReference `xml:"_this"` - DatastorePath string `xml:"datastorePath"` - SearchSpec *HostDatastoreBrowserSearchSpec `xml:"searchSpec,omitempty"` -} - -func init() { - t["SearchDatastoreSubFoldersRequestType"] = reflect.TypeOf((*SearchDatastoreSubFoldersRequestType)(nil)).Elem() -} - -type SearchDatastoreSubFolders_Task SearchDatastoreSubFoldersRequestType - -func init() { - t["SearchDatastoreSubFolders_Task"] = reflect.TypeOf((*SearchDatastoreSubFolders_Task)(nil)).Elem() -} - -type SearchDatastoreSubFolders_TaskResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type SearchDatastore_Task SearchDatastoreRequestType - -func init() { - t["SearchDatastore_Task"] = reflect.TypeOf((*SearchDatastore_Task)(nil)).Elem() -} - -type SearchDatastore_TaskResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type SecondaryVmAlreadyDisabled struct { - VmFaultToleranceIssue - - InstanceUuid string `xml:"instanceUuid"` -} - -func init() { - t["SecondaryVmAlreadyDisabled"] = reflect.TypeOf((*SecondaryVmAlreadyDisabled)(nil)).Elem() -} - -type SecondaryVmAlreadyDisabledFault SecondaryVmAlreadyDisabled - -func init() { - t["SecondaryVmAlreadyDisabledFault"] = reflect.TypeOf((*SecondaryVmAlreadyDisabledFault)(nil)).Elem() -} - -type SecondaryVmAlreadyEnabled struct { - VmFaultToleranceIssue - - InstanceUuid string `xml:"instanceUuid"` -} - -func init() { - t["SecondaryVmAlreadyEnabled"] = reflect.TypeOf((*SecondaryVmAlreadyEnabled)(nil)).Elem() -} - -type SecondaryVmAlreadyEnabledFault SecondaryVmAlreadyEnabled - -func init() { - t["SecondaryVmAlreadyEnabledFault"] = reflect.TypeOf((*SecondaryVmAlreadyEnabledFault)(nil)).Elem() -} - -type SecondaryVmAlreadyRegistered struct { - VmFaultToleranceIssue - - InstanceUuid string `xml:"instanceUuid,omitempty"` -} - -func init() { - t["SecondaryVmAlreadyRegistered"] = reflect.TypeOf((*SecondaryVmAlreadyRegistered)(nil)).Elem() -} - -type SecondaryVmAlreadyRegisteredFault SecondaryVmAlreadyRegistered - -func init() { - t["SecondaryVmAlreadyRegisteredFault"] = reflect.TypeOf((*SecondaryVmAlreadyRegisteredFault)(nil)).Elem() -} - -type SecondaryVmNotRegistered struct { - VmFaultToleranceIssue - - InstanceUuid string `xml:"instanceUuid,omitempty"` -} - -func init() { - t["SecondaryVmNotRegistered"] = reflect.TypeOf((*SecondaryVmNotRegistered)(nil)).Elem() -} - -type SecondaryVmNotRegisteredFault SecondaryVmNotRegistered - -func init() { - t["SecondaryVmNotRegisteredFault"] = reflect.TypeOf((*SecondaryVmNotRegisteredFault)(nil)).Elem() -} - -type SecurityError struct { - RuntimeFault -} - -func init() { - t["SecurityError"] = reflect.TypeOf((*SecurityError)(nil)).Elem() -} - -type SecurityErrorFault BaseSecurityError - -func init() { - t["SecurityErrorFault"] = reflect.TypeOf((*SecurityErrorFault)(nil)).Elem() -} - -type SecurityProfile struct { - ApplyProfile - - Permission []PermissionProfile `xml:"permission,omitempty"` -} - -func init() { - t["SecurityProfile"] = reflect.TypeOf((*SecurityProfile)(nil)).Elem() -} - -type SelectActivePartition SelectActivePartitionRequestType - -func init() { - t["SelectActivePartition"] = reflect.TypeOf((*SelectActivePartition)(nil)).Elem() -} - -type SelectActivePartitionRequestType struct { - This ManagedObjectReference `xml:"_this"` - Partition *HostScsiDiskPartition `xml:"partition,omitempty"` -} - -func init() { - t["SelectActivePartitionRequestType"] = reflect.TypeOf((*SelectActivePartitionRequestType)(nil)).Elem() -} - -type SelectActivePartitionResponse struct { -} - -type SelectVnic SelectVnicRequestType - -func init() { - t["SelectVnic"] = reflect.TypeOf((*SelectVnic)(nil)).Elem() -} - -type SelectVnicForNicType SelectVnicForNicTypeRequestType - -func init() { - t["SelectVnicForNicType"] = reflect.TypeOf((*SelectVnicForNicType)(nil)).Elem() -} - -type SelectVnicForNicTypeRequestType struct { - This ManagedObjectReference `xml:"_this"` - NicType string `xml:"nicType"` - Device string `xml:"device"` -} - -func init() { - t["SelectVnicForNicTypeRequestType"] = reflect.TypeOf((*SelectVnicForNicTypeRequestType)(nil)).Elem() -} - -type SelectVnicForNicTypeResponse struct { -} - -type SelectVnicRequestType struct { - This ManagedObjectReference `xml:"_this"` - Device string `xml:"device"` -} - -func init() { - t["SelectVnicRequestType"] = reflect.TypeOf((*SelectVnicRequestType)(nil)).Elem() -} - -type SelectVnicResponse struct { -} - -type SelectionSet struct { - DynamicData -} - -func init() { - t["SelectionSet"] = reflect.TypeOf((*SelectionSet)(nil)).Elem() -} - -type SelectionSpec struct { - DynamicData - - Name string `xml:"name,omitempty"` -} - -func init() { - t["SelectionSpec"] = reflect.TypeOf((*SelectionSpec)(nil)).Elem() -} - -type SendEmailAction struct { - Action - - ToList string `xml:"toList"` - CcList string `xml:"ccList"` - Subject string `xml:"subject"` - Body string `xml:"body"` -} - -func init() { - t["SendEmailAction"] = reflect.TypeOf((*SendEmailAction)(nil)).Elem() -} - -type SendSNMPAction struct { - Action -} - -func init() { - t["SendSNMPAction"] = reflect.TypeOf((*SendSNMPAction)(nil)).Elem() -} - -type SendTestNotification SendTestNotificationRequestType - -func init() { - t["SendTestNotification"] = reflect.TypeOf((*SendTestNotification)(nil)).Elem() -} - -type SendTestNotificationRequestType struct { - This ManagedObjectReference `xml:"_this"` -} - -func init() { - t["SendTestNotificationRequestType"] = reflect.TypeOf((*SendTestNotificationRequestType)(nil)).Elem() -} - -type SendTestNotificationResponse struct { -} - -type ServerLicenseExpiredEvent struct { - LicenseEvent - - Product string `xml:"product"` -} - -func init() { - t["ServerLicenseExpiredEvent"] = reflect.TypeOf((*ServerLicenseExpiredEvent)(nil)).Elem() -} - -type ServerStartedSessionEvent struct { - SessionEvent -} - -func init() { - t["ServerStartedSessionEvent"] = reflect.TypeOf((*ServerStartedSessionEvent)(nil)).Elem() -} - -type ServiceConsolePortGroupProfile struct { - PortGroupProfile - - IpConfig IpAddressProfile `xml:"ipConfig"` -} - -func init() { - t["ServiceConsolePortGroupProfile"] = reflect.TypeOf((*ServiceConsolePortGroupProfile)(nil)).Elem() -} - -type ServiceConsoleReservationInfo struct { - DynamicData - - ServiceConsoleReservedCfg int64 `xml:"serviceConsoleReservedCfg"` - ServiceConsoleReserved int64 `xml:"serviceConsoleReserved"` - Unreserved int64 `xml:"unreserved"` -} - -func init() { - t["ServiceConsoleReservationInfo"] = reflect.TypeOf((*ServiceConsoleReservationInfo)(nil)).Elem() -} - -type ServiceContent struct { - DynamicData - - RootFolder ManagedObjectReference `xml:"rootFolder"` - PropertyCollector ManagedObjectReference `xml:"propertyCollector"` - ViewManager *ManagedObjectReference `xml:"viewManager,omitempty"` - About AboutInfo `xml:"about"` - Setting *ManagedObjectReference `xml:"setting,omitempty"` - UserDirectory *ManagedObjectReference `xml:"userDirectory,omitempty"` - SessionManager *ManagedObjectReference `xml:"sessionManager,omitempty"` - AuthorizationManager *ManagedObjectReference `xml:"authorizationManager,omitempty"` - ServiceManager *ManagedObjectReference `xml:"serviceManager,omitempty"` - PerfManager *ManagedObjectReference `xml:"perfManager,omitempty"` - ScheduledTaskManager *ManagedObjectReference `xml:"scheduledTaskManager,omitempty"` - AlarmManager *ManagedObjectReference `xml:"alarmManager,omitempty"` - EventManager *ManagedObjectReference `xml:"eventManager,omitempty"` - TaskManager *ManagedObjectReference `xml:"taskManager,omitempty"` - ExtensionManager *ManagedObjectReference `xml:"extensionManager,omitempty"` - CustomizationSpecManager *ManagedObjectReference `xml:"customizationSpecManager,omitempty"` - CustomFieldsManager *ManagedObjectReference `xml:"customFieldsManager,omitempty"` - AccountManager *ManagedObjectReference `xml:"accountManager,omitempty"` - DiagnosticManager *ManagedObjectReference `xml:"diagnosticManager,omitempty"` - LicenseManager *ManagedObjectReference `xml:"licenseManager,omitempty"` - SearchIndex *ManagedObjectReference `xml:"searchIndex,omitempty"` - FileManager *ManagedObjectReference `xml:"fileManager,omitempty"` - DatastoreNamespaceManager *ManagedObjectReference `xml:"datastoreNamespaceManager,omitempty"` - VirtualDiskManager *ManagedObjectReference `xml:"virtualDiskManager,omitempty"` - VirtualizationManager *ManagedObjectReference `xml:"virtualizationManager,omitempty"` - SnmpSystem *ManagedObjectReference `xml:"snmpSystem,omitempty"` - VmProvisioningChecker *ManagedObjectReference `xml:"vmProvisioningChecker,omitempty"` - VmCompatibilityChecker *ManagedObjectReference `xml:"vmCompatibilityChecker,omitempty"` - OvfManager *ManagedObjectReference `xml:"ovfManager,omitempty"` - IpPoolManager *ManagedObjectReference `xml:"ipPoolManager,omitempty"` - DvSwitchManager *ManagedObjectReference `xml:"dvSwitchManager,omitempty"` - HostProfileManager *ManagedObjectReference `xml:"hostProfileManager,omitempty"` - ClusterProfileManager *ManagedObjectReference `xml:"clusterProfileManager,omitempty"` - ComplianceManager *ManagedObjectReference `xml:"complianceManager,omitempty"` - LocalizationManager *ManagedObjectReference `xml:"localizationManager,omitempty"` - StorageResourceManager *ManagedObjectReference `xml:"storageResourceManager,omitempty"` - GuestOperationsManager *ManagedObjectReference `xml:"guestOperationsManager,omitempty"` -} - -func init() { - t["ServiceContent"] = reflect.TypeOf((*ServiceContent)(nil)).Elem() -} - -type ServiceManagerServiceInfo struct { - DynamicData - - ServiceName string `xml:"serviceName"` - Location []string `xml:"location,omitempty"` - Service ManagedObjectReference `xml:"service"` - Description string `xml:"description"` -} - -func init() { - t["ServiceManagerServiceInfo"] = reflect.TypeOf((*ServiceManagerServiceInfo)(nil)).Elem() -} - -type ServiceProfile struct { - ApplyProfile - - Key string `xml:"key"` -} - -func init() { - t["ServiceProfile"] = reflect.TypeOf((*ServiceProfile)(nil)).Elem() -} - -type SessionEvent struct { - Event -} - -func init() { - t["SessionEvent"] = reflect.TypeOf((*SessionEvent)(nil)).Elem() -} - -type SessionIsActive SessionIsActiveRequestType - -func init() { - t["SessionIsActive"] = reflect.TypeOf((*SessionIsActive)(nil)).Elem() -} - -type SessionIsActiveRequestType struct { - This ManagedObjectReference `xml:"_this"` - SessionID string `xml:"sessionID"` - UserName string `xml:"userName"` -} - -func init() { - t["SessionIsActiveRequestType"] = reflect.TypeOf((*SessionIsActiveRequestType)(nil)).Elem() -} - -type SessionIsActiveResponse struct { - Returnval bool `xml:"returnval"` -} - -type SessionManagerGenericServiceTicket struct { - DynamicData - - Id string `xml:"id"` - HostName string `xml:"hostName,omitempty"` - SslThumbprint string `xml:"sslThumbprint,omitempty"` -} - -func init() { - t["SessionManagerGenericServiceTicket"] = reflect.TypeOf((*SessionManagerGenericServiceTicket)(nil)).Elem() -} - -type SessionManagerHttpServiceRequestSpec struct { - SessionManagerServiceRequestSpec - - Method string `xml:"method,omitempty"` - Url string `xml:"url"` -} - -func init() { - t["SessionManagerHttpServiceRequestSpec"] = reflect.TypeOf((*SessionManagerHttpServiceRequestSpec)(nil)).Elem() -} - -type SessionManagerLocalTicket struct { - DynamicData - - UserName string `xml:"userName"` - PasswordFilePath string `xml:"passwordFilePath"` -} - -func init() { - t["SessionManagerLocalTicket"] = reflect.TypeOf((*SessionManagerLocalTicket)(nil)).Elem() -} - -type SessionManagerServiceRequestSpec struct { - DynamicData -} - -func init() { - t["SessionManagerServiceRequestSpec"] = reflect.TypeOf((*SessionManagerServiceRequestSpec)(nil)).Elem() -} - -type SessionManagerVmomiServiceRequestSpec struct { - SessionManagerServiceRequestSpec - - Method string `xml:"method"` -} - -func init() { - t["SessionManagerVmomiServiceRequestSpec"] = reflect.TypeOf((*SessionManagerVmomiServiceRequestSpec)(nil)).Elem() -} - -type SessionTerminatedEvent struct { - SessionEvent - - SessionId string `xml:"sessionId"` - TerminatedUsername string `xml:"terminatedUsername"` -} - -func init() { - t["SessionTerminatedEvent"] = reflect.TypeOf((*SessionTerminatedEvent)(nil)).Elem() -} - -type SetCollectorPageSize SetCollectorPageSizeRequestType - -func init() { - t["SetCollectorPageSize"] = reflect.TypeOf((*SetCollectorPageSize)(nil)).Elem() -} - -type SetCollectorPageSizeRequestType struct { - This ManagedObjectReference `xml:"_this"` - MaxCount int `xml:"maxCount"` -} - -func init() { - t["SetCollectorPageSizeRequestType"] = reflect.TypeOf((*SetCollectorPageSizeRequestType)(nil)).Elem() -} - -type SetCollectorPageSizeResponse struct { -} - -type SetDisplayTopology SetDisplayTopologyRequestType - -func init() { - t["SetDisplayTopology"] = reflect.TypeOf((*SetDisplayTopology)(nil)).Elem() -} - -type SetDisplayTopologyRequestType struct { - This ManagedObjectReference `xml:"_this"` - Displays []VirtualMachineDisplayTopology `xml:"displays"` -} - -func init() { - t["SetDisplayTopologyRequestType"] = reflect.TypeOf((*SetDisplayTopologyRequestType)(nil)).Elem() -} - -type SetDisplayTopologyResponse struct { -} - -type SetEntityPermissions SetEntityPermissionsRequestType - -func init() { - t["SetEntityPermissions"] = reflect.TypeOf((*SetEntityPermissions)(nil)).Elem() -} - -type SetEntityPermissionsRequestType struct { - This ManagedObjectReference `xml:"_this"` - Entity ManagedObjectReference `xml:"entity"` - Permission []Permission `xml:"permission,omitempty"` -} - -func init() { - t["SetEntityPermissionsRequestType"] = reflect.TypeOf((*SetEntityPermissionsRequestType)(nil)).Elem() -} - -type SetEntityPermissionsResponse struct { -} - -type SetExtensionCertificate SetExtensionCertificateRequestType - -func init() { - t["SetExtensionCertificate"] = reflect.TypeOf((*SetExtensionCertificate)(nil)).Elem() -} - -type SetExtensionCertificateRequestType struct { - This ManagedObjectReference `xml:"_this"` - ExtensionKey string `xml:"extensionKey"` - CertificatePem string `xml:"certificatePem,omitempty"` -} - -func init() { - t["SetExtensionCertificateRequestType"] = reflect.TypeOf((*SetExtensionCertificateRequestType)(nil)).Elem() -} - -type SetExtensionCertificateResponse struct { -} - -type SetField SetFieldRequestType - -func init() { - t["SetField"] = reflect.TypeOf((*SetField)(nil)).Elem() -} - -type SetFieldRequestType struct { - This ManagedObjectReference `xml:"_this"` - Entity ManagedObjectReference `xml:"entity"` - Key int `xml:"key"` - Value string `xml:"value"` -} - -func init() { - t["SetFieldRequestType"] = reflect.TypeOf((*SetFieldRequestType)(nil)).Elem() -} - -type SetFieldResponse struct { -} - -type SetLicenseEdition SetLicenseEditionRequestType - -func init() { - t["SetLicenseEdition"] = reflect.TypeOf((*SetLicenseEdition)(nil)).Elem() -} - -type SetLicenseEditionRequestType struct { - This ManagedObjectReference `xml:"_this"` - Host *ManagedObjectReference `xml:"host,omitempty"` - FeatureKey string `xml:"featureKey,omitempty"` -} - -func init() { - t["SetLicenseEditionRequestType"] = reflect.TypeOf((*SetLicenseEditionRequestType)(nil)).Elem() -} - -type SetLicenseEditionResponse struct { -} - -type SetLocale SetLocaleRequestType - -func init() { - t["SetLocale"] = reflect.TypeOf((*SetLocale)(nil)).Elem() -} - -type SetLocaleRequestType struct { - This ManagedObjectReference `xml:"_this"` - Locale string `xml:"locale"` -} - -func init() { - t["SetLocaleRequestType"] = reflect.TypeOf((*SetLocaleRequestType)(nil)).Elem() -} - -type SetLocaleResponse struct { -} - -type SetMultipathLunPolicy SetMultipathLunPolicyRequestType - -func init() { - t["SetMultipathLunPolicy"] = reflect.TypeOf((*SetMultipathLunPolicy)(nil)).Elem() -} - -type SetMultipathLunPolicyRequestType struct { - This ManagedObjectReference `xml:"_this"` - LunId string `xml:"lunId"` - Policy BaseHostMultipathInfoLogicalUnitPolicy `xml:"policy,typeattr"` -} - -func init() { - t["SetMultipathLunPolicyRequestType"] = reflect.TypeOf((*SetMultipathLunPolicyRequestType)(nil)).Elem() -} - -type SetMultipathLunPolicyResponse struct { -} - -type SetPublicKey SetPublicKeyRequestType - -func init() { - t["SetPublicKey"] = reflect.TypeOf((*SetPublicKey)(nil)).Elem() -} - -type SetPublicKeyRequestType struct { - This ManagedObjectReference `xml:"_this"` - ExtensionKey string `xml:"extensionKey"` - PublicKey string `xml:"publicKey"` -} - -func init() { - t["SetPublicKeyRequestType"] = reflect.TypeOf((*SetPublicKeyRequestType)(nil)).Elem() -} - -type SetPublicKeyResponse struct { -} - -type SetScreenResolution SetScreenResolutionRequestType - -func init() { - t["SetScreenResolution"] = reflect.TypeOf((*SetScreenResolution)(nil)).Elem() -} - -type SetScreenResolutionRequestType struct { - This ManagedObjectReference `xml:"_this"` - Width int `xml:"width"` - Height int `xml:"height"` -} - -func init() { - t["SetScreenResolutionRequestType"] = reflect.TypeOf((*SetScreenResolutionRequestType)(nil)).Elem() -} - -type SetScreenResolutionResponse struct { -} - -type SetTaskDescription SetTaskDescriptionRequestType - -func init() { - t["SetTaskDescription"] = reflect.TypeOf((*SetTaskDescription)(nil)).Elem() -} - -type SetTaskDescriptionRequestType struct { - This ManagedObjectReference `xml:"_this"` - Description LocalizableMessage `xml:"description"` -} - -func init() { - t["SetTaskDescriptionRequestType"] = reflect.TypeOf((*SetTaskDescriptionRequestType)(nil)).Elem() -} - -type SetTaskDescriptionResponse struct { -} - -type SetTaskState SetTaskStateRequestType - -func init() { - t["SetTaskState"] = reflect.TypeOf((*SetTaskState)(nil)).Elem() -} - -type SetTaskStateRequestType struct { - This ManagedObjectReference `xml:"_this"` - State TaskInfoState `xml:"state"` - Result AnyType `xml:"result,omitempty,typeattr"` - Fault *LocalizedMethodFault `xml:"fault,omitempty"` -} - -func init() { - t["SetTaskStateRequestType"] = reflect.TypeOf((*SetTaskStateRequestType)(nil)).Elem() -} - -type SetTaskStateResponse struct { -} - -type SetVirtualDiskUuid SetVirtualDiskUuidRequestType - -func init() { - t["SetVirtualDiskUuid"] = reflect.TypeOf((*SetVirtualDiskUuid)(nil)).Elem() -} - -type SetVirtualDiskUuidRequestType struct { - This ManagedObjectReference `xml:"_this"` - Name string `xml:"name"` - Datacenter *ManagedObjectReference `xml:"datacenter,omitempty"` - Uuid string `xml:"uuid"` -} - -func init() { - t["SetVirtualDiskUuidRequestType"] = reflect.TypeOf((*SetVirtualDiskUuidRequestType)(nil)).Elem() -} - -type SetVirtualDiskUuidResponse struct { -} - -type SharedBusControllerNotSupported struct { - DeviceNotSupported -} - -func init() { - t["SharedBusControllerNotSupported"] = reflect.TypeOf((*SharedBusControllerNotSupported)(nil)).Elem() -} - -type SharedBusControllerNotSupportedFault SharedBusControllerNotSupported - -func init() { - t["SharedBusControllerNotSupportedFault"] = reflect.TypeOf((*SharedBusControllerNotSupportedFault)(nil)).Elem() -} - -type SharesInfo struct { - DynamicData - - Shares int `xml:"shares"` - Level SharesLevel `xml:"level"` -} - -func init() { - t["SharesInfo"] = reflect.TypeOf((*SharesInfo)(nil)).Elem() -} - -type SharesOption struct { - DynamicData - - SharesOption IntOption `xml:"sharesOption"` - DefaultLevel SharesLevel `xml:"defaultLevel"` -} - -func init() { - t["SharesOption"] = reflect.TypeOf((*SharesOption)(nil)).Elem() -} - -type ShrinkDiskFault struct { - VimFault - - DiskId int `xml:"diskId,omitempty"` -} - -func init() { - t["ShrinkDiskFault"] = reflect.TypeOf((*ShrinkDiskFault)(nil)).Elem() -} - -type ShrinkDiskFaultFault ShrinkDiskFault - -func init() { - t["ShrinkDiskFaultFault"] = reflect.TypeOf((*ShrinkDiskFaultFault)(nil)).Elem() -} - -type ShrinkVirtualDiskRequestType struct { - This ManagedObjectReference `xml:"_this"` - Name string `xml:"name"` - Datacenter *ManagedObjectReference `xml:"datacenter,omitempty"` - Copy *bool `xml:"copy"` -} - -func init() { - t["ShrinkVirtualDiskRequestType"] = reflect.TypeOf((*ShrinkVirtualDiskRequestType)(nil)).Elem() -} - -type ShrinkVirtualDisk_Task ShrinkVirtualDiskRequestType - -func init() { - t["ShrinkVirtualDisk_Task"] = reflect.TypeOf((*ShrinkVirtualDisk_Task)(nil)).Elem() -} - -type ShrinkVirtualDisk_TaskResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type ShutdownGuest ShutdownGuestRequestType - -func init() { - t["ShutdownGuest"] = reflect.TypeOf((*ShutdownGuest)(nil)).Elem() -} - -type ShutdownGuestRequestType struct { - This ManagedObjectReference `xml:"_this"` -} - -func init() { - t["ShutdownGuestRequestType"] = reflect.TypeOf((*ShutdownGuestRequestType)(nil)).Elem() -} - -type ShutdownGuestResponse struct { -} - -type ShutdownHostRequestType struct { - This ManagedObjectReference `xml:"_this"` - Force bool `xml:"force"` -} - -func init() { - t["ShutdownHostRequestType"] = reflect.TypeOf((*ShutdownHostRequestType)(nil)).Elem() -} - -type ShutdownHost_Task ShutdownHostRequestType - -func init() { - t["ShutdownHost_Task"] = reflect.TypeOf((*ShutdownHost_Task)(nil)).Elem() -} - -type ShutdownHost_TaskResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type SingleIp struct { - IpAddress - - Address string `xml:"address"` -} - -func init() { - t["SingleIp"] = reflect.TypeOf((*SingleIp)(nil)).Elem() -} - -type SingleMac struct { - MacAddress - - Address string `xml:"address"` -} - -func init() { - t["SingleMac"] = reflect.TypeOf((*SingleMac)(nil)).Elem() -} - -type SnapshotCloneNotSupported struct { - SnapshotCopyNotSupported -} - -func init() { - t["SnapshotCloneNotSupported"] = reflect.TypeOf((*SnapshotCloneNotSupported)(nil)).Elem() -} - -type SnapshotCloneNotSupportedFault SnapshotCloneNotSupported - -func init() { - t["SnapshotCloneNotSupportedFault"] = reflect.TypeOf((*SnapshotCloneNotSupportedFault)(nil)).Elem() -} - -type SnapshotCopyNotSupported struct { - MigrationFault -} - -func init() { - t["SnapshotCopyNotSupported"] = reflect.TypeOf((*SnapshotCopyNotSupported)(nil)).Elem() -} - -type SnapshotCopyNotSupportedFault BaseSnapshotCopyNotSupported - -func init() { - t["SnapshotCopyNotSupportedFault"] = reflect.TypeOf((*SnapshotCopyNotSupportedFault)(nil)).Elem() -} - -type SnapshotDisabled struct { - SnapshotFault -} - -func init() { - t["SnapshotDisabled"] = reflect.TypeOf((*SnapshotDisabled)(nil)).Elem() -} - -type SnapshotDisabledFault SnapshotDisabled - -func init() { - t["SnapshotDisabledFault"] = reflect.TypeOf((*SnapshotDisabledFault)(nil)).Elem() -} - -type SnapshotFault struct { - VimFault -} - -func init() { - t["SnapshotFault"] = reflect.TypeOf((*SnapshotFault)(nil)).Elem() -} - -type SnapshotFaultFault BaseSnapshotFault - -func init() { - t["SnapshotFaultFault"] = reflect.TypeOf((*SnapshotFaultFault)(nil)).Elem() -} - -type SnapshotIncompatibleDeviceInVm struct { - SnapshotFault - - Fault LocalizedMethodFault `xml:"fault"` -} - -func init() { - t["SnapshotIncompatibleDeviceInVm"] = reflect.TypeOf((*SnapshotIncompatibleDeviceInVm)(nil)).Elem() -} - -type SnapshotIncompatibleDeviceInVmFault SnapshotIncompatibleDeviceInVm - -func init() { - t["SnapshotIncompatibleDeviceInVmFault"] = reflect.TypeOf((*SnapshotIncompatibleDeviceInVmFault)(nil)).Elem() -} - -type SnapshotLocked struct { - SnapshotFault -} - -func init() { - t["SnapshotLocked"] = reflect.TypeOf((*SnapshotLocked)(nil)).Elem() -} - -type SnapshotLockedFault SnapshotLocked - -func init() { - t["SnapshotLockedFault"] = reflect.TypeOf((*SnapshotLockedFault)(nil)).Elem() -} - -type SnapshotMoveFromNonHomeNotSupported struct { - SnapshotCopyNotSupported -} - -func init() { - t["SnapshotMoveFromNonHomeNotSupported"] = reflect.TypeOf((*SnapshotMoveFromNonHomeNotSupported)(nil)).Elem() -} - -type SnapshotMoveFromNonHomeNotSupportedFault SnapshotMoveFromNonHomeNotSupported - -func init() { - t["SnapshotMoveFromNonHomeNotSupportedFault"] = reflect.TypeOf((*SnapshotMoveFromNonHomeNotSupportedFault)(nil)).Elem() -} - -type SnapshotMoveNotSupported struct { - SnapshotCopyNotSupported -} - -func init() { - t["SnapshotMoveNotSupported"] = reflect.TypeOf((*SnapshotMoveNotSupported)(nil)).Elem() -} - -type SnapshotMoveNotSupportedFault SnapshotMoveNotSupported - -func init() { - t["SnapshotMoveNotSupportedFault"] = reflect.TypeOf((*SnapshotMoveNotSupportedFault)(nil)).Elem() -} - -type SnapshotMoveToNonHomeNotSupported struct { - SnapshotCopyNotSupported -} - -func init() { - t["SnapshotMoveToNonHomeNotSupported"] = reflect.TypeOf((*SnapshotMoveToNonHomeNotSupported)(nil)).Elem() -} - -type SnapshotMoveToNonHomeNotSupportedFault SnapshotMoveToNonHomeNotSupported - -func init() { - t["SnapshotMoveToNonHomeNotSupportedFault"] = reflect.TypeOf((*SnapshotMoveToNonHomeNotSupportedFault)(nil)).Elem() -} - -type SnapshotNoChange struct { - SnapshotFault -} - -func init() { - t["SnapshotNoChange"] = reflect.TypeOf((*SnapshotNoChange)(nil)).Elem() -} - -type SnapshotNoChangeFault SnapshotNoChange - -func init() { - t["SnapshotNoChangeFault"] = reflect.TypeOf((*SnapshotNoChangeFault)(nil)).Elem() -} - -type SnapshotRevertIssue struct { - MigrationFault - - SnapshotName string `xml:"snapshotName,omitempty"` - Event []BaseEvent `xml:"event,omitempty,typeattr"` - Errors bool `xml:"errors"` -} - -func init() { - t["SnapshotRevertIssue"] = reflect.TypeOf((*SnapshotRevertIssue)(nil)).Elem() -} - -type SnapshotRevertIssueFault SnapshotRevertIssue - -func init() { - t["SnapshotRevertIssueFault"] = reflect.TypeOf((*SnapshotRevertIssueFault)(nil)).Elem() -} - -type SoftRuleVioCorrectionDisallowed struct { - VmConfigFault - - VmName string `xml:"vmName"` -} - -func init() { - t["SoftRuleVioCorrectionDisallowed"] = reflect.TypeOf((*SoftRuleVioCorrectionDisallowed)(nil)).Elem() -} - -type SoftRuleVioCorrectionDisallowedFault SoftRuleVioCorrectionDisallowed - -func init() { - t["SoftRuleVioCorrectionDisallowedFault"] = reflect.TypeOf((*SoftRuleVioCorrectionDisallowedFault)(nil)).Elem() -} - -type SoftRuleVioCorrectionImpact struct { - VmConfigFault - - VmName string `xml:"vmName"` -} - -func init() { - t["SoftRuleVioCorrectionImpact"] = reflect.TypeOf((*SoftRuleVioCorrectionImpact)(nil)).Elem() -} - -type SoftRuleVioCorrectionImpactFault SoftRuleVioCorrectionImpact - -func init() { - t["SoftRuleVioCorrectionImpactFault"] = reflect.TypeOf((*SoftRuleVioCorrectionImpactFault)(nil)).Elem() -} - -type SsdDiskNotAvailable struct { - VimFault - - DevicePath string `xml:"devicePath"` -} - -func init() { - t["SsdDiskNotAvailable"] = reflect.TypeOf((*SsdDiskNotAvailable)(nil)).Elem() -} - -type SsdDiskNotAvailableFault SsdDiskNotAvailable - -func init() { - t["SsdDiskNotAvailableFault"] = reflect.TypeOf((*SsdDiskNotAvailableFault)(nil)).Elem() -} - -type StageHostPatchRequestType struct { - This ManagedObjectReference `xml:"_this"` - MetaUrls []string `xml:"metaUrls,omitempty"` - BundleUrls []string `xml:"bundleUrls,omitempty"` - VibUrls []string `xml:"vibUrls,omitempty"` - Spec *HostPatchManagerPatchManagerOperationSpec `xml:"spec,omitempty"` -} - -func init() { - t["StageHostPatchRequestType"] = reflect.TypeOf((*StageHostPatchRequestType)(nil)).Elem() -} - -type StageHostPatch_Task StageHostPatchRequestType - -func init() { - t["StageHostPatch_Task"] = reflect.TypeOf((*StageHostPatch_Task)(nil)).Elem() -} - -type StageHostPatch_TaskResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type StandbyGuest StandbyGuestRequestType - -func init() { - t["StandbyGuest"] = reflect.TypeOf((*StandbyGuest)(nil)).Elem() -} - -type StandbyGuestRequestType struct { - This ManagedObjectReference `xml:"_this"` -} - -func init() { - t["StandbyGuestRequestType"] = reflect.TypeOf((*StandbyGuestRequestType)(nil)).Elem() -} - -type StandbyGuestResponse struct { -} - -type StartProgramInGuest StartProgramInGuestRequestType - -func init() { - t["StartProgramInGuest"] = reflect.TypeOf((*StartProgramInGuest)(nil)).Elem() -} - -type StartProgramInGuestRequestType struct { - This ManagedObjectReference `xml:"_this"` - Vm ManagedObjectReference `xml:"vm"` - Auth BaseGuestAuthentication `xml:"auth,typeattr"` - Spec BaseGuestProgramSpec `xml:"spec,typeattr"` -} - -func init() { - t["StartProgramInGuestRequestType"] = reflect.TypeOf((*StartProgramInGuestRequestType)(nil)).Elem() -} - -type StartProgramInGuestResponse struct { - Returnval int64 `xml:"returnval"` -} - -type StartRecordingRequestType struct { - This ManagedObjectReference `xml:"_this"` - Name string `xml:"name"` - Description string `xml:"description,omitempty"` -} - -func init() { - t["StartRecordingRequestType"] = reflect.TypeOf((*StartRecordingRequestType)(nil)).Elem() -} - -type StartRecording_Task StartRecordingRequestType - -func init() { - t["StartRecording_Task"] = reflect.TypeOf((*StartRecording_Task)(nil)).Elem() -} - -type StartRecording_TaskResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type StartReplayingRequestType struct { - This ManagedObjectReference `xml:"_this"` - ReplaySnapshot ManagedObjectReference `xml:"replaySnapshot"` -} - -func init() { - t["StartReplayingRequestType"] = reflect.TypeOf((*StartReplayingRequestType)(nil)).Elem() -} - -type StartReplaying_Task StartReplayingRequestType - -func init() { - t["StartReplaying_Task"] = reflect.TypeOf((*StartReplaying_Task)(nil)).Elem() -} - -type StartReplaying_TaskResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type StartService StartServiceRequestType - -func init() { - t["StartService"] = reflect.TypeOf((*StartService)(nil)).Elem() -} - -type StartServiceRequestType struct { - This ManagedObjectReference `xml:"_this"` - Id string `xml:"id"` -} - -func init() { - t["StartServiceRequestType"] = reflect.TypeOf((*StartServiceRequestType)(nil)).Elem() -} - -type StartServiceResponse struct { -} - -type StateAlarmExpression struct { - AlarmExpression - - Operator StateAlarmOperator `xml:"operator"` - Type string `xml:"type"` - StatePath string `xml:"statePath"` - Yellow string `xml:"yellow,omitempty"` - Red string `xml:"red,omitempty"` -} - -func init() { - t["StateAlarmExpression"] = reflect.TypeOf((*StateAlarmExpression)(nil)).Elem() -} - -type StaticRouteProfile struct { - ApplyProfile - - Key string `xml:"key,omitempty"` -} - -func init() { - t["StaticRouteProfile"] = reflect.TypeOf((*StaticRouteProfile)(nil)).Elem() -} - -type StopRecordingRequestType struct { - This ManagedObjectReference `xml:"_this"` -} - -func init() { - t["StopRecordingRequestType"] = reflect.TypeOf((*StopRecordingRequestType)(nil)).Elem() -} - -type StopRecording_Task StopRecordingRequestType - -func init() { - t["StopRecording_Task"] = reflect.TypeOf((*StopRecording_Task)(nil)).Elem() -} - -type StopRecording_TaskResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type StopReplayingRequestType struct { - This ManagedObjectReference `xml:"_this"` -} - -func init() { - t["StopReplayingRequestType"] = reflect.TypeOf((*StopReplayingRequestType)(nil)).Elem() -} - -type StopReplaying_Task StopReplayingRequestType - -func init() { - t["StopReplaying_Task"] = reflect.TypeOf((*StopReplaying_Task)(nil)).Elem() -} - -type StopReplaying_TaskResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type StopService StopServiceRequestType - -func init() { - t["StopService"] = reflect.TypeOf((*StopService)(nil)).Elem() -} - -type StopServiceRequestType struct { - This ManagedObjectReference `xml:"_this"` - Id string `xml:"id"` -} - -func init() { - t["StopServiceRequestType"] = reflect.TypeOf((*StopServiceRequestType)(nil)).Elem() -} - -type StopServiceResponse struct { -} - -type StorageDrsCannotMoveDiskInMultiWriterMode struct { - VimFault -} - -func init() { - t["StorageDrsCannotMoveDiskInMultiWriterMode"] = reflect.TypeOf((*StorageDrsCannotMoveDiskInMultiWriterMode)(nil)).Elem() -} - -type StorageDrsCannotMoveDiskInMultiWriterModeFault StorageDrsCannotMoveDiskInMultiWriterMode - -func init() { - t["StorageDrsCannotMoveDiskInMultiWriterModeFault"] = reflect.TypeOf((*StorageDrsCannotMoveDiskInMultiWriterModeFault)(nil)).Elem() -} - -type StorageDrsCannotMoveFTVm struct { - VimFault -} - -func init() { - t["StorageDrsCannotMoveFTVm"] = reflect.TypeOf((*StorageDrsCannotMoveFTVm)(nil)).Elem() -} - -type StorageDrsCannotMoveFTVmFault StorageDrsCannotMoveFTVm - -func init() { - t["StorageDrsCannotMoveFTVmFault"] = reflect.TypeOf((*StorageDrsCannotMoveFTVmFault)(nil)).Elem() -} - -type StorageDrsCannotMoveIndependentDisk struct { - VimFault -} - -func init() { - t["StorageDrsCannotMoveIndependentDisk"] = reflect.TypeOf((*StorageDrsCannotMoveIndependentDisk)(nil)).Elem() -} - -type StorageDrsCannotMoveIndependentDiskFault StorageDrsCannotMoveIndependentDisk - -func init() { - t["StorageDrsCannotMoveIndependentDiskFault"] = reflect.TypeOf((*StorageDrsCannotMoveIndependentDiskFault)(nil)).Elem() -} - -type StorageDrsCannotMoveManuallyPlacedSwapFile struct { - VimFault -} - -func init() { - t["StorageDrsCannotMoveManuallyPlacedSwapFile"] = reflect.TypeOf((*StorageDrsCannotMoveManuallyPlacedSwapFile)(nil)).Elem() -} - -type StorageDrsCannotMoveManuallyPlacedSwapFileFault StorageDrsCannotMoveManuallyPlacedSwapFile - -func init() { - t["StorageDrsCannotMoveManuallyPlacedSwapFileFault"] = reflect.TypeOf((*StorageDrsCannotMoveManuallyPlacedSwapFileFault)(nil)).Elem() -} - -type StorageDrsCannotMoveManuallyPlacedVm struct { - VimFault -} - -func init() { - t["StorageDrsCannotMoveManuallyPlacedVm"] = reflect.TypeOf((*StorageDrsCannotMoveManuallyPlacedVm)(nil)).Elem() -} - -type StorageDrsCannotMoveManuallyPlacedVmFault StorageDrsCannotMoveManuallyPlacedVm - -func init() { - t["StorageDrsCannotMoveManuallyPlacedVmFault"] = reflect.TypeOf((*StorageDrsCannotMoveManuallyPlacedVmFault)(nil)).Elem() -} - -type StorageDrsCannotMoveSharedDisk struct { - VimFault -} - -func init() { - t["StorageDrsCannotMoveSharedDisk"] = reflect.TypeOf((*StorageDrsCannotMoveSharedDisk)(nil)).Elem() -} - -type StorageDrsCannotMoveSharedDiskFault StorageDrsCannotMoveSharedDisk - -func init() { - t["StorageDrsCannotMoveSharedDiskFault"] = reflect.TypeOf((*StorageDrsCannotMoveSharedDiskFault)(nil)).Elem() -} - -type StorageDrsCannotMoveTemplate struct { - VimFault -} - -func init() { - t["StorageDrsCannotMoveTemplate"] = reflect.TypeOf((*StorageDrsCannotMoveTemplate)(nil)).Elem() -} - -type StorageDrsCannotMoveTemplateFault StorageDrsCannotMoveTemplate - -func init() { - t["StorageDrsCannotMoveTemplateFault"] = reflect.TypeOf((*StorageDrsCannotMoveTemplateFault)(nil)).Elem() -} - -type StorageDrsCannotMoveVmInUserFolder struct { - VimFault -} - -func init() { - t["StorageDrsCannotMoveVmInUserFolder"] = reflect.TypeOf((*StorageDrsCannotMoveVmInUserFolder)(nil)).Elem() -} - -type StorageDrsCannotMoveVmInUserFolderFault StorageDrsCannotMoveVmInUserFolder - -func init() { - t["StorageDrsCannotMoveVmInUserFolderFault"] = reflect.TypeOf((*StorageDrsCannotMoveVmInUserFolderFault)(nil)).Elem() -} - -type StorageDrsCannotMoveVmWithMountedCDROM struct { - VimFault -} - -func init() { - t["StorageDrsCannotMoveVmWithMountedCDROM"] = reflect.TypeOf((*StorageDrsCannotMoveVmWithMountedCDROM)(nil)).Elem() -} - -type StorageDrsCannotMoveVmWithMountedCDROMFault StorageDrsCannotMoveVmWithMountedCDROM - -func init() { - t["StorageDrsCannotMoveVmWithMountedCDROMFault"] = reflect.TypeOf((*StorageDrsCannotMoveVmWithMountedCDROMFault)(nil)).Elem() -} - -type StorageDrsCannotMoveVmWithNoFilesInLayout struct { - VimFault -} - -func init() { - t["StorageDrsCannotMoveVmWithNoFilesInLayout"] = reflect.TypeOf((*StorageDrsCannotMoveVmWithNoFilesInLayout)(nil)).Elem() -} - -type StorageDrsCannotMoveVmWithNoFilesInLayoutFault StorageDrsCannotMoveVmWithNoFilesInLayout - -func init() { - t["StorageDrsCannotMoveVmWithNoFilesInLayoutFault"] = reflect.TypeOf((*StorageDrsCannotMoveVmWithNoFilesInLayoutFault)(nil)).Elem() -} - -type StorageDrsConfigInfo struct { - DynamicData - - PodConfig StorageDrsPodConfigInfo `xml:"podConfig"` - VmConfig []StorageDrsVmConfigInfo `xml:"vmConfig,omitempty"` -} - -func init() { - t["StorageDrsConfigInfo"] = reflect.TypeOf((*StorageDrsConfigInfo)(nil)).Elem() -} - -type StorageDrsConfigSpec struct { - DynamicData - - PodConfigSpec *StorageDrsPodConfigSpec `xml:"podConfigSpec,omitempty"` - VmConfigSpec []StorageDrsVmConfigSpec `xml:"vmConfigSpec,omitempty"` -} - -func init() { - t["StorageDrsConfigSpec"] = reflect.TypeOf((*StorageDrsConfigSpec)(nil)).Elem() -} - -type StorageDrsDatacentersCannotShareDatastore struct { - VimFault -} - -func init() { - t["StorageDrsDatacentersCannotShareDatastore"] = reflect.TypeOf((*StorageDrsDatacentersCannotShareDatastore)(nil)).Elem() -} - -type StorageDrsDatacentersCannotShareDatastoreFault StorageDrsDatacentersCannotShareDatastore - -func init() { - t["StorageDrsDatacentersCannotShareDatastoreFault"] = reflect.TypeOf((*StorageDrsDatacentersCannotShareDatastoreFault)(nil)).Elem() -} - -type StorageDrsDisabledOnVm struct { - VimFault -} - -func init() { - t["StorageDrsDisabledOnVm"] = reflect.TypeOf((*StorageDrsDisabledOnVm)(nil)).Elem() -} - -type StorageDrsDisabledOnVmFault StorageDrsDisabledOnVm - -func init() { - t["StorageDrsDisabledOnVmFault"] = reflect.TypeOf((*StorageDrsDisabledOnVmFault)(nil)).Elem() -} - -type StorageDrsIoLoadBalanceConfig struct { - DynamicData - - IoLatencyThreshold int `xml:"ioLatencyThreshold,omitempty"` - IoLoadImbalanceThreshold int `xml:"ioLoadImbalanceThreshold,omitempty"` -} - -func init() { - t["StorageDrsIoLoadBalanceConfig"] = reflect.TypeOf((*StorageDrsIoLoadBalanceConfig)(nil)).Elem() -} - -type StorageDrsIolbDisabledInternally struct { - VimFault -} - -func init() { - t["StorageDrsIolbDisabledInternally"] = reflect.TypeOf((*StorageDrsIolbDisabledInternally)(nil)).Elem() -} - -type StorageDrsIolbDisabledInternallyFault StorageDrsIolbDisabledInternally - -func init() { - t["StorageDrsIolbDisabledInternallyFault"] = reflect.TypeOf((*StorageDrsIolbDisabledInternallyFault)(nil)).Elem() -} - -type StorageDrsOptionSpec struct { - ArrayUpdateSpec - - Option BaseOptionValue `xml:"option,omitempty,typeattr"` -} - -func init() { - t["StorageDrsOptionSpec"] = reflect.TypeOf((*StorageDrsOptionSpec)(nil)).Elem() -} - -type StorageDrsPodConfigInfo struct { - DynamicData - - Enabled bool `xml:"enabled"` - IoLoadBalanceEnabled bool `xml:"ioLoadBalanceEnabled"` - DefaultVmBehavior string `xml:"defaultVmBehavior"` - LoadBalanceInterval int `xml:"loadBalanceInterval,omitempty"` - DefaultIntraVmAffinity *bool `xml:"defaultIntraVmAffinity"` - SpaceLoadBalanceConfig *StorageDrsSpaceLoadBalanceConfig `xml:"spaceLoadBalanceConfig,omitempty"` - IoLoadBalanceConfig *StorageDrsIoLoadBalanceConfig `xml:"ioLoadBalanceConfig,omitempty"` - Rule []BaseClusterRuleInfo `xml:"rule,omitempty,typeattr"` - Option []BaseOptionValue `xml:"option,omitempty,typeattr"` -} - -func init() { - t["StorageDrsPodConfigInfo"] = reflect.TypeOf((*StorageDrsPodConfigInfo)(nil)).Elem() -} - -type StorageDrsPodConfigSpec struct { - DynamicData - - Enabled *bool `xml:"enabled"` - IoLoadBalanceEnabled *bool `xml:"ioLoadBalanceEnabled"` - DefaultVmBehavior string `xml:"defaultVmBehavior,omitempty"` - LoadBalanceInterval int `xml:"loadBalanceInterval,omitempty"` - DefaultIntraVmAffinity *bool `xml:"defaultIntraVmAffinity"` - SpaceLoadBalanceConfig *StorageDrsSpaceLoadBalanceConfig `xml:"spaceLoadBalanceConfig,omitempty"` - IoLoadBalanceConfig *StorageDrsIoLoadBalanceConfig `xml:"ioLoadBalanceConfig,omitempty"` - Rule []ClusterRuleSpec `xml:"rule,omitempty"` - Option []StorageDrsOptionSpec `xml:"option,omitempty"` -} - -func init() { - t["StorageDrsPodConfigSpec"] = reflect.TypeOf((*StorageDrsPodConfigSpec)(nil)).Elem() -} - -type StorageDrsPodSelectionSpec struct { - DynamicData - - InitialVmConfig []VmPodConfigForPlacement `xml:"initialVmConfig,omitempty"` - StoragePod *ManagedObjectReference `xml:"storagePod,omitempty"` -} - -func init() { - t["StorageDrsPodSelectionSpec"] = reflect.TypeOf((*StorageDrsPodSelectionSpec)(nil)).Elem() -} - -type StorageDrsSpaceLoadBalanceConfig struct { - DynamicData - - SpaceUtilizationThreshold int `xml:"spaceUtilizationThreshold,omitempty"` - MinSpaceUtilizationDifference int `xml:"minSpaceUtilizationDifference,omitempty"` -} - -func init() { - t["StorageDrsSpaceLoadBalanceConfig"] = reflect.TypeOf((*StorageDrsSpaceLoadBalanceConfig)(nil)).Elem() -} - -type StorageDrsUnableToMoveFiles struct { - VimFault -} - -func init() { - t["StorageDrsUnableToMoveFiles"] = reflect.TypeOf((*StorageDrsUnableToMoveFiles)(nil)).Elem() -} - -type StorageDrsUnableToMoveFilesFault StorageDrsUnableToMoveFiles - -func init() { - t["StorageDrsUnableToMoveFilesFault"] = reflect.TypeOf((*StorageDrsUnableToMoveFilesFault)(nil)).Elem() -} - -type StorageDrsVmConfigInfo struct { - DynamicData - - Vm *ManagedObjectReference `xml:"vm,omitempty"` - Enabled *bool `xml:"enabled"` - Behavior string `xml:"behavior,omitempty"` - IntraVmAffinity *bool `xml:"intraVmAffinity"` - IntraVmAntiAffinity *VirtualDiskAntiAffinityRuleSpec `xml:"intraVmAntiAffinity,omitempty"` -} - -func init() { - t["StorageDrsVmConfigInfo"] = reflect.TypeOf((*StorageDrsVmConfigInfo)(nil)).Elem() -} - -type StorageDrsVmConfigSpec struct { - ArrayUpdateSpec - - Info *StorageDrsVmConfigInfo `xml:"info,omitempty"` -} - -func init() { - t["StorageDrsVmConfigSpec"] = reflect.TypeOf((*StorageDrsVmConfigSpec)(nil)).Elem() -} - -type StorageIOAllocationInfo struct { - DynamicData - - Limit int64 `xml:"limit,omitempty"` - Shares *SharesInfo `xml:"shares,omitempty"` - Reservation int `xml:"reservation,omitempty"` -} - -func init() { - t["StorageIOAllocationInfo"] = reflect.TypeOf((*StorageIOAllocationInfo)(nil)).Elem() -} - -type StorageIOAllocationOption struct { - DynamicData - - LimitOption LongOption `xml:"limitOption"` - SharesOption SharesOption `xml:"sharesOption"` -} - -func init() { - t["StorageIOAllocationOption"] = reflect.TypeOf((*StorageIOAllocationOption)(nil)).Elem() -} - -type StorageIORMConfigOption struct { - DynamicData - - EnabledOption BoolOption `xml:"enabledOption"` - CongestionThresholdOption IntOption `xml:"congestionThresholdOption"` - StatsCollectionEnabledOption *BoolOption `xml:"statsCollectionEnabledOption,omitempty"` -} - -func init() { - t["StorageIORMConfigOption"] = reflect.TypeOf((*StorageIORMConfigOption)(nil)).Elem() -} - -type StorageIORMConfigSpec struct { - DynamicData - - Enabled *bool `xml:"enabled"` - CongestionThresholdMode string `xml:"congestionThresholdMode,omitempty"` - CongestionThreshold int `xml:"congestionThreshold,omitempty"` - PercentOfPeakThroughput int `xml:"percentOfPeakThroughput,omitempty"` - StatsCollectionEnabled *bool `xml:"statsCollectionEnabled"` - StatsAggregationDisabled *bool `xml:"statsAggregationDisabled"` -} - -func init() { - t["StorageIORMConfigSpec"] = reflect.TypeOf((*StorageIORMConfigSpec)(nil)).Elem() -} - -type StorageIORMInfo struct { - DynamicData - - Enabled bool `xml:"enabled"` - CongestionThresholdMode string `xml:"congestionThresholdMode,omitempty"` - CongestionThreshold int `xml:"congestionThreshold"` - PercentOfPeakThroughput int `xml:"percentOfPeakThroughput,omitempty"` - StatsCollectionEnabled *bool `xml:"statsCollectionEnabled"` - StatsAggregationDisabled *bool `xml:"statsAggregationDisabled"` -} - -func init() { - t["StorageIORMInfo"] = reflect.TypeOf((*StorageIORMInfo)(nil)).Elem() -} - -type StorageMigrationAction struct { - ClusterAction - - Vm ManagedObjectReference `xml:"vm"` - RelocateSpec VirtualMachineRelocateSpec `xml:"relocateSpec"` - Source ManagedObjectReference `xml:"source"` - Destination ManagedObjectReference `xml:"destination"` - SizeTransferred int64 `xml:"sizeTransferred"` - SpaceUtilSrcBefore float32 `xml:"spaceUtilSrcBefore,omitempty"` - SpaceUtilDstBefore float32 `xml:"spaceUtilDstBefore,omitempty"` - SpaceUtilSrcAfter float32 `xml:"spaceUtilSrcAfter,omitempty"` - SpaceUtilDstAfter float32 `xml:"spaceUtilDstAfter,omitempty"` - IoLatencySrcBefore float32 `xml:"ioLatencySrcBefore,omitempty"` - IoLatencyDstBefore float32 `xml:"ioLatencyDstBefore,omitempty"` -} - -func init() { - t["StorageMigrationAction"] = reflect.TypeOf((*StorageMigrationAction)(nil)).Elem() -} - -type StoragePerformanceSummary struct { - DynamicData - - Interval int `xml:"interval"` - Percentile []int `xml:"percentile"` - DatastoreReadLatency []float64 `xml:"datastoreReadLatency"` - DatastoreWriteLatency []float64 `xml:"datastoreWriteLatency"` - DatastoreVmLatency []float64 `xml:"datastoreVmLatency"` - DatastoreReadIops []float64 `xml:"datastoreReadIops"` - DatastoreWriteIops []float64 `xml:"datastoreWriteIops"` - SiocActivityDuration int `xml:"siocActivityDuration"` -} - -func init() { - t["StoragePerformanceSummary"] = reflect.TypeOf((*StoragePerformanceSummary)(nil)).Elem() -} - -type StoragePlacementAction struct { - ClusterAction - - Vm *ManagedObjectReference `xml:"vm,omitempty"` - RelocateSpec VirtualMachineRelocateSpec `xml:"relocateSpec"` - Destination ManagedObjectReference `xml:"destination"` - SpaceUtilBefore float32 `xml:"spaceUtilBefore,omitempty"` - SpaceUtilAfter float32 `xml:"spaceUtilAfter,omitempty"` - IoLatencyBefore float32 `xml:"ioLatencyBefore,omitempty"` -} - -func init() { - t["StoragePlacementAction"] = reflect.TypeOf((*StoragePlacementAction)(nil)).Elem() -} - -type StoragePlacementResult struct { - DynamicData - - Recommendations []ClusterRecommendation `xml:"recommendations,omitempty"` - DrsFault *ClusterDrsFaults `xml:"drsFault,omitempty"` - Task *ManagedObjectReference `xml:"task,omitempty"` -} - -func init() { - t["StoragePlacementResult"] = reflect.TypeOf((*StoragePlacementResult)(nil)).Elem() -} - -type StoragePlacementSpec struct { - DynamicData - - Type string `xml:"type"` - Priority VirtualMachineMovePriority `xml:"priority,omitempty"` - Vm *ManagedObjectReference `xml:"vm,omitempty"` - PodSelectionSpec StorageDrsPodSelectionSpec `xml:"podSelectionSpec"` - CloneSpec *VirtualMachineCloneSpec `xml:"cloneSpec,omitempty"` - CloneName string `xml:"cloneName,omitempty"` - ConfigSpec *VirtualMachineConfigSpec `xml:"configSpec,omitempty"` - RelocateSpec *VirtualMachineRelocateSpec `xml:"relocateSpec,omitempty"` - ResourcePool *ManagedObjectReference `xml:"resourcePool,omitempty"` - Host *ManagedObjectReference `xml:"host,omitempty"` - Folder *ManagedObjectReference `xml:"folder,omitempty"` - DisallowPrerequisiteMoves *bool `xml:"disallowPrerequisiteMoves"` - ResourceLeaseDurationSec int `xml:"resourceLeaseDurationSec,omitempty"` -} - -func init() { - t["StoragePlacementSpec"] = reflect.TypeOf((*StoragePlacementSpec)(nil)).Elem() -} - -type StoragePodSummary struct { - DynamicData - - Name string `xml:"name"` - Capacity int64 `xml:"capacity"` - FreeSpace int64 `xml:"freeSpace"` -} - -func init() { - t["StoragePodSummary"] = reflect.TypeOf((*StoragePodSummary)(nil)).Elem() -} - -type StorageProfile struct { - ApplyProfile - - NasStorage []NasStorageProfile `xml:"nasStorage,omitempty"` -} - -func init() { - t["StorageProfile"] = reflect.TypeOf((*StorageProfile)(nil)).Elem() -} - -type StorageRequirement struct { - DynamicData - - Datastore ManagedObjectReference `xml:"datastore"` - FreeSpaceRequiredInKb int64 `xml:"freeSpaceRequiredInKb"` -} - -func init() { - t["StorageRequirement"] = reflect.TypeOf((*StorageRequirement)(nil)).Elem() -} - -type StorageVMotionNotSupported struct { - MigrationFeatureNotSupported -} - -func init() { - t["StorageVMotionNotSupported"] = reflect.TypeOf((*StorageVMotionNotSupported)(nil)).Elem() -} - -type StorageVMotionNotSupportedFault StorageVMotionNotSupported - -func init() { - t["StorageVMotionNotSupportedFault"] = reflect.TypeOf((*StorageVMotionNotSupportedFault)(nil)).Elem() -} - -type StorageVmotionIncompatible struct { - VirtualHardwareCompatibilityIssue - - Datastore *ManagedObjectReference `xml:"datastore,omitempty"` -} - -func init() { - t["StorageVmotionIncompatible"] = reflect.TypeOf((*StorageVmotionIncompatible)(nil)).Elem() -} - -type StorageVmotionIncompatibleFault StorageVmotionIncompatible - -func init() { - t["StorageVmotionIncompatibleFault"] = reflect.TypeOf((*StorageVmotionIncompatibleFault)(nil)).Elem() -} - -type StringExpression struct { - NegatableExpression - - Value string `xml:"value,omitempty"` -} - -func init() { - t["StringExpression"] = reflect.TypeOf((*StringExpression)(nil)).Elem() -} - -type StringOption struct { - OptionType - - DefaultValue string `xml:"defaultValue"` - ValidCharacters string `xml:"validCharacters,omitempty"` -} - -func init() { - t["StringOption"] = reflect.TypeOf((*StringOption)(nil)).Elem() -} - -type StringPolicy struct { - InheritablePolicy - - Value string `xml:"value,omitempty"` -} - -func init() { - t["StringPolicy"] = reflect.TypeOf((*StringPolicy)(nil)).Elem() -} - -type SuspendVAppRequestType struct { - This ManagedObjectReference `xml:"_this"` -} - -func init() { - t["SuspendVAppRequestType"] = reflect.TypeOf((*SuspendVAppRequestType)(nil)).Elem() -} - -type SuspendVApp_Task SuspendVAppRequestType - -func init() { - t["SuspendVApp_Task"] = reflect.TypeOf((*SuspendVApp_Task)(nil)).Elem() -} - -type SuspendVApp_TaskResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type SuspendVMRequestType struct { - This ManagedObjectReference `xml:"_this"` -} - -func init() { - t["SuspendVMRequestType"] = reflect.TypeOf((*SuspendVMRequestType)(nil)).Elem() -} - -type SuspendVM_Task SuspendVMRequestType - -func init() { - t["SuspendVM_Task"] = reflect.TypeOf((*SuspendVM_Task)(nil)).Elem() -} - -type SuspendVM_TaskResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type SuspendedRelocateNotSupported struct { - MigrationFault -} - -func init() { - t["SuspendedRelocateNotSupported"] = reflect.TypeOf((*SuspendedRelocateNotSupported)(nil)).Elem() -} - -type SuspendedRelocateNotSupportedFault SuspendedRelocateNotSupported - -func init() { - t["SuspendedRelocateNotSupportedFault"] = reflect.TypeOf((*SuspendedRelocateNotSupportedFault)(nil)).Elem() -} - -type SwapDatastoreNotWritableOnHost struct { - DatastoreNotWritableOnHost -} - -func init() { - t["SwapDatastoreNotWritableOnHost"] = reflect.TypeOf((*SwapDatastoreNotWritableOnHost)(nil)).Elem() -} - -type SwapDatastoreNotWritableOnHostFault SwapDatastoreNotWritableOnHost - -func init() { - t["SwapDatastoreNotWritableOnHostFault"] = reflect.TypeOf((*SwapDatastoreNotWritableOnHostFault)(nil)).Elem() -} - -type SwapDatastoreUnset struct { - VimFault -} - -func init() { - t["SwapDatastoreUnset"] = reflect.TypeOf((*SwapDatastoreUnset)(nil)).Elem() -} - -type SwapDatastoreUnsetFault SwapDatastoreUnset - -func init() { - t["SwapDatastoreUnsetFault"] = reflect.TypeOf((*SwapDatastoreUnsetFault)(nil)).Elem() -} - -type SwapPlacementOverrideNotSupported struct { - InvalidVmConfig -} - -func init() { - t["SwapPlacementOverrideNotSupported"] = reflect.TypeOf((*SwapPlacementOverrideNotSupported)(nil)).Elem() -} - -type SwapPlacementOverrideNotSupportedFault SwapPlacementOverrideNotSupported - -func init() { - t["SwapPlacementOverrideNotSupportedFault"] = reflect.TypeOf((*SwapPlacementOverrideNotSupportedFault)(nil)).Elem() -} - -type SwitchIpUnset struct { - DvsFault -} - -func init() { - t["SwitchIpUnset"] = reflect.TypeOf((*SwitchIpUnset)(nil)).Elem() -} - -type SwitchIpUnsetFault SwitchIpUnset - -func init() { - t["SwitchIpUnsetFault"] = reflect.TypeOf((*SwitchIpUnsetFault)(nil)).Elem() -} - -type SwitchNotInUpgradeMode struct { - DvsFault -} - -func init() { - t["SwitchNotInUpgradeMode"] = reflect.TypeOf((*SwitchNotInUpgradeMode)(nil)).Elem() -} - -type SwitchNotInUpgradeModeFault SwitchNotInUpgradeMode - -func init() { - t["SwitchNotInUpgradeModeFault"] = reflect.TypeOf((*SwitchNotInUpgradeModeFault)(nil)).Elem() -} - -type SystemError struct { - RuntimeFault - - Reason string `xml:"reason"` -} - -func init() { - t["SystemError"] = reflect.TypeOf((*SystemError)(nil)).Elem() -} - -type SystemErrorFault SystemError - -func init() { - t["SystemErrorFault"] = reflect.TypeOf((*SystemErrorFault)(nil)).Elem() -} - -type Tag struct { - DynamicData - - Key string `xml:"key"` -} - -func init() { - t["Tag"] = reflect.TypeOf((*Tag)(nil)).Elem() -} - -type TaskDescription struct { - DynamicData - - MethodInfo []BaseElementDescription `xml:"methodInfo,typeattr"` - State []BaseElementDescription `xml:"state,typeattr"` - Reason []BaseTypeDescription `xml:"reason,typeattr"` -} - -func init() { - t["TaskDescription"] = reflect.TypeOf((*TaskDescription)(nil)).Elem() -} - -type TaskEvent struct { - Event - - Info TaskInfo `xml:"info"` -} - -func init() { - t["TaskEvent"] = reflect.TypeOf((*TaskEvent)(nil)).Elem() -} - -type TaskFilterSpec struct { - DynamicData - - Entity *TaskFilterSpecByEntity `xml:"entity,omitempty"` - Time *TaskFilterSpecByTime `xml:"time,omitempty"` - UserName *TaskFilterSpecByUsername `xml:"userName,omitempty"` - State []TaskInfoState `xml:"state,omitempty"` - Alarm *ManagedObjectReference `xml:"alarm,omitempty"` - ScheduledTask *ManagedObjectReference `xml:"scheduledTask,omitempty"` - EventChainId []int `xml:"eventChainId,omitempty"` - Tag []string `xml:"tag,omitempty"` - ParentTaskKey []string `xml:"parentTaskKey,omitempty"` - RootTaskKey []string `xml:"rootTaskKey,omitempty"` -} - -func init() { - t["TaskFilterSpec"] = reflect.TypeOf((*TaskFilterSpec)(nil)).Elem() -} - -type TaskFilterSpecByEntity struct { - DynamicData - - Entity ManagedObjectReference `xml:"entity"` - Recursion TaskFilterSpecRecursionOption `xml:"recursion"` -} - -func init() { - t["TaskFilterSpecByEntity"] = reflect.TypeOf((*TaskFilterSpecByEntity)(nil)).Elem() -} - -type TaskFilterSpecByTime struct { - DynamicData - - TimeType TaskFilterSpecTimeOption `xml:"timeType"` - BeginTime *time.Time `xml:"beginTime"` - EndTime *time.Time `xml:"endTime"` -} - -func init() { - t["TaskFilterSpecByTime"] = reflect.TypeOf((*TaskFilterSpecByTime)(nil)).Elem() -} - -type TaskFilterSpecByUsername struct { - DynamicData - - SystemUser bool `xml:"systemUser"` - UserList []string `xml:"userList,omitempty"` -} - -func init() { - t["TaskFilterSpecByUsername"] = reflect.TypeOf((*TaskFilterSpecByUsername)(nil)).Elem() -} - -type TaskInProgress struct { - VimFault - - Task ManagedObjectReference `xml:"task"` -} - -func init() { - t["TaskInProgress"] = reflect.TypeOf((*TaskInProgress)(nil)).Elem() -} - -type TaskInProgressFault BaseTaskInProgress - -func init() { - t["TaskInProgressFault"] = reflect.TypeOf((*TaskInProgressFault)(nil)).Elem() -} - -type TaskInfo struct { - DynamicData - - Key string `xml:"key"` - Task ManagedObjectReference `xml:"task"` - Description *LocalizableMessage `xml:"description,omitempty"` - Name string `xml:"name,omitempty"` - DescriptionId string `xml:"descriptionId"` - Entity *ManagedObjectReference `xml:"entity,omitempty"` - EntityName string `xml:"entityName,omitempty"` - Locked []ManagedObjectReference `xml:"locked,omitempty"` - State TaskInfoState `xml:"state"` - Cancelled bool `xml:"cancelled"` - Cancelable bool `xml:"cancelable"` - Error *LocalizedMethodFault `xml:"error,omitempty"` - Result AnyType `xml:"result,omitempty,typeattr"` - Progress int `xml:"progress,omitempty"` - Reason BaseTaskReason `xml:"reason,typeattr"` - QueueTime time.Time `xml:"queueTime"` - StartTime *time.Time `xml:"startTime"` - CompleteTime *time.Time `xml:"completeTime"` - EventChainId int `xml:"eventChainId"` - ChangeTag string `xml:"changeTag,omitempty"` - ParentTaskKey string `xml:"parentTaskKey,omitempty"` - RootTaskKey string `xml:"rootTaskKey,omitempty"` -} - -func init() { - t["TaskInfo"] = reflect.TypeOf((*TaskInfo)(nil)).Elem() -} - -type TaskReason struct { - DynamicData -} - -func init() { - t["TaskReason"] = reflect.TypeOf((*TaskReason)(nil)).Elem() -} - -type TaskReasonAlarm struct { - TaskReason - - AlarmName string `xml:"alarmName"` - Alarm ManagedObjectReference `xml:"alarm"` - EntityName string `xml:"entityName"` - Entity ManagedObjectReference `xml:"entity"` -} - -func init() { - t["TaskReasonAlarm"] = reflect.TypeOf((*TaskReasonAlarm)(nil)).Elem() -} - -type TaskReasonSchedule struct { - TaskReason - - Name string `xml:"name"` - ScheduledTask ManagedObjectReference `xml:"scheduledTask"` -} - -func init() { - t["TaskReasonSchedule"] = reflect.TypeOf((*TaskReasonSchedule)(nil)).Elem() -} - -type TaskReasonSystem struct { - TaskReason -} - -func init() { - t["TaskReasonSystem"] = reflect.TypeOf((*TaskReasonSystem)(nil)).Elem() -} - -type TaskReasonUser struct { - TaskReason - - UserName string `xml:"userName"` -} - -func init() { - t["TaskReasonUser"] = reflect.TypeOf((*TaskReasonUser)(nil)).Elem() -} - -type TaskScheduler struct { - DynamicData - - ActiveTime *time.Time `xml:"activeTime"` - ExpireTime *time.Time `xml:"expireTime"` -} - -func init() { - t["TaskScheduler"] = reflect.TypeOf((*TaskScheduler)(nil)).Elem() -} - -type TaskTimeoutEvent struct { - TaskEvent -} - -func init() { - t["TaskTimeoutEvent"] = reflect.TypeOf((*TaskTimeoutEvent)(nil)).Elem() -} - -type TeamingMatchEvent struct { - DvsHealthStatusChangeEvent -} - -func init() { - t["TeamingMatchEvent"] = reflect.TypeOf((*TeamingMatchEvent)(nil)).Elem() -} - -type TeamingMisMatchEvent struct { - DvsHealthStatusChangeEvent -} - -func init() { - t["TeamingMisMatchEvent"] = reflect.TypeOf((*TeamingMisMatchEvent)(nil)).Elem() -} - -type TemplateBeingUpgradedEvent struct { - TemplateUpgradeEvent -} - -func init() { - t["TemplateBeingUpgradedEvent"] = reflect.TypeOf((*TemplateBeingUpgradedEvent)(nil)).Elem() -} - -type TemplateConfigFileInfo struct { - VmConfigFileInfo -} - -func init() { - t["TemplateConfigFileInfo"] = reflect.TypeOf((*TemplateConfigFileInfo)(nil)).Elem() -} - -type TemplateConfigFileQuery struct { - VmConfigFileQuery -} - -func init() { - t["TemplateConfigFileQuery"] = reflect.TypeOf((*TemplateConfigFileQuery)(nil)).Elem() -} - -type TemplateUpgradeEvent struct { - Event - - LegacyTemplate string `xml:"legacyTemplate"` -} - -func init() { - t["TemplateUpgradeEvent"] = reflect.TypeOf((*TemplateUpgradeEvent)(nil)).Elem() -} - -type TemplateUpgradeFailedEvent struct { - TemplateUpgradeEvent - - Reason LocalizedMethodFault `xml:"reason"` -} - -func init() { - t["TemplateUpgradeFailedEvent"] = reflect.TypeOf((*TemplateUpgradeFailedEvent)(nil)).Elem() -} - -type TemplateUpgradedEvent struct { - TemplateUpgradeEvent -} - -func init() { - t["TemplateUpgradedEvent"] = reflect.TypeOf((*TemplateUpgradedEvent)(nil)).Elem() -} - -type TerminateFaultTolerantVMRequestType struct { - This ManagedObjectReference `xml:"_this"` - Vm *ManagedObjectReference `xml:"vm,omitempty"` -} - -func init() { - t["TerminateFaultTolerantVMRequestType"] = reflect.TypeOf((*TerminateFaultTolerantVMRequestType)(nil)).Elem() -} - -type TerminateFaultTolerantVM_Task TerminateFaultTolerantVMRequestType - -func init() { - t["TerminateFaultTolerantVM_Task"] = reflect.TypeOf((*TerminateFaultTolerantVM_Task)(nil)).Elem() -} - -type TerminateFaultTolerantVM_TaskResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type TerminateProcessInGuest TerminateProcessInGuestRequestType - -func init() { - t["TerminateProcessInGuest"] = reflect.TypeOf((*TerminateProcessInGuest)(nil)).Elem() -} - -type TerminateProcessInGuestRequestType struct { - This ManagedObjectReference `xml:"_this"` - Vm ManagedObjectReference `xml:"vm"` - Auth BaseGuestAuthentication `xml:"auth,typeattr"` - Pid int64 `xml:"pid"` -} - -func init() { - t["TerminateProcessInGuestRequestType"] = reflect.TypeOf((*TerminateProcessInGuestRequestType)(nil)).Elem() -} - -type TerminateProcessInGuestResponse struct { -} - -type TerminateSession TerminateSessionRequestType - -func init() { - t["TerminateSession"] = reflect.TypeOf((*TerminateSession)(nil)).Elem() -} - -type TerminateSessionRequestType struct { - This ManagedObjectReference `xml:"_this"` - SessionId []string `xml:"sessionId"` -} - -func init() { - t["TerminateSessionRequestType"] = reflect.TypeOf((*TerminateSessionRequestType)(nil)).Elem() -} - -type TerminateSessionResponse struct { -} - -type TerminateVM TerminateVMRequestType - -func init() { - t["TerminateVM"] = reflect.TypeOf((*TerminateVM)(nil)).Elem() -} - -type TerminateVMRequestType struct { - This ManagedObjectReference `xml:"_this"` -} - -func init() { - t["TerminateVMRequestType"] = reflect.TypeOf((*TerminateVMRequestType)(nil)).Elem() -} - -type TerminateVMResponse struct { -} - -type ThirdPartyLicenseAssignmentFailed struct { - RuntimeFault - - Host ManagedObjectReference `xml:"host"` - Module string `xml:"module"` - Reason string `xml:"reason,omitempty"` -} - -func init() { - t["ThirdPartyLicenseAssignmentFailed"] = reflect.TypeOf((*ThirdPartyLicenseAssignmentFailed)(nil)).Elem() -} - -type ThirdPartyLicenseAssignmentFailedFault ThirdPartyLicenseAssignmentFailed - -func init() { - t["ThirdPartyLicenseAssignmentFailedFault"] = reflect.TypeOf((*ThirdPartyLicenseAssignmentFailedFault)(nil)).Elem() -} - -type TicketedSessionAuthentication struct { - GuestAuthentication - - Ticket string `xml:"ticket"` -} - -func init() { - t["TicketedSessionAuthentication"] = reflect.TypeOf((*TicketedSessionAuthentication)(nil)).Elem() -} - -type TimedOutHostOperationEvent struct { - HostEvent -} - -func init() { - t["TimedOutHostOperationEvent"] = reflect.TypeOf((*TimedOutHostOperationEvent)(nil)).Elem() -} - -type Timedout struct { - VimFault -} - -func init() { - t["Timedout"] = reflect.TypeOf((*Timedout)(nil)).Elem() -} - -type TimedoutFault BaseTimedout - -func init() { - t["TimedoutFault"] = reflect.TypeOf((*TimedoutFault)(nil)).Elem() -} - -type TooManyConcurrentNativeClones struct { - FileFault -} - -func init() { - t["TooManyConcurrentNativeClones"] = reflect.TypeOf((*TooManyConcurrentNativeClones)(nil)).Elem() -} - -type TooManyConcurrentNativeClonesFault TooManyConcurrentNativeClones - -func init() { - t["TooManyConcurrentNativeClonesFault"] = reflect.TypeOf((*TooManyConcurrentNativeClonesFault)(nil)).Elem() -} - -type TooManyConsecutiveOverrides struct { - VimFault -} - -func init() { - t["TooManyConsecutiveOverrides"] = reflect.TypeOf((*TooManyConsecutiveOverrides)(nil)).Elem() -} - -type TooManyConsecutiveOverridesFault TooManyConsecutiveOverrides - -func init() { - t["TooManyConsecutiveOverridesFault"] = reflect.TypeOf((*TooManyConsecutiveOverridesFault)(nil)).Elem() -} - -type TooManyDevices struct { - InvalidVmConfig -} - -func init() { - t["TooManyDevices"] = reflect.TypeOf((*TooManyDevices)(nil)).Elem() -} - -type TooManyDevicesFault TooManyDevices - -func init() { - t["TooManyDevicesFault"] = reflect.TypeOf((*TooManyDevicesFault)(nil)).Elem() -} - -type TooManyDisksOnLegacyHost struct { - MigrationFault - - DiskCount int `xml:"diskCount"` - TimeoutDanger bool `xml:"timeoutDanger"` -} - -func init() { - t["TooManyDisksOnLegacyHost"] = reflect.TypeOf((*TooManyDisksOnLegacyHost)(nil)).Elem() -} - -type TooManyDisksOnLegacyHostFault TooManyDisksOnLegacyHost - -func init() { - t["TooManyDisksOnLegacyHostFault"] = reflect.TypeOf((*TooManyDisksOnLegacyHostFault)(nil)).Elem() -} - -type TooManyGuestLogons struct { - GuestOperationsFault -} - -func init() { - t["TooManyGuestLogons"] = reflect.TypeOf((*TooManyGuestLogons)(nil)).Elem() -} - -type TooManyGuestLogonsFault TooManyGuestLogons - -func init() { - t["TooManyGuestLogonsFault"] = reflect.TypeOf((*TooManyGuestLogonsFault)(nil)).Elem() -} - -type TooManyHosts struct { - HostConnectFault -} - -func init() { - t["TooManyHosts"] = reflect.TypeOf((*TooManyHosts)(nil)).Elem() -} - -type TooManyHostsFault TooManyHosts - -func init() { - t["TooManyHostsFault"] = reflect.TypeOf((*TooManyHostsFault)(nil)).Elem() -} - -type TooManyNativeCloneLevels struct { - FileFault -} - -func init() { - t["TooManyNativeCloneLevels"] = reflect.TypeOf((*TooManyNativeCloneLevels)(nil)).Elem() -} - -type TooManyNativeCloneLevelsFault TooManyNativeCloneLevels - -func init() { - t["TooManyNativeCloneLevelsFault"] = reflect.TypeOf((*TooManyNativeCloneLevelsFault)(nil)).Elem() -} - -type TooManyNativeClonesOnFile struct { - FileFault -} - -func init() { - t["TooManyNativeClonesOnFile"] = reflect.TypeOf((*TooManyNativeClonesOnFile)(nil)).Elem() -} - -type TooManyNativeClonesOnFileFault TooManyNativeClonesOnFile - -func init() { - t["TooManyNativeClonesOnFileFault"] = reflect.TypeOf((*TooManyNativeClonesOnFileFault)(nil)).Elem() -} - -type TooManySnapshotLevels struct { - SnapshotFault -} - -func init() { - t["TooManySnapshotLevels"] = reflect.TypeOf((*TooManySnapshotLevels)(nil)).Elem() -} - -type TooManySnapshotLevelsFault TooManySnapshotLevels - -func init() { - t["TooManySnapshotLevelsFault"] = reflect.TypeOf((*TooManySnapshotLevelsFault)(nil)).Elem() -} - -type ToolsAlreadyUpgraded struct { - VmToolsUpgradeFault -} - -func init() { - t["ToolsAlreadyUpgraded"] = reflect.TypeOf((*ToolsAlreadyUpgraded)(nil)).Elem() -} - -type ToolsAlreadyUpgradedFault ToolsAlreadyUpgraded - -func init() { - t["ToolsAlreadyUpgradedFault"] = reflect.TypeOf((*ToolsAlreadyUpgradedFault)(nil)).Elem() -} - -type ToolsAutoUpgradeNotSupported struct { - VmToolsUpgradeFault -} - -func init() { - t["ToolsAutoUpgradeNotSupported"] = reflect.TypeOf((*ToolsAutoUpgradeNotSupported)(nil)).Elem() -} - -type ToolsAutoUpgradeNotSupportedFault ToolsAutoUpgradeNotSupported - -func init() { - t["ToolsAutoUpgradeNotSupportedFault"] = reflect.TypeOf((*ToolsAutoUpgradeNotSupportedFault)(nil)).Elem() -} - -type ToolsConfigInfo struct { - DynamicData - - ToolsVersion int `xml:"toolsVersion,omitempty"` - AfterPowerOn *bool `xml:"afterPowerOn"` - AfterResume *bool `xml:"afterResume"` - BeforeGuestStandby *bool `xml:"beforeGuestStandby"` - BeforeGuestShutdown *bool `xml:"beforeGuestShutdown"` - BeforeGuestReboot *bool `xml:"beforeGuestReboot"` - ToolsUpgradePolicy string `xml:"toolsUpgradePolicy,omitempty"` - PendingCustomization string `xml:"pendingCustomization,omitempty"` - SyncTimeWithHost *bool `xml:"syncTimeWithHost"` - LastInstallInfo *ToolsConfigInfoToolsLastInstallInfo `xml:"lastInstallInfo,omitempty"` -} - -func init() { - t["ToolsConfigInfo"] = reflect.TypeOf((*ToolsConfigInfo)(nil)).Elem() -} - -type ToolsConfigInfoToolsLastInstallInfo struct { - DynamicData - - Counter int `xml:"counter"` - Fault *LocalizedMethodFault `xml:"fault,omitempty"` -} - -func init() { - t["ToolsConfigInfoToolsLastInstallInfo"] = reflect.TypeOf((*ToolsConfigInfoToolsLastInstallInfo)(nil)).Elem() -} - -type ToolsImageCopyFailed struct { - VmToolsUpgradeFault -} - -func init() { - t["ToolsImageCopyFailed"] = reflect.TypeOf((*ToolsImageCopyFailed)(nil)).Elem() -} - -type ToolsImageCopyFailedFault ToolsImageCopyFailed - -func init() { - t["ToolsImageCopyFailedFault"] = reflect.TypeOf((*ToolsImageCopyFailedFault)(nil)).Elem() -} - -type ToolsImageNotAvailable struct { - VmToolsUpgradeFault -} - -func init() { - t["ToolsImageNotAvailable"] = reflect.TypeOf((*ToolsImageNotAvailable)(nil)).Elem() -} - -type ToolsImageNotAvailableFault ToolsImageNotAvailable - -func init() { - t["ToolsImageNotAvailableFault"] = reflect.TypeOf((*ToolsImageNotAvailableFault)(nil)).Elem() -} - -type ToolsImageSignatureCheckFailed struct { - VmToolsUpgradeFault -} - -func init() { - t["ToolsImageSignatureCheckFailed"] = reflect.TypeOf((*ToolsImageSignatureCheckFailed)(nil)).Elem() -} - -type ToolsImageSignatureCheckFailedFault ToolsImageSignatureCheckFailed - -func init() { - t["ToolsImageSignatureCheckFailedFault"] = reflect.TypeOf((*ToolsImageSignatureCheckFailedFault)(nil)).Elem() -} - -type ToolsInstallationInProgress struct { - MigrationFault -} - -func init() { - t["ToolsInstallationInProgress"] = reflect.TypeOf((*ToolsInstallationInProgress)(nil)).Elem() -} - -type ToolsInstallationInProgressFault ToolsInstallationInProgress - -func init() { - t["ToolsInstallationInProgressFault"] = reflect.TypeOf((*ToolsInstallationInProgressFault)(nil)).Elem() -} - -type ToolsUnavailable struct { - VimFault -} - -func init() { - t["ToolsUnavailable"] = reflect.TypeOf((*ToolsUnavailable)(nil)).Elem() -} - -type ToolsUnavailableFault ToolsUnavailable - -func init() { - t["ToolsUnavailableFault"] = reflect.TypeOf((*ToolsUnavailableFault)(nil)).Elem() -} - -type ToolsUpgradeCancelled struct { - VmToolsUpgradeFault -} - -func init() { - t["ToolsUpgradeCancelled"] = reflect.TypeOf((*ToolsUpgradeCancelled)(nil)).Elem() -} - -type ToolsUpgradeCancelledFault ToolsUpgradeCancelled - -func init() { - t["ToolsUpgradeCancelledFault"] = reflect.TypeOf((*ToolsUpgradeCancelledFault)(nil)).Elem() -} - -type TraversalSpec struct { - SelectionSpec - - Type string `xml:"type"` - Path string `xml:"path"` - Skip *bool `xml:"skip"` - SelectSet []BaseSelectionSpec `xml:"selectSet,omitempty,typeattr"` -} - -func init() { - t["TraversalSpec"] = reflect.TypeOf((*TraversalSpec)(nil)).Elem() -} - -type TurnOffFaultToleranceForVMRequestType struct { - This ManagedObjectReference `xml:"_this"` -} - -func init() { - t["TurnOffFaultToleranceForVMRequestType"] = reflect.TypeOf((*TurnOffFaultToleranceForVMRequestType)(nil)).Elem() -} - -type TurnOffFaultToleranceForVM_Task TurnOffFaultToleranceForVMRequestType - -func init() { - t["TurnOffFaultToleranceForVM_Task"] = reflect.TypeOf((*TurnOffFaultToleranceForVM_Task)(nil)).Elem() -} - -type TurnOffFaultToleranceForVM_TaskResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type TypeDescription struct { - Description - - Key string `xml:"key"` -} - -func init() { - t["TypeDescription"] = reflect.TypeOf((*TypeDescription)(nil)).Elem() -} - -type UnSupportedDatastoreForVFlash struct { - UnsupportedDatastore - - DatastoreName string `xml:"datastoreName"` - Type string `xml:"type"` -} - -func init() { - t["UnSupportedDatastoreForVFlash"] = reflect.TypeOf((*UnSupportedDatastoreForVFlash)(nil)).Elem() -} - -type UnSupportedDatastoreForVFlashFault UnSupportedDatastoreForVFlash - -func init() { - t["UnSupportedDatastoreForVFlashFault"] = reflect.TypeOf((*UnSupportedDatastoreForVFlashFault)(nil)).Elem() -} - -type UnassignUserFromGroup UnassignUserFromGroupRequestType - -func init() { - t["UnassignUserFromGroup"] = reflect.TypeOf((*UnassignUserFromGroup)(nil)).Elem() -} - -type UnassignUserFromGroupRequestType struct { - This ManagedObjectReference `xml:"_this"` - User string `xml:"user"` - Group string `xml:"group"` -} - -func init() { - t["UnassignUserFromGroupRequestType"] = reflect.TypeOf((*UnassignUserFromGroupRequestType)(nil)).Elem() -} - -type UnassignUserFromGroupResponse struct { -} - -type UnbindVnic UnbindVnicRequestType - -func init() { - t["UnbindVnic"] = reflect.TypeOf((*UnbindVnic)(nil)).Elem() -} - -type UnbindVnicRequestType struct { - This ManagedObjectReference `xml:"_this"` - IScsiHbaName string `xml:"iScsiHbaName"` - VnicDevice string `xml:"vnicDevice"` - Force bool `xml:"force"` -} - -func init() { - t["UnbindVnicRequestType"] = reflect.TypeOf((*UnbindVnicRequestType)(nil)).Elem() -} - -type UnbindVnicResponse struct { -} - -type UncommittedUndoableDisk struct { - MigrationFault -} - -func init() { - t["UncommittedUndoableDisk"] = reflect.TypeOf((*UncommittedUndoableDisk)(nil)).Elem() -} - -type UncommittedUndoableDiskFault UncommittedUndoableDisk - -func init() { - t["UncommittedUndoableDiskFault"] = reflect.TypeOf((*UncommittedUndoableDiskFault)(nil)).Elem() -} - -type UnconfiguredPropertyValue struct { - InvalidPropertyValue -} - -func init() { - t["UnconfiguredPropertyValue"] = reflect.TypeOf((*UnconfiguredPropertyValue)(nil)).Elem() -} - -type UnconfiguredPropertyValueFault UnconfiguredPropertyValue - -func init() { - t["UnconfiguredPropertyValueFault"] = reflect.TypeOf((*UnconfiguredPropertyValueFault)(nil)).Elem() -} - -type UncustomizableGuest struct { - CustomizationFault - - UncustomizableGuestOS string `xml:"uncustomizableGuestOS"` -} - -func init() { - t["UncustomizableGuest"] = reflect.TypeOf((*UncustomizableGuest)(nil)).Elem() -} - -type UncustomizableGuestFault UncustomizableGuest - -func init() { - t["UncustomizableGuestFault"] = reflect.TypeOf((*UncustomizableGuestFault)(nil)).Elem() -} - -type UnexpectedCustomizationFault struct { - CustomizationFault -} - -func init() { - t["UnexpectedCustomizationFault"] = reflect.TypeOf((*UnexpectedCustomizationFault)(nil)).Elem() -} - -type UnexpectedCustomizationFaultFault UnexpectedCustomizationFault - -func init() { - t["UnexpectedCustomizationFaultFault"] = reflect.TypeOf((*UnexpectedCustomizationFaultFault)(nil)).Elem() -} - -type UnexpectedFault struct { - RuntimeFault - - FaultName string `xml:"faultName"` - Fault *LocalizedMethodFault `xml:"fault,omitempty"` -} - -func init() { - t["UnexpectedFault"] = reflect.TypeOf((*UnexpectedFault)(nil)).Elem() -} - -type UnexpectedFaultFault UnexpectedFault - -func init() { - t["UnexpectedFaultFault"] = reflect.TypeOf((*UnexpectedFaultFault)(nil)).Elem() -} - -type UninstallHostPatchRequestType struct { - This ManagedObjectReference `xml:"_this"` - BulletinIds []string `xml:"bulletinIds,omitempty"` - Spec *HostPatchManagerPatchManagerOperationSpec `xml:"spec,omitempty"` -} - -func init() { - t["UninstallHostPatchRequestType"] = reflect.TypeOf((*UninstallHostPatchRequestType)(nil)).Elem() -} - -type UninstallHostPatch_Task UninstallHostPatchRequestType - -func init() { - t["UninstallHostPatch_Task"] = reflect.TypeOf((*UninstallHostPatch_Task)(nil)).Elem() -} - -type UninstallHostPatch_TaskResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type UninstallService UninstallServiceRequestType - -func init() { - t["UninstallService"] = reflect.TypeOf((*UninstallService)(nil)).Elem() -} - -type UninstallServiceRequestType struct { - This ManagedObjectReference `xml:"_this"` - Id string `xml:"id"` -} - -func init() { - t["UninstallServiceRequestType"] = reflect.TypeOf((*UninstallServiceRequestType)(nil)).Elem() -} - -type UninstallServiceResponse struct { -} - -type UnlicensedVirtualMachinesEvent struct { - LicenseEvent - - Unlicensed int `xml:"unlicensed"` - Available int `xml:"available"` -} - -func init() { - t["UnlicensedVirtualMachinesEvent"] = reflect.TypeOf((*UnlicensedVirtualMachinesEvent)(nil)).Elem() -} - -type UnlicensedVirtualMachinesFoundEvent struct { - LicenseEvent - - Available int `xml:"available"` -} - -func init() { - t["UnlicensedVirtualMachinesFoundEvent"] = reflect.TypeOf((*UnlicensedVirtualMachinesFoundEvent)(nil)).Elem() -} - -type UnmountForceMountedVmfsVolume UnmountForceMountedVmfsVolumeRequestType - -func init() { - t["UnmountForceMountedVmfsVolume"] = reflect.TypeOf((*UnmountForceMountedVmfsVolume)(nil)).Elem() -} - -type UnmountForceMountedVmfsVolumeRequestType struct { - This ManagedObjectReference `xml:"_this"` - VmfsUuid string `xml:"vmfsUuid"` -} - -func init() { - t["UnmountForceMountedVmfsVolumeRequestType"] = reflect.TypeOf((*UnmountForceMountedVmfsVolumeRequestType)(nil)).Elem() -} - -type UnmountForceMountedVmfsVolumeResponse struct { -} - -type UnmountToolsInstaller UnmountToolsInstallerRequestType - -func init() { - t["UnmountToolsInstaller"] = reflect.TypeOf((*UnmountToolsInstaller)(nil)).Elem() -} - -type UnmountToolsInstallerRequestType struct { - This ManagedObjectReference `xml:"_this"` -} - -func init() { - t["UnmountToolsInstallerRequestType"] = reflect.TypeOf((*UnmountToolsInstallerRequestType)(nil)).Elem() -} - -type UnmountToolsInstallerResponse struct { -} - -type UnmountVffsVolume UnmountVffsVolumeRequestType - -func init() { - t["UnmountVffsVolume"] = reflect.TypeOf((*UnmountVffsVolume)(nil)).Elem() -} - -type UnmountVffsVolumeRequestType struct { - This ManagedObjectReference `xml:"_this"` - VffsUuid string `xml:"vffsUuid"` -} - -func init() { - t["UnmountVffsVolumeRequestType"] = reflect.TypeOf((*UnmountVffsVolumeRequestType)(nil)).Elem() -} - -type UnmountVffsVolumeResponse struct { -} - -type UnmountVmfsVolume UnmountVmfsVolumeRequestType - -func init() { - t["UnmountVmfsVolume"] = reflect.TypeOf((*UnmountVmfsVolume)(nil)).Elem() -} - -type UnmountVmfsVolumeRequestType struct { - This ManagedObjectReference `xml:"_this"` - VmfsUuid string `xml:"vmfsUuid"` -} - -func init() { - t["UnmountVmfsVolumeRequestType"] = reflect.TypeOf((*UnmountVmfsVolumeRequestType)(nil)).Elem() -} - -type UnmountVmfsVolumeResponse struct { -} - -type UnrecognizedHost struct { - VimFault - - HostName string `xml:"hostName"` -} - -func init() { - t["UnrecognizedHost"] = reflect.TypeOf((*UnrecognizedHost)(nil)).Elem() -} - -type UnrecognizedHostFault UnrecognizedHost - -func init() { - t["UnrecognizedHostFault"] = reflect.TypeOf((*UnrecognizedHostFault)(nil)).Elem() -} - -type UnregisterAndDestroyRequestType struct { - This ManagedObjectReference `xml:"_this"` -} - -func init() { - t["UnregisterAndDestroyRequestType"] = reflect.TypeOf((*UnregisterAndDestroyRequestType)(nil)).Elem() -} - -type UnregisterAndDestroy_Task UnregisterAndDestroyRequestType - -func init() { - t["UnregisterAndDestroy_Task"] = reflect.TypeOf((*UnregisterAndDestroy_Task)(nil)).Elem() -} - -type UnregisterAndDestroy_TaskResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type UnregisterExtension UnregisterExtensionRequestType - -func init() { - t["UnregisterExtension"] = reflect.TypeOf((*UnregisterExtension)(nil)).Elem() -} - -type UnregisterExtensionRequestType struct { - This ManagedObjectReference `xml:"_this"` - ExtensionKey string `xml:"extensionKey"` -} - -func init() { - t["UnregisterExtensionRequestType"] = reflect.TypeOf((*UnregisterExtensionRequestType)(nil)).Elem() -} - -type UnregisterExtensionResponse struct { -} - -type UnregisterVM UnregisterVMRequestType - -func init() { - t["UnregisterVM"] = reflect.TypeOf((*UnregisterVM)(nil)).Elem() -} - -type UnregisterVMRequestType struct { - This ManagedObjectReference `xml:"_this"` -} - -func init() { - t["UnregisterVMRequestType"] = reflect.TypeOf((*UnregisterVMRequestType)(nil)).Elem() -} - -type UnregisterVMResponse struct { -} - -type UnsharedSwapVMotionNotSupported struct { - MigrationFeatureNotSupported -} - -func init() { - t["UnsharedSwapVMotionNotSupported"] = reflect.TypeOf((*UnsharedSwapVMotionNotSupported)(nil)).Elem() -} - -type UnsharedSwapVMotionNotSupportedFault UnsharedSwapVMotionNotSupported - -func init() { - t["UnsharedSwapVMotionNotSupportedFault"] = reflect.TypeOf((*UnsharedSwapVMotionNotSupportedFault)(nil)).Elem() -} - -type UnsupportedDatastore struct { - VmConfigFault - - Datastore *ManagedObjectReference `xml:"datastore,omitempty"` -} - -func init() { - t["UnsupportedDatastore"] = reflect.TypeOf((*UnsupportedDatastore)(nil)).Elem() -} - -type UnsupportedDatastoreFault BaseUnsupportedDatastore - -func init() { - t["UnsupportedDatastoreFault"] = reflect.TypeOf((*UnsupportedDatastoreFault)(nil)).Elem() -} - -type UnsupportedGuest struct { - InvalidVmConfig - - UnsupportedGuestOS string `xml:"unsupportedGuestOS"` -} - -func init() { - t["UnsupportedGuest"] = reflect.TypeOf((*UnsupportedGuest)(nil)).Elem() -} - -type UnsupportedGuestFault UnsupportedGuest - -func init() { - t["UnsupportedGuestFault"] = reflect.TypeOf((*UnsupportedGuestFault)(nil)).Elem() -} - -type UnsupportedVimApiVersion struct { - VimFault - - Version string `xml:"version,omitempty"` -} - -func init() { - t["UnsupportedVimApiVersion"] = reflect.TypeOf((*UnsupportedVimApiVersion)(nil)).Elem() -} - -type UnsupportedVimApiVersionFault UnsupportedVimApiVersion - -func init() { - t["UnsupportedVimApiVersionFault"] = reflect.TypeOf((*UnsupportedVimApiVersionFault)(nil)).Elem() -} - -type UnsupportedVmxLocation struct { - VmConfigFault -} - -func init() { - t["UnsupportedVmxLocation"] = reflect.TypeOf((*UnsupportedVmxLocation)(nil)).Elem() -} - -type UnsupportedVmxLocationFault UnsupportedVmxLocation - -func init() { - t["UnsupportedVmxLocationFault"] = reflect.TypeOf((*UnsupportedVmxLocationFault)(nil)).Elem() -} - -type UnusedVirtualDiskBlocksNotScrubbed struct { - DeviceBackingNotSupported -} - -func init() { - t["UnusedVirtualDiskBlocksNotScrubbed"] = reflect.TypeOf((*UnusedVirtualDiskBlocksNotScrubbed)(nil)).Elem() -} - -type UnusedVirtualDiskBlocksNotScrubbedFault UnusedVirtualDiskBlocksNotScrubbed - -func init() { - t["UnusedVirtualDiskBlocksNotScrubbedFault"] = reflect.TypeOf((*UnusedVirtualDiskBlocksNotScrubbedFault)(nil)).Elem() -} - -type UpdateAnswerFileRequestType struct { - This ManagedObjectReference `xml:"_this"` - Host ManagedObjectReference `xml:"host"` - ConfigSpec BaseAnswerFileCreateSpec `xml:"configSpec,typeattr"` -} - -func init() { - t["UpdateAnswerFileRequestType"] = reflect.TypeOf((*UpdateAnswerFileRequestType)(nil)).Elem() -} - -type UpdateAnswerFile_Task UpdateAnswerFileRequestType - -func init() { - t["UpdateAnswerFile_Task"] = reflect.TypeOf((*UpdateAnswerFile_Task)(nil)).Elem() -} - -type UpdateAnswerFile_TaskResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type UpdateAssignedLicense UpdateAssignedLicenseRequestType - -func init() { - t["UpdateAssignedLicense"] = reflect.TypeOf((*UpdateAssignedLicense)(nil)).Elem() -} - -type UpdateAssignedLicenseRequestType struct { - This ManagedObjectReference `xml:"_this"` - Entity string `xml:"entity"` - LicenseKey string `xml:"licenseKey"` - EntityDisplayName string `xml:"entityDisplayName,omitempty"` -} - -func init() { - t["UpdateAssignedLicenseRequestType"] = reflect.TypeOf((*UpdateAssignedLicenseRequestType)(nil)).Elem() -} - -type UpdateAssignedLicenseResponse struct { - Returnval LicenseManagerLicenseInfo `xml:"returnval"` -} - -type UpdateAuthorizationRole UpdateAuthorizationRoleRequestType - -func init() { - t["UpdateAuthorizationRole"] = reflect.TypeOf((*UpdateAuthorizationRole)(nil)).Elem() -} - -type UpdateAuthorizationRoleRequestType struct { - This ManagedObjectReference `xml:"_this"` - RoleId int `xml:"roleId"` - NewName string `xml:"newName"` - PrivIds []string `xml:"privIds,omitempty"` -} - -func init() { - t["UpdateAuthorizationRoleRequestType"] = reflect.TypeOf((*UpdateAuthorizationRoleRequestType)(nil)).Elem() -} - -type UpdateAuthorizationRoleResponse struct { -} - -type UpdateBootDevice UpdateBootDeviceRequestType - -func init() { - t["UpdateBootDevice"] = reflect.TypeOf((*UpdateBootDevice)(nil)).Elem() -} - -type UpdateBootDeviceRequestType struct { - This ManagedObjectReference `xml:"_this"` - Key string `xml:"key"` -} - -func init() { - t["UpdateBootDeviceRequestType"] = reflect.TypeOf((*UpdateBootDeviceRequestType)(nil)).Elem() -} - -type UpdateBootDeviceResponse struct { -} - -type UpdateChildResourceConfiguration UpdateChildResourceConfigurationRequestType - -func init() { - t["UpdateChildResourceConfiguration"] = reflect.TypeOf((*UpdateChildResourceConfiguration)(nil)).Elem() -} - -type UpdateChildResourceConfigurationRequestType struct { - This ManagedObjectReference `xml:"_this"` - Spec []ResourceConfigSpec `xml:"spec"` -} - -func init() { - t["UpdateChildResourceConfigurationRequestType"] = reflect.TypeOf((*UpdateChildResourceConfigurationRequestType)(nil)).Elem() -} - -type UpdateChildResourceConfigurationResponse struct { -} - -type UpdateClusterProfile UpdateClusterProfileRequestType - -func init() { - t["UpdateClusterProfile"] = reflect.TypeOf((*UpdateClusterProfile)(nil)).Elem() -} - -type UpdateClusterProfileRequestType struct { - This ManagedObjectReference `xml:"_this"` - Config BaseClusterProfileConfigSpec `xml:"config,typeattr"` -} - -func init() { - t["UpdateClusterProfileRequestType"] = reflect.TypeOf((*UpdateClusterProfileRequestType)(nil)).Elem() -} - -type UpdateClusterProfileResponse struct { -} - -type UpdateConfig UpdateConfigRequestType - -func init() { - t["UpdateConfig"] = reflect.TypeOf((*UpdateConfig)(nil)).Elem() -} - -type UpdateConfigRequestType struct { - This ManagedObjectReference `xml:"_this"` - Name string `xml:"name,omitempty"` - Config *ResourceConfigSpec `xml:"config,omitempty"` -} - -func init() { - t["UpdateConfigRequestType"] = reflect.TypeOf((*UpdateConfigRequestType)(nil)).Elem() -} - -type UpdateConfigResponse struct { -} - -type UpdateConsoleIpRouteConfig UpdateConsoleIpRouteConfigRequestType - -func init() { - t["UpdateConsoleIpRouteConfig"] = reflect.TypeOf((*UpdateConsoleIpRouteConfig)(nil)).Elem() -} - -type UpdateConsoleIpRouteConfigRequestType struct { - This ManagedObjectReference `xml:"_this"` - Config BaseHostIpRouteConfig `xml:"config,typeattr"` -} - -func init() { - t["UpdateConsoleIpRouteConfigRequestType"] = reflect.TypeOf((*UpdateConsoleIpRouteConfigRequestType)(nil)).Elem() -} - -type UpdateConsoleIpRouteConfigResponse struct { -} - -type UpdateCounterLevelMapping UpdateCounterLevelMappingRequestType - -func init() { - t["UpdateCounterLevelMapping"] = reflect.TypeOf((*UpdateCounterLevelMapping)(nil)).Elem() -} - -type UpdateCounterLevelMappingRequestType struct { - This ManagedObjectReference `xml:"_this"` - CounterLevelMap []PerformanceManagerCounterLevelMapping `xml:"counterLevelMap"` -} - -func init() { - t["UpdateCounterLevelMappingRequestType"] = reflect.TypeOf((*UpdateCounterLevelMappingRequestType)(nil)).Elem() -} - -type UpdateCounterLevelMappingResponse struct { -} - -type UpdateDVSHealthCheckConfigRequestType struct { - This ManagedObjectReference `xml:"_this"` - HealthCheckConfig []BaseDVSHealthCheckConfig `xml:"healthCheckConfig,typeattr"` -} - -func init() { - t["UpdateDVSHealthCheckConfigRequestType"] = reflect.TypeOf((*UpdateDVSHealthCheckConfigRequestType)(nil)).Elem() -} - -type UpdateDVSHealthCheckConfig_Task UpdateDVSHealthCheckConfigRequestType - -func init() { - t["UpdateDVSHealthCheckConfig_Task"] = reflect.TypeOf((*UpdateDVSHealthCheckConfig_Task)(nil)).Elem() -} - -type UpdateDVSHealthCheckConfig_TaskResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type UpdateDVSLacpGroupConfigRequestType struct { - This ManagedObjectReference `xml:"_this"` - LacpGroupSpec []VMwareDvsLacpGroupSpec `xml:"lacpGroupSpec"` -} - -func init() { - t["UpdateDVSLacpGroupConfigRequestType"] = reflect.TypeOf((*UpdateDVSLacpGroupConfigRequestType)(nil)).Elem() -} - -type UpdateDVSLacpGroupConfig_Task UpdateDVSLacpGroupConfigRequestType - -func init() { - t["UpdateDVSLacpGroupConfig_Task"] = reflect.TypeOf((*UpdateDVSLacpGroupConfig_Task)(nil)).Elem() -} - -type UpdateDVSLacpGroupConfig_TaskResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type UpdateDateTime UpdateDateTimeRequestType - -func init() { - t["UpdateDateTime"] = reflect.TypeOf((*UpdateDateTime)(nil)).Elem() -} - -type UpdateDateTimeConfig UpdateDateTimeConfigRequestType - -func init() { - t["UpdateDateTimeConfig"] = reflect.TypeOf((*UpdateDateTimeConfig)(nil)).Elem() -} - -type UpdateDateTimeConfigRequestType struct { - This ManagedObjectReference `xml:"_this"` - Config HostDateTimeConfig `xml:"config"` -} - -func init() { - t["UpdateDateTimeConfigRequestType"] = reflect.TypeOf((*UpdateDateTimeConfigRequestType)(nil)).Elem() -} - -type UpdateDateTimeConfigResponse struct { -} - -type UpdateDateTimeRequestType struct { - This ManagedObjectReference `xml:"_this"` - DateTime time.Time `xml:"dateTime"` -} - -func init() { - t["UpdateDateTimeRequestType"] = reflect.TypeOf((*UpdateDateTimeRequestType)(nil)).Elem() -} - -type UpdateDateTimeResponse struct { -} - -type UpdateDefaultPolicy UpdateDefaultPolicyRequestType - -func init() { - t["UpdateDefaultPolicy"] = reflect.TypeOf((*UpdateDefaultPolicy)(nil)).Elem() -} - -type UpdateDefaultPolicyRequestType struct { - This ManagedObjectReference `xml:"_this"` - DefaultPolicy HostFirewallDefaultPolicy `xml:"defaultPolicy"` -} - -func init() { - t["UpdateDefaultPolicyRequestType"] = reflect.TypeOf((*UpdateDefaultPolicyRequestType)(nil)).Elem() -} - -type UpdateDefaultPolicyResponse struct { -} - -type UpdateDiskPartitions UpdateDiskPartitionsRequestType - -func init() { - t["UpdateDiskPartitions"] = reflect.TypeOf((*UpdateDiskPartitions)(nil)).Elem() -} - -type UpdateDiskPartitionsRequestType struct { - This ManagedObjectReference `xml:"_this"` - DevicePath string `xml:"devicePath"` - Spec HostDiskPartitionSpec `xml:"spec"` -} - -func init() { - t["UpdateDiskPartitionsRequestType"] = reflect.TypeOf((*UpdateDiskPartitionsRequestType)(nil)).Elem() -} - -type UpdateDiskPartitionsResponse struct { -} - -type UpdateDnsConfig UpdateDnsConfigRequestType - -func init() { - t["UpdateDnsConfig"] = reflect.TypeOf((*UpdateDnsConfig)(nil)).Elem() -} - -type UpdateDnsConfigRequestType struct { - This ManagedObjectReference `xml:"_this"` - Config BaseHostDnsConfig `xml:"config,typeattr"` -} - -func init() { - t["UpdateDnsConfigRequestType"] = reflect.TypeOf((*UpdateDnsConfigRequestType)(nil)).Elem() -} - -type UpdateDnsConfigResponse struct { -} - -type UpdateDvsCapability UpdateDvsCapabilityRequestType - -func init() { - t["UpdateDvsCapability"] = reflect.TypeOf((*UpdateDvsCapability)(nil)).Elem() -} - -type UpdateDvsCapabilityRequestType struct { - This ManagedObjectReference `xml:"_this"` - Capability DVSCapability `xml:"capability"` -} - -func init() { - t["UpdateDvsCapabilityRequestType"] = reflect.TypeOf((*UpdateDvsCapabilityRequestType)(nil)).Elem() -} - -type UpdateDvsCapabilityResponse struct { -} - -type UpdateExtension UpdateExtensionRequestType - -func init() { - t["UpdateExtension"] = reflect.TypeOf((*UpdateExtension)(nil)).Elem() -} - -type UpdateExtensionRequestType struct { - This ManagedObjectReference `xml:"_this"` - Extension Extension `xml:"extension"` -} - -func init() { - t["UpdateExtensionRequestType"] = reflect.TypeOf((*UpdateExtensionRequestType)(nil)).Elem() -} - -type UpdateExtensionResponse struct { -} - -type UpdateFlags UpdateFlagsRequestType - -func init() { - t["UpdateFlags"] = reflect.TypeOf((*UpdateFlags)(nil)).Elem() -} - -type UpdateFlagsRequestType struct { - This ManagedObjectReference `xml:"_this"` - FlagInfo HostFlagInfo `xml:"flagInfo"` -} - -func init() { - t["UpdateFlagsRequestType"] = reflect.TypeOf((*UpdateFlagsRequestType)(nil)).Elem() -} - -type UpdateFlagsResponse struct { -} - -type UpdateHostImageAcceptanceLevel UpdateHostImageAcceptanceLevelRequestType - -func init() { - t["UpdateHostImageAcceptanceLevel"] = reflect.TypeOf((*UpdateHostImageAcceptanceLevel)(nil)).Elem() -} - -type UpdateHostImageAcceptanceLevelRequestType struct { - This ManagedObjectReference `xml:"_this"` - NewAcceptanceLevel string `xml:"newAcceptanceLevel"` -} - -func init() { - t["UpdateHostImageAcceptanceLevelRequestType"] = reflect.TypeOf((*UpdateHostImageAcceptanceLevelRequestType)(nil)).Elem() -} - -type UpdateHostImageAcceptanceLevelResponse struct { -} - -type UpdateHostProfile UpdateHostProfileRequestType - -func init() { - t["UpdateHostProfile"] = reflect.TypeOf((*UpdateHostProfile)(nil)).Elem() -} - -type UpdateHostProfileRequestType struct { - This ManagedObjectReference `xml:"_this"` - Config BaseHostProfileConfigSpec `xml:"config,typeattr"` -} - -func init() { - t["UpdateHostProfileRequestType"] = reflect.TypeOf((*UpdateHostProfileRequestType)(nil)).Elem() -} - -type UpdateHostProfileResponse struct { -} - -type UpdateInternetScsiAdvancedOptions UpdateInternetScsiAdvancedOptionsRequestType - -func init() { - t["UpdateInternetScsiAdvancedOptions"] = reflect.TypeOf((*UpdateInternetScsiAdvancedOptions)(nil)).Elem() -} - -type UpdateInternetScsiAdvancedOptionsRequestType struct { - This ManagedObjectReference `xml:"_this"` - IScsiHbaDevice string `xml:"iScsiHbaDevice"` - TargetSet *HostInternetScsiHbaTargetSet `xml:"targetSet,omitempty"` - Options []HostInternetScsiHbaParamValue `xml:"options"` -} - -func init() { - t["UpdateInternetScsiAdvancedOptionsRequestType"] = reflect.TypeOf((*UpdateInternetScsiAdvancedOptionsRequestType)(nil)).Elem() -} - -type UpdateInternetScsiAdvancedOptionsResponse struct { -} - -type UpdateInternetScsiAlias UpdateInternetScsiAliasRequestType - -func init() { - t["UpdateInternetScsiAlias"] = reflect.TypeOf((*UpdateInternetScsiAlias)(nil)).Elem() -} - -type UpdateInternetScsiAliasRequestType struct { - This ManagedObjectReference `xml:"_this"` - IScsiHbaDevice string `xml:"iScsiHbaDevice"` - IScsiAlias string `xml:"iScsiAlias"` -} - -func init() { - t["UpdateInternetScsiAliasRequestType"] = reflect.TypeOf((*UpdateInternetScsiAliasRequestType)(nil)).Elem() -} - -type UpdateInternetScsiAliasResponse struct { -} - -type UpdateInternetScsiAuthenticationProperties UpdateInternetScsiAuthenticationPropertiesRequestType - -func init() { - t["UpdateInternetScsiAuthenticationProperties"] = reflect.TypeOf((*UpdateInternetScsiAuthenticationProperties)(nil)).Elem() -} - -type UpdateInternetScsiAuthenticationPropertiesRequestType struct { - This ManagedObjectReference `xml:"_this"` - IScsiHbaDevice string `xml:"iScsiHbaDevice"` - AuthenticationProperties HostInternetScsiHbaAuthenticationProperties `xml:"authenticationProperties"` - TargetSet *HostInternetScsiHbaTargetSet `xml:"targetSet,omitempty"` -} - -func init() { - t["UpdateInternetScsiAuthenticationPropertiesRequestType"] = reflect.TypeOf((*UpdateInternetScsiAuthenticationPropertiesRequestType)(nil)).Elem() -} - -type UpdateInternetScsiAuthenticationPropertiesResponse struct { -} - -type UpdateInternetScsiDigestProperties UpdateInternetScsiDigestPropertiesRequestType - -func init() { - t["UpdateInternetScsiDigestProperties"] = reflect.TypeOf((*UpdateInternetScsiDigestProperties)(nil)).Elem() -} - -type UpdateInternetScsiDigestPropertiesRequestType struct { - This ManagedObjectReference `xml:"_this"` - IScsiHbaDevice string `xml:"iScsiHbaDevice"` - TargetSet *HostInternetScsiHbaTargetSet `xml:"targetSet,omitempty"` - DigestProperties HostInternetScsiHbaDigestProperties `xml:"digestProperties"` -} - -func init() { - t["UpdateInternetScsiDigestPropertiesRequestType"] = reflect.TypeOf((*UpdateInternetScsiDigestPropertiesRequestType)(nil)).Elem() -} - -type UpdateInternetScsiDigestPropertiesResponse struct { -} - -type UpdateInternetScsiDiscoveryProperties UpdateInternetScsiDiscoveryPropertiesRequestType - -func init() { - t["UpdateInternetScsiDiscoveryProperties"] = reflect.TypeOf((*UpdateInternetScsiDiscoveryProperties)(nil)).Elem() -} - -type UpdateInternetScsiDiscoveryPropertiesRequestType struct { - This ManagedObjectReference `xml:"_this"` - IScsiHbaDevice string `xml:"iScsiHbaDevice"` - DiscoveryProperties HostInternetScsiHbaDiscoveryProperties `xml:"discoveryProperties"` -} - -func init() { - t["UpdateInternetScsiDiscoveryPropertiesRequestType"] = reflect.TypeOf((*UpdateInternetScsiDiscoveryPropertiesRequestType)(nil)).Elem() -} - -type UpdateInternetScsiDiscoveryPropertiesResponse struct { -} - -type UpdateInternetScsiIPProperties UpdateInternetScsiIPPropertiesRequestType - -func init() { - t["UpdateInternetScsiIPProperties"] = reflect.TypeOf((*UpdateInternetScsiIPProperties)(nil)).Elem() -} - -type UpdateInternetScsiIPPropertiesRequestType struct { - This ManagedObjectReference `xml:"_this"` - IScsiHbaDevice string `xml:"iScsiHbaDevice"` - IpProperties HostInternetScsiHbaIPProperties `xml:"ipProperties"` -} - -func init() { - t["UpdateInternetScsiIPPropertiesRequestType"] = reflect.TypeOf((*UpdateInternetScsiIPPropertiesRequestType)(nil)).Elem() -} - -type UpdateInternetScsiIPPropertiesResponse struct { -} - -type UpdateInternetScsiName UpdateInternetScsiNameRequestType - -func init() { - t["UpdateInternetScsiName"] = reflect.TypeOf((*UpdateInternetScsiName)(nil)).Elem() -} - -type UpdateInternetScsiNameRequestType struct { - This ManagedObjectReference `xml:"_this"` - IScsiHbaDevice string `xml:"iScsiHbaDevice"` - IScsiName string `xml:"iScsiName"` -} - -func init() { - t["UpdateInternetScsiNameRequestType"] = reflect.TypeOf((*UpdateInternetScsiNameRequestType)(nil)).Elem() -} - -type UpdateInternetScsiNameResponse struct { -} - -type UpdateIpConfig UpdateIpConfigRequestType - -func init() { - t["UpdateIpConfig"] = reflect.TypeOf((*UpdateIpConfig)(nil)).Elem() -} - -type UpdateIpConfigRequestType struct { - This ManagedObjectReference `xml:"_this"` - IpConfig HostIpConfig `xml:"ipConfig"` -} - -func init() { - t["UpdateIpConfigRequestType"] = reflect.TypeOf((*UpdateIpConfigRequestType)(nil)).Elem() -} - -type UpdateIpConfigResponse struct { -} - -type UpdateIpPool UpdateIpPoolRequestType - -func init() { - t["UpdateIpPool"] = reflect.TypeOf((*UpdateIpPool)(nil)).Elem() -} - -type UpdateIpPoolRequestType struct { - This ManagedObjectReference `xml:"_this"` - Dc ManagedObjectReference `xml:"dc"` - Pool IpPool `xml:"pool"` -} - -func init() { - t["UpdateIpPoolRequestType"] = reflect.TypeOf((*UpdateIpPoolRequestType)(nil)).Elem() -} - -type UpdateIpPoolResponse struct { -} - -type UpdateIpRouteConfig UpdateIpRouteConfigRequestType - -func init() { - t["UpdateIpRouteConfig"] = reflect.TypeOf((*UpdateIpRouteConfig)(nil)).Elem() -} - -type UpdateIpRouteConfigRequestType struct { - This ManagedObjectReference `xml:"_this"` - Config BaseHostIpRouteConfig `xml:"config,typeattr"` -} - -func init() { - t["UpdateIpRouteConfigRequestType"] = reflect.TypeOf((*UpdateIpRouteConfigRequestType)(nil)).Elem() -} - -type UpdateIpRouteConfigResponse struct { -} - -type UpdateIpRouteTableConfig UpdateIpRouteTableConfigRequestType - -func init() { - t["UpdateIpRouteTableConfig"] = reflect.TypeOf((*UpdateIpRouteTableConfig)(nil)).Elem() -} - -type UpdateIpRouteTableConfigRequestType struct { - This ManagedObjectReference `xml:"_this"` - Config HostIpRouteTableConfig `xml:"config"` -} - -func init() { - t["UpdateIpRouteTableConfigRequestType"] = reflect.TypeOf((*UpdateIpRouteTableConfigRequestType)(nil)).Elem() -} - -type UpdateIpRouteTableConfigResponse struct { -} - -type UpdateIpmi UpdateIpmiRequestType - -func init() { - t["UpdateIpmi"] = reflect.TypeOf((*UpdateIpmi)(nil)).Elem() -} - -type UpdateIpmiRequestType struct { - This ManagedObjectReference `xml:"_this"` - IpmiInfo HostIpmiInfo `xml:"ipmiInfo"` -} - -func init() { - t["UpdateIpmiRequestType"] = reflect.TypeOf((*UpdateIpmiRequestType)(nil)).Elem() -} - -type UpdateIpmiResponse struct { -} - -type UpdateLicense UpdateLicenseRequestType - -func init() { - t["UpdateLicense"] = reflect.TypeOf((*UpdateLicense)(nil)).Elem() -} - -type UpdateLicenseLabel UpdateLicenseLabelRequestType - -func init() { - t["UpdateLicenseLabel"] = reflect.TypeOf((*UpdateLicenseLabel)(nil)).Elem() -} - -type UpdateLicenseLabelRequestType struct { - This ManagedObjectReference `xml:"_this"` - LicenseKey string `xml:"licenseKey"` - LabelKey string `xml:"labelKey"` - LabelValue string `xml:"labelValue"` -} - -func init() { - t["UpdateLicenseLabelRequestType"] = reflect.TypeOf((*UpdateLicenseLabelRequestType)(nil)).Elem() -} - -type UpdateLicenseLabelResponse struct { -} - -type UpdateLicenseRequestType struct { - This ManagedObjectReference `xml:"_this"` - LicenseKey string `xml:"licenseKey"` - Labels []KeyValue `xml:"labels,omitempty"` -} - -func init() { - t["UpdateLicenseRequestType"] = reflect.TypeOf((*UpdateLicenseRequestType)(nil)).Elem() -} - -type UpdateLicenseResponse struct { - Returnval LicenseManagerLicenseInfo `xml:"returnval"` -} - -type UpdateLinkedChildren UpdateLinkedChildrenRequestType - -func init() { - t["UpdateLinkedChildren"] = reflect.TypeOf((*UpdateLinkedChildren)(nil)).Elem() -} - -type UpdateLinkedChildrenRequestType struct { - This ManagedObjectReference `xml:"_this"` - AddChangeSet []VirtualAppLinkInfo `xml:"addChangeSet,omitempty"` - RemoveSet []ManagedObjectReference `xml:"removeSet,omitempty"` -} - -func init() { - t["UpdateLinkedChildrenRequestType"] = reflect.TypeOf((*UpdateLinkedChildrenRequestType)(nil)).Elem() -} - -type UpdateLinkedChildrenResponse struct { -} - -type UpdateLocalSwapDatastore UpdateLocalSwapDatastoreRequestType - -func init() { - t["UpdateLocalSwapDatastore"] = reflect.TypeOf((*UpdateLocalSwapDatastore)(nil)).Elem() -} - -type UpdateLocalSwapDatastoreRequestType struct { - This ManagedObjectReference `xml:"_this"` - Datastore *ManagedObjectReference `xml:"datastore,omitempty"` -} - -func init() { - t["UpdateLocalSwapDatastoreRequestType"] = reflect.TypeOf((*UpdateLocalSwapDatastoreRequestType)(nil)).Elem() -} - -type UpdateLocalSwapDatastoreResponse struct { -} - -type UpdateModuleOptionString UpdateModuleOptionStringRequestType - -func init() { - t["UpdateModuleOptionString"] = reflect.TypeOf((*UpdateModuleOptionString)(nil)).Elem() -} - -type UpdateModuleOptionStringRequestType struct { - This ManagedObjectReference `xml:"_this"` - Name string `xml:"name"` - Options string `xml:"options"` -} - -func init() { - t["UpdateModuleOptionStringRequestType"] = reflect.TypeOf((*UpdateModuleOptionStringRequestType)(nil)).Elem() -} - -type UpdateModuleOptionStringResponse struct { -} - -type UpdateNetworkConfig UpdateNetworkConfigRequestType - -func init() { - t["UpdateNetworkConfig"] = reflect.TypeOf((*UpdateNetworkConfig)(nil)).Elem() -} - -type UpdateNetworkConfigRequestType struct { - This ManagedObjectReference `xml:"_this"` - Config HostNetworkConfig `xml:"config"` - ChangeMode string `xml:"changeMode"` -} - -func init() { - t["UpdateNetworkConfigRequestType"] = reflect.TypeOf((*UpdateNetworkConfigRequestType)(nil)).Elem() -} - -type UpdateNetworkConfigResponse struct { - Returnval HostNetworkConfigResult `xml:"returnval"` -} - -type UpdateNetworkResourcePool UpdateNetworkResourcePoolRequestType - -func init() { - t["UpdateNetworkResourcePool"] = reflect.TypeOf((*UpdateNetworkResourcePool)(nil)).Elem() -} - -type UpdateNetworkResourcePoolRequestType struct { - This ManagedObjectReference `xml:"_this"` - ConfigSpec []DVSNetworkResourcePoolConfigSpec `xml:"configSpec"` -} - -func init() { - t["UpdateNetworkResourcePoolRequestType"] = reflect.TypeOf((*UpdateNetworkResourcePoolRequestType)(nil)).Elem() -} - -type UpdateNetworkResourcePoolResponse struct { -} - -type UpdateOptions UpdateOptionsRequestType - -func init() { - t["UpdateOptions"] = reflect.TypeOf((*UpdateOptions)(nil)).Elem() -} - -type UpdateOptionsRequestType struct { - This ManagedObjectReference `xml:"_this"` - ChangedValue []BaseOptionValue `xml:"changedValue,typeattr"` -} - -func init() { - t["UpdateOptionsRequestType"] = reflect.TypeOf((*UpdateOptionsRequestType)(nil)).Elem() -} - -type UpdateOptionsResponse struct { -} - -type UpdatePassthruConfig UpdatePassthruConfigRequestType - -func init() { - t["UpdatePassthruConfig"] = reflect.TypeOf((*UpdatePassthruConfig)(nil)).Elem() -} - -type UpdatePassthruConfigRequestType struct { - This ManagedObjectReference `xml:"_this"` - Config []BaseHostPciPassthruConfig `xml:"config,typeattr"` -} - -func init() { - t["UpdatePassthruConfigRequestType"] = reflect.TypeOf((*UpdatePassthruConfigRequestType)(nil)).Elem() -} - -type UpdatePassthruConfigResponse struct { -} - -type UpdatePerfInterval UpdatePerfIntervalRequestType - -func init() { - t["UpdatePerfInterval"] = reflect.TypeOf((*UpdatePerfInterval)(nil)).Elem() -} - -type UpdatePerfIntervalRequestType struct { - This ManagedObjectReference `xml:"_this"` - Interval PerfInterval `xml:"interval"` -} - -func init() { - t["UpdatePerfIntervalRequestType"] = reflect.TypeOf((*UpdatePerfIntervalRequestType)(nil)).Elem() -} - -type UpdatePerfIntervalResponse struct { -} - -type UpdatePhysicalNicLinkSpeed UpdatePhysicalNicLinkSpeedRequestType - -func init() { - t["UpdatePhysicalNicLinkSpeed"] = reflect.TypeOf((*UpdatePhysicalNicLinkSpeed)(nil)).Elem() -} - -type UpdatePhysicalNicLinkSpeedRequestType struct { - This ManagedObjectReference `xml:"_this"` - Device string `xml:"device"` - LinkSpeed *PhysicalNicLinkInfo `xml:"linkSpeed,omitempty"` -} - -func init() { - t["UpdatePhysicalNicLinkSpeedRequestType"] = reflect.TypeOf((*UpdatePhysicalNicLinkSpeedRequestType)(nil)).Elem() -} - -type UpdatePhysicalNicLinkSpeedResponse struct { -} - -type UpdatePortGroup UpdatePortGroupRequestType - -func init() { - t["UpdatePortGroup"] = reflect.TypeOf((*UpdatePortGroup)(nil)).Elem() -} - -type UpdatePortGroupRequestType struct { - This ManagedObjectReference `xml:"_this"` - PgName string `xml:"pgName"` - Portgrp HostPortGroupSpec `xml:"portgrp"` -} - -func init() { - t["UpdatePortGroupRequestType"] = reflect.TypeOf((*UpdatePortGroupRequestType)(nil)).Elem() -} - -type UpdatePortGroupResponse struct { -} - -type UpdateProgress UpdateProgressRequestType - -func init() { - t["UpdateProgress"] = reflect.TypeOf((*UpdateProgress)(nil)).Elem() -} - -type UpdateProgressRequestType struct { - This ManagedObjectReference `xml:"_this"` - PercentDone int `xml:"percentDone"` -} - -func init() { - t["UpdateProgressRequestType"] = reflect.TypeOf((*UpdateProgressRequestType)(nil)).Elem() -} - -type UpdateProgressResponse struct { -} - -type UpdateReferenceHost UpdateReferenceHostRequestType - -func init() { - t["UpdateReferenceHost"] = reflect.TypeOf((*UpdateReferenceHost)(nil)).Elem() -} - -type UpdateReferenceHostRequestType struct { - This ManagedObjectReference `xml:"_this"` - Host *ManagedObjectReference `xml:"host,omitempty"` -} - -func init() { - t["UpdateReferenceHostRequestType"] = reflect.TypeOf((*UpdateReferenceHostRequestType)(nil)).Elem() -} - -type UpdateReferenceHostResponse struct { -} - -type UpdateRuleset UpdateRulesetRequestType - -func init() { - t["UpdateRuleset"] = reflect.TypeOf((*UpdateRuleset)(nil)).Elem() -} - -type UpdateRulesetRequestType struct { - This ManagedObjectReference `xml:"_this"` - Id string `xml:"id"` - Spec HostFirewallRulesetRulesetSpec `xml:"spec"` -} - -func init() { - t["UpdateRulesetRequestType"] = reflect.TypeOf((*UpdateRulesetRequestType)(nil)).Elem() -} - -type UpdateRulesetResponse struct { -} - -type UpdateScsiLunDisplayName UpdateScsiLunDisplayNameRequestType - -func init() { - t["UpdateScsiLunDisplayName"] = reflect.TypeOf((*UpdateScsiLunDisplayName)(nil)).Elem() -} - -type UpdateScsiLunDisplayNameRequestType struct { - This ManagedObjectReference `xml:"_this"` - LunUuid string `xml:"lunUuid"` - DisplayName string `xml:"displayName"` -} - -func init() { - t["UpdateScsiLunDisplayNameRequestType"] = reflect.TypeOf((*UpdateScsiLunDisplayNameRequestType)(nil)).Elem() -} - -type UpdateScsiLunDisplayNameResponse struct { -} - -type UpdateServiceConsoleVirtualNic UpdateServiceConsoleVirtualNicRequestType - -func init() { - t["UpdateServiceConsoleVirtualNic"] = reflect.TypeOf((*UpdateServiceConsoleVirtualNic)(nil)).Elem() -} - -type UpdateServiceConsoleVirtualNicRequestType struct { - This ManagedObjectReference `xml:"_this"` - Device string `xml:"device"` - Nic HostVirtualNicSpec `xml:"nic"` -} - -func init() { - t["UpdateServiceConsoleVirtualNicRequestType"] = reflect.TypeOf((*UpdateServiceConsoleVirtualNicRequestType)(nil)).Elem() -} - -type UpdateServiceConsoleVirtualNicResponse struct { -} - -type UpdateServiceMessage UpdateServiceMessageRequestType - -func init() { - t["UpdateServiceMessage"] = reflect.TypeOf((*UpdateServiceMessage)(nil)).Elem() -} - -type UpdateServiceMessageRequestType struct { - This ManagedObjectReference `xml:"_this"` - Message string `xml:"message"` -} - -func init() { - t["UpdateServiceMessageRequestType"] = reflect.TypeOf((*UpdateServiceMessageRequestType)(nil)).Elem() -} - -type UpdateServiceMessageResponse struct { -} - -type UpdateServicePolicy UpdateServicePolicyRequestType - -func init() { - t["UpdateServicePolicy"] = reflect.TypeOf((*UpdateServicePolicy)(nil)).Elem() -} - -type UpdateServicePolicyRequestType struct { - This ManagedObjectReference `xml:"_this"` - Id string `xml:"id"` - Policy string `xml:"policy"` -} - -func init() { - t["UpdateServicePolicyRequestType"] = reflect.TypeOf((*UpdateServicePolicyRequestType)(nil)).Elem() -} - -type UpdateServicePolicyResponse struct { -} - -type UpdateSet struct { - DynamicData - - Version string `xml:"version"` - FilterSet []PropertyFilterUpdate `xml:"filterSet,omitempty"` - Truncated *bool `xml:"truncated"` -} - -func init() { - t["UpdateSet"] = reflect.TypeOf((*UpdateSet)(nil)).Elem() -} - -type UpdateSoftwareInternetScsiEnabled UpdateSoftwareInternetScsiEnabledRequestType - -func init() { - t["UpdateSoftwareInternetScsiEnabled"] = reflect.TypeOf((*UpdateSoftwareInternetScsiEnabled)(nil)).Elem() -} - -type UpdateSoftwareInternetScsiEnabledRequestType struct { - This ManagedObjectReference `xml:"_this"` - Enabled bool `xml:"enabled"` -} - -func init() { - t["UpdateSoftwareInternetScsiEnabledRequestType"] = reflect.TypeOf((*UpdateSoftwareInternetScsiEnabledRequestType)(nil)).Elem() -} - -type UpdateSoftwareInternetScsiEnabledResponse struct { -} - -type UpdateSystemResources UpdateSystemResourcesRequestType - -func init() { - t["UpdateSystemResources"] = reflect.TypeOf((*UpdateSystemResources)(nil)).Elem() -} - -type UpdateSystemResourcesRequestType struct { - This ManagedObjectReference `xml:"_this"` - ResourceInfo HostSystemResourceInfo `xml:"resourceInfo"` -} - -func init() { - t["UpdateSystemResourcesRequestType"] = reflect.TypeOf((*UpdateSystemResourcesRequestType)(nil)).Elem() -} - -type UpdateSystemResourcesResponse struct { -} - -type UpdateSystemSwapConfiguration UpdateSystemSwapConfigurationRequestType - -func init() { - t["UpdateSystemSwapConfiguration"] = reflect.TypeOf((*UpdateSystemSwapConfiguration)(nil)).Elem() -} - -type UpdateSystemSwapConfigurationRequestType struct { - This ManagedObjectReference `xml:"_this"` - SysSwapConfig HostSystemSwapConfiguration `xml:"sysSwapConfig"` -} - -func init() { - t["UpdateSystemSwapConfigurationRequestType"] = reflect.TypeOf((*UpdateSystemSwapConfigurationRequestType)(nil)).Elem() -} - -type UpdateSystemSwapConfigurationResponse struct { -} - -type UpdateUser UpdateUserRequestType - -func init() { - t["UpdateUser"] = reflect.TypeOf((*UpdateUser)(nil)).Elem() -} - -type UpdateUserRequestType struct { - This ManagedObjectReference `xml:"_this"` - User BaseHostAccountSpec `xml:"user,typeattr"` -} - -func init() { - t["UpdateUserRequestType"] = reflect.TypeOf((*UpdateUserRequestType)(nil)).Elem() -} - -type UpdateUserResponse struct { -} - -type UpdateVAppConfig UpdateVAppConfigRequestType - -func init() { - t["UpdateVAppConfig"] = reflect.TypeOf((*UpdateVAppConfig)(nil)).Elem() -} - -type UpdateVAppConfigRequestType struct { - This ManagedObjectReference `xml:"_this"` - Spec VAppConfigSpec `xml:"spec"` -} - -func init() { - t["UpdateVAppConfigRequestType"] = reflect.TypeOf((*UpdateVAppConfigRequestType)(nil)).Elem() -} - -type UpdateVAppConfigResponse struct { -} - -type UpdateVirtualMachineFilesRequestType struct { - This ManagedObjectReference `xml:"_this"` - MountPathDatastoreMapping []DatastoreMountPathDatastorePair `xml:"mountPathDatastoreMapping"` -} - -func init() { - t["UpdateVirtualMachineFilesRequestType"] = reflect.TypeOf((*UpdateVirtualMachineFilesRequestType)(nil)).Elem() -} - -type UpdateVirtualMachineFilesResult struct { - DynamicData - - FailedVmFile []UpdateVirtualMachineFilesResultFailedVmFileInfo `xml:"failedVmFile,omitempty"` -} - -func init() { - t["UpdateVirtualMachineFilesResult"] = reflect.TypeOf((*UpdateVirtualMachineFilesResult)(nil)).Elem() -} - -type UpdateVirtualMachineFilesResultFailedVmFileInfo struct { - DynamicData - - VmFile string `xml:"vmFile"` - Fault LocalizedMethodFault `xml:"fault"` -} - -func init() { - t["UpdateVirtualMachineFilesResultFailedVmFileInfo"] = reflect.TypeOf((*UpdateVirtualMachineFilesResultFailedVmFileInfo)(nil)).Elem() -} - -type UpdateVirtualMachineFiles_Task UpdateVirtualMachineFilesRequestType - -func init() { - t["UpdateVirtualMachineFiles_Task"] = reflect.TypeOf((*UpdateVirtualMachineFiles_Task)(nil)).Elem() -} - -type UpdateVirtualMachineFiles_TaskResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type UpdateVirtualNic UpdateVirtualNicRequestType - -func init() { - t["UpdateVirtualNic"] = reflect.TypeOf((*UpdateVirtualNic)(nil)).Elem() -} - -type UpdateVirtualNicRequestType struct { - This ManagedObjectReference `xml:"_this"` - Device string `xml:"device"` - Nic HostVirtualNicSpec `xml:"nic"` -} - -func init() { - t["UpdateVirtualNicRequestType"] = reflect.TypeOf((*UpdateVirtualNicRequestType)(nil)).Elem() -} - -type UpdateVirtualNicResponse struct { -} - -type UpdateVirtualSwitch UpdateVirtualSwitchRequestType - -func init() { - t["UpdateVirtualSwitch"] = reflect.TypeOf((*UpdateVirtualSwitch)(nil)).Elem() -} - -type UpdateVirtualSwitchRequestType struct { - This ManagedObjectReference `xml:"_this"` - VswitchName string `xml:"vswitchName"` - Spec HostVirtualSwitchSpec `xml:"spec"` -} - -func init() { - t["UpdateVirtualSwitchRequestType"] = reflect.TypeOf((*UpdateVirtualSwitchRequestType)(nil)).Elem() -} - -type UpdateVirtualSwitchResponse struct { -} - -type UpdateVsanRequestType struct { - This ManagedObjectReference `xml:"_this"` - Config VsanHostConfigInfo `xml:"config"` -} - -func init() { - t["UpdateVsanRequestType"] = reflect.TypeOf((*UpdateVsanRequestType)(nil)).Elem() -} - -type UpdateVsan_Task UpdateVsanRequestType - -func init() { - t["UpdateVsan_Task"] = reflect.TypeOf((*UpdateVsan_Task)(nil)).Elem() -} - -type UpdateVsan_TaskResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type UpdatedAgentBeingRestartedEvent struct { - HostEvent -} - -func init() { - t["UpdatedAgentBeingRestartedEvent"] = reflect.TypeOf((*UpdatedAgentBeingRestartedEvent)(nil)).Elem() -} - -type UpgradeEvent struct { - Event - - Message string `xml:"message"` -} - -func init() { - t["UpgradeEvent"] = reflect.TypeOf((*UpgradeEvent)(nil)).Elem() -} - -type UpgradeToolsRequestType struct { - This ManagedObjectReference `xml:"_this"` - InstallerOptions string `xml:"installerOptions,omitempty"` -} - -func init() { - t["UpgradeToolsRequestType"] = reflect.TypeOf((*UpgradeToolsRequestType)(nil)).Elem() -} - -type UpgradeTools_Task UpgradeToolsRequestType - -func init() { - t["UpgradeTools_Task"] = reflect.TypeOf((*UpgradeTools_Task)(nil)).Elem() -} - -type UpgradeTools_TaskResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type UpgradeVMRequestType struct { - This ManagedObjectReference `xml:"_this"` - Version string `xml:"version,omitempty"` -} - -func init() { - t["UpgradeVMRequestType"] = reflect.TypeOf((*UpgradeVMRequestType)(nil)).Elem() -} - -type UpgradeVM_Task UpgradeVMRequestType - -func init() { - t["UpgradeVM_Task"] = reflect.TypeOf((*UpgradeVM_Task)(nil)).Elem() -} - -type UpgradeVM_TaskResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} - -type UpgradeVmLayout UpgradeVmLayoutRequestType - -func init() { - t["UpgradeVmLayout"] = reflect.TypeOf((*UpgradeVmLayout)(nil)).Elem() -} - -type UpgradeVmLayoutRequestType struct { - This ManagedObjectReference `xml:"_this"` -} - -func init() { - t["UpgradeVmLayoutRequestType"] = reflect.TypeOf((*UpgradeVmLayoutRequestType)(nil)).Elem() -} - -type UpgradeVmLayoutResponse struct { -} - -type UpgradeVmfs UpgradeVmfsRequestType - -func init() { - t["UpgradeVmfs"] = reflect.TypeOf((*UpgradeVmfs)(nil)).Elem() -} - -type UpgradeVmfsRequestType struct { - This ManagedObjectReference `xml:"_this"` - VmfsPath string `xml:"vmfsPath"` -} - -func init() { - t["UpgradeVmfsRequestType"] = reflect.TypeOf((*UpgradeVmfsRequestType)(nil)).Elem() -} - -type UpgradeVmfsResponse struct { -} - -type UplinkPortMtuNotSupportEvent struct { - DvsHealthStatusChangeEvent -} - -func init() { - t["UplinkPortMtuNotSupportEvent"] = reflect.TypeOf((*UplinkPortMtuNotSupportEvent)(nil)).Elem() -} - -type UplinkPortMtuSupportEvent struct { - DvsHealthStatusChangeEvent -} - -func init() { - t["UplinkPortMtuSupportEvent"] = reflect.TypeOf((*UplinkPortMtuSupportEvent)(nil)).Elem() -} - -type UplinkPortVlanTrunkedEvent struct { - DvsHealthStatusChangeEvent -} - -func init() { - t["UplinkPortVlanTrunkedEvent"] = reflect.TypeOf((*UplinkPortVlanTrunkedEvent)(nil)).Elem() -} - -type UplinkPortVlanUntrunkedEvent struct { - DvsHealthStatusChangeEvent -} - -func init() { - t["UplinkPortVlanUntrunkedEvent"] = reflect.TypeOf((*UplinkPortVlanUntrunkedEvent)(nil)).Elem() -} - -type UserAssignedToGroup struct { - HostEvent - - UserLogin string `xml:"userLogin"` - Group string `xml:"group"` -} - -func init() { - t["UserAssignedToGroup"] = reflect.TypeOf((*UserAssignedToGroup)(nil)).Elem() -} - -type UserGroupProfile struct { - ApplyProfile - - Key string `xml:"key"` -} - -func init() { - t["UserGroupProfile"] = reflect.TypeOf((*UserGroupProfile)(nil)).Elem() -} - -type UserInputRequiredParameterMetadata struct { - ProfilePolicyOptionMetadata - - UserInputParameter []ProfileParameterMetadata `xml:"userInputParameter,omitempty"` -} - -func init() { - t["UserInputRequiredParameterMetadata"] = reflect.TypeOf((*UserInputRequiredParameterMetadata)(nil)).Elem() -} - -type UserLoginSessionEvent struct { - SessionEvent - - IpAddress string `xml:"ipAddress"` - UserAgent string `xml:"userAgent,omitempty"` - Locale string `xml:"locale"` - SessionId string `xml:"sessionId"` -} - -func init() { - t["UserLoginSessionEvent"] = reflect.TypeOf((*UserLoginSessionEvent)(nil)).Elem() -} - -type UserLogoutSessionEvent struct { - SessionEvent - - IpAddress string `xml:"ipAddress,omitempty"` - UserAgent string `xml:"userAgent,omitempty"` - CallCount int64 `xml:"callCount,omitempty"` - SessionId string `xml:"sessionId,omitempty"` - LoginTime *time.Time `xml:"loginTime"` -} - -func init() { - t["UserLogoutSessionEvent"] = reflect.TypeOf((*UserLogoutSessionEvent)(nil)).Elem() -} - -type UserNotFound struct { - VimFault - - Principal string `xml:"principal"` - Unresolved bool `xml:"unresolved"` -} - -func init() { - t["UserNotFound"] = reflect.TypeOf((*UserNotFound)(nil)).Elem() -} - -type UserNotFoundFault UserNotFound - -func init() { - t["UserNotFoundFault"] = reflect.TypeOf((*UserNotFoundFault)(nil)).Elem() -} - -type UserPasswordChanged struct { - HostEvent - - UserLogin string `xml:"userLogin"` -} - -func init() { - t["UserPasswordChanged"] = reflect.TypeOf((*UserPasswordChanged)(nil)).Elem() -} - -type UserProfile struct { - ApplyProfile - - Key string `xml:"key"` -} - -func init() { - t["UserProfile"] = reflect.TypeOf((*UserProfile)(nil)).Elem() -} - -type UserSearchResult struct { - DynamicData - - Principal string `xml:"principal"` - FullName string `xml:"fullName,omitempty"` - Group bool `xml:"group"` -} - -func init() { - t["UserSearchResult"] = reflect.TypeOf((*UserSearchResult)(nil)).Elem() -} - -type UserSession struct { - DynamicData - - Key string `xml:"key"` - UserName string `xml:"userName"` - FullName string `xml:"fullName"` - LoginTime time.Time `xml:"loginTime"` - LastActiveTime time.Time `xml:"lastActiveTime"` - Locale string `xml:"locale"` - MessageLocale string `xml:"messageLocale"` - ExtensionSession *bool `xml:"extensionSession"` - IpAddress string `xml:"ipAddress,omitempty"` - UserAgent string `xml:"userAgent,omitempty"` - CallCount int64 `xml:"callCount,omitempty"` -} - -func init() { - t["UserSession"] = reflect.TypeOf((*UserSession)(nil)).Elem() -} - -type UserUnassignedFromGroup struct { - HostEvent - - UserLogin string `xml:"userLogin"` - Group string `xml:"group"` -} - -func init() { - t["UserUnassignedFromGroup"] = reflect.TypeOf((*UserUnassignedFromGroup)(nil)).Elem() -} - -type UserUpgradeEvent struct { - UpgradeEvent -} - -func init() { - t["UserUpgradeEvent"] = reflect.TypeOf((*UserUpgradeEvent)(nil)).Elem() -} - -type VAppCloneSpec struct { - DynamicData - - Location ManagedObjectReference `xml:"location"` - Host *ManagedObjectReference `xml:"host,omitempty"` - ResourceSpec *ResourceConfigSpec `xml:"resourceSpec,omitempty"` - VmFolder *ManagedObjectReference `xml:"vmFolder,omitempty"` - NetworkMapping []VAppCloneSpecNetworkMappingPair `xml:"networkMapping,omitempty"` - Property []KeyValue `xml:"property,omitempty"` - ResourceMapping []VAppCloneSpecResourceMap `xml:"resourceMapping,omitempty"` - Provisioning string `xml:"provisioning,omitempty"` -} - -func init() { - t["VAppCloneSpec"] = reflect.TypeOf((*VAppCloneSpec)(nil)).Elem() -} - -type VAppCloneSpecNetworkMappingPair struct { - DynamicData - - Source ManagedObjectReference `xml:"source"` - Destination ManagedObjectReference `xml:"destination"` -} - -func init() { - t["VAppCloneSpecNetworkMappingPair"] = reflect.TypeOf((*VAppCloneSpecNetworkMappingPair)(nil)).Elem() -} - -type VAppCloneSpecResourceMap struct { - DynamicData - - Source ManagedObjectReference `xml:"source"` - Parent *ManagedObjectReference `xml:"parent,omitempty"` - ResourceSpec *ResourceConfigSpec `xml:"resourceSpec,omitempty"` - Location *ManagedObjectReference `xml:"location,omitempty"` -} - -func init() { - t["VAppCloneSpecResourceMap"] = reflect.TypeOf((*VAppCloneSpecResourceMap)(nil)).Elem() -} - -type VAppConfigFault struct { - VimFault -} - -func init() { - t["VAppConfigFault"] = reflect.TypeOf((*VAppConfigFault)(nil)).Elem() -} - -type VAppConfigFaultFault BaseVAppConfigFault - -func init() { - t["VAppConfigFaultFault"] = reflect.TypeOf((*VAppConfigFaultFault)(nil)).Elem() -} - -type VAppConfigInfo struct { - VmConfigInfo - - EntityConfig []VAppEntityConfigInfo `xml:"entityConfig,omitempty"` - Annotation string `xml:"annotation"` - InstanceUuid string `xml:"instanceUuid,omitempty"` - ManagedBy *ManagedByInfo `xml:"managedBy,omitempty"` -} - -func init() { - t["VAppConfigInfo"] = reflect.TypeOf((*VAppConfigInfo)(nil)).Elem() -} - -type VAppConfigSpec struct { - VmConfigSpec - - EntityConfig []VAppEntityConfigInfo `xml:"entityConfig,omitempty"` - Annotation string `xml:"annotation,omitempty"` - InstanceUuid string `xml:"instanceUuid,omitempty"` - ManagedBy *ManagedByInfo `xml:"managedBy,omitempty"` -} - -func init() { - t["VAppConfigSpec"] = reflect.TypeOf((*VAppConfigSpec)(nil)).Elem() -} - -type VAppEntityConfigInfo struct { - DynamicData - - Key *ManagedObjectReference `xml:"key,omitempty"` - Tag string `xml:"tag,omitempty"` - StartOrder int `xml:"startOrder,omitempty"` - StartDelay int `xml:"startDelay,omitempty"` - WaitingForGuest *bool `xml:"waitingForGuest"` - StartAction string `xml:"startAction,omitempty"` - StopDelay int `xml:"stopDelay,omitempty"` - StopAction string `xml:"stopAction,omitempty"` - DestroyWithParent *bool `xml:"destroyWithParent"` -} - -func init() { - t["VAppEntityConfigInfo"] = reflect.TypeOf((*VAppEntityConfigInfo)(nil)).Elem() -} - -type VAppIPAssignmentInfo struct { - DynamicData - - SupportedAllocationScheme []string `xml:"supportedAllocationScheme,omitempty"` - IpAllocationPolicy string `xml:"ipAllocationPolicy,omitempty"` - SupportedIpProtocol []string `xml:"supportedIpProtocol,omitempty"` - IpProtocol string `xml:"ipProtocol,omitempty"` -} - -func init() { - t["VAppIPAssignmentInfo"] = reflect.TypeOf((*VAppIPAssignmentInfo)(nil)).Elem() -} - -type VAppNotRunning struct { - VmConfigFault -} - -func init() { - t["VAppNotRunning"] = reflect.TypeOf((*VAppNotRunning)(nil)).Elem() -} - -type VAppNotRunningFault VAppNotRunning - -func init() { - t["VAppNotRunningFault"] = reflect.TypeOf((*VAppNotRunningFault)(nil)).Elem() -} - -type VAppOperationInProgress struct { - RuntimeFault -} - -func init() { - t["VAppOperationInProgress"] = reflect.TypeOf((*VAppOperationInProgress)(nil)).Elem() -} - -type VAppOperationInProgressFault VAppOperationInProgress - -func init() { - t["VAppOperationInProgressFault"] = reflect.TypeOf((*VAppOperationInProgressFault)(nil)).Elem() -} - -type VAppOvfSectionInfo struct { - DynamicData - - Key int `xml:"key,omitempty"` - Namespace string `xml:"namespace,omitempty"` - Type string `xml:"type,omitempty"` - AtEnvelopeLevel *bool `xml:"atEnvelopeLevel"` - Contents string `xml:"contents,omitempty"` -} - -func init() { - t["VAppOvfSectionInfo"] = reflect.TypeOf((*VAppOvfSectionInfo)(nil)).Elem() -} - -type VAppOvfSectionSpec struct { - ArrayUpdateSpec - - Info *VAppOvfSectionInfo `xml:"info,omitempty"` -} - -func init() { - t["VAppOvfSectionSpec"] = reflect.TypeOf((*VAppOvfSectionSpec)(nil)).Elem() -} - -type VAppProductInfo struct { - DynamicData - - Key int `xml:"key"` - ClassId string `xml:"classId,omitempty"` - InstanceId string `xml:"instanceId,omitempty"` - Name string `xml:"name,omitempty"` - Vendor string `xml:"vendor,omitempty"` - Version string `xml:"version,omitempty"` - FullVersion string `xml:"fullVersion,omitempty"` - VendorUrl string `xml:"vendorUrl,omitempty"` - ProductUrl string `xml:"productUrl,omitempty"` - AppUrl string `xml:"appUrl,omitempty"` -} - -func init() { - t["VAppProductInfo"] = reflect.TypeOf((*VAppProductInfo)(nil)).Elem() -} - -type VAppProductSpec struct { - ArrayUpdateSpec - - Info *VAppProductInfo `xml:"info,omitempty"` -} - -func init() { - t["VAppProductSpec"] = reflect.TypeOf((*VAppProductSpec)(nil)).Elem() -} - -type VAppPropertyFault struct { - VmConfigFault - - Id string `xml:"id"` - Category string `xml:"category"` - Label string `xml:"label"` - Type string `xml:"type"` - Value string `xml:"value"` -} - -func init() { - t["VAppPropertyFault"] = reflect.TypeOf((*VAppPropertyFault)(nil)).Elem() -} - -type VAppPropertyFaultFault BaseVAppPropertyFault - -func init() { - t["VAppPropertyFaultFault"] = reflect.TypeOf((*VAppPropertyFaultFault)(nil)).Elem() -} - -type VAppPropertyInfo struct { - DynamicData - - Key int `xml:"key"` - ClassId string `xml:"classId,omitempty"` - InstanceId string `xml:"instanceId,omitempty"` - Id string `xml:"id,omitempty"` - Category string `xml:"category,omitempty"` - Label string `xml:"label,omitempty"` - Type string `xml:"type,omitempty"` - TypeReference string `xml:"typeReference,omitempty"` - UserConfigurable *bool `xml:"userConfigurable"` - DefaultValue string `xml:"defaultValue,omitempty"` - Value string `xml:"value,omitempty"` - Description string `xml:"description,omitempty"` -} - -func init() { - t["VAppPropertyInfo"] = reflect.TypeOf((*VAppPropertyInfo)(nil)).Elem() -} - -type VAppPropertySpec struct { - ArrayUpdateSpec - - Info *VAppPropertyInfo `xml:"info,omitempty"` -} - -func init() { - t["VAppPropertySpec"] = reflect.TypeOf((*VAppPropertySpec)(nil)).Elem() -} - -type VAppTaskInProgress struct { - TaskInProgress -} - -func init() { - t["VAppTaskInProgress"] = reflect.TypeOf((*VAppTaskInProgress)(nil)).Elem() -} - -type VAppTaskInProgressFault VAppTaskInProgress - -func init() { - t["VAppTaskInProgressFault"] = reflect.TypeOf((*VAppTaskInProgressFault)(nil)).Elem() -} - -type VFlashModuleNotSupported struct { - VmConfigFault - - VmName string `xml:"vmName"` - ModuleName string `xml:"moduleName"` - Reason string `xml:"reason"` - HostName string `xml:"hostName"` -} - -func init() { - t["VFlashModuleNotSupported"] = reflect.TypeOf((*VFlashModuleNotSupported)(nil)).Elem() -} - -type VFlashModuleNotSupportedFault VFlashModuleNotSupported - -func init() { - t["VFlashModuleNotSupportedFault"] = reflect.TypeOf((*VFlashModuleNotSupportedFault)(nil)).Elem() -} - -type VFlashModuleVersionIncompatible struct { - VimFault - - ModuleName string `xml:"moduleName"` - VmRequestModuleVersion string `xml:"vmRequestModuleVersion"` - HostMinSupportedVerson string `xml:"hostMinSupportedVerson"` - HostModuleVersion string `xml:"hostModuleVersion"` -} - -func init() { - t["VFlashModuleVersionIncompatible"] = reflect.TypeOf((*VFlashModuleVersionIncompatible)(nil)).Elem() -} - -type VFlashModuleVersionIncompatibleFault VFlashModuleVersionIncompatible - -func init() { - t["VFlashModuleVersionIncompatibleFault"] = reflect.TypeOf((*VFlashModuleVersionIncompatibleFault)(nil)).Elem() -} - -type VMFSDatastoreCreatedEvent struct { - HostEvent - - Datastore DatastoreEventArgument `xml:"datastore"` -} - -func init() { - t["VMFSDatastoreCreatedEvent"] = reflect.TypeOf((*VMFSDatastoreCreatedEvent)(nil)).Elem() -} - -type VMFSDatastoreExpandedEvent struct { - HostEvent - - Datastore DatastoreEventArgument `xml:"datastore"` -} - -func init() { - t["VMFSDatastoreExpandedEvent"] = reflect.TypeOf((*VMFSDatastoreExpandedEvent)(nil)).Elem() -} - -type VMFSDatastoreExtendedEvent struct { - HostEvent - - Datastore DatastoreEventArgument `xml:"datastore"` -} - -func init() { - t["VMFSDatastoreExtendedEvent"] = reflect.TypeOf((*VMFSDatastoreExtendedEvent)(nil)).Elem() -} - -type VMINotSupported struct { - DeviceNotSupported -} - -func init() { - t["VMINotSupported"] = reflect.TypeOf((*VMINotSupported)(nil)).Elem() -} - -type VMINotSupportedFault VMINotSupported - -func init() { - t["VMINotSupportedFault"] = reflect.TypeOf((*VMINotSupportedFault)(nil)).Elem() -} - -type VMOnConflictDVPort struct { - CannotAccessNetwork -} - -func init() { - t["VMOnConflictDVPort"] = reflect.TypeOf((*VMOnConflictDVPort)(nil)).Elem() -} - -type VMOnConflictDVPortFault VMOnConflictDVPort - -func init() { - t["VMOnConflictDVPortFault"] = reflect.TypeOf((*VMOnConflictDVPortFault)(nil)).Elem() -} - -type VMOnVirtualIntranet struct { - CannotAccessNetwork -} - -func init() { - t["VMOnVirtualIntranet"] = reflect.TypeOf((*VMOnVirtualIntranet)(nil)).Elem() -} - -type VMOnVirtualIntranetFault VMOnVirtualIntranet - -func init() { - t["VMOnVirtualIntranetFault"] = reflect.TypeOf((*VMOnVirtualIntranetFault)(nil)).Elem() -} - -type VMotionAcrossNetworkNotSupported struct { - MigrationFeatureNotSupported -} - -func init() { - t["VMotionAcrossNetworkNotSupported"] = reflect.TypeOf((*VMotionAcrossNetworkNotSupported)(nil)).Elem() -} - -type VMotionAcrossNetworkNotSupportedFault VMotionAcrossNetworkNotSupported - -func init() { - t["VMotionAcrossNetworkNotSupportedFault"] = reflect.TypeOf((*VMotionAcrossNetworkNotSupportedFault)(nil)).Elem() -} - -type VMotionInterfaceIssue struct { - MigrationFault - - AtSourceHost bool `xml:"atSourceHost"` - FailedHost string `xml:"failedHost"` - FailedHostEntity *ManagedObjectReference `xml:"failedHostEntity,omitempty"` -} - -func init() { - t["VMotionInterfaceIssue"] = reflect.TypeOf((*VMotionInterfaceIssue)(nil)).Elem() -} - -type VMotionInterfaceIssueFault BaseVMotionInterfaceIssue - -func init() { - t["VMotionInterfaceIssueFault"] = reflect.TypeOf((*VMotionInterfaceIssueFault)(nil)).Elem() -} - -type VMotionLicenseExpiredEvent struct { - LicenseEvent -} - -func init() { - t["VMotionLicenseExpiredEvent"] = reflect.TypeOf((*VMotionLicenseExpiredEvent)(nil)).Elem() -} - -type VMotionLinkCapacityLow struct { - VMotionInterfaceIssue - - Network string `xml:"network"` -} - -func init() { - t["VMotionLinkCapacityLow"] = reflect.TypeOf((*VMotionLinkCapacityLow)(nil)).Elem() -} - -type VMotionLinkCapacityLowFault VMotionLinkCapacityLow - -func init() { - t["VMotionLinkCapacityLowFault"] = reflect.TypeOf((*VMotionLinkCapacityLowFault)(nil)).Elem() -} - -type VMotionLinkDown struct { - VMotionInterfaceIssue - - Network string `xml:"network"` -} - -func init() { - t["VMotionLinkDown"] = reflect.TypeOf((*VMotionLinkDown)(nil)).Elem() -} - -type VMotionLinkDownFault VMotionLinkDown - -func init() { - t["VMotionLinkDownFault"] = reflect.TypeOf((*VMotionLinkDownFault)(nil)).Elem() -} - -type VMotionNotConfigured struct { - VMotionInterfaceIssue -} - -func init() { - t["VMotionNotConfigured"] = reflect.TypeOf((*VMotionNotConfigured)(nil)).Elem() -} - -type VMotionNotConfiguredFault VMotionNotConfigured - -func init() { - t["VMotionNotConfiguredFault"] = reflect.TypeOf((*VMotionNotConfiguredFault)(nil)).Elem() -} - -type VMotionNotLicensed struct { - VMotionInterfaceIssue -} - -func init() { - t["VMotionNotLicensed"] = reflect.TypeOf((*VMotionNotLicensed)(nil)).Elem() -} - -type VMotionNotLicensedFault VMotionNotLicensed - -func init() { - t["VMotionNotLicensedFault"] = reflect.TypeOf((*VMotionNotLicensedFault)(nil)).Elem() -} - -type VMotionNotSupported struct { - VMotionInterfaceIssue -} - -func init() { - t["VMotionNotSupported"] = reflect.TypeOf((*VMotionNotSupported)(nil)).Elem() -} - -type VMotionNotSupportedFault VMotionNotSupported - -func init() { - t["VMotionNotSupportedFault"] = reflect.TypeOf((*VMotionNotSupportedFault)(nil)).Elem() -} - -type VMotionProtocolIncompatible struct { - MigrationFault -} - -func init() { - t["VMotionProtocolIncompatible"] = reflect.TypeOf((*VMotionProtocolIncompatible)(nil)).Elem() -} - -type VMotionProtocolIncompatibleFault VMotionProtocolIncompatible - -func init() { - t["VMotionProtocolIncompatibleFault"] = reflect.TypeOf((*VMotionProtocolIncompatibleFault)(nil)).Elem() -} - -type VMwareDVSConfigInfo struct { - DVSConfigInfo - - VspanSession []VMwareVspanSession `xml:"vspanSession,omitempty"` - PvlanConfig []VMwareDVSPvlanMapEntry `xml:"pvlanConfig,omitempty"` - MaxMtu int `xml:"maxMtu"` - LinkDiscoveryProtocolConfig *LinkDiscoveryProtocolConfig `xml:"linkDiscoveryProtocolConfig,omitempty"` - IpfixConfig *VMwareIpfixConfig `xml:"ipfixConfig,omitempty"` - LacpGroupConfig []VMwareDvsLacpGroupConfig `xml:"lacpGroupConfig,omitempty"` - LacpApiVersion string `xml:"lacpApiVersion,omitempty"` -} - -func init() { - t["VMwareDVSConfigInfo"] = reflect.TypeOf((*VMwareDVSConfigInfo)(nil)).Elem() -} - -type VMwareDVSConfigSpec struct { - DVSConfigSpec - - PvlanConfigSpec []VMwareDVSPvlanConfigSpec `xml:"pvlanConfigSpec,omitempty"` - VspanConfigSpec []VMwareDVSVspanConfigSpec `xml:"vspanConfigSpec,omitempty"` - MaxMtu int `xml:"maxMtu,omitempty"` - LinkDiscoveryProtocolConfig *LinkDiscoveryProtocolConfig `xml:"linkDiscoveryProtocolConfig,omitempty"` - IpfixConfig *VMwareIpfixConfig `xml:"ipfixConfig,omitempty"` - LacpApiVersion string `xml:"lacpApiVersion,omitempty"` -} - -func init() { - t["VMwareDVSConfigSpec"] = reflect.TypeOf((*VMwareDVSConfigSpec)(nil)).Elem() -} - -type VMwareDVSFeatureCapability struct { - DVSFeatureCapability - - VspanSupported *bool `xml:"vspanSupported"` - LldpSupported *bool `xml:"lldpSupported"` - IpfixSupported *bool `xml:"ipfixSupported"` - VspanCapability *VMwareDVSVspanCapability `xml:"vspanCapability,omitempty"` - LacpCapability *VMwareDvsLacpCapability `xml:"lacpCapability,omitempty"` -} - -func init() { - t["VMwareDVSFeatureCapability"] = reflect.TypeOf((*VMwareDVSFeatureCapability)(nil)).Elem() -} - -type VMwareDVSHealthCheckCapability struct { - DVSHealthCheckCapability - - VlanMtuSupported bool `xml:"vlanMtuSupported"` - TeamingSupported bool `xml:"teamingSupported"` -} - -func init() { - t["VMwareDVSHealthCheckCapability"] = reflect.TypeOf((*VMwareDVSHealthCheckCapability)(nil)).Elem() -} - -type VMwareDVSHealthCheckConfig struct { - DVSHealthCheckConfig -} - -func init() { - t["VMwareDVSHealthCheckConfig"] = reflect.TypeOf((*VMwareDVSHealthCheckConfig)(nil)).Elem() -} - -type VMwareDVSMtuHealthCheckResult struct { - HostMemberUplinkHealthCheckResult - - MtuMismatch bool `xml:"mtuMismatch"` - VlanSupportSwitchMtu []NumericRange `xml:"vlanSupportSwitchMtu,omitempty"` - VlanNotSupportSwitchMtu []NumericRange `xml:"vlanNotSupportSwitchMtu,omitempty"` -} - -func init() { - t["VMwareDVSMtuHealthCheckResult"] = reflect.TypeOf((*VMwareDVSMtuHealthCheckResult)(nil)).Elem() -} - -type VMwareDVSPortSetting struct { - DVPortSetting - - Vlan BaseVmwareDistributedVirtualSwitchVlanSpec `xml:"vlan,omitempty,typeattr"` - QosTag *IntPolicy `xml:"qosTag,omitempty"` - UplinkTeamingPolicy *VmwareUplinkPortTeamingPolicy `xml:"uplinkTeamingPolicy,omitempty"` - SecurityPolicy *DVSSecurityPolicy `xml:"securityPolicy,omitempty"` - IpfixEnabled *BoolPolicy `xml:"ipfixEnabled,omitempty"` - TxUplink *BoolPolicy `xml:"txUplink,omitempty"` - LacpPolicy *VMwareUplinkLacpPolicy `xml:"lacpPolicy,omitempty"` -} - -func init() { - t["VMwareDVSPortSetting"] = reflect.TypeOf((*VMwareDVSPortSetting)(nil)).Elem() -} - -type VMwareDVSPortgroupPolicy struct { - DVPortgroupPolicy - - VlanOverrideAllowed bool `xml:"vlanOverrideAllowed"` - UplinkTeamingOverrideAllowed bool `xml:"uplinkTeamingOverrideAllowed"` - SecurityPolicyOverrideAllowed bool `xml:"securityPolicyOverrideAllowed"` - IpfixOverrideAllowed *bool `xml:"ipfixOverrideAllowed"` -} - -func init() { - t["VMwareDVSPortgroupPolicy"] = reflect.TypeOf((*VMwareDVSPortgroupPolicy)(nil)).Elem() -} - -type VMwareDVSPvlanConfigSpec struct { - DynamicData - - PvlanEntry VMwareDVSPvlanMapEntry `xml:"pvlanEntry"` - Operation string `xml:"operation"` -} - -func init() { - t["VMwareDVSPvlanConfigSpec"] = reflect.TypeOf((*VMwareDVSPvlanConfigSpec)(nil)).Elem() -} - -type VMwareDVSPvlanMapEntry struct { - DynamicData - - PrimaryVlanId int `xml:"primaryVlanId"` - SecondaryVlanId int `xml:"secondaryVlanId"` - PvlanType string `xml:"pvlanType"` -} - -func init() { - t["VMwareDVSPvlanMapEntry"] = reflect.TypeOf((*VMwareDVSPvlanMapEntry)(nil)).Elem() -} - -type VMwareDVSTeamingHealthCheckConfig struct { - VMwareDVSHealthCheckConfig -} - -func init() { - t["VMwareDVSTeamingHealthCheckConfig"] = reflect.TypeOf((*VMwareDVSTeamingHealthCheckConfig)(nil)).Elem() -} - -type VMwareDVSTeamingHealthCheckResult struct { - HostMemberHealthCheckResult - - TeamingStatus string `xml:"teamingStatus"` -} - -func init() { - t["VMwareDVSTeamingHealthCheckResult"] = reflect.TypeOf((*VMwareDVSTeamingHealthCheckResult)(nil)).Elem() -} - -type VMwareDVSVlanHealthCheckResult struct { - HostMemberUplinkHealthCheckResult - - TrunkedVlan []NumericRange `xml:"trunkedVlan,omitempty"` - UntrunkedVlan []NumericRange `xml:"untrunkedVlan,omitempty"` -} - -func init() { - t["VMwareDVSVlanHealthCheckResult"] = reflect.TypeOf((*VMwareDVSVlanHealthCheckResult)(nil)).Elem() -} - -type VMwareDVSVlanMtuHealthCheckConfig struct { - VMwareDVSHealthCheckConfig -} - -func init() { - t["VMwareDVSVlanMtuHealthCheckConfig"] = reflect.TypeOf((*VMwareDVSVlanMtuHealthCheckConfig)(nil)).Elem() -} - -type VMwareDVSVspanCapability struct { - DynamicData - - MixedDestSupported bool `xml:"mixedDestSupported"` - DvportSupported bool `xml:"dvportSupported"` - RemoteSourceSupported bool `xml:"remoteSourceSupported"` - RemoteDestSupported bool `xml:"remoteDestSupported"` - EncapRemoteSourceSupported bool `xml:"encapRemoteSourceSupported"` -} - -func init() { - t["VMwareDVSVspanCapability"] = reflect.TypeOf((*VMwareDVSVspanCapability)(nil)).Elem() -} - -type VMwareDVSVspanConfigSpec struct { - DynamicData - - VspanSession VMwareVspanSession `xml:"vspanSession"` - Operation string `xml:"operation"` -} - -func init() { - t["VMwareDVSVspanConfigSpec"] = reflect.TypeOf((*VMwareDVSVspanConfigSpec)(nil)).Elem() -} - -type VMwareDvsLacpCapability struct { - DynamicData - - LacpSupported *bool `xml:"lacpSupported"` - MultiLacpGroupSupported *bool `xml:"multiLacpGroupSupported"` -} - -func init() { - t["VMwareDvsLacpCapability"] = reflect.TypeOf((*VMwareDvsLacpCapability)(nil)).Elem() -} - -type VMwareDvsLacpGroupConfig struct { - DynamicData - - Key string `xml:"key,omitempty"` - Name string `xml:"name,omitempty"` - Mode string `xml:"mode,omitempty"` - UplinkNum int `xml:"uplinkNum,omitempty"` - LoadbalanceAlgorithm string `xml:"loadbalanceAlgorithm,omitempty"` - Vlan *VMwareDvsLagVlanConfig `xml:"vlan,omitempty"` - Ipfix *VMwareDvsLagIpfixConfig `xml:"ipfix,omitempty"` - UplinkName []string `xml:"uplinkName,omitempty"` - UplinkPortKey []string `xml:"uplinkPortKey,omitempty"` -} - -func init() { - t["VMwareDvsLacpGroupConfig"] = reflect.TypeOf((*VMwareDvsLacpGroupConfig)(nil)).Elem() -} - -type VMwareDvsLacpGroupSpec struct { - DynamicData - - LacpGroupConfig VMwareDvsLacpGroupConfig `xml:"lacpGroupConfig"` - Operation string `xml:"operation"` -} - -func init() { - t["VMwareDvsLacpGroupSpec"] = reflect.TypeOf((*VMwareDvsLacpGroupSpec)(nil)).Elem() -} - -type VMwareDvsLagIpfixConfig struct { - DynamicData - - IpfixEnabled *bool `xml:"ipfixEnabled"` -} - -func init() { - t["VMwareDvsLagIpfixConfig"] = reflect.TypeOf((*VMwareDvsLagIpfixConfig)(nil)).Elem() -} - -type VMwareDvsLagVlanConfig struct { - DynamicData - - VlanId []NumericRange `xml:"vlanId,omitempty"` -} - -func init() { - t["VMwareDvsLagVlanConfig"] = reflect.TypeOf((*VMwareDvsLagVlanConfig)(nil)).Elem() -} - -type VMwareIpfixConfig struct { - DynamicData - - CollectorIpAddress string `xml:"collectorIpAddress,omitempty"` - CollectorPort int `xml:"collectorPort,omitempty"` - ActiveFlowTimeout int `xml:"activeFlowTimeout"` - IdleFlowTimeout int `xml:"idleFlowTimeout"` - SamplingRate int `xml:"samplingRate"` - InternalFlowsOnly bool `xml:"internalFlowsOnly"` -} - -func init() { - t["VMwareIpfixConfig"] = reflect.TypeOf((*VMwareIpfixConfig)(nil)).Elem() -} - -type VMwareUplinkLacpPolicy struct { - InheritablePolicy - - Enable *BoolPolicy `xml:"enable,omitempty"` - Mode *StringPolicy `xml:"mode,omitempty"` -} - -func init() { - t["VMwareUplinkLacpPolicy"] = reflect.TypeOf((*VMwareUplinkLacpPolicy)(nil)).Elem() -} - -type VMwareUplinkPortOrderPolicy struct { - InheritablePolicy - - ActiveUplinkPort []string `xml:"activeUplinkPort,omitempty"` - StandbyUplinkPort []string `xml:"standbyUplinkPort,omitempty"` -} - -func init() { - t["VMwareUplinkPortOrderPolicy"] = reflect.TypeOf((*VMwareUplinkPortOrderPolicy)(nil)).Elem() -} - -type VMwareVspanPort struct { - DynamicData - - PortKey []string `xml:"portKey,omitempty"` - UplinkPortName []string `xml:"uplinkPortName,omitempty"` - WildcardPortConnecteeType []string `xml:"wildcardPortConnecteeType,omitempty"` - Vlans []int `xml:"vlans,omitempty"` - IpAddress []string `xml:"ipAddress,omitempty"` -} - -func init() { - t["VMwareVspanPort"] = reflect.TypeOf((*VMwareVspanPort)(nil)).Elem() -} - -type VMwareVspanSession struct { - DynamicData - - Key string `xml:"key,omitempty"` - Name string `xml:"name,omitempty"` - Description string `xml:"description,omitempty"` - Enabled bool `xml:"enabled"` - SourcePortTransmitted *VMwareVspanPort `xml:"sourcePortTransmitted,omitempty"` - SourcePortReceived *VMwareVspanPort `xml:"sourcePortReceived,omitempty"` - DestinationPort *VMwareVspanPort `xml:"destinationPort,omitempty"` - EncapsulationVlanId int `xml:"encapsulationVlanId,omitempty"` - StripOriginalVlan bool `xml:"stripOriginalVlan"` - MirroredPacketLength int `xml:"mirroredPacketLength,omitempty"` - NormalTrafficAllowed bool `xml:"normalTrafficAllowed"` - SessionType string `xml:"sessionType,omitempty"` - SamplingRate int `xml:"samplingRate,omitempty"` -} - -func init() { - t["VMwareVspanSession"] = reflect.TypeOf((*VMwareVspanSession)(nil)).Elem() -} - -type ValidateCredentialsInGuest ValidateCredentialsInGuestRequestType - -func init() { - t["ValidateCredentialsInGuest"] = reflect.TypeOf((*ValidateCredentialsInGuest)(nil)).Elem() -} - -type ValidateCredentialsInGuestRequestType struct { - This ManagedObjectReference `xml:"_this"` - Vm ManagedObjectReference `xml:"vm"` - Auth BaseGuestAuthentication `xml:"auth,typeattr"` -} - -func init() { - t["ValidateCredentialsInGuestRequestType"] = reflect.TypeOf((*ValidateCredentialsInGuestRequestType)(nil)).Elem() -} - -type ValidateCredentialsInGuestResponse struct { -} - -type ValidateHost ValidateHostRequestType - -func init() { - t["ValidateHost"] = reflect.TypeOf((*ValidateHost)(nil)).Elem() -} - -type ValidateHostRequestType struct { - This ManagedObjectReference `xml:"_this"` - OvfDescriptor string `xml:"ovfDescriptor"` - Host ManagedObjectReference `xml:"host"` - Vhp OvfValidateHostParams `xml:"vhp"` -} - -func init() { - t["ValidateHostRequestType"] = reflect.TypeOf((*ValidateHostRequestType)(nil)).Elem() -} - -type ValidateHostResponse struct { - Returnval OvfValidateHostResult `xml:"returnval"` -} - -type ValidateMigration ValidateMigrationRequestType - -func init() { - t["ValidateMigration"] = reflect.TypeOf((*ValidateMigration)(nil)).Elem() -} - -type ValidateMigrationRequestType struct { - This ManagedObjectReference `xml:"_this"` - Vm []ManagedObjectReference `xml:"vm"` - State VirtualMachinePowerState `xml:"state,omitempty"` - TestType []string `xml:"testType,omitempty"` - Pool *ManagedObjectReference `xml:"pool,omitempty"` - Host *ManagedObjectReference `xml:"host,omitempty"` -} - -func init() { - t["ValidateMigrationRequestType"] = reflect.TypeOf((*ValidateMigrationRequestType)(nil)).Elem() -} - -type ValidateMigrationResponse struct { - Returnval []BaseEvent `xml:"returnval,omitempty,typeattr"` -} - -type VcAgentUninstallFailedEvent struct { - HostEvent - - Reason string `xml:"reason,omitempty"` -} - -func init() { - t["VcAgentUninstallFailedEvent"] = reflect.TypeOf((*VcAgentUninstallFailedEvent)(nil)).Elem() -} - -type VcAgentUninstalledEvent struct { - HostEvent -} - -func init() { - t["VcAgentUninstalledEvent"] = reflect.TypeOf((*VcAgentUninstalledEvent)(nil)).Elem() -} - -type VcAgentUpgradeFailedEvent struct { - HostEvent - - Reason string `xml:"reason,omitempty"` -} - -func init() { - t["VcAgentUpgradeFailedEvent"] = reflect.TypeOf((*VcAgentUpgradeFailedEvent)(nil)).Elem() -} - -type VcAgentUpgradedEvent struct { - HostEvent -} - -func init() { - t["VcAgentUpgradedEvent"] = reflect.TypeOf((*VcAgentUpgradedEvent)(nil)).Elem() -} - -type VimAccountPasswordChangedEvent struct { - HostEvent -} - -func init() { - t["VimAccountPasswordChangedEvent"] = reflect.TypeOf((*VimAccountPasswordChangedEvent)(nil)).Elem() -} - -type VimFault struct { - MethodFault -} - -func init() { - t["VimFault"] = reflect.TypeOf((*VimFault)(nil)).Elem() -} - -type VimFaultFault BaseVimFault - -func init() { - t["VimFaultFault"] = reflect.TypeOf((*VimFaultFault)(nil)).Elem() -} - -type VirtualAHCIController struct { - VirtualSATAController -} - -func init() { - t["VirtualAHCIController"] = reflect.TypeOf((*VirtualAHCIController)(nil)).Elem() -} - -type VirtualAHCIControllerOption struct { - VirtualSATAControllerOption -} - -func init() { - t["VirtualAHCIControllerOption"] = reflect.TypeOf((*VirtualAHCIControllerOption)(nil)).Elem() -} - -type VirtualAppImportSpec struct { - ImportSpec - - Name string `xml:"name"` - VAppConfigSpec VAppConfigSpec `xml:"vAppConfigSpec"` - ResourcePoolSpec ResourceConfigSpec `xml:"resourcePoolSpec"` - Child []BaseImportSpec `xml:"child,omitempty,typeattr"` -} - -func init() { - t["VirtualAppImportSpec"] = reflect.TypeOf((*VirtualAppImportSpec)(nil)).Elem() -} - -type VirtualAppLinkInfo struct { - DynamicData - - Key ManagedObjectReference `xml:"key"` - DestroyWithParent *bool `xml:"destroyWithParent"` -} - -func init() { - t["VirtualAppLinkInfo"] = reflect.TypeOf((*VirtualAppLinkInfo)(nil)).Elem() -} - -type VirtualAppSummary struct { - ResourcePoolSummary - - Product *VAppProductInfo `xml:"product,omitempty"` - VAppState VirtualAppVAppState `xml:"vAppState,omitempty"` - Suspended *bool `xml:"suspended"` - InstallBootRequired *bool `xml:"installBootRequired"` - InstanceUuid string `xml:"instanceUuid,omitempty"` -} - -func init() { - t["VirtualAppSummary"] = reflect.TypeOf((*VirtualAppSummary)(nil)).Elem() -} - -type VirtualBusLogicController struct { - VirtualSCSIController -} - -func init() { - t["VirtualBusLogicController"] = reflect.TypeOf((*VirtualBusLogicController)(nil)).Elem() -} - -type VirtualBusLogicControllerOption struct { - VirtualSCSIControllerOption -} - -func init() { - t["VirtualBusLogicControllerOption"] = reflect.TypeOf((*VirtualBusLogicControllerOption)(nil)).Elem() -} - -type VirtualCdrom struct { - VirtualDevice -} - -func init() { - t["VirtualCdrom"] = reflect.TypeOf((*VirtualCdrom)(nil)).Elem() -} - -type VirtualCdromAtapiBackingInfo struct { - VirtualDeviceDeviceBackingInfo -} - -func init() { - t["VirtualCdromAtapiBackingInfo"] = reflect.TypeOf((*VirtualCdromAtapiBackingInfo)(nil)).Elem() -} - -type VirtualCdromAtapiBackingOption struct { - VirtualDeviceDeviceBackingOption -} - -func init() { - t["VirtualCdromAtapiBackingOption"] = reflect.TypeOf((*VirtualCdromAtapiBackingOption)(nil)).Elem() -} - -type VirtualCdromIsoBackingInfo struct { - VirtualDeviceFileBackingInfo -} - -func init() { - t["VirtualCdromIsoBackingInfo"] = reflect.TypeOf((*VirtualCdromIsoBackingInfo)(nil)).Elem() -} - -type VirtualCdromIsoBackingOption struct { - VirtualDeviceFileBackingOption -} - -func init() { - t["VirtualCdromIsoBackingOption"] = reflect.TypeOf((*VirtualCdromIsoBackingOption)(nil)).Elem() -} - -type VirtualCdromOption struct { - VirtualDeviceOption -} - -func init() { - t["VirtualCdromOption"] = reflect.TypeOf((*VirtualCdromOption)(nil)).Elem() -} - -type VirtualCdromPassthroughBackingInfo struct { - VirtualDeviceDeviceBackingInfo - - Exclusive bool `xml:"exclusive"` -} - -func init() { - t["VirtualCdromPassthroughBackingInfo"] = reflect.TypeOf((*VirtualCdromPassthroughBackingInfo)(nil)).Elem() -} - -type VirtualCdromPassthroughBackingOption struct { - VirtualDeviceDeviceBackingOption - - Exclusive BoolOption `xml:"exclusive"` -} - -func init() { - t["VirtualCdromPassthroughBackingOption"] = reflect.TypeOf((*VirtualCdromPassthroughBackingOption)(nil)).Elem() -} - -type VirtualCdromRemoteAtapiBackingInfo struct { - VirtualDeviceRemoteDeviceBackingInfo -} - -func init() { - t["VirtualCdromRemoteAtapiBackingInfo"] = reflect.TypeOf((*VirtualCdromRemoteAtapiBackingInfo)(nil)).Elem() -} - -type VirtualCdromRemoteAtapiBackingOption struct { - VirtualDeviceDeviceBackingOption -} - -func init() { - t["VirtualCdromRemoteAtapiBackingOption"] = reflect.TypeOf((*VirtualCdromRemoteAtapiBackingOption)(nil)).Elem() -} - -type VirtualCdromRemotePassthroughBackingInfo struct { - VirtualDeviceRemoteDeviceBackingInfo - - Exclusive bool `xml:"exclusive"` -} - -func init() { - t["VirtualCdromRemotePassthroughBackingInfo"] = reflect.TypeOf((*VirtualCdromRemotePassthroughBackingInfo)(nil)).Elem() -} - -type VirtualCdromRemotePassthroughBackingOption struct { - VirtualDeviceRemoteDeviceBackingOption - - Exclusive BoolOption `xml:"exclusive"` -} - -func init() { - t["VirtualCdromRemotePassthroughBackingOption"] = reflect.TypeOf((*VirtualCdromRemotePassthroughBackingOption)(nil)).Elem() -} - -type VirtualController struct { - VirtualDevice - - BusNumber int `xml:"busNumber"` - Device []int `xml:"device,omitempty"` -} - -func init() { - t["VirtualController"] = reflect.TypeOf((*VirtualController)(nil)).Elem() -} - -type VirtualControllerOption struct { - VirtualDeviceOption - - Devices IntOption `xml:"devices"` - SupportedDevice []string `xml:"supportedDevice,omitempty"` -} - -func init() { - t["VirtualControllerOption"] = reflect.TypeOf((*VirtualControllerOption)(nil)).Elem() -} - -type VirtualDevice struct { - DynamicData - - Key int `xml:"key"` - DeviceInfo BaseDescription `xml:"deviceInfo,omitempty,typeattr"` - Backing BaseVirtualDeviceBackingInfo `xml:"backing,omitempty,typeattr"` - Connectable *VirtualDeviceConnectInfo `xml:"connectable,omitempty"` - SlotInfo BaseVirtualDeviceBusSlotInfo `xml:"slotInfo,omitempty,typeattr"` - ControllerKey int `xml:"controllerKey,omitempty"` - UnitNumber int `xml:"unitNumber,omitempty"` -} - -func init() { - t["VirtualDevice"] = reflect.TypeOf((*VirtualDevice)(nil)).Elem() -} - -type VirtualDeviceBackingInfo struct { - DynamicData -} - -func init() { - t["VirtualDeviceBackingInfo"] = reflect.TypeOf((*VirtualDeviceBackingInfo)(nil)).Elem() -} - -type VirtualDeviceBackingOption struct { - DynamicData - - Type string `xml:"type"` -} - -func init() { - t["VirtualDeviceBackingOption"] = reflect.TypeOf((*VirtualDeviceBackingOption)(nil)).Elem() -} - -type VirtualDeviceBusSlotInfo struct { - DynamicData -} - -func init() { - t["VirtualDeviceBusSlotInfo"] = reflect.TypeOf((*VirtualDeviceBusSlotInfo)(nil)).Elem() -} - -type VirtualDeviceBusSlotOption struct { - DynamicData - - Type string `xml:"type"` -} - -func init() { - t["VirtualDeviceBusSlotOption"] = reflect.TypeOf((*VirtualDeviceBusSlotOption)(nil)).Elem() -} - -type VirtualDeviceConfigSpec struct { - DynamicData - - Operation VirtualDeviceConfigSpecOperation `xml:"operation,omitempty"` - FileOperation VirtualDeviceConfigSpecFileOperation `xml:"fileOperation,omitempty"` - Device BaseVirtualDevice `xml:"device,typeattr"` - Profile []BaseVirtualMachineProfileSpec `xml:"profile,omitempty,typeattr"` -} - -func init() { - t["VirtualDeviceConfigSpec"] = reflect.TypeOf((*VirtualDeviceConfigSpec)(nil)).Elem() -} - -type VirtualDeviceConnectInfo struct { - DynamicData - - StartConnected bool `xml:"startConnected"` - AllowGuestControl bool `xml:"allowGuestControl"` - Connected bool `xml:"connected"` - Status string `xml:"status,omitempty"` -} - -func init() { - t["VirtualDeviceConnectInfo"] = reflect.TypeOf((*VirtualDeviceConnectInfo)(nil)).Elem() -} - -type VirtualDeviceConnectOption struct { - DynamicData - - StartConnected BoolOption `xml:"startConnected"` - AllowGuestControl BoolOption `xml:"allowGuestControl"` -} - -func init() { - t["VirtualDeviceConnectOption"] = reflect.TypeOf((*VirtualDeviceConnectOption)(nil)).Elem() -} - -type VirtualDeviceDeviceBackingInfo struct { - VirtualDeviceBackingInfo - - DeviceName string `xml:"deviceName"` - UseAutoDetect *bool `xml:"useAutoDetect"` -} - -func init() { - t["VirtualDeviceDeviceBackingInfo"] = reflect.TypeOf((*VirtualDeviceDeviceBackingInfo)(nil)).Elem() -} - -type VirtualDeviceDeviceBackingOption struct { - VirtualDeviceBackingOption - - AutoDetectAvailable BoolOption `xml:"autoDetectAvailable"` -} - -func init() { - t["VirtualDeviceDeviceBackingOption"] = reflect.TypeOf((*VirtualDeviceDeviceBackingOption)(nil)).Elem() -} - -type VirtualDeviceFileBackingInfo struct { - VirtualDeviceBackingInfo - - FileName string `xml:"fileName"` - Datastore *ManagedObjectReference `xml:"datastore,omitempty"` - BackingObjectId string `xml:"backingObjectId,omitempty"` -} - -func init() { - t["VirtualDeviceFileBackingInfo"] = reflect.TypeOf((*VirtualDeviceFileBackingInfo)(nil)).Elem() -} - -type VirtualDeviceFileBackingOption struct { - VirtualDeviceBackingOption - - FileNameExtensions *ChoiceOption `xml:"fileNameExtensions,omitempty"` -} - -func init() { - t["VirtualDeviceFileBackingOption"] = reflect.TypeOf((*VirtualDeviceFileBackingOption)(nil)).Elem() -} - -type VirtualDeviceOption struct { - DynamicData - - Type string `xml:"type"` - ConnectOption *VirtualDeviceConnectOption `xml:"connectOption,omitempty"` - BusSlotOption *VirtualDeviceBusSlotOption `xml:"busSlotOption,omitempty"` - ControllerType string `xml:"controllerType,omitempty"` - AutoAssignController *BoolOption `xml:"autoAssignController,omitempty"` - BackingOption []BaseVirtualDeviceBackingOption `xml:"backingOption,omitempty,typeattr"` - DefaultBackingOptionIndex int `xml:"defaultBackingOptionIndex,omitempty"` - LicensingLimit []string `xml:"licensingLimit,omitempty"` - Deprecated bool `xml:"deprecated"` - PlugAndPlay bool `xml:"plugAndPlay"` - HotRemoveSupported *bool `xml:"hotRemoveSupported"` -} - -func init() { - t["VirtualDeviceOption"] = reflect.TypeOf((*VirtualDeviceOption)(nil)).Elem() -} - -type VirtualDevicePciBusSlotInfo struct { - VirtualDeviceBusSlotInfo - - PciSlotNumber int `xml:"pciSlotNumber"` -} - -func init() { - t["VirtualDevicePciBusSlotInfo"] = reflect.TypeOf((*VirtualDevicePciBusSlotInfo)(nil)).Elem() -} - -type VirtualDevicePipeBackingInfo struct { - VirtualDeviceBackingInfo - - PipeName string `xml:"pipeName"` -} - -func init() { - t["VirtualDevicePipeBackingInfo"] = reflect.TypeOf((*VirtualDevicePipeBackingInfo)(nil)).Elem() -} - -type VirtualDevicePipeBackingOption struct { - VirtualDeviceBackingOption -} - -func init() { - t["VirtualDevicePipeBackingOption"] = reflect.TypeOf((*VirtualDevicePipeBackingOption)(nil)).Elem() -} - -type VirtualDeviceRemoteDeviceBackingInfo struct { - VirtualDeviceBackingInfo - - DeviceName string `xml:"deviceName"` - UseAutoDetect *bool `xml:"useAutoDetect"` -} - -func init() { - t["VirtualDeviceRemoteDeviceBackingInfo"] = reflect.TypeOf((*VirtualDeviceRemoteDeviceBackingInfo)(nil)).Elem() -} - -type VirtualDeviceRemoteDeviceBackingOption struct { - VirtualDeviceBackingOption - - AutoDetectAvailable BoolOption `xml:"autoDetectAvailable"` -} - -func init() { - t["VirtualDeviceRemoteDeviceBackingOption"] = reflect.TypeOf((*VirtualDeviceRemoteDeviceBackingOption)(nil)).Elem() -} - -type VirtualDeviceURIBackingInfo struct { - VirtualDeviceBackingInfo - - ServiceURI string `xml:"serviceURI"` - Direction string `xml:"direction"` - ProxyURI string `xml:"proxyURI,omitempty"` -} - -func init() { - t["VirtualDeviceURIBackingInfo"] = reflect.TypeOf((*VirtualDeviceURIBackingInfo)(nil)).Elem() -} - -type VirtualDeviceURIBackingOption struct { - VirtualDeviceBackingOption - - Directions ChoiceOption `xml:"directions"` -} - -func init() { - t["VirtualDeviceURIBackingOption"] = reflect.TypeOf((*VirtualDeviceURIBackingOption)(nil)).Elem() -} - -type VirtualDisk struct { - VirtualDevice - - CapacityInKB int64 `xml:"capacityInKB"` - CapacityInBytes int64 `xml:"capacityInBytes,omitempty"` - Shares *SharesInfo `xml:"shares,omitempty"` - StorageIOAllocation *StorageIOAllocationInfo `xml:"storageIOAllocation,omitempty"` - DiskObjectId string `xml:"diskObjectId,omitempty"` - VFlashCacheConfigInfo *VirtualDiskVFlashCacheConfigInfo `xml:"vFlashCacheConfigInfo,omitempty"` -} - -func init() { - t["VirtualDisk"] = reflect.TypeOf((*VirtualDisk)(nil)).Elem() -} - -type VirtualDiskAntiAffinityRuleSpec struct { - ClusterRuleInfo - - DiskId []int `xml:"diskId"` -} - -func init() { - t["VirtualDiskAntiAffinityRuleSpec"] = reflect.TypeOf((*VirtualDiskAntiAffinityRuleSpec)(nil)).Elem() -} - -type VirtualDiskBlocksNotFullyProvisioned struct { - DeviceBackingNotSupported -} - -func init() { - t["VirtualDiskBlocksNotFullyProvisioned"] = reflect.TypeOf((*VirtualDiskBlocksNotFullyProvisioned)(nil)).Elem() -} - -type VirtualDiskBlocksNotFullyProvisionedFault VirtualDiskBlocksNotFullyProvisioned - -func init() { - t["VirtualDiskBlocksNotFullyProvisionedFault"] = reflect.TypeOf((*VirtualDiskBlocksNotFullyProvisionedFault)(nil)).Elem() -} - -type VirtualDiskConfigSpec struct { - VirtualDeviceConfigSpec - - MigrateCache *bool `xml:"migrateCache"` -} - -func init() { - t["VirtualDiskConfigSpec"] = reflect.TypeOf((*VirtualDiskConfigSpec)(nil)).Elem() -} - -type VirtualDiskDeltaDiskFormatsSupported struct { - DynamicData - - DatastoreType string `xml:"datastoreType"` - DeltaDiskFormat ChoiceOption `xml:"deltaDiskFormat"` -} - -func init() { - t["VirtualDiskDeltaDiskFormatsSupported"] = reflect.TypeOf((*VirtualDiskDeltaDiskFormatsSupported)(nil)).Elem() -} - -type VirtualDiskFlatVer1BackingInfo struct { - VirtualDeviceFileBackingInfo - - DiskMode string `xml:"diskMode"` - Split *bool `xml:"split"` - WriteThrough *bool `xml:"writeThrough"` - ContentId string `xml:"contentId,omitempty"` - Parent *VirtualDiskFlatVer1BackingInfo `xml:"parent,omitempty"` -} - -func init() { - t["VirtualDiskFlatVer1BackingInfo"] = reflect.TypeOf((*VirtualDiskFlatVer1BackingInfo)(nil)).Elem() -} - -type VirtualDiskFlatVer1BackingOption struct { - VirtualDeviceFileBackingOption - - DiskMode ChoiceOption `xml:"diskMode"` - Split BoolOption `xml:"split"` - WriteThrough BoolOption `xml:"writeThrough"` - Growable bool `xml:"growable"` -} - -func init() { - t["VirtualDiskFlatVer1BackingOption"] = reflect.TypeOf((*VirtualDiskFlatVer1BackingOption)(nil)).Elem() -} - -type VirtualDiskFlatVer2BackingInfo struct { - VirtualDeviceFileBackingInfo - - DiskMode string `xml:"diskMode"` - Split *bool `xml:"split"` - WriteThrough *bool `xml:"writeThrough"` - ThinProvisioned *bool `xml:"thinProvisioned"` - EagerlyScrub *bool `xml:"eagerlyScrub"` - Uuid string `xml:"uuid,omitempty"` - ContentId string `xml:"contentId,omitempty"` - ChangeId string `xml:"changeId,omitempty"` - Parent *VirtualDiskFlatVer2BackingInfo `xml:"parent,omitempty"` - DeltaDiskFormat string `xml:"deltaDiskFormat,omitempty"` - DigestEnabled *bool `xml:"digestEnabled"` - DeltaGrainSize int `xml:"deltaGrainSize,omitempty"` -} - -func init() { - t["VirtualDiskFlatVer2BackingInfo"] = reflect.TypeOf((*VirtualDiskFlatVer2BackingInfo)(nil)).Elem() -} - -type VirtualDiskFlatVer2BackingOption struct { - VirtualDeviceFileBackingOption - - DiskMode ChoiceOption `xml:"diskMode"` - Split BoolOption `xml:"split"` - WriteThrough BoolOption `xml:"writeThrough"` - Growable bool `xml:"growable"` - HotGrowable bool `xml:"hotGrowable"` - Uuid bool `xml:"uuid"` - ThinProvisioned *BoolOption `xml:"thinProvisioned,omitempty"` - EagerlyScrub *BoolOption `xml:"eagerlyScrub,omitempty"` - DeltaDiskFormat *ChoiceOption `xml:"deltaDiskFormat,omitempty"` - DeltaDiskFormatsSupported []VirtualDiskDeltaDiskFormatsSupported `xml:"deltaDiskFormatsSupported,omitempty"` -} - -func init() { - t["VirtualDiskFlatVer2BackingOption"] = reflect.TypeOf((*VirtualDiskFlatVer2BackingOption)(nil)).Elem() -} - -type VirtualDiskId struct { - DynamicData - - Vm ManagedObjectReference `xml:"vm"` - DiskId int `xml:"diskId"` -} - -func init() { - t["VirtualDiskId"] = reflect.TypeOf((*VirtualDiskId)(nil)).Elem() -} - -type VirtualDiskModeNotSupported struct { - DeviceNotSupported - - Mode string `xml:"mode"` -} - -func init() { - t["VirtualDiskModeNotSupported"] = reflect.TypeOf((*VirtualDiskModeNotSupported)(nil)).Elem() -} - -type VirtualDiskModeNotSupportedFault VirtualDiskModeNotSupported - -func init() { - t["VirtualDiskModeNotSupportedFault"] = reflect.TypeOf((*VirtualDiskModeNotSupportedFault)(nil)).Elem() -} - -type VirtualDiskOption struct { - VirtualDeviceOption - - CapacityInKB LongOption `xml:"capacityInKB"` - IoAllocationOption *StorageIOAllocationOption `xml:"ioAllocationOption,omitempty"` - VFlashCacheConfigOption *VirtualDiskOptionVFlashCacheConfigOption `xml:"vFlashCacheConfigOption,omitempty"` -} - -func init() { - t["VirtualDiskOption"] = reflect.TypeOf((*VirtualDiskOption)(nil)).Elem() -} - -type VirtualDiskOptionVFlashCacheConfigOption struct { - DynamicData - - CacheConsistencyType ChoiceOption `xml:"cacheConsistencyType"` - CacheMode ChoiceOption `xml:"cacheMode"` - ReservationInMB LongOption `xml:"reservationInMB"` - BlockSizeInKB LongOption `xml:"blockSizeInKB"` -} - -func init() { - t["VirtualDiskOptionVFlashCacheConfigOption"] = reflect.TypeOf((*VirtualDiskOptionVFlashCacheConfigOption)(nil)).Elem() -} - -type VirtualDiskPartitionedRawDiskVer2BackingInfo struct { - VirtualDiskRawDiskVer2BackingInfo - - Partition []int `xml:"partition"` -} - -func init() { - t["VirtualDiskPartitionedRawDiskVer2BackingInfo"] = reflect.TypeOf((*VirtualDiskPartitionedRawDiskVer2BackingInfo)(nil)).Elem() -} - -type VirtualDiskPartitionedRawDiskVer2BackingOption struct { - VirtualDiskRawDiskVer2BackingOption -} - -func init() { - t["VirtualDiskPartitionedRawDiskVer2BackingOption"] = reflect.TypeOf((*VirtualDiskPartitionedRawDiskVer2BackingOption)(nil)).Elem() -} - -type VirtualDiskRawDiskMappingVer1BackingInfo struct { - VirtualDeviceFileBackingInfo - - LunUuid string `xml:"lunUuid,omitempty"` - DeviceName string `xml:"deviceName,omitempty"` - CompatibilityMode string `xml:"compatibilityMode,omitempty"` - DiskMode string `xml:"diskMode,omitempty"` - Uuid string `xml:"uuid,omitempty"` - ContentId string `xml:"contentId,omitempty"` - ChangeId string `xml:"changeId,omitempty"` - Parent *VirtualDiskRawDiskMappingVer1BackingInfo `xml:"parent,omitempty"` -} - -func init() { - t["VirtualDiskRawDiskMappingVer1BackingInfo"] = reflect.TypeOf((*VirtualDiskRawDiskMappingVer1BackingInfo)(nil)).Elem() -} - -type VirtualDiskRawDiskMappingVer1BackingOption struct { - VirtualDeviceDeviceBackingOption - - DescriptorFileNameExtensions *ChoiceOption `xml:"descriptorFileNameExtensions,omitempty"` - CompatibilityMode ChoiceOption `xml:"compatibilityMode"` - DiskMode ChoiceOption `xml:"diskMode"` - Uuid bool `xml:"uuid"` -} - -func init() { - t["VirtualDiskRawDiskMappingVer1BackingOption"] = reflect.TypeOf((*VirtualDiskRawDiskMappingVer1BackingOption)(nil)).Elem() -} - -type VirtualDiskRawDiskVer2BackingInfo struct { - VirtualDeviceDeviceBackingInfo - - DescriptorFileName string `xml:"descriptorFileName"` - Uuid string `xml:"uuid,omitempty"` - ChangeId string `xml:"changeId,omitempty"` -} - -func init() { - t["VirtualDiskRawDiskVer2BackingInfo"] = reflect.TypeOf((*VirtualDiskRawDiskVer2BackingInfo)(nil)).Elem() -} - -type VirtualDiskRawDiskVer2BackingOption struct { - VirtualDeviceDeviceBackingOption - - DescriptorFileNameExtensions ChoiceOption `xml:"descriptorFileNameExtensions"` - Uuid bool `xml:"uuid"` -} - -func init() { - t["VirtualDiskRawDiskVer2BackingOption"] = reflect.TypeOf((*VirtualDiskRawDiskVer2BackingOption)(nil)).Elem() -} - -type VirtualDiskSeSparseBackingInfo struct { - VirtualDeviceFileBackingInfo - - DiskMode string `xml:"diskMode"` - WriteThrough *bool `xml:"writeThrough"` - Uuid string `xml:"uuid,omitempty"` - ContentId string `xml:"contentId,omitempty"` - ChangeId string `xml:"changeId,omitempty"` - Parent *VirtualDiskSeSparseBackingInfo `xml:"parent,omitempty"` - DeltaDiskFormat string `xml:"deltaDiskFormat,omitempty"` - DigestEnabled *bool `xml:"digestEnabled"` - GrainSize int `xml:"grainSize,omitempty"` -} - -func init() { - t["VirtualDiskSeSparseBackingInfo"] = reflect.TypeOf((*VirtualDiskSeSparseBackingInfo)(nil)).Elem() -} - -type VirtualDiskSeSparseBackingOption struct { - VirtualDeviceFileBackingOption - - DiskMode ChoiceOption `xml:"diskMode"` - WriteThrough BoolOption `xml:"writeThrough"` - Growable bool `xml:"growable"` - HotGrowable bool `xml:"hotGrowable"` - Uuid bool `xml:"uuid"` - DeltaDiskFormatsSupported []VirtualDiskDeltaDiskFormatsSupported `xml:"deltaDiskFormatsSupported"` -} - -func init() { - t["VirtualDiskSeSparseBackingOption"] = reflect.TypeOf((*VirtualDiskSeSparseBackingOption)(nil)).Elem() -} - -type VirtualDiskSparseVer1BackingInfo struct { - VirtualDeviceFileBackingInfo - - DiskMode string `xml:"diskMode"` - Split *bool `xml:"split"` - WriteThrough *bool `xml:"writeThrough"` - SpaceUsedInKB int64 `xml:"spaceUsedInKB,omitempty"` - ContentId string `xml:"contentId,omitempty"` - Parent *VirtualDiskSparseVer1BackingInfo `xml:"parent,omitempty"` -} - -func init() { - t["VirtualDiskSparseVer1BackingInfo"] = reflect.TypeOf((*VirtualDiskSparseVer1BackingInfo)(nil)).Elem() -} - -type VirtualDiskSparseVer1BackingOption struct { - VirtualDeviceFileBackingOption - - DiskModes ChoiceOption `xml:"diskModes"` - Split BoolOption `xml:"split"` - WriteThrough BoolOption `xml:"writeThrough"` - Growable bool `xml:"growable"` -} - -func init() { - t["VirtualDiskSparseVer1BackingOption"] = reflect.TypeOf((*VirtualDiskSparseVer1BackingOption)(nil)).Elem() -} - -type VirtualDiskSparseVer2BackingInfo struct { - VirtualDeviceFileBackingInfo - - DiskMode string `xml:"diskMode"` - Split *bool `xml:"split"` - WriteThrough *bool `xml:"writeThrough"` - SpaceUsedInKB int64 `xml:"spaceUsedInKB,omitempty"` - Uuid string `xml:"uuid,omitempty"` - ContentId string `xml:"contentId,omitempty"` - ChangeId string `xml:"changeId,omitempty"` - Parent *VirtualDiskSparseVer2BackingInfo `xml:"parent,omitempty"` -} - -func init() { - t["VirtualDiskSparseVer2BackingInfo"] = reflect.TypeOf((*VirtualDiskSparseVer2BackingInfo)(nil)).Elem() -} - -type VirtualDiskSparseVer2BackingOption struct { - VirtualDeviceFileBackingOption - - DiskMode ChoiceOption `xml:"diskMode"` - Split BoolOption `xml:"split"` - WriteThrough BoolOption `xml:"writeThrough"` - Growable bool `xml:"growable"` - HotGrowable bool `xml:"hotGrowable"` - Uuid bool `xml:"uuid"` -} - -func init() { - t["VirtualDiskSparseVer2BackingOption"] = reflect.TypeOf((*VirtualDiskSparseVer2BackingOption)(nil)).Elem() -} - -type VirtualDiskSpec struct { - DynamicData - - DiskType string `xml:"diskType"` - AdapterType string `xml:"adapterType"` -} - -func init() { - t["VirtualDiskSpec"] = reflect.TypeOf((*VirtualDiskSpec)(nil)).Elem() -} - -type VirtualDiskVFlashCacheConfigInfo struct { - DynamicData - - VFlashModule string `xml:"vFlashModule,omitempty"` - ReservationInMB int64 `xml:"reservationInMB,omitempty"` - CacheConsistencyType string `xml:"cacheConsistencyType,omitempty"` - CacheMode string `xml:"cacheMode,omitempty"` - BlockSizeInKB int64 `xml:"blockSizeInKB,omitempty"` -} - -func init() { - t["VirtualDiskVFlashCacheConfigInfo"] = reflect.TypeOf((*VirtualDiskVFlashCacheConfigInfo)(nil)).Elem() -} - -type VirtualE1000 struct { - VirtualEthernetCard -} - -func init() { - t["VirtualE1000"] = reflect.TypeOf((*VirtualE1000)(nil)).Elem() -} - -type VirtualE1000Option struct { - VirtualEthernetCardOption -} - -func init() { - t["VirtualE1000Option"] = reflect.TypeOf((*VirtualE1000Option)(nil)).Elem() -} - -type VirtualE1000e struct { - VirtualEthernetCard -} - -func init() { - t["VirtualE1000e"] = reflect.TypeOf((*VirtualE1000e)(nil)).Elem() -} - -type VirtualE1000eOption struct { - VirtualEthernetCardOption -} - -func init() { - t["VirtualE1000eOption"] = reflect.TypeOf((*VirtualE1000eOption)(nil)).Elem() -} - -type VirtualEnsoniq1371 struct { - VirtualSoundCard -} - -func init() { - t["VirtualEnsoniq1371"] = reflect.TypeOf((*VirtualEnsoniq1371)(nil)).Elem() -} - -type VirtualEnsoniq1371Option struct { - VirtualSoundCardOption -} - -func init() { - t["VirtualEnsoniq1371Option"] = reflect.TypeOf((*VirtualEnsoniq1371Option)(nil)).Elem() -} - -type VirtualEthernetCard struct { - VirtualDevice - - AddressType string `xml:"addressType,omitempty"` - MacAddress string `xml:"macAddress,omitempty"` - WakeOnLanEnabled *bool `xml:"wakeOnLanEnabled"` -} - -func init() { - t["VirtualEthernetCard"] = reflect.TypeOf((*VirtualEthernetCard)(nil)).Elem() -} - -type VirtualEthernetCardDVPortBackingOption struct { - VirtualDeviceBackingOption -} - -func init() { - t["VirtualEthernetCardDVPortBackingOption"] = reflect.TypeOf((*VirtualEthernetCardDVPortBackingOption)(nil)).Elem() -} - -type VirtualEthernetCardDistributedVirtualPortBackingInfo struct { - VirtualDeviceBackingInfo - - Port DistributedVirtualSwitchPortConnection `xml:"port"` -} - -func init() { - t["VirtualEthernetCardDistributedVirtualPortBackingInfo"] = reflect.TypeOf((*VirtualEthernetCardDistributedVirtualPortBackingInfo)(nil)).Elem() -} - -type VirtualEthernetCardLegacyNetworkBackingInfo struct { - VirtualDeviceDeviceBackingInfo -} - -func init() { - t["VirtualEthernetCardLegacyNetworkBackingInfo"] = reflect.TypeOf((*VirtualEthernetCardLegacyNetworkBackingInfo)(nil)).Elem() -} - -type VirtualEthernetCardLegacyNetworkBackingOption struct { - VirtualDeviceDeviceBackingOption -} - -func init() { - t["VirtualEthernetCardLegacyNetworkBackingOption"] = reflect.TypeOf((*VirtualEthernetCardLegacyNetworkBackingOption)(nil)).Elem() -} - -type VirtualEthernetCardNetworkBackingInfo struct { - VirtualDeviceDeviceBackingInfo - - Network *ManagedObjectReference `xml:"network,omitempty"` - InPassthroughMode *bool `xml:"inPassthroughMode"` -} - -func init() { - t["VirtualEthernetCardNetworkBackingInfo"] = reflect.TypeOf((*VirtualEthernetCardNetworkBackingInfo)(nil)).Elem() -} - -type VirtualEthernetCardNetworkBackingOption struct { - VirtualDeviceDeviceBackingOption -} - -func init() { - t["VirtualEthernetCardNetworkBackingOption"] = reflect.TypeOf((*VirtualEthernetCardNetworkBackingOption)(nil)).Elem() -} - -type VirtualEthernetCardNotSupported struct { - DeviceNotSupported -} - -func init() { - t["VirtualEthernetCardNotSupported"] = reflect.TypeOf((*VirtualEthernetCardNotSupported)(nil)).Elem() -} - -type VirtualEthernetCardNotSupportedFault VirtualEthernetCardNotSupported - -func init() { - t["VirtualEthernetCardNotSupportedFault"] = reflect.TypeOf((*VirtualEthernetCardNotSupportedFault)(nil)).Elem() -} - -type VirtualEthernetCardOpaqueNetworkBackingInfo struct { - VirtualDeviceBackingInfo - - OpaqueNetworkId string `xml:"opaqueNetworkId"` - OpaqueNetworkType string `xml:"opaqueNetworkType"` -} - -func init() { - t["VirtualEthernetCardOpaqueNetworkBackingInfo"] = reflect.TypeOf((*VirtualEthernetCardOpaqueNetworkBackingInfo)(nil)).Elem() -} - -type VirtualEthernetCardOpaqueNetworkBackingOption struct { - VirtualDeviceBackingOption -} - -func init() { - t["VirtualEthernetCardOpaqueNetworkBackingOption"] = reflect.TypeOf((*VirtualEthernetCardOpaqueNetworkBackingOption)(nil)).Elem() -} - -type VirtualEthernetCardOption struct { - VirtualDeviceOption - - SupportedOUI ChoiceOption `xml:"supportedOUI"` - MacType ChoiceOption `xml:"macType"` - WakeOnLanEnabled BoolOption `xml:"wakeOnLanEnabled"` - VmDirectPathGen2Supported *bool `xml:"vmDirectPathGen2Supported"` -} - -func init() { - t["VirtualEthernetCardOption"] = reflect.TypeOf((*VirtualEthernetCardOption)(nil)).Elem() -} - -type VirtualFloppy struct { - VirtualDevice -} - -func init() { - t["VirtualFloppy"] = reflect.TypeOf((*VirtualFloppy)(nil)).Elem() -} - -type VirtualFloppyDeviceBackingInfo struct { - VirtualDeviceDeviceBackingInfo -} - -func init() { - t["VirtualFloppyDeviceBackingInfo"] = reflect.TypeOf((*VirtualFloppyDeviceBackingInfo)(nil)).Elem() -} - -type VirtualFloppyDeviceBackingOption struct { - VirtualDeviceDeviceBackingOption -} - -func init() { - t["VirtualFloppyDeviceBackingOption"] = reflect.TypeOf((*VirtualFloppyDeviceBackingOption)(nil)).Elem() -} - -type VirtualFloppyImageBackingInfo struct { - VirtualDeviceFileBackingInfo -} - -func init() { - t["VirtualFloppyImageBackingInfo"] = reflect.TypeOf((*VirtualFloppyImageBackingInfo)(nil)).Elem() -} - -type VirtualFloppyImageBackingOption struct { - VirtualDeviceFileBackingOption -} - -func init() { - t["VirtualFloppyImageBackingOption"] = reflect.TypeOf((*VirtualFloppyImageBackingOption)(nil)).Elem() -} - -type VirtualFloppyOption struct { - VirtualDeviceOption -} - -func init() { - t["VirtualFloppyOption"] = reflect.TypeOf((*VirtualFloppyOption)(nil)).Elem() -} - -type VirtualFloppyRemoteDeviceBackingInfo struct { - VirtualDeviceRemoteDeviceBackingInfo -} - -func init() { - t["VirtualFloppyRemoteDeviceBackingInfo"] = reflect.TypeOf((*VirtualFloppyRemoteDeviceBackingInfo)(nil)).Elem() -} - -type VirtualFloppyRemoteDeviceBackingOption struct { - VirtualDeviceRemoteDeviceBackingOption -} - -func init() { - t["VirtualFloppyRemoteDeviceBackingOption"] = reflect.TypeOf((*VirtualFloppyRemoteDeviceBackingOption)(nil)).Elem() -} - -type VirtualHardware struct { - DynamicData - - NumCPU int `xml:"numCPU"` - NumCoresPerSocket int `xml:"numCoresPerSocket,omitempty"` - MemoryMB int `xml:"memoryMB"` - VirtualICH7MPresent *bool `xml:"virtualICH7MPresent"` - VirtualSMCPresent *bool `xml:"virtualSMCPresent"` - Device []BaseVirtualDevice `xml:"device,omitempty,typeattr"` -} - -func init() { - t["VirtualHardware"] = reflect.TypeOf((*VirtualHardware)(nil)).Elem() -} - -type VirtualHardwareCompatibilityIssue struct { - VmConfigFault -} - -func init() { - t["VirtualHardwareCompatibilityIssue"] = reflect.TypeOf((*VirtualHardwareCompatibilityIssue)(nil)).Elem() -} - -type VirtualHardwareCompatibilityIssueFault BaseVirtualHardwareCompatibilityIssue - -func init() { - t["VirtualHardwareCompatibilityIssueFault"] = reflect.TypeOf((*VirtualHardwareCompatibilityIssueFault)(nil)).Elem() -} - -type VirtualHardwareOption struct { - DynamicData - - HwVersion int `xml:"hwVersion"` - VirtualDeviceOption []BaseVirtualDeviceOption `xml:"virtualDeviceOption,typeattr"` - DeviceListReadonly bool `xml:"deviceListReadonly"` - NumCPU []int `xml:"numCPU"` - NumCoresPerSocket *IntOption `xml:"numCoresPerSocket,omitempty"` - NumCpuReadonly bool `xml:"numCpuReadonly"` - MemoryMB LongOption `xml:"memoryMB"` - NumPCIControllers IntOption `xml:"numPCIControllers"` - NumIDEControllers IntOption `xml:"numIDEControllers"` - NumUSBControllers IntOption `xml:"numUSBControllers"` - NumUSBXHCIControllers *IntOption `xml:"numUSBXHCIControllers,omitempty"` - NumSIOControllers IntOption `xml:"numSIOControllers"` - NumPS2Controllers IntOption `xml:"numPS2Controllers"` - LicensingLimit []string `xml:"licensingLimit,omitempty"` - NumSupportedWwnPorts *IntOption `xml:"numSupportedWwnPorts,omitempty"` - NumSupportedWwnNodes *IntOption `xml:"numSupportedWwnNodes,omitempty"` - ResourceConfigOption *ResourceConfigOption `xml:"resourceConfigOption,omitempty"` -} - -func init() { - t["VirtualHardwareOption"] = reflect.TypeOf((*VirtualHardwareOption)(nil)).Elem() -} - -type VirtualHardwareVersionNotSupported struct { - VirtualHardwareCompatibilityIssue - - HostName string `xml:"hostName"` - Host ManagedObjectReference `xml:"host"` -} - -func init() { - t["VirtualHardwareVersionNotSupported"] = reflect.TypeOf((*VirtualHardwareVersionNotSupported)(nil)).Elem() -} - -type VirtualHardwareVersionNotSupportedFault VirtualHardwareVersionNotSupported - -func init() { - t["VirtualHardwareVersionNotSupportedFault"] = reflect.TypeOf((*VirtualHardwareVersionNotSupportedFault)(nil)).Elem() -} - -type VirtualHdAudioCard struct { - VirtualSoundCard -} - -func init() { - t["VirtualHdAudioCard"] = reflect.TypeOf((*VirtualHdAudioCard)(nil)).Elem() -} - -type VirtualHdAudioCardOption struct { - VirtualSoundCardOption -} - -func init() { - t["VirtualHdAudioCardOption"] = reflect.TypeOf((*VirtualHdAudioCardOption)(nil)).Elem() -} - -type VirtualIDEController struct { - VirtualController -} - -func init() { - t["VirtualIDEController"] = reflect.TypeOf((*VirtualIDEController)(nil)).Elem() -} - -type VirtualIDEControllerOption struct { - VirtualControllerOption - - NumIDEDisks IntOption `xml:"numIDEDisks"` - NumIDECdroms IntOption `xml:"numIDECdroms"` -} - -func init() { - t["VirtualIDEControllerOption"] = reflect.TypeOf((*VirtualIDEControllerOption)(nil)).Elem() -} - -type VirtualKeyboard struct { - VirtualDevice -} - -func init() { - t["VirtualKeyboard"] = reflect.TypeOf((*VirtualKeyboard)(nil)).Elem() -} - -type VirtualKeyboardOption struct { - VirtualDeviceOption -} - -func init() { - t["VirtualKeyboardOption"] = reflect.TypeOf((*VirtualKeyboardOption)(nil)).Elem() -} - -type VirtualLsiLogicController struct { - VirtualSCSIController -} - -func init() { - t["VirtualLsiLogicController"] = reflect.TypeOf((*VirtualLsiLogicController)(nil)).Elem() -} - -type VirtualLsiLogicControllerOption struct { - VirtualSCSIControllerOption -} - -func init() { - t["VirtualLsiLogicControllerOption"] = reflect.TypeOf((*VirtualLsiLogicControllerOption)(nil)).Elem() -} - -type VirtualLsiLogicSASController struct { - VirtualSCSIController -} - -func init() { - t["VirtualLsiLogicSASController"] = reflect.TypeOf((*VirtualLsiLogicSASController)(nil)).Elem() -} - -type VirtualLsiLogicSASControllerOption struct { - VirtualSCSIControllerOption -} - -func init() { - t["VirtualLsiLogicSASControllerOption"] = reflect.TypeOf((*VirtualLsiLogicSASControllerOption)(nil)).Elem() -} - -type VirtualMachineAffinityInfo struct { - DynamicData - - AffinitySet []int `xml:"affinitySet,omitempty"` -} - -func init() { - t["VirtualMachineAffinityInfo"] = reflect.TypeOf((*VirtualMachineAffinityInfo)(nil)).Elem() -} - -type VirtualMachineBootOptions struct { - DynamicData - - BootDelay int64 `xml:"bootDelay,omitempty"` - EnterBIOSSetup *bool `xml:"enterBIOSSetup"` - BootRetryEnabled *bool `xml:"bootRetryEnabled"` - BootRetryDelay int64 `xml:"bootRetryDelay,omitempty"` - BootOrder []BaseVirtualMachineBootOptionsBootableDevice `xml:"bootOrder,omitempty,typeattr"` -} - -func init() { - t["VirtualMachineBootOptions"] = reflect.TypeOf((*VirtualMachineBootOptions)(nil)).Elem() -} - -type VirtualMachineBootOptionsBootableCdromDevice struct { - VirtualMachineBootOptionsBootableDevice -} - -func init() { - t["VirtualMachineBootOptionsBootableCdromDevice"] = reflect.TypeOf((*VirtualMachineBootOptionsBootableCdromDevice)(nil)).Elem() -} - -type VirtualMachineBootOptionsBootableDevice struct { - DynamicData -} - -func init() { - t["VirtualMachineBootOptionsBootableDevice"] = reflect.TypeOf((*VirtualMachineBootOptionsBootableDevice)(nil)).Elem() -} - -type VirtualMachineBootOptionsBootableDiskDevice struct { - VirtualMachineBootOptionsBootableDevice - - DeviceKey int `xml:"deviceKey"` -} - -func init() { - t["VirtualMachineBootOptionsBootableDiskDevice"] = reflect.TypeOf((*VirtualMachineBootOptionsBootableDiskDevice)(nil)).Elem() -} - -type VirtualMachineBootOptionsBootableEthernetDevice struct { - VirtualMachineBootOptionsBootableDevice - - DeviceKey int `xml:"deviceKey"` -} - -func init() { - t["VirtualMachineBootOptionsBootableEthernetDevice"] = reflect.TypeOf((*VirtualMachineBootOptionsBootableEthernetDevice)(nil)).Elem() -} - -type VirtualMachineBootOptionsBootableFloppyDevice struct { - VirtualMachineBootOptionsBootableDevice -} - -func init() { - t["VirtualMachineBootOptionsBootableFloppyDevice"] = reflect.TypeOf((*VirtualMachineBootOptionsBootableFloppyDevice)(nil)).Elem() -} - -type VirtualMachineCapability struct { - DynamicData - - SnapshotOperationsSupported bool `xml:"snapshotOperationsSupported"` - MultipleSnapshotsSupported bool `xml:"multipleSnapshotsSupported"` - SnapshotConfigSupported bool `xml:"snapshotConfigSupported"` - PoweredOffSnapshotsSupported bool `xml:"poweredOffSnapshotsSupported"` - MemorySnapshotsSupported bool `xml:"memorySnapshotsSupported"` - RevertToSnapshotSupported bool `xml:"revertToSnapshotSupported"` - QuiescedSnapshotsSupported bool `xml:"quiescedSnapshotsSupported"` - DisableSnapshotsSupported bool `xml:"disableSnapshotsSupported"` - LockSnapshotsSupported bool `xml:"lockSnapshotsSupported"` - ConsolePreferencesSupported bool `xml:"consolePreferencesSupported"` - CpuFeatureMaskSupported bool `xml:"cpuFeatureMaskSupported"` - S1AcpiManagementSupported bool `xml:"s1AcpiManagementSupported"` - SettingScreenResolutionSupported bool `xml:"settingScreenResolutionSupported"` - ToolsAutoUpdateSupported bool `xml:"toolsAutoUpdateSupported"` - VmNpivWwnSupported bool `xml:"vmNpivWwnSupported"` - NpivWwnOnNonRdmVmSupported bool `xml:"npivWwnOnNonRdmVmSupported"` - VmNpivWwnDisableSupported *bool `xml:"vmNpivWwnDisableSupported"` - VmNpivWwnUpdateSupported *bool `xml:"vmNpivWwnUpdateSupported"` - SwapPlacementSupported bool `xml:"swapPlacementSupported"` - ToolsSyncTimeSupported bool `xml:"toolsSyncTimeSupported"` - VirtualMmuUsageSupported bool `xml:"virtualMmuUsageSupported"` - DiskSharesSupported bool `xml:"diskSharesSupported"` - BootOptionsSupported bool `xml:"bootOptionsSupported"` - BootRetryOptionsSupported *bool `xml:"bootRetryOptionsSupported"` - SettingVideoRamSizeSupported bool `xml:"settingVideoRamSizeSupported"` - SettingDisplayTopologySupported *bool `xml:"settingDisplayTopologySupported"` - RecordReplaySupported *bool `xml:"recordReplaySupported"` - ChangeTrackingSupported *bool `xml:"changeTrackingSupported"` - MultipleCoresPerSocketSupported *bool `xml:"multipleCoresPerSocketSupported"` - HostBasedReplicationSupported *bool `xml:"hostBasedReplicationSupported"` - GuestAutoLockSupported *bool `xml:"guestAutoLockSupported"` - MemoryReservationLockSupported *bool `xml:"memoryReservationLockSupported"` - FeatureRequirementSupported *bool `xml:"featureRequirementSupported"` - PoweredOnMonitorTypeChangeSupported *bool `xml:"poweredOnMonitorTypeChangeSupported"` - SeSparseDiskSupported *bool `xml:"seSparseDiskSupported"` - NestedHVSupported *bool `xml:"nestedHVSupported"` - VPMCSupported *bool `xml:"vPMCSupported"` -} - -func init() { - t["VirtualMachineCapability"] = reflect.TypeOf((*VirtualMachineCapability)(nil)).Elem() -} - -type VirtualMachineCdromInfo struct { - VirtualMachineTargetInfo -} - -func init() { - t["VirtualMachineCdromInfo"] = reflect.TypeOf((*VirtualMachineCdromInfo)(nil)).Elem() -} - -type VirtualMachineCloneSpec struct { - DynamicData - - Location VirtualMachineRelocateSpec `xml:"location"` - Template bool `xml:"template"` - Config *VirtualMachineConfigSpec `xml:"config,omitempty"` - Customization *CustomizationSpec `xml:"customization,omitempty"` - PowerOn bool `xml:"powerOn"` - Snapshot *ManagedObjectReference `xml:"snapshot,omitempty"` - Memory *bool `xml:"memory"` -} - -func init() { - t["VirtualMachineCloneSpec"] = reflect.TypeOf((*VirtualMachineCloneSpec)(nil)).Elem() -} - -type VirtualMachineConfigInfo struct { - DynamicData - - ChangeVersion string `xml:"changeVersion"` - Modified time.Time `xml:"modified"` - Name string `xml:"name"` - GuestFullName string `xml:"guestFullName"` - Version string `xml:"version"` - Uuid string `xml:"uuid"` - InstanceUuid string `xml:"instanceUuid,omitempty"` - NpivNodeWorldWideName []int64 `xml:"npivNodeWorldWideName,omitempty"` - NpivPortWorldWideName []int64 `xml:"npivPortWorldWideName,omitempty"` - NpivWorldWideNameType string `xml:"npivWorldWideNameType,omitempty"` - NpivDesiredNodeWwns int16 `xml:"npivDesiredNodeWwns,omitempty"` - NpivDesiredPortWwns int16 `xml:"npivDesiredPortWwns,omitempty"` - NpivTemporaryDisabled *bool `xml:"npivTemporaryDisabled"` - NpivOnNonRdmDisks *bool `xml:"npivOnNonRdmDisks"` - LocationId string `xml:"locationId,omitempty"` - Template bool `xml:"template"` - GuestId string `xml:"guestId"` - AlternateGuestName string `xml:"alternateGuestName"` - Annotation string `xml:"annotation,omitempty"` - Files VirtualMachineFileInfo `xml:"files"` - Tools *ToolsConfigInfo `xml:"tools,omitempty"` - Flags VirtualMachineFlagInfo `xml:"flags"` - ConsolePreferences *VirtualMachineConsolePreferences `xml:"consolePreferences,omitempty"` - DefaultPowerOps VirtualMachineDefaultPowerOpInfo `xml:"defaultPowerOps"` - Hardware VirtualHardware `xml:"hardware"` - CpuAllocation *ResourceAllocationInfo `xml:"cpuAllocation,omitempty"` - MemoryAllocation *ResourceAllocationInfo `xml:"memoryAllocation,omitempty"` - LatencySensitivity *LatencySensitivity `xml:"latencySensitivity,omitempty"` - MemoryHotAddEnabled *bool `xml:"memoryHotAddEnabled"` - CpuHotAddEnabled *bool `xml:"cpuHotAddEnabled"` - CpuHotRemoveEnabled *bool `xml:"cpuHotRemoveEnabled"` - HotPlugMemoryLimit int64 `xml:"hotPlugMemoryLimit,omitempty"` - HotPlugMemoryIncrementSize int64 `xml:"hotPlugMemoryIncrementSize,omitempty"` - CpuAffinity *VirtualMachineAffinityInfo `xml:"cpuAffinity,omitempty"` - MemoryAffinity *VirtualMachineAffinityInfo `xml:"memoryAffinity,omitempty"` - NetworkShaper *VirtualMachineNetworkShaperInfo `xml:"networkShaper,omitempty"` - ExtraConfig []BaseOptionValue `xml:"extraConfig,omitempty,typeattr"` - CpuFeatureMask []HostCpuIdInfo `xml:"cpuFeatureMask,omitempty"` - DatastoreUrl []VirtualMachineConfigInfoDatastoreUrlPair `xml:"datastoreUrl,omitempty"` - SwapPlacement string `xml:"swapPlacement,omitempty"` - BootOptions *VirtualMachineBootOptions `xml:"bootOptions,omitempty"` - FtInfo BaseFaultToleranceConfigInfo `xml:"ftInfo,omitempty,typeattr"` - VAppConfig BaseVmConfigInfo `xml:"vAppConfig,omitempty,typeattr"` - VAssertsEnabled *bool `xml:"vAssertsEnabled"` - ChangeTrackingEnabled *bool `xml:"changeTrackingEnabled"` - Firmware string `xml:"firmware,omitempty"` - MaxMksConnections int `xml:"maxMksConnections,omitempty"` - GuestAutoLockEnabled *bool `xml:"guestAutoLockEnabled"` - ManagedBy *ManagedByInfo `xml:"managedBy,omitempty"` - MemoryReservationLockedToMax *bool `xml:"memoryReservationLockedToMax"` - InitialOverhead *VirtualMachineConfigInfoOverheadInfo `xml:"initialOverhead,omitempty"` - NestedHVEnabled *bool `xml:"nestedHVEnabled"` - VPMCEnabled *bool `xml:"vPMCEnabled"` - ScheduledHardwareUpgradeInfo *ScheduledHardwareUpgradeInfo `xml:"scheduledHardwareUpgradeInfo,omitempty"` - VFlashCacheReservation int64 `xml:"vFlashCacheReservation,omitempty"` -} - -func init() { - t["VirtualMachineConfigInfo"] = reflect.TypeOf((*VirtualMachineConfigInfo)(nil)).Elem() -} - -type VirtualMachineConfigInfoDatastoreUrlPair struct { - DynamicData - - Name string `xml:"name"` - Url string `xml:"url"` -} - -func init() { - t["VirtualMachineConfigInfoDatastoreUrlPair"] = reflect.TypeOf((*VirtualMachineConfigInfoDatastoreUrlPair)(nil)).Elem() -} - -type VirtualMachineConfigInfoOverheadInfo struct { - DynamicData - - InitialMemoryReservation int64 `xml:"initialMemoryReservation,omitempty"` - InitialSwapReservation int64 `xml:"initialSwapReservation,omitempty"` -} - -func init() { - t["VirtualMachineConfigInfoOverheadInfo"] = reflect.TypeOf((*VirtualMachineConfigInfoOverheadInfo)(nil)).Elem() -} - -type VirtualMachineConfigOption struct { - DynamicData - - Version string `xml:"version"` - Description string `xml:"description"` - GuestOSDescriptor []GuestOsDescriptor `xml:"guestOSDescriptor"` - GuestOSDefaultIndex int `xml:"guestOSDefaultIndex"` - HardwareOptions VirtualHardwareOption `xml:"hardwareOptions"` - Capabilities VirtualMachineCapability `xml:"capabilities"` - Datastore DatastoreOption `xml:"datastore"` - DefaultDevice []BaseVirtualDevice `xml:"defaultDevice,omitempty,typeattr"` - SupportedMonitorType []string `xml:"supportedMonitorType"` - SupportedOvfEnvironmentTransport []string `xml:"supportedOvfEnvironmentTransport,omitempty"` - SupportedOvfInstallTransport []string `xml:"supportedOvfInstallTransport,omitempty"` -} - -func init() { - t["VirtualMachineConfigOption"] = reflect.TypeOf((*VirtualMachineConfigOption)(nil)).Elem() -} - -type VirtualMachineConfigOptionDescriptor struct { - DynamicData - - Key string `xml:"key"` - Description string `xml:"description,omitempty"` - Host []ManagedObjectReference `xml:"host,omitempty"` - CreateSupported *bool `xml:"createSupported"` - DefaultConfigOption *bool `xml:"defaultConfigOption"` - RunSupported *bool `xml:"runSupported"` - UpgradeSupported *bool `xml:"upgradeSupported"` -} - -func init() { - t["VirtualMachineConfigOptionDescriptor"] = reflect.TypeOf((*VirtualMachineConfigOptionDescriptor)(nil)).Elem() -} - -type VirtualMachineConfigSpec struct { - DynamicData - - ChangeVersion string `xml:"changeVersion,omitempty"` - Name string `xml:"name,omitempty"` - Version string `xml:"version,omitempty"` - Uuid string `xml:"uuid,omitempty"` - InstanceUuid string `xml:"instanceUuid,omitempty"` - NpivNodeWorldWideName []int64 `xml:"npivNodeWorldWideName,omitempty"` - NpivPortWorldWideName []int64 `xml:"npivPortWorldWideName,omitempty"` - NpivWorldWideNameType string `xml:"npivWorldWideNameType,omitempty"` - NpivDesiredNodeWwns int16 `xml:"npivDesiredNodeWwns,omitempty"` - NpivDesiredPortWwns int16 `xml:"npivDesiredPortWwns,omitempty"` - NpivTemporaryDisabled *bool `xml:"npivTemporaryDisabled"` - NpivOnNonRdmDisks *bool `xml:"npivOnNonRdmDisks"` - NpivWorldWideNameOp string `xml:"npivWorldWideNameOp,omitempty"` - LocationId string `xml:"locationId,omitempty"` - GuestId string `xml:"guestId,omitempty"` - AlternateGuestName string `xml:"alternateGuestName,omitempty"` - Annotation string `xml:"annotation,omitempty"` - Files *VirtualMachineFileInfo `xml:"files,omitempty"` - Tools *ToolsConfigInfo `xml:"tools,omitempty"` - Flags *VirtualMachineFlagInfo `xml:"flags,omitempty"` - ConsolePreferences *VirtualMachineConsolePreferences `xml:"consolePreferences,omitempty"` - PowerOpInfo *VirtualMachineDefaultPowerOpInfo `xml:"powerOpInfo,omitempty"` - NumCPUs int `xml:"numCPUs,omitempty"` - NumCoresPerSocket int `xml:"numCoresPerSocket,omitempty"` - MemoryMB int64 `xml:"memoryMB,omitempty"` - MemoryHotAddEnabled *bool `xml:"memoryHotAddEnabled"` - CpuHotAddEnabled *bool `xml:"cpuHotAddEnabled"` - CpuHotRemoveEnabled *bool `xml:"cpuHotRemoveEnabled"` - VirtualICH7MPresent *bool `xml:"virtualICH7MPresent"` - VirtualSMCPresent *bool `xml:"virtualSMCPresent"` - DeviceChange []BaseVirtualDeviceConfigSpec `xml:"deviceChange,omitempty,typeattr"` - CpuAllocation *ResourceAllocationInfo `xml:"cpuAllocation,omitempty"` - MemoryAllocation *ResourceAllocationInfo `xml:"memoryAllocation,omitempty"` - LatencySensitivity *LatencySensitivity `xml:"latencySensitivity,omitempty"` - CpuAffinity *VirtualMachineAffinityInfo `xml:"cpuAffinity,omitempty"` - MemoryAffinity *VirtualMachineAffinityInfo `xml:"memoryAffinity,omitempty"` - NetworkShaper *VirtualMachineNetworkShaperInfo `xml:"networkShaper,omitempty"` - CpuFeatureMask []VirtualMachineCpuIdInfoSpec `xml:"cpuFeatureMask,omitempty"` - ExtraConfig []BaseOptionValue `xml:"extraConfig,omitempty,typeattr"` - SwapPlacement string `xml:"swapPlacement,omitempty"` - BootOptions *VirtualMachineBootOptions `xml:"bootOptions,omitempty"` - VAppConfig BaseVmConfigSpec `xml:"vAppConfig,omitempty,typeattr"` - FtInfo BaseFaultToleranceConfigInfo `xml:"ftInfo,omitempty,typeattr"` - VAppConfigRemoved *bool `xml:"vAppConfigRemoved"` - VAssertsEnabled *bool `xml:"vAssertsEnabled"` - ChangeTrackingEnabled *bool `xml:"changeTrackingEnabled"` - Firmware string `xml:"firmware,omitempty"` - MaxMksConnections int `xml:"maxMksConnections,omitempty"` - GuestAutoLockEnabled *bool `xml:"guestAutoLockEnabled"` - ManagedBy *ManagedByInfo `xml:"managedBy,omitempty"` - MemoryReservationLockedToMax *bool `xml:"memoryReservationLockedToMax"` - NestedHVEnabled *bool `xml:"nestedHVEnabled"` - VPMCEnabled *bool `xml:"vPMCEnabled"` - ScheduledHardwareUpgradeInfo *ScheduledHardwareUpgradeInfo `xml:"scheduledHardwareUpgradeInfo,omitempty"` - VmProfile []BaseVirtualMachineProfileSpec `xml:"vmProfile,omitempty,typeattr"` -} - -func init() { - t["VirtualMachineConfigSpec"] = reflect.TypeOf((*VirtualMachineConfigSpec)(nil)).Elem() -} - -type VirtualMachineConfigSummary struct { - DynamicData - - Name string `xml:"name"` - Template bool `xml:"template"` - VmPathName string `xml:"vmPathName"` - MemorySizeMB int `xml:"memorySizeMB,omitempty"` - CpuReservation int `xml:"cpuReservation,omitempty"` - MemoryReservation int `xml:"memoryReservation,omitempty"` - NumCpu int `xml:"numCpu,omitempty"` - NumEthernetCards int `xml:"numEthernetCards,omitempty"` - NumVirtualDisks int `xml:"numVirtualDisks,omitempty"` - Uuid string `xml:"uuid,omitempty"` - InstanceUuid string `xml:"instanceUuid,omitempty"` - GuestId string `xml:"guestId,omitempty"` - GuestFullName string `xml:"guestFullName,omitempty"` - Annotation string `xml:"annotation,omitempty"` - Product *VAppProductInfo `xml:"product,omitempty"` - InstallBootRequired *bool `xml:"installBootRequired"` - FtInfo BaseFaultToleranceConfigInfo `xml:"ftInfo,omitempty,typeattr"` - ManagedBy *ManagedByInfo `xml:"managedBy,omitempty"` -} - -func init() { - t["VirtualMachineConfigSummary"] = reflect.TypeOf((*VirtualMachineConfigSummary)(nil)).Elem() -} - -type VirtualMachineConsolePreferences struct { - DynamicData - - PowerOnWhenOpened *bool `xml:"powerOnWhenOpened"` - EnterFullScreenOnPowerOn *bool `xml:"enterFullScreenOnPowerOn"` - CloseOnPowerOffOrSuspend *bool `xml:"closeOnPowerOffOrSuspend"` -} - -func init() { - t["VirtualMachineConsolePreferences"] = reflect.TypeOf((*VirtualMachineConsolePreferences)(nil)).Elem() -} - -type VirtualMachineCpuIdInfoSpec struct { - ArrayUpdateSpec - - Info *HostCpuIdInfo `xml:"info,omitempty"` -} - -func init() { - t["VirtualMachineCpuIdInfoSpec"] = reflect.TypeOf((*VirtualMachineCpuIdInfoSpec)(nil)).Elem() -} - -type VirtualMachineDatastoreInfo struct { - VirtualMachineTargetInfo - - Datastore DatastoreSummary `xml:"datastore"` - Capability DatastoreCapability `xml:"capability"` - MaxFileSize int64 `xml:"maxFileSize"` - MaxVirtualDiskCapacity int64 `xml:"maxVirtualDiskCapacity,omitempty"` - Mode string `xml:"mode"` - VStorageSupport string `xml:"vStorageSupport,omitempty"` -} - -func init() { - t["VirtualMachineDatastoreInfo"] = reflect.TypeOf((*VirtualMachineDatastoreInfo)(nil)).Elem() -} - -type VirtualMachineDatastoreVolumeOption struct { - DynamicData - - FileSystemType string `xml:"fileSystemType"` - MajorVersion int `xml:"majorVersion,omitempty"` -} - -func init() { - t["VirtualMachineDatastoreVolumeOption"] = reflect.TypeOf((*VirtualMachineDatastoreVolumeOption)(nil)).Elem() -} - -type VirtualMachineDefaultPowerOpInfo struct { - DynamicData - - PowerOffType string `xml:"powerOffType,omitempty"` - SuspendType string `xml:"suspendType,omitempty"` - ResetType string `xml:"resetType,omitempty"` - DefaultPowerOffType string `xml:"defaultPowerOffType,omitempty"` - DefaultSuspendType string `xml:"defaultSuspendType,omitempty"` - DefaultResetType string `xml:"defaultResetType,omitempty"` - StandbyAction string `xml:"standbyAction,omitempty"` -} - -func init() { - t["VirtualMachineDefaultPowerOpInfo"] = reflect.TypeOf((*VirtualMachineDefaultPowerOpInfo)(nil)).Elem() -} - -type VirtualMachineDefinedProfileSpec struct { - VirtualMachineProfileSpec - - ProfileId string `xml:"profileId"` - ProfileData *VirtualMachineProfileRawData `xml:"profileData,omitempty"` -} - -func init() { - t["VirtualMachineDefinedProfileSpec"] = reflect.TypeOf((*VirtualMachineDefinedProfileSpec)(nil)).Elem() -} - -type VirtualMachineDeviceRuntimeInfo struct { - DynamicData - - RuntimeState BaseVirtualMachineDeviceRuntimeInfoDeviceRuntimeState `xml:"runtimeState,typeattr"` - Key int `xml:"key"` -} - -func init() { - t["VirtualMachineDeviceRuntimeInfo"] = reflect.TypeOf((*VirtualMachineDeviceRuntimeInfo)(nil)).Elem() -} - -type VirtualMachineDeviceRuntimeInfoDeviceRuntimeState struct { - DynamicData -} - -func init() { - t["VirtualMachineDeviceRuntimeInfoDeviceRuntimeState"] = reflect.TypeOf((*VirtualMachineDeviceRuntimeInfoDeviceRuntimeState)(nil)).Elem() -} - -type VirtualMachineDeviceRuntimeInfoVirtualEthernetCardRuntimeState struct { - VirtualMachineDeviceRuntimeInfoDeviceRuntimeState - - VmDirectPathGen2Active bool `xml:"vmDirectPathGen2Active"` - VmDirectPathGen2InactiveReasonVm []string `xml:"vmDirectPathGen2InactiveReasonVm,omitempty"` - VmDirectPathGen2InactiveReasonOther []string `xml:"vmDirectPathGen2InactiveReasonOther,omitempty"` - VmDirectPathGen2InactiveReasonExtended string `xml:"vmDirectPathGen2InactiveReasonExtended,omitempty"` - ReservationStatus string `xml:"reservationStatus,omitempty"` -} - -func init() { - t["VirtualMachineDeviceRuntimeInfoVirtualEthernetCardRuntimeState"] = reflect.TypeOf((*VirtualMachineDeviceRuntimeInfoVirtualEthernetCardRuntimeState)(nil)).Elem() -} - -type VirtualMachineDiskDeviceInfo struct { - VirtualMachineTargetInfo - - Capacity int64 `xml:"capacity,omitempty"` - Vm []ManagedObjectReference `xml:"vm,omitempty"` -} - -func init() { - t["VirtualMachineDiskDeviceInfo"] = reflect.TypeOf((*VirtualMachineDiskDeviceInfo)(nil)).Elem() -} - -type VirtualMachineDisplayTopology struct { - DynamicData - - X int `xml:"x"` - Y int `xml:"y"` - Width int `xml:"width"` - Height int `xml:"height"` -} - -func init() { - t["VirtualMachineDisplayTopology"] = reflect.TypeOf((*VirtualMachineDisplayTopology)(nil)).Elem() -} - -type VirtualMachineEmptyProfileSpec struct { - VirtualMachineProfileSpec -} - -func init() { - t["VirtualMachineEmptyProfileSpec"] = reflect.TypeOf((*VirtualMachineEmptyProfileSpec)(nil)).Elem() -} - -type VirtualMachineFeatureRequirement struct { - DynamicData - - Key string `xml:"key"` - FeatureName string `xml:"featureName"` - Value string `xml:"value"` -} - -func init() { - t["VirtualMachineFeatureRequirement"] = reflect.TypeOf((*VirtualMachineFeatureRequirement)(nil)).Elem() -} - -type VirtualMachineFileInfo struct { - DynamicData - - VmPathName string `xml:"vmPathName,omitempty"` - SnapshotDirectory string `xml:"snapshotDirectory,omitempty"` - SuspendDirectory string `xml:"suspendDirectory,omitempty"` - LogDirectory string `xml:"logDirectory,omitempty"` -} - -func init() { - t["VirtualMachineFileInfo"] = reflect.TypeOf((*VirtualMachineFileInfo)(nil)).Elem() -} - -type VirtualMachineFileLayout struct { - DynamicData - - ConfigFile []string `xml:"configFile,omitempty"` - LogFile []string `xml:"logFile,omitempty"` - Disk []VirtualMachineFileLayoutDiskLayout `xml:"disk,omitempty"` - Snapshot []VirtualMachineFileLayoutSnapshotLayout `xml:"snapshot,omitempty"` - SwapFile string `xml:"swapFile,omitempty"` -} - -func init() { - t["VirtualMachineFileLayout"] = reflect.TypeOf((*VirtualMachineFileLayout)(nil)).Elem() -} - -type VirtualMachineFileLayoutDiskLayout struct { - DynamicData - - Key int `xml:"key"` - DiskFile []string `xml:"diskFile"` -} - -func init() { - t["VirtualMachineFileLayoutDiskLayout"] = reflect.TypeOf((*VirtualMachineFileLayoutDiskLayout)(nil)).Elem() -} - -type VirtualMachineFileLayoutEx struct { - DynamicData - - File []VirtualMachineFileLayoutExFileInfo `xml:"file,omitempty"` - Disk []VirtualMachineFileLayoutExDiskLayout `xml:"disk,omitempty"` - Snapshot []VirtualMachineFileLayoutExSnapshotLayout `xml:"snapshot,omitempty"` - Timestamp time.Time `xml:"timestamp"` -} - -func init() { - t["VirtualMachineFileLayoutEx"] = reflect.TypeOf((*VirtualMachineFileLayoutEx)(nil)).Elem() -} - -type VirtualMachineFileLayoutExDiskLayout struct { - DynamicData - - Key int `xml:"key"` - Chain []VirtualMachineFileLayoutExDiskUnit `xml:"chain,omitempty"` -} - -func init() { - t["VirtualMachineFileLayoutExDiskLayout"] = reflect.TypeOf((*VirtualMachineFileLayoutExDiskLayout)(nil)).Elem() -} - -type VirtualMachineFileLayoutExDiskUnit struct { - DynamicData - - FileKey []int `xml:"fileKey"` -} - -func init() { - t["VirtualMachineFileLayoutExDiskUnit"] = reflect.TypeOf((*VirtualMachineFileLayoutExDiskUnit)(nil)).Elem() -} - -type VirtualMachineFileLayoutExFileInfo struct { - DynamicData - - Key int `xml:"key"` - Name string `xml:"name"` - Type string `xml:"type"` - Size int64 `xml:"size"` - UniqueSize int64 `xml:"uniqueSize,omitempty"` -} - -func init() { - t["VirtualMachineFileLayoutExFileInfo"] = reflect.TypeOf((*VirtualMachineFileLayoutExFileInfo)(nil)).Elem() -} - -type VirtualMachineFileLayoutExSnapshotLayout struct { - DynamicData - - Key ManagedObjectReference `xml:"key"` - DataKey int `xml:"dataKey"` - Disk []VirtualMachineFileLayoutExDiskLayout `xml:"disk,omitempty"` -} - -func init() { - t["VirtualMachineFileLayoutExSnapshotLayout"] = reflect.TypeOf((*VirtualMachineFileLayoutExSnapshotLayout)(nil)).Elem() -} - -type VirtualMachineFileLayoutSnapshotLayout struct { - DynamicData - - Key ManagedObjectReference `xml:"key"` - SnapshotFile []string `xml:"snapshotFile"` -} - -func init() { - t["VirtualMachineFileLayoutSnapshotLayout"] = reflect.TypeOf((*VirtualMachineFileLayoutSnapshotLayout)(nil)).Elem() -} - -type VirtualMachineFlagInfo struct { - DynamicData - - DisableAcceleration *bool `xml:"disableAcceleration"` - EnableLogging *bool `xml:"enableLogging"` - UseToe *bool `xml:"useToe"` - RunWithDebugInfo *bool `xml:"runWithDebugInfo"` - MonitorType string `xml:"monitorType,omitempty"` - HtSharing string `xml:"htSharing,omitempty"` - SnapshotDisabled *bool `xml:"snapshotDisabled"` - SnapshotLocked *bool `xml:"snapshotLocked"` - DiskUuidEnabled *bool `xml:"diskUuidEnabled"` - VirtualMmuUsage string `xml:"virtualMmuUsage,omitempty"` - VirtualExecUsage string `xml:"virtualExecUsage,omitempty"` - SnapshotPowerOffBehavior string `xml:"snapshotPowerOffBehavior,omitempty"` - RecordReplayEnabled *bool `xml:"recordReplayEnabled"` -} - -func init() { - t["VirtualMachineFlagInfo"] = reflect.TypeOf((*VirtualMachineFlagInfo)(nil)).Elem() -} - -type VirtualMachineFloppyInfo struct { - VirtualMachineTargetInfo -} - -func init() { - t["VirtualMachineFloppyInfo"] = reflect.TypeOf((*VirtualMachineFloppyInfo)(nil)).Elem() -} - -type VirtualMachineGuestSummary struct { - DynamicData - - GuestId string `xml:"guestId,omitempty"` - GuestFullName string `xml:"guestFullName,omitempty"` - ToolsStatus VirtualMachineToolsStatus `xml:"toolsStatus,omitempty"` - ToolsVersionStatus string `xml:"toolsVersionStatus,omitempty"` - ToolsVersionStatus2 string `xml:"toolsVersionStatus2,omitempty"` - ToolsRunningStatus string `xml:"toolsRunningStatus,omitempty"` - HostName string `xml:"hostName,omitempty"` - IpAddress string `xml:"ipAddress,omitempty"` -} - -func init() { - t["VirtualMachineGuestSummary"] = reflect.TypeOf((*VirtualMachineGuestSummary)(nil)).Elem() -} - -type VirtualMachineIdeDiskDeviceInfo struct { - VirtualMachineDiskDeviceInfo - - PartitionTable []VirtualMachineIdeDiskDevicePartitionInfo `xml:"partitionTable,omitempty"` -} - -func init() { - t["VirtualMachineIdeDiskDeviceInfo"] = reflect.TypeOf((*VirtualMachineIdeDiskDeviceInfo)(nil)).Elem() -} - -type VirtualMachineIdeDiskDevicePartitionInfo struct { - DynamicData - - Id int `xml:"id"` - Capacity int `xml:"capacity"` -} - -func init() { - t["VirtualMachineIdeDiskDevicePartitionInfo"] = reflect.TypeOf((*VirtualMachineIdeDiskDevicePartitionInfo)(nil)).Elem() -} - -type VirtualMachineImportSpec struct { - ImportSpec - - ConfigSpec VirtualMachineConfigSpec `xml:"configSpec"` - ResPoolEntity *ManagedObjectReference `xml:"resPoolEntity,omitempty"` -} - -func init() { - t["VirtualMachineImportSpec"] = reflect.TypeOf((*VirtualMachineImportSpec)(nil)).Elem() -} - -type VirtualMachineLegacyNetworkSwitchInfo struct { - DynamicData - - Name string `xml:"name"` -} - -func init() { - t["VirtualMachineLegacyNetworkSwitchInfo"] = reflect.TypeOf((*VirtualMachineLegacyNetworkSwitchInfo)(nil)).Elem() -} - -type VirtualMachineMemoryReservationInfo struct { - DynamicData - - VirtualMachineMin int64 `xml:"virtualMachineMin"` - VirtualMachineMax int64 `xml:"virtualMachineMax"` - VirtualMachineReserved int64 `xml:"virtualMachineReserved"` - AllocationPolicy string `xml:"allocationPolicy"` -} - -func init() { - t["VirtualMachineMemoryReservationInfo"] = reflect.TypeOf((*VirtualMachineMemoryReservationInfo)(nil)).Elem() -} - -type VirtualMachineMemoryReservationSpec struct { - DynamicData - - VirtualMachineReserved int64 `xml:"virtualMachineReserved,omitempty"` - AllocationPolicy string `xml:"allocationPolicy,omitempty"` -} - -func init() { - t["VirtualMachineMemoryReservationSpec"] = reflect.TypeOf((*VirtualMachineMemoryReservationSpec)(nil)).Elem() -} - -type VirtualMachineMessage struct { - DynamicData - - Id string `xml:"id"` - Argument []AnyType `xml:"argument,omitempty,typeattr"` - Text string `xml:"text,omitempty"` -} - -func init() { - t["VirtualMachineMessage"] = reflect.TypeOf((*VirtualMachineMessage)(nil)).Elem() -} - -type VirtualMachineMetadataManagerVmMetadata struct { - DynamicData - - VmId string `xml:"vmId"` - Metadata string `xml:"metadata,omitempty"` -} - -func init() { - t["VirtualMachineMetadataManagerVmMetadata"] = reflect.TypeOf((*VirtualMachineMetadataManagerVmMetadata)(nil)).Elem() -} - -type VirtualMachineMetadataManagerVmMetadataInput struct { - DynamicData - - Operation string `xml:"operation"` - VmMetadata VirtualMachineMetadataManagerVmMetadata `xml:"vmMetadata"` -} - -func init() { - t["VirtualMachineMetadataManagerVmMetadataInput"] = reflect.TypeOf((*VirtualMachineMetadataManagerVmMetadataInput)(nil)).Elem() -} - -type VirtualMachineMetadataManagerVmMetadataOwner struct { - DynamicData - - Name string `xml:"name"` -} - -func init() { - t["VirtualMachineMetadataManagerVmMetadataOwner"] = reflect.TypeOf((*VirtualMachineMetadataManagerVmMetadataOwner)(nil)).Elem() -} - -type VirtualMachineMetadataManagerVmMetadataResult struct { - DynamicData - - VmMetadata VirtualMachineMetadataManagerVmMetadata `xml:"vmMetadata"` - Error *LocalizedMethodFault `xml:"error,omitempty"` -} - -func init() { - t["VirtualMachineMetadataManagerVmMetadataResult"] = reflect.TypeOf((*VirtualMachineMetadataManagerVmMetadataResult)(nil)).Elem() -} - -type VirtualMachineMksTicket struct { - DynamicData - - Ticket string `xml:"ticket"` - CfgFile string `xml:"cfgFile"` - Host string `xml:"host,omitempty"` - Port int `xml:"port,omitempty"` - SslThumbprint string `xml:"sslThumbprint,omitempty"` -} - -func init() { - t["VirtualMachineMksTicket"] = reflect.TypeOf((*VirtualMachineMksTicket)(nil)).Elem() -} - -type VirtualMachineNetworkInfo struct { - VirtualMachineTargetInfo - - Network BaseNetworkSummary `xml:"network,typeattr"` -} - -func init() { - t["VirtualMachineNetworkInfo"] = reflect.TypeOf((*VirtualMachineNetworkInfo)(nil)).Elem() -} - -type VirtualMachineNetworkShaperInfo struct { - DynamicData - - Enabled *bool `xml:"enabled"` - PeakBps int64 `xml:"peakBps,omitempty"` - AverageBps int64 `xml:"averageBps,omitempty"` - BurstSize int64 `xml:"burstSize,omitempty"` -} - -func init() { - t["VirtualMachineNetworkShaperInfo"] = reflect.TypeOf((*VirtualMachineNetworkShaperInfo)(nil)).Elem() -} - -type VirtualMachineParallelInfo struct { - VirtualMachineTargetInfo -} - -func init() { - t["VirtualMachineParallelInfo"] = reflect.TypeOf((*VirtualMachineParallelInfo)(nil)).Elem() -} - -type VirtualMachinePciPassthroughInfo struct { - VirtualMachineTargetInfo - - PciDevice HostPciDevice `xml:"pciDevice"` - SystemId string `xml:"systemId"` -} - -func init() { - t["VirtualMachinePciPassthroughInfo"] = reflect.TypeOf((*VirtualMachinePciPassthroughInfo)(nil)).Elem() -} - -type VirtualMachineProfileRawData struct { - DynamicData - - ExtensionKey string `xml:"extensionKey"` - ObjectData string `xml:"objectData,omitempty"` -} - -func init() { - t["VirtualMachineProfileRawData"] = reflect.TypeOf((*VirtualMachineProfileRawData)(nil)).Elem() -} - -type VirtualMachineProfileSpec struct { - DynamicData -} - -func init() { - t["VirtualMachineProfileSpec"] = reflect.TypeOf((*VirtualMachineProfileSpec)(nil)).Elem() -} - -type VirtualMachineQuestionInfo struct { - DynamicData - - Id string `xml:"id"` - Text string `xml:"text"` - Choice ChoiceOption `xml:"choice"` - Message []VirtualMachineMessage `xml:"message,omitempty"` -} - -func init() { - t["VirtualMachineQuestionInfo"] = reflect.TypeOf((*VirtualMachineQuestionInfo)(nil)).Elem() -} - -type VirtualMachineQuickStats struct { - DynamicData - - OverallCpuUsage int `xml:"overallCpuUsage,omitempty"` - OverallCpuDemand int `xml:"overallCpuDemand,omitempty"` - GuestMemoryUsage int `xml:"guestMemoryUsage,omitempty"` - HostMemoryUsage int `xml:"hostMemoryUsage,omitempty"` - GuestHeartbeatStatus ManagedEntityStatus `xml:"guestHeartbeatStatus"` - DistributedCpuEntitlement int `xml:"distributedCpuEntitlement,omitempty"` - DistributedMemoryEntitlement int `xml:"distributedMemoryEntitlement,omitempty"` - StaticCpuEntitlement int `xml:"staticCpuEntitlement,omitempty"` - StaticMemoryEntitlement int `xml:"staticMemoryEntitlement,omitempty"` - PrivateMemory int `xml:"privateMemory,omitempty"` - SharedMemory int `xml:"sharedMemory,omitempty"` - SwappedMemory int `xml:"swappedMemory,omitempty"` - BalloonedMemory int `xml:"balloonedMemory,omitempty"` - ConsumedOverheadMemory int `xml:"consumedOverheadMemory,omitempty"` - FtLogBandwidth int `xml:"ftLogBandwidth,omitempty"` - FtSecondaryLatency int `xml:"ftSecondaryLatency,omitempty"` - FtLatencyStatus ManagedEntityStatus `xml:"ftLatencyStatus,omitempty"` - CompressedMemory int64 `xml:"compressedMemory,omitempty"` - UptimeSeconds int `xml:"uptimeSeconds,omitempty"` - SsdSwappedMemory int64 `xml:"ssdSwappedMemory,omitempty"` -} - -func init() { - t["VirtualMachineQuickStats"] = reflect.TypeOf((*VirtualMachineQuickStats)(nil)).Elem() -} - -type VirtualMachineRelocateSpec struct { - DynamicData - - Datastore *ManagedObjectReference `xml:"datastore,omitempty"` - DiskMoveType string `xml:"diskMoveType,omitempty"` - Pool *ManagedObjectReference `xml:"pool,omitempty"` - Host *ManagedObjectReference `xml:"host,omitempty"` - Disk []VirtualMachineRelocateSpecDiskLocator `xml:"disk,omitempty"` - Transform VirtualMachineRelocateTransformation `xml:"transform,omitempty"` - DeviceChange []BaseVirtualDeviceConfigSpec `xml:"deviceChange,omitempty,typeattr"` - Profile []BaseVirtualMachineProfileSpec `xml:"profile,omitempty,typeattr"` -} - -func init() { - t["VirtualMachineRelocateSpec"] = reflect.TypeOf((*VirtualMachineRelocateSpec)(nil)).Elem() -} - -type VirtualMachineRelocateSpecDiskLocator struct { - DynamicData - - DiskId int `xml:"diskId"` - Datastore ManagedObjectReference `xml:"datastore"` - DiskMoveType string `xml:"diskMoveType,omitempty"` - DiskBackingInfo BaseVirtualDeviceBackingInfo `xml:"diskBackingInfo,omitempty,typeattr"` - Profile []BaseVirtualMachineProfileSpec `xml:"profile,omitempty,typeattr"` -} - -func init() { - t["VirtualMachineRelocateSpecDiskLocator"] = reflect.TypeOf((*VirtualMachineRelocateSpecDiskLocator)(nil)).Elem() -} - -type VirtualMachineRuntimeInfo struct { - DynamicData - - Device []VirtualMachineDeviceRuntimeInfo `xml:"device,omitempty"` - Host *ManagedObjectReference `xml:"host,omitempty"` - ConnectionState VirtualMachineConnectionState `xml:"connectionState"` - PowerState VirtualMachinePowerState `xml:"powerState"` - FaultToleranceState VirtualMachineFaultToleranceState `xml:"faultToleranceState,omitempty"` - DasVmProtection *VirtualMachineRuntimeInfoDasProtectionState `xml:"dasVmProtection,omitempty"` - ToolsInstallerMounted bool `xml:"toolsInstallerMounted"` - SuspendTime *time.Time `xml:"suspendTime"` - BootTime *time.Time `xml:"bootTime"` - SuspendInterval int64 `xml:"suspendInterval,omitempty"` - Question *VirtualMachineQuestionInfo `xml:"question,omitempty"` - MemoryOverhead int64 `xml:"memoryOverhead,omitempty"` - MaxCpuUsage int `xml:"maxCpuUsage,omitempty"` - MaxMemoryUsage int `xml:"maxMemoryUsage,omitempty"` - NumMksConnections int `xml:"numMksConnections"` - RecordReplayState VirtualMachineRecordReplayState `xml:"recordReplayState,omitempty"` - CleanPowerOff *bool `xml:"cleanPowerOff"` - NeedSecondaryReason string `xml:"needSecondaryReason,omitempty"` - OnlineStandby *bool `xml:"onlineStandby"` - MinRequiredEVCModeKey string `xml:"minRequiredEVCModeKey,omitempty"` - ConsolidationNeeded *bool `xml:"consolidationNeeded"` - OfflineFeatureRequirement []VirtualMachineFeatureRequirement `xml:"offlineFeatureRequirement,omitempty"` - FeatureRequirement []VirtualMachineFeatureRequirement `xml:"featureRequirement,omitempty"` - FeatureMask []HostFeatureMask `xml:"featureMask,omitempty"` - VFlashCacheAllocation int64 `xml:"vFlashCacheAllocation,omitempty"` -} - -func init() { - t["VirtualMachineRuntimeInfo"] = reflect.TypeOf((*VirtualMachineRuntimeInfo)(nil)).Elem() -} - -type VirtualMachineRuntimeInfoDasProtectionState struct { - DynamicData - - DasProtected bool `xml:"dasProtected"` -} - -func init() { - t["VirtualMachineRuntimeInfoDasProtectionState"] = reflect.TypeOf((*VirtualMachineRuntimeInfoDasProtectionState)(nil)).Elem() -} - -type VirtualMachineScsiDiskDeviceInfo struct { - VirtualMachineDiskDeviceInfo - - Disk *HostScsiDisk `xml:"disk,omitempty"` - TransportHint string `xml:"transportHint,omitempty"` - LunNumber int `xml:"lunNumber,omitempty"` -} - -func init() { - t["VirtualMachineScsiDiskDeviceInfo"] = reflect.TypeOf((*VirtualMachineScsiDiskDeviceInfo)(nil)).Elem() -} - -type VirtualMachineScsiPassthroughInfo struct { - VirtualMachineTargetInfo - - ScsiClass string `xml:"scsiClass"` - Vendor string `xml:"vendor"` - PhysicalUnitNumber int `xml:"physicalUnitNumber"` -} - -func init() { - t["VirtualMachineScsiPassthroughInfo"] = reflect.TypeOf((*VirtualMachineScsiPassthroughInfo)(nil)).Elem() -} - -type VirtualMachineSerialInfo struct { - VirtualMachineTargetInfo -} - -func init() { - t["VirtualMachineSerialInfo"] = reflect.TypeOf((*VirtualMachineSerialInfo)(nil)).Elem() -} - -type VirtualMachineSnapshotInfo struct { - DynamicData - - CurrentSnapshot *ManagedObjectReference `xml:"currentSnapshot,omitempty"` - RootSnapshotList []VirtualMachineSnapshotTree `xml:"rootSnapshotList"` -} - -func init() { - t["VirtualMachineSnapshotInfo"] = reflect.TypeOf((*VirtualMachineSnapshotInfo)(nil)).Elem() -} - -type VirtualMachineSnapshotTree struct { - DynamicData - - Snapshot ManagedObjectReference `xml:"snapshot"` - Vm ManagedObjectReference `xml:"vm"` - Name string `xml:"name"` - Description string `xml:"description"` - Id int `xml:"id,omitempty"` - CreateTime time.Time `xml:"createTime"` - State VirtualMachinePowerState `xml:"state"` - Quiesced bool `xml:"quiesced"` - BackupManifest string `xml:"backupManifest,omitempty"` - ChildSnapshotList []VirtualMachineSnapshotTree `xml:"childSnapshotList,omitempty"` - ReplaySupported *bool `xml:"replaySupported"` -} - -func init() { - t["VirtualMachineSnapshotTree"] = reflect.TypeOf((*VirtualMachineSnapshotTree)(nil)).Elem() -} - -type VirtualMachineSoundInfo struct { - VirtualMachineTargetInfo -} - -func init() { - t["VirtualMachineSoundInfo"] = reflect.TypeOf((*VirtualMachineSoundInfo)(nil)).Elem() -} - -type VirtualMachineSriovInfo struct { - VirtualMachinePciPassthroughInfo - - VirtualFunction bool `xml:"virtualFunction"` - Pnic string `xml:"pnic,omitempty"` -} - -func init() { - t["VirtualMachineSriovInfo"] = reflect.TypeOf((*VirtualMachineSriovInfo)(nil)).Elem() -} - -type VirtualMachineStorageInfo struct { - DynamicData - - PerDatastoreUsage []VirtualMachineUsageOnDatastore `xml:"perDatastoreUsage,omitempty"` - Timestamp time.Time `xml:"timestamp"` -} - -func init() { - t["VirtualMachineStorageInfo"] = reflect.TypeOf((*VirtualMachineStorageInfo)(nil)).Elem() -} - -type VirtualMachineStorageSummary struct { - DynamicData - - Committed int64 `xml:"committed"` - Uncommitted int64 `xml:"uncommitted"` - Unshared int64 `xml:"unshared"` - Timestamp time.Time `xml:"timestamp"` -} - -func init() { - t["VirtualMachineStorageSummary"] = reflect.TypeOf((*VirtualMachineStorageSummary)(nil)).Elem() -} - -type VirtualMachineSummary struct { - DynamicData - - Vm *ManagedObjectReference `xml:"vm,omitempty"` - Runtime VirtualMachineRuntimeInfo `xml:"runtime"` - Guest *VirtualMachineGuestSummary `xml:"guest,omitempty"` - Config VirtualMachineConfigSummary `xml:"config"` - Storage *VirtualMachineStorageSummary `xml:"storage,omitempty"` - QuickStats VirtualMachineQuickStats `xml:"quickStats"` - OverallStatus ManagedEntityStatus `xml:"overallStatus"` - CustomValue []BaseCustomFieldValue `xml:"customValue,omitempty,typeattr"` -} - -func init() { - t["VirtualMachineSummary"] = reflect.TypeOf((*VirtualMachineSummary)(nil)).Elem() -} - -type VirtualMachineTargetInfo struct { - DynamicData - - Name string `xml:"name"` - ConfigurationTag []string `xml:"configurationTag,omitempty"` -} - -func init() { - t["VirtualMachineTargetInfo"] = reflect.TypeOf((*VirtualMachineTargetInfo)(nil)).Elem() -} - -type VirtualMachineTicket struct { - DynamicData - - Ticket string `xml:"ticket"` - CfgFile string `xml:"cfgFile"` - Host string `xml:"host,omitempty"` - Port int `xml:"port,omitempty"` - SslThumbprint string `xml:"sslThumbprint,omitempty"` -} - -func init() { - t["VirtualMachineTicket"] = reflect.TypeOf((*VirtualMachineTicket)(nil)).Elem() -} - -type VirtualMachineUsageOnDatastore struct { - DynamicData - - Datastore ManagedObjectReference `xml:"datastore"` - Committed int64 `xml:"committed"` - Uncommitted int64 `xml:"uncommitted"` - Unshared int64 `xml:"unshared"` -} - -func init() { - t["VirtualMachineUsageOnDatastore"] = reflect.TypeOf((*VirtualMachineUsageOnDatastore)(nil)).Elem() -} - -type VirtualMachineUsbInfo struct { - VirtualMachineTargetInfo - - Description string `xml:"description"` - Vendor int `xml:"vendor"` - Product int `xml:"product"` - PhysicalPath string `xml:"physicalPath"` - Family []string `xml:"family,omitempty"` - Speed []string `xml:"speed,omitempty"` - Summary *VirtualMachineSummary `xml:"summary,omitempty"` -} - -func init() { - t["VirtualMachineUsbInfo"] = reflect.TypeOf((*VirtualMachineUsbInfo)(nil)).Elem() -} - -type VirtualMachineVFlashModuleInfo struct { - VirtualMachineTargetInfo - - VFlashModule HostVFlashManagerVFlashCacheConfigInfoVFlashModuleConfigOption `xml:"vFlashModule"` -} - -func init() { - t["VirtualMachineVFlashModuleInfo"] = reflect.TypeOf((*VirtualMachineVFlashModuleInfo)(nil)).Elem() -} - -type VirtualMachineVMCIDevice struct { - VirtualDevice - - Id int64 `xml:"id,omitempty"` - AllowUnrestrictedCommunication *bool `xml:"allowUnrestrictedCommunication"` -} - -func init() { - t["VirtualMachineVMCIDevice"] = reflect.TypeOf((*VirtualMachineVMCIDevice)(nil)).Elem() -} - -type VirtualMachineVMCIDeviceOption struct { - VirtualDeviceOption - - AllowUnrestrictedCommunication BoolOption `xml:"allowUnrestrictedCommunication"` -} - -func init() { - t["VirtualMachineVMCIDeviceOption"] = reflect.TypeOf((*VirtualMachineVMCIDeviceOption)(nil)).Elem() -} - -type VirtualMachineVMIROM struct { - VirtualDevice -} - -func init() { - t["VirtualMachineVMIROM"] = reflect.TypeOf((*VirtualMachineVMIROM)(nil)).Elem() -} - -type VirtualMachineVideoCard struct { - VirtualDevice - - VideoRamSizeInKB int64 `xml:"videoRamSizeInKB,omitempty"` - NumDisplays int `xml:"numDisplays,omitempty"` - UseAutoDetect *bool `xml:"useAutoDetect"` - Enable3DSupport *bool `xml:"enable3DSupport"` - Use3dRenderer string `xml:"use3dRenderer,omitempty"` -} - -func init() { - t["VirtualMachineVideoCard"] = reflect.TypeOf((*VirtualMachineVideoCard)(nil)).Elem() -} - -type VirtualMachineWipeResult struct { - DynamicData - - DiskId int `xml:"diskId"` - ShrinkableDiskSpace int64 `xml:"shrinkableDiskSpace"` -} - -func init() { - t["VirtualMachineWipeResult"] = reflect.TypeOf((*VirtualMachineWipeResult)(nil)).Elem() -} - -type VirtualNicManagerNetConfig struct { - DynamicData - - NicType string `xml:"nicType"` - MultiSelectAllowed bool `xml:"multiSelectAllowed"` - CandidateVnic []HostVirtualNic `xml:"candidateVnic,omitempty"` - SelectedVnic []string `xml:"selectedVnic,omitempty"` -} - -func init() { - t["VirtualNicManagerNetConfig"] = reflect.TypeOf((*VirtualNicManagerNetConfig)(nil)).Elem() -} - -type VirtualPCIController struct { - VirtualController -} - -func init() { - t["VirtualPCIController"] = reflect.TypeOf((*VirtualPCIController)(nil)).Elem() -} - -type VirtualPCIControllerOption struct { - VirtualControllerOption - - NumSCSIControllers IntOption `xml:"numSCSIControllers"` - NumEthernetCards IntOption `xml:"numEthernetCards"` - NumVideoCards IntOption `xml:"numVideoCards"` - NumSoundCards IntOption `xml:"numSoundCards"` - NumVmiRoms IntOption `xml:"numVmiRoms"` - NumVmciDevices *IntOption `xml:"numVmciDevices,omitempty"` - NumPCIPassthroughDevices *IntOption `xml:"numPCIPassthroughDevices,omitempty"` - NumSasSCSIControllers *IntOption `xml:"numSasSCSIControllers,omitempty"` - NumVmxnet3EthernetCards *IntOption `xml:"numVmxnet3EthernetCards,omitempty"` - NumParaVirtualSCSIControllers *IntOption `xml:"numParaVirtualSCSIControllers,omitempty"` - NumSATAControllers *IntOption `xml:"numSATAControllers,omitempty"` -} - -func init() { - t["VirtualPCIControllerOption"] = reflect.TypeOf((*VirtualPCIControllerOption)(nil)).Elem() -} - -type VirtualPCIPassthrough struct { - VirtualDevice -} - -func init() { - t["VirtualPCIPassthrough"] = reflect.TypeOf((*VirtualPCIPassthrough)(nil)).Elem() -} - -type VirtualPCIPassthroughDeviceBackingInfo struct { - VirtualDeviceDeviceBackingInfo - - Id string `xml:"id"` - DeviceId string `xml:"deviceId"` - SystemId string `xml:"systemId"` - VendorId int16 `xml:"vendorId"` -} - -func init() { - t["VirtualPCIPassthroughDeviceBackingInfo"] = reflect.TypeOf((*VirtualPCIPassthroughDeviceBackingInfo)(nil)).Elem() -} - -type VirtualPCIPassthroughDeviceBackingOption struct { - VirtualDeviceDeviceBackingOption -} - -func init() { - t["VirtualPCIPassthroughDeviceBackingOption"] = reflect.TypeOf((*VirtualPCIPassthroughDeviceBackingOption)(nil)).Elem() -} - -type VirtualPCIPassthroughOption struct { - VirtualDeviceOption -} - -func init() { - t["VirtualPCIPassthroughOption"] = reflect.TypeOf((*VirtualPCIPassthroughOption)(nil)).Elem() -} - -type VirtualPCNet32 struct { - VirtualEthernetCard -} - -func init() { - t["VirtualPCNet32"] = reflect.TypeOf((*VirtualPCNet32)(nil)).Elem() -} - -type VirtualPCNet32Option struct { - VirtualEthernetCardOption - - SupportsMorphing bool `xml:"supportsMorphing"` -} - -func init() { - t["VirtualPCNet32Option"] = reflect.TypeOf((*VirtualPCNet32Option)(nil)).Elem() -} - -type VirtualPS2Controller struct { - VirtualController -} - -func init() { - t["VirtualPS2Controller"] = reflect.TypeOf((*VirtualPS2Controller)(nil)).Elem() -} - -type VirtualPS2ControllerOption struct { - VirtualControllerOption - - NumKeyboards IntOption `xml:"numKeyboards"` - NumPointingDevices IntOption `xml:"numPointingDevices"` -} - -func init() { - t["VirtualPS2ControllerOption"] = reflect.TypeOf((*VirtualPS2ControllerOption)(nil)).Elem() -} - -type VirtualParallelPort struct { - VirtualDevice -} - -func init() { - t["VirtualParallelPort"] = reflect.TypeOf((*VirtualParallelPort)(nil)).Elem() -} - -type VirtualParallelPortDeviceBackingInfo struct { - VirtualDeviceDeviceBackingInfo -} - -func init() { - t["VirtualParallelPortDeviceBackingInfo"] = reflect.TypeOf((*VirtualParallelPortDeviceBackingInfo)(nil)).Elem() -} - -type VirtualParallelPortDeviceBackingOption struct { - VirtualDeviceDeviceBackingOption -} - -func init() { - t["VirtualParallelPortDeviceBackingOption"] = reflect.TypeOf((*VirtualParallelPortDeviceBackingOption)(nil)).Elem() -} - -type VirtualParallelPortFileBackingInfo struct { - VirtualDeviceFileBackingInfo -} - -func init() { - t["VirtualParallelPortFileBackingInfo"] = reflect.TypeOf((*VirtualParallelPortFileBackingInfo)(nil)).Elem() -} - -type VirtualParallelPortFileBackingOption struct { - VirtualDeviceFileBackingOption -} - -func init() { - t["VirtualParallelPortFileBackingOption"] = reflect.TypeOf((*VirtualParallelPortFileBackingOption)(nil)).Elem() -} - -type VirtualParallelPortOption struct { - VirtualDeviceOption -} - -func init() { - t["VirtualParallelPortOption"] = reflect.TypeOf((*VirtualParallelPortOption)(nil)).Elem() -} - -type VirtualPointingDevice struct { - VirtualDevice -} - -func init() { - t["VirtualPointingDevice"] = reflect.TypeOf((*VirtualPointingDevice)(nil)).Elem() -} - -type VirtualPointingDeviceBackingOption struct { - VirtualDeviceDeviceBackingOption - - HostPointingDevice ChoiceOption `xml:"hostPointingDevice"` -} - -func init() { - t["VirtualPointingDeviceBackingOption"] = reflect.TypeOf((*VirtualPointingDeviceBackingOption)(nil)).Elem() -} - -type VirtualPointingDeviceDeviceBackingInfo struct { - VirtualDeviceDeviceBackingInfo - - HostPointingDevice string `xml:"hostPointingDevice"` -} - -func init() { - t["VirtualPointingDeviceDeviceBackingInfo"] = reflect.TypeOf((*VirtualPointingDeviceDeviceBackingInfo)(nil)).Elem() -} - -type VirtualPointingDeviceOption struct { - VirtualDeviceOption -} - -func init() { - t["VirtualPointingDeviceOption"] = reflect.TypeOf((*VirtualPointingDeviceOption)(nil)).Elem() -} - -type VirtualSATAController struct { - VirtualController -} - -func init() { - t["VirtualSATAController"] = reflect.TypeOf((*VirtualSATAController)(nil)).Elem() -} - -type VirtualSATAControllerOption struct { - VirtualControllerOption - - NumSATADisks IntOption `xml:"numSATADisks"` - NumSATACdroms IntOption `xml:"numSATACdroms"` -} - -func init() { - t["VirtualSATAControllerOption"] = reflect.TypeOf((*VirtualSATAControllerOption)(nil)).Elem() -} - -type VirtualSCSIController struct { - VirtualController - - HotAddRemove *bool `xml:"hotAddRemove"` - SharedBus VirtualSCSISharing `xml:"sharedBus"` - ScsiCtlrUnitNumber int `xml:"scsiCtlrUnitNumber,omitempty"` -} - -func init() { - t["VirtualSCSIController"] = reflect.TypeOf((*VirtualSCSIController)(nil)).Elem() -} - -type VirtualSCSIControllerOption struct { - VirtualControllerOption - - NumSCSIDisks IntOption `xml:"numSCSIDisks"` - NumSCSICdroms IntOption `xml:"numSCSICdroms"` - NumSCSIPassthrough IntOption `xml:"numSCSIPassthrough"` - Sharing []VirtualSCSISharing `xml:"sharing"` - DefaultSharedIndex int `xml:"defaultSharedIndex"` - HotAddRemove BoolOption `xml:"hotAddRemove"` - ScsiCtlrUnitNumber int `xml:"scsiCtlrUnitNumber"` -} - -func init() { - t["VirtualSCSIControllerOption"] = reflect.TypeOf((*VirtualSCSIControllerOption)(nil)).Elem() -} - -type VirtualSCSIPassthrough struct { - VirtualDevice -} - -func init() { - t["VirtualSCSIPassthrough"] = reflect.TypeOf((*VirtualSCSIPassthrough)(nil)).Elem() -} - -type VirtualSCSIPassthroughDeviceBackingInfo struct { - VirtualDeviceDeviceBackingInfo -} - -func init() { - t["VirtualSCSIPassthroughDeviceBackingInfo"] = reflect.TypeOf((*VirtualSCSIPassthroughDeviceBackingInfo)(nil)).Elem() -} - -type VirtualSCSIPassthroughDeviceBackingOption struct { - VirtualDeviceDeviceBackingOption -} - -func init() { - t["VirtualSCSIPassthroughDeviceBackingOption"] = reflect.TypeOf((*VirtualSCSIPassthroughDeviceBackingOption)(nil)).Elem() -} - -type VirtualSCSIPassthroughOption struct { - VirtualDeviceOption -} - -func init() { - t["VirtualSCSIPassthroughOption"] = reflect.TypeOf((*VirtualSCSIPassthroughOption)(nil)).Elem() -} - -type VirtualSIOController struct { - VirtualController -} - -func init() { - t["VirtualSIOController"] = reflect.TypeOf((*VirtualSIOController)(nil)).Elem() -} - -type VirtualSIOControllerOption struct { - VirtualControllerOption - - NumFloppyDrives IntOption `xml:"numFloppyDrives"` - NumSerialPorts IntOption `xml:"numSerialPorts"` - NumParallelPorts IntOption `xml:"numParallelPorts"` -} - -func init() { - t["VirtualSIOControllerOption"] = reflect.TypeOf((*VirtualSIOControllerOption)(nil)).Elem() -} - -type VirtualSerialPort struct { - VirtualDevice - - YieldOnPoll bool `xml:"yieldOnPoll"` -} - -func init() { - t["VirtualSerialPort"] = reflect.TypeOf((*VirtualSerialPort)(nil)).Elem() -} - -type VirtualSerialPortDeviceBackingInfo struct { - VirtualDeviceDeviceBackingInfo -} - -func init() { - t["VirtualSerialPortDeviceBackingInfo"] = reflect.TypeOf((*VirtualSerialPortDeviceBackingInfo)(nil)).Elem() -} - -type VirtualSerialPortDeviceBackingOption struct { - VirtualDeviceDeviceBackingOption -} - -func init() { - t["VirtualSerialPortDeviceBackingOption"] = reflect.TypeOf((*VirtualSerialPortDeviceBackingOption)(nil)).Elem() -} - -type VirtualSerialPortFileBackingInfo struct { - VirtualDeviceFileBackingInfo -} - -func init() { - t["VirtualSerialPortFileBackingInfo"] = reflect.TypeOf((*VirtualSerialPortFileBackingInfo)(nil)).Elem() -} - -type VirtualSerialPortFileBackingOption struct { - VirtualDeviceFileBackingOption -} - -func init() { - t["VirtualSerialPortFileBackingOption"] = reflect.TypeOf((*VirtualSerialPortFileBackingOption)(nil)).Elem() -} - -type VirtualSerialPortOption struct { - VirtualDeviceOption - - YieldOnPoll BoolOption `xml:"yieldOnPoll"` -} - -func init() { - t["VirtualSerialPortOption"] = reflect.TypeOf((*VirtualSerialPortOption)(nil)).Elem() -} - -type VirtualSerialPortPipeBackingInfo struct { - VirtualDevicePipeBackingInfo - - Endpoint string `xml:"endpoint"` - NoRxLoss *bool `xml:"noRxLoss"` -} - -func init() { - t["VirtualSerialPortPipeBackingInfo"] = reflect.TypeOf((*VirtualSerialPortPipeBackingInfo)(nil)).Elem() -} - -type VirtualSerialPortPipeBackingOption struct { - VirtualDevicePipeBackingOption - - Endpoint ChoiceOption `xml:"endpoint"` - NoRxLoss BoolOption `xml:"noRxLoss"` -} - -func init() { - t["VirtualSerialPortPipeBackingOption"] = reflect.TypeOf((*VirtualSerialPortPipeBackingOption)(nil)).Elem() -} - -type VirtualSerialPortThinPrintBackingInfo struct { - VirtualDeviceBackingInfo -} - -func init() { - t["VirtualSerialPortThinPrintBackingInfo"] = reflect.TypeOf((*VirtualSerialPortThinPrintBackingInfo)(nil)).Elem() -} - -type VirtualSerialPortThinPrintBackingOption struct { - VirtualDeviceBackingOption -} - -func init() { - t["VirtualSerialPortThinPrintBackingOption"] = reflect.TypeOf((*VirtualSerialPortThinPrintBackingOption)(nil)).Elem() -} - -type VirtualSerialPortURIBackingInfo struct { - VirtualDeviceURIBackingInfo -} - -func init() { - t["VirtualSerialPortURIBackingInfo"] = reflect.TypeOf((*VirtualSerialPortURIBackingInfo)(nil)).Elem() -} - -type VirtualSerialPortURIBackingOption struct { - VirtualDeviceURIBackingOption -} - -func init() { - t["VirtualSerialPortURIBackingOption"] = reflect.TypeOf((*VirtualSerialPortURIBackingOption)(nil)).Elem() -} - -type VirtualSoundBlaster16 struct { - VirtualSoundCard -} - -func init() { - t["VirtualSoundBlaster16"] = reflect.TypeOf((*VirtualSoundBlaster16)(nil)).Elem() -} - -type VirtualSoundBlaster16Option struct { - VirtualSoundCardOption -} - -func init() { - t["VirtualSoundBlaster16Option"] = reflect.TypeOf((*VirtualSoundBlaster16Option)(nil)).Elem() -} - -type VirtualSoundCard struct { - VirtualDevice -} - -func init() { - t["VirtualSoundCard"] = reflect.TypeOf((*VirtualSoundCard)(nil)).Elem() -} - -type VirtualSoundCardDeviceBackingInfo struct { - VirtualDeviceDeviceBackingInfo -} - -func init() { - t["VirtualSoundCardDeviceBackingInfo"] = reflect.TypeOf((*VirtualSoundCardDeviceBackingInfo)(nil)).Elem() -} - -type VirtualSoundCardDeviceBackingOption struct { - VirtualDeviceDeviceBackingOption -} - -func init() { - t["VirtualSoundCardDeviceBackingOption"] = reflect.TypeOf((*VirtualSoundCardDeviceBackingOption)(nil)).Elem() -} - -type VirtualSoundCardOption struct { - VirtualDeviceOption -} - -func init() { - t["VirtualSoundCardOption"] = reflect.TypeOf((*VirtualSoundCardOption)(nil)).Elem() -} - -type VirtualSriovEthernetCard struct { - VirtualEthernetCard - - AllowGuestOSMtuChange *bool `xml:"allowGuestOSMtuChange"` - SriovBacking *VirtualSriovEthernetCardSriovBackingInfo `xml:"sriovBacking,omitempty"` -} - -func init() { - t["VirtualSriovEthernetCard"] = reflect.TypeOf((*VirtualSriovEthernetCard)(nil)).Elem() -} - -type VirtualSriovEthernetCardOption struct { - VirtualEthernetCardOption -} - -func init() { - t["VirtualSriovEthernetCardOption"] = reflect.TypeOf((*VirtualSriovEthernetCardOption)(nil)).Elem() -} - -type VirtualSriovEthernetCardSriovBackingInfo struct { - VirtualDeviceBackingInfo - - PhysicalFunctionBacking *VirtualPCIPassthroughDeviceBackingInfo `xml:"physicalFunctionBacking,omitempty"` - VirtualFunctionBacking *VirtualPCIPassthroughDeviceBackingInfo `xml:"virtualFunctionBacking,omitempty"` - VirtualFunctionIndex int `xml:"virtualFunctionIndex,omitempty"` -} - -func init() { - t["VirtualSriovEthernetCardSriovBackingInfo"] = reflect.TypeOf((*VirtualSriovEthernetCardSriovBackingInfo)(nil)).Elem() -} - -type VirtualSriovEthernetCardSriovBackingOption struct { - VirtualDeviceBackingOption -} - -func init() { - t["VirtualSriovEthernetCardSriovBackingOption"] = reflect.TypeOf((*VirtualSriovEthernetCardSriovBackingOption)(nil)).Elem() -} - -type VirtualSwitchProfile struct { - ApplyProfile - - Key string `xml:"key"` - Name string `xml:"name"` - Link LinkProfile `xml:"link"` - NumPorts NumPortsProfile `xml:"numPorts"` - NetworkPolicy NetworkPolicyProfile `xml:"networkPolicy"` -} - -func init() { - t["VirtualSwitchProfile"] = reflect.TypeOf((*VirtualSwitchProfile)(nil)).Elem() -} - -type VirtualSwitchSelectionProfile struct { - ApplyProfile -} - -func init() { - t["VirtualSwitchSelectionProfile"] = reflect.TypeOf((*VirtualSwitchSelectionProfile)(nil)).Elem() -} - -type VirtualUSB struct { - VirtualDevice - - Connected bool `xml:"connected"` - Vendor int `xml:"vendor,omitempty"` - Product int `xml:"product,omitempty"` - Family []string `xml:"family,omitempty"` - Speed []string `xml:"speed,omitempty"` -} - -func init() { - t["VirtualUSB"] = reflect.TypeOf((*VirtualUSB)(nil)).Elem() -} - -type VirtualUSBController struct { - VirtualController - - AutoConnectDevices *bool `xml:"autoConnectDevices"` - EhciEnabled *bool `xml:"ehciEnabled"` -} - -func init() { - t["VirtualUSBController"] = reflect.TypeOf((*VirtualUSBController)(nil)).Elem() -} - -type VirtualUSBControllerOption struct { - VirtualControllerOption - - AutoConnectDevices BoolOption `xml:"autoConnectDevices"` - EhciSupported BoolOption `xml:"ehciSupported"` - SupportedSpeeds []string `xml:"supportedSpeeds,omitempty"` -} - -func init() { - t["VirtualUSBControllerOption"] = reflect.TypeOf((*VirtualUSBControllerOption)(nil)).Elem() -} - -type VirtualUSBControllerPciBusSlotInfo struct { - VirtualDevicePciBusSlotInfo - - EhciPciSlotNumber int `xml:"ehciPciSlotNumber,omitempty"` -} - -func init() { - t["VirtualUSBControllerPciBusSlotInfo"] = reflect.TypeOf((*VirtualUSBControllerPciBusSlotInfo)(nil)).Elem() -} - -type VirtualUSBOption struct { - VirtualDeviceOption -} - -func init() { - t["VirtualUSBOption"] = reflect.TypeOf((*VirtualUSBOption)(nil)).Elem() -} - -type VirtualUSBRemoteClientBackingInfo struct { - VirtualDeviceRemoteDeviceBackingInfo - - Hostname string `xml:"hostname"` -} - -func init() { - t["VirtualUSBRemoteClientBackingInfo"] = reflect.TypeOf((*VirtualUSBRemoteClientBackingInfo)(nil)).Elem() -} - -type VirtualUSBRemoteClientBackingOption struct { - VirtualDeviceRemoteDeviceBackingOption -} - -func init() { - t["VirtualUSBRemoteClientBackingOption"] = reflect.TypeOf((*VirtualUSBRemoteClientBackingOption)(nil)).Elem() -} - -type VirtualUSBRemoteHostBackingInfo struct { - VirtualDeviceDeviceBackingInfo - - Hostname string `xml:"hostname"` -} - -func init() { - t["VirtualUSBRemoteHostBackingInfo"] = reflect.TypeOf((*VirtualUSBRemoteHostBackingInfo)(nil)).Elem() -} - -type VirtualUSBRemoteHostBackingOption struct { - VirtualDeviceDeviceBackingOption -} - -func init() { - t["VirtualUSBRemoteHostBackingOption"] = reflect.TypeOf((*VirtualUSBRemoteHostBackingOption)(nil)).Elem() -} - -type VirtualUSBUSBBackingInfo struct { - VirtualDeviceDeviceBackingInfo -} - -func init() { - t["VirtualUSBUSBBackingInfo"] = reflect.TypeOf((*VirtualUSBUSBBackingInfo)(nil)).Elem() -} - -type VirtualUSBUSBBackingOption struct { - VirtualDeviceDeviceBackingOption -} - -func init() { - t["VirtualUSBUSBBackingOption"] = reflect.TypeOf((*VirtualUSBUSBBackingOption)(nil)).Elem() -} - -type VirtualUSBXHCIController struct { - VirtualController - - AutoConnectDevices *bool `xml:"autoConnectDevices"` -} - -func init() { - t["VirtualUSBXHCIController"] = reflect.TypeOf((*VirtualUSBXHCIController)(nil)).Elem() -} - -type VirtualUSBXHCIControllerOption struct { - VirtualControllerOption - - AutoConnectDevices BoolOption `xml:"autoConnectDevices"` - SupportedSpeeds []string `xml:"supportedSpeeds"` -} - -func init() { - t["VirtualUSBXHCIControllerOption"] = reflect.TypeOf((*VirtualUSBXHCIControllerOption)(nil)).Elem() -} - -type VirtualVMIROMOption struct { - VirtualDeviceOption -} - -func init() { - t["VirtualVMIROMOption"] = reflect.TypeOf((*VirtualVMIROMOption)(nil)).Elem() -} - -type VirtualVideoCardOption struct { - VirtualDeviceOption - - VideoRamSizeInKB *LongOption `xml:"videoRamSizeInKB,omitempty"` - NumDisplays *IntOption `xml:"numDisplays,omitempty"` - UseAutoDetect *BoolOption `xml:"useAutoDetect,omitempty"` - Support3D *BoolOption `xml:"support3D,omitempty"` - Use3dRendererSupported *BoolOption `xml:"use3dRendererSupported,omitempty"` -} - -func init() { - t["VirtualVideoCardOption"] = reflect.TypeOf((*VirtualVideoCardOption)(nil)).Elem() -} - -type VirtualVmxnet struct { - VirtualEthernetCard -} - -func init() { - t["VirtualVmxnet"] = reflect.TypeOf((*VirtualVmxnet)(nil)).Elem() -} - -type VirtualVmxnet2 struct { - VirtualVmxnet -} - -func init() { - t["VirtualVmxnet2"] = reflect.TypeOf((*VirtualVmxnet2)(nil)).Elem() -} - -type VirtualVmxnet2Option struct { - VirtualVmxnetOption -} - -func init() { - t["VirtualVmxnet2Option"] = reflect.TypeOf((*VirtualVmxnet2Option)(nil)).Elem() -} - -type VirtualVmxnet3 struct { - VirtualVmxnet -} - -func init() { - t["VirtualVmxnet3"] = reflect.TypeOf((*VirtualVmxnet3)(nil)).Elem() -} - -type VirtualVmxnet3Option struct { - VirtualVmxnetOption -} - -func init() { - t["VirtualVmxnet3Option"] = reflect.TypeOf((*VirtualVmxnet3Option)(nil)).Elem() -} - -type VirtualVmxnetOption struct { - VirtualEthernetCardOption -} - -func init() { - t["VirtualVmxnetOption"] = reflect.TypeOf((*VirtualVmxnetOption)(nil)).Elem() -} - -type VlanProfile struct { - ApplyProfile -} - -func init() { - t["VlanProfile"] = reflect.TypeOf((*VlanProfile)(nil)).Elem() -} - -type VmAcquiredMksTicketEvent struct { - VmEvent -} - -func init() { - t["VmAcquiredMksTicketEvent"] = reflect.TypeOf((*VmAcquiredMksTicketEvent)(nil)).Elem() -} - -type VmAcquiredTicketEvent struct { - VmEvent - - TicketType string `xml:"ticketType"` -} - -func init() { - t["VmAcquiredTicketEvent"] = reflect.TypeOf((*VmAcquiredTicketEvent)(nil)).Elem() -} - -type VmAlreadyExistsInDatacenter struct { - InvalidFolder - - Host ManagedObjectReference `xml:"host"` - Hostname string `xml:"hostname"` - Vm []ManagedObjectReference `xml:"vm"` -} - -func init() { - t["VmAlreadyExistsInDatacenter"] = reflect.TypeOf((*VmAlreadyExistsInDatacenter)(nil)).Elem() -} - -type VmAlreadyExistsInDatacenterFault VmAlreadyExistsInDatacenter - -func init() { - t["VmAlreadyExistsInDatacenterFault"] = reflect.TypeOf((*VmAlreadyExistsInDatacenterFault)(nil)).Elem() -} - -type VmAutoRenameEvent struct { - VmEvent - - OldName string `xml:"oldName"` - NewName string `xml:"newName"` -} - -func init() { - t["VmAutoRenameEvent"] = reflect.TypeOf((*VmAutoRenameEvent)(nil)).Elem() -} - -type VmBeingClonedEvent struct { - VmCloneEvent - - DestFolder FolderEventArgument `xml:"destFolder"` - DestName string `xml:"destName"` - DestHost HostEventArgument `xml:"destHost"` -} - -func init() { - t["VmBeingClonedEvent"] = reflect.TypeOf((*VmBeingClonedEvent)(nil)).Elem() -} - -type VmBeingClonedNoFolderEvent struct { - VmCloneEvent - - DestName string `xml:"destName"` - DestHost HostEventArgument `xml:"destHost"` -} - -func init() { - t["VmBeingClonedNoFolderEvent"] = reflect.TypeOf((*VmBeingClonedNoFolderEvent)(nil)).Elem() -} - -type VmBeingCreatedEvent struct { - VmEvent - - ConfigSpec *VirtualMachineConfigSpec `xml:"configSpec,omitempty"` -} - -func init() { - t["VmBeingCreatedEvent"] = reflect.TypeOf((*VmBeingCreatedEvent)(nil)).Elem() -} - -type VmBeingDeployedEvent struct { - VmEvent - - SrcTemplate VmEventArgument `xml:"srcTemplate"` -} - -func init() { - t["VmBeingDeployedEvent"] = reflect.TypeOf((*VmBeingDeployedEvent)(nil)).Elem() -} - -type VmBeingHotMigratedEvent struct { - VmEvent - - DestHost HostEventArgument `xml:"destHost"` - DestDatacenter *DatacenterEventArgument `xml:"destDatacenter,omitempty"` - DestDatastore *DatastoreEventArgument `xml:"destDatastore,omitempty"` -} - -func init() { - t["VmBeingHotMigratedEvent"] = reflect.TypeOf((*VmBeingHotMigratedEvent)(nil)).Elem() -} - -type VmBeingMigratedEvent struct { - VmEvent - - DestHost HostEventArgument `xml:"destHost"` - DestDatacenter *DatacenterEventArgument `xml:"destDatacenter,omitempty"` - DestDatastore *DatastoreEventArgument `xml:"destDatastore,omitempty"` -} - -func init() { - t["VmBeingMigratedEvent"] = reflect.TypeOf((*VmBeingMigratedEvent)(nil)).Elem() -} - -type VmBeingRelocatedEvent struct { - VmRelocateSpecEvent - - DestHost HostEventArgument `xml:"destHost"` - DestDatacenter *DatacenterEventArgument `xml:"destDatacenter,omitempty"` - DestDatastore *DatastoreEventArgument `xml:"destDatastore,omitempty"` -} - -func init() { - t["VmBeingRelocatedEvent"] = reflect.TypeOf((*VmBeingRelocatedEvent)(nil)).Elem() -} - -type VmCloneEvent struct { - VmEvent -} - -func init() { - t["VmCloneEvent"] = reflect.TypeOf((*VmCloneEvent)(nil)).Elem() -} - -type VmCloneFailedEvent struct { - VmCloneEvent - - DestFolder FolderEventArgument `xml:"destFolder"` - DestName string `xml:"destName"` - DestHost HostEventArgument `xml:"destHost"` - Reason LocalizedMethodFault `xml:"reason"` -} - -func init() { - t["VmCloneFailedEvent"] = reflect.TypeOf((*VmCloneFailedEvent)(nil)).Elem() -} - -type VmClonedEvent struct { - VmCloneEvent - - SourceVm VmEventArgument `xml:"sourceVm"` -} - -func init() { - t["VmClonedEvent"] = reflect.TypeOf((*VmClonedEvent)(nil)).Elem() -} - -type VmConfigFault struct { - VimFault -} - -func init() { - t["VmConfigFault"] = reflect.TypeOf((*VmConfigFault)(nil)).Elem() -} - -type VmConfigFaultFault BaseVmConfigFault - -func init() { - t["VmConfigFaultFault"] = reflect.TypeOf((*VmConfigFaultFault)(nil)).Elem() -} - -type VmConfigFileInfo struct { - FileInfo - - ConfigVersion int `xml:"configVersion,omitempty"` -} - -func init() { - t["VmConfigFileInfo"] = reflect.TypeOf((*VmConfigFileInfo)(nil)).Elem() -} - -type VmConfigFileQuery struct { - FileQuery - - Filter *VmConfigFileQueryFilter `xml:"filter,omitempty"` - Details *VmConfigFileQueryFlags `xml:"details,omitempty"` -} - -func init() { - t["VmConfigFileQuery"] = reflect.TypeOf((*VmConfigFileQuery)(nil)).Elem() -} - -type VmConfigFileQueryFilter struct { - DynamicData - - MatchConfigVersion []int `xml:"matchConfigVersion,omitempty"` -} - -func init() { - t["VmConfigFileQueryFilter"] = reflect.TypeOf((*VmConfigFileQueryFilter)(nil)).Elem() -} - -type VmConfigFileQueryFlags struct { - DynamicData - - ConfigVersion bool `xml:"configVersion"` -} - -func init() { - t["VmConfigFileQueryFlags"] = reflect.TypeOf((*VmConfigFileQueryFlags)(nil)).Elem() -} - -type VmConfigIncompatibleForFaultTolerance struct { - VmConfigFault - - Fault *LocalizedMethodFault `xml:"fault,omitempty"` -} - -func init() { - t["VmConfigIncompatibleForFaultTolerance"] = reflect.TypeOf((*VmConfigIncompatibleForFaultTolerance)(nil)).Elem() -} - -type VmConfigIncompatibleForFaultToleranceFault VmConfigIncompatibleForFaultTolerance - -func init() { - t["VmConfigIncompatibleForFaultToleranceFault"] = reflect.TypeOf((*VmConfigIncompatibleForFaultToleranceFault)(nil)).Elem() -} - -type VmConfigIncompatibleForRecordReplay struct { - VmConfigFault - - Fault *LocalizedMethodFault `xml:"fault,omitempty"` -} - -func init() { - t["VmConfigIncompatibleForRecordReplay"] = reflect.TypeOf((*VmConfigIncompatibleForRecordReplay)(nil)).Elem() -} - -type VmConfigIncompatibleForRecordReplayFault VmConfigIncompatibleForRecordReplay - -func init() { - t["VmConfigIncompatibleForRecordReplayFault"] = reflect.TypeOf((*VmConfigIncompatibleForRecordReplayFault)(nil)).Elem() -} - -type VmConfigInfo struct { - DynamicData - - Product []VAppProductInfo `xml:"product,omitempty"` - Property []VAppPropertyInfo `xml:"property,omitempty"` - IpAssignment VAppIPAssignmentInfo `xml:"ipAssignment"` - Eula []string `xml:"eula,omitempty"` - OvfSection []VAppOvfSectionInfo `xml:"ovfSection,omitempty"` - OvfEnvironmentTransport []string `xml:"ovfEnvironmentTransport,omitempty"` - InstallBootRequired bool `xml:"installBootRequired"` - InstallBootStopDelay int `xml:"installBootStopDelay"` -} - -func init() { - t["VmConfigInfo"] = reflect.TypeOf((*VmConfigInfo)(nil)).Elem() -} - -type VmConfigMissingEvent struct { - VmEvent -} - -func init() { - t["VmConfigMissingEvent"] = reflect.TypeOf((*VmConfigMissingEvent)(nil)).Elem() -} - -type VmConfigSpec struct { - DynamicData - - Product []VAppProductSpec `xml:"product,omitempty"` - Property []VAppPropertySpec `xml:"property,omitempty"` - IpAssignment *VAppIPAssignmentInfo `xml:"ipAssignment,omitempty"` - Eula []string `xml:"eula,omitempty"` - OvfSection []VAppOvfSectionSpec `xml:"ovfSection,omitempty"` - OvfEnvironmentTransport []string `xml:"ovfEnvironmentTransport,omitempty"` - InstallBootRequired *bool `xml:"installBootRequired"` - InstallBootStopDelay int `xml:"installBootStopDelay,omitempty"` -} - -func init() { - t["VmConfigSpec"] = reflect.TypeOf((*VmConfigSpec)(nil)).Elem() -} - -type VmConnectedEvent struct { - VmEvent -} - -func init() { - t["VmConnectedEvent"] = reflect.TypeOf((*VmConnectedEvent)(nil)).Elem() -} - -type VmCreatedEvent struct { - VmEvent -} - -func init() { - t["VmCreatedEvent"] = reflect.TypeOf((*VmCreatedEvent)(nil)).Elem() -} - -type VmDasBeingResetEvent struct { - VmEvent - - Reason string `xml:"reason,omitempty"` -} - -func init() { - t["VmDasBeingResetEvent"] = reflect.TypeOf((*VmDasBeingResetEvent)(nil)).Elem() -} - -type VmDasBeingResetWithScreenshotEvent struct { - VmDasBeingResetEvent - - ScreenshotFilePath string `xml:"screenshotFilePath"` -} - -func init() { - t["VmDasBeingResetWithScreenshotEvent"] = reflect.TypeOf((*VmDasBeingResetWithScreenshotEvent)(nil)).Elem() -} - -type VmDasResetFailedEvent struct { - VmEvent -} - -func init() { - t["VmDasResetFailedEvent"] = reflect.TypeOf((*VmDasResetFailedEvent)(nil)).Elem() -} - -type VmDasUpdateErrorEvent struct { - VmEvent -} - -func init() { - t["VmDasUpdateErrorEvent"] = reflect.TypeOf((*VmDasUpdateErrorEvent)(nil)).Elem() -} - -type VmDasUpdateOkEvent struct { - VmEvent -} - -func init() { - t["VmDasUpdateOkEvent"] = reflect.TypeOf((*VmDasUpdateOkEvent)(nil)).Elem() -} - -type VmDateRolledBackEvent struct { - VmEvent -} - -func init() { - t["VmDateRolledBackEvent"] = reflect.TypeOf((*VmDateRolledBackEvent)(nil)).Elem() -} - -type VmDeployFailedEvent struct { - VmEvent - - DestDatastore BaseEntityEventArgument `xml:"destDatastore,typeattr"` - Reason LocalizedMethodFault `xml:"reason"` -} - -func init() { - t["VmDeployFailedEvent"] = reflect.TypeOf((*VmDeployFailedEvent)(nil)).Elem() -} - -type VmDeployedEvent struct { - VmEvent - - SrcTemplate VmEventArgument `xml:"srcTemplate"` -} - -func init() { - t["VmDeployedEvent"] = reflect.TypeOf((*VmDeployedEvent)(nil)).Elem() -} - -type VmDisconnectedEvent struct { - VmEvent -} - -func init() { - t["VmDisconnectedEvent"] = reflect.TypeOf((*VmDisconnectedEvent)(nil)).Elem() -} - -type VmDiscoveredEvent struct { - VmEvent -} - -func init() { - t["VmDiscoveredEvent"] = reflect.TypeOf((*VmDiscoveredEvent)(nil)).Elem() -} - -type VmDiskFailedEvent struct { - VmEvent - - Disk string `xml:"disk"` - Reason LocalizedMethodFault `xml:"reason"` -} - -func init() { - t["VmDiskFailedEvent"] = reflect.TypeOf((*VmDiskFailedEvent)(nil)).Elem() -} - -type VmDiskFileInfo struct { - FileInfo - - DiskType string `xml:"diskType,omitempty"` - CapacityKb int64 `xml:"capacityKb,omitempty"` - HardwareVersion int `xml:"hardwareVersion,omitempty"` - ControllerType string `xml:"controllerType,omitempty"` - DiskExtents []string `xml:"diskExtents,omitempty"` - Thin *bool `xml:"thin"` -} - -func init() { - t["VmDiskFileInfo"] = reflect.TypeOf((*VmDiskFileInfo)(nil)).Elem() -} - -type VmDiskFileQuery struct { - FileQuery - - Filter *VmDiskFileQueryFilter `xml:"filter,omitempty"` - Details *VmDiskFileQueryFlags `xml:"details,omitempty"` -} - -func init() { - t["VmDiskFileQuery"] = reflect.TypeOf((*VmDiskFileQuery)(nil)).Elem() -} - -type VmDiskFileQueryFilter struct { - DynamicData - - DiskType []string `xml:"diskType,omitempty"` - MatchHardwareVersion []int `xml:"matchHardwareVersion,omitempty"` - ControllerType []string `xml:"controllerType,omitempty"` - Thin *bool `xml:"thin"` -} - -func init() { - t["VmDiskFileQueryFilter"] = reflect.TypeOf((*VmDiskFileQueryFilter)(nil)).Elem() -} - -type VmDiskFileQueryFlags struct { - DynamicData - - DiskType bool `xml:"diskType"` - CapacityKb bool `xml:"capacityKb"` - HardwareVersion bool `xml:"hardwareVersion"` - ControllerType *bool `xml:"controllerType"` - DiskExtents *bool `xml:"diskExtents"` - Thin *bool `xml:"thin"` -} - -func init() { - t["VmDiskFileQueryFlags"] = reflect.TypeOf((*VmDiskFileQueryFlags)(nil)).Elem() -} - -type VmEmigratingEvent struct { - VmEvent -} - -func init() { - t["VmEmigratingEvent"] = reflect.TypeOf((*VmEmigratingEvent)(nil)).Elem() -} - -type VmEndRecordingEvent struct { - VmEvent -} - -func init() { - t["VmEndRecordingEvent"] = reflect.TypeOf((*VmEndRecordingEvent)(nil)).Elem() -} - -type VmEndReplayingEvent struct { - VmEvent -} - -func init() { - t["VmEndReplayingEvent"] = reflect.TypeOf((*VmEndReplayingEvent)(nil)).Elem() -} - -type VmEvent struct { - Event - - Template bool `xml:"template"` -} - -func init() { - t["VmEvent"] = reflect.TypeOf((*VmEvent)(nil)).Elem() -} - -type VmEventArgument struct { - EntityEventArgument - - Vm ManagedObjectReference `xml:"vm"` -} - -func init() { - t["VmEventArgument"] = reflect.TypeOf((*VmEventArgument)(nil)).Elem() -} - -type VmFailedMigrateEvent struct { - VmEvent - - DestHost HostEventArgument `xml:"destHost"` - Reason LocalizedMethodFault `xml:"reason"` - DestDatacenter *DatacenterEventArgument `xml:"destDatacenter,omitempty"` - DestDatastore *DatastoreEventArgument `xml:"destDatastore,omitempty"` -} - -func init() { - t["VmFailedMigrateEvent"] = reflect.TypeOf((*VmFailedMigrateEvent)(nil)).Elem() -} - -type VmFailedRelayoutEvent struct { - VmEvent - - Reason LocalizedMethodFault `xml:"reason"` -} - -func init() { - t["VmFailedRelayoutEvent"] = reflect.TypeOf((*VmFailedRelayoutEvent)(nil)).Elem() -} - -type VmFailedRelayoutOnVmfs2DatastoreEvent struct { - VmEvent -} - -func init() { - t["VmFailedRelayoutOnVmfs2DatastoreEvent"] = reflect.TypeOf((*VmFailedRelayoutOnVmfs2DatastoreEvent)(nil)).Elem() -} - -type VmFailedStartingSecondaryEvent struct { - VmEvent - - Reason string `xml:"reason,omitempty"` -} - -func init() { - t["VmFailedStartingSecondaryEvent"] = reflect.TypeOf((*VmFailedStartingSecondaryEvent)(nil)).Elem() -} - -type VmFailedToPowerOffEvent struct { - VmEvent - - Reason LocalizedMethodFault `xml:"reason"` -} - -func init() { - t["VmFailedToPowerOffEvent"] = reflect.TypeOf((*VmFailedToPowerOffEvent)(nil)).Elem() -} - -type VmFailedToPowerOnEvent struct { - VmEvent - - Reason LocalizedMethodFault `xml:"reason"` -} - -func init() { - t["VmFailedToPowerOnEvent"] = reflect.TypeOf((*VmFailedToPowerOnEvent)(nil)).Elem() -} - -type VmFailedToRebootGuestEvent struct { - VmEvent - - Reason LocalizedMethodFault `xml:"reason"` -} - -func init() { - t["VmFailedToRebootGuestEvent"] = reflect.TypeOf((*VmFailedToRebootGuestEvent)(nil)).Elem() -} - -type VmFailedToResetEvent struct { - VmEvent - - Reason LocalizedMethodFault `xml:"reason"` -} - -func init() { - t["VmFailedToResetEvent"] = reflect.TypeOf((*VmFailedToResetEvent)(nil)).Elem() -} - -type VmFailedToShutdownGuestEvent struct { - VmEvent - - Reason LocalizedMethodFault `xml:"reason"` -} - -func init() { - t["VmFailedToShutdownGuestEvent"] = reflect.TypeOf((*VmFailedToShutdownGuestEvent)(nil)).Elem() -} - -type VmFailedToStandbyGuestEvent struct { - VmEvent - - Reason LocalizedMethodFault `xml:"reason"` -} - -func init() { - t["VmFailedToStandbyGuestEvent"] = reflect.TypeOf((*VmFailedToStandbyGuestEvent)(nil)).Elem() -} - -type VmFailedToSuspendEvent struct { - VmEvent - - Reason LocalizedMethodFault `xml:"reason"` -} - -func init() { - t["VmFailedToSuspendEvent"] = reflect.TypeOf((*VmFailedToSuspendEvent)(nil)).Elem() -} - -type VmFailedUpdatingSecondaryConfig struct { - VmEvent -} - -func init() { - t["VmFailedUpdatingSecondaryConfig"] = reflect.TypeOf((*VmFailedUpdatingSecondaryConfig)(nil)).Elem() -} - -type VmFailoverFailed struct { - VmEvent - - Reason *LocalizedMethodFault `xml:"reason,omitempty"` -} - -func init() { - t["VmFailoverFailed"] = reflect.TypeOf((*VmFailoverFailed)(nil)).Elem() -} - -type VmFaultToleranceConfigIssue struct { - VmFaultToleranceIssue - - Reason string `xml:"reason,omitempty"` - EntityName string `xml:"entityName,omitempty"` - Entity *ManagedObjectReference `xml:"entity,omitempty"` -} - -func init() { - t["VmFaultToleranceConfigIssue"] = reflect.TypeOf((*VmFaultToleranceConfigIssue)(nil)).Elem() -} - -type VmFaultToleranceConfigIssueFault VmFaultToleranceConfigIssue - -func init() { - t["VmFaultToleranceConfigIssueFault"] = reflect.TypeOf((*VmFaultToleranceConfigIssueFault)(nil)).Elem() -} - -type VmFaultToleranceConfigIssueWrapper struct { - VmFaultToleranceIssue - - EntityName string `xml:"entityName,omitempty"` - Entity *ManagedObjectReference `xml:"entity,omitempty"` - Error *LocalizedMethodFault `xml:"error,omitempty"` -} - -func init() { - t["VmFaultToleranceConfigIssueWrapper"] = reflect.TypeOf((*VmFaultToleranceConfigIssueWrapper)(nil)).Elem() -} - -type VmFaultToleranceConfigIssueWrapperFault VmFaultToleranceConfigIssueWrapper - -func init() { - t["VmFaultToleranceConfigIssueWrapperFault"] = reflect.TypeOf((*VmFaultToleranceConfigIssueWrapperFault)(nil)).Elem() -} - -type VmFaultToleranceInvalidFileBacking struct { - VmFaultToleranceIssue - - BackingType string `xml:"backingType,omitempty"` - BackingFilename string `xml:"backingFilename,omitempty"` -} - -func init() { - t["VmFaultToleranceInvalidFileBacking"] = reflect.TypeOf((*VmFaultToleranceInvalidFileBacking)(nil)).Elem() -} - -type VmFaultToleranceInvalidFileBackingFault VmFaultToleranceInvalidFileBacking - -func init() { - t["VmFaultToleranceInvalidFileBackingFault"] = reflect.TypeOf((*VmFaultToleranceInvalidFileBackingFault)(nil)).Elem() -} - -type VmFaultToleranceIssue struct { - VimFault -} - -func init() { - t["VmFaultToleranceIssue"] = reflect.TypeOf((*VmFaultToleranceIssue)(nil)).Elem() -} - -type VmFaultToleranceIssueFault BaseVmFaultToleranceIssue - -func init() { - t["VmFaultToleranceIssueFault"] = reflect.TypeOf((*VmFaultToleranceIssueFault)(nil)).Elem() -} - -type VmFaultToleranceOpIssuesList struct { - VmFaultToleranceIssue - - Errors []LocalizedMethodFault `xml:"errors,omitempty"` - Warnings []LocalizedMethodFault `xml:"warnings,omitempty"` -} - -func init() { - t["VmFaultToleranceOpIssuesList"] = reflect.TypeOf((*VmFaultToleranceOpIssuesList)(nil)).Elem() -} - -type VmFaultToleranceOpIssuesListFault VmFaultToleranceOpIssuesList - -func init() { - t["VmFaultToleranceOpIssuesListFault"] = reflect.TypeOf((*VmFaultToleranceOpIssuesListFault)(nil)).Elem() -} - -type VmFaultToleranceStateChangedEvent struct { - VmEvent - - OldState VirtualMachineFaultToleranceState `xml:"oldState"` - NewState VirtualMachineFaultToleranceState `xml:"newState"` -} - -func init() { - t["VmFaultToleranceStateChangedEvent"] = reflect.TypeOf((*VmFaultToleranceStateChangedEvent)(nil)).Elem() -} - -type VmFaultToleranceTooManyVMsOnHost struct { - InsufficientResourcesFault - - HostName string `xml:"hostName,omitempty"` - MaxNumFtVms int `xml:"maxNumFtVms"` -} - -func init() { - t["VmFaultToleranceTooManyVMsOnHost"] = reflect.TypeOf((*VmFaultToleranceTooManyVMsOnHost)(nil)).Elem() -} - -type VmFaultToleranceTooManyVMsOnHostFault VmFaultToleranceTooManyVMsOnHost - -func init() { - t["VmFaultToleranceTooManyVMsOnHostFault"] = reflect.TypeOf((*VmFaultToleranceTooManyVMsOnHostFault)(nil)).Elem() -} - -type VmFaultToleranceTurnedOffEvent struct { - VmEvent -} - -func init() { - t["VmFaultToleranceTurnedOffEvent"] = reflect.TypeOf((*VmFaultToleranceTurnedOffEvent)(nil)).Elem() -} - -type VmFaultToleranceVmTerminatedEvent struct { - VmEvent - - Reason string `xml:"reason,omitempty"` -} - -func init() { - t["VmFaultToleranceVmTerminatedEvent"] = reflect.TypeOf((*VmFaultToleranceVmTerminatedEvent)(nil)).Elem() -} - -type VmGuestRebootEvent struct { - VmEvent -} - -func init() { - t["VmGuestRebootEvent"] = reflect.TypeOf((*VmGuestRebootEvent)(nil)).Elem() -} - -type VmGuestShutdownEvent struct { - VmEvent -} - -func init() { - t["VmGuestShutdownEvent"] = reflect.TypeOf((*VmGuestShutdownEvent)(nil)).Elem() -} - -type VmGuestStandbyEvent struct { - VmEvent -} - -func init() { - t["VmGuestStandbyEvent"] = reflect.TypeOf((*VmGuestStandbyEvent)(nil)).Elem() -} - -type VmHealthMonitoringStateChangedEvent struct { - ClusterEvent - - State string `xml:"state"` -} - -func init() { - t["VmHealthMonitoringStateChangedEvent"] = reflect.TypeOf((*VmHealthMonitoringStateChangedEvent)(nil)).Elem() -} - -type VmHostAffinityRuleViolation struct { - VmConfigFault - - VmName string `xml:"vmName"` - HostName string `xml:"hostName"` -} - -func init() { - t["VmHostAffinityRuleViolation"] = reflect.TypeOf((*VmHostAffinityRuleViolation)(nil)).Elem() -} - -type VmHostAffinityRuleViolationFault VmHostAffinityRuleViolation - -func init() { - t["VmHostAffinityRuleViolationFault"] = reflect.TypeOf((*VmHostAffinityRuleViolationFault)(nil)).Elem() -} - -type VmInstanceUuidAssignedEvent struct { - VmEvent - - InstanceUuid string `xml:"instanceUuid"` -} - -func init() { - t["VmInstanceUuidAssignedEvent"] = reflect.TypeOf((*VmInstanceUuidAssignedEvent)(nil)).Elem() -} - -type VmInstanceUuidChangedEvent struct { - VmEvent - - OldInstanceUuid string `xml:"oldInstanceUuid"` - NewInstanceUuid string `xml:"newInstanceUuid"` -} - -func init() { - t["VmInstanceUuidChangedEvent"] = reflect.TypeOf((*VmInstanceUuidChangedEvent)(nil)).Elem() -} - -type VmInstanceUuidConflictEvent struct { - VmEvent - - ConflictedVm VmEventArgument `xml:"conflictedVm"` - InstanceUuid string `xml:"instanceUuid"` -} - -func init() { - t["VmInstanceUuidConflictEvent"] = reflect.TypeOf((*VmInstanceUuidConflictEvent)(nil)).Elem() -} - -type VmLimitLicense struct { - NotEnoughLicenses - - Limit int `xml:"limit"` -} - -func init() { - t["VmLimitLicense"] = reflect.TypeOf((*VmLimitLicense)(nil)).Elem() -} - -type VmLimitLicenseFault VmLimitLicense - -func init() { - t["VmLimitLicenseFault"] = reflect.TypeOf((*VmLimitLicenseFault)(nil)).Elem() -} - -type VmLogFileInfo struct { - FileInfo -} - -func init() { - t["VmLogFileInfo"] = reflect.TypeOf((*VmLogFileInfo)(nil)).Elem() -} - -type VmLogFileQuery struct { - FileQuery -} - -func init() { - t["VmLogFileQuery"] = reflect.TypeOf((*VmLogFileQuery)(nil)).Elem() -} - -type VmMacAssignedEvent struct { - VmEvent - - Adapter string `xml:"adapter"` - Mac string `xml:"mac"` -} - -func init() { - t["VmMacAssignedEvent"] = reflect.TypeOf((*VmMacAssignedEvent)(nil)).Elem() -} - -type VmMacChangedEvent struct { - VmEvent - - Adapter string `xml:"adapter"` - OldMac string `xml:"oldMac"` - NewMac string `xml:"newMac"` -} - -func init() { - t["VmMacChangedEvent"] = reflect.TypeOf((*VmMacChangedEvent)(nil)).Elem() -} - -type VmMacConflictEvent struct { - VmEvent - - ConflictedVm VmEventArgument `xml:"conflictedVm"` - Mac string `xml:"mac"` -} - -func init() { - t["VmMacConflictEvent"] = reflect.TypeOf((*VmMacConflictEvent)(nil)).Elem() -} - -type VmMaxFTRestartCountReached struct { - VmEvent -} - -func init() { - t["VmMaxFTRestartCountReached"] = reflect.TypeOf((*VmMaxFTRestartCountReached)(nil)).Elem() -} - -type VmMaxRestartCountReached struct { - VmEvent -} - -func init() { - t["VmMaxRestartCountReached"] = reflect.TypeOf((*VmMaxRestartCountReached)(nil)).Elem() -} - -type VmMessageErrorEvent struct { - VmEvent - - Message string `xml:"message"` - MessageInfo []VirtualMachineMessage `xml:"messageInfo,omitempty"` -} - -func init() { - t["VmMessageErrorEvent"] = reflect.TypeOf((*VmMessageErrorEvent)(nil)).Elem() -} - -type VmMessageEvent struct { - VmEvent - - Message string `xml:"message"` - MessageInfo []VirtualMachineMessage `xml:"messageInfo,omitempty"` -} - -func init() { - t["VmMessageEvent"] = reflect.TypeOf((*VmMessageEvent)(nil)).Elem() -} - -type VmMessageWarningEvent struct { - VmEvent - - Message string `xml:"message"` - MessageInfo []VirtualMachineMessage `xml:"messageInfo,omitempty"` -} - -func init() { - t["VmMessageWarningEvent"] = reflect.TypeOf((*VmMessageWarningEvent)(nil)).Elem() -} - -type VmMetadataManagerFault struct { - VimFault -} - -func init() { - t["VmMetadataManagerFault"] = reflect.TypeOf((*VmMetadataManagerFault)(nil)).Elem() -} - -type VmMetadataManagerFaultFault VmMetadataManagerFault - -func init() { - t["VmMetadataManagerFaultFault"] = reflect.TypeOf((*VmMetadataManagerFaultFault)(nil)).Elem() -} - -type VmMigratedEvent struct { - VmEvent - - SourceHost HostEventArgument `xml:"sourceHost"` - SourceDatacenter *DatacenterEventArgument `xml:"sourceDatacenter,omitempty"` - SourceDatastore *DatastoreEventArgument `xml:"sourceDatastore,omitempty"` -} - -func init() { - t["VmMigratedEvent"] = reflect.TypeOf((*VmMigratedEvent)(nil)).Elem() -} - -type VmMonitorIncompatibleForFaultTolerance struct { - VimFault -} - -func init() { - t["VmMonitorIncompatibleForFaultTolerance"] = reflect.TypeOf((*VmMonitorIncompatibleForFaultTolerance)(nil)).Elem() -} - -type VmMonitorIncompatibleForFaultToleranceFault VmMonitorIncompatibleForFaultTolerance - -func init() { - t["VmMonitorIncompatibleForFaultToleranceFault"] = reflect.TypeOf((*VmMonitorIncompatibleForFaultToleranceFault)(nil)).Elem() -} - -type VmNoCompatibleHostForSecondaryEvent struct { - VmEvent -} - -func init() { - t["VmNoCompatibleHostForSecondaryEvent"] = reflect.TypeOf((*VmNoCompatibleHostForSecondaryEvent)(nil)).Elem() -} - -type VmNoNetworkAccessEvent struct { - VmEvent - - DestHost HostEventArgument `xml:"destHost"` -} - -func init() { - t["VmNoNetworkAccessEvent"] = reflect.TypeOf((*VmNoNetworkAccessEvent)(nil)).Elem() -} - -type VmNvramFileInfo struct { - FileInfo -} - -func init() { - t["VmNvramFileInfo"] = reflect.TypeOf((*VmNvramFileInfo)(nil)).Elem() -} - -type VmNvramFileQuery struct { - FileQuery -} - -func init() { - t["VmNvramFileQuery"] = reflect.TypeOf((*VmNvramFileQuery)(nil)).Elem() -} - -type VmOrphanedEvent struct { - VmEvent -} - -func init() { - t["VmOrphanedEvent"] = reflect.TypeOf((*VmOrphanedEvent)(nil)).Elem() -} - -type VmPodConfigForPlacement struct { - DynamicData - - StoragePod ManagedObjectReference `xml:"storagePod"` - Disk []PodDiskLocator `xml:"disk,omitempty"` - VmConfig *StorageDrsVmConfigInfo `xml:"vmConfig,omitempty"` - InterVmRule []BaseClusterRuleInfo `xml:"interVmRule,omitempty,typeattr"` -} - -func init() { - t["VmPodConfigForPlacement"] = reflect.TypeOf((*VmPodConfigForPlacement)(nil)).Elem() -} - -type VmPortGroupProfile struct { - PortGroupProfile -} - -func init() { - t["VmPortGroupProfile"] = reflect.TypeOf((*VmPortGroupProfile)(nil)).Elem() -} - -type VmPowerOffOnIsolationEvent struct { - VmPoweredOffEvent - - IsolatedHost HostEventArgument `xml:"isolatedHost"` -} - -func init() { - t["VmPowerOffOnIsolationEvent"] = reflect.TypeOf((*VmPowerOffOnIsolationEvent)(nil)).Elem() -} - -type VmPowerOnDisabled struct { - InvalidState -} - -func init() { - t["VmPowerOnDisabled"] = reflect.TypeOf((*VmPowerOnDisabled)(nil)).Elem() -} - -type VmPowerOnDisabledFault VmPowerOnDisabled - -func init() { - t["VmPowerOnDisabledFault"] = reflect.TypeOf((*VmPowerOnDisabledFault)(nil)).Elem() -} - -type VmPoweredOffEvent struct { - VmEvent -} - -func init() { - t["VmPoweredOffEvent"] = reflect.TypeOf((*VmPoweredOffEvent)(nil)).Elem() -} - -type VmPoweredOnEvent struct { - VmEvent -} - -func init() { - t["VmPoweredOnEvent"] = reflect.TypeOf((*VmPoweredOnEvent)(nil)).Elem() -} - -type VmPoweringOnWithCustomizedDVPortEvent struct { - VmEvent - - Vnic []VnicPortArgument `xml:"vnic"` -} - -func init() { - t["VmPoweringOnWithCustomizedDVPortEvent"] = reflect.TypeOf((*VmPoweringOnWithCustomizedDVPortEvent)(nil)).Elem() -} - -type VmPrimaryFailoverEvent struct { - VmEvent - - Reason string `xml:"reason,omitempty"` -} - -func init() { - t["VmPrimaryFailoverEvent"] = reflect.TypeOf((*VmPrimaryFailoverEvent)(nil)).Elem() -} - -type VmReconfiguredEvent struct { - VmEvent - - ConfigSpec VirtualMachineConfigSpec `xml:"configSpec"` -} - -func init() { - t["VmReconfiguredEvent"] = reflect.TypeOf((*VmReconfiguredEvent)(nil)).Elem() -} - -type VmRegisteredEvent struct { - VmEvent -} - -func init() { - t["VmRegisteredEvent"] = reflect.TypeOf((*VmRegisteredEvent)(nil)).Elem() -} - -type VmRelayoutSuccessfulEvent struct { - VmEvent -} - -func init() { - t["VmRelayoutSuccessfulEvent"] = reflect.TypeOf((*VmRelayoutSuccessfulEvent)(nil)).Elem() -} - -type VmRelayoutUpToDateEvent struct { - VmEvent -} - -func init() { - t["VmRelayoutUpToDateEvent"] = reflect.TypeOf((*VmRelayoutUpToDateEvent)(nil)).Elem() -} - -type VmReloadFromPathEvent struct { - VmEvent - - ConfigPath string `xml:"configPath"` -} - -func init() { - t["VmReloadFromPathEvent"] = reflect.TypeOf((*VmReloadFromPathEvent)(nil)).Elem() -} - -type VmReloadFromPathFailedEvent struct { - VmEvent - - ConfigPath string `xml:"configPath"` -} - -func init() { - t["VmReloadFromPathFailedEvent"] = reflect.TypeOf((*VmReloadFromPathFailedEvent)(nil)).Elem() -} - -type VmRelocateFailedEvent struct { - VmRelocateSpecEvent - - DestHost HostEventArgument `xml:"destHost"` - Reason LocalizedMethodFault `xml:"reason"` - DestDatacenter *DatacenterEventArgument `xml:"destDatacenter,omitempty"` - DestDatastore *DatastoreEventArgument `xml:"destDatastore,omitempty"` -} - -func init() { - t["VmRelocateFailedEvent"] = reflect.TypeOf((*VmRelocateFailedEvent)(nil)).Elem() -} - -type VmRelocateSpecEvent struct { - VmEvent -} - -func init() { - t["VmRelocateSpecEvent"] = reflect.TypeOf((*VmRelocateSpecEvent)(nil)).Elem() -} - -type VmRelocatedEvent struct { - VmRelocateSpecEvent - - SourceHost HostEventArgument `xml:"sourceHost"` - SourceDatacenter *DatacenterEventArgument `xml:"sourceDatacenter,omitempty"` - SourceDatastore *DatastoreEventArgument `xml:"sourceDatastore,omitempty"` -} - -func init() { - t["VmRelocatedEvent"] = reflect.TypeOf((*VmRelocatedEvent)(nil)).Elem() -} - -type VmRemoteConsoleConnectedEvent struct { - VmEvent -} - -func init() { - t["VmRemoteConsoleConnectedEvent"] = reflect.TypeOf((*VmRemoteConsoleConnectedEvent)(nil)).Elem() -} - -type VmRemoteConsoleDisconnectedEvent struct { - VmEvent -} - -func init() { - t["VmRemoteConsoleDisconnectedEvent"] = reflect.TypeOf((*VmRemoteConsoleDisconnectedEvent)(nil)).Elem() -} - -type VmRemovedEvent struct { - VmEvent -} - -func init() { - t["VmRemovedEvent"] = reflect.TypeOf((*VmRemovedEvent)(nil)).Elem() -} - -type VmRenamedEvent struct { - VmEvent - - OldName string `xml:"oldName"` - NewName string `xml:"newName"` -} - -func init() { - t["VmRenamedEvent"] = reflect.TypeOf((*VmRenamedEvent)(nil)).Elem() -} - -type VmRequirementsExceedCurrentEVCModeEvent struct { - VmEvent -} - -func init() { - t["VmRequirementsExceedCurrentEVCModeEvent"] = reflect.TypeOf((*VmRequirementsExceedCurrentEVCModeEvent)(nil)).Elem() -} - -type VmResettingEvent struct { - VmEvent -} - -func init() { - t["VmResettingEvent"] = reflect.TypeOf((*VmResettingEvent)(nil)).Elem() -} - -type VmResourcePoolMovedEvent struct { - VmEvent - - OldParent ResourcePoolEventArgument `xml:"oldParent"` - NewParent ResourcePoolEventArgument `xml:"newParent"` -} - -func init() { - t["VmResourcePoolMovedEvent"] = reflect.TypeOf((*VmResourcePoolMovedEvent)(nil)).Elem() -} - -type VmResourceReallocatedEvent struct { - VmEvent -} - -func init() { - t["VmResourceReallocatedEvent"] = reflect.TypeOf((*VmResourceReallocatedEvent)(nil)).Elem() -} - -type VmRestartedOnAlternateHostEvent struct { - VmPoweredOnEvent - - SourceHost HostEventArgument `xml:"sourceHost"` -} - -func init() { - t["VmRestartedOnAlternateHostEvent"] = reflect.TypeOf((*VmRestartedOnAlternateHostEvent)(nil)).Elem() -} - -type VmResumingEvent struct { - VmEvent -} - -func init() { - t["VmResumingEvent"] = reflect.TypeOf((*VmResumingEvent)(nil)).Elem() -} - -type VmSecondaryAddedEvent struct { - VmEvent -} - -func init() { - t["VmSecondaryAddedEvent"] = reflect.TypeOf((*VmSecondaryAddedEvent)(nil)).Elem() -} - -type VmSecondaryDisabledBySystemEvent struct { - VmEvent - - Reason *LocalizedMethodFault `xml:"reason,omitempty"` -} - -func init() { - t["VmSecondaryDisabledBySystemEvent"] = reflect.TypeOf((*VmSecondaryDisabledBySystemEvent)(nil)).Elem() -} - -type VmSecondaryDisabledEvent struct { - VmEvent -} - -func init() { - t["VmSecondaryDisabledEvent"] = reflect.TypeOf((*VmSecondaryDisabledEvent)(nil)).Elem() -} - -type VmSecondaryEnabledEvent struct { - VmEvent -} - -func init() { - t["VmSecondaryEnabledEvent"] = reflect.TypeOf((*VmSecondaryEnabledEvent)(nil)).Elem() -} - -type VmSecondaryStartedEvent struct { - VmEvent -} - -func init() { - t["VmSecondaryStartedEvent"] = reflect.TypeOf((*VmSecondaryStartedEvent)(nil)).Elem() -} - -type VmShutdownOnIsolationEvent struct { - VmPoweredOffEvent - - IsolatedHost HostEventArgument `xml:"isolatedHost"` - ShutdownResult string `xml:"shutdownResult,omitempty"` -} - -func init() { - t["VmShutdownOnIsolationEvent"] = reflect.TypeOf((*VmShutdownOnIsolationEvent)(nil)).Elem() -} - -type VmSnapshotFileInfo struct { - FileInfo -} - -func init() { - t["VmSnapshotFileInfo"] = reflect.TypeOf((*VmSnapshotFileInfo)(nil)).Elem() -} - -type VmSnapshotFileQuery struct { - FileQuery -} - -func init() { - t["VmSnapshotFileQuery"] = reflect.TypeOf((*VmSnapshotFileQuery)(nil)).Elem() -} - -type VmStartRecordingEvent struct { - VmEvent -} - -func init() { - t["VmStartRecordingEvent"] = reflect.TypeOf((*VmStartRecordingEvent)(nil)).Elem() -} - -type VmStartReplayingEvent struct { - VmEvent -} - -func init() { - t["VmStartReplayingEvent"] = reflect.TypeOf((*VmStartReplayingEvent)(nil)).Elem() -} - -type VmStartingEvent struct { - VmEvent -} - -func init() { - t["VmStartingEvent"] = reflect.TypeOf((*VmStartingEvent)(nil)).Elem() -} - -type VmStartingSecondaryEvent struct { - VmEvent -} - -func init() { - t["VmStartingSecondaryEvent"] = reflect.TypeOf((*VmStartingSecondaryEvent)(nil)).Elem() -} - -type VmStaticMacConflictEvent struct { - VmEvent - - ConflictedVm VmEventArgument `xml:"conflictedVm"` - Mac string `xml:"mac"` -} - -func init() { - t["VmStaticMacConflictEvent"] = reflect.TypeOf((*VmStaticMacConflictEvent)(nil)).Elem() -} - -type VmStoppingEvent struct { - VmEvent -} - -func init() { - t["VmStoppingEvent"] = reflect.TypeOf((*VmStoppingEvent)(nil)).Elem() -} - -type VmSuspendedEvent struct { - VmEvent -} - -func init() { - t["VmSuspendedEvent"] = reflect.TypeOf((*VmSuspendedEvent)(nil)).Elem() -} - -type VmSuspendingEvent struct { - VmEvent -} - -func init() { - t["VmSuspendingEvent"] = reflect.TypeOf((*VmSuspendingEvent)(nil)).Elem() -} - -type VmTimedoutStartingSecondaryEvent struct { - VmEvent - - Timeout int64 `xml:"timeout,omitempty"` -} - -func init() { - t["VmTimedoutStartingSecondaryEvent"] = reflect.TypeOf((*VmTimedoutStartingSecondaryEvent)(nil)).Elem() -} - -type VmToolsUpgradeFault struct { - VimFault -} - -func init() { - t["VmToolsUpgradeFault"] = reflect.TypeOf((*VmToolsUpgradeFault)(nil)).Elem() -} - -type VmToolsUpgradeFaultFault BaseVmToolsUpgradeFault - -func init() { - t["VmToolsUpgradeFaultFault"] = reflect.TypeOf((*VmToolsUpgradeFaultFault)(nil)).Elem() -} - -type VmUnsupportedStartingEvent struct { - VmStartingEvent - - GuestId string `xml:"guestId"` -} - -func init() { - t["VmUnsupportedStartingEvent"] = reflect.TypeOf((*VmUnsupportedStartingEvent)(nil)).Elem() -} - -type VmUpgradeCompleteEvent struct { - VmEvent - - Version string `xml:"version"` -} - -func init() { - t["VmUpgradeCompleteEvent"] = reflect.TypeOf((*VmUpgradeCompleteEvent)(nil)).Elem() -} - -type VmUpgradeFailedEvent struct { - VmEvent -} - -func init() { - t["VmUpgradeFailedEvent"] = reflect.TypeOf((*VmUpgradeFailedEvent)(nil)).Elem() -} - -type VmUpgradingEvent struct { - VmEvent - - Version string `xml:"version"` -} - -func init() { - t["VmUpgradingEvent"] = reflect.TypeOf((*VmUpgradingEvent)(nil)).Elem() -} - -type VmUuidAssignedEvent struct { - VmEvent - - Uuid string `xml:"uuid"` -} - -func init() { - t["VmUuidAssignedEvent"] = reflect.TypeOf((*VmUuidAssignedEvent)(nil)).Elem() -} - -type VmUuidChangedEvent struct { - VmEvent - - OldUuid string `xml:"oldUuid"` - NewUuid string `xml:"newUuid"` -} - -func init() { - t["VmUuidChangedEvent"] = reflect.TypeOf((*VmUuidChangedEvent)(nil)).Elem() -} - -type VmUuidConflictEvent struct { - VmEvent - - ConflictedVm VmEventArgument `xml:"conflictedVm"` - Uuid string `xml:"uuid"` -} - -func init() { - t["VmUuidConflictEvent"] = reflect.TypeOf((*VmUuidConflictEvent)(nil)).Elem() -} - -type VmValidateMaxDevice struct { - VimFault - - Device string `xml:"device"` - Max int `xml:"max"` - Count int `xml:"count"` -} - -func init() { - t["VmValidateMaxDevice"] = reflect.TypeOf((*VmValidateMaxDevice)(nil)).Elem() -} - -type VmValidateMaxDeviceFault VmValidateMaxDevice - -func init() { - t["VmValidateMaxDeviceFault"] = reflect.TypeOf((*VmValidateMaxDeviceFault)(nil)).Elem() -} - -type VmWwnAssignedEvent struct { - VmEvent - - NodeWwns []int64 `xml:"nodeWwns"` - PortWwns []int64 `xml:"portWwns"` -} - -func init() { - t["VmWwnAssignedEvent"] = reflect.TypeOf((*VmWwnAssignedEvent)(nil)).Elem() -} - -type VmWwnChangedEvent struct { - VmEvent - - OldNodeWwns []int64 `xml:"oldNodeWwns,omitempty"` - OldPortWwns []int64 `xml:"oldPortWwns,omitempty"` - NewNodeWwns []int64 `xml:"newNodeWwns,omitempty"` - NewPortWwns []int64 `xml:"newPortWwns,omitempty"` -} - -func init() { - t["VmWwnChangedEvent"] = reflect.TypeOf((*VmWwnChangedEvent)(nil)).Elem() -} - -type VmWwnConflict struct { - InvalidVmConfig - - Vm *ManagedObjectReference `xml:"vm,omitempty"` - Host *ManagedObjectReference `xml:"host,omitempty"` - Name string `xml:"name,omitempty"` - Wwn int64 `xml:"wwn,omitempty"` -} - -func init() { - t["VmWwnConflict"] = reflect.TypeOf((*VmWwnConflict)(nil)).Elem() -} - -type VmWwnConflictEvent struct { - VmEvent - - ConflictedVms []VmEventArgument `xml:"conflictedVms,omitempty"` - ConflictedHosts []HostEventArgument `xml:"conflictedHosts,omitempty"` - Wwn int64 `xml:"wwn"` -} - -func init() { - t["VmWwnConflictEvent"] = reflect.TypeOf((*VmWwnConflictEvent)(nil)).Elem() -} - -type VmWwnConflictFault VmWwnConflict - -func init() { - t["VmWwnConflictFault"] = reflect.TypeOf((*VmWwnConflictFault)(nil)).Elem() -} - -type VmfsAlreadyMounted struct { - VmfsMountFault -} - -func init() { - t["VmfsAlreadyMounted"] = reflect.TypeOf((*VmfsAlreadyMounted)(nil)).Elem() -} - -type VmfsAlreadyMountedFault VmfsAlreadyMounted - -func init() { - t["VmfsAlreadyMountedFault"] = reflect.TypeOf((*VmfsAlreadyMountedFault)(nil)).Elem() -} - -type VmfsAmbiguousMount struct { - VmfsMountFault -} - -func init() { - t["VmfsAmbiguousMount"] = reflect.TypeOf((*VmfsAmbiguousMount)(nil)).Elem() -} - -type VmfsAmbiguousMountFault VmfsAmbiguousMount - -func init() { - t["VmfsAmbiguousMountFault"] = reflect.TypeOf((*VmfsAmbiguousMountFault)(nil)).Elem() -} - -type VmfsDatastoreAllExtentOption struct { - VmfsDatastoreSingleExtentOption -} - -func init() { - t["VmfsDatastoreAllExtentOption"] = reflect.TypeOf((*VmfsDatastoreAllExtentOption)(nil)).Elem() -} - -type VmfsDatastoreBaseOption struct { - DynamicData - - Layout HostDiskPartitionLayout `xml:"layout"` - PartitionFormatChange *bool `xml:"partitionFormatChange"` -} - -func init() { - t["VmfsDatastoreBaseOption"] = reflect.TypeOf((*VmfsDatastoreBaseOption)(nil)).Elem() -} - -type VmfsDatastoreCreateSpec struct { - VmfsDatastoreSpec - - Partition HostDiskPartitionSpec `xml:"partition"` - Vmfs HostVmfsSpec `xml:"vmfs"` - Extent []HostScsiDiskPartition `xml:"extent,omitempty"` -} - -func init() { - t["VmfsDatastoreCreateSpec"] = reflect.TypeOf((*VmfsDatastoreCreateSpec)(nil)).Elem() -} - -type VmfsDatastoreExpandSpec struct { - VmfsDatastoreSpec - - Partition HostDiskPartitionSpec `xml:"partition"` - Extent HostScsiDiskPartition `xml:"extent"` -} - -func init() { - t["VmfsDatastoreExpandSpec"] = reflect.TypeOf((*VmfsDatastoreExpandSpec)(nil)).Elem() -} - -type VmfsDatastoreExtendSpec struct { - VmfsDatastoreSpec - - Partition HostDiskPartitionSpec `xml:"partition"` - Extent []HostScsiDiskPartition `xml:"extent"` -} - -func init() { - t["VmfsDatastoreExtendSpec"] = reflect.TypeOf((*VmfsDatastoreExtendSpec)(nil)).Elem() -} - -type VmfsDatastoreInfo struct { - DatastoreInfo - - MaxPhysicalRDMFileSize int64 `xml:"maxPhysicalRDMFileSize,omitempty"` - MaxVirtualRDMFileSize int64 `xml:"maxVirtualRDMFileSize,omitempty"` - Vmfs *HostVmfsVolume `xml:"vmfs,omitempty"` -} - -func init() { - t["VmfsDatastoreInfo"] = reflect.TypeOf((*VmfsDatastoreInfo)(nil)).Elem() -} - -type VmfsDatastoreMultipleExtentOption struct { - VmfsDatastoreBaseOption - - VmfsExtent []HostDiskPartitionBlockRange `xml:"vmfsExtent"` -} - -func init() { - t["VmfsDatastoreMultipleExtentOption"] = reflect.TypeOf((*VmfsDatastoreMultipleExtentOption)(nil)).Elem() -} - -type VmfsDatastoreOption struct { - DynamicData - - Info BaseVmfsDatastoreBaseOption `xml:"info,typeattr"` - Spec BaseVmfsDatastoreSpec `xml:"spec,typeattr"` -} - -func init() { - t["VmfsDatastoreOption"] = reflect.TypeOf((*VmfsDatastoreOption)(nil)).Elem() -} - -type VmfsDatastoreSingleExtentOption struct { - VmfsDatastoreBaseOption - - VmfsExtent HostDiskPartitionBlockRange `xml:"vmfsExtent"` -} - -func init() { - t["VmfsDatastoreSingleExtentOption"] = reflect.TypeOf((*VmfsDatastoreSingleExtentOption)(nil)).Elem() -} - -type VmfsDatastoreSpec struct { - DynamicData - - DiskUuid string `xml:"diskUuid"` -} - -func init() { - t["VmfsDatastoreSpec"] = reflect.TypeOf((*VmfsDatastoreSpec)(nil)).Elem() -} - -type VmfsMountFault struct { - HostConfigFault - - Uuid string `xml:"uuid"` -} - -func init() { - t["VmfsMountFault"] = reflect.TypeOf((*VmfsMountFault)(nil)).Elem() -} - -type VmfsMountFaultFault BaseVmfsMountFault - -func init() { - t["VmfsMountFaultFault"] = reflect.TypeOf((*VmfsMountFaultFault)(nil)).Elem() -} - -type VmotionInterfaceNotEnabled struct { - HostPowerOpFailed -} - -func init() { - t["VmotionInterfaceNotEnabled"] = reflect.TypeOf((*VmotionInterfaceNotEnabled)(nil)).Elem() -} - -type VmotionInterfaceNotEnabledFault VmotionInterfaceNotEnabled - -func init() { - t["VmotionInterfaceNotEnabledFault"] = reflect.TypeOf((*VmotionInterfaceNotEnabledFault)(nil)).Elem() -} - -type VmwareDistributedVirtualSwitchPvlanSpec struct { - VmwareDistributedVirtualSwitchVlanSpec - - PvlanId int `xml:"pvlanId"` -} - -func init() { - t["VmwareDistributedVirtualSwitchPvlanSpec"] = reflect.TypeOf((*VmwareDistributedVirtualSwitchPvlanSpec)(nil)).Elem() -} - -type VmwareDistributedVirtualSwitchTrunkVlanSpec struct { - VmwareDistributedVirtualSwitchVlanSpec - - VlanId []NumericRange `xml:"vlanId"` -} - -func init() { - t["VmwareDistributedVirtualSwitchTrunkVlanSpec"] = reflect.TypeOf((*VmwareDistributedVirtualSwitchTrunkVlanSpec)(nil)).Elem() -} - -type VmwareDistributedVirtualSwitchVlanIdSpec struct { - VmwareDistributedVirtualSwitchVlanSpec - - VlanId int `xml:"vlanId"` -} - -func init() { - t["VmwareDistributedVirtualSwitchVlanIdSpec"] = reflect.TypeOf((*VmwareDistributedVirtualSwitchVlanIdSpec)(nil)).Elem() -} - -type VmwareDistributedVirtualSwitchVlanSpec struct { - InheritablePolicy -} - -func init() { - t["VmwareDistributedVirtualSwitchVlanSpec"] = reflect.TypeOf((*VmwareDistributedVirtualSwitchVlanSpec)(nil)).Elem() -} - -type VmwareUplinkPortTeamingPolicy struct { - InheritablePolicy - - Policy *StringPolicy `xml:"policy,omitempty"` - ReversePolicy *BoolPolicy `xml:"reversePolicy,omitempty"` - NotifySwitches *BoolPolicy `xml:"notifySwitches,omitempty"` - RollingOrder *BoolPolicy `xml:"rollingOrder,omitempty"` - FailureCriteria *DVSFailureCriteria `xml:"failureCriteria,omitempty"` - UplinkPortOrder *VMwareUplinkPortOrderPolicy `xml:"uplinkPortOrder,omitempty"` -} - -func init() { - t["VmwareUplinkPortTeamingPolicy"] = reflect.TypeOf((*VmwareUplinkPortTeamingPolicy)(nil)).Elem() -} - -type VnicPortArgument struct { - DynamicData - - Vnic string `xml:"vnic"` - Port DistributedVirtualSwitchPortConnection `xml:"port"` -} - -func init() { - t["VnicPortArgument"] = reflect.TypeOf((*VnicPortArgument)(nil)).Elem() -} - -type VolumeEditorError struct { - CustomizationFault -} - -func init() { - t["VolumeEditorError"] = reflect.TypeOf((*VolumeEditorError)(nil)).Elem() -} - -type VolumeEditorErrorFault VolumeEditorError - -func init() { - t["VolumeEditorErrorFault"] = reflect.TypeOf((*VolumeEditorErrorFault)(nil)).Elem() -} - -type VramLimitLicense struct { - NotEnoughLicenses - - Limit int `xml:"limit"` -} - -func init() { - t["VramLimitLicense"] = reflect.TypeOf((*VramLimitLicense)(nil)).Elem() -} - -type VramLimitLicenseFault VramLimitLicense - -func init() { - t["VramLimitLicenseFault"] = reflect.TypeOf((*VramLimitLicenseFault)(nil)).Elem() -} - -type VsanClusterConfigInfo struct { - DynamicData - - Enabled *bool `xml:"enabled"` - DefaultConfig *VsanClusterConfigInfoHostDefaultInfo `xml:"defaultConfig,omitempty"` -} - -func init() { - t["VsanClusterConfigInfo"] = reflect.TypeOf((*VsanClusterConfigInfo)(nil)).Elem() -} - -type VsanClusterConfigInfoHostDefaultInfo struct { - DynamicData - - Uuid string `xml:"uuid,omitempty"` - AutoClaimStorage *bool `xml:"autoClaimStorage"` -} - -func init() { - t["VsanClusterConfigInfoHostDefaultInfo"] = reflect.TypeOf((*VsanClusterConfigInfoHostDefaultInfo)(nil)).Elem() -} - -type VsanClusterUuidMismatch struct { - CannotMoveVsanEnabledHost - - HostClusterUuid string `xml:"hostClusterUuid"` - DestinationClusterUuid string `xml:"destinationClusterUuid"` -} - -func init() { - t["VsanClusterUuidMismatch"] = reflect.TypeOf((*VsanClusterUuidMismatch)(nil)).Elem() -} - -type VsanClusterUuidMismatchFault VsanClusterUuidMismatch - -func init() { - t["VsanClusterUuidMismatchFault"] = reflect.TypeOf((*VsanClusterUuidMismatchFault)(nil)).Elem() -} - -type VsanDiskFault struct { - VsanFault - - Device string `xml:"device,omitempty"` -} - -func init() { - t["VsanDiskFault"] = reflect.TypeOf((*VsanDiskFault)(nil)).Elem() -} - -type VsanDiskFaultFault BaseVsanDiskFault - -func init() { - t["VsanDiskFaultFault"] = reflect.TypeOf((*VsanDiskFaultFault)(nil)).Elem() -} - -type VsanFault struct { - VimFault -} - -func init() { - t["VsanFault"] = reflect.TypeOf((*VsanFault)(nil)).Elem() -} - -type VsanFaultFault BaseVsanFault - -func init() { - t["VsanFaultFault"] = reflect.TypeOf((*VsanFaultFault)(nil)).Elem() -} - -type VsanHostClusterStatus struct { - DynamicData - - Uuid string `xml:"uuid,omitempty"` - NodeUuid string `xml:"nodeUuid,omitempty"` - Health string `xml:"health"` - NodeState VsanHostClusterStatusState `xml:"nodeState"` - MemberUuid []string `xml:"memberUuid,omitempty"` -} - -func init() { - t["VsanHostClusterStatus"] = reflect.TypeOf((*VsanHostClusterStatus)(nil)).Elem() -} - -type VsanHostClusterStatusState struct { - DynamicData - - State string `xml:"state"` - Completion *VsanHostClusterStatusStateCompletionEstimate `xml:"completion,omitempty"` -} - -func init() { - t["VsanHostClusterStatusState"] = reflect.TypeOf((*VsanHostClusterStatusState)(nil)).Elem() -} - -type VsanHostClusterStatusStateCompletionEstimate struct { - DynamicData - - CompleteTime *time.Time `xml:"completeTime"` - PercentComplete int `xml:"percentComplete,omitempty"` -} - -func init() { - t["VsanHostClusterStatusStateCompletionEstimate"] = reflect.TypeOf((*VsanHostClusterStatusStateCompletionEstimate)(nil)).Elem() -} - -type VsanHostConfigInfo struct { - DynamicData - - Enabled *bool `xml:"enabled"` - HostSystem *ManagedObjectReference `xml:"hostSystem,omitempty"` - ClusterInfo *VsanHostConfigInfoClusterInfo `xml:"clusterInfo,omitempty"` - StorageInfo *VsanHostConfigInfoStorageInfo `xml:"storageInfo,omitempty"` - NetworkInfo *VsanHostConfigInfoNetworkInfo `xml:"networkInfo,omitempty"` -} - -func init() { - t["VsanHostConfigInfo"] = reflect.TypeOf((*VsanHostConfigInfo)(nil)).Elem() -} - -type VsanHostConfigInfoClusterInfo struct { - DynamicData - - Uuid string `xml:"uuid,omitempty"` - NodeUuid string `xml:"nodeUuid,omitempty"` -} - -func init() { - t["VsanHostConfigInfoClusterInfo"] = reflect.TypeOf((*VsanHostConfigInfoClusterInfo)(nil)).Elem() -} - -type VsanHostConfigInfoNetworkInfo struct { - DynamicData - - Port []VsanHostConfigInfoNetworkInfoPortConfig `xml:"port,omitempty"` -} - -func init() { - t["VsanHostConfigInfoNetworkInfo"] = reflect.TypeOf((*VsanHostConfigInfoNetworkInfo)(nil)).Elem() -} - -type VsanHostConfigInfoNetworkInfoPortConfig struct { - DynamicData - - IpConfig *VsanHostIpConfig `xml:"ipConfig,omitempty"` - Device string `xml:"device"` -} - -func init() { - t["VsanHostConfigInfoNetworkInfoPortConfig"] = reflect.TypeOf((*VsanHostConfigInfoNetworkInfoPortConfig)(nil)).Elem() -} - -type VsanHostConfigInfoStorageInfo struct { - DynamicData - - AutoClaimStorage *bool `xml:"autoClaimStorage"` - DiskMapping []VsanHostDiskMapping `xml:"diskMapping,omitempty"` -} - -func init() { - t["VsanHostConfigInfoStorageInfo"] = reflect.TypeOf((*VsanHostConfigInfoStorageInfo)(nil)).Elem() -} - -type VsanHostDecommissionMode struct { - DynamicData - - ObjectAction string `xml:"objectAction"` -} - -func init() { - t["VsanHostDecommissionMode"] = reflect.TypeOf((*VsanHostDecommissionMode)(nil)).Elem() -} - -type VsanHostDiskMapResult struct { - DynamicData - - Mapping VsanHostDiskMapping `xml:"mapping"` - DiskResult []VsanHostDiskResult `xml:"diskResult,omitempty"` - Error *LocalizedMethodFault `xml:"error,omitempty"` -} - -func init() { - t["VsanHostDiskMapResult"] = reflect.TypeOf((*VsanHostDiskMapResult)(nil)).Elem() -} - -type VsanHostDiskMapping struct { - DynamicData - - Ssd HostScsiDisk `xml:"ssd"` - NonSsd []HostScsiDisk `xml:"nonSsd"` -} - -func init() { - t["VsanHostDiskMapping"] = reflect.TypeOf((*VsanHostDiskMapping)(nil)).Elem() -} - -type VsanHostDiskResult struct { - DynamicData - - Disk HostScsiDisk `xml:"disk"` - State string `xml:"state"` - VsanUuid string `xml:"vsanUuid,omitempty"` - Error *LocalizedMethodFault `xml:"error,omitempty"` -} - -func init() { - t["VsanHostDiskResult"] = reflect.TypeOf((*VsanHostDiskResult)(nil)).Elem() -} - -type VsanHostIpConfig struct { - DynamicData - - UpstreamIpAddress string `xml:"upstreamIpAddress"` - DownstreamIpAddress string `xml:"downstreamIpAddress"` -} - -func init() { - t["VsanHostIpConfig"] = reflect.TypeOf((*VsanHostIpConfig)(nil)).Elem() -} - -type VsanHostMembershipInfo struct { - DynamicData - - NodeUuid string `xml:"nodeUuid"` - Hostname string `xml:"hostname"` -} - -func init() { - t["VsanHostMembershipInfo"] = reflect.TypeOf((*VsanHostMembershipInfo)(nil)).Elem() -} - -type VsanHostRuntimeInfo struct { - DynamicData - - MembershipList []VsanHostMembershipInfo `xml:"membershipList,omitempty"` - DiskIssues []VsanHostRuntimeInfoDiskIssue `xml:"diskIssues,omitempty"` - AccessGenNo int `xml:"accessGenNo,omitempty"` -} - -func init() { - t["VsanHostRuntimeInfo"] = reflect.TypeOf((*VsanHostRuntimeInfo)(nil)).Elem() -} - -type VsanHostRuntimeInfoDiskIssue struct { - DynamicData - - DiskId string `xml:"diskId"` - Issue string `xml:"issue"` -} - -func init() { - t["VsanHostRuntimeInfoDiskIssue"] = reflect.TypeOf((*VsanHostRuntimeInfoDiskIssue)(nil)).Elem() -} - -type VspanDestPortConflict struct { - DvsFault - - VspanSessionKey1 string `xml:"vspanSessionKey1"` - VspanSessionKey2 string `xml:"vspanSessionKey2"` - PortKey string `xml:"portKey"` -} - -func init() { - t["VspanDestPortConflict"] = reflect.TypeOf((*VspanDestPortConflict)(nil)).Elem() -} - -type VspanDestPortConflictFault VspanDestPortConflict - -func init() { - t["VspanDestPortConflictFault"] = reflect.TypeOf((*VspanDestPortConflictFault)(nil)).Elem() -} - -type VspanPortConflict struct { - DvsFault - - VspanSessionKey1 string `xml:"vspanSessionKey1"` - VspanSessionKey2 string `xml:"vspanSessionKey2"` - PortKey string `xml:"portKey"` -} - -func init() { - t["VspanPortConflict"] = reflect.TypeOf((*VspanPortConflict)(nil)).Elem() -} - -type VspanPortConflictFault VspanPortConflict - -func init() { - t["VspanPortConflictFault"] = reflect.TypeOf((*VspanPortConflictFault)(nil)).Elem() -} - -type VspanPortMoveFault struct { - DvsFault - - SrcPortgroupName string `xml:"srcPortgroupName"` - DestPortgroupName string `xml:"destPortgroupName"` - PortKey string `xml:"portKey"` -} - -func init() { - t["VspanPortMoveFault"] = reflect.TypeOf((*VspanPortMoveFault)(nil)).Elem() -} - -type VspanPortMoveFaultFault VspanPortMoveFault - -func init() { - t["VspanPortMoveFaultFault"] = reflect.TypeOf((*VspanPortMoveFaultFault)(nil)).Elem() -} - -type VspanPortPromiscChangeFault struct { - DvsFault - - PortKey string `xml:"portKey"` -} - -func init() { - t["VspanPortPromiscChangeFault"] = reflect.TypeOf((*VspanPortPromiscChangeFault)(nil)).Elem() -} - -type VspanPortPromiscChangeFaultFault VspanPortPromiscChangeFault - -func init() { - t["VspanPortPromiscChangeFaultFault"] = reflect.TypeOf((*VspanPortPromiscChangeFaultFault)(nil)).Elem() -} - -type VspanPortgroupPromiscChangeFault struct { - DvsFault - - PortgroupName string `xml:"portgroupName"` -} - -func init() { - t["VspanPortgroupPromiscChangeFault"] = reflect.TypeOf((*VspanPortgroupPromiscChangeFault)(nil)).Elem() -} - -type VspanPortgroupPromiscChangeFaultFault VspanPortgroupPromiscChangeFault - -func init() { - t["VspanPortgroupPromiscChangeFaultFault"] = reflect.TypeOf((*VspanPortgroupPromiscChangeFaultFault)(nil)).Elem() -} - -type VspanPortgroupTypeChangeFault struct { - DvsFault - - PortgroupName string `xml:"portgroupName"` -} - -func init() { - t["VspanPortgroupTypeChangeFault"] = reflect.TypeOf((*VspanPortgroupTypeChangeFault)(nil)).Elem() -} - -type VspanPortgroupTypeChangeFaultFault VspanPortgroupTypeChangeFault - -func init() { - t["VspanPortgroupTypeChangeFaultFault"] = reflect.TypeOf((*VspanPortgroupTypeChangeFaultFault)(nil)).Elem() -} - -type VspanPromiscuousPortNotSupported struct { - DvsFault - - VspanSessionKey string `xml:"vspanSessionKey"` - PortKey string `xml:"portKey"` -} - -func init() { - t["VspanPromiscuousPortNotSupported"] = reflect.TypeOf((*VspanPromiscuousPortNotSupported)(nil)).Elem() -} - -type VspanPromiscuousPortNotSupportedFault VspanPromiscuousPortNotSupported - -func init() { - t["VspanPromiscuousPortNotSupportedFault"] = reflect.TypeOf((*VspanPromiscuousPortNotSupportedFault)(nil)).Elem() -} - -type VspanSameSessionPortConflict struct { - DvsFault - - VspanSessionKey string `xml:"vspanSessionKey"` - PortKey string `xml:"portKey"` -} - -func init() { - t["VspanSameSessionPortConflict"] = reflect.TypeOf((*VspanSameSessionPortConflict)(nil)).Elem() -} - -type VspanSameSessionPortConflictFault VspanSameSessionPortConflict - -func init() { - t["VspanSameSessionPortConflictFault"] = reflect.TypeOf((*VspanSameSessionPortConflictFault)(nil)).Elem() -} - -type WaitForUpdates WaitForUpdatesRequestType - -func init() { - t["WaitForUpdates"] = reflect.TypeOf((*WaitForUpdates)(nil)).Elem() -} - -type WaitForUpdatesEx WaitForUpdatesExRequestType - -func init() { - t["WaitForUpdatesEx"] = reflect.TypeOf((*WaitForUpdatesEx)(nil)).Elem() -} - -type WaitForUpdatesExRequestType struct { - This ManagedObjectReference `xml:"_this"` - Version string `xml:"version,omitempty"` - Options *WaitOptions `xml:"options,omitempty"` -} - -func init() { - t["WaitForUpdatesExRequestType"] = reflect.TypeOf((*WaitForUpdatesExRequestType)(nil)).Elem() -} - -type WaitForUpdatesExResponse struct { - Returnval *UpdateSet `xml:"returnval,omitempty"` -} - -type WaitForUpdatesRequestType struct { - This ManagedObjectReference `xml:"_this"` - Version string `xml:"version,omitempty"` -} - -func init() { - t["WaitForUpdatesRequestType"] = reflect.TypeOf((*WaitForUpdatesRequestType)(nil)).Elem() -} - -type WaitForUpdatesResponse struct { - Returnval UpdateSet `xml:"returnval"` -} - -type WaitOptions struct { - DynamicData - - MaxWaitSeconds int `xml:"maxWaitSeconds,omitempty"` - MaxObjectUpdates int `xml:"maxObjectUpdates,omitempty"` -} - -func init() { - t["WaitOptions"] = reflect.TypeOf((*WaitOptions)(nil)).Elem() -} - -type WakeOnLanNotSupported struct { - VirtualHardwareCompatibilityIssue -} - -func init() { - t["WakeOnLanNotSupported"] = reflect.TypeOf((*WakeOnLanNotSupported)(nil)).Elem() -} - -type WakeOnLanNotSupportedByVmotionNIC struct { - HostPowerOpFailed -} - -func init() { - t["WakeOnLanNotSupportedByVmotionNIC"] = reflect.TypeOf((*WakeOnLanNotSupportedByVmotionNIC)(nil)).Elem() -} - -type WakeOnLanNotSupportedByVmotionNICFault WakeOnLanNotSupportedByVmotionNIC - -func init() { - t["WakeOnLanNotSupportedByVmotionNICFault"] = reflect.TypeOf((*WakeOnLanNotSupportedByVmotionNICFault)(nil)).Elem() -} - -type WakeOnLanNotSupportedFault WakeOnLanNotSupported - -func init() { - t["WakeOnLanNotSupportedFault"] = reflect.TypeOf((*WakeOnLanNotSupportedFault)(nil)).Elem() -} - -type WarningUpgradeEvent struct { - UpgradeEvent -} - -func init() { - t["WarningUpgradeEvent"] = reflect.TypeOf((*WarningUpgradeEvent)(nil)).Elem() -} - -type WeeklyTaskScheduler struct { - DailyTaskScheduler - - Sunday bool `xml:"sunday"` - Monday bool `xml:"monday"` - Tuesday bool `xml:"tuesday"` - Wednesday bool `xml:"wednesday"` - Thursday bool `xml:"thursday"` - Friday bool `xml:"friday"` - Saturday bool `xml:"saturday"` -} - -func init() { - t["WeeklyTaskScheduler"] = reflect.TypeOf((*WeeklyTaskScheduler)(nil)).Elem() -} - -type WillLoseHAProtection struct { - MigrationFault - - Resolution string `xml:"resolution"` -} - -func init() { - t["WillLoseHAProtection"] = reflect.TypeOf((*WillLoseHAProtection)(nil)).Elem() -} - -type WillLoseHAProtectionFault WillLoseHAProtection - -func init() { - t["WillLoseHAProtectionFault"] = reflect.TypeOf((*WillLoseHAProtectionFault)(nil)).Elem() -} - -type WillModifyConfigCpuRequirements struct { - MigrationFault -} - -func init() { - t["WillModifyConfigCpuRequirements"] = reflect.TypeOf((*WillModifyConfigCpuRequirements)(nil)).Elem() -} - -type WillModifyConfigCpuRequirementsFault WillModifyConfigCpuRequirements - -func init() { - t["WillModifyConfigCpuRequirementsFault"] = reflect.TypeOf((*WillModifyConfigCpuRequirementsFault)(nil)).Elem() -} - -type WillResetSnapshotDirectory struct { - MigrationFault -} - -func init() { - t["WillResetSnapshotDirectory"] = reflect.TypeOf((*WillResetSnapshotDirectory)(nil)).Elem() -} - -type WillResetSnapshotDirectoryFault WillResetSnapshotDirectory - -func init() { - t["WillResetSnapshotDirectoryFault"] = reflect.TypeOf((*WillResetSnapshotDirectoryFault)(nil)).Elem() -} - -type WinNetBIOSConfigInfo struct { - NetBIOSConfigInfo - - PrimaryWINS string `xml:"primaryWINS"` - SecondaryWINS string `xml:"secondaryWINS,omitempty"` -} - -func init() { - t["WinNetBIOSConfigInfo"] = reflect.TypeOf((*WinNetBIOSConfigInfo)(nil)).Elem() -} - -type WipeDiskFault struct { - VimFault -} - -func init() { - t["WipeDiskFault"] = reflect.TypeOf((*WipeDiskFault)(nil)).Elem() -} - -type WipeDiskFaultFault WipeDiskFault - -func init() { - t["WipeDiskFaultFault"] = reflect.TypeOf((*WipeDiskFaultFault)(nil)).Elem() -} - -type XmlToCustomizationSpecItem XmlToCustomizationSpecItemRequestType - -func init() { - t["XmlToCustomizationSpecItem"] = reflect.TypeOf((*XmlToCustomizationSpecItem)(nil)).Elem() -} - -type XmlToCustomizationSpecItemRequestType struct { - This ManagedObjectReference `xml:"_this"` - SpecItemXml string `xml:"specItemXml"` -} - -func init() { - t["XmlToCustomizationSpecItemRequestType"] = reflect.TypeOf((*XmlToCustomizationSpecItemRequestType)(nil)).Elem() -} - -type XmlToCustomizationSpecItemResponse struct { - Returnval CustomizationSpecItem `xml:"returnval"` -} - -type ZeroFillVirtualDiskRequestType struct { - This ManagedObjectReference `xml:"_this"` - Name string `xml:"name"` - Datacenter *ManagedObjectReference `xml:"datacenter,omitempty"` -} - -func init() { - t["ZeroFillVirtualDiskRequestType"] = reflect.TypeOf((*ZeroFillVirtualDiskRequestType)(nil)).Elem() -} - -type ZeroFillVirtualDisk_Task ZeroFillVirtualDiskRequestType - -func init() { - t["ZeroFillVirtualDisk_Task"] = reflect.TypeOf((*ZeroFillVirtualDisk_Task)(nil)).Elem() -} - -type ZeroFillVirtualDisk_TaskResponse struct { - Returnval ManagedObjectReference `xml:"returnval"` -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/vim25/types/types_test.go juju-core-2.0.2/src/github.com/juju/govmomi/vim25/types/types_test.go --- juju-core-2.0.0/src/github.com/juju/govmomi/vim25/types/types_test.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/vim25/types/types_test.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,92 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package types - -import ( - "testing" - - "github.com/juju/govmomi/vim25/xml" -) - -func TestVirtualMachineConfigSpec(t *testing.T) { - spec := VirtualMachineConfigSpec{ - Name: "vm-001", - GuestId: "otherGuest", - Files: &VirtualMachineFileInfo{VmPathName: "[datastore1]"}, - NumCPUs: 1, - MemoryMB: 128, - DeviceChange: []BaseVirtualDeviceConfigSpec{ - &VirtualDeviceConfigSpec{ - Operation: VirtualDeviceConfigSpecOperationAdd, - Device: &VirtualLsiLogicController{VirtualSCSIController{ - SharedBus: VirtualSCSISharingNoSharing, - VirtualController: VirtualController{ - BusNumber: 0, - VirtualDevice: VirtualDevice{ - Key: 1000, - }, - }, - }}, - }, - &VirtualDeviceConfigSpec{ - Operation: VirtualDeviceConfigSpecOperationAdd, - FileOperation: VirtualDeviceConfigSpecFileOperationCreate, - Device: &VirtualDisk{ - VirtualDevice: VirtualDevice{ - Key: 0, - ControllerKey: 1000, - UnitNumber: 0, - Backing: &VirtualDiskFlatVer2BackingInfo{ - DiskMode: string(VirtualDiskModePersistent), - ThinProvisioned: NewBool(true), - VirtualDeviceFileBackingInfo: VirtualDeviceFileBackingInfo{ - FileName: "[datastore1]", - }, - }, - }, - CapacityInKB: 4000000, - }, - }, - &VirtualDeviceConfigSpec{ - Operation: VirtualDeviceConfigSpecOperationAdd, - Device: &VirtualE1000{VirtualEthernetCard{ - VirtualDevice: VirtualDevice{ - Key: 0, - DeviceInfo: &Description{ - Label: "Network Adapter 1", - Summary: "VM Network", - }, - Backing: &VirtualEthernetCardNetworkBackingInfo{ - VirtualDeviceDeviceBackingInfo: VirtualDeviceDeviceBackingInfo{ - DeviceName: "VM Network", - }, - }, - }, - AddressType: string(VirtualEthernetCardMacTypeGenerated), - }}, - }, - }, - ExtraConfig: []BaseOptionValue{ - &OptionValue{Key: "bios.bootOrder", Value: "ethernet0"}, - }, - } - - _, err := xml.MarshalIndent(spec, "", " ") - if err != nil { - t.Fatal(err) - } -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/vim25/xml/atom_test.go juju-core-2.0.2/src/github.com/juju/govmomi/vim25/xml/atom_test.go --- juju-core-2.0.0/src/github.com/juju/govmomi/vim25/xml/atom_test.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/vim25/xml/atom_test.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,56 +0,0 @@ -// Copyright 2011 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package xml - -import "time" - -var atomValue = &Feed{ - XMLName: Name{"http://www.w3.org/2005/Atom", "feed"}, - Title: "Example Feed", - Link: []Link{{Href: "http://example.org/"}}, - Updated: ParseTime("2003-12-13T18:30:02Z"), - Author: Person{Name: "John Doe"}, - Id: "urn:uuid:60a76c80-d399-11d9-b93C-0003939e0af6", - - Entry: []Entry{ - { - Title: "Atom-Powered Robots Run Amok", - Link: []Link{{Href: "http://example.org/2003/12/13/atom03"}}, - Id: "urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a", - Updated: ParseTime("2003-12-13T18:30:02Z"), - Summary: NewText("Some text."), - }, - }, -} - -var atomXml = `` + - `` + - `Example Feed` + - `urn:uuid:60a76c80-d399-11d9-b93C-0003939e0af6` + - `` + - `John Doe` + - `` + - `Atom-Powered Robots Run Amok` + - `urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a` + - `` + - `2003-12-13T18:30:02Z` + - `` + - `Some text.` + - `` + - `` - -func ParseTime(str string) time.Time { - t, err := time.Parse(time.RFC3339, str) - if err != nil { - panic(err) - } - return t -} - -func NewText(text string) Text { - return Text{ - Body: text, - } -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/vim25/xml/example_test.go juju-core-2.0.2/src/github.com/juju/govmomi/vim25/xml/example_test.go --- juju-core-2.0.0/src/github.com/juju/govmomi/vim25/xml/example_test.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/vim25/xml/example_test.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,151 +0,0 @@ -// Copyright 2012 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package xml_test - -import ( - "encoding/xml" - "fmt" - "os" -) - -func ExampleMarshalIndent() { - type Address struct { - City, State string - } - type Person struct { - XMLName xml.Name `xml:"person"` - Id int `xml:"id,attr"` - FirstName string `xml:"name>first"` - LastName string `xml:"name>last"` - Age int `xml:"age"` - Height float32 `xml:"height,omitempty"` - Married bool - Address - Comment string `xml:",comment"` - } - - v := &Person{Id: 13, FirstName: "John", LastName: "Doe", Age: 42} - v.Comment = " Need more details. " - v.Address = Address{"Hanga Roa", "Easter Island"} - - output, err := xml.MarshalIndent(v, " ", " ") - if err != nil { - fmt.Printf("error: %v\n", err) - } - - os.Stdout.Write(output) - // Output: - // - // - // John - // Doe - // - // 42 - // false - // Hanga Roa - // Easter Island - // - // -} - -func ExampleEncoder() { - type Address struct { - City, State string - } - type Person struct { - XMLName xml.Name `xml:"person"` - Id int `xml:"id,attr"` - FirstName string `xml:"name>first"` - LastName string `xml:"name>last"` - Age int `xml:"age"` - Height float32 `xml:"height,omitempty"` - Married bool - Address - Comment string `xml:",comment"` - } - - v := &Person{Id: 13, FirstName: "John", LastName: "Doe", Age: 42} - v.Comment = " Need more details. " - v.Address = Address{"Hanga Roa", "Easter Island"} - - enc := xml.NewEncoder(os.Stdout) - enc.Indent(" ", " ") - if err := enc.Encode(v); err != nil { - fmt.Printf("error: %v\n", err) - } - - // Output: - // - // - // John - // Doe - // - // 42 - // false - // Hanga Roa - // Easter Island - // - // -} - -// This example demonstrates unmarshaling an XML excerpt into a value with -// some preset fields. Note that the Phone field isn't modified and that -// the XML element is ignored. Also, the Groups field is assigned -// considering the element path provided in its tag. -func ExampleUnmarshal() { - type Email struct { - Where string `xml:"where,attr"` - Addr string - } - type Address struct { - City, State string - } - type Result struct { - XMLName xml.Name `xml:"Person"` - Name string `xml:"FullName"` - Phone string - Email []Email - Groups []string `xml:"Group>Value"` - Address - } - v := Result{Name: "none", Phone: "none"} - - data := ` - - Grace R. Emlin - Example Inc. - - gre@example.com - - - gre@work.com - - - Friends - Squash - - Hanga Roa - Easter Island - - ` - err := xml.Unmarshal([]byte(data), &v) - if err != nil { - fmt.Printf("error: %v", err) - return - } - fmt.Printf("XMLName: %#v\n", v.XMLName) - fmt.Printf("Name: %q\n", v.Name) - fmt.Printf("Phone: %q\n", v.Phone) - fmt.Printf("Email: %v\n", v.Email) - fmt.Printf("Groups: %v\n", v.Groups) - fmt.Printf("Address: %v\n", v.Address) - // Output: - // XMLName: xml.Name{Space:"", Local:"Person"} - // Name: "Grace R. Emlin" - // Phone: "none" - // Email: [{home gre@example.com} {work gre@work.com}] - // Groups: [Friends Squash] - // Address: {Hanga Roa Easter Island} -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/vim25/xml/extras.go juju-core-2.0.2/src/github.com/juju/govmomi/vim25/xml/extras.go --- juju-core-2.0.0/src/github.com/juju/govmomi/vim25/xml/extras.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/vim25/xml/extras.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,93 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package xml - -import ( - "reflect" - "time" -) - -var xmlSchemaInstance = Name{Space: "http://www.w3.org/2001/XMLSchema-instance", Local: "type"} - -var stringToTypeMap = map[string]reflect.Type{ - "xsd:boolean": reflect.TypeOf((*bool)(nil)).Elem(), - "xsd:byte": reflect.TypeOf((*int8)(nil)).Elem(), - "xsd:short": reflect.TypeOf((*int16)(nil)).Elem(), - "xsd:int": reflect.TypeOf((*int32)(nil)).Elem(), - "xsd:long": reflect.TypeOf((*int64)(nil)).Elem(), - "xsd:unsignedByte": reflect.TypeOf((*uint8)(nil)).Elem(), - "xsd:unsignedShort": reflect.TypeOf((*uint16)(nil)).Elem(), - "xsd:unsignedInt": reflect.TypeOf((*uint32)(nil)).Elem(), - "xsd:unsignedLong": reflect.TypeOf((*uint64)(nil)).Elem(), - "xsd:float": reflect.TypeOf((*float32)(nil)).Elem(), - "xsd:double": reflect.TypeOf((*float64)(nil)).Elem(), - "xsd:string": reflect.TypeOf((*string)(nil)).Elem(), - "xsd:dateTime": reflect.TypeOf((*time.Time)(nil)).Elem(), - "xsd:base64Binary": reflect.TypeOf((*[]byte)(nil)).Elem(), -} - -// Return a reflect.Type for the specified type. Nil if unknown. -func stringToType(s string) reflect.Type { - return stringToTypeMap[s] -} - -// Return a string for the specified reflect.Type. Panic if unknown. -func typeToString(typ reflect.Type) string { - switch typ.Kind() { - case reflect.Bool: - return "xsd:boolean" - case reflect.Int8: - return "xsd:byte" - case reflect.Int16: - return "xsd:short" - case reflect.Int32: - return "xsd:int" - case reflect.Int, reflect.Int64: - return "xsd:long" - case reflect.Uint8: - return "xsd:unsignedByte" - case reflect.Uint16: - return "xsd:unsignedShort" - case reflect.Uint32: - return "xsd:unsignedInt" - case reflect.Uint, reflect.Uint64: - return "xsd:unsignedLong" - case reflect.Float32: - return "xsd:float" - case reflect.Float64: - return "xsd:double" - case reflect.String: - return "xsd:string" - case reflect.Struct: - if typ == stringToTypeMap["xsd:dateTime"] { - return "xsd:dateTime" - } - - // Expect any other struct to be handled... - return typ.Name() - case reflect.Slice: - if typ.Elem().Kind() == reflect.Uint8 { - return "xsd:base64Binary" - } - case reflect.Array: - if typ.Elem().Kind() == reflect.Uint8 { - return "xsd:base64Binary" - } - } - - panic("don't know what to do for type: " + typ.String()) -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/vim25/xml/extras_test.go juju-core-2.0.2/src/github.com/juju/govmomi/vim25/xml/extras_test.go --- juju-core-2.0.0/src/github.com/juju/govmomi/vim25/xml/extras_test.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/vim25/xml/extras_test.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,222 +0,0 @@ -/* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. - -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, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package xml - -import ( - "bytes" - "reflect" - "testing" - "time" -) - -type MyType struct { - Value string -} - -var myTypes = map[string]reflect.Type{ - "MyType": reflect.TypeOf(MyType{}), - "ValueType": reflect.TypeOf(ValueType{}), - "PointerType": reflect.TypeOf(PointerType{}), -} - -func MyTypes(name string) (reflect.Type, bool) { - t, ok := myTypes[name] - return t, ok -} - -func TestMarshalWithEmptyInterface(t *testing.T) { - var r1, r2 struct { - XMLName Name `xml:"root"` - Values []interface{} `xml:"value,typeattr"` - } - - var tests = []struct { - Value interface{} - }{ - {Value: bool(true)}, - {Value: int8(-8)}, - {Value: int16(-16)}, - {Value: int32(-32)}, - {Value: int64(-64)}, - {Value: uint8(8)}, - {Value: uint16(16)}, - {Value: uint32(32)}, - {Value: uint64(64)}, - {Value: float32(32.0)}, - {Value: float64(64.0)}, - {Value: string("string")}, - {Value: time.Now()}, - {Value: ParseTime("2009-10-04T01:35:58+00:00")}, - {Value: []byte("bytes")}, - {Value: MyType{Value: "v"}}, - } - - for _, test := range tests { - r1.XMLName.Local = "root" - r1.Values = []interface{}{test.Value} - r2.XMLName = Name{} - r2.Values = nil - - b, err := Marshal(r1) - if err != nil { - t.Fatalf("Marshal: %s", err) - } - - dec := NewDecoder(bytes.NewReader(b)) - dec.TypeFunc = MyTypes - err = dec.Decode(&r2) - if err != nil { - t.Fatalf("Unmarshal: %s", err) - } - - switch r1.Values[0].(type) { - case time.Time: - if !r1.Values[0].(time.Time).Equal(r2.Values[0].(time.Time)) { - t.Errorf("Expected: %#v, actual: %#v", r1, r2) - } - default: - if !reflect.DeepEqual(r1, r2) { - t.Errorf("Expected: %#v, actual: %#v", r1, r2) - } - } - } -} - -type VIntf interface { - V() string -} - -type ValueType struct { - Value string `xml:",chardata"` -} - -type PointerType struct { - Value string `xml:",chardata"` -} - -func (t ValueType) V() string { - return t.Value -} - -func (t *PointerType) V() string { - return t.Value -} - -func TestMarshalWithInterface(t *testing.T) { - var r1, r2 struct { - XMLName Name `xml:"root"` - Values []VIntf `xml:"value,typeattr"` - } - - r1.XMLName.Local = "root" - r1.Values = []VIntf{ - ValueType{"v1"}, - &PointerType{"v2"}, - } - - b, err := Marshal(r1) - if err != nil { - t.Fatalf("Marshal: %s", err) - } - - dec := NewDecoder(bytes.NewReader(b)) - dec.TypeFunc = MyTypes - err = dec.Decode(&r2) - if err != nil { - t.Fatalf("Unmarshal: %s", err) - } - - if !reflect.DeepEqual(r1, r2) { - t.Errorf("expected: %#v, actual: %#v", r1, r2) - } -} - -type test3iface interface { - Value() string -} - -type test3a struct { - V string `xml:",chardata"` -} - -func (t test3a) Value() string { return t.V } - -type test3b struct { - V string `xml:",chardata"` -} - -func (t test3b) Value() string { return t.V } - -func TestUnmarshalInterfaceWithoutTypeAttr(t *testing.T) { - var r struct { - XMLName Name `xml:"root"` - Values []test3iface `xml:"value,typeattr"` - } - - b := ` - - A - B - - ` - - fn := func(name string) (reflect.Type, bool) { - switch name { - case "test3a": - return reflect.TypeOf(test3a{}), true - case "test3iface": - return reflect.TypeOf(test3b{}), true - default: - return nil, false - } - } - - dec := NewDecoder(bytes.NewReader([]byte(b))) - dec.TypeFunc = fn - err := dec.Decode(&r) - if err != nil { - t.Fatalf("Unmarshal: %s", err) - } - - if len(r.Values) != 2 { - t.Errorf("Expected 2 values") - } - - exps := []struct { - Typ reflect.Type - Val string - }{ - { - Typ: reflect.TypeOf(test3a{}), - Val: "A", - }, - { - Typ: reflect.TypeOf(test3b{}), - Val: "B", - }, - } - - for i, e := range exps { - if val := r.Values[i].Value(); val != e.Val { - t.Errorf("Expected: %s, got: %s", e.Val, val) - } - - if typ := reflect.TypeOf(r.Values[i]); typ.Name() != e.Typ.Name() { - t.Errorf("Expected: %s, got: %s", e.Typ.Name(), typ.Name()) - } - } -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/vim25/xml/LICENSE juju-core-2.0.2/src/github.com/juju/govmomi/vim25/xml/LICENSE --- juju-core-2.0.0/src/github.com/juju/govmomi/vim25/xml/LICENSE 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/vim25/xml/LICENSE 1970-01-01 00:00:00.000000000 +0000 @@ -1,27 +0,0 @@ -Copyright (c) 2012 The Go Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/vim25/xml/marshal.go juju-core-2.0.2/src/github.com/juju/govmomi/vim25/xml/marshal.go --- juju-core-2.0.0/src/github.com/juju/govmomi/vim25/xml/marshal.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/vim25/xml/marshal.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,949 +0,0 @@ -// Copyright 2011 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package xml - -import ( - "bufio" - "bytes" - "encoding" - "fmt" - "io" - "reflect" - "strconv" - "strings" -) - -const ( - // A generic XML header suitable for use with the output of Marshal. - // This is not automatically added to any output of this package, - // it is provided as a convenience. - Header = `` + "\n" -) - -// Marshal returns the XML encoding of v. -// -// Marshal handles an array or slice by marshalling each of the elements. -// Marshal handles a pointer by marshalling the value it points at or, if the -// pointer is nil, by writing nothing. Marshal handles an interface value by -// marshalling the value it contains or, if the interface value is nil, by -// writing nothing. Marshal handles all other data by writing one or more XML -// elements containing the data. -// -// The name for the XML elements is taken from, in order of preference: -// - the tag on the XMLName field, if the data is a struct -// - the value of the XMLName field of type xml.Name -// - the tag of the struct field used to obtain the data -// - the name of the struct field used to obtain the data -// - the name of the marshalled type -// -// The XML element for a struct contains marshalled elements for each of the -// exported fields of the struct, with these exceptions: -// - the XMLName field, described above, is omitted. -// - a field with tag "-" is omitted. -// - a field with tag "name,attr" becomes an attribute with -// the given name in the XML element. -// - a field with tag ",attr" becomes an attribute with the -// field name in the XML element. -// - a field with tag ",chardata" is written as character data, -// not as an XML element. -// - a field with tag ",innerxml" is written verbatim, not subject -// to the usual marshalling procedure. -// - a field with tag ",comment" is written as an XML comment, not -// subject to the usual marshalling procedure. It must not contain -// the "--" string within it. -// - a field with a tag including the "omitempty" option is omitted -// if the field value is empty. The empty values are false, 0, any -// nil pointer or interface value, and any array, slice, map, or -// string of length zero. -// - an anonymous struct field is handled as if the fields of its -// value were part of the outer struct. -// -// If a field uses a tag "a>b>c", then the element c will be nested inside -// parent elements a and b. Fields that appear next to each other that name -// the same parent will be enclosed in one XML element. -// -// See MarshalIndent for an example. -// -// Marshal will return an error if asked to marshal a channel, function, or map. -func Marshal(v interface{}) ([]byte, error) { - var b bytes.Buffer - if err := NewEncoder(&b).Encode(v); err != nil { - return nil, err - } - return b.Bytes(), nil -} - -// Marshaler is the interface implemented by objects that can marshal -// themselves into valid XML elements. -// -// MarshalXML encodes the receiver as zero or more XML elements. -// By convention, arrays or slices are typically encoded as a sequence -// of elements, one per entry. -// Using start as the element tag is not required, but doing so -// will enable Unmarshal to match the XML elements to the correct -// struct field. -// One common implementation strategy is to construct a separate -// value with a layout corresponding to the desired XML and then -// to encode it using e.EncodeElement. -// Another common strategy is to use repeated calls to e.EncodeToken -// to generate the XML output one token at a time. -// The sequence of encoded tokens must make up zero or more valid -// XML elements. -type Marshaler interface { - MarshalXML(e *Encoder, start StartElement) error -} - -// MarshalerAttr is the interface implemented by objects that can marshal -// themselves into valid XML attributes. -// -// MarshalXMLAttr returns an XML attribute with the encoded value of the receiver. -// Using name as the attribute name is not required, but doing so -// will enable Unmarshal to match the attribute to the correct -// struct field. -// If MarshalXMLAttr returns the zero attribute Attr{}, no attribute -// will be generated in the output. -// MarshalXMLAttr is used only for struct fields with the -// "attr" option in the field tag. -type MarshalerAttr interface { - MarshalXMLAttr(name Name) (Attr, error) -} - -// MarshalIndent works like Marshal, but each XML element begins on a new -// indented line that starts with prefix and is followed by one or more -// copies of indent according to the nesting depth. -func MarshalIndent(v interface{}, prefix, indent string) ([]byte, error) { - var b bytes.Buffer - enc := NewEncoder(&b) - enc.Indent(prefix, indent) - if err := enc.Encode(v); err != nil { - return nil, err - } - return b.Bytes(), nil -} - -// An Encoder writes XML data to an output stream. -type Encoder struct { - p printer -} - -// NewEncoder returns a new encoder that writes to w. -func NewEncoder(w io.Writer) *Encoder { - e := &Encoder{printer{Writer: bufio.NewWriter(w)}} - e.p.encoder = e - return e -} - -// Indent sets the encoder to generate XML in which each element -// begins on a new indented line that starts with prefix and is followed by -// one or more copies of indent according to the nesting depth. -func (enc *Encoder) Indent(prefix, indent string) { - enc.p.prefix = prefix - enc.p.indent = indent -} - -// Encode writes the XML encoding of v to the stream. -// -// See the documentation for Marshal for details about the conversion -// of Go values to XML. -// -// Encode calls Flush before returning. -func (enc *Encoder) Encode(v interface{}) error { - err := enc.p.marshalValue(reflect.ValueOf(v), nil, nil) - if err != nil { - return err - } - return enc.p.Flush() -} - -// EncodeElement writes the XML encoding of v to the stream, -// using start as the outermost tag in the encoding. -// -// See the documentation for Marshal for details about the conversion -// of Go values to XML. -// -// EncodeElement calls Flush before returning. -func (enc *Encoder) EncodeElement(v interface{}, start StartElement) error { - err := enc.p.marshalValue(reflect.ValueOf(v), nil, &start) - if err != nil { - return err - } - return enc.p.Flush() -} - -var ( - endComment = []byte("-->") - endProcInst = []byte("?>") - endDirective = []byte(">") -) - -// EncodeToken writes the given XML token to the stream. -// It returns an error if StartElement and EndElement tokens are not properly matched. -// -// EncodeToken does not call Flush, because usually it is part of a larger operation -// such as Encode or EncodeElement (or a custom Marshaler's MarshalXML invoked -// during those), and those will call Flush when finished. -// Callers that create an Encoder and then invoke EncodeToken directly, without -// using Encode or EncodeElement, need to call Flush when finished to ensure -// that the XML is written to the underlying writer. -// -// EncodeToken allows writing a ProcInst with Target set to "xml" only as the first token -// in the stream. -func (enc *Encoder) EncodeToken(t Token) error { - p := &enc.p - switch t := t.(type) { - case StartElement: - if err := p.writeStart(&t); err != nil { - return err - } - case EndElement: - if err := p.writeEnd(t.Name); err != nil { - return err - } - case CharData: - EscapeText(p, t) - case Comment: - if bytes.Contains(t, endComment) { - return fmt.Errorf("xml: EncodeToken of Comment containing --> marker") - } - p.WriteString("") - return p.cachedWriteError() - case ProcInst: - // First token to be encoded which is also a ProcInst with target of xml - // is the xml declaration. The only ProcInst where target of xml is allowed. - if t.Target == "xml" && p.Buffered() != 0 { - return fmt.Errorf("xml: EncodeToken of ProcInst xml target only valid for xml declaration, first token encoded") - } - if !isNameString(t.Target) { - return fmt.Errorf("xml: EncodeToken of ProcInst with invalid Target") - } - if bytes.Contains(t.Inst, endProcInst) { - return fmt.Errorf("xml: EncodeToken of ProcInst containing ?> marker") - } - p.WriteString(" 0 { - p.WriteByte(' ') - p.Write(t.Inst) - } - p.WriteString("?>") - case Directive: - if bytes.Contains(t, endDirective) { - return fmt.Errorf("xml: EncodeToken of Directive containing > marker") - } - p.WriteString("") - } - return p.cachedWriteError() -} - -// Flush flushes any buffered XML to the underlying writer. -// See the EncodeToken documentation for details about when it is necessary. -func (enc *Encoder) Flush() error { - return enc.p.Flush() -} - -type printer struct { - *bufio.Writer - encoder *Encoder - seq int - indent string - prefix string - depth int - indentedIn bool - putNewline bool - attrNS map[string]string // map prefix -> name space - attrPrefix map[string]string // map name space -> prefix - prefixes []string - tags []Name -} - -// createAttrPrefix finds the name space prefix attribute to use for the given name space, -// defining a new prefix if necessary. It returns the prefix. -func (p *printer) createAttrPrefix(url string) string { - if prefix := p.attrPrefix[url]; prefix != "" { - return prefix - } - - // The "http://www.w3.org/XML/1998/namespace" name space is predefined as "xml" - // and must be referred to that way. - // (The "http://www.w3.org/2000/xmlns/" name space is also predefined as "xmlns", - // but users should not be trying to use that one directly - that's our job.) - if url == xmlURL { - return "xml" - } - - // Need to define a new name space. - if p.attrPrefix == nil { - p.attrPrefix = make(map[string]string) - p.attrNS = make(map[string]string) - } - - // Pick a name. We try to use the final element of the path - // but fall back to _. - prefix := strings.TrimRight(url, "/") - if i := strings.LastIndex(prefix, "/"); i >= 0 { - prefix = prefix[i+1:] - } - if prefix == "" || !isName([]byte(prefix)) || strings.Contains(prefix, ":") { - prefix = "_" - } - if strings.HasPrefix(prefix, "xml") { - // xmlanything is reserved. - prefix = "_" + prefix - } - if p.attrNS[prefix] != "" { - // Name is taken. Find a better one. - for p.seq++; ; p.seq++ { - if id := prefix + "_" + strconv.Itoa(p.seq); p.attrNS[id] == "" { - prefix = id - break - } - } - } - - p.attrPrefix[url] = prefix - p.attrNS[prefix] = url - - p.WriteString(`xmlns:`) - p.WriteString(prefix) - p.WriteString(`="`) - EscapeText(p, []byte(url)) - p.WriteString(`" `) - - p.prefixes = append(p.prefixes, prefix) - - return prefix -} - -// deleteAttrPrefix removes an attribute name space prefix. -func (p *printer) deleteAttrPrefix(prefix string) { - delete(p.attrPrefix, p.attrNS[prefix]) - delete(p.attrNS, prefix) -} - -func (p *printer) markPrefix() { - p.prefixes = append(p.prefixes, "") -} - -func (p *printer) popPrefix() { - for len(p.prefixes) > 0 { - prefix := p.prefixes[len(p.prefixes)-1] - p.prefixes = p.prefixes[:len(p.prefixes)-1] - if prefix == "" { - break - } - p.deleteAttrPrefix(prefix) - } -} - -var ( - marshalerType = reflect.TypeOf((*Marshaler)(nil)).Elem() - marshalerAttrType = reflect.TypeOf((*MarshalerAttr)(nil)).Elem() - textMarshalerType = reflect.TypeOf((*encoding.TextMarshaler)(nil)).Elem() -) - -// marshalValue writes one or more XML elements representing val. -// If val was obtained from a struct field, finfo must have its details. -func (p *printer) marshalValue(val reflect.Value, finfo *fieldInfo, startTemplate *StartElement) error { - if startTemplate != nil && startTemplate.Name.Local == "" { - return fmt.Errorf("xml: EncodeElement of StartElement with missing name") - } - - if !val.IsValid() { - return nil - } - if finfo != nil && finfo.flags&fOmitEmpty != 0 && isEmptyValue(val) { - return nil - } - - // Drill into interfaces and pointers. - // This can turn into an infinite loop given a cyclic chain, - // but it matches the Go 1 behavior. - for val.Kind() == reflect.Interface || val.Kind() == reflect.Ptr { - if val.IsNil() { - return nil - } - val = val.Elem() - } - - kind := val.Kind() - typ := val.Type() - - // Check for marshaler. - if val.CanInterface() && typ.Implements(marshalerType) { - return p.marshalInterface(val.Interface().(Marshaler), defaultStart(typ, finfo, startTemplate)) - } - if val.CanAddr() { - pv := val.Addr() - if pv.CanInterface() && pv.Type().Implements(marshalerType) { - return p.marshalInterface(pv.Interface().(Marshaler), defaultStart(pv.Type(), finfo, startTemplate)) - } - } - - // Check for text marshaler. - if val.CanInterface() && typ.Implements(textMarshalerType) { - return p.marshalTextInterface(val.Interface().(encoding.TextMarshaler), defaultStart(typ, finfo, startTemplate)) - } - if val.CanAddr() { - pv := val.Addr() - if pv.CanInterface() && pv.Type().Implements(textMarshalerType) { - return p.marshalTextInterface(pv.Interface().(encoding.TextMarshaler), defaultStart(pv.Type(), finfo, startTemplate)) - } - } - - // Slices and arrays iterate over the elements. They do not have an enclosing tag. - if (kind == reflect.Slice || kind == reflect.Array) && typ.Elem().Kind() != reflect.Uint8 { - for i, n := 0, val.Len(); i < n; i++ { - if err := p.marshalValue(val.Index(i), finfo, startTemplate); err != nil { - return err - } - } - return nil - } - - tinfo, err := getTypeInfo(typ) - if err != nil { - return err - } - - // Create start element. - // Precedence for the XML element name is: - // 0. startTemplate - // 1. XMLName field in underlying struct; - // 2. field name/tag in the struct field; and - // 3. type name - var start StartElement - - if startTemplate != nil { - start.Name = startTemplate.Name - start.Attr = append(start.Attr, startTemplate.Attr...) - } else if tinfo.xmlname != nil { - xmlname := tinfo.xmlname - if xmlname.name != "" { - start.Name.Space, start.Name.Local = xmlname.xmlns, xmlname.name - } else if v, ok := xmlname.value(val).Interface().(Name); ok && v.Local != "" { - start.Name = v - } - } - if start.Name.Local == "" && finfo != nil { - start.Name.Space, start.Name.Local = finfo.xmlns, finfo.name - } - if start.Name.Local == "" { - name := typ.Name() - if name == "" { - return &UnsupportedTypeError{typ} - } - start.Name.Local = name - } - - // Add type attribute if necessary - if finfo != nil && finfo.flags&fTypeAttr != 0 { - start.Attr = append(start.Attr, Attr{xmlSchemaInstance, typeToString(typ)}) - } - - // Attributes - for i := range tinfo.fields { - finfo := &tinfo.fields[i] - if finfo.flags&fAttr == 0 { - continue - } - fv := finfo.value(val) - name := Name{Space: finfo.xmlns, Local: finfo.name} - - if finfo.flags&fOmitEmpty != 0 && isEmptyValue(fv) { - continue - } - - if fv.Kind() == reflect.Interface && fv.IsNil() { - continue - } - - if fv.CanInterface() && fv.Type().Implements(marshalerAttrType) { - attr, err := fv.Interface().(MarshalerAttr).MarshalXMLAttr(name) - if err != nil { - return err - } - if attr.Name.Local != "" { - start.Attr = append(start.Attr, attr) - } - continue - } - - if fv.CanAddr() { - pv := fv.Addr() - if pv.CanInterface() && pv.Type().Implements(marshalerAttrType) { - attr, err := pv.Interface().(MarshalerAttr).MarshalXMLAttr(name) - if err != nil { - return err - } - if attr.Name.Local != "" { - start.Attr = append(start.Attr, attr) - } - continue - } - } - - if fv.CanInterface() && fv.Type().Implements(textMarshalerType) { - text, err := fv.Interface().(encoding.TextMarshaler).MarshalText() - if err != nil { - return err - } - start.Attr = append(start.Attr, Attr{name, string(text)}) - continue - } - - if fv.CanAddr() { - pv := fv.Addr() - if pv.CanInterface() && pv.Type().Implements(textMarshalerType) { - text, err := pv.Interface().(encoding.TextMarshaler).MarshalText() - if err != nil { - return err - } - start.Attr = append(start.Attr, Attr{name, string(text)}) - continue - } - } - - // Dereference or skip nil pointer, interface values. - switch fv.Kind() { - case reflect.Ptr, reflect.Interface: - if fv.IsNil() { - continue - } - fv = fv.Elem() - } - - s, b, err := p.marshalSimple(fv.Type(), fv) - if err != nil { - return err - } - if b != nil { - s = string(b) - } - start.Attr = append(start.Attr, Attr{name, s}) - } - - if err := p.writeStart(&start); err != nil { - return err - } - - if val.Kind() == reflect.Struct { - err = p.marshalStruct(tinfo, val) - } else { - s, b, err1 := p.marshalSimple(typ, val) - if err1 != nil { - err = err1 - } else if b != nil { - EscapeText(p, b) - } else { - p.EscapeString(s) - } - } - if err != nil { - return err - } - - if err := p.writeEnd(start.Name); err != nil { - return err - } - - return p.cachedWriteError() -} - -// defaultStart returns the default start element to use, -// given the reflect type, field info, and start template. -func defaultStart(typ reflect.Type, finfo *fieldInfo, startTemplate *StartElement) StartElement { - var start StartElement - // Precedence for the XML element name is as above, - // except that we do not look inside structs for the first field. - if startTemplate != nil { - start.Name = startTemplate.Name - start.Attr = append(start.Attr, startTemplate.Attr...) - } else if finfo != nil && finfo.name != "" { - start.Name.Local = finfo.name - start.Name.Space = finfo.xmlns - } else if typ.Name() != "" { - start.Name.Local = typ.Name() - } else { - // Must be a pointer to a named type, - // since it has the Marshaler methods. - start.Name.Local = typ.Elem().Name() - } - - // Add type attribute if necessary - if finfo != nil && finfo.flags&fTypeAttr != 0 { - start.Attr = append(start.Attr, Attr{xmlSchemaInstance, typeToString(typ)}) - } - - return start -} - -// marshalInterface marshals a Marshaler interface value. -func (p *printer) marshalInterface(val Marshaler, start StartElement) error { - // Push a marker onto the tag stack so that MarshalXML - // cannot close the XML tags that it did not open. - p.tags = append(p.tags, Name{}) - n := len(p.tags) - - err := val.MarshalXML(p.encoder, start) - if err != nil { - return err - } - - // Make sure MarshalXML closed all its tags. p.tags[n-1] is the mark. - if len(p.tags) > n { - return fmt.Errorf("xml: %s.MarshalXML wrote invalid XML: <%s> not closed", receiverType(val), p.tags[len(p.tags)-1].Local) - } - p.tags = p.tags[:n-1] - return nil -} - -// marshalTextInterface marshals a TextMarshaler interface value. -func (p *printer) marshalTextInterface(val encoding.TextMarshaler, start StartElement) error { - if err := p.writeStart(&start); err != nil { - return err - } - text, err := val.MarshalText() - if err != nil { - return err - } - EscapeText(p, text) - return p.writeEnd(start.Name) -} - -// writeStart writes the given start element. -func (p *printer) writeStart(start *StartElement) error { - if start.Name.Local == "" { - return fmt.Errorf("xml: start tag with no name") - } - - p.tags = append(p.tags, start.Name) - p.markPrefix() - - p.writeIndent(1) - p.WriteByte('<') - p.WriteString(start.Name.Local) - - if start.Name.Space != "" { - p.WriteString(` xmlns="`) - p.EscapeString(start.Name.Space) - p.WriteByte('"') - } - - // Attributes - for _, attr := range start.Attr { - name := attr.Name - if name.Local == "" { - continue - } - p.WriteByte(' ') - if name.Space != "" { - p.WriteString(p.createAttrPrefix(name.Space)) - p.WriteByte(':') - } - p.WriteString(name.Local) - p.WriteString(`="`) - p.EscapeString(attr.Value) - p.WriteByte('"') - } - p.WriteByte('>') - return nil -} - -func (p *printer) writeEnd(name Name) error { - if name.Local == "" { - return fmt.Errorf("xml: end tag with no name") - } - if len(p.tags) == 0 || p.tags[len(p.tags)-1].Local == "" { - return fmt.Errorf("xml: end tag without start tag", name.Local) - } - if top := p.tags[len(p.tags)-1]; top != name { - if top.Local != name.Local { - return fmt.Errorf("xml: end tag does not match start tag <%s>", name.Local, top.Local) - } - return fmt.Errorf("xml: end tag in namespace %s does not match start tag <%s> in namespace %s", name.Local, name.Space, top.Local, top.Space) - } - p.tags = p.tags[:len(p.tags)-1] - - p.writeIndent(-1) - p.WriteByte('<') - p.WriteByte('/') - p.WriteString(name.Local) - p.WriteByte('>') - p.popPrefix() - return nil -} - -func (p *printer) marshalSimple(typ reflect.Type, val reflect.Value) (string, []byte, error) { - switch val.Kind() { - case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: - return strconv.FormatInt(val.Int(), 10), nil, nil - case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: - return strconv.FormatUint(val.Uint(), 10), nil, nil - case reflect.Float32, reflect.Float64: - return strconv.FormatFloat(val.Float(), 'g', -1, val.Type().Bits()), nil, nil - case reflect.String: - return val.String(), nil, nil - case reflect.Bool: - return strconv.FormatBool(val.Bool()), nil, nil - case reflect.Array: - if typ.Elem().Kind() != reflect.Uint8 { - break - } - // [...]byte - var bytes []byte - if val.CanAddr() { - bytes = val.Slice(0, val.Len()).Bytes() - } else { - bytes = make([]byte, val.Len()) - reflect.Copy(reflect.ValueOf(bytes), val) - } - return "", bytes, nil - case reflect.Slice: - if typ.Elem().Kind() != reflect.Uint8 { - break - } - // []byte - return "", val.Bytes(), nil - } - return "", nil, &UnsupportedTypeError{typ} -} - -var ddBytes = []byte("--") - -func (p *printer) marshalStruct(tinfo *typeInfo, val reflect.Value) error { - s := parentStack{p: p} - for i := range tinfo.fields { - finfo := &tinfo.fields[i] - if finfo.flags&fAttr != 0 { - continue - } - vf := finfo.value(val) - - // Dereference or skip nil pointer, interface values. - switch vf.Kind() { - case reflect.Ptr, reflect.Interface: - if !vf.IsNil() { - vf = vf.Elem() - } - } - - switch finfo.flags & fMode { - case fCharData: - if vf.CanInterface() && vf.Type().Implements(textMarshalerType) { - data, err := vf.Interface().(encoding.TextMarshaler).MarshalText() - if err != nil { - return err - } - Escape(p, data) - continue - } - if vf.CanAddr() { - pv := vf.Addr() - if pv.CanInterface() && pv.Type().Implements(textMarshalerType) { - data, err := pv.Interface().(encoding.TextMarshaler).MarshalText() - if err != nil { - return err - } - Escape(p, data) - continue - } - } - var scratch [64]byte - switch vf.Kind() { - case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: - Escape(p, strconv.AppendInt(scratch[:0], vf.Int(), 10)) - case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: - Escape(p, strconv.AppendUint(scratch[:0], vf.Uint(), 10)) - case reflect.Float32, reflect.Float64: - Escape(p, strconv.AppendFloat(scratch[:0], vf.Float(), 'g', -1, vf.Type().Bits())) - case reflect.Bool: - Escape(p, strconv.AppendBool(scratch[:0], vf.Bool())) - case reflect.String: - if err := EscapeText(p, []byte(vf.String())); err != nil { - return err - } - case reflect.Slice: - if elem, ok := vf.Interface().([]byte); ok { - if err := EscapeText(p, elem); err != nil { - return err - } - } - } - continue - - case fComment: - k := vf.Kind() - if !(k == reflect.String || k == reflect.Slice && vf.Type().Elem().Kind() == reflect.Uint8) { - return fmt.Errorf("xml: bad type for comment field of %s", val.Type()) - } - if vf.Len() == 0 { - continue - } - p.writeIndent(0) - p.WriteString("" is invalid grammar. Make it "- -->" - p.WriteByte(' ') - } - p.WriteString("-->") - continue - - case fInnerXml: - iface := vf.Interface() - switch raw := iface.(type) { - case []byte: - p.Write(raw) - continue - case string: - p.WriteString(raw) - continue - } - - case fElement, fElement | fAny: - if err := s.trim(finfo.parents); err != nil { - return err - } - if len(finfo.parents) > len(s.stack) { - if vf.Kind() != reflect.Ptr && vf.Kind() != reflect.Interface || !vf.IsNil() { - if err := s.push(finfo.parents[len(s.stack):]); err != nil { - return err - } - } - } - } - if err := p.marshalValue(vf, finfo, nil); err != nil { - return err - } - } - s.trim(nil) - return p.cachedWriteError() -} - -// return the bufio Writer's cached write error -func (p *printer) cachedWriteError() error { - _, err := p.Write(nil) - return err -} - -func (p *printer) writeIndent(depthDelta int) { - if len(p.prefix) == 0 && len(p.indent) == 0 { - return - } - if depthDelta < 0 { - p.depth-- - if p.indentedIn { - p.indentedIn = false - return - } - p.indentedIn = false - } - if p.putNewline { - p.WriteByte('\n') - } else { - p.putNewline = true - } - if len(p.prefix) > 0 { - p.WriteString(p.prefix) - } - if len(p.indent) > 0 { - for i := 0; i < p.depth; i++ { - p.WriteString(p.indent) - } - } - if depthDelta > 0 { - p.depth++ - p.indentedIn = true - } -} - -type parentStack struct { - p *printer - stack []string -} - -// trim updates the XML context to match the longest common prefix of the stack -// and the given parents. A closing tag will be written for every parent -// popped. Passing a zero slice or nil will close all the elements. -func (s *parentStack) trim(parents []string) error { - split := 0 - for ; split < len(parents) && split < len(s.stack); split++ { - if parents[split] != s.stack[split] { - break - } - } - for i := len(s.stack) - 1; i >= split; i-- { - if err := s.p.writeEnd(Name{Local: s.stack[i]}); err != nil { - return err - } - } - s.stack = parents[:split] - return nil -} - -// push adds parent elements to the stack and writes open tags. -func (s *parentStack) push(parents []string) error { - for i := 0; i < len(parents); i++ { - if err := s.p.writeStart(&StartElement{Name: Name{Local: parents[i]}}); err != nil { - return err - } - } - s.stack = append(s.stack, parents...) - return nil -} - -// A MarshalXMLError is returned when Marshal encounters a type -// that cannot be converted into XML. -type UnsupportedTypeError struct { - Type reflect.Type -} - -func (e *UnsupportedTypeError) Error() string { - return "xml: unsupported type: " + e.Type.String() -} - -func isEmptyValue(v reflect.Value) bool { - switch v.Kind() { - case reflect.Array, reflect.Map, reflect.Slice, reflect.String: - return v.Len() == 0 - case reflect.Bool: - return !v.Bool() - case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: - return v.Int() == 0 - case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: - return v.Uint() == 0 - case reflect.Float32, reflect.Float64: - return v.Float() == 0 - case reflect.Interface, reflect.Ptr: - return v.IsNil() - } - return false -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/vim25/xml/marshal_test.go juju-core-2.0.2/src/github.com/juju/govmomi/vim25/xml/marshal_test.go --- juju-core-2.0.0/src/github.com/juju/govmomi/vim25/xml/marshal_test.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/vim25/xml/marshal_test.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,1266 +0,0 @@ -// Copyright 2011 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package xml - -import ( - "bytes" - "errors" - "fmt" - "io" - "reflect" - "strconv" - "strings" - "testing" - "time" -) - -type DriveType int - -const ( - HyperDrive DriveType = iota - ImprobabilityDrive -) - -type Passenger struct { - Name []string `xml:"name"` - Weight float32 `xml:"weight"` -} - -type Ship struct { - XMLName struct{} `xml:"spaceship"` - - Name string `xml:"name,attr"` - Pilot string `xml:"pilot,attr"` - Drive DriveType `xml:"drive"` - Age uint `xml:"age"` - Passenger []*Passenger `xml:"passenger"` - secret string -} - -type NamedType string - -type Port struct { - XMLName struct{} `xml:"port"` - Type string `xml:"type,attr,omitempty"` - Comment string `xml:",comment"` - Number string `xml:",chardata"` -} - -type Domain struct { - XMLName struct{} `xml:"domain"` - Country string `xml:",attr,omitempty"` - Name []byte `xml:",chardata"` - Comment []byte `xml:",comment"` -} - -type Book struct { - XMLName struct{} `xml:"book"` - Title string `xml:",chardata"` -} - -type Event struct { - XMLName struct{} `xml:"event"` - Year int `xml:",chardata"` -} - -type Movie struct { - XMLName struct{} `xml:"movie"` - Length uint `xml:",chardata"` -} - -type Pi struct { - XMLName struct{} `xml:"pi"` - Approximation float32 `xml:",chardata"` -} - -type Universe struct { - XMLName struct{} `xml:"universe"` - Visible float64 `xml:",chardata"` -} - -type Particle struct { - XMLName struct{} `xml:"particle"` - HasMass bool `xml:",chardata"` -} - -type Departure struct { - XMLName struct{} `xml:"departure"` - When time.Time `xml:",chardata"` -} - -type SecretAgent struct { - XMLName struct{} `xml:"agent"` - Handle string `xml:"handle,attr"` - Identity string - Obfuscate string `xml:",innerxml"` -} - -type NestedItems struct { - XMLName struct{} `xml:"result"` - Items []string `xml:">item"` - Item1 []string `xml:"Items>item1"` -} - -type NestedOrder struct { - XMLName struct{} `xml:"result"` - Field1 string `xml:"parent>c"` - Field2 string `xml:"parent>b"` - Field3 string `xml:"parent>a"` -} - -type MixedNested struct { - XMLName struct{} `xml:"result"` - A string `xml:"parent1>a"` - B string `xml:"b"` - C string `xml:"parent1>parent2>c"` - D string `xml:"parent1>d"` -} - -type NilTest struct { - A interface{} `xml:"parent1>parent2>a"` - B interface{} `xml:"parent1>b"` - C interface{} `xml:"parent1>parent2>c"` -} - -type Service struct { - XMLName struct{} `xml:"service"` - Domain *Domain `xml:"host>domain"` - Port *Port `xml:"host>port"` - Extra1 interface{} - Extra2 interface{} `xml:"host>extra2"` -} - -var nilStruct *Ship - -type EmbedA struct { - EmbedC - EmbedB EmbedB - FieldA string -} - -type EmbedB struct { - FieldB string - *EmbedC -} - -type EmbedC struct { - FieldA1 string `xml:"FieldA>A1"` - FieldA2 string `xml:"FieldA>A2"` - FieldB string - FieldC string -} - -type NameCasing struct { - XMLName struct{} `xml:"casing"` - Xy string - XY string - XyA string `xml:"Xy,attr"` - XYA string `xml:"XY,attr"` -} - -type NamePrecedence struct { - XMLName Name `xml:"Parent"` - FromTag XMLNameWithoutTag `xml:"InTag"` - FromNameVal XMLNameWithoutTag - FromNameTag XMLNameWithTag - InFieldName string -} - -type XMLNameWithTag struct { - XMLName Name `xml:"InXMLNameTag"` - Value string `xml:",chardata"` -} - -type XMLNameWithoutTag struct { - XMLName Name - Value string `xml:",chardata"` -} - -type NameInField struct { - Foo Name `xml:"ns foo"` -} - -type AttrTest struct { - Int int `xml:",attr"` - Named int `xml:"int,attr"` - Float float64 `xml:",attr"` - Uint8 uint8 `xml:",attr"` - Bool bool `xml:",attr"` - Str string `xml:",attr"` - Bytes []byte `xml:",attr"` -} - -type OmitAttrTest struct { - Int int `xml:",attr,omitempty"` - Named int `xml:"int,attr,omitempty"` - Float float64 `xml:",attr,omitempty"` - Uint8 uint8 `xml:",attr,omitempty"` - Bool bool `xml:",attr,omitempty"` - Str string `xml:",attr,omitempty"` - Bytes []byte `xml:",attr,omitempty"` -} - -type OmitFieldTest struct { - Int int `xml:",omitempty"` - Named int `xml:"int,omitempty"` - Float float64 `xml:",omitempty"` - Uint8 uint8 `xml:",omitempty"` - Bool bool `xml:",omitempty"` - Str string `xml:",omitempty"` - Bytes []byte `xml:",omitempty"` - Ptr *PresenceTest `xml:",omitempty"` -} - -type AnyTest struct { - XMLName struct{} `xml:"a"` - Nested string `xml:"nested>value"` - AnyField AnyHolder `xml:",any"` -} - -type AnyOmitTest struct { - XMLName struct{} `xml:"a"` - Nested string `xml:"nested>value"` - AnyField *AnyHolder `xml:",any,omitempty"` -} - -type AnySliceTest struct { - XMLName struct{} `xml:"a"` - Nested string `xml:"nested>value"` - AnyField []AnyHolder `xml:",any"` -} - -type AnyHolder struct { - XMLName Name - XML string `xml:",innerxml"` -} - -type RecurseA struct { - A string - B *RecurseB -} - -type RecurseB struct { - A *RecurseA - B string -} - -type PresenceTest struct { - Exists *struct{} -} - -type IgnoreTest struct { - PublicSecret string `xml:"-"` -} - -type MyBytes []byte - -type Data struct { - Bytes []byte - Attr []byte `xml:",attr"` - Custom MyBytes -} - -type Plain struct { - V interface{} -} - -type MyInt int - -type EmbedInt struct { - MyInt -} - -type Strings struct { - X []string `xml:"A>B,omitempty"` -} - -type PointerFieldsTest struct { - XMLName Name `xml:"dummy"` - Name *string `xml:"name,attr"` - Age *uint `xml:"age,attr"` - Empty *string `xml:"empty,attr"` - Contents *string `xml:",chardata"` -} - -type ChardataEmptyTest struct { - XMLName Name `xml:"test"` - Contents *string `xml:",chardata"` -} - -type MyMarshalerTest struct { -} - -var _ Marshaler = (*MyMarshalerTest)(nil) - -func (m *MyMarshalerTest) MarshalXML(e *Encoder, start StartElement) error { - e.EncodeToken(start) - e.EncodeToken(CharData([]byte("hello world"))) - e.EncodeToken(EndElement{start.Name}) - return nil -} - -type MyMarshalerAttrTest struct { -} - -var _ MarshalerAttr = (*MyMarshalerAttrTest)(nil) - -func (m *MyMarshalerAttrTest) MarshalXMLAttr(name Name) (Attr, error) { - return Attr{name, "hello world"}, nil -} - -type MarshalerStruct struct { - Foo MyMarshalerAttrTest `xml:",attr"` -} - -type InnerStruct struct { - XMLName Name `xml:"testns outer"` -} - -type OuterStruct struct { - InnerStruct - IntAttr int `xml:"int,attr"` -} - -type OuterNamedStruct struct { - InnerStruct - XMLName Name `xml:"outerns test"` - IntAttr int `xml:"int,attr"` -} - -type OuterNamedOrderedStruct struct { - XMLName Name `xml:"outerns test"` - InnerStruct - IntAttr int `xml:"int,attr"` -} - -type OuterOuterStruct struct { - OuterStruct -} - -func ifaceptr(x interface{}) interface{} { - return &x -} - -var ( - nameAttr = "Sarah" - ageAttr = uint(12) - contentsAttr = "lorem ipsum" -) - -// Unless explicitly stated as such (or *Plain), all of the -// tests below are two-way tests. When introducing new tests, -// please try to make them two-way as well to ensure that -// marshalling and unmarshalling are as symmetrical as feasible. -var marshalTests = []struct { - Value interface{} - ExpectXML string - MarshalOnly bool - UnmarshalOnly bool -}{ - // Test nil marshals to nothing - {Value: nil, ExpectXML: ``, MarshalOnly: true}, - {Value: nilStruct, ExpectXML: ``, MarshalOnly: true}, - - // Test value types - {Value: &Plain{true}, ExpectXML: `true`}, - {Value: &Plain{false}, ExpectXML: `false`}, - {Value: &Plain{int(42)}, ExpectXML: `42`}, - {Value: &Plain{int8(42)}, ExpectXML: `42`}, - {Value: &Plain{int16(42)}, ExpectXML: `42`}, - {Value: &Plain{int32(42)}, ExpectXML: `42`}, - {Value: &Plain{uint(42)}, ExpectXML: `42`}, - {Value: &Plain{uint8(42)}, ExpectXML: `42`}, - {Value: &Plain{uint16(42)}, ExpectXML: `42`}, - {Value: &Plain{uint32(42)}, ExpectXML: `42`}, - {Value: &Plain{float32(1.25)}, ExpectXML: `1.25`}, - {Value: &Plain{float64(1.25)}, ExpectXML: `1.25`}, - {Value: &Plain{uintptr(0xFFDD)}, ExpectXML: `65501`}, - {Value: &Plain{"gopher"}, ExpectXML: `gopher`}, - {Value: &Plain{[]byte("gopher")}, ExpectXML: `gopher`}, - {Value: &Plain{""}, ExpectXML: `</>`}, - {Value: &Plain{[]byte("")}, ExpectXML: `</>`}, - {Value: &Plain{[3]byte{'<', '/', '>'}}, ExpectXML: `</>`}, - {Value: &Plain{NamedType("potato")}, ExpectXML: `potato`}, - {Value: &Plain{[]int{1, 2, 3}}, ExpectXML: `123`}, - {Value: &Plain{[3]int{1, 2, 3}}, ExpectXML: `123`}, - {Value: ifaceptr(true), MarshalOnly: true, ExpectXML: `true`}, - - // Test time. - { - Value: &Plain{time.Unix(1e9, 123456789).UTC()}, - ExpectXML: `2001-09-09T01:46:40.123456789Z`, - }, - - // A pointer to struct{} may be used to test for an element's presence. - { - Value: &PresenceTest{new(struct{})}, - ExpectXML: ``, - }, - { - Value: &PresenceTest{}, - ExpectXML: ``, - }, - - // A pointer to struct{} may be used to test for an element's presence. - { - Value: &PresenceTest{new(struct{})}, - ExpectXML: ``, - }, - { - Value: &PresenceTest{}, - ExpectXML: ``, - }, - - // A []byte field is only nil if the element was not found. - { - Value: &Data{}, - ExpectXML: ``, - UnmarshalOnly: true, - }, - { - Value: &Data{Bytes: []byte{}, Custom: MyBytes{}, Attr: []byte{}}, - ExpectXML: ``, - UnmarshalOnly: true, - }, - - // Check that []byte works, including named []byte types. - { - Value: &Data{Bytes: []byte("ab"), Custom: MyBytes("cd"), Attr: []byte{'v'}}, - ExpectXML: `abcd`, - }, - - // Test innerxml - { - Value: &SecretAgent{ - Handle: "007", - Identity: "James Bond", - Obfuscate: "", - }, - ExpectXML: `James Bond`, - MarshalOnly: true, - }, - { - Value: &SecretAgent{ - Handle: "007", - Identity: "James Bond", - Obfuscate: "James Bond", - }, - ExpectXML: `James Bond`, - UnmarshalOnly: true, - }, - - // Test structs - {Value: &Port{Type: "ssl", Number: "443"}, ExpectXML: `443`}, - {Value: &Port{Number: "443"}, ExpectXML: `443`}, - {Value: &Port{Type: ""}, ExpectXML: ``}, - {Value: &Port{Number: "443", Comment: "https"}, ExpectXML: `443`}, - {Value: &Port{Number: "443", Comment: "add space-"}, ExpectXML: `443`, MarshalOnly: true}, - {Value: &Domain{Name: []byte("google.com&friends")}, ExpectXML: `google.com&friends`}, - {Value: &Domain{Name: []byte("google.com"), Comment: []byte(" &friends ")}, ExpectXML: `google.com`}, - {Value: &Book{Title: "Pride & Prejudice"}, ExpectXML: `Pride & Prejudice`}, - {Value: &Event{Year: -3114}, ExpectXML: `-3114`}, - {Value: &Movie{Length: 13440}, ExpectXML: `13440`}, - {Value: &Pi{Approximation: 3.14159265}, ExpectXML: `3.1415927`}, - {Value: &Universe{Visible: 9.3e13}, ExpectXML: `9.3e+13`}, - {Value: &Particle{HasMass: true}, ExpectXML: `true`}, - {Value: &Departure{When: ParseTime("2013-01-09T00:15:00-09:00")}, ExpectXML: `2013-01-09T00:15:00-09:00`}, - {Value: atomValue, ExpectXML: atomXml}, - { - Value: &Ship{ - Name: "Heart of Gold", - Pilot: "Computer", - Age: 1, - Drive: ImprobabilityDrive, - Passenger: []*Passenger{ - { - Name: []string{"Zaphod", "Beeblebrox"}, - Weight: 7.25, - }, - { - Name: []string{"Trisha", "McMillen"}, - Weight: 5.5, - }, - { - Name: []string{"Ford", "Prefect"}, - Weight: 7, - }, - { - Name: []string{"Arthur", "Dent"}, - Weight: 6.75, - }, - }, - }, - ExpectXML: `` + - `` + strconv.Itoa(int(ImprobabilityDrive)) + `` + - `1` + - `` + - `Zaphod` + - `Beeblebrox` + - `7.25` + - `` + - `` + - `Trisha` + - `McMillen` + - `5.5` + - `` + - `` + - `Ford` + - `Prefect` + - `7` + - `` + - `` + - `Arthur` + - `Dent` + - `6.75` + - `` + - ``, - }, - - // Test a>b - { - Value: &NestedItems{Items: nil, Item1: nil}, - ExpectXML: `` + - `` + - `` + - ``, - }, - { - Value: &NestedItems{Items: []string{}, Item1: []string{}}, - ExpectXML: `` + - `` + - `` + - ``, - MarshalOnly: true, - }, - { - Value: &NestedItems{Items: nil, Item1: []string{"A"}}, - ExpectXML: `` + - `` + - `A` + - `` + - ``, - }, - { - Value: &NestedItems{Items: []string{"A", "B"}, Item1: nil}, - ExpectXML: `` + - `` + - `A` + - `B` + - `` + - ``, - }, - { - Value: &NestedItems{Items: []string{"A", "B"}, Item1: []string{"C"}}, - ExpectXML: `` + - `` + - `A` + - `B` + - `C` + - `` + - ``, - }, - { - Value: &NestedOrder{Field1: "C", Field2: "B", Field3: "A"}, - ExpectXML: `` + - `` + - `C` + - `B` + - `A` + - `` + - ``, - }, - { - Value: &NilTest{A: "A", B: nil, C: "C"}, - ExpectXML: `` + - `` + - `A` + - `C` + - `` + - ``, - MarshalOnly: true, // Uses interface{} - }, - { - Value: &MixedNested{A: "A", B: "B", C: "C", D: "D"}, - ExpectXML: `` + - `A` + - `B` + - `` + - `C` + - `D` + - `` + - ``, - }, - { - Value: &Service{Port: &Port{Number: "80"}}, - ExpectXML: `80`, - }, - { - Value: &Service{}, - ExpectXML: ``, - }, - { - Value: &Service{Port: &Port{Number: "80"}, Extra1: "A", Extra2: "B"}, - ExpectXML: `` + - `80` + - `A` + - `B` + - ``, - MarshalOnly: true, - }, - { - Value: &Service{Port: &Port{Number: "80"}, Extra2: "example"}, - ExpectXML: `` + - `80` + - `example` + - ``, - MarshalOnly: true, - }, - - // Test struct embedding - { - Value: &EmbedA{ - EmbedC: EmbedC{ - FieldA1: "", // Shadowed by A.A - FieldA2: "", // Shadowed by A.A - FieldB: "A.C.B", - FieldC: "A.C.C", - }, - EmbedB: EmbedB{ - FieldB: "A.B.B", - EmbedC: &EmbedC{ - FieldA1: "A.B.C.A1", - FieldA2: "A.B.C.A2", - FieldB: "", // Shadowed by A.B.B - FieldC: "A.B.C.C", - }, - }, - FieldA: "A.A", - }, - ExpectXML: `` + - `A.C.B` + - `A.C.C` + - `` + - `A.B.B` + - `` + - `A.B.C.A1` + - `A.B.C.A2` + - `` + - `A.B.C.C` + - `` + - `A.A` + - ``, - }, - - // Test that name casing matters - { - Value: &NameCasing{Xy: "mixed", XY: "upper", XyA: "mixedA", XYA: "upperA"}, - ExpectXML: `mixedupper`, - }, - - // Test the order in which the XML element name is chosen - { - Value: &NamePrecedence{ - FromTag: XMLNameWithoutTag{Value: "A"}, - FromNameVal: XMLNameWithoutTag{XMLName: Name{Local: "InXMLName"}, Value: "B"}, - FromNameTag: XMLNameWithTag{Value: "C"}, - InFieldName: "D", - }, - ExpectXML: `` + - `A` + - `B` + - `C` + - `D` + - ``, - MarshalOnly: true, - }, - { - Value: &NamePrecedence{ - XMLName: Name{Local: "Parent"}, - FromTag: XMLNameWithoutTag{XMLName: Name{Local: "InTag"}, Value: "A"}, - FromNameVal: XMLNameWithoutTag{XMLName: Name{Local: "FromNameVal"}, Value: "B"}, - FromNameTag: XMLNameWithTag{XMLName: Name{Local: "InXMLNameTag"}, Value: "C"}, - InFieldName: "D", - }, - ExpectXML: `` + - `A` + - `B` + - `C` + - `D` + - ``, - UnmarshalOnly: true, - }, - - // xml.Name works in a plain field as well. - { - Value: &NameInField{Name{Space: "ns", Local: "foo"}}, - ExpectXML: ``, - }, - { - Value: &NameInField{Name{Space: "ns", Local: "foo"}}, - ExpectXML: ``, - UnmarshalOnly: true, - }, - - // Marshaling zero xml.Name uses the tag or field name. - { - Value: &NameInField{}, - ExpectXML: ``, - MarshalOnly: true, - }, - - // Test attributes - { - Value: &AttrTest{ - Int: 8, - Named: 9, - Float: 23.5, - Uint8: 255, - Bool: true, - Str: "str", - Bytes: []byte("byt"), - }, - ExpectXML: ``, - }, - { - Value: &AttrTest{Bytes: []byte{}}, - ExpectXML: ``, - }, - { - Value: &OmitAttrTest{ - Int: 8, - Named: 9, - Float: 23.5, - Uint8: 255, - Bool: true, - Str: "str", - Bytes: []byte("byt"), - }, - ExpectXML: ``, - }, - { - Value: &OmitAttrTest{}, - ExpectXML: ``, - }, - - // pointer fields - { - Value: &PointerFieldsTest{Name: &nameAttr, Age: &ageAttr, Contents: &contentsAttr}, - ExpectXML: `lorem ipsum`, - MarshalOnly: true, - }, - - // empty chardata pointer field - { - Value: &ChardataEmptyTest{}, - ExpectXML: ``, - MarshalOnly: true, - }, - - // omitempty on fields - { - Value: &OmitFieldTest{ - Int: 8, - Named: 9, - Float: 23.5, - Uint8: 255, - Bool: true, - Str: "str", - Bytes: []byte("byt"), - Ptr: &PresenceTest{}, - }, - ExpectXML: `` + - `8` + - `9` + - `23.5` + - `255` + - `true` + - `str` + - `byt` + - `` + - ``, - }, - { - Value: &OmitFieldTest{}, - ExpectXML: ``, - }, - - // Test ",any" - { - ExpectXML: `knownunknown`, - Value: &AnyTest{ - Nested: "known", - AnyField: AnyHolder{ - XMLName: Name{Local: "other"}, - XML: "unknown", - }, - }, - }, - { - Value: &AnyTest{Nested: "known", - AnyField: AnyHolder{ - XML: "", - XMLName: Name{Local: "AnyField"}, - }, - }, - ExpectXML: `known`, - }, - { - ExpectXML: `b`, - Value: &AnyOmitTest{ - Nested: "b", - }, - }, - { - ExpectXML: `bei`, - Value: &AnySliceTest{ - Nested: "b", - AnyField: []AnyHolder{ - { - XMLName: Name{Local: "c"}, - XML: "e", - }, - { - XMLName: Name{Space: "f", Local: "g"}, - XML: "i", - }, - }, - }, - }, - { - ExpectXML: `b`, - Value: &AnySliceTest{ - Nested: "b", - }, - }, - - // Test recursive types. - { - Value: &RecurseA{ - A: "a1", - B: &RecurseB{ - A: &RecurseA{"a2", nil}, - B: "b1", - }, - }, - ExpectXML: `a1a2b1`, - }, - - // Test ignoring fields via "-" tag - { - ExpectXML: ``, - Value: &IgnoreTest{}, - }, - { - ExpectXML: ``, - Value: &IgnoreTest{PublicSecret: "can't tell"}, - MarshalOnly: true, - }, - { - ExpectXML: `ignore me`, - Value: &IgnoreTest{}, - UnmarshalOnly: true, - }, - - // Test escaping. - { - ExpectXML: `dquote: "; squote: '; ampersand: &; less: <; greater: >;`, - Value: &AnyTest{ - Nested: `dquote: "; squote: '; ampersand: &; less: <; greater: >;`, - AnyField: AnyHolder{XMLName: Name{Local: "empty"}}, - }, - }, - { - ExpectXML: `newline: ; cr: ; tab: ;`, - Value: &AnyTest{ - Nested: "newline: \n; cr: \r; tab: \t;", - AnyField: AnyHolder{XMLName: Name{Local: "AnyField"}}, - }, - }, - { - ExpectXML: "1\r2\r\n3\n\r4\n5", - Value: &AnyTest{ - Nested: "1\n2\n3\n\n4\n5", - }, - UnmarshalOnly: true, - }, - { - ExpectXML: `42`, - Value: &EmbedInt{ - MyInt: 42, - }, - }, - // Test omitempty with parent chain; see golang.org/issue/4168. - { - ExpectXML: ``, - Value: &Strings{}, - }, - // Custom marshalers. - { - ExpectXML: `hello world`, - Value: &MyMarshalerTest{}, - }, - { - ExpectXML: ``, - Value: &MarshalerStruct{}, - }, - { - ExpectXML: ``, - Value: &OuterStruct{IntAttr: 10}, - }, - { - ExpectXML: ``, - Value: &OuterNamedStruct{XMLName: Name{Space: "outerns", Local: "test"}, IntAttr: 10}, - }, - { - ExpectXML: ``, - Value: &OuterNamedOrderedStruct{XMLName: Name{Space: "outerns", Local: "test"}, IntAttr: 10}, - }, - { - ExpectXML: ``, - Value: &OuterOuterStruct{OuterStruct{IntAttr: 10}}, - }, -} - -func TestMarshal(t *testing.T) { - for idx, test := range marshalTests { - if test.UnmarshalOnly { - continue - } - data, err := Marshal(test.Value) - if err != nil { - t.Errorf("#%d: Error: %s", idx, err) - continue - } - if got, want := string(data), test.ExpectXML; got != want { - if strings.Contains(want, "\n") { - t.Errorf("#%d: marshal(%#v):\nHAVE:\n%s\nWANT:\n%s", idx, test.Value, got, want) - } else { - t.Errorf("#%d: marshal(%#v):\nhave %#q\nwant %#q", idx, test.Value, got, want) - } - } - } -} - -type AttrParent struct { - X string `xml:"X>Y,attr"` -} - -type BadAttr struct { - Name []string `xml:"name,attr"` -} - -var marshalErrorTests = []struct { - Value interface{} - Err string - Kind reflect.Kind -}{ - { - Value: make(chan bool), - Err: "xml: unsupported type: chan bool", - Kind: reflect.Chan, - }, - { - Value: map[string]string{ - "question": "What do you get when you multiply six by nine?", - "answer": "42", - }, - Err: "xml: unsupported type: map[string]string", - Kind: reflect.Map, - }, - { - Value: map[*Ship]bool{nil: false}, - Err: "xml: unsupported type: map[*xml.Ship]bool", - Kind: reflect.Map, - }, - { - Value: &Domain{Comment: []byte("f--bar")}, - Err: `xml: comments must not contain "--"`, - }, - // Reject parent chain with attr, never worked; see golang.org/issue/5033. - { - Value: &AttrParent{}, - Err: `xml: X>Y chain not valid with attr flag`, - }, - { - Value: BadAttr{[]string{"X", "Y"}}, - Err: `xml: unsupported type: []string`, - }, -} - -var marshalIndentTests = []struct { - Value interface{} - Prefix string - Indent string - ExpectXML string -}{ - { - Value: &SecretAgent{ - Handle: "007", - Identity: "James Bond", - Obfuscate: "", - }, - Prefix: "", - Indent: "\t", - ExpectXML: fmt.Sprintf("\n\tJames Bond\n"), - }, -} - -func TestMarshalErrors(t *testing.T) { - for idx, test := range marshalErrorTests { - data, err := Marshal(test.Value) - if err == nil { - t.Errorf("#%d: marshal(%#v) = [success] %q, want error %v", idx, test.Value, data, test.Err) - continue - } - if err.Error() != test.Err { - t.Errorf("#%d: marshal(%#v) = [error] %v, want %v", idx, test.Value, err, test.Err) - } - if test.Kind != reflect.Invalid { - if kind := err.(*UnsupportedTypeError).Type.Kind(); kind != test.Kind { - t.Errorf("#%d: marshal(%#v) = [error kind] %s, want %s", idx, test.Value, kind, test.Kind) - } - } - } -} - -// Do invertibility testing on the various structures that we test -func TestUnmarshal(t *testing.T) { - for i, test := range marshalTests { - if test.MarshalOnly { - continue - } - if _, ok := test.Value.(*Plain); ok { - continue - } - - vt := reflect.TypeOf(test.Value) - dest := reflect.New(vt.Elem()).Interface() - err := Unmarshal([]byte(test.ExpectXML), dest) - - switch fix := dest.(type) { - case *Feed: - fix.Author.InnerXML = "" - for i := range fix.Entry { - fix.Entry[i].Author.InnerXML = "" - } - } - - if err != nil { - t.Errorf("#%d: unexpected error: %#v", i, err) - } else if got, want := dest, test.Value; !reflect.DeepEqual(got, want) { - t.Errorf("#%d: unmarshal(%q):\nhave %#v\nwant %#v", i, test.ExpectXML, got, want) - } - } -} - -func TestMarshalIndent(t *testing.T) { - for i, test := range marshalIndentTests { - data, err := MarshalIndent(test.Value, test.Prefix, test.Indent) - if err != nil { - t.Errorf("#%d: Error: %s", i, err) - continue - } - if got, want := string(data), test.ExpectXML; got != want { - t.Errorf("#%d: MarshalIndent:\nGot:%s\nWant:\n%s", i, got, want) - } - } -} - -type limitedBytesWriter struct { - w io.Writer - remain int // until writes fail -} - -func (lw *limitedBytesWriter) Write(p []byte) (n int, err error) { - if lw.remain <= 0 { - println("error") - return 0, errors.New("write limit hit") - } - if len(p) > lw.remain { - p = p[:lw.remain] - n, _ = lw.w.Write(p) - lw.remain = 0 - return n, errors.New("write limit hit") - } - n, err = lw.w.Write(p) - lw.remain -= n - return n, err -} - -func TestMarshalWriteErrors(t *testing.T) { - var buf bytes.Buffer - const writeCap = 1024 - w := &limitedBytesWriter{&buf, writeCap} - enc := NewEncoder(w) - var err error - var i int - const n = 4000 - for i = 1; i <= n; i++ { - err = enc.Encode(&Passenger{ - Name: []string{"Alice", "Bob"}, - Weight: 5, - }) - if err != nil { - break - } - } - if err == nil { - t.Error("expected an error") - } - if i == n { - t.Errorf("expected to fail before the end") - } - if buf.Len() != writeCap { - t.Errorf("buf.Len() = %d; want %d", buf.Len(), writeCap) - } -} - -func TestMarshalWriteIOErrors(t *testing.T) { - enc := NewEncoder(errWriter{}) - - expectErr := "unwritable" - err := enc.Encode(&Passenger{}) - if err == nil || err.Error() != expectErr { - t.Errorf("EscapeTest = [error] %v, want %v", err, expectErr) - } -} - -func TestMarshalFlush(t *testing.T) { - var buf bytes.Buffer - enc := NewEncoder(&buf) - if err := enc.EncodeToken(CharData("hello world")); err != nil { - t.Fatalf("enc.EncodeToken: %v", err) - } - if buf.Len() > 0 { - t.Fatalf("enc.EncodeToken caused actual write: %q", buf.Bytes()) - } - if err := enc.Flush(); err != nil { - t.Fatalf("enc.Flush: %v", err) - } - if buf.String() != "hello world" { - t.Fatalf("after enc.Flush, buf.String() = %q, want %q", buf.String(), "hello world") - } -} - -func BenchmarkMarshal(b *testing.B) { - for i := 0; i < b.N; i++ { - Marshal(atomValue) - } -} - -func BenchmarkUnmarshal(b *testing.B) { - xml := []byte(atomXml) - for i := 0; i < b.N; i++ { - Unmarshal(xml, &Feed{}) - } -} - -// golang.org/issue/6556 -func TestStructPointerMarshal(t *testing.T) { - type A struct { - XMLName string `xml:"a"` - B []interface{} - } - type C struct { - XMLName Name - Value string `xml:"value"` - } - - a := new(A) - a.B = append(a.B, &C{ - XMLName: Name{Local: "c"}, - Value: "x", - }) - - b, err := Marshal(a) - if err != nil { - t.Fatal(err) - } - if x := string(b); x != "x" { - t.Fatal(x) - } - var v A - err = Unmarshal(b, &v) - if err != nil { - t.Fatal(err) - } -} - -var encodeTokenTests = []struct { - tok Token - want string - ok bool -}{ - {StartElement{Name{"space", "local"}, nil}, "", true}, - {StartElement{Name{"space", ""}, nil}, "", false}, - {EndElement{Name{"space", ""}}, "", false}, - {CharData("foo"), "foo", true}, - {Comment("foo"), "", true}, - {Comment("foo-->"), "", false}, - {ProcInst{"Target", []byte("Instruction")}, "", true}, - {ProcInst{"", []byte("Instruction")}, "", false}, - {ProcInst{"Target", []byte("Instruction?>")}, "", false}, - {Directive("foo"), "", true}, - {Directive("foo>"), "", false}, -} - -func TestEncodeToken(t *testing.T) { - for _, tt := range encodeTokenTests { - var buf bytes.Buffer - enc := NewEncoder(&buf) - err := enc.EncodeToken(tt.tok) - switch { - case !tt.ok && err == nil: - t.Errorf("enc.EncodeToken(%#v): expected error; got none", tt.tok) - case tt.ok && err != nil: - t.Fatalf("enc.EncodeToken: %v", err) - case !tt.ok && err != nil: - // expected error, got one - } - if err := enc.Flush(); err != nil { - t.Fatalf("enc.EncodeToken: %v", err) - } - if got := buf.String(); got != tt.want { - t.Errorf("enc.EncodeToken = %s; want: %s", got, tt.want) - } - } -} - -func TestProcInstEncodeToken(t *testing.T) { - var buf bytes.Buffer - enc := NewEncoder(&buf) - - if err := enc.EncodeToken(ProcInst{"xml", []byte("Instruction")}); err != nil { - t.Fatalf("enc.EncodeToken: expected to be able to encode xml target ProcInst as first token, %s", err) - } - - if err := enc.EncodeToken(ProcInst{"Target", []byte("Instruction")}); err != nil { - t.Fatalf("enc.EncodeToken: expected to be able to add non-xml target ProcInst") - } - - if err := enc.EncodeToken(ProcInst{"xml", []byte("Instruction")}); err == nil { - t.Fatalf("enc.EncodeToken: expected to not be allowed to encode xml target ProcInst when not first token") - } -} - -func TestDecodeEncode(t *testing.T) { - var in, out bytes.Buffer - in.WriteString(` - - - -`) - dec := NewDecoder(&in) - enc := NewEncoder(&out) - for tok, err := dec.Token(); err == nil; tok, err = dec.Token() { - err = enc.EncodeToken(tok) - if err != nil { - t.Fatalf("enc.EncodeToken: Unable to encode token (%#v), %v", tok, err) - } - } -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/vim25/xml/read.go juju-core-2.0.2/src/github.com/juju/govmomi/vim25/xml/read.go --- juju-core-2.0.0/src/github.com/juju/govmomi/vim25/xml/read.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/vim25/xml/read.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,769 +0,0 @@ -// Copyright 2009 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package xml - -import ( - "bytes" - "encoding" - "errors" - "fmt" - "reflect" - "strconv" - "strings" -) - -// BUG(rsc): Mapping between XML elements and data structures is inherently flawed: -// an XML element is an order-dependent collection of anonymous -// values, while a data structure is an order-independent collection -// of named values. -// See package json for a textual representation more suitable -// to data structures. - -// Unmarshal parses the XML-encoded data and stores the result in -// the value pointed to by v, which must be an arbitrary struct, -// slice, or string. Well-formed data that does not fit into v is -// discarded. -// -// Because Unmarshal uses the reflect package, it can only assign -// to exported (upper case) fields. Unmarshal uses a case-sensitive -// comparison to match XML element names to tag values and struct -// field names. -// -// Unmarshal maps an XML element to a struct using the following rules. -// In the rules, the tag of a field refers to the value associated with the -// key 'xml' in the struct field's tag (see the example above). -// -// * If the struct has a field of type []byte or string with tag -// ",innerxml", Unmarshal accumulates the raw XML nested inside the -// element in that field. The rest of the rules still apply. -// -// * If the struct has a field named XMLName of type xml.Name, -// Unmarshal records the element name in that field. -// -// * If the XMLName field has an associated tag of the form -// "name" or "namespace-URL name", the XML element must have -// the given name (and, optionally, name space) or else Unmarshal -// returns an error. -// -// * If the XML element has an attribute whose name matches a -// struct field name with an associated tag containing ",attr" or -// the explicit name in a struct field tag of the form "name,attr", -// Unmarshal records the attribute value in that field. -// -// * If the XML element contains character data, that data is -// accumulated in the first struct field that has tag ",chardata". -// The struct field may have type []byte or string. -// If there is no such field, the character data is discarded. -// -// * If the XML element contains comments, they are accumulated in -// the first struct field that has tag ",comment". The struct -// field may have type []byte or string. If there is no such -// field, the comments are discarded. -// -// * If the XML element contains a sub-element whose name matches -// the prefix of a tag formatted as "a" or "a>b>c", unmarshal -// will descend into the XML structure looking for elements with the -// given names, and will map the innermost elements to that struct -// field. A tag starting with ">" is equivalent to one starting -// with the field name followed by ">". -// -// * If the XML element contains a sub-element whose name matches -// a struct field's XMLName tag and the struct field has no -// explicit name tag as per the previous rule, unmarshal maps -// the sub-element to that struct field. -// -// * If the XML element contains a sub-element whose name matches a -// field without any mode flags (",attr", ",chardata", etc), Unmarshal -// maps the sub-element to that struct field. -// -// * If the XML element contains a sub-element that hasn't matched any -// of the above rules and the struct has a field with tag ",any", -// unmarshal maps the sub-element to that struct field. -// -// * An anonymous struct field is handled as if the fields of its -// value were part of the outer struct. -// -// * A struct field with tag "-" is never unmarshalled into. -// -// Unmarshal maps an XML element to a string or []byte by saving the -// concatenation of that element's character data in the string or -// []byte. The saved []byte is never nil. -// -// Unmarshal maps an attribute value to a string or []byte by saving -// the value in the string or slice. -// -// Unmarshal maps an XML element to a slice by extending the length of -// the slice and mapping the element to the newly created value. -// -// Unmarshal maps an XML element or attribute value to a bool by -// setting it to the boolean value represented by the string. -// -// Unmarshal maps an XML element or attribute value to an integer or -// floating-point field by setting the field to the result of -// interpreting the string value in decimal. There is no check for -// overflow. -// -// Unmarshal maps an XML element to an xml.Name by recording the -// element name. -// -// Unmarshal maps an XML element to a pointer by setting the pointer -// to a freshly allocated value and then mapping the element to that value. -// -func Unmarshal(data []byte, v interface{}) error { - return NewDecoder(bytes.NewReader(data)).Decode(v) -} - -// Decode works like xml.Unmarshal, except it reads the decoder -// stream to find the start element. -func (d *Decoder) Decode(v interface{}) error { - return d.DecodeElement(v, nil) -} - -// DecodeElement works like xml.Unmarshal except that it takes -// a pointer to the start XML element to decode into v. -// It is useful when a client reads some raw XML tokens itself -// but also wants to defer to Unmarshal for some elements. -func (d *Decoder) DecodeElement(v interface{}, start *StartElement) error { - val := reflect.ValueOf(v) - if val.Kind() != reflect.Ptr { - return errors.New("non-pointer passed to Unmarshal") - } - return d.unmarshal(val.Elem(), start) -} - -// An UnmarshalError represents an error in the unmarshalling process. -type UnmarshalError string - -func (e UnmarshalError) Error() string { return string(e) } - -// Unmarshaler is the interface implemented by objects that can unmarshal -// an XML element description of themselves. -// -// UnmarshalXML decodes a single XML element -// beginning with the given start element. -// If it returns an error, the outer call to Unmarshal stops and -// returns that error. -// UnmarshalXML must consume exactly one XML element. -// One common implementation strategy is to unmarshal into -// a separate value with a layout matching the expected XML -// using d.DecodeElement, and then to copy the data from -// that value into the receiver. -// Another common strategy is to use d.Token to process the -// XML object one token at a time. -// UnmarshalXML may not use d.RawToken. -type Unmarshaler interface { - UnmarshalXML(d *Decoder, start StartElement) error -} - -// UnmarshalerAttr is the interface implemented by objects that can unmarshal -// an XML attribute description of themselves. -// -// UnmarshalXMLAttr decodes a single XML attribute. -// If it returns an error, the outer call to Unmarshal stops and -// returns that error. -// UnmarshalXMLAttr is used only for struct fields with the -// "attr" option in the field tag. -type UnmarshalerAttr interface { - UnmarshalXMLAttr(attr Attr) error -} - -// receiverType returns the receiver type to use in an expression like "%s.MethodName". -func receiverType(val interface{}) string { - t := reflect.TypeOf(val) - if t.Name() != "" { - return t.String() - } - return "(" + t.String() + ")" -} - -// unmarshalInterface unmarshals a single XML element into val. -// start is the opening tag of the element. -func (p *Decoder) unmarshalInterface(val Unmarshaler, start *StartElement) error { - // Record that decoder must stop at end tag corresponding to start. - p.pushEOF() - - p.unmarshalDepth++ - err := val.UnmarshalXML(p, *start) - p.unmarshalDepth-- - if err != nil { - p.popEOF() - return err - } - - if !p.popEOF() { - return fmt.Errorf("xml: %s.UnmarshalXML did not consume entire <%s> element", receiverType(val), start.Name.Local) - } - - return nil -} - -// unmarshalTextInterface unmarshals a single XML element into val. -// The chardata contained in the element (but not its children) -// is passed to the text unmarshaler. -func (p *Decoder) unmarshalTextInterface(val encoding.TextUnmarshaler, start *StartElement) error { - var buf []byte - depth := 1 - for depth > 0 { - t, err := p.Token() - if err != nil { - return err - } - switch t := t.(type) { - case CharData: - if depth == 1 { - buf = append(buf, t...) - } - case StartElement: - depth++ - case EndElement: - depth-- - } - } - return val.UnmarshalText(buf) -} - -// unmarshalAttr unmarshals a single XML attribute into val. -func (p *Decoder) unmarshalAttr(val reflect.Value, attr Attr) error { - if val.Kind() == reflect.Ptr { - if val.IsNil() { - val.Set(reflect.New(val.Type().Elem())) - } - val = val.Elem() - } - - if val.CanInterface() && val.Type().Implements(unmarshalerAttrType) { - // This is an unmarshaler with a non-pointer receiver, - // so it's likely to be incorrect, but we do what we're told. - return val.Interface().(UnmarshalerAttr).UnmarshalXMLAttr(attr) - } - if val.CanAddr() { - pv := val.Addr() - if pv.CanInterface() && pv.Type().Implements(unmarshalerAttrType) { - return pv.Interface().(UnmarshalerAttr).UnmarshalXMLAttr(attr) - } - } - - // Not an UnmarshalerAttr; try encoding.TextUnmarshaler. - if val.CanInterface() && val.Type().Implements(textUnmarshalerType) { - // This is an unmarshaler with a non-pointer receiver, - // so it's likely to be incorrect, but we do what we're told. - return val.Interface().(encoding.TextUnmarshaler).UnmarshalText([]byte(attr.Value)) - } - if val.CanAddr() { - pv := val.Addr() - if pv.CanInterface() && pv.Type().Implements(textUnmarshalerType) { - return pv.Interface().(encoding.TextUnmarshaler).UnmarshalText([]byte(attr.Value)) - } - } - - copyValue(val, []byte(attr.Value)) - return nil -} - -var ( - unmarshalerType = reflect.TypeOf((*Unmarshaler)(nil)).Elem() - unmarshalerAttrType = reflect.TypeOf((*UnmarshalerAttr)(nil)).Elem() - textUnmarshalerType = reflect.TypeOf((*encoding.TextUnmarshaler)(nil)).Elem() -) - -// Find reflect.Type for an element's type attribute. -func (p *Decoder) typeForElement(val reflect.Value, start *StartElement) reflect.Type { - t := "" - for _, a := range start.Attr { - if a.Name == xmlSchemaInstance { - t = a.Value - break - } - } - - if t == "" { - // No type attribute; fall back to looking up type by interface name. - t = val.Type().Name() - } - - // Maybe the type is a basic xsd:* type. - typ := stringToType(t) - if typ != nil { - return typ - } - - // Maybe the type is a custom type. - if p.TypeFunc != nil { - if typ, ok := p.TypeFunc(t); ok { - return typ - } - } - - return nil -} - -// Unmarshal a single XML element into val. -func (p *Decoder) unmarshal(val reflect.Value, start *StartElement) error { - // Find start element if we need it. - if start == nil { - for { - tok, err := p.Token() - if err != nil { - return err - } - if t, ok := tok.(StartElement); ok { - start = &t - break - } - } - } - - // Try to figure out type for empty interface values. - if val.Kind() == reflect.Interface && val.IsNil() { - typ := p.typeForElement(val, start) - if typ != nil { - pval := reflect.New(typ).Elem() - err := p.unmarshal(pval, start) - if err != nil { - return err - } - - for i := 0; i < 2; i++ { - if typ.Implements(val.Type()) { - val.Set(pval) - return nil - } - - typ = reflect.PtrTo(typ) - pval = pval.Addr() - } - - val.Set(pval) - return nil - } - } - - // Load value from interface, but only if the result will be - // usefully addressable. - if val.Kind() == reflect.Interface && !val.IsNil() { - e := val.Elem() - if e.Kind() == reflect.Ptr && !e.IsNil() { - val = e - } - } - - if val.Kind() == reflect.Ptr { - if val.IsNil() { - val.Set(reflect.New(val.Type().Elem())) - } - val = val.Elem() - } - - if val.CanInterface() && val.Type().Implements(unmarshalerType) { - // This is an unmarshaler with a non-pointer receiver, - // so it's likely to be incorrect, but we do what we're told. - return p.unmarshalInterface(val.Interface().(Unmarshaler), start) - } - - if val.CanAddr() { - pv := val.Addr() - if pv.CanInterface() && pv.Type().Implements(unmarshalerType) { - return p.unmarshalInterface(pv.Interface().(Unmarshaler), start) - } - } - - if val.CanInterface() && val.Type().Implements(textUnmarshalerType) { - return p.unmarshalTextInterface(val.Interface().(encoding.TextUnmarshaler), start) - } - - if val.CanAddr() { - pv := val.Addr() - if pv.CanInterface() && pv.Type().Implements(textUnmarshalerType) { - return p.unmarshalTextInterface(pv.Interface().(encoding.TextUnmarshaler), start) - } - } - - var ( - data []byte - saveData reflect.Value - comment []byte - saveComment reflect.Value - saveXML reflect.Value - saveXMLIndex int - saveXMLData []byte - saveAny reflect.Value - sv reflect.Value - tinfo *typeInfo - err error - ) - - switch v := val; v.Kind() { - default: - return errors.New("unknown type " + v.Type().String()) - - case reflect.Interface: - // TODO: For now, simply ignore the field. In the near - // future we may choose to unmarshal the start - // element on it, if not nil. - return p.Skip() - - case reflect.Slice: - typ := v.Type() - if typ.Elem().Kind() == reflect.Uint8 { - // []byte - saveData = v - break - } - - // Slice of element values. - // Grow slice. - n := v.Len() - if n >= v.Cap() { - ncap := 2 * n - if ncap < 4 { - ncap = 4 - } - new := reflect.MakeSlice(typ, n, ncap) - reflect.Copy(new, v) - v.Set(new) - } - v.SetLen(n + 1) - - // Recur to read element into slice. - if err := p.unmarshal(v.Index(n), start); err != nil { - v.SetLen(n) - return err - } - return nil - - case reflect.Bool, reflect.Float32, reflect.Float64, reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr, reflect.String: - saveData = v - - case reflect.Struct: - typ := v.Type() - if typ == nameType { - v.Set(reflect.ValueOf(start.Name)) - break - } - - sv = v - tinfo, err = getTypeInfo(typ) - if err != nil { - return err - } - - // Validate and assign element name. - if tinfo.xmlname != nil { - finfo := tinfo.xmlname - if finfo.name != "" && finfo.name != start.Name.Local { - return UnmarshalError("expected element type <" + finfo.name + "> but have <" + start.Name.Local + ">") - } - if finfo.xmlns != "" && finfo.xmlns != start.Name.Space { - e := "expected element <" + finfo.name + "> in name space " + finfo.xmlns + " but have " - if start.Name.Space == "" { - e += "no name space" - } else { - e += start.Name.Space - } - return UnmarshalError(e) - } - fv := finfo.value(sv) - if _, ok := fv.Interface().(Name); ok { - fv.Set(reflect.ValueOf(start.Name)) - } - } - - // Assign attributes. - // Also, determine whether we need to save character data or comments. - for i := range tinfo.fields { - finfo := &tinfo.fields[i] - switch finfo.flags & fMode { - case fAttr: - strv := finfo.value(sv) - // Look for attribute. - for _, a := range start.Attr { - if a.Name.Local == finfo.name && (finfo.xmlns == "" || finfo.xmlns == a.Name.Space) { - if err := p.unmarshalAttr(strv, a); err != nil { - return err - } - break - } - } - - case fCharData: - if !saveData.IsValid() { - saveData = finfo.value(sv) - } - - case fComment: - if !saveComment.IsValid() { - saveComment = finfo.value(sv) - } - - case fAny, fAny | fElement: - if !saveAny.IsValid() { - saveAny = finfo.value(sv) - } - - case fInnerXml: - if !saveXML.IsValid() { - saveXML = finfo.value(sv) - if p.saved == nil { - saveXMLIndex = 0 - p.saved = new(bytes.Buffer) - } else { - saveXMLIndex = p.savedOffset() - } - } - } - } - } - - // Find end element. - // Process sub-elements along the way. -Loop: - for { - var savedOffset int - if saveXML.IsValid() { - savedOffset = p.savedOffset() - } - tok, err := p.Token() - if err != nil { - return err - } - switch t := tok.(type) { - case StartElement: - consumed := false - if sv.IsValid() { - consumed, err = p.unmarshalPath(tinfo, sv, nil, &t) - if err != nil { - return err - } - if !consumed && saveAny.IsValid() { - consumed = true - if err := p.unmarshal(saveAny, &t); err != nil { - return err - } - } - } - if !consumed { - if err := p.Skip(); err != nil { - return err - } - } - - case EndElement: - if saveXML.IsValid() { - saveXMLData = p.saved.Bytes()[saveXMLIndex:savedOffset] - if saveXMLIndex == 0 { - p.saved = nil - } - } - break Loop - - case CharData: - if saveData.IsValid() { - data = append(data, t...) - } - - case Comment: - if saveComment.IsValid() { - comment = append(comment, t...) - } - } - } - - if saveData.IsValid() && saveData.CanInterface() && saveData.Type().Implements(textUnmarshalerType) { - if err := saveData.Interface().(encoding.TextUnmarshaler).UnmarshalText(data); err != nil { - return err - } - saveData = reflect.Value{} - } - - if saveData.IsValid() && saveData.CanAddr() { - pv := saveData.Addr() - if pv.CanInterface() && pv.Type().Implements(textUnmarshalerType) { - if err := pv.Interface().(encoding.TextUnmarshaler).UnmarshalText(data); err != nil { - return err - } - saveData = reflect.Value{} - } - } - - if err := copyValue(saveData, data); err != nil { - return err - } - - switch t := saveComment; t.Kind() { - case reflect.String: - t.SetString(string(comment)) - case reflect.Slice: - t.Set(reflect.ValueOf(comment)) - } - - switch t := saveXML; t.Kind() { - case reflect.String: - t.SetString(string(saveXMLData)) - case reflect.Slice: - t.Set(reflect.ValueOf(saveXMLData)) - } - - return nil -} - -func copyValue(dst reflect.Value, src []byte) (err error) { - dst0 := dst - - if dst.Kind() == reflect.Ptr { - if dst.IsNil() { - dst.Set(reflect.New(dst.Type().Elem())) - } - dst = dst.Elem() - } - - // Save accumulated data. - switch dst.Kind() { - case reflect.Invalid: - // Probably a comment. - default: - return errors.New("cannot unmarshal into " + dst0.Type().String()) - case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: - itmp, err := strconv.ParseInt(string(src), 10, dst.Type().Bits()) - if err != nil { - return err - } - dst.SetInt(itmp) - case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: - var utmp uint64 - if len(src) > 0 && src[0] == '-' { - // Negative value for unsigned field. - // Assume it was serialized following two's complement. - itmp, err := strconv.ParseInt(string(src), 10, dst.Type().Bits()) - if err != nil { - return err - } - // Reinterpret value based on type width. - switch dst.Type().Bits() { - case 8: - utmp = uint64(uint8(itmp)) - case 16: - utmp = uint64(uint16(itmp)) - case 32: - utmp = uint64(uint32(itmp)) - case 64: - utmp = uint64(uint64(itmp)) - } - } else { - utmp, err = strconv.ParseUint(string(src), 10, dst.Type().Bits()) - if err != nil { - return err - } - } - dst.SetUint(utmp) - case reflect.Float32, reflect.Float64: - ftmp, err := strconv.ParseFloat(string(src), dst.Type().Bits()) - if err != nil { - return err - } - dst.SetFloat(ftmp) - case reflect.Bool: - value, err := strconv.ParseBool(strings.TrimSpace(string(src))) - if err != nil { - return err - } - dst.SetBool(value) - case reflect.String: - dst.SetString(string(src)) - case reflect.Slice: - if len(src) == 0 { - // non-nil to flag presence - src = []byte{} - } - dst.SetBytes(src) - } - return nil -} - -// unmarshalPath walks down an XML structure looking for wanted -// paths, and calls unmarshal on them. -// The consumed result tells whether XML elements have been consumed -// from the Decoder until start's matching end element, or if it's -// still untouched because start is uninteresting for sv's fields. -func (p *Decoder) unmarshalPath(tinfo *typeInfo, sv reflect.Value, parents []string, start *StartElement) (consumed bool, err error) { - recurse := false -Loop: - for i := range tinfo.fields { - finfo := &tinfo.fields[i] - if finfo.flags&fElement == 0 || len(finfo.parents) < len(parents) || finfo.xmlns != "" && finfo.xmlns != start.Name.Space { - continue - } - for j := range parents { - if parents[j] != finfo.parents[j] { - continue Loop - } - } - if len(finfo.parents) == len(parents) && finfo.name == start.Name.Local { - // It's a perfect match, unmarshal the field. - return true, p.unmarshal(finfo.value(sv), start) - } - if len(finfo.parents) > len(parents) && finfo.parents[len(parents)] == start.Name.Local { - // It's a prefix for the field. Break and recurse - // since it's not ok for one field path to be itself - // the prefix for another field path. - recurse = true - - // We can reuse the same slice as long as we - // don't try to append to it. - parents = finfo.parents[:len(parents)+1] - break - } - } - if !recurse { - // We have no business with this element. - return false, nil - } - // The element is not a perfect match for any field, but one - // or more fields have the path to this element as a parent - // prefix. Recurse and attempt to match these. - for { - var tok Token - tok, err = p.Token() - if err != nil { - return true, err - } - switch t := tok.(type) { - case StartElement: - consumed2, err := p.unmarshalPath(tinfo, sv, parents, &t) - if err != nil { - return true, err - } - if !consumed2 { - if err := p.Skip(); err != nil { - return true, err - } - } - case EndElement: - return true, nil - } - } -} - -// Skip reads tokens until it has consumed the end element -// matching the most recent start element already consumed. -// It recurs if it encounters a start element, so it can be used to -// skip nested structures. -// It returns nil if it finds an end element matching the start -// element; otherwise it returns an error describing the problem. -func (d *Decoder) Skip() error { - for { - tok, err := d.Token() - if err != nil { - return err - } - switch tok.(type) { - case StartElement: - if err := d.Skip(); err != nil { - return err - } - case EndElement: - return nil - } - } -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/vim25/xml/read_test.go juju-core-2.0.2/src/github.com/juju/govmomi/vim25/xml/read_test.go --- juju-core-2.0.0/src/github.com/juju/govmomi/vim25/xml/read_test.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/vim25/xml/read_test.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,762 +0,0 @@ -// Copyright 2009 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package xml - -import ( - "io" - "reflect" - "strings" - "testing" - "time" -) - -// Stripped down Atom feed data structures. - -func TestUnmarshalFeed(t *testing.T) { - var f Feed - if err := Unmarshal([]byte(atomFeedString), &f); err != nil { - t.Fatalf("Unmarshal: %s", err) - } - if !reflect.DeepEqual(f, atomFeed) { - t.Fatalf("have %#v\nwant %#v", f, atomFeed) - } -} - -// hget http://codereview.appspot.com/rss/mine/rsc -const atomFeedString = ` - -Code Review - My issueshttp://codereview.appspot.com/rietveld<>rietveld: an attempt at pubsubhubbub -2009-10-04T01:35:58+00:00email-address-removedurn:md5:134d9179c41f806be79b3a5f7877d19a - An attempt at adding pubsubhubbub support to Rietveld. -http://code.google.com/p/pubsubhubbub -http://code.google.com/p/rietveld/issues/detail?id=155 - -The server side of the protocol is trivial: - 1. add a &lt;link rel=&quot;hub&quot; href=&quot;hub-server&quot;&gt; tag to all - feeds that will be pubsubhubbubbed. - 2. every time one of those feeds changes, tell the hub - with a simple POST request. - -I have tested this by adding debug prints to a local hub -server and checking that the server got the right publish -requests. - -I can&#39;t quite get the server to work, but I think the bug -is not in my code. I think that the server expects to be -able to grab the feed and see the feed&#39;s actual URL in -the link rel=&quot;self&quot;, but the default value for that drops -the :port from the URL, and I cannot for the life of me -figure out how to get the Atom generator deep inside -django not to do that, or even where it is doing that, -or even what code is running to generate the Atom feed. -(I thought I knew but I added some assert False statements -and it kept running!) - -Ignoring that particular problem, I would appreciate -feedback on the right way to get the two values at -the top of feeds.py marked NOTE(rsc). - - -rietveld: correct tab handling -2009-10-03T23:02:17+00:00email-address-removedurn:md5:0a2a4f19bb815101f0ba2904aed7c35a - This fixes the buggy tab rendering that can be seen at -http://codereview.appspot.com/116075/diff/1/2 - -The fundamental problem was that the tab code was -not being told what column the text began in, so it -didn&#39;t know where to put the tab stops. Another problem -was that some of the code assumed that string byte -offsets were the same as column offsets, which is only -true if there are no tabs. - -In the process of fixing this, I cleaned up the arguments -to Fold and ExpandTabs and renamed them Break and -_ExpandTabs so that I could be sure that I found all the -call sites. I also wanted to verify that ExpandTabs was -not being used from outside intra_region_diff.py. - - - ` - -type Feed struct { - XMLName Name `xml:"http://www.w3.org/2005/Atom feed"` - Title string `xml:"title"` - Id string `xml:"id"` - Link []Link `xml:"link"` - Updated time.Time `xml:"updated,attr"` - Author Person `xml:"author"` - Entry []Entry `xml:"entry"` -} - -type Entry struct { - Title string `xml:"title"` - Id string `xml:"id"` - Link []Link `xml:"link"` - Updated time.Time `xml:"updated"` - Author Person `xml:"author"` - Summary Text `xml:"summary"` -} - -type Link struct { - Rel string `xml:"rel,attr,omitempty"` - Href string `xml:"href,attr"` -} - -type Person struct { - Name string `xml:"name"` - URI string `xml:"uri"` - Email string `xml:"email"` - InnerXML string `xml:",innerxml"` -} - -type Text struct { - Type string `xml:"type,attr,omitempty"` - Body string `xml:",chardata"` -} - -var atomFeed = Feed{ - XMLName: Name{"http://www.w3.org/2005/Atom", "feed"}, - Title: "Code Review - My issues", - Link: []Link{ - {Rel: "alternate", Href: "http://codereview.appspot.com/"}, - {Rel: "self", Href: "http://codereview.appspot.com/rss/mine/rsc"}, - }, - Id: "http://codereview.appspot.com/", - Updated: ParseTime("2009-10-04T01:35:58+00:00"), - Author: Person{ - Name: "rietveld<>", - InnerXML: "rietveld<>", - }, - Entry: []Entry{ - { - Title: "rietveld: an attempt at pubsubhubbub\n", - Link: []Link{ - {Rel: "alternate", Href: "http://codereview.appspot.com/126085"}, - }, - Updated: ParseTime("2009-10-04T01:35:58+00:00"), - Author: Person{ - Name: "email-address-removed", - InnerXML: "email-address-removed", - }, - Id: "urn:md5:134d9179c41f806be79b3a5f7877d19a", - Summary: Text{ - Type: "html", - Body: ` - An attempt at adding pubsubhubbub support to Rietveld. -http://code.google.com/p/pubsubhubbub -http://code.google.com/p/rietveld/issues/detail?id=155 - -The server side of the protocol is trivial: - 1. add a <link rel="hub" href="hub-server"> tag to all - feeds that will be pubsubhubbubbed. - 2. every time one of those feeds changes, tell the hub - with a simple POST request. - -I have tested this by adding debug prints to a local hub -server and checking that the server got the right publish -requests. - -I can't quite get the server to work, but I think the bug -is not in my code. I think that the server expects to be -able to grab the feed and see the feed's actual URL in -the link rel="self", but the default value for that drops -the :port from the URL, and I cannot for the life of me -figure out how to get the Atom generator deep inside -django not to do that, or even where it is doing that, -or even what code is running to generate the Atom feed. -(I thought I knew but I added some assert False statements -and it kept running!) - -Ignoring that particular problem, I would appreciate -feedback on the right way to get the two values at -the top of feeds.py marked NOTE(rsc). - - -`, - }, - }, - { - Title: "rietveld: correct tab handling\n", - Link: []Link{ - {Rel: "alternate", Href: "http://codereview.appspot.com/124106"}, - }, - Updated: ParseTime("2009-10-03T23:02:17+00:00"), - Author: Person{ - Name: "email-address-removed", - InnerXML: "email-address-removed", - }, - Id: "urn:md5:0a2a4f19bb815101f0ba2904aed7c35a", - Summary: Text{ - Type: "html", - Body: ` - This fixes the buggy tab rendering that can be seen at -http://codereview.appspot.com/116075/diff/1/2 - -The fundamental problem was that the tab code was -not being told what column the text began in, so it -didn't know where to put the tab stops. Another problem -was that some of the code assumed that string byte -offsets were the same as column offsets, which is only -true if there are no tabs. - -In the process of fixing this, I cleaned up the arguments -to Fold and ExpandTabs and renamed them Break and -_ExpandTabs so that I could be sure that I found all the -call sites. I also wanted to verify that ExpandTabs was -not being used from outside intra_region_diff.py. - - -`, - }, - }, - }, -} - -const pathTestString = ` - - 1 - - - A - - - B - - - C - D - - <_> - E - - - 2 - -` - -type PathTestItem struct { - Value string -} - -type PathTestA struct { - Items []PathTestItem `xml:">Item1"` - Before, After string -} - -type PathTestB struct { - Other []PathTestItem `xml:"Items>Item1"` - Before, After string -} - -type PathTestC struct { - Values1 []string `xml:"Items>Item1>Value"` - Values2 []string `xml:"Items>Item2>Value"` - Before, After string -} - -type PathTestSet struct { - Item1 []PathTestItem -} - -type PathTestD struct { - Other PathTestSet `xml:"Items"` - Before, After string -} - -type PathTestE struct { - Underline string `xml:"Items>_>Value"` - Before, After string -} - -var pathTests = []interface{}{ - &PathTestA{Items: []PathTestItem{{"A"}, {"D"}}, Before: "1", After: "2"}, - &PathTestB{Other: []PathTestItem{{"A"}, {"D"}}, Before: "1", After: "2"}, - &PathTestC{Values1: []string{"A", "C", "D"}, Values2: []string{"B"}, Before: "1", After: "2"}, - &PathTestD{Other: PathTestSet{Item1: []PathTestItem{{"A"}, {"D"}}}, Before: "1", After: "2"}, - &PathTestE{Underline: "E", Before: "1", After: "2"}, -} - -func TestUnmarshalPaths(t *testing.T) { - for _, pt := range pathTests { - v := reflect.New(reflect.TypeOf(pt).Elem()).Interface() - if err := Unmarshal([]byte(pathTestString), v); err != nil { - t.Fatalf("Unmarshal: %s", err) - } - if !reflect.DeepEqual(v, pt) { - t.Fatalf("have %#v\nwant %#v", v, pt) - } - } -} - -type BadPathTestA struct { - First string `xml:"items>item1"` - Other string `xml:"items>item2"` - Second string `xml:"items"` -} - -type BadPathTestB struct { - Other string `xml:"items>item2>value"` - First string `xml:"items>item1"` - Second string `xml:"items>item1>value"` -} - -type BadPathTestC struct { - First string - Second string `xml:"First"` -} - -type BadPathTestD struct { - BadPathEmbeddedA - BadPathEmbeddedB -} - -type BadPathEmbeddedA struct { - First string -} - -type BadPathEmbeddedB struct { - Second string `xml:"First"` -} - -var badPathTests = []struct { - v, e interface{} -}{ - {&BadPathTestA{}, &TagPathError{reflect.TypeOf(BadPathTestA{}), "First", "items>item1", "Second", "items"}}, - {&BadPathTestB{}, &TagPathError{reflect.TypeOf(BadPathTestB{}), "First", "items>item1", "Second", "items>item1>value"}}, - {&BadPathTestC{}, &TagPathError{reflect.TypeOf(BadPathTestC{}), "First", "", "Second", "First"}}, - {&BadPathTestD{}, &TagPathError{reflect.TypeOf(BadPathTestD{}), "First", "", "Second", "First"}}, -} - -func TestUnmarshalBadPaths(t *testing.T) { - for _, tt := range badPathTests { - err := Unmarshal([]byte(pathTestString), tt.v) - if !reflect.DeepEqual(err, tt.e) { - t.Fatalf("Unmarshal with %#v didn't fail properly:\nhave %#v,\nwant %#v", tt.v, err, tt.e) - } - } -} - -const OK = "OK" -const withoutNameTypeData = ` - -` - -type TestThree struct { - XMLName Name `xml:"Test3"` - Attr string `xml:",attr"` -} - -func TestUnmarshalWithoutNameType(t *testing.T) { - var x TestThree - if err := Unmarshal([]byte(withoutNameTypeData), &x); err != nil { - t.Fatalf("Unmarshal: %s", err) - } - if x.Attr != OK { - t.Fatalf("have %v\nwant %v", x.Attr, OK) - } -} - -func TestUnmarshalAttr(t *testing.T) { - type ParamVal struct { - Int int `xml:"int,attr"` - } - - type ParamPtr struct { - Int *int `xml:"int,attr"` - } - - type ParamStringPtr struct { - Int *string `xml:"int,attr"` - } - - x := []byte(``) - - p1 := &ParamPtr{} - if err := Unmarshal(x, p1); err != nil { - t.Fatalf("Unmarshal: %s", err) - } - if p1.Int == nil { - t.Fatalf("Unmarshal failed in to *int field") - } else if *p1.Int != 1 { - t.Fatalf("Unmarshal with %s failed:\nhave %#v,\n want %#v", x, p1.Int, 1) - } - - p2 := &ParamVal{} - if err := Unmarshal(x, p2); err != nil { - t.Fatalf("Unmarshal: %s", err) - } - if p2.Int != 1 { - t.Fatalf("Unmarshal with %s failed:\nhave %#v,\n want %#v", x, p2.Int, 1) - } - - p3 := &ParamStringPtr{} - if err := Unmarshal(x, p3); err != nil { - t.Fatalf("Unmarshal: %s", err) - } - if p3.Int == nil { - t.Fatalf("Unmarshal failed in to *string field") - } else if *p3.Int != "1" { - t.Fatalf("Unmarshal with %s failed:\nhave %#v,\n want %#v", x, p3.Int, 1) - } -} - -type Tables struct { - HTable string `xml:"http://www.w3.org/TR/html4/ table"` - FTable string `xml:"http://www.w3schools.com/furniture table"` -} - -var tables = []struct { - xml string - tab Tables - ns string -}{ - { - xml: `` + - `hello
` + - `world
` + - `
`, - tab: Tables{"hello", "world"}, - }, - { - xml: `` + - `world
` + - `hello
` + - `
`, - tab: Tables{"hello", "world"}, - }, - { - xml: `` + - `world` + - `hello` + - ``, - tab: Tables{"hello", "world"}, - }, - { - xml: `` + - `bogus
` + - `
`, - tab: Tables{}, - }, - { - xml: `` + - `only
` + - `
`, - tab: Tables{HTable: "only"}, - ns: "http://www.w3.org/TR/html4/", - }, - { - xml: `` + - `only
` + - `
`, - tab: Tables{FTable: "only"}, - ns: "http://www.w3schools.com/furniture", - }, - { - xml: `` + - `only
` + - `
`, - tab: Tables{}, - ns: "something else entirely", - }, -} - -func TestUnmarshalNS(t *testing.T) { - for i, tt := range tables { - var dst Tables - var err error - if tt.ns != "" { - d := NewDecoder(strings.NewReader(tt.xml)) - d.DefaultSpace = tt.ns - err = d.Decode(&dst) - } else { - err = Unmarshal([]byte(tt.xml), &dst) - } - if err != nil { - t.Errorf("#%d: Unmarshal: %v", i, err) - continue - } - want := tt.tab - if dst != want { - t.Errorf("#%d: dst=%+v, want %+v", i, dst, want) - } - } -} - -func TestMarshalNS(t *testing.T) { - dst := Tables{"hello", "world"} - data, err := Marshal(&dst) - if err != nil { - t.Fatalf("Marshal: %v", err) - } - want := `hello
world
` - str := string(data) - if str != want { - t.Errorf("have: %q\nwant: %q\n", str, want) - } -} - -type TableAttrs struct { - TAttr TAttr -} - -type TAttr struct { - HTable string `xml:"http://www.w3.org/TR/html4/ table,attr"` - FTable string `xml:"http://www.w3schools.com/furniture table,attr"` - Lang string `xml:"http://www.w3.org/XML/1998/namespace lang,attr,omitempty"` - Other1 string `xml:"http://golang.org/xml/ other,attr,omitempty"` - Other2 string `xml:"http://golang.org/xmlfoo/ other,attr,omitempty"` - Other3 string `xml:"http://golang.org/json/ other,attr,omitempty"` - Other4 string `xml:"http://golang.org/2/json/ other,attr,omitempty"` -} - -var tableAttrs = []struct { - xml string - tab TableAttrs - ns string -}{ - { - xml: ``, - tab: TableAttrs{TAttr{HTable: "hello", FTable: "world"}}, - }, - { - xml: ``, - tab: TableAttrs{TAttr{HTable: "hello", FTable: "world"}}, - }, - { - xml: ``, - tab: TableAttrs{TAttr{HTable: "hello", FTable: "world"}}, - }, - { - // Default space does not apply to attribute names. - xml: ``, - tab: TableAttrs{TAttr{HTable: "hello", FTable: ""}}, - }, - { - // Default space does not apply to attribute names. - xml: ``, - tab: TableAttrs{TAttr{HTable: "", FTable: "world"}}, - }, - { - xml: ``, - tab: TableAttrs{}, - }, - { - // Default space does not apply to attribute names. - xml: ``, - tab: TableAttrs{TAttr{HTable: "hello", FTable: ""}}, - ns: "http://www.w3schools.com/furniture", - }, - { - // Default space does not apply to attribute names. - xml: ``, - tab: TableAttrs{TAttr{HTable: "", FTable: "world"}}, - ns: "http://www.w3.org/TR/html4/", - }, - { - xml: ``, - tab: TableAttrs{}, - ns: "something else entirely", - }, -} - -func TestUnmarshalNSAttr(t *testing.T) { - for i, tt := range tableAttrs { - var dst TableAttrs - var err error - if tt.ns != "" { - d := NewDecoder(strings.NewReader(tt.xml)) - d.DefaultSpace = tt.ns - err = d.Decode(&dst) - } else { - err = Unmarshal([]byte(tt.xml), &dst) - } - if err != nil { - t.Errorf("#%d: Unmarshal: %v", i, err) - continue - } - want := tt.tab - if dst != want { - t.Errorf("#%d: dst=%+v, want %+v", i, dst, want) - } - } -} - -func TestMarshalNSAttr(t *testing.T) { - src := TableAttrs{TAttr{"hello", "world", "en_US", "other1", "other2", "other3", "other4"}} - data, err := Marshal(&src) - if err != nil { - t.Fatalf("Marshal: %v", err) - } - want := `` - str := string(data) - if str != want { - t.Errorf("Marshal:\nhave: %#q\nwant: %#q\n", str, want) - } - - var dst TableAttrs - if err := Unmarshal(data, &dst); err != nil { - t.Errorf("Unmarshal: %v", err) - } - - if dst != src { - t.Errorf("Unmarshal = %q, want %q", dst, src) - } -} - -type MyCharData struct { - body string -} - -func (m *MyCharData) UnmarshalXML(d *Decoder, start StartElement) error { - for { - t, err := d.Token() - if err == io.EOF { // found end of element - break - } - if err != nil { - return err - } - if char, ok := t.(CharData); ok { - m.body += string(char) - } - } - return nil -} - -var _ Unmarshaler = (*MyCharData)(nil) - -func (m *MyCharData) UnmarshalXMLAttr(attr Attr) error { - panic("must not call") -} - -type MyAttr struct { - attr string -} - -func (m *MyAttr) UnmarshalXMLAttr(attr Attr) error { - m.attr = attr.Value - return nil -} - -var _ UnmarshalerAttr = (*MyAttr)(nil) - -type MyStruct struct { - Data *MyCharData - Attr *MyAttr `xml:",attr"` - - Data2 MyCharData - Attr2 MyAttr `xml:",attr"` -} - -func TestUnmarshaler(t *testing.T) { - xml := ` - - hello world - howdy world - - ` - - var m MyStruct - if err := Unmarshal([]byte(xml), &m); err != nil { - t.Fatal(err) - } - - if m.Data == nil || m.Attr == nil || m.Data.body != "hello world" || m.Attr.attr != "attr1" || m.Data2.body != "howdy world" || m.Attr2.attr != "attr2" { - t.Errorf("m=%#+v\n", m) - } -} - -type Pea struct { - Cotelydon string -} - -type Pod struct { - Pea interface{} `xml:"Pea"` -} - -// https://code.google.com/p/go/issues/detail?id=6836 -func TestUnmarshalIntoInterface(t *testing.T) { - pod := new(Pod) - pod.Pea = new(Pea) - xml := `Green stuff` - err := Unmarshal([]byte(xml), pod) - if err != nil { - t.Fatalf("failed to unmarshal %q: %v", xml, err) - } - pea, ok := pod.Pea.(*Pea) - if !ok { - t.Fatalf("unmarshalled into wrong type: have %T want *Pea", pod.Pea) - } - have, want := pea.Cotelydon, "Green stuff" - if have != want { - t.Errorf("failed to unmarshal into interface, have %q want %q", have, want) - } -} - -// https://github.com/vmware/govmomi/issues/246 -func TestNegativeValuesUnsignedFields(t *testing.T) { - type T struct { - I string - O interface{} - U8 uint8 `xml:"u8"` - U16 uint16 `xml:"u16"` - U32 uint32 `xml:"u32"` - U64 uint64 `xml:"u64"` - } - - var tests = []T{ - {I: "-128", O: uint8(0x80)}, - {I: "-1", O: uint8(0xff)}, - {I: "-32768", O: uint16(0x8000)}, - {I: "-1", O: uint16(0xffff)}, - {I: "-2147483648", O: uint32(0x80000000)}, - {I: "-1", O: uint32(0xffffffff)}, - {I: "-9223372036854775808", O: uint64(0x8000000000000000)}, - {I: "-1", O: uint64(0xffffffffffffffff)}, - } - - for _, test := range tests { - err := Unmarshal([]byte(test.I), &test) - if err != nil { - t.Errorf("Unmarshal error: %v", err) - continue - } - - var expected = test.O - var actual interface{} - switch reflect.ValueOf(test.O).Type().Kind() { - case reflect.Uint8: - actual = test.U8 - case reflect.Uint16: - actual = test.U16 - case reflect.Uint32: - actual = test.U32 - case reflect.Uint64: - actual = test.U64 - } - - if !reflect.DeepEqual(actual, expected) { - t.Errorf("Actual: %v, expected: %v", actual, expected) - } - } -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/vim25/xml/typeinfo.go juju-core-2.0.2/src/github.com/juju/govmomi/vim25/xml/typeinfo.go --- juju-core-2.0.0/src/github.com/juju/govmomi/vim25/xml/typeinfo.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/vim25/xml/typeinfo.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,366 +0,0 @@ -// Copyright 2011 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package xml - -import ( - "fmt" - "reflect" - "strings" - "sync" -) - -// typeInfo holds details for the xml representation of a type. -type typeInfo struct { - xmlname *fieldInfo - fields []fieldInfo -} - -// fieldInfo holds details for the xml representation of a single field. -type fieldInfo struct { - idx []int - name string - xmlns string - flags fieldFlags - parents []string -} - -type fieldFlags int - -const ( - fElement fieldFlags = 1 << iota - fAttr - fCharData - fInnerXml - fComment - fAny - - fOmitEmpty - fTypeAttr - - fMode = fElement | fAttr | fCharData | fInnerXml | fComment | fAny -) - -var tinfoMap = make(map[reflect.Type]*typeInfo) -var tinfoLock sync.RWMutex - -var nameType = reflect.TypeOf(Name{}) - -// getTypeInfo returns the typeInfo structure with details necessary -// for marshalling and unmarshalling typ. -func getTypeInfo(typ reflect.Type) (*typeInfo, error) { - tinfoLock.RLock() - tinfo, ok := tinfoMap[typ] - tinfoLock.RUnlock() - if ok { - return tinfo, nil - } - tinfo = &typeInfo{} - if typ.Kind() == reflect.Struct && typ != nameType { - n := typ.NumField() - for i := 0; i < n; i++ { - f := typ.Field(i) - if f.PkgPath != "" || f.Tag.Get("xml") == "-" { - continue // Private field - } - - // For embedded structs, embed its fields. - if f.Anonymous { - t := f.Type - if t.Kind() == reflect.Ptr { - t = t.Elem() - } - if t.Kind() == reflect.Struct { - inner, err := getTypeInfo(t) - if err != nil { - return nil, err - } - if tinfo.xmlname == nil { - tinfo.xmlname = inner.xmlname - } - for _, finfo := range inner.fields { - finfo.idx = append([]int{i}, finfo.idx...) - if err := addFieldInfo(typ, tinfo, &finfo); err != nil { - return nil, err - } - } - continue - } - } - - finfo, err := structFieldInfo(typ, &f) - if err != nil { - return nil, err - } - - if f.Name == "XMLName" { - tinfo.xmlname = finfo - continue - } - - // Add the field if it doesn't conflict with other fields. - if err := addFieldInfo(typ, tinfo, finfo); err != nil { - return nil, err - } - } - } - tinfoLock.Lock() - tinfoMap[typ] = tinfo - tinfoLock.Unlock() - return tinfo, nil -} - -// structFieldInfo builds and returns a fieldInfo for f. -func structFieldInfo(typ reflect.Type, f *reflect.StructField) (*fieldInfo, error) { - finfo := &fieldInfo{idx: f.Index} - - // Split the tag from the xml namespace if necessary. - tag := f.Tag.Get("xml") - if i := strings.Index(tag, " "); i >= 0 { - finfo.xmlns, tag = tag[:i], tag[i+1:] - } - - // Parse flags. - tokens := strings.Split(tag, ",") - if len(tokens) == 1 { - finfo.flags = fElement - } else { - tag = tokens[0] - for _, flag := range tokens[1:] { - switch flag { - case "attr": - finfo.flags |= fAttr - case "chardata": - finfo.flags |= fCharData - case "innerxml": - finfo.flags |= fInnerXml - case "comment": - finfo.flags |= fComment - case "any": - finfo.flags |= fAny - case "omitempty": - finfo.flags |= fOmitEmpty - case "typeattr": - finfo.flags |= fTypeAttr - } - } - - // Validate the flags used. - valid := true - switch mode := finfo.flags & fMode; mode { - case 0: - finfo.flags |= fElement - case fAttr, fCharData, fInnerXml, fComment, fAny: - if f.Name == "XMLName" || tag != "" && mode != fAttr { - valid = false - } - default: - // This will also catch multiple modes in a single field. - valid = false - } - if finfo.flags&fMode == fAny { - finfo.flags |= fElement - } - if finfo.flags&fOmitEmpty != 0 && finfo.flags&(fElement|fAttr) == 0 { - valid = false - } - if !valid { - return nil, fmt.Errorf("xml: invalid tag in field %s of type %s: %q", - f.Name, typ, f.Tag.Get("xml")) - } - } - - // Use of xmlns without a name is not allowed. - if finfo.xmlns != "" && tag == "" { - return nil, fmt.Errorf("xml: namespace without name in field %s of type %s: %q", - f.Name, typ, f.Tag.Get("xml")) - } - - if f.Name == "XMLName" { - // The XMLName field records the XML element name. Don't - // process it as usual because its name should default to - // empty rather than to the field name. - finfo.name = tag - return finfo, nil - } - - if tag == "" { - // If the name part of the tag is completely empty, get - // default from XMLName of underlying struct if feasible, - // or field name otherwise. - if xmlname := lookupXMLName(f.Type); xmlname != nil { - finfo.xmlns, finfo.name = xmlname.xmlns, xmlname.name - } else { - finfo.name = f.Name - } - return finfo, nil - } - - // Prepare field name and parents. - parents := strings.Split(tag, ">") - if parents[0] == "" { - parents[0] = f.Name - } - if parents[len(parents)-1] == "" { - return nil, fmt.Errorf("xml: trailing '>' in field %s of type %s", f.Name, typ) - } - finfo.name = parents[len(parents)-1] - if len(parents) > 1 { - if (finfo.flags & fElement) == 0 { - return nil, fmt.Errorf("xml: %s chain not valid with %s flag", tag, strings.Join(tokens[1:], ",")) - } - finfo.parents = parents[:len(parents)-1] - } - - // If the field type has an XMLName field, the names must match - // so that the behavior of both marshalling and unmarshalling - // is straightforward and unambiguous. - if finfo.flags&fElement != 0 { - ftyp := f.Type - xmlname := lookupXMLName(ftyp) - if xmlname != nil && xmlname.name != finfo.name { - return nil, fmt.Errorf("xml: name %q in tag of %s.%s conflicts with name %q in %s.XMLName", - finfo.name, typ, f.Name, xmlname.name, ftyp) - } - } - return finfo, nil -} - -// lookupXMLName returns the fieldInfo for typ's XMLName field -// in case it exists and has a valid xml field tag, otherwise -// it returns nil. -func lookupXMLName(typ reflect.Type) (xmlname *fieldInfo) { - for typ.Kind() == reflect.Ptr { - typ = typ.Elem() - } - if typ.Kind() != reflect.Struct { - return nil - } - for i, n := 0, typ.NumField(); i < n; i++ { - f := typ.Field(i) - if f.Name != "XMLName" { - continue - } - finfo, err := structFieldInfo(typ, &f) - if finfo.name != "" && err == nil { - return finfo - } - // Also consider errors as a non-existent field tag - // and let getTypeInfo itself report the error. - break - } - return nil -} - -func min(a, b int) int { - if a <= b { - return a - } - return b -} - -// addFieldInfo adds finfo to tinfo.fields if there are no -// conflicts, or if conflicts arise from previous fields that were -// obtained from deeper embedded structures than finfo. In the latter -// case, the conflicting entries are dropped. -// A conflict occurs when the path (parent + name) to a field is -// itself a prefix of another path, or when two paths match exactly. -// It is okay for field paths to share a common, shorter prefix. -func addFieldInfo(typ reflect.Type, tinfo *typeInfo, newf *fieldInfo) error { - var conflicts []int -Loop: - // First, figure all conflicts. Most working code will have none. - for i := range tinfo.fields { - oldf := &tinfo.fields[i] - if oldf.flags&fMode != newf.flags&fMode { - continue - } - if oldf.xmlns != "" && newf.xmlns != "" && oldf.xmlns != newf.xmlns { - continue - } - minl := min(len(newf.parents), len(oldf.parents)) - for p := 0; p < minl; p++ { - if oldf.parents[p] != newf.parents[p] { - continue Loop - } - } - if len(oldf.parents) > len(newf.parents) { - if oldf.parents[len(newf.parents)] == newf.name { - conflicts = append(conflicts, i) - } - } else if len(oldf.parents) < len(newf.parents) { - if newf.parents[len(oldf.parents)] == oldf.name { - conflicts = append(conflicts, i) - } - } else { - if newf.name == oldf.name { - conflicts = append(conflicts, i) - } - } - } - // Without conflicts, add the new field and return. - if conflicts == nil { - tinfo.fields = append(tinfo.fields, *newf) - return nil - } - - // If any conflict is shallower, ignore the new field. - // This matches the Go field resolution on embedding. - for _, i := range conflicts { - if len(tinfo.fields[i].idx) < len(newf.idx) { - return nil - } - } - - // Otherwise, if any of them is at the same depth level, it's an error. - for _, i := range conflicts { - oldf := &tinfo.fields[i] - if len(oldf.idx) == len(newf.idx) { - f1 := typ.FieldByIndex(oldf.idx) - f2 := typ.FieldByIndex(newf.idx) - return &TagPathError{typ, f1.Name, f1.Tag.Get("xml"), f2.Name, f2.Tag.Get("xml")} - } - } - - // Otherwise, the new field is shallower, and thus takes precedence, - // so drop the conflicting fields from tinfo and append the new one. - for c := len(conflicts) - 1; c >= 0; c-- { - i := conflicts[c] - copy(tinfo.fields[i:], tinfo.fields[i+1:]) - tinfo.fields = tinfo.fields[:len(tinfo.fields)-1] - } - tinfo.fields = append(tinfo.fields, *newf) - return nil -} - -// A TagPathError represents an error in the unmarshalling process -// caused by the use of field tags with conflicting paths. -type TagPathError struct { - Struct reflect.Type - Field1, Tag1 string - Field2, Tag2 string -} - -func (e *TagPathError) Error() string { - return fmt.Sprintf("%s field %q with tag %q conflicts with field %q with tag %q", e.Struct, e.Field1, e.Tag1, e.Field2, e.Tag2) -} - -// value returns v's field value corresponding to finfo. -// It's equivalent to v.FieldByIndex(finfo.idx), but initializes -// and dereferences pointers as necessary. -func (finfo *fieldInfo) value(v reflect.Value) reflect.Value { - for i, x := range finfo.idx { - if i > 0 { - t := v.Type() - if t.Kind() == reflect.Ptr && t.Elem().Kind() == reflect.Struct { - if v.IsNil() { - v.Set(reflect.New(v.Type().Elem())) - } - v = v.Elem() - } - } - v = v.Field(x) - } - return v -} diff -Nru juju-core-2.0.0/src/github.com/juju/govmomi/vim25/xml/xml.go juju-core-2.0.2/src/github.com/juju/govmomi/vim25/xml/xml.go --- juju-core-2.0.0/src/github.com/juju/govmomi/vim25/xml/xml.go 2016-10-13 14:32:07.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/govmomi/vim25/xml/xml.go 1970-01-01 00:00:00.000000000 +0000 @@ -1,1939 +0,0 @@ -// Copyright 2009 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package xml implements a simple XML 1.0 parser that -// understands XML name spaces. -package xml - -// References: -// Annotated XML spec: http://www.xml.com/axml/testaxml.htm -// XML name spaces: http://www.w3.org/TR/REC-xml-names/ - -// TODO(rsc): -// Test error handling. - -import ( - "bufio" - "bytes" - "errors" - "fmt" - "io" - "reflect" - "strconv" - "strings" - "unicode" - "unicode/utf8" -) - -// A SyntaxError represents a syntax error in the XML input stream. -type SyntaxError struct { - Msg string - Line int -} - -func (e *SyntaxError) Error() string { - return "XML syntax error on line " + strconv.Itoa(e.Line) + ": " + e.Msg -} - -// A Name represents an XML name (Local) annotated -// with a name space identifier (Space). -// In tokens returned by Decoder.Token, the Space identifier -// is given as a canonical URL, not the short prefix used -// in the document being parsed. -type Name struct { - Space, Local string -} - -// An Attr represents an attribute in an XML element (Name=Value). -type Attr struct { - Name Name - Value string -} - -// A Token is an interface holding one of the token types: -// StartElement, EndElement, CharData, Comment, ProcInst, or Directive. -type Token interface{} - -// A StartElement represents an XML start element. -type StartElement struct { - Name Name - Attr []Attr -} - -func (e StartElement) Copy() StartElement { - attrs := make([]Attr, len(e.Attr)) - copy(attrs, e.Attr) - e.Attr = attrs - return e -} - -// End returns the corresponding XML end element. -func (e StartElement) End() EndElement { - return EndElement{e.Name} -} - -// An EndElement represents an XML end element. -type EndElement struct { - Name Name -} - -// A CharData represents XML character data (raw text), -// in which XML escape sequences have been replaced by -// the characters they represent. -type CharData []byte - -func makeCopy(b []byte) []byte { - b1 := make([]byte, len(b)) - copy(b1, b) - return b1 -} - -func (c CharData) Copy() CharData { return CharData(makeCopy(c)) } - -// A Comment represents an XML comment of the form . -// The bytes do not include the comment markers. -type Comment []byte - -func (c Comment) Copy() Comment { return Comment(makeCopy(c)) } - -// A ProcInst represents an XML processing instruction of the form -type ProcInst struct { - Target string - Inst []byte -} - -func (p ProcInst) Copy() ProcInst { - p.Inst = makeCopy(p.Inst) - return p -} - -// A Directive represents an XML directive of the form . -// The bytes do not include the markers. -type Directive []byte - -func (d Directive) Copy() Directive { return Directive(makeCopy(d)) } - -// CopyToken returns a copy of a Token. -func CopyToken(t Token) Token { - switch v := t.(type) { - case CharData: - return v.Copy() - case Comment: - return v.Copy() - case Directive: - return v.Copy() - case ProcInst: - return v.Copy() - case StartElement: - return v.Copy() - } - return t -} - -// A Decoder represents an XML parser reading a particular input stream. -// The parser assumes that its input is encoded in UTF-8. -type Decoder struct { - // Strict defaults to true, enforcing the requirements - // of the XML specification. - // If set to false, the parser allows input containing common - // mistakes: - // * If an element is missing an end tag, the parser invents - // end tags as necessary to keep the return values from Token - // properly balanced. - // * In attribute values and character data, unknown or malformed - // character entities (sequences beginning with &) are left alone. - // - // Setting: - // - // d.Strict = false; - // d.AutoClose = HTMLAutoClose; - // d.Entity = HTMLEntity - // - // creates a parser that can handle typical HTML. - // - // Strict mode does not enforce the requirements of the XML name spaces TR. - // In particular it does not reject name space tags using undefined prefixes. - // Such tags are recorded with the unknown prefix as the name space URL. - Strict bool - - // When Strict == false, AutoClose indicates a set of elements to - // consider closed immediately after they are opened, regardless - // of whether an end element is present. - AutoClose []string - - // Entity can be used to map non-standard entity names to string replacements. - // The parser behaves as if these standard mappings are present in the map, - // regardless of the actual map content: - // - // "lt": "<", - // "gt": ">", - // "amp": "&", - // "apos": "'", - // "quot": `"`, - Entity map[string]string - - // CharsetReader, if non-nil, defines a function to generate - // charset-conversion readers, converting from the provided - // non-UTF-8 charset into UTF-8. If CharsetReader is nil or - // returns an error, parsing stops with an error. One of the - // the CharsetReader's result values must be non-nil. - CharsetReader func(charset string, input io.Reader) (io.Reader, error) - - // DefaultSpace sets the default name space used for unadorned tags, - // as if the entire XML stream were wrapped in an element containing - // the attribute xmlns="DefaultSpace". - DefaultSpace string - - // TypeFunc is used to map type names to actual types. - TypeFunc func(string) (reflect.Type, bool) - - r io.ByteReader - buf bytes.Buffer - saved *bytes.Buffer - stk *stack - free *stack - needClose bool - toClose Name - nextToken Token - nextByte int - ns map[string]string - err error - line int - unmarshalDepth int -} - -// NewDecoder creates a new XML parser reading from r. -// If r does not implement io.ByteReader, NewDecoder will -// do its own buffering. -func NewDecoder(r io.Reader) *Decoder { - d := &Decoder{ - ns: make(map[string]string), - nextByte: -1, - line: 1, - Strict: true, - } - d.switchToReader(r) - return d -} - -// Token returns the next XML token in the input stream. -// At the end of the input stream, Token returns nil, io.EOF. -// -// Slices of bytes in the returned token data refer to the -// parser's internal buffer and remain valid only until the next -// call to Token. To acquire a copy of the bytes, call CopyToken -// or the token's Copy method. -// -// Token expands self-closing elements such as
-// into separate start and end elements returned by successive calls. -// -// Token guarantees that the StartElement and EndElement -// tokens it returns are properly nested and matched: -// if Token encounters an unexpected end element, -// it will return an error. -// -// Token implements XML name spaces as described by -// http://www.w3.org/TR/REC-xml-names/. Each of the -// Name structures contained in the Token has the Space -// set to the URL identifying its name space when known. -// If Token encounters an unrecognized name space prefix, -// it uses the prefix as the Space rather than report an error. -func (d *Decoder) Token() (t Token, err error) { - if d.stk != nil && d.stk.kind == stkEOF { - err = io.EOF - return - } - if d.nextToken != nil { - t = d.nextToken - d.nextToken = nil - } else if t, err = d.rawToken(); err != nil { - return - } - - if !d.Strict { - if t1, ok := d.autoClose(t); ok { - d.nextToken = t - t = t1 - } - } - switch t1 := t.(type) { - case StartElement: - // In XML name spaces, the translations listed in the - // attributes apply to the element name and - // to the other attribute names, so process - // the translations first. - for _, a := range t1.Attr { - if a.Name.Space == "xmlns" { - v, ok := d.ns[a.Name.Local] - d.pushNs(a.Name.Local, v, ok) - d.ns[a.Name.Local] = a.Value - } - if a.Name.Space == "" && a.Name.Local == "xmlns" { - // Default space for untagged names - v, ok := d.ns[""] - d.pushNs("", v, ok) - d.ns[""] = a.Value - } - } - - d.translate(&t1.Name, true) - for i := range t1.Attr { - d.translate(&t1.Attr[i].Name, false) - } - d.pushElement(t1.Name) - t = t1 - - case EndElement: - d.translate(&t1.Name, true) - if !d.popElement(&t1) { - return nil, d.err - } - t = t1 - } - return -} - -const xmlURL = "http://www.w3.org/XML/1998/namespace" - -// Apply name space translation to name n. -// The default name space (for Space=="") -// applies only to element names, not to attribute names. -func (d *Decoder) translate(n *Name, isElementName bool) { - switch { - case n.Space == "xmlns": - return - case n.Space == "" && !isElementName: - return - case n.Space == "xml": - n.Space = xmlURL - case n.Space == "" && n.Local == "xmlns": - return - } - if v, ok := d.ns[n.Space]; ok { - n.Space = v - } else if n.Space == "" { - n.Space = d.DefaultSpace - } -} - -func (d *Decoder) switchToReader(r io.Reader) { - // Get efficient byte at a time reader. - // Assume that if reader has its own - // ReadByte, it's efficient enough. - // Otherwise, use bufio. - if rb, ok := r.(io.ByteReader); ok { - d.r = rb - } else { - d.r = bufio.NewReader(r) - } -} - -// Parsing state - stack holds old name space translations -// and the current set of open elements. The translations to pop when -// ending a given tag are *below* it on the stack, which is -// more work but forced on us by XML. -type stack struct { - next *stack - kind int - name Name - ok bool -} - -const ( - stkStart = iota - stkNs - stkEOF -) - -func (d *Decoder) push(kind int) *stack { - s := d.free - if s != nil { - d.free = s.next - } else { - s = new(stack) - } - s.next = d.stk - s.kind = kind - d.stk = s - return s -} - -func (d *Decoder) pop() *stack { - s := d.stk - if s != nil { - d.stk = s.next - s.next = d.free - d.free = s - } - return s -} - -// Record that after the current element is finished -// (that element is already pushed on the stack) -// Token should return EOF until popEOF is called. -func (d *Decoder) pushEOF() { - // Walk down stack to find Start. - // It might not be the top, because there might be stkNs - // entries above it. - start := d.stk - for start.kind != stkStart { - start = start.next - } - // The stkNs entries below a start are associated with that - // element too; skip over them. - for start.next != nil && start.next.kind == stkNs { - start = start.next - } - s := d.free - if s != nil { - d.free = s.next - } else { - s = new(stack) - } - s.kind = stkEOF - s.next = start.next - start.next = s -} - -// Undo a pushEOF. -// The element must have been finished, so the EOF should be at the top of the stack. -func (d *Decoder) popEOF() bool { - if d.stk == nil || d.stk.kind != stkEOF { - return false - } - d.pop() - return true -} - -// Record that we are starting an element with the given name. -func (d *Decoder) pushElement(name Name) { - s := d.push(stkStart) - s.name = name -} - -// Record that we are changing the value of ns[local]. -// The old value is url, ok. -func (d *Decoder) pushNs(local string, url string, ok bool) { - s := d.push(stkNs) - s.name.Local = local - s.name.Space = url - s.ok = ok -} - -// Creates a SyntaxError with the current line number. -func (d *Decoder) syntaxError(msg string) error { - return &SyntaxError{Msg: msg, Line: d.line} -} - -// Record that we are ending an element with the given name. -// The name must match the record at the top of the stack, -// which must be a pushElement record. -// After popping the element, apply any undo records from -// the stack to restore the name translations that existed -// before we saw this element. -func (d *Decoder) popElement(t *EndElement) bool { - s := d.pop() - name := t.Name - switch { - case s == nil || s.kind != stkStart: - d.err = d.syntaxError("unexpected end element ") - return false - case s.name.Local != name.Local: - if !d.Strict { - d.needClose = true - d.toClose = t.Name - t.Name = s.name - return true - } - d.err = d.syntaxError("element <" + s.name.Local + "> closed by ") - return false - case s.name.Space != name.Space: - d.err = d.syntaxError("element <" + s.name.Local + "> in space " + s.name.Space + - "closed by in space " + name.Space) - return false - } - - // Pop stack until a Start or EOF is on the top, undoing the - // translations that were associated with the element we just closed. - for d.stk != nil && d.stk.kind != stkStart && d.stk.kind != stkEOF { - s := d.pop() - if s.ok { - d.ns[s.name.Local] = s.name.Space - } else { - delete(d.ns, s.name.Local) - } - } - - return true -} - -// If the top element on the stack is autoclosing and -// t is not the end tag, invent the end tag. -func (d *Decoder) autoClose(t Token) (Token, bool) { - if d.stk == nil || d.stk.kind != stkStart { - return nil, false - } - name := strings.ToLower(d.stk.name.Local) - for _, s := range d.AutoClose { - if strings.ToLower(s) == name { - // This one should be auto closed if t doesn't close it. - et, ok := t.(EndElement) - if !ok || et.Name.Local != name { - return EndElement{d.stk.name}, true - } - break - } - } - return nil, false -} - -var errRawToken = errors.New("xml: cannot use RawToken from UnmarshalXML method") - -// RawToken is like Token but does not verify that -// start and end elements match and does not translate -// name space prefixes to their corresponding URLs. -func (d *Decoder) RawToken() (Token, error) { - if d.unmarshalDepth > 0 { - return nil, errRawToken - } - return d.rawToken() -} - -func (d *Decoder) rawToken() (Token, error) { - if d.err != nil { - return nil, d.err - } - if d.needClose { - // The last element we read was self-closing and - // we returned just the StartElement half. - // Return the EndElement half now. - d.needClose = false - return EndElement{d.toClose}, nil - } - - b, ok := d.getc() - if !ok { - return nil, d.err - } - - if b != '<' { - // Text section. - d.ungetc(b) - data := d.text(-1, false) - if data == nil { - return nil, d.err - } - return CharData(data), nil - } - - if b, ok = d.mustgetc(); !ok { - return nil, d.err - } - switch b { - case '/': - // ' { - d.err = d.syntaxError("invalid characters between ") - return nil, d.err - } - return EndElement{name}, nil - - case '?': - // ' { - break - } - b0 = b - } - data := d.buf.Bytes() - data = data[0 : len(data)-2] // chop ?> - - if target == "xml" { - enc := procInstEncoding(string(data)) - if enc != "" && enc != "utf-8" && enc != "UTF-8" { - if d.CharsetReader == nil { - d.err = fmt.Errorf("xml: encoding %q declared but Decoder.CharsetReader is nil", enc) - return nil, d.err - } - newr, err := d.CharsetReader(enc, d.r.(io.Reader)) - if err != nil { - d.err = fmt.Errorf("xml: opening charset %q: %v", enc, err) - return nil, d.err - } - if newr == nil { - panic("CharsetReader returned a nil Reader for charset " + enc) - } - d.switchToReader(newr) - } - } - return ProcInst{target, data}, nil - - case '!': - // ' { - break - } - b0, b1 = b1, b - } - data := d.buf.Bytes() - data = data[0 : len(data)-3] // chop --> - return Comment(data), nil - - case '[': // . - data := d.text(-1, true) - if data == nil { - return nil, d.err - } - return CharData(data), nil - } - - // Probably a directive: , , etc. - // We don't care, but accumulate for caller. Quoted angle - // brackets do not count for nesting. - d.buf.Reset() - d.buf.WriteByte(b) - inquote := uint8(0) - depth := 0 - for { - if b, ok = d.mustgetc(); !ok { - return nil, d.err - } - if inquote == 0 && b == '>' && depth == 0 { - break - } - HandleB: - d.buf.WriteByte(b) - switch { - case b == inquote: - inquote = 0 - - case inquote != 0: - // in quotes, no special action - - case b == '\'' || b == '"': - inquote = b - - case b == '>' && inquote == 0: - depth-- - - case b == '<' && inquote == 0: - // Look for ` - -var testEntity = map[string]string{"何": "What", "is-it": "is it?"} - -var rawTokens = []Token{ - CharData("\n"), - ProcInst{"xml", []byte(`version="1.0" encoding="UTF-8"`)}, - CharData("\n"), - Directive(`DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"`), - CharData("\n"), - StartElement{Name{"", "body"}, []Attr{{Name{"xmlns", "foo"}, "ns1"}, {Name{"", "xmlns"}, "ns2"}, {Name{"xmlns", "tag"}, "ns3"}}}, - CharData("\n "), - StartElement{Name{"", "hello"}, []Attr{{Name{"", "lang"}, "en"}}}, - CharData("World <>'\" 白鵬翔"), - EndElement{Name{"", "hello"}}, - CharData("\n "), - StartElement{Name{"", "query"}, []Attr{}}, - CharData("What is it?"), - EndElement{Name{"", "query"}}, - CharData("\n "), - StartElement{Name{"", "goodbye"}, []Attr{}}, - EndElement{Name{"", "goodbye"}}, - CharData("\n "), - StartElement{Name{"", "outer"}, []Attr{{Name{"foo", "attr"}, "value"}, {Name{"xmlns", "tag"}, "ns4"}}}, - CharData("\n "), - StartElement{Name{"", "inner"}, []Attr{}}, - EndElement{Name{"", "inner"}}, - CharData("\n "), - EndElement{Name{"", "outer"}}, - CharData("\n "), - StartElement{Name{"tag", "name"}, []Attr{}}, - CharData("\n "), - CharData("Some text here."), - CharData("\n "), - EndElement{Name{"tag", "name"}}, - CharData("\n"), - EndElement{Name{"", "body"}}, - Comment(" missing final newline "), -} - -var cookedTokens = []Token{ - CharData("\n"), - ProcInst{"xml", []byte(`version="1.0" encoding="UTF-8"`)}, - CharData("\n"), - Directive(`DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"`), - CharData("\n"), - StartElement{Name{"ns2", "body"}, []Attr{{Name{"xmlns", "foo"}, "ns1"}, {Name{"", "xmlns"}, "ns2"}, {Name{"xmlns", "tag"}, "ns3"}}}, - CharData("\n "), - StartElement{Name{"ns2", "hello"}, []Attr{{Name{"", "lang"}, "en"}}}, - CharData("World <>'\" 白鵬翔"), - EndElement{Name{"ns2", "hello"}}, - CharData("\n "), - StartElement{Name{"ns2", "query"}, []Attr{}}, - CharData("What is it?"), - EndElement{Name{"ns2", "query"}}, - CharData("\n "), - StartElement{Name{"ns2", "goodbye"}, []Attr{}}, - EndElement{Name{"ns2", "goodbye"}}, - CharData("\n "), - StartElement{Name{"ns2", "outer"}, []Attr{{Name{"ns1", "attr"}, "value"}, {Name{"xmlns", "tag"}, "ns4"}}}, - CharData("\n "), - StartElement{Name{"ns2", "inner"}, []Attr{}}, - EndElement{Name{"ns2", "inner"}}, - CharData("\n "), - EndElement{Name{"ns2", "outer"}}, - CharData("\n "), - StartElement{Name{"ns3", "name"}, []Attr{}}, - CharData("\n "), - CharData("Some text here."), - CharData("\n "), - EndElement{Name{"ns3", "name"}}, - CharData("\n"), - EndElement{Name{"ns2", "body"}}, - Comment(" missing final newline "), -} - -const testInputAltEncoding = ` - -VALUE` - -var rawTokensAltEncoding = []Token{ - CharData("\n"), - ProcInst{"xml", []byte(`version="1.0" encoding="x-testing-uppercase"`)}, - CharData("\n"), - StartElement{Name{"", "tag"}, []Attr{}}, - CharData("value"), - EndElement{Name{"", "tag"}}, -} - -var xmlInput = []string{ - // unexpected EOF cases - "<", - "", - "", - "", - // "", // let the Token() caller handle - "", - "", - "", - "", - " c;", - "", - "", - "", - // "", // let the Token() caller handle - "", - "", - "cdata]]>", -} - -func TestRawToken(t *testing.T) { - d := NewDecoder(strings.NewReader(testInput)) - d.Entity = testEntity - testRawToken(t, d, rawTokens) -} - -const nonStrictInput = ` -non&entity -&unknown;entity -{ -&#zzz; -&なまえ3; -<-gt; -&; -&0a; -` - -var nonStringEntity = map[string]string{"": "oops!", "0a": "oops!"} - -var nonStrictTokens = []Token{ - CharData("\n"), - StartElement{Name{"", "tag"}, []Attr{}}, - CharData("non&entity"), - EndElement{Name{"", "tag"}}, - CharData("\n"), - StartElement{Name{"", "tag"}, []Attr{}}, - CharData("&unknown;entity"), - EndElement{Name{"", "tag"}}, - CharData("\n"), - StartElement{Name{"", "tag"}, []Attr{}}, - CharData("{"), - EndElement{Name{"", "tag"}}, - CharData("\n"), - StartElement{Name{"", "tag"}, []Attr{}}, - CharData("&#zzz;"), - EndElement{Name{"", "tag"}}, - CharData("\n"), - StartElement{Name{"", "tag"}, []Attr{}}, - CharData("&なまえ3;"), - EndElement{Name{"", "tag"}}, - CharData("\n"), - StartElement{Name{"", "tag"}, []Attr{}}, - CharData("<-gt;"), - EndElement{Name{"", "tag"}}, - CharData("\n"), - StartElement{Name{"", "tag"}, []Attr{}}, - CharData("&;"), - EndElement{Name{"", "tag"}}, - CharData("\n"), - StartElement{Name{"", "tag"}, []Attr{}}, - CharData("&0a;"), - EndElement{Name{"", "tag"}}, - CharData("\n"), -} - -func TestNonStrictRawToken(t *testing.T) { - d := NewDecoder(strings.NewReader(nonStrictInput)) - d.Strict = false - testRawToken(t, d, nonStrictTokens) -} - -type downCaser struct { - t *testing.T - r io.ByteReader -} - -func (d *downCaser) ReadByte() (c byte, err error) { - c, err = d.r.ReadByte() - if c >= 'A' && c <= 'Z' { - c += 'a' - 'A' - } - return -} - -func (d *downCaser) Read(p []byte) (int, error) { - d.t.Fatalf("unexpected Read call on downCaser reader") - panic("unreachable") -} - -func TestRawTokenAltEncoding(t *testing.T) { - d := NewDecoder(strings.NewReader(testInputAltEncoding)) - d.CharsetReader = func(charset string, input io.Reader) (io.Reader, error) { - if charset != "x-testing-uppercase" { - t.Fatalf("unexpected charset %q", charset) - } - return &downCaser{t, input.(io.ByteReader)}, nil - } - testRawToken(t, d, rawTokensAltEncoding) -} - -func TestRawTokenAltEncodingNoConverter(t *testing.T) { - d := NewDecoder(strings.NewReader(testInputAltEncoding)) - token, err := d.RawToken() - if token == nil { - t.Fatalf("expected a token on first RawToken call") - } - if err != nil { - t.Fatal(err) - } - token, err = d.RawToken() - if token != nil { - t.Errorf("expected a nil token; got %#v", token) - } - if err == nil { - t.Fatalf("expected an error on second RawToken call") - } - const encoding = "x-testing-uppercase" - if !strings.Contains(err.Error(), encoding) { - t.Errorf("expected error to contain %q; got error: %v", - encoding, err) - } -} - -func testRawToken(t *testing.T, d *Decoder, rawTokens []Token) { - for i, want := range rawTokens { - have, err := d.RawToken() - if err != nil { - t.Fatalf("token %d: unexpected error: %s", i, err) - } - if !reflect.DeepEqual(have, want) { - var shave, swant string - if _, ok := have.(CharData); ok { - shave = fmt.Sprintf("CharData(%q)", have) - } else { - shave = fmt.Sprintf("%#v", have) - } - if _, ok := want.(CharData); ok { - swant = fmt.Sprintf("CharData(%q)", want) - } else { - swant = fmt.Sprintf("%#v", want) - } - t.Errorf("token %d = %s, want %s", i, shave, swant) - } - } -} - -// Ensure that directives (specifically !DOCTYPE) include the complete -// text of any nested directives, noting that < and > do not change -// nesting depth if they are in single or double quotes. - -var nestedDirectivesInput = ` -]> -">]> -]> -'>]> -]> -'>]> -]> -` - -var nestedDirectivesTokens = []Token{ - CharData("\n"), - Directive(`DOCTYPE []`), - CharData("\n"), - Directive(`DOCTYPE [">]`), - CharData("\n"), - Directive(`DOCTYPE []`), - CharData("\n"), - Directive(`DOCTYPE ['>]`), - CharData("\n"), - Directive(`DOCTYPE []`), - CharData("\n"), - Directive(`DOCTYPE ['>]`), - CharData("\n"), - Directive(`DOCTYPE []`), - CharData("\n"), -} - -func TestNestedDirectives(t *testing.T) { - d := NewDecoder(strings.NewReader(nestedDirectivesInput)) - - for i, want := range nestedDirectivesTokens { - have, err := d.Token() - if err != nil { - t.Fatalf("token %d: unexpected error: %s", i, err) - } - if !reflect.DeepEqual(have, want) { - t.Errorf("token %d = %#v want %#v", i, have, want) - } - } -} - -func TestToken(t *testing.T) { - d := NewDecoder(strings.NewReader(testInput)) - d.Entity = testEntity - - for i, want := range cookedTokens { - have, err := d.Token() - if err != nil { - t.Fatalf("token %d: unexpected error: %s", i, err) - } - if !reflect.DeepEqual(have, want) { - t.Errorf("token %d = %#v want %#v", i, have, want) - } - } -} - -func TestSyntax(t *testing.T) { - for i := range xmlInput { - d := NewDecoder(strings.NewReader(xmlInput[i])) - var err error - for _, err = d.Token(); err == nil; _, err = d.Token() { - } - if _, ok := err.(*SyntaxError); !ok { - t.Fatalf(`xmlInput "%s": expected SyntaxError not received`, xmlInput[i]) - } - } -} - -type allScalars struct { - True1 bool - True2 bool - False1 bool - False2 bool - Int int - Int8 int8 - Int16 int16 - Int32 int32 - Int64 int64 - Uint int - Uint8 uint8 - Uint16 uint16 - Uint32 uint32 - Uint64 uint64 - Uintptr uintptr - Float32 float32 - Float64 float64 - String string - PtrString *string -} - -var all = allScalars{ - True1: true, - True2: true, - False1: false, - False2: false, - Int: 1, - Int8: -2, - Int16: 3, - Int32: -4, - Int64: 5, - Uint: 6, - Uint8: 7, - Uint16: 8, - Uint32: 9, - Uint64: 10, - Uintptr: 11, - Float32: 13.0, - Float64: 14.0, - String: "15", - PtrString: &sixteen, -} - -var sixteen = "16" - -const testScalarsInput = ` - true - 1 - false - 0 - 1 - -2 - 3 - -4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12.0 - 13.0 - 14.0 - 15 - 16 -` - -func TestAllScalars(t *testing.T) { - var a allScalars - err := Unmarshal([]byte(testScalarsInput), &a) - - if err != nil { - t.Fatal(err) - } - if !reflect.DeepEqual(a, all) { - t.Errorf("have %+v want %+v", a, all) - } -} - -type item struct { - Field_a string -} - -func TestIssue569(t *testing.T) { - data := `abcd` - var i item - err := Unmarshal([]byte(data), &i) - - if err != nil || i.Field_a != "abcd" { - t.Fatal("Expecting abcd") - } -} - -func TestUnquotedAttrs(t *testing.T) { - data := "" - d := NewDecoder(strings.NewReader(data)) - d.Strict = false - token, err := d.Token() - if _, ok := err.(*SyntaxError); ok { - t.Errorf("Unexpected error: %v", err) - } - if token.(StartElement).Name.Local != "tag" { - t.Errorf("Unexpected tag name: %v", token.(StartElement).Name.Local) - } - attr := token.(StartElement).Attr[0] - if attr.Value != "azAZ09:-_" { - t.Errorf("Unexpected attribute value: %v", attr.Value) - } - if attr.Name.Local != "attr" { - t.Errorf("Unexpected attribute name: %v", attr.Name.Local) - } -} - -func TestValuelessAttrs(t *testing.T) { - tests := [][3]string{ - {"

", "p", "nowrap"}, - {"

", "p", "nowrap"}, - {"", "input", "checked"}, - {"", "input", "checked"}, - } - for _, test := range tests { - d := NewDecoder(strings.NewReader(test[0])) - d.Strict = false - token, err := d.Token() - if _, ok := err.(*SyntaxError); ok { - t.Errorf("Unexpected error: %v", err) - } - if token.(StartElement).Name.Local != test[1] { - t.Errorf("Unexpected tag name: %v", token.(StartElement).Name.Local) - } - attr := token.(StartElement).Attr[0] - if attr.Value != test[2] { - t.Errorf("Unexpected attribute value: %v", attr.Value) - } - if attr.Name.Local != test[2] { - t.Errorf("Unexpected attribute name: %v", attr.Name.Local) - } - } -} - -func TestCopyTokenCharData(t *testing.T) { - data := []byte("same data") - var tok1 Token = CharData(data) - tok2 := CopyToken(tok1) - if !reflect.DeepEqual(tok1, tok2) { - t.Error("CopyToken(CharData) != CharData") - } - data[1] = 'o' - if reflect.DeepEqual(tok1, tok2) { - t.Error("CopyToken(CharData) uses same buffer.") - } -} - -func TestCopyTokenStartElement(t *testing.T) { - elt := StartElement{Name{"", "hello"}, []Attr{{Name{"", "lang"}, "en"}}} - var tok1 Token = elt - tok2 := CopyToken(tok1) - if tok1.(StartElement).Attr[0].Value != "en" { - t.Error("CopyToken overwrote Attr[0]") - } - if !reflect.DeepEqual(tok1, tok2) { - t.Error("CopyToken(StartElement) != StartElement") - } - tok1.(StartElement).Attr[0] = Attr{Name{"", "lang"}, "de"} - if reflect.DeepEqual(tok1, tok2) { - t.Error("CopyToken(CharData) uses same buffer.") - } -} - -func TestSyntaxErrorLineNum(t *testing.T) { - testInput := "

Foo

\n\n

Bar\n" - d := NewDecoder(strings.NewReader(testInput)) - var err error - for _, err = d.Token(); err == nil; _, err = d.Token() { - } - synerr, ok := err.(*SyntaxError) - if !ok { - t.Error("Expected SyntaxError.") - } - if synerr.Line != 3 { - t.Error("SyntaxError didn't have correct line number.") - } -} - -func TestTrailingRawToken(t *testing.T) { - input := ` ` - d := NewDecoder(strings.NewReader(input)) - var err error - for _, err = d.RawToken(); err == nil; _, err = d.RawToken() { - } - if err != io.EOF { - t.Fatalf("d.RawToken() = _, %v, want _, io.EOF", err) - } -} - -func TestTrailingToken(t *testing.T) { - input := ` ` - d := NewDecoder(strings.NewReader(input)) - var err error - for _, err = d.Token(); err == nil; _, err = d.Token() { - } - if err != io.EOF { - t.Fatalf("d.Token() = _, %v, want _, io.EOF", err) - } -} - -func TestEntityInsideCDATA(t *testing.T) { - input := `` - d := NewDecoder(strings.NewReader(input)) - var err error - for _, err = d.Token(); err == nil; _, err = d.Token() { - } - if err != io.EOF { - t.Fatalf("d.Token() = _, %v, want _, io.EOF", err) - } -} - -var characterTests = []struct { - in string - err string -}{ - {"\x12", "illegal character code U+0012"}, - {"\x0b", "illegal character code U+000B"}, - {"\xef\xbf\xbe", "illegal character code U+FFFE"}, - {"\r\n\x07", "illegal character code U+0007"}, - {"what's up", "expected attribute name in element"}, - {"&abc\x01;", "invalid character entity &abc (no semicolon)"}, - {"&\x01;", "invalid character entity & (no semicolon)"}, - {"&\xef\xbf\xbe;", "invalid character entity &\uFFFE;"}, - {"&hello;", "invalid character entity &hello;"}, -} - -func TestDisallowedCharacters(t *testing.T) { - - for i, tt := range characterTests { - d := NewDecoder(strings.NewReader(tt.in)) - var err error - - for err == nil { - _, err = d.Token() - } - synerr, ok := err.(*SyntaxError) - if !ok { - t.Fatalf("input %d d.Token() = _, %v, want _, *SyntaxError", i, err) - } - if synerr.Msg != tt.err { - t.Fatalf("input %d synerr.Msg wrong: want %q, got %q", i, tt.err, synerr.Msg) - } - } -} - -type procInstEncodingTest struct { - expect, got string -} - -var procInstTests = []struct { - input, expect string -}{ - {`version="1.0" encoding="utf-8"`, "utf-8"}, - {`version="1.0" encoding='utf-8'`, "utf-8"}, - {`version="1.0" encoding='utf-8' `, "utf-8"}, - {`version="1.0" encoding=utf-8`, ""}, - {`encoding="FOO" `, "FOO"}, -} - -func TestProcInstEncoding(t *testing.T) { - for _, test := range procInstTests { - got := procInstEncoding(test.input) - if got != test.expect { - t.Errorf("procInstEncoding(%q) = %q; want %q", test.input, got, test.expect) - } - } -} - -// Ensure that directives with comments include the complete -// text of any nested directives. - -var directivesWithCommentsInput = ` -]> -]> - --> --> []> -` - -var directivesWithCommentsTokens = []Token{ - CharData("\n"), - Directive(`DOCTYPE []`), - CharData("\n"), - Directive(`DOCTYPE []`), - CharData("\n"), - Directive(`DOCTYPE []`), - CharData("\n"), -} - -func TestDirectivesWithComments(t *testing.T) { - d := NewDecoder(strings.NewReader(directivesWithCommentsInput)) - - for i, want := range directivesWithCommentsTokens { - have, err := d.Token() - if err != nil { - t.Fatalf("token %d: unexpected error: %s", i, err) - } - if !reflect.DeepEqual(have, want) { - t.Errorf("token %d = %#v want %#v", i, have, want) - } - } -} - -// Writer whose Write method always returns an error. -type errWriter struct{} - -func (errWriter) Write(p []byte) (n int, err error) { return 0, fmt.Errorf("unwritable") } - -func TestEscapeTextIOErrors(t *testing.T) { - expectErr := "unwritable" - err := EscapeText(errWriter{}, []byte{'A'}) - - if err == nil || err.Error() != expectErr { - t.Errorf("have %v, want %v", err, expectErr) - } -} - -func TestEscapeTextInvalidChar(t *testing.T) { - input := []byte("A \x00 terminated string.") - expected := "A \uFFFD terminated string." - - buff := new(bytes.Buffer) - if err := EscapeText(buff, input); err != nil { - t.Fatalf("have %v, want nil", err) - } - text := buff.String() - - if text != expected { - t.Errorf("have %v, want %v", text, expected) - } -} - -func TestIssue5880(t *testing.T) { - type T []byte - data, err := Marshal(T{192, 168, 0, 1}) - if err != nil { - t.Errorf("Marshal error: %v", err) - } - if !utf8.Valid(data) { - t.Errorf("Marshal generated invalid UTF-8: %x", data) - } -} diff -Nru juju-core-2.0.0/src/github.com/juju/juju/api/allwatcher.go juju-core-2.0.2/src/github.com/juju/juju/api/allwatcher.go --- juju-core-2.0.0/src/github.com/juju/juju/api/allwatcher.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/api/allwatcher.go 2016-11-11 00:08:09.000000000 +0000 @@ -4,6 +4,8 @@ package api import ( + "sort" + "github.com/juju/juju/api/base" "github.com/juju/juju/apiserver/params" "github.com/juju/juju/state/multiwatcher" @@ -57,9 +59,46 @@ "Next", nil, &info, ) + // We'll order the deltas so relation changes come last. + // This allows the callers like the GUI to process changes + // in the right order. + sort.Sort(orderedDeltas(info.Deltas)) return info.Deltas, err } +type orderedDeltas []multiwatcher.Delta + +func (o orderedDeltas) Len() int { + return len(o) +} + +func (o orderedDeltas) kindPriority(kind string) int { + switch kind { + case "machine": + return 1 + case "service": + return 2 + case "relation": + return 3 + } + return 0 +} + +func (o orderedDeltas) Less(i, j int) bool { + // All we care about is having relation deltas last. + // We'll add extra checks though to make the order more + // deterministic for tests. + pi, pj := o.kindPriority(o[i].Entity.EntityId().Kind), o.kindPriority(o[j].Entity.EntityId().Kind) + if pi == pj { + return o[i].Entity.EntityId().Id < o[j].Entity.EntityId().Id + } + return pi < pj +} + +func (o orderedDeltas) Swap(i, j int) { + o[i], o[j] = o[j], o[i] +} + // Stop shutdowns down a watcher previously created by the WatchAll or // WatchAllModels API calls func (watcher *AllWatcher) Stop() error { diff -Nru juju-core-2.0.0/src/github.com/juju/juju/api/apiclient.go juju-core-2.0.2/src/github.com/juju/juju/api/apiclient.go --- juju-core-2.0.0/src/github.com/juju/juju/api/apiclient.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/api/apiclient.go 2016-11-11 00:08:09.000000000 +0000 @@ -180,7 +180,7 @@ if clock == nil { return nil, errors.NotValidf("nil clock") } - conn, tlsConfig, err := connectWebsocket(info, opts) + conn, tlsConfig, err := dialAPI(info, opts) if err != nil { return nil, errors.Trace(err) } @@ -275,70 +275,6 @@ return t.fallback.RoundTrip(req) } -// connectWebsocket establishes a websocket connection to the RPC -// API websocket on the API server using Info. If multiple API addresses -// are provided in Info they will be tried concurrently - the first successful -// connection wins. -// -// It also returns the TLS configuration that it has derived from the Info. -func connectWebsocket(info *Info, opts DialOpts) (*websocket.Conn, *tls.Config, error) { - if len(info.Addrs) == 0 { - return nil, nil, errors.New("no API addresses to connect to") - } - tlsConfig := utils.SecureTLSConfig() - tlsConfig.InsecureSkipVerify = opts.InsecureSkipVerify - - if info.CACert != "" && !tlsConfig.InsecureSkipVerify { - // We want to be specific here (rather than just using "anything". - // See commit 7fc118f015d8480dfad7831788e4b8c0432205e8 (PR 899). - tlsConfig.ServerName = "juju-apiserver" - certPool, err := CreateCertPool(info.CACert) - if err != nil { - return nil, nil, errors.Annotate(err, "cert pool creation failed") - } - tlsConfig.RootCAs = certPool - } - path, err := apiPath(info.ModelTag, "/api") - if err != nil { - return nil, nil, errors.Trace(err) - } - conn, err := dialWebSocket(info.Addrs, path, tlsConfig, opts) - if err != nil { - return nil, nil, errors.Trace(err) - } - logger.Infof("connection established to %q", conn.RemoteAddr()) - return conn, tlsConfig, nil -} - -// dialWebSocket dials a websocket with one of the provided addresses, the -// specified URL path, TLS configuration, and dial options. Each of the -// specified addresses will be attempted concurrently, and the first -// successful connection will be returned. -func dialWebSocket(addrs []string, path string, tlsConfig *tls.Config, opts DialOpts) (*websocket.Conn, error) { - // Dial all addresses at reasonable intervals. - try := parallel.NewTry(0, nil) - defer try.Kill() - for _, addr := range addrs { - err := dialWebsocket(addr, path, opts, tlsConfig, try) - if err == parallel.ErrStopped { - break - } - if err != nil { - return nil, errors.Trace(err) - } - select { - case <-time.After(opts.DialAddressInterval): - case <-try.Dead(): - } - } - try.Close() - result, err := try.Result() - if err != nil { - return nil, errors.Trace(err) - } - return result.(*websocket.Conn), nil -} - // ConnectStream implements StreamConnector.ConnectStream. func (st *state) ConnectStream(path string, attrs url.Values) (base.Stream, error) { if !st.isLoggedIn() { @@ -486,7 +422,83 @@ return tag.String() } -func dialWebsocket(addr, path string, opts DialOpts, tlsConfig *tls.Config, try *parallel.Try) error { +// dialAPI establishes a websocket connection to the RPC +// API websocket on the API server using Info. If multiple API addresses +// are provided in Info they will be tried concurrently - the first successful +// connection wins. +// +// It also returns the TLS configuration that it has derived from the Info. +func dialAPI(info *Info, opts DialOpts) (*websocket.Conn, *tls.Config, error) { + // Set opts.DialWebsocket here rather than in open because + // some tests call dialAPI directly. + if opts.DialWebsocket == nil { + opts.DialWebsocket = websocket.DialConfig + } + if len(info.Addrs) == 0 { + return nil, nil, errors.New("no API addresses to connect to") + } + tlsConfig := utils.SecureTLSConfig() + tlsConfig.InsecureSkipVerify = opts.InsecureSkipVerify + + if info.CACert != "" { + // We want to be specific here (rather than just using "anything". + // See commit 7fc118f015d8480dfad7831788e4b8c0432205e8 (PR 899). + tlsConfig.ServerName = "juju-apiserver" + certPool, err := CreateCertPool(info.CACert) + if err != nil { + return nil, nil, errors.Annotate(err, "cert pool creation failed") + } + tlsConfig.RootCAs = certPool + } else { + // No CA certificate so use the SNI host name for all + // connections (if SNIHostName is empty, the host + // name in the address will be used as usual). + tlsConfig.ServerName = info.SNIHostName + } + path, err := apiPath(info.ModelTag, "/api") + if err != nil { + return nil, nil, errors.Trace(err) + } + conn, err := dialWebsocketMulti(info.Addrs, path, tlsConfig, opts) + if err != nil { + return nil, nil, errors.Trace(err) + } + logger.Infof("connection established to %q", conn.RemoteAddr()) + return conn, tlsConfig, nil +} + +// dialWebsocketMulti dials a websocket with one of the provided addresses, the +// specified URL path, TLS configuration, and dial options. Each of the +// specified addresses will be attempted concurrently, and the first +// successful connection will be returned. +func dialWebsocketMulti(addrs []string, path string, tlsConfig *tls.Config, opts DialOpts) (*websocket.Conn, error) { + // Dial all addresses at reasonable intervals. + try := parallel.NewTry(0, nil) + defer try.Kill() + for _, addr := range addrs { + err := startDialWebsocket(try, addr, path, opts, tlsConfig) + if err == parallel.ErrStopped { + break + } + if err != nil { + return nil, errors.Trace(err) + } + select { + case <-time.After(opts.DialAddressInterval): + case <-try.Dead(): + } + } + try.Close() + result, err := try.Result() + if err != nil { + return nil, errors.Trace(err) + } + return result.(*websocket.Conn), nil +} + +// startDialWebsocket starts websocket connection to a single address +// on the given try instance. +func startDialWebsocket(try *parallel.Try, addr, path string, opts DialOpts, tlsConfig *tls.Config) error { // origin is required by the WebSocket API, used for "origin policy" // in websockets. We pass localhost to satisfy the API; it is // inconsequential to us. @@ -499,11 +511,10 @@ return try.Start(newWebsocketDialer(cfg, opts)) } -// newWebsocketDialer returns a function that -// can be passed to utils/parallel.Try.Start. -var newWebsocketDialer = createWebsocketDialer - -func createWebsocketDialer(cfg *websocket.Config, opts DialOpts) func(<-chan struct{}) (io.Closer, error) { +// newWebsocketDialer0 returns a function that dials the websocket represented +// by the given configuration with the given dial options, suitable for passing +// to utils/parallel.Try.Start. +func newWebsocketDialer(cfg *websocket.Config, opts DialOpts) func(<-chan struct{}) (io.Closer, error) { // TODO(katco): 2016-08-09: lp:1611427 openAttempt := utils.AttemptStrategy{ Total: opts.Timeout, @@ -517,7 +528,7 @@ default: } logger.Infof("dialing %q", cfg.Location) - conn, err := websocket.DialConfig(cfg) + conn, err := opts.DialWebsocket(cfg) if err == nil { return conn, nil } diff -Nru juju-core-2.0.0/src/github.com/juju/juju/api/apiclient_test.go juju-core-2.0.2/src/github.com/juju/juju/api/apiclient_test.go --- juju-core-2.0.0/src/github.com/juju/juju/api/apiclient_test.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/api/apiclient_test.go 2016-11-11 00:08:09.000000000 +0000 @@ -34,24 +34,24 @@ var _ = gc.Suite(&apiclientSuite{}) -func (s *apiclientSuite) TestConnectWebsocketToEnv(c *gc.C) { +func (s *apiclientSuite) TestDialAPIToEnv(c *gc.C) { info := s.APIInfo(c) - conn, _, err := api.ConnectWebsocket(info, api.DialOpts{}) + conn, _, err := api.DialAPI(info, api.DialOpts{}) c.Assert(err, jc.ErrorIsNil) defer conn.Close() - assertConnAddrForEnv(c, conn, info.Addrs[0], s.State.ModelUUID(), "/api") + assertConnAddrForModel(c, conn, info.Addrs[0], s.State.ModelUUID()) } -func (s *apiclientSuite) TestConnectWebsocketToRoot(c *gc.C) { +func (s *apiclientSuite) TestDialAPIToRoot(c *gc.C) { info := s.APIInfo(c) info.ModelTag = names.NewModelTag("") - conn, _, err := api.ConnectWebsocket(info, api.DialOpts{}) + conn, _, err := api.DialAPI(info, api.DialOpts{}) c.Assert(err, jc.ErrorIsNil) defer conn.Close() assertConnAddrForRoot(c, conn, info.Addrs[0]) } -func (s *apiclientSuite) TestConnectWebsocketMultiple(c *gc.C) { +func (s *apiclientSuite) TestDialAPIMultiple(c *gc.C) { // Create a socket that proxies to the API server. info := s.APIInfo(c) serverAddr := info.Addrs[0] @@ -60,22 +60,22 @@ // Check that we can use the proxy to connect. info.Addrs = []string{proxy.Addr()} - conn, _, err := api.ConnectWebsocket(info, api.DialOpts{}) + conn, _, err := api.DialAPI(info, api.DialOpts{}) c.Assert(err, jc.ErrorIsNil) conn.Close() - assertConnAddrForEnv(c, conn, proxy.Addr(), s.State.ModelUUID(), "/api") + assertConnAddrForModel(c, conn, proxy.Addr(), s.State.ModelUUID()) // Now break Addrs[0], and ensure that Addrs[1] // is successfully connected to. proxy.Close() info.Addrs = []string{proxy.Addr(), serverAddr} - conn, _, err = api.ConnectWebsocket(info, api.DialOpts{}) + conn, _, err = api.DialAPI(info, api.DialOpts{}) c.Assert(err, jc.ErrorIsNil) conn.Close() - assertConnAddrForEnv(c, conn, serverAddr, s.State.ModelUUID(), "/api") + assertConnAddrForModel(c, conn, serverAddr, s.State.ModelUUID()) } -func (s *apiclientSuite) TestConnectWebsocketMultipleError(c *gc.C) { +func (s *apiclientSuite) TestDialAPIMultipleError(c *gc.C) { listener, err := net.Listen("tcp", "127.0.0.1:0") c.Assert(err, jc.ErrorIsNil) defer listener.Close() @@ -94,7 +94,7 @@ info := s.APIInfo(c) addr := listener.Addr().String() info.Addrs = []string{addr, addr, addr} - _, _, err = api.ConnectWebsocket(info, api.DialOpts{}) + _, _, err = api.DialAPI(info, api.DialOpts{}) c.Assert(err, gc.ErrorMatches, `unable to connect to API: websocket.Dial wss://.*/model/[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}/api: .*`) c.Assert(atomic.LoadInt32(&count), gc.Equals, int32(3)) } @@ -153,14 +153,116 @@ } func (s *apiclientSuite) TestDialWebsocketStopped(c *gc.C) { - stopped := make(chan struct{}) f := api.NewWebsocketDialer(nil, api.DialOpts{}) + stopped := make(chan struct{}) close(stopped) result, err := f(stopped) c.Assert(err, gc.Equals, parallel.ErrStopped) c.Assert(result, gc.IsNil) } +type apiDialInfo struct { + location string + hasRootCAs bool + serverName string +} + +var openWithSNIHostnameTests = []struct { + about string + info *api.Info + expectDial apiDialInfo +}{{ + about: "no cert; DNS name - use SNI hostname", + info: &api.Info{ + Addrs: []string{"foo.com:1234"}, + SNIHostName: "foo.com", + SkipLogin: true, + }, + expectDial: apiDialInfo{ + location: "wss://foo.com:1234/api", + hasRootCAs: false, + serverName: "foo.com", + }, +}, { + about: "no cert; numeric IP address - use SNI hostname", + info: &api.Info{ + Addrs: []string{"0.1.2.3:1234"}, + SNIHostName: "foo.com", + SkipLogin: true, + }, + expectDial: apiDialInfo{ + location: "wss://0.1.2.3:1234/api", + hasRootCAs: false, + serverName: "foo.com", + }, +}, { + about: "with cert; DNS name - use cert", + info: &api.Info{ + Addrs: []string{"foo.com:1234"}, + SNIHostName: "foo.com", + SkipLogin: true, + CACert: jtesting.CACert, + }, + expectDial: apiDialInfo{ + location: "wss://foo.com:1234/api", + hasRootCAs: true, + serverName: "juju-apiserver", + }, +}, { + about: "with cert; numeric IP address - use cert", + info: &api.Info{ + Addrs: []string{"0.1.2.3:1234"}, + SNIHostName: "foo.com", + SkipLogin: true, + CACert: jtesting.CACert, + }, + expectDial: apiDialInfo{ + location: "wss://0.1.2.3:1234/api", + hasRootCAs: true, + serverName: "juju-apiserver", + }, +}} + +func (s *apiclientSuite) TestOpenWithSNIHostname(c *gc.C) { + for i, test := range openWithSNIHostnameTests { + c.Logf("test %d: %v", i, test.about) + s.testSNIHostName(c, test.info, test.expectDial) + } +} + +// testSNIHostName tests that when the API is dialed with the given info, +// api.newWebsocketDialer is called with the expected information. +func (s *apiclientSuite) testSNIHostName(c *gc.C, info *api.Info, expectDial apiDialInfo) { + dialed := make(chan *websocket.Config) + fakeDialer := func(cfg *websocket.Config) (*websocket.Conn, error) { + dialed <- cfg + return nil, errors.New("nope") + } + done := make(chan struct{}) + go func() { + defer close(done) + conn, err := api.Open(info, api.DialOpts{ + DialWebsocket: fakeDialer, + }) + c.Check(conn, gc.Equals, nil) + c.Check(err, gc.ErrorMatches, `unable to connect to API: nope`) + }() + select { + case cfg := <-dialed: + c.Check(cfg.Location.String(), gc.Equals, expectDial.location) + c.Assert(cfg.TlsConfig, gc.NotNil) + c.Check(cfg.TlsConfig.RootCAs != nil, gc.Equals, expectDial.hasRootCAs) + c.Check(cfg.TlsConfig.ServerName, gc.Equals, expectDial.serverName) + case <-time.After(jtesting.LongWait): + c.Fatalf("timed out waiting for dial") + } + select { + case <-done: + case <-time.After(jtesting.LongWait): + c.Fatalf("timed out waiting for API open") + } +} + func (s *apiclientSuite) TestOpenWithNoCACert(c *gc.C) { // This is hard to test as we have no way of affecting the system roots, // so instead we check that the error that we get implies that @@ -405,10 +507,10 @@ }, nil } -func assertConnAddrForEnv(c *gc.C, conn *websocket.Conn, addr, modelUUID, tail string) { - c.Assert(conn.RemoteAddr(), gc.Matches, "^wss://"+addr+"/model/"+modelUUID+tail+"$") +func assertConnAddrForModel(c *gc.C, conn *websocket.Conn, addr, modelUUID string) { + c.Assert(conn.RemoteAddr().String(), gc.Equals, "wss://"+addr+"/model/"+modelUUID+"/api") } func assertConnAddrForRoot(c *gc.C, conn *websocket.Conn, addr string) { - c.Assert(conn.RemoteAddr(), gc.Matches, "^wss://"+addr+"/api$") + c.Assert(conn.RemoteAddr().String(), gc.Matches, "wss://"+addr+"/api") } diff -Nru juju-core-2.0.0/src/github.com/juju/juju/api/applicationscaler/api.go juju-core-2.0.2/src/github.com/juju/juju/api/applicationscaler/api.go --- juju-core-2.0.0/src/github.com/juju/juju/api/applicationscaler/api.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/api/applicationscaler/api.go 2016-11-11 00:08:09.000000000 +0000 @@ -47,7 +47,7 @@ return w, nil } -// Rescale requests that all supplied service names be rescaled to +// Rescale requests that all supplied application names be rescaled to // their minimum configured sizes. It returns the first error it // encounters. func (api *API) Rescale(services []string) error { diff -Nru juju-core-2.0.0/src/github.com/juju/juju/api/certpool.go juju-core-2.0.2/src/github.com/juju/juju/api/certpool.go --- juju-core-2.0.0/src/github.com/juju/juju/api/certpool.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/api/certpool.go 2016-11-11 00:08:09.000000000 +0000 @@ -27,7 +27,7 @@ if caCert != "" { xcert, err := cert.ParseCert(caCert) if err != nil { - return nil, errors.Trace(err) + return nil, errors.Annotatef(err, "cannot parse certificate %q", caCert) } pool.AddCert(xcert) } diff -Nru juju-core-2.0.0/src/github.com/juju/juju/api/crossmodel/applicationdirectory.go juju-core-2.0.2/src/github.com/juju/juju/api/crossmodel/applicationdirectory.go --- juju-core-2.0.0/src/github.com/juju/juju/api/crossmodel/applicationdirectory.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/api/crossmodel/applicationdirectory.go 2016-11-11 00:08:09.000000000 +0000 @@ -0,0 +1,168 @@ +// Copyright 2015 Canonical Ltd. +// Licensed under the AGPLv3, see LICENCE file for details. + +package crossmodel + +import ( + "github.com/juju/errors" + "gopkg.in/juju/charm.v6-unstable" + "gopkg.in/juju/names.v2" + + "github.com/juju/juju/api/base" + "github.com/juju/juju/apiserver/params" + "github.com/juju/juju/core/crossmodel" +) + +// applicationOffersAPI allows access to a locally hosted application directory. +type applicationOffersAPI struct { + base.ClientFacade + facade base.FacadeCaller +} + +// ApplicationOffersAPI instances provides access to application offerings from external environments. +type ApplicationOffersAPI interface { + + // AddOffer adds a new application offering to a application directory. + // The offer's application URL scheme determines the directory to + // which the offer is added. + AddOffer(offer crossmodel.ApplicationOffer, users []string) error + + // List offers returns the offers contained in the specified directory, + // satisfying the specified filter. The directory is the same as the service + // URL scheme and is used to determine which backend to query. + ListOffers(directory string, filters ...crossmodel.ApplicationOfferFilter) ([]crossmodel.ApplicationOffer, error) +} + +// NewApplicationOffers creates a new client for accessing a controller application directory API. +func NewApplicationOffers(st base.APICallCloser) ApplicationOffersAPI { + frontend, backend := base.NewClientFacade(st, "ApplicationOffers") + return &applicationOffersAPI{ClientFacade: frontend, facade: backend} +} + +// TODO(wallyworld) - add Remove() and Update() + +// AddOffer adds a new application offering to the directory, able to be consumed by +// the specified users. +func (s *applicationOffersAPI) AddOffer(offer crossmodel.ApplicationOffer, users []string) error { + addOffer := params.AddApplicationOffer{ + ApplicationOffer: MakeParamsFromOffer(offer), + } + addOffer.UserTags = make([]string, len(users)) + for i, user := range users { + if !names.IsValidUserName(user) { + return errors.NotValidf("user name %q", user) + } + addOffer.UserTags[i] = names.NewUserTag(user).String() + } + offers := []params.AddApplicationOffer{addOffer} + + results := new(params.ErrorResults) + if err := s.facade.FacadeCall("AddOffers", params.AddApplicationOffers{Offers: offers}, results); err != nil { + return errors.Trace(err) + } + if len(results.Results) != 1 { + err := errors.Errorf("expected 1 result, got %d", len(results.Results)) + return errors.Trace(err) + } + if results.Results[0].Error == nil { + return nil + } + return results.Results[0].Error +} + +// MakeParamsFromOffer creates api parameters from a ApplicationOffer. +func MakeParamsFromOffer(offer crossmodel.ApplicationOffer) params.ApplicationOffer { + eps := make([]params.RemoteEndpoint, len(offer.Endpoints)) + for i, ep := range offer.Endpoints { + eps[i] = params.RemoteEndpoint{ + Name: ep.Name, + Interface: ep.Interface, + Role: ep.Role, + Limit: ep.Limit, + Scope: ep.Scope, + } + } + return params.ApplicationOffer{ + ApplicationURL: offer.ApplicationURL, + ApplicationName: offer.ApplicationName, + ApplicationDescription: offer.ApplicationDescription, + SourceModelTag: names.NewModelTag(offer.SourceModelUUID).String(), + SourceLabel: offer.SourceLabel, + Endpoints: eps, + } +} + +// List offers returns the offers satisfying the specified filter for the specified directory. +func (s *applicationOffersAPI) ListOffers(directory string, filters ...crossmodel.ApplicationOfferFilter) ([]crossmodel.ApplicationOffer, error) { + if directory == "" { + return nil, errors.New("application directory must be specified") + } + var filterParams params.OfferFilters + filterParams.Directory = directory + filterParams.Filters = make([]params.OfferFilter, len(filters)) + // TODO(wallyworld) - support or remove params.ApplicationOfferFilter.ServiceUser + for i, filter := range filters { + eps := make([]params.EndpointFilterAttributes, len(filter.Endpoints)) + for j, ep := range filter.Endpoints { + eps[j] = params.EndpointFilterAttributes{ + Name: ep.Name, + Interface: ep.Interface, + Role: ep.Role, + } + } + users := make([]string, len(filter.AllowedUsers)) + for j, user := range filter.AllowedUsers { + users[j] = names.NewUserTag(user).String() + } + filterParams.Filters[i] = params.OfferFilter{ + ApplicationURL: filter.ApplicationURL, + ApplicationName: filter.ApplicationName, + ApplicationDescription: filter.ApplicationDescription, + SourceLabel: filter.SourceLabel, + SourceModelUUIDTag: names.NewModelTag(filter.SourceModelUUID).String(), + Endpoints: eps, + AllowedUserTags: users, + } + } + results := new(params.ApplicationOfferResults) + if err := s.facade.FacadeCall("ListOffers", filterParams, results); err != nil { + return nil, errors.Trace(err) + } + if results.Error != nil { + return nil, results.Error + } + offers := make([]crossmodel.ApplicationOffer, len(results.Offers)) + for i, offer := range results.Offers { + var err error + if offers[i], err = MakeOfferFromParams(offer); err != nil { + return nil, errors.Annotatef(err, "invalid environment UUID for offer %v", offer) + } + } + return offers, nil +} + +// MakeOfferFromParams creates a ApplicationOffer from api parameters. +func MakeOfferFromParams(offer params.ApplicationOffer) (crossmodel.ApplicationOffer, error) { + eps := make([]charm.Relation, len(offer.Endpoints)) + for i, ep := range offer.Endpoints { + eps[i] = charm.Relation{ + Name: ep.Name, + Interface: ep.Interface, + Role: ep.Role, + Limit: ep.Limit, + Scope: ep.Scope, + } + } + envTag, err := names.ParseModelTag(offer.SourceModelTag) + if err != nil { + return crossmodel.ApplicationOffer{}, errors.Trace(err) + } + return crossmodel.ApplicationOffer{ + ApplicationURL: offer.ApplicationURL, + ApplicationName: offer.ApplicationName, + ApplicationDescription: offer.ApplicationDescription, + SourceModelUUID: envTag.Id(), + SourceLabel: offer.SourceLabel, + Endpoints: eps, + }, nil +} diff -Nru juju-core-2.0.0/src/github.com/juju/juju/api/crossmodel/applicationdirectory_test.go juju-core-2.0.2/src/github.com/juju/juju/api/crossmodel/applicationdirectory_test.go --- juju-core-2.0.0/src/github.com/juju/juju/api/crossmodel/applicationdirectory_test.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/api/crossmodel/applicationdirectory_test.go 2016-11-11 00:08:09.000000000 +0000 @@ -0,0 +1,302 @@ +// Copyright 2015 Canonical Ltd. +// Licensed under the AGPLv3, see LICENCE file for details. + +package crossmodel_test + +import ( + "github.com/juju/errors" + jc "github.com/juju/testing/checkers" + gc "gopkg.in/check.v1" + "gopkg.in/juju/charm.v6-unstable" + + basetesting "github.com/juju/juju/api/base/testing" + "github.com/juju/juju/api/crossmodel" + "github.com/juju/juju/apiserver/common" + "github.com/juju/juju/apiserver/params" + jujucrossmodel "github.com/juju/juju/core/crossmodel" + "github.com/juju/juju/testing" +) + +type serviceDirectorySuite struct { + testing.BaseSuite +} + +var _ = gc.Suite(&serviceDirectorySuite{}) + +func serviceForURLCaller(c *gc.C, offers []params.ApplicationOffer, err string) basetesting.APICallerFunc { + return basetesting.APICallerFunc( + func(objType string, + version int, + id, request string, + a, result interface{}, + ) error { + c.Check(objType, gc.Equals, "ApplicationOffers") + c.Check(id, gc.Equals, "") + c.Check(request, gc.Equals, "ListOffers") + + args, ok := a.(params.OfferFilters) + c.Assert(ok, jc.IsTrue) + c.Assert(args.Filters, gc.HasLen, 1) + + filter := args.Filters[0] + c.Check(filter.ApplicationURL, gc.DeepEquals, "local:/u/user/servicename") + c.Check(filter.AllowedUserTags, jc.SameContents, []string{"user-foo"}) + c.Check(filter.Endpoints, gc.HasLen, 0) + c.Check(filter.ApplicationName, gc.Equals, "") + c.Check(filter.ApplicationDescription, gc.Equals, "") + c.Check(filter.ApplicationUser, gc.Equals, "") + c.Check(filter.SourceLabel, gc.Equals, "") + + if results, ok := result.(*params.ApplicationOfferResults); ok { + results.Offers = offers + if err != "" { + results.Error = common.ServerError(errors.New(err)) + } + } + return nil + }) +} + +var fakeUUID = "df136476-12e9-11e4-8a70-b2227cce2b54" + +func (s *serviceDirectorySuite) TestServiceForURL(c *gc.C) { + endpoints := []params.RemoteEndpoint{ + { + Name: "db", + Role: charm.RoleProvider, + Interface: "mysql", + }, + } + offers := []params.ApplicationOffer{ + { + ApplicationURL: "local:/u/user/servicename", + ApplicationName: "service", + SourceModelTag: "model-" + fakeUUID, + Endpoints: endpoints, + }, + } + apiCaller := serviceForURLCaller(c, offers, "") + client := crossmodel.NewApplicationOffers(apiCaller) + result, err := jujucrossmodel.ApplicationOfferForURL(client, "local:/u/user/servicename", "foo") + c.Assert(err, jc.ErrorIsNil) + expectedOffer, err := crossmodel.MakeOfferFromParams(offers[0]) + c.Assert(err, jc.ErrorIsNil) + c.Assert(result, jc.DeepEquals, expectedOffer) +} + +func (s *serviceDirectorySuite) TestServiceForURLNoneOrNoAccess(c *gc.C) { + apiCaller := serviceForURLCaller(c, []params.ApplicationOffer{}, "") + client := crossmodel.NewApplicationOffers(apiCaller) + _, err := jujucrossmodel.ApplicationOfferForURL(client, "local:/u/user/servicename", "foo") + c.Assert(err, jc.Satisfies, errors.IsNotFound) +} + +func (s *serviceDirectorySuite) TestServiceForURLError(c *gc.C) { + apiCaller := serviceForURLCaller(c, nil, "error") + client := crossmodel.NewApplicationOffers(apiCaller) + _, err := jujucrossmodel.ApplicationOfferForURL(client, "local:/u/user/servicename", "foo") + c.Assert(err, gc.ErrorMatches, "error") +} + +func listOffersCaller(c *gc.C, offers []params.ApplicationOffer, err string) basetesting.APICallerFunc { + return basetesting.APICallerFunc( + func(objType string, + version int, + id, request string, + a, result interface{}, + ) error { + c.Check(objType, gc.Equals, "ApplicationOffers") + c.Check(id, gc.Equals, "") + c.Check(request, gc.Equals, "ListOffers") + + args, ok := a.(params.OfferFilters) + c.Assert(ok, jc.IsTrue) + c.Assert(args.Filters, gc.HasLen, 1) + + filter := args.Filters[0] + c.Check(filter.ApplicationName, gc.Equals, "service") + c.Check(filter.ApplicationDescription, gc.Equals, "description") + c.Check(filter.SourceModelUUIDTag, gc.Equals, "model-"+fakeUUID) + + if results, ok := result.(*params.ApplicationOfferResults); ok { + results.Offers = offers + if err != "" { + results.Error = common.ServerError(errors.New(err)) + } + } + return nil + }) +} + +func (s *serviceDirectorySuite) TestListOffers(c *gc.C) { + endpoints := []params.RemoteEndpoint{ + { + Name: "db", + Role: charm.RoleProvider, + Interface: "mysql", + }, + } + offers := []params.ApplicationOffer{ + { + ApplicationURL: "local:/u/user/servicename", + ApplicationName: "service", + SourceModelTag: "model-" + fakeUUID, + Endpoints: endpoints, + }, + } + apiCaller := listOffersCaller(c, offers, "") + client := crossmodel.NewApplicationOffers(apiCaller) + filter := jujucrossmodel.ApplicationOfferFilter{ + ApplicationOffer: jujucrossmodel.ApplicationOffer{ + ApplicationName: "service", + ApplicationDescription: "description", + SourceModelUUID: fakeUUID, + }, + } + result, err := client.ListOffers("local", filter) + c.Assert(err, jc.ErrorIsNil) + c.Assert(result, gc.HasLen, 1) + expectedOffer, err := crossmodel.MakeOfferFromParams(offers[0]) + c.Assert(err, jc.ErrorIsNil) + c.Assert(result[0], jc.DeepEquals, expectedOffer) +} + +func (s *serviceDirectorySuite) TestListOffersError(c *gc.C) { + apiCaller := listOffersCaller(c, nil, "error") + client := crossmodel.NewApplicationOffers(apiCaller) + filter := jujucrossmodel.ApplicationOfferFilter{ + ApplicationOffer: jujucrossmodel.ApplicationOffer{ + ApplicationName: "service", + ApplicationDescription: "description", + SourceModelUUID: fakeUUID, + }, + } + _, err := client.ListOffers("local", filter) + c.Assert(err, gc.ErrorMatches, "error") +} + +func (s *serviceDirectorySuite) TestListOffersNoDirectory(c *gc.C) { + apiCaller := listOffersCaller(c, nil, "error") + client := crossmodel.NewApplicationOffers(apiCaller) + _, err := client.ListOffers("", jujucrossmodel.ApplicationOfferFilter{}) + c.Assert(err, gc.ErrorMatches, "application directory must be specified") +} + +func addOffersCaller(c *gc.C, expectedOffers []params.AddApplicationOffer, err string) basetesting.APICallerFunc { + return basetesting.APICallerFunc( + func(objType string, + version int, + id, request string, + a, result interface{}, + ) error { + c.Check(objType, gc.Equals, "ApplicationOffers") + c.Check(id, gc.Equals, "") + c.Check(request, gc.Equals, "AddOffers") + + args, ok := a.(params.AddApplicationOffers) + c.Assert(ok, jc.IsTrue) + c.Assert(args.Offers, jc.DeepEquals, expectedOffers) + + if results, ok := result.(*params.ErrorResults); ok { + results.Results = make([]params.ErrorResult, len(expectedOffers)) + if err != "" { + results.Results[0].Error = common.ServerError(errors.New(err)) + } + } + return nil + }) +} + +func (s *serviceDirectorySuite) TestAddOffers(c *gc.C) { + endpoints := []params.RemoteEndpoint{ + { + Name: "db", + Role: charm.RoleProvider, + Interface: "mysql", + }, + } + offers := []params.AddApplicationOffer{ + { + ApplicationOffer: params.ApplicationOffer{ + ApplicationURL: "local:/u/user/servicename", + ApplicationName: "service", + SourceModelTag: "model-" + fakeUUID, + Endpoints: endpoints, + }, + UserTags: []string{"user-foo"}, + }, + } + apiCaller := addOffersCaller(c, offers, "") + client := crossmodel.NewApplicationOffers(apiCaller) + offerToAdd, err := crossmodel.MakeOfferFromParams(offers[0].ApplicationOffer) + c.Assert(err, jc.ErrorIsNil) + err = client.AddOffer(offerToAdd, []string{"foo"}) + c.Assert(err, jc.ErrorIsNil) +} + +func (s *serviceDirectorySuite) TestAddOffersError(c *gc.C) { + endpoints := []params.RemoteEndpoint{ + { + Name: "db", + Role: charm.RoleProvider, + Interface: "mysql", + }, + } + offers := []params.AddApplicationOffer{ + { + ApplicationOffer: params.ApplicationOffer{ + ApplicationURL: "local:/u/user/servicename", + ApplicationName: "service", + SourceModelTag: "model-" + fakeUUID, + Endpoints: endpoints, + }, + UserTags: []string{"user-foo"}, + }, + } + apiCaller := addOffersCaller(c, offers, "error") + client := crossmodel.NewApplicationOffers(apiCaller) + offerToAdd, err := crossmodel.MakeOfferFromParams(offers[0].ApplicationOffer) + c.Assert(err, jc.ErrorIsNil) + err = client.AddOffer(offerToAdd, []string{"foo"}) + c.Assert(err, gc.ErrorMatches, "error") +} + +func (s *serviceDirectorySuite) TestAddOffersInvalidUser(c *gc.C) { + apiCaller := addOffersCaller(c, nil, "") + client := crossmodel.NewApplicationOffers(apiCaller) + err := client.AddOffer(jujucrossmodel.ApplicationOffer{}, []string{"foo/23"}) + c.Assert(err, gc.ErrorMatches, `user name "foo/23" not valid`) +} + +func apiCallerWithError(c *gc.C, facadeName, apiName string) basetesting.APICallerFunc { + return basetesting.APICallerFunc( + func(objType string, + version int, + id, request string, + a, result interface{}, + ) error { + c.Check(objType, gc.Equals, facadeName) + c.Check(id, gc.Equals, "") + c.Check(request, gc.Equals, apiName) + + return errors.New("facade failure") + }) +} + +func (s *serviceDirectorySuite) TestServiceForURLFacadeCallError(c *gc.C) { + client := crossmodel.NewApplicationOffers(apiCallerWithError(c, "ApplicationOffers", "ListOffers")) + _, err := jujucrossmodel.ApplicationOfferForURL(client, "local:/u/user/servicename", "user") + c.Assert(errors.Cause(err), gc.ErrorMatches, "facade failure") +} + +func (s *serviceDirectorySuite) TestListOffersFacadeCallError(c *gc.C) { + client := crossmodel.NewApplicationOffers(apiCallerWithError(c, "ApplicationOffers", "ListOffers")) + _, err := client.ListOffers("local", jujucrossmodel.ApplicationOfferFilter{}) + c.Assert(errors.Cause(err), gc.ErrorMatches, "facade failure") +} + +func (s *serviceDirectorySuite) TestAddOfferFacadeCallError(c *gc.C) { + client := crossmodel.NewApplicationOffers(apiCallerWithError(c, "ApplicationOffers", "AddOffers")) + err := client.AddOffer(jujucrossmodel.ApplicationOffer{}, nil) + c.Assert(errors.Cause(err), gc.ErrorMatches, "facade failure") +} diff -Nru juju-core-2.0.0/src/github.com/juju/juju/api/crossmodel/client.go juju-core-2.0.2/src/github.com/juju/juju/api/crossmodel/client.go --- juju-core-2.0.0/src/github.com/juju/juju/api/crossmodel/client.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/api/crossmodel/client.go 2016-11-11 00:08:09.000000000 +0000 @@ -0,0 +1,170 @@ +// Copyright 2015 Canonical Ltd. +// Licensed under the AGPLv3, see LICENCE file for details. + +package crossmodel + +import ( + "github.com/juju/errors" + "gopkg.in/juju/charm.v6-unstable" + "gopkg.in/juju/names.v2" + + "github.com/juju/juju/api/base" + "github.com/juju/juju/apiserver/params" + "github.com/juju/juju/core/crossmodel" +) + +// Client allows access to the cross model management API end points. +type Client struct { + base.ClientFacade + facade base.FacadeCaller +} + +// NewClient creates a new client for accessing the cross model relations API. +func NewClient(st base.APICallCloser) *Client { + frontend, backend := base.NewClientFacade(st, "CrossModelRelations") + return &Client{ClientFacade: frontend, facade: backend} +} + +// Offer prepares application's endpoints for consumption. +func (c *Client) Offer(modelUUID, application string, endpoints []string, url string, desc string) ([]params.ErrorResult, error) { + offers := []params.ApplicationOfferParams{ + { + ModelTag: names.NewModelTag(modelUUID).String(), + ApplicationName: application, + ApplicationDescription: desc, + Endpoints: endpoints, + ApplicationURL: url, + }, + } + out := params.ErrorResults{} + if err := c.facade.FacadeCall("Offer", params.ApplicationOffersParams{Offers: offers}, &out); err != nil { + return nil, errors.Trace(err) + } + return out.Results, nil +} + +// ApplicationOffer returns offered remote application details for a given URL. +func (c *Client) ApplicationOffer(url string) (params.ApplicationOffer, error) { + found := params.ApplicationOffersResults{} + + err := c.facade.FacadeCall("ApplicationOffers", params.ApplicationURLs{[]string{url}}, &found) + if err != nil { + return params.ApplicationOffer{}, errors.Trace(err) + } + + result := found.Results + if len(result) != 1 { + return params.ApplicationOffer{}, errors.Errorf("expected to find one result for url %q but found %d", url, len(result)) + } + + theOne := result[0] + if theOne.Error != nil { + return params.ApplicationOffer{}, errors.Trace(theOne.Error) + } + return theOne.Result, nil +} + +// FindApplicationOffers returns all application offers matching the supplied filter. +func (c *Client) FindApplicationOffers(filters ...crossmodel.ApplicationOfferFilter) ([]params.ApplicationOffer, error) { + // We need at least one filter. The default filter will list all local applications. + if len(filters) == 0 { + return nil, errors.New("at least one filter must be specified") + } + var paramsFilter params.OfferFilterParams + for _, f := range filters { + urlParts, err := crossmodel.ParseApplicationURLParts(f.ApplicationURL) + if err != nil { + return nil, err + } + if urlParts.Directory == "" { + return nil, errors.Errorf("application offer filter needs a directory: %#v", f) + } + // TODO(wallyworld) - include allowed users + filterTerm := params.OfferFilter{ + ApplicationURL: f.ApplicationURL, + ApplicationName: f.ApplicationName, + ApplicationDescription: f.ApplicationDescription, + SourceLabel: f.SourceLabel, + } + if f.SourceModelUUID != "" { + filterTerm.SourceModelUUIDTag = names.NewModelTag(f.SourceModelUUID).String() + } + filterTerm.Endpoints = make([]params.EndpointFilterAttributes, len(f.Endpoints)) + for i, ep := range f.Endpoints { + filterTerm.Endpoints[i].Name = ep.Name + filterTerm.Endpoints[i].Interface = ep.Interface + filterTerm.Endpoints[i].Role = ep.Role + } + paramsFilter.Filters = append(paramsFilter.Filters, params.OfferFilters{ + Directory: urlParts.Directory, + Filters: []params.OfferFilter{filterTerm}, + }) + } + + out := params.FindApplicationOffersResults{} + err := c.facade.FacadeCall("FindApplicationOffers", paramsFilter, &out) + if err != nil { + return nil, errors.Trace(err) + } + + result := out.Results + // Since only one filters set was sent, expecting only one back + if len(result) != 1 { + return nil, errors.Errorf("expected to find one result but found %d", len(result)) + + } + + theOne := result[0] + if theOne.Error != nil { + return nil, errors.Trace(theOne.Error) + } + return theOne.Offers, nil +} + +// ListOffers gets all remote applications that have been offered from this Juju model. +// Each returned application satisfies at least one of the the specified filters. +func (c *Client) ListOffers(filters ...crossmodel.OfferedApplicationFilter) ([]crossmodel.OfferedApplicationDetailsResult, error) { + // TODO (anastasiamac 2015-11-23) translate a set of filters from crossmodel domain to params + offerFilters := make([]crossmodel.ApplicationOfferFilter, len(filters)) + for i, f := range filters { + offerFilters[i] = crossmodel.ApplicationOfferFilter{ + ApplicationOffer: crossmodel.ApplicationOffer{ + ApplicationURL: f.ApplicationURL, + ApplicationName: f.ApplicationName, + Endpoints: []charm.Relation{ + { + Name: f.Endpoint.Name, + Interface: f.Endpoint.Interface, + Role: f.Endpoint.Role, + }}, + }, + } + } + applicationOffers, err := c.FindApplicationOffers(offerFilters...) + if err != nil { + return nil, errors.Trace(err) + } + return convertListResultsToModel(applicationOffers), nil +} + +func convertListResultsToModel(items []params.ApplicationOffer) []crossmodel.OfferedApplicationDetailsResult { + result := make([]crossmodel.OfferedApplicationDetailsResult, len(items)) + for i, one := range items { + eps := make([]charm.Relation, len(one.Endpoints)) + for i, ep := range one.Endpoints { + eps[i] = charm.Relation{ + Name: ep.Name, + Role: ep.Role, + Interface: ep.Interface, + Scope: ep.Scope, + Limit: ep.Limit, + } + } + result[i].Result = &crossmodel.OfferedApplicationDetails{ + ApplicationName: one.ApplicationName, + ApplicationURL: one.ApplicationURL, + Endpoints: eps, + } + } + return result +} diff -Nru juju-core-2.0.0/src/github.com/juju/juju/api/crossmodel/client_test.go juju-core-2.0.2/src/github.com/juju/juju/api/crossmodel/client_test.go --- juju-core-2.0.0/src/github.com/juju/juju/api/crossmodel/client_test.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/api/crossmodel/client_test.go 2016-11-11 00:08:09.000000000 +0000 @@ -0,0 +1,421 @@ +// Copyright 2015 Canonical Ltd. +// Licensed under the AGPLv3, see LICENCE file for details. + +package crossmodel_test + +import ( + "fmt" + + "github.com/juju/errors" + jc "github.com/juju/testing/checkers" + gc "gopkg.in/check.v1" + "gopkg.in/juju/charm.v6-unstable" + + basetesting "github.com/juju/juju/api/base/testing" + "github.com/juju/juju/api/crossmodel" + "github.com/juju/juju/apiserver/common" + "github.com/juju/juju/apiserver/params" + model "github.com/juju/juju/core/crossmodel" + "github.com/juju/juju/testing" +) + +type crossmodelMockSuite struct { + testing.BaseSuite +} + +var _ = gc.Suite(&crossmodelMockSuite{}) + +func (s *crossmodelMockSuite) TestOffer(c *gc.C) { + application := "shared" + endPointA := "endPointA" + endPointB := "endPointB" + url := "url" + desc := "desc" + + msg := "fail" + apiCaller := basetesting.APICallerFunc( + func(objType string, + version int, + id, request string, + a, result interface{}, + ) error { + c.Check(objType, gc.Equals, "CrossModelRelations") + c.Check(id, gc.Equals, "") + c.Check(request, gc.Equals, "Offer") + + args, ok := a.(params.ApplicationOffersParams) + c.Assert(ok, jc.IsTrue) + c.Assert(args.Offers, gc.HasLen, 1) + + offer := args.Offers[0] + c.Assert(offer.ModelTag, gc.Equals, "model-uuid") + c.Assert(offer.ApplicationName, gc.DeepEquals, application) + c.Assert(offer.Endpoints, jc.SameContents, []string{endPointA, endPointB}) + c.Assert(offer.ApplicationURL, gc.DeepEquals, url) + c.Assert(offer.ApplicationDescription, gc.DeepEquals, desc) + + if results, ok := result.(*params.ErrorResults); ok { + all := make([]params.ErrorResult, len(args.Offers)) + // add one error to make sure it's catered for. + all = append(all, params.ErrorResult{ + Error: common.ServerError(errors.New(msg))}) + results.Results = all + } + + return nil + }) + + client := crossmodel.NewClient(apiCaller) + results, err := client.Offer("uuid", application, []string{endPointA, endPointB}, url, desc) + c.Assert(err, jc.ErrorIsNil) + c.Assert(results, gc.HasLen, 2) + c.Assert(results, jc.DeepEquals, + []params.ErrorResult{ + params.ErrorResult{}, + params.ErrorResult{Error: common.ServerError(errors.New(msg))}, + }) +} + +func (s *crossmodelMockSuite) TestOfferFacadeCallError(c *gc.C) { + msg := "facade failure" + apiCaller := basetesting.APICallerFunc( + func(objType string, + version int, + id, request string, + a, result interface{}, + ) error { + c.Check(objType, gc.Equals, "CrossModelRelations") + c.Check(id, gc.Equals, "") + c.Check(request, gc.Equals, "Offer") + + return errors.New(msg) + }) + client := crossmodel.NewClient(apiCaller) + results, err := client.Offer("", "", nil, "", "") + c.Assert(errors.Cause(err), gc.ErrorMatches, msg) + c.Assert(results, gc.IsNil) +} + +func (s *crossmodelMockSuite) TestShow(c *gc.C) { + url := "local:/u/fred/db2" + + desc := "IBM DB2 Express Server Edition is an entry level database system" + endpoints := []params.RemoteEndpoint{ + params.RemoteEndpoint{Name: "db2", Interface: "db2", Role: charm.RoleProvider}, + params.RemoteEndpoint{Name: "log", Interface: "http", Role: charm.RoleRequirer}, + } + applicationTag := "application-hosted-db2" + + called := false + + apiCaller := basetesting.APICallerFunc( + func(objType string, + version int, + id, request string, + a, result interface{}, + ) error { + called = true + + c.Check(objType, gc.Equals, "CrossModelRelations") + c.Check(id, gc.Equals, "") + c.Check(request, gc.Equals, "ApplicationOffers") + + args, ok := a.(params.ApplicationURLs) + c.Assert(ok, jc.IsTrue) + c.Assert(args.ApplicationURLs, gc.DeepEquals, []string{url}) + + if points, ok := result.(*params.ApplicationOffersResults); ok { + points.Results = []params.ApplicationOfferResult{ + {Result: params.ApplicationOffer{ + ApplicationDescription: desc, + Endpoints: endpoints, + ApplicationName: applicationTag, + }}, + } + } + return nil + }) + client := crossmodel.NewClient(apiCaller) + found, err := client.ApplicationOffer(url) + c.Assert(err, jc.ErrorIsNil) + + c.Assert(called, jc.IsTrue) + c.Assert(found, gc.DeepEquals, params.ApplicationOffer{ + ApplicationDescription: desc, + Endpoints: endpoints, + ApplicationName: applicationTag}) +} + +func (s *crossmodelMockSuite) TestShowURLError(c *gc.C) { + url := "local:/u/fred/db2" + msg := "facade failure" + + called := false + + apiCaller := basetesting.APICallerFunc( + func(objType string, + version int, + id, request string, + a, result interface{}, + ) error { + called = true + + c.Check(objType, gc.Equals, "CrossModelRelations") + c.Check(id, gc.Equals, "") + c.Check(request, gc.Equals, "ApplicationOffers") + + args, ok := a.(params.ApplicationURLs) + c.Assert(ok, jc.IsTrue) + c.Assert(args.ApplicationURLs, gc.DeepEquals, []string{url}) + + if points, ok := result.(*params.ApplicationOffersResults); ok { + points.Results = []params.ApplicationOfferResult{ + {Error: common.ServerError(errors.New(msg))}} + } + return nil + }) + client := crossmodel.NewClient(apiCaller) + found, err := client.ApplicationOffer(url) + + c.Assert(errors.Cause(err), gc.ErrorMatches, msg) + c.Assert(found, gc.DeepEquals, params.ApplicationOffer{}) + c.Assert(called, jc.IsTrue) +} + +func (s *crossmodelMockSuite) TestShowMultiple(c *gc.C) { + url := "local:/u/fred/db2" + + desc := "IBM DB2 Express Server Edition is an entry level database system" + endpoints := []params.RemoteEndpoint{ + params.RemoteEndpoint{Name: "db2", Interface: "db2", Role: charm.RoleProvider}, + params.RemoteEndpoint{Name: "log", Interface: "http", Role: charm.RoleRequirer}, + } + applicationTag := "application-hosted-db2" + + called := false + + apiCaller := basetesting.APICallerFunc( + func(objType string, + version int, + id, request string, + a, result interface{}, + ) error { + called = true + + c.Check(objType, gc.Equals, "CrossModelRelations") + c.Check(id, gc.Equals, "") + c.Check(request, gc.Equals, "ApplicationOffers") + + args, ok := a.(params.ApplicationURLs) + c.Assert(ok, jc.IsTrue) + c.Assert(args.ApplicationURLs, gc.DeepEquals, []string{url}) + + if points, ok := result.(*params.ApplicationOffersResults); ok { + points.Results = []params.ApplicationOfferResult{ + {Result: params.ApplicationOffer{ + ApplicationDescription: desc, + Endpoints: endpoints, + ApplicationName: applicationTag, + }}, + {Result: params.ApplicationOffer{ + ApplicationDescription: desc, + Endpoints: endpoints, + ApplicationName: applicationTag, + }}} + } + return nil + }) + client := crossmodel.NewClient(apiCaller) + found, err := client.ApplicationOffer(url) + c.Assert(err, gc.ErrorMatches, fmt.Sprintf(`expected to find one result for url %q but found 2`, url)) + c.Assert(found, gc.DeepEquals, params.ApplicationOffer{}) + + c.Assert(called, jc.IsTrue) +} + +func (s *crossmodelMockSuite) TestShowFacadeCallError(c *gc.C) { + url := "local:/u/fred/db2" + msg := "facade failure" + apiCaller := basetesting.APICallerFunc( + func(objType string, + version int, + id, request string, + a, result interface{}, + ) error { + c.Check(objType, gc.Equals, "CrossModelRelations") + c.Check(id, gc.Equals, "") + c.Check(request, gc.Equals, "ApplicationOffers") + + return errors.New(msg) + }) + client := crossmodel.NewClient(apiCaller) + found, err := client.ApplicationOffer(url) + c.Assert(errors.Cause(err), gc.ErrorMatches, msg) + c.Assert(found, gc.DeepEquals, params.ApplicationOffer{}) +} + +func (s *crossmodelMockSuite) TestFind(c *gc.C) { + directoryName := "local" + charmName := "db2" + applicationName := fmt.Sprintf("hosted-%s", charmName) + url := fmt.Sprintf("%s:/u/fred/%s", directoryName, applicationName) + endpoints := []params.RemoteEndpoint{{Name: "endPointA"}} + relations := []charm.Relation{{Name: "endPointA", Interface: "http"}} + + filter := model.ApplicationOfferFilter{ + ApplicationOffer: model.ApplicationOffer{ + ApplicationURL: fmt.Sprintf("%s:/u/fred/%s", directoryName, applicationName), + ApplicationName: fmt.Sprintf("hosted-%s", charmName), + Endpoints: relations, + }, + } + + called := false + apiCaller := basetesting.APICallerFunc( + func(objType string, + version int, + id, request string, + a, result interface{}, + ) error { + c.Check(objType, gc.Equals, "CrossModelRelations") + c.Check(id, gc.Equals, "") + c.Check(request, gc.Equals, "FindApplicationOffers") + + called = true + args, ok := a.(params.OfferFilterParams) + c.Assert(ok, jc.IsTrue) + c.Assert(args.Filters, gc.HasLen, 1) + c.Assert(args.Filters[0].Directory, gc.Equals, "local") + c.Assert(args.Filters[0].Filters, jc.DeepEquals, []params.OfferFilter{{ + ApplicationURL: filter.ApplicationURL, + ApplicationName: filter.ApplicationName, + Endpoints: []params.EndpointFilterAttributes{{ + Name: "endPointA", + Interface: "http", + }}, + }}) + + if results, ok := result.(*params.FindApplicationOffersResults); ok { + offer := params.ApplicationOffer{ + ApplicationURL: url, + ApplicationName: applicationName, + Endpoints: endpoints, + } + results.Results = []params.ApplicationOfferResults{{ + Offers: []params.ApplicationOffer{offer}, + }} + } + + return nil + }) + + client := crossmodel.NewClient(apiCaller) + results, err := client.FindApplicationOffers(filter) + c.Assert(err, jc.ErrorIsNil) + c.Assert(called, jc.IsTrue) + c.Assert(results, jc.DeepEquals, []params.ApplicationOffer{{ + ApplicationName: applicationName, + ApplicationURL: url, + Endpoints: endpoints, + }}) +} + +func (s *crossmodelMockSuite) TestFindNoFilter(c *gc.C) { + apiCaller := basetesting.APICallerFunc( + func(objType string, + version int, + id, request string, + a, result interface{}, + ) error { + c.Fail() + return nil + }) + + client := crossmodel.NewClient(apiCaller) + _, err := client.FindApplicationOffers() + c.Assert(err, gc.ErrorMatches, "at least one filter must be specified") +} + +func (s *crossmodelMockSuite) TestFindMultipleResults(c *gc.C) { + called := false + apiCaller := basetesting.APICallerFunc( + func(objType string, + version int, + id, request string, + a, result interface{}, + ) error { + c.Check(objType, gc.Equals, "CrossModelRelations") + c.Check(id, gc.Equals, "") + c.Check(request, gc.Equals, "FindApplicationOffers") + + called = true + if results, ok := result.(*params.FindApplicationOffersResults); ok { + results.Results = []params.ApplicationOfferResults{{}, {}} + } + + return nil + }) + + client := crossmodel.NewClient(apiCaller) + filter := model.ApplicationOfferFilter{ + ApplicationOffer: model.ApplicationOffer{ApplicationURL: "local:"}, + } + _, err := client.FindApplicationOffers(filter) + c.Assert(errors.Cause(err), gc.ErrorMatches, ".*expected to find one result but found 2.*") + c.Assert(called, jc.IsTrue) +} + +func (s *crossmodelMockSuite) TestFindError(c *gc.C) { + msg := "find failure" + called := false + apiCaller := basetesting.APICallerFunc( + func(objType string, + version int, + id, request string, + a, result interface{}, + ) error { + c.Check(objType, gc.Equals, "CrossModelRelations") + c.Check(id, gc.Equals, "") + c.Check(request, gc.Equals, "FindApplicationOffers") + + called = true + if results, ok := result.(*params.FindApplicationOffersResults); ok { + results.Results = []params.ApplicationOfferResults{{ + Error: common.ServerError(errors.New(msg)), + }} + } + + return nil + }) + + client := crossmodel.NewClient(apiCaller) + filter := model.ApplicationOfferFilter{ + ApplicationOffer: model.ApplicationOffer{ApplicationURL: "local:"}, + } + _, err := client.FindApplicationOffers(filter) + c.Assert(errors.Cause(err), gc.ErrorMatches, msg) + c.Assert(called, jc.IsTrue) +} + +func (s *crossmodelMockSuite) TestFindFacadeCallError(c *gc.C) { + msg := "facade failure" + apiCaller := basetesting.APICallerFunc( + func(objType string, + version int, + id, request string, + a, result interface{}, + ) error { + c.Check(objType, gc.Equals, "CrossModelRelations") + c.Check(id, gc.Equals, "") + c.Check(request, gc.Equals, "FindApplicationOffers") + + return errors.New(msg) + }) + client := crossmodel.NewClient(apiCaller) + filter := model.ApplicationOfferFilter{ + ApplicationOffer: model.ApplicationOffer{ApplicationURL: "local:"}, + } + results, err := client.FindApplicationOffers(filter) + c.Assert(errors.Cause(err), gc.ErrorMatches, msg) + c.Assert(results, gc.IsNil) +} diff -Nru juju-core-2.0.0/src/github.com/juju/juju/api/crossmodel/offeredapplications.go juju-core-2.0.2/src/github.com/juju/juju/api/crossmodel/offeredapplications.go --- juju-core-2.0.0/src/github.com/juju/juju/api/crossmodel/offeredapplications.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/api/crossmodel/offeredapplications.go 2016-11-11 00:08:09.000000000 +0000 @@ -0,0 +1,104 @@ +// Copyright 2015 Canonical Ltd. +// Licensed under the AGPLv3, see LICENCE file for details. + +package crossmodel + +import ( + "github.com/juju/errors" + + "github.com/juju/juju/api/base" + apiwatcher "github.com/juju/juju/api/watcher" + "github.com/juju/juju/apiserver/params" + "github.com/juju/juju/core/crossmodel" + "github.com/juju/juju/watcher" +) + +// offeredApplicationsAPI allows access to a services exported from the environment. +type offeredApplicationsAPI struct { + base.ClientFacade + facade base.FacadeCaller +} + +// OfferedApplicationAPI provides access to application offerings from this environment. +type OfferedApplicationAPI interface { + + // OfferedApplications returns the offered applications for the specified urls. + // The results and any errors are keyed by URL. + OfferedApplications(applicationURLs ...string) (map[string]crossmodel.OfferedApplication, map[string]error, error) + + // WatchOfferedApplications starts a watcher for changes to the offered + // services from this environment. + WatchOfferedApplications() (watcher.StringsWatcher, error) +} + +// NewOfferedApplications creates a new client for accessing an offered applications API. +func NewOfferedApplications(st base.APICallCloser) OfferedApplicationAPI { + frontend, backend := base.NewClientFacade(st, "OfferedApplications") + return &offeredApplicationsAPI{ClientFacade: frontend, facade: backend} +} + +// OfferedApplications returns the offered applications for the specified urls. +// The results and any errors are keyed by URL. +func (s *offeredApplicationsAPI) OfferedApplications(applicationURLs ...string) (map[string]crossmodel.OfferedApplication, map[string]error, error) { + if len(applicationURLs) == 0 { + return nil, nil, errors.New("no application URLs specified") + } + var queryParams params.ApplicationURLs + queryParams.ApplicationURLs = make([]string, len(applicationURLs)) + for i, url := range applicationURLs { + queryParams.ApplicationURLs[i] = url + } + results := new(params.OfferedApplicationResults) + if err := s.facade.FacadeCall("OfferedApplications", queryParams, results); err != nil { + return nil, nil, errors.Trace(err) + } + if len(results.Results) != len(applicationURLs) { + return nil, nil, errors.Errorf("expected %d results, got %d", len(applicationURLs), len(results.Results)) + } + offers := make(map[string]crossmodel.OfferedApplication) + offerErrors := make(map[string]error) + for i, result := range results.Results { + applicationURL := applicationURLs[i] + if result.Error != nil { + if result.Error.ErrorCode() == params.CodeNotFound { + offerErrors[applicationURL] = errors.NotFoundf("offered application at %q", applicationURLs[i]) + } else { + offerErrors[applicationURL] = errors.Annotatef(result.Error, "error retrieving offer at %q", applicationURLs[i]) + } + continue + } + offers[result.Result.ApplicationURL] = MakeOfferedApplicationFromParams(result.Result) + } + return offers, offerErrors, nil +} + +// MakeOfferedApplicationFromParams creates an OfferedApplication from api parameters. +func MakeOfferedApplicationFromParams(offer params.OfferedApplication) crossmodel.OfferedApplication { + eps := make(map[string]string, len(offer.Endpoints)) + for k, v := range offer.Endpoints { + eps[k] = v + } + return crossmodel.OfferedApplication{ + ApplicationURL: offer.ApplicationURL, + ApplicationName: offer.ApplicationName, + CharmName: offer.CharmName, + Description: offer.Description, + Registered: offer.Registered, + Endpoints: eps, + } +} + +// WatchOfferedApplications starts a watcher for changes to the offered +// services from this environment. +func (s *offeredApplicationsAPI) WatchOfferedApplications() (watcher.StringsWatcher, error) { + var result params.StringsWatchResult + err := s.facade.FacadeCall("WatchOfferedApplications", nil, &result) + if err != nil { + return nil, err + } + if result.Error != nil { + return nil, result.Error + } + w := apiwatcher.NewStringsWatcher(s.facade.RawAPICaller(), result) + return w, nil +} diff -Nru juju-core-2.0.0/src/github.com/juju/juju/api/crossmodel/offeredapplications_test.go juju-core-2.0.2/src/github.com/juju/juju/api/crossmodel/offeredapplications_test.go --- juju-core-2.0.0/src/github.com/juju/juju/api/crossmodel/offeredapplications_test.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/api/crossmodel/offeredapplications_test.go 2016-11-11 00:08:09.000000000 +0000 @@ -0,0 +1,139 @@ +// Copyright 2015 Canonical Ltd. +// Licensed under the AGPLv3, see LICENCE file for details. + +package crossmodel_test + +import ( + "github.com/juju/errors" + jc "github.com/juju/testing/checkers" + gc "gopkg.in/check.v1" + + basetesting "github.com/juju/juju/api/base/testing" + "github.com/juju/juju/api/crossmodel" + "github.com/juju/juju/apiserver/common" + "github.com/juju/juju/apiserver/params" + "github.com/juju/juju/testing" +) + +type offeredApplicationsSuite struct { + testing.BaseSuite +} + +var _ = gc.Suite(&offeredApplicationsSuite{}) + +func offeredApplicationsCaller(c *gc.C, offers []params.OfferedApplication, err string) basetesting.APICallerFunc { + return basetesting.APICallerFunc( + func(objType string, + version int, + id, request string, + a, result interface{}, + ) error { + c.Check(objType, gc.Equals, "OfferedApplications") + c.Check(id, gc.Equals, "") + c.Check(request, gc.Equals, "OfferedApplications") + + args, ok := a.(params.ApplicationURLs) + c.Assert(ok, jc.IsTrue) + + url := args.ApplicationURLs[0] + c.Check(url, gc.DeepEquals, "local:/u/user/servicename") + + offersByURL := make(map[string]params.OfferedApplication) + for _, offer := range offers { + offersByURL[offer.ApplicationURL] = offer + } + if results, ok := result.(*params.OfferedApplicationResults); ok { + results.Results = make([]params.OfferedApplicationResult, len(args.ApplicationURLs)) + for i, url := range args.ApplicationURLs { + if err != "" { + results.Results[i].Error = common.ServerError(errors.New(err)) + continue + } + if offer, ok := offersByURL[url]; ok { + results.Results[i].Result = offer + } else { + results.Results[i].Error = common.ServerError(errors.NotFoundf("offfer at url %q", url)) + } + } + } + return nil + }) +} + +func (s *offeredApplicationsSuite) TestOfferedApplications(c *gc.C) { + offers := []params.OfferedApplication{ + { + ApplicationURL: "local:/u/user/servicename", + ApplicationName: "service", + CharmName: "charm", + Description: "description", + Endpoints: map[string]string{"foo": "bar"}, + Registered: true, + }, + } + apiCaller := offeredApplicationsCaller(c, offers, "") + client := crossmodel.NewOfferedApplications(apiCaller) + result, offerErrors, err := client.OfferedApplications("local:/u/user/servicename") + c.Assert(err, jc.ErrorIsNil) + c.Assert(result, gc.HasLen, 1) + c.Assert(offerErrors, gc.HasLen, 0) + expectedOffer := crossmodel.MakeOfferedApplicationFromParams(offers[0]) + c.Assert(result["local:/u/user/servicename"], jc.DeepEquals, expectedOffer) +} + +func (s *offeredApplicationsSuite) TestOfferedApplicationsNotFound(c *gc.C) { + apiCaller := offeredApplicationsCaller(c, nil, "") + client := crossmodel.NewOfferedApplications(apiCaller) + result, offerErrors, err := client.OfferedApplications("local:/u/user/servicename") + c.Assert(err, jc.ErrorIsNil) + c.Assert(result, gc.HasLen, 0) + c.Assert(offerErrors, gc.HasLen, 1) + c.Assert(offerErrors["local:/u/user/servicename"], jc.Satisfies, errors.IsNotFound) +} + +func (s *offeredApplicationsSuite) TestOfferedApplicationsError(c *gc.C) { + apiCaller := offeredApplicationsCaller(c, nil, "error") + client := crossmodel.NewOfferedApplications(apiCaller) + _, offerErrors, err := client.OfferedApplications("local:/u/user/servicename") + c.Assert(err, jc.ErrorIsNil) + c.Assert(offerErrors, gc.HasLen, 1) + c.Assert(offerErrors["local:/u/user/servicename"], gc.ErrorMatches, `error retrieving offer at "local:/u/user/servicename": error`) +} + +func watchOfferedApplicationsCaller(c *gc.C, err string) basetesting.APICallerFunc { + return basetesting.APICallerFunc( + func(objType string, + version int, + id, request string, + a, result interface{}, + ) error { + c.Check(objType, gc.Equals, "OfferedApplications") + c.Check(id, gc.Equals, "") + c.Check(request, gc.Equals, "WatchOfferedApplications") + c.Assert(a, gc.IsNil) + + if result, ok := result.(*params.StringsWatchResult); ok { + result.Error = ¶ms.Error{Message: "fail"} + } + return nil + }) +} + +func (s *offeredApplicationsSuite) TestWatchOfferedApplications(c *gc.C) { + apiCaller := watchOfferedApplicationsCaller(c, "") + client := crossmodel.NewOfferedApplications(apiCaller) + _, err := client.WatchOfferedApplications() + c.Assert(err, gc.ErrorMatches, "fail") +} + +func (s *offeredApplicationsSuite) TestWatchOfferedApplicationsFacadeCallError(c *gc.C) { + client := crossmodel.NewOfferedApplications(apiCallerWithError(c, "OfferedApplications", "WatchOfferedApplications")) + _, err := client.WatchOfferedApplications() + c.Assert(errors.Cause(err), gc.ErrorMatches, "facade failure") +} + +func (s *offeredApplicationsSuite) TestOfferedApplicationsFacadeCallError(c *gc.C) { + client := crossmodel.NewOfferedApplications(apiCallerWithError(c, "OfferedApplications", "OfferedApplications")) + _, _, err := client.OfferedApplications("url") + c.Assert(errors.Cause(err), gc.ErrorMatches, "facade failure") +} diff -Nru juju-core-2.0.0/src/github.com/juju/juju/api/crossmodel/package_test.go juju-core-2.0.2/src/github.com/juju/juju/api/crossmodel/package_test.go --- juju-core-2.0.0/src/github.com/juju/juju/api/crossmodel/package_test.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/api/crossmodel/package_test.go 2016-11-11 00:08:09.000000000 +0000 @@ -0,0 +1,14 @@ +// Copyright 2015 Canonical Ltd. +// Licensed under the AGPLv3, see LICENCE file for details. + +package crossmodel_test + +import ( + "testing" + + gc "gopkg.in/check.v1" +) + +func TestAll(t *testing.T) { + gc.TestingT(t) +} diff -Nru juju-core-2.0.0/src/github.com/juju/juju/api/export_test.go juju-core-2.0.2/src/github.com/juju/juju/api/export_test.go --- juju-core-2.0.0/src/github.com/juju/juju/api/export_test.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/api/export_test.go 2016-11-11 00:08:09.000000000 +0000 @@ -12,14 +12,13 @@ ) var ( - CertDir = &certDir - NewWebsocketDialer = newWebsocketDialer - NewWebsocketDialerPtr = &newWebsocketDialer - WebsocketDialConfig = &websocketDialConfig - SlideAddressToFront = slideAddressToFront - BestVersion = bestVersion - FacadeVersions = &facadeVersions - ConnectWebsocket = connectWebsocket + CertDir = &certDir + NewWebsocketDialer = newWebsocketDialer + WebsocketDialConfig = &websocketDialConfig + SlideAddressToFront = slideAddressToFront + BestVersion = bestVersion + FacadeVersions = &facadeVersions + DialAPI = dialAPI ) // RPCConnection defines the methods that are called on the rpc.Conn instance. diff -Nru juju-core-2.0.0/src/github.com/juju/juju/api/facadeversions.go juju-core-2.0.2/src/github.com/juju/juju/api/facadeversions.go --- juju-core-2.0.0/src/github.com/juju/juju/api/facadeversions.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/api/facadeversions.go 2016-11-11 00:08:09.000000000 +0000 @@ -17,8 +17,10 @@ "AllModelWatcher": 2, "AllWatcher": 1, "Annotations": 2, - "Application": 2, + "Application": 3, "ApplicationScaler": 1, + "ApplicationOffers": 1, + "ApplicationRelationsWatcher": 1, "Backups": 1, "Block": 2, "Bundle": 1, @@ -28,6 +30,7 @@ "Client": 1, "Cloud": 1, "Controller": 3, + "CrossModelRelations": 1, "Deployer": 1, "DiscoverSpaces": 2, "DiskManager": 2, @@ -61,6 +64,7 @@ "ModelConfig": 1, "ModelManager": 2, "NotifyWatcher": 1, + "OfferedApplications": 1, "Payloads": 1, "PayloadsHookContext": 1, "Pinger": 1, @@ -68,13 +72,14 @@ "ProxyUpdater": 1, "Reboot": 2, "RelationUnitsWatcher": 1, + "RemoteRelations": 1, "Resources": 1, "ResourcesHookContext": 1, "Resumer": 2, "RetryStrategy": 1, "Singular": 1, "Spaces": 2, - "SSHClient": 1, + "SSHClient": 2, "StatusHistory": 2, "Storage": 3, "StorageProvisioner": 3, diff -Nru juju-core-2.0.0/src/github.com/juju/juju/api/facadeversions_test.go juju-core-2.0.2/src/github.com/juju/juju/api/facadeversions_test.go --- juju-core-2.0.0/src/github.com/juju/juju/api/facadeversions_test.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/api/facadeversions_test.go 2016-11-11 00:08:09.000000000 +0000 @@ -11,6 +11,7 @@ "github.com/juju/juju/api" "github.com/juju/juju/apiserver/common" "github.com/juju/juju/component/all" + "github.com/juju/juju/feature" coretesting "github.com/juju/juju/testing" ) @@ -20,6 +21,11 @@ var _ = gc.Suite(&facadeVersionSuite{}) +func (s *facadeVersionSuite) SetUpTest(c *gc.C) { + s.SetInitialFeatureFlags(feature.CrossModelRelations) + s.BaseSuite.SetUpTest(c) +} + func (s *facadeVersionSuite) TestFacadeVersionsMatchServerVersions(c *gc.C) { // The client side code doesn't want to directly import the server side // code just to list out what versions are available. However, we do diff -Nru juju-core-2.0.0/src/github.com/juju/juju/api/firewaller/service.go juju-core-2.0.2/src/github.com/juju/juju/api/firewaller/service.go --- juju-core-2.0.0/src/github.com/juju/juju/api/firewaller/service.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/api/firewaller/service.go 2016-11-11 00:08:09.000000000 +0000 @@ -20,7 +20,7 @@ life params.Life } -// Name returns the service name. +// Name returns the application name. func (s *Application) Name() string { return s.tag.Id() } diff -Nru juju-core-2.0.0/src/github.com/juju/juju/api/interface.go juju-core-2.0.2/src/github.com/juju/juju/api/interface.go --- juju-core-2.0.0/src/github.com/juju/juju/api/interface.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/api/interface.go 2016-11-11 00:08:09.000000000 +0000 @@ -9,6 +9,7 @@ "github.com/juju/errors" "github.com/juju/version" + "golang.org/x/net/websocket" "gopkg.in/juju/names.v2" "gopkg.in/macaroon-bakery.v1/httpbakery" "gopkg.in/macaroon.v1" @@ -36,6 +37,12 @@ // Addrs holds the addresses of the controllers. Addrs []string + // SNIHostName optionally holds the host name to use for + // server name indication (SNI) when connecting + // to the addresses in Addrs above. If CACert is non-empty, + // this field is ignored. + SNIHostName string + // CACert holds the CA certificate that will be used // to validate the controller's certificate, in PEM format. // If this is empty, the standard system root certificates @@ -134,6 +141,15 @@ // be used in tests, or when verification cannot be // performed and the communication need not be secure. InsecureSkipVerify bool + + // DialWebsocket is used to make connections to API servers. + // It will be called with a websocket URL to connect to, + // and the TLS configuration to use to secure the connection. + // + // If DialWebsocket is nil, webaocket.DialConfig will be used. + // + // This field is provided for testing purposes only. + DialWebsocket func(cfg *websocket.Config) (*websocket.Conn, error) } // DefaultDialOpts returns a DialOpts representing the default diff -Nru juju-core-2.0.0/src/github.com/juju/juju/api/monitor_internal_test.go juju-core-2.0.2/src/github.com/juju/juju/api/monitor_internal_test.go --- juju-core-2.0.0/src/github.com/juju/juju/api/monitor_internal_test.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/api/monitor_internal_test.go 2016-11-11 00:08:09.000000000 +0000 @@ -10,7 +10,7 @@ "github.com/juju/testing" gc "gopkg.in/check.v1" - jjtesting "github.com/juju/juju/testing" + jtesting "github.com/juju/juju/testing" ) var _ = gc.Suite(&MonitorSuite{}) @@ -108,7 +108,7 @@ func assertEvent(c *gc.C, ch <-chan struct{}) { select { case <-ch: - case <-time.After(jjtesting.LongWait): + case <-time.After(jtesting.LongWait): c.Fatal("timed out waiting for channel event") } } diff -Nru juju-core-2.0.0/src/github.com/juju/juju/api/remoterelations/package_test.go juju-core-2.0.2/src/github.com/juju/juju/api/remoterelations/package_test.go --- juju-core-2.0.0/src/github.com/juju/juju/api/remoterelations/package_test.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/api/remoterelations/package_test.go 2016-11-11 00:08:09.000000000 +0000 @@ -0,0 +1,14 @@ +// Copyright 2015 Canonical Ltd. +// Licensed under the AGPLv3, see LICENCE file for details. + +package remoterelations_test + +import ( + stdtesting "testing" + + gc "gopkg.in/check.v1" +) + +func TestAll(t *stdtesting.T) { + gc.TestingT(t) +} diff -Nru juju-core-2.0.0/src/github.com/juju/juju/api/remoterelations/remoterelations.go juju-core-2.0.2/src/github.com/juju/juju/api/remoterelations/remoterelations.go --- juju-core-2.0.0/src/github.com/juju/juju/api/remoterelations/remoterelations.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/api/remoterelations/remoterelations.go 2016-11-11 00:08:09.000000000 +0000 @@ -0,0 +1,72 @@ +// Copyright 2015 Canonical Ltd. +// Licensed under the AGPLv3, see LICENCE file for details. + +package remoterelations + +import ( + "github.com/juju/errors" + "gopkg.in/juju/names.v2" + + "github.com/juju/juju/api/base" + apiwatcher "github.com/juju/juju/api/watcher" + "github.com/juju/juju/apiserver/params" + "github.com/juju/juju/watcher" +) + +const remoteRelationsFacade = "RemoteRelations" + +// State provides access to a remoterelations's view of the state. +type State struct { + facade base.FacadeCaller +} + +// NewState creates a new client-side RemoteRelations facade. +func NewState(caller base.APICaller) *State { + facadeCaller := base.NewFacadeCaller(caller, remoteRelationsFacade) + return &State{facadeCaller} +} + +// WatchRemoteApplications returns a strings watcher that notifies of the addition, +// removal, and lifecycle changes of remote applications in the model. +func (st *State) WatchRemoteApplications() (watcher.StringsWatcher, error) { + var result params.StringsWatchResult + err := st.facade.FacadeCall("WatchRemoteApplications", nil, &result) + if err != nil { + return nil, err + } + if result.Error != nil { + return nil, result.Error + } + w := apiwatcher.NewStringsWatcher(st.facade.RawAPICaller(), result) + return w, nil +} + +// WatchRemoteApplication returns application relations watchers that delivers +// changes according to the addition, removal, and lifecycle changes of +// relations that the specified remote application is involved in; and also +// according to the entering, departing, and change of unit settings in +// those relations. +func (st *State) WatchRemoteApplication(service string) (watcher.ApplicationRelationsWatcher, error) { + if !names.IsValidApplication(service) { + return nil, errors.NotValidf("application name %q", service) + } + serviceTag := names.NewApplicationTag(service) + args := params.Entities{ + Entities: []params.Entity{{Tag: serviceTag.String()}}, + } + + var results params.ApplicationRelationsWatchResults + err := st.facade.FacadeCall("WatchRemoteApplication", args, &results) + if err != nil { + return nil, err + } + if len(results.Results) != 1 { + return nil, errors.Errorf("expected 1 result, got %d", len(results.Results)) + } + result := results.Results[0] + if result.Error != nil { + return nil, result.Error + } + w := apiwatcher.NewApplicationRelationsWatcher(st.facade.RawAPICaller(), result) + return w, nil +} diff -Nru juju-core-2.0.0/src/github.com/juju/juju/api/remoterelations/remoterelations_test.go juju-core-2.0.2/src/github.com/juju/juju/api/remoterelations/remoterelations_test.go --- juju-core-2.0.0/src/github.com/juju/juju/api/remoterelations/remoterelations_test.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/api/remoterelations/remoterelations_test.go 2016-11-11 00:08:09.000000000 +0000 @@ -0,0 +1,78 @@ +// Copyright 2015 Canonical Ltd. +// Licensed under the AGPLv3, see LICENCE file for details. + +package remoterelations_test + +import ( + gc "gopkg.in/check.v1" + + "github.com/juju/juju/api/base/testing" + "github.com/juju/juju/api/remoterelations" + "github.com/juju/juju/apiserver/params" + coretesting "github.com/juju/juju/testing" +) + +var _ = gc.Suite(&remoteRelationsSuite{}) + +type remoteRelationsSuite struct { + coretesting.BaseSuite +} + +func (s *remoteRelationsSuite) TestNewState(c *gc.C) { + apiCaller := testing.APICallerFunc(func(objType string, version int, id, request string, arg, result interface{}) error { + return nil + }) + st := remoterelations.NewState(apiCaller) + c.Assert(st, gc.NotNil) +} + +func (s *remoteRelationsSuite) TestWatchRemoteApplications(c *gc.C) { + var callCount int + apiCaller := testing.APICallerFunc(func(objType string, version int, id, request string, arg, result interface{}) error { + c.Check(objType, gc.Equals, "RemoteRelations") + c.Check(version, gc.Equals, 0) + c.Check(id, gc.Equals, "") + c.Check(request, gc.Equals, "WatchRemoteApplications") + c.Assert(result, gc.FitsTypeOf, ¶ms.StringsWatchResult{}) + *(result.(*params.StringsWatchResult)) = params.StringsWatchResult{ + Error: ¶ms.Error{Message: "FAIL"}, + } + callCount++ + return nil + }) + st := remoterelations.NewState(apiCaller) + _, err := st.WatchRemoteApplications() + c.Check(err, gc.ErrorMatches, "FAIL") + c.Check(callCount, gc.Equals, 1) +} + +func (s *remoteRelationsSuite) TestWatchRemoteApplication(c *gc.C) { + var callCount int + apiCaller := testing.APICallerFunc(func(objType string, version int, id, request string, arg, result interface{}) error { + c.Check(objType, gc.Equals, "RemoteRelations") + c.Check(version, gc.Equals, 0) + c.Check(id, gc.Equals, "") + c.Check(request, gc.Equals, "WatchRemoteApplication") + c.Assert(result, gc.FitsTypeOf, ¶ms.ApplicationRelationsWatchResults{}) + *(result.(*params.ApplicationRelationsWatchResults)) = params.ApplicationRelationsWatchResults{ + Results: []params.ApplicationRelationsWatchResult{{ + Error: ¶ms.Error{Message: "FAIL"}, + }}, + } + callCount++ + return nil + }) + st := remoterelations.NewState(apiCaller) + _, err := st.WatchRemoteApplication("db2") + c.Check(err, gc.ErrorMatches, "FAIL") + c.Check(callCount, gc.Equals, 1) +} + +func (s *remoteRelationsSuite) TestWatchRemoteApplicationInvalidService(c *gc.C) { + apiCaller := testing.APICallerFunc(func(objType string, version int, id, request string, arg, result interface{}) error { + return nil + }) + st := remoterelations.NewState(apiCaller) + _, err := st.WatchRemoteApplication("!@#") + c.Assert(err, gc.ErrorMatches, `application name "!@#" not valid`) +} diff -Nru juju-core-2.0.0/src/github.com/juju/juju/api/sshclient/facade.go juju-core-2.0.2/src/github.com/juju/juju/api/sshclient/facade.go --- juju-core-2.0.0/src/github.com/juju/juju/api/sshclient/facade.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/api/sshclient/facade.go 2016-11-11 00:08:09.000000000 +0000 @@ -39,6 +39,27 @@ return addr, errors.Trace(err) } +// AllAddresses returns all addresses for the SSH target provided. The target +// may be provided as a machine ID or unit name. +func (facade *Facade) AllAddresses(target string) ([]string, error) { + entities, err := targetToEntities(target) + if err != nil { + return nil, errors.Trace(err) + } + var out params.SSHAddressesResults + err = facade.caller.FacadeCall("AllAddresses", entities, &out) + if err != nil { + return nil, errors.Trace(err) + } + if len(out.Results) != 1 { + return nil, countError(len(out.Results)) + } + if err := out.Results[0].Error; err != nil { + return nil, errors.Trace(err) + } + return out.Results[0].Addresses, nil +} + func (facade *Facade) addressCall(callName, target string) (string, error) { entities, err := targetToEntities(target) if err != nil { diff -Nru juju-core-2.0.0/src/github.com/juju/juju/api/sshclient/facade_test.go juju-core-2.0.2/src/github.com/juju/juju/api/sshclient/facade_test.go --- juju-core-2.0.0/src/github.com/juju/juju/api/sshclient/facade_test.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/api/sshclient/facade_test.go 2016-11-11 00:08:09.000000000 +0000 @@ -22,16 +22,31 @@ var _ = gc.Suite(&FacadeSuite{}) -func (s *FacadeSuite) TestAddress(c *gc.C) { +func (s *FacadeSuite) TestAddresses(c *gc.C) { var stub jujutesting.Stub apiCaller := apitesting.APICallerFunc(func(objType string, version int, id, request string, arg, result interface{}) error { stub.AddCall(objType+"."+request, arg) c.Check(id, gc.Equals, "") - *result.(*params.SSHAddressResults) = params.SSHAddressResults{ - Results: []params.SSHAddressResult{{Address: "1.1.1.1"}}, + + switch request { + case "PublicAddress", "PrivateAddress": + *result.(*params.SSHAddressResults) = params.SSHAddressResults{ + Results: []params.SSHAddressResult{ + {Address: "1.1.1.1"}, + }, + } + + case "AllAddresses": + *result.(*params.SSHAddressesResults) = params.SSHAddressesResults{ + Results: []params.SSHAddressesResult{ + {Addresses: []string{"1.1.1.1", "2.2.2.2"}}, + }, + } } + return nil }) + facade := sshclient.NewFacade(apiCaller) expectedArg := []interface{}{params.Entities{[]params.Entity{{ names.NewUnitTag("foo/0").String(), @@ -47,9 +62,15 @@ c.Assert(err, jc.ErrorIsNil) c.Check(private, gc.Equals, "1.1.1.1") stub.CheckCalls(c, []jujutesting.StubCall{{"SSHClient.PrivateAddress", expectedArg}}) + stub.ResetCalls() + + addrs, err := facade.AllAddresses("foo/0") + c.Assert(err, jc.ErrorIsNil) + c.Check(addrs, gc.DeepEquals, []string{"1.1.1.1", "2.2.2.2"}) + stub.CheckCalls(c, []jujutesting.StubCall{{"SSHClient.AllAddresses", expectedArg}}) } -func (s *FacadeSuite) TestAddressError(c *gc.C) { +func (s *FacadeSuite) TestAddressesError(c *gc.C) { apiCaller := apitesting.APICallerFunc(func(objType string, version int, id, request string, arg, result interface{}) error { return errors.New("boom") }) @@ -62,13 +83,27 @@ private, err := facade.PrivateAddress("foo/0") c.Check(private, gc.Equals, "") c.Check(err, gc.ErrorMatches, "boom") + + addrs, err := facade.AllAddresses("foo/0") + c.Check(addrs, gc.IsNil) + c.Check(err, gc.ErrorMatches, "boom") } -func (s *FacadeSuite) TestAddressTargetError(c *gc.C) { +func (s *FacadeSuite) TestAddressesTargetError(c *gc.C) { apiCaller := apitesting.APICallerFunc(func(objType string, version int, id, request string, arg, result interface{}) error { - *result.(*params.SSHAddressResults) = params.SSHAddressResults{ - Results: []params.SSHAddressResult{{Error: common.ServerError(errors.New("boom"))}}, + serverError := common.ServerError(errors.New("boom")) + + switch request { + case "PublicAddress", "PrivateAddress": + *result.(*params.SSHAddressResults) = params.SSHAddressResults{ + Results: []params.SSHAddressResult{{Error: serverError}}, + } + case "AllAddresses": + *result.(*params.SSHAddressesResults) = params.SSHAddressesResults{ + Results: []params.SSHAddressesResult{{Error: serverError}}, + } } + return nil }) facade := sshclient.NewFacade(apiCaller) @@ -80,9 +115,13 @@ private, err := facade.PrivateAddress("foo/0") c.Check(private, gc.Equals, "") c.Check(err, gc.ErrorMatches, "boom") + + addrs, err := facade.AllAddresses("foo/0") + c.Check(addrs, gc.IsNil) + c.Check(err, gc.ErrorMatches, "boom") } -func (s *FacadeSuite) TestAddressMissingResults(c *gc.C) { +func (s *FacadeSuite) TestAddressesMissingResults(c *gc.C) { apiCaller := apitesting.APICallerFunc(func(objType string, version int, id, request string, arg, result interface{}) error { return nil }) @@ -96,15 +135,29 @@ private, err := facade.PrivateAddress("foo/0") c.Check(private, gc.Equals, "") c.Check(err, gc.ErrorMatches, expectedErr) + + addrs, err := facade.AllAddresses("foo/0") + c.Check(addrs, gc.IsNil) + c.Check(err, gc.ErrorMatches, expectedErr) } -func (s *FacadeSuite) TestAddressExtraResults(c *gc.C) { +func (s *FacadeSuite) TestAddressesExtraResults(c *gc.C) { apiCaller := apitesting.APICallerFunc(func(objType string, version int, id, request string, arg, result interface{}) error { - *result.(*params.SSHAddressResults) = params.SSHAddressResults{ - Results: []params.SSHAddressResult{ - {Address: "1.1.1.1"}, - {Address: "2.2.2.2"}, - }, + switch request { + case "PublicAddress", "PrivateAddress": + *result.(*params.SSHAddressResults) = params.SSHAddressResults{ + Results: []params.SSHAddressResult{ + {Address: "1.1.1.1"}, + {Address: "2.2.2.2"}, + }, + } + case "AllAddresses": + *result.(*params.SSHAddressesResults) = params.SSHAddressesResults{ + Results: []params.SSHAddressesResult{ + {Addresses: []string{"1.1.1.1"}}, + {Addresses: []string{"2.2.2.2"}}, + }, + } } return nil }) @@ -118,6 +171,10 @@ private, err := facade.PrivateAddress("foo/0") c.Check(private, gc.Equals, "") c.Check(err, gc.ErrorMatches, expectedErr) + + addrs, err := facade.AllAddresses("foo/0") + c.Check(addrs, gc.IsNil) + c.Check(err, gc.ErrorMatches, expectedErr) } func (s *FacadeSuite) TestPublicKeys(c *gc.C) { diff -Nru juju-core-2.0.0/src/github.com/juju/juju/api/uniter/relation.go juju-core-2.0.2/src/github.com/juju/juju/api/uniter/relation.go --- juju-core-2.0.0/src/github.com/juju/juju/api/uniter/relation.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/api/uniter/relation.go 2016-11-11 00:08:09.000000000 +0000 @@ -80,7 +80,7 @@ func (r *Relation) Endpoint() (*Endpoint, error) { // NOTE: This differs from state.Relation.Endpoint(), because when // talking to the API, there's already an authenticated entity - the - // unit, and we can find out its service name. + // unit, and we can find out its application name. result, err := r.st.relation(r.tag, r.st.unitTag) if err != nil { return nil, err diff -Nru juju-core-2.0.0/src/github.com/juju/juju/api/uniter/unit.go juju-core-2.0.2/src/github.com/juju/juju/api/uniter/unit.go --- juju-core-2.0.0/src/github.com/juju/juju/api/uniter/unit.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/api/uniter/unit.go 2016-11-11 00:08:09.000000000 +0000 @@ -211,7 +211,7 @@ return charm.Settings(result.Settings), nil } -// ApplicationName returns the service name. +// ApplicationName returns the application name. func (u *Unit) ApplicationName() string { application, err := names.UnitApplication(u.Name()) if err != nil { diff -Nru juju-core-2.0.0/src/github.com/juju/juju/api/watcher/watcher.go juju-core-2.0.2/src/github.com/juju/juju/api/watcher/watcher.go --- juju-core-2.0.0/src/github.com/juju/juju/api/watcher/watcher.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/api/watcher/watcher.go 2016-11-11 00:08:09.000000000 +0000 @@ -13,6 +13,7 @@ "github.com/juju/juju/api/base" "github.com/juju/juju/apiserver/params" "github.com/juju/juju/core/migration" + "github.com/juju/juju/state/multiwatcher" "github.com/juju/juju/watcher" ) @@ -513,3 +514,85 @@ func (w *migrationStatusWatcher) Changes() <-chan watcher.MigrationStatus { return w.out } + +// applicationRelationsWatcher will sends changes to relations an application +// is involved in, including changes to the units involved in those +// relations, and their settings. +type applicationRelationsWatcher struct { + commonWatcher + caller base.APICaller + applicationRelationsWatcherId string + out chan watcher.ApplicationRelationsChange +} + +// NewApplicationRelationsWatcher returns an ApplicationRelationsWatcher which +// communicates with the ApplicationRelationsWatcher API facade to watch +// application relations. +func NewApplicationRelationsWatcher(caller base.APICaller, result params.ApplicationRelationsWatchResult) watcher.ApplicationRelationsWatcher { + w := &applicationRelationsWatcher{ + caller: caller, + applicationRelationsWatcherId: result.ApplicationRelationsWatcherId, + out: make(chan watcher.ApplicationRelationsChange), + } + go func() { + defer w.tomb.Done() + defer close(w.out) + w.tomb.Kill(w.loop(*result.Changes)) + }() + return w +} + +func (w *applicationRelationsWatcher) loop(initialChanges params.ApplicationRelationsChange) error { + changes := copyApplicationRelationsChange(initialChanges) + w.newResult = func() interface{} { return new(params.ApplicationRelationsWatchResult) } + w.call = makeWatcherAPICaller(w.caller, "ApplicationRelationsWatcher", w.applicationRelationsWatcherId) + w.commonWatcher.init() + go w.commonLoop() + + for { + select { + // Send the initial event or subsequent change. + case w.out <- changes: + case <-w.tomb.Dying(): + return nil + } + // Read the next change. + data, ok := <-w.in + if !ok { + // The tomb is already killed with the correct error + // at this point, so just return. + return nil + } + changes = copyApplicationRelationsChange(*data.(*params.ApplicationRelationsWatchResult).Changes) + } +} + +func copyApplicationRelationsChange(src params.ApplicationRelationsChange) watcher.ApplicationRelationsChange { + dst := watcher.ApplicationRelationsChange{ + RemovedRelations: src.RemovedRelations, + } + if src.ChangedRelations != nil { + dst.ChangedRelations = make([]watcher.RelationChange, len(src.ChangedRelations)) + for i, change := range src.ChangedRelations { + cr := watcher.RelationChange{ + RelationId: change.RelationId, + Life: multiwatcher.Life(change.Life), + DepartedUnits: change.DepartedUnits, + } + cr.ChangedUnits = make(map[string]watcher.RelationUnitChange) + for name, relationChange := range change.ChangedUnits { + cr.ChangedUnits[name] = watcher.RelationUnitChange{Settings: relationChange.Settings} + } + dst.ChangedRelations[i] = cr + } + } + return dst +} + +// Changes returns a channel that will receive the changes to +// relations an application is involved in. The first event on the channel +// holds the initial state of the application's relations in its Changed +// field. +func (w *applicationRelationsWatcher) Changes() watcher.ApplicationRelationsChannel { + return w.out +} diff -Nru juju-core-2.0.0/src/github.com/juju/juju/apiserver/action/run.go juju-core-2.0.2/src/github.com/juju/juju/apiserver/action/run.go --- juju-core-2.0.0/src/github.com/juju/juju/apiserver/action/run.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/apiserver/action/run.go 2016-11-11 00:08:09.000000000 +0000 @@ -16,7 +16,7 @@ ) // getAllUnitNames returns a sequence of valid Unit objects from state. If any -// of the service names or unit names are not found, an error is returned. +// of the application names or unit names are not found, an error is returned. func getAllUnitNames(st *state.State, units, services []string) (result []names.Tag, err error) { unitsSet := set.NewStrings(units...) for _, name := range services { diff -Nru juju-core-2.0.0/src/github.com/juju/juju/apiserver/allfacades.go juju-core-2.0.2/src/github.com/juju/juju/apiserver/allfacades.go --- juju-core-2.0.0/src/github.com/juju/juju/apiserver/allfacades.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/apiserver/allfacades.go 2016-11-11 00:08:09.000000000 +0000 @@ -25,6 +25,7 @@ _ "github.com/juju/juju/apiserver/client" // ModelUser Write _ "github.com/juju/juju/apiserver/cloud" // ModelUser Read _ "github.com/juju/juju/apiserver/controller" // ModelUser Admin (although some methods check for read only) + _ "github.com/juju/juju/apiserver/crossmodel" _ "github.com/juju/juju/apiserver/deployer" _ "github.com/juju/juju/apiserver/discoverspaces" _ "github.com/juju/juju/apiserver/diskmanager" @@ -57,6 +58,7 @@ _ "github.com/juju/juju/apiserver/provisioner" _ "github.com/juju/juju/apiserver/proxyupdater" _ "github.com/juju/juju/apiserver/reboot" + _ "github.com/juju/juju/apiserver/remoterelations" _ "github.com/juju/juju/apiserver/resumer" _ "github.com/juju/juju/apiserver/retrystrategy" _ "github.com/juju/juju/apiserver/singular" diff -Nru juju-core-2.0.0/src/github.com/juju/juju/apiserver/apiserver.go juju-core-2.0.2/src/github.com/juju/juju/apiserver/apiserver.go --- juju-core-2.0.0/src/github.com/juju/juju/apiserver/apiserver.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/apiserver/apiserver.go 2016-11-11 00:08:09.000000000 +0000 @@ -6,6 +6,7 @@ import ( "crypto/tls" "crypto/x509" + "io" "net" "net/http" "strings" @@ -63,6 +64,7 @@ certChanged <-chan params.StateServingInfo tlsConfig *tls.Config allowModelAccess bool + logSinkWriter io.WriteCloser // mu guards the fields below it. mu sync.Mutex @@ -192,6 +194,12 @@ if err := srv.updateCertificate(cfg.Cert, cfg.Key); err != nil { return nil, errors.Annotatef(err, "cannot set initial certificate") } + logSinkWriter, err := newLogSinkWriter(srv.logDir) + if err != nil { + return nil, errors.Annotate(err, "creating logsink writer") + } + srv.logSinkWriter = logSinkWriter + go srv.run() return srv, nil } @@ -277,6 +285,7 @@ srv.tomb.Done() srv.statePool.Close() srv.state.Close() + srv.logSinkWriter.Close() }() srv.wg.Add(1) @@ -355,11 +364,11 @@ strictCtxt.controllerModelOnly = true mainAPIHandler := srv.trackRequests(http.HandlerFunc(srv.apiHandler)) - logSinkHandler := srv.trackRequests(newLogSinkHandler(httpCtxt, srv.logDir)) + logSinkHandler := newLogSinkHandler(httpCtxt, srv.logSinkWriter) logStreamHandler := srv.trackRequests(newLogStreamEndpointHandler(strictCtxt)) debugLogHandler := srv.trackRequests(newDebugLogDBHandler(httpCtxt)) - add("/model/:modeluuid/logsink", logSinkHandler) + add("/model/:modeluuid/logsink", srv.trackRequests(logSinkHandler)) add("/model/:modeluuid/logstream", logStreamHandler) add("/model/:modeluuid/log", debugLogHandler) diff -Nru juju-core-2.0.0/src/github.com/juju/juju/apiserver/application/application.go juju-core-2.0.2/src/github.com/juju/juju/apiserver/application/application.go --- juju-core-2.0.0/src/github.com/juju/juju/apiserver/application/application.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/apiserver/application/application.go 2016-11-11 00:08:09.000000000 +0000 @@ -7,15 +7,21 @@ package application import ( + "regexp" + "github.com/juju/errors" "github.com/juju/loggo" + "github.com/juju/utils/featureflag" "gopkg.in/juju/charm.v6-unstable" csparams "gopkg.in/juju/charmrepo.v2-unstable/csclient/params" goyaml "gopkg.in/yaml.v2" "github.com/juju/juju/apiserver/common" + "github.com/juju/juju/apiserver/crossmodel" "github.com/juju/juju/apiserver/facade" "github.com/juju/juju/apiserver/params" + jujucrossmodel "github.com/juju/juju/core/crossmodel" + "github.com/juju/juju/feature" "github.com/juju/juju/instance" jjj "github.com/juju/juju/juju" "github.com/juju/juju/permission" @@ -30,19 +36,23 @@ ) func init() { + // TODO - version 1 is required for the legacy deployer, + // remove when deploy is updated. common.RegisterStandardFacade("Application", 1, newAPI) - // Facade version 2 adds support for the ConfigSettings - // and StorageConstraints fields in SetCharm. common.RegisterStandardFacade("Application", 2, newAPI) + + // Version 3 adds support for cross model relations. + common.RegisterStandardFacade("Application", 3, newAPI) } // API implements the application interface and is the concrete // implementation of the api end point. type API struct { - backend Backend - authorizer facade.Authorizer - check BlockChecker + backend Backend + applicationOffersAPIFactory crossmodel.ApplicationOffersAPIFactory + authorizer facade.Authorizer + check BlockChecker // TODO(axw) stateCharm only exists because I ran out // of time unwinding all of the tendrils of state. We @@ -62,6 +72,7 @@ return NewAPI( backend, authorizer, + resources, blockChecker, stateCharm, ) @@ -71,15 +82,18 @@ func NewAPI( backend Backend, authorizer facade.Authorizer, + resources facade.Resources, blockChecker BlockChecker, stateCharm func(Charm) *state.Charm, ) (*API, error) { if !authorizer.AuthClient() { return nil, common.ErrPerm } + apiFactory := resources.Get("applicationOffersApiFactory").(crossmodel.ApplicationOffersAPIFactory) return &API{ - backend: backend, - authorizer: authorizer, + backend: backend, + authorizer: authorizer, + applicationOffersAPIFactory: apiFactory, check: blockChecker, stateCharm: stateCharm, }, nil @@ -686,6 +700,10 @@ return app.SetConstraints(args.Constraints) } +// applicationUrlEndpointParse is used to split an application url and optional +// relation name into url and relation name. +var applicationUrlEndpointParse = regexp.MustCompile("(?P.*/[^:]*)(:(?P.*))?") + // AddRelation adds a relation between the specified endpoints and returns the relation info. func (api *API) AddRelation(args params.AddRelation) (params.AddRelationResults, error) { if err := api.checkCanWrite(); err != nil { @@ -694,7 +712,46 @@ if err := api.check.ChangeAllowed(); err != nil { return params.AddRelationResults{}, errors.Trace(err) } - inEps, err := api.backend.InferEndpoints(args.Endpoints...) + + endpoints := make([]string, len(args.Endpoints)) + // We may have a remote application passed in as the endpoint spec. + // We'll iterate the endpoints to check. + for i, ep := range args.Endpoints { + endpoints[i] = ep + + // If cross model relations not enabled, ignore remote endpoints. + if !featureflag.Enabled(feature.CrossModelRelations) { + continue + } + + // If the endpoint is not remote, skip it. + // We first need to strip off any relation name + // which may have been appended to the URL, then + // we try parsing the URL. + possibleURL := applicationUrlEndpointParse.ReplaceAllString(ep, "$url") + relName := applicationUrlEndpointParse.ReplaceAllString(ep, "$relname") + + // If the URL parses, we need to look up the remote application + // details and save to state. + url, err := jujucrossmodel.ParseApplicationURL(possibleURL) + if err != nil { + // Not a URL. + continue + } + // Save the remote application details into state. + rs, err := saveRemoteApplication(api.backend, api.applicationOffersAPIFactory, *url) + if err != nil { + return params.AddRelationResults{}, errors.Trace(err) + } + // The endpoint is named after the remote application name, + // not the application name from the URL. + endpoints[i] = rs.Name() + if relName != "" { + endpoints[i] = rs.Name() + ":" + relName + } + } + + inEps, err := api.backend.InferEndpoints(endpoints...) if err != nil { return params.AddRelationResults{}, errors.Trace(err) } @@ -720,6 +777,70 @@ return params.AddRelationResults{Endpoints: outEps}, nil } +// saveRemoteApplication takes a remote application URL and retrieves the details of the service from +// the relevant application directory. These details are saved to the state model so relations to +// the remote application can be created. +func saveRemoteApplication( + backend Backend, apiFactory crossmodel.ApplicationOffersAPIFactory, url jujucrossmodel.ApplicationURL, +) (*state.RemoteApplication, error) { + offersAPI, err := apiFactory.ApplicationOffers(url.Directory) + if err != nil { + return nil, errors.Trace(err) + } + offers, err := offersAPI.ListOffers(params.OfferFilters{ + Directory: url.Directory, + Filters: []params.OfferFilter{ + { + ApplicationURL: url.String(), + }, + }, + }) + if err != nil { + return nil, errors.Trace(err) + } + if offers.Error != nil { + return nil, errors.Trace(offers.Error) + } + // The offers query succeeded but there were no offers matching the URL. + if len(offers.Offers) == 0 { + return nil, errors.NotFoundf("application offer %q", url.String()) + } + + // Create a remote application entry in the model for the consumed service. + offer := offers.Offers[0] + remoteApp, err := backend.RemoteApplication(url.ApplicationName) + if err != nil && !errors.IsNotFound(err) { + return nil, errors.Trace(err) + } + if err == nil { + // TODO (wallyworld) - update service if it exists already with any additional endpoints + return remoteApp, nil + } + remoteEps := make([]charm.Relation, len(offer.Endpoints)) + for j, ep := range offer.Endpoints { + remoteEps[j] = charm.Relation{ + Name: ep.Name, + Role: ep.Role, + Interface: ep.Interface, + Limit: ep.Limit, + Scope: ep.Scope, + } + } + remoteApp, err = backend.AddRemoteApplication(url.ApplicationName, url.String(), remoteEps) + if err != nil { + if !errors.IsAlreadyExists(err) { + return nil, errors.Trace(err) + } + // Remote application didn't exist but now there's a clash + // trying to save it. It could be a local application with the + // same name or a remote application with the same name but we + // have no idea whether endpoints are compatible or not. + // Best just to error. + return nil, errors.Annotatef(err, "saving endpoints for application at URL %q", url.String()) + } + return remoteApp, nil +} + // DestroyRelation removes the relation between the specified endpoints. func (api *API) DestroyRelation(args params.DestroyRelation) error { if err := api.checkCanWrite(); err != nil { diff -Nru juju-core-2.0.0/src/github.com/juju/juju/apiserver/application/application_test.go juju-core-2.0.2/src/github.com/juju/juju/apiserver/application/application_test.go --- juju-core-2.0.0/src/github.com/juju/juju/apiserver/application/application_test.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/apiserver/application/application_test.go 2016-11-11 00:08:09.000000000 +0000 @@ -25,6 +25,8 @@ "github.com/juju/juju/apiserver/application" "github.com/juju/juju/apiserver/common" commontesting "github.com/juju/juju/apiserver/common/testing" + "github.com/juju/juju/apiserver/crossmodel" + "github.com/juju/juju/apiserver/facade" "github.com/juju/juju/apiserver/params" apiservertesting "github.com/juju/juju/apiserver/testing" "github.com/juju/juju/constraints" @@ -44,9 +46,10 @@ apiservertesting.CharmStoreSuite commontesting.BlockHelper - applicationAPI *application.API - application *state.Application - authorizer apiservertesting.FakeAuthorizer + applicationAPI *application.API + application *state.Application + authorizer apiservertesting.FakeAuthorizer + offersApiFactory *mockApplicationOffersFactory } var _ = gc.Suite(&serviceSuite{}) @@ -74,10 +77,13 @@ Tag: s.AdminUserTag(c), } var err error + s.offersApiFactory = &mockApplicationOffersFactory{} + resources := common.NewResources() + resources.RegisterNamed("applicationOffersApiFactory", s.offersApiFactory) backend := application.NewStateBackend(s.State) blockChecker := common.NewBlockChecker(s.State) s.applicationAPI, err = application.NewAPI( - backend, s.authorizer, blockChecker, + backend, s.authorizer, resources, blockChecker, application.CharmToStateCharm, ) c.Assert(err, jc.ErrorIsNil) @@ -1622,7 +1628,7 @@ to: "0", }, { - about: "unknown service name", + about: "unknown application name", service: "unknown-service", err: `application "unknown-service" not found`, }, @@ -1853,7 +1859,7 @@ exposed bool }{ { - about: "unknown service name", + about: "unknown application name", service: "unknown-service", err: `application "unknown-service" not found`, }, @@ -1918,7 +1924,7 @@ expected bool }{ { - about: "unknown service name", + about: "unknown application name", service: "unknown-service", err: `application "unknown-service" not found`, }, @@ -2006,7 +2012,7 @@ err string }{ { - about: "unknown service name", + about: "unknown application name", service: "unknown-service", err: `application "unknown-service" not found`, }, @@ -2059,10 +2065,10 @@ s.BlockRemoveObject(c, "TestBlockServiceDestroy") err := s.applicationAPI.Destroy(params.ApplicationDestroy{"dummy-service"}) s.AssertBlocked(c, err, "TestBlockServiceDestroy") - // Tests may have invalid service names. + // Tests may have invalid application names. application, err := s.State.Application("dummy-service") if err == nil { - // For valid service names, check that service is alive :-) + // For valid application names, check that service is alive :-) assertLife(c, application, state.Alive) } } @@ -2393,7 +2399,7 @@ c.Assert(result.Constraints, gc.DeepEquals, cons) } -func (s *serviceSuite) checkEndpoints(c *gc.C, endpoints map[string]params.CharmRelation) { +func (s *serviceSuite) checkEndpoints(c *gc.C, mysqlAppName string, endpoints map[string]params.CharmRelation) { c.Assert(endpoints["wordpress"], gc.DeepEquals, params.CharmRelation{ Name: "db", Role: "requirer", @@ -2402,7 +2408,7 @@ Limit: 1, Scope: "global", }) - c.Assert(endpoints["mysql"], gc.DeepEquals, params.CharmRelation{ + c.Assert(endpoints[mysqlAppName], gc.DeepEquals, params.CharmRelation{ Name: "server", Role: "provider", Interface: "mysql", @@ -2425,7 +2431,6 @@ s.setupRelationScenario(c) res, err := s.applicationAPI.AddRelation(params.AddRelation{Endpoints: endpoints}) c.Assert(err, jc.ErrorIsNil) - s.checkEndpoints(c, res.Endpoints) // Show that the relation was added. wpSvc, err := s.State.Application("wordpress") c.Assert(err, jc.ErrorIsNil) @@ -2433,9 +2438,20 @@ // There are 2 relations - the logging-wordpress one set up in the // scenario and the one created in this test. c.Assert(len(rels), gc.Equals, 2) - mySvc, err := s.State.Application("mysql") + + // We may be related to a local application or a remote. + var mySqlApplication state.ApplicationEntity + mySqlApplication, err = s.State.RemoteApplication("hosted-mysql") + if errors.IsNotFound(err) { + mySqlApplication, err = s.State.Application("mysql") + c.Assert(err, jc.ErrorIsNil) + s.checkEndpoints(c, "mysql", res.Endpoints) + } else { + c.Assert(err, jc.ErrorIsNil) + s.checkEndpoints(c, "hosted-mysql", res.Endpoints) + } c.Assert(err, jc.ErrorIsNil) - rels, err = mySvc.Relations() + rels, err = mySqlApplication.Relations() c.Assert(err, jc.ErrorIsNil) c.Assert(len(rels), gc.Equals, 1) } @@ -2497,6 +2513,111 @@ c.Assert(err, gc.ErrorMatches, `cannot add relation "wordpress:db mysql:server": relation already exists`) } +type mockApplicationOffersFactory struct { + facade.Resource + offers []params.ApplicationOffer +} + +type mockApplicationOffersAPI struct { + crossmodel.ApplicationOffersAPI + offers []params.ApplicationOffer +} + +func (m *mockApplicationOffersFactory) ApplicationOffers(directory string) (crossmodel.ApplicationOffersAPI, error) { + return &mockApplicationOffersAPI{ + offers: m.offers, + }, nil +} + +func (m *mockApplicationOffersAPI) ListOffers(filters params.OfferFilters) (params.ApplicationOfferResults, error) { + return params.ApplicationOfferResults{ + Offers: m.offers, + }, nil +} + +func remoteOffers() []params.ApplicationOffer { + return []params.ApplicationOffer{ + { + ApplicationURL: "local:/u/me/prod/hosted-mysql", + ApplicationName: "mysqlremote", + Endpoints: []params.RemoteEndpoint{ + { + Name: "server", + Role: "provider", + Interface: "mysql", + Scope: "global", + }, + }, + }, + } +} + +func (s *serviceSuite) TestSuccessfullyAddRemoteRelation(c *gc.C) { + s.offersApiFactory.offers = remoteOffers() + endpoints := []string{"wordpress", "local:/u/me/prod/hosted-mysql"} + s.assertAddRelation(c, endpoints) +} + +func (s *serviceSuite) TestSuccessfullyAddRemoteRelationWithRelName(c *gc.C) { + s.offersApiFactory.offers = remoteOffers() + endpoints := []string{"wordpress", "local:/u/me/prod/hosted-mysql:server"} + s.assertAddRelation(c, endpoints) +} + +func (s *serviceSuite) TestAddRemoteRelationOnlyOneEndpoint(c *gc.C) { + s.offersApiFactory.offers = remoteOffers() + endpoints := []string{"local:/u/me/prod/hosted-mysql"} + _, err := s.applicationAPI.AddRelation(params.AddRelation{endpoints}) + c.Assert(err, gc.ErrorMatches, "no relations found") +} + +func (s *serviceSuite) TestAlreadyAddedRemoteRelation(c *gc.C) { + s.offersApiFactory.offers = remoteOffers() + // Add a relation between wordpress and mysql. + endpoints := []string{"wordpress", "local:/u/me/prod/hosted-mysql"} + s.assertAddRelation(c, endpoints) + + // And try to add it again. + _, err := s.applicationAPI.AddRelation(params.AddRelation{endpoints}) + c.Assert(err, gc.ErrorMatches, `cannot add relation "wordpress:db hosted-mysql:server": relation already exists`) +} + +func (s *serviceSuite) TestRemoteRelationInvalidEndpoint(c *gc.C) { + s.offersApiFactory.offers = remoteOffers() + s.AddTestingService(c, "wordpress", s.AddTestingCharm(c, "wordpress")) + endpoints := []string{"wordpress", "local:/u/me/prod/hosted-mysql:nope"} + _, err := s.applicationAPI.AddRelation(params.AddRelation{endpoints}) + c.Assert(err, gc.ErrorMatches, `remote application "hosted-mysql" has no "nope" relation`) +} + +func (s *serviceSuite) TestRemoteRelationNoMatchingEndpoint(c *gc.C) { + s.offersApiFactory.offers = []params.ApplicationOffer{ + { + ApplicationURL: "local:/u/me/prod/hosted-mysql", + ApplicationName: "mysqlremote", + Endpoints: []params.RemoteEndpoint{ + { + Name: "admin", + Role: "provider", + Interface: "admin", + Scope: "global", + }, + }, + }, + } + s.AddTestingService(c, "wordpress", s.AddTestingCharm(c, "wordpress")) + endpoints := []string{"wordpress", "local:/u/me/prod/hosted-mysql"} + _, err := s.applicationAPI.AddRelation(params.AddRelation{endpoints}) + c.Assert(err, gc.ErrorMatches, "no relations found") +} + +func (s *serviceSuite) TestRemoteRelationServiceNotFound(c *gc.C) { + s.AddTestingService(c, "wordpress", s.AddTestingCharm(c, "wordpress")) + endpoints := []string{"wordpress", "local:/u/me/prod/unknown"} + _, err := s.applicationAPI.AddRelation(params.AddRelation{endpoints}) + c.Assert(err, gc.ErrorMatches, `application offer "local:/u/me/prod/unknown" not found`) +} + func (s *serviceSuite) setupDestroyRelationScenario(c *gc.C, endpoints []string) *state.Relation { s.AddTestingService(c, "wordpress", s.AddTestingCharm(c, "wordpress")) // Add a relation between the endpoints. diff -Nru juju-core-2.0.0/src/github.com/juju/juju/apiserver/application/application_unit_test.go juju-core-2.0.2/src/github.com/juju/juju/apiserver/application/application_unit_test.go --- juju-core-2.0.0/src/github.com/juju/juju/apiserver/application/application_unit_test.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/apiserver/application/application_unit_test.go 2016-11-11 00:08:09.000000000 +0000 @@ -12,6 +12,7 @@ "gopkg.in/juju/names.v2" "github.com/juju/juju/apiserver/application" + "github.com/juju/juju/apiserver/common" "github.com/juju/juju/apiserver/params" apiservertesting "github.com/juju/juju/apiserver/testing" "github.com/juju/juju/state" @@ -50,9 +51,13 @@ charm: &s.charm, } s.blockChecker = mockBlockChecker{} + offersApiFactory := &mockApplicationOffersFactory{} + resources := common.NewResources() + resources.RegisterNamed("applicationOffersApiFactory", offersApiFactory) api, err := application.NewAPI( &s.backend, s.authorizer, + resources, &s.blockChecker, func(application.Charm) *state.Charm { return &state.Charm{} diff -Nru juju-core-2.0.0/src/github.com/juju/juju/apiserver/application/backend.go juju-core-2.0.2/src/github.com/juju/juju/apiserver/application/backend.go --- juju-core-2.0.0/src/github.com/juju/juju/apiserver/application/backend.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/apiserver/application/backend.go 2016-11-11 00:08:09.000000000 +0000 @@ -19,6 +19,8 @@ type Backend interface { Application(string) (Application, error) AddApplication(state.AddApplicationArgs) (*state.Application, error) + RemoteApplication(name string) (*state.RemoteApplication, error) + AddRemoteApplication(name, url string, endpoints []charm.Relation) (*state.RemoteApplication, error) AddRelation(...state.Endpoint) (Relation, error) AssignUnit(*state.Unit, state.AssignmentPolicy) error AssignUnitWithPlacement(*state.Unit, *instance.Placement) error diff -Nru juju-core-2.0.0/src/github.com/juju/juju/apiserver/application/get_test.go juju-core-2.0.2/src/github.com/juju/juju/apiserver/application/get_test.go --- juju-core-2.0.0/src/github.com/juju/juju/apiserver/application/get_test.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/apiserver/application/get_test.go 2016-11-11 00:08:09.000000000 +0000 @@ -37,8 +37,11 @@ var err error backend := application.NewStateBackend(s.State) blockChecker := common.NewBlockChecker(s.State) + offersApiFactory := &mockApplicationOffersFactory{} + resources := common.NewResources() + resources.RegisterNamed("applicationOffersApiFactory", offersApiFactory) s.serviceAPI, err = application.NewAPI( - backend, s.authorizer, blockChecker, + backend, s.authorizer, resources, blockChecker, application.CharmToStateCharm, ) c.Assert(err, jc.ErrorIsNil) diff -Nru juju-core-2.0.0/src/github.com/juju/juju/apiserver/client/api_test.go juju-core-2.0.2/src/github.com/juju/juju/apiserver/client/api_test.go --- juju-core-2.0.0/src/github.com/juju/juju/apiserver/client/api_test.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/apiserver/client/api_test.go 2016-11-11 00:08:09.000000000 +0000 @@ -218,6 +218,7 @@ WantsVote: false, }, }, + RemoteApplications: map[string]params.RemoteApplicationStatus{}, Applications: map[string]params.ApplicationStatus{ "logging": { Charm: "local:quantal/logging-1", diff -Nru juju-core-2.0.0/src/github.com/juju/juju/apiserver/client/backend.go juju-core-2.0.2/src/github.com/juju/juju/apiserver/client/backend.go --- juju-core-2.0.0/src/github.com/juju/juju/apiserver/client/backend.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/apiserver/client/backend.go 2016-11-11 00:08:09.000000000 +0000 @@ -40,6 +40,7 @@ AddOneMachine(state.MachineTemplate) (*state.Machine, error) AddRelation(...state.Endpoint) (*state.Relation, error) AllApplications() ([]*state.Application, error) + AllRemoteApplications() ([]*state.RemoteApplication, error) AllMachines() ([]*state.Machine, error) AllRelations() ([]*state.Relation, error) Annotations(state.GlobalEntity) (map[string]string, error) diff -Nru juju-core-2.0.0/src/github.com/juju/juju/apiserver/client/client_test.go juju-core-2.0.2/src/github.com/juju/juju/apiserver/client/client_test.go --- juju-core-2.0.0/src/github.com/juju/juju/apiserver/client/client_test.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/apiserver/client/client_test.go 2016-11-11 00:08:09.000000000 +0000 @@ -681,9 +681,9 @@ _, err := s.APIState.Client().PublicAddress("wordpress") c.Assert(err, gc.ErrorMatches, `unknown unit or machine "wordpress"`) _, err = s.APIState.Client().PublicAddress("0") - c.Assert(err, gc.ErrorMatches, `error fetching address for machine "0": no public address`) + c.Assert(err, gc.ErrorMatches, `error fetching address for machine "0": no public address\(es\)`) _, err = s.APIState.Client().PublicAddress("wordpress/0") - c.Assert(err, gc.ErrorMatches, `error fetching address for unit "wordpress/0": no public address`) + c.Assert(err, gc.ErrorMatches, `error fetching address for unit "wordpress/0": no public address\(es\)`) } func (s *clientSuite) TestClientPublicAddressMachine(c *gc.C) { @@ -723,9 +723,9 @@ _, err := s.APIState.Client().PrivateAddress("wordpress") c.Assert(err, gc.ErrorMatches, `unknown unit or machine "wordpress"`) _, err = s.APIState.Client().PrivateAddress("0") - c.Assert(err, gc.ErrorMatches, `error fetching address for machine "0": no private address`) + c.Assert(err, gc.ErrorMatches, `error fetching address for machine "0": no private address\(es\)`) _, err = s.APIState.Client().PrivateAddress("wordpress/0") - c.Assert(err, gc.ErrorMatches, `error fetching address for unit "wordpress/0": no private address`) + c.Assert(err, gc.ErrorMatches, `error fetching address for unit "wordpress/0": no private address\(es\)`) } func (s *clientSuite) TestClientPrivateAddress(c *gc.C) { diff -Nru juju-core-2.0.0/src/github.com/juju/juju/apiserver/client/filtering.go juju-core-2.0.2/src/github.com/juju/juju/apiserver/client/filtering.go --- juju-core-2.0.0/src/github.com/juju/juju/apiserver/client/filtering.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/apiserver/client/filtering.go 2016-11-11 00:08:09.000000000 +0000 @@ -411,7 +411,7 @@ return false } -// validPattern must match the parts of a unit or service name +// validPattern must match the parts of a unit or application name // pattern either side of the '/' for it to be valid. var validPattern = regexp.MustCompile("^[a-z0-9-*]+$") diff -Nru juju-core-2.0.0/src/github.com/juju/juju/apiserver/client/status.go juju-core-2.0.2/src/github.com/juju/juju/apiserver/client/status.go --- juju-core-2.0.0/src/github.com/juju/juju/apiserver/client/status.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/apiserver/client/status.go 2016-11-11 00:08:09.000000000 +0000 @@ -9,12 +9,14 @@ "strings" "github.com/juju/errors" + "github.com/juju/utils/featureflag" "github.com/juju/utils/set" "gopkg.in/juju/charm.v6-unstable" "gopkg.in/juju/names.v2" "github.com/juju/juju/apiserver/common" "github.com/juju/juju/apiserver/params" + "github.com/juju/juju/feature" "github.com/juju/juju/network" "github.com/juju/juju/state" "github.com/juju/juju/state/multiwatcher" @@ -169,9 +171,15 @@ var noStatus params.FullStatus var context statusContext var err error - if context.services, context.units, context.latestCharms, err = + if context.applications, context.units, context.latestCharms, err = fetchAllApplicationsAndUnits(c.api.stateAccessor, len(args.Patterns) <= 0); err != nil { - return noStatus, errors.Annotate(err, "could not fetch services and units") + return noStatus, errors.Annotate(err, "could not fetch applications and units") + } + if featureflag.Enabled(feature.CrossModelRelations) { + if context.remoteApplications, err = + fetchRemoteApplications(c.api.stateAccessor); err != nil { + return noStatus, errors.Annotate(err, "could not fetch remote applications") + } } if context.machines, err = fetchMachines(c.api.stateAccessor, nil); err != nil { return noStatus, errors.Annotate(err, "could not fetch machines") @@ -179,13 +187,14 @@ if context.relations, err = fetchRelations(c.api.stateAccessor); err != nil { return noStatus, errors.Annotate(err, "could not fetch relations") } - if len(context.services) > 0 { + if len(context.applications) > 0 { if context.leaders, err = c.api.stateAccessor.ApplicationLeaders(); err != nil { return noStatus, errors.Annotate(err, " could not fetch leaders") } } - logger.Debugf("Applications: %v", context.services) + logger.Debugf("Applications: %v", context.applications) + logger.Debugf("Remote applications: %v", context.remoteApplications) if len(args.Patterns) > 0 { predicate := BuildPredicateFor(args.Patterns) @@ -239,18 +248,20 @@ } } - // Filter services - for svcName, svc := range context.services { + // Filter applications + for svcName, svc := range context.applications { if matchedSvcs.Contains(svcName) { - // There are matched units for this service. + // There are matched units for this application. continue } else if matches, err := predicate(svc); err != nil { return noStatus, errors.Annotate(err, "could not filter applications") } else if !matches { - delete(context.services, svcName) + delete(context.applications, svcName) } } + // TODO(wallyworld) - filter remote applications + // Filter machines for status, machineList := range context.machines { matched := make([]*state.Machine, 0, len(machineList)) @@ -278,10 +289,11 @@ return noStatus, errors.Annotate(err, "cannot determine model status") } return params.FullStatus{ - Model: modelStatus, - Machines: processMachines(context.machines), - Applications: context.processApplications(), - Relations: context.processRelations(), + Model: modelStatus, + Machines: processMachines(context.machines), + Applications: context.processApplications(), + RemoteApplications: context.processRemoteApplications(), + Relations: context.processRelations(), }, nil } @@ -351,12 +363,14 @@ // machines: top-level machine id -> list of machines nested in // this machine. machines map[string][]*state.Machine - // services: service name -> service - services map[string]*state.Application - relations map[string][]*state.Relation - units map[string]map[string]*state.Unit - latestCharms map[charm.URL]*state.Charm - leaders map[string]string + // applications: application name -> application + applications map[string]*state.Application + // remote applications: application name -> application + remoteApplications map[string]*state.RemoteApplication + relations map[string][]*state.Relation + units map[string]map[string]*state.Unit + latestCharms map[charm.URL]*state.Charm + leaders map[string]string } // fetchMachines returns a map from top level machine id to machines, where machines[0] is the host @@ -391,32 +405,32 @@ return v, nil } -// fetchAllApplicationsAndUnits returns a map from service name to service, -// a map from service name to unit name to unit, and a map from base charm URL to latest URL. +// fetchAllApplicationsAndUnits returns a map from application name to application, +// a map from application name to unit name to unit, and a map from base charm URL to latest URL. func fetchAllApplicationsAndUnits( st Backend, matchAny bool, ) (map[string]*state.Application, map[string]map[string]*state.Unit, map[charm.URL]*state.Charm, error) { - svcMap := make(map[string]*state.Application) + appMap := make(map[string]*state.Application) unitMap := make(map[string]map[string]*state.Unit) latestCharms := make(map[charm.URL]*state.Charm) - services, err := st.AllApplications() + applications, err := st.AllApplications() if err != nil { return nil, nil, nil, err } - for _, s := range services { + for _, s := range applications { units, err := s.AllUnits() if err != nil { return nil, nil, nil, err } - svcUnitMap := make(map[string]*state.Unit) + appUnitMap := make(map[string]*state.Unit) for _, u := range units { - svcUnitMap[u.Name()] = u + appUnitMap[u.Name()] = u } - if matchAny || len(svcUnitMap) > 0 { - unitMap[s.Name()] = svcUnitMap - svcMap[s.Name()] = s + if matchAny || len(appUnitMap) > 0 { + unitMap[s.Name()] = appUnitMap + appMap[s.Name()] = s // Record the base URL for the application's charm so that // the latest store revision can be looked up. charmURL, _ := s.CharmURL() @@ -436,15 +450,28 @@ latestCharms[baseURL] = ch } - return svcMap, unitMap, latestCharms, nil + return appMap, unitMap, latestCharms, nil +} + +// fetchRemoteApplications returns a map from application name to remote application. +func fetchRemoteApplications(st Backend) (map[string]*state.RemoteApplication, error) { + appMap := make(map[string]*state.RemoteApplication) + applications, err := st.AllRemoteApplications() + if err != nil { + return nil, err + } + for _, s := range applications { + appMap[s.Name()] = s + } + return appMap, nil } -// fetchRelations returns a map of all relations keyed by service name. +// fetchRelations returns a map of all relations keyed by application name. // -// This structure is useful for processServiceRelations() which needs -// to have the relations for each service. Reading them once here +// This structure is useful for processApplicationRelations() which needs +// to have the relations for each application. Reading them once here // avoids the repeated DB hits to retrieve the relations for each -// service that used to happen in processServiceRelations(). +// application that used to happen in processApplicationRelations(). func fetchRelations(st Backend) (map[string][]*state.Relation, error) { relations, err := st.AllRelations() if err != nil { @@ -604,15 +631,15 @@ } func (context *statusContext) isSubordinate(ep *state.Endpoint) bool { - service := context.services[ep.ApplicationName] - if service == nil { + application := context.applications[ep.ApplicationName] + if application == nil { return false } - return isSubordinate(ep, service) + return isSubordinate(ep, application) } -func isSubordinate(ep *state.Endpoint, service *state.Application) bool { - return ep.Scope == charm.ScopeContainer && !service.IsPrincipal() +func isSubordinate(ep *state.Endpoint, application *state.Application) bool { + return ep.Scope == charm.ScopeContainer && !application.IsPrincipal() } // paramsJobsFromJobs converts state jobs to params jobs. @@ -625,42 +652,42 @@ } func (context *statusContext) processApplications() map[string]params.ApplicationStatus { - servicesMap := make(map[string]params.ApplicationStatus) - for _, s := range context.services { - servicesMap[s.Name()] = context.processApplication(s) + applicationsMap := make(map[string]params.ApplicationStatus) + for _, s := range context.applications { + applicationsMap[s.Name()] = context.processApplication(s) } - return servicesMap + return applicationsMap } -func (context *statusContext) processApplication(service *state.Application) params.ApplicationStatus { - serviceCharm, _, err := service.Charm() +func (context *statusContext) processApplication(application *state.Application) params.ApplicationStatus { + applicationCharm, _, err := application.Charm() if err != nil { return params.ApplicationStatus{Err: common.ServerError(err)} } var processedStatus = params.ApplicationStatus{ - Charm: serviceCharm.URL().String(), - Series: service.Series(), - Exposed: service.IsExposed(), - Life: processLife(service), + Charm: applicationCharm.URL().String(), + Series: application.Series(), + Exposed: application.IsExposed(), + Life: processLife(application), } - if latestCharm, ok := context.latestCharms[*serviceCharm.URL().WithRevision(-1)]; ok && latestCharm != nil { - if latestCharm.Revision() > serviceCharm.URL().Revision { + if latestCharm, ok := context.latestCharms[*applicationCharm.URL().WithRevision(-1)]; ok && latestCharm != nil { + if latestCharm.Revision() > applicationCharm.URL().Revision { processedStatus.CanUpgradeTo = latestCharm.String() } } - processedStatus.Relations, processedStatus.SubordinateTo, err = context.processServiceRelations(service) + processedStatus.Relations, processedStatus.SubordinateTo, err = context.processApplicationRelations(application) if err != nil { processedStatus.Err = common.ServerError(err) return processedStatus } - units := context.units[service.Name()] - if service.IsPrincipal() { - processedStatus.Units = context.processUnits(units, serviceCharm.URL().String()) + units := context.units[application.Name()] + if application.IsPrincipal() { + processedStatus.Units = context.processUnits(units, applicationCharm.URL().String()) } - applicationStatus, err := service.Status() + applicationStatus, err := application.Status() if err != nil { processedStatus.Err = common.ServerError(err) return processedStatus @@ -670,9 +697,9 @@ processedStatus.Status.Data = applicationStatus.Data processedStatus.Status.Since = applicationStatus.Since - metrics := serviceCharm.Metrics() + metrics := applicationCharm.Metrics() planRequired := metrics != nil && metrics.Plan != nil && metrics.Plan.Required - if planRequired || len(service.MetricCredentials()) > 0 { + if planRequired || len(application.MetricCredentials()) > 0 { processedStatus.MeterStatuses = context.processUnitMeterStatuses(units) } @@ -701,6 +728,42 @@ return processedStatus } +func (context *statusContext) processRemoteApplications() map[string]params.RemoteApplicationStatus { + applicationsMap := make(map[string]params.RemoteApplicationStatus) + for _, s := range context.remoteApplications { + applicationsMap[s.Name()] = context.processRemoteApplication(s) + } + return applicationsMap +} + +func (context *statusContext) processRemoteApplication(application *state.RemoteApplication) (status params.RemoteApplicationStatus) { + status.ApplicationURL = application.URL() + status.ApplicationName = application.Name() + eps, err := application.Endpoints() + if err != nil { + status.Err = err + return + } + status.Endpoints = make([]params.RemoteEndpoint, len(eps)) + for i, ep := range eps { + status.Endpoints[i] = params.RemoteEndpoint{ + Name: ep.Name, + Interface: ep.Interface, + Role: ep.Role, + } + } + status.Life = processLife(application) + + status.Relations, err = context.processRemoteApplicationRelations(application) + if err != nil { + status.Err = err + return + } + applicationStatus, err := application.Status() + populateStatusFromStatusInfoAndErr(&status.Status, applicationStatus, err) + return status +} + func isColorStatus(code state.MeterStatusCode) bool { return code == state.MeterGreen || code == state.MeterAmber || code == state.MeterRed } @@ -722,15 +785,15 @@ return nil } -func (context *statusContext) processUnits(units map[string]*state.Unit, serviceCharm string) map[string]params.UnitStatus { +func (context *statusContext) processUnits(units map[string]*state.Unit, applicationCharm string) map[string]params.UnitStatus { unitsMap := make(map[string]params.UnitStatus) for _, unit := range units { - unitsMap[unit.Name()] = context.processUnit(unit, serviceCharm) + unitsMap[unit.Name()] = context.processUnit(unit, applicationCharm) } return unitsMap } -func (context *statusContext) processUnit(unit *state.Unit, serviceCharm string) params.UnitStatus { +func (context *statusContext) processUnit(unit *state.Unit, applicationCharm string) params.UnitStatus { var result params.UnitStatus addr, err := unit.PublicAddress() if err != nil { @@ -748,7 +811,7 @@ result.Machine, _ = unit.AssignedMachineId() } curl, _ := unit.CharmURL() - if serviceCharm != "" && curl != nil && curl.String() != serviceCharm { + if applicationCharm != "" && curl != nil && curl.String() != applicationCharm { result.Charm = curl.String() } workloadVersion, err := unit.WorkloadVersion() @@ -766,7 +829,7 @@ subUnit := context.unitByName(name) // subUnit may be nil if subordinate was filtered out. if subUnit != nil { - result.Subordinates[name] = context.processUnit(subUnit, serviceCharm) + result.Subordinates[name] = context.processUnit(subUnit, applicationCharm) } } } @@ -777,38 +840,62 @@ } func (context *statusContext) unitByName(name string) *state.Unit { - serviceName := strings.Split(name, "/")[0] - return context.units[serviceName][name] + applicationName := strings.Split(name, "/")[0] + return context.units[applicationName][name] } -func (context *statusContext) processServiceRelations(service *state.Application) (related map[string][]string, subord []string, err error) { +func (context *statusContext) processApplicationRelations(application *state.Application) (related map[string][]string, subord []string, err error) { subordSet := make(set.Strings) related = make(map[string][]string) - relations := context.relations[service.Name()] + relations := context.relations[application.Name()] for _, relation := range relations { - ep, err := relation.Endpoint(service.Name()) + ep, err := relation.Endpoint(application.Name()) if err != nil { return nil, nil, err } relationName := ep.Relation.Name - eps, err := relation.RelatedEndpoints(service.Name()) + eps, err := relation.RelatedEndpoints(application.Name()) if err != nil { return nil, nil, err } for _, ep := range eps { - if isSubordinate(&ep, service) { + if isSubordinate(&ep, application) { subordSet.Add(ep.ApplicationName) } related[relationName] = append(related[relationName], ep.ApplicationName) } } - for relationName, serviceNames := range related { - sn := set.NewStrings(serviceNames...) + for relationName, applicationNames := range related { + sn := set.NewStrings(applicationNames...) related[relationName] = sn.SortedValues() } return related, subordSet.SortedValues(), nil } +func (context *statusContext) processRemoteApplicationRelations(application *state.RemoteApplication) (related map[string][]string, err error) { + related = make(map[string][]string) + relations := context.relations[application.Name()] + for _, relation := range relations { + ep, err := relation.Endpoint(application.Name()) + if err != nil { + return nil, err + } + relationName := ep.Relation.Name + eps, err := relation.RelatedEndpoints(application.Name()) + if err != nil { + return nil, err + } + for _, ep := range eps { + related[relationName] = append(related[relationName], ep.ApplicationName) + } + } + for relationName, applicationNames := range related { + sn := set.NewStrings(applicationNames...) + related[relationName] = sn.SortedValues() + } + return related, nil +} + type lifer interface { Life() state.Life } diff -Nru juju-core-2.0.0/src/github.com/juju/juju/apiserver/client/status_test.go juju-core-2.0.2/src/github.com/juju/juju/apiserver/client/status_test.go --- juju-core-2.0.0/src/github.com/juju/juju/apiserver/client/status_test.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/apiserver/client/status_test.go 2016-11-11 00:08:09.000000000 +0000 @@ -48,6 +48,7 @@ c.Check(status.Model.Name, gc.Equals, "controller") c.Check(status.Model.CloudTag, gc.Equals, "cloud-dummy") c.Check(status.Applications, gc.HasLen, 0) + c.Check(status.RemoteApplications, gc.HasLen, 0) c.Check(status.Machines, gc.HasLen, 1) resultMachine, ok := status.Machines[machine.Id()] if !ok { diff -Nru juju-core-2.0.0/src/github.com/juju/juju/apiserver/common/addresses_test.go juju-core-2.0.2/src/github.com/juju/juju/apiserver/common/addresses_test.go --- juju-core-2.0.0/src/github.com/juju/juju/apiserver/common/addresses_test.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/apiserver/common/addresses_test.go 2016-11-11 00:08:09.000000000 +0000 @@ -93,7 +93,7 @@ c.Assert(string(result.Result), gc.Equals, "a cert") } -func (s *apiAddresserSuite) TestEnvironUUID(c *gc.C) { +func (s *apiAddresserSuite) TestModelUUID(c *gc.C) { result := s.addresser.ModelUUID() c.Assert(string(result.Result), gc.Equals, "the environ uuid") } diff -Nru juju-core-2.0.0/src/github.com/juju/juju/apiserver/common/getstatus.go juju-core-2.0.2/src/github.com/juju/juju/apiserver/common/getstatus.go --- juju-core-2.0.0/src/github.com/juju/juju/apiserver/common/getstatus.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/apiserver/common/getstatus.go 2016-11-11 00:08:09.000000000 +0000 @@ -6,7 +6,6 @@ import ( "fmt" - "github.com/juju/errors" "gopkg.in/juju/names.v2" "github.com/juju/juju/apiserver/params" @@ -14,14 +13,6 @@ "github.com/juju/juju/status" ) -// ErrIsNotLeader is an error for operations that require for a -// unit to be the leader but it was not the case. -// TODO(fwereade) why do we have an alternative implementation of ErrPerm -// that is exported (implying people will be able to meaningfully check it) -// but not actually handled anywhere or converted into an error code by the -// api server? -var ErrIsNotLeader = errors.Errorf("this unit is not the leader") - // StatusGetter implements a common Status method for use by // various facades. type StatusGetter struct { @@ -84,26 +75,26 @@ return result, nil } -// ServiceStatusGetter is a StatusGetter for combined service and unit statuses. +// ApplicationStatusGetter is a StatusGetter for combined application and unit statuses. // TODO(fwereade) this is completely evil and should never have been created. // We have a perfectly adequate StatusGetter already, that accepts bulk args; // all this does is break the user model, break the api model, and lie about // unit statuses). -type ServiceStatusGetter struct { +type ApplicationStatusGetter struct { st *state.State getCanAccess GetAuthFunc } -// NewServiceStatusGetter returns a ServiceStatusGetter. -func NewServiceStatusGetter(st *state.State, getCanAccess GetAuthFunc) *ServiceStatusGetter { - return &ServiceStatusGetter{ +// NewApplicationStatusGetter returns a ApplicationStatusGetter. +func NewApplicationStatusGetter(st *state.State, getCanAccess GetAuthFunc) *ApplicationStatusGetter { + return &ApplicationStatusGetter{ st: st, getCanAccess: getCanAccess, } } -// Status returns the status of the Service for each given Unit tag. -func (s *ServiceStatusGetter) Status(args params.Entities) (params.ApplicationStatusResults, error) { +// Status returns the status of the Application for each given Unit tag. +func (s *ApplicationStatusGetter) Status(args params.Entities) (params.ApplicationStatusResults, error) { result := params.ApplicationStatusResults{ Results: make([]params.ApplicationStatusResult, len(args.Entities)), } @@ -117,11 +108,11 @@ // works by coincidence (and is happening at the wrong layer anyway). // Read carefully. - // We "know" that arg.Tag is either the calling unit or its service - // (because getCanAccess is authUnitOrService, and we'll fail out if + // We "know" that arg.Tag is either the calling unit or its application + // (because getCanAccess is authUnitOrApplication, and we'll fail out if // it isn't); and, in practice, it's always going to be the calling - // unit (because, /sigh, we don't actually use service tags to refer - // to services in this method). + // unit (because, /sigh, we don't actually use application tags to refer + // to applications in this method). tag, err := names.ParseTag(arg.Tag) if err != nil { result.Results[i].Error = ServerError(err) @@ -140,22 +131,22 @@ } unitId := unitTag.Id() - // Now we have the unit, we can get the service that should have been + // Now we have the unit, we can get the application that should have been // specified in the first place... - serviceId, err := names.UnitApplication(unitId) + applicationId, err := names.UnitApplication(unitId) if err != nil { result.Results[i].Error = ServerError(err) continue } - service, err := s.st.Application(serviceId) + application, err := s.st.Application(applicationId) if err != nil { result.Results[i].Error = ServerError(err) continue } - // ...so we can check the unit's service leadership... + // ...so we can check the unit's application leadership... checker := s.st.LeadershipChecker() - token := checker.LeadershipCheck(serviceId, unitId) + token := checker.LeadershipCheck(applicationId, unitId) if err := token.Check(nil); err != nil { // TODO(fwereade) this should probably be ErrPerm is certain cases, // but I don't think I implemented an exported ErrNotLeader. I @@ -165,16 +156,16 @@ } // ...and collect the results. - serviceStatus, unitStatuses, err := service.ServiceAndUnitsStatus() + applicationStatus, unitStatuses, err := application.ApplicationAndUnitsStatus() if err != nil { result.Results[i].Application.Error = ServerError(err) result.Results[i].Error = ServerError(err) continue } - result.Results[i].Application.Status = serviceStatus.Status.String() - result.Results[i].Application.Info = serviceStatus.Message - result.Results[i].Application.Data = serviceStatus.Data - result.Results[i].Application.Since = serviceStatus.Since + result.Results[i].Application.Status = applicationStatus.Status.String() + result.Results[i].Application.Info = applicationStatus.Message + result.Results[i].Application.Data = applicationStatus.Data + result.Results[i].Application.Since = applicationStatus.Since result.Results[i].Units = make(map[string]params.StatusResult, len(unitStatuses)) for uTag, r := range unitStatuses { diff -Nru juju-core-2.0.0/src/github.com/juju/juju/apiserver/common/getstatus_test.go juju-core-2.0.2/src/github.com/juju/juju/apiserver/common/getstatus_test.go --- juju-core-2.0.0/src/github.com/juju/juju/apiserver/common/getstatus_test.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/apiserver/common/getstatus_test.go 2016-11-11 00:08:09.000000000 +0000 @@ -124,7 +124,7 @@ type serviceStatusGetterSuite struct { statusBaseSuite - getter *common.ServiceStatusGetter + getter *common.ApplicationStatusGetter } var _ = gc.Suite(&serviceStatusGetterSuite{}) @@ -132,7 +132,7 @@ func (s *serviceStatusGetterSuite) SetUpTest(c *gc.C) { s.statusBaseSuite.SetUpTest(c) - s.getter = common.NewServiceStatusGetter(s.State, func() (common.AuthFunc, error) { + s.getter = common.NewApplicationStatusGetter(s.State, func() (common.AuthFunc, error) { return s.authFunc, nil }) } diff -Nru juju-core-2.0.0/src/github.com/juju/juju/apiserver/common/setstatus.go juju-core-2.0.2/src/github.com/juju/juju/apiserver/common/setstatus.go --- juju-core-2.0.0/src/github.com/juju/juju/apiserver/common/setstatus.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/apiserver/common/setstatus.go 2016-11-11 00:08:09.000000000 +0000 @@ -15,26 +15,26 @@ "github.com/juju/juju/status" ) -// ServiceStatusSetter implements a SetApplicationStatus method to be -// used by facades that can change a service status. -// This is only slightly less evil than ServiceStatusGetter. We have +// ApplicationStatusSetter implements a SetApplicationStatus method to be +// used by facades that can change an application status. +// This is only slightly less evil than ApplicationStatusGetter. We have // StatusSetter already; all this does is set the status for the wrong // entity, and render the auth so confused as to be ~worthless. -type ServiceStatusSetter struct { +type ApplicationStatusSetter struct { st *state.State getCanModify GetAuthFunc } // NewServiceStatusSetter returns a ServiceStatusSetter. -func NewServiceStatusSetter(st *state.State, getCanModify GetAuthFunc) *ServiceStatusSetter { - return &ServiceStatusSetter{ +func NewServiceStatusSetter(st *state.State, getCanModify GetAuthFunc) *ApplicationStatusSetter { + return &ApplicationStatusSetter{ st: st, getCanModify: getCanModify, } } // SetStatus sets the status on the service given by the unit in args if the unit is the leader. -func (s *ServiceStatusSetter) SetStatus(args params.SetStatus) (params.ErrorResults, error) { +func (s *ApplicationStatusSetter) SetStatus(args params.SetStatus) (params.ErrorResults, error) { result := params.ErrorResults{ Results: make([]params.ErrorResult, len(args.Entities)), } diff -Nru juju-core-2.0.0/src/github.com/juju/juju/apiserver/common/setstatus_test.go juju-core-2.0.2/src/github.com/juju/juju/apiserver/common/setstatus_test.go --- juju-core-2.0.0/src/github.com/juju/juju/apiserver/common/setstatus_test.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/apiserver/common/setstatus_test.go 2016-11-11 00:08:09.000000000 +0000 @@ -143,7 +143,7 @@ type serviceStatusSetterSuite struct { statusBaseSuite - setter *common.ServiceStatusSetter + setter *common.ApplicationStatusSetter } var _ = gc.Suite(&serviceStatusSetterSuite{}) diff -Nru juju-core-2.0.0/src/github.com/juju/juju/apiserver/crossmodel/applicationdirectory.go juju-core-2.0.2/src/github.com/juju/juju/apiserver/crossmodel/applicationdirectory.go --- juju-core-2.0.0/src/github.com/juju/juju/apiserver/crossmodel/applicationdirectory.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/apiserver/crossmodel/applicationdirectory.go 2016-11-11 00:08:09.000000000 +0000 @@ -0,0 +1,169 @@ +// Copyright 2015 Canonical Ltd. +// Licensed under the AGPLv3, see LICENCE file for details. + +package crossmodel + +import ( + "github.com/juju/errors" + "gopkg.in/juju/names.v2" + + crossmodelapi "github.com/juju/juju/api/crossmodel" + "github.com/juju/juju/apiserver/common" + "github.com/juju/juju/apiserver/facade" + "github.com/juju/juju/apiserver/params" + "github.com/juju/juju/core/crossmodel" + jujucrossmodel "github.com/juju/juju/core/crossmodel" + "github.com/juju/juju/feature" + "github.com/juju/juju/state" +) + +func init() { + common.RegisterStandardFacadeForFeature("ApplicationOffers", 1, newApplicationOffersAPI, feature.CrossModelRelations) +} + +// ApplicationOffersAPI implements the cross model interface and is the concrete +// implementation of the api end point. +type ApplicationOffersAPI interface { + // AddOffers adds new application offerings to a directory, able to be consumed by + // the specified users. + AddOffers(offers params.AddApplicationOffers) (params.ErrorResults, error) + + // ListOffers returns offers matching the filter from a application directory. + ListOffers(filters params.OfferFilters) (params.ApplicationOfferResults, error) +} + +type applicationOffersAPI struct { + authorizer facade.Authorizer + applicationOffersAPIFactory ApplicationOffersAPIFactory + // TODO(wallyworld) - add component to handle permissions. +} + +// createApplicationDirectoryAPI returns a new cross model API facade. +func createApplicationOffersAPI( + serviceAPIFactory ApplicationOffersAPIFactory, + authorizer facade.Authorizer, +) (ApplicationOffersAPI, error) { + if !authorizer.AuthClient() { + return nil, common.ErrPerm + } + + return &applicationOffersAPI{ + authorizer: authorizer, + applicationOffersAPIFactory: serviceAPIFactory, + }, nil +} + +func newApplicationOffersAPI( + st *state.State, + resources facade.Resources, + authorizer facade.Authorizer, +) (ApplicationOffersAPI, error) { + apiFactory := resources.Get("applicationOffersApiFactory").(ApplicationOffersAPIFactory) + return createApplicationOffersAPI(apiFactory, authorizer) +} + +// TODO(wallyworld) - add Remove() and Update() + +// ListOffers returns offers matching the filter from a application directory. +func (api *applicationOffersAPI) ListOffers(filters params.OfferFilters) (params.ApplicationOfferResults, error) { + if filters.Directory == "" { + return params.ApplicationOfferResults{}, errors.New("application directory must be specified") + } + applicationOffers, err := api.applicationOffersAPIFactory.ApplicationOffers(filters.Directory) + if err != nil { + return params.ApplicationOfferResults{}, err + } + return applicationOffers.ListOffers(filters) +} + +// AddOffers adds new application offerings to a directory, able to be consumed by +// the specified users. +func (api *applicationOffersAPI) AddOffers(offers params.AddApplicationOffers) (params.ErrorResults, error) { + if len(offers.Offers) == 0 { + return params.ErrorResults{}, nil + } + + // TODO(wallyworld) - we assume for now that all offers are to the + // same backend ie all local or all to the same remote application directory. + directory, err := jujucrossmodel.ApplicationDirectoryForURL(offers.Offers[0].ApplicationURL) + if err != nil { + return params.ErrorResults{}, err + } + applicationOffers, err := api.applicationOffersAPIFactory.ApplicationOffers(directory) + if err != nil { + return params.ErrorResults{}, err + } + return applicationOffers.AddOffers(offers) +} + +// localApplicationOffers provides access to application offers hosted within +// a local controller. +type localApplicationOffers struct { + applicationDirectory crossmodel.ApplicationDirectory +} + +// ListOffers returns offers matching the filter from a application directory. +func (so *localApplicationOffers) ListOffers(filters params.OfferFilters) (params.ApplicationOfferResults, error) { + var result params.ApplicationOfferResults + offerFilters, err := makeOfferFilterFromParams(filters.Filters) + if err != nil { + return result, err + } + offers, err := so.applicationDirectory.ListOffers(offerFilters...) + if err != nil { + result.Error = common.ServerError(err) + return result, nil + } + result.Offers = make([]params.ApplicationOffer, len(offers)) + for i, offer := range offers { + result.Offers[i] = crossmodelapi.MakeParamsFromOffer(offer) + } + return result, nil +} + +func makeOfferFilterFromParams(filters []params.OfferFilter) ([]crossmodel.ApplicationOfferFilter, error) { + offerFilters := make([]crossmodel.ApplicationOfferFilter, len(filters)) + for i, filter := range filters { + offerFilters[i] = crossmodel.ApplicationOfferFilter{ + ApplicationOffer: crossmodel.ApplicationOffer{ + ApplicationURL: filter.ApplicationURL, + ApplicationName: filter.ApplicationName, + ApplicationDescription: filter.ApplicationDescription, + SourceLabel: filter.SourceLabel, + }, + } + if filter.SourceModelUUIDTag != "" { + envTag, err := names.ParseModelTag(filter.SourceModelUUIDTag) + if err != nil { + return nil, errors.Trace(err) + } + offerFilters[i].SourceModelUUID = envTag.Id() + } + // TODO(wallyworld) - add support for Endpoint filter attribute + } + return offerFilters, nil +} + +// AddOffers adds new application offerings to a directory, able to be consumed by +// the specified users. +func (so *localApplicationOffers) AddOffers(offers params.AddApplicationOffers) (params.ErrorResults, error) { + result := params.ErrorResults{ + Results: make([]params.ErrorResult, len(offers.Offers)), + } + if len(offers.Offers) == 0 { + return result, nil + } + + for i, offerParams := range offers.Offers { + offer, err := crossmodelapi.MakeOfferFromParams(offerParams.ApplicationOffer) + if err != nil { + result.Results[i].Error = common.ServerError(err) + continue + } + if err := so.applicationDirectory.AddOffer(offer); err != nil { + result.Results[i].Error = common.ServerError(err) + } + } + // TODO(wallyworld) - write ACLs with supplied users once we support that + return result, nil +} diff -Nru juju-core-2.0.0/src/github.com/juju/juju/apiserver/crossmodel/applicationdirectory_test.go juju-core-2.0.2/src/github.com/juju/juju/apiserver/crossmodel/applicationdirectory_test.go --- juju-core-2.0.0/src/github.com/juju/juju/apiserver/crossmodel/applicationdirectory_test.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/apiserver/crossmodel/applicationdirectory_test.go 2016-11-11 00:08:09.000000000 +0000 @@ -0,0 +1,189 @@ +// Copyright 2015 Canonical Ltd. +// Licensed under the AGPLv3, see LICENCE file for details. + +package crossmodel_test + +import ( + "github.com/juju/errors" + jc "github.com/juju/testing/checkers" + gc "gopkg.in/check.v1" + "gopkg.in/juju/names.v2" + + apicrossmodel "github.com/juju/juju/api/crossmodel" + "github.com/juju/juju/apiserver/common" + "github.com/juju/juju/apiserver/crossmodel" + "github.com/juju/juju/apiserver/params" + "github.com/juju/juju/apiserver/testing" + jujucrossmodel "github.com/juju/juju/core/crossmodel" + "github.com/juju/juju/feature" + coretesting "github.com/juju/juju/testing" +) + +var _ = gc.Suite(&applicationdirectorySuite{}) + +type applicationdirectorySuite struct { + coretesting.BaseSuite + + resources *common.Resources + authoriser testing.FakeAuthorizer + + api crossmodel.ApplicationOffersAPI + calls []string + applicationdirectory *mockApplicationDirectory + offers map[string]jujucrossmodel.ApplicationOffer +} + +func (s *applicationdirectorySuite) constructApplicationDirectory() *mockApplicationDirectory { + return &mockApplicationDirectory{ + addOffer: func(offer jujucrossmodel.ApplicationOffer) error { + s.calls = append(s.calls, "addoffer") + s.offers[offer.ApplicationURL] = offer + return nil + }, + listOffers: func(filters ...jujucrossmodel.ApplicationOfferFilter) ([]jujucrossmodel.ApplicationOffer, error) { + s.calls = append(s.calls, "listoffers") + var result []jujucrossmodel.ApplicationOffer + for _, filter := range filters { + if offer, ok := s.offers[filter.ApplicationURL]; ok { + result = append(result, offer) + } + } + return result, nil + }, + } +} + +func (s *applicationdirectorySuite) SetUpTest(c *gc.C) { + s.SetInitialFeatureFlags(feature.CrossModelRelations) + s.authoriser = testing.FakeAuthorizer{ + Tag: names.NewUserTag("testuser"), + } + s.resources = common.NewResources() + s.AddCleanup(func(*gc.C) { s.resources.StopAll() }) + + s.calls = []string{} + s.offers = make(map[string]jujucrossmodel.ApplicationOffer) + s.applicationdirectory = s.constructApplicationDirectory() + + var err error + serviceAPIFactory, err := crossmodel.NewServiceAPIFactory( + func() jujucrossmodel.ApplicationDirectory { return s.applicationdirectory }, + nil, + ) + c.Assert(err, jc.ErrorIsNil) + s.api, err = crossmodel.CreateApplicationOffersAPI(serviceAPIFactory, s.authoriser) + c.Assert(err, jc.ErrorIsNil) +} + +func (s *applicationdirectorySuite) TestUnauthorised(c *gc.C) { + s.authoriser = testing.FakeAuthorizer{} + _, err := crossmodel.CreateApplicationOffersAPI(nil, s.authoriser) + c.Assert(err, gc.Equals, common.ErrPerm) +} + +func (s *applicationdirectorySuite) assertCalls(c *gc.C, expectedCalls []string) { + c.Assert(s.calls, jc.SameContents, expectedCalls) +} + +var fakeUUID = "df136476-12e9-11e4-8a70-b2227cce2b54" + +func (s *applicationdirectorySuite) TestAddOffer(c *gc.C) { + offers := params.AddApplicationOffers{ + Offers: []params.AddApplicationOffer{ + { + ApplicationOffer: params.ApplicationOffer{ + ApplicationURL: "local:/u/user/servicename", + ApplicationName: "service", + SourceModelTag: names.NewModelTag(fakeUUID).String(), + }, + }, + { + ApplicationOffer: params.ApplicationOffer{ + ApplicationURL: "local:/u/user/anothername", + ApplicationName: "service", + SourceModelTag: names.NewModelTag(fakeUUID).String(), + }, + }, + }, + } + results, err := s.api.AddOffers(offers) + c.Assert(err, jc.ErrorIsNil) + c.Assert(results.Results, gc.HasLen, 2) + c.Assert(results.Results[0].Error, gc.IsNil) + s.assertCalls(c, []string{"addoffer", "addoffer"}) + offer0, err := apicrossmodel.MakeOfferFromParams(offers.Offers[0].ApplicationOffer) + c.Assert(err, jc.ErrorIsNil) + c.Assert(s.offers["local:/u/user/servicename"], jc.DeepEquals, offer0) + offer1, err := apicrossmodel.MakeOfferFromParams(offers.Offers[1].ApplicationOffer) + c.Assert(err, jc.ErrorIsNil) + c.Assert(s.offers["local:/u/user/anothername"], jc.DeepEquals, offer1) +} + +func (s *applicationdirectorySuite) TestAddOfferError(c *gc.C) { + s.applicationdirectory.addOffer = func(offer jujucrossmodel.ApplicationOffer) error { + s.calls = append(s.calls, "addoffer") + return errors.New("error") + } + offers := params.AddApplicationOffers{ + Offers: []params.AddApplicationOffer{ + { + ApplicationOffer: params.ApplicationOffer{ + ApplicationURL: "local:/u/user/servicename", + ApplicationName: "service", + SourceModelTag: names.NewModelTag(fakeUUID).String(), + }, + }, + }, + } + results, err := s.api.AddOffers(offers) + c.Assert(err, jc.ErrorIsNil) + c.Assert(results.Results, gc.HasLen, 1) + c.Assert(results.Results[0].Error, gc.ErrorMatches, "error") + s.assertCalls(c, []string{"addoffer"}) +} + +func (s *applicationdirectorySuite) TestListOffers(c *gc.C) { + s.offers["local:/u/user/servicename"] = jujucrossmodel.ApplicationOffer{ + ApplicationURL: "local:/u/user/servicename", + ApplicationName: "service", + SourceModelUUID: fakeUUID, + } + s.offers["local:/u/user/anothername"] = jujucrossmodel.ApplicationOffer{ + ApplicationURL: "local:/u/user/anothername", + ApplicationName: "anotherservice", + SourceModelUUID: fakeUUID, + } + results, err := s.api.ListOffers(params.OfferFilters{ + Directory: "local", + Filters: []params.OfferFilter{ + { + ApplicationURL: "local:/u/user/servicename", + }, + }, + }) + c.Assert(err, jc.ErrorIsNil) + c.Assert(results.Error, gc.IsNil) + c.Assert(results.Offers, gc.HasLen, 1) + s.assertCalls(c, []string{"listoffers"}) + offer, err := apicrossmodel.MakeOfferFromParams(results.Offers[0]) + c.Assert(err, jc.ErrorIsNil) + c.Assert(offer, jc.DeepEquals, s.offers["local:/u/user/servicename"]) + c.Assert(results.Offers[0].ApplicationURL, gc.Equals, "local:/u/user/servicename") + c.Assert(results.Offers[0].SourceModelTag, gc.Equals, names.NewModelTag(fakeUUID).String()) +} + +func (s *applicationdirectorySuite) TestListOffersError(c *gc.C) { + s.applicationdirectory.listOffers = func(filters ...jujucrossmodel.ApplicationOfferFilter) ([]jujucrossmodel.ApplicationOffer, error) { + s.calls = append(s.calls, "listoffers") + return nil, errors.New("error") + } + result, err := s.api.ListOffers(params.OfferFilters{Directory: "local"}) + c.Assert(err, jc.ErrorIsNil) + c.Assert(result.Error, gc.ErrorMatches, "error") + s.assertCalls(c, []string{"listoffers"}) +} + +func (s *applicationdirectorySuite) TestListOffersNoDirectory(c *gc.C) { + _, err := s.api.ListOffers(params.OfferFilters{}) + c.Assert(err, gc.ErrorMatches, "application directory must be specified") +} diff -Nru juju-core-2.0.0/src/github.com/juju/juju/apiserver/crossmodel/base_test.go juju-core-2.0.2/src/github.com/juju/juju/apiserver/crossmodel/base_test.go --- juju-core-2.0.0/src/github.com/juju/juju/apiserver/crossmodel/base_test.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/apiserver/crossmodel/base_test.go 2016-11-11 00:08:09.000000000 +0000 @@ -0,0 +1,86 @@ +// Copyright 2015 Canonical Ltd. +// Licensed under the AGPLv3, see LICENCE file for details. + +package crossmodel_test + +import ( + jtesting "github.com/juju/testing" + jc "github.com/juju/testing/checkers" + gc "gopkg.in/check.v1" + "gopkg.in/juju/names.v2" + + "github.com/juju/juju/apiserver/common" + "github.com/juju/juju/apiserver/crossmodel" + "github.com/juju/juju/apiserver/params" + "github.com/juju/juju/apiserver/testing" + jujucrossmodel "github.com/juju/juju/core/crossmodel" + jujutesting "github.com/juju/juju/juju/testing" +) + +const ( + addOffersBackendCall = "AddOffers" + listOffersBackendCall = "ListOffers" +) + +type baseCrossmodelSuite struct { + // TODO(anastasiamac) mock to remove JujuConnSuite + // This Suite is required at the moment as we cannot easily mock out a state.Service object. + jujutesting.JujuConnSuite + + resources *common.Resources + authorizer testing.FakeAuthorizer + + api *crossmodel.API + + applicationDirectory *mockApplicationOffersAPI + makeOfferedApplicationParamsFunc func(p params.ApplicationOfferParams) (params.ApplicationOffer, error) +} + +func (s *baseCrossmodelSuite) addApplication(c *gc.C, name string) jujucrossmodel.OfferedApplication { + ch := s.AddTestingCharm(c, "wordpress") + s.AddTestingService(c, name, ch) + + return jujucrossmodel.OfferedApplication{ + ApplicationURL: "local:/u/me/" + name, + ApplicationName: name, + CharmName: ch.Meta().Name, + Endpoints: map[string]string{"db": "db"}, + Description: ch.Meta().Description, + } +} + +func (s *baseCrossmodelSuite) SetUpTest(c *gc.C) { + s.JujuConnSuite.SetUpTest(c) + s.resources = common.NewResources() + s.authorizer = testing.FakeAuthorizer{Tag: names.NewUserTag("testuser"), EnvironManager: true} + + s.applicationDirectory = &mockApplicationOffersAPI{} + + var err error + s.api, err = crossmodel.CreateAPI( + s.applicationDirectory, crossmodel.GetStateAccess(s.State), s.authorizer, + func(p params.ApplicationOfferParams) (params.ApplicationOffer, error) { + if s.makeOfferedApplicationParamsFunc != nil { + return s.makeOfferedApplicationParamsFunc(p) + } + return crossmodel.MakeOfferedApplicationParams(s.api, p) + }) + c.Assert(err, jc.ErrorIsNil) +} + +type mockApplicationOffersAPI struct { + jtesting.Stub + + addOffers func(offers params.AddApplicationOffers) (params.ErrorResults, error) + listOffers func(filters params.OfferFilters) (params.ApplicationOfferResults, error) +} + +func (m *mockApplicationOffersAPI) AddOffers(offers params.AddApplicationOffers) (params.ErrorResults, error) { + m.MethodCall(m, addOffersBackendCall) + return m.addOffers(offers) +} + +func (m *mockApplicationOffersAPI) ListOffers(filters params.OfferFilters) (params.ApplicationOfferResults, error) { + m.MethodCall(m, listOffersBackendCall, filters) + return m.listOffers(filters) +} diff -Nru juju-core-2.0.0/src/github.com/juju/juju/apiserver/crossmodel/crossmodel.go juju-core-2.0.2/src/github.com/juju/juju/apiserver/crossmodel/crossmodel.go --- juju-core-2.0.0/src/github.com/juju/juju/apiserver/crossmodel/crossmodel.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/apiserver/crossmodel/crossmodel.go 2016-11-11 00:08:09.000000000 +0000 @@ -0,0 +1,273 @@ +// Copyright 2015 Canonical Ltd. +// Licensed under the AGPLv3, see LICENCE file for details. + +// Package crossmodel provides an API server facade for managing +// cross model relations. +package crossmodel + +import ( + "github.com/juju/errors" + "github.com/juju/loggo" + "gopkg.in/juju/charm.v6-unstable" + "gopkg.in/juju/names.v2" + + "github.com/juju/juju/apiserver/common" + "github.com/juju/juju/apiserver/facade" + "github.com/juju/juju/apiserver/params" + jujucrossmodel "github.com/juju/juju/core/crossmodel" + "github.com/juju/juju/feature" + "github.com/juju/juju/state" +) + +var logger = loggo.GetLogger("juju.apiserver.crossmodel") + +func init() { + common.RegisterStandardFacadeForFeature("CrossModelRelations", 1, NewAPI, feature.CrossModelRelations) +} + +// API implements the cross model interface and is the concrete +// implementation of the api end point. +type API struct { + authorizer facade.Authorizer + applicationDirectory ApplicationOffersAPI + backend Backend + makeOfferedApplicationParamsFunc func(p params.ApplicationOfferParams) (params.ApplicationOffer, error) +} + +// createAPI returns a new cross model API facade. +func createAPI( + applicationDirectory ApplicationOffersAPI, + backend Backend, + authorizer facade.Authorizer, + makeOfferedApplicationParamsFunc func(p params.ApplicationOfferParams) (params.ApplicationOffer, error), +) (*API, error) { + if !authorizer.AuthClient() { + return nil, common.ErrPerm + } + + api := &API{ + authorizer: authorizer, + applicationDirectory: applicationDirectory, + backend: backend, + makeOfferedApplicationParamsFunc: makeOfferedApplicationParamsFunc, + } + if makeOfferedApplicationParamsFunc == nil { + api.makeOfferedApplicationParamsFunc = api.makeOfferedApplicationParams + } + return api, nil +} + +// NewAPI returns a new cross model API facade. +func NewAPI( + st *state.State, + resources facade.Resources, + authorizer facade.Authorizer, +) (*API, error) { + applicationOffers, err := newApplicationOffersAPI(st, resources, authorizer) + if err != nil { + return nil, errors.Trace(err) + } + return createAPI(applicationOffers, getStateAccess(st), authorizer, nil) +} + +// Offer makes application endpoints available for consumption at a specified URL. +func (api *API) Offer(all params.ApplicationOffersParams) (params.ErrorResults, error) { + result := make([]params.ErrorResult, len(all.Offers)) + + var offers params.AddApplicationOffers + indexInOffersToResult := make(map[int]int) + for i, one := range all.Offers { + applicationOfferParams, err := api.makeOfferedApplicationParamsFunc(one) + if err != nil { + result[i].Error = common.ServerError(err) + continue + } + indexInOffersToResult[len(offers.Offers)] = i + offers.Offers = append(offers.Offers, params.AddApplicationOffer{ + ApplicationOffer: applicationOfferParams, + UserTags: one.AllowedUserTags, + }) + } + addOffersErrors, err := api.applicationDirectory.AddOffers(offers) + if err != nil { + return params.ErrorResults{}, errors.Trace(err) + } + + // Merge the results with any errors encountered earlier. + for i, errResult := range addOffersErrors.Results { + if resultIndex, ok := indexInOffersToResult[i]; ok { + result[resultIndex] = errResult + } + } + return params.ErrorResults{Results: result}, nil +} + +// makeOfferedApplicationParams is a helper function that translates from a params +// structure into data structures needed for subsequent processing. +func (api *API) makeOfferedApplicationParams(p params.ApplicationOfferParams) (params.ApplicationOffer, error) { + tag, err := names.ParseModelTag(p.ModelTag) + if err != nil { + return params.ApplicationOffer{}, errors.Trace(err) + } + st, err := api.backend.ForModel(tag) + if err != nil { + return params.ApplicationOffer{}, errors.Trace(err) + } + defer st.Close() + application, err := st.Application(p.ApplicationName) + if err != nil { + return params.ApplicationOffer{}, errors.Annotatef(err, "getting offered application %v", p.ApplicationName) + } + + endpoints, err := getApplicationEndpoints(application, p.Endpoints) + if err != nil { + return params.ApplicationOffer{}, errors.Trace(err) + } + curl, _ := application.CharmURL() + epNames := make(map[string]string) + remoteEndpoints := make([]params.RemoteEndpoint, len(endpoints)) + for i, ep := range endpoints { + // TODO(wallyworld) - allow endpoint name aliasing + epNames[ep.Name] = ep.Name + remoteEndpoints[i] = params.RemoteEndpoint{ + Name: ep.Name, + Interface: ep.Interface, + Role: ep.Role, + Limit: ep.Limit, + Scope: ep.Scope, + } + } + + offer := jujucrossmodel.OfferedApplication{ + ApplicationURL: p.ApplicationURL, + ApplicationName: application.Name(), + CharmName: curl.Name, + Endpoints: epNames, + Description: p.ApplicationDescription, + } + + if offer.Description == "" || offer.Icon == nil { + ch, _, err := application.Charm() + if err != nil { + return params.ApplicationOffer{}, + errors.Annotatef(err, "getting charm for application %v", p.ApplicationName) + } + if offer.Description == "" { + offer.Description = ch.Meta().Description + } + if offer.Icon == nil { + // TODO(wallyworld) - add charm icon. + } + } + + // TODO(wallyworld) - allow source model name to be aliased + sourceModel, err := st.Model() + if err != nil { + return params.ApplicationOffer{}, errors.Trace(err) + } + + // offerParams is used to make the API call to record the application offer + // in a application directory. + offerParams := params.ApplicationOffer{ + ApplicationURL: offer.ApplicationURL, + ApplicationName: offer.ApplicationName, + ApplicationDescription: offer.Description, + Endpoints: remoteEndpoints, + SourceModelTag: st.ModelTag().String(), + SourceLabel: sourceModel.Name(), + } + + return offerParams, nil +} + +// ApplicationOffers gets details about remote applications that match given URLs. +func (api *API) ApplicationOffers(filter params.ApplicationURLs) (params.ApplicationOffersResults, error) { + urls := filter.ApplicationURLs + results := make([]params.ApplicationOfferResult, len(urls)) + // Record errors for each URL for later. + errorsByURL := make(map[string]error) + + // Group the filter URL terms by directory name so that the + // application directory API for each named directory can be used + // via a bulk call. + urlsByDirectory := make(map[string][]string) + for _, urlstr := range filter.ApplicationURLs { + url, err := jujucrossmodel.ParseApplicationURL(urlstr) + if err != nil { + errorsByURL[urlstr] = err + continue + } + urlsByDirectory[url.Directory] = append(urlsByDirectory[url.Directory], urlstr) + } + + foundOffers := make(map[string]params.ApplicationOffer) + for directory, urls := range urlsByDirectory { + // Make the filter terms for the current directory and then + // list the offers for that directory. + filters := params.OfferFilters{Directory: directory} + filters.Filters = make([]params.OfferFilter, len(urls)) + for i, url := range urls { + filters.Filters[i] = params.OfferFilter{ApplicationURL: url} + } + offers, err := api.applicationDirectory.ListOffers(filters) + if err == nil && offers.Error != nil { + err = offers.Error + } + if err != nil { + for _, url := range urls { + errorsByURL[url] = err + } + continue + } + for _, offer := range offers.Offers { + foundOffers[offer.ApplicationURL] = offer + } + } + + // We have the offers keyed on URL, sort out the not found URLs + // from the supplied filter arguments. + for i, one := range urls { + if err, ok := errorsByURL[one]; ok { + results[i].Error = common.ServerError(err) + continue + } + foundOffer, ok := foundOffers[one] + if !ok { + results[i].Error = common.ServerError(errors.NotFoundf("offer for remote application url %v", one)) + continue + } + results[i].Result = foundOffer + } + return params.ApplicationOffersResults{results}, nil +} + +// FindApplicationOffers gets details about remote applications that match given filter. +func (api *API) FindApplicationOffers(filters params.OfferFilterParams) (params.FindApplicationOffersResults, error) { + var result params.FindApplicationOffersResults + result.Results = make([]params.ApplicationOfferResults, len(filters.Filters)) + + for i, filter := range filters.Filters { + offers, err := api.applicationDirectory.ListOffers(filter) + if err == nil && offers.Error != nil { + err = offers.Error + } + if err != nil { + result.Results[i].Error = common.ServerError(err) + continue + } + result.Results[i] = offers + } + return result, nil +} + +func getApplicationEndpoints(application *state.Application, endpointNames []string) ([]charm.Relation, error) { + result := make([]charm.Relation, len(endpointNames)) + for i, endpointName := range endpointNames { + endpoint, err := application.Endpoint(endpointName) + if err != nil { + return nil, errors.Annotatef(err, "getting relation endpoint for relation %q and application %q", endpointName, application.Name()) + } + result[i] = endpoint.Relation + } + return result, nil +} diff -Nru juju-core-2.0.0/src/github.com/juju/juju/apiserver/crossmodel/crossmodel_test.go juju-core-2.0.2/src/github.com/juju/juju/apiserver/crossmodel/crossmodel_test.go --- juju-core-2.0.0/src/github.com/juju/juju/apiserver/crossmodel/crossmodel_test.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/apiserver/crossmodel/crossmodel_test.go 2016-11-11 00:08:09.000000000 +0000 @@ -0,0 +1,394 @@ +// Copyright 2015 Canonical Ltd. +// Licensed under the AGPLv3, see LICENCE file for details. + +package crossmodel_test + +import ( + "fmt" + + "github.com/juju/errors" + jc "github.com/juju/testing/checkers" + gc "gopkg.in/check.v1" + + "github.com/juju/juju/apiserver/crossmodel" + "github.com/juju/juju/apiserver/params" + "github.com/juju/juju/feature" +) + +type crossmodelSuite struct { + baseCrossmodelSuite +} + +var _ = gc.Suite(&crossmodelSuite{}) + +func (s *crossmodelSuite) SetUpTest(c *gc.C) { + s.SetInitialFeatureFlags(feature.CrossModelRelations) + s.baseCrossmodelSuite.SetUpTest(c) +} + +func (s *crossmodelSuite) TestOffer(c *gc.C) { + applicationName := "test" + s.addApplication(c, applicationName) + one := params.ApplicationOfferParams{ + ModelTag: "model-deadbeef-0bad-400d-8000-4b1d0d06f00d", + ApplicationURL: "local:/u/me/test", + ApplicationName: applicationName, + Endpoints: []string{"db"}, + } + all := params.ApplicationOffersParams{Offers: []params.ApplicationOfferParams{one}} + expectedOffers := params.AddApplicationOffers{ + Offers: []params.AddApplicationOffer{{ + ApplicationOffer: params.ApplicationOffer{ + ApplicationURL: "local:/u/me/test", + SourceModelTag: "model-deadbeef-0bad-400d-8000-4b1d0d06f00d", + SourceLabel: "controller", + ApplicationName: "test", + ApplicationDescription: "A pretty popular blog engine", + Endpoints: []params.RemoteEndpoint{ + {Name: "db", + Role: "requirer", + Interface: "mysql", + Limit: 1, + Scope: "global", + }, + }}}}} + s.applicationDirectory.addOffers = func(offers params.AddApplicationOffers) (params.ErrorResults, error) { + c.Assert(offers, jc.DeepEquals, expectedOffers) + result := params.ErrorResults{} + result.Results = make([]params.ErrorResult, len(offers.Offers)) + return result, nil + } + + errs, err := s.api.Offer(all) + c.Assert(err, jc.ErrorIsNil) + c.Assert(errs.Results, gc.HasLen, len(all.Offers)) + c.Assert(errs.Results[0].Error, gc.IsNil) + s.applicationDirectory.CheckCallNames(c, addOffersBackendCall) +} + +func (s *crossmodelSuite) TestOfferSomeFail(c *gc.C) { + s.addApplication(c, "one") + s.addApplication(c, "two") + one := params.ApplicationOfferParams{ + ModelTag: "model-deadbeef-0bad-400d-8000-4b1d0d06f00d", + ApplicationURL: "local:/u/me/one", + ApplicationName: "one", + Endpoints: []string{"db"}, + } + bad := params.ApplicationOfferParams{ + ModelTag: "model-deadbeef-0bad-400d-8000-4b1d0d06f00d", + ApplicationURL: "local:/u/me/bad", + ApplicationName: "notthere", + Endpoints: []string{"db"}, + } + bad2 := params.ApplicationOfferParams{ + ModelTag: "model-deadbeef-0bad-400d-8000-4b1d0d06f00d", + ApplicationURL: "local:/u/me/bad", + ApplicationName: "paramsfail", + Endpoints: []string{"db"}, + } + two := params.ApplicationOfferParams{ + ModelTag: "model-deadbeef-0bad-400d-8000-4b1d0d06f00d", + ApplicationURL: "local:/u/me/two", + ApplicationName: "two", + Endpoints: []string{"db"}, + } + all := params.ApplicationOffersParams{Offers: []params.ApplicationOfferParams{one, bad, bad2, two}} + expectedOffers := params.AddApplicationOffers{ + Offers: []params.AddApplicationOffer{{ + ApplicationOffer: params.ApplicationOffer{ + ApplicationURL: "local:/u/me/one", + SourceModelTag: "model-deadbeef-0bad-400d-8000-4b1d0d06f00d", + SourceLabel: "controller", + ApplicationName: "one", + ApplicationDescription: "A pretty popular blog engine", + Endpoints: []params.RemoteEndpoint{ + {Name: "db", + Role: "requirer", + Interface: "mysql", + Limit: 1, + Scope: "global", + }, + }}}, { + ApplicationOffer: params.ApplicationOffer{ + ApplicationURL: "local:/u/me/two", + SourceModelTag: "model-deadbeef-0bad-400d-8000-4b1d0d06f00d", + SourceLabel: "controller", + ApplicationName: "two", + ApplicationDescription: "A pretty popular blog engine", + Endpoints: []params.RemoteEndpoint{ + {Name: "db", + Role: "requirer", + Interface: "mysql", + Limit: 1, + Scope: "global", + }, + }}}}} + s.applicationDirectory.addOffers = func(offers params.AddApplicationOffers) (params.ErrorResults, error) { + c.Assert(offers, jc.DeepEquals, expectedOffers) + result := params.ErrorResults{} + result.Results = make([]params.ErrorResult, len(offers.Offers)) + return result, nil + } + + s.makeOfferedApplicationParamsFunc = func(p params.ApplicationOfferParams) (params.ApplicationOffer, error) { + if p.ApplicationName == "paramsfail" { + return params.ApplicationOffer{}, errors.New("params fail") + } + return crossmodel.MakeOfferedApplicationParams(s.api, p) + } + errs, err := s.api.Offer(all) + c.Assert(err, jc.ErrorIsNil) + c.Assert(errs.Results, gc.HasLen, len(all.Offers)) + c.Assert(errs.Results[0].Error, gc.IsNil) + c.Assert(errs.Results[3].Error, gc.IsNil) + c.Assert(errs.Results[1].Error, gc.ErrorMatches, `getting offered application notthere: application "notthere" not found`) + c.Assert(errs.Results[2].Error, gc.ErrorMatches, `params fail`) + s.applicationDirectory.CheckCallNames(c, addOffersBackendCall) +} + +func (s *crossmodelSuite) TestOfferError(c *gc.C) { + applicationName := "test" + s.addApplication(c, applicationName) + one := params.ApplicationOfferParams{ + ModelTag: "model-deadbeef-0bad-400d-8000-4b1d0d06f00d", + ApplicationName: applicationName, + } + all := params.ApplicationOffersParams{[]params.ApplicationOfferParams{one}} + + msg := "fail" + + s.applicationDirectory.addOffers = func(offers params.AddApplicationOffers) (params.ErrorResults, error) { + return params.ErrorResults{Results: []params.ErrorResult{{Error: ¶ms.Error{Message: msg}}}}, nil + } + + errs, err := s.api.Offer(all) + c.Assert(err, jc.ErrorIsNil) + c.Assert(errs.Results, gc.HasLen, len(all.Offers)) + c.Assert(errs.Results[0].Error, gc.ErrorMatches, fmt.Sprintf(".*%v.*", msg)) + s.applicationDirectory.CheckCallNames(c, addOffersBackendCall) +} + +func (s *crossmodelSuite) TestShow(c *gc.C) { + applicationName := "test" + url := "local:/u/fred/hosted-db2" + + filter := params.ApplicationURLs{[]string{url}} + anOffer := params.ApplicationOffer{ + ApplicationName: applicationName, + ApplicationDescription: "description", + ApplicationURL: url, + SourceModelTag: "environment-", + SourceLabel: "label", + Endpoints: []params.RemoteEndpoint{{Name: "db"}}, + } + + s.applicationDirectory.listOffers = func(filter params.OfferFilters) (params.ApplicationOfferResults, error) { + return params.ApplicationOfferResults{Offers: []params.ApplicationOffer{anOffer}}, nil + } + + found, err := s.api.ApplicationOffers(filter) + c.Assert(err, jc.ErrorIsNil) + c.Assert(found, jc.DeepEquals, + params.ApplicationOffersResults{[]params.ApplicationOfferResult{ + {Result: params.ApplicationOffer{ + ApplicationName: applicationName, + ApplicationDescription: "description", + ApplicationURL: url, + SourceModelTag: "environment-", + SourceLabel: "label", + Endpoints: []params.RemoteEndpoint{{Name: "db"}}}}, + }}) + s.applicationDirectory.CheckCallNames(c, listOffersBackendCall) +} + +func (s *crossmodelSuite) TestShowError(c *gc.C) { + url := "local:/u/fred/hosted-db2" + filter := params.ApplicationURLs{[]string{url}} + msg := "fail" + + s.applicationDirectory.listOffers = func(filter params.OfferFilters) (params.ApplicationOfferResults, error) { + return params.ApplicationOfferResults{}, errors.New(msg) + } + + found, err := s.api.ApplicationOffers(filter) + c.Assert(err, jc.ErrorIsNil) + c.Assert(found.Results, gc.HasLen, 1) + c.Assert(found.Results[0].Error, gc.ErrorMatches, fmt.Sprintf(".*%v.*", msg)) + s.applicationDirectory.CheckCallNames(c, listOffersBackendCall) +} + +func (s *crossmodelSuite) TestShowNotFound(c *gc.C) { + urls := []string{"local:/u/fred/hosted-db2"} + filter := params.ApplicationURLs{urls} + + s.applicationDirectory.listOffers = func(filter params.OfferFilters) (params.ApplicationOfferResults, error) { + return params.ApplicationOfferResults{}, nil + } + + found, err := s.api.ApplicationOffers(filter) + c.Assert(err, jc.ErrorIsNil) + c.Assert(found.Results, gc.HasLen, 1) + c.Assert(found.Results[0].Error.Error(), gc.Matches, fmt.Sprintf(`offer for remote application url %v not found`, urls[0])) + s.applicationDirectory.CheckCallNames(c, listOffersBackendCall) +} + +func (s *crossmodelSuite) TestShowErrorMsgMultipleURLs(c *gc.C) { + urls := []string{"local:/u/fred/prod/foo/hosted-db2", "local:/u/fred/hosted-db2"} + filter := params.ApplicationURLs{urls} + + s.applicationDirectory.listOffers = func(filter params.OfferFilters) (params.ApplicationOfferResults, error) { + return params.ApplicationOfferResults{}, nil + } + + found, err := s.api.ApplicationOffers(filter) + c.Assert(err, jc.ErrorIsNil) + c.Assert(found.Results, gc.HasLen, 2) + c.Assert(found.Results[0].Error.Error(), gc.Matches, fmt.Sprintf(`application URL has invalid form: %q`, urls[0])) + c.Assert(found.Results[1].Error.Error(), gc.Matches, fmt.Sprintf(`offer for remote application url %v not found`, urls[1])) + s.applicationDirectory.CheckCallNames(c, listOffersBackendCall) +} + +func (s *crossmodelSuite) TestShowNotFoundEmpty(c *gc.C) { + urls := []string{"local:/u/fred/hosted-db2"} + filter := params.ApplicationURLs{urls} + + s.applicationDirectory.listOffers = func(filter params.OfferFilters) (params.ApplicationOfferResults, error) { + return params.ApplicationOfferResults{}, nil + } + + found, err := s.api.ApplicationOffers(filter) + c.Assert(err, jc.ErrorIsNil) + c.Assert(found.Results, gc.HasLen, 1) + c.Assert(found.Results[0].Error.Error(), gc.Matches, fmt.Sprintf(`offer for remote application url %v not found`, urls[0])) + s.applicationDirectory.CheckCallNames(c, listOffersBackendCall) +} + +func (s *crossmodelSuite) TestShowFoundMultiple(c *gc.C) { + name := "test" + url := "local:/u/fred/hosted-db2" + anOffer := params.ApplicationOffer{ + ApplicationName: name, + ApplicationDescription: "description", + ApplicationURL: url, + SourceModelTag: "environment-", + SourceLabel: "label", + Endpoints: []params.RemoteEndpoint{{Name: "db"}}, + } + + name2 := "testAgain" + url2 := "local:/u/mary/hosted-db2" + anOffer2 := params.ApplicationOffer{ + ApplicationName: name2, + ApplicationDescription: "description2", + ApplicationURL: url2, + SourceModelTag: "environment-", + SourceLabel: "label2", + Endpoints: []params.RemoteEndpoint{{Name: "db2"}}, + } + + filter := params.ApplicationURLs{[]string{url, url2}} + + s.applicationDirectory.listOffers = func(filter params.OfferFilters) (params.ApplicationOfferResults, error) { + return params.ApplicationOfferResults{Offers: []params.ApplicationOffer{anOffer, anOffer2}}, nil + } + + found, err := s.api.ApplicationOffers(filter) + c.Assert(err, jc.ErrorIsNil) + c.Assert(found, jc.DeepEquals, params.ApplicationOffersResults{ + []params.ApplicationOfferResult{ + {Result: params.ApplicationOffer{ + ApplicationName: name, + ApplicationDescription: "description", + ApplicationURL: url, + SourceModelTag: "environment-", + SourceLabel: "label", + Endpoints: []params.RemoteEndpoint{{Name: "db"}}}}, + {Result: params.ApplicationOffer{ + ApplicationName: name2, + ApplicationDescription: "description2", + ApplicationURL: url2, + SourceModelTag: "environment-", + SourceLabel: "label2", + Endpoints: []params.RemoteEndpoint{{Name: "db2"}}}}, + }}) + s.applicationDirectory.CheckCallNames(c, listOffersBackendCall) +} + +var emptyFilterSet1 = params.OfferedApplicationFilters{ + Filters: []params.OfferedApplicationFilter{ + {FilterTerms: []params.OfferedApplicationFilterTerm{}}, + }, +} + +func (s *crossmodelSuite) TestFind(c *gc.C) { + applicationName := "test" + url := "local:/u/fred/hosted-db2" + + filter := params.OfferFilterParams{ + Filters: []params.OfferFilters{ + { + Directory: "local", + Filters: []params.OfferFilter{ + { + ApplicationURL: "local:/u/fred/hosted-db2", + ApplicationName: "test", + }, + }, + }, + }, + } + anOffer := params.ApplicationOffer{ + ApplicationName: applicationName, + ApplicationDescription: "description", + ApplicationURL: url, + SourceModelTag: "environment-", + SourceLabel: "label", + Endpoints: []params.RemoteEndpoint{{Name: "db"}}, + } + + s.applicationDirectory.listOffers = func(filter params.OfferFilters) (params.ApplicationOfferResults, error) { + c.Assert(filter, jc.DeepEquals, params.OfferFilters{ + Directory: "local", + Filters: []params.OfferFilter{ + { + ApplicationURL: "local:/u/fred/hosted-db2", + ApplicationName: "test", + }, + }, + }) + return params.ApplicationOfferResults{Offers: []params.ApplicationOffer{anOffer}}, nil + } + + found, err := s.api.FindApplicationOffers(filter) + c.Assert(err, jc.ErrorIsNil) + c.Assert(found, jc.DeepEquals, + params.FindApplicationOffersResults{ + Results: []params.ApplicationOfferResults{ + { + Offers: []params.ApplicationOffer{ + { + ApplicationName: applicationName, + ApplicationDescription: "description", + ApplicationURL: url, + SourceModelTag: "environment-", + SourceLabel: "label", + Endpoints: []params.RemoteEndpoint{{Name: "db"}}}}, + }}}) + s.applicationDirectory.CheckCallNames(c, listOffersBackendCall) +} + +func (s *crossmodelSuite) TestFindError(c *gc.C) { + filter := params.OfferFilterParams{Filters: []params.OfferFilters{{}}} + msg := "fail" + + s.applicationDirectory.listOffers = func(filter params.OfferFilters) (params.ApplicationOfferResults, error) { + return params.ApplicationOfferResults{}, errors.New(msg) + } + + found, err := s.api.FindApplicationOffers(filter) + c.Assert(err, jc.ErrorIsNil) + c.Assert(found.Results, gc.HasLen, 1) + c.Assert(found.Results[0].Error, gc.ErrorMatches, fmt.Sprintf(".*%v.*", msg)) + s.applicationDirectory.CheckCallNames(c, listOffersBackendCall) +} diff -Nru juju-core-2.0.0/src/github.com/juju/juju/apiserver/crossmodel/export_test.go juju-core-2.0.2/src/github.com/juju/juju/apiserver/crossmodel/export_test.go --- juju-core-2.0.0/src/github.com/juju/juju/apiserver/crossmodel/export_test.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/apiserver/crossmodel/export_test.go 2016-11-11 00:08:09.000000000 +0000 @@ -0,0 +1,18 @@ +// Copyright 2015 Canonical Ltd. +// Licensed under the AGPLv3, see LICENCE file for details. + +package crossmodel + +import "github.com/juju/juju/apiserver/params" + +var ( + CreateAPI = createAPI + CreateApplicationOffersAPI = createApplicationOffersAPI + CreateOfferedApplicationAPI = createOfferedApplicationAPI + NewServiceAPIFactory = newServiceAPIFactory + GetStateAccess = getStateAccess +) + +func MakeOfferedApplicationParams(api *API, p params.ApplicationOfferParams) (params.ApplicationOffer, error) { + return api.makeOfferedApplicationParams(p) +} diff -Nru juju-core-2.0.0/src/github.com/juju/juju/apiserver/crossmodel/mock_test.go juju-core-2.0.2/src/github.com/juju/juju/apiserver/crossmodel/mock_test.go --- juju-core-2.0.0/src/github.com/juju/juju/apiserver/crossmodel/mock_test.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/apiserver/crossmodel/mock_test.go 2016-11-11 00:08:09.000000000 +0000 @@ -0,0 +1,97 @@ +// Copyright 2015 Canonical Ltd. +// Licensed under the AGPLv3, see LICENCE file for details. + +package crossmodel_test + +import ( + "errors" + + jtesting "github.com/juju/testing" + "gopkg.in/juju/names.v2" + + "github.com/juju/juju/core/crossmodel" + "github.com/juju/juju/state" +) + +const ( + addOfferCall = "addOfferCall" + updateOfferCall = "updateOfferCall" + listOffersCall = "listOffersCall" + removeOfferCall = "removeOfferCall" +) + +type mockApplicationDirectory struct { + jtesting.Stub + + addOffer func(offer crossmodel.ApplicationOffer) error + listOffers func(filters ...crossmodel.ApplicationOfferFilter) ([]crossmodel.ApplicationOffer, error) +} + +func (m *mockApplicationDirectory) AddOffer(offer crossmodel.ApplicationOffer) error { + m.AddCall(addOfferCall) + return m.addOffer(offer) +} + +func (m *mockApplicationDirectory) ListOffers(filters ...crossmodel.ApplicationOfferFilter) ([]crossmodel.ApplicationOffer, error) { + m.AddCall(listOffersCall) + return m.listOffers(filters...) +} + +func (m *mockApplicationDirectory) UpdateOffer(offer crossmodel.ApplicationOffer) error { + m.AddCall(updateOfferCall) + panic("not implemented") +} + +func (m *mockApplicationDirectory) Remove(url string) error { + m.AddCall(removeOfferCall) + panic("not implemented") +} + +type mockState struct { + watchOfferedApplications func() state.StringsWatcher +} + +func (m *mockState) WatchOfferedApplications() state.StringsWatcher { + return m.watchOfferedApplications() +} + +func (m *mockState) ForModel(tag names.ModelTag) (*state.State, error) { + return nil, errors.New("not implemented") +} + +func (m *mockState) Application(name string) (application *state.Application, err error) { + return nil, errors.New("not implemented") +} + +func (m *mockState) ModelUUID() string { + return "uuid" +} + +func (m *mockState) ModelTag() names.ModelTag { + return names.NewModelTag("uuid") +} + +func (m *mockState) ModelName() (string, error) { + return "prod", nil +} + +type mockStringsWatcher struct { + state.StringsWatcher + changes chan []string +} + +func (m *mockStringsWatcher) Changes() <-chan []string { + return m.changes +} + +func (m *mockStringsWatcher) Stop() error { + return nil +} + +type mockOfferLister struct { + listOffers func(filters ...crossmodel.OfferedApplicationFilter) ([]crossmodel.OfferedApplication, error) +} + +func (m *mockOfferLister) ListOffers(filters ...crossmodel.OfferedApplicationFilter) ([]crossmodel.OfferedApplication, error) { + return m.listOffers(filters...) +} diff -Nru juju-core-2.0.0/src/github.com/juju/juju/apiserver/crossmodel/offeredapplications.go juju-core-2.0.2/src/github.com/juju/juju/apiserver/crossmodel/offeredapplications.go --- juju-core-2.0.0/src/github.com/juju/juju/apiserver/crossmodel/offeredapplications.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/apiserver/crossmodel/offeredapplications.go 2016-11-11 00:08:09.000000000 +0000 @@ -0,0 +1,105 @@ +// Copyright 2015 Canonical Ltd. +// Licensed under the AGPLv3, see LICENCE file for details. + +package crossmodel + +import ( + "github.com/juju/errors" + + "github.com/juju/juju/apiserver/common" + "github.com/juju/juju/apiserver/facade" + "github.com/juju/juju/apiserver/params" + "github.com/juju/juju/core/crossmodel" + "github.com/juju/juju/feature" + "github.com/juju/juju/state" + "github.com/juju/juju/state/watcher" +) + +func init() { + common.RegisterStandardFacadeForFeature("OfferedApplications", 1, newOfferedApplicationAPI, feature.CrossModelRelations) +} + +// OfferedApplicationLister instances allow offered applications to be queried. +type OfferedApplicationLister interface { + // ListOffers returns the offered applications matching the filter. + ListOffers(filter ...crossmodel.OfferedApplicationFilter) ([]crossmodel.OfferedApplication, error) +} + +// OfferedApplicationAPI is a facade used to access offered applications. +type OfferedApplicationAPI struct { + st Backend + offeredApplications OfferedApplicationLister + resources facade.Resources + authorizer facade.Authorizer +} + +// createApplicationDirectoryAPI returns a new cross model API facade. +func createOfferedApplicationAPI( + st Backend, + offeredApplicationLister OfferedApplicationLister, + resources facade.Resources, + authorizer facade.Authorizer, +) (*OfferedApplicationAPI, error) { + if !authorizer.AuthModelManager() { + return nil, common.ErrPerm + } + + return &OfferedApplicationAPI{ + st: st, + offeredApplications: offeredApplicationLister, + authorizer: authorizer, + resources: resources, + }, nil +} + +func newOfferedApplicationAPI( + st *state.State, + resources facade.Resources, + authorizer facade.Authorizer, +) (*OfferedApplicationAPI, error) { + return createOfferedApplicationAPI(getStateAccess(st), state.NewOfferedApplications(st), resources, authorizer) +} + +// WatchOfferedApplications creates a watcher to listen to changes to the offered applications. +func (s *OfferedApplicationAPI) WatchOfferedApplications() (params.StringsWatchResult, error) { + nothing := params.StringsWatchResult{} + watch := s.st.WatchOfferedApplications() + if changes, ok := <-watch.Changes(); ok { + return params.StringsWatchResult{ + StringsWatcherId: s.resources.Register(watch), + Changes: changes, + }, nil + } + return nothing, watcher.EnsureErr(watch) +} + +// OfferedApplications returns the offered applications matching the query parameters. +func (s *OfferedApplicationAPI) OfferedApplications(filter params.ApplicationURLs) (params.OfferedApplicationResults, error) { + offers := make([]params.OfferedApplicationResult, len(filter.ApplicationURLs)) + for i, url := range filter.ApplicationURLs { + offerResults, err := s.offeredApplications.ListOffers(crossmodel.OfferedApplicationFilter{ + ApplicationURL: url, + }) + if err != nil { + offers[i].Error = common.ServerError(err) + continue + } + if len(offerResults) == 0 { + offers[i].Error = common.ServerError(errors.NotFoundf("offered application at %q", url)) + continue + } + if len(offerResults) != 1 { + offers[i].Error = common.ServerError(errors.Errorf("expected 1 result, got %d", len(offerResults))) + continue + } + offers[i].Result = params.OfferedApplication{ + ApplicationURL: offerResults[0].ApplicationURL, + ApplicationName: offerResults[0].ApplicationName, + CharmName: offerResults[0].CharmName, + Description: offerResults[0].Description, + Registered: offerResults[0].Registered, + Endpoints: offerResults[0].Endpoints, + } + } + return params.OfferedApplicationResults{offers}, nil +} diff -Nru juju-core-2.0.0/src/github.com/juju/juju/apiserver/crossmodel/offeredapplications_test.go juju-core-2.0.2/src/github.com/juju/juju/apiserver/crossmodel/offeredapplications_test.go --- juju-core-2.0.0/src/github.com/juju/juju/apiserver/crossmodel/offeredapplications_test.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/apiserver/crossmodel/offeredapplications_test.go 2016-11-11 00:08:09.000000000 +0000 @@ -0,0 +1,150 @@ +// Copyright 2015 Canonical Ltd. +// Licensed under the AGPLv3, see LICENCE file for details. + +package crossmodel_test + +import ( + jc "github.com/juju/testing/checkers" + gc "gopkg.in/check.v1" + + apicrossmodel "github.com/juju/juju/api/crossmodel" + "github.com/juju/juju/apiserver/common" + "github.com/juju/juju/apiserver/crossmodel" + "github.com/juju/juju/apiserver/params" + "github.com/juju/juju/apiserver/testing" + jujucrossmodel "github.com/juju/juju/core/crossmodel" + "github.com/juju/juju/feature" + "github.com/juju/juju/state" + coretesting "github.com/juju/juju/testing" +) + +type offeredApplicationsSuite struct { + coretesting.BaseSuite + + resources *common.Resources + authoriser testing.FakeAuthorizer + api *crossmodel.OfferedApplicationAPI + + calls []string + offerLister *mockOfferLister + offers map[string]jujucrossmodel.OfferedApplication +} + +var _ = gc.Suite(&offeredApplicationsSuite{}) + +func (s *offeredApplicationsSuite) SetUpTest(c *gc.C) { + s.SetInitialFeatureFlags(feature.CrossModelRelations) + s.authoriser = testing.FakeAuthorizer{ + EnvironManager: true, + } + s.resources = common.NewResources() + s.AddCleanup(func(*gc.C) { s.resources.StopAll() }) + + s.calls = []string{} + s.offers = make(map[string]jujucrossmodel.OfferedApplication) + s.offerLister = s.constructOfferLister() + + var err error + s.api, err = crossmodel.CreateOfferedApplicationAPI(&mockState{}, s.offerLister, s.resources, s.authoriser) + c.Assert(err, jc.ErrorIsNil) +} + +func (s *offeredApplicationsSuite) TestUnauthorised(c *gc.C) { + s.authoriser = testing.FakeAuthorizer{ + EnvironManager: false, + } + _, err := crossmodel.CreateOfferedApplicationAPI(&mockState{}, s.offerLister, s.resources, s.authoriser) + c.Assert(err, gc.Equals, common.ErrPerm) +} + +func (s *offeredApplicationsSuite) TestWatchOfferedApplications(c *gc.C) { + authoriser := testing.FakeAuthorizer{ + EnvironManager: true, + } + resources := common.NewResources() + defer resources.StopAll() + + watcher := &mockStringsWatcher{ + changes: make(chan []string, 1), + } + watcher.changes <- []string{"local:/u/me/service", "local:/u/me/service"} + state := &mockState{ + watchOfferedApplications: func() state.StringsWatcher { + return watcher + }, + } + + api, err := crossmodel.CreateOfferedApplicationAPI(state, s.constructOfferLister(), resources, authoriser) + c.Assert(err, jc.ErrorIsNil) + watches, err := api.WatchOfferedApplications() + c.Assert(err, jc.ErrorIsNil) + c.Assert(watches, gc.DeepEquals, params.StringsWatchResult{ + StringsWatcherId: "1", + Changes: []string{"local:/u/me/service", "local:/u/me/service"}, + }) + c.Assert(resources.Get("1"), gc.Equals, watcher) +} + +func (s *offeredApplicationsSuite) assertCalls(c *gc.C, expectedCalls []string) { + c.Assert(s.calls, jc.SameContents, expectedCalls) +} + +func (s *offeredApplicationsSuite) constructOfferLister() *mockOfferLister { + return &mockOfferLister{ + listOffers: func(filters ...jujucrossmodel.OfferedApplicationFilter) ([]jujucrossmodel.OfferedApplication, error) { + s.calls = append(s.calls, "listoffers") + var result []jujucrossmodel.OfferedApplication + for _, filter := range filters { + if offer, ok := s.offers[filter.ApplicationURL]; ok { + result = append(result, offer) + } + } + return result, nil + }, + } +} + +func (s *offeredApplicationsSuite) TestListOffers(c *gc.C) { + s.offers["local:/u/user/servicename"] = jujucrossmodel.OfferedApplication{ + ApplicationURL: "local:/u/user/servicename", + ApplicationName: "service", + CharmName: "charm", + Description: "description", + Registered: true, + Endpoints: map[string]string{"foo": "bar"}, + } + s.offers["local:/u/user/anothername"] = jujucrossmodel.OfferedApplication{ + ApplicationURL: "local:/u/user/anothername", + ApplicationName: "service2", + CharmName: "charm2", + Description: "description2", + Registered: true, + Endpoints: map[string]string{"db": "db"}, + } + results, err := s.api.OfferedApplications(params.ApplicationURLs{ + ApplicationURLs: []string{"local:/u/user/servicename"}, + }) + c.Assert(err, jc.ErrorIsNil) + c.Assert(results.Results, gc.HasLen, 1) + s.assertCalls(c, []string{"listoffers"}) + offer := apicrossmodel.MakeOfferedApplicationFromParams(results.Results[0].Result) + c.Assert(offer, jc.DeepEquals, s.offers["local:/u/user/servicename"]) +} + +func (s *offeredApplicationsSuite) TestListOffersNoneFound(c *gc.C) { + s.offers["local:/u/user/servicename"] = jujucrossmodel.OfferedApplication{ + ApplicationURL: "local:/u/user/servicename", + ApplicationName: "service", + CharmName: "charm", + Description: "description", + Registered: true, + Endpoints: map[string]string{"foo": "bar"}, + } + results, err := s.api.OfferedApplications(params.ApplicationURLs{ + ApplicationURLs: []string{"local:/u/user/bogus"}, + }) + c.Assert(err, jc.ErrorIsNil) + c.Assert(results.Results, gc.HasLen, 1) + s.assertCalls(c, []string{"listoffers"}) + c.Assert(results.Results[0].Error.ErrorCode(), gc.Equals, params.CodeNotFound) +} diff -Nru juju-core-2.0.0/src/github.com/juju/juju/apiserver/crossmodel/offersapifactory.go juju-core-2.0.2/src/github.com/juju/juju/apiserver/crossmodel/offersapifactory.go --- juju-core-2.0.0/src/github.com/juju/juju/apiserver/crossmodel/offersapifactory.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/apiserver/crossmodel/offersapifactory.go 2016-11-11 00:08:09.000000000 +0000 @@ -0,0 +1,80 @@ +// Copyright 2015 Canonical Ltd. +// Licensed under the AGPLv3, see LICENCE file for details. + +package crossmodel + +import ( + "github.com/juju/errors" + + "github.com/juju/juju/apiserver/facade" + "github.com/juju/juju/core/crossmodel" + "github.com/juju/juju/state" +) + +// ApplicationOffersAPIFactory instances create ApplicationDirectory instance. +type ApplicationOffersAPIFactory interface { + facade.Resource + + // ApplicationOffers returns a application directory used to look up services + // based on the specified directory name. + ApplicationOffers(directory string) (ApplicationOffersAPI, error) +} + +type createApplicationDirectoryFunc func() crossmodel.ApplicationDirectory + +type closer interface { + Close() error +} + +type applicationOffersAPIFactory struct { + createLocalApplicationDirectory createApplicationDirectoryFunc + closer closer +} + +// newServiceAPIFactory creates a ApplicationOffersAPIFactory instance which +// is used to provide access to services for specified directories eg "local" or "vendor". +func newServiceAPIFactory(createFunc createApplicationDirectoryFunc, closer closer) (ApplicationOffersAPIFactory, error) { + return &applicationOffersAPIFactory{createFunc, closer}, nil +} + +// ApplicationOffers returns a application directory used to look up services +// based on the specified directory name. +func (s *applicationOffersAPIFactory) ApplicationOffers(directory string) (ApplicationOffersAPI, error) { + switch directory { + case "local": + return &localApplicationOffers{s.createLocalApplicationDirectory()}, nil + } + return nil, errors.NotSupportedf("application directory for %q", directory) +} + +// Stop is required by the Resource interface. +func (s *applicationOffersAPIFactory) Stop() error { + if s.closer != nil { + return s.closer.Close() + } + return nil +} + +// ApplicationOffersAPIFactoryResource is a function which returns the application offer api factory +// which can be used as an facade resource. +func ApplicationOffersAPIFactoryResource(st *state.State) (facade.Resource, error) { + controllerModelStata := st + controllerModel, err := st.ControllerModel() + if err != nil { + return nil, errors.Trace(err) + } + var closer closer + if st.ModelTag() != controllerModel.ModelTag() { + // We are not using the state server environment, so get one. + logger.Debugf("getting a controller connection, current model: %s", st.ModelTag()) + controllerModelStata, err = st.ForModel(controllerModel.ModelTag()) + if err != nil { + return nil, errors.Trace(err) + } + closer = controllerModelStata + } + return newServiceAPIFactory( + func() crossmodel.ApplicationDirectory { + return state.NewApplicationDirectory(controllerModelStata) + }, closer) +} diff -Nru juju-core-2.0.0/src/github.com/juju/juju/apiserver/crossmodel/offersapifactory_test.go juju-core-2.0.2/src/github.com/juju/juju/apiserver/crossmodel/offersapifactory_test.go --- juju-core-2.0.0/src/github.com/juju/juju/apiserver/crossmodel/offersapifactory_test.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/apiserver/crossmodel/offersapifactory_test.go 2016-11-11 00:08:09.000000000 +0000 @@ -0,0 +1,63 @@ +// Copyright 2015 Canonical Ltd. +// Licensed under the AGPLv3, see LICENCE file for details. + +package crossmodel_test + +import ( + "github.com/juju/errors" + jc "github.com/juju/testing/checkers" + gc "gopkg.in/check.v1" + + "github.com/juju/juju/apiserver/crossmodel" + jujucrossmodel "github.com/juju/juju/core/crossmodel" + "github.com/juju/juju/state" + "github.com/juju/juju/testing" +) + +type applicationURLSuite struct { + testing.BaseSuite +} + +var _ = gc.Suite(&applicationURLSuite{}) + +func (s *applicationURLSuite) TestUnsupportedURL(c *gc.C) { + f, err := crossmodel.NewServiceAPIFactory(nil, nil) + c.Assert(err, jc.ErrorIsNil) + _, err = f.ApplicationOffers("unsupported") + c.Assert(err, jc.Satisfies, errors.IsNotSupported) +} + +func (s *applicationURLSuite) TestLocalURL(c *gc.C) { + var st *state.State + f, err := crossmodel.NewServiceAPIFactory( + func() jujucrossmodel.ApplicationDirectory { return state.NewApplicationDirectory(st) }, + nil, + ) + c.Assert(err, jc.ErrorIsNil) + api, err := f.ApplicationOffers("local") + c.Assert(err, jc.ErrorIsNil) + _, ok := api.(crossmodel.ApplicationOffersAPI) + c.Assert(ok, jc.IsTrue) +} + +type closer struct { + called bool +} + +func (c *closer) Close() error { + c.called = true + return nil +} + +func (s *applicationURLSuite) TestStop(c *gc.C) { + var st *state.State + closer := &closer{} + f, err := crossmodel.NewServiceAPIFactory( + func() jujucrossmodel.ApplicationDirectory { return state.NewApplicationDirectory(st) }, + closer, + ) + c.Assert(err, jc.ErrorIsNil) + err = f.Stop() + c.Assert(err, jc.ErrorIsNil) + c.Assert(closer.called, jc.IsTrue) +} diff -Nru juju-core-2.0.0/src/github.com/juju/juju/apiserver/crossmodel/package_test.go juju-core-2.0.2/src/github.com/juju/juju/apiserver/crossmodel/package_test.go --- juju-core-2.0.0/src/github.com/juju/juju/apiserver/crossmodel/package_test.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/apiserver/crossmodel/package_test.go 2016-11-11 00:08:09.000000000 +0000 @@ -0,0 +1,14 @@ +// Copyright 2015 Canonical Ltd. +// Licensed under the AGPLv3, see LICENCE file for details. + +package crossmodel_test + +import ( + stdtesting "testing" + + "github.com/juju/juju/testing" +) + +func TestAll(t *stdtesting.T) { + testing.MgoTestPackage(t) +} diff -Nru juju-core-2.0.0/src/github.com/juju/juju/apiserver/crossmodel/state.go juju-core-2.0.2/src/github.com/juju/juju/apiserver/crossmodel/state.go --- juju-core-2.0.0/src/github.com/juju/juju/apiserver/crossmodel/state.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/apiserver/crossmodel/state.go 2016-11-11 00:08:09.000000000 +0000 @@ -0,0 +1,38 @@ +// Copyright 2015 Canonical Ltd. +// Licensed under the AGPLv3, see LICENCE file for details. + +package crossmodel + +import ( + "gopkg.in/juju/names.v2" + + "github.com/juju/juju/state" +) + +// Backend provides selected methods off the state.State struct +// plus additional helpers. +type Backend interface { + Application(name string) (*state.Application, error) + ForModel(modelTag names.ModelTag) (*state.State, error) + ModelTag() names.ModelTag + ModelUUID() string + WatchOfferedApplications() state.StringsWatcher + ModelName() (string, error) +} + +var getStateAccess = func(st *state.State) Backend { + return &stateShim{st} +} + +type stateShim struct { + *state.State +} + +// ModelName returns the name of the model. +func (s *stateShim) ModelName() (string, error) { + cfg, err := s.ModelConfig() + if err != nil { + return "", err + } + return cfg.Name(), nil +} diff -Nru juju-core-2.0.0/src/github.com/juju/juju/apiserver/logsink.go juju-core-2.0.2/src/github.com/juju/juju/apiserver/logsink.go --- juju-core-2.0.0/src/github.com/juju/juju/apiserver/logsink.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/apiserver/logsink.go 2016-11-11 00:08:09.000000000 +0000 @@ -23,23 +23,21 @@ "github.com/juju/juju/state" ) -func newLogSinkHandler(h httpContext, logDir string) http.Handler { +func newLogSinkHandler(h httpContext, w io.Writer) http.Handler { + return &logSinkHandler{ctxt: h, fileLogger: w} +} +func newLogSinkWriter(logDir string) (io.WriteCloser, error) { logPath := filepath.Join(logDir, "logsink.log") if err := primeLogFile(logPath); err != nil { - // This isn't a fatal error so log and continue if priming - // fails. - logger.Errorf("Unable to prime %s (proceeding anyway): %v", logPath, err) - } - - return &logSinkHandler{ - ctxt: h, - fileLogger: &lumberjack.Logger{ - Filename: logPath, - MaxSize: 300, // MB - MaxBackups: 2, - }, + // This isn't a fatal error so log and continue if priming fails. + logger.Warningf("Unable to prime %s (proceeding anyway): %v", logPath, err) } + return &lumberjack.Logger{ + Filename: logPath, + MaxSize: 300, // MB + MaxBackups: 2, + }, nil } // primeLogFile ensures the logsink log file is created with the @@ -56,7 +54,7 @@ type logSinkHandler struct { ctxt httpContext - fileLogger io.WriteCloser + fileLogger io.Writer } // ServeHTTP implements the http.Handler interface. @@ -100,7 +98,10 @@ select { case <-h.ctxt.stop(): return - case m := <-logCh: + case m, ok := <-logCh: + if !ok { + return + } fileErr := h.logToFile(filePrefix, m) if fileErr != nil { logger.Errorf("logging to logsink.log failed: %v", fileErr) @@ -136,6 +137,7 @@ logCh := make(chan params.LogRecord) go func() { + defer close(logCh) var m params.LogRecord for { // Receive() blocks until data arrives but will also be diff -Nru juju-core-2.0.0/src/github.com/juju/juju/apiserver/logsink_test.go juju-core-2.0.2/src/github.com/juju/juju/apiserver/logsink_test.go --- juju-core-2.0.0/src/github.com/juju/juju/apiserver/logsink_test.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/apiserver/logsink_test.go 2016-11-11 00:08:09.000000000 +0000 @@ -5,6 +5,7 @@ import ( "bufio" + "io" "io/ioutil" "net/http" "net/url" @@ -64,7 +65,7 @@ c.Assert(loggo.RegisterWriter("logsink-tests", writer), jc.ErrorIsNil) } -func (s *logsinkSuite) TestRejectsBadEnvironUUID(c *gc.C) { +func (s *logsinkSuite) TestRejectsBadModelUUID(c *gc.C) { reader := s.openWebsocketCustomPath(c, "/model/does-not-exist/logsink") assertJSONError(c, reader, `unknown model: "does-not-exist"`) assertWebsocketClosed(c, reader) @@ -202,6 +203,24 @@ } } +func (s *logsinkSuite) TestReceiveErrorBreaksConn(c *gc.C) { + conn := s.dialWebsocket(c) + defer conn.Close() + + // Read back the nil error, indicating that all is well. + reader := bufio.NewReader(conn) + errResult := readJSONErrorLine(c, reader) + c.Assert(errResult.Error, gc.IsNil) + + // The logsink handler expects JSON messages. Send some + // junk to verify that the server closes the connection. + err := websocket.Message.Send(conn, "junk!") + c.Assert(err, jc.ErrorIsNil) + + _, err = conn.Read(make([]byte, 1024)) + c.Assert(err, gc.Equals, io.EOF) +} + func (s *logsinkSuite) dialWebsocket(c *gc.C) *websocket.Conn { return s.dialWebsocketInternal(c, s.makeAuthHeader()) } diff -Nru juju-core-2.0.0/src/github.com/juju/juju/apiserver/metricsmanager/metricsmanager_test.go juju-core-2.0.2/src/github.com/juju/juju/apiserver/metricsmanager/metricsmanager_test.go --- juju-core-2.0.0/src/github.com/juju/juju/apiserver/metricsmanager/metricsmanager_test.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/apiserver/metricsmanager/metricsmanager_test.go 2016-11-11 00:08:09.000000000 +0000 @@ -26,6 +26,7 @@ type metricsManagerSuite struct { jujujutesting.JujuConnSuite + clock *jujutesting.Clock metricsmanager *metricsmanager.MetricsManagerAPI authorizer apiservertesting.FakeAuthorizer unit *state.Unit @@ -39,7 +40,8 @@ Tag: names.NewMachineTag("0"), EnvironManager: true, } - manager, err := metricsmanager.NewMetricsManagerAPI(s.State, nil, s.authorizer, jujutesting.NewClock(time.Now())) + s.clock = jujutesting.NewClock(time.Now()) + manager, err := metricsmanager.NewMetricsManagerAPI(s.State, nil, s.authorizer, s.clock) c.Assert(err, jc.ErrorIsNil) s.metricsmanager = manager meteredCharm := s.Factory.MakeCharm(c, &factory.CharmParams{Name: "metered", URL: "cs:quantal/metered"}) @@ -185,7 +187,7 @@ func (s *metricsManagerSuite) TestMeterStatusSuccessfulSend(c *gc.C) { var sender testing.MockSender - pastTime := time.Now().Add(-time.Second) + pastTime := s.clock.Now().Add(-time.Second) metric := state.Metric{"pings", "5", pastTime} s.Factory.MakeMetric(c, &factory.MetricParams{Unit: s.unit, Sent: false, Time: &pastTime, Metrics: []state.Metric{metric}}) metricsmanager.PatchSender(&sender) diff -Nru juju-core-2.0.0/src/github.com/juju/juju/apiserver/params/crossmodel.go juju-core-2.0.2/src/github.com/juju/juju/apiserver/params/crossmodel.go --- juju-core-2.0.0/src/github.com/juju/juju/apiserver/params/crossmodel.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/apiserver/params/crossmodel.go 2016-11-11 00:08:09.000000000 +0000 @@ -0,0 +1,225 @@ +// Copyright 2015 Canonical Ltd. +// Licensed under the AGPLv3, see LICENCE file for details. + +package params + +import ( + "gopkg.in/juju/charm.v6-unstable" +) + +// OfferFilterParams contains filters used to query application offers +// from one or more directories. +type OfferFilterParams struct { + Filters []OfferFilters `json:"filters"` +} + +// EndpointFilterAttributes is used to filter offers matching the +// specified endpoint criteria. +type EndpointFilterAttributes struct { + Role charm.RelationRole `json:"role"` + Interface string `json:"interface"` + Name string `json:"name"` +} + +// OfferFilters is used to query offers in an application directory. +// Offers matching any of the filters are returned. +type OfferFilters struct { + Directory string + Filters []OfferFilter +} + +// OfferFilter is used to query offers in a application directory. +type OfferFilter struct { + ApplicationURL string `json:"application-url"` + SourceLabel string `json:"source-label"` + SourceModelUUIDTag string `json:"source-uuid"` + ApplicationName string `json:"application-name"` + ApplicationDescription string `json:"application-description"` + ApplicationUser string `json:"application-user"` + Endpoints []EndpointFilterAttributes `json:"endpoints"` + AllowedUserTags []string `json:"allowed-users"` +} + +// ApplicationOffer represents an application offering from an external model. +type ApplicationOffer struct { + ApplicationURL string `json:"application-url"` + SourceModelTag string `json:"source-model-tag"` + SourceLabel string `json:"source-label"` + ApplicationName string `json:"application-name"` + ApplicationDescription string `json:"application-description"` + Endpoints []RemoteEndpoint `json:"endpoints"` +} + +// AddApplicationOffers is used when adding offers to a application directory. +type AddApplicationOffers struct { + Offers []AddApplicationOffer +} + +// AddApplicationOffer represents a application offering from an external environment. +type AddApplicationOffer struct { + ApplicationOffer + // UserTags are those who can consume the offer. + UserTags []string `json:"users"` +} + +// ApplicationOfferResults is a result of listing application offers. +type ApplicationOfferResults struct { + Offers []ApplicationOffer + Error *Error +} + +// RemoteEndpoint represents a remote application endpoint. +type RemoteEndpoint struct { + Name string `json:"name"` + Role charm.RelationRole `json:"role"` + Interface string `json:"interface"` + Limit int `json:"limit"` + Scope charm.RelationScope `json:"scope"` +} + +// ApplicationOfferParams is used to offer remote applications. +type ApplicationOfferParams struct { + // ModelTag is the tag of the model containing the application to offer. + ModelTag string `json:"model-tag"` + + // ApplicationURL may contain user supplied application url. + ApplicationURL string `json:"application-url,omitempty"` + + // ApplicationName contains name of application being offered. + ApplicationName string `json:"application-name"` + + // ApplicationDescription is description for the offered application. + // For now, this defaults to description provided in the charm or + // is supplied by the user. + ApplicationDescription string `json:"application-description"` + + // Endpoints contains offered application endpoints. + Endpoints []string `json:"endpoints"` + + // AllowedUserTags contains tags of users that are allowed to use this offered application. + AllowedUserTags []string `json:"allowed-users"` +} + +// ApplicationOffersParams contains a collection of offers to allow adding offers in bulk. +type ApplicationOffersParams struct { + Offers []ApplicationOfferParams `json:"offers"` +} + +// FindApplicationOffersResults is a result of finding remote application offers. +type FindApplicationOffersResults struct { + // Results contains application offers matching each filter. + Results []ApplicationOfferResults `json:"results"` +} + +// ApplicationOfferResult is a result of listing a remote application offer. +type ApplicationOfferResult struct { + // Result contains application offer information. + Result ApplicationOffer `json:"result"` + + // Error contains related error. + Error *Error `json:"error,omitempty"` +} + +// ApplicationOffersResults is a result of listing remote application offers. +type ApplicationOffersResults struct { + // Result contains collection of remote application results. + Results []ApplicationOfferResult `json:"results,omitempty"` +} + +// ApplicationURLs is a filter used to select remote applications via show call. +type ApplicationURLs struct { + // ApplicationURLs contains collection of urls for applications that are to be shown. + ApplicationURLs []string `json:"application-urls,omitempty"` +} + +// OfferedApplication represents attributes for an offered application. +type OfferedApplication struct { + ApplicationURL string `json:"application-url"` + ApplicationName string `json:"application-name"` + CharmName string `json:"charm-name"` + Description string `json:"description"` + Registered bool `json:"registered"` + Endpoints map[string]string `json:"endpoints"` +} + +// OfferedApplicationResult holds the result of loading an +// offered application at a URL. +type OfferedApplicationResult struct { + Result OfferedApplication `json:"result"` + Error *Error `json:"error,omitempty"` +} + +// OfferedApplicationResults represents the result of a ListOfferedApplications call. +type OfferedApplicationResults struct { + Results []OfferedApplicationResult +} + +// OfferedApplicationDetails is an application found during a request to list remote applications. +type OfferedApplicationDetails struct { + // ApplicationURL may contain user supplied application URL. + ApplicationURL string `json:"application-url,omitempty"` + + // ApplicationName contains name of application being offered. + ApplicationName string `json:"application-name"` + + // CharmName is the charm name of this service. + CharmName string `json:"charm-name"` + + // UsersCount is the count of how many users are connected to this shared application. + UsersCount int `json:"users-count,omitempty"` + + // Endpoints is a list of charm relations that this remote application offered. + Endpoints []RemoteEndpoint `json:"endpoints"` +} + +// OfferedApplicationDetailsResult is a result of listing a remote application. +type OfferedApplicationDetailsResult struct { + // Result contains remote application information. + Result *OfferedApplicationDetails `json:"result,omitempty"` + + // Error contains error related to this item. + Error *Error `json:"error,omitempty"` +} + +// ListOffersFilterResults is a result of listing remote application offers +// for an application directory. +type ListOffersFilterResults struct { + // Error contains error related to this directory. + Error *Error `json:"error,omitempty"` + + // Result contains collection of remote application item results for this directory. + Result []OfferedApplicationDetailsResult `json:"result,omitempty"` +} + +// ListOffersResults is a result of listing remote application offers +// for application directories. +type ListOffersResults struct { + // Results contains collection of remote directories results. + Results []ListOffersFilterResults `json:"results,omitempty"` +} + +// OfferedApplicationFilters has sets of filters that +// are used by a vendor to query remote applications that the vendor has offered. +type OfferedApplicationFilters struct { + Filters []OfferedApplicationFilter `json:"filters,omitempty"` +} + +// OfferedApplicationFilter has a set of filter terms that +// are used by a vendor to query remote applications that the vendor has offered. +type OfferedApplicationFilter struct { + FilterTerms []OfferedApplicationFilterTerm `json:"filter-terms,omitempty"` +} + +// OfferedApplicationFilterTerm has filter criteria that +// are used by a vendor to query remote applications that the vendor has offered. +type OfferedApplicationFilterTerm struct { + // ApplicationURL is url for remote application. + // This may be a part of valid URL. + ApplicationURL string `json:"application-url,omitempty"` + + // Endpoint contains endpoint properties for filter. + Endpoint RemoteEndpoint `json:"endpoint"` + + // CharmName is the charm name of this application. + CharmName string `json:"charm-name,omitempty"` +} diff -Nru juju-core-2.0.0/src/github.com/juju/juju/apiserver/params/internal.go juju-core-2.0.2/src/github.com/juju/juju/apiserver/params/internal.go --- juju-core-2.0.0/src/github.com/juju/juju/apiserver/params/internal.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/apiserver/params/internal.go 2016-11-11 00:08:09.000000000 +0000 @@ -537,6 +537,70 @@ Results []RelationUnitsWatchResult `json:"results"` } +// ApplicationRelationsWatchResult holds a ApplicationRelationsWatcher id, +// changes and an error (if any). +type ApplicationRelationsWatchResult struct { + ApplicationRelationsWatcherId string + Changes *ApplicationRelationsChange `json:"changes,omitempty"` + Error *Error `json:"error,omitempty"` +} + +// ApplicationRelationsWatchResults holds the results for any API call which ends +// up returning a list of ApplicationRelationsWatchers. +type ApplicationRelationsWatchResults struct { + Results []ApplicationRelationsWatchResult `json:"results"` +} + +// ApplicationChange describes changes to a service. +type ApplicationChange struct { + ApplicationTag string `json:"application-tag"` + Life Life `json:"life"` + Relations ApplicationRelationsChange `json:"relations"` +} + +// ApplicationChanges describes a set of changes to services. +type ApplicationChanges struct { + Changes []ApplicationChange `json:"changes,omitempty"` +} + +// ApplicationRelationsChange describes changes to the relations that a service +// is involved in. +type ApplicationRelationsChange struct { + // ChangedRelations maps relation IDs to relation changes. + ChangedRelations []RelationChange `json:"changed,omitempty"` + + // RemovedRelations contains the IDs of relations removed + // since the last change. + RemovedRelations []int `json:"removed,omitempty"` +} + +// ApplicationRelationsChanges holds a set of ApplicationRelationsChange structures. +type ApplicationRelationsChanges struct { + Changes []ApplicationRelationsChange `json:"changes,omitempty"` +} + +// RelationChange describes changes to a relation. +type RelationChange struct { + // RelationId is the numeric ID of the relation. + RelationId int `json:"id"` + + // Life is the current lifecycle state of the relation. + Life Life `json:"life"` + + // ChangedUnits maps unit names to relation unit changes. + ChangedUnits map[string]RelationUnitChange `json:"changedunits,omitempty"` + + // DepartedUnits contains the names of units that have departed + // the relation since the last change. + DepartedUnits []string `json:"departedunits,omitempty"` +} + +// RelationUnitChange describes a relation unit change. +type RelationUnitChange struct { + // Settings is the current settings for the relation unit. + Settings map[string]interface{} `json:"settings,omitempty"` +} + // MachineStorageIdsWatchResult holds a MachineStorageIdsWatcher id, // changes and an error (if any). type MachineStorageIdsWatchResult struct { diff -Nru juju-core-2.0.0/src/github.com/juju/juju/apiserver/params/ssh.go juju-core-2.0.2/src/github.com/juju/juju/apiserver/params/ssh.go --- juju-core-2.0.0/src/github.com/juju/juju/apiserver/params/ssh.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/apiserver/params/ssh.go 2016-11-11 00:08:09.000000000 +0000 @@ -33,6 +33,19 @@ Address string `json:"address,omitempty"` } +// SSHAddressesResults defines the response from AllAddresses on the SSHClient +// API facade. +type SSHAddressesResults struct { + Results []SSHAddressesResult `json:"results"` +} + +// SSHAddressesResult defines a single result with multiple addresses (see +// SSHAddressesResults). +type SSHAddressesResult struct { + Error *Error `json:"error,omitempty"` + Addresses []string `json:"addresses"` +} + // SSHPublicKeysResults is used to return SSH public host keys for one // or more target for the SSHClient.PublicKeys API. type SSHPublicKeysResults struct { diff -Nru juju-core-2.0.0/src/github.com/juju/juju/apiserver/params/status.go juju-core-2.0.2/src/github.com/juju/juju/apiserver/params/status.go --- juju-core-2.0.0/src/github.com/juju/juju/apiserver/params/status.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/apiserver/params/status.go 2016-11-11 00:08:09.000000000 +0000 @@ -21,10 +21,11 @@ // FullStatus holds information about the status of a juju model. type FullStatus struct { - Model ModelStatusInfo `json:"model"` - Machines map[string]MachineStatus `json:"machines"` - Applications map[string]ApplicationStatus `json:"applications"` - Relations []RelationStatus `json:"relations"` + Model ModelStatusInfo `json:"model"` + Machines map[string]MachineStatus `json:"machines"` + Applications map[string]ApplicationStatus `json:"applications"` + RemoteApplications map[string]RemoteApplicationStatus `json:"remote-applications"` + Relations []RelationStatus `json:"relations"` } // ModelStatusInfo holds status information about the model itself. @@ -87,6 +88,17 @@ WorkloadVersion string `json:"workload-version"` } +// RemoteApplicationStatus holds status info about a remote application. +type RemoteApplicationStatus struct { + Err error `json:"err,omitempty"` + ApplicationURL string `json:"application-url"` + ApplicationName string `json:"application-name"` + Endpoints []RemoteEndpoint `json:"endpoints"` + Life string `json:"life"` + Relations map[string][]string `json:"relations"` + Status DetailedStatus `json:"status"` +} + // MeterStatus represents the meter status of a unit. type MeterStatus struct { Color string `json:"color"` diff -Nru juju-core-2.0.0/src/github.com/juju/juju/apiserver/remoterelations/mock_test.go juju-core-2.0.2/src/github.com/juju/juju/apiserver/remoterelations/mock_test.go --- juju-core-2.0.0/src/github.com/juju/juju/apiserver/remoterelations/mock_test.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/apiserver/remoterelations/mock_test.go 2016-11-11 00:08:09.000000000 +0000 @@ -0,0 +1,294 @@ +// Copyright 2015 Canonical Ltd. +// Licensed under the AGPLv3, see LICENCE file for details. + +package remoterelations_test + +import ( + "gopkg.in/tomb.v1" + + "github.com/juju/errors" + "github.com/juju/juju/apiserver/params" + "github.com/juju/juju/apiserver/remoterelations" + "github.com/juju/juju/state" + "github.com/juju/testing" +) + +type mockState struct { + testing.Stub + relations map[string]*mockRelation + remoteApplications map[string]*mockRemoteApplication + remoteApplicationsWatcher *mockStringsWatcher + applicationRelationsWatchers map[string]*mockStringsWatcher +} + +func newMockState() *mockState { + return &mockState{ + relations: make(map[string]*mockRelation), + remoteApplications: make(map[string]*mockRemoteApplication), + remoteApplicationsWatcher: newMockStringsWatcher(), + applicationRelationsWatchers: make(map[string]*mockStringsWatcher), + } +} + +func (st *mockState) KeyRelation(key string) (remoterelations.Relation, error) { + st.MethodCall(st, "KeyRelation", key) + if err := st.NextErr(); err != nil { + return nil, err + } + r, ok := st.relations[key] + if !ok { + return nil, errors.NotFoundf("relation %q", key) + } + return r, nil +} + +func (st *mockState) Relation(id int) (remoterelations.Relation, error) { + st.MethodCall(st, "Relation", id) + if err := st.NextErr(); err != nil { + return nil, err + } + for _, r := range st.relations { + if r.id == id { + return r, nil + } + } + return nil, errors.NotFoundf("relation %d", id) +} + +func (st *mockState) RemoteApplication(id string) (remoterelations.RemoteApplication, error) { + st.MethodCall(st, "RemoteApplication", id) + if err := st.NextErr(); err != nil { + return nil, err + } + s, ok := st.remoteApplications[id] + if !ok { + return nil, errors.NotFoundf("remote application %q", id) + } + return s, nil +} + +func (st *mockState) WatchRemoteApplications() state.StringsWatcher { + st.MethodCall(st, "WatchRemoteApplications") + return st.remoteApplicationsWatcher +} + +func (st *mockState) WatchRemoteApplicationRelations(applicationName string) (state.StringsWatcher, error) { + st.MethodCall(st, "WatchRemoteApplicationRelations", applicationName) + if err := st.NextErr(); err != nil { + return nil, err + } + w, ok := st.applicationRelationsWatchers[applicationName] + if !ok { + return nil, errors.NotFoundf("application %q", applicationName) + } + return w, nil +} + +type mockRelation struct { + testing.Stub + id int + life state.Life + units map[string]remoterelations.RelationUnit + endpointUnitsWatchers map[string]*mockRelationUnitsWatcher +} + +func newMockRelation(id int) *mockRelation { + return &mockRelation{ + id: id, + life: state.Alive, + units: make(map[string]remoterelations.RelationUnit), + endpointUnitsWatchers: make(map[string]*mockRelationUnitsWatcher), + } +} + +func (r *mockRelation) Id() int { + r.MethodCall(r, "Id") + return r.id +} + +func (r *mockRelation) Life() state.Life { + r.MethodCall(r, "Life") + return r.life +} + +func (r *mockRelation) Destroy() error { + r.MethodCall(r, "Destroy") + return r.NextErr() +} + +func (r *mockRelation) RemoteUnit(unitId string) (remoterelations.RelationUnit, error) { + r.MethodCall(r, "RemoteUnit", unitId) + if err := r.NextErr(); err != nil { + return nil, err + } + u, ok := r.units[unitId] + if !ok { + return nil, errors.NotFoundf("unit %q", unitId) + } + return u, nil +} + +func (r *mockRelation) Unit(unitId string) (remoterelations.RelationUnit, error) { + r.MethodCall(r, "Unit", unitId) + if err := r.NextErr(); err != nil { + return nil, err + } + u, ok := r.units[unitId] + if !ok { + return nil, errors.NotFoundf("unit %q", unitId) + } + return u, nil +} + +func (r *mockRelation) WatchCounterpartEndpointUnits(applicationName string) (state.RelationUnitsWatcher, error) { + r.MethodCall(r, "WatchCounterpartEndpointUnits", applicationName) + if err := r.NextErr(); err != nil { + return nil, err + } + w, ok := r.endpointUnitsWatchers[applicationName] + if !ok { + return nil, errors.NotFoundf("application %q", applicationName) + } + return w, nil +} + +type mockRemoteApplication struct { + testing.Stub + name string + url string +} + +func newMockRemoteApplication(name, url string) *mockRemoteApplication { + return &mockRemoteApplication{ + name: name, url: url, + } +} + +func (r *mockRemoteApplication) Name() string { + r.MethodCall(r, "Name") + return r.name +} + +func (r *mockRemoteApplication) URL() string { + r.MethodCall(r, "URL") + return r.url +} + +func (r *mockRemoteApplication) Destroy() error { + r.MethodCall(r, "Destroy") + return r.NextErr() +} + +type mockWatcher struct { + testing.Stub + tomb.Tomb +} + +func (w *mockWatcher) doneWhenDying() { + <-w.Tomb.Dying() + w.Tomb.Done() +} + +func (w *mockWatcher) Kill() { + w.MethodCall(w, "Kill") + w.Tomb.Kill(nil) +} + +func (w *mockWatcher) Stop() error { + w.MethodCall(w, "Stop") + if err := w.NextErr(); err != nil { + return err + } + w.Tomb.Kill(nil) + return w.Tomb.Wait() +} + +type mockStringsWatcher struct { + mockWatcher + changes chan []string +} + +func newMockStringsWatcher() *mockStringsWatcher { + w := &mockStringsWatcher{changes: make(chan []string, 1)} + go w.doneWhenDying() + return w +} + +func (w *mockStringsWatcher) Changes() <-chan []string { + w.MethodCall(w, "Changes") + return w.changes +} + +type mockRelationUnitsWatcher struct { + mockWatcher + changes chan params.RelationUnitsChange +} + +func newMockRelationUnitsWatcher() *mockRelationUnitsWatcher { + w := &mockRelationUnitsWatcher{ + changes: make(chan params.RelationUnitsChange, 1), + } + go w.doneWhenDying() + return w +} + +func (w *mockRelationUnitsWatcher) Changes() <-chan params.RelationUnitsChange { + w.MethodCall(w, "Changes") + return w.changes +} + +type mockRelationUnit struct { + testing.Stub + inScope bool + settings map[string]interface{} +} + +func newMockRelationUnit() *mockRelationUnit { + return &mockRelationUnit{ + settings: make(map[string]interface{}), + } +} + +func (u *mockRelationUnit) Settings() (map[string]interface{}, error) { + u.MethodCall(u, "Settings") + return u.settings, u.NextErr() +} + +func (u *mockRelationUnit) InScope() (bool, error) { + u.MethodCall(u, "InScope") + return u.inScope, u.NextErr() +} + +func (u *mockRelationUnit) LeaveScope() error { + u.MethodCall(u, "LeaveScope") + if err := u.NextErr(); err != nil { + return err + } + u.inScope = false + return nil +} + +func (u *mockRelationUnit) EnterScope(settings map[string]interface{}) error { + u.MethodCall(u, "EnterScope", settings) + if err := u.NextErr(); err != nil { + return err + } + u.inScope = true + u.settings = make(map[string]interface{}) + for k, v := range settings { + u.settings[k] = v + } + return nil +} + +func (u *mockRelationUnit) ReplaceSettings(settings map[string]interface{}) error { + u.MethodCall(u, "ReplaceSettings", settings) + if err := u.NextErr(); err != nil { + return err + } + u.settings = make(map[string]interface{}) + for k, v := range settings { + u.settings[k] = v + } + return nil +} diff -Nru juju-core-2.0.0/src/github.com/juju/juju/apiserver/remoterelations/package_test.go juju-core-2.0.2/src/github.com/juju/juju/apiserver/remoterelations/package_test.go --- juju-core-2.0.0/src/github.com/juju/juju/apiserver/remoterelations/package_test.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/apiserver/remoterelations/package_test.go 2016-11-11 00:08:09.000000000 +0000 @@ -0,0 +1,14 @@ +// Copyright 2015 Canonical Ltd. +// Licensed under the AGPLv3, see LICENCE file for details. + +package remoterelations_test + +import ( + testing "testing" + + gc "gopkg.in/check.v1" +) + +func TestAll(t *testing.T) { + gc.TestingT(t) +} diff -Nru juju-core-2.0.0/src/github.com/juju/juju/apiserver/remoterelations/remoterelations.go juju-core-2.0.2/src/github.com/juju/juju/apiserver/remoterelations/remoterelations.go --- juju-core-2.0.0/src/github.com/juju/juju/apiserver/remoterelations/remoterelations.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/apiserver/remoterelations/remoterelations.go 2016-11-11 00:08:09.000000000 +0000 @@ -0,0 +1,525 @@ +// Copyright 2015 Canonical Ltd. +// Licensed under the AGPLv3, see LICENCE file for details. + +package remoterelations + +import ( + "github.com/juju/errors" + "github.com/juju/loggo" + "github.com/juju/utils/set" + "gopkg.in/juju/names.v2" + "gopkg.in/tomb.v1" + + "github.com/juju/juju/apiserver/common" + "github.com/juju/juju/apiserver/facade" + "github.com/juju/juju/apiserver/params" + "github.com/juju/juju/feature" + "github.com/juju/juju/state" + "github.com/juju/juju/state/watcher" +) + +var logger = loggo.GetLogger("juju.apiserver.remoterelations") + +func init() { + common.RegisterStandardFacadeForFeature("RemoteRelations", 1, NewStateRemoteRelationsAPI, feature.CrossModelRelations) +} + +// RemoteRelationsAPI provides access to the Provisioner API facade. +type RemoteRelationsAPI struct { + st RemoteRelationsState + resources facade.Resources + authorizer facade.Authorizer +} + +// NewRemoteRelationsAPI creates a new server-side RemoteRelationsAPI facade +// backed by global state. +func NewStateRemoteRelationsAPI( + st *state.State, + resources facade.Resources, + authorizer facade.Authorizer, +) (*RemoteRelationsAPI, error) { + return NewRemoteRelationsAPI(stateShim{st}, resources, authorizer) +} + +// NewRemoteRelationsAPI returns a new server-side RemoteRelationsAPI facade. +func NewRemoteRelationsAPI( + st RemoteRelationsState, + resources facade.Resources, + authorizer facade.Authorizer, +) (*RemoteRelationsAPI, error) { + if !authorizer.AuthModelManager() { + return nil, common.ErrPerm + } + return &RemoteRelationsAPI{ + st: st, + resources: resources, + authorizer: authorizer, + }, nil +} + +// ConsumeRemoteApplicationChange consumes remote changes to applications into the +// local environment. +func (api *RemoteRelationsAPI) ConsumeRemoteApplicationChange( + changes params.ApplicationChanges, +) (params.ErrorResults, error) { + results := params.ErrorResults{ + Results: make([]params.ErrorResult, len(changes.Changes)), + } + handleApplicationRelationsChange := func(change params.ApplicationRelationsChange) error { + // For any relations that have been removed on the offering + // side, destroy them on the consuming side. + for _, relId := range change.RemovedRelations { + rel, err := api.st.Relation(relId) + if errors.IsNotFound(err) { + continue + } else if err != nil { + return errors.Trace(err) + } + if err := rel.Destroy(); err != nil { + return errors.Trace(err) + } + // TODO(axw) remove remote relation units. + } + for _, change := range change.ChangedRelations { + rel, err := api.st.Relation(change.RelationId) + if err != nil { + return errors.Trace(err) + } + if change.Life != params.Alive { + if err := rel.Destroy(); err != nil { + return errors.Trace(err) + } + } + for _, unitId := range change.DepartedUnits { + ru, err := rel.RemoteUnit(unitId) + if err != nil { + return errors.Trace(err) + } + if err := ru.LeaveScope(); err != nil { + return errors.Trace(err) + } + } + for unitId, change := range change.ChangedUnits { + ru, err := rel.RemoteUnit(unitId) + if err != nil { + return errors.Trace(err) + } + inScope, err := ru.InScope() + if err != nil { + return errors.Trace(err) + } + if !inScope { + err = ru.EnterScope(change.Settings) + } else { + err = ru.ReplaceSettings(change.Settings) + } + if err != nil { + return errors.Trace(err) + } + } + } + return nil + } + handleApplicationChange := func(change params.ApplicationChange) error { + applicationTag, err := names.ParseApplicationTag(change.ApplicationTag) + if err != nil { + return errors.Trace(err) + } + application, err := api.st.RemoteApplication(applicationTag.Id()) + if err != nil { + return errors.Trace(err) + } + // TODO(axw) update application status, lifecycle state. + _ = application + return handleApplicationRelationsChange(change.Relations) + } + for i, change := range changes.Changes { + if err := handleApplicationChange(change); err != nil { + results.Results[i].Error = common.ServerError(err) + } + } + return results, nil +} + +// PublishLocalRelationChange publishes local relations changes to the +// remote side offering those relations. +func (api *RemoteRelationsAPI) PublishLocalRelationsChange( + changes params.ApplicationRelationsChanges, +) (params.ErrorResults, error) { + return params.ErrorResults{}, errors.NotImplementedf("PublishLocalRelationChange") +} + +// WatchRemoteApplications starts a strings watcher that notifies of the addition, +// removal, and lifecycle changes of remote applications in the environment; and +// returns the watcher ID and initial IDs of remote applications, or an error if +// watching failed. +func (api *RemoteRelationsAPI) WatchRemoteApplications() (params.StringsWatchResult, error) { + w := api.st.WatchRemoteApplications() + if changes, ok := <-w.Changes(); ok { + return params.StringsWatchResult{ + StringsWatcherId: api.resources.Register(w), + Changes: changes, + }, nil + } + return params.StringsWatchResult{}, watcher.EnsureErr(w) +} + +// WatchRemoteApplication starts a ApplicationRelationsWatcher for each specified +// remote application, and returns the watcher IDs and initial values, or an error +// if the remote applications could not be watched. +func (api *RemoteRelationsAPI) WatchRemoteApplication(args params.Entities) (params.ApplicationRelationsWatchResults, error) { + results := params.ApplicationRelationsWatchResults{ + make([]params.ApplicationRelationsWatchResult, len(args.Entities)), + } + for i, arg := range args.Entities { + applicationTag, err := names.ParseApplicationTag(arg.Tag) + if err != nil { + results.Results[i].Error = common.ServerError(err) + continue + } + w, err := api.watchApplication(applicationTag) + if err != nil { + results.Results[i].Error = common.ServerError(err) + continue + } + changes, ok := <-w.Changes() + if !ok { + results.Results[i].Error = common.ServerError(watcher.EnsureErr(w)) + continue + } + results.Results[i].ApplicationRelationsWatcherId = api.resources.Register(w) + results.Results[i].Changes = &changes + } + return results, nil +} + +func (api *RemoteRelationsAPI) watchApplication(applicationTag names.ApplicationTag) (*applicationRelationsWatcher, error) { + // TODO(axw) subscribe to changes sent by the offering side. + applicationName := applicationTag.Id() + relationsWatcher, err := api.st.WatchRemoteApplicationRelations(applicationName) + if err != nil { + return nil, errors.Trace(err) + } + return newApplicationRelationsWatcher(api.st, applicationName, relationsWatcher), nil +} + +// applicationRelationsWatcher watches the relations of a application, and the +// *counterpart* endpoint units for each of those relations. +type applicationRelationsWatcher struct { + tomb tomb.Tomb + st RemoteRelationsState + applicationName string + relationsWatcher state.StringsWatcher + relationUnitsChanges chan relationUnitsChange + relationUnitsWatchers map[string]*relationWatcher + relations map[string]relationInfo + out chan params.ApplicationRelationsChange +} + +func newApplicationRelationsWatcher( + st RemoteRelationsState, + applicationName string, + rw state.StringsWatcher, +) *applicationRelationsWatcher { + w := &applicationRelationsWatcher{ + st: st, + applicationName: applicationName, + relationsWatcher: rw, + relationUnitsChanges: make(chan relationUnitsChange), + relationUnitsWatchers: make(map[string]*relationWatcher), + relations: make(map[string]relationInfo), + out: make(chan params.ApplicationRelationsChange), + } + go func() { + defer w.tomb.Done() + defer close(w.out) + defer close(w.relationUnitsChanges) + defer watcher.Stop(rw, &w.tomb) + defer func() { + for _, ruw := range w.relationUnitsWatchers { + watcher.Stop(ruw, &w.tomb) + } + }() + w.tomb.Kill(w.loop()) + }() + return w +} + +func (w *applicationRelationsWatcher) loop() error { + var out chan<- params.ApplicationRelationsChange + var value params.ApplicationRelationsChange + for { + select { + case <-w.tomb.Dying(): + return tomb.ErrDying + + case change, ok := <-w.relationsWatcher.Changes(): + if !ok { + return watcher.EnsureErr(w.relationsWatcher) + } + for _, relationKey := range change { + relation, err := w.st.KeyRelation(relationKey) + if errors.IsNotFound(err) { + r, ok := w.relations[relationKey] + if !ok { + // Relation was not previously known, so + // don't report it as removed. + continue + } + delete(w.relations, relationKey) + relationId := r.relationId + + // Relation has been removed, so stop and remove its + // relation units watcher, and then add the relation + // ID to the removed relations list. + watcher, ok := w.relationUnitsWatchers[relationKey] + if ok { + if err := watcher.Stop(); err != nil { + return errors.Trace(err) + } + delete(w.relationUnitsWatchers, relationKey) + } + value.RemovedRelations = append( + value.RemovedRelations, relationId, + ) + continue + } else if err != nil { + return errors.Trace(err) + } + + relationId := relation.Id() + relationChange, _ := getRelationChange(&value, relationId) + relationChange.Life = params.Life(relation.Life().String()) + w.relations[relationKey] = relationInfo{relationId, relationChange.Life} + if _, ok := w.relationUnitsWatchers[relationKey]; !ok { + // Start a relation units watcher, wait for the initial + // value before informing the client of the relation. + ruw, err := relation.WatchCounterpartEndpointUnits(w.applicationName) + if err != nil { + return errors.Trace(err) + } + var knownUnits set.Strings + select { + case <-w.tomb.Dying(): + return tomb.ErrDying + case change, ok := <-ruw.Changes(): + if !ok { + return watcher.EnsureErr(ruw) + } + ru := relationUnitsChange{ + relationKey: relationKey, + } + knownUnits = make(set.Strings) + if err := updateRelationUnits( + w.st, relation, knownUnits, change, &ru, + ); err != nil { + watcher.Stop(ruw, &w.tomb) + return errors.Trace(err) + } + w.updateRelationUnits(ru, &value) + } + w.relationUnitsWatchers[relationKey] = newRelationWatcher( + w.st, relation, relationKey, knownUnits, + ruw, w.relationUnitsChanges, + ) + } + } + out = w.out + + case change := <-w.relationUnitsChanges: + w.updateRelationUnits(change, &value) + out = w.out + + case out <- value: + out = nil + value = params.ApplicationRelationsChange{} + } + } +} + +func (w *applicationRelationsWatcher) updateRelationUnits(change relationUnitsChange, value *params.ApplicationRelationsChange) { + relationInfo, ok := w.relations[change.relationKey] + r, ok := getRelationChange(value, relationInfo.relationId) + if !ok { + r.Life = relationInfo.life + } + if r.ChangedUnits == nil && len(change.changedUnits) > 0 { + r.ChangedUnits = make(map[string]params.RelationUnitChange) + } + for unitId, unitChange := range change.changedUnits { + r.ChangedUnits[unitId] = unitChange + } + if r.ChangedUnits != nil { + for _, unitId := range change.departedUnits { + delete(r.ChangedUnits, unitId) + } + } + r.DepartedUnits = append(r.DepartedUnits, change.departedUnits...) +} + +func getRelationChange(value *params.ApplicationRelationsChange, relationId int) (*params.RelationChange, bool) { + for i, r := range value.ChangedRelations { + if r.RelationId == relationId { + return &value.ChangedRelations[i], true + } + } + value.ChangedRelations = append( + value.ChangedRelations, params.RelationChange{RelationId: relationId}, + ) + return &value.ChangedRelations[len(value.ChangedRelations)-1], false +} + +func (w *applicationRelationsWatcher) updateRelation(change params.RelationChange, value *params.ApplicationRelationsChange) { + for i, r := range value.ChangedRelations { + if r.RelationId == change.RelationId { + value.ChangedRelations[i] = change + return + } + } +} + +func (w *applicationRelationsWatcher) Changes() <-chan params.ApplicationRelationsChange { + return w.out +} + +func (w *applicationRelationsWatcher) Err() error { + return w.tomb.Err() +} + +func (w *applicationRelationsWatcher) Stop() error { + w.tomb.Kill(nil) + return w.tomb.Wait() +} + +// relationWatcher watches the counterpart endpoint units for a relation. +type relationWatcher struct { + tomb tomb.Tomb + st RemoteRelationsState + relation Relation + relationKey string + knownUnits set.Strings + watcher state.RelationUnitsWatcher + out chan<- relationUnitsChange +} + +func newRelationWatcher( + st RemoteRelationsState, + relation Relation, + relationKey string, + knownUnits set.Strings, + ruw state.RelationUnitsWatcher, + out chan<- relationUnitsChange, +) *relationWatcher { + w := &relationWatcher{ + st: st, + relation: relation, + relationKey: relationKey, + knownUnits: knownUnits, + watcher: ruw, + out: out, + } + go func() { + defer w.tomb.Done() + defer watcher.Stop(ruw, &w.tomb) + w.tomb.Kill(w.loop()) + }() + return w +} + +func (w *relationWatcher) loop() error { + value := relationUnitsChange{relationKey: w.relationKey} + var out chan<- relationUnitsChange + for { + select { + case <-w.tomb.Dying(): + return tomb.ErrDying + + case change, ok := <-w.watcher.Changes(): + if !ok { + return watcher.EnsureErr(w.watcher) + } + if err := w.update(change, &value); err != nil { + return errors.Trace(err) + } + out = w.out + + case out <- value: + out = nil + value = relationUnitsChange{relationKey: w.relationKey} + } + } +} + +func (w *relationWatcher) update(change params.RelationUnitsChange, value *relationUnitsChange) error { + return updateRelationUnits(w.st, w.relation, w.knownUnits, change, value) +} + +// updateRelationUnits updates a relationUnitsChange structure with the +// params.RelationUnitsChange. +func updateRelationUnits( + st RemoteRelationsState, + relation Relation, + knownUnits set.Strings, + change params.RelationUnitsChange, + value *relationUnitsChange, +) error { + if value.changedUnits == nil && len(change.Changed) > 0 { + value.changedUnits = make(map[string]params.RelationUnitChange) + } + if value.changedUnits != nil { + for _, unitId := range change.Departed { + delete(value.changedUnits, unitId) + } + } + for _, unitId := range change.Departed { + if knownUnits == nil || !knownUnits.Contains(unitId) { + // Unit hasn't previously been seen. This could happen + // if the unit is removed between the watcher firing + // when it was present and reading the unit's settings. + continue + } + knownUnits.Remove(unitId) + value.departedUnits = append(value.departedUnits, unitId) + } + + // Fetch settings for each changed relation unit. + for unitId := range change.Changed { + ru, err := relation.Unit(unitId) + if errors.IsNotFound(err) { + // Relation unit removed between watcher firing and + // reading the unit's settings. + continue + } else if err != nil { + return errors.Trace(err) + } + settings, err := ru.Settings() + if err != nil { + return errors.Trace(err) + } + value.changedUnits[unitId] = params.RelationUnitChange{settings} + if knownUnits != nil { + knownUnits.Add(unitId) + } + } + return nil +} + +func (w *relationWatcher) Stop() error { + w.tomb.Kill(nil) + return w.tomb.Wait() +} + +func (w *relationWatcher) Err() error { + return w.tomb.Err() +} + +type relationInfo struct { + relationId int + life params.Life +} + +type relationUnitsChange struct { + relationKey string + changedUnits map[string]params.RelationUnitChange + departedUnits []string +} diff -Nru juju-core-2.0.0/src/github.com/juju/juju/apiserver/remoterelations/remoterelations_test.go juju-core-2.0.2/src/github.com/juju/juju/apiserver/remoterelations/remoterelations_test.go --- juju-core-2.0.0/src/github.com/juju/juju/apiserver/remoterelations/remoterelations_test.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/apiserver/remoterelations/remoterelations_test.go 2016-11-11 00:08:09.000000000 +0000 @@ -0,0 +1,347 @@ +// Copyright 2015 Canonical Ltd. +// Licensed under the AGPLv3, see LICENCE file for details. + +package remoterelations_test + +import ( + "github.com/juju/errors" + "github.com/juju/testing" + jc "github.com/juju/testing/checkers" + gc "gopkg.in/check.v1" + "gopkg.in/juju/names.v2" + + "github.com/juju/juju/apiserver" + "github.com/juju/juju/apiserver/common" + "github.com/juju/juju/apiserver/params" + "github.com/juju/juju/apiserver/remoterelations" + apiservertesting "github.com/juju/juju/apiserver/testing" + "github.com/juju/juju/state" + coretesting "github.com/juju/juju/testing" +) + +var _ = gc.Suite(&remoteRelationsSuite{}) + +type remoteRelationsSuite struct { + coretesting.BaseSuite + + resources *common.Resources + authorizer *apiservertesting.FakeAuthorizer + st *mockState + api *remoterelations.RemoteRelationsAPI +} + +func (s *remoteRelationsSuite) SetUpTest(c *gc.C) { + s.BaseSuite.SetUpTest(c) + + s.resources = common.NewResources() + s.AddCleanup(func(_ *gc.C) { s.resources.StopAll() }) + + s.authorizer = &apiservertesting.FakeAuthorizer{ + Tag: names.NewMachineTag("0"), + EnvironManager: true, + } + + s.st = newMockState() + api, err := remoterelations.NewRemoteRelationsAPI(s.st, s.resources, s.authorizer) + c.Assert(err, jc.ErrorIsNil) + s.api = api +} + +func (s *remoteRelationsSuite) TestWatchRemoteApplications(c *gc.C) { + applicationNames := []string{"db2", "hadoop"} + s.st.remoteApplicationsWatcher.changes <- applicationNames + result, err := s.api.WatchRemoteApplications() + c.Assert(err, jc.ErrorIsNil) + c.Assert(result.Error, gc.IsNil) + c.Assert(result.StringsWatcherId, gc.Equals, "1") + c.Assert(result.Changes, jc.DeepEquals, applicationNames) + + resource := s.resources.Get("1") + c.Assert(resource, gc.NotNil) + c.Assert(resource, gc.Implements, new(state.StringsWatcher)) +} + +func (s *remoteRelationsSuite) TestWatchRemoteApplication(c *gc.C) { + djangoRelationUnit := newMockRelationUnit() + djangoRelationUnit.settings["key"] = "value" + db2RelationsWatcher := newMockStringsWatcher() + db2RelationsWatcher.changes <- []string{"db2:db django:db"} + db2RelationUnitsWatcher := newMockRelationUnitsWatcher() + db2RelationUnitsWatcher.changes <- params.RelationUnitsChange{ + Changed: map[string]params.UnitSettings{"django/0": {}}, + } + db2Relation := newMockRelation(123) + db2Relation.units["django/0"] = djangoRelationUnit + db2Relation.endpointUnitsWatchers["db2"] = db2RelationUnitsWatcher + s.st.relations["db2:db django:db"] = db2Relation + s.st.applicationRelationsWatchers["db2"] = db2RelationsWatcher + + results, err := s.api.WatchRemoteApplication(params.Entities{[]params.Entity{ + {"application-db2"}, + {"application-hadoop"}, + {"machine-42"}, + }}) + c.Assert(err, jc.ErrorIsNil) + c.Assert(results.Results, jc.DeepEquals, []params.ApplicationRelationsWatchResult{{ + ApplicationRelationsWatcherId: "1", + Changes: ¶ms.ApplicationRelationsChange{ + ChangedRelations: []params.RelationChange{{ + RelationId: 123, + Life: params.Alive, + ChangedUnits: map[string]params.RelationUnitChange{ + "django/0": { + Settings: djangoRelationUnit.settings, + }, + }, + }}, + }, + }, { + Error: ¶ms.Error{ + Code: params.CodeNotFound, + Message: `application "hadoop" not found`, + }, + }, { + Error: ¶ms.Error{ + Message: `"machine-42" is not a valid application tag`, + }, + }}) + + s.st.CheckCalls(c, []testing.StubCall{ + {"WatchRemoteApplicationRelations", []interface{}{"db2"}}, + {"KeyRelation", []interface{}{"db2:db django:db"}}, + {"WatchRemoteApplicationRelations", []interface{}{"hadoop"}}, + }) + + db2Relation.CheckCalls(c, []testing.StubCall{ + {"Id", []interface{}{}}, + {"Life", []interface{}{}}, + {"WatchCounterpartEndpointUnits", []interface{}{"db2"}}, + {"Unit", []interface{}{"django/0"}}, + }) +} + +func (s *remoteRelationsSuite) TestWatchRemoteApplicationRelationRemoved(c *gc.C) { + db2RelationsWatcher := newMockStringsWatcher() + db2RelationsWatcher.changes <- []string{"db2:db django:db"} + db2RelationUnitsWatcher := newMockRelationUnitsWatcher() + db2RelationUnitsWatcher.changes <- params.RelationUnitsChange{} + db2Relation := newMockRelation(123) + db2Relation.endpointUnitsWatchers["db2"] = db2RelationUnitsWatcher + s.st.relations["db2:db django:db"] = db2Relation + s.st.applicationRelationsWatchers["db2"] = db2RelationsWatcher + + results, err := s.api.WatchRemoteApplication(params.Entities{[]params.Entity{{"application-db2"}}}) + c.Assert(err, jc.ErrorIsNil) + c.Assert(results.Results, jc.DeepEquals, []params.ApplicationRelationsWatchResult{{ + ApplicationRelationsWatcherId: "1", + Changes: ¶ms.ApplicationRelationsChange{ + // The relation is not found, but it was never reported + // to us, so it should not be reported in "Removed". + ChangedRelations: []params.RelationChange{{ + RelationId: 123, + Life: params.Alive, + }}, + }, + }}) + + // Remove the relation, and expect it to be reported as removed. + delete(s.st.relations, "db2:db django:db") + db2RelationsWatcher.changes <- []string{"db2:db django:db"} + w := s.resources.Get("1").(apiserver.ApplicationRelationsWatcher) + change := <-w.Changes() + c.Assert(change, jc.DeepEquals, params.ApplicationRelationsChange{ + RemovedRelations: []int{123}, + }) + + s.st.CheckCalls(c, []testing.StubCall{ + {"WatchRemoteApplicationRelations", []interface{}{"db2"}}, + {"KeyRelation", []interface{}{"db2:db django:db"}}, + {"KeyRelation", []interface{}{"db2:db django:db"}}, + }) + db2Relation.CheckCalls(c, []testing.StubCall{ + {"Id", []interface{}{}}, + {"Life", []interface{}{}}, + {"WatchCounterpartEndpointUnits", []interface{}{"db2"}}, + }) + db2RelationUnitsWatcher.CheckCallNames(c, "Changes", "Changes", "Stop") +} + +func (s *remoteRelationsSuite) TestWatchRemoteApplicationRelationRemovedRace(c *gc.C) { + db2RelationsWatcher := newMockStringsWatcher() + db2RelationsWatcher.changes <- []string{"db2:db django:db"} + s.st.applicationRelationsWatchers["db2"] = db2RelationsWatcher + + results, err := s.api.WatchRemoteApplication(params.Entities{[]params.Entity{{"application-db2"}}}) + c.Assert(err, jc.ErrorIsNil) + c.Assert(results.Results, jc.DeepEquals, []params.ApplicationRelationsWatchResult{{ + ApplicationRelationsWatcherId: "1", + // The relation is not found, but it was never reported + // to us, so it should not be reported in "Removed". + Changes: ¶ms.ApplicationRelationsChange{}, + }}) + s.st.CheckCalls(c, []testing.StubCall{ + {"WatchRemoteApplicationRelations", []interface{}{"db2"}}, + {"KeyRelation", []interface{}{"db2:db django:db"}}, + }) +} + +func (s *remoteRelationsSuite) TestWatchRemoteApplicationRelationUnitRemoved(c *gc.C) { + djangoRelationUnit := newMockRelationUnit() + djangoRelationUnit.settings["key"] = "value" + db2RelationsWatcher := newMockStringsWatcher() + db2RelationsWatcher.changes <- []string{"db2:db django:db"} + db2RelationUnitsWatcher := newMockRelationUnitsWatcher() + db2RelationUnitsWatcher.changes <- params.RelationUnitsChange{ + Changed: map[string]params.UnitSettings{"django/0": {}}, + } + db2Relation := newMockRelation(123) + db2Relation.units["django/0"] = djangoRelationUnit + db2Relation.endpointUnitsWatchers["db2"] = db2RelationUnitsWatcher + s.st.relations["db2:db django:db"] = db2Relation + s.st.applicationRelationsWatchers["db2"] = db2RelationsWatcher + + results, err := s.api.WatchRemoteApplication(params.Entities{[]params.Entity{{"application-db2"}}}) + c.Assert(err, jc.ErrorIsNil) + c.Assert(results.Results, jc.DeepEquals, []params.ApplicationRelationsWatchResult{{ + ApplicationRelationsWatcherId: "1", + Changes: ¶ms.ApplicationRelationsChange{ + ChangedRelations: []params.RelationChange{{ + RelationId: 123, + Life: params.Alive, + ChangedUnits: map[string]params.RelationUnitChange{ + "django/0": { + Settings: djangoRelationUnit.settings, + }, + }, + }}, + }, + }}) + + db2RelationUnitsWatcher.changes <- params.RelationUnitsChange{ + Departed: []string{"django/0"}, + } + w := s.resources.Get("1").(apiserver.ApplicationRelationsWatcher) + change := <-w.Changes() + c.Assert(change, jc.DeepEquals, params.ApplicationRelationsChange{ + ChangedRelations: []params.RelationChange{{ + RelationId: 123, + Life: params.Alive, + DepartedUnits: []string{"django/0"}, + }}, + }) + + db2Relation.CheckCalls(c, []testing.StubCall{ + {"Id", []interface{}{}}, + {"Life", []interface{}{}}, + {"WatchCounterpartEndpointUnits", []interface{}{"db2"}}, + {"Unit", []interface{}{"django/0"}}, + }) +} + +func (s *remoteRelationsSuite) TestWatchRemoteApplicationRelationUnitRemovedRace(c *gc.C) { + db2RelationsWatcher := newMockStringsWatcher() + db2RelationsWatcher.changes <- []string{"db2:db django:db"} + db2RelationUnitsWatcher := newMockRelationUnitsWatcher() + db2RelationUnitsWatcher.changes <- params.RelationUnitsChange{ + Departed: []string{"django/0"}, + } + db2Relation := newMockRelation(123) + db2Relation.endpointUnitsWatchers["db2"] = db2RelationUnitsWatcher + s.st.relations["db2:db django:db"] = db2Relation + s.st.applicationRelationsWatchers["db2"] = db2RelationsWatcher + + results, err := s.api.WatchRemoteApplication(params.Entities{[]params.Entity{{"application-db2"}}}) + c.Assert(err, jc.ErrorIsNil) + c.Assert(results.Results, jc.DeepEquals, []params.ApplicationRelationsWatchResult{{ + ApplicationRelationsWatcherId: "1", + Changes: ¶ms.ApplicationRelationsChange{ + ChangedRelations: []params.RelationChange{{ + RelationId: 123, + Life: params.Alive, + }}, + }, + }}) +} + +func (s *remoteRelationsSuite) TestPublishLocalRelationsChange(c *gc.C) { + _, err := s.api.PublishLocalRelationsChange(params.ApplicationRelationsChanges{}) + c.Assert(err, jc.Satisfies, errors.IsNotImplemented) +} + +func (s *remoteRelationsSuite) TestConsumeRemoveApplicationChange(c *gc.C) { + mysql := newMockRemoteApplication("mysql", "local:/u/me/mysql") + s.st.remoteApplications["mysql"] = mysql + + relation1 := newMockRelation(1) + relation2 := newMockRelation(2) + relation3 := newMockRelation(3) + s.st.relations["mysql:db wordpress:db"] = relation1 + s.st.relations["mysql:db django:db"] = relation2 + s.st.relations["mysql:munin munin:munin-node"] = relation3 + + mysql0 := newMockRelationUnit() + mysql1 := newMockRelationUnit() + relation1.units["mysql/0"] = mysql0 + relation2.units["mysql/1"] = mysql1 + mysql0Settings := map[string]interface{}{"k": "v"} + + results, err := s.api.ConsumeRemoteApplicationChange(params.ApplicationChanges{ + Changes: []params.ApplicationChange{{ + ApplicationTag: "application-mysql", + Life: params.Alive, + Relations: params.ApplicationRelationsChange{ + ChangedRelations: []params.RelationChange{{ + RelationId: 1, + Life: params.Alive, + ChangedUnits: map[string]params.RelationUnitChange{ + "mysql/0": {mysql0Settings}, + }, + }, { + RelationId: 2, + Life: params.Dying, + DepartedUnits: []string{"mysql/1"}, + }}, + RemovedRelations: []int{3, 42}, + }, + }, { + ApplicationTag: "application-db2", + }, { + ApplicationTag: "machine-42", + }}, + }) + c.Assert(err, jc.ErrorIsNil) + c.Assert(results.Results, jc.DeepEquals, []params.ErrorResult{ + {nil}, + {¶ms.Error{Code: params.CodeNotFound, Message: `remote application "db2" not found`}}, + {¶ms.Error{Code: "", Message: `"machine-42" is not a valid application tag`}}, + }) + + s.st.CheckCalls(c, []testing.StubCall{ + {"RemoteApplication", []interface{}{"mysql"}}, + {"Relation", []interface{}{int(3)}}, + {"Relation", []interface{}{int(42)}}, + {"Relation", []interface{}{int(1)}}, + {"Relation", []interface{}{int(2)}}, + {"RemoteApplication", []interface{}{"db2"}}, + }) + mysql.CheckCalls(c, []testing.StubCall{}) // no calls yet + + relation1.CheckCalls(c, []testing.StubCall{ + {"RemoteUnit", []interface{}{"mysql/0"}}, + }) + relation2.CheckCalls(c, []testing.StubCall{ + {"Destroy", []interface{}{}}, + {"RemoteUnit", []interface{}{"mysql/1"}}, + }) + relation3.CheckCalls(c, []testing.StubCall{ + {"Destroy", []interface{}{}}, + }) + + mysql0.CheckCalls(c, []testing.StubCall{ + {"InScope", []interface{}{}}, + {"EnterScope", []interface{}{mysql0Settings}}, + }) + mysql1.CheckCalls(c, []testing.StubCall{ + {"LeaveScope", []interface{}{}}, + }) +} diff -Nru juju-core-2.0.0/src/github.com/juju/juju/apiserver/remoterelations/state.go juju-core-2.0.2/src/github.com/juju/juju/apiserver/remoterelations/state.go --- juju-core-2.0.0/src/github.com/juju/juju/apiserver/remoterelations/state.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/apiserver/remoterelations/state.go 2016-11-11 00:08:09.000000000 +0000 @@ -0,0 +1,187 @@ +// Copyright 2015 Canonical Ltd. +// Licensed under the AGPLv3, see LICENCE file for details. + +package remoterelations + +import ( + "github.com/juju/errors" + "github.com/juju/juju/state" +) + +// RemoteRelationState provides the subset of global state required by the +// remote relations facade. +type RemoteRelationsState interface { + // KeyRelation returns the existing relation with the given key (which can + // be derived unambiguously from the relation's endpoints). + KeyRelation(string) (Relation, error) + + // Relation returns the existing relation with the given id. + Relation(int) (Relation, error) + + // RemoteApplication returns a remote application by name. + RemoteApplication(string) (RemoteApplication, error) + + // WatchRemoteApplications returns a StringsWatcher that notifies of changes to + // the lifecycles of the remote applications in the environment. + WatchRemoteApplications() state.StringsWatcher + + // WatchRemoteApplicationRelations returns a StringsWatcher that notifies of + // changes to the lifecycles of relations involving the specified remote + // service. + WatchRemoteApplicationRelations(serviceName string) (state.StringsWatcher, error) +} + +// Relation provides access a relation in global state. +type Relation interface { + // Destroy ensures that the relation will be removed at some point; if + // no units are currently in scope, it will be removed immediately. + Destroy() error + + // Id returns the integer internal relation key. + Id() int + + // Life returns the relation's current life state. + Life() state.Life + + // RemoteUnit returns a RelationUnit for the remote application unit + // with the supplied ID. + RemoteUnit(unitId string) (RelationUnit, error) + + // Unit returns a RelationUnit for the unit with the supplied ID. + Unit(unitId string) (RelationUnit, error) + + // WatchCounterpartEndpointUnits returns a watcher that notifies of + // changes to the units with the endpoint counterpart to the specified + // service. + WatchCounterpartEndpointUnits(serviceName string) (state.RelationUnitsWatcher, error) +} + +// RelationUnit provides access to the settings of a single unit in a relation, +// and methods for modifying the unit's involvement in the relation. +type RelationUnit interface { + // EnterScope ensures that the unit has entered its scope in the + // relation. When the unit has already entered its scope, EnterScope + // will report success but make no changes to state. + EnterScope(settings map[string]interface{}) error + + // InScope returns whether the relation unit has entered scope and + // not left it. + InScope() (bool, error) + + // LeaveScope signals that the unit has left its scope in the relation. + // After the unit has left its relation scope, it is no longer a member + // of the relation; if the relation is dying when its last member unit + // leaves, it is removed immediately. It is not an error to leave a + // scope that the unit is not, or never was, a member of. + LeaveScope() error + + // ReplaceSettings replaces the relation unit's settings within the + // relation. + ReplaceSettings(map[string]interface{}) error + + // Settings returns the relation unit's settings within the relation. + Settings() (map[string]interface{}, error) +} + +// RemoteApplication represents the state of a service hosted in an external +// (remote) environment. +type RemoteApplication interface { + // Name returns the name of the remote application. + Name() string + + // URL returns the remote application URL, at which it is offered. + URL() string +} + +type stateShim struct { + *state.State +} + +func (st stateShim) KeyRelation(key string) (Relation, error) { + r, err := st.State.KeyRelation(key) + if err != nil { + return nil, errors.Trace(err) + } + return relationShim{r, st.State}, nil +} + +func (st stateShim) Relation(id int) (Relation, error) { + r, err := st.State.Relation(id) + if err != nil { + return nil, errors.Trace(err) + } + return relationShim{r, st.State}, nil +} + +func (st stateShim) RemoteApplication(name string) (RemoteApplication, error) { + s, err := st.State.RemoteApplication(name) + if err != nil { + return nil, errors.Trace(err) + } + return remoteApplicationShim{s}, nil +} + +func (st stateShim) WatchRemoteApplicationRelations(applicationName string) (state.StringsWatcher, error) { + s, err := st.State.RemoteApplication(applicationName) + if err != nil { + return nil, errors.Trace(err) + } + return s.WatchRelations(), nil +} + +type relationShim struct { + *state.Relation + st *state.State +} + +func (r relationShim) RemoteUnit(unitId string) (RelationUnit, error) { + ru, err := r.Relation.RemoteUnit(unitId) + if err != nil { + return nil, errors.Trace(err) + } + return relationUnitShim{ru}, nil +} + +func (r relationShim) Unit(unitId string) (RelationUnit, error) { + unit, err := r.st.Unit(unitId) + if err != nil { + return nil, errors.Trace(err) + } + ru, err := r.Relation.Unit(unit) + if err != nil { + return nil, errors.Trace(err) + } + return relationUnitShim{ru}, nil +} + +type relationUnitShim struct { + *state.RelationUnit +} + +func (r relationUnitShim) ReplaceSettings(s map[string]interface{}) error { + settings, err := r.RelationUnit.Settings() + if err != nil { + return errors.Trace(err) + } + settings.Update(s) + for _, key := range settings.Keys() { + if _, ok := s[key]; ok { + continue + } + settings.Delete(key) + } + _, err = settings.Write() + return errors.Trace(err) +} + +func (r relationUnitShim) Settings() (map[string]interface{}, error) { + settings, err := r.RelationUnit.Settings() + if err != nil { + return nil, errors.Trace(err) + } + return settings.Map(), nil +} + +type remoteApplicationShim struct { + *state.RemoteApplication +} diff -Nru juju-core-2.0.0/src/github.com/juju/juju/apiserver/restrict_controller.go juju-core-2.0.2/src/github.com/juju/juju/apiserver/restrict_controller.go --- juju-core-2.0.0/src/github.com/juju/juju/apiserver/restrict_controller.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/apiserver/restrict_controller.go 2016-11-11 00:08:09.000000000 +0000 @@ -20,6 +20,8 @@ "MigrationTarget", "ModelManager", "UserManager", + "ApplicationOffers", + "CrossModelRelations", ) // commonFacadeNames holds root names that can be accessed using both diff -Nru juju-core-2.0.0/src/github.com/juju/juju/apiserver/restrict_controller_test.go juju-core-2.0.2/src/github.com/juju/juju/apiserver/restrict_controller_test.go --- juju-core-2.0.0/src/github.com/juju/juju/apiserver/restrict_controller_test.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/apiserver/restrict_controller_test.go 2016-11-11 00:08:09.000000000 +0000 @@ -9,6 +9,7 @@ gc "gopkg.in/check.v1" "github.com/juju/juju/apiserver" + "github.com/juju/juju/feature" "github.com/juju/juju/rpc" "github.com/juju/juju/testing" ) @@ -21,6 +22,7 @@ var _ = gc.Suite(&restrictControllerSuite{}) func (s *restrictControllerSuite) SetUpSuite(c *gc.C) { + s.SetInitialFeatureFlags(feature.CrossModelRelations) s.BaseSuite.SetUpSuite(c) s.root = apiserver.TestingControllerOnlyRoot() } @@ -33,6 +35,8 @@ s.assertMethod(c, "Pinger", 1, "Ping") s.assertMethod(c, "Bundle", 1, "GetChanges") s.assertMethod(c, "HighAvailability", 2, "EnableHA") + s.assertMethod(c, "CrossModelRelations", 1, "FindApplicationOffers") + s.assertMethod(c, "ApplicationOffers", 1, "ListOffers") } func (s *restrictControllerSuite) TestNotAllowed(c *gc.C) { diff -Nru juju-core-2.0.0/src/github.com/juju/juju/apiserver/restrict_upgrades.go juju-core-2.0.2/src/github.com/juju/juju/apiserver/restrict_upgrades.go --- juju-core-2.0.0/src/github.com/juju/juju/apiserver/restrict_upgrades.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/apiserver/restrict_upgrades.go 2016-11-11 00:08:09.000000000 +0000 @@ -40,6 +40,8 @@ "SSHClient": set.NewStrings( // allow all SSH client related calls "PublicAddress", "PrivateAddress", + "BestAPIVersion", + "AllAddresses", "PublicKeys", "Proxy", ), diff -Nru juju-core-2.0.0/src/github.com/juju/juju/apiserver/root.go juju-core-2.0.2/src/github.com/juju/juju/apiserver/root.go --- juju-core-2.0.0/src/github.com/juju/juju/apiserver/root.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/apiserver/root.go 2016-11-11 00:08:09.000000000 +0000 @@ -12,6 +12,7 @@ "gopkg.in/juju/names.v2" "github.com/juju/juju/apiserver/common" + "github.com/juju/juju/apiserver/crossmodel" "github.com/juju/juju/apiserver/facade" "github.com/juju/juju/apiserver/params" "github.com/juju/juju/permission" @@ -80,6 +81,13 @@ if err := r.resources.RegisterNamed("logDir", common.StringResource(srv.logDir)); err != nil { return nil, errors.Trace(err) } + apiFactory, err := crossmodel.ApplicationOffersAPIFactoryResource(st) + if err != nil { + return nil, errors.Trace(err) + } + if err := r.resources.RegisterNamed("applicationOffersApiFactory", apiFactory); err != nil { + return nil, errors.Trace(err) + } return r, nil } diff -Nru juju-core-2.0.0/src/github.com/juju/juju/apiserver/server_test.go juju-core-2.0.2/src/github.com/juju/juju/apiserver/server_test.go --- juju-core-2.0.0/src/github.com/juju/juju/apiserver/server_test.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/apiserver/server_test.go 2016-11-11 00:08:09.000000000 +0000 @@ -464,7 +464,7 @@ apiserver.AssertHasPermission(c, handler, permission.SuperuserAccess, ctag, false) } -func (s *serverSuite) TestAPIHandlerHasPermissionAdmodel(c *gc.C) { +func (s *serverSuite) TestAPIHandlerHasPermissionAddmodel(c *gc.C) { u, ctag := s.bootstrapHasPermissionTest(c) user := u.UserTag() @@ -510,6 +510,7 @@ otherState := s.Factory.MakeModel(c, nil) defer otherState.Close() handler, _ := apiserver.TestingAPIHandler(c, s.State, otherState) + defer handler.Kill() c.Check(handler.ConnectedModel(), gc.Equals, otherState.ModelUUID()) } diff -Nru juju-core-2.0.0/src/github.com/juju/juju/apiserver/sshclient/facade.go juju-core-2.0.2/src/github.com/juju/juju/apiserver/sshclient/facade.go --- juju-core-2.0.0/src/github.com/juju/juju/apiserver/sshclient/facade.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/apiserver/sshclient/facade.go 2016-11-11 00:08:09.000000000 +0000 @@ -17,6 +17,9 @@ func init() { common.RegisterStandardFacade("SSHClient", 1, newFacade) + + // Facade version 2 adds AllAddresses() method. + common.RegisterStandardFacade("SSHClient", 2, newFacade) } // Facade implements the API required by the sshclient worker. @@ -52,7 +55,7 @@ } getter := func(m SSHMachine) (network.Address, error) { return m.PublicAddress() } - return facade.getAddresses(args, getter) + return facade.getAddressPerEntity(args, getter) } // PrivateAddress reports the preferred private network address for one or @@ -63,31 +66,87 @@ } getter := func(m SSHMachine) (network.Address, error) { return m.PrivateAddress() } - return facade.getAddresses(args, getter) + return facade.getAddressPerEntity(args, getter) } -func (facade *Facade) getAddresses(args params.Entities, getter func(SSHMachine) (network.Address, error)) ( - params.SSHAddressResults, error, +// AllAddresses reports all addresses known to Juju for each given entity in +// args. Machines and units are supported as entity types. Since the returned +// addresses are gathered from multiple sources, results may include duplicates. +func (facade *Facade) AllAddresses(args params.Entities) (params.SSHAddressesResults, error) { + if err := facade.checkIsModelAdmin(); err != nil { + return params.SSHAddressesResults{}, errors.Trace(err) + } + + getter := func(m SSHMachine) ([]network.Address, error) { + devicesAddresses, err := m.AllNetworkAddresses() + if err != nil { + return nil, errors.Trace(err) + } + + legacyAddresses := m.Addresses() + return append(devicesAddresses, legacyAddresses...), nil + } + + return facade.getAllEntityAddresses(args, getter) +} + +func (facade *Facade) getAllEntityAddresses(args params.Entities, getter func(SSHMachine) ([]network.Address, error)) ( + params.SSHAddressesResults, error, ) { - out := params.SSHAddressResults{ - Results: make([]params.SSHAddressResult, len(args.Entities)), + out := params.SSHAddressesResults{ + Results: make([]params.SSHAddressesResult, len(args.Entities)), } for i, entity := range args.Entities { machine, err := facade.backend.GetMachineForEntity(entity.Tag) if err != nil { out.Results[i].Error = common.ServerError(err) } else { - address, err := getter(machine) + addresses, err := getter(machine) if err != nil { out.Results[i].Error = common.ServerError(err) - } else { - out.Results[i].Address = address.Value + continue + } + + out.Results[i].Addresses = make([]string, len(addresses)) + for j := range addresses { + out.Results[i].Addresses[j] = addresses[j].Value } } } return out, nil } +func (facade *Facade) getAddressPerEntity(args params.Entities, addressGetter func(SSHMachine) (network.Address, error)) ( + params.SSHAddressResults, error, +) { + out := params.SSHAddressResults{ + Results: make([]params.SSHAddressResult, len(args.Entities)), + } + + getter := func(m SSHMachine) ([]network.Address, error) { + address, err := addressGetter(m) + if err != nil { + return nil, errors.Trace(err) + } + return []network.Address{address}, nil + } + + fullResults, err := facade.getAllEntityAddresses(args, getter) + if err != nil { + return params.SSHAddressResults{}, errors.Trace(err) + } + + for i, result := range fullResults.Results { + if result.Error != nil { + out.Results[i].Error = result.Error + } else { + out.Results[i].Address = result.Addresses[0] + } + } + + return out, nil +} + // PublicKeys returns the public SSH hosts for one or more // entities. Machines and units are supported. func (facade *Facade) PublicKeys(args params.Entities) (params.SSHPublicKeysResults, error) { diff -Nru juju-core-2.0.0/src/github.com/juju/juju/apiserver/sshclient/facade_test.go juju-core-2.0.2/src/github.com/juju/juju/apiserver/sshclient/facade_test.go --- juju-core-2.0.0/src/github.com/juju/juju/apiserver/sshclient/facade_test.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/apiserver/sshclient/facade_test.go 2016-11-11 00:08:09.000000000 +0000 @@ -103,6 +103,33 @@ }) } +func (s *facadeSuite) TestAllAddresses(c *gc.C) { + args := params.Entities{ + Entities: []params.Entity{{s.uOther}, {s.m0}, {s.uFoo}}, + } + results, err := s.facade.AllAddresses(args) + + c.Assert(err, jc.ErrorIsNil) + c.Check(results, gc.DeepEquals, params.SSHAddressesResults{ + Results: []params.SSHAddressesResult{ + {Error: apiservertesting.NotFoundError("entity")}, + {Addresses: []string{ + "0.1.2.3", "1.1.1.1", "2.2.2.2", // From AllNetworkAddresses() + "1.1.1.1", "2.2.2.2", // From Addresses() + }}, + {Addresses: []string{ + "0.3.2.1", "3.3.3.3", "4.4.4.4", // From AllNetworkAddresses() + "3.3.3.3", "4.4.4.4", // From Addresses() + }}, + }, + }) + s.backend.stub.CheckCalls(c, []jujutesting.StubCall{ + {"GetMachineForEntity", []interface{}{s.uOther}}, + {"GetMachineForEntity", []interface{}{s.m0}}, + {"GetMachineForEntity", []interface{}{s.uFoo}}, + }) +} + func (s *facadeSuite) TestPublicKeys(c *gc.C) { args := params.Entities{ Entities: []params.Entity{{s.m0}, {s.uOther}, {s.uFoo}}, @@ -171,15 +198,19 @@ switch tagString { case names.NewMachineTag("0").String(): return &mockMachine{ - tag: names.NewMachineTag("0"), - publicAddress: "1.1.1.1", - privateAddress: "2.2.2.2", + tag: names.NewMachineTag("0"), + publicAddress: "1.1.1.1", + privateAddress: "2.2.2.2", + addresses: network.NewAddresses("1.1.1.1", "2.2.2.2"), + allNetworkAddresses: network.NewAddresses("0.1.2.3", "1.1.1.1", "2.2.2.2"), }, nil case names.NewUnitTag("foo/0").String(): return &mockMachine{ - tag: names.NewMachineTag("1"), - publicAddress: "3.3.3.3", - privateAddress: "4.4.4.4", + tag: names.NewMachineTag("1"), + publicAddress: "3.3.3.3", + privateAddress: "4.4.4.4", + addresses: network.NewAddresses("3.3.3.3", "4.4.4.4"), + allNetworkAddresses: network.NewAddresses("0.3.2.1", "3.3.3.3", "4.4.4.4"), }, nil } return nil, errors.NotFoundf("entity") @@ -200,6 +231,9 @@ tag names.MachineTag publicAddress string privateAddress string + + addresses []network.Address + allNetworkAddresses []network.Address } func (m *mockMachine) MachineTag() names.MachineTag { @@ -217,3 +251,11 @@ Value: m.privateAddress, }, nil } + +func (m *mockMachine) AllNetworkAddresses() ([]network.Address, error) { + return m.allNetworkAddresses, nil +} + +func (m *mockMachine) Addresses() []network.Address { + return m.addresses +} diff -Nru juju-core-2.0.0/src/github.com/juju/juju/apiserver/sshclient/shim.go juju-core-2.0.2/src/github.com/juju/juju/apiserver/sshclient/shim.go --- juju-core-2.0.0/src/github.com/juju/juju/apiserver/sshclient/shim.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/apiserver/sshclient/shim.go 2016-11-11 00:08:09.000000000 +0000 @@ -27,6 +27,8 @@ MachineTag() names.MachineTag PublicAddress() (network.Address, error) PrivateAddress() (network.Address, error) + Addresses() []network.Address + AllNetworkAddresses() ([]network.Address, error) } // newFacade wraps New to express the supplied *state.State as a Backend. diff -Nru juju-core-2.0.0/src/github.com/juju/juju/apiserver/uniter/status.go juju-core-2.0.2/src/github.com/juju/juju/apiserver/uniter/status.go --- juju-core-2.0.0/src/github.com/juju/juju/apiserver/uniter/status.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/apiserver/uniter/status.go 2016-11-11 00:08:09.000000000 +0000 @@ -16,8 +16,8 @@ agentSetter *common.StatusSetter unitSetter *common.StatusSetter unitGetter *common.StatusGetter - serviceSetter *common.ServiceStatusSetter - serviceGetter *common.ServiceStatusGetter + serviceSetter *common.ApplicationStatusSetter + serviceGetter *common.ApplicationStatusGetter getCanModify common.GetAuthFunc } @@ -28,7 +28,7 @@ unitSetter := common.NewStatusSetter(st, getCanModify) unitGetter := common.NewStatusGetter(st, getCanModify) serviceSetter := common.NewServiceStatusSetter(st, getCanModify) - serviceGetter := common.NewServiceStatusGetter(st, getCanModify) + serviceGetter := common.NewApplicationStatusGetter(st, getCanModify) agentSetter := common.NewStatusSetter(&common.UnitAgentFinder{st}, getCanModify) return &StatusAPI{ agentSetter: agentSetter, diff -Nru juju-core-2.0.0/src/github.com/juju/juju/apiserver/uniter/uniter.go juju-core-2.0.2/src/github.com/juju/juju/apiserver/uniter/uniter.go --- juju-core-2.0.0/src/github.com/juju/juju/apiserver/uniter/uniter.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/apiserver/uniter/uniter.go 2016-11-11 00:08:09.000000000 +0000 @@ -1039,23 +1039,33 @@ if err != nil { return params.ErrorResults{}, err } + one := func(relTag string, unitTag names.UnitTag) error { + rel, unit, err := u.getRelationAndUnit(canAccess, relTag, unitTag) + if err != nil { + return err + } + relUnit, err := rel.Unit(unit) + if err != nil { + return err + } + // Construct the settings, passing the unit's + // private address (we already know it). + privateAddress, _ := unit.PrivateAddress() + settings := map[string]interface{}{ + "private-address": privateAddress.Value, + } + return relUnit.EnterScope(settings) + } for i, arg := range args.RelationUnits { tag, err := names.ParseUnitTag(arg.Unit) if err != nil { result.Results[i].Error = common.ServerError(common.ErrPerm) continue } - relUnit, err := u.getRelationUnit(canAccess, arg.Relation, tag) - if err == nil { - // Construct the settings, passing the unit's - // private address (we already know it). - privateAddress, _ := relUnit.PrivateAddress() - settings := map[string]interface{}{ - "private-address": privateAddress.Value, - } - err = relUnit.EnterScope(settings) + err = one(arg.Relation, tag) + if err != nil { + result.Results[i].Error = common.ServerError(err) } - result.Results[i].Error = common.ServerError(err) } return result, nil } @@ -1436,12 +1446,12 @@ return "", common.ErrPerm } remoteUnitName := tag.Id() - remoteServiceName, err := names.UnitApplication(remoteUnitName) + remoteApplicationName, err := names.UnitApplication(remoteUnitName) if err != nil { return "", common.ErrPerm } rel := relUnit.Relation() - _, err = rel.RelatedEndpoints(remoteServiceName) + _, err = rel.RelatedEndpoints(remoteApplicationName) if err != nil { return "", common.ErrPerm } diff -Nru juju-core-2.0.0/src/github.com/juju/juju/apiserver/watcher.go juju-core-2.0.2/src/github.com/juju/juju/apiserver/watcher.go --- juju-core-2.0.0/src/github.com/juju/juju/apiserver/watcher.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/apiserver/watcher.go 2016-11-11 00:08:09.000000000 +0000 @@ -15,7 +15,6 @@ "github.com/juju/juju/controller" "github.com/juju/juju/core/migration" "github.com/juju/juju/network" - "github.com/juju/juju/permission" "github.com/juju/juju/state" ) @@ -41,6 +40,10 @@ reflect.TypeOf((*srvStringsWatcher)(nil)), ) common.RegisterFacade( + "ApplicationRelationsWatcher", 1, newApplicationRelationsWatcher, + reflect.TypeOf((*srvApplicationRelationsWatcher)(nil)), + ) + common.RegisterFacade( "RelationUnitsWatcher", 1, newRelationUnitsWatcher, reflect.TypeOf((*srvRelationUnitsWatcher)(nil)), ) @@ -69,14 +72,18 @@ auth := context.Auth() resources := context.Resources() - // HasPermission should not be replaced by auth.AuthClient() even if, at first sight, they seem - // equivalent because this allows us to remove login permission for a user - // (a permission that is given by default). - isAuthorized, err := auth.HasPermission(permission.LoginAccess, context.State().ControllerTag()) - if err != nil { - return nil, errors.Trace(err) - } - if !isAuthorized { + if !auth.AuthClient() { + // Note that we don't need to check specific permissions + // here, as the AllWatcher can only do anything if the + // watcher resource has already been created, so we can + // rely on the permission check there to ensure that + // this facade can't do anything it shouldn't be allowed + // to. + // + // This is useful because the AllWatcher is reused for + // both the WatchAll (requires model access rights) and + // the WatchAllModels (requring controller superuser + // rights) API calls. return nil, common.ErrPerm } watcher, ok := resources.Get(id).(*state.Multiwatcher) @@ -260,6 +267,66 @@ return w.resources.Stop(w.id) } +// srvApplicationRelationsWatcher defines the API wrapping a ApplicationRelationsWatcher. +// This watcher notifies about: +// - addition and removal of relations of the service +// - lifecycle changes to relations of the service +// - settings of relation units changing +// - units departing the relation (joining is implicit in seeing new settings) +type srvApplicationRelationsWatcher struct { + watcher ApplicationRelationsWatcher + id string + resources facade.Resources +} + +// ApplicationRelationsWatcher is a watcher that reports on changes to relations +// and relation units related to those relations for a specified service. +type ApplicationRelationsWatcher interface { + Changes() <-chan params.ApplicationRelationsChange + Err() error + Stop() error +} + +func newApplicationRelationsWatcher(context facade.Context) (facade.Facade, error) { + id := context.ID() + resources := context.Resources() + auth := context.Auth() + + if !auth.AuthModelManager() { + return nil, common.ErrPerm + } + watcher, ok := resources.Get(id).(ApplicationRelationsWatcher) + if !ok { + return nil, common.ErrUnknownWatcher + } + return &srvApplicationRelationsWatcher{ + watcher: watcher, + id: id, + resources: resources, + }, nil +} + +// Next returns when a change has occured to an entity of the +// collection being watched since the most recent call to Next +// or the Watch call that created the srvApplicationRelationsWatcher. +func (w *srvApplicationRelationsWatcher) Next() (params.ApplicationRelationsWatchResult, error) { + if changes, ok := <-w.watcher.Changes(); ok { + return params.ApplicationRelationsWatchResult{ + Changes: &changes, + }, nil + } + err := w.watcher.Err() + if err == nil { + err = common.ErrStoppedWatcher + } + return params.ApplicationRelationsWatchResult{}, err +} + +// Stop stops the watcher. +func (w *srvApplicationRelationsWatcher) Stop() error { + return w.resources.Stop(w.id) +} + // srvMachineStorageIdsWatcher defines the API wrapping a state.StringsWatcher // watching machine/storage attachments. This watcher notifies about storage // entities (volumes/filesystems) being attached to and detached from machines. diff -Nru juju-core-2.0.0/src/github.com/juju/juju/cloud/fallback_public_cloud.go juju-core-2.0.2/src/github.com/juju/juju/cloud/fallback_public_cloud.go --- juju-core-2.0.0/src/github.com/juju/juju/cloud/fallback_public_cloud.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/cloud/fallback_public_cloud.go 2016-11-11 00:08:09.000000000 +0000 @@ -14,6 +14,8 @@ regions: us-east-1: endpoint: https://ec2.us-east-1.amazonaws.com + us-east-2: + endpoint: https://ec2.us-east-2.amazonaws.com us-west-1: endpoint: https://ec2.us-west-1.amazonaws.com us-west-2: diff -Nru juju-core-2.0.0/src/github.com/juju/juju/cloud/fallback-public-cloud.yaml juju-core-2.0.2/src/github.com/juju/juju/cloud/fallback-public-cloud.yaml --- juju-core-2.0.0/src/github.com/juju/juju/cloud/fallback-public-cloud.yaml 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/cloud/fallback-public-cloud.yaml 2016-11-11 00:08:09.000000000 +0000 @@ -7,6 +7,8 @@ regions: us-east-1: endpoint: https://ec2.us-east-1.amazonaws.com + us-east-2: + endpoint: https://ec2.us-east-2.amazonaws.com us-west-1: endpoint: https://ec2.us-west-1.amazonaws.com us-west-2: diff -Nru juju-core-2.0.0/src/github.com/juju/juju/cloudconfig/containerinit/container_userdata.go juju-core-2.0.2/src/github.com/juju/juju/cloudconfig/containerinit/container_userdata.go --- juju-core-2.0.0/src/github.com/juju/juju/cloudconfig/containerinit/container_userdata.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/cloudconfig/containerinit/container_userdata.go 2016-11-11 00:08:09.000000000 +0000 @@ -243,8 +243,6 @@ cloudConfig.SetAttr("hostname", instanceConfig.MachineContainerHostname) } - cloudConfig.SetAttr("manage_etc_hosts", true) - data, err := cloudConfig.RenderYAML() if err != nil { return nil, errors.Trace(err) diff -Nru juju-core-2.0.0/src/github.com/juju/juju/cloudconfig/containerinit/container_userdata_test.go juju-core-2.0.2/src/github.com/juju/juju/cloudconfig/containerinit/container_userdata_test.go --- juju-core-2.0.0/src/github.com/juju/juju/cloudconfig/containerinit/container_userdata_test.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/cloudconfig/containerinit/container_userdata_test.go 2016-11-11 00:08:09.000000000 +0000 @@ -281,8 +281,6 @@ expectedLinesToMatch = append(expectedLinesToMatch, line) } - expectedLinesToMatch = append(expectedLinesToMatch, "manage_etc_hosts: true") - c.Assert(strings.Join(linesToMatch, "\n")+"\n", gc.Equals, strings.Join(expectedLinesToMatch, "\n")+"\n") } @@ -308,7 +306,6 @@ } expectedLinesToMatch = append(expectedLinesToMatch, "hostname: lxdhostname") - expectedLinesToMatch = append(expectedLinesToMatch, "manage_etc_hosts: true") c.Assert(strings.Join(linesToMatch, "\n")+"\n", gc.Equals, strings.Join(expectedLinesToMatch, "\n")+"\n") } diff -Nru juju-core-2.0.0/src/github.com/juju/juju/cmd/juju/action/list.go juju-core-2.0.2/src/github.com/juju/juju/cmd/juju/action/list.go --- juju-core-2.0.0/src/github.com/juju/juju/cmd/juju/action/list.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/cmd/juju/action/list.go 2016-11-11 00:08:09.000000000 +0000 @@ -59,7 +59,7 @@ } } -// Init validates the service name and any other options. +// Init validates the application name and any other options. func (c *listCommand) Init(args []string) error { if c.out.Name() == "tabular" && c.fullSchema { return errors.New("full schema not compatible with tabular output") diff -Nru juju-core-2.0.0/src/github.com/juju/juju/cmd/juju/application/addrelation.go juju-core-2.0.2/src/github.com/juju/juju/cmd/juju/application/addrelation.go --- juju-core-2.0.0/src/github.com/juju/juju/cmd/juju/application/addrelation.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/cmd/juju/application/addrelation.go 2016-11-11 00:08:09.000000000 +0000 @@ -4,16 +4,44 @@ package application import ( + "regexp" + "strings" + "github.com/juju/cmd" "github.com/juju/errors" + "github.com/juju/utils/featureflag" + "gopkg.in/juju/names.v2" "github.com/juju/juju/api/application" "github.com/juju/juju/apiserver/params" "github.com/juju/juju/cmd/juju/block" "github.com/juju/juju/cmd/juju/common" "github.com/juju/juju/cmd/modelcmd" + "github.com/juju/juju/core/crossmodel" + "github.com/juju/juju/feature" ) +const addRelationDocCrossModel = ` +Add a relation between 2 local application endpoints or a local endpoint and a remote application endpoint. +Adding a relation between two remote application endpoints is not supported. + +Service endpoints can be identified either by: + [:] + where application name supplied without relation will be internally expanded to be well-formed +or + + +Examples: + $ juju add-relation wordpress mysql + where "wordpress" and "mysql" will be internally expanded to "wordpress:mysql" and "mysql:server" respectively + + $ juju add-relation wordpress local:/u/fred/prod/db2 + where "wordpress" will be internally expanded to "wordpress:db2" + +` + +var localEndpointRegEx = regexp.MustCompile("^" + names.RelationSnippet + "$") + // NewAddRelationCommand returns a command to add a relation between 2 services. func NewAddRelationCommand() cmd.Command { cmd := &addRelationCommand{} @@ -31,23 +59,31 @@ // addRelationCommand adds a relation between two application endpoints. type addRelationCommand struct { modelcmd.ModelCommandBase - Endpoints []string - newAPIFunc func() (ApplicationAddRelationAPI, error) + Endpoints []string + hasRemoteEndpoints bool + newAPIFunc func() (ApplicationAddRelationAPI, error) } func (c *addRelationCommand) Info() *cmd.Info { - return &cmd.Info{ + addCmd := &cmd.Info{ Name: "add-relation", Aliases: []string{"relate"}, - Args: "[:] [:]", - Purpose: "Add a relation between two applications.", + Args: "[:] [:]", + Purpose: "Add a relation between two application endpoints.", + } + if featureflag.Enabled(feature.CrossModelRelations) { + addCmd.Doc = addRelationDocCrossModel } + return addCmd } func (c *addRelationCommand) Init(args []string) error { if len(args) != 2 { return errors.Errorf("a relation must involve two applications") } + if err := c.validateEndpoints(args); err != nil { + return err + } c.Endpoints = args return nil } @@ -55,6 +91,8 @@ // ApplicationAddRelationAPI defines the API methods that application add relation command uses. type ApplicationAddRelationAPI interface { Close() error + // CHECK + BestAPIVersion() int AddRelation(endpoints ...string) (*params.AddRelationResults, error) } @@ -64,9 +102,69 @@ return err } defer client.Close() + + if c.hasRemoteEndpoints && client.BestAPIVersion() < 3 { + // old client does not have cross-model capability. + return errors.NotSupportedf("cannot add relation between %s: remote endpoints", c.Endpoints) + } + _, err = client.AddRelation(c.Endpoints...) if params.IsCodeUnauthorized(err) { common.PermissionsMessage(ctx.Stderr, "add a relation") } return block.ProcessBlockedError(err, block.BlockChange) } + +// validateEndpoints determines if all endpoints are valid. +// Each endpoint is either from local service or remote. +// If more than one remote endpoint are supplied, the input argument are considered invalid. +func (c *addRelationCommand) validateEndpoints(all []string) error { + for _, endpoint := range all { + if featureflag.Enabled(feature.CrossModelRelations) { + // We can only determine if this is a remote endpoint with 100%. + // If we cannot parse it, it may still be a valid local endpoint... + // so ignoring parsing error, + if _, err := crossmodel.ParseApplicationURL(endpoint); err == nil { + if c.hasRemoteEndpoints { + return errors.NotSupportedf("providing more than one remote endpoints") + } + c.hasRemoteEndpoints = true + continue + } + } + // at this stage, we are assuming that this could be a local endpoint + if err := validateLocalEndpoint(endpoint, ":"); err != nil { + return err + } + } + return nil +} + +// validateLocalEndpoint determines if given endpoint could be a valid +func validateLocalEndpoint(endpoint string, sep string) error { + i := strings.Index(endpoint, sep) + applicationName := endpoint + if i != -1 { + // not a valid endpoint as sep either at the start or the end of the name + if i == 0 || i == len(endpoint)-1 { + return errors.NotValidf("endpoint %q", endpoint) + } + + parts := strings.SplitN(endpoint, sep, -1) + if rightCount := len(parts) == 2; !rightCount { + // not valid if there are not exactly 2 parts. + return errors.NotValidf("endpoint %q", endpoint) + } + + applicationName = parts[0] + + if valid := localEndpointRegEx.MatchString(parts[1]); !valid { + return errors.NotValidf("endpoint %q", endpoint) + } + } + + if valid := names.IsValidApplication(applicationName); !valid { + return errors.NotValidf("application name %q", applicationName) + } + return nil +} diff -Nru juju-core-2.0.0/src/github.com/juju/juju/cmd/juju/application/addrelation_test.go juju-core-2.0.2/src/github.com/juju/juju/cmd/juju/application/addrelation_test.go --- juju-core-2.0.0/src/github.com/juju/juju/cmd/juju/application/addrelation_test.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/cmd/juju/application/addrelation_test.go 2016-11-11 00:08:09.000000000 +0000 @@ -100,3 +100,8 @@ s.MethodCall(s, "AddRelation", endpoints) return s.addRelationFunc(endpoints...) } + +func (s mockAddAPI) BestAPIVersion() int { + s.MethodCall(s, "BestAPIVersion") + return 2 +} diff -Nru juju-core-2.0.0/src/github.com/juju/juju/cmd/juju/application/addremoterelation_test.go juju-core-2.0.2/src/github.com/juju/juju/cmd/juju/application/addremoterelation_test.go --- juju-core-2.0.0/src/github.com/juju/juju/cmd/juju/application/addremoterelation_test.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/cmd/juju/application/addremoterelation_test.go 2016-11-11 00:08:09.000000000 +0000 @@ -0,0 +1,202 @@ +// Copyright 2012, 2013 Canonical Ltd. +// Licensed under the AGPLv3, see LICENCE file for details. + +package application + +import ( + "regexp" + + "github.com/juju/errors" + jtesting "github.com/juju/testing" + jc "github.com/juju/testing/checkers" + gc "gopkg.in/check.v1" + + "github.com/juju/juju/apiserver/params" + "github.com/juju/juju/cmd/modelcmd" + "github.com/juju/juju/feature" + jujutesting "github.com/juju/juju/juju/testing" + "github.com/juju/juju/testing" +) + +const endpointSeparator = ":" + +type AddRemoteRelationSuiteNewAPI struct { + baseAddRemoteRelationSuite +} + +var _ = gc.Suite(&AddRemoteRelationSuiteNewAPI{}) + +func (s *AddRemoteRelationSuiteNewAPI) SetUpTest(c *gc.C) { + s.baseAddRemoteRelationSuite.SetUpTest(c) + s.mockAPI.version = 3 +} + +func (s *AddRemoteRelationSuiteNewAPI) TestAddRelationNoRemoteApplications(c *gc.C) { + err := s.runAddRelation(c, "applicationname2", "applicationname") + c.Assert(err, jc.ErrorIsNil) + s.mockAPI.CheckCallNames(c, "AddRelation", "Close") + s.mockAPI.CheckCall(c, 0, "AddRelation", []string{"applicationname2", "applicationname"}) +} + +func (s *AddRemoteRelationSuiteNewAPI) TestAddRelationRemoteApplications(c *gc.C) { + s.assertFailAddRelationTwoRemoteApplications(c) +} + +func (s *AddRemoteRelationSuiteNewAPI) TestAddRelationToOneRemoteApplication(c *gc.C) { + s.assertAddedRelation(c, "applicationname", "local:/u/user/applicationname2") +} + +func (s *AddRemoteRelationSuiteNewAPI) TestAddRelationAnyRemoteApplication(c *gc.C) { + s.assertAddedRelation(c, "local:/u/user/applicationname2", "applicationname") +} + +func (s *AddRemoteRelationSuiteNewAPI) TestAddRelationFailure(c *gc.C) { + msg := "add relation failure" + s.mockAPI.addRelation = func(endpoints ...string) (*params.AddRelationResults, error) { + return nil, errors.New(msg) + } + + err := s.runAddRelation(c, "local:/u/user/applicationname2", "applicationname") + c.Assert(err, gc.ErrorMatches, msg) + s.mockAPI.CheckCallNames(c, "BestAPIVersion", "AddRelation", "Close") +} + +func (s *AddRemoteRelationSuiteNewAPI) TestAddRelationClientRetrievalFailure(c *gc.C) { + msg := "where is my client" + + addRelationCmd := &addRelationCommand{} + addRelationCmd.newAPIFunc = func() (ApplicationAddRelationAPI, error) { + return nil, errors.New(msg) + } + + _, err := testing.RunCommand(c, modelcmd.Wrap(addRelationCmd), "local:/u/user/applicationname2", "applicationname") + c.Assert(err, gc.ErrorMatches, msg) +} + +func (s *AddRemoteRelationSuiteNewAPI) assertAddedRelation(c *gc.C, args ...string) { + err := s.runAddRelation(c, args...) + c.Assert(err, jc.ErrorIsNil) + s.mockAPI.CheckCallNames(c, "BestAPIVersion", "AddRelation", "Close") + s.mockAPI.CheckCall(c, 1, "AddRelation", args) +} + +// AddRemoteRelationSuiteOldAPI only needs to check that we have fallen through to the old api +// since best facade version is 0... +// This old api is tested in another suite. +type AddRemoteRelationSuiteOldAPI struct { + baseAddRemoteRelationSuite +} + +var _ = gc.Suite(&AddRemoteRelationSuiteOldAPI{}) + +func (s *AddRemoteRelationSuiteOldAPI) TestAddRelationRemoteApplications(c *gc.C) { + s.assertFailAddRelationTwoRemoteApplications(c) +} + +func (s *AddRemoteRelationSuiteOldAPI) TestAddRelationToOneRemoteApplication(c *gc.C) { + err := s.runAddRelation(c, "applicationname", "local:/u/user/applicationname2") + c.Assert(err, gc.ErrorMatches, regexp.QuoteMeta("cannot add relation between [applicationname local:/u/user/applicationname2]: remote endpoints not supported")) +} + +func (s *AddRemoteRelationSuiteOldAPI) TestAddRelationAnyRemoteApplication(c *gc.C) { + err := s.runAddRelation(c, "local:/u/user/applicationname2", "applicationname") + c.Assert(err, gc.ErrorMatches, regexp.QuoteMeta("cannot add relation between [local:/u/user/applicationname2 applicationname]: remote endpoints not supported")) +} + +// AddRelationValidationSuite has input validation tests. +type AddRelationValidationSuite struct { + baseAddRemoteRelationSuite +} + +var _ = gc.Suite(&AddRelationValidationSuite{}) + +func (s *AddRelationValidationSuite) TestAddRelationInvalidEndpoint(c *gc.C) { + s.assertInvalidEndpoint(c, "applicationname:inva#lid", `endpoint "applicationname:inva#lid" not valid`) +} + +func (s *AddRelationValidationSuite) TestAddRelationSeparatorFirst(c *gc.C) { + s.assertInvalidEndpoint(c, ":applicationname", `endpoint ":applicationname" not valid`) +} + +func (s *AddRelationValidationSuite) TestAddRelationSeparatorLast(c *gc.C) { + s.assertInvalidEndpoint(c, "applicationname:", `endpoint "applicationname:" not valid`) +} + +func (s *AddRelationValidationSuite) TestAddRelationMoreThanOneSeparator(c *gc.C) { + s.assertInvalidEndpoint(c, "serv:ice:name", `endpoint "serv:ice:name" not valid`) +} + +func (s *AddRelationValidationSuite) TestAddRelationInvalidApplication(c *gc.C) { + s.assertInvalidEndpoint(c, "applicat@ionname", `application name "applicat@ionname" not valid`) +} + +func (s *AddRelationValidationSuite) TestAddRelationInvalidEndpointApplication(c *gc.C) { + s.assertInvalidEndpoint(c, "applicat@ionname:endpoint", `application name "applicat@ionname" not valid`) +} + +func (s *AddRelationValidationSuite) assertInvalidEndpoint(c *gc.C, endpoint, msg string) { + err := validateLocalEndpoint(endpoint, endpointSeparator) + c.Assert(err, gc.ErrorMatches, msg) +} + +// baseAddRemoteRelationSuite contains common functionality for add-relation cmd tests +// that mock out api client. +type baseAddRemoteRelationSuite struct { + jujutesting.RepoSuite + + mockAPI *mockAddRelationAPI +} + +func (s *baseAddRemoteRelationSuite) SetUpTest(c *gc.C) { + s.SetInitialFeatureFlags(feature.CrossModelRelations) + s.RepoSuite.SetUpTest(c) + s.mockAPI = &mockAddRelationAPI{ + addRelation: func(endpoints ...string) (*params.AddRelationResults, error) { + return nil, nil + }, + } +} + +func (s *baseAddRemoteRelationSuite) TearDownTest(c *gc.C) { + s.RepoSuite.TearDownTest(c) +} + +func (s *baseAddRemoteRelationSuite) runAddRelation(c *gc.C, args ...string) error { + addRelationCmd := &addRelationCommand{} + addRelationCmd.newAPIFunc = func() (ApplicationAddRelationAPI, error) { + return s.mockAPI, nil + } + _, err := testing.RunCommand(c, modelcmd.Wrap(addRelationCmd), args...) + return err +} + +func (s *baseAddRemoteRelationSuite) assertFailAddRelationTwoRemoteApplications(c *gc.C) { + err := s.runAddRelation(c, "local:/u/user/applicationname1", "local:/u/user/applicationname2") + c.Assert(err, gc.ErrorMatches, "providing more than one remote endpoints not supported") +} + +// mockAddRelationAPI contains a stub api used for add-relation cmd tests. +type mockAddRelationAPI struct { + jtesting.Stub + + // addRelation can be defined by tests to test different add-relation outcomes. + addRelation func(endpoints ...string) (*params.AddRelationResults, error) + + // version can be overwritten by tests interested in different behaviour based on client version. + version int +} + +func (m *mockAddRelationAPI) AddRelation(endpoints ...string) (*params.AddRelationResults, error) { + m.AddCall("AddRelation", endpoints) + return m.addRelation(endpoints...) +} + +func (m *mockAddRelationAPI) Close() error { + m.AddCall("Close") + return nil +} + +func (m *mockAddRelationAPI) BestAPIVersion() int { + m.AddCall("BestAPIVersion") + return m.version +} diff -Nru juju-core-2.0.0/src/github.com/juju/juju/cmd/juju/application/deploy_test.go juju-core-2.0.2/src/github.com/juju/juju/cmd/juju/application/deploy_test.go --- juju-core-2.0.0/src/github.com/juju/juju/cmd/juju/application/deploy_test.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/cmd/juju/application/deploy_test.go 2016-11-11 00:08:09.000000000 +0000 @@ -1236,30 +1236,15 @@ type DeployUnitTestSuite struct { jujutesting.IsolationSuite - jujutesting.FakeHomeSuite DeployAPI } var _ = gc.Suite(&DeployUnitTestSuite{}) -func (s *DeployUnitTestSuite) SetUpSuite(c *gc.C) { - s.IsolationSuite.SetUpSuite(c) - s.FakeHomeSuite.SetUpSuite(c) -} - -func (s *DeployUnitTestSuite) TearDownSuite(c *gc.C) { - s.FakeHomeSuite.TearDownSuite(c) - s.IsolationSuite.TearDownSuite(c) -} - func (s *DeployUnitTestSuite) SetUpTest(c *gc.C) { s.IsolationSuite.SetUpTest(c) - s.FakeHomeSuite.SetUpTest(c) -} - -func (s *DeployUnitTestSuite) TearDownTest(c *gc.C) { - s.FakeHomeSuite.TearDownTest(c) - s.IsolationSuite.TearDownTest(c) + cookiesFile := filepath.Join(c.MkDir(), ".go-cookies") + s.PatchEnvironment("JUJU_COOKIEFILE", cookiesFile) } func (s *DeployUnitTestSuite) TestDeployLocalCharm_GivesCorrectUserMessage(c *gc.C) { diff -Nru juju-core-2.0.0/src/github.com/juju/juju/cmd/juju/backups/restore.go juju-core-2.0.2/src/github.com/juju/juju/cmd/juju/backups/restore.go --- juju-core-2.0.0/src/github.com/juju/juju/cmd/juju/backups/restore.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/cmd/juju/backups/restore.go 2016-11-11 00:08:09.000000000 +0000 @@ -273,7 +273,7 @@ } instanceIds, err := env.ControllerInstances(params.ControllerConfig.ControllerUUID()) - if err != nil && errors.Cause(err) != environs.ErrNotBootstrapped { + if err != nil && errors.Cause(err) != environs.ErrNotBootstrapped && !errors.IsNotFound(err) { return errors.Annotatef(err, "cannot determine controller instances") } if len(instanceIds) > 0 { diff -Nru juju-core-2.0.0/src/github.com/juju/juju/cmd/juju/cloud/regions_test.go juju-core-2.0.2/src/github.com/juju/juju/cmd/juju/cloud/regions_test.go --- juju-core-2.0.0/src/github.com/juju/juju/cmd/juju/cloud/regions_test.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/cmd/juju/cloud/regions_test.go 2016-11-11 00:08:09.000000000 +0000 @@ -36,6 +36,7 @@ out := testing.Stdout(ctx) c.Assert(out, jc.DeepEquals, ` us-east-1 +us-east-2 us-west-1 us-west-2 eu-west-1 @@ -57,6 +58,8 @@ c.Assert(out, jc.DeepEquals, ` us-east-1: endpoint: https://ec2.us-east-1.amazonaws.com +us-east-2: + endpoint: https://ec2.us-east-2.amazonaws.com us-west-1: endpoint: https://ec2.us-west-1.amazonaws.com us-west-2: diff -Nru juju-core-2.0.0/src/github.com/juju/juju/cmd/juju/commands/bootstrap.go juju-core-2.0.2/src/github.com/juju/juju/cmd/juju/commands/bootstrap.go --- juju-core-2.0.0/src/github.com/juju/juju/cmd/juju/commands/bootstrap.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/cmd/juju/commands/bootstrap.go 2016-11-11 00:08:09.000000000 +0000 @@ -315,31 +315,290 @@ if err := c.parseConstraints(ctx); err != nil { return err } + + // Start by checking for usage errors, requests for information + finished, err := c.handleCommandLineErrorsAndInfoRequests(ctx) + if err != nil { + return errors.Trace(err) + } + if finished { + return nil + } + + // Run interactive bootstrap if needed/asked for + if c.interactive { + if err := c.runInteractive(ctx); err != nil { + return errors.Trace(err) + } + // now run normal bootstrap using info gained above. + } + + cloud, err := c.cloud(ctx) + if err != nil { + return errors.Trace(err) + } + + provider, err := environs.Provider(cloud.Type) + if err != nil { + return errors.Trace(err) + } + // Custom clouds may not have explicitly declared support for any auth- + // types, in which case we'll assume that they support everything that + // the provider supports. + if len(cloud.AuthTypes) == 0 { + for authType := range provider.CredentialSchemas() { + cloud.AuthTypes = append(cloud.AuthTypes, authType) + } + } + + credentials, regionName, err := c.credentialsAndRegionName(ctx, cloud) + if err != nil { + return errors.Trace(err) + } + + region, err := getRegion(cloud, c.Cloud, regionName) + if err != nil { + fmt.Fprintf(ctx.GetStderr(), + "%s\n\nSpecify an alternative region, or try %q.\n", + err, "juju update-clouds", + ) + return cmd.ErrSilent + } + if c.controllerName == "" { + c.controllerName = defaultControllerName(c.Cloud, region.Name) + } + + config, err := c.bootstrapConfigs(ctx, cloud, provider) + if err != nil { + return errors.Trace(err) + } + + // Read existing current controller so we can clean up on error. + var oldCurrentController string + store := c.ClientStore() + oldCurrentController, err = store.CurrentController() + if errors.IsNotFound(err) { + oldCurrentController = "" + } else if err != nil { + return errors.Annotate(err, "error reading current controller") + } + + defer func() { + if resultErr == nil || errors.IsAlreadyExists(resultErr) { + return + } + if oldCurrentController != "" { + if err := store.SetCurrentController(oldCurrentController); err != nil { + logger.Errorf( + "cannot reset current controller to %q: %v", + oldCurrentController, err, + ) + } + } + if err := store.RemoveController(c.controllerName); err != nil { + logger.Errorf( + "cannot destroy newly created controller %q details: %v", + c.controllerName, err, + ) + } + }() + + environ, err := bootstrapPrepare( + modelcmd.BootstrapContext(ctx), store, + bootstrap.PrepareParams{ + ModelConfig: config.bootstrapModel, + ControllerConfig: config.controller, + ControllerName: c.controllerName, + Cloud: environs.CloudSpec{ + Type: cloud.Type, + Name: c.Cloud, + Region: region.Name, + Endpoint: region.Endpoint, + IdentityEndpoint: region.IdentityEndpoint, + StorageEndpoint: region.StorageEndpoint, + Credential: credentials.credential, + }, + CredentialName: credentials.name, + AdminSecret: config.bootstrap.AdminSecret, + }, + ) + if err != nil { + return errors.Trace(err) + } + + hostedModelUUID, err := utils.NewUUID() + if err != nil { + return errors.Trace(err) + } + + // Set the current model to the initial hosted model. + if err := store.UpdateModel(c.controllerName, c.hostedModelName, jujuclient.ModelDetails{ + hostedModelUUID.String(), + }); err != nil { + return errors.Trace(err) + } + if err := store.SetCurrentModel(c.controllerName, c.hostedModelName); err != nil { + return errors.Trace(err) + } + + // Set the current controller so "juju status" can be run while + // bootstrapping is underway. + if err := store.SetCurrentController(c.controllerName); err != nil { + return errors.Trace(err) + } + + cloudRegion := c.Cloud + if region.Name != "" { + cloudRegion = fmt.Sprintf("%s/%s", cloudRegion, region.Name) + } + ctx.Infof( + "Creating Juju controller %q on %s", + c.controllerName, cloudRegion, + ) + + // If we error out for any reason, clean up the environment. + defer func() { + if resultErr != nil { + if c.KeepBrokenEnvironment { + ctx.Infof(` +bootstrap failed but --keep-broken was specified so resources are not being destroyed. +When you have finished diagnosing the problem, remember to clean up the failed controller. +See `[1:] + "`juju kill-controller`" + `.`) + } else { + handleBootstrapError(ctx, resultErr, func() error { + return environsDestroy( + c.controllerName, environ, store, + ) + }) + } + } + }() + + // Block interruption during bootstrap. Providers may also + // register for interrupt notification so they can exit early. + interrupted := make(chan os.Signal, 1) + defer close(interrupted) + ctx.InterruptNotify(interrupted) + defer ctx.StopInterruptNotify(interrupted) + go func() { + for _ = range interrupted { + ctx.Infof("Interrupt signalled: waiting for bootstrap to exit") + } + }() + + // If --metadata-source is specified, override the default tools metadata source so + // SyncTools can use it, and also upload any image metadata. + var metadataDir string + if c.MetadataSource != "" { + metadataDir = ctx.AbsPath(c.MetadataSource) + } + + // Merge environ and bootstrap-specific constraints. + constraintsValidator, err := environ.ConstraintsValidator() + if err != nil { + return errors.Trace(err) + } + bootstrapConstraints, err := constraintsValidator.Merge( + c.Constraints, c.BootstrapConstraints, + ) + if err != nil { + return errors.Trace(err) + } + logger.Infof("combined bootstrap constraints: %v", bootstrapConstraints) + + hostedModelConfig := c.hostedModelConfig( + hostedModelUUID, config.inheritedControllerAttrs, config.userConfigAttrs, environ) + + // Check whether the Juju GUI must be installed in the controller. + // Leaving this value empty means no GUI will be installed. + var guiDataSourceBaseURL string + if !c.noGUI { + guiDataSourceBaseURL = common.GUIDataSourceBaseURL() + } + + if credentials.name == "" { + // credentialName will be empty if the credential was detected. + // We must supply a name for the credential in the database, + // so choose one. + credentials.name = credentials.detectedName + } + + bootstrapFuncs := getBootstrapFuncs() + err = bootstrapFuncs.Bootstrap(modelcmd.BootstrapContext(ctx), environ, bootstrap.BootstrapParams{ + ModelConstraints: c.Constraints, + BootstrapConstraints: bootstrapConstraints, + BootstrapSeries: c.BootstrapSeries, + BootstrapImage: c.BootstrapImage, + Placement: c.Placement, + BuildAgent: c.BuildAgent, + BuildAgentTarball: sync.BuildAgentTarball, + AgentVersion: c.AgentVersion, + MetadataDir: metadataDir, + Cloud: *cloud, + CloudName: c.Cloud, + CloudRegion: region.Name, + CloudCredential: credentials.credential, + CloudCredentialName: credentials.name, + ControllerConfig: config.controller, + ControllerInheritedConfig: config.inheritedControllerAttrs, + RegionInheritedConfig: cloud.RegionConfig, + HostedModelConfig: hostedModelConfig, + GUIDataSourceBaseURL: guiDataSourceBaseURL, + AdminSecret: config.bootstrap.AdminSecret, + CAPrivateKey: config.bootstrap.CAPrivateKey, + DialOpts: environs.BootstrapDialOpts{ + Timeout: config.bootstrap.BootstrapTimeout, + RetryDelay: config.bootstrap.BootstrapRetryDelay, + AddressesDelay: config.bootstrap.BootstrapAddressesDelay, + }, + }) + if err != nil { + return errors.Annotate(err, "failed to bootstrap model") + } + + if err := c.SetModelName(modelcmd.JoinModelName(c.controllerName, c.hostedModelName)); err != nil { + return errors.Trace(err) + } + + agentVersion := jujuversion.Current + if c.AgentVersion != nil { + agentVersion = *c.AgentVersion + } + err = common.SetBootstrapEndpointAddress(c.ClientStore(), c.controllerName, agentVersion, config.controller.APIPort(), environ) + if err != nil { + return errors.Annotate(err, "saving bootstrap endpoint address") + } + + // To avoid race conditions when running scripted bootstraps, wait + // for the controller's machine agent to be ready to accept commands + // before exiting this bootstrap command. + return waitForAgentInitialisation(ctx, &c.ModelCommandBase, c.controllerName, c.hostedModelName) +} + +func (c *bootstrapCommand) handleCommandLineErrorsAndInfoRequests(ctx *cmd.Context) (bool, error) { if c.BootstrapImage != "" { if c.BootstrapSeries == "" { - return errors.Errorf("--bootstrap-image must be used with --bootstrap-series") + return true, errors.Errorf("--bootstrap-image must be used with --bootstrap-series") } cons, err := constraints.Merge(c.Constraints, c.BootstrapConstraints) if err != nil { - return errors.Trace(err) + return true, errors.Trace(err) } if !cons.HasArch() { - return errors.Errorf("--bootstrap-image must be used with --bootstrap-constraints, specifying architecture") - } - } - if c.interactive { - if err := c.runInteractive(ctx); err != nil { - return errors.Trace(err) + return true, errors.Errorf("--bootstrap-image must be used with --bootstrap-constraints, specifying architecture") } - // now run normal bootstrap using info gained above. } if c.showClouds { - return printClouds(ctx, c.ClientStore()) + return true, printClouds(ctx, c.ClientStore()) } if c.showRegionsForCloud != "" { - return printCloudRegions(ctx, c.showRegionsForCloud) + return true, printCloudRegions(ctx, c.showRegionsForCloud) } + return false, nil +} + +func (c *bootstrapCommand) cloud(ctx *cmd.Context) (*jujucloud.Cloud, error) { bootstrapFuncs := getBootstrapFuncs() // Get the cloud definition identified by c.Cloud. If c.Cloud does not @@ -352,9 +611,9 @@ ctx.Verbosef("cloud %q not found, trying as a provider name", c.Cloud) provider, err := environs.Provider(c.Cloud) if errors.IsNotFound(err) { - return errors.NewNotFound(nil, fmt.Sprintf("unknown cloud %q, please try %q", c.Cloud, "juju update-clouds")) + return nil, errors.NewNotFound(nil, fmt.Sprintf("unknown cloud %q, please try %q", c.Cloud, "juju update-clouds")) } else if err != nil { - return errors.Trace(err) + return nil, errors.Trace(err) } detector, ok := bootstrapFuncs.CloudRegionDetector(provider) if !ok { @@ -362,7 +621,7 @@ "provider %q does not support detecting regions", c.Cloud, ) - return errors.NewNotFound(nil, fmt.Sprintf("unknown cloud %q, please try %q", c.Cloud, "juju update-clouds")) + return nil, errors.NewNotFound(nil, fmt.Sprintf("unknown cloud %q, please try %q", c.Cloud, "juju update-clouds")) } var cloudEndpoint string regions, err := detector.DetectRegions() @@ -378,7 +637,7 @@ c.Region = "" } } else if err != nil { - return errors.Annotatef(err, + return nil, errors.Annotatef(err, "detecting regions for %q cloud provider", c.Cloud, ) @@ -398,31 +657,35 @@ Regions: regions, } } else if err != nil { - return errors.Trace(err) + return nil, errors.Trace(err) } if err := checkProviderType(cloud.Type); errors.IsNotFound(err) { // This error will get handled later. } else if err != nil { - return errors.Trace(err) + return nil, errors.Trace(err) } - provider, err := environs.Provider(cloud.Type) - if err != nil { - return errors.Trace(err) - } - // Custom clouds may not have explicitly declared support for any auth- - // types, in which case we'll assume that they support everything that - // the provider supports. - if len(cloud.AuthTypes) == 0 { - for authType := range provider.CredentialSchemas() { - cloud.AuthTypes = append(cloud.AuthTypes, authType) - } - } + return cloud, nil +} + +type bootstrapCredentials struct { + credential *jujucloud.Credential + name string + detectedName string +} + +// Get the credentials and region name. +func (c *bootstrapCommand) credentialsAndRegionName( + ctx *cmd.Context, + cloud *jujucloud.Cloud, +) ( + creds bootstrapCredentials, + regionName string, + err error, +) { - // Get the credentials and region name. store := c.ClientStore() - var detectedCredentialName string - credential, credentialName, regionName, err := modelcmd.GetCredentials( + creds.credential, creds.name, regionName, err = modelcmd.GetCredentials( ctx, store, modelcmd.GetCredentialsParams{ Cloud: *cloud, CloudName: c.Cloud, @@ -431,7 +694,7 @@ }, ) if errors.Cause(err) == modelcmd.ErrMultipleCredentials { - return ambiguousCredentialError + return bootstrapCredentials{}, "", ambiguousCredentialError } if errors.IsNotFound(err) && c.CredentialName == "" { // No credential was explicitly specified, and no credential @@ -440,56 +703,60 @@ ctx.Verbosef("no credentials found, checking environment") detected, err := modelcmd.DetectCredential(c.Cloud, cloud.Type) if errors.Cause(err) == modelcmd.ErrMultipleCredentials { - return ambiguousDetectedCredentialError + return bootstrapCredentials{}, "", ambiguousDetectedCredentialError } else if err != nil { - return errors.Trace(err) + return bootstrapCredentials{}, "", errors.Trace(err) } // We have one credential so extract it from the map. var oneCredential jujucloud.Credential - for detectedCredentialName, oneCredential = range detected.AuthCredentials { + for creds.detectedName, oneCredential = range detected.AuthCredentials { } - credential = &oneCredential + creds.credential = &oneCredential regionName = c.Region if regionName == "" { regionName = detected.DefaultRegion } logger.Debugf( "authenticating with region %q and credential %q (%v)", - regionName, detectedCredentialName, credential.Label, + regionName, creds.detectedName, creds.credential.Label, ) - logger.Tracef("credential: %v", credential) + logger.Tracef("credential: %v", creds.credential) } else if err != nil { - return errors.Trace(err) + return bootstrapCredentials{}, "", errors.Trace(err) } - region, err := getRegion(cloud, c.Cloud, regionName) - if err != nil { - fmt.Fprintf(ctx.GetStderr(), - "%s\n\nSpecify an alternative region, or try %q.\n", - err, "juju update-clouds", - ) - return cmd.ErrSilent - } - if c.controllerName == "" { - c.controllerName = defaultControllerName(c.Cloud, region.Name) - } + return creds, regionName, nil +} + +type bootstrapConfigs struct { + bootstrapModel map[string]interface{} + controller controller.Config + bootstrap bootstrap.Config + inheritedControllerAttrs map[string]interface{} + userConfigAttrs map[string]interface{} +} + +func (c *bootstrapCommand) bootstrapConfigs( + ctx *cmd.Context, + cloud *jujucloud.Cloud, + provider environs.EnvironProvider, +) ( + bootstrapConfigs, + error, +) { controllerModelUUID, err := utils.NewUUID() if err != nil { - return errors.Trace(err) - } - hostedModelUUID, err := utils.NewUUID() - if err != nil { - return errors.Trace(err) + return bootstrapConfigs{}, errors.Trace(err) } controllerUUID, err := utils.NewUUID() if err != nil { - return errors.Trace(err) + return bootstrapConfigs{}, errors.Trace(err) } // Create a model config, and split out any controller // and bootstrap config attributes. - modelConfigAttrs := map[string]interface{}{ + combinedConfig := map[string]interface{}{ "type": cloud.Type, "name": bootstrap.ControllerModelName, config.UUIDKey: controllerModelUUID.String(), @@ -497,13 +764,12 @@ userConfigAttrs, err := c.config.ReadAttrs(ctx) if err != nil { - return errors.Trace(err) + return bootstrapConfigs{}, errors.Trace(err) } modelDefaultConfigAttrs, err := c.modelDefaults.ReadAttrs(ctx) if err != nil { - return errors.Trace(err) + return bootstrapConfigs{}, errors.Trace(err) } - // The provider may define some custom attributes specific // to the provider. These will be added to the model config. providerAttrs := make(map[string]interface{}) @@ -520,25 +786,13 @@ } fields := schema.FieldMap(ps.ConfigSchema(), ps.ConfigDefaults()) if coercedAttrs, err := fields.Coerce(providerAttrs, nil); err != nil { - return errors.Annotatef(err, "invalid attribute value(s) for %v cloud", cloud.Type) + return bootstrapConfigs{}, + errors.Annotatef(err, "invalid attribute value(s) for %v cloud", cloud.Type) } else { providerAttrs = coercedAttrs.(map[string]interface{}) } } - // Start with the model defaults, then add in user config attributes. - for k, v := range modelDefaultConfigAttrs { - modelConfigAttrs[k] = v - } - for k, v := range userConfigAttrs { - modelConfigAttrs[k] = v - } - // Provider specific attributes are either already specified in model - // config (but may have been coerced), or were not present. Either way, - // copy them in. - logger.Debugf("provider attrs: %v", providerAttrs) - for k, v := range providerAttrs { - modelConfigAttrs[k] = v - } + bootstrapConfigAttrs := make(map[string]interface{}) controllerConfigAttrs := make(map[string]interface{}) // Based on the attribute names in clouds.yaml, create @@ -560,31 +814,66 @@ for k, v := range modelDefaultConfigAttrs { switch { case bootstrap.IsBootstrapAttribute(k): - return errors.Errorf("%q is a bootstrap only attribute, and cannot be set as a model-default", k) + return bootstrapConfigs{}, + errors.Errorf("%q is a bootstrap only attribute, and cannot be set as a model-default", k) case controller.ControllerOnlyAttribute(k): - return errors.Errorf("%q is a controller attribute, and cannot be set as a model-default", k) + return bootstrapConfigs{}, + errors.Errorf("%q is a controller attribute, and cannot be set as a model-default", k) } inheritedControllerAttrs[k] = v } - for k, v := range modelConfigAttrs { + + // Start with the model defaults, then add in user config attributes. + for k, v := range modelDefaultConfigAttrs { + combinedConfig[k] = v + } + + // Provider specific attributes are either already specified in model + // config (but may have been coerced), or were not present. Either way, + // copy them in. + logger.Debugf("provider attrs: %v", providerAttrs) + for k, v := range providerAttrs { + combinedConfig[k] = v + } + + for k, v := range inheritedControllerAttrs { + combinedConfig[k] = v + } + + for k, v := range userConfigAttrs { + combinedConfig[k] = v + } + + // Add in any default attribute values if not already + // specified, making the recorded bootstrap config + // immutable to changes in Juju. + for k, v := range config.ConfigDefaults() { + if _, ok := combinedConfig[k]; !ok { + combinedConfig[k] = v + } + } + + bootstrapModelConfig := make(map[string]interface{}) + for k, v := range combinedConfig { switch { case bootstrap.IsBootstrapAttribute(k): bootstrapConfigAttrs[k] = v - delete(modelConfigAttrs, k) case controller.ControllerOnlyAttribute(k): controllerConfigAttrs[k] = v - delete(modelConfigAttrs, k) + default: + bootstrapModelConfig[k] = v } } + bootstrapConfig, err := bootstrap.NewConfig(bootstrapConfigAttrs) if err != nil { - return errors.Annotate(err, "constructing bootstrap config") + return bootstrapConfigs{}, errors.Annotate(err, "constructing bootstrap config") } controllerConfig, err := controller.NewConfig( controllerUUID.String(), bootstrapConfig.CACert, controllerConfigAttrs, ) if err != nil { - return errors.Annotate(err, "constructing controller config") + return bootstrapConfigs{}, errors.Annotate(err, "constructing controller config") } if controllerConfig.AutocertDNSName() != "" { if _, ok := controllerConfigAttrs[controller.APIPort]; !ok { @@ -595,153 +884,27 @@ } } - if err := common.FinalizeAuthorizedKeys(ctx, modelConfigAttrs); err != nil { - return errors.Annotate(err, "finalizing authorized-keys") - } - logger.Debugf("preparing controller with config: %v", modelConfigAttrs) - - // Read existing current controller so we can clean up on error. - var oldCurrentController string - oldCurrentController, err = store.CurrentController() - if errors.IsNotFound(err) { - oldCurrentController = "" - } else if err != nil { - return errors.Annotate(err, "error reading current controller") + if err := common.FinalizeAuthorizedKeys(ctx, bootstrapModelConfig); err != nil { + return bootstrapConfigs{}, errors.Annotate(err, "finalizing authorized-keys") } + logger.Debugf("preparing controller with config: %v", bootstrapModelConfig) - defer func() { - if resultErr == nil || errors.IsAlreadyExists(resultErr) { - return - } - if oldCurrentController != "" { - if err := store.SetCurrentController(oldCurrentController); err != nil { - logger.Errorf( - "cannot reset current controller to %q: %v", - oldCurrentController, err, - ) - } - } - if err := store.RemoveController(c.controllerName); err != nil { - logger.Errorf( - "cannot destroy newly created controller %q details: %v", - c.controllerName, err, - ) - } - }() - - bootstrapModelConfig := make(map[string]interface{}) - for k, v := range inheritedControllerAttrs { - bootstrapModelConfig[k] = v - } - for k, v := range modelConfigAttrs { - bootstrapModelConfig[k] = v + configs := bootstrapConfigs{ + bootstrapModel: bootstrapModelConfig, + controller: controllerConfig, + bootstrap: bootstrapConfig, + inheritedControllerAttrs: inheritedControllerAttrs, + userConfigAttrs: userConfigAttrs, } - // Add in any default attribute values if not already - // specified, making the recorded bootstrap config - // immutable to changes in Juju. - for k, v := range config.ConfigDefaults() { - if _, ok := bootstrapModelConfig[k]; !ok { - bootstrapModelConfig[k] = v - } - } - - environ, err := bootstrapPrepare( - modelcmd.BootstrapContext(ctx), store, - bootstrap.PrepareParams{ - ModelConfig: bootstrapModelConfig, - ControllerConfig: controllerConfig, - ControllerName: c.controllerName, - Cloud: environs.CloudSpec{ - Type: cloud.Type, - Name: c.Cloud, - Region: region.Name, - Endpoint: region.Endpoint, - IdentityEndpoint: region.IdentityEndpoint, - StorageEndpoint: region.StorageEndpoint, - Credential: credential, - }, - CredentialName: credentialName, - AdminSecret: bootstrapConfig.AdminSecret, - }, - ) - if err != nil { - return errors.Trace(err) - } - - // Set the current model to the initial hosted model. - if err := store.UpdateModel(c.controllerName, c.hostedModelName, jujuclient.ModelDetails{ - hostedModelUUID.String(), - }); err != nil { - return errors.Trace(err) - } - if err := store.SetCurrentModel(c.controllerName, c.hostedModelName); err != nil { - return errors.Trace(err) - } - - // Set the current controller so "juju status" can be run while - // bootstrapping is underway. - if err := store.SetCurrentController(c.controllerName); err != nil { - return errors.Trace(err) - } - - cloudRegion := c.Cloud - if region.Name != "" { - cloudRegion = fmt.Sprintf("%s/%s", cloudRegion, region.Name) - } - ctx.Infof( - "Creating Juju controller %q on %s", - c.controllerName, cloudRegion, - ) - - // If we error out for any reason, clean up the environment. - defer func() { - if resultErr != nil { - if c.KeepBrokenEnvironment { - ctx.Infof(` -bootstrap failed but --keep-broken was specified so resources are not being destroyed. -When you have finished diagnosing the problem, remember to clean up the failed controller. -See `[1:] + "`juju kill-controller`" + `.`) - } else { - handleBootstrapError(ctx, resultErr, func() error { - return environsDestroy( - c.controllerName, environ, store, - ) - }) - } - } - }() - - // Block interruption during bootstrap. Providers may also - // register for interrupt notification so they can exit early. - interrupted := make(chan os.Signal, 1) - defer close(interrupted) - ctx.InterruptNotify(interrupted) - defer ctx.StopInterruptNotify(interrupted) - go func() { - for _ = range interrupted { - ctx.Infof("Interrupt signalled: waiting for bootstrap to exit") - } - }() + return configs, nil +} - // If --metadata-source is specified, override the default tools metadata source so - // SyncTools can use it, and also upload any image metadata. - var metadataDir string - if c.MetadataSource != "" { - metadataDir = ctx.AbsPath(c.MetadataSource) - } - - // Merge environ and bootstrap-specific constraints. - constraintsValidator, err := environ.ConstraintsValidator() - if err != nil { - return errors.Trace(err) - } - bootstrapConstraints, err := constraintsValidator.Merge( - c.Constraints, c.BootstrapConstraints, - ) - if err != nil { - return errors.Trace(err) - } - logger.Infof("combined bootstrap constraints: %v", bootstrapConstraints) +func (c *bootstrapCommand) hostedModelConfig( + hostedModelUUID utils.UUID, + inheritedControllerAttrs, + userConfigAttrs map[string]interface{}, + environ environs.Environ, +) map[string]interface{} { hostedModelConfig := map[string]interface{}{ "name": c.hostedModelName, @@ -767,69 +930,7 @@ delete(hostedModelConfig, config.AuthorizedKeysKey) delete(hostedModelConfig, config.AgentVersionKey) - // Check whether the Juju GUI must be installed in the controller. - // Leaving this value empty means no GUI will be installed. - var guiDataSourceBaseURL string - if !c.noGUI { - guiDataSourceBaseURL = common.GUIDataSourceBaseURL() - } - - if credentialName == "" { - // credentialName will be empty if the credential was detected. - // We must supply a name for the credential in the database, - // so choose one. - credentialName = detectedCredentialName - } - - err = bootstrapFuncs.Bootstrap(modelcmd.BootstrapContext(ctx), environ, bootstrap.BootstrapParams{ - ModelConstraints: c.Constraints, - BootstrapConstraints: bootstrapConstraints, - BootstrapSeries: c.BootstrapSeries, - BootstrapImage: c.BootstrapImage, - Placement: c.Placement, - BuildAgent: c.BuildAgent, - BuildAgentTarball: sync.BuildAgentTarball, - AgentVersion: c.AgentVersion, - MetadataDir: metadataDir, - Cloud: *cloud, - CloudName: c.Cloud, - CloudRegion: region.Name, - CloudCredential: credential, - CloudCredentialName: credentialName, - ControllerConfig: controllerConfig, - ControllerInheritedConfig: inheritedControllerAttrs, - RegionInheritedConfig: cloud.RegionConfig, - HostedModelConfig: hostedModelConfig, - GUIDataSourceBaseURL: guiDataSourceBaseURL, - AdminSecret: bootstrapConfig.AdminSecret, - CAPrivateKey: bootstrapConfig.CAPrivateKey, - DialOpts: environs.BootstrapDialOpts{ - Timeout: bootstrapConfig.BootstrapTimeout, - RetryDelay: bootstrapConfig.BootstrapRetryDelay, - AddressesDelay: bootstrapConfig.BootstrapAddressesDelay, - }, - }) - if err != nil { - return errors.Annotate(err, "failed to bootstrap model") - } - - if err := c.SetModelName(modelcmd.JoinModelName(c.controllerName, c.hostedModelName)); err != nil { - return errors.Trace(err) - } - - agentVersion := jujuversion.Current - if c.AgentVersion != nil { - agentVersion = *c.AgentVersion - } - err = common.SetBootstrapEndpointAddress(c.ClientStore(), c.controllerName, agentVersion, controllerConfig.APIPort(), environ) - if err != nil { - return errors.Annotate(err, "saving bootstrap endpoint address") - } - - // To avoid race conditions when running scripted bootstraps, wait - // for the controller's machine agent to be ready to accept commands - // before exiting this bootstrap command. - return waitForAgentInitialisation(ctx, &c.ModelCommandBase, c.controllerName, c.hostedModelName) + return hostedModelConfig } // runInteractive queries the user about bootstrap config interactively at the diff -Nru juju-core-2.0.0/src/github.com/juju/juju/cmd/juju/commands/bootstrap_test.go juju-core-2.0.2/src/github.com/juju/juju/cmd/juju/commands/bootstrap_test.go --- juju-core-2.0.0/src/github.com/juju/juju/cmd/juju/commands/bootstrap_test.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/cmd/juju/commands/bootstrap_test.go 2016-11-11 00:08:09.000000000 +0000 @@ -48,6 +48,7 @@ "github.com/juju/juju/jujuclient/jujuclienttesting" "github.com/juju/juju/network" "github.com/juju/juju/provider/dummy" + "github.com/juju/juju/provider/openstack" coretesting "github.com/juju/juju/testing" coretools "github.com/juju/juju/tools" jujuversion "github.com/juju/juju/version" @@ -250,6 +251,10 @@ if test.bootstrapConstraints == (constraints.Value{}) { test.bootstrapConstraints = test.constraints } + if test.bootstrapConstraints.Mem == nil { + mem := uint64(3584) + test.bootstrapConstraints.Mem = &mem + } c.Check(opBootstrap.Args.BootstrapConstraints, gc.DeepEquals, test.bootstrapConstraints) c.Check(opBootstrap.Args.Placement, gc.Equals, test.placement) @@ -590,6 +595,149 @@ c.Assert(ok, jc.IsFalse) } +// checkConfigs runs bootstrapCmd.getBootstrapConfigs and checks the returned configs match +// the expected values passed in the expect parameter. +func checkConfigs( + c *gc.C, + bootstrapCmd bootstrapCommand, + key string, + ctx *cmd.Context, cloud *cloud.Cloud, provider environs.EnvironProvider, + expect map[string]map[string]interface{}) { + + configs, err := bootstrapCmd.bootstrapConfigs(ctx, cloud, provider) + + c.Assert(err, jc.ErrorIsNil) + + checkConfigEntryMatches(c, configs.bootstrapModel, key, "bootstrapModelConfig", expect) + checkConfigEntryMatches(c, configs.inheritedControllerAttrs, key, "inheritedControllerAttrs", expect) + checkConfigEntryMatches(c, configs.userConfigAttrs, key, "userConfigAttrs", expect) + + _, ok := configs.controller[key] + c.Check(ok, jc.IsFalse) +} + +// checkConfigEntryMatches tests that a keys existence and indexed value in configMap +// matches those in expect[name]. +func checkConfigEntryMatches(c *gc.C, configMap map[string]interface{}, key, name string, expect map[string]map[string]interface{}) { + v, ok := configMap[key] + expected_config, expected_config_ok := expect[name] + c.Assert(expected_config_ok, jc.IsTrue) + v_expect, ok_expect := expected_config[key] + + c.Logf("checkConfigEntryMatches %v %v", name, key) + c.Check(ok, gc.Equals, ok_expect) + c.Check(v, gc.Equals, v_expect) +} + +func (s *BootstrapSuite) TestBootstrapAttributesInheritedOverDefaults(c *gc.C) { + /* Test that defaults are overwritten by inherited attributes by setting + the inherited attribute enable-os-upgrade to true in the cloud + config and ensure that it ends up as true in the model config. */ + s.patchVersionAndSeries(c, "raring") + + bootstrapCmd := bootstrapCommand{} + ctx := coretesting.Context(c) + + // The OpenStack provider has a default of "use-floating-ip": false, so we + // use that to test against. + env := &openstack.Environ{} + provider := env.Provider() + + // First test that use-floating-ip defaults to false + testCloud, err := cloud.CloudByName("dummy-cloud") + c.Assert(err, jc.ErrorIsNil) + + key := "use-floating-ip" + checkConfigs(c, bootstrapCmd, key, ctx, testCloud, provider, map[string]map[string]interface{}{ + "bootstrapModelConfig": {key: false}, + "inheritedControllerAttrs": {}, + "userConfigAttrs": {}, + }) + + // Second test that use-floating-ip in the cloud config overwrites the + // provider default of false with true + testCloud, err = cloud.CloudByName("dummy-cloud-with-config") + c.Assert(err, jc.ErrorIsNil) + + checkConfigs(c, bootstrapCmd, key, ctx, testCloud, provider, map[string]map[string]interface{}{ + "bootstrapModelConfig": {key: true}, + "inheritedControllerAttrs": {key: true}, + "userConfigAttrs": {}, + }) +} + +func (s *BootstrapSuite) TestBootstrapAttributesCLIOverDefaults(c *gc.C) { + /* Test that defaults are overwritten by CLI passed attributes by setting + the inherited attribute enable-os-upgrade to true in the cloud + config and ensure that it ends up as true in the model config. */ + s.patchVersionAndSeries(c, "raring") + + bootstrapCmd := bootstrapCommand{} + ctx := coretesting.Context(c) + + // The OpenStack provider has a default of "use-floating-ip": false, so we + // use that to test against. + env := &openstack.Environ{} + provider := env.Provider() + + // First test that use-floating-ip defaults to false + testCloud, err := cloud.CloudByName("dummy-cloud") + c.Assert(err, jc.ErrorIsNil) + + key := "use-floating-ip" + checkConfigs(c, bootstrapCmd, key, ctx, testCloud, provider, map[string]map[string]interface{}{ + "bootstrapModelConfig": {key: false}, + "inheritedControllerAttrs": {}, + "userConfigAttrs": {}, + }) + + // Second test that use-floating-ip passed on the command line overwrites the + // provider default of false with true + bootstrapCmd.config.Set("use-floating-ip=true") + checkConfigs(c, bootstrapCmd, key, ctx, testCloud, provider, map[string]map[string]interface{}{ + "bootstrapModelConfig": {key: true}, + "inheritedControllerAttrs": {}, + "userConfigAttrs": {key: true}, + }) +} + +func (s *BootstrapSuite) TestBootstrapAttributesCLIOverInherited(c *gc.C) { + /* Test that defaults are overwritten by CLI passed attributes by setting + the inherited attribute enable-os-upgrade to true in the cloud + config and ensure that it ends up as true in the model config. */ + s.patchVersionAndSeries(c, "raring") + + bootstrapCmd := bootstrapCommand{} + ctx := coretesting.Context(c) + + // The OpenStack provider has a default of "use-floating-ip": false, so we + // use that to test against. + env := &openstack.Environ{} + provider := env.Provider() + + // First test that use-floating-ip defaults to false + testCloud, err := cloud.CloudByName("dummy-cloud") + c.Assert(err, jc.ErrorIsNil) + + key := "use-floating-ip" + checkConfigs(c, bootstrapCmd, key, ctx, testCloud, provider, map[string]map[string]interface{}{ + "bootstrapModelConfig": {key: false}, + "inheritedControllerAttrs": {}, + "userConfigAttrs": {}, + }) + + // Second test that use-floating-ip passed on the command line overwrites the + // inherited attribute + testCloud, err = cloud.CloudByName("dummy-cloud-with-config") + c.Assert(err, jc.ErrorIsNil) + bootstrapCmd.config.Set("use-floating-ip=false") + checkConfigs(c, bootstrapCmd, key, ctx, testCloud, provider, map[string]map[string]interface{}{ + "bootstrapModelConfig": {key: false}, + "inheritedControllerAttrs": {key: true}, + "userConfigAttrs": {key: false}, + }) +} + func (s *BootstrapSuite) TestBootstrapWithGUI(c *gc.C) { s.patchVersionAndSeries(c, "raring") var bootstrap fakeBootstrapFuncs @@ -1399,6 +1547,7 @@ c.Assert(coretesting.Stdout(ctx), jc.DeepEquals, ` Showing regions for aws: us-east-1 +us-east-2 us-west-1 us-west-2 eu-west-1 @@ -1532,6 +1681,7 @@ config: broken: Bootstrap controller: not-a-bool + use-floating-ip: true many-credentials-no-auth-types: type: many-credentials `[1:]), 0644) diff -Nru juju-core-2.0.0/src/github.com/juju/juju/cmd/juju/commands/debughooks.go juju-core-2.0.2/src/github.com/juju/juju/cmd/juju/commands/debughooks.go --- juju-core-2.0.0/src/github.com/juju/juju/cmd/juju/commands/debughooks.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/cmd/juju/commands/debughooks.go 2016-11-11 00:08:09.000000000 +0000 @@ -15,11 +15,14 @@ "github.com/juju/juju/api/application" "github.com/juju/juju/cmd/modelcmd" + "github.com/juju/juju/network" unitdebug "github.com/juju/juju/worker/uniter/runner/debug" ) -func newDebugHooksCommand() cmd.Command { - return modelcmd.Wrap(&debugHooksCommand{}) +func newDebugHooksCommand(hostDialer network.Dialer) cmd.Command { + c := new(debugHooksCommand) + c.setHostDialer(hostDialer) + return modelcmd.Wrap(c) } // debugHooksCommand is responsible for launching a ssh shell on a given unit or machine. diff -Nru juju-core-2.0.0/src/github.com/juju/juju/cmd/juju/commands/debughooks_test.go juju-core-2.0.2/src/github.com/juju/juju/cmd/juju/commands/debughooks_test.go --- juju-core-2.0.0/src/github.com/juju/juju/cmd/juju/commands/debughooks_test.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/cmd/juju/commands/debughooks_test.go 2016-11-11 00:08:09.000000000 +0000 @@ -19,15 +19,17 @@ } var debugHooksTests = []struct { - info string - args []string - error string - proxy bool - expected *argsSpec + info string + args []string + dialWith dialerFunc + forceAPIv1 bool + error string + expected *argsSpec }{{ - info: "unit name without hook", - args: []string{"mysql/0"}, - proxy: true, + info: "literal script (api v1: unit name w/o hook or proxy)", + args: []string{"mysql/0"}, + dialWith: dialerFuncFor("0.private", "0.public"), + forceAPIv1: true, expected: &argsSpec{ hostKeyChecking: "yes", knownHosts: "0", @@ -35,14 +37,50 @@ args: "ubuntu@0.public sudo /bin/bash -c 'F=$(mktemp); echo IyEvYmluL2Jhc2gKKApjbGVhbnVwX29uX2V4aXQoKSAKeyAKCWVjaG8gIkNsZWFuaW5nIHVwIHRoZSBkZWJ1ZyBzZXNzaW9uIgoJdG11eCBraWxsLXNlc3Npb24gLXQgbXlzcWwvMDsgCn0KdHJhcCBjbGVhbnVwX29uX2V4aXQgRVhJVAoKIyBMb2NrIHRoZSBqdWp1LTx1bml0Pi1kZWJ1ZyBsb2NrZmlsZS4KZmxvY2sgLW4gOCB8fCAoCgllY2hvICJGb3VuZCBleGlzdGluZyBkZWJ1ZyBzZXNzaW9ucywgYXR0ZW1wdGluZyB0byByZWNvbm5lY3QiIDI+JjEKCWV4ZWMgdG11eCBhdHRhY2gtc2Vzc2lvbiAtdCBteXNxbC8wCglleGl0ICQ/CgkpCigKIyBDbG9zZSB0aGUgaW5oZXJpdGVkIGxvY2sgRkQsIG9yIHRtdXggd2lsbCBrZWVwIGl0IG9wZW4uCmV4ZWMgOD4mLQoKIyBXcml0ZSBvdXQgdGhlIGRlYnVnLWhvb2tzIGFyZ3MuCmVjaG8gImUzMEsiIHwgYmFzZTY0IC1kID4gL3RtcC9qdWp1LXVuaXQtbXlzcWwtMC1kZWJ1Zy1ob29rcwoKIyBMb2NrIHRoZSBqdWp1LTx1bml0Pi1kZWJ1Zy1leGl0IGxvY2tmaWxlLgpmbG9jayAtbiA5IHx8IGV4aXQgMQoKIyBXYWl0IGZvciB0bXV4IHRvIGJlIGluc3RhbGxlZC4Kd2hpbGUgWyAhIC1mIC91c3IvYmluL3RtdXggXTsgZG8KICAgIHNsZWVwIDEKZG9uZQoKaWYgWyAhIC1mIH4vLnRtdXguY29uZiBdOyB0aGVuCiAgICAgICAgaWYgWyAtZiAvdXNyL3NoYXJlL2J5b2J1L3Byb2ZpbGVzL3RtdXggXTsgdGhlbgogICAgICAgICAgICAgICAgIyBVc2UgYnlvYnUvdG11eCBwcm9maWxlIGZvciBmYW1pbGlhciBrZXliaW5kaW5ncyBhbmQgYnJhbmRpbmcKICAgICAgICAgICAgICAgIGVjaG8gInNvdXJjZS1maWxlIC91c3Ivc2hhcmUvYnlvYnUvcHJvZmlsZXMvdG11eCIgPiB+Ly50bXV4LmNvbmYKICAgICAgICBlbHNlCiAgICAgICAgICAgICAgICAjIE90aGVyd2lzZSwgdXNlIHRoZSBsZWdhY3kganVqdS90bXV4IGNvbmZpZ3VyYXRpb24KICAgICAgICAgICAgICAgIGNhdCA+IH4vLnRtdXguY29uZiA8PEVORAogICAgICAgICAgICAgICAgCiMgU3RhdHVzIGJhcgpzZXQtb3B0aW9uIC1nIHN0YXR1cy1iZyBibGFjawpzZXQtb3B0aW9uIC1nIHN0YXR1cy1mZyB3aGl0ZQoKc2V0LXdpbmRvdy1vcHRpb24gLWcgd2luZG93LXN0YXR1cy1jdXJyZW50LWJnIHJlZApzZXQtd2luZG93LW9wdGlvbiAtZyB3aW5kb3ctc3RhdHVzLWN1cnJlbnQtYXR0ciBicmlnaHQKCnNldC1vcHRpb24gLWcgc3RhdHVzLXJpZ2h0ICcnCgojIFBhbmVzCnNldC1vcHRpb24gLWcgcGFuZS1ib3JkZXItZmcgd2hpdGUKc2V0LW9wdGlvbiAtZyBwYW5lLWFjdGl2ZS1ib3JkZXItZmcgd2hpdGUKCiMgTW9uaXRvciBhY3Rpdml0eSBvbiB3aW5kb3dzCnNldC13aW5kb3ctb3B0aW9uIC1nIG1vbml0b3ItYWN0aXZpdHkgb24KCiMgU2NyZWVuIGJpbmRpbmdzLCBzaW5jZSBwZW9wbGUgYXJlIG1vcmUgZmFtaWxpYXIgd2l0aCB0aGF0LgpzZXQtb3B0aW9uIC1nIHByZWZpeCBDLWEKYmluZCBDLWEgbGFzdC13aW5kb3cKYmluZCBhIHNlbmQta2V5IEMtYQoKYmluZCB8IHNwbGl0LXdpbmRvdyAtaApiaW5kIC0gc3BsaXQtd2luZG93IC12CgojIEZpeCBDVFJMLVBHVVAvUEdET1dOIGZvciB2aW0Kc2V0LXdpbmRvdy1vcHRpb24gLWcgeHRlcm0ta2V5cyBvbgoKIyBQcmV2ZW50IEVTQyBrZXkgZnJvbSBhZGRpbmcgZGVsYXkgYW5kIGJyZWFraW5nIFZpbSdzIEVTQyA+IGFycm93IGtleQpzZXQtb3B0aW9uIC1zIGVzY2FwZS10aW1lIDAKCkVORAogICAgICAgIGZpCmZpCgooCiAgICAjIENsb3NlIHRoZSBpbmhlcml0ZWQgbG9jayBGRCwgb3IgdG11eCB3aWxsIGtlZXAgaXQgb3Blbi4KICAgIGV4ZWMgOT4mLQogICAgaWYgISB0bXV4IGhhcy1zZXNzaW9uIC10IG15c3FsLzA7IHRoZW4KCQl0bXV4IG5ldy1zZXNzaW9uIC1kIC1zIG15c3FsLzAKCWZpCgljbGllbnRfY291bnQ9JCh0bXV4IGxpc3QtY2xpZW50cyB8IHdjIC1sKQoJaWYgWyAkY2xpZW50X2NvdW50IC1nZSAxIF07IHRoZW4KCQlzZXNzaW9uX25hbWU9bXlzcWwvMCItIiRjbGllbnRfY250CgkJZXhlYyB0bXV4IG5ldy1zZXNzaW9uIC1kIC10IG15c3FsLzAgLXMgJHNlc3Npb25fbmFtZQoJCWV4ZWMgdG11eCBhdHRhY2gtc2Vzc2lvbiAtdCAkc2Vzc2lvbl9uYW1lIFw7IHNldC1vcHRpb24gZGVzdHJveS11bmF0dGFjaGVkCgllbHNlCgkgICAgZXhlYyB0bXV4IGF0dGFjaC1zZXNzaW9uIC10IG15c3FsLzAKCWZpCikKKSA5Pi90bXAvanVqdS11bml0LW15c3FsLTAtZGVidWctaG9va3MtZXhpdAopIDg+L3RtcC9qdWp1LXVuaXQtbXlzcWwtMC1kZWJ1Zy1ob29rcwpleGl0ICQ/Cg== | base64 -d > $F; . $F'", }, }, { - info: "proxy", - args: []string{"--proxy=true", "mysql/0"}, + info: "unit name without hook (api v1)", + args: []string{"mysql/0"}, + dialWith: dialerFuncFor("0.private", "0.public"), + forceAPIv1: true, + expected: &argsSpec{ + hostKeyChecking: "yes", + knownHosts: "0", + enablePty: true, + argsMatch: `ubuntu@0\.public sudo /bin/bash .+`, + }, +}, { + info: "unit name without hook (api v2)", + args: []string{"mysql/0"}, + dialWith: dialerFuncFor("0.private", "0.public", "0.1.2.3"), // set by setAddresses() and setLinkLayerDevicesAddresses() + forceAPIv1: false, + expected: &argsSpec{ + hostKeyChecking: "yes", + knownHosts: "0", + enablePty: true, + argsMatch: `ubuntu@0\.(private|public|1\.2\.3) sudo .+`, // can be any of the 3 + }, +}, { + info: "proxy (api v1)", + args: []string{"--proxy=true", "mysql/0"}, + dialWith: dialerFuncFor("0.private", "0.public"), + forceAPIv1: true, + expected: &argsSpec{ + hostKeyChecking: "yes", + knownHosts: "0", + enablePty: true, + withProxy: true, + argsMatch: `ubuntu@0\.private sudo /bin/bash .+`, + }, +}, { + info: "proxy (api v2)", + args: []string{"--proxy=true", "mysql/0"}, + dialWith: dialerFuncFor("0.private", "0.public", "0.1.2.3"), // set by setAddresses() and setLinkLayerDevicesAddresses() + forceAPIv1: false, expected: &argsSpec{ hostKeyChecking: "yes", knownHosts: "0", enablePty: true, withProxy: true, - args: "ubuntu@0.private sudo /bin/bash -c 'F=$(mktemp); echo IyEvYmluL2Jhc2gKKApjbGVhbnVwX29uX2V4aXQoKSAKeyAKCWVjaG8gIkNsZWFuaW5nIHVwIHRoZSBkZWJ1ZyBzZXNzaW9uIgoJdG11eCBraWxsLXNlc3Npb24gLXQgbXlzcWwvMDsgCn0KdHJhcCBjbGVhbnVwX29uX2V4aXQgRVhJVAoKIyBMb2NrIHRoZSBqdWp1LTx1bml0Pi1kZWJ1ZyBsb2NrZmlsZS4KZmxvY2sgLW4gOCB8fCAoCgllY2hvICJGb3VuZCBleGlzdGluZyBkZWJ1ZyBzZXNzaW9ucywgYXR0ZW1wdGluZyB0byByZWNvbm5lY3QiIDI+JjEKCWV4ZWMgdG11eCBhdHRhY2gtc2Vzc2lvbiAtdCBteXNxbC8wCglleGl0ICQ/CgkpCigKIyBDbG9zZSB0aGUgaW5oZXJpdGVkIGxvY2sgRkQsIG9yIHRtdXggd2lsbCBrZWVwIGl0IG9wZW4uCmV4ZWMgOD4mLQoKIyBXcml0ZSBvdXQgdGhlIGRlYnVnLWhvb2tzIGFyZ3MuCmVjaG8gImUzMEsiIHwgYmFzZTY0IC1kID4gL3RtcC9qdWp1LXVuaXQtbXlzcWwtMC1kZWJ1Zy1ob29rcwoKIyBMb2NrIHRoZSBqdWp1LTx1bml0Pi1kZWJ1Zy1leGl0IGxvY2tmaWxlLgpmbG9jayAtbiA5IHx8IGV4aXQgMQoKIyBXYWl0IGZvciB0bXV4IHRvIGJlIGluc3RhbGxlZC4Kd2hpbGUgWyAhIC1mIC91c3IvYmluL3RtdXggXTsgZG8KICAgIHNsZWVwIDEKZG9uZQoKaWYgWyAhIC1mIH4vLnRtdXguY29uZiBdOyB0aGVuCiAgICAgICAgaWYgWyAtZiAvdXNyL3NoYXJlL2J5b2J1L3Byb2ZpbGVzL3RtdXggXTsgdGhlbgogICAgICAgICAgICAgICAgIyBVc2UgYnlvYnUvdG11eCBwcm9maWxlIGZvciBmYW1pbGlhciBrZXliaW5kaW5ncyBhbmQgYnJhbmRpbmcKICAgICAgICAgICAgICAgIGVjaG8gInNvdXJjZS1maWxlIC91c3Ivc2hhcmUvYnlvYnUvcHJvZmlsZXMvdG11eCIgPiB+Ly50bXV4LmNvbmYKICAgICAgICBlbHNlCiAgICAgICAgICAgICAgICAjIE90aGVyd2lzZSwgdXNlIHRoZSBsZWdhY3kganVqdS90bXV4IGNvbmZpZ3VyYXRpb24KICAgICAgICAgICAgICAgIGNhdCA+IH4vLnRtdXguY29uZiA8PEVORAogICAgICAgICAgICAgICAgCiMgU3RhdHVzIGJhcgpzZXQtb3B0aW9uIC1nIHN0YXR1cy1iZyBibGFjawpzZXQtb3B0aW9uIC1nIHN0YXR1cy1mZyB3aGl0ZQoKc2V0LXdpbmRvdy1vcHRpb24gLWcgd2luZG93LXN0YXR1cy1jdXJyZW50LWJnIHJlZApzZXQtd2luZG93LW9wdGlvbiAtZyB3aW5kb3ctc3RhdHVzLWN1cnJlbnQtYXR0ciBicmlnaHQKCnNldC1vcHRpb24gLWcgc3RhdHVzLXJpZ2h0ICcnCgojIFBhbmVzCnNldC1vcHRpb24gLWcgcGFuZS1ib3JkZXItZmcgd2hpdGUKc2V0LW9wdGlvbiAtZyBwYW5lLWFjdGl2ZS1ib3JkZXItZmcgd2hpdGUKCiMgTW9uaXRvciBhY3Rpdml0eSBvbiB3aW5kb3dzCnNldC13aW5kb3ctb3B0aW9uIC1nIG1vbml0b3ItYWN0aXZpdHkgb24KCiMgU2NyZWVuIGJpbmRpbmdzLCBzaW5jZSBwZW9wbGUgYXJlIG1vcmUgZmFtaWxpYXIgd2l0aCB0aGF0LgpzZXQtb3B0aW9uIC1nIHByZWZpeCBDLWEKYmluZCBDLWEgbGFzdC13aW5kb3cKYmluZCBhIHNlbmQta2V5IEMtYQoKYmluZCB8IHNwbGl0LXdpbmRvdyAtaApiaW5kIC0gc3BsaXQtd2luZG93IC12CgojIEZpeCBDVFJMLVBHVVAvUEdET1dOIGZvciB2aW0Kc2V0LXdpbmRvdy1vcHRpb24gLWcgeHRlcm0ta2V5cyBvbgoKIyBQcmV2ZW50IEVTQyBrZXkgZnJvbSBhZGRpbmcgZGVsYXkgYW5kIGJyZWFraW5nIFZpbSdzIEVTQyA+IGFycm93IGtleQpzZXQtb3B0aW9uIC1zIGVzY2FwZS10aW1lIDAKCkVORAogICAgICAgIGZpCmZpCgooCiAgICAjIENsb3NlIHRoZSBpbmhlcml0ZWQgbG9jayBGRCwgb3IgdG11eCB3aWxsIGtlZXAgaXQgb3Blbi4KICAgIGV4ZWMgOT4mLQogICAgaWYgISB0bXV4IGhhcy1zZXNzaW9uIC10IG15c3FsLzA7IHRoZW4KCQl0bXV4IG5ldy1zZXNzaW9uIC1kIC1zIG15c3FsLzAKCWZpCgljbGllbnRfY291bnQ9JCh0bXV4IGxpc3QtY2xpZW50cyB8IHdjIC1sKQoJaWYgWyAkY2xpZW50X2NvdW50IC1nZSAxIF07IHRoZW4KCQlzZXNzaW9uX25hbWU9bXlzcWwvMCItIiRjbGllbnRfY250CgkJZXhlYyB0bXV4IG5ldy1zZXNzaW9uIC1kIC10IG15c3FsLzAgLXMgJHNlc3Npb25fbmFtZQoJCWV4ZWMgdG11eCBhdHRhY2gtc2Vzc2lvbiAtdCAkc2Vzc2lvbl9uYW1lIFw7IHNldC1vcHRpb24gZGVzdHJveS11bmF0dGFjaGVkCgllbHNlCgkgICAgZXhlYyB0bXV4IGF0dGFjaC1zZXNzaW9uIC10IG15c3FsLzAKCWZpCikKKSA5Pi90bXAvanVqdS11bml0LW15c3FsLTAtZGVidWctaG9va3MtZXhpdAopIDg+L3RtcC9qdWp1LXVuaXQtbXlzcWwtMC1kZWJ1Zy1ob29rcwpleGl0ICQ/Cg== | base64 -d > $F; . $F'", + argsMatch: `ubuntu@0\.(private|public|1\.2\.3) sudo .+`, // can be any of the 3 }, }, { info: `"*" is a valid hook name: it means hook everything`, @@ -72,6 +110,10 @@ info: `invalid hook`, args: []string{"mysql/0", "invalid-hook"}, error: `unit "mysql/0" does not contain hook "invalid-hook"`, +}, { + info: `no args at all`, + args: nil, + error: `no unit name specified`, }} func (s *DebugHooksSuite) TestDebugHooksCommand(c *gc.C) { @@ -85,7 +127,10 @@ for i, t := range debugHooksTests { c.Logf("test %d: %s\n\t%s\n", i, t.info, t.args) - ctx, err := coretesting.RunCommand(c, newDebugHooksCommand(), t.args...) + s.setHostDialerFunc(t.dialWith) + s.setForceAPIv1(t.forceAPIv1) + + ctx, err := coretesting.RunCommand(c, newDebugHooksCommand(s.hostDialer), t.args...) if t.error != "" { c.Check(err, gc.ErrorMatches, t.error) } else { diff -Nru juju-core-2.0.0/src/github.com/juju/juju/cmd/juju/commands/main.go juju-core-2.0.2/src/github.com/juju/juju/cmd/juju/commands/main.go --- juju-core-2.0.0/src/github.com/juju/juju/cmd/juju/commands/main.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/cmd/juju/commands/main.go 2016-11-11 00:08:09.000000000 +0000 @@ -4,10 +4,12 @@ package commands import ( + "bytes" "fmt" "os" "os/exec" "strings" + "text/template" "github.com/juju/cmd" "github.com/juju/loggo" @@ -25,6 +27,7 @@ "github.com/juju/juju/cmd/juju/charmcmd" "github.com/juju/juju/cmd/juju/cloud" "github.com/juju/juju/cmd/juju/controller" + "github.com/juju/juju/cmd/juju/crossmodel" "github.com/juju/juju/cmd/juju/gui" "github.com/juju/juju/cmd/juju/machine" "github.com/juju/juju/cmd/juju/metricsdebug" @@ -166,12 +169,24 @@ if !exists { return newInstall } - fmt.Fprintf(os.Stderr, ` - Welcome to Juju %s. If you meant to use Juju %s you can continue using it - with the command %s e.g. '%s switch'. + // TODO (anastasiamac 2016-10-21) Once manual page exists as per + // https://github.com/juju/docs/issues/1487, + // link it in the Note below to avoid propose here. + welcomeMsgTemplate := ` +Welcome to Juju {{.CurrentJujuVersion}}. See https://jujucharms.com/docs/stable/introducing-2 for more details. -`[1:], jujuversion.Current, ver, juju1xCmdName, juju1xCmdName) +If you want to use Juju {{.OldJujuVersion}}, run 'juju' commands as '{{.OldJujuCommand}}'. For example, '{{.OldJujuCommand}} bootstrap'. + See https://jujucharms.com/docs/stable/juju-coexist for installation details. +`[1:] + t := template.Must(template.New("plugin").Parse(welcomeMsgTemplate)) + var buf bytes.Buffer + t.Execute(&buf, map[string]interface{}{ + "CurrentJujuVersion": jujuversion.Current, + "OldJujuVersion": ver, + "OldJujuCommand": juju1xCmdName, + }) + fmt.Fprintln(os.Stderr, buf.String()) return newInstall } @@ -234,6 +249,13 @@ r.Register(newBootstrapCommand()) r.Register(application.NewAddRelationCommand()) + if featureflag.Enabled(feature.CrossModelRelations) { + r.Register(crossmodel.NewOfferCommand()) + r.Register(crossmodel.NewShowOfferedEndpointCommand()) + r.Register(crossmodel.NewListEndpointsCommand()) + r.Register(crossmodel.NewFindEndpointsCommand()) + } + // Destruction commands. r.Register(application.NewRemoveRelationCommand()) r.Register(application.NewRemoveServiceCommand()) @@ -246,11 +268,11 @@ // Error resolution and debugging commands. r.Register(newRunCommand()) - r.Register(newSCPCommand()) - r.Register(newSSHCommand()) + r.Register(newSCPCommand(nil)) + r.Register(newSSHCommand(nil)) r.Register(newResolvedCommand()) r.Register(newDebugLogCommand()) - r.Register(newDebugHooksCommand()) + r.Register(newDebugHooksCommand(nil)) // Configuration commands. r.Register(model.NewModelGetConstraintsCommand()) diff -Nru juju-core-2.0.0/src/github.com/juju/juju/cmd/juju/commands/main_test.go juju-core-2.0.2/src/github.com/juju/juju/cmd/juju/commands/main_test.go --- juju-core-2.0.0/src/github.com/juju/juju/cmd/juju/commands/main_test.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/cmd/juju/commands/main_test.go 2016-11-11 00:08:09.000000000 +0000 @@ -203,10 +203,12 @@ c.Check(code, gc.Equals, 0) c.Check(string(stderr), gc.Equals, fmt.Sprintf(` - Welcome to Juju %s. If you meant to use Juju 1.25.0 you can continue using it - with the command juju-1 e.g. 'juju-1 switch'. +Welcome to Juju %s. See https://jujucharms.com/docs/stable/introducing-2 for more details. +If you want to use Juju 1.25.0, run 'juju' commands as 'juju-1'. For example, 'juju-1 bootstrap'. + See https://jujucharms.com/docs/stable/juju-coexist for installation details. + Since Juju 2 is being run for the first time, downloading latest cloud information.`[1:]+"\n", jujuversion.Current)) checkVersionOutput(c, string(stdout)) } @@ -528,11 +530,16 @@ } // devFeatures are feature flags that impact registration of commands. -var devFeatures = []string{feature.Migration} +var devFeatures = []string{feature.Migration, feature.CrossModelRelations} // These are the commands that are behind the `devFeatures`. var commandNamesBehindFlags = set.NewStrings( + "find-endpoints", + "list-offers", "migrate", + "offer", + "offers", + "show-endpoints", ) func (s *MainSuite) TestHelpCommands(c *gc.C) { diff -Nru juju-core-2.0.0/src/github.com/juju/juju/cmd/juju/commands/scp.go juju-core-2.0.2/src/github.com/juju/juju/cmd/juju/commands/scp.go --- juju-core-2.0.0/src/github.com/juju/juju/cmd/juju/commands/scp.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/cmd/juju/commands/scp.go 2016-11-11 00:08:09.000000000 +0000 @@ -12,6 +12,7 @@ "github.com/juju/utils/ssh" "github.com/juju/juju/cmd/modelcmd" + "github.com/juju/juju/network" ) var usageSCPSummary = ` @@ -72,8 +73,10 @@ See also: ssh` -func newSCPCommand() cmd.Command { - return modelcmd.Wrap(&scpCommand{}) +func newSCPCommand(hostDialer network.Dialer) cmd.Command { + c := new(scpCommand) + c.setHostDialer(hostDialer) + return modelcmd.Wrap(c) } // scpCommand is responsible for launching a scp command to copy files to/from remote machine(s) diff -Nru juju-core-2.0.0/src/github.com/juju/juju/cmd/juju/commands/scp_unix_test.go juju-core-2.0.2/src/github.com/juju/juju/cmd/juju/commands/scp_unix_test.go --- juju-core-2.0.0/src/github.com/juju/juju/cmd/juju/commands/scp_unix_test.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/cmd/juju/commands/scp_unix_test.go 2016-11-11 00:08:09.000000000 +0000 @@ -22,30 +22,46 @@ } var scpTests = []struct { - about string - args []string - expected argsSpec - error string + about string + args []string + dialWith dialerFunc + forceAPIv1 bool + expected argsSpec + error string }{ { - about: "scp from machine 0 to current dir", - args: []string{"0:foo", "."}, + about: "scp from machine 0 to current dir (api v1)", + args: []string{"0:foo", "."}, + dialWith: dialerFuncFor("0.private", "0.public"), + forceAPIv1: true, expected: argsSpec{ args: "ubuntu@0.public:foo .", hostKeyChecking: "yes", knownHosts: "0", }, }, { - about: "scp from machine 0 to current dir with extra args", - args: []string{"0:foo", ".", "-rv", "-o", "SomeOption"}, + about: "scp from machine 0 to current dir (api v2)", + args: []string{"0:foo", "."}, + dialWith: dialerFuncFor("0.private", "0.public", "0.1.2.3"), // set by setAddresses() and setLinkLayerDevicesAddresses() + forceAPIv1: false, + expected: argsSpec{ + argsMatch: `ubuntu@0.(public|private|1\.2\.3):foo \.`, // can be any of the 3 + hostKeyChecking: "yes", + knownHosts: "0", + }, + }, { + about: "scp from machine 0 to current dir with extra args", + args: []string{"0:foo", ".", "-rv", "-o", "SomeOption"}, + dialWith: dialerFuncFor("0.public"), expected: argsSpec{ args: "ubuntu@0.public:foo . -rv -o SomeOption", hostKeyChecking: "yes", knownHosts: "0", }, }, { - about: "scp from current dir to machine 0", - args: []string{"foo", "0:"}, + about: "scp from current dir to machine 0", + args: []string{"foo", "0:"}, + dialWith: dialerFuncFor("0.public"), expected: argsSpec{ args: "foo ubuntu@0.public:", hostKeyChecking: "yes", @@ -56,32 +72,36 @@ args: []string{"foo", "1:"}, error: `retrieving SSH host keys for "1": keys not found`, }, { - about: "scp when no keys available, with --no-host-key-checks", - args: []string{"--no-host-key-checks", "foo", "1:"}, + about: "scp when no keys available, with --no-host-key-checks", + args: []string{"--no-host-key-checks", "foo", "1:"}, + dialWith: dialerFuncFor("1.public"), expected: argsSpec{ args: "foo ubuntu@1.public:", hostKeyChecking: "no", knownHosts: "null", }, }, { - about: "scp from current dir to machine 0 with extra args", - args: []string{"foo", "0:", "-r", "-v"}, + about: "scp from current dir to machine 0 with extra args", + args: []string{"foo", "0:", "-r", "-v"}, + dialWith: dialerFuncFor("0.public"), expected: argsSpec{ args: "foo ubuntu@0.public: -r -v", hostKeyChecking: "yes", knownHosts: "0", }, }, { - about: "scp from machine 0 to unit mysql/0", - args: []string{"0:foo", "mysql/0:/foo"}, + about: "scp from machine 0 to unit mysql/0", + args: []string{"0:foo", "mysql/0:/foo"}, + dialWith: dialerFuncFor("0.public"), expected: argsSpec{ args: "ubuntu@0.public:foo ubuntu@0.public:/foo", hostKeyChecking: "yes", knownHosts: "0", }, }, { - about: "scp from machine 0 to unit mysql/0 and extra args", - args: []string{"0:foo", "mysql/0:/foo", "-q"}, + about: "scp from machine 0 to unit mysql/0 and extra args", + args: []string{"0:foo", "mysql/0:/foo", "-q"}, + dialWith: dialerFuncFor("0.public"), expected: argsSpec{ args: "ubuntu@0.public:foo ubuntu@0.public:/foo -q", hostKeyChecking: "yes", @@ -92,32 +112,36 @@ args: []string{"-q", "-r", "0:foo", "mysql/0:/foo"}, error: "flag provided but not defined: -q", }, { - about: "scp two local files to unit mysql/0", - args: []string{"file1", "file2", "mysql/0:/foo/"}, + about: "scp two local files to unit mysql/0", + args: []string{"file1", "file2", "mysql/0:/foo/"}, + dialWith: dialerFuncFor("0.public"), expected: argsSpec{ args: "file1 file2 ubuntu@0.public:/foo/", hostKeyChecking: "yes", knownHosts: "0", }, }, { - about: "scp from machine 0 to unit mysql/0 and multiple extra args", - args: []string{"0:foo", "mysql/0:", "-r", "-v", "-q", "-l5"}, + about: "scp from machine 0 to unit mysql/0 and multiple extra args", + args: []string{"0:foo", "mysql/0:", "-r", "-v", "-q", "-l5"}, + dialWith: dialerFuncFor("0.public"), expected: argsSpec{ args: "ubuntu@0.public:foo ubuntu@0.public: -r -v -q -l5", hostKeyChecking: "yes", knownHosts: "0", }, }, { - about: "scp works with IPv6 addresses", - args: []string{"2:foo", "bar"}, + about: "scp works with IPv6 addresses", + args: []string{"2:foo", "bar"}, + dialWith: dialerFuncFor("2001:db8::1"), expected: argsSpec{ args: `ubuntu@[2001:db8::1]:foo bar`, hostKeyChecking: "yes", knownHosts: "2", }, }, { - about: "scp from machine 0 to unit mysql/0 with proxy", - args: []string{"--proxy=true", "0:foo", "mysql/0:/bar"}, + about: "scp from machine 0 to unit mysql/0 with proxy", + args: []string{"--proxy=true", "0:foo", "mysql/0:/bar"}, + dialWith: dialerFuncFor("0.private"), expected: argsSpec{ args: "ubuntu@0.private:foo ubuntu@0.private:/bar", withProxy: true, @@ -125,16 +149,18 @@ knownHosts: "0", }, }, { - about: "scp from unit mysql/0 to machine 2 with a --", - args: []string{"--", "-r", "-v", "mysql/0:foo", "2:", "-q", "-l5"}, + about: "scp from unit mysql/0 to machine 2 with a --", + args: []string{"--", "-r", "-v", "mysql/0:foo", "2:", "-q", "-l5"}, + dialWith: dialerFuncFor("0.public", "2001:db8::1"), expected: argsSpec{ args: "-r -v ubuntu@0.public:foo ubuntu@[2001:db8::1]: -q -l5", hostKeyChecking: "yes", knownHosts: "0,2", }, }, { - about: "scp from unit mysql/0 to current dir as 'sam' user", - args: []string{"sam@mysql/0:foo", "."}, + about: "scp from unit mysql/0 to current dir as 'sam' user", + args: []string{"sam@mysql/0:foo", "."}, + dialWith: dialerFuncFor("0.public"), expected: argsSpec{ args: "sam@0.public:foo .", hostKeyChecking: "yes", @@ -145,15 +171,17 @@ args: []string{"5:foo", "bar"}, error: `machine 5 not found`, }, { - about: "scp from arbitrary host name to current dir", - args: []string{"some.host:foo", "."}, + about: "scp from arbitrary host name to current dir", + args: []string{"some.host:foo", "."}, + dialWith: dialerFuncFor("some.host"), expected: argsSpec{ args: "some.host:foo .", hostKeyChecking: "", }, }, { - about: "scp from arbitrary user & host to current dir", - args: []string{"someone@some.host:foo", "."}, + about: "scp from arbitrary user & host to current dir", + args: []string{"someone@some.host:foo", "."}, + dialWith: dialerFuncFor("some.host"), expected: argsSpec{ args: "someone@some.host:foo .", hostKeyChecking: "", @@ -163,13 +191,20 @@ args: []string{"some.host:foo", "0:"}, error: `can't determine host keys for all targets: consider --no-host-key-checks`, }, { - about: "scp with arbitrary host name and an entity, --no-host-key-checks", - args: []string{"--no-host-key-checks", "some.host:foo", "0:"}, + about: "scp with arbitrary host name and an entity, --no-host-key-checks, --proxy (api v1)", + args: []string{"--no-host-key-checks", "--proxy", "some.host:foo", "0:"}, + dialWith: dialerFuncFor("some.host", "0.private"), + forceAPIv1: true, expected: argsSpec{ - args: "some.host:foo ubuntu@0.public:", + args: "some.host:foo ubuntu@0.private:", hostKeyChecking: "no", + withProxy: true, knownHosts: "null", }, + }, { + about: "scp with no arguments", + args: nil, + error: `at least two arguments required`, }, } @@ -179,7 +214,10 @@ for i, t := range scpTests { c.Logf("test %d: %s -> %s\n", i, t.about, t.args) - ctx, err := coretesting.RunCommand(c, newSCPCommand(), t.args...) + s.setHostDialerFunc(t.dialWith) + s.setForceAPIv1(t.forceAPIv1) + + ctx, err := coretesting.RunCommand(c, newSCPCommand(s.hostDialer), t.args...) if t.error != "" { c.Check(err, gc.ErrorMatches, t.error) } else { diff -Nru juju-core-2.0.0/src/github.com/juju/juju/cmd/juju/commands/ssh_common.go juju-core-2.0.2/src/github.com/juju/juju/cmd/juju/commands/ssh_common.go --- juju-core-2.0.0/src/github.com/juju/juju/cmd/juju/commands/ssh_common.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/cmd/juju/commands/ssh_common.go 2016-11-11 00:08:09.000000000 +0000 @@ -21,7 +21,9 @@ "gopkg.in/juju/names.v2" "github.com/juju/juju/api/sshclient" + "github.com/juju/juju/apiserver/params" "github.com/juju/juju/cmd/modelcmd" + "github.com/juju/juju/network" ) // SSHCommon implements functionality shared by sshCommand, SCPCommand @@ -36,11 +38,17 @@ apiClient sshAPIClient apiAddr string knownHostsPath string + hostDialer network.Dialer + forceAPIv1 bool } +const jujuSSHClientForceAPIv1 = "JUJU_SSHCLIENT_API_V1" + type sshAPIClient interface { + BestAPIVersion() int PublicAddress(target string) (string, error) PrivateAddress(target string) (string, error) + AllAddresses(target string) ([]string, error) PublicKeys(target string) ([]string, error) Proxy() (bool, error) Close() error @@ -82,9 +90,22 @@ return utils.AttemptStrategy(s).Start() } +const ( + // SSHRetryDelay is the time to wait for an SSH connection to be established + // to a single endpoint of a target. + SSHRetryDelay = 500 * time.Millisecond + + // SSHTimeout is the time to wait for before giving up trying to establish + // an SSH connection to a target, after retriying. + SSHTimeout = 5 * time.Second + + // SSHPort is the TCP port used for SSH connections. + SSHPort = 22 +) + var sshHostFromTargetAttemptStrategy attemptStarter = attemptStrategy{ - Total: 5 * time.Second, - Delay: 500 * time.Millisecond, + Total: SSHTimeout, + Delay: SSHRetryDelay, } func (c *SSHCommon) SetFlags(f *gnuflag.FlagSet) { @@ -94,21 +115,37 @@ f.BoolVar(&c.noHostKeyChecks, "no-host-key-checks", false, "Skip host key checking (INSECURE)") } +// defaultHostDialer returns a network.Dialer with timeout set to SSHRetryDelay. +func defaultHostDialer() network.Dialer { + return &net.Dialer{Timeout: SSHRetryDelay} +} + +func (c *SSHCommon) setHostDialer(dialer network.Dialer) { + if dialer == nil { + dialer = defaultHostDialer() + } + c.hostDialer = dialer +} + // initRun initializes the API connection if required, and determines // if SSH proxying is required. It must be called at the top of the // command's Run method. // -// The apiClient, apiAddr and proxy fields are initialized after this -// call. +// The apiClient, apiAddr and proxy fields are initialized after this call. func (c *SSHCommon) initRun() error { if err := c.ensureAPIClient(); err != nil { return errors.Trace(err) } + if proxy, err := c.proxySSH(); err != nil { return errors.Trace(err) } else { c.proxy = proxy } + + // Used mostly for testing, but useful for debugging and/or + // backwards-compatibility with some scripts. + c.forceAPIv1 = os.Getenv(jujuSSHClientForceAPIv1) != "" return nil } @@ -275,35 +312,95 @@ } func (c *SSHCommon) resolveTarget(target string) (*resolvedTarget, error) { + out, ok := c.resolveAsAgent(target) + if !ok { + // Not a machine or unit agent target - use directly. + return out, nil + } + + getAddress := c.reachableAddressGetter + if c.apiClient.BestAPIVersion() < 2 || c.forceAPIv1 { + logger.Debugf("using legacy SSHClient API v1: no support for AllAddresses()") + getAddress = c.legacyAddressGetter + } else if c.proxy { + logger.Infof("proxy-ssh enabled but ignored: trying all addresses of target %q", out.entity) + } + + return c.resolveWithRetry(*out, getAddress) +} + +func (c *SSHCommon) resolveAsAgent(target string) (*resolvedTarget, bool) { out := new(resolvedTarget) out.user, out.entity = splitUserTarget(target) + isAgent := out.isAgent() - // If the target is neither a machine nor a unit assume it's a - // hostname and try it directly. - if !targetIsAgent(out.entity) { + if !isAgent { + // Not a machine/unit agent target: resolve - use as-is. out.host = out.entity - return out, nil - } - - if out.user == "" { + } else if out.user == "" { out.user = "ubuntu" } + return out, isAgent +} + +type addressGetterFunc func(target string) (string, error) + +func (c *SSHCommon) resolveWithRetry(target resolvedTarget, getAddress addressGetterFunc) (*resolvedTarget, error) { // A target may not initially have an address (e.g. the // address updater hasn't yet run), so we must do this in // a loop. var err error + out := &target for a := sshHostFromTargetAttemptStrategy.Start(); a.Next(); { - if c.proxy { - out.host, err = c.apiClient.PrivateAddress(out.entity) - } else { - out.host, err = c.apiClient.PublicAddress(out.entity) + out.host, err = getAddress(out.entity) + if errors.IsNotFound(err) || params.IsCodeNotFound(err) { + // Catch issues like passing invalid machine/unit IDs early. + return nil, errors.Trace(err) } - if err == nil { - return out, nil + + if err != nil { + logger.Debugf("getting target %q address(es) failed: %v (retrying)", out.entity, err) + continue } + + logger.Debugf("using target %q address %q", out.entity, out.host) + return out, nil + } + + return nil, errors.Trace(err) +} + +// legacyAddressGetter returns the preferred public or private address of the +// given entity (private when c.proxy is true), using the apiClient. Only used +// when the SSHClient API facade v2 is not available. +func (c *SSHCommon) legacyAddressGetter(entity string) (string, error) { + if c.proxy { + return c.apiClient.PrivateAddress(entity) } - return nil, err + + return c.apiClient.PublicAddress(entity) +} + +// reachableAddressGetter dials all addresses of the given entity, returning the +// first one that succeeds. Only used with SSHClient API facade v2 or later is +// available. +func (c *SSHCommon) reachableAddressGetter(entity string) (string, error) { + addresses, err := c.apiClient.AllAddresses(entity) + if err != nil { + return "", errors.Trace(err) + } else if len(addresses) == 0 { + return "", network.NoAddressError("available") + } + + hostPorts := network.NewHostPorts(SSHPort, addresses...) + usableHPs := network.FilterUnusableHostPorts(hostPorts) + bestHP, err := network.ReachableHostPort(usableHPs, c.hostDialer, SSHTimeout) + if err != nil { + return "", errors.Trace(err) + } + + return bestHP.Address.Value, nil } // AllowInterspersedFlags for ssh/scp is set to false so that diff -Nru juju-core-2.0.0/src/github.com/juju/juju/cmd/juju/commands/ssh_common_test.go juju-core-2.0.2/src/github.com/juju/juju/cmd/juju/commands/ssh_common_test.go --- juju-core-2.0.0/src/github.com/juju/juju/cmd/juju/commands/ssh_common_test.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/cmd/juju/commands/ssh_common_test.go 2016-11-11 00:08:09.000000000 +0000 @@ -5,12 +5,15 @@ import ( "fmt" + "net" "os" "path/filepath" "regexp" "strings" + "github.com/juju/errors" jc "github.com/juju/testing/checkers" + "github.com/juju/utils/set" "github.com/juju/utils/ssh" gc "gopkg.in/check.v1" @@ -42,8 +45,12 @@ knownHosts string // args specifies any other command line arguments expected. This - // includes the SSH/SCP targets. + // includes the SSH/SCP targets. Ignored if argsMatch is set as well. args string + + // argsMatch is like args, but instead of a literal string it's interpreted + // as a regular expression. When argsMatch is set, args is ignored. + argsMatch string } func (s *argsSpec) check(c *gc.C, output string) { @@ -85,8 +92,14 @@ c.Check(actualKnownHosts, gc.Matches, s.expectedKnownHosts()) } + if s.argsMatch != "" { + expect(s.argsMatch) + } else { + expect(regexp.QuoteMeta(s.args)) + } + // Check the command line matches what is expected. - pattern := "^" + strings.Join(expected, " ") + " " + regexp.QuoteMeta(s.args) + "$" + pattern := "^" + strings.Join(expected, " ") + "$" c.Check(actualCommandLine, gc.Matches, pattern) } @@ -102,6 +115,7 @@ testing.JujuConnSuite knownHostsDir string binDir string + hostDialer network.Dialer } // Commands to patch @@ -126,10 +140,36 @@ }| tee $0.args ` +type dialerFunc func(address string) error + +type fakeDialer struct { + dialWith dialerFunc +} + +func (f *fakeDialer) Dial(network, address string) (net.Conn, error) { + if f.dialWith == nil { + return &fakeConn{}, nil + } + + err := f.dialWith(address) + if err != nil { + return nil, err + } + + return &fakeConn{}, nil +} + +type fakeConn struct { + net.Conn +} + +func (f *fakeConn) Close() error { return nil } + func (s *SSHCommonSuite) SetUpTest(c *gc.C) { s.JujuConnSuite.SetUpTest(c) ssh.ClearClientKeys() s.PatchValue(&getJujuExecutable, func() (string, error) { return "juju", nil }) + s.setForceAPIv1(false) s.binDir = c.MkDir() s.PatchEnvPathPrepend(s.binDir) @@ -146,14 +186,43 @@ s.PatchValue(&ssh.DefaultClient, client) } +func (s *SSHCommonSuite) setForceAPIv1(enabled bool) { + if enabled { + os.Setenv(jujuSSHClientForceAPIv1, "1") + } else { + os.Unsetenv(jujuSSHClientForceAPIv1) + } +} + +func (s *SSHCommonSuite) setHostDialerFunc(dialWith dialerFunc) { + s.hostDialer = &fakeDialer{dialWith: dialWith} +} + +func dialerFuncFor(allowedAddresses ...string) dialerFunc { + allowedSet := set.NewStrings(allowedAddresses...) + + return func(address string) error { + if strings.HasSuffix(address, ":22") { + address, _, _ = net.SplitHostPort(address) + } + if allowedSet.Contains(address) { + return nil + } + return errors.Errorf("not dialing %q", address) + } +} + func (s *SSHCommonSuite) setupModel(c *gc.C) { // Add machine-0 with a mysql service and mysql/0 unit u := s.Factory.MakeUnit(c, nil) - // Set addresses and keys for machine-0 + // Set both the preferred public and private addresses for machine-0, add a + // couple of link-layer devices (loopback and ethernet) with addresses, and + // the ssh keys. m := s.getMachineForUnit(c, u) s.setAddresses(c, m) s.setKeys(c, m) + s.setLinkLayerDevicesAddresses(c, m) // machine-1 has no public host keys available. m1 := s.Factory.MakeMachine(c, nil) @@ -186,6 +255,30 @@ c.Assert(err, jc.ErrorIsNil) } +func (s *SSHCommonSuite) setLinkLayerDevicesAddresses(c *gc.C, m *state.Machine) { + devicesArgs := []state.LinkLayerDeviceArgs{{ + Name: "lo", + Type: state.LoopbackDevice, + }, { + Name: "eth0", + Type: state.EthernetDevice, + }} + err := m.SetLinkLayerDevices(devicesArgs...) + c.Assert(err, jc.ErrorIsNil) + + addressesArgs := []state.LinkLayerDeviceAddress{{ + DeviceName: "lo", + CIDRAddress: "127.0.0.1/8", // will be filtered + ConfigMethod: state.LoopbackAddress, + }, { + DeviceName: "eth0", + CIDRAddress: "0.1.2.3/24", // needs the be a valid CIDR + ConfigMethod: state.StaticAddress, + }} + err = m.SetDevicesAddresses(addressesArgs...) + c.Assert(err, jc.ErrorIsNil) +} + func (s *SSHCommonSuite) setAddresses6(c *gc.C, m *state.Machine) { addrPub := network.NewScopedAddress("2001:db8::1", network.ScopePublic) addrPriv := network.NewScopedAddress("fc00:bbb::1", network.ScopeCloudLocal) diff -Nru juju-core-2.0.0/src/github.com/juju/juju/cmd/juju/commands/ssh.go juju-core-2.0.2/src/github.com/juju/juju/cmd/juju/commands/ssh.go --- juju-core-2.0.0/src/github.com/juju/juju/cmd/juju/commands/ssh.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/cmd/juju/commands/ssh.go 2016-11-11 00:08:09.000000000 +0000 @@ -9,6 +9,7 @@ "github.com/juju/utils/ssh" "github.com/juju/juju/cmd/modelcmd" + "github.com/juju/juju/network" ) var usageSSHSummary = ` @@ -47,8 +48,10 @@ See also: scp` -func newSSHCommand() cmd.Command { - return modelcmd.Wrap(&sshCommand{}) +func newSSHCommand(hostDialer network.Dialer) cmd.Command { + c := new(sshCommand) + c.setHostDialer(hostDialer) + return modelcmd.Wrap(c) } // sshCommand is responsible for launching a ssh shell on a given unit or machine. diff -Nru juju-core-2.0.0/src/github.com/juju/juju/cmd/juju/commands/ssh_unix_test.go juju-core-2.0.2/src/github.com/juju/juju/cmd/juju/commands/ssh_unix_test.go --- juju-core-2.0.0/src/github.com/juju/juju/cmd/juju/commands/ssh_unix_test.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/cmd/juju/commands/ssh_unix_test.go 2016-11-11 00:08:09.000000000 +0000 @@ -10,10 +10,12 @@ "fmt" "reflect" + "github.com/juju/testing" jc "github.com/juju/testing/checkers" gc "gopkg.in/check.v1" "github.com/juju/juju/apiserver" + "github.com/juju/juju/network" coretesting "github.com/juju/juju/testing" ) @@ -26,12 +28,16 @@ var sshTests = []struct { about string args []string + dialWith dialerFunc + forceAPIv1 bool expected argsSpec expectedErr string }{ { - about: "connect to machine 0", - args: []string{"0"}, + about: "connect to machine 0 (api v1)", + args: []string{"0"}, + dialWith: dialerFuncFor("0.private", "0.public"), + forceAPIv1: true, expected: argsSpec{ hostKeyChecking: "yes", knownHosts: "0", @@ -40,8 +46,21 @@ }, }, { - about: "connect to machine 0 and pass extra arguments", - args: []string{"0", "uname", "-a"}, + about: "connect to machine 0 (api v2)", + args: []string{"0"}, + dialWith: dialerFuncFor("0.private", "0.public", "0.1.2.3"), // set by setAddresses() and setLinkLayerDevicesAddresses() + forceAPIv1: false, + expected: argsSpec{ + hostKeyChecking: "yes", + knownHosts: "0", + enablePty: true, + argsMatch: `ubuntu@0.(public|private|1\.2\.3)`, // can be any of the 3 + }, + }, + { + about: "connect to machine 0 and pass extra arguments", + args: []string{"0", "uname", "-a"}, + dialWith: dialerFuncFor("0.public"), expected: argsSpec{ hostKeyChecking: "yes", knownHosts: "0", @@ -50,8 +69,9 @@ }, }, { - about: "connect to machine 0 with no pseudo-tty", - args: []string{"--pty=false", "0"}, + about: "connect to machine 0 with no pseudo-tty", + args: []string{"--pty=false", "0"}, + dialWith: dialerFuncFor("0.public"), expected: argsSpec{ hostKeyChecking: "yes", knownHosts: "0", @@ -65,8 +85,9 @@ expectedErr: `retrieving SSH host keys for "1": keys not found`, }, { - about: "connect to machine 1 which has no SSH host keys, no host key checks", - args: []string{"--no-host-key-checks", "1"}, + about: "connect to machine 1 which has no SSH host keys, no host key checks", + args: []string{"--no-host-key-checks", "1"}, + dialWith: dialerFuncFor("1.public"), expected: argsSpec{ hostKeyChecking: "no", knownHosts: "null", @@ -75,8 +96,9 @@ }, }, { - about: "connect to arbitrary (non-entity) hostname", - args: []string{"foo@some.host"}, + about: "connect to arbitrary (non-entity) hostname", + args: []string{"foo@some.host"}, + dialWith: dialerFuncFor("some.host"), expected: argsSpec{ // In this case, use the user's own known_hosts and own // StrictHostKeyChecking config. @@ -87,8 +109,9 @@ }, }, { - about: "connect to unit mysql/0", - args: []string{"mysql/0"}, + about: "connect to unit mysql/0", + args: []string{"mysql/0"}, + dialWith: dialerFuncFor("0.public"), expected: argsSpec{ hostKeyChecking: "yes", knownHosts: "0", @@ -97,8 +120,9 @@ }, }, { - about: "connect to unit mysql/0 as the mongo user", - args: []string{"mongo@mysql/0"}, + about: "connect to unit mysql/0 as the mongo user", + args: []string{"mongo@mysql/0"}, + dialWith: dialerFuncFor("0.public"), expected: argsSpec{ hostKeyChecking: "yes", knownHosts: "0", @@ -107,8 +131,9 @@ }, }, { - about: "connect to unit mysql/0 and pass extra arguments", - args: []string{"mysql/0", "ls", "/"}, + about: "connect to unit mysql/0 and pass extra arguments", + args: []string{"mysql/0", "ls", "/"}, + dialWith: dialerFuncFor("0.public"), expected: argsSpec{ hostKeyChecking: "yes", knownHosts: "0", @@ -117,8 +142,10 @@ }, }, { - about: "connect to unit mysql/0 with proxy", - args: []string{"--proxy=true", "mysql/0"}, + about: "connect to unit mysql/0 with proxy (api v1)", + args: []string{"--proxy=true", "mysql/0"}, + dialWith: dialerFuncFor("0.private", "0.public"), + forceAPIv1: true, expected: argsSpec{ hostKeyChecking: "yes", knownHosts: "0", @@ -127,6 +154,19 @@ args: "ubuntu@0.private", }, }, + { + about: "connect to unit mysql/0 with proxy (api v2)", + args: []string{"--proxy=true", "mysql/0"}, + dialWith: dialerFuncFor("0.private", "0.public", "0.1.2.3"), // set by setAddresses() and setLinkLayerDevicesAddresses() + forceAPIv1: false, + expected: argsSpec{ + hostKeyChecking: "yes", + knownHosts: "0", + enablePty: true, + withProxy: true, + argsMatch: `ubuntu@0.(public|private|1\.2\.3)`, // can be any of the 3 + }, + }, } func (s *SSHSuite) TestSSHCommand(c *gc.C) { @@ -135,7 +175,10 @@ for i, t := range sshTests { c.Logf("test %d: %s -> %s", i, t.about, t.args) - ctx, err := coretesting.RunCommand(c, newSSHCommand(), t.args...) + s.setHostDialerFunc(t.dialWith) + s.setForceAPIv1(t.forceAPIv1) + + ctx, err := coretesting.RunCommand(c, newSSHCommand(s.hostDialer), t.args...) if t.expectedErr != "" { c.Check(err, gc.ErrorMatches, t.expectedErr) } else { @@ -154,7 +197,10 @@ err := s.State.UpdateModelConfig(map[string]interface{}{"proxy-ssh": true}, nil, nil) c.Assert(err, jc.ErrorIsNil) - ctx, err := coretesting.RunCommand(c, newSSHCommand(), "0") + s.setForceAPIv1(true) + s.setHostDialerFunc(dialerFuncFor("0.private", "0.public", "0.1.2.3")) + + ctx, err := coretesting.RunCommand(c, newSSHCommand(s.hostDialer), "0") c.Check(err, jc.ErrorIsNil) c.Check(coretesting.Stderr(ctx), gc.Equals, "") expectedArgs := argsSpec{ @@ -165,6 +211,14 @@ args: "ubuntu@0.private", } expectedArgs.check(c, coretesting.Stdout(ctx)) + + s.setForceAPIv1(false) + ctx, err = coretesting.RunCommand(c, newSSHCommand(s.hostDialer), "0") + c.Check(err, jc.ErrorIsNil) + c.Check(coretesting.Stderr(ctx), gc.Equals, "") + expectedArgs.argsMatch = `ubuntu@0.(public|private|1\.2\.3)` // can be any of the 3 with api v2. + expectedArgs.check(c, coretesting.Stdout(ctx)) + } func (s *SSHSuite) TestSSHWillWorkInUpgrade(c *gc.C) { @@ -187,11 +241,39 @@ } } -func (s *SSHSuite) TestSSHCommandHostAddressRetry(c *gc.C) { +func (s *SSHSuite) TestSSHCommandHostAddressRetryAPIv1(c *gc.C) { + s.setHostDialerFunc(func(address string) error { + return network.NoAddressError("public") + }) + s.setForceAPIv1(true) + + s.testSSHCommandHostAddressRetry(c, false) +} + +func (s *SSHSuite) TestSSHCommandHostAddressRetryAPIv2(c *gc.C) { + s.setHostDialerFunc(func(address string) error { + return network.NoAddressError("available") + }) + s.setForceAPIv1(false) + s.testSSHCommandHostAddressRetry(c, false) } -func (s *SSHSuite) TestSSHCommandHostAddressRetryProxy(c *gc.C) { +func (s *SSHSuite) TestSSHCommandHostAddressRetryProxyAPIv1(c *gc.C) { + s.setHostDialerFunc(func(address string) error { + return network.NoAddressError("private") + }) + s.setForceAPIv1(true) + + s.testSSHCommandHostAddressRetry(c, true) +} + +func (s *SSHSuite) TestSSHCommandHostAddressRetryProxyAPIv2(c *gc.C) { + s.setHostDialerFunc(func(address string) error { + return network.NoAddressError("available") + }) + s.setForceAPIv1(false) + s.testSSHCommandHostAddressRetry(c, true) } @@ -204,15 +286,18 @@ called++ return called < 2 }} - s.PatchValue(&sshHostFromTargetAttemptStrategy, attemptStarter) + restorer := testing.PatchValue(&sshHostFromTargetAttemptStrategy, attemptStarter) + defer restorer.Restore() - // Ensure that the ssh command waits for a public address, or the attempt - // strategy's Done method returns false. + // Ensure that the ssh command waits for a public (private with proxy=true) + // address, or the attempt strategy's Done method returns false. args := []string{"--proxy=" + fmt.Sprint(proxy), "0"} - _, err := coretesting.RunCommand(c, newSSHCommand(), args...) - c.Assert(err, gc.ErrorMatches, "no .+ address") + _, err := coretesting.RunCommand(c, newSSHCommand(s.hostDialer), args...) + c.Assert(err, gc.ErrorMatches, `no .+ address\(es\)`) c.Assert(called, gc.Equals, 2) + s.setHostDialerFunc(dialerFuncFor("0.private", "0.public")) + called = 0 attemptStarter.next = func() bool { called++ @@ -222,7 +307,7 @@ return true } - _, err = coretesting.RunCommand(c, newSSHCommand(), args...) + _, err = coretesting.RunCommand(c, newSSHCommand(s.hostDialer), args...) c.Assert(err, jc.ErrorIsNil) c.Assert(called, gc.Equals, 2) } diff -Nru juju-core-2.0.0/src/github.com/juju/juju/cmd/juju/controller/listcontrollersformatters.go juju-core-2.0.2/src/github.com/juju/juju/cmd/juju/controller/listcontrollersformatters.go --- juju-core-2.0.0/src/github.com/juju/juju/cmd/juju/controller/listcontrollersformatters.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/cmd/juju/controller/listcontrollersformatters.go 2016-11-11 00:08:09.000000000 +0000 @@ -35,7 +35,7 @@ w := output.Wrapper{tw} if promptRefresh && len(set.Controllers) > 0 { - fmt.Fprintln(writer, "Use --refresh to see the latest information.") + fmt.Fprintln(writer, "Use --refresh flag with this command to see the latest information.") fmt.Fprintln(writer) } w.Println("Controller", "Model", "User", "Access", "Cloud/Region", "Models", "Machines", "HA", "Version") diff -Nru juju-core-2.0.0/src/github.com/juju/juju/cmd/juju/controller/listcontrollers_test.go juju-core-2.0.2/src/github.com/juju/juju/cmd/juju/controller/listcontrollers_test.go --- juju-core-2.0.0/src/github.com/juju/juju/cmd/juju/controller/listcontrollers_test.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/cmd/juju/controller/listcontrollers_test.go 2016-11-11 00:08:09.000000000 +0000 @@ -36,7 +36,7 @@ func (s *ListControllersSuite) TestListControllers(c *gc.C) { s.expectedOutput = ` -Use --refresh to see the latest information. +Use --refresh flag with this command to see the latest information. Controller Model User Access Cloud/Region Models Machines HA Version aws-test controller - - aws/us-east-1 2 5 - 2.0.1 diff -Nru juju-core-2.0.0/src/github.com/juju/juju/cmd/juju/controller/listmodels.go juju-core-2.0.2/src/github.com/juju/juju/cmd/juju/controller/listmodels.go --- juju-core-2.0.0/src/github.com/juju/juju/cmd/juju/controller/listmodels.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/cmd/juju/controller/listmodels.go 2016-11-11 00:08:09.000000000 +0000 @@ -6,6 +6,7 @@ import ( "fmt" "io" + "strings" "time" "github.com/juju/cmd" @@ -282,7 +283,7 @@ } } if haveMachineInfo { - w.Println("Owner", "Status", "Machines", "Cores", "Access", "Last connection") + w.Println("Cloud/Region", "Status", "Machines", "Cores", "Access", "Last connection") offset := 0 if c.listUUID { offset++ @@ -290,9 +291,10 @@ tw.SetColumnAlignRight(3 + offset) tw.SetColumnAlignRight(4 + offset) } else { - w.Println("Owner", "Status", "Access", "Last connection") + w.Println("Cloud/Region", "Status", "Access", "Last connection") } for _, model := range modelSet.Models { + cloudRegion := strings.Trim(model.Cloud+"/"+model.CloudRegion, "/") owner := names.NewUserTag(model.Owner) name := common.OwnerQualifiedModelName(model.Name, owner, userForListing) if jujuclient.JoinOwnerModelName(owner, model.Name) == modelSet.CurrentModelQualified { @@ -313,7 +315,7 @@ userForAccess = names.NewUserTag(c.user) } access := model.Users[userForAccess.Id()].Access - w.Print(model.Owner, model.Status.Current) + w.Print(cloudRegion, model.Status.Current) if haveMachineInfo { machineInfo := fmt.Sprintf("%d", len(model.Machines)) cores := uint64(0) diff -Nru juju-core-2.0.0/src/github.com/juju/juju/cmd/juju/controller/listmodels_test.go juju-core-2.0.2/src/github.com/juju/juju/cmd/juju/controller/listmodels_test.go --- juju-core-2.0.0/src/github.com/juju/juju/cmd/juju/controller/listmodels_test.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/cmd/juju/controller/listmodels_test.go 2016-11-11 00:08:09.000000000 +0000 @@ -152,10 +152,10 @@ c.Assert(testing.Stdout(context), gc.Equals, ""+ "Controller: fake\n"+ "\n"+ - "Model Owner Status Access Last connection\n"+ - "test-model1* admin active read 2015-03-20\n"+ - "carlotta/test-model2 carlotta active write 2015-03-01\n"+ - "daiwik@external/test-model3 daiwik@external destroying never connected\n"+ + "Model Cloud/Region Status Access Last connection\n"+ + "test-model1* dummy active read 2015-03-20\n"+ + "carlotta/test-model2 dummy active write 2015-03-01\n"+ + "daiwik@external/test-model3 dummy destroying never connected\n"+ "\n") } @@ -166,10 +166,10 @@ c.Assert(testing.Stdout(context), gc.Equals, ""+ "Controller: fake\n"+ "\n"+ - "Model Owner Status Access Last connection\n"+ - "admin/test-model1* admin active read 2015-03-20\n"+ - "carlotta/test-model2 carlotta active write 2015-03-01\n"+ - "daiwik@external/test-model3 daiwik@external destroying never connected\n"+ + "Model Cloud/Region Status Access Last connection\n"+ + "admin/test-model1* dummy active read 2015-03-20\n"+ + "carlotta/test-model2 dummy active write 2015-03-01\n"+ + "daiwik@external/test-model3 dummy destroying never connected\n"+ "\n") } @@ -180,10 +180,10 @@ c.Assert(testing.Stdout(context), gc.Equals, ""+ "Controller: fake\n"+ "\n"+ - "Model Owner Status Access Last connection\n"+ - "admin/test-model1* admin active read 2015-03-20\n"+ - "carlotta/test-model2 carlotta active write 2015-03-01\n"+ - "daiwik@external/test-model3 daiwik@external destroying never connected\n"+ + "Model Cloud/Region Status Access Last connection\n"+ + "admin/test-model1* dummy active read 2015-03-20\n"+ + "carlotta/test-model2 dummy active write 2015-03-01\n"+ + "daiwik@external/test-model3 dummy destroying never connected\n"+ "\n") } @@ -194,10 +194,10 @@ c.Assert(testing.Stdout(context), gc.Equals, ""+ "Controller: fake\n"+ "\n"+ - "Model Owner Status Access Last connection\n"+ - "test-model1 admin active read 2015-03-20\n"+ - "carlotta/test-model2 carlotta active write 2015-03-01\n"+ - "daiwik@external/test-model3 daiwik@external destroying never connected\n"+ + "Model Cloud/Region Status Access Last connection\n"+ + "test-model1 dummy active read 2015-03-20\n"+ + "carlotta/test-model2 dummy active write 2015-03-01\n"+ + "daiwik@external/test-model3 dummy destroying never connected\n"+ "\n") } @@ -209,10 +209,10 @@ c.Assert(testing.Stdout(context), gc.Equals, ""+ "Controller: fake\n"+ "\n"+ - "Model UUID Owner Status Machines Cores Access Last connection\n"+ - "test-model1* test-model1-UUID admin active 2 1 read 2015-03-20\n"+ - "carlotta/test-model2 test-model2-UUID carlotta active 0 - write 2015-03-01\n"+ - "daiwik@external/test-model3 test-model3-UUID daiwik@external destroying 0 - never connected\n"+ + "Model UUID Cloud/Region Status Machines Cores Access Last connection\n"+ + "test-model1* test-model1-UUID dummy active 2 1 read 2015-03-20\n"+ + "carlotta/test-model2 test-model2-UUID dummy active 0 - write 2015-03-01\n"+ + "daiwik@external/test-model3 test-model3-UUID dummy destroying 0 - never connected\n"+ "\n") } @@ -224,10 +224,10 @@ c.Assert(testing.Stdout(context), gc.Equals, ""+ "Controller: fake\n"+ "\n"+ - "Model Owner Status Machines Cores Access Last connection\n"+ - "test-model1* admin active 2 1 read 2015-03-20\n"+ - "carlotta/test-model2 carlotta active 0 - write 2015-03-01\n"+ - "daiwik@external/test-model3 daiwik@external destroying 0 - never connected\n"+ + "Model Cloud/Region Status Machines Cores Access Last connection\n"+ + "test-model1* dummy active 2 1 read 2015-03-20\n"+ + "carlotta/test-model2 dummy active 0 - write 2015-03-01\n"+ + "daiwik@external/test-model3 dummy destroying 0 - never connected\n"+ "\n") } diff -Nru juju-core-2.0.0/src/github.com/juju/juju/cmd/juju/controller/register.go juju-core-2.0.2/src/github.com/juju/juju/cmd/juju/controller/register.go --- juju-core-2.0.0/src/github.com/juju/juju/cmd/juju/controller/register.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/cmd/juju/controller/register.go 2016-11-11 00:08:09.000000000 +0000 @@ -482,11 +482,6 @@ conn, err := c.apiOpen(&api.Info{ Addrs: addrs, SkipLogin: true, - // NOTE(axw) CACert is required, but ignored if - // InsecureSkipVerify is set. We should try to - // bring together CACert and InsecureSkipVerify - // so they can be validated together. - CACert: "ignored", }, opts) if err != nil { return nil, errors.Trace(err) diff -Nru juju-core-2.0.0/src/github.com/juju/juju/cmd/juju/crossmodel/crossmodel.go juju-core-2.0.2/src/github.com/juju/juju/cmd/juju/crossmodel/crossmodel.go --- juju-core-2.0.0/src/github.com/juju/juju/cmd/juju/crossmodel/crossmodel.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/cmd/juju/crossmodel/crossmodel.go 2016-11-11 00:08:09.000000000 +0000 @@ -0,0 +1,54 @@ +// Copyright 2015 Canonical Ltd. +// Licensed under the AGPLv3, see LICENCE file for details. + +// The crossmodel command provides an interface that allows to +// manipulate and inspect cross model relation. +package crossmodel + +import ( + "github.com/juju/loggo" + + "github.com/juju/juju/api/crossmodel" + "github.com/juju/juju/apiserver/params" + "github.com/juju/juju/cmd/modelcmd" +) + +var logger = loggo.GetLogger("juju.cmd.juju.crossmodel") + +// CrossModelCommandBase is a base structure to get cross model managing client. +type CrossModelCommandBase struct { + modelcmd.ControllerCommandBase +} + +// NewCrossModelAPI returns a cross model api for the root api endpoint +// that the environment command returns. +func (c *CrossModelCommandBase) NewCrossModelAPI() (*crossmodel.Client, error) { + root, err := c.NewAPIRoot() + if err != nil { + return nil, err + } + return crossmodel.NewClient(root), nil +} + +// RemoteEndpoint defines the serialization behaviour of remote endpoints. +// This is used in map-style yaml output where remote endpoint name is the key. +type RemoteEndpoint struct { + // Interface is relation interface. + Interface string `yaml:"interface" json:"interface"` + + // Role is relation role. + Role string `yaml:"role" json:"role"` +} + +// convertRemoteEndpoints takes any number of api-formatted remote applications' endpoints and +// creates a collection of ui-formatted endpoints. +func convertRemoteEndpoints(apiEndpoints ...params.RemoteEndpoint) map[string]RemoteEndpoint { + if len(apiEndpoints) == 0 { + return nil + } + output := make(map[string]RemoteEndpoint, len(apiEndpoints)) + for _, one := range apiEndpoints { + output[one.Name] = RemoteEndpoint{one.Interface, string(one.Role)} + } + return output +} diff -Nru juju-core-2.0.0/src/github.com/juju/juju/cmd/juju/crossmodel/export_test.go juju-core-2.0.2/src/github.com/juju/juju/cmd/juju/crossmodel/export_test.go --- juju-core-2.0.0/src/github.com/juju/juju/cmd/juju/crossmodel/export_test.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/cmd/juju/crossmodel/export_test.go 2016-11-11 00:08:09.000000000 +0000 @@ -0,0 +1,51 @@ +// Copyright 2015 Canonical Ltd. +// Licensed under the AGPLv3, see LICENCE file for details. + +package crossmodel + +import ( + "github.com/juju/cmd" + + "github.com/juju/juju/cmd/modelcmd" + "github.com/juju/juju/jujuclient" +) + +var ( + Max = max + DescAt = descAt + BreakLines = breakLines + ColumnWidth = columnWidth + BreakOneWord = breakOneWord +) + +func NewOfferCommandForTest(store jujuclient.ClientStore, api OfferAPI) cmd.Command { + aCmd := &offerCommand{newAPIFunc: func() (OfferAPI, error) { + return api, nil + }} + aCmd.SetClientStore(store) + return modelcmd.WrapController(aCmd) +} + +func NewShowEndpointsCommandForTest(store jujuclient.ClientStore, api ShowAPI) cmd.Command { + aCmd := &showCommand{newAPIFunc: func() (ShowAPI, error) { + return api, nil + }} + aCmd.SetClientStore(store) + return modelcmd.WrapController(aCmd) +} + +func NewListEndpointsCommandForTest(store jujuclient.ClientStore, api ListAPI) cmd.Command { + aCmd := &listCommand{newAPIFunc: func() (ListAPI, error) { + return api, nil + }} + aCmd.SetClientStore(store) + return modelcmd.WrapController(aCmd) +} + +func NewFindEndpointsCommandForTest(store jujuclient.ClientStore, api FindAPI) cmd.Command { + aCmd := &findCommand{newAPIFunc: func() (FindAPI, error) { + return api, nil + }} + aCmd.SetClientStore(store) + return modelcmd.WrapController(aCmd) +} diff -Nru juju-core-2.0.0/src/github.com/juju/juju/cmd/juju/crossmodel/findformatter.go juju-core-2.0.2/src/github.com/juju/juju/cmd/juju/crossmodel/findformatter.go --- juju-core-2.0.0/src/github.com/juju/juju/cmd/juju/crossmodel/findformatter.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/cmd/juju/crossmodel/findformatter.go 2016-11-11 00:08:09.000000000 +0000 @@ -0,0 +1,45 @@ +// Copyright 2015 Canonical Ltd. +// Licensed under the AGPLv3, see LICENCE file for details. + +package crossmodel + +import ( + "fmt" + "io" + "sort" + "strings" + + "github.com/juju/errors" + "github.com/juju/juju/cmd/output" +) + +// formatFindTabular returns a tabular summary of remote applications or +// errors out if parameter is not of expected type. +func formatFindTabular(writer io.Writer, value interface{}) error { + endpoints, ok := value.(map[string]RemoteApplicationResult) + if !ok { + return errors.Errorf("expected value of type %T, got %T", endpoints, value) + } + return formatFoundEndpointsTabular(writer, endpoints) +} + +// formatFoundEndpointsTabular returns a tabular summary of offered applications' endpoints. +func formatFoundEndpointsTabular(writer io.Writer, all map[string]RemoteApplicationResult) error { + tw := output.TabWriter(writer) + w := output.Wrapper{tw} + w.Println("URL", "Interfaces") + + for url, one := range all { + applicationURL := url + + interfaces := []string{} + for name, ep := range one.Endpoints { + interfaces = append(interfaces, fmt.Sprintf("%s:%s", ep.Interface, name)) + } + sort.Strings(interfaces) + w.Println(applicationURL, strings.Join(interfaces, ", ")) + } + tw.Flush() + + return nil +} diff -Nru juju-core-2.0.0/src/github.com/juju/juju/cmd/juju/crossmodel/find.go juju-core-2.0.2/src/github.com/juju/juju/cmd/juju/crossmodel/find.go --- juju-core-2.0.0/src/github.com/juju/juju/cmd/juju/crossmodel/find.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/cmd/juju/crossmodel/find.go 2016-11-11 00:08:09.000000000 +0000 @@ -0,0 +1,172 @@ +// Copyright 2015 Canonical Ltd. +// Licensed under the AGPLv3, see LICENCE file for details. + +package crossmodel + +import ( + "github.com/juju/cmd" + "github.com/juju/errors" + "github.com/juju/gnuflag" + "gopkg.in/juju/charm.v6-unstable" + + "github.com/juju/juju/apiserver/params" + "github.com/juju/juju/cmd/modelcmd" + "github.com/juju/juju/core/crossmodel" +) + +const findCommandDoc = ` +Find which offered application endpoints are available to the current user. + +This command is aimed for a user who wants to discover what endpoints are available to them. + +options: +-o, --output (= "") + specify an output file +--format (= tabular) + specify output format (tabular|json|yaml) + +Examples: + $ juju find-endpoints local: + $ juju find-endpoints local:/u/fred + $ juju find-endpoints --interface mysql --url local: + $ juju find-endpoints --charm db2 --url vendor:/u/ibm + $ juju find-endpoints --charm db2 --author ibm +` + +type findCommand struct { + CrossModelCommandBase + + url string + interfaceName string + endpoint string + user string + charm string + author string + + out cmd.Output + newAPIFunc func() (FindAPI, error) +} + +// NewFindEndpointsCommand constructs command that +// allows to find offered application endpoints. +func NewFindEndpointsCommand() cmd.Command { + findCmd := &findCommand{} + findCmd.newAPIFunc = func() (FindAPI, error) { + return findCmd.NewCrossModelAPI() + } + return modelcmd.WrapController(findCmd) +} + +// Init implements Command.Init. +func (c *findCommand) Init(args []string) (err error) { + url, err := cmd.ZeroOrOneArgs(args) + if err != nil { + return err + } + + if url != "" { + if c.url != "" { + return errors.New("URL term cannot be specified twice") + } + c.url = url + } + if c.url != "" { + if _, err := crossmodel.ParseApplicationURLParts(c.url); err != nil { + return err + } + } else { + // We need at least one filter. The default filter will list all local services. + c.url = "local:" + } + return nil +} + +// Info implements Command.Info. +func (c *findCommand) Info() *cmd.Info { + return &cmd.Info{ + Name: "find-endpoints", + Purpose: "Find offered application endpoints", + Doc: findCommandDoc, + } +} + +// SetFlags implements Command.SetFlags. +func (c *findCommand) SetFlags(f *gnuflag.FlagSet) { + c.CrossModelCommandBase.SetFlags(f) + f.StringVar(&c.url, "url", "", "application URL") + f.StringVar(&c.interfaceName, "interface", "", "return results matching the interface name") + f.StringVar(&c.endpoint, "endpoint", "", "return results matching the endpoint name") + f.StringVar(&c.user, "user", "", "return results with the user in the URL") + f.StringVar(&c.charm, "charm", "", "return results for the charm name") + f.StringVar(&c.author, "author", "", "return results matching the charm author") + c.out.AddFlags(f, "tabular", map[string]cmd.Formatter{ + "yaml": cmd.FormatYaml, + "json": cmd.FormatJson, + "tabular": formatFindTabular, + }) +} + +// Run implements Command.Run. +func (c *findCommand) Run(ctx *cmd.Context) (err error) { + api, err := c.newAPIFunc() + if err != nil { + return err + } + defer api.Close() + + filter := crossmodel.ApplicationOfferFilter{ + ApplicationOffer: crossmodel.ApplicationOffer{ + ApplicationURL: c.url, + }, + // TODO(wallyworld): allowed users + // TODO(wallyworld): charm + // TODO(wallyworld): user + // TODO(wallyworld): author + } + if c.interfaceName != "" || c.endpoint != "" { + filter.Endpoints = []charm.Relation{{ + Interface: c.interfaceName, + Name: c.endpoint, + }} + } + found, err := api.FindApplicationOffers(filter) + if err != nil { + return err + } + + output, err := convertFoundServices(found...) + if err != nil { + return err + } + if len(output) == 0 { + return errors.New("no matching application offers found") + } + return c.out.Write(ctx, output) +} + +// FindAPI defines the API methods that cross model find command uses. +type FindAPI interface { + Close() error + FindApplicationOffers(filters ...crossmodel.ApplicationOfferFilter) ([]params.ApplicationOffer, error) +} + +// RemoteApplicationResult defines the serialization behaviour of remote application. +// This is used in map-style yaml output where remote application URL is the key. +type RemoteApplicationResult struct { + // Endpoints is the list of offered application endpoints. + Endpoints map[string]RemoteEndpoint `yaml:"endpoints" json:"endpoints"` +} + +// convertFoundServices takes any number of api-formatted remote applications and +// creates a collection of ui-formatted services. +func convertFoundServices(services ...params.ApplicationOffer) (map[string]RemoteApplicationResult, error) { + if len(services) == 0 { + return nil, nil + } + output := make(map[string]RemoteApplicationResult, len(services)) + for _, one := range services { + service := RemoteApplicationResult{Endpoints: convertRemoteEndpoints(one.Endpoints...)} + output[one.ApplicationURL] = service + } + return output, nil +} diff -Nru juju-core-2.0.0/src/github.com/juju/juju/cmd/juju/crossmodel/find_test.go juju-core-2.0.2/src/github.com/juju/juju/cmd/juju/crossmodel/find_test.go --- juju-core-2.0.0/src/github.com/juju/juju/cmd/juju/crossmodel/find_test.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/cmd/juju/crossmodel/find_test.go 2016-11-11 00:08:09.000000000 +0000 @@ -0,0 +1,195 @@ +// Copyright 2015 Canonical Ltd. +// Licensed under the AGPLv3, see LICENCE file for details. + +package crossmodel_test + +import ( + "fmt" + + "github.com/juju/cmd" + "github.com/juju/errors" + jc "github.com/juju/testing/checkers" + gc "gopkg.in/check.v1" + "gopkg.in/juju/charm.v6-unstable" + + "github.com/juju/juju/apiserver/params" + "github.com/juju/juju/cmd/juju/crossmodel" + jujucrossmodel "github.com/juju/juju/core/crossmodel" + "github.com/juju/juju/testing" +) + +type findSuite struct { + BaseCrossModelSuite + mockAPI *mockFindAPI +} + +var _ = gc.Suite(&findSuite{}) + +func (s *findSuite) SetUpTest(c *gc.C) { + s.BaseCrossModelSuite.SetUpTest(c) + + s.mockAPI = &mockFindAPI{ + serviceName: "hosted-db2", + } +} + +func (s *findSuite) runFind(c *gc.C, args ...string) (*cmd.Context, error) { + return testing.RunCommand(c, crossmodel.NewFindEndpointsCommandForTest(s.store, s.mockAPI), args...) +} + +func (s *findSuite) TestFindNoArgs(c *gc.C) { + s.mockAPI.c = c + s.mockAPI.expectedFilter = &jujucrossmodel.ApplicationOfferFilter{ + ApplicationOffer: jujucrossmodel.ApplicationOffer{ + ApplicationURL: "local:", + }, + } + s.assertFind( + c, + []string{}, + ` +URL Interfaces +local:/u/fred/hosted-db2 http:db2, http:log + +`[1:], + ) +} + +func (s *findSuite) TestFindDuplicateUrl(c *gc.C) { + s.assertFindError(c, []string{"url", "--url", "urlparam"}, ".*URL term cannot be specified twice.*") +} + +func (s *findSuite) TestNoResults(c *gc.C) { + s.mockAPI.c = c + s.mockAPI.expectedFilter = &jujucrossmodel.ApplicationOfferFilter{ + ApplicationOffer: jujucrossmodel.ApplicationOffer{ + ApplicationURL: "local:/u/none", + }, + } + s.mockAPI.results = []params.ApplicationOffer{} + s.assertFindError( + c, + []string{"--url", "local:/u/none"}, + `no matching application offers found`, + ) +} + +func (s *findSuite) TestSimpleFilter(c *gc.C) { + s.mockAPI.c = c + s.mockAPI.expectedFilter = &jujucrossmodel.ApplicationOfferFilter{ + ApplicationOffer: jujucrossmodel.ApplicationOffer{ + ApplicationURL: "local:/u/fred", + }, + } + s.assertFind( + c, + []string{"--format", "tabular", "--url", "local:/u/fred"}, + ` +URL Interfaces +local:/u/fred/hosted-db2 http:db2, http:log + +`[1:], + ) +} + +func (s *findSuite) TestEndpointFilter(c *gc.C) { + s.mockAPI.c = c + s.mockAPI.expectedFilter = &jujucrossmodel.ApplicationOfferFilter{ + ApplicationOffer: jujucrossmodel.ApplicationOffer{ + ApplicationURL: "local:/u/fred", + Endpoints: []charm.Relation{{ + Interface: "mysql", + Name: "db", + }}, + }, + } + s.assertFind( + c, + []string{"--format", "tabular", "--url", "local:/u/fred", "--endpoint", "db", "--interface", "mysql"}, + ` +URL Interfaces +local:/u/fred/hosted-db2 http:db2, http:log + +`[1:], + ) +} + +func (s *findSuite) TestFindApiError(c *gc.C) { + s.mockAPI.msg = "fail" + s.assertFindError(c, []string{"local:/u/fred/db2"}, ".*fail.*") +} + +func (s *findSuite) TestFindYaml(c *gc.C) { + s.assertFind( + c, + []string{"local:/u/fred/db2", "--format", "yaml"}, + ` +local:/u/fred/hosted-db2: + endpoints: + db2: + interface: http + role: requirer + log: + interface: http + role: provider +`[1:], + ) +} + +func (s *findSuite) TestFindTabular(c *gc.C) { + s.assertFind( + c, + []string{"local:/u/fred/db2", "--format", "tabular"}, + ` +URL Interfaces +local:/u/fred/hosted-db2 http:db2, http:log + +`[1:], + ) +} + +func (s *findSuite) assertFind(c *gc.C, args []string, expected string) { + context, err := s.runFind(c, args...) + c.Assert(err, jc.ErrorIsNil) + + obtained := testing.Stdout(context) + c.Assert(obtained, gc.Matches, expected) +} + +func (s *findSuite) assertFindError(c *gc.C, args []string, expected string) { + _, err := s.runFind(c, args...) + c.Assert(err, gc.ErrorMatches, expected) +} + +type mockFindAPI struct { + c *gc.C + msg, serviceName string + expectedFilter *jujucrossmodel.ApplicationOfferFilter + results []params.ApplicationOffer +} + +func (s mockFindAPI) Close() error { + return nil +} + +func (s mockFindAPI) FindApplicationOffers(filters ...jujucrossmodel.ApplicationOfferFilter) ([]params.ApplicationOffer, error) { + if s.msg != "" { + return nil, errors.New(s.msg) + } + if s.expectedFilter != nil { + s.c.Assert(filters, gc.HasLen, 1) + s.c.Assert(filters[0], jc.DeepEquals, *s.expectedFilter) + } + + if s.results != nil { + return s.results, nil + } + return []params.ApplicationOffer{{ + ApplicationURL: fmt.Sprintf("local:/u/fred/%s", s.serviceName), + ApplicationName: s.serviceName, + Endpoints: []params.RemoteEndpoint{ + {Name: "log", Interface: "http", Role: charm.RoleProvider}, + {Name: "db2", Interface: "http", Role: charm.RoleRequirer}, + }, + }}, nil +} diff -Nru juju-core-2.0.0/src/github.com/juju/juju/cmd/juju/crossmodel/listformatter.go juju-core-2.0.2/src/github.com/juju/juju/cmd/juju/crossmodel/listformatter.go --- juju-core-2.0.0/src/github.com/juju/juju/cmd/juju/crossmodel/listformatter.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/cmd/juju/crossmodel/listformatter.go 2016-11-11 00:08:09.000000000 +0000 @@ -0,0 +1,77 @@ +// Copyright 2015 Canonical Ltd. +// Licensed under the AGPLv3, see LICENCE file for details. + +package crossmodel + +import ( + "fmt" + "io" + "sort" + + "github.com/juju/errors" + "github.com/juju/juju/cmd/output" +) + +// formatListTabular returns a tabular summary of remote applications or +// errors out if parameter is not of expected type. +func formatListTabular(writer io.Writer, value interface{}) error { + endpoints, ok := value.(map[string]directoryApplications) + if !ok { + return errors.Errorf("expected value of type %T, got %T", endpoints, value) + } + return formatListEndpointsTabular(writer, endpoints) +} + +// formatListEndpointsTabular returns a tabular summary of listed applications' endpoints. +func formatListEndpointsTabular(writer io.Writer, all map[string]directoryApplications) error { + tw := output.TabWriter(writer) + w := output.Wrapper{tw} + + // Ensure directories are sorted alphabetically. + directories := []string{} + for name, _ := range all { + directories = append(directories, name) + } + sort.Strings(directories) + + for _, directory := range directories { + w.Println(directory) + w.Println("Application", "Charm", "Connected", "Store", "URL", "Endpoint", "Interface", "Role") + + // Sort application names alphabetically. + applications := all[directory] + applicationNames := []string{} + for name, _ := range applications { + applicationNames = append(applicationNames, name) + } + sort.Strings(applicationNames) + + for _, name := range applicationNames { + application := applications[name] + + // Sort endpoints alphabetically. + endpoints := []string{} + for endpoint, _ := range application.Endpoints { + endpoints = append(endpoints, endpoint) + } + sort.Strings(endpoints) + + for i, endpointName := range endpoints { + + endpoint := application.Endpoints[endpointName] + if i == 0 { + // As there is some information about application and its endpoints, + // only display application information once + // when the first endpoint is displayed. + w.Println(name, application.CharmName, fmt.Sprint(application.UsersCount), application.Store, application.Location, endpointName, endpoint.Interface, endpoint.Role) + continue + } + // Subsequent lines only need to display endpoint information. + // This will display less noise. + w.Println("", "", "", "", "", endpointName, endpoint.Interface, endpoint.Role) + } + } + } + tw.Flush() + return nil +} diff -Nru juju-core-2.0.0/src/github.com/juju/juju/cmd/juju/crossmodel/list.go juju-core-2.0.2/src/github.com/juju/juju/cmd/juju/crossmodel/list.go --- juju-core-2.0.0/src/github.com/juju/juju/cmd/juju/crossmodel/list.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/cmd/juju/crossmodel/list.go 2016-11-11 00:08:09.000000000 +0000 @@ -0,0 +1,214 @@ +// Copyright 2015 Canonical Ltd. +// Licensed under the AGPLv3, see LICENCE file for details. + +package crossmodel + +import ( + "fmt" + + "github.com/juju/cmd" + "github.com/juju/errors" + "github.com/juju/gnuflag" + "gopkg.in/juju/charm.v6-unstable" + + "github.com/juju/juju/cmd/modelcmd" + "github.com/juju/juju/core/crossmodel" +) + +const listCommandDoc = ` +List information about services' endpoints that have been shared. + +options: +-o, --output (= "") + specify an output file +--format (= tabular) + specify output format (json|tabular|yaml) +[[-- ]],... + is free text and will be matched against any of: + - endpoint URL prefix + - interface name + - charm name + is optional and is used to limit the scope of the search using the search term, one of: + - url + - interface + - charm + +Examples: + $ juju list-offers + $ juju list-offers vendor: + $ juju list-offers --url vendor:/u/ibm + $ juju list-offers --interface db2 + + $ juju list-offers --interface db2 + LOCAL + APPLICATION CHARM INTERFACES CONNECTED STORE URL + fred/prod/hosted-db2 db2 db2, log 23 local /u/fred/prod/hosted-db2 + mary/test/hosted-db2 db2 db2 0 local /u/mary/test/hosted-db2 + + VENDOR + APPLICATION CHARM INTERFACES CONNECTED STORE URL + ibm/us-east/hosted-db2 db2 db2 3212 vendor /u/ibm/hosted-db2 + +` + +// listCommand returns storage instances. +type listCommand struct { + CrossModelCommandBase + + out cmd.Output + + newAPIFunc func() (ListAPI, error) + + filters []crossmodel.OfferedApplicationFilter +} + +// NewListEndpointsCommand constructs new list endpoint command. +func NewListEndpointsCommand() cmd.Command { + listCmd := &listCommand{} + listCmd.newAPIFunc = func() (ListAPI, error) { + return listCmd.NewCrossModelAPI() + } + return modelcmd.WrapController(listCmd) +} + +// Init implements Command.Init. +func (c *listCommand) Init(args []string) (err error) { + // TODO (anastasiamac 2015-11-17) need to get filters from user input + return cmd.CheckEmpty(args) +} + +// Info implements Command.Info. +func (c *listCommand) Info() *cmd.Info { + return &cmd.Info{ + Name: "offers", + Aliases: []string{"list-offers"}, + Purpose: "Lists shared endpoints", + Doc: listCommandDoc, + } +} + +// SetFlags implements Command.SetFlags. +func (c *listCommand) SetFlags(f *gnuflag.FlagSet) { + c.CrossModelCommandBase.SetFlags(f) + + // TODO (anastasiamac 2015-11-17) need to get filters from user input + c.out.AddFlags(f, "tabular", map[string]cmd.Formatter{ + "yaml": cmd.FormatYaml, + "json": cmd.FormatJson, + "tabular": formatListTabular, + }) +} + +// Run implements Command.Run. +func (c *listCommand) Run(ctx *cmd.Context) (err error) { + api, err := c.newAPIFunc() + if err != nil { + return err + } + defer api.Close() + + if len(c.filters) == 0 { + c.filters = []crossmodel.OfferedApplicationFilter{{ApplicationURL: "local:"}} + } + // TODO (anastasiamac 2015-11-17) add input filters + offeredApplications, err := api.ListOffers(c.filters...) + if err != nil { + return err + } + + // Filter out valid output, if any... + valid := []crossmodel.OfferedApplicationDetails{} + for _, service := range offeredApplications { + if service.Error != nil { + fmt.Fprintf(ctx.Stderr, "%v\n", service.Error) + continue + } + if service.Result != nil { + valid = append(valid, *service.Result) + } + } + if len(valid) == 0 { + return nil + } + + data, err := formatOfferedApplicationDetails(valid) + if err != nil { + return errors.Annotate(err, "failed to format found services") + } + + return c.out.Write(ctx, data) +} + +// ListAPI defines the API methods that list endpoints command use. +type ListAPI interface { + Close() error + ListOffers(filters ...crossmodel.OfferedApplicationFilter) ([]crossmodel.OfferedApplicationDetailsResult, error) +} + +// ListServiceItem defines the serialization behaviour of a service item in endpoints list. +type ListServiceItem struct { + // CharmName is the charm name of this service. + CharmName string `yaml:"charm,omitempty" json:"charm,omitempty"` + + // UsersCount is the count of how many users are connected to this shared service. + UsersCount int `yaml:"connected,omitempty" json:"connected,omitempty"` + + // Store is the name of the store which offers this shared service. + Store string `yaml:"store" json:"store"` + + // Location is part of Juju location where this service is shared relative to the store. + Location string `yaml:"url" json:"url"` + + // Endpoints is a list of service endpoints. + Endpoints map[string]RemoteEndpoint `yaml:"endpoints" json:"endpoints"` +} + +type directoryApplications map[string]ListServiceItem + +func formatOfferedApplicationDetails(all []crossmodel.OfferedApplicationDetails) (map[string]directoryApplications, error) { + directories := make(map[string]directoryApplications) + for _, one := range all { + url, err := crossmodel.ParseApplicationURL(one.ApplicationURL) + if err != nil { + return nil, err + } + + // Get services for this directory. + servicesMap, ok := directories[url.Directory] + if !ok { + servicesMap = make(directoryApplications) + directories[url.Directory] = servicesMap + } + + // Store services by name. + servicesMap[url.ApplicationName] = convertServiceToListItem(url, one) + } + return directories, nil +} + +func convertServiceToListItem(url *crossmodel.ApplicationURL, service crossmodel.OfferedApplicationDetails) ListServiceItem { + item := ListServiceItem{ + CharmName: service.CharmName, + // TODO (anastasiamac 2-15-11-20) what is the difference between store and directory. + // At this stage, the distinction is unclear apart from strong desire to call "directory" "store". + Store: url.Directory, + // Location is the suffix of the service's url, the part after ":". + Location: service.ApplicationURL[len(url.Directory)+1:], + UsersCount: service.ConnectedCount, + Endpoints: convertCharmEndpoints(service.Endpoints...), + } + return item +} + +// convertCharmEndpoints takes any number of charm relations and +// creates a collection of ui-formatted endpoints. +func convertCharmEndpoints(relations ...charm.Relation) map[string]RemoteEndpoint { + if len(relations) == 0 { + return nil + } + output := make(map[string]RemoteEndpoint, len(relations)) + for _, one := range relations { + output[one.Name] = RemoteEndpoint{one.Interface, string(one.Role)} + } + return output +} diff -Nru juju-core-2.0.0/src/github.com/juju/juju/cmd/juju/crossmodel/list_test.go juju-core-2.0.2/src/github.com/juju/juju/cmd/juju/crossmodel/list_test.go --- juju-core-2.0.0/src/github.com/juju/juju/cmd/juju/crossmodel/list_test.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/cmd/juju/crossmodel/list_test.go 2016-11-11 00:08:09.000000000 +0000 @@ -0,0 +1,173 @@ +// Copyright 2015 Canonical Ltd. +// Licensed under the AGPLv3, see LICENCE file for details. + +package crossmodel_test + +import ( + "fmt" + "strings" + + "github.com/juju/cmd" + "github.com/juju/errors" + jc "github.com/juju/testing/checkers" + gc "gopkg.in/check.v1" + "gopkg.in/juju/charm.v6-unstable" + + "github.com/juju/juju/cmd/juju/crossmodel" + model "github.com/juju/juju/core/crossmodel" + "github.com/juju/juju/testing" +) + +type ListSuite struct { + BaseCrossModelSuite + + mockAPI *mockListAPI + + applications []model.OfferedApplicationDetailsResult + endpoints []charm.Relation +} + +var _ = gc.Suite(&ListSuite{}) + +func (s *ListSuite) SetUpTest(c *gc.C) { + s.BaseCrossModelSuite.SetUpTest(c) + + s.endpoints = []charm.Relation{ + {Name: "mysql", Interface: "db2", Role: charm.RoleRequirer}, + {Name: "log", Interface: "http", Role: charm.RoleProvider}, + } + + s.applications = []model.OfferedApplicationDetailsResult{ + {Result: s.createServiceItem("hosted-db2", "local", 0)}, + } + + s.mockAPI = &mockListAPI{ + list: func(filters ...model.OfferedApplicationFilter) ([]model.OfferedApplicationDetailsResult, error) { + return s.applications, nil + }, + } +} + +func (s *ListSuite) TestListError(c *gc.C) { + msg := "fail api" + + s.mockAPI.list = func(filters ...model.OfferedApplicationFilter) ([]model.OfferedApplicationDetailsResult, error) { + return nil, errors.New(msg) + } + + _, err := s.runList(c, nil) + c.Assert(err, gc.ErrorMatches, fmt.Sprintf(".*%v.*", msg)) +} + +func (s *ListSuite) TestListFormatError(c *gc.C) { + s.applications = append(s.applications, model.OfferedApplicationDetailsResult{Result: s.createServiceItem("zdi^%", "different_store", 33)}) + + _, err := s.runList(c, nil) + c.Assert(err, gc.ErrorMatches, ".*failed to format.*") +} + +func (s *ListSuite) TestListDirectories(c *gc.C) { + // Insert in random order to check sorting. + s.applications = append(s.applications, model.OfferedApplicationDetailsResult{Result: s.createServiceItem("zdiff-db2", "differentstore", 33)}) + s.applications = append(s.applications, model.OfferedApplicationDetailsResult{Result: s.createServiceItem("adiff-db2", "vendor", 23)}) + + s.assertValidList( + c, + nil, + // Default format is tabular + ` +differentstore +Application Charm Connected Store URL Endpoint Interface Role +zdiff-db2 db2 33 differentstore /u/fred/zdiff-db2 log http provider + mysql db2 requirer +local +Application Charm Connected Store URL Endpoint Interface Role +hosted-db2 db2 0 local /u/fred/hosted-db2 log http provider + mysql db2 requirer +vendor +Application Charm Connected Store URL Endpoint Interface Role +adiff-db2 db2 23 vendor /u/fred/adiff-db2 log http provider + mysql db2 requirer + +`[1:], + "", + ) +} + +func (s *ListSuite) TestListWithErrors(c *gc.C) { + msg := "here is the error" + s.applications = append(s.applications, model.OfferedApplicationDetailsResult{Error: errors.New(msg)}) + + s.assertValidList( + c, + nil, + ` +local +Application Charm Connected Store URL Endpoint Interface Role +hosted-db2 db2 0 local /u/fred/hosted-db2 log http provider + mysql db2 requirer + +`[1:], + msg, + ) +} + +func (s *ListSuite) TestListYAML(c *gc.C) { + // Since applications are in the map and ordering is unreliable, ensure that there is only one endpoint. + // We only need one to demonstrate display anyway :D + s.applications[0].Result.Endpoints = []charm.Relation{{Name: "mysql", Interface: "db2", Role: charm.RoleRequirer}} + + s.assertValidList( + c, + []string{"--format", "yaml"}, + ` +local: + hosted-db2: + charm: db2 + store: local + url: /u/fred/hosted-db2 + endpoints: + mysql: + interface: db2 + role: requirer +`[1:], + "", + ) +} + +func (s *ListSuite) createServiceItem(name, store string, count int) *model.OfferedApplicationDetails { + return &model.OfferedApplicationDetails{ + ApplicationName: name, + ApplicationURL: fmt.Sprintf("%s:%s%s", store, "/u/fred/", name), + CharmName: "db2", + Endpoints: s.endpoints, + ConnectedCount: count, + } +} + +func (s *ListSuite) runList(c *gc.C, args []string) (*cmd.Context, error) { + return testing.RunCommand(c, crossmodel.NewListEndpointsCommandForTest(s.store, s.mockAPI), args...) +} + +func (s *ListSuite) assertValidList(c *gc.C, args []string, expectedValid, expectedErr string) { + context, err := s.runList(c, args) + c.Assert(err, jc.ErrorIsNil) + + obtainedErr := strings.Replace(testing.Stderr(context), "\n", "", -1) + c.Assert(obtainedErr, gc.Matches, expectedErr) + + obtainedValid := testing.Stdout(context) + c.Assert(obtainedValid, gc.Matches, expectedValid) +} + +type mockListAPI struct { + list func(filters ...model.OfferedApplicationFilter) ([]model.OfferedApplicationDetailsResult, error) +} + +func (s mockListAPI) Close() error { + return nil +} + +func (s mockListAPI) ListOffers(filters ...model.OfferedApplicationFilter) ([]model.OfferedApplicationDetailsResult, error) { + return s.list(filters...) +} diff -Nru juju-core-2.0.0/src/github.com/juju/juju/cmd/juju/crossmodel/offer.go juju-core-2.0.2/src/github.com/juju/juju/cmd/juju/crossmodel/offer.go --- juju-core-2.0.0/src/github.com/juju/juju/cmd/juju/crossmodel/offer.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/cmd/juju/crossmodel/offer.go 2016-11-11 00:08:09.000000000 +0000 @@ -0,0 +1,159 @@ +// Copyright 2015 Canonical Ltd. +// Licensed under the AGPLv3, see LICENCE file for details. + +package crossmodel + +import ( + "regexp" + "strings" + + "github.com/juju/cmd" + "github.com/juju/errors" + "github.com/juju/gnuflag" + "gopkg.in/juju/names.v2" + + "github.com/juju/juju/apiserver/params" + "github.com/juju/juju/cmd/modelcmd" + "github.com/juju/juju/core/crossmodel" +) + +const ( + offerCommandDoc = ` +A vendor offers deployed application endpoints for use by consumers. + +Examples: + +For local endpoints: +local:/u/// + +$ juju offer db2:db local:/myapps/db2 + +For vendor endpoints: +vendor:/u// + +$ juju offer db2:db vendor:/u/ibm/hosted-db2 +$ juju offer -e prod db2:db,log vendor:/u/ibm/hosted-db2 +$ juju offer hosted-db2:db,log vendor:/u/ibm/hosted-db2 +` +) + +// NewOfferCommand constructs commands that enables endpoints for export. +func NewOfferCommand() cmd.Command { + offerCmd := &offerCommand{} + offerCmd.newAPIFunc = func() (OfferAPI, error) { + return offerCmd.NewCrossModelAPI() + } + return modelcmd.WrapController(offerCmd) +} + +type offerCommand struct { + CrossModelCommandBase + newAPIFunc func() (OfferAPI, error) + + // ModelName stores the name of the model containing the application to be offered. + ModelName string + + // Application stores application name to be offered. + Application string + + // Endpoints stores a list of endpoints that are being offered. + Endpoints []string + + // URL stores juju location where these endpoints are offered from. + URL string +} + +// Info implements Command.Info. +func (c *offerCommand) Info() *cmd.Info { + return &cmd.Info{ + Name: "offer", + Purpose: "Offer application endpoints for use in other models", + Args: ":[,...] ", + Doc: offerCommandDoc, + } +} + +// Init implements Command.Init. +func (c *offerCommand) Init(args []string) error { + if len(args) < 1 { + return errors.New("an offer must at least specify application endpoint") + } + if len(args) < 2 { + return errors.New("an offer must specify a url") + } + if len(args) > 2 { + return errors.New("an offer can only specify application endpoints and url") + } + + if err := c.parseEndpoints(args[0]); err != nil { + return err + } + + hostedURL := args[1] + if _, err := crossmodel.ParseApplicationURL(hostedURL); err != nil { + return errors.Errorf(`hosted url %q is not valid" `, hostedURL) + } + c.URL = hostedURL + return nil +} + +// SetFlags implements Command.SetFlags. +func (c *offerCommand) SetFlags(f *gnuflag.FlagSet) { + c.CrossModelCommandBase.SetFlags(f) +} + +// Run implements Command.Run. +func (c *offerCommand) Run(_ *cmd.Context) error { + api, err := c.newAPIFunc() + if err != nil { + return err + } + defer api.Close() + + model, err := c.ClientStore().ModelByName(c.ControllerName(), c.ModelName) + if err != nil { + return err + } + // TODO (anastasiamac 2015-11-16) Add a sensible way for user to specify long-ish (at times) description when offering + results, err := api.Offer(model.ModelUUID, c.Application, c.Endpoints, c.URL, "") + if err != nil { + return err + } + return params.ErrorResults{results}.Combine() +} + +// OfferAPI defines the API methods that the offer command uses. +type OfferAPI interface { + Close() error + Offer(modelUUID, application string, endpoints []string, url string, desc string) ([]params.ErrorResult, error) +} + +// applicationParse is used to split an application string +// into model, application and endpoint names. +var applicationParse = regexp.MustCompile("/?((?P[^\\.]*)\\.)?(?P[^:]*)(:(?P.*))?") + +func (c *offerCommand) parseEndpoints(arg string) error { + c.ModelName = applicationParse.ReplaceAllString(arg, "$model") + c.Application = applicationParse.ReplaceAllString(arg, "$appname") + endpoints := applicationParse.ReplaceAllString(arg, "$endpoints") + + if !strings.Contains(arg, ":") { + return errors.New(`endpoints must conform to format ":[,...]" `) + } + if !names.IsValidApplication(c.Application) { + return errors.NotValidf(`application name %q`, c.Application) + } + + c.Endpoints = strings.Split(endpoints, ",") + if len(endpoints) < 1 || endpoints == "" { + return errors.Errorf(`specify endpoints for %v" `, c.Application) + } + + if c.ModelName == "" { + var err error + if c.ModelName, err = c.ClientStore().CurrentModel(c.ControllerName()); err != nil { + return err + } + } + return nil +} diff -Nru juju-core-2.0.0/src/github.com/juju/juju/cmd/juju/crossmodel/offer_test.go juju-core-2.0.2/src/github.com/juju/juju/cmd/juju/crossmodel/offer_test.go --- juju-core-2.0.0/src/github.com/juju/juju/cmd/juju/crossmodel/offer_test.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/cmd/juju/crossmodel/offer_test.go 2016-11-11 00:08:09.000000000 +0000 @@ -0,0 +1,146 @@ +// Copyright 2015 Canonical Ltd. +// Licensed under the AGPLv3, see LICENCE file for details. + +package crossmodel_test + +import ( + "github.com/juju/cmd" + "github.com/juju/errors" + jc "github.com/juju/testing/checkers" + gc "gopkg.in/check.v1" + + "github.com/juju/juju/apiserver/common" + "github.com/juju/juju/apiserver/params" + "github.com/juju/juju/cmd/juju/crossmodel" + "github.com/juju/juju/testing" +) + +type offerSuite struct { + BaseCrossModelSuite + mockAPI *mockOfferAPI + args []string +} + +var _ = gc.Suite(&offerSuite{}) + +func (s *offerSuite) SetUpTest(c *gc.C) { + s.BaseCrossModelSuite.SetUpTest(c) + + s.mockAPI = newMockOfferAPI() + s.args = nil +} + +func (s *offerSuite) TestOfferNoArgs(c *gc.C) { + s.assertOfferErrorOutput(c, ".*an offer must at least specify application endpoint.*") +} + +func (s *offerSuite) TestOfferTooFewArgs(c *gc.C) { + s.args = []string{"tst:db"} + s.assertOfferErrorOutput(c, "an offer must specify a url") +} + +func (s *offerSuite) TestOfferInvalidApplication(c *gc.C) { + s.args = []string{"123:", "local:/u/bob/testing/tst"} + s.assertOfferErrorOutput(c, `.*application name "123" not valid.*`) +} + +func (s *offerSuite) TestOfferInvalidEndpoints(c *gc.C) { + s.args = []string{"tst/123", "local:/u/bob/testing/tst"} + s.assertOfferErrorOutput(c, `.*endpoints must conform to format.*`) +} + +func (s *offerSuite) TestOfferNoEndpoints(c *gc.C) { + s.args = []string{"tst:", "local:/u/bob/testing/tst"} + s.assertOfferErrorOutput(c, `.*specify endpoints for tst.*`) +} + +func (s *offerSuite) TestOfferNoModel(c *gc.C) { + s.store.Models[s.store.CurrentControllerName].CurrentModel = "" + s.args = []string{"tst:db", "local:/u/bob/testing/tst"} + s.assertOfferErrorOutput(c, `current model for controller test-master not found`) +} + +func (s *offerSuite) assertOfferErrorOutput(c *gc.C, expected string) { + _, err := s.runOffer(c, s.args...) + c.Assert(errors.Cause(err), gc.ErrorMatches, expected) +} + +func (s *offerSuite) runOffer(c *gc.C, args ...string) (*cmd.Context, error) { + return testing.RunCommand(c, crossmodel.NewOfferCommandForTest(s.store, s.mockAPI), args...) +} + +func (s *offerSuite) TestOfferCallErred(c *gc.C) { + s.args = []string{"tst:db", "local:/u/bob/testing/tst"} + s.mockAPI.errCall = true + s.assertOfferErrorOutput(c, ".*aborted.*") +} + +func (s *offerSuite) TestOfferDataErred(c *gc.C) { + s.args = []string{"tst:db", "local:/u/bob/testing/tst"} + s.mockAPI.errData = true + s.assertOfferErrorOutput(c, ".*failed.*") +} + +func (s *offerSuite) TestOfferValid(c *gc.C) { + s.args = []string{"tst:db", "local:/u/bob/testing/tst"} + s.assertOfferOutput(c, "test", "tst", []string{"db"}, "local:/u/bob/testing/tst") +} + +func (s *offerSuite) TestOfferExplicitModel(c *gc.C) { + s.args = []string{"prod.tst:db", "local:/u/bob/testing/tst"} + s.assertOfferOutput(c, "prod", "tst", []string{"db"}, "local:/u/bob/testing/tst") +} + +func (s *offerSuite) TestOfferWithURL(c *gc.C) { + s.args = []string{"tst:db", "/u/user/offer"} + s.assertOfferOutput(c, "test", "tst", []string{"db"}, "/u/user/offer") +} + +func (s *offerSuite) TestOfferMultipleEndpoints(c *gc.C) { + s.args = []string{"tst:db,admin", "local:/u/bob/testing/tst"} + s.assertOfferOutput(c, "test", "tst", []string{"db", "admin"}, "local:/u/bob/testing/tst") +} + +func (s *offerSuite) assertOfferOutput(c *gc.C, expectedModel, expectedApplication string, endpoints []string, url string) { + _, err := s.runOffer(c, s.args...) + c.Assert(err, jc.ErrorIsNil) + c.Assert(s.mockAPI.model, gc.Equals, expectedModel+"-uuid") + c.Assert(s.mockAPI.offers[expectedApplication], jc.SameContents, endpoints) + c.Assert(s.mockAPI.urls[expectedApplication], jc.DeepEquals, url) +} + +type mockOfferAPI struct { + errCall, errData bool + model string + offers map[string][]string + urls map[string]string + descs map[string]string +} + +func newMockOfferAPI() *mockOfferAPI { + mock := &mockOfferAPI{} + mock.offers = make(map[string][]string) + mock.urls = make(map[string]string) + mock.descs = make(map[string]string) + return mock +} + +func (s *mockOfferAPI) Close() error { + return nil +} + +func (s *mockOfferAPI) Offer(model, application string, endpoints []string, url string, desc string) ([]params.ErrorResult, error) { + s.model = model + if s.errCall { + return nil, errors.New("aborted") + } + result := make([]params.ErrorResult, 1) + if s.errData { + result[0].Error = common.ServerError(errors.New("failed")) + return result, nil + } + s.offers[application] = endpoints + s.urls[application] = url + s.descs[application] = desc + return result, nil +} diff -Nru juju-core-2.0.0/src/github.com/juju/juju/cmd/juju/crossmodel/package_test.go juju-core-2.0.2/src/github.com/juju/juju/cmd/juju/crossmodel/package_test.go --- juju-core-2.0.0/src/github.com/juju/juju/cmd/juju/crossmodel/package_test.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/cmd/juju/crossmodel/package_test.go 2016-11-11 00:08:09.000000000 +0000 @@ -0,0 +1,43 @@ +// Copyright 2015 Canonical Ltd. +// Licensed under the AGPLv3, see LICENCE file for details. + +package crossmodel_test + +import ( + "testing" + + gc "gopkg.in/check.v1" + + "github.com/juju/juju/jujuclient" + "github.com/juju/juju/jujuclient/jujuclienttesting" + jujutesting "github.com/juju/juju/testing" +) + +func TestAll(t *testing.T) { + gc.TestingT(t) +} + +type BaseCrossModelSuite struct { + jujutesting.BaseSuite + + store *jujuclienttesting.MemStore +} + +func (s *BaseCrossModelSuite) SetUpTest(c *gc.C) { + // Set up the current controller, and write just enough info + // so we don't try to refresh + controllerName := "test-master" + s.store = jujuclienttesting.NewMemStore() + s.store.CurrentControllerName = controllerName + s.store.Controllers[controllerName] = jujuclient.ControllerDetails{} + s.store.Models[controllerName] = &jujuclient.ControllerModels{ + CurrentModel: "test", + Models: map[string]jujuclient.ModelDetails{ + "bob/test": {"test-uuid"}, + "bob/prod": {"prod-uuid"}, + }, + } + s.store.Accounts[controllerName] = jujuclient.AccountDetails{ + User: "bob", + } +} diff -Nru juju-core-2.0.0/src/github.com/juju/juju/cmd/juju/crossmodel/showformatter.go juju-core-2.0.2/src/github.com/juju/juju/cmd/juju/crossmodel/showformatter.go --- juju-core-2.0.0/src/github.com/juju/juju/cmd/juju/crossmodel/showformatter.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/cmd/juju/crossmodel/showformatter.go 2016-11-11 00:08:09.000000000 +0000 @@ -0,0 +1,142 @@ +// Copyright 2015 Canonical Ltd. +// Licensed under the AGPLv3, see LICENCE file for details. + +package crossmodel + +import ( + "fmt" + "io" + "sort" + "strings" + + "github.com/juju/errors" + "github.com/juju/juju/cmd/output" +) + +const ( + // To wrap long lines within a column. + maxColumnLength = 180 + truncatedSuffix = "..." + maxFieldLength = maxColumnLength - len(truncatedSuffix) + columnWidth = 45 +) + +// formatShowTabular returns a tabular summary of remote applications or +// errors out if parameter is not of expected type. +func formatShowTabular(writer io.Writer, value interface{}) error { + endpoints, ok := value.(map[string]ShowRemoteApplication) + if !ok { + return errors.Errorf("expected value of type %T, got %T", endpoints, value) + } + return formatOfferedEndpointsTabular(writer, endpoints) +} + +// formatOfferedEndpointsTabular returns a tabular summary of offered applications' endpoints. +func formatOfferedEndpointsTabular(writer io.Writer, all map[string]ShowRemoteApplication) error { + tw := output.TabWriter(writer) + w := output.Wrapper{tw} + + w.Println("Application", "Description", "Endpoint", "Interface", "Role") + + for name, one := range all { + applicationName := name + applicationDesc := one.Description + + // truncate long description for now. + if len(applicationDesc) > maxColumnLength { + applicationDesc = fmt.Sprintf("%v%v", applicationDesc[:maxFieldLength], truncatedSuffix) + } + descLines := breakLines(applicationDesc) + + // Find the maximum amount of iterations required: + // it will be either endpoints or description lines length + maxIterations := max(len(one.Endpoints), len(descLines)) + + names := []string{} + for name, _ := range one.Endpoints { + names = append(names, name) + } + sort.Strings(names) + + for i := 0; i < maxIterations; i++ { + descLine := descAt(descLines, i) + name, endpoint := endpointAt(one.Endpoints, names, i) + w.Println(applicationName, descLine, name, endpoint.Interface, endpoint.Role) + // Only print once. + applicationName = "" + } + } + tw.Flush() + return nil +} + +func descAt(lines []string, i int) string { + if i < len(lines) { + return lines[i] + } + return "" +} + +func endpointAt(endpoints map[string]RemoteEndpoint, names []string, i int) (string, RemoteEndpoint) { + if i < len(endpoints) { + name := names[i] + return name, endpoints[name] + } + return "", RemoteEndpoint{} +} + +func breakLines(text string) []string { + words := strings.Fields(text) + + // if there is one very long word, break it + if len(words) == 1 { + return breakOneWord(words[0]) + } + + numLines := len(text)/columnWidth + 1 + lines := make([]string, numLines) + + index := 0 + for _, aWord := range words { + if len(lines[index]) == 0 { + lines[index] = aWord + continue + } + tp := fmt.Sprintf("%v %v", lines[index], aWord) + if len(tp) > columnWidth { + index++ + lines[index] = aWord + continue + } + lines[index] = tp + } + + return lines +} + +func breakOneWord(one string) []string { + if len(one) <= columnWidth { + return []string{one} + } + + numParts := (len(one) / columnWidth) + 1 + parts := make([]string, numParts) + + for i := 0; i < numParts; i++ { + start := i * columnWidth + end := start + columnWidth + if end > len(one) { + parts[i] = one[start:] + continue + } + parts[i] = one[start:end] + } + return parts +} + +func max(one, two int) int { + if one > two { + return one + } + return two +} diff -Nru juju-core-2.0.0/src/github.com/juju/juju/cmd/juju/crossmodel/showformatter_test.go juju-core-2.0.2/src/github.com/juju/juju/cmd/juju/crossmodel/showformatter_test.go --- juju-core-2.0.0/src/github.com/juju/juju/cmd/juju/crossmodel/showformatter_test.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/cmd/juju/crossmodel/showformatter_test.go 2016-11-11 00:08:09.000000000 +0000 @@ -0,0 +1,84 @@ +// Copyright 2015 Canonical Ltd. +// Licensed under the AGPLv3, see LICENCE file for details. + +package crossmodel_test + +import ( + gc "gopkg.in/check.v1" + + "github.com/juju/juju/cmd/juju/crossmodel" + "github.com/juju/juju/testing" +) + +type funcSuite struct { + testing.BaseSuite +} + +func (s *funcSuite) SetUpTest(c *gc.C) { + s.BaseSuite.SetUpTest(c) +} + +var _ = gc.Suite(&funcSuite{}) + +func (s *funcSuite) TestMaxFirstBigger(c *gc.C) { + c.Assert(crossmodel.Max(3, 1), gc.DeepEquals, 3) +} + +func (s *funcSuite) TestMaxLastBigger(c *gc.C) { + c.Assert(crossmodel.Max(1, 3), gc.DeepEquals, 3) +} + +func (s *funcSuite) TestMaxEquals(c *gc.C) { + c.Assert(crossmodel.Max(3, 3), gc.DeepEquals, 3) +} + +func (s *funcSuite) TestAtInRange(c *gc.C) { + desc := []string{"one", "two"} + c.Assert(crossmodel.DescAt(desc, 0), gc.DeepEquals, desc[0]) + c.Assert(crossmodel.DescAt(desc, 1), gc.DeepEquals, desc[1]) +} + +func (s *funcSuite) TestAtOutRange(c *gc.C) { + desc := []string{"one", "two"} + c.Assert(crossmodel.DescAt(desc, 2), gc.DeepEquals, "") + c.Assert(crossmodel.DescAt(desc, 10), gc.DeepEquals, "") +} + +func (s *funcSuite) TestBreakLinesEmpty(c *gc.C) { + empty := "" + c.Assert(crossmodel.BreakLines(empty), gc.DeepEquals, []string{empty}) +} + +func (s *funcSuite) TestBreakLinesOneWord(c *gc.C) { + aWord := "aWord" + c.Assert(crossmodel.BreakLines(aWord), gc.DeepEquals, []string{aWord}) +} + +func (s *funcSuite) TestBreakLinesManyWordsOneLine(c *gc.C) { + aWord := "aWord aWord aWord aWord aWord" + c.Assert(crossmodel.BreakLines(aWord), gc.DeepEquals, []string{aWord}) +} + +func (s *funcSuite) TestBreakLinesManyWordsManyLines(c *gc.C) { + aWord := "aWord aWord aWord aWord aWord aWord aWord aWord aWord aWord" + c.Assert(crossmodel.BreakLines(aWord), gc.DeepEquals, + []string{ + "aWord aWord aWord aWord aWord aWord aWord", + "aWord aWord aWord", + }) +} + +func (s *funcSuite) TestBreakOneWord(c *gc.C) { + aWord := "aWord" + c.Assert(crossmodel.BreakOneWord(aWord), gc.DeepEquals, []string{aWord}) +} + +func (s *funcSuite) TestBreakOneLongWord(c *gc.C) { + aWord := "aVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryaWordaWordaWordaWordaWordaWord" + c.Assert(crossmodel.BreakOneWord(aWord), gc.DeepEquals, + []string{ + aWord[0:crossmodel.ColumnWidth], + aWord[crossmodel.ColumnWidth : crossmodel.ColumnWidth*2], + aWord[crossmodel.ColumnWidth*2:], + }) +} diff -Nru juju-core-2.0.0/src/github.com/juju/juju/cmd/juju/crossmodel/show.go juju-core-2.0.2/src/github.com/juju/juju/cmd/juju/crossmodel/show.go --- juju-core-2.0.0/src/github.com/juju/juju/cmd/juju/crossmodel/show.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/cmd/juju/crossmodel/show.go 2016-11-11 00:08:09.000000000 +0000 @@ -0,0 +1,134 @@ +// Copyright 2015 Canonical Ltd. +// Licensed under the AGPLv3, see LICENCE file for details. + +package crossmodel + +import ( + "github.com/juju/cmd" + "github.com/juju/errors" + "github.com/juju/gnuflag" + + "github.com/juju/juju/apiserver/params" + "github.com/juju/juju/cmd/modelcmd" + "github.com/juju/juju/core/crossmodel" +) + +const showCommandDoc = ` +Show extended information about an exported service. + +This command is aimed for a user who wants to see more detail about what’s offered behind a particular URL. + +options: +-o, --output (= "") + specify an output file +--format (= tabular) + specify output format (tabular|json|yaml) + +Examples: + $ juju show-endpoints local:/u/fred/prod/db2 + $ juju show-endpoints vendor:/u/ibm/hosted-db2 +` + +type showCommand struct { + CrossModelCommandBase + + url string + out cmd.Output + newAPIFunc func() (ShowAPI, error) +} + +// NewShowOfferedEndpointCommand constructs command that +// allows to show details of offered application's endpoint. +func NewShowOfferedEndpointCommand() cmd.Command { + showCmd := &showCommand{} + showCmd.newAPIFunc = func() (ShowAPI, error) { + return showCmd.NewCrossModelAPI() + } + return modelcmd.WrapController(showCmd) +} + +// Init implements Command.Init. +func (c *showCommand) Init(args []string) (err error) { + if len(args) != 1 { + return errors.New("must specify endpoint URL") + } + + url := args[0] + if _, err := crossmodel.ParseApplicationURL(url); err != nil { + return err + } + c.url = url + return nil +} + +// Info implements Command.Info. +func (c *showCommand) Info() *cmd.Info { + return &cmd.Info{ + Name: "show-endpoints", + Purpose: "Shows offered applications' endpoints details", + Doc: showCommandDoc, + } +} + +// SetFlags implements Command.SetFlags. +func (c *showCommand) SetFlags(f *gnuflag.FlagSet) { + c.CrossModelCommandBase.SetFlags(f) + c.out.AddFlags(f, "tabular", map[string]cmd.Formatter{ + "yaml": cmd.FormatYaml, + "json": cmd.FormatJson, + "tabular": formatShowTabular, + }) +} + +// Run implements Command.Run. +func (c *showCommand) Run(ctx *cmd.Context) (err error) { + api, err := c.newAPIFunc() + if err != nil { + return err + } + defer api.Close() + + found, err := api.ApplicationOffer(c.url) + if err != nil { + return err + } + + output, err := convertRemoteApplications(found) + if err != nil { + return err + } + return c.out.Write(ctx, output) +} + +// ShowAPI defines the API methods that cross model show command uses. +type ShowAPI interface { + Close() error + ApplicationOffer(url string) (params.ApplicationOffer, error) +} + +// ShowRemoteApplication defines the serialization behaviour of remote application. +// This is used in map-style yaml output where remote application name is the key. +type ShowRemoteApplication struct { + // Endpoints list of offered application endpoints. + Endpoints map[string]RemoteEndpoint `yaml:"endpoints" json:"endpoints"` + + // Description is the user entered description. + Description string `yaml:"description,omitempty" json:"description,omitempty"` +} + +// convertRemoteApplications takes any number of api-formatted remote applications and +// creates a collection of ui-formatted services. +func convertRemoteApplications(services ...params.ApplicationOffer) (map[string]ShowRemoteApplication, error) { + if len(services) == 0 { + return nil, nil + } + output := make(map[string]ShowRemoteApplication, len(services)) + for _, one := range services { + service := ShowRemoteApplication{Endpoints: convertRemoteEndpoints(one.Endpoints...)} + if one.ApplicationDescription != "" { + service.Description = one.ApplicationDescription + } + output[one.ApplicationName] = service + } + return output, nil +} diff -Nru juju-core-2.0.0/src/github.com/juju/juju/cmd/juju/crossmodel/show_test.go juju-core-2.0.2/src/github.com/juju/juju/cmd/juju/crossmodel/show_test.go --- juju-core-2.0.0/src/github.com/juju/juju/cmd/juju/crossmodel/show_test.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/cmd/juju/crossmodel/show_test.go 2016-11-11 00:08:09.000000000 +0000 @@ -0,0 +1,151 @@ +// Copyright 2015 Canonical Ltd. +// Licensed under the AGPLv3, see LICENCE file for details. + +package crossmodel_test + +import ( + "github.com/juju/cmd" + "github.com/juju/errors" + jc "github.com/juju/testing/checkers" + gc "gopkg.in/check.v1" + "gopkg.in/juju/charm.v6-unstable" + + "github.com/juju/juju/apiserver/params" + "github.com/juju/juju/cmd/juju/crossmodel" + "github.com/juju/juju/testing" +) + +type showSuite struct { + BaseCrossModelSuite + mockAPI *mockShowAPI +} + +var _ = gc.Suite(&showSuite{}) + +func (s *showSuite) SetUpTest(c *gc.C) { + s.BaseCrossModelSuite.SetUpTest(c) + + s.mockAPI = &mockShowAPI{ + serviceTag: "hosted-db2", + desc: "IBM DB2 Express Server Edition is an entry level database system", + } +} + +func (s *showSuite) runShow(c *gc.C, args ...string) (*cmd.Context, error) { + return testing.RunCommand(c, crossmodel.NewShowEndpointsCommandForTest(s.store, s.mockAPI), args...) +} + +func (s *showSuite) TestShowNoUrl(c *gc.C) { + s.assertShowError(c, nil, ".*must specify endpoint URL.*") +} + +func (s *showSuite) TestShowApiError(c *gc.C) { + s.mockAPI.msg = "fail" + s.assertShowError(c, []string{"local:/u/fred/db2"}, ".*fail.*") +} + +func (s *showSuite) TestShowURLError(c *gc.C) { + s.mockAPI.serviceTag = "invalid_tag" + s.assertShowError(c, []string{"local:/u/fred/prod/foo/db2"}, ".*invalid.*") +} + +func (s *showSuite) TestShowYaml(c *gc.C) { + s.assertShow( + c, + []string{"local:/u/fred/db2", "--format", "yaml"}, + ` +hosted-db2: + endpoints: + db2: + interface: http + role: requirer + log: + interface: http + role: provider + description: IBM DB2 Express Server Edition is an entry level database system +`[1:], + ) +} + +func (s *showSuite) TestShowTabular(c *gc.C) { + s.assertShow( + c, + []string{"local:/u/fred/db2", "--format", "tabular"}, + ` +Application Description Endpoint Interface Role +hosted-db2 IBM DB2 Express Server Edition is an entry db2 http requirer + level database system log http provider + +`[1:], + ) +} + +func (s *showSuite) TestShowTabularExactly180Desc(c *gc.C) { + s.mockAPI.desc = s.mockAPI.desc + s.mockAPI.desc + s.mockAPI.desc[:52] + s.assertShow( + c, + []string{"local:/u/fred/db2", "--format", "tabular"}, + ` +Application Description Endpoint Interface Role +hosted-db2 IBM DB2 Express Server Edition is an entry db2 http requirer + level database systemIBM DB2 Express Server log http provider + Edition is an entry level database systemIBM + DB2 Express Server Edition is an entry level + dat + +`[1:], + ) +} + +func (s *showSuite) TestShowTabularMoreThan180Desc(c *gc.C) { + s.mockAPI.desc = s.mockAPI.desc + s.mockAPI.desc + s.mockAPI.desc + s.assertShow( + c, + []string{"local:/u/fred/db2", "--format", "tabular"}, + ` +Application Description Endpoint Interface Role +hosted-db2 IBM DB2 Express Server Edition is an entry db2 http requirer + level database systemIBM DB2 Express Server log http provider + Edition is an entry level database systemIBM + DB2 Express Server Edition is an entry level + ... + +`[1:], + ) +} + +func (s *showSuite) assertShow(c *gc.C, args []string, expected string) { + context, err := s.runShow(c, args...) + c.Assert(err, jc.ErrorIsNil) + + obtained := testing.Stdout(context) + c.Assert(obtained, gc.Matches, expected) +} + +func (s *showSuite) assertShowError(c *gc.C, args []string, expected string) { + _, err := s.runShow(c, args...) + c.Assert(err, gc.ErrorMatches, expected) +} + +type mockShowAPI struct { + msg, serviceTag, desc string +} + +func (s mockShowAPI) Close() error { + return nil +} + +func (s mockShowAPI) ApplicationOffer(url string) (params.ApplicationOffer, error) { + if s.msg != "" { + return params.ApplicationOffer{}, errors.New(s.msg) + } + + return params.ApplicationOffer{ + ApplicationName: s.serviceTag, + ApplicationDescription: s.desc, + Endpoints: []params.RemoteEndpoint{ + {Name: "log", Interface: "http", Role: charm.RoleProvider}, + {Name: "db2", Interface: "http", Role: charm.RoleRequirer}, + }, + }, nil +} diff -Nru juju-core-2.0.0/src/github.com/juju/juju/cmd/juju/gui/gui.go juju-core-2.0.2/src/github.com/juju/juju/cmd/juju/gui/gui.go --- juju-core-2.0.0/src/github.com/juju/juju/cmd/juju/gui/gui.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/cmd/juju/gui/gui.go 2016-11-11 00:08:09.000000000 +0000 @@ -65,7 +65,7 @@ // Run implements the cmd.Command interface. func (c *guiCommand) Run(ctx *cmd.Context) error { // Retrieve model details. - conn, err := c.NewAPIRoot() + conn, err := c.NewControllerAPIRoot() if err != nil { return errors.Annotate(err, "cannot establish API connection") } diff -Nru juju-core-2.0.0/src/github.com/juju/juju/cmd/juju/metricsdebug/metrics.go juju-core-2.0.2/src/github.com/juju/juju/cmd/juju/metricsdebug/metrics.go --- juju-core-2.0.0/src/github.com/juju/juju/cmd/juju/metricsdebug/metrics.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/cmd/juju/metricsdebug/metrics.go 2016-11-11 00:08:09.000000000 +0000 @@ -6,6 +6,7 @@ import ( "fmt" "io" + "sort" "time" "github.com/gosuri/uitable" @@ -91,6 +92,23 @@ return metricsdebug.NewClient(state), nil } +type metricSlice []metric + +// Len implements the sort.Interface. +func (slice metricSlice) Len() int { + return len(slice) +} + +// Less implements the sort.Interface. +func (slice metricSlice) Less(i, j int) bool { + return slice[i].Metric < slice[j].Metric +} + +// Swap implements the sort.Interface. +func (slice metricSlice) Swap(i, j int) { + slice[i], slice[j] = slice[j], slice[i] +} + type metric struct { Unit string `json:"unit" yaml:"unit"` Timestamp time.Time `json:"timestamp" yaml:"timestamp"` @@ -126,6 +144,9 @@ Value: m.Value, } } + sortedResults := metricSlice(results) + sort.Sort(sortedResults) + return errors.Trace(c.out.Write(ctx, results)) } diff -Nru juju-core-2.0.0/src/github.com/juju/juju/cmd/juju/metricsdebug/metrics_test.go juju-core-2.0.2/src/github.com/juju/juju/cmd/juju/metricsdebug/metrics_test.go --- juju-core-2.0.0/src/github.com/juju/juju/cmd/juju/metricsdebug/metrics_test.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/cmd/juju/metricsdebug/metrics_test.go 2016-11-11 00:08:09.000000000 +0000 @@ -54,17 +54,44 @@ }) } -func (s *metricsSuite) TestDefaultTabulatFormat(c *gc.C) { +func (s *metricsSuite) TestSort(c *gc.C) { s.client.metrics = []params.MetricResult{{ Unit: "unit-metered-0", - Key: "pings", + Key: "c-s", Value: "5.0", - Time: time.Date(2016, 8, 22, 12, 02, 03, 0, time.UTC), + Time: time.Date(2016, 8, 22, 12, 02, 04, 0, time.UTC), }, { Unit: "unit-metered-0", + Key: "b-s", + Value: "10.0", + Time: time.Date(2016, 8, 22, 12, 02, 04, 0, time.UTC), + }, { + Unit: "unit-metered-0", + Key: "a-s", + Value: "15.0", + Time: time.Date(2016, 8, 22, 12, 02, 04, 0, time.UTC), + }} + ctx, err := coretesting.RunCommand(c, metricsdebug.New(), "metered/0") + c.Assert(err, jc.ErrorIsNil) + s.client.CheckCall(c, 0, "GetMetrics", []string{"unit-metered-0"}) + c.Assert(cmdtesting.Stdout(ctx), gc.Equals, `UNIT TIMESTAMP METRIC VALUE +unit-metered-0 2016-08-22T12:02:04Z a-s 15.0 +unit-metered-0 2016-08-22T12:02:04Z b-s 10.0 +unit-metered-0 2016-08-22T12:02:04Z c-s 5.0 +`) +} + +func (s *metricsSuite) TestDefaultTabulatFormat(c *gc.C) { + s.client.metrics = []params.MetricResult{{ + Unit: "unit-metered-0", Key: "pongs", Value: "15.0", Time: time.Date(2016, 8, 22, 12, 02, 04, 0, time.UTC), + }, { + Unit: "unit-metered-0", + Key: "pings", + Value: "5.0", + Time: time.Date(2016, 8, 22, 12, 02, 03, 0, time.UTC), }} ctx, err := coretesting.RunCommand(c, metricsdebug.New(), "metered/0") c.Assert(err, jc.ErrorIsNil) diff -Nru juju-core-2.0.0/src/github.com/juju/juju/cmd/juju/model/defaultscommand.go juju-core-2.0.2/src/github.com/juju/juju/cmd/juju/model/defaultscommand.go --- juju-core-2.0.0/src/github.com/juju/juju/cmd/juju/model/defaultscommand.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/cmd/juju/model/defaultscommand.go 2016-11-11 00:08:09.000000000 +0000 @@ -217,7 +217,13 @@ // set args. return c.handleSetArgs(args) case len(args) == 0: - c.action = c.getDefaults + if len(c.resetKeys) == 0 { + // If there's no positional args and reset is not set then we're + // getting all attrs. + c.action = c.getDefaults + return nil + } + // Reset only. return nil case len(args) == 1: // We want to get settings for the provided key. @@ -519,6 +525,11 @@ return errors.New(msg) } } + if c.regionName != "" && len(attrs) == 0 { + return errors.New(fmt.Sprintf( + "there are no default model values in region %q", c.regionName)) + } + // If c.keys is empty, write out the whole lot. return c.out.Write(ctx, attrs) } diff -Nru juju-core-2.0.0/src/github.com/juju/juju/cmd/juju/model/defaultscommand_test.go juju-core-2.0.2/src/github.com/juju/juju/cmd/juju/model/defaultscommand_test.go --- juju-core-2.0.0/src/github.com/juju/juju/cmd/juju/model/defaultscommand_test.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/cmd/juju/model/defaultscommand_test.go 2016-11-11 00:08:09.000000000 +0000 @@ -229,16 +229,17 @@ } func (s *DefaultsCommandSuite) TestResetUnknownValueLogs(c *gc.C) { - _, err := s.run(c, "--reset", "attr,weird") + ctx, err := s.run(c, "--reset", "attr,weird") c.Assert(err, jc.ErrorIsNil) expected := `key "weird" is not defined in the known model configuration: possible misspelling` c.Check(c.GetTestLog(), jc.Contains, expected) + c.Check(testing.Stdout(ctx), jc.DeepEquals, "") } func (s *DefaultsCommandSuite) TestResetAttr(c *gc.C) { - _, err := s.run(c, "--reset", "attr,unknown") - c.Assert(err, jc.ErrorIsNil) - c.Assert(s.fakeDefaultsAPI.defaults, jc.DeepEquals, config.ModelDefaultAttributes{ + ctx, err := s.run(c, "--reset", "attr,unknown") + c.Check(err, jc.ErrorIsNil) + c.Check(s.fakeDefaultsAPI.defaults, jc.DeepEquals, config.ModelDefaultAttributes{ "attr2": {Controller: "bar", Default: nil, Regions: []config.RegionDefaultValue{{ Name: "dummy-region", Value: "dummy-value", @@ -247,6 +248,22 @@ Value: "another-value", }}}, }) + c.Check(testing.Stdout(ctx), jc.DeepEquals, "") +} + +func (s *DefaultsCommandSuite) TestResetRegionAttr(c *gc.C) { + ctx, err := s.run(c, "--reset", "attr,unknown", "dummy-region") + c.Check(err, jc.ErrorIsNil) + c.Check(s.fakeDefaultsAPI.defaults, jc.DeepEquals, config.ModelDefaultAttributes{ + "attr2": {Controller: "bar", Default: nil, Regions: []config.RegionDefaultValue{{ + Name: "dummy-region", + Value: "dummy-value", + }, { + Name: "another-region", + Value: "another-value", + }}}, + }) + c.Check(testing.Stdout(ctx), jc.DeepEquals, "") } func (s *DefaultsCommandSuite) TestResetBlockedError(c *gc.C) { @@ -381,3 +398,17 @@ " dummy-region dummy-value -" c.Assert(output, gc.Equals, expected) } + +func (s *DefaultsCommandSuite) TestGetRegionNoValuesTabular(c *gc.C) { + _, err := s.run(c, "--reset", "attr2") + c.Assert(err, jc.ErrorIsNil) + ctx, err := s.run(c, "dummy-region") + c.Assert(err, gc.ErrorMatches, `there are no default model values in region "dummy-region"`) + c.Assert(testing.Stdout(ctx), gc.Equals, "") +} + +func (s *DefaultsCommandSuite) TestGetRegionOneArgNoValuesTabular(c *gc.C) { + ctx, err := s.run(c, "dummy-region", "attr") + c.Assert(err, gc.ErrorMatches, `there are no default model values for "attr" in region "dummy-region"`) + c.Assert(testing.Stdout(ctx), gc.Equals, "") +} diff -Nru juju-core-2.0.0/src/github.com/juju/juju/cmd/juju/model/grantrevoke.go juju-core-2.0.2/src/github.com/juju/juju/cmd/juju/model/grantrevoke.go --- juju-core-2.0.0/src/github.com/juju/juju/cmd/juju/model/grantrevoke.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/cmd/juju/model/grantrevoke.go 2016-11-11 00:08:09.000000000 +0000 @@ -21,6 +21,16 @@ Users with read access are limited in what they can do with models: ` + "`juju models`, `juju machines`, and `juju status`" + `. +Valid access levels for models are: + read + write + admin + +Valid access levels for controllers are: + login + add-model + superuser + Examples: Grant user 'joe' 'read' access to model 'mymodel': @@ -38,16 +48,6 @@ juju grant maria add-model -Valid access levels for models are: - read - write - admin - -Valid access levels for controllers are: - login - add-model - superuser - See also: revoke add-user` diff -Nru juju-core-2.0.0/src/github.com/juju/juju/cmd/juju/romulus/setplan/set_plan.go juju-core-2.0.2/src/github.com/juju/juju/cmd/juju/romulus/setplan/set_plan.go --- juju-core-2.0.0/src/github.com/juju/juju/cmd/juju/romulus/setplan/set_plan.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/cmd/juju/romulus/setplan/set_plan.go 2016-11-11 00:08:09.000000000 +0000 @@ -82,7 +82,7 @@ } func (c *setPlanCommand) requestMetricCredentials(client *application.Client, ctx *cmd.Context) ([]byte, error) { - envUUID := client.ModelUUID() + modelUUID := client.ModelUUID() charmURL, err := client.GetCharmURL(c.Application) if err != nil { return nil, errors.Trace(err) @@ -96,7 +96,7 @@ if err != nil { return nil, errors.Trace(err) } - m, err := authClient.Authorize(envUUID, charmURL.String(), c.Application, c.Plan, hc.VisitWebPage) + m, err := authClient.Authorize(modelUUID, charmURL.String(), c.Application, c.Plan, hc.VisitWebPage) if err != nil { return nil, errors.Trace(err) } diff -Nru juju-core-2.0.0/src/github.com/juju/juju/cmd/juju/romulus/showbudget/show_budget.go juju-core-2.0.2/src/github.com/juju/juju/cmd/juju/romulus/showbudget/show_budget.go --- juju-core-2.0.0/src/github.com/juju/juju/cmd/juju/romulus/showbudget/show_budget.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/cmd/juju/romulus/showbudget/show_budget.go 2016-11-11 00:08:09.000000000 +0000 @@ -139,7 +139,7 @@ table.AddRow("MODEL", "SERVICES", "SPENT", "ALLOCATED", "BY", "USAGE") for _, allocation := range b.Allocations { firstLine := true - // We'll sort the service names to avoid nondeterministic + // We'll sort the application names to avoid nondeterministic // command output. services := make([]string, 0, len(allocation.Services)) for serviceName, _ := range allocation.Services { diff -Nru juju-core-2.0.0/src/github.com/juju/juju/cmd/juju/status/formatted.go juju-core-2.0.2/src/github.com/juju/juju/cmd/juju/status/formatted.go --- juju-core-2.0.0/src/github.com/juju/juju/cmd/juju/status/formatted.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/cmd/juju/status/formatted.go 2016-11-11 00:08:09.000000000 +0000 @@ -14,9 +14,10 @@ ) type formattedStatus struct { - Model modelStatus `json:"model"` - Machines map[string]machineStatus `json:"machines"` - Applications map[string]applicationStatus `json:"applications"` + Model modelStatus `json:"model"` + Machines map[string]machineStatus `json:"machines"` + Applications map[string]applicationStatus `json:"applications"` + RemoteApplications map[string]remoteApplicationStatus `json:"application-endpoints,omitempty" yaml:"application-endpoints,omitempty"` } type formattedMachineStatus struct { @@ -104,6 +105,36 @@ return applicationStatusNoMarshal(s), nil } +type remoteEndpoint struct { + Interface string `json:"interface" yaml:"interface"` + Role string `json:"role" yaml:"role"` +} + +type remoteApplicationStatus struct { + Err error `json:"-" yaml:",omitempty"` + ApplicationURL string `json:"url" yaml:"url"` + Endpoints map[string]remoteEndpoint `json:"endpoints,omitempty" yaml:"endpoints,omitempty"` + Life string `json:"life,omitempty" yaml:"life,omitempty"` + StatusInfo statusInfoContents `json:"application-status,omitempty" yaml:"application-status"` + Relations map[string][]string `json:"relations,omitempty" yaml:"relations,omitempty"` +} + +type remoteApplicationStatusNoMarshal remoteApplicationStatus + +func (s remoteApplicationStatus) MarshalJSON() ([]byte, error) { + if s.Err != nil { + return json.Marshal(errorStatus{s.Err.Error()}) + } + return json.Marshal(remoteApplicationStatusNoMarshal(s)) +} + +func (s remoteApplicationStatus) MarshalYAML() (interface{}, error) { + if s.Err != nil { + return errorStatus{s.Err.Error()}, nil + } + return remoteApplicationStatusNoMarshal(s), nil +} + type meterStatus struct { Color string `json:"color,omitempty" yaml:"color,omitempty"` Message string `json:"message,omitempty" yaml:"message,omitempty"` diff -Nru juju-core-2.0.0/src/github.com/juju/juju/cmd/juju/status/formatter.go juju-core-2.0.2/src/github.com/juju/juju/cmd/juju/status/formatter.go --- juju-core-2.0.0/src/github.com/juju/juju/cmd/juju/status/formatter.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/cmd/juju/status/formatter.go 2016-11-11 00:08:09.000000000 +0000 @@ -60,8 +60,9 @@ AvailableVersion: sf.status.Model.AvailableVersion, Migration: sf.status.Model.Migration, }, - Machines: make(map[string]machineStatus), - Applications: make(map[string]applicationStatus), + Machines: make(map[string]machineStatus), + Applications: make(map[string]applicationStatus), + RemoteApplications: make(map[string]remoteApplicationStatus), } for k, m := range sf.status.Machines { out.Machines[k] = sf.formatMachine(m) @@ -69,6 +70,9 @@ for sn, s := range sf.status.Applications { out.Applications[sn] = sf.formatApplication(sn, s) } + for sn, s := range sf.status.RemoteApplications { + out.RemoteApplications[sn] = sf.formatRemoteApplication(sn, s) + } return out, nil } @@ -161,7 +165,7 @@ CanUpgradeTo: application.CanUpgradeTo, SubordinateTo: application.SubordinateTo, Units: make(map[string]unitStatus), - StatusInfo: sf.getServiceStatusInfo(application), + StatusInfo: sf.getApplicationStatusInfo(application), Version: application.WorkloadVersion, } for k, m := range application.Units { @@ -175,16 +179,48 @@ return out } -func (sf *statusFormatter) getServiceStatusInfo(service params.ApplicationStatus) statusInfoContents { +func (sf *statusFormatter) formatRemoteApplication(name string, application params.RemoteApplicationStatus) remoteApplicationStatus { + out := remoteApplicationStatus{ + Err: application.Err, + ApplicationURL: application.ApplicationURL, + Life: application.Life, + Relations: application.Relations, + StatusInfo: sf.getRemoteApplicationStatusInfo(application), + } + out.Endpoints = make(map[string]remoteEndpoint) + for _, ep := range application.Endpoints { + out.Endpoints[ep.Name] = remoteEndpoint{ + Interface: ep.Interface, + Role: string(ep.Role), + } + } + return out +} + +func (sf *statusFormatter) getApplicationStatusInfo(application params.ApplicationStatus) statusInfoContents { + // TODO(perrito66) add status validation. + info := statusInfoContents{ + Err: application.Status.Err, + Current: status.Status(application.Status.Status), + Message: application.Status.Info, + Version: application.Status.Version, + } + if application.Status.Since != nil { + info.Since = common.FormatTime(application.Status.Since, sf.isoTime) + } + return info +} + +func (sf *statusFormatter) getRemoteApplicationStatusInfo(application params.RemoteApplicationStatus) statusInfoContents { // TODO(perrito66) add status validation. info := statusInfoContents{ - Err: service.Status.Err, - Current: status.Status(service.Status.Status), - Message: service.Status.Info, - Version: service.Status.Version, + Err: application.Status.Err, + Current: status.Status(application.Status.Status), + Message: application.Status.Info, + Version: application.Status.Version, } - if service.Status.Since != nil { - info.Since = common.FormatTime(service.Status.Since, sf.isoTime) + if application.Status.Since != nil { + info.Since = common.FormatTime(application.Status.Since, sf.isoTime) } return info } diff -Nru juju-core-2.0.0/src/github.com/juju/juju/cmd/juju/status/output_summary.go juju-core-2.0.2/src/github.com/juju/juju/cmd/juju/status/output_summary.go --- juju-core-2.0.0/src/github.com/juju/juju/cmd/juju/status/output_summary.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/cmd/juju/status/output_summary.go 2016-11-11 00:08:09.000000000 +0000 @@ -30,6 +30,7 @@ // - Units: Displays total #, and then # in each state. // - Applications: Displays total #, their names, and how many of each // are exposed. +// - RemoteApplications: Displays total #, their names and URLs. func FormatSummary(writer io.Writer, value interface{}) error { fs, valueConverted := value.(formattedStatus) if !valueConverted { @@ -61,6 +62,13 @@ s := svcExposure[svcName] p(svcName, fmt.Sprintf("%d/%d\texposed", s[true], s[true]+s[false])) } + p(" ") + + p("# Remote:", fmt.Sprintf("(%d)", len(fs.RemoteApplications))) + for _, svcName := range utils.SortStringsNaturally(stringKeysFromMap(fs.RemoteApplications)) { + s := fs.RemoteApplications[svcName] + p(svcName, "", s.ApplicationURL) + } f.tw.Flush() return nil diff -Nru juju-core-2.0.0/src/github.com/juju/juju/cmd/juju/status/output_tabular.go juju-core-2.0.2/src/github.com/juju/juju/cmd/juju/status/output_tabular.go --- juju-core-2.0.0/src/github.com/juju/juju/cmd/juju/status/output_tabular.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/cmd/juju/status/output_tabular.go 2016-11-11 00:08:09.000000000 +0000 @@ -17,6 +17,7 @@ "gopkg.in/juju/charm.v6-unstable/hooks" "github.com/juju/juju/cmd/output" + "github.com/juju/juju/core/crossmodel" "github.com/juju/juju/instance" "github.com/juju/juju/status" ) @@ -117,6 +118,31 @@ p(header...) p(values...) + if len(fs.RemoteApplications) > 0 { + outputHeaders("SAAS name", "Status", "Store", "URL", "Interfaces") + for _, svcName := range utils.SortStringsNaturally(stringKeysFromMap(fs.RemoteApplications)) { + svc := fs.RemoteApplications[svcName] + var store, urlPath string + url, err := crossmodel.ParseApplicationURL(svc.ApplicationURL) + if err == nil { + store = url.Directory + urlPath = url.Path() + } else { + // This is not expected. + logger.Errorf("invalid application URL %q: %v", svc.ApplicationURL, err) + store = "unknown" + urlPath = svc.ApplicationURL + } + interfaces := make([]string, len(svc.Endpoints)) + for i, name := range utils.SortStringsNaturally(stringKeysFromMap(svc.Endpoints)) { + ep := svc.Endpoints[name] + interfaces[i] = fmt.Sprintf("%s:%s", ep.Interface, name) + } + p(svcName, svc.StatusInfo.Current, store, urlPath, strings.Join(interfaces, ", ")) + } + tw.Flush() + } + units := make(map[string]unitStatus) metering := false relations := newRelationFormatter() diff -Nru juju-core-2.0.0/src/github.com/juju/juju/cmd/juju/status/status_test.go juju-core-2.0.2/src/github.com/juju/juju/cmd/juju/status/status_test.go --- juju-core-2.0.0/src/github.com/juju/juju/cmd/juju/status/status_test.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/cmd/juju/status/status_test.go 2016-11-11 00:08:09.000000000 +0000 @@ -2636,6 +2636,82 @@ }, }, ), + test( // 23 + "a remote application", + addMachine{machineId: "0", job: state.JobManageModel}, + setAddresses{"0", network.NewAddresses("10.0.0.1")}, + startAliveMachine{"0"}, + setMachineStatus{"0", status.Started, ""}, + addMachine{machineId: "1", job: state.JobHostUnits}, + setAddresses{"1", network.NewAddresses("10.0.1.1")}, + startAliveMachine{"1"}, + setMachineStatus{"1", status.Started, ""}, + + addCharm{"wordpress"}, + addService{name: "wordpress", charm: "wordpress"}, + addAliveUnit{"wordpress", "1"}, + + addCharm{"mysql"}, + addRemoteApplication{name: "hosted-mysql", url: "local:/u/me/mysql", charm: "mysql", endpoints: []string{"server"}}, + relateServices{"wordpress", "hosted-mysql"}, + + expect{ + "a remote application", + M{ + "model": model, + "machines": M{ + "0": machine0, + "1": machine1, + }, + "application-endpoints": M{ + "hosted-mysql": M{ + "url": "local:/u/me/mysql", + "endpoints": M{ + "server": M{ + "interface": "mysql", + "role": "provider", + }, + }, + "application-status": M{ + "current": "unknown", + "message": "waiting for remote connection", + "since": "01 Apr 15 01:23+10:00", + }, + "relations": M{ + "server": L{"wordpress"}, + }, + }, + }, + "applications": M{ + "wordpress": wordpressCharm(M{ + "application-status": M{ + "current": "waiting", + "message": "waiting for machine", + "since": "01 Apr 15 01:23+10:00", + }, + "relations": M{ + "db": L{"hosted-mysql"}, + }, + "units": M{ + "wordpress/0": M{ + "machine": "1", + "workload-status": M{ + "current": "waiting", + "message": "waiting for machine", + "since": "01 Apr 15 01:23+10:00", + }, + "juju-status": M{ + "current": "allocating", + "since": "01 Apr 15 01:23+10:00", + }, + "public-address": "10.0.1.1", + }, + }, + }), + }, + }, + }, + ), } func mysqlCharm(extras M) M { @@ -2901,6 +2977,29 @@ } } +type addRemoteApplication struct { + name string + url string + charm string + endpoints []string +} + +func (as addRemoteApplication) step(c *gc.C, ctx *context) { + ch, ok := ctx.charms[as.charm] + c.Assert(ok, jc.IsTrue) + var endpoints []charm.Relation + for _, ep := range as.endpoints { + r, ok := ch.Meta().Requires[ep] + if !ok { + r, ok = ch.Meta().Provides[ep] + } + c.Assert(ok, jc.IsTrue) + endpoints = append(endpoints, r) + } + _, err := ctx.st.AddRemoteApplication(as.name, as.url, endpoints) + c.Assert(err, jc.ErrorIsNil) +} + type setServiceExposed struct { name string exposed bool @@ -3439,6 +3538,8 @@ addCharm{"wordpress"}, addCharm{"mysql"}, addCharm{"logging"}, + addCharm{"riak"}, + addRemoteApplication{name: "hosted-riak", url: "local:/u/me/riak", charm: "riak", endpoints: []string{"endpoint"}}, addService{name: "wordpress", charm: "wordpress"}, setServiceExposed{"wordpress", true}, addMachine{machineId: "1", job: state.JobHostUnits}, @@ -3489,6 +3590,9 @@ logging 1/1 exposed mysql 1/1 exposed wordpress 1/1 exposed + + # Remote: (1) + hosted-riak local:/u/me/riak `[1:]) } @@ -3581,6 +3685,8 @@ addCharm{"wordpress"}, addCharm{"mysql"}, addCharm{"logging"}, + addCharm{"riak"}, + addRemoteApplication{name: "hosted-riak", url: "local:/u/me/riak", charm: "riak", endpoints: []string{"endpoint"}}, addService{name: "wordpress", charm: "wordpress"}, setServiceExposed{"wordpress", true}, addMachine{machineId: "1", job: state.JobHostUnits}, @@ -3642,6 +3748,9 @@ Model Controller Cloud/Region Version Notes controller kontroll dummy/dummy-region 1.2.3 upgrade available: 1.2.4 +SAAS name Status Store URL Interfaces +hosted-riak unknown local u/me/riak http:endpoint + App Version Status Scale Charm Store Rev OS Notes logging a bit too lo... error 2 logging jujucharms 1 ubuntu exposed mysql 5.7.13 maintenance 1 mysql jujucharms 1 ubuntu exposed @@ -4340,7 +4449,8 @@ Containers: map[string]machineStatus{}, }, }, - Applications: map[string]applicationStatus{}, + Applications: map[string]applicationStatus{}, + RemoteApplications: map[string]remoteApplicationStatus{}, }) } diff -Nru juju-core-2.0.0/src/github.com/juju/juju/cmd/juju/user/logout_test.go juju-core-2.0.2/src/github.com/juju/juju/cmd/juju/user/logout_test.go --- juju-core-2.0.0/src/github.com/juju/juju/cmd/juju/user/logout_test.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/cmd/juju/user/logout_test.go 2016-11-11 00:08:09.000000000 +0000 @@ -13,7 +13,6 @@ "github.com/juju/errors" "github.com/juju/persistent-cookiejar" jc "github.com/juju/testing/checkers" - "github.com/juju/utils" gc "gopkg.in/check.v1" "github.com/juju/juju/cmd/juju/user" @@ -62,7 +61,7 @@ } func (s *LogoutCommandSuite) TestLogout(c *gc.C) { - cookiefile := filepath.Join(utils.Home(), ".go-cookies") + cookiefile := filepath.Join(c.MkDir(), ".go-cookies") jar, err := cookiejar.New(&cookiejar.Options{Filename: cookiefile}) c.Assert(err, jc.ErrorIsNil) cont, err := s.store.CurrentController() diff -Nru juju-core-2.0.0/src/github.com/juju/juju/core/crossmodel/applicationdirectory.go juju-core-2.0.2/src/github.com/juju/juju/core/crossmodel/applicationdirectory.go --- juju-core-2.0.0/src/github.com/juju/juju/core/crossmodel/applicationdirectory.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/core/crossmodel/applicationdirectory.go 2016-11-11 00:08:09.000000000 +0000 @@ -0,0 +1,41 @@ +// Copyright 2015 Canonical Ltd. +// Licensed under the AGPLv3, see LICENCE file for details. + +package crossmodel + +import ( + "github.com/juju/errors" +) + +type ApplicationOfferLister interface { + // ListOffers returns the offers from the specified directory satisfying the specified filter. + ListOffers(directory string, filter ...ApplicationOfferFilter) ([]ApplicationOffer, error) +} + +// ApplicationOfferForURL returns a application offer for the specified URL +// so long as the specified user has been granted access to use that offer. +func ApplicationOfferForURL(offers ApplicationOfferLister, urlStr string, user string) (ApplicationOffer, error) { + url, err := ParseApplicationURL(urlStr) + if err != nil { + return ApplicationOffer{}, err + } + results, err := offers.ListOffers( + url.Directory, + ApplicationOfferFilter{ + ApplicationOffer: ApplicationOffer{ + ApplicationURL: urlStr, + }, + AllowedUsers: []string{user}, + }, + ) + if err != nil { + return ApplicationOffer{}, errors.Trace(err) + } + if len(results) == 0 { + return ApplicationOffer{}, errors.NotFoundf("application offer at %q", url) + } + if len(results) != 1 { + return ApplicationOffer{}, errors.Errorf("expected 1 result, got %d", len(results)) + } + return results[0], nil +} diff -Nru juju-core-2.0.0/src/github.com/juju/juju/core/crossmodel/applicationdirectory_test.go juju-core-2.0.2/src/github.com/juju/juju/core/crossmodel/applicationdirectory_test.go --- juju-core-2.0.0/src/github.com/juju/juju/core/crossmodel/applicationdirectory_test.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/core/crossmodel/applicationdirectory_test.go 2016-11-11 00:08:09.000000000 +0000 @@ -0,0 +1,46 @@ +// Copyright 2015 Canonical Ltd. +// Licensed under the AGPLv3, see LICENCE file for details. + +package crossmodel_test + +import ( + "github.com/juju/errors" + jc "github.com/juju/testing/checkers" + gc "gopkg.in/check.v1" + + "github.com/juju/juju/core/crossmodel" + "github.com/juju/juju/testing" +) + +type applicationDirectorySuite struct { + testing.BaseSuite +} + +var _ = gc.Suite(&applicationDirectorySuite{}) + +type mockApplicationOfferLister struct { + results []crossmodel.ApplicationOffer +} + +func (m *mockApplicationOfferLister) ListOffers(directory string, filter ...crossmodel.ApplicationOfferFilter) ([]crossmodel.ApplicationOffer, error) { + return m.results, nil +} + +func (s *applicationDirectorySuite) TestServiceForURL(c *gc.C) { + offers := []crossmodel.ApplicationOffer{ + { + ApplicationURL: "local:/u/user/applicationname", + ApplicationName: "application", + }, + } + offerLister := &mockApplicationOfferLister{offers} + result, err := crossmodel.ApplicationOfferForURL(offerLister, "local:/u/user/applicationname", "foo") + c.Assert(err, jc.ErrorIsNil) + c.Assert(result, jc.DeepEquals, offers[0]) +} + +func (s *applicationDirectorySuite) TestServiceForURLNoneOrNoAccess(c *gc.C) { + offerLister := &mockApplicationOfferLister{[]crossmodel.ApplicationOffer{}} + _, err := crossmodel.ApplicationOfferForURL(offerLister, "local:/u/user/applicationname", "foo") + c.Assert(err, jc.Satisfies, errors.IsNotFound) +} diff -Nru juju-core-2.0.0/src/github.com/juju/juju/core/crossmodel/applicationurl.go juju-core-2.0.2/src/github.com/juju/juju/core/crossmodel/applicationurl.go --- juju-core-2.0.0/src/github.com/juju/juju/core/crossmodel/applicationurl.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/core/crossmodel/applicationurl.go 2016-11-11 00:08:09.000000000 +0000 @@ -0,0 +1,188 @@ +// Copyright 2015 Canonical Ltd. +// Licensed under the AGPLv3, see LICENCE file for details. + +package crossmodel + +import ( + "fmt" + gourl "net/url" + "strings" + + "github.com/juju/errors" + "gopkg.in/juju/names.v2" +) + +// ApplicationURL represents the location of an offered application and its +// associated exported endpoints. +type ApplicationURL struct { + // Directory represents where the offer is hosted. + Directory string // "local" or "" + + // User is the user whose namespace in which the offer is made. + User string + + // ModelName is the name of the model providing the exported endpoints. + // It is only used for local URLs. + ModelName string + + // ApplicationName is the name of the application providing the exported endpoints. + ApplicationName string +} + +// Path returns the path component of the URL. +func (u *ApplicationURL) Path() string { + var parts []string + if u.User != "" { + parts = append(parts, "u", u.User) + } + if u.Directory == "local" && u.ModelName != "" { + parts = append(parts, u.ModelName) + } + parts = append(parts, u.ApplicationName) + return strings.Join(parts, "/") +} + +func (u *ApplicationURL) String() string { + return fmt.Sprintf("%s:/%s", u.Directory, u.Path()) +} + +var supportedURLDirectories = []string{ + // TODO(wallyworld): just support local for now. + "local", // for applications hosted by a local application directory +} + +// ParseApplicationURL parses the specified URL string into a ApplicationURL. +// The URL string is of one of the forms: +// local:/u// +// local:/u/// +// :/u// +func ParseApplicationURL(urlStr string) (*ApplicationURL, error) { + url, err := gourl.Parse(urlStr) + if err != nil { + return nil, errors.Errorf("cannot parse application URL: %q", urlStr) + } + if url.RawQuery != "" || url.Fragment != "" || url.User != nil { + return nil, errors.Errorf("application URL %q has unrecognized parts", urlStr) + } + + var result ApplicationURL + if url.Scheme == "" { + url.Scheme = "local" + } + if url.Scheme != "" { + result.Directory = url.Scheme + } + urlPath := strings.Trim(url.Path, "/") + parts := strings.Split(urlPath, "/") + if len(parts) < 1 || len(parts) > 4 { + return nil, fmt.Errorf("application URL has invalid form: %q", urlStr) + } + + // User + if parts[0] != "u" { + return nil, fmt.Errorf("application URL has invalid form, missing %q: %q", "/u/", urlStr) + } + if !names.IsValidUser(parts[1]) { + return nil, errors.NotValidf("user name %q", parts[1]) + } + result.User = parts[1] + + // Application name + if len(parts) < 3 { + return nil, fmt.Errorf("application URL has invalid form, missing application name: %q", urlStr) + } + + // Figure out what URL parts we have. + envPart := -1 + applicationPart := 2 + if len(parts) == 4 { + envPart = 2 + applicationPart = 3 + } + + if envPart > 0 { + result.ModelName = parts[envPart] + } + + if !names.IsValidApplication(parts[applicationPart]) { + return nil, errors.NotValidf("application name %q", parts[applicationPart]) + } + result.ApplicationName = parts[applicationPart] + return &result, nil +} + +// ApplicationDirectoryForURL returns a application directory name, used to look up applications, +// based on the specified URL. +func ApplicationDirectoryForURL(urlStr string) (string, error) { + url, err := ParseApplicationURL(urlStr) + if err != nil { + return "", err + } + return url.Directory, nil +} + +// ApplicationURLParts contains various attributes of a URL. +type ApplicationURLParts ApplicationURL + +// ParseApplicationURLParts parses a partial URL, filling out what parts are supplied. +// TODO(wallyworld) update ParseApplicationURL to use this method and perform additional validation on top. +func ParseApplicationURLParts(urlStr string) (*ApplicationURLParts, error) { + url, err := gourl.Parse(urlStr) + if err != nil { + return nil, errors.Errorf("cannot parse application URL: %q", urlStr) + } + if url.RawQuery != "" || url.Fragment != "" || url.User != nil { + return nil, errors.Errorf("application URL %q has unrecognized parts", urlStr) + } + + var result ApplicationURLParts + if url.Scheme != "" { + result.Directory = url.Scheme + } + urlPath := strings.Trim(url.Path, "/") + parts := strings.Split(urlPath, "/") + + if len(parts) < 2 { + switch len(parts) { + case 1: + result.ApplicationName = parts[0] + } + return &result, nil + } + + if parts[0] == "u" { + if !names.IsValidUser(parts[1]) { + return nil, errors.NotValidf("user name %q", parts[1]) + } + result.User = parts[1] + } else { + if len(parts) > 2 { + return nil, fmt.Errorf("application URL has too many parts: %q", urlStr) + } + result.ModelName = parts[0] + result.ApplicationName = parts[1] + return &result, nil + } + + if len(parts) == 2 { + return &result, nil + } + + // Figure out what other URL parts we have. + envPart := -1 + applicationPart := 2 + if len(parts) == 4 { + envPart = 2 + applicationPart = 3 + } + + if envPart > 0 { + result.ModelName = parts[envPart] + } + + if !names.IsValidApplication(parts[applicationPart]) { + return nil, errors.NotValidf("application name %q", parts[applicationPart]) + } + result.ApplicationName = parts[applicationPart] + return &result, nil +} diff -Nru juju-core-2.0.0/src/github.com/juju/juju/core/crossmodel/applicationurl_test.go juju-core-2.0.2/src/github.com/juju/juju/core/crossmodel/applicationurl_test.go --- juju-core-2.0.0/src/github.com/juju/juju/core/crossmodel/applicationurl_test.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/core/crossmodel/applicationurl_test.go 2016-11-11 00:08:09.000000000 +0000 @@ -0,0 +1,157 @@ +// Copyright 2015 Canonical Ltd. +// Licensed under the LGPLv3, see LICENCE file for details. + +package crossmodel_test + +import ( + "fmt" + "regexp" + "strings" + + jc "github.com/juju/testing/checkers" + gc "gopkg.in/check.v1" + + "github.com/juju/juju/core/crossmodel" +) + +type ApplicationURLSuite struct{} + +var _ = gc.Suite(&ApplicationURLSuite{}) + +var urlTests = []struct { + s, err string + exact string + url *crossmodel.ApplicationURL +}{{ + s: "local:/u/user/applicationname", + url: &crossmodel.ApplicationURL{"local", "user", "", "applicationname"}, +}, { + s: "u/user/applicationname", + url: &crossmodel.ApplicationURL{"local", "user", "", "applicationname"}, + exact: "local:/u/user/applicationname", +}, { + s: "u/user/prod/applicationname", + url: &crossmodel.ApplicationURL{"local", "user", "prod", "applicationname"}, + exact: "local:/u/user/prod/applicationname", +}, { + s: "local:application", + err: `application URL has invalid form, missing "/u/": $URL`, +}, { + s: "local:user/application", + err: `application URL has invalid form, missing "/u/": $URL`, +}, { + s: "local:/u/user", + err: `application URL has invalid form, missing application name: $URL`, +}, { + s: "application", + err: `application URL has invalid form, missing "/u/": $URL`, +}, { + s: "/user/application", + err: `application URL has invalid form, missing "/u/": $URL`, +}, { + s: "/u/user", + err: `application URL has invalid form, missing application name: $URL`, +}, { + s: "local:/u/user/application.bad", + err: `application name "application.bad" not valid`, +}, { + s: "local:/u/user[bad/application", + err: `user name "user\[bad" not valid`, +}, { + s: ":foo", + err: `cannot parse application URL: $URL`, +}, { + s: "local:/u/fred/prod/foo/db2", + err: `application URL has invalid form: $URL`, +}} + +func (s *ApplicationURLSuite) TestParseURL(c *gc.C) { + for i, t := range urlTests { + c.Logf("test %d: %q", i, t.s) + url, err := crossmodel.ParseApplicationURL(t.s) + + match := t.s + if t.exact != "" { + match = t.exact + } + if t.url != nil { + c.Assert(err, gc.IsNil) + c.Assert(url, gc.DeepEquals, t.url) + c.Check(url.String(), gc.Equals, match) + } + if t.err != "" { + t.err = strings.Replace(t.err, "$URL", regexp.QuoteMeta(fmt.Sprintf("%q", t.s)), -1) + c.Assert(err, gc.ErrorMatches, t.err) + c.Assert(url, gc.IsNil) + } + } +} + +func (s *ApplicationURLSuite) TestServiceDirectoryForURL(c *gc.C) { + dir, err := crossmodel.ApplicationDirectoryForURL("local:/u/me/application") + c.Assert(err, jc.ErrorIsNil) + c.Assert(dir, gc.Equals, "local") +} + +func (s *ApplicationURLSuite) TestServiceDirectoryForURLError(c *gc.C) { + _, err := crossmodel.ApplicationDirectoryForURL("error") + c.Assert(err, gc.ErrorMatches, "application URL has invalid form.*") +} + +var urlPartsTests = []struct { + s, err string + url *crossmodel.ApplicationURLParts +}{{ + s: "local:/u/user/applicationname", + url: &crossmodel.ApplicationURLParts{"local", "user", "", "applicationname"}, +}, { + s: "u/user/applicationname", + url: &crossmodel.ApplicationURLParts{"", "user", "", "applicationname"}, +}, { + s: "u/user/prod/applicationname", + url: &crossmodel.ApplicationURLParts{"", "user", "prod", "applicationname"}, +}, { + s: "u/user", + url: &crossmodel.ApplicationURLParts{"", "user", "", ""}, +}, { + s: "application", + url: &crossmodel.ApplicationURLParts{"", "", "", "application"}, +}, { + s: "prod/application", + url: &crossmodel.ApplicationURLParts{"", "", "prod", "application"}, +}, { + s: "local:/application", + url: &crossmodel.ApplicationURLParts{"local", "", "", "application"}, +}, { + s: "", + url: &crossmodel.ApplicationURLParts{}, +}, { + s: "a/b/c", + err: `application URL has too many parts: "a/b/c"`, +}, { + s: "local:/u/user/application.bad", + err: `application name "application.bad" not valid`, +}, { + s: "local:/u/user[bad/application", + err: `user name "user\[bad" not valid`, +}, { + s: ":foo", + err: `cannot parse application URL: $URL`, +}} + +func (s *ApplicationURLSuite) TestParseURLParts(c *gc.C) { + for i, t := range urlPartsTests { + c.Logf("test %d: %q", i, t.s) + url, err := crossmodel.ParseApplicationURLParts(t.s) + + if t.url != nil { + c.Check(err, gc.IsNil) + c.Check(url, gc.DeepEquals, t.url) + } + if t.err != "" { + t.err = strings.Replace(t.err, "$URL", regexp.QuoteMeta(fmt.Sprintf("%q", t.s)), -1) + c.Assert(err, gc.ErrorMatches, t.err) + c.Assert(url, gc.IsNil) + } + } +} diff -Nru juju-core-2.0.0/src/github.com/juju/juju/core/crossmodel/interface.go juju-core-2.0.2/src/github.com/juju/juju/core/crossmodel/interface.go --- juju-core-2.0.0/src/github.com/juju/juju/core/crossmodel/interface.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/core/crossmodel/interface.go 2016-11-11 00:08:09.000000000 +0000 @@ -0,0 +1,159 @@ +// Copyright 2015 Canonical Ltd. +// Licensed under the AGPLv3, see LICENCE file for details. + +package crossmodel + +import ( + "fmt" + + "gopkg.in/juju/charm.v6-unstable" +) + +// ApplicationOffer represents the state of an application hosted +// in an external (remote) model. +type ApplicationOffer struct { + // ApplicationURL is the URL used to locate the offer in a directory. + ApplicationURL string + + // ApplicationName is the name of the application. + ApplicationName string + + // ApplicationDescription is a description of the application's functionality, + // typically copied from the charm metadata. + ApplicationDescription string + + // Endpoints are the charm endpoints supported by the application. + Endpoints []charm.Relation + + // SourceModelUUID is the UUID of the model hosting the application. + SourceModelUUID string + + // SourceLabel is a user friendly name for the source model. + SourceLabel string +} + +// String returns the directory record name. +func (s *ApplicationOffer) String() string { + return fmt.Sprintf("%s-%s", s.SourceModelUUID, s.ApplicationName) +} + +// ApplicationOfferFilter is used to query offers in a application directory. +// We allow filtering on any of the application offer attributes plus +// users allowed to consume the application. +type ApplicationOfferFilter struct { + ApplicationOffer + + // AllowedUsers are the users allowed to consume the application. + AllowedUsers []string +} + +// An ApplicationDirectory holds application offers from external models. +type ApplicationDirectory interface { + + // AddOffer adds a new application offer to the directory. + AddOffer(offer ApplicationOffer) error + + // UpdateOffer replaces an existing offer at the same URL. + UpdateOffer(offer ApplicationOffer) error + + // ListOffers returns the offers satisfying the specified filter. + ListOffers(filter ...ApplicationOfferFilter) ([]ApplicationOffer, error) + + // Remove removes the application offer at the specified URL. + Remove(url string) error +} + +// OfferedApplication holds the details of applications offered +// by this model. +type OfferedApplication struct { + // ApplicationName is the application name. + ApplicationName string + + // ApplicationURL is the URL where the application can be located. + ApplicationURL string + + // CharmName is the name of the charm used to deploy the offered application. + CharmName string + + // Endpoints is the collection of endpoint names offered (internal->published). + // The map allows for advertised endpoint names to be aliased. + Endpoints map[string]string + + // Description is a description of the application, which by default comes + // from the charm metadata. + Description string + + // Icon is an icon to display when browsing the ApplicationDirectory, which by default + // comes from the charm. + Icon []byte + + // Registered is true if this offer is to be registered with + // the relevant application directory. + Registered bool +} + +// OfferedApplicationFilter is used to query applications offered +// by this model. +type OfferedApplicationFilter struct { + // ApplicationName is the application name. + ApplicationName string + + // CharmName is the name of the charm of the application. + CharmName string + + // ApplicationURL is the URL where the application can be located. + ApplicationURL string + + // Registered, if non-nil, returns only the offered applications + // that are registered or not. + Registered *bool + + // Endpoint contains an endpoint filter criteria. + Endpoint EndpointFilterTerm +} + +// RegisteredFilter is a helper function for creating an offered application filter. +func RegisteredFilter(registered bool) OfferedApplicationFilter { + var filter OfferedApplicationFilter + filter.Registered = ®istered + return filter +} + +// OfferedApplications instances hold application offers from this model. +type OfferedApplications interface { + + // AddOffer adds a new application offer. + AddOffer(offer OfferedApplication) error + + // UpdateOffer updates an existing application offer. + UpdateOffer(url string, endpoints map[string]string) error + + // ListOffers returns the offers satisfying the specified filter. + ListOffers(filter ...OfferedApplicationFilter) ([]OfferedApplication, error) + + // SetOfferRegistered marks a previously saved offer as registered or not. + SetOfferRegistered(url string, registered bool) error + + // RemoveOffer removes the application offer at the specified URL. + RemoveOffer(url string) error +} + +// EndpointFilterTerm represents a remote endpoint filter. +type EndpointFilterTerm struct { + // Name is an endpoint name. + Name string + + // Interface is an endpoint interface. + Interface string + + // Role is an endpoint role. + Role charm.RelationRole +} + +// RemoteApplication represents a remote application. +type RemoteApplication struct { + ApplicationOffer + + // ConnectedUsers are the users that are consuming the application. + ConnectedUsers []string +} diff -Nru juju-core-2.0.0/src/github.com/juju/juju/core/crossmodel/package_test.go juju-core-2.0.2/src/github.com/juju/juju/core/crossmodel/package_test.go --- juju-core-2.0.0/src/github.com/juju/juju/core/crossmodel/package_test.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/core/crossmodel/package_test.go 2016-11-11 00:08:09.000000000 +0000 @@ -0,0 +1,14 @@ +// Copyright 2015 Canonical Ltd. +// Licensed under the LGPLv3, see COPYING and COPYING.LESSER file for details. + +package crossmodel_test + +import ( + "testing" + + gc "gopkg.in/check.v1" +) + +func Test(t *testing.T) { + gc.TestingT(t) +} diff -Nru juju-core-2.0.0/src/github.com/juju/juju/core/crossmodel/params.go juju-core-2.0.2/src/github.com/juju/juju/core/crossmodel/params.go --- juju-core-2.0.0/src/github.com/juju/juju/core/crossmodel/params.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/core/crossmodel/params.go 2016-11-11 00:08:09.000000000 +0000 @@ -0,0 +1,37 @@ +// Copyright 2015 Canonical Ltd. +// Licensed under the AGPLv3, see LICENCE file for details. + +package crossmodel + +import ( + "gopkg.in/juju/charm.v6-unstable" +) + +// OfferedApplicationDetails represents a remote application used when vendor +// lists their own applications. +type OfferedApplicationDetails struct { + // ApplicationName is the application name. + ApplicationName string + + // ApplicationURL is the URl where the application can be located. + ApplicationURL string + + // CharmName is a name of a charm for remote application. + CharmName string + + // Endpoints are the charm endpoints supported by the application. + // TODO(wallyworld) - do not use charm.Relation here + Endpoints []charm.Relation + + // ConnectedCount are the number of users that are consuming the application. + ConnectedCount int +} + +// OfferedApplicationDetailsResult is a result of listing a remote application. +type OfferedApplicationDetailsResult struct { + // Result contains remote application information. + Result *OfferedApplicationDetails + + // Error contains error related to this item. + Error error +} diff -Nru juju-core-2.0.0/src/github.com/juju/juju/core/description/application.go juju-core-2.0.2/src/github.com/juju/juju/core/description/application.go --- juju-core-2.0.0/src/github.com/juju/juju/core/description/application.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/core/description/application.go 2016-11-11 00:08:09.000000000 +0000 @@ -13,6 +13,40 @@ "gopkg.in/juju/names.v2" ) +// Application represents a deployed charm in a model. +type Application interface { + HasAnnotations + HasConstraints + HasStatus + HasStatusHistory + + Tag() names.ApplicationTag + Name() string + Series() string + Subordinate() bool + CharmURL() string + Channel() string + CharmModifiedVersion() int + ForceCharm() bool + Exposed() bool + MinUnits() int + + EndpointBindings() map[string]string + + Settings() map[string]interface{} + + Leader() string + LeadershipSettings() map[string]interface{} + + MetricsCredentials() []byte + StorageConstraints() map[string]StorageConstraint + + Units() []Unit + AddUnit(UnitArgs) Unit + + Validate() error +} + type applications struct { Version int `yaml:"version"` Applications_ []*application `yaml:"applications"` @@ -35,6 +69,8 @@ Status_ *status `yaml:"status"` StatusHistory_ `yaml:"status-history"` + EndpointBindings_ map[string]string `yaml:"endpoint-bindings,omitempty"` + Settings_ map[string]interface{} `yaml:"settings"` Leader_ string `yaml:"leader,omitempty"` @@ -62,6 +98,7 @@ ForceCharm bool Exposed bool MinUnits int + EndpointBindings map[string]string Settings map[string]interface{} Leader string LeadershipSettings map[string]interface{} @@ -81,6 +118,7 @@ ForceCharm_: args.ForceCharm, Exposed_: args.Exposed, MinUnits_: args.MinUnits, + EndpointBindings_: args.EndpointBindings, Settings_: args.Settings, Leader_: args.Leader, LeadershipSettings_: args.LeadershipSettings, @@ -98,68 +136,73 @@ } // Tag implements Application. -func (s *application) Tag() names.ApplicationTag { - return names.NewApplicationTag(s.Name_) +func (a *application) Tag() names.ApplicationTag { + return names.NewApplicationTag(a.Name_) } // Name implements Application. -func (s *application) Name() string { - return s.Name_ +func (a *application) Name() string { + return a.Name_ } // Series implements Application. -func (s *application) Series() string { - return s.Series_ +func (a *application) Series() string { + return a.Series_ } // Subordinate implements Application. -func (s *application) Subordinate() bool { - return s.Subordinate_ +func (a *application) Subordinate() bool { + return a.Subordinate_ } // CharmURL implements Application. -func (s *application) CharmURL() string { - return s.CharmURL_ +func (a *application) CharmURL() string { + return a.CharmURL_ } // Channel implements Application. -func (s *application) Channel() string { - return s.Channel_ +func (a *application) Channel() string { + return a.Channel_ } // CharmModifiedVersion implements Application. -func (s *application) CharmModifiedVersion() int { - return s.CharmModifiedVersion_ +func (a *application) CharmModifiedVersion() int { + return a.CharmModifiedVersion_ } // ForceCharm implements Application. -func (s *application) ForceCharm() bool { - return s.ForceCharm_ +func (a *application) ForceCharm() bool { + return a.ForceCharm_ } // Exposed implements Application. -func (s *application) Exposed() bool { - return s.Exposed_ +func (a *application) Exposed() bool { + return a.Exposed_ } // MinUnits implements Application. -func (s *application) MinUnits() int { - return s.MinUnits_ +func (a *application) MinUnits() int { + return a.MinUnits_ +} + +// EndpointBindings implements Application. +func (a *application) EndpointBindings() map[string]string { + return a.EndpointBindings_ } // Settings implements Application. -func (s *application) Settings() map[string]interface{} { - return s.Settings_ +func (a *application) Settings() map[string]interface{} { + return a.Settings_ } // Leader implements Application. -func (s *application) Leader() string { - return s.Leader_ +func (a *application) Leader() string { + return a.Leader_ } // LeadershipSettings implements Application. -func (s *application) LeadershipSettings() map[string]interface{} { - return s.LeadershipSettings_ +func (a *application) LeadershipSettings() map[string]interface{} { + return a.LeadershipSettings_ } // StorageConstraints implements Application. @@ -172,95 +215,95 @@ } // MetricsCredentials implements Application. -func (s *application) MetricsCredentials() []byte { +func (a *application) MetricsCredentials() []byte { // Here we are explicitly throwing away any decode error. We check that // the creds can be decoded when we parse the incoming data, or we encode // an incoming byte array, so in both cases, we know that the stored creds // can be decoded. - creds, _ := base64.StdEncoding.DecodeString(s.MetricsCredentials_) + creds, _ := base64.StdEncoding.DecodeString(a.MetricsCredentials_) return creds } // Status implements Application. -func (s *application) Status() Status { +func (a *application) Status() Status { // To avoid typed nils check nil here. - if s.Status_ == nil { + if a.Status_ == nil { return nil } - return s.Status_ + return a.Status_ } // SetStatus implements Application. -func (s *application) SetStatus(args StatusArgs) { - s.Status_ = newStatus(args) +func (a *application) SetStatus(args StatusArgs) { + a.Status_ = newStatus(args) } // Units implements Application. -func (s *application) Units() []Unit { - result := make([]Unit, len(s.Units_.Units_)) - for i, u := range s.Units_.Units_ { +func (a *application) Units() []Unit { + result := make([]Unit, len(a.Units_.Units_)) + for i, u := range a.Units_.Units_ { result[i] = u } return result } -func (s *application) unitNames() set.Strings { +func (a *application) unitNames() set.Strings { result := set.NewStrings() - for _, u := range s.Units_.Units_ { + for _, u := range a.Units_.Units_ { result.Add(u.Name()) } return result } // AddUnit implements Application. -func (s *application) AddUnit(args UnitArgs) Unit { +func (a *application) AddUnit(args UnitArgs) Unit { u := newUnit(args) - s.Units_.Units_ = append(s.Units_.Units_, u) + a.Units_.Units_ = append(a.Units_.Units_, u) return u } -func (s *application) setUnits(unitList []*unit) { - s.Units_ = units{ +func (a *application) setUnits(unitList []*unit) { + a.Units_ = units{ Version: 1, Units_: unitList, } } // Constraints implements HasConstraints. -func (s *application) Constraints() Constraints { - if s.Constraints_ == nil { +func (a *application) Constraints() Constraints { + if a.Constraints_ == nil { return nil } - return s.Constraints_ + return a.Constraints_ } // SetConstraints implements HasConstraints. -func (s *application) SetConstraints(args ConstraintsArgs) { - s.Constraints_ = newConstraints(args) +func (a *application) SetConstraints(args ConstraintsArgs) { + a.Constraints_ = newConstraints(args) } // Validate implements Application. -func (s *application) Validate() error { - if s.Name_ == "" { +func (a *application) Validate() error { + if a.Name_ == "" { return errors.NotValidf("application missing name") } - if s.Status_ == nil { - return errors.NotValidf("application %q missing status", s.Name_) + if a.Status_ == nil { + return errors.NotValidf("application %q missing status", a.Name_) } // If leader is set, it must match one of the units. var leaderFound bool // All of the applications units should also be valid. - for _, u := range s.Units() { + for _, u := range a.Units() { if err := u.Validate(); err != nil { return errors.Trace(err) } // We know that the unit has a name, because it validated correctly. - if u.Name() == s.Leader_ { + if u.Name() == a.Leader_ { leaderFound = true } } - if s.Leader_ != "" && !leaderFound { - return errors.NotValidf("missing unit for leader %q", s.Leader_) + if a.Leader_ != "" && !leaderFound { + return errors.NotValidf("missing unit for leader %q", a.Leader_) } return nil } @@ -316,6 +359,7 @@ "exposed": schema.Bool(), "min-units": schema.Int(), "status": schema.StringMap(schema.Any()), + "endpoint-bindings": schema.StringMap(schema.String()), "settings": schema.StringMap(schema.Any()), "leader": schema.String(), "leadership-settings": schema.StringMap(schema.Any()), @@ -332,6 +376,7 @@ "leader": "", "metrics-creds": "", "storage-constraints": schema.Omit, + "endpoint-bindings": schema.Omit, } addAnnotationSchema(fields, defaults) addConstraintsSchema(fields, defaults) @@ -355,12 +400,14 @@ ForceCharm_: valid["force-charm"].(bool), Exposed_: valid["exposed"].(bool), MinUnits_: int(valid["min-units"].(int64)), + EndpointBindings_: convertToStringMap(valid["endpoint-bindings"]), Settings_: valid["settings"].(map[string]interface{}), Leader_: valid["leader"].(string), LeadershipSettings_: valid["leadership-settings"].(map[string]interface{}), StatusHistory_: newStatusHistory(), } result.importAnnotations(valid) + if err := result.importStatusHistory(valid); err != nil { return nil, errors.Trace(err) } diff -Nru juju-core-2.0.0/src/github.com/juju/juju/core/description/application_test.go juju-core-2.0.2/src/github.com/juju/juju/core/description/application_test.go --- juju-core-2.0.0/src/github.com/juju/juju/core/description/application_test.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/core/description/application_test.go 2016-11-11 00:08:09.000000000 +0000 @@ -112,6 +112,9 @@ ForceCharm: true, Exposed: true, MinUnits: 42, // no judgement is made by the migration code + EndpointBindings: map[string]string{ + "rel-name": "some-space", + }, Settings: map[string]interface{}{ "key": "value", }, @@ -133,6 +136,7 @@ c.Assert(application.ForceCharm(), jc.IsTrue) c.Assert(application.Exposed(), jc.IsTrue) c.Assert(application.MinUnits(), gc.Equals, 42) + c.Assert(application.EndpointBindings(), jc.DeepEquals, args.EndpointBindings) c.Assert(application.Settings(), jc.DeepEquals, args.Settings) c.Assert(application.Leader(), gc.Equals, "magic/1") c.Assert(application.LeadershipSettings(), jc.DeepEquals, args.LeadershipSettings) @@ -179,6 +183,17 @@ c.Assert(application, jc.DeepEquals, svc) } +func (s *ApplicationSerializationSuite) TestEndpointBindings(c *gc.C) { + args := minimalApplicationArgs() + args.EndpointBindings = map[string]string{ + "rel-name": "some-space", + "other": "other-space", + } + initial := minimalApplication(args) + application := s.exportImport(c, initial) + c.Assert(application.EndpointBindings(), jc.DeepEquals, args.EndpointBindings) +} + func (s *ApplicationSerializationSuite) TestAnnotations(c *gc.C) { initial := minimalApplication() annotations := map[string]string{ diff -Nru juju-core-2.0.0/src/github.com/juju/juju/core/description/interfaces.go juju-core-2.0.2/src/github.com/juju/juju/core/description/interfaces.go --- juju-core-2.0.0/src/github.com/juju/juju/core/description/interfaces.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/core/description/interfaces.go 2016-11-11 00:08:09.000000000 +0000 @@ -241,38 +241,6 @@ Updated() time.Time } -// Application represents a deployed charm in a model. -type Application interface { - HasAnnotations - HasConstraints - HasStatus - HasStatusHistory - - Tag() names.ApplicationTag - Name() string - Series() string - Subordinate() bool - CharmURL() string - Channel() string - CharmModifiedVersion() int - ForceCharm() bool - Exposed() bool - MinUnits() int - - Settings() map[string]interface{} - - Leader() string - LeadershipSettings() map[string]interface{} - - MetricsCredentials() []byte - StorageConstraints() map[string]StorageConstraint - - Units() []Unit - AddUnit(UnitArgs) Unit - - Validate() error -} - // Unit represents an instance of an application in a model. type Unit interface { HasAnnotations diff -Nru juju-core-2.0.0/src/github.com/juju/juju/core/description/model.go juju-core-2.0.2/src/github.com/juju/juju/core/description/model.go --- juju-core-2.0.0/src/github.com/juju/juju/core/description/model.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/core/description/model.go 2016-11-11 00:08:09.000000000 +0000 @@ -896,6 +896,7 @@ "owner": schema.String(), "cloud": schema.String(), "cloud-region": schema.String(), + "cloud-credential": schema.String(), "config": schema.StringMap(schema.Any()), "latest-tools": schema.String(), "blocks": schema.StringMap(schema.String()), @@ -918,9 +919,10 @@ } // Some values don't have to be there. defaults := schema.Defaults{ - "latest-tools": schema.Omit, - "blocks": schema.Omit, - "cloud-region": schema.Omit, + "latest-tools": schema.Omit, + "blocks": schema.Omit, + "cloud-region": "", + "cloud-credential": "", } addAnnotationSchema(fields, defaults) addConstraintsSchema(fields, defaults) @@ -935,12 +937,14 @@ // contains fields of the right type. result := &model{ - Version: 1, - Owner_: valid["owner"].(string), - Config_: valid["config"].(map[string]interface{}), - Sequences_: make(map[string]int), - Blocks_: convertToStringMap(valid["blocks"]), - Cloud_: valid["cloud"].(string), + Version: 1, + Owner_: valid["owner"].(string), + Config_: valid["config"].(map[string]interface{}), + Sequences_: make(map[string]int), + Blocks_: convertToStringMap(valid["blocks"]), + Cloud_: valid["cloud"].(string), + CloudRegion_: valid["cloud-region"].(string), + CloudCredential_: valid["cloud-credential"].(string), } result.importAnnotations(valid) sequences := valid["sequences"].(map[string]interface{}) @@ -964,14 +968,6 @@ result.LatestToolsVersion_ = num } - if region, ok := valid["cloud-region"]; ok { - result.CloudRegion_ = region.(string) - } - - if credential, ok := valid["cloud-credential"]; ok { - result.CloudCredential_ = credential.(string) - } - userMap := valid["users"].(map[string]interface{}) users, err := importUsers(userMap) if err != nil { diff -Nru juju-core-2.0.0/src/github.com/juju/juju/core/description/model_test.go juju-core-2.0.2/src/github.com/juju/juju/core/description/model_test.go --- juju-core-2.0.0/src/github.com/juju/juju/core/description/model_test.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/core/description/model_test.go 2016-11-11 00:08:09.000000000 +0000 @@ -85,6 +85,9 @@ Blocks: map[string]string{ "all-changes": "locked down", }, + Cloud: "vapour", + CloudRegion: "east-west", + CloudCredential: "cirrus", } initial := NewModel(args) adminUser := names.NewUserTag("admin@local") @@ -100,6 +103,9 @@ c.Assert(model.Owner(), gc.Equals, args.Owner) c.Assert(model.Tag().Id(), gc.Equals, "some-uuid") c.Assert(model.Config(), jc.DeepEquals, args.Config) + c.Assert(model.Cloud(), gc.Equals, "vapour") + c.Assert(model.CloudRegion(), gc.Equals, "east-west") + c.Assert(model.CloudCredential(), gc.Equals, "cirrus") c.Assert(model.LatestToolsVersion(), gc.Equals, args.LatestToolsVersion) c.Assert(model.Blocks(), jc.DeepEquals, args.Blocks) users := model.Users() diff -Nru juju-core-2.0.0/src/github.com/juju/juju/dependencies.tsv juju-core-2.0.2/src/github.com/juju/juju/dependencies.tsv --- juju-core-2.0.0/src/github.com/juju/juju/dependencies.tsv 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/dependencies.tsv 2016-11-11 00:08:09.000000000 +0000 @@ -27,8 +27,8 @@ github.com/juju/gojsonpointer git afe8b77aa08f272b49e01b82de78510c11f61500 2015-02-04T19:46:29Z github.com/juju/gojsonreference git f0d24ac5ee330baa21721cdff56d45e4ee42628e 2015-02-04T19:46:33Z github.com/juju/gojsonschema git e1ad140384f254c82f89450d9a7c8dd38a632838 2015-03-12T17:00:16Z -github.com/juju/gomaasapi git 8c484173e0870fc49c9214c56c6ae8dc9c26463d 2016-09-19T18:34:33Z -github.com/juju/govmomi git 4354a88d4b34abe467215f77c2fc1cb9f78b66f7 2015-04-24T01:54:48Z +github.com/juju/gomaasapi git f0300c96aa5e0deb3cc599ca8a8949097b955e60 2016-11-02T12:07:14Z +github.com/vmware/govmomi git c0c7ce63df7edd78e713257b924c89d9a2dac119 2016-06-30T15:37:42Z github.com/juju/httpprof git 14bf14c307672fd2456bdbf35d19cf0ccd3cf565 2014-12-17T16:00:36Z github.com/juju/httprequest git 266fd1e9debf09c037a63f074d099a2da4559ece 2016-10-06T15:09:09Z github.com/juju/idmclient git 3dda079a75cccb85083d4c3877e638f5d6ab79c2 2016-05-26T05:00:34Z @@ -43,9 +43,9 @@ github.com/juju/schema git 075de04f9b7d7580d60a1e12a0b3f50bb18e6998 2016-04-20T04:42:03Z github.com/juju/terms-client git 9b925afd677234e4146dde3cb1a11e187cbed64e 2016-08-09T13:19:00Z github.com/juju/testing git 692d58e72934a2e2b56f663259696e035e6351ff 2016-09-30T14:09:10Z -github.com/juju/txn git 18d812a45ffc407a4d5f849036b7d8d12febaf08 2016-09-13T21:23:40Z +github.com/juju/txn git af2fa2051800371a0272610882891a28c719c02c 2016-10-31T02:11:40Z github.com/juju/usso git 68a59c96c178fbbad65926e7f93db50a2cd14f33 2016-04-01T10:44:24Z -github.com/juju/utils git 406e7197d0690a3f28c5a147138774eec4c1355e 2016-09-26T13:08:26Z +github.com/juju/utils git 28c01ec2ad930d41fe5acd9969b96284eb61660b 2016-10-03T23:32:26Z github.com/juju/version git 4ae6172c00626779a5a462c3e3d22fc0e889431a 2016-06-03T19:49:58Z github.com/juju/webbrowser git 54b8c57083b4afb7dc75da7f13e2967b2606a507 2016-03-09T14:36:29Z github.com/juju/xml git eb759a627588d35166bc505fceb51b88500e291e 2015-04-13T13:11:21Z @@ -70,7 +70,7 @@ gopkg.in/amz.v3 git 18899065239e006cc73b0e66800c98c2ce4eee50 2016-10-06T07:29:34Z gopkg.in/check.v1 git 4f90aeace3a26ad7021961c297b22c42160c7b25 2016-01-05T16:49:36Z gopkg.in/errgo.v1 git 66cb46252b94c1f3d65646f54ee8043ab38d766c 2015-10-07T15:31:57Z -gopkg.in/goose.v1 git 495e6fa2ab89bc5ed2c8e1bbcbc4c9e4a3c97d37 2016-03-17T17:25:46Z +gopkg.in/goose.v1 git 328e6b224fce7ab412f62b841757be1596f3b3a8 2016-11-03T03:56:51Z gopkg.in/ini.v1 git 776aa739ce9373377cd16f526cdf06cb4c89b40f 2016-02-22T23:24:41Z gopkg.in/juju/blobstore.v2 git 51fa6e26128d74e445c72d3a91af555151cc3654 2016-01-25T02:37:03Z gopkg.in/juju/charm.v6-unstable git 83771c4919d6810bce5b7e63f46bea5fbfed0b93 2016-10-03T20:31:18Z diff -Nru juju-core-2.0.0/src/github.com/juju/juju/doc/api.txt juju-core-2.0.2/src/github.com/juju/juju/doc/api.txt --- juju-core-2.0.0/src/github.com/juju/juju/doc/api.txt 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/doc/api.txt 2016-11-11 00:08:09.000000000 +0000 @@ -116,7 +116,7 @@ UnitWatcher LifecycleWatcher ServiceUnitsWatcher - ServiceRelationsWatcher + ApplicationRelationsWatcher RelationScopeWatcher UnitsWatcher ConfigWatcher diff -Nru juju-core-2.0.0/src/github.com/juju/juju/environs/bootstrap/bootstrap.go juju-core-2.0.2/src/github.com/juju/juju/environs/bootstrap/bootstrap.go --- juju-core-2.0.0/src/github.com/juju/juju/environs/bootstrap/bootstrap.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/environs/bootstrap/bootstrap.go 2016-11-11 00:08:09.000000000 +0000 @@ -163,6 +163,23 @@ return nil } +// withDefaultControllerConstraints returns the given constraints, +// updated to choose a default instance type appropriate for a +// controller machine. We use this only if the user does not specify +// any constraints that would otherwise control the instance type +// selection. +func withDefaultControllerConstraints(cons constraints.Value) constraints.Value { + if !cons.HasInstanceType() && !cons.HasCpuCores() && !cons.HasCpuPower() && !cons.HasMem() { + // A default of 3.5GiB will result in machines with up to 4GiB of memory, eg + // - 3.75GiB on AWS, Google + // - 3.5GiB on Azure + // - 4GiB on Rackspace etc + var mem uint64 = 3.5 * 1024 + cons.Mem = &mem + } + return cons +} + // Bootstrap bootstraps the given environment. The supplied constraints are // used to provision the instance, and are also set within the bootstrapped // environment. @@ -253,6 +270,7 @@ if err != nil { return errors.Trace(err) } + bootstrapConstraints = withDefaultControllerConstraints(args.BootstrapConstraints) // The arch we use to find tools isn't the boostrapConstraints arch. // We copy the constraints arch to a separate variable and diff -Nru juju-core-2.0.0/src/github.com/juju/juju/environs/bootstrap/bootstrap_test.go juju-core-2.0.2/src/github.com/juju/juju/environs/bootstrap/bootstrap_test.go --- juju-core-2.0.0/src/github.com/juju/juju/environs/bootstrap/bootstrap_test.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/environs/bootstrap/bootstrap_test.go 2016-11-11 00:08:09.000000000 +0000 @@ -130,7 +130,8 @@ c.Assert(env.bootstrapCount, gc.Equals, 1) env.args.AvailableTools = nil c.Assert(env.args, gc.DeepEquals, environs.BootstrapParams{ - ControllerConfig: coretesting.FakeControllerConfig(), + ControllerConfig: coretesting.FakeControllerConfig(), + BootstrapConstraints: constraints.MustParse("mem=3.5G"), }) } @@ -187,6 +188,10 @@ c.Assert(env.args.Placement, gc.DeepEquals, placement) } +func intPtr(i uint64) *uint64 { + return &i +} + func (s *bootstrapSuite) TestBootstrapImage(c *gc.C) { s.PatchValue(&series.HostSeries, func() string { return "precise" }) s.PatchValue(&arch.HostArch, func() string { return arch.AMD64 }) @@ -229,7 +234,9 @@ c.Assert(env.instanceConfig.Bootstrap.CustomImageMetadata, gc.HasLen, 2) c.Assert(env.instanceConfig.Bootstrap.CustomImageMetadata[0], jc.DeepEquals, metadata[0]) c.Assert(env.instanceConfig.Bootstrap.CustomImageMetadata[1], jc.DeepEquals, env.args.ImageMetadata[0]) - c.Assert(env.instanceConfig.Bootstrap.BootstrapMachineConstraints, jc.DeepEquals, bootstrapCons) + expectedCons := bootstrapCons + expectedCons.Mem = intPtr(3584) + c.Assert(env.instanceConfig.Bootstrap.BootstrapMachineConstraints, jc.DeepEquals, expectedCons) } func (s *bootstrapSuite) TestBootstrapAddsArchFromImageToExistingProviderSupportedArches(c *gc.C) { @@ -250,7 +257,9 @@ MetadataDir: data.metadataDir, }) c.Assert(err, jc.ErrorIsNil) - s.assertBootstrapImageMetadata(c, env.bootstrapEnviron, data, bootstrapCons) + expectedCons := bootstrapCons + expectedCons.Mem = intPtr(3584) + s.assertBootstrapImageMetadata(c, env.bootstrapEnviron, data, expectedCons) } type testImageMetadata struct { @@ -329,7 +338,9 @@ MetadataDir: data.metadataDir, }) c.Assert(err, jc.ErrorIsNil) - s.assertBootstrapImageMetadata(c, env.bootstrapEnviron, data, bootstrapCons) + expectedCons := bootstrapCons + expectedCons.Mem = intPtr(3584) + s.assertBootstrapImageMetadata(c, env.bootstrapEnviron, data, expectedCons) } func (s *bootstrapSuite) setupProviderWithNoSupportedArches(c *gc.C) bootstrapEnvironNoExplicitArchitectures { diff -Nru juju-core-2.0.0/src/github.com/juju/juju/etc/bash_completion.d/juju-2.0 juju-core-2.0.2/src/github.com/juju/juju/etc/bash_completion.d/juju-2.0 --- juju-core-2.0.0/src/github.com/juju/juju/etc/bash_completion.d/juju-2.0 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/etc/bash_completion.d/juju-2.0 2016-11-11 00:08:09.000000000 +0000 @@ -335,13 +335,26 @@ } # _juju_2_0_cache_TTL [mins] export _juju_2_0_cache_TTL=2 + # All above completion is juju-2.0 specific, uses $_juju_cmd_JUJU_2_0 -export _juju_cmd_JUJU_2_0=/usr/bin/juju-2.0 + +# Detect juju built from source (highest priority) +if [ -x "$GOPATH/bin/juju" ]; then + export _juju_cmd_JUJU_2_0="$GOPATH/bin/juju" +# Detect installed juju-2.0 binary (next highest priority) +elif [ -x "/usr/bin/juju-2.0" ]; then + export _juju_cmd_JUJU_2_0="/usr/bin/juju-2.0" +# Use /usr/bin/juju as a last resort. +else + export _juju_cmd_JUJU_2_0="/usr/bin/juju" +fi + # Select python3, else python2 export _juju_cmd_PYTHON for _juju_cmd_PYTHON in /usr/bin/python{3,2};do [ -x ${_juju_cmd_PYTHON?} ] && break done + # Add juju-2.0 completion complete -F _juju_complete_2_0 juju-2.0 diff -Nru juju-core-2.0.0/src/github.com/juju/juju/feature/flags.go juju-core-2.0.2/src/github.com/juju/juju/feature/flags.go --- juju-core-2.0.0/src/github.com/juju/juju/feature/flags.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/feature/flags.go 2016-11-11 00:08:09.000000000 +0000 @@ -39,3 +39,6 @@ // DeveloperMode allows access to developer specific commands and behaviour. const DeveloperMode = "developer-mode" + +// CrossModelRelations allows cross model relations functionality. +const CrossModelRelations = "cross-model" diff -Nru juju-core-2.0.0/src/github.com/juju/juju/featuretests/cmd_juju_controller_test.go juju-core-2.0.2/src/github.com/juju/juju/featuretests/cmd_juju_controller_test.go --- juju-core-2.0.0/src/github.com/juju/juju/featuretests/cmd_juju_controller_test.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/featuretests/cmd_juju_controller_test.go 2016-11-11 00:08:09.000000000 +0000 @@ -72,7 +72,7 @@ func (s *cmdControllerSuite) TestControllerListCommand(c *gc.C) { context := s.run(c, "list-controllers") expectedOutput := ` -Use --refresh to see the latest information. +Use --refresh flag with this command to see the latest information. Controller Model User Access Cloud/Region Models Machines HA Version kontroll* controller admin superuser dummy/dummy-region - - - (unknown) @@ -87,9 +87,9 @@ c.Assert(testing.Stdout(context), gc.Equals, ""+ "Controller: kontroll\n"+ "\n"+ - "Model Owner Status Access Last connection\n"+ - "controller* admin available admin just now\n"+ - "new-model admin available admin never connected\n"+ + "Model Cloud/Region Status Access Last connection\n"+ + "controller* dummy/dummy-region available admin just now\n"+ + "new-model dummy/dummy-region available admin never connected\n"+ "\n") } @@ -99,9 +99,9 @@ c.Assert(testing.Stdout(context), gc.Equals, ""+ "Controller: kontroll\n"+ "\n"+ - "Model Owner Status Access Last connection\n"+ - "admin/controller* admin available admin just now\n"+ - "test/new-model test available never connected\n"+ + "Model Cloud/Region Status Access Last connection\n"+ + "admin/controller* dummy/dummy-region available admin just now\n"+ + "test/new-model dummy/dummy-region available never connected\n"+ "\n") } @@ -162,9 +162,9 @@ c.Assert(testing.Stdout(context), gc.Equals, ""+ "Controller: kontroll\n"+ "\n"+ - "Model Owner Status Access Last connection\n"+ - "controller* admin available admin just now\n"+ - "new-model admin destroying admin never connected\n"+ + "Model Cloud/Region Status Access Last connection\n"+ + "controller* dummy/dummy-region available admin just now\n"+ + "new-model dummy/dummy-region destroying admin never connected\n"+ "\n") } diff -Nru juju-core-2.0.0/src/github.com/juju/juju/featuretests/cmd_juju_crossmodel_test.go juju-core-2.0.2/src/github.com/juju/juju/featuretests/cmd_juju_crossmodel_test.go --- juju-core-2.0.0/src/github.com/juju/juju/featuretests/cmd_juju_crossmodel_test.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/featuretests/cmd_juju_crossmodel_test.go 2016-11-11 00:08:09.000000000 +0000 @@ -0,0 +1,146 @@ +// Copyright 2015 Canonical Ltd. +// Licensed under the AGPLv3, see LICENCE file for details. + +package featuretests + +import ( + "bytes" + + jc "github.com/juju/testing/checkers" + gc "gopkg.in/check.v1" + "gopkg.in/juju/charm.v6-unstable" + + "github.com/juju/juju/cmd/juju/crossmodel" + jujutesting "github.com/juju/juju/juju/testing" + "github.com/juju/juju/state" + "github.com/juju/juju/testing" +) + +type crossmodelSuite struct { + jujutesting.JujuConnSuite +} + +func (s *crossmodelSuite) TestListEndpoints(c *gc.C) { + ch := s.AddTestingCharm(c, "riak") + s.AddTestingService(c, "riakservice", ch) + ch = s.AddTestingCharm(c, "varnish") + s.AddTestingService(c, "varnishservice", ch) + + _, err := testing.RunCommand(c, crossmodel.NewOfferCommand(), + "riakservice:endpoint", "local:/u/me/riak") + c.Assert(err, jc.ErrorIsNil) + _, err = testing.RunCommand(c, crossmodel.NewOfferCommand(), + "varnishservice:webcache", "local:/u/me/varnish") + c.Assert(err, jc.ErrorIsNil) + + // TODO(wallyworld) - list with filters when supported + ctx, err := testing.RunCommand(c, crossmodel.NewListEndpointsCommand(), + "--format", "yaml") + c.Assert(err, jc.ErrorIsNil) + c.Assert(ctx.Stdout.(*bytes.Buffer).String(), gc.Equals, ` +local: + riak: + store: local + url: /u/me/riak + endpoints: + endpoint: + interface: http + role: provider + varnish: + store: local + url: /u/me/varnish + endpoints: + webcache: + interface: varnish + role: provider +`[1:]) +} + +func (s *crossmodelSuite) TestShow(c *gc.C) { + ch := s.AddTestingCharm(c, "riak") + s.AddTestingService(c, "riakservice", ch) + ch = s.AddTestingCharm(c, "varnish") + s.AddTestingService(c, "varnishservice", ch) + + _, err := testing.RunCommand(c, crossmodel.NewOfferCommand(), + "riakservice:endpoint", "local:/u/me/riak") + c.Assert(err, jc.ErrorIsNil) + _, err = testing.RunCommand(c, crossmodel.NewOfferCommand(), + "varnishservice:webcache", "local:/u/me/varnish") + c.Assert(err, jc.ErrorIsNil) + + // TODO(wallyworld) - list with filters when supported + ctx, err := testing.RunCommand(c, crossmodel.NewShowOfferedEndpointCommand(), + "local:/u/me/varnish", "--format", "yaml") + c.Assert(err, jc.ErrorIsNil) + c.Assert(ctx.Stdout.(*bytes.Buffer).String(), gc.Equals, ` +varnishservice: + endpoints: + webcache: + interface: varnish + role: provider + description: Another popular database +`[1:]) +} + +func (s *crossmodelSuite) TestFind(c *gc.C) { + ch := s.AddTestingCharm(c, "riak") + s.AddTestingService(c, "riakservice", ch) + ch = s.AddTestingCharm(c, "varnish") + s.AddTestingService(c, "varnishservice", ch) + + _, err := testing.RunCommand(c, crossmodel.NewOfferCommand(), + "riakservice:endpoint", "local:/u/you/riak") + c.Assert(err, jc.ErrorIsNil) + _, err = testing.RunCommand(c, crossmodel.NewOfferCommand(), + "varnishservice:webcache", "local:/u/me/varnish") + c.Assert(err, jc.ErrorIsNil) + + // TODO(wallyworld) - find with interface and endpoint name filters when supported + ctx, err := testing.RunCommand(c, crossmodel.NewFindEndpointsCommand(), + "local:/u/me", "--format", "yaml") + c.Assert(err, jc.ErrorIsNil) + c.Assert(ctx.Stdout.(*bytes.Buffer).String(), gc.Equals, ` +local:/u/me/varnish: + endpoints: + webcache: + interface: varnish + role: provider +`[1:]) +} + +func (s *crossmodelSuite) TestAddRelation(c *gc.C) { + ch := s.AddTestingCharm(c, "wordpress") + s.AddTestingService(c, "wordpress", ch) + ch = s.AddTestingCharm(c, "mysql") + s.AddTestingService(c, "mysql", ch) + + _, err := testing.RunCommand(c, crossmodel.NewOfferCommand(), + "mysql:server", "local:/u/me/hosted-mysql") + c.Assert(err, jc.ErrorIsNil) + _, err = runJujuCommand(c, "add-relation", "wordpress", "local:/u/me/hosted-mysql") + c.Assert(err, jc.ErrorIsNil) + svc, err := s.State.RemoteApplication("hosted-mysql") + c.Assert(err, jc.ErrorIsNil) + rel, err := svc.Relations() + c.Assert(err, jc.ErrorIsNil) + c.Assert(rel, gc.HasLen, 1) + c.Assert(rel[0].Endpoints(), jc.SameContents, []state.Endpoint{ + { + ApplicationName: "wordpress", + Relation: charm.Relation{ + Name: "db", + Role: "requirer", + Interface: "mysql", + Limit: 1, + Scope: "global", + }, + }, { + ApplicationName: "hosted-mysql", + Relation: charm.Relation{Name: "server", + Role: "provider", + Interface: "mysql", + Scope: "global"}, + }, + }) +} diff -Nru juju-core-2.0.0/src/github.com/juju/juju/featuretests/package_test.go juju-core-2.0.2/src/github.com/juju/juju/featuretests/package_test.go --- juju-core-2.0.0/src/github.com/juju/juju/featuretests/package_test.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/featuretests/package_test.go 2016-11-11 00:08:09.000000000 +0000 @@ -44,6 +44,8 @@ gc.Suite(&undertakerSuite{}) gc.Suite(&upgradeSuite{}) gc.Suite(&CmdRelationSuite{}) + gc.Suite(&remoteRelationsSuite{}) + gc.Suite(&crossmodelSuite{}) // TODO (anastasiamac 2016-07-19) Bug#1603585 // These tests cannot run on windows - they require a bootstrapped controller. diff -Nru juju-core-2.0.0/src/github.com/juju/juju/featuretests/remoterelations_test.go juju-core-2.0.2/src/github.com/juju/juju/featuretests/remoterelations_test.go --- juju-core-2.0.0/src/github.com/juju/juju/featuretests/remoterelations_test.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/featuretests/remoterelations_test.go 2016-11-11 00:08:09.000000000 +0000 @@ -0,0 +1,157 @@ +// Copyright 2015 Canonical Ltd. +// Licensed under the AGPLv3, see LICENCE file for details. + +package featuretests + +import ( + "time" + + jc "github.com/juju/testing/checkers" + gc "gopkg.in/check.v1" + "gopkg.in/juju/charm.v6-unstable" + + "github.com/juju/juju/api/remoterelations" + jujutesting "github.com/juju/juju/juju/testing" + "github.com/juju/juju/state" + statetesting "github.com/juju/juju/state/testing" + "github.com/juju/juju/testing" + "github.com/juju/juju/testing/factory" + "github.com/juju/juju/watcher" + "github.com/juju/juju/watcher/watchertest" + "github.com/juju/juju/worker" +) + +// TODO(axw) this suite should be re-written as end-to-end tests using the +// remote relations worker when it is ready. + +type remoteRelationsSuite struct { + jujutesting.JujuConnSuite + client *remoterelations.State +} + +func (s *remoteRelationsSuite) SetUpTest(c *gc.C) { + s.JujuConnSuite.SetUpTest(c) + conn, _ := s.OpenAPIAsNewMachine(c, state.JobManageModel) + s.client = remoterelations.NewState(conn) +} + +func (s *remoteRelationsSuite) TestWatchRemoteApplications(c *gc.C) { + _, err := s.State.AddRemoteApplication("mysql", "local:/u/me/mysql", nil) + c.Assert(err, jc.ErrorIsNil) + + w, err := s.client.WatchRemoteApplications() + c.Assert(err, jc.ErrorIsNil) + c.Assert(w, gc.NotNil) + defer func() { + c.Assert(worker.Stop(w), jc.ErrorIsNil) + }() + + wc := watchertest.NewStringsWatcherC(c, w, s.BackingState.StartSync) + defer wc.AssertStops() + + wc.AssertChangeInSingleEvent("mysql") + wc.AssertNoChange() + + _, err = s.State.AddRemoteApplication("db2", "local:/u/ibm/db2", nil) + c.Assert(err, jc.ErrorIsNil) + wc.AssertChangeInSingleEvent("db2") + wc.AssertNoChange() +} + +func (s *remoteRelationsSuite) TestWatchRemoteApplication(c *gc.C) { + // Add a remote application, and watch it. It should initially have no + // relations. + _, err := s.State.AddRemoteApplication("mysql", "local:/u/me/mysql", []charm.Relation{{ + Interface: "mysql", + Name: "db", + Role: charm.RoleProvider, + Scope: charm.ScopeGlobal, + }}) + c.Assert(err, jc.ErrorIsNil) + w, err := s.client.WatchRemoteApplication("mysql") + c.Assert(err, jc.ErrorIsNil) + c.Assert(w, gc.NotNil) + defer func() { + c.Assert(worker.Stop(w), jc.ErrorIsNil) + }() + + assertApplicationRelationsChange(c, s.BackingState, w, watcher.ApplicationRelationsChange{}) + assertNoApplicationRelationsChange(c, s.BackingState, w) + + // Add the relation, and expect a watcher change. + wordpress := s.Factory.MakeApplication(c, &factory.ApplicationParams{ + Charm: s.Factory.MakeCharm(c, &factory.CharmParams{ + Name: "wordpress", + }), + }) + eps, err := s.State.InferEndpoints("wordpress", "mysql") + c.Assert(err, jc.ErrorIsNil) + rel, err := s.State.AddRelation(eps[0], eps[1]) + c.Assert(err, jc.ErrorIsNil) + + expect := watcher.ApplicationRelationsChange{ + ChangedRelations: []watcher.RelationChange{{ + RelationId: rel.Id(), + Life: "alive", + ChangedUnits: map[string]watcher.RelationUnitChange{}, + }}, + } + assertApplicationRelationsChange(c, s.BackingState, w, expect) + assertNoApplicationRelationsChange(c, s.BackingState, w) + + // Add a unit of wordpress, expect a change. + settings := map[string]interface{}{"key": "value"} + wordpress0, err := wordpress.AddUnit() + c.Assert(err, jc.ErrorIsNil) + ru, err := rel.Unit(wordpress0) + c.Assert(err, jc.ErrorIsNil) + err = ru.EnterScope(settings) + c.Assert(err, jc.ErrorIsNil) + expect.ChangedRelations[rel.Id()] = watcher.RelationChange{ + Life: "alive", + ChangedUnits: map[string]watcher.RelationUnitChange{ + wordpress0.Name(): { + Settings: settings, + }, + }, + } + assertApplicationRelationsChange(c, s.BackingState, w, expect) + assertNoApplicationRelationsChange(c, s.BackingState, w) + + // Change the settings, expect a change. + ruSettings, err := ru.Settings() + c.Assert(err, jc.ErrorIsNil) + settings["quay"] = 123 + ruSettings.Update(settings) + _, err = ruSettings.Write() + c.Assert(err, jc.ErrorIsNil) + // Numeric settings values are unmarshalled as float64. + settings["quay"] = float64(123) + expect.ChangedRelations[rel.Id()].ChangedUnits[wordpress0.Name()] = watcher.RelationUnitChange{ + Settings: settings, + } + assertApplicationRelationsChange(c, s.BackingState, w, expect) + assertNoApplicationRelationsChange(c, s.BackingState, w) +} + +func assertApplicationRelationsChange( + c *gc.C, ss statetesting.SyncStarter, w watcher.ApplicationRelationsWatcher, expect watcher.ApplicationRelationsChange, +) { + ss.StartSync() + select { + case change, ok := <-w.Changes(): + c.Assert(ok, jc.IsTrue) + c.Assert(change, jc.DeepEquals, expect) + case <-time.After(testing.LongWait): + c.Errorf("timed out waiting for application relations change") + } +} + +func assertNoApplicationRelationsChange(c *gc.C, ss statetesting.SyncStarter, w watcher.ApplicationRelationsWatcher) { + ss.StartSync() + select { + case change, ok := <-w.Changes(): + c.Errorf("unexpected change from application relations watcher: %v, %v", change, ok) + case <-time.After(testing.ShortWait): + } +} diff -Nru juju-core-2.0.0/src/github.com/juju/juju/featuretests/upgrade_test.go juju-core-2.0.2/src/github.com/juju/juju/featuretests/upgrade_test.go --- juju-core-2.0.0/src/github.com/juju/juju/featuretests/upgrade_test.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/featuretests/upgrade_test.go 2016-11-11 00:08:09.000000000 +0000 @@ -10,6 +10,7 @@ "strings" "time" + "github.com/juju/errors" jc "github.com/juju/testing/checkers" "github.com/juju/utils" "github.com/juju/utils/arch" @@ -338,13 +339,17 @@ } defer apiState.Close() - // this call should always work - var result params.FullStatus - err = apiState.APICall("Client", 1, "", "FullStatus", nil, &result) - c.Assert(err, jc.ErrorIsNil) + // This call should always work, but might fail if the apiserver + // is restarting. If it fails just return the error so retries + // can continue. + err = apiState.APICall("Client", 1, "", "FullStatus", nil, new(params.FullStatus)) + if err != nil { + return errors.Annotate(err, "FullStatus call") + } // this call should only work if API is not restricted - return apiState.APICall("Client", 1, "", "WatchAll", nil, nil) + err = apiState.APICall("Client", 1, "", "WatchAll", nil, nil) + return errors.Annotate(err, "WatchAll call") } var upgradeTestDialOpts = api.DialOpts{ diff -Nru juju-core-2.0.0/src/github.com/juju/juju/juju/api.go juju-core-2.0.2/src/github.com/juju/juju/juju/api.go --- juju-core-2.0.0/src/github.com/juju/juju/juju/api.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/juju/api.go 2016-11-11 00:08:09.000000000 +0000 @@ -290,7 +290,7 @@ func usableHostPorts(hps [][]network.HostPort) []network.HostPort { collapsed := network.CollapseHostPorts(hps) usable := network.FilterUnusableHostPorts(collapsed) - unique := network.DropDuplicatedHostPorts(usable) + unique := network.UniqueHostPorts(usable) return unique } diff -Nru juju-core-2.0.0/src/github.com/juju/juju/juju/testing/conn.go juju-core-2.0.2/src/github.com/juju/juju/juju/testing/conn.go --- juju-core-2.0.0/src/github.com/juju/juju/juju/testing/conn.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/juju/testing/conn.go 2016-11-11 00:08:09.000000000 +0000 @@ -38,6 +38,7 @@ "github.com/juju/juju/environs/storage" envtesting "github.com/juju/juju/environs/testing" "github.com/juju/juju/environs/tools" + "github.com/juju/juju/feature" "github.com/juju/juju/juju/keys" "github.com/juju/juju/juju/osenv" "github.com/juju/juju/jujuclient" @@ -107,6 +108,7 @@ const AdminSecret = "dummy-secret" func (s *JujuConnSuite) SetUpSuite(c *gc.C) { + s.SetInitialFeatureFlags(feature.CrossModelRelations) s.MgoSuite.SetUpSuite(c) s.FakeJujuXDGDataHomeSuite.SetUpSuite(c) s.PatchValue(&utils.OutgoingAccessAllowed, false) diff -Nru juju-core-2.0.0/src/github.com/juju/juju/Makefile juju-core-2.0.2/src/github.com/juju/juju/Makefile --- juju-core-2.0.0/src/github.com/juju/juju/Makefile 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/Makefile 2016-11-11 00:08:09.000000000 +0000 @@ -99,7 +99,8 @@ # Install bash_completion install-etc: @echo Installing bash completion - @sudo install -o root -g root -m 644 etc/bash_completion.d/juju2 /etc/bash_completion.d + @sudo install -o root -g root -m 644 etc/bash_completion.d/juju-2.0 /usr/share/bash-completion/completions + @sudo install -o root -g root -m 644 etc/bash_completion.d/juju-version /usr/share/bash-completion/completions setup-lxd: ifeq ($(shell ifconfig lxdbr0 2>&1 | grep -q "inet addr" && echo true),true) diff -Nru juju-core-2.0.0/src/github.com/juju/juju/mongo/open.go juju-core-2.0.2/src/github.com/juju/juju/mongo/open.go --- juju-core-2.0.0/src/github.com/juju/juju/mongo/open.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/mongo/open.go 2016-11-11 00:08:09.000000000 +0000 @@ -137,6 +137,9 @@ cc := tls.Client(c, tlsConfig) if err := cc.Handshake(); err != nil { logger.Warningf("TLS handshake failed: %v", err) + if err := c.Close(); err != nil { + logger.Warningf("failed to close connection: %v", err) + } return nil, err } logger.Debugf("dialled mongodb server at %q", addr) diff -Nru juju-core-2.0.0/src/github.com/juju/juju/network/hostport.go juju-core-2.0.2/src/github.com/juju/juju/network/hostport.go --- juju-core-2.0.0/src/github.com/juju/juju/network/hostport.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/network/hostport.go 2016-11-11 00:08:09.000000000 +0000 @@ -7,6 +7,7 @@ "net" "sort" "strconv" + "time" "github.com/juju/errors" "github.com/juju/utils/set" @@ -184,20 +185,6 @@ return filtered } -// DropDuplicatedHostPorts removes any HostPorts duplicates from the -// given slice and returns the result. -func DropDuplicatedHostPorts(hps []HostPort) []HostPort { - uniqueHPs := set.NewStrings() - var result []HostPort - for _, hp := range hps { - if !uniqueHPs.Contains(hp.NetAddr()) { - uniqueHPs.Add(hp.NetAddr()) - result = append(result, hp) - } - } - return result -} - // HostPortsToStrings converts each HostPort to string calling its // NetAddr() method. func HostPortsToStrings(hps []HostPort) []string { @@ -236,3 +223,58 @@ result = append([]HostPort{first}, result...) return result } + +// UniqueHostPorts returns the given hostPorts after filtering out any +// duplicates, preserving the input order. +func UniqueHostPorts(hostPorts []HostPort) []HostPort { + results := make([]HostPort, 0, len(hostPorts)) + + seen := make(map[HostPort]bool, len(hostPorts)) + for _, hostPort := range hostPorts { + if seen[hostPort] { + continue + } + + seen[hostPort] = true + results = append(results, hostPort) + } + + return results +} + +// Dialer defines a Dial() method matching the signature of net.Dial(). +type Dialer interface { + Dial(network, address string) (net.Conn, error) +} + +// ReachableHostPort dials the entries in the given hostPorts, in parallel, +// using the given dialer, closing successfully established connections +// immediately. Individual connection errors are discarded, and an error is +// returned only if none of the hostPorts can be reached when the given timeout +// expires. +// +// Usually, a net.Dialer initialized with a non-empty Timeout field is passed +// for dialer. +func ReachableHostPort(hostPorts []HostPort, dialer Dialer, timeout time.Duration) (HostPort, error) { + uniqueHPs := UniqueHostPorts(hostPorts) + successful := make(chan HostPort, 1) + + for _, hostPort := range uniqueHPs { + go func(hp HostPort) { + conn, err := dialer.Dial("tcp", hp.NetAddr()) + if err == nil { + conn.Close() + successful <- hp + } + }(hostPort) + } + + select { + case result := <-successful: + logger.Infof("dialed %q successfully", result) + return result, nil + + case <-time.After(timeout): + return HostPort{}, errors.Errorf("cannot connect to any address: %v", hostPorts) + } +} diff -Nru juju-core-2.0.0/src/github.com/juju/juju/network/hostport_test.go juju-core-2.0.2/src/github.com/juju/juju/network/hostport_test.go --- juju-core-2.0.0/src/github.com/juju/juju/network/hostport_test.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/network/hostport_test.go 2016-11-11 00:08:09.000000000 +0000 @@ -7,17 +7,18 @@ "fmt" "net" "strings" + "time" "github.com/juju/errors" jc "github.com/juju/testing/checkers" gc "gopkg.in/check.v1" "github.com/juju/juju/network" - "github.com/juju/juju/testing" + coretesting "github.com/juju/juju/testing" ) type HostPortSuite struct { - testing.BaseSuite + coretesting.BaseSuite } var _ = gc.Suite(&HostPortSuite{}) @@ -399,43 +400,6 @@ } } -func (s *HostPortSuite) TestDropDuplicatedHostPorts(c *gc.C) { - hps := s.makeHostPorts() - noDups := network.DropDuplicatedHostPorts(hps) - c.Assert(noDups, gc.Not(gc.HasLen), len(hps)) - c.Assert(noDups, jc.DeepEquals, append( - network.NewHostPorts(1234, - "127.0.0.1", - "localhost", - "example.com", - "127.0.1.1", - "example.org", - "2001:db8::2", - "169.254.1.1", - "example.net", - "invalid host", - "fd00::22", - "2001:db8::1", - "169.254.1.2", - "ff01::22", - "0.1.2.0", - "10.0.0.1", - "::1", - "fc00::1", - "fe80::2", - "172.16.0.1", - "8.8.8.8", - "7.8.8.8", - ), - network.NewHostPorts(9999, - "127.0.0.1", // machine-local - "10.0.0.1", // cloud-local - "2001:db8::1", // public - "fe80::2", // link-local - )..., - )) -} - func (s *HostPortSuite) TestHostPortsToStrings(c *gc.C) { hps := s.makeHostPorts() strHPs := network.HostPortsToStrings(hps) @@ -510,3 +474,92 @@ )..., ) } + +func (s *HostPortSuite) TestUniqueHostPortsSimpleInput(c *gc.C) { + input := network.NewHostPorts(1234, "127.0.0.1", "::1") + expected := input + + results := network.UniqueHostPorts(input) + c.Assert(results, jc.DeepEquals, expected) +} + +func (s *HostPortSuite) TestUniqueHostPortsOnlyDuplicates(c *gc.C) { + input := s.manyHostPorts(c, 10000, nil) // use IANA reserved port + expected := input[0:1] + + results := network.UniqueHostPorts(input) + c.Assert(results, jc.DeepEquals, expected) +} + +func (s *HostPortSuite) TestUniqueHostPortsHugeUniqueInput(c *gc.C) { + input := s.manyHostPorts(c, maxTCPPort, func(port int) string { + return fmt.Sprintf("127.1.0.1:%d", port) + }) + expected := input + + results := network.UniqueHostPorts(input) + c.Assert(results, jc.DeepEquals, expected) +} + +func (s *HostPortSuite) TestReachableHostPortAllUnreachable(c *gc.C) { + dialer := &net.Dialer{Timeout: 100 * time.Millisecond} + unreachableHPs := s.manyHostPorts(c, maxTCPPort, nil) // use IANA reserved port + timeout := 300 * time.Millisecond + + best, err := network.ReachableHostPort(unreachableHPs, dialer, timeout) + c.Check(err, gc.ErrorMatches, "cannot connect to any address: .*") + c.Check(best, gc.Equals, network.HostPort{}) +} + +func (s *HostPortSuite) TestReachableHostPortRealDial(c *gc.C) { + fakeHostPort := network.NewHostPorts(1234, "127.0.0.1")[0] + hostPorts := []network.HostPort{ + fakeHostPort, + testTCPServer(c), + } + timeout := 300 * time.Millisecond + + dialer := &net.Dialer{Timeout: 100 * time.Millisecond} + best, err := network.ReachableHostPort(hostPorts, dialer, timeout) + c.Check(err, jc.ErrorIsNil) + c.Check(best, jc.DeepEquals, hostPorts[1]) // the only real listener +} + +const maxTCPPort = 65535 + +func (s *HostPortSuite) manyHostPorts(c *gc.C, count int, addressFunc func(index int) string) []network.HostPort { + if addressFunc == nil { + addressFunc = func(_ int) string { + return "127.0.0.1:49151" // all use the same IANA reserved port. + } + } + + results := make([]network.HostPort, count) + for i := range results { + hostPort, err := network.ParseHostPort(addressFunc(i)) + c.Assert(err, jc.ErrorIsNil) + results[i] = *hostPort + } + return results +} + +func testTCPServer(c *gc.C) network.HostPort { + listener, err := net.Listen("tcp", "127.0.0.1:0") + c.Assert(err, jc.ErrorIsNil) + + listenAddress := listener.Addr().String() + hostPort, err := network.ParseHostPort(listenAddress) + c.Assert(err, jc.ErrorIsNil) + c.Logf("listening on %q", hostPort) + + go func() { + conn, _ := listener.Accept() + if conn != nil { + c.Logf("accepted connection on %q from %s", hostPort, conn.RemoteAddr()) + conn.Close() + } + listener.Close() + }() + + return *hostPort +} diff -Nru juju-core-2.0.0/src/github.com/juju/juju/network/network.go juju-core-2.0.2/src/github.com/juju/juju/network/network.go --- juju-core-2.0.0/src/github.com/juju/juju/network/network.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/network/network.go 2016-11-11 00:08:09.000000000 +0000 @@ -29,10 +29,10 @@ } // NoAddressError returns an error which satisfies IsNoAddressError(). The given -// addressKind specifies what kind of address is missing, usually "private" or -// "public". +// addressKind specifies what kind of address(es) is(are) missing, usually +// "private" or "public". func NoAddressError(addressKind string) error { - newErr := errors.NewErr("no %s address", addressKind) + newErr := errors.NewErr("no %s address(es)", addressKind) newErr.SetLocation(1) return &noAddress{newErr} } diff -Nru juju-core-2.0.0/src/github.com/juju/juju/network/network_test.go juju-core-2.0.2/src/github.com/juju/juju/network/network_test.go --- juju-core-2.0.0/src/github.com/juju/juju/network/network_test.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/network/network_test.go 2016-11-11 00:08:09.000000000 +0000 @@ -172,7 +172,7 @@ func (s *NetworkSuite) TestNoAddressError(c *gc.C) { err := network.NoAddressError("fake") - c.Assert(err, gc.ErrorMatches, "no fake address") + c.Assert(err, gc.ErrorMatches, `no fake address\(es\)`) c.Assert(network.IsNoAddressError(err), jc.IsTrue) c.Assert(network.IsNoAddressError(errors.New("address found")), jc.IsFalse) } diff -Nru juju-core-2.0.0/src/github.com/juju/juju/provider/azure/environ.go juju-core-2.0.2/src/github.com/juju/juju/provider/azure/environ.go --- juju-core-2.0.0/src/github.com/juju/juju/provider/azure/environ.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/provider/azure/environ.go 2016-11-11 00:08:09.000000000 +0000 @@ -727,7 +727,7 @@ } serviceName, err := names.UnitApplication(unitName) if err != nil { - return "", errors.Annotate(err, "getting service name") + return "", errors.Annotate(err, "getting application name") } availabilitySetName = serviceName break diff -Nru juju-core-2.0.0/src/github.com/juju/juju/provider/azure/environ_test.go juju-core-2.0.2/src/github.com/juju/juju/provider/azure/environ_test.go --- juju-core-2.0.0/src/github.com/juju/juju/provider/azure/environ_test.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/provider/azure/environ_test.go 2016-11-11 00:08:09.000000000 +0000 @@ -11,6 +11,7 @@ "net/http" "path" "reflect" + "runtime" "time" "github.com/Azure/azure-sdk-for-go/arm/compute" @@ -31,12 +32,15 @@ "github.com/juju/juju/cloudconfig/instancecfg" "github.com/juju/juju/constraints" "github.com/juju/juju/environs" + "github.com/juju/juju/environs/bootstrap" "github.com/juju/juju/environs/imagemetadata" "github.com/juju/juju/environs/simplestreams" + "github.com/juju/juju/environs/sync" "github.com/juju/juju/environs/tags" envtesting "github.com/juju/juju/environs/testing" envtools "github.com/juju/juju/environs/tools" "github.com/juju/juju/instance" + jujutesting "github.com/juju/juju/juju/testing" "github.com/juju/juju/provider/azure" "github.com/juju/juju/provider/azure/internal/armtemplates" "github.com/juju/juju/provider/azure/internal/azureauth" @@ -156,12 +160,26 @@ } vmSizes := []compute.VirtualMachineSize{{ + Name: to.StringPtr("Standard_A1"), + NumberOfCores: to.Int32Ptr(1), + OsDiskSizeInMB: to.Int32Ptr(1047552), + ResourceDiskSizeInMB: to.Int32Ptr(71680), + MemoryInMB: to.Int32Ptr(1792), + MaxDataDiskCount: to.Int32Ptr(2), + }, { Name: to.StringPtr("Standard_D1"), NumberOfCores: to.Int32Ptr(1), OsDiskSizeInMB: to.Int32Ptr(1047552), ResourceDiskSizeInMB: to.Int32Ptr(51200), MemoryInMB: to.Int32Ptr(3584), MaxDataDiskCount: to.Int32Ptr(2), + }, { + Name: to.StringPtr("Standard_D2"), + NumberOfCores: to.Int32Ptr(2), + OsDiskSizeInMB: to.Int32Ptr(1047552), + ResourceDiskSizeInMB: to.Int32Ptr(102400), + MemoryInMB: to.Int32Ptr(7168), + MaxDataDiskCount: to.Int32Ptr(4), }} s.vmSizes = &compute.VirtualMachineSizeListResult{Value: &vmSizes} @@ -312,6 +330,15 @@ return senders } +func (s *environSuite) startInstanceSendersNoSizes() azuretesting.Senders { + senders := azuretesting.Senders{} + if s.ubuntuServerSKUs != nil { + senders = append(senders, s.makeSender(".*/Canonical/.*/UbuntuServer/skus", s.ubuntuServerSKUs)) + } + senders = append(senders, s.makeSender("/deployments/machine-0", s.deployment)) + return senders +} + func (s *environSuite) networkInterfacesSender(nics ...network.Interface) *azuretesting.MockSender { return s.makeSender(".*/networkInterfaces", network.InterfaceListResult{Value: &nics}) } @@ -438,7 +465,7 @@ c.Assert(result.VolumeAttachments, gc.HasLen, 0) arch := "amd64" - mem := uint64(3584) + mem := uint64(1792) rootDisk := uint64(30 * 1024) // 30 GiB cpuCores := uint64(1) c.Assert(result.Hardware, jc.DeepEquals, &instance.HardwareCharacteristics{ @@ -451,6 +478,7 @@ imageReference: &quantalImageReference, diskSizeGB: 32, osProfile: &linuxOsProfile, + instanceType: "Standard_A1", }) } @@ -499,7 +527,8 @@ AutoUpgradeMinorVersion: to.BoolPtr(true), Settings: &vmExtensionSettings, }, - osProfile: &windowsOsProfile, + osProfile: &windowsOsProfile, + instanceType: "Standard_A1", }) } @@ -527,7 +556,8 @@ AutoUpgradeMinorVersion: to.BoolPtr(true), Settings: &vmExtensionSettings, }, - osProfile: &linuxOsProfile, + osProfile: &linuxOsProfile, + instanceType: "Standard_A1", }) } @@ -563,6 +593,7 @@ imageReference: &quantalImageReference, diskSizeGB: 32, osProfile: &linuxOsProfile, + instanceType: "Standard_A1", }) // The final requests should all be identical. @@ -641,6 +672,7 @@ imageReference: &quantalImageReference, diskSizeGB: 32, osProfile: &linuxOsProfile, + instanceType: "Standard_A1", }) } @@ -652,6 +684,8 @@ vmExtension *compute.VirtualMachineExtensionProperties diskSizeGB int osProfile *compute.OSProfile + needsProviderInit bool + instanceType string } func (s *environSuite) assertStartInstanceRequests( @@ -824,7 +858,7 @@ Tags: to.StringMap(s.vmTags), Properties: &compute.VirtualMachineProperties{ HardwareProfile: &compute.HardwareProfile{ - VMSize: "Standard_D1", + VMSize: compute.VirtualMachineSizeTypes(args.instanceType), }, StorageProfile: &compute.StorageProfile{ ImageReference: args.imageReference, @@ -882,12 +916,21 @@ startInstanceRequests.deployment = requests[1] } else { c.Assert(requests, gc.HasLen, numExpectedStartInstanceRequests) - c.Assert(requests[0].Method, gc.Equals, "GET") // vmSizes - c.Assert(requests[1].Method, gc.Equals, "GET") // skus - c.Assert(requests[2].Method, gc.Equals, "PUT") // create deployment - startInstanceRequests.vmSizes = requests[0] - startInstanceRequests.skus = requests[1] - startInstanceRequests.deployment = requests[2] + if args.needsProviderInit { + c.Assert(requests[0].Method, gc.Equals, "PUT") // resource groups + c.Assert(requests[1].Method, gc.Equals, "GET") // skus + c.Assert(requests[2].Method, gc.Equals, "PUT") // create deployment + startInstanceRequests.resourceGroups = requests[0] + startInstanceRequests.skus = requests[1] + startInstanceRequests.deployment = requests[2] + } else { + c.Assert(requests[0].Method, gc.Equals, "GET") // vmSizes + c.Assert(requests[1].Method, gc.Equals, "GET") // skus + c.Assert(requests[2].Method, gc.Equals, "PUT") // create deployment + startInstanceRequests.vmSizes = requests[0] + startInstanceRequests.skus = requests[1] + startInstanceRequests.deployment = requests[2] + } } // Marshal/unmarshal the deployment we expect, so it's in map form. @@ -921,9 +964,10 @@ } type startInstanceRequests struct { - vmSizes *http.Request - skus *http.Request - deployment *http.Request + resourceGroups *http.Request + vmSizes *http.Request + skus *http.Request + deployment *http.Request } func (s *environSuite) TestBootstrap(c *gc.C) { @@ -937,9 +981,10 @@ s.requests = nil result, err := env.Bootstrap( ctx, environs.BootstrapParams{ - ControllerConfig: testing.FakeControllerConfig(), - AvailableTools: makeToolsList("quantal"), - BootstrapSeries: "quantal", + ControllerConfig: testing.FakeControllerConfig(), + AvailableTools: makeToolsList("quantal"), + BootstrapSeries: "quantal", + BootstrapConstraints: constraints.MustParse("mem=3.5G"), }, ) c.Assert(err, jc.ErrorIsNil) @@ -953,6 +998,57 @@ imageReference: &quantalImageReference, diskSizeGB: 32, osProfile: &linuxOsProfile, + instanceType: "Standard_D1", + }) +} + +func (s *environSuite) TestBootstrapInstanceConstraints(c *gc.C) { + if runtime.GOOS == "windows" { + c.Skip("bootstrap not supported on Windows") + } + defer envtesting.DisableFinishBootstrap()() + + ctx := envtesting.BootstrapContext(c) + env := prepareForBootstrap(c, ctx, s.provider, &s.sender) + + s.sender = append(s.sender, s.vmSizesSender()) + s.sender = append(s.sender, s.initResourceGroupSenders()...) + s.sender = append(s.sender, s.startInstanceSendersNoSizes()...) + s.requests = nil + err := bootstrap.Bootstrap( + ctx, env, bootstrap.BootstrapParams{ + ControllerConfig: testing.FakeControllerConfig(), + AdminSecret: jujutesting.AdminSecret, + CAPrivateKey: testing.CAKey, + BootstrapSeries: "quantal", + BuildAgentTarball: func(build bool, ver *version.Number, _ string) (*sync.BuiltAgent, error) { + c.Assert(build, jc.IsFalse) + return &sync.BuiltAgent{Dir: c.MkDir()}, nil + }, + }, + ) + // If we aren't on amd64, this should correctly fail. See also: + // lp#1638706: environSuite.TestBootstrapInstanceConstraints fails on rare archs and series + if arch.HostArch() != "amd64" { + wantErr := fmt.Sprintf("model %q of type %s does not support instances running on %q", + env.Config().Name(), + env.Config().Type(), + arch.HostArch()) + c.Assert(err, gc.ErrorMatches, wantErr) + c.SucceedNow() + } + // amd64 should pass the rest of the test. + c.Assert(err, jc.ErrorIsNil) + + c.Assert(len(s.requests), gc.Equals, numExpectedStartInstanceRequests+1) + s.vmTags[tags.JujuIsController] = to.StringPtr("true") + s.assertStartInstanceRequests(c, s.requests[1:], assertStartInstanceRequestsParams{ + availabilitySetName: "juju-controller", + imageReference: &quantalImageReference, + diskSizeGB: 32, + osProfile: &linuxOsProfile, + needsProviderInit: true, + instanceType: "Standard_D1", }) } @@ -1128,7 +1224,7 @@ ) _, err = validator.Validate(constraints.MustParse("instance-type=t1.micro")) c.Assert(err, gc.ErrorMatches, - "invalid constraint value: instance-type=t1.micro\nvalid values are: \\[D1 Standard_D1\\]", + "invalid constraint value: instance-type=t1.micro\nvalid values are: \\[A1 D1 D2 Standard_A1 Standard_D1 Standard_D2\\]", ) } diff -Nru juju-core-2.0.0/src/github.com/juju/juju/provider/ec2/image.go juju-core-2.0.2/src/github.com/juju/juju/provider/ec2/image.go --- juju-core-2.0.0/src/github.com/juju/juju/provider/ec2/image.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/provider/ec2/image.go 2016-11-11 00:08:09.000000000 +0000 @@ -43,9 +43,7 @@ ic *instances.InstanceConstraint, ) (*instances.InstanceSpec, error) { logger.Debugf("received %d image(s)", len(allImageMetadata)) - if controller { - ic.Constraints = withDefaultControllerConstraints(ic.Constraints) - } else { + if !controller { ic.Constraints = withDefaultNonControllerConstraints(ic.Constraints) } suitableImages := filterImages(allImageMetadata, ic) @@ -54,23 +52,6 @@ return instances.FindInstanceSpec(images, ic, instanceTypes) } -// withDefaultControllerConstraints returns the given constraints, -// updated to choose a default instance type appropriate for a -// controller machine. We use this only if the user does not specify -// any constraints that would otherwise control the instance type -// selection. -// -// At the time of writing, this will choose -// - t2.medium, for VPC -// - m3.medium, for EC2-Classic -func withDefaultControllerConstraints(cons constraints.Value) constraints.Value { - if !cons.HasInstanceType() && !cons.HasCpuCores() && !cons.HasCpuPower() && !cons.HasMem() { - var mem uint64 = 3.75 * 1024 - cons.Mem = &mem - } - return cons -} - // withDefaultNonControllerConstraints returns the given constraints, // updated to choose a default instance type appropriate for a // non-controller machine. We use this only if the user does not diff -Nru juju-core-2.0.0/src/github.com/juju/juju/provider/ec2/internal/ec2instancetypes/generated.go juju-core-2.0.2/src/github.com/juju/juju/provider/ec2/internal/ec2instancetypes/generated.go --- juju-core-2.0.0/src/github.com/juju/juju/provider/ec2/internal/ec2instancetypes/generated.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/provider/ec2/internal/ec2instancetypes/generated.go 2016-11-11 00:08:09.000000000 +0000 @@ -16,8 +16,8 @@ both = []string{arch.AMD64, arch.I386} ) -// Version: 20160901005907 -// Publication date: 2016-09-01 00:59:07 +0000 UTC +// Version: 20161017231909 +// Publication date: 2016-10-17 23:19:09 +0000 UTC // // This pricing list is for informational purposes only. All prices are subject to the additional terms included in the pricing pages on http://aws.amazon.com. All Free Tier prices are also subject to the terms included at https://aws.amazon.com/free/ @@ -25,6 +25,19 @@ "ap-northeast-1": { + // SKU: 2JSMK4YRVSAHV4RW + // Instance family: General purpose + // Storage: EBS only + { + Name: "m4.16xlarge", + Arches: amd64, + CpuCores: 64, + CpuPower: instances.CpuPower(20608), + Mem: 262144, + VirtType: &hvm, + Cost: 5563, + }, + // SKU: 4BJPFU3PAZJ4AKMM // Instance family: General purpose // Storage: 4 x 420 @@ -316,6 +329,19 @@ Cost: 1061, }, + // SKU: E5ZC2EJP47JC4Y2A + // Instance family: Memory optimized + // Storage: 1 x 1,920 + { + Name: "x1.16xlarge", + Arches: amd64, + CpuCores: 64, + CpuPower: instances.CpuPower(20608), + Mem: 999424, + VirtType: &hvm, + Cost: 9671, + }, + // SKU: E6F66FZ47YZNXAJ2 // Instance family: General purpose // Storage: EBS only @@ -938,6 +964,19 @@ Cost: 3592, }, + // SKU: 9DY7H84NVAJTABAD + // Instance family: General purpose + // Storage: EBS only + { + Name: "m4.16xlarge", + Arches: amd64, + CpuCores: 64, + CpuPower: instances.CpuPower(20608), + Mem: 262144, + VirtType: &hvm, + Cost: 5285, + }, + // SKU: 9XQJDHCZD834J68K // Instance family: General purpose // Storage: EBS only @@ -1081,6 +1120,19 @@ Cost: 183, }, + // SKU: KF2B96YA25ZRC292 + // Instance family: Memory optimized + // Storage: 1 x 1,920 + { + Name: "x1.16xlarge", + Arches: amd64, + CpuCores: 64, + CpuPower: instances.CpuPower(20608), + Mem: 999424, + VirtType: &hvm, + Cost: 9671, + }, + // SKU: KGFSNH7UYJEDWTQQ // Instance family: General purpose // Storage: EBS only @@ -1422,6 +1474,32 @@ Cost: 1516, }, + // SKU: D3KF5EAWRYNBCMNK + // Instance family: Memory optimized + // Storage: 1 x 1,920 + { + Name: "x1.16xlarge", + Arches: amd64, + CpuCores: 64, + CpuPower: instances.CpuPower(20608), + Mem: 999424, + VirtType: &hvm, + Cost: 9187, + }, + + // SKU: DDTXDG7MMJKV72FM + // Instance family: General purpose + // Storage: EBS only + { + Name: "m4.16xlarge", + Arches: amd64, + CpuCores: 64, + CpuPower: instances.CpuPower(20608), + Mem: 262144, + VirtType: &hvm, + Cost: 5400, + }, + // SKU: FQ7FVC9B3R8RBBXA // Instance family: General purpose // Storage: EBS only @@ -1768,6 +1846,19 @@ Cost: 4070, }, + // SKU: 8HKF2YYVVMBUQWDD + // Instance family: General purpose + // Storage: EBS only + { + Name: "m4.16xlarge", + Arches: amd64, + CpuCores: 64, + CpuPower: instances.CpuPower(20608), + Mem: 262144, + VirtType: &hvm, + Cost: 5685, + }, + // SKU: 8V5MYBMPUD434579 // Instance family: Compute optimized // Storage: 4 x 420 @@ -2305,6 +2396,19 @@ VirtType: &hvm, Cost: 98, }, + + // SKU: ZB3PCMUQE9XQZAHW + // Instance family: Memory optimized + // Storage: 1 x 1,920 + { + Name: "x1.16xlarge", + Arches: amd64, + CpuCores: 64, + CpuPower: instances.CpuPower(20608), + Mem: 999424, + VirtType: &hvm, + Cost: 9671, + }, }, "ap-southeast-2": { @@ -2468,6 +2572,19 @@ Cost: 93, }, + // SKU: 78Z5UDBK335DDYN5 + // Instance family: Memory optimized + // Storage: 1 x 1,920 + { + Name: "x1.16xlarge", + Arches: amd64, + CpuCores: 64, + CpuPower: instances.CpuPower(20608), + Mem: 999424, + VirtType: &hvm, + Cost: 9671, + }, + // SKU: 7NYHPHSMD45SYSNN // Instance family: General purpose // Storage: EBS only @@ -2809,6 +2926,19 @@ Cost: 200, }, + // SKU: NV37A29BHV49EC6J + // Instance family: General purpose + // Storage: EBS only + { + Name: "m4.16xlarge", + Arches: amd64, + CpuCores: 64, + CpuPower: instances.CpuPower(20608), + Mem: 262144, + VirtType: &hvm, + Cost: 5381, + }, + // SKU: R8KMJWXSQ8BJC35M // Instance family: Compute optimized // Storage: 2 x 80 SSD @@ -3141,6 +3271,19 @@ Cost: 158, }, + // SKU: 8MASRMZD7KUHQBJC + // Instance family: Memory optimized + // Storage: 1 x 1,920 + { + Name: "x1.16xlarge", + Arches: amd64, + CpuCores: 64, + CpuPower: instances.CpuPower(20608), + Mem: 999424, + VirtType: &hvm, + Cost: 9337, + }, + // SKU: ABFDCPB959KUGRH8 // Instance family: General purpose // Storage: EBS only @@ -3440,6 +3583,19 @@ Cost: 3088, }, + // SKU: QJ82YTRR8GFNUS8T + // Instance family: General purpose + // Storage: EBS only + { + Name: "m4.16xlarge", + Arches: amd64, + CpuCores: 64, + CpuPower: instances.CpuPower(20608), + Mem: 262144, + VirtType: &hvm, + Cost: 4560, + }, + // SKU: SMTUMBHX6YKRBJQB // Instance family: Storage optimized // Storage: 8 x 800 SSD @@ -3534,6 +3690,19 @@ Cost: 1470, }, + // SKU: 38KKRTQP385PX9HY + // Instance family: GPU instance + // Storage: EBS only + { + Name: "p2.8xlarge", + Arches: amd64, + CpuCores: 32, + CpuPower: instances.CpuPower(3200), + Mem: 499712, + VirtType: &hvm, + Cost: 7776, + }, + // SKU: 3H8WR8FBAE4DWNRB // Instance family: GPU instance // Storage: 2 x 840 @@ -3783,6 +3952,19 @@ Cost: 3751, }, + // SKU: F3VADBY3Z6MMHKTQ + // Instance family: Memory optimized + // Storage: 1 x 1,920 + { + Name: "x1.16xlarge", + Arches: amd64, + CpuCores: 64, + CpuPower: instances.CpuPower(20608), + Mem: 999424, + VirtType: &hvm, + Cost: 8003, + }, + // SKU: FSS42UA3US5PWMV7 // Instance family: Memory optimized // Storage: 2 x 120 SSD @@ -3864,6 +4046,19 @@ Cost: 938, }, + // SKU: KPQDNX9YMUA29HRQ + // Instance family: GPU instance + // Storage: EBS only + { + Name: "p2.xlarge", + Arches: amd64, + CpuCores: 4, + CpuPower: instances.CpuPower(400), + Mem: 62464, + VirtType: &hvm, + Cost: 972, + }, + // SKU: N6KDUVR23T758UUC // Instance family: General purpose // Storage: EBS only @@ -4023,6 +4218,19 @@ Cost: 120, }, + // SKU: RQP6UTWCTHK7X5XP + // Instance family: General purpose + // Storage: EBS only + { + Name: "m4.16xlarge", + Arches: amd64, + CpuCores: 64, + CpuPower: instances.CpuPower(20608), + Mem: 262144, + VirtType: &hvm, + Cost: 4226, + }, + // SKU: SDFJSCXXJEFDV7P2 // Instance family: General purpose // Storage: EBS only @@ -4049,6 +4257,19 @@ Cost: 14, }, + // SKU: SZGY4A8U8CBJGHRV + // Instance family: GPU instance + // Storage: EBS only + { + Name: "p2.16xlarge", + Arches: amd64, + CpuCores: 64, + CpuPower: instances.CpuPower(6400), + Mem: 786432, + VirtType: &hvm, + Cost: 15552, + }, + // SKU: T3ZC3B9VPS8PA59H // Instance family: Compute optimized // Storage: 4 x 840 @@ -4252,6 +4473,19 @@ Cost: 26010, }, + // SKU: 38R4NKAE2QECWRDD + // Instance family: General purpose + // Storage: EBS only + { + Name: "m4.2xlarge", + Arches: amd64, + CpuCores: 8, + CpuPower: instances.CpuPower(2688), + Mem: 32768, + VirtType: &hvm, + Cost: 685, + }, + // SKU: 3AW2EEGJZNBGCQTC // Instance family: General purpose // Storage: EBS only @@ -4291,6 +4525,19 @@ Cost: 163, }, + // SKU: 5V3T67JXMGR4TH34 + // Instance family: General purpose + // Storage: EBS only + { + Name: "m4.large", + Arches: amd64, + CpuCores: 2, + CpuPower: instances.CpuPower(672), + Mem: 8192, + VirtType: &hvm, + Cost: 171, + }, + // SKU: 5YDAVRN5B6TSD9NF // Instance family: Compute optimized // Storage: EBS only @@ -4372,6 +4619,19 @@ Deprecated: true, }, + // SKU: 9C4Q3RMVKSYS988K + // Instance family: General purpose + // Storage: EBS only + { + Name: "m4.xlarge", + Arches: amd64, + CpuCores: 4, + CpuPower: instances.CpuPower(1344), + Mem: 16384, + VirtType: &hvm, + Cost: 343, + }, + // SKU: ADMZJH7G4TK3XW72 // Instance family: General purpose // Storage: 1 x 4 SSD @@ -4451,6 +4711,32 @@ Cost: 1300, }, + // SKU: DYHZ6YTHR4RRH3TS + // Instance family: General purpose + // Storage: EBS only + { + Name: "m4.16xlarge", + Arches: amd64, + CpuCores: 64, + CpuPower: instances.CpuPower(20608), + Mem: 262144, + VirtType: &hvm, + Cost: 5480, + }, + + // SKU: EKJ89WCZYTF4ZNY8 + // Instance family: General purpose + // Storage: EBS only + { + Name: "m4.4xlarge", + Arches: amd64, + CpuCores: 16, + CpuPower: instances.CpuPower(5376), + Mem: 65536, + VirtType: &hvm, + Cost: 1370, + }, + // SKU: EY7JV9JX6H66P24B // Instance family: Memory optimized // Storage: 1 x 420 @@ -4465,6 +4751,19 @@ Deprecated: true, }, + // SKU: F3B7MENDPCX44NH3 + // Instance family: Memory optimized + // Storage: 1 x 1,920 + { + Name: "x1.16xlarge", + Arches: amd64, + CpuCores: 64, + CpuPower: instances.CpuPower(20608), + Mem: 999424, + VirtType: &hvm, + Cost: 13005, + }, + // SKU: FDUDDQXMYRBXXPU6 // Instance family: General purpose // Storage: 2 x 40 SSD @@ -4612,6 +4911,19 @@ Cost: 108, }, + // SKU: VZ7SHPDE4QVD6EJ6 + // Instance family: General purpose + // Storage: EBS only + { + Name: "m4.10xlarge", + Arches: amd64, + CpuCores: 40, + CpuPower: instances.CpuPower(13440), + Mem: 163840, + VirtType: &hvm, + Cost: 3425, + }, + // SKU: W6ARQS59M94CBPW2 // Instance family: Compute optimized // Storage: EBS only @@ -4800,6 +5112,19 @@ Cost: 2660, }, + // SKU: 58HUPRT96M5H8VUW + // Instance family: GPU instance + // Storage: EBS only + { + Name: "p2.xlarge", + Arches: amd64, + CpuCores: 4, + CpuPower: instances.CpuPower(400), + Mem: 62464, + VirtType: &hvm, + Cost: 900, + }, + // SKU: 5KHB4S5E8M74C6ES // Instance family: Storage optimized // Storage: 1 x 800 SSD @@ -4984,6 +5309,19 @@ Cost: 665, }, + // SKU: ECM8RSBXMC7F4WAS + // Instance family: General purpose + // Storage: EBS only + { + Name: "m4.16xlarge", + Arches: amd64, + CpuCores: 64, + CpuPower: instances.CpuPower(20608), + Mem: 262144, + VirtType: &hvm, + Cost: 3830, + }, + // SKU: EYGMRBWWFGSQBSBZ // Instance family: General purpose // Storage: 4 x 420 @@ -5302,6 +5640,19 @@ Cost: 479, }, + // SKU: WAWEH2Q4B3BTK68V + // Instance family: GPU instance + // Storage: EBS only + { + Name: "p2.8xlarge", + Arches: amd64, + CpuCores: 32, + CpuPower: instances.CpuPower(3200), + Mem: 499712, + VirtType: &hvm, + Cost: 7200, + }, + // SKU: X4RWGEB2DKQGCWC2 // Instance family: Compute optimized // Storage: 1 x 350 @@ -5329,6 +5680,19 @@ Cost: 5520, }, + // SKU: XVDMNM2WMYBYVW3T + // Instance family: GPU instance + // Storage: EBS only + { + Name: "p2.16xlarge", + Arches: amd64, + CpuCores: 64, + CpuPower: instances.CpuPower(6400), + Mem: 786432, + VirtType: &hvm, + Cost: 14400, + }, + // SKU: YGU2QZY8VPP94FSR // Instance family: General purpose // Storage: 1 x 32 SSD @@ -5342,6 +5706,19 @@ Cost: 133, }, + // SKU: YNFV4A5QUAMVDGKX + // Instance family: Memory optimized + // Storage: 1 x 1,920 + { + Name: "x1.16xlarge", + Arches: amd64, + CpuCores: 64, + CpuPower: instances.CpuPower(20608), + Mem: 999424, + VirtType: &hvm, + Cost: 6669, + }, + // SKU: YUXKRQ5SQSHVKD58 // Instance family: General purpose // Storage: 1 x 410 @@ -5396,33 +5773,426 @@ }, }, - "us-gov-west-1": { + "us-east-2": { - // SKU: 28MYFN2XX2772KFF - // Instance family: Memory optimized - // Storage: 1 x 420 + // SKU: 2N2QH6UEJZ5GUPT8 + // Instance family: General purpose + // Storage: EBS only { - Name: "m2.xlarge", - Arches: amd64, - CpuCores: 2, - CpuPower: instances.CpuPower(200), - Mem: 17511, - VirtType: ¶virtual, - Cost: 293, - Deprecated: true, + Name: "t2.medium", + Arches: both, + CpuCores: 2, + CpuPower: instances.CpuPower(40), + Mem: 4096, + VirtType: &hvm, + Cost: 52, }, - // SKU: 6CVNTPV3HMNBWRCF - // Instance family: General purpose - // Storage: 1 x 4 SSD + // SKU: 34ZEJZENQ3WGN6MA + // Instance family: Memory optimized + // Storage: 1 x 32 SSD { - Name: "m3.medium", + Name: "r3.large", Arches: amd64, - CpuCores: 1, - CpuPower: instances.CpuPower(350), - Mem: 3840, + CpuCores: 2, + CpuPower: instances.CpuPower(700), + Mem: 15616, VirtType: &hvm, - Cost: 84, + Cost: 166, + }, + + // SKU: 3VWERDY4UHEZUS9F + // Instance family: Memory optimized + // Storage: 2 x 320 SSD + { + Name: "r3.8xlarge", + Arches: amd64, + CpuCores: 32, + CpuPower: instances.CpuPower(11200), + Mem: 249856, + VirtType: &hvm, + Cost: 2660, + }, + + // SKU: 65YDGPXVA9GTBYCA + // Instance family: Storage optimized + // Storage: 3 x 2000 HDD + { + Name: "d2.xlarge", + Arches: amd64, + CpuCores: 4, + CpuPower: instances.CpuPower(1344), + Mem: 31232, + VirtType: &hvm, + Cost: 690, + }, + + // SKU: 9DMUVQNHGNHC7R92 + // Instance family: Memory optimized + // Storage: 1 x 80 SSD + { + Name: "r3.xlarge", + Arches: amd64, + CpuCores: 4, + CpuPower: instances.CpuPower(1400), + Mem: 31232, + VirtType: &hvm, + Cost: 333, + }, + + // SKU: 9F7GGKJQGM6J387N + // Instance family: Compute optimized + // Storage: EBS only + { + Name: "c4.large", + Arches: amd64, + CpuCores: 2, + CpuPower: instances.CpuPower(811), + Mem: 3840, + VirtType: &hvm, + Cost: 105, + }, + + // SKU: 9MXQF8NSPZESJJUW + // Instance family: Memory optimized + // Storage: 1 x 1,920 + { + Name: "x1.16xlarge", + Arches: amd64, + CpuCores: 64, + CpuPower: instances.CpuPower(20608), + Mem: 999424, + VirtType: &hvm, + Cost: 6669, + }, + + // SKU: AW2T9CUGJYGQKTY8 + // Instance family: Storage optimized + // Storage: 4 x 800 SSD + { + Name: "i2.4xlarge", + Arches: amd64, + CpuCores: 16, + CpuPower: instances.CpuPower(5600), + Mem: 124928, + VirtType: &hvm, + Cost: 3410, + }, + + // SKU: B7KJQVXZZNDAS23N + // Instance family: General purpose + // Storage: EBS only + { + Name: "t2.large", + Arches: amd64, + CpuCores: 2, + CpuPower: instances.CpuPower(60), + Mem: 8192, + VirtType: &hvm, + Cost: 104, + }, + + // SKU: C2XHT7MUVASJ7UQ3 + // Instance family: General purpose + // Storage: EBS only + { + Name: "m4.10xlarge", + Arches: amd64, + CpuCores: 40, + CpuPower: instances.CpuPower(13440), + Mem: 163840, + VirtType: &hvm, + Cost: 2394, + }, + + // SKU: DJPGFVCZAKBSEZ3N + // Instance family: Storage optimized + // Storage: 24 x 2000 HDD + { + Name: "d2.8xlarge", + Arches: amd64, + CpuCores: 36, + CpuPower: instances.CpuPower(12096), + Mem: 249856, + VirtType: &hvm, + Cost: 5520, + }, + + // SKU: DWQDRJ9AWUJ8BZKH + // Instance family: Memory optimized + // Storage: 2 x 1,920 + { + Name: "x1.32xlarge", + Arches: amd64, + CpuCores: 128, + CpuPower: instances.CpuPower(41216), + Mem: 1998848, + VirtType: &hvm, + Cost: 13338, + }, + + // SKU: F9GPUA3E29X6GJVE + // Instance family: General purpose + // Storage: EBS only + { + Name: "t2.micro", + Arches: both, + CpuCores: 1, + CpuPower: instances.CpuPower(10), + Mem: 1024, + VirtType: &hvm, + Cost: 13, + }, + + // SKU: GSMN37GEEUV2CC27 + // Instance family: General purpose + // Storage: EBS only + { + Name: "m4.4xlarge", + Arches: amd64, + CpuCores: 16, + CpuPower: instances.CpuPower(5376), + Mem: 65536, + VirtType: &hvm, + Cost: 958, + }, + + // SKU: GWP38ESW2CNEVPUS + // Instance family: Storage optimized + // Storage: 8 x 800 SSD + { + Name: "i2.8xlarge", + Arches: amd64, + CpuCores: 32, + CpuPower: instances.CpuPower(11200), + Mem: 249856, + VirtType: &hvm, + Cost: 6820, + }, + + // SKU: GZSHSGVERG8544YU + // Instance family: General purpose + // Storage: EBS only + { + Name: "m4.xlarge", + Arches: amd64, + CpuCores: 4, + CpuPower: instances.CpuPower(1344), + Mem: 16384, + VirtType: &hvm, + Cost: 239, + }, + + // SKU: JNBD8ZZ5JSFMNNYR + // Instance family: General purpose + // Storage: EBS only + { + Name: "t2.nano", + Arches: both, + CpuCores: 1, + CpuPower: instances.CpuPower(5), + Mem: 512, + VirtType: &hvm, + Cost: 6, + }, + + // SKU: JVT8Z9JR8H2KTMEY + // Instance family: Compute optimized + // Storage: EBS only + { + Name: "c4.8xlarge", + Arches: amd64, + CpuCores: 36, + CpuPower: instances.CpuPower(14615), + Mem: 61440, + VirtType: &hvm, + Cost: 1675, + }, + + // SKU: M6S6AKBD4WYEHANV + // Instance family: Memory optimized + // Storage: 1 x 320 SSD + { + Name: "r3.4xlarge", + Arches: amd64, + CpuCores: 16, + CpuPower: instances.CpuPower(5600), + Mem: 124928, + VirtType: &hvm, + Cost: 1330, + }, + + // SKU: MD5WDRNPRHM2XAGC + // Instance family: Compute optimized + // Storage: EBS only + { + Name: "c4.2xlarge", + Arches: amd64, + CpuCores: 8, + CpuPower: instances.CpuPower(3247), + Mem: 15360, + VirtType: &hvm, + Cost: 419, + }, + + // SKU: P3R3B44DZXKTKMYR + // Instance family: Storage optimized + // Storage: 2 x 800 SSD + { + Name: "i2.2xlarge", + Arches: amd64, + CpuCores: 8, + CpuPower: instances.CpuPower(2800), + Mem: 62464, + VirtType: &hvm, + Cost: 1705, + }, + + // SKU: PBMCNRQPJ8XA43PT + // Instance family: Storage optimized + // Storage: 6 x 2000 HDD + { + Name: "d2.2xlarge", + Arches: amd64, + CpuCores: 8, + CpuPower: instances.CpuPower(2688), + Mem: 62464, + VirtType: &hvm, + Cost: 1380, + }, + + // SKU: PSAR6KAESEV4S8JY + // Instance family: Storage optimized + // Storage: 12 x 2000 HDD + { + Name: "d2.4xlarge", + Arches: amd64, + CpuCores: 16, + CpuPower: instances.CpuPower(5376), + Mem: 124928, + VirtType: &hvm, + Cost: 2760, + }, + + // SKU: Q236HUQXMUFFR9AN + // Instance family: General purpose + // Storage: EBS only + { + Name: "m4.large", + Arches: amd64, + CpuCores: 2, + CpuPower: instances.CpuPower(672), + Mem: 8192, + VirtType: &hvm, + Cost: 120, + }, + + // SKU: R99FC88U7735H9RR + // Instance family: Compute optimized + // Storage: EBS only + { + Name: "c4.xlarge", + Arches: amd64, + CpuCores: 4, + CpuPower: instances.CpuPower(1623), + Mem: 7680, + VirtType: &hvm, + Cost: 209, + }, + + // SKU: RGU9HRNUAS2TX83W + // Instance family: Compute optimized + // Storage: EBS only + { + Name: "c4.4xlarge", + Arches: amd64, + CpuCores: 16, + CpuPower: instances.CpuPower(6495), + Mem: 30720, + VirtType: &hvm, + Cost: 838, + }, + + // SKU: RHW8EAZNVJA4KSWC + // Instance family: General purpose + // Storage: EBS only + { + Name: "m4.2xlarge", + Arches: amd64, + CpuCores: 8, + CpuPower: instances.CpuPower(2688), + Mem: 32768, + VirtType: &hvm, + Cost: 479, + }, + + // SKU: URPTCUXU96S8XJUV + // Instance family: Memory optimized + // Storage: 1 x 160 SSD + { + Name: "r3.2xlarge", + Arches: amd64, + CpuCores: 8, + CpuPower: instances.CpuPower(2800), + Mem: 62464, + VirtType: &hvm, + Cost: 665, + }, + + // SKU: Y9Z92WYATPYKXSM2 + // Instance family: Storage optimized + // Storage: 1 x 800 SSD + { + Name: "i2.xlarge", + Arches: amd64, + CpuCores: 4, + CpuPower: instances.CpuPower(1400), + Mem: 31232, + VirtType: &hvm, + Cost: 853, + }, + + // SKU: ZZNXUPSQ9BSA2M88 + // Instance family: General purpose + // Storage: EBS only + { + Name: "t2.small", + Arches: both, + CpuCores: 1, + CpuPower: instances.CpuPower(20), + Mem: 2048, + VirtType: &hvm, + Cost: 26, + }, + }, + + "us-gov-west-1": { + + // SKU: 28MYFN2XX2772KFF + // Instance family: Memory optimized + // Storage: 1 x 420 + { + Name: "m2.xlarge", + Arches: amd64, + CpuCores: 2, + CpuPower: instances.CpuPower(200), + Mem: 17511, + VirtType: ¶virtual, + Cost: 293, + Deprecated: true, + }, + + // SKU: 6CVNTPV3HMNBWRCF + // Instance family: General purpose + // Storage: 1 x 4 SSD + { + Name: "m3.medium", + Arches: amd64, + CpuCores: 1, + CpuPower: instances.CpuPower(350), + Mem: 3840, + VirtType: &hvm, + Cost: 84, }, // SKU: 6DWB5HXXA6HTFHVP @@ -5518,6 +6288,19 @@ Cost: 2016, }, + // SKU: 8GK9ASUZPC2EWUZ4 + // Instance family: General purpose + // Storage: EBS only + { + Name: "m4.large", + Arches: amd64, + CpuCores: 2, + CpuPower: instances.CpuPower(672), + Mem: 8192, + VirtType: &hvm, + Cost: 151, + }, + // SKU: 98882H5A8BVY29GC // Instance family: General purpose // Storage: 4 x 420 @@ -5692,6 +6475,32 @@ Cost: 24, }, + // SKU: HVTS332KRPZUNRU4 + // Instance family: General purpose + // Storage: EBS only + { + Name: "m4.16xlarge", + Arches: amd64, + CpuCores: 64, + CpuPower: instances.CpuPower(20608), + Mem: 262144, + VirtType: &hvm, + Cost: 4840, + }, + + // SKU: J9DSB6BXY5KQK7F9 + // Instance family: General purpose + // Storage: EBS only + { + Name: "m4.2xlarge", + Arches: amd64, + CpuCores: 8, + CpuPower: instances.CpuPower(2688), + Mem: 32768, + VirtType: &hvm, + Cost: 605, + }, + // SKU: K5CWXN5HSW7SME2R // Instance family: Memory optimized // Storage: 1 x 160 SSD @@ -5718,6 +6527,19 @@ Cost: 4091, }, + // SKU: MCV6F96BD976FX6F + // Instance family: General purpose + // Storage: EBS only + { + Name: "m4.4xlarge", + Arches: amd64, + CpuCores: 16, + CpuPower: instances.CpuPower(5376), + Mem: 65536, + VirtType: &hvm, + Cost: 1210, + }, + // SKU: N5HCW4AX6C3QWS7P // Instance family: General purpose // Storage: EBS only @@ -5744,6 +6566,32 @@ Cost: 200, }, + // SKU: PB9ZD3B8VHMC8YD9 + // Instance family: General purpose + // Storage: EBS only + { + Name: "m4.10xlarge", + Arches: amd64, + CpuCores: 40, + CpuPower: instances.CpuPower(13440), + Mem: 163840, + VirtType: &hvm, + Cost: 3025, + }, + + // SKU: PKQU74FNEQGYH8AN + // Instance family: Memory optimized + // Storage: 1 x 1,920 + { + Name: "x1.16xlarge", + Arches: amd64, + CpuCores: 64, + CpuPower: instances.CpuPower(20608), + Mem: 999424, + VirtType: &hvm, + Cost: 8003, + }, + // SKU: Q864N6CVS6UKQ3WZ // Instance family: Compute optimized // Storage: EBS only @@ -5889,6 +6737,19 @@ Cost: 3192, }, + // SKU: WVKVYKA9HGPSEYHF + // Instance family: General purpose + // Storage: EBS only + { + Name: "m4.xlarge", + Arches: amd64, + CpuCores: 4, + CpuPower: instances.CpuPower(1344), + Mem: 16384, + VirtType: &hvm, + Cost: 303, + }, + // SKU: XBS8PBKJMH9G6SDB // Instance family: Compute optimized // Storage: 4 x 420 @@ -6365,6 +7226,19 @@ Cost: 262, }, + // SKU: N63KE7N2NCMCYWXC + // Instance family: Memory optimized + // Storage: 1 x 1,920 + { + Name: "x1.16xlarge", + Arches: amd64, + CpuCores: 64, + CpuPower: instances.CpuPower(20608), + Mem: 999424, + VirtType: &hvm, + Cost: 8670, + }, + // SKU: P5VFWENV9YDAQVFH // Instance family: General purpose // Storage: 1 x 160 @@ -6483,6 +7357,19 @@ Cost: 781, }, + // SKU: VQ4GF8ZANSG56N6Z + // Instance family: General purpose + // Storage: EBS only + { + Name: "m4.16xlarge", + Arches: amd64, + CpuCores: 64, + CpuPower: instances.CpuPower(20608), + Mem: 262144, + VirtType: &hvm, + Cost: 4469, + }, + // SKU: VZ7V29X35F98VENC // Instance family: Memory optimized // Storage: 1 x 160 SSD @@ -7164,6 +8051,19 @@ Deprecated: true, }, + // SKU: PWCUVRQBX67NDRMJ + // Instance family: GPU instance + // Storage: EBS only + { + Name: "p2.8xlarge", + Arches: amd64, + CpuCores: 32, + CpuPower: instances.CpuPower(3200), + Mem: 499712, + VirtType: &hvm, + Cost: 7200, + }, + // SKU: PWGQ6MKD7A6EHVXN // Instance family: Memory optimized // Storage: 2 x 120 SSD @@ -7205,6 +8105,19 @@ Deprecated: true, }, + // SKU: TKYAD5H42TYVUTMG + // Instance family: General purpose + // Storage: EBS only + { + Name: "m4.16xlarge", + Arches: amd64, + CpuCores: 64, + CpuPower: instances.CpuPower(20608), + Mem: 262144, + VirtType: &hvm, + Cost: 3830, + }, + // SKU: UNB4R4KS4XXHQFD2 // Instance family: Compute optimized // Storage: EBS only @@ -7296,6 +8209,19 @@ Cost: 419, }, + // SKU: YKQ7DN6CCEDVB8Q2 + // Instance family: GPU instance + // Storage: EBS only + { + Name: "p2.xlarge", + Arches: amd64, + CpuCores: 4, + CpuPower: instances.CpuPower(400), + Mem: 62464, + VirtType: &hvm, + Cost: 900, + }, + // SKU: YMWQW8W92QHE628D // Instance family: Storage optimized // Storage: 3 x 2000 HDD @@ -7309,6 +8235,32 @@ Cost: 690, }, + // SKU: YT7P3Q75RMN2RX4J + // Instance family: GPU instance + // Storage: EBS only + { + Name: "p2.16xlarge", + Arches: amd64, + CpuCores: 64, + CpuPower: instances.CpuPower(6400), + Mem: 786432, + VirtType: &hvm, + Cost: 14400, + }, + + // SKU: YZN6FRZW8JHKE3HV + // Instance family: Memory optimized + // Storage: 1 x 1,920 + { + Name: "x1.16xlarge", + Arches: amd64, + CpuCores: 64, + CpuPower: instances.CpuPower(20608), + Mem: 999424, + VirtType: &hvm, + Cost: 6669, + }, + // SKU: ZKYE77DHMC32Y9BK // Instance family: Storage optimized // Storage: 2 x 800 SSD diff -Nru juju-core-2.0.0/src/github.com/juju/juju/provider/ec2/internal/ec2instancetypes/instancetypes_test.go juju-core-2.0.2/src/github.com/juju/juju/provider/ec2/internal/ec2instancetypes/instancetypes_test.go --- juju-core-2.0.0/src/github.com/juju/juju/provider/ec2/internal/ec2instancetypes/instancetypes_test.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/provider/ec2/internal/ec2instancetypes/instancetypes_test.go 2016-11-11 00:08:09.000000000 +0000 @@ -69,7 +69,10 @@ c.Assert( usEast1InstanceTypes.Difference(usWest1InstanceTypes).SortedValues(), jc.DeepEquals, - []string{"cc2.8xlarge", "cg1.4xlarge", "cr1.8xlarge", "hi1.4xlarge", "hs1.8xlarge"}, + []string{ + "cc2.8xlarge", "cg1.4xlarge", "cr1.8xlarge", "hi1.4xlarge", + "hs1.8xlarge", "p2.16xlarge", "p2.8xlarge", "p2.xlarge", + }, ) } diff -Nru juju-core-2.0.0/src/github.com/juju/juju/provider/ec2/internal/ec2instancetypes/process_cost_data.go juju-core-2.0.2/src/github.com/juju/juju/provider/ec2/internal/ec2instancetypes/process_cost_data.go --- juju-core-2.0.0/src/github.com/juju/juju/provider/ec2/internal/ec2instancetypes/process_cost_data.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/provider/ec2/internal/ec2instancetypes/process_cost_data.go 2016-11-11 00:08:09.000000000 +0000 @@ -298,6 +298,7 @@ func locationToRegion(loc string) (string, bool) { regions := map[string]string{ "US East (N. Virginia)": "us-east-1", + "US East (Ohio)": "us-east-2", "US West (N. California)": "us-west-1", "US West (Oregon)": "us-west-2", "Asia Pacific (Mumbai)": "ap-south-1", diff -Nru juju-core-2.0.0/src/github.com/juju/juju/provider/ec2/local_test.go juju-core-2.0.2/src/github.com/juju/juju/provider/ec2/local_test.go --- juju-core-2.0.0/src/github.com/juju/juju/provider/ec2/local_test.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/provider/ec2/local_test.go 2016-11-11 00:08:09.000000000 +0000 @@ -1476,17 +1476,15 @@ } func (s *localServerSuite) TestBootstrapInstanceConstraints(c *gc.C) { + c.Skip("in order to release 2.0.2, lp#1638706: environSuite.TestBootstrapInstanceConstraints fails on rare archs and series") env := s.prepareAndBootstrap(c) - inst, hc := testing.AssertStartControllerInstance(c, env, s.ControllerUUID, "1") - ec2inst := ec2.InstanceEC2(inst) - + inst, err := env.AllInstances() + c.Assert(err, jc.ErrorIsNil) + c.Assert(inst, gc.HasLen, 1) + ec2inst := ec2.InstanceEC2(inst[0]) // Controllers should be started with a burstable // instance if possible, and a 32 GiB disk. c.Assert(ec2inst.InstanceType, gc.Equals, "t2.medium") - c.Assert(*hc.Arch, gc.Equals, "amd64") - c.Assert(*hc.Mem, gc.Equals, uint64(4*1024)) - c.Assert(*hc.RootDisk, gc.Equals, uint64(32*1024)) - c.Assert(*hc.CpuCores, gc.Equals, uint64(2)) } // localNonUSEastSuite is similar to localServerSuite but the S3 mock server diff -Nru juju-core-2.0.0/src/github.com/juju/juju/provider/lxd/environ_broker.go juju-core-2.0.2/src/github.com/juju/juju/provider/lxd/environ_broker.go --- juju-core-2.0.0/src/github.com/juju/juju/provider/lxd/environ_broker.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/provider/lxd/environ_broker.go 2016-11-11 00:08:09.000000000 +0000 @@ -212,9 +212,6 @@ cloudcfg.AddRunTextFile(serverCertPath, serverState.Environment.Certificate, 0600) } - cloudcfg.SetAttr("hostname", hostname) - cloudcfg.SetAttr("manage_etc_hosts", true) - metadata, err := getMetadata(cloudcfg, args) if err != nil { return nil, errors.Trace(err) diff -Nru juju-core-2.0.0/src/github.com/juju/juju/provider/maas/constraints.go juju-core-2.0.2/src/github.com/juju/juju/provider/maas/constraints.go --- juju-core-2.0.0/src/github.com/juju/juju/provider/maas/constraints.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/provider/maas/constraints.go 2016-11-11 00:08:09.000000000 +0000 @@ -177,11 +177,10 @@ params.Add("interfaces", strings.Join(combinedBindingsString, ";")) } if len(negatives) > 0 { - negativesString := make([]string, len(negatives)) - for i, binding := range negatives { - negativesString[i] = fmt.Sprintf("space:%s", binding.SpaceProviderId) + for _, binding := range negatives { + not_network := fmt.Sprintf("space:%s", binding.SpaceProviderId) + params.Add("not_networks", not_network) } - params.Add("not_networks", strings.Join(negativesString, ",")) } return nil } diff -Nru juju-core-2.0.0/src/github.com/juju/juju/provider/maas/constraints_test.go juju-core-2.0.2/src/github.com/juju/juju/provider/maas/constraints_test.go --- juju-core-2.0.0/src/github.com/juju/juju/provider/maas/constraints_test.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/provider/maas/constraints_test.go 2016-11-11 00:08:09.000000000 +0000 @@ -386,7 +386,7 @@ nodeValues, found := requestValues["node0"] c.Assert(found, jc.IsTrue) c.Check(nodeValues[0].Get("interfaces"), gc.Equals, "0:space=2;1:space=4") - c.Check(nodeValues[0].Get("not_networks"), gc.Equals, "space:3,space:5") + c.Check(nodeValues[0]["not_networks"], jc.DeepEquals, []string{"space:3", "space:5"}) } func (suite *environSuite) createFourSpaces(c *gc.C) { diff -Nru juju-core-2.0.0/src/github.com/juju/juju/provider/maas/environ_whitebox_test.go juju-core-2.0.2/src/github.com/juju/juju/provider/maas/environ_whitebox_test.go --- juju-core-2.0.0/src/github.com/juju/juju/provider/maas/environ_whitebox_test.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/provider/maas/environ_whitebox_test.go 2016-11-11 00:08:09.000000000 +0000 @@ -144,9 +144,10 @@ suite.newNode(c, "node0", "host0", nil) suite.addSubnet(c, 9, 9, "node0") err := bootstrap.Bootstrap(envtesting.BootstrapContext(c), env, bootstrap.BootstrapParams{ - ControllerConfig: coretesting.FakeControllerConfig(), - AdminSecret: testing.AdminSecret, - CAPrivateKey: coretesting.CAKey, + ControllerConfig: coretesting.FakeControllerConfig(), + AdminSecret: testing.AdminSecret, + CAPrivateKey: coretesting.CAKey, + BootstrapConstraints: constraints.MustParse("mem=1G"), }) c.Assert(err, jc.ErrorIsNil) // The bootstrap node has been acquired and started. @@ -340,9 +341,10 @@ suite.newNode(c, "thenode", "host", nil) suite.addSubnet(c, 9, 9, "thenode") err := bootstrap.Bootstrap(envtesting.BootstrapContext(c), env, bootstrap.BootstrapParams{ - ControllerConfig: coretesting.FakeControllerConfig(), - AdminSecret: testing.AdminSecret, - CAPrivateKey: coretesting.CAKey, + ControllerConfig: coretesting.FakeControllerConfig(), + AdminSecret: testing.AdminSecret, + CAPrivateKey: coretesting.CAKey, + BootstrapConstraints: constraints.MustParse("mem=1G"), }) c.Assert(err, jc.ErrorIsNil) } @@ -355,9 +357,10 @@ // Ensure node will not be reported as deployed by changing its status. suite.testMAASObject.TestServer.ChangeNode("thenode", "status", "4") err := bootstrap.Bootstrap(envtesting.BootstrapContext(c), env, bootstrap.BootstrapParams{ - ControllerConfig: coretesting.FakeControllerConfig(), - AdminSecret: testing.AdminSecret, - CAPrivateKey: coretesting.CAKey, + ControllerConfig: coretesting.FakeControllerConfig(), + AdminSecret: testing.AdminSecret, + CAPrivateKey: coretesting.CAKey, + BootstrapConstraints: constraints.MustParse("mem=1G"), }) c.Assert(err, gc.ErrorMatches, "bootstrap instance started but did not change to Deployed state.*") } @@ -370,9 +373,10 @@ // Set the node status to "Failed deployment" suite.testMAASObject.TestServer.ChangeNode("thenode", "status", "11") err := bootstrap.Bootstrap(envtesting.BootstrapContext(c), env, bootstrap.BootstrapParams{ - ControllerConfig: coretesting.FakeControllerConfig(), - AdminSecret: testing.AdminSecret, - CAPrivateKey: coretesting.CAKey, + ControllerConfig: coretesting.FakeControllerConfig(), + AdminSecret: testing.AdminSecret, + CAPrivateKey: coretesting.CAKey, + BootstrapConstraints: constraints.MustParse("mem=1G"), }) c.Assert(err, gc.ErrorMatches, "bootstrap instance started but did not change to Deployed state. instance \"/api/.*/nodes/thenode/\" failed to deploy") } @@ -395,9 +399,10 @@ suite.setupFakeTools(c) env := suite.makeEnviron() err := bootstrap.Bootstrap(envtesting.BootstrapContext(c), env, bootstrap.BootstrapParams{ - ControllerConfig: coretesting.FakeControllerConfig(), - AdminSecret: testing.AdminSecret, - CAPrivateKey: coretesting.CAKey, + ControllerConfig: coretesting.FakeControllerConfig(), + AdminSecret: testing.AdminSecret, + CAPrivateKey: coretesting.CAKey, + BootstrapConstraints: constraints.MustParse("mem=1G"), }) // Since there are no nodes, the attempt to allocate one returns a // 409: Conflict. @@ -903,10 +908,11 @@ s.setupFakeTools(c) env := s.makeEnviron() err := bootstrap.Bootstrap(envtesting.BootstrapContext(c), env, bootstrap.BootstrapParams{ - ControllerConfig: coretesting.FakeControllerConfig(), - Placement: "bootstrap-host", - AdminSecret: testing.AdminSecret, - CAPrivateKey: coretesting.CAKey, + ControllerConfig: coretesting.FakeControllerConfig(), + Placement: "bootstrap-host", + AdminSecret: testing.AdminSecret, + CAPrivateKey: coretesting.CAKey, + BootstrapConstraints: constraints.MustParse("mem=1G"), }) c.Assert(err, jc.ErrorIsNil) return env @@ -998,6 +1004,7 @@ c.Assert(s.testMAASObject.TestServer.NodesOperationRequestValues(), gc.DeepEquals, []url.Values{{ "name": []string{"bootstrap-host"}, "agent_name": []string{env.Config().UUID()}, + "mem": []string{"1024"}, }, { "zone": []string{"zone1"}, "agent_name": []string{env.Config().UUID()}, diff -Nru juju-core-2.0.0/src/github.com/juju/juju/provider/openstack/cinder.go juju-core-2.0.2/src/github.com/juju/juju/provider/openstack/cinder.go --- juju-core-2.0.0/src/github.com/juju/juju/provider/openstack/cinder.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/provider/openstack/cinder.go 2016-11-11 00:08:09.000000000 +0000 @@ -381,11 +381,14 @@ return nil, err } } + if novaAttachment.Device == nil { + return nil, errors.Errorf("device not assigned to volume attachment") + } return &storage.VolumeAttachment{ arg.Volume, arg.Machine, storage.VolumeAttachmentInfo{ - DeviceName: novaAttachment.Device[len("/dev/"):], + DeviceName: (*novaAttachment.Device)[len("/dev/"):], }, }, nil } diff -Nru juju-core-2.0.0/src/github.com/juju/juju/provider/openstack/cinder_test.go juju-core-2.0.2/src/github.com/juju/juju/provider/openstack/cinder_test.go --- juju-core-2.0.0/src/github.com/juju/juju/provider/openstack/cinder_test.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/provider/openstack/cinder_test.go 2016-11-11 00:08:09.000000000 +0000 @@ -48,6 +48,10 @@ openstack.CinderAttempt.Delay = 0 } +func toStringPtr(s string) *string { + return &s +} + func (s *cinderVolumeSourceSuite) TestAttachVolumes(c *gc.C) { mockAdapter := &mockAdapter{ attachVolume: func(serverId, volId, mountPoint string) (*nova.VolumeAttachment, error) { @@ -57,7 +61,7 @@ Id: volId, VolumeId: volId, ServerId: serverId, - Device: "/dev/sda", + Device: toStringPtr("/dev/sda"), }, nil }, } @@ -84,6 +88,33 @@ }}) } +func (s *cinderVolumeSourceSuite) TestAttachVolumesNoDevice(c *gc.C) { + mockAdapter := &mockAdapter{ + attachVolume: func(serverId, volId, mountPoint string) (*nova.VolumeAttachment, error) { + return &nova.VolumeAttachment{ + Id: volId, + VolumeId: volId, + ServerId: serverId, + Device: nil, + }, nil + }, + } + + volSource := openstack.NewCinderVolumeSource(mockAdapter) + results, err := volSource.AttachVolumes([]storage.VolumeAttachmentParams{{ + Volume: mockVolumeTag, + VolumeId: mockVolId, + AttachmentParams: storage.AttachmentParams{ + Provider: openstack.CinderProviderType, + Machine: mockMachineTag, + InstanceId: instance.Id(mockServerId), + }}, + }) + c.Assert(err, jc.ErrorIsNil) + c.Assert(results, gc.HasLen, 1) + c.Assert(results[0].Error, gc.ErrorMatches, "device not assigned to volume attachment") +} + func (s *cinderVolumeSourceSuite) TestCreateVolume(c *gc.C) { const ( requestedSize = 2 * 1024 @@ -122,7 +153,7 @@ Id: volId, VolumeId: volId, ServerId: serverId, - Device: "/dev/sda", + Device: toStringPtr("/dev/sda"), }, nil }, } @@ -185,7 +216,7 @@ Id: volId, VolumeId: volId, ServerId: serverId, - Device: "/dev/sda", + Device: toStringPtr("/dev/sda"), }, nil }, } @@ -316,7 +347,7 @@ Id: mockVolId, VolumeId: mockVolId, ServerId: mockServerId, - Device: "/dev/sda", + Device: toStringPtr("/dev/sda"), }}, nil }, detachVolume: func(serverId, volId string) error { diff -Nru juju-core-2.0.0/src/github.com/juju/juju/provider/openstack/export_test.go juju-core-2.0.2/src/github.com/juju/juju/provider/openstack/export_test.go --- juju-core-2.0.0/src/github.com/juju/juju/provider/openstack/export_test.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/provider/openstack/export_test.go 2016-11-11 00:08:09.000000000 +0000 @@ -443,7 +443,7 @@ } func GetSwiftURL(e environs.Environ) (string, error) { - return e.(*Environ).client.MakeServiceURL("object-store", nil) + return e.(*Environ).client.MakeServiceURL("object-store", "", nil) } func SetUseFloatingIP(e environs.Environ, val bool) { @@ -501,6 +501,5 @@ var RuleMatchesPortRange = ruleMatchesPortRange var MakeServiceURL = &makeServiceURL -var ProviderInstance = providerInstance var GetVolumeEndpointURL = getVolumeEndpointURL diff -Nru juju-core-2.0.0/src/github.com/juju/juju/provider/openstack/firewaller.go juju-core-2.0.2/src/github.com/juju/juju/provider/openstack/firewaller.go --- juju-core-2.0.0/src/github.com/juju/juju/provider/openstack/firewaller.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/provider/openstack/firewaller.go 2016-11-11 00:08:09.000000000 +0000 @@ -253,7 +253,7 @@ } for _, group := range securityGroups { if re.MatchString(group.Name) { - deleteSecurityGroup(novaClient, group.Name, group.Id) + deleteSecurityGroup(novaClient, group.Name, group.Id, clock.WallClock) } } return nil @@ -278,7 +278,7 @@ // terminated and hence attempt to delete the security groups but nova still // has it around internally. To attempt to catch this timing issue, deletion // of the groups is tried multiple times. -func deleteSecurityGroup(novaclient *nova.Client, name, id string) { +func deleteSecurityGroup(novaclient *nova.Client, name, id string, clock clock.Clock) { logger.Debugf("deleting security group %q", name) err := retry.Call(retry.CallArgs{ Func: func() error { @@ -295,11 +295,7 @@ }, Attempts: 30, Delay: time.Second, - // TODO(dimitern): This should be fixed to take a clock.Clock arg, not - // hard-coded WallClock, like in provider/ec2/securitygroups_test.go! - // See PR juju:#5197, especially the code around autoAdvancingClock. - // LP Bug: http://pad.lv/1580626. - Clock: clock.WallClock, + Clock: clock, }) if err != nil { logger.Warningf("cannot delete security group %q. Used by another model?", name) diff -Nru juju-core-2.0.0/src/github.com/juju/juju/provider/openstack/live_test.go juju-core-2.0.2/src/github.com/juju/juju/provider/openstack/live_test.go --- juju-core-2.0.0/src/github.com/juju/juju/provider/openstack/live_test.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/provider/openstack/live_test.go 2016-11-11 00:08:09.000000000 +0000 @@ -88,7 +88,7 @@ cl := client.NewClient(t.cred, identity.AuthUserPass, nil) err := cl.Authenticate() c.Assert(err, jc.ErrorIsNil) - containerURL, err := cl.MakeServiceURL("object-store", nil) + containerURL, err := cl.MakeServiceURL("object-store", "", nil) c.Assert(err, jc.ErrorIsNil) t.TestConfig = t.TestConfig.Merge(coretesting.Attrs{ "agent-metadata-url": containerURL + "/juju-dist-test/tools", diff -Nru juju-core-2.0.0/src/github.com/juju/juju/provider/openstack/local_test.go juju-core-2.0.2/src/github.com/juju/juju/provider/openstack/local_test.go --- juju-core-2.0.0/src/github.com/juju/juju/provider/openstack/local_test.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/provider/openstack/local_test.go 2016-11-11 00:08:09.000000000 +0000 @@ -8,13 +8,12 @@ "errors" "fmt" "io/ioutil" - "net/http" - "net/http/httptest" "net/url" "os" "path/filepath" "regexp" "strings" + "time" jujuerrors "github.com/juju/errors" gitjujutesting "github.com/juju/testing" @@ -29,7 +28,6 @@ "gopkg.in/goose.v1/identity" "gopkg.in/goose.v1/nova" "gopkg.in/goose.v1/testservices/hook" - "gopkg.in/goose.v1/testservices/identityservice" "gopkg.in/goose.v1/testservices/novaservice" "gopkg.in/goose.v1/testservices/openstackservice" @@ -105,32 +103,24 @@ // localServer is used to spin up a local Openstack service double. type localServer struct { - Server *httptest.Server - Mux *http.ServeMux - oldHandler http.Handler + Openstack *openstackservice.Openstack Nova *novaservice.Nova restoreTimeouts func() UseTLS bool } -type newOpenstackFunc func(*http.ServeMux, *identity.Credentials, identity.AuthMode) *novaservice.Nova +type newOpenstackFunc func(*identity.Credentials, identity.AuthMode, bool) (*openstackservice.Openstack, []string) func (s *localServer) start( c *gc.C, cred *identity.Credentials, newOpenstackFunc newOpenstackFunc, ) { - // Set up the HTTP server. - if s.UseTLS { - s.Server = httptest.NewTLSServer(nil) - } else { - s.Server = httptest.NewServer(nil) - } - c.Assert(s.Server, gc.NotNil) - s.oldHandler = s.Server.Config.Handler - s.Mux = http.NewServeMux() - s.Server.Config.Handler = s.Mux - cred.URL = s.Server.URL - c.Logf("Started service at: %v", s.Server.URL) - s.Nova = newOpenstackFunc(s.Mux, cred, identity.AuthUserPass) + var logMsg []string + s.Openstack, logMsg = newOpenstackFunc(cred, identity.AuthUserPass, s.UseTLS) + s.Openstack.SetupHTTP(nil) + s.Nova = s.Openstack.Nova + for _, msg := range logMsg { + c.Logf("%v", msg) + } s.restoreTimeouts = envtesting.PatchAttemptStrategies(openstack.ShortAttempt, openstack.StorageAttempt) s.Nova.SetAvailabilityZones( nova.AvailabilityZone{Name: "test-unavailable"}, @@ -144,9 +134,7 @@ } func (s *localServer) stop() { - s.Mux = nil - s.Server.Config.Handler = s.oldHandler - s.Server.Close() + s.Openstack.Stop() s.restoreTimeouts() } @@ -167,7 +155,7 @@ s.BaseSuite.SetUpSuite(c) c.Logf("Running live tests using openstack service test double") - s.srv.start(c, s.cred, newFullOpenstackService) + s.srv.start(c, s.cred, openstackservice.New) // Set credentials to use when bootstrapping. Must be done after // starting server to get the auth URL. @@ -224,7 +212,7 @@ func (s *localServerSuite) SetUpTest(c *gc.C) { s.BaseSuite.SetUpTest(c) - s.srv.start(c, s.cred, newFullOpenstackService) + s.srv.start(c, s.cred, openstackservice.New) // Set credentials to use when bootstrapping. Must be done after // starting server to get the auth URL. @@ -235,7 +223,7 @@ cl := client.NewClient(s.cred, identity.AuthUserPass, nil) err := cl.Authenticate() c.Assert(err, jc.ErrorIsNil) - containerURL, err := cl.MakeServiceURL("object-store", nil) + containerURL, err := cl.MakeServiceURL("object-store", "", nil) c.Assert(err, jc.ErrorIsNil) s.TestConfig = s.TestConfig.Merge(coretesting.Attrs{ "agent-metadata-url": containerURL + "/juju-dist-test/tools", @@ -564,6 +552,12 @@ fmt.Sprintf("juju-%v-%v-%v", s.ControllerUUID, modelUUID, instanceName), } assertSecurityGroups(c, env, allSecurityGroups) + + // Make time advance in zero time + clk := gitjujutesting.NewClock(time.Time{}) + clock := gitjujutesting.AutoAdvancingClock{clk, clk.Advance} + env.(*openstack.Environ).SetClock(&clock) + err := env.StopInstances(inst.Id()) c.Assert(err, jc.ErrorIsNil) assertSecurityGroups(c, env, allSecurityGroups) @@ -930,7 +924,7 @@ } func (s *localServerSuite) TestGetImageMetadataSourcesNoProductStreams(c *gc.C) { - s.PatchValue(openstack.MakeServiceURL, func(client.AuthenticatingClient, string, []string) (string, error) { + s.PatchValue(openstack.MakeServiceURL, func(client.AuthenticatingClient, string, string, []string) (string, error) { return "", errors.New("cannae do it captain") }) env := s.Open(c, s.env.Config()) @@ -1233,7 +1227,7 @@ cl := client.NewNonValidatingClient(s.cred, identity.AuthUserPass, nil) err := cl.Authenticate() c.Assert(err, jc.ErrorIsNil) - containerURL, err := cl.MakeServiceURL("object-store", nil) + containerURL, err := cl.MakeServiceURL("object-store", "", nil) c.Assert(err, jc.ErrorIsNil) c.Check(containerURL[:8], gc.Equals, "https://") attrs["agent-metadata-url"] = containerURL + "/juju-dist-test/tools" @@ -1254,7 +1248,7 @@ TenantName: "some tenant", } // Note: start() will change cred.URL to point to s.srv.Server.URL - s.srv.start(c, cred, newFullOpenstackService) + s.srv.start(c, cred, openstackservice.New) s.cred = cred attrs := s.createConfigAttrs(c) c.Assert(attrs["auth-url"].(string)[:8], gc.Equals, "https://") @@ -1871,7 +1865,7 @@ Region: "some-region", TenantName: "some tenant", } - s.srv.start(c, s.cred, newNovaOnlyOpenstackService) + s.srv.start(c, s.cred, openstackservice.NewNoSwift) attrs := coretesting.FakeConfig().Merge(coretesting.Attrs{ "name": "sample-no-swift", @@ -1921,30 +1915,6 @@ c.Assert(err, jc.ErrorIsNil) } -func newFullOpenstackService(mux *http.ServeMux, cred *identity.Credentials, auth identity.AuthMode) *novaservice.Nova { - service := openstackservice.New(cred, auth) - service.SetupHTTP(mux) - return service.Nova -} - -func newNovaOnlyOpenstackService(mux *http.ServeMux, cred *identity.Credentials, auth identity.AuthMode) *novaservice.Nova { - var identityService, fallbackService identityservice.IdentityService - if auth == identity.AuthKeyPair { - identityService = identityservice.NewKeyPair() - } else { - identityService = identityservice.NewUserPass() - fallbackService = identityservice.NewV3UserPass() - } - userInfo := identityService.AddUser(cred.User, cred.Secrets, cred.TenantName) - if cred.TenantName == "" { - panic("Openstack service double requires a tenant to be specified.") - } - novaService := novaservice.New(cred.URL, "v2", userInfo.TenantId, cred.Region, identityService, fallbackService) - identityService.SetupHTTP(mux) - novaService.SetupHTTP(mux) - return novaService -} - func bootstrapEnv(c *gc.C, env environs.Environ) error { return bootstrap.Bootstrap(envtesting.BootstrapContext(c), env, bootstrap.BootstrapParams{ ControllerConfig: coretesting.FakeControllerConfig(), diff -Nru juju-core-2.0.0/src/github.com/juju/juju/provider/openstack/provider.go juju-core-2.0.2/src/github.com/juju/juju/provider/openstack/provider.go --- juju-core-2.0.0/src/github.com/juju/juju/provider/openstack/provider.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/provider/openstack/provider.go 2016-11-11 00:08:09.000000000 +0000 @@ -38,6 +38,7 @@ "github.com/juju/juju/state" "github.com/juju/juju/status" "github.com/juju/juju/tools" + "github.com/juju/utils/clock" ) var logger = loggo.GetLogger("juju.provider.openstack") @@ -87,6 +88,7 @@ uuid: uuid, cloud: args.Cloud, namespace: namespace, + clock: clock.WallClock, } e.firewaller = p.FirewallerFactory.GetFirewaller(e) e.configurator = p.Configurator @@ -175,6 +177,9 @@ availabilityZones []common.AvailabilityZone firewaller Firewaller configurator ProviderConfigurator + + // Clock is defined so it can be replaced for testing + clock clock.Clock } var _ environs.Environ = (*Environ)(nil) @@ -625,6 +630,13 @@ // By default, the client requires "compute" and // "object-store". Juju only requires "compute". client.SetRequiredServiceTypes([]string{"compute"}) + + // By default, the client performs API version discovery. + // Because we're using some deprecated endpoints, we have + // to be careful not to use too new a version. Disable + // discovery until we've moved off those deprecated APIs. + client.SetVersionDiscoveryEnabled(false) + return client, nil } @@ -671,17 +683,35 @@ func identityClientVersion(authURL string) (int, error) { url, err := url.Parse(authURL) if err != nil { - return -1, err - } else if url.Path == "" { - return -1, err + // Return 0 as this is the lowest invalid number according to openstack codebase: + // -1 is reserved and has special handling; 1, 2, 3, etc are valid identity client versions. + return 0, err + } + if url.Path == authURL { + // This means we could not parse URL into url structure + // with protocols, domain, port, etc. + // For example, specifying "keystone.foo" instead of "https://keystone.foo:443/v3/" + // falls into this category. + return 0, errors.Errorf("url %s is malformed", authURL) + } + if url.Path == "" || url.Path == "/" { + // User explicitely did not provide any version, it is empty. + return -1, nil } // The last part of the path should be the version #. // Example: https://keystone.foo:443/v3/ - logger.Tracef("authURL: %s", authURL) - versionNumStr := url.Path[2:] - if versionNumStr[len(versionNumStr)-1] == '/' { - versionNumStr = versionNumStr[:len(versionNumStr)-1] + versionNumStr := strings.TrimPrefix(strings.ToLower(url.Path), "/v") + versionNumStr = strings.TrimSuffix(versionNumStr, "/") + if versionNumStr == url.Path || versionNumStr == "" { + // If nothing was trimmed, version specification was malformed. + // If nothing was left after trim, version number is not provided and, + // hence, version specification was malformed. + // At this stage only '/Vxxx' and '/vxxx' are valid where xxx is major.minor version. + // Return 0 as this is the lowest invalid number according to openstack codebase: + // -1 is reserved and has special handling; 1, 2, 3, etc are valid identity client versions. + return 0, errors.NotValidf("version part of identity url %s", authURL) } + logger.Tracef("authURL: %s", authURL) major, _, err := version.ParseMajorMinor(versionNumStr) return major, err } @@ -718,7 +748,7 @@ } } - url, err := makeServiceURL(e.client, keystoneName, nil) + url, err := makeServiceURL(e.client, keystoneName, "", nil) if err != nil { return nil, errors.NewNotSupported(err, fmt.Sprintf("cannot make service URL: %v", err)) } @@ -1351,7 +1381,7 @@ for _, securityGroup := range allSecurityGroups { for _, name := range securityGroupNames { if securityGroup.Name == name { - deleteSecurityGroup(novaclient, name, securityGroup.Id) + deleteSecurityGroup(novaclient, name, securityGroup.Id, e.clock) break } } @@ -1414,6 +1444,10 @@ return nil } +func (e *Environ) SetClock(clock clock.Clock) { + e.clock = clock +} + func validateCloudSpec(spec environs.CloudSpec) error { if err := spec.Validate(); err != nil { return errors.Trace(err) diff -Nru juju-core-2.0.0/src/github.com/juju/juju/provider/openstack/provider_test.go juju-core-2.0.2/src/github.com/juju/juju/provider/openstack/provider_test.go --- juju-core-2.0.0/src/github.com/juju/juju/provider/openstack/provider_test.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/provider/openstack/provider_test.go 2016-11-11 00:08:09.000000000 +0000 @@ -4,6 +4,8 @@ package openstack import ( + "fmt" + gitjujutesting "github.com/juju/testing" jc "github.com/juju/testing/checkers" gc "gopkg.in/check.v1" @@ -356,9 +358,23 @@ var _ = gc.Suite(&providerUnitTests{}) +func (s *providerUnitTests) checkIdentityClientVersionInvalid(c *gc.C, url string) { + _, err := identityClientVersion(url) + c.Check(err, gc.ErrorMatches, fmt.Sprintf("version part of identity url %s not valid", url)) +} + func (s *providerUnitTests) TestIdentityClientVersion_BadURLErrors(c *gc.C) { + s.checkIdentityClientVersionInvalid(c, "https://keystone.internal/a") + s.checkIdentityClientVersionInvalid(c, "https://keystone.internal/v") + s.checkIdentityClientVersionInvalid(c, "https://keystone.internal/V") + s.checkIdentityClientVersionInvalid(c, "https://keystone.internal/V/") + s.checkIdentityClientVersionInvalid(c, "https://keystone.internal/100") + _, err := identityClientVersion("abc123") - c.Check(err, gc.Not(jc.ErrorIsNil)) + c.Check(err, gc.ErrorMatches, `url abc123 is malformed`) + + _, err = identityClientVersion("https://keystone.internal/vot") + c.Check(err, gc.ErrorMatches, `invalid major version number ot: strconv.ParseInt: parsing "ot": invalid syntax`) } func (s *providerUnitTests) TestIdentityClientVersion_ParsesGoodURL(c *gc.C) { @@ -373,4 +389,14 @@ version, err = identityClientVersion("https://keystone.internal/v2/") c.Assert(err, jc.ErrorIsNil) c.Check(version, gc.Equals, 2) + + version, err = identityClientVersion("https://keystone.internal/V2/") + c.Assert(err, jc.ErrorIsNil) + c.Check(version, gc.Equals, 2) + + _, err = identityClientVersion("https://keystone.internal") + c.Check(err, jc.ErrorIsNil) + + _, err = identityClientVersion("https://keystone.internal/") + c.Check(err, jc.ErrorIsNil) } diff -Nru juju-core-2.0.0/src/github.com/juju/juju/provider/vsphere/client.go juju-core-2.0.2/src/github.com/juju/juju/provider/vsphere/client.go --- juju-core-2.0.0/src/github.com/juju/juju/provider/vsphere/client.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/provider/vsphere/client.go 2016-11-11 00:08:09.000000000 +0000 @@ -11,12 +11,12 @@ "strings" "github.com/juju/errors" - "github.com/juju/govmomi" - "github.com/juju/govmomi/find" - "github.com/juju/govmomi/list" - "github.com/juju/govmomi/object" - "github.com/juju/govmomi/property" - "github.com/juju/govmomi/vim25/mo" + "github.com/vmware/govmomi" + "github.com/vmware/govmomi/find" + "github.com/vmware/govmomi/list" + "github.com/vmware/govmomi/object" + "github.com/vmware/govmomi/property" + "github.com/vmware/govmomi/vim25/mo" "golang.org/x/net/context" "github.com/juju/juju/environs" @@ -33,50 +33,62 @@ ) type client struct { - connection *govmomi.Client - datacenter *object.Datacenter - finder *find.Finder - recurser *list.Recurser + connectionURL *url.URL + cloud environs.CloudSpec } -var newClient = func(cloud environs.CloudSpec) (*client, error) { +var newConnection = func(url *url.URL) (*govmomi.Client, func() error, error) { + conn, err := govmomi.NewClient(context.TODO(), url, true) + if err != nil { + return nil, nil, errors.Trace(err) + } + logout := func() error { + return conn.Logout(context.TODO()) + } + + return conn, logout, nil + +} + +func (c *client) connection() (*govmomi.Client, func() error, error) { + return newConnection(c.connectionURL) +} + +func (c *client) recurser(conn *govmomi.Client) *list.Recurser { + return &list.Recurser{ + Collector: property.DefaultCollector(conn.Client), + All: true, + } +} + +func (c *client) finder(conn *govmomi.Client) (*find.Finder, *object.Datacenter, error) { + finder := find.NewFinder(conn.Client, true) + datacenter, err := finder.Datacenter(context.TODO(), c.cloud.Region) + if err != nil { + return nil, nil, errors.Trace(err) + } + finder.SetDatacenter(datacenter) + return finder, datacenter, nil +} - credAttrs := cloud.Credential.Attributes() +var newClient = func(cloudSpec environs.CloudSpec) (*client, error) { + + credAttrs := cloudSpec.Credential.Attributes() username := credAttrs[credAttrUser] password := credAttrs[credAttrPassword] connURL := &url.URL{ Scheme: "https", User: url.UserPassword(username, password), - Host: cloud.Endpoint, + Host: cloudSpec.Endpoint, Path: "/sdk", } - connection, err := newConnection(connURL) - if err != nil { - return nil, errors.Trace(err) - } - finder := find.NewFinder(connection.Client, true) - datacenter, err := finder.Datacenter(context.TODO(), cloud.Region) - if err != nil { - return nil, errors.Trace(err) - } - finder.SetDatacenter(datacenter) - recurser := &list.Recurser{ - Collector: property.DefaultCollector(connection.Client), - All: true, - } return &client{ - connection: connection, - datacenter: datacenter, - finder: finder, - recurser: recurser, + connectionURL: connURL, + cloud: cloudSpec, }, nil } -var newConnection = func(url *url.URL) (*govmomi.Client, error) { - return govmomi.NewClient(context.TODO(), url, true) -} - type instanceSpec struct { machineID string zone *vmwareAvailZone @@ -91,7 +103,16 @@ // CreateInstance create new vm in vsphere and run it func (c *client) CreateInstance(ecfg *environConfig, spec *instanceSpec) (*mo.VirtualMachine, error) { - manager := &ovaImportManager{client: c} + conn, closer, err := c.connection() + if err != nil { + return nil, errors.Trace(err) + } + defer closer() + + manager := &ovaImportManager{ + client: conn, + providerClient: c, + } vm, err := manager.importOva(ecfg, spec) if err != nil { return nil, errors.Annotatef(err, "Failed to import OVA file") @@ -120,7 +141,8 @@ } } var res mo.VirtualMachine - err = c.connection.RetrieveOne(context.TODO(), *taskInfo.Entity, nil, &res) + + err = conn.RetrieveOne(context.TODO(), *taskInfo.Entity, nil, &res) if err != nil { return nil, errors.Trace(err) } @@ -131,8 +153,18 @@ func (c *client) RemoveInstances(ids ...string) error { var lastError error tasks := make([]*object.Task, 0, len(ids)) + conn, closer, err := c.connection() + if err != nil { + return errors.Trace(err) + } + defer closer() + finder, _, err := c.finder(conn) + if err != nil { + return errors.Trace(err) + } + for _, id := range ids { - vm, err := c.finder.VirtualMachine(context.TODO(), id) + vm, err := finder.VirtualMachine(context.TODO(), id) if err != nil { lastError = err logger.Errorf(err.Error()) @@ -168,16 +200,27 @@ // Instances return list of all vms in the system, that match naming convention func (c *client) Instances(prefix string) ([]*mo.VirtualMachine, error) { - items, err := c.finder.VirtualMachineList(context.TODO(), "*") + conn, closer, err := c.connection() + if err != nil { + return nil, errors.Trace(err) + } + defer closer() + finder, _, err := c.finder(conn) + if err != nil { + return nil, errors.Trace(err) + } + items, err := finder.VirtualMachineList(context.TODO(), "*") if err != nil { return nil, errors.Trace(err) } var vms []*mo.VirtualMachine vms = make([]*mo.VirtualMachine, 0, len(vms)) + for _, item := range items { var vm mo.VirtualMachine - err = c.connection.RetrieveOne(context.TODO(), item.Reference(), nil, &vm) + + err = conn.RetrieveOne(context.TODO(), item.Reference(), nil, &vm) if err != nil { return nil, errors.Trace(err) } @@ -191,7 +234,7 @@ // Refresh refreshes the virtual machine func (c *client) Refresh(v *mo.VirtualMachine) error { - vm, err := c.getVm(v.Name) + vm, err := c.vm(v.Name) if err != nil { return errors.Trace(err) } @@ -199,13 +242,24 @@ return nil } -func (c *client) getVm(name string) (*mo.VirtualMachine, error) { - item, err := c.finder.VirtualMachine(context.TODO(), name) +func (c *client) vm(name string) (*mo.VirtualMachine, error) { + conn, closer, err := c.connection() + if err != nil { + return nil, errors.Trace(err) + } + defer closer() + finder, _, err := c.finder(conn) + if err != nil { + return nil, errors.Trace(err) + } + + item, err := finder.VirtualMachine(context.TODO(), name) if err != nil { return nil, errors.Trace(err) } var vm mo.VirtualMachine - err = c.connection.RetrieveOne(context.TODO(), item.Reference(), nil, &vm) + + err = conn.RetrieveOne(context.TODO(), item.Reference(), nil, &vm) if err != nil { return nil, errors.Trace(err) } @@ -214,14 +268,25 @@ //AvailabilityZones retuns list of all root compute resources in the system func (c *client) AvailabilityZones() ([]*mo.ComputeResource, error) { - folders, err := c.datacenter.Folders(context.TODO()) + conn, closer, err := c.connection() + if err != nil { + return nil, errors.Trace(err) + } + defer closer() + _, datacenter, err := c.finder(conn) + if err != nil { + return nil, errors.Trace(err) + } + + folders, err := datacenter.Folders(context.TODO()) if err != nil { return nil, errors.Trace(err) } root := list.Element{ Object: folders.HostFolder, } - es, err := c.recurser.Recurse(context.TODO(), root, []string{"*"}) + + es, err := c.recurser(conn).Recurse(context.TODO(), root, []string{"*"}) if err != nil { return nil, err } @@ -240,7 +305,7 @@ } func (c *client) GetNetworkInterfaces(inst instance.Id, ecfg *environConfig) ([]network.InterfaceInfo, error) { - vm, err := c.getVm(string(inst)) + vm, err := c.vm(string(inst)) if err != nil { return nil, errors.Trace(err) } @@ -254,7 +319,7 @@ ipScope = network.ScopePublic } res = append(res, network.InterfaceInfo{ - DeviceIndex: net.DeviceConfigId, + DeviceIndex: int(net.DeviceConfigId), MACAddress: net.MacAddress, Disabled: !net.Connected, ProviderId: network.Id(fmt.Sprintf("net-device%d", net.DeviceConfigId)), @@ -271,7 +336,7 @@ if len(ids) == 0 { return nil, errors.Errorf("subnetIds must not be empty") } - vm, err := c.getVm(string(inst)) + vm, err := c.vm(string(inst)) if err != nil { return nil, errors.Trace(err) } diff -Nru juju-core-2.0.0/src/github.com/juju/juju/provider/vsphere/environ_availzones.go juju-core-2.0.2/src/github.com/juju/juju/provider/vsphere/environ_availzones.go --- juju-core-2.0.0/src/github.com/juju/juju/provider/vsphere/environ_availzones.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/provider/vsphere/environ_availzones.go 2016-11-11 00:08:09.000000000 +0000 @@ -7,7 +7,7 @@ import ( "github.com/juju/errors" - "github.com/juju/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/mo" "github.com/juju/juju/environs" "github.com/juju/juju/instance" diff -Nru juju-core-2.0.0/src/github.com/juju/juju/provider/vsphere/environ_availzones_test.go juju-core-2.0.2/src/github.com/juju/juju/provider/vsphere/environ_availzones_test.go --- juju-core-2.0.0/src/github.com/juju/juju/provider/vsphere/environ_availzones_test.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/provider/vsphere/environ_availzones_test.go 2016-11-11 00:08:09.000000000 +0000 @@ -24,7 +24,10 @@ } func (s *environAvailzonesSuite) TestAvailabilityZones(c *gc.C) { - client := vsphere.ExposeEnvFakeClient(s.Env) + client, closer, err := vsphere.ExposeEnvFakeClient(s.Env) + c.Assert(err, jc.ErrorIsNil) + defer closer() + s.FakeClient = client s.FakeAvailabilityZones(client, "z1", "z2") zones, err := s.Env.AvailabilityZones() @@ -35,13 +38,17 @@ } func (s *environAvailzonesSuite) TestInstanceAvailabilityZoneNames(c *gc.C) { - client := vsphere.ExposeEnvFakeClient(s.Env) + client, closer, err := vsphere.ExposeEnvFakeClient(s.Env) + c.Assert(err, jc.ErrorIsNil) + defer closer() + s.FakeClient = client client.SetPropertyProxyHandler("FakeDatacenter", vsphere.RetrieveDatacenterProperties) namespace, err := instance.NewNamespace(s.Env.Config().UUID()) c.Assert(err, jc.ErrorIsNil) vmName, err := namespace.Hostname("1") c.Assert(err, jc.ErrorIsNil) s.FakeInstancesWithResourcePool(client, vsphere.InstRp{Inst: vmName, Rp: "rp1"}) + s.FakeClient.SetPropertyProxyHandler("FakeRootFolder", vsphere.RetrieveDatacenter) s.FakeAvailabilityZonesWithResourcePool(client, vsphere.ZoneRp{Zone: "z1", Rp: "rp1"}, vsphere.ZoneRp{Zone: "z2", Rp: "rp2"}) zones, err := s.Env.InstanceAvailabilityZoneNames([]instance.Id{instance.Id(vmName)}) diff -Nru juju-core-2.0.0/src/github.com/juju/juju/provider/vsphere/environ_broker.go juju-core-2.0.2/src/github.com/juju/juju/provider/vsphere/environ_broker.go --- juju-core-2.0.0/src/github.com/juju/juju/provider/vsphere/environ_broker.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/provider/vsphere/environ_broker.go 2016-11-11 00:08:09.000000000 +0000 @@ -7,7 +7,7 @@ import ( "github.com/juju/errors" - "github.com/juju/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/mo" "github.com/juju/juju/cloudconfig/cloudinit" "github.com/juju/juju/cloudconfig/instancecfg" diff -Nru juju-core-2.0.0/src/github.com/juju/juju/provider/vsphere/environ_broker_test.go juju-core-2.0.2/src/github.com/juju/juju/provider/vsphere/environ_broker_test.go --- juju-core-2.0.0/src/github.com/juju/juju/provider/vsphere/environ_broker_test.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/provider/vsphere/environ_broker_test.go 2016-11-11 00:08:09.000000000 +0000 @@ -7,12 +7,12 @@ import ( "github.com/juju/errors" - "github.com/juju/govmomi/vim25/methods" - "github.com/juju/govmomi/vim25/soap" - "github.com/juju/govmomi/vim25/types" jc "github.com/juju/testing/checkers" "github.com/juju/utils/arch" "github.com/juju/version" + "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/soap" + "github.com/vmware/govmomi/vim25/types" gc "gopkg.in/check.v1" "github.com/juju/juju/cloudconfig/instancecfg" @@ -33,14 +33,13 @@ var _ = gc.Suite(&environBrokerSuite{}) -func (s *environBrokerSuite) SetUpTest(c *gc.C) { - s.BaseSuite.SetUpTest(c) -} - func (s *environBrokerSuite) PrepareStartInstanceFakes(c *gc.C) { imagetesting.PatchOfficialDataSources(&s.CleanupSuite, "") - client := vsphere.ExposeEnvFakeClient(s.Env) + client, closer, err := vsphere.ExposeEnvFakeClient(s.Env) + c.Assert(err, jc.ErrorIsNil) + defer closer() + s.FakeClient = client client.SetPropertyProxyHandler("FakeDatacenter", vsphere.RetrieveDatacenterProperties) s.FakeInstances(client) s.FakeAvailabilityZones(client, "z1") @@ -49,6 +48,27 @@ s.FakeCreateInstance(client, s.ServerURL, c) } +func (s *environBrokerSuite) PrepareStartInstanceFakesForNewImplementation(c *gc.C) { + imagetesting.PatchOfficialDataSources(&s.CleanupSuite, "") + + client, closer, err := vsphere.ExposeEnvFakeClient(s.Env) + c.Assert(err, jc.ErrorIsNil) + defer closer() + s.FakeClient = client + s.FakeAvailabilityZones(client, "z1") + s.FakeClient.SetPropertyProxyHandler("FakeRootFolder", vsphere.RetrieveDatacenter) + s.FakeCreateInstance(client, s.ServerURL, c) +} + +func (s *environBrokerSuite) fakeAvailabilityZonesAllocations() { + fakeAZAllocations := func(env common.ZonedEnviron, group []instance.Id) ([]common.AvailabilityZoneInstances, error) { + return []common.AvailabilityZoneInstances{ + {ZoneName: "z1"}, + }, nil + } + s.PatchValue(&vsphere.AvailabilityZoneAllocations, fakeAZAllocations) +} + func (s *environBrokerSuite) CreateStartInstanceArgs(c *gc.C) environs.StartInstanceParams { tools := []*coretools.Tools{{ Version: version.Binary{Arch: arch.AMD64, Series: "trusty"}, @@ -75,7 +95,8 @@ } func (s *environBrokerSuite) TestStartInstance(c *gc.C) { - s.PrepareStartInstanceFakes(c) + s.PrepareStartInstanceFakesForNewImplementation(c) + s.fakeAvailabilityZonesAllocations() startInstArgs := s.CreateStartInstanceArgs(c) _, err := s.Env.StartInstance(startInstArgs) @@ -93,7 +114,7 @@ // if tools for multiple architectures are avaliable, provider should filter tools by arch of the selected image func (s *environBrokerSuite) TestStartInstanceFilterToolByArch(c *gc.C) { - s.PrepareStartInstanceFakes(c) + s.PrepareStartInstanceFakesForNewImplementation(c) startInstArgs := s.CreateStartInstanceArgs(c) tools := []*coretools.Tools{{ Version: version.Binary{Arch: arch.I386, Series: "trusty"}, @@ -108,6 +129,7 @@ tools[0], }) c.Assert(err, jc.ErrorIsNil) + s.fakeAvailabilityZonesAllocations() res, err := s.Env.StartInstance(startInstArgs) c.Assert(err, jc.ErrorIsNil) @@ -116,7 +138,8 @@ } func (s *environBrokerSuite) TestStartInstanceDefaultConstraintsApplied(c *gc.C) { - s.PrepareStartInstanceFakes(c) + s.PrepareStartInstanceFakesForNewImplementation(c) + s.fakeAvailabilityZonesAllocations() startInstArgs := s.CreateStartInstanceArgs(c) res, err := s.Env.StartInstance(startInstArgs) @@ -128,7 +151,8 @@ } func (s *environBrokerSuite) TestStartInstanceCustomConstraintsApplied(c *gc.C) { - s.PrepareStartInstanceFakes(c) + s.PrepareStartInstanceFakesForNewImplementation(c) + s.fakeAvailabilityZonesAllocations() startInstArgs := s.CreateStartInstanceArgs(c) cpuCores := uint64(4) startInstArgs.Constraints.CpuCores = &cpuCores @@ -159,7 +183,8 @@ } func (s *environBrokerSuite) TestStartInstanceDefaultDiskSizeIsUsedForSmallConstraintValue(c *gc.C) { - s.PrepareStartInstanceFakes(c) + s.fakeAvailabilityZonesAllocations() + s.PrepareStartInstanceFakesForNewImplementation(c) startInstArgs := s.CreateStartInstanceArgs(c) rootDisk := uint64(1000) startInstArgs.Constraints.RootDisk = &rootDisk @@ -177,13 +202,18 @@ } func (s *environBrokerSuite) TestStartInstanceSelectZone(c *gc.C) { - client := vsphere.ExposeEnvFakeClient(s.Env) + client, closer, err := vsphere.ExposeEnvFakeClient(s.Env) + c.Assert(err, jc.ErrorIsNil) + defer closer() + s.FakeClient = client s.FakeAvailabilityZones(client, "z1", "z2") + client.SetPropertyProxyHandler("FakeRootFolder", vsphere.RetrieveDatacenter) s.FakeAvailabilityZones(client, "z1", "z2") + client.SetPropertyProxyHandler("FakeRootFolder", vsphere.RetrieveDatacenter) s.FakeCreateInstance(client, s.ServerURL, c) startInstArgs := s.CreateStartInstanceArgs(c) startInstArgs.Placement = "zone=z2" - _, err := s.Env.StartInstance(startInstArgs) + _, err = s.Env.StartInstance(startInstArgs) c.Assert(err, jc.ErrorIsNil) } @@ -203,12 +233,26 @@ } func (s *environBrokerSuite) TestStartInstanceTriesToCreateInstanceInAllAvailabilityZones(c *gc.C) { - client := vsphere.ExposeEnvFakeClient(s.Env) - client.SetPropertyProxyHandler("FakeDatacenter", vsphere.RetrieveDatacenterProperties) - s.FakeInstances(client) - s.FakeAvailabilityZones(client, "z1", "z2") + client, closer, err := vsphere.ExposeEnvFakeClient(s.Env) + c.Assert(err, jc.ErrorIsNil) + defer closer() + s.FakeClient = client s.FakeAvailabilityZones(client, "z1", "z2") + client.SetPropertyProxyHandler("FakeRootFolder", vsphere.RetrieveDatacenter) + client.SetPropertyProxyHandler("FakeDatacenter", vsphere.RetrieveDatacenterProperties) + + client.SetPropertyProxyHandler("FakeRootFolder", vsphere.RetrieveDatacenter) s.FakeAvailabilityZones(client, "z1", "z2") + client.SetPropertyProxyHandler("FakeRootFolder", vsphere.RetrieveDatacenter) + + fakeAZAllocations := func(env common.ZonedEnviron, group []instance.Id) ([]common.AvailabilityZoneInstances, error) { + return []common.AvailabilityZoneInstances{ + {ZoneName: "z1"}, + {ZoneName: "z2"}, + }, nil + } + s.PatchValue(&vsphere.AvailabilityZoneAllocations, fakeAZAllocations) + client.SetPropertyProxyHandler("FakeDatacenter", vsphere.RetrieveDatacenterProperties) client.SetProxyHandler("CreateImportSpec", func(req, res soap.HasFault) { resBody := res.(*methods.CreateImportSpecBody) @@ -233,6 +277,6 @@ } }) startInstArgs := s.CreateStartInstanceArgs(c) - _, err := s.Env.StartInstance(startInstArgs) + _, err = s.Env.StartInstance(startInstArgs) c.Assert(err, gc.ErrorMatches, "Can't create instance in any of availability zones, last error: Failed to import OVA file: Error zone 2") } diff -Nru juju-core-2.0.0/src/github.com/juju/juju/provider/vsphere/environ.go juju-core-2.0.2/src/github.com/juju/juju/provider/vsphere/environ.go --- juju-core-2.0.0/src/github.com/juju/juju/provider/vsphere/environ.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/provider/vsphere/environ.go 2016-11-11 00:08:09.000000000 +0000 @@ -16,9 +16,6 @@ "github.com/juju/juju/provider/common" ) -// TODO(ericsnow) All imports from github.com/juju/govmomi should change -// back to github.com/vmware/govmomi once our min Go is 1.3 or higher. - // Note: This provider/environment does *not* implement storage. type environ struct { diff -Nru juju-core-2.0.0/src/github.com/juju/juju/provider/vsphere/environ_instance_test.go juju-core-2.0.2/src/github.com/juju/juju/provider/vsphere/environ_instance_test.go --- juju-core-2.0.0/src/github.com/juju/juju/provider/vsphere/environ_instance_test.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/provider/vsphere/environ_instance_test.go 2016-11-11 00:08:09.000000000 +0000 @@ -35,7 +35,10 @@ } func (s *environInstanceSuite) TestInstances(c *gc.C) { - client := vsphere.ExposeEnvFakeClient(s.Env) + client, closer, err := vsphere.ExposeEnvFakeClient(s.Env) + c.Assert(err, jc.ErrorIsNil) + defer closer() + s.FakeClient = client client.SetPropertyProxyHandler("FakeDatacenter", vsphere.RetrieveDatacenterProperties) vmName1 := s.machineName(c, "1") vmName2 := s.machineName(c, "2") @@ -50,23 +53,29 @@ } func (s *environInstanceSuite) TestInstancesReturnNoInstances(c *gc.C) { - client := vsphere.ExposeEnvFakeClient(s.Env) + client, closer, err := vsphere.ExposeEnvFakeClient(s.Env) + c.Assert(err, jc.ErrorIsNil) + defer closer() + s.FakeClient = client client.SetPropertyProxyHandler("FakeDatacenter", vsphere.RetrieveDatacenterProperties) s.FakeInstancesWithResourcePool(client, vsphere.InstRp{Inst: "Some name that don't match naming convention", Rp: "rp1"}) - _, err := s.Env.Instances([]instance.Id{instance.Id("Some other name")}) + _, err = s.Env.Instances([]instance.Id{instance.Id("Some other name")}) c.Assert(err, gc.Equals, environs.ErrNoInstances) } func (s *environInstanceSuite) TestInstancesReturnPartialInstances(c *gc.C) { - client := vsphere.ExposeEnvFakeClient(s.Env) + client, closer, err := vsphere.ExposeEnvFakeClient(s.Env) + c.Assert(err, jc.ErrorIsNil) + defer closer() client.SetPropertyProxyHandler("FakeDatacenter", vsphere.RetrieveDatacenterProperties) vmName1 := s.machineName(c, "1") vmName2 := s.machineName(c, "2") s.FakeInstancesWithResourcePool(client, vsphere.InstRp{Inst: vmName1, Rp: "rp1"}, vsphere.InstRp{Inst: "Some inst", Rp: "rp2"}) - _, err := s.Env.Instances([]instance.Id{instance.Id(vmName1), instance.Id(vmName2)}) + s.FakeClient = client + _, err = s.Env.Instances([]instance.Id{instance.Id(vmName1), instance.Id(vmName2)}) c.Assert(err, gc.Equals, environs.ErrPartialInstances) } diff -Nru juju-core-2.0.0/src/github.com/juju/juju/provider/vsphere/export_test.go juju-core-2.0.2/src/github.com/juju/juju/provider/vsphere/export_test.go --- juju-core-2.0.0/src/github.com/juju/juju/provider/vsphere/export_test.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/provider/vsphere/export_test.go 2016-11-11 00:08:09.000000000 +0000 @@ -13,8 +13,10 @@ Provider environs.EnvironProvider = providerInstance ) -func ExposeEnvFakeClient(env *environ) *fakeClient { - return env.client.connection.RoundTripper.(*fakeClient) +func ExposeEnvFakeClient(env *environ) (*fakeClient, func() error, error) { + conn, closer, err := env.client.connection() + closer = func() error { return nil } + return conn.RoundTripper.(*fakeClient), closer, err } var _ environs.Environ = (*environ)(nil) diff -Nru juju-core-2.0.0/src/github.com/juju/juju/provider/vsphere/fake_methods_test.go juju-core-2.0.2/src/github.com/juju/juju/provider/vsphere/fake_methods_test.go --- juju-core-2.0.0/src/github.com/juju/juju/provider/vsphere/fake_methods_test.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/provider/vsphere/fake_methods_test.go 2016-11-11 00:08:09.000000000 +0000 @@ -11,10 +11,10 @@ "io/ioutil" "net/http" - "github.com/juju/govmomi/vim25/methods" - "github.com/juju/govmomi/vim25/soap" - "github.com/juju/govmomi/vim25/types" jc "github.com/juju/testing/checkers" + "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/soap" + "github.com/vmware/govmomi/vim25/types" gc "gopkg.in/check.v1" ) diff -Nru juju-core-2.0.0/src/github.com/juju/juju/provider/vsphere/instance.go juju-core-2.0.2/src/github.com/juju/juju/provider/vsphere/instance.go --- juju-core-2.0.0/src/github.com/juju/juju/provider/vsphere/instance.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/provider/vsphere/instance.go 2016-11-11 00:08:09.000000000 +0000 @@ -7,7 +7,7 @@ import ( "github.com/juju/errors" - "github.com/juju/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/mo" "github.com/juju/juju/instance" "github.com/juju/juju/network" @@ -53,11 +53,7 @@ res := make([]network.Address, 0) for _, net := range inst.base.Guest.Net { for _, ip := range net.IpAddress { - scope := network.ScopeCloudLocal - if net.Network == inst.env.ecfg.externalNetwork() { - scope = network.ScopePublic - } - res = append(res, network.NewScopedAddress(ip, scope)) + res = append(res, network.NewAddress(ip)) } } return res, nil diff -Nru juju-core-2.0.0/src/github.com/juju/juju/provider/vsphere/ova_import_manager.go juju-core-2.0.2/src/github.com/juju/juju/provider/vsphere/ova_import_manager.go --- juju-core-2.0.0/src/github.com/juju/juju/provider/vsphere/ova_import_manager.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/provider/vsphere/ova_import_manager.go 2016-11-11 00:08:09.000000000 +0000 @@ -15,10 +15,11 @@ "path/filepath" "github.com/juju/errors" - "github.com/juju/govmomi/object" - "github.com/juju/govmomi/vim25/progress" - "github.com/juju/govmomi/vim25/soap" - "github.com/juju/govmomi/vim25/types" + "github.com/vmware/govmomi" + "github.com/vmware/govmomi/object" + "github.com/vmware/govmomi/vim25/progress" + "github.com/vmware/govmomi/vim25/soap" + "github.com/vmware/govmomi/vim25/types" "golang.org/x/net/context" ) @@ -46,11 +47,17 @@ } type ovaImportManager struct { - client *client + client *govmomi.Client + providerClient *client } func (m *ovaImportManager) importOva(ecfg *environConfig, instSpec *instanceSpec) (*object.VirtualMachine, error) { - folders, err := m.client.datacenter.Folders(context.TODO()) + _, datacenter, err := m.providerClient.finder(m.client) + if err != nil { + return nil, errors.Trace(err) + } + + folders, err := datacenter.Folders(context.TODO()) if err != nil { return nil, errors.Trace(err) } @@ -77,9 +84,9 @@ }, } - ovfManager := object.NewOvfManager(m.client.connection.Client) - resourcePool := object.NewReference(m.client.connection.Client, *instSpec.zone.r.ResourcePool) - datastore := object.NewReference(m.client.connection.Client, instSpec.zone.r.Datastore[0]) + ovfManager := object.NewOvfManager(m.client.Client) + resourcePool := object.NewReference(m.client.Client, *instSpec.zone.r.ResourcePool) + datastore := object.NewReference(m.client.Client, instSpec.zone.r.Datastore[0]) spec, err := ovfManager.CreateImportSpec(context.TODO(), string(ovf), resourcePool, datastore, cisp) if err != nil { return nil, errors.Trace(err) @@ -89,11 +96,19 @@ return nil, errors.New(spec.Error[0].LocalizedMessage) } s := &spec.ImportSpec.(*types.VirtualMachineImportSpec).ConfigSpec - s.NumCPUs = int(*instSpec.hwc.CpuCores) - s.MemoryMB = int64(*instSpec.hwc.Mem) + if instSpec.hwc.CpuCores != nil { + s.NumCPUs = int32(*instSpec.hwc.CpuCores) + } + if instSpec.hwc.Mem != nil { + s.MemoryMB = int64(*instSpec.hwc.Mem) + } + var cpuPower int64 + if instSpec.hwc.CpuPower != nil { + cpuPower = int64(*instSpec.hwc.CpuPower) + } s.CpuAllocation = &types.ResourceAllocationInfo{ - Limit: int64(*instSpec.hwc.CpuPower), - Reservation: int64(*instSpec.hwc.CpuPower), + Limit: cpuPower, + Reservation: cpuPower, } s.ExtraConfig = append(s.ExtraConfig, &types.OptionValue{ Key: metadataKeyControllerUUID, Value: instSpec.controllerUUID, @@ -105,13 +120,22 @@ } for _, d := range s.DeviceChange { if disk, ok := d.GetVirtualDeviceConfigSpec().Device.(*types.VirtualDisk); ok { - if disk.CapacityInKB < int64(*instSpec.hwc.RootDisk*1024) { - disk.CapacityInKB = int64(*instSpec.hwc.RootDisk * 1024) + var rootDisk int64 + if instSpec.hwc.RootDisk != nil { + rootDisk = int64(*instSpec.hwc.RootDisk * 1024) + } + if disk.CapacityInKB < rootDisk { + disk.CapacityInKB = rootDisk } //Set UnitNumber to -1 if it is unset in ovf file template (in this case it is parces as 0) //but 0 causes an error for disk devices - if disk.UnitNumber == 0 { - disk.UnitNumber = -1 + var unitNumber int32 + if disk.UnitNumber != nil { + unitNumber = *disk.UnitNumber + } + if unitNumber == 0 { + unitNumber = -1 + disk.UnitNumber = &unitNumber } } } @@ -135,7 +159,7 @@ }, }) } - rp := object.NewResourcePool(m.client.connection.Client, *instSpec.zone.r.ResourcePool) + rp := object.NewResourcePool(m.client.Client, *instSpec.zone.r.ResourcePool) lease, err := rp.ImportVApp(context.TODO(), spec.ImportSpec, folders.VmFolder, nil) if err != nil { return nil, errors.Annotatef(err, "failed to import vapp") @@ -152,7 +176,7 @@ continue } - u, err := m.client.connection.Client.ParseURL(device.Url) + u, err := m.client.Client.ParseURL(device.Url) if err != nil { return nil, errors.Trace(err) } @@ -173,7 +197,7 @@ } } lease.HttpNfcLeaseComplete(context.TODO()) - return object.NewVirtualMachine(m.client.connection.Client, info.Entity), nil + return object.NewVirtualMachine(m.client.Client, info.Entity), nil } func (m *ovaImportManager) downloadOva(basePath, url string) (string, error) { @@ -272,7 +296,8 @@ } } }() - err = m.client.connection.Client.Upload(f, ofi.url, &opts) + + err = m.client.Client.Upload(f, ofi.url, &opts) if err == nil { logger.Debugf("Image uploaded") } diff -Nru juju-core-2.0.0/src/github.com/juju/juju/provider/vsphere/testing_test.go juju-core-2.0.2/src/github.com/juju/juju/provider/vsphere/testing_test.go --- juju-core-2.0.0/src/github.com/juju/juju/provider/vsphere/testing_test.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/provider/vsphere/testing_test.go 2016-11-11 00:08:09.000000000 +0000 @@ -12,13 +12,13 @@ "reflect" "github.com/juju/errors" - "github.com/juju/govmomi" - "github.com/juju/govmomi/session" - "github.com/juju/govmomi/vim25" - "github.com/juju/govmomi/vim25/methods" - "github.com/juju/govmomi/vim25/soap" - "github.com/juju/govmomi/vim25/types" jc "github.com/juju/testing/checkers" + "github.com/vmware/govmomi" + "github.com/vmware/govmomi/session" + "github.com/vmware/govmomi/vim25" + "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/soap" + "github.com/vmware/govmomi/vim25/types" "golang.org/x/net/context" gc "gopkg.in/check.v1" @@ -61,12 +61,46 @@ EnvConfig *environConfig Env *environ - ServeMux *http.ServeMux - ServerURL string + ServeMux *http.ServeMux + ServerURL string + FakeClient *fakeClient } func (s *BaseSuite) SetUpTest(c *gc.C) { s.FakeJujuXDGDataHomeSuite.SetUpTest(c) + s.FakeClient = &fakeClient{ + handlers: make([]fakeAPICall, 0, 100), + propertyHandlers: make([]fakePropertiesCall, 0, 100), + } + + newFakeConnection := func(url *url.URL) (*govmomi.Client, func() error, error) { + logger.Debugf("CONNECT") + fakeClient := s.FakeClient + if len(fakeClient.propertyHandlers) == 0 { + fakeClient.SetPropertyProxyHandler("FakeRootFolder", RetrieveDatacenter) + } + vimClient := &vim25.Client{ + Client: &soap.Client{}, + ServiceContent: types.ServiceContent{ + RootFolder: types.ManagedObjectReference{ + Type: "Folder", + Value: "FakeRootFolder", + }, + OvfManager: &types.ManagedObjectReference{ + Type: "OvfManager", + Value: "FakeOvfManager", + }, + }, + RoundTripper: fakeClient, + } + + c := &govmomi.Client{ + Client: vimClient, + SessionManager: session.NewManager(vimClient), + } + fakeLogout := func() error { return nil } + return c, fakeLogout, nil + } s.PatchValue(&newConnection, newFakeConnection) s.initEnv(c) @@ -160,36 +194,6 @@ c.propertyHandlers = append(c.propertyHandlers, fakePropertiesCall{object: obj, handler: handler}) } -var newFakeConnection = func(url *url.URL) (*govmomi.Client, error) { - fakeClient := &fakeClient{ - handlers: make([]fakeAPICall, 0, 100), - propertyHandlers: make([]fakePropertiesCall, 0, 100), - } - - fakeClient.SetPropertyProxyHandler("FakeRootFolder", RetrieveDatacenter) - - vimClient := &vim25.Client{ - Client: &soap.Client{}, - ServiceContent: types.ServiceContent{ - RootFolder: types.ManagedObjectReference{ - Type: "Folder", - Value: "FakeRootFolder", - }, - OvfManager: &types.ManagedObjectReference{ - Type: "OvfManager", - Value: "FakeOvfManager", - }, - }, - RoundTripper: fakeClient, - } - - c := &govmomi.Client{ - Client: vimClient, - SessionManager: session.NewManager(vimClient), - } - return c, nil -} - var CommonRetrieveProperties = func(resBody *methods.RetrievePropertiesBody, objType, objValue, propName string, propValue interface{}) { resBody.Res = &types.RetrievePropertiesResponse{ Returnval: []types.ObjectContent{ diff -Nru juju-core-2.0.0/src/github.com/juju/juju/resource/resourceadapters/apiclient.go juju-core-2.0.2/src/github.com/juju/juju/resource/resourceadapters/apiclient.go --- juju-core-2.0.0/src/github.com/juju/juju/resource/resourceadapters/apiclient.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/resource/resourceadapters/apiclient.go 2016-11-11 00:08:09.000000000 +0000 @@ -22,7 +22,7 @@ if err != nil { return nil, errors.Trace(err) } - // The apiCaller takes care of prepending /environment/. + // The apiCaller takes care of prepending /environment/. apiClient := client.NewClient(caller, httpClient, apiCaller) return apiClient, nil } diff -Nru juju-core-2.0.0/src/github.com/juju/juju/scripts/win-installer/setup.iss juju-core-2.0.2/src/github.com/juju/juju/scripts/win-installer/setup.iss --- juju-core-2.0.0/src/github.com/juju/juju/scripts/win-installer/setup.iss 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/scripts/win-installer/setup.iss 2016-11-11 00:08:09.000000000 +0000 @@ -2,7 +2,7 @@ ; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES! #define MyAppName "Juju" -#define MyAppVersion "2.0.0" +#define MyAppVersion "2.0.2" #define MyAppPublisher "Canonical, Ltd" #define MyAppURL "http://jujucharms.com/" #define MyAppExeName "juju.exe" diff -Nru juju-core-2.0.0/src/github.com/juju/juju/state/allcollections.go juju-core-2.0.2/src/github.com/juju/juju/state/allcollections.go --- juju-core-2.0.0/src/github.com/juju/juju/state/allcollections.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/state/allcollections.go 2016-11-11 00:08:09.000000000 +0000 @@ -4,8 +4,10 @@ package state import ( + "github.com/juju/utils/featureflag" "gopkg.in/mgo.v2" + "github.com/juju/juju/feature" "github.com/juju/juju/state/bakerystorage" ) @@ -44,7 +46,7 @@ // collections, please document them, and make an effort to put them in an // appropriate section. func allCollections() collectionSchema { - return collectionSchema{ + result := collectionSchema{ // Infrastructure collections // ========================== @@ -396,6 +398,26 @@ rawAccess: true, }, } + if featureflag.Enabled(feature.CrossModelRelations) { + for name, details := range map[string]collectionInfo{ + applicationOffersC: { + indexes: []mgo.Index{{Key: []string{"model-uuid", "url"}}}, + }, + // This collection holds information about applications that have been + // offered (exported) for use in other models managed by the same + // host controller. + localApplicationDirectoryC: { + global: true, + indexes: []mgo.Index{{ + Key: []string{"url"}, + }}, + }, + remoteApplicationsC: {}, + } { + result[name] = details + } + } + return result } // These constants are used to avoid sprinkling the package with any more @@ -478,4 +500,9 @@ volumeAttachmentsC = "volumeattachments" volumesC = "volumes" // "resources" (see resource/persistence/mongo.go) + + // Cross model relations + localApplicationDirectoryC = "localapplicationdirectory" + applicationOffersC = "applicationOffers" + remoteApplicationsC = "remoteApplications" ) diff -Nru juju-core-2.0.0/src/github.com/juju/juju/state/allwatcher.go juju-core-2.0.2/src/github.com/juju/juju/state/allwatcher.go --- juju-core-2.0.0/src/github.com/juju/juju/state/allwatcher.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/state/allwatcher.go 2016-11-11 00:08:09.000000000 +0000 @@ -8,9 +8,11 @@ "strings" "github.com/juju/errors" + "github.com/juju/utils/featureflag" "gopkg.in/juju/names.v2" "gopkg.in/mgo.v2" + "github.com/juju/juju/feature" "github.com/juju/juju/network" "github.com/juju/juju/state/multiwatcher" "github.com/juju/juju/state/watcher" @@ -89,6 +91,8 @@ case openedPortsC: collection.docType = reflect.TypeOf(backingOpenedPorts{}) collection.subsidiary = true + case remoteApplicationsC: + collection.docType = reflect.TypeOf(backingRemoteApplication{}) default: panic(errors.Errorf("unknown collection %q", collName)) } @@ -400,12 +404,7 @@ } info.Constraints = c needConfig = true - // Fetch the status. - application, err := st.Application(svc.Name) - if err != nil { - return errors.Trace(err) - } - applicationStatus, err := application.Status() + applicationStatus, err := getStatus(st, key, "application") if err != nil { return errors.Annotatef(err, "reading application status for key %s", key) } @@ -467,6 +466,55 @@ return svc.DocID } +type backingRemoteApplication remoteApplicationDoc + +func (svc *backingRemoteApplication) updated(st *State, store *multiwatcherStore, id string) error { + if svc.Name == "" { + return errors.Errorf("remote application name is not set") + } + info := &multiwatcher.RemoteApplicationInfo{ + ModelUUID: st.ModelUUID(), + Name: svc.Name, + ApplicationURL: svc.URL, + Life: multiwatcher.Life(svc.Life.String()), + } + oldInfo := store.Get(info.EntityId()) + if oldInfo == nil { + logger.Debugf("new remote application %q added to backing state", svc.Name) + // Fetch the status. + key := remoteApplicationGlobalKey(svc.Name) + serviceStatus, err := getStatus(st, key, "remote application") + if err != nil { + return errors.Annotatef(err, "reading remote application status for key %s", key) + } + info.Status = multiwatcher.StatusInfo{ + Current: serviceStatus.Status, + Message: serviceStatus.Message, + Data: normaliseStatusData(serviceStatus.Data), + Since: serviceStatus.Since, + } + logger.Debugf("service status %#v", info.Status) + } + if store.Get(info.EntityId()) == nil { + logger.Debugf("new remote application %q added to backing state", svc.Name) + } + store.Update(info) + return nil +} + +func (svc *backingRemoteApplication) removed(store *multiwatcherStore, modelUUID, id string, _ *State) error { + store.Remove(multiwatcher.EntityId{ + Kind: "remoteApplication", + ModelUUID: modelUUID, + Id: id, + }) + return nil +} + +func (svc *backingRemoteApplication) mongoId() string { + return svc.DocID +} + type backingAction actionDoc func (a *backingAction) mongoId() string { @@ -626,6 +674,10 @@ newInfo := *info newInfo.Status = s.toStatusInfo() info0 = &newInfo + case *multiwatcher.RemoteApplicationInfo: + newInfo := *info + newInfo.Status = s.toStatusInfo() + info0 = &newInfo case *multiwatcher.MachineInfo: newInfo := *info // lets dissambiguate between juju machine agent and provider instance statuses. @@ -954,6 +1006,11 @@ ModelUUID: modelUUID, Name: id, }).EntityId(), true + case 'c': + return (&multiwatcher.RemoteApplicationInfo{ + ModelUUID: modelUUID, + Name: id, + }).EntityId(), true default: return multiwatcher.EntityId{}, false } @@ -985,6 +1042,7 @@ machinesC, unitsC, applicationsC, + remoteApplicationsC, relationsC, annotationsC, statusesC, @@ -994,6 +1052,12 @@ actionsC, blocksC, ) + if featureflag.Enabled(feature.CrossModelRelations) { + crossModelCollections := makeAllWatcherCollectionInfo(remoteApplicationsC) + for name, w := range crossModelCollections { + collections[name] = w + } + } return &allWatcherStateBacking{ st: st, watcher: st.workers.TxnLogWatcher(), @@ -1073,6 +1137,12 @@ settingsC, openedPortsC, ) + if featureflag.Enabled(feature.CrossModelRelations) { + crossModelCollections := makeAllWatcherCollectionInfo(remoteApplicationsC) + for name, w := range crossModelCollections { + collections[name] = w + } + } return &allModelWatcherStateBacking{ st: st, watcher: st.workers.TxnLogWatcher(), diff -Nru juju-core-2.0.0/src/github.com/juju/juju/state/allwatcher_internal_test.go juju-core-2.0.2/src/github.com/juju/juju/state/allwatcher_internal_test.go --- juju-core-2.0.0/src/github.com/juju/juju/state/allwatcher_internal_test.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/state/allwatcher_internal_test.go 2016-11-11 00:08:09.000000000 +0000 @@ -6,6 +6,7 @@ import ( "fmt" "sort" + "time" "github.com/juju/errors" "github.com/juju/loggo" @@ -29,6 +30,7 @@ _ backingEntityDoc = (*backingMachine)(nil) _ backingEntityDoc = (*backingUnit)(nil) _ backingEntityDoc = (*backingApplication)(nil) + _ backingEntityDoc = (*backingRemoteApplication)(nil) _ backingEntityDoc = (*backingRelation)(nil) _ backingEntityDoc = (*backingAnnotation)(nil) _ backingEntityDoc = (*backingStatus)(nil) @@ -286,9 +288,45 @@ }, }) } + + _, remoteApplicationInfo := addTestingRemoteApplication( + c, st, "remote-mysql", "local:/u/me/mysql", mysqlRelations, + ) + add(&remoteApplicationInfo) return } +var mysqlRelations = []charm.Relation{{ + Name: "db", + Role: "provider", + Scope: charm.ScopeGlobal, + Interface: "mysql", +}, { + Name: "nrpe-external-master", + Role: "provider", + Scope: charm.ScopeGlobal, + Interface: "nrpe-external-master", +}} + +func addTestingRemoteApplication( + c *gc.C, st *State, name, url string, relations []charm.Relation, +) (*RemoteApplication, multiwatcher.RemoteApplicationInfo) { + + rs, err := st.AddRemoteApplication(name, url, relations) + c.Assert(err, jc.ErrorIsNil) + return rs, multiwatcher.RemoteApplicationInfo{ + ModelUUID: st.ModelUUID(), + Name: name, + ApplicationURL: url, + Life: multiwatcher.Life(rs.Life().String()), + Status: multiwatcher.StatusInfo{ + Current: "unknown", + Message: "waiting for remote connection", + Data: map[string]interface{}{}, + }, + } +} + var _ = gc.Suite(&allWatcherStateSuite{}) type allWatcherStateSuite struct { @@ -380,6 +418,10 @@ applicationInfo := *e // must copy because this entity came out of the multiwatcher cache. substNilSinceTimeForStatus(c, &applicationInfo.Status) entities[i] = &applicationInfo + case *multiwatcher.RemoteApplicationInfo: + remoteApplicationInfo := *e // must copy because this entity came out of the multiwatcher cache. + substNilSinceTimeForStatus(c, &remoteApplicationInfo.Status) + entities[i] = &remoteApplicationInfo case *multiwatcher.MachineInfo: machineInfo := *e // must copy because this entity came out of the multiwatcher cache. substNilSinceTimeForStatus(c, &machineInfo.AgentStatus) @@ -402,6 +444,10 @@ applicationInfo := *e // must copy because this entity came out of the multiwatcher cache. applicationInfo.Status.Since = nil return &applicationInfo + case *multiwatcher.RemoteApplicationInfo: + remoteApplicationInfo := *e // must copy because this entity came out of the multiwatcher cache. + remoteApplicationInfo.Status.Since = nil + return &remoteApplicationInfo case *multiwatcher.MachineInfo: machineInfo := *e // must copy because we this entity came out of the multiwatcher cache. machineInfo.AgentStatus.Since = nil @@ -464,6 +510,10 @@ testChangeUnitsNonNilPorts(c, s.owner, s.performChangeTestCases) } +func (s *allWatcherStateSuite) TestChangeRemoteApplications(c *gc.C) { + testChangeRemoteApplications(c, s.performChangeTestCases) +} + func (s *allWatcherStateSuite) TestChangeActions(c *gc.C) { changeTestFuncs := []changeTestFunc{ func(c *gc.C, st *State) changeTestCase { @@ -1074,7 +1124,7 @@ } { c.Logf("Test %d: %s", i, test.about) func() { - checkIsolationForEnv := func(st *State, w, otherW *testWatcher) { + checkIsolationForModel := func(st *State, w, otherW *testWatcher) { c.Logf("Making changes to model %s", st.ModelUUID()) if test.setUpState != nil { @@ -1099,8 +1149,8 @@ // The first set of deltas is empty, reflecting an empty model. w1.AssertNoChange(c) w2.AssertNoChange(c) - checkIsolationForEnv(s.state, w1, w2) - checkIsolationForEnv(otherState, w2, w1) + checkIsolationForModel(s.state, w1, w2) + checkIsolationForModel(otherState, w2, w1) }() s.reset(c) } @@ -1202,6 +1252,10 @@ testChangeUnitsNonNilPorts(c, s.owner, s.performChangeTestCases) } +func (s *allModelWatcherStateSuite) TestChangeRemoteApplications(c *gc.C) { + testChangeRemoteApplications(c, s.performChangeTestCases) +} + func (s *allModelWatcherStateSuite) TestChangeModels(c *gc.C) { changeTestFuncs := []changeTestFunc{ func(c *gc.C, st *State) changeTestCase { @@ -1295,7 +1349,7 @@ s.performChangeTestCases(c, changeTestFuncs) } -func (s *allModelWatcherStateSuite) TestChangeForDeadEnv(c *gc.C) { +func (s *allModelWatcherStateSuite) TestChangeForDeadModel(c *gc.C) { // Ensure an entity is removed when a change is seen but // the model the entity belonged to has already died. @@ -1646,6 +1700,10 @@ applicationInfo := *e // must copy, we may not own this reference substNilSinceTimeForStatus(c, &applicationInfo.Status) delta.Entity = &applicationInfo + case *multiwatcher.RemoteApplicationInfo: + remoteApplicationInfo := *e // must copy, we may not own this reference + substNilSinceTimeForStatus(c, &remoteApplicationInfo.Status) + delta.Entity = &remoteApplicationInfo } deltas[i] = delta } @@ -3042,6 +3100,115 @@ }, } runChangeTests(c, changeTestFuncs) +} + +func testChangeRemoteApplications(c *gc.C, runChangeTests func(*gc.C, []changeTestFunc)) { + changeTestFuncs := []changeTestFunc{ + func(c *gc.C, st *State) changeTestCase { + return changeTestCase{ + about: "no remote application in state, no remote application in store -> do nothing", + change: watcher.Change{ + C: "remoteApplications", + Id: st.docID("remote-mysql"), + }} + }, + func(c *gc.C, st *State) changeTestCase { + return changeTestCase{ + about: "remote application is removed if it's not in backing", + initialContents: []multiwatcher.EntityInfo{ + &multiwatcher.RemoteApplicationInfo{ + ModelUUID: st.ModelUUID(), + Name: "remote-mysql", + ApplicationURL: "local:/u/me/mysql", + }, + }, + change: watcher.Change{ + C: "remoteApplications", + Id: st.docID("remote-mysql"), + }} + }, + func(c *gc.C, st *State) changeTestCase { + _, remoteApplicationInfo := addTestingRemoteApplication(c, st, "remote-mysql", "local:/u/me/mysql", mysqlRelations) + return changeTestCase{ + about: "remote application is added if it's in backing but not in Store", + change: watcher.Change{ + C: "remoteApplications", + Id: st.docID("remote-mysql"), + }, + expectContents: []multiwatcher.EntityInfo{&remoteApplicationInfo}, + } + }, + func(c *gc.C, st *State) changeTestCase { + // Currently the only change we can make to a remote + // service is to destroy it. + // + // We must add a relation to the remote application, and + // a unit to the relation, so that the relation is not + // removed and thus the remote application is not removed + // upon destroying. + wordpress := AddTestingService(c, st, "wordpress", AddTestingCharm(c, st, "wordpress")) + mysql, remoteApplicationInfo := addTestingRemoteApplication( + c, st, "remote-mysql", "local:/u/me/mysql", mysqlRelations, + ) + + eps, err := st.InferEndpoints("wordpress", "remote-mysql") + c.Assert(err, jc.ErrorIsNil) + rel, err := st.AddRelation(eps[0], eps[1]) + c.Assert(err, jc.ErrorIsNil) + + wu, err := wordpress.AddUnit() + c.Assert(err, jc.ErrorIsNil) + wru, err := rel.Unit(wu) + c.Assert(err, jc.ErrorIsNil) + err = wru.EnterScope(nil) + c.Assert(err, jc.ErrorIsNil) + + err = mysql.Destroy() + c.Assert(err, jc.ErrorIsNil) + initialRemoteApplicationInfo := remoteApplicationInfo + remoteApplicationInfo.Life = "dying" + remoteApplicationInfo.Status = multiwatcher.StatusInfo{} + return changeTestCase{ + about: "remote application is updated if it's in backing and in multiwatcher.Store", + initialContents: []multiwatcher.EntityInfo{&initialRemoteApplicationInfo}, + change: watcher.Change{ + C: "remoteApplications", + Id: st.docID("remote-mysql"), + }, + expectContents: []multiwatcher.EntityInfo{&remoteApplicationInfo}, + } + }, + func(c *gc.C, st *State) changeTestCase { + mysql, remoteApplicationInfo := addTestingRemoteApplication( + c, st, "remote-mysql", "local:/u/me/mysql", mysqlRelations, + ) + now := time.Now() + sInfo := status.StatusInfo{ + Status: status.Active, + Message: "running", + Data: map[string]interface{}{"foo": "bar"}, + Since: &now, + } + err := mysql.SetStatus(sInfo) + c.Assert(err, jc.ErrorIsNil) + initialRemoteApplicationInfo := remoteApplicationInfo + remoteApplicationInfo.Status = multiwatcher.StatusInfo{ + Current: "active", + Message: "running", + Data: map[string]interface{}{"foo": "bar"}, + } + return changeTestCase{ + about: "remote application status is updated if it's in backing and in multiwatcher.Store", + initialContents: []multiwatcher.EntityInfo{&initialRemoteApplicationInfo}, + change: watcher.Change{ + C: "statuses", + Id: st.docID(mysql.globalKey()), + }, + expectContents: []multiwatcher.EntityInfo{&remoteApplicationInfo}, + } + }, + } + runChangeTests(c, changeTestFuncs) } func newTestAllWatcher(st *State, c *gc.C) *testWatcher { diff -Nru juju-core-2.0.0/src/github.com/juju/juju/state/applicationdirectory.go juju-core-2.0.2/src/github.com/juju/juju/state/applicationdirectory.go --- juju-core-2.0.0/src/github.com/juju/juju/state/applicationdirectory.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/state/applicationdirectory.go 2016-11-11 00:08:09.000000000 +0000 @@ -0,0 +1,318 @@ +// Copyright 2015 Canonical Ltd. +// Licensed under the AGPLv3, see LICENCE file for details. + +package state + +import ( + "fmt" + "regexp" + "sort" + + "github.com/juju/errors" + "gopkg.in/juju/charm.v6-unstable" + "gopkg.in/juju/names.v2" + "gopkg.in/mgo.v2" + "gopkg.in/mgo.v2/bson" + "gopkg.in/mgo.v2/txn" + + "github.com/juju/juju/core/crossmodel" +) + +// applicationOfferDoc represents the internal state of a application offer in MongoDB. +type applicationOfferDoc struct { + DocID string `bson:"_id"` + + // URL is the URL used to locate the offer in a directory. + URL string `bson:"url"` + + // SourceModelUUID is the UUID of the environment hosting the application. + SourceModelUUID string `bson:"source-uuid"` + + // SourceLabel is a user friendly name for the source environment. + SourceLabel string `bson:"source-label"` + + // ApplicationName is the name of the application. + ApplicationName string `bson:"application-name"` + + // ApplicationDescription is a description of the application's functionality, + // typically copied from the charm metadata. + ApplicationDescription string `bson:"application-description"` + + // Endpoints are the charm endpoints supported by the applicationbob. + Endpoints []remoteEndpointDoc `bson:"endpoints"` +} + +var _ crossmodel.ApplicationDirectory = (*applicationDirectory)(nil) + +type applicationDirectory struct { + st *State +} + +// NewApplicationDirectory creates a application directory backed by a state instance. +func NewApplicationDirectory(st *State) crossmodel.ApplicationDirectory { + return &applicationDirectory{st: st} +} + +// ApplicationOfferEndpoint returns from the specified offer, the relation endpoint +// with the supplied name, if it exists. +func ApplicationOfferEndpoint(offer crossmodel.ApplicationOffer, relationName string) (Endpoint, error) { + for _, ep := range offer.Endpoints { + if ep.Name == relationName { + return Endpoint{ + ApplicationName: offer.ApplicationName, + Relation: ep, + }, nil + } + } + return Endpoint{}, errors.NotFoundf("relation %q on application offer %q", relationName, offer.String()) +} + +func (s *applicationDirectory) offerAtURL(url string) (*applicationOfferDoc, error) { + applicationOffersCollection, closer := s.st.getCollection(localApplicationDirectoryC) + defer closer() + + var doc applicationOfferDoc + err := applicationOffersCollection.FindId(url).One(&doc) + if err == mgo.ErrNotFound { + return nil, errors.NotFoundf("application offer %q", url) + } + if err != nil { + return nil, errors.Annotatef(err, "cannot count application offers %q", url) + } + return &doc, nil +} + +// Remove deletes the application offer at url immediately. +func (s *applicationDirectory) Remove(url string) (err error) { + defer errors.DeferredAnnotatef(&err, "cannot delete application offer %q", url) + err = s.st.runTransaction(s.removeOps(url)) + if err == txn.ErrAborted { + // Already deleted. + return nil + } + return err +} + +// removeOps returns the operations required to remove the record at url. +func (s *applicationDirectory) removeOps(url string) []txn.Op { + return []txn.Op{ + { + C: localApplicationDirectoryC, + Id: url, + Assert: txn.DocExists, + Remove: true, + }, + } +} + +var errDuplicateApplicationOffer = errors.Errorf("application offer already exists") + +func (s *applicationDirectory) validateOffer(offer crossmodel.ApplicationOffer) (err error) { + // Sanity checks. + if offer.SourceModelUUID == "" { + return errors.Errorf("missing source model UUID") + } + if !names.IsValidApplication(offer.ApplicationName) { + return errors.Errorf("invalid application name") + } + // TODO(wallyworld) - validate application URL + return nil +} + +// AddOffer adds a new application offering to the directory. +func (s *applicationDirectory) AddOffer(offer crossmodel.ApplicationOffer) (err error) { + defer errors.DeferredAnnotatef(&err, "cannot add application offer %q at %q", offer.ApplicationName, offer.ApplicationURL) + + if err := s.validateOffer(offer); err != nil { + return err + } + model, err := s.st.Model() + if err != nil { + return errors.Trace(err) + } else if model.Life() != Alive { + return errors.Errorf("model is no longer alive") + } + + doc := s.makeApplicationOfferDoc(offer) + buildTxn := func(attempt int) ([]txn.Op, error) { + // If we've tried once already and failed, check that + // environment may have been destroyed. + if attempt > 0 { + if err := checkModelActive(s.st); err != nil { + return nil, errors.Trace(err) + } + _, err := s.offerAtURL(offer.ApplicationURL) + if err == nil { + return nil, errDuplicateApplicationOffer + } + } + ops := []txn.Op{ + model.assertActiveOp(), + { + C: localApplicationDirectoryC, + Id: doc.DocID, + Assert: txn.DocMissing, + Insert: doc, + }, + } + return ops, nil + } + err = s.st.run(buildTxn) + return errors.Trace(err) +} + +// UpdateOffer replaces an existing offer at the same URL. +func (s *applicationDirectory) UpdateOffer(offer crossmodel.ApplicationOffer) (err error) { + defer errors.DeferredAnnotatef(&err, "cannot update application offer %q", offer.ApplicationName) + + if err := s.validateOffer(offer); err != nil { + return err + } + model, err := s.st.Model() + if err != nil { + return errors.Trace(err) + } else if model.Life() != Alive { + return errors.Errorf("model is no longer alive") + } + + doc := s.makeApplicationOfferDoc(offer) + buildTxn := func(attempt int) ([]txn.Op, error) { + // If we've tried once already and failed, check that + // environment may have been destroyed. + if attempt > 0 { + if err := checkModelActive(s.st); err != nil { + return nil, errors.Trace(err) + } + _, err := s.offerAtURL(offer.ApplicationURL) + if err != nil { + // This will either be NotFound or some other error. + // In either case, we return the error. + return nil, errors.Trace(err) + } + } + ops := []txn.Op{ + model.assertActiveOp(), + { + C: localApplicationDirectoryC, + Id: doc.DocID, + Assert: txn.DocExists, + Update: doc, + }, + } + return ops, nil + } + err = s.st.run(buildTxn) + return errors.Trace(err) +} + +func (s *applicationDirectory) makeApplicationOfferDoc(offer crossmodel.ApplicationOffer) applicationOfferDoc { + doc := applicationOfferDoc{ + DocID: offer.ApplicationURL, + URL: offer.ApplicationURL, + ApplicationName: offer.ApplicationName, + ApplicationDescription: offer.ApplicationDescription, + SourceModelUUID: offer.SourceModelUUID, + SourceLabel: offer.SourceLabel, + } + eps := make([]remoteEndpointDoc, len(offer.Endpoints)) + for i, ep := range offer.Endpoints { + eps[i] = remoteEndpointDoc{ + Name: ep.Name, + Role: ep.Role, + Interface: ep.Interface, + Limit: ep.Limit, + Scope: ep.Scope, + } + } + doc.Endpoints = eps + return doc +} + +func (s *applicationDirectory) makeFilterTerm(filterTerm crossmodel.ApplicationOfferFilter) bson.D { + var filter bson.D + if filterTerm.ApplicationName != "" { + filter = append(filter, bson.DocElem{"application-name", filterTerm.ApplicationName}) + } + if filterTerm.SourceLabel != "" { + filter = append(filter, bson.DocElem{"source-label", filterTerm.SourceLabel}) + } + if filterTerm.SourceModelUUID != "" { + filter = append(filter, bson.DocElem{"source-uuid", filterTerm.SourceModelUUID}) + } + // We match on partial URLs eg /u/user + if filterTerm.ApplicationURL != "" { + url := regexp.QuoteMeta(filterTerm.ApplicationURL) + filter = append(filter, bson.DocElem{"url", bson.D{{"$regex", fmt.Sprintf(".*%s.*", url)}}}) + } + // We match descriptions by looking for containing terms. + if filterTerm.ApplicationDescription != "" { + desc := regexp.QuoteMeta(filterTerm.ApplicationDescription) + filter = append(filter, bson.DocElem{"application-description", bson.D{{"$regex", fmt.Sprintf(".*%s.*", desc)}}}) + } + return filter +} + +// ListOffers returns the application offers matching any one of the filter terms. +func (s *applicationDirectory) ListOffers(filter ...crossmodel.ApplicationOfferFilter) ([]crossmodel.ApplicationOffer, error) { + applicationOffersCollection, closer := s.st.getCollection(localApplicationDirectoryC) + defer closer() + + // TODO(wallyworld) - add support for filtering on endpoints + var mgoTerms []bson.D + for _, term := range filter { + elems := s.makeFilterTerm(term) + if len(elems) == 0 { + continue + } + mgoTerms = append(mgoTerms, bson.D{{"$and", []bson.D{elems}}}) + } + var docs []applicationOfferDoc + var mgoQuery bson.D + if len(mgoTerms) > 0 { + mgoQuery = bson.D{{"$or", mgoTerms}} + } + err := applicationOffersCollection.Find(mgoQuery).All(&docs) + if err != nil { + return nil, errors.Annotate(err, "cannot find application offers") + } + sort.Sort(srSlice(docs)) + offers := make([]crossmodel.ApplicationOffer, len(docs)) + for i, doc := range docs { + offers[i] = s.makeApplicationOffer(doc) + } + return offers, nil +} + +func (s *applicationDirectory) makeApplicationOffer(doc applicationOfferDoc) crossmodel.ApplicationOffer { + offer := crossmodel.ApplicationOffer{ + ApplicationURL: doc.URL, + ApplicationName: doc.ApplicationName, + ApplicationDescription: doc.ApplicationDescription, + SourceModelUUID: doc.SourceModelUUID, + SourceLabel: doc.SourceLabel, + } + offer.Endpoints = make([]charm.Relation, len(doc.Endpoints)) + for i, ep := range doc.Endpoints { + offer.Endpoints[i] = charm.Relation{ + Name: ep.Name, + Role: ep.Role, + Interface: ep.Interface, + Limit: ep.Limit, + Scope: ep.Scope, + } + } + return offer +} + +type srSlice []applicationOfferDoc + +func (sr srSlice) Len() int { return len(sr) } +func (sr srSlice) Swap(i, j int) { sr[i], sr[j] = sr[j], sr[i] } +func (sr srSlice) Less(i, j int) bool { + sr1 := sr[i] + sr2 := sr[j] + if sr1.URL != sr2.URL { + return sr1.ApplicationName < sr2.ApplicationName + } + return sr1.URL < sr2.URL +} diff -Nru juju-core-2.0.0/src/github.com/juju/juju/state/applicationdirectory_test.go juju-core-2.0.2/src/github.com/juju/juju/state/applicationdirectory_test.go --- juju-core-2.0.0/src/github.com/juju/juju/state/applicationdirectory_test.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/state/applicationdirectory_test.go 2016-11-11 00:08:09.000000000 +0000 @@ -0,0 +1,314 @@ +// Copyright 2015 Canonical Ltd. +// Licensed under the AGPLv3, see LICENCE file for details. + +package state_test + +import ( + "github.com/juju/errors" + jc "github.com/juju/testing/checkers" + gc "gopkg.in/check.v1" + "gopkg.in/juju/charm.v6-unstable" + + "github.com/juju/juju/core/crossmodel" + "github.com/juju/juju/state" +) + +type applicationDirectorySuite struct { + ConnSuite +} + +var _ = gc.Suite(&applicationDirectorySuite{}) + +func (s *applicationDirectorySuite) createDefaultOffer(c *gc.C) crossmodel.ApplicationOffer { + eps := []charm.Relation{ + { + Interface: "mysql", + Name: "db", + Role: charm.RoleProvider, + Scope: charm.ScopeGlobal, + }, + { + Interface: "mysql-root", + Name: "db-admin", + Role: charm.RoleProvider, + Scope: charm.ScopeGlobal, + }, + } + sd := state.NewApplicationDirectory(s.State) + offer := crossmodel.ApplicationOffer{ + ApplicationURL: "local:/u/me/application", + ApplicationName: "mysql", + ApplicationDescription: "mysql is a db server", + Endpoints: eps, + SourceModelUUID: "source-uuid", + SourceLabel: "source", + } + err := sd.AddOffer(offer) + c.Assert(err, jc.ErrorIsNil) + return offer +} + +func (s *applicationDirectorySuite) TestEndpoints(c *gc.C) { + offer := s.createDefaultOffer(c) + _, err := state.ApplicationOfferEndpoint(offer, "foo") + c.Assert(err, gc.ErrorMatches, `relation "foo" on application offer "source-uuid-mysql" not found`) + + serverEP, err := state.ApplicationOfferEndpoint(offer, "db") + c.Assert(err, jc.ErrorIsNil) + c.Assert(serverEP, gc.DeepEquals, state.Endpoint{ + ApplicationName: "mysql", + Relation: charm.Relation{ + Interface: "mysql", + Name: "db", + Role: charm.RoleProvider, + Scope: charm.ScopeGlobal, + }, + }) +} + +func (s *applicationDirectorySuite) TestRemove(c *gc.C) { + offer := s.createDefaultOffer(c) + sd := state.NewApplicationDirectory(s.State) + err := sd.Remove(offer.ApplicationURL) + c.Assert(err, jc.ErrorIsNil) + _, err = state.OfferAtURL(sd, offer.ApplicationURL) + c.Assert(err, jc.Satisfies, errors.IsNotFound) +} + +func (s *applicationDirectorySuite) TestAddApplicationOffer(c *gc.C) { + eps := []charm.Relation{ + { + Interface: "mysql", + Name: "db", + Role: charm.RoleProvider, + Scope: charm.ScopeGlobal, + }, + { + Interface: "mysql-root", + Name: "db-admin", + Role: charm.RoleProvider, + Scope: charm.ScopeGlobal, + }, + } + sd := state.NewApplicationDirectory(s.State) + offer := crossmodel.ApplicationOffer{ + ApplicationURL: "local:/u/me/application", + ApplicationName: "mysql", + ApplicationDescription: "mysql is a db server", + Endpoints: eps, + SourceModelUUID: "source-uuid", + SourceLabel: "source", + } + err := sd.AddOffer(offer) + c.Assert(err, jc.ErrorIsNil) + expectedDoc := state.MakeApplicationOfferDoc(sd, "local:/u/me/application", offer) + doc, err := state.OfferAtURL(sd, "local:/u/me/application") + c.Assert(err, jc.ErrorIsNil) + c.Assert(*doc, jc.DeepEquals, expectedDoc) +} + +func (s *applicationDirectorySuite) TestListOffersNone(c *gc.C) { + sd := state.NewApplicationDirectory(s.State) + offers, err := sd.ListOffers() + c.Assert(err, jc.ErrorIsNil) + c.Assert(len(offers), gc.Equals, 0) +} + +func (s *applicationDirectorySuite) createOffer(c *gc.C, name, description, uuid, label string) crossmodel.ApplicationOffer { + eps := []charm.Relation{ + { + Interface: name + "-interface", + Name: name, + Role: charm.RoleProvider, + Scope: charm.ScopeGlobal, + }, + { + Interface: name + "-interface2", + Name: name + "2", + Role: charm.RoleRequirer, + Scope: charm.ScopeGlobal, + }, + } + sd := state.NewApplicationDirectory(s.State) + offer := crossmodel.ApplicationOffer{ + ApplicationURL: "local:/u/me/" + name, + ApplicationName: name, + ApplicationDescription: description, + Endpoints: eps, + SourceModelUUID: uuid, + SourceLabel: label, + } + err := sd.AddOffer(offer) + c.Assert(err, jc.ErrorIsNil) + return offer +} + +func (s *applicationDirectorySuite) TestListOffersAll(c *gc.C) { + sd := state.NewApplicationDirectory(s.State) + offer := s.createDefaultOffer(c) + offers, err := sd.ListOffers() + c.Assert(err, jc.ErrorIsNil) + c.Assert(len(offers), gc.Equals, 1) + c.Assert(offers[0], jc.DeepEquals, offer) +} + +func (s *applicationDirectorySuite) TestListOffersOneFilter(c *gc.C) { + sd := state.NewApplicationDirectory(s.State) + offer := s.createOffer(c, "offer1", "description for offer1", "uuid-1", "label") + s.createOffer(c, "offer2", "description for offer2", "uuid-2", "label") + s.createOffer(c, "offer3", "description for offer3", "uuid-3", "label") + offers, err := sd.ListOffers(crossmodel.ApplicationOfferFilter{ + ApplicationOffer: crossmodel.ApplicationOffer{ + ApplicationURL: "local:/u/me/offer1", + ApplicationName: "offer1", + SourceModelUUID: "uuid-1", + SourceLabel: "label", + }, + }) + c.Assert(err, jc.ErrorIsNil) + c.Assert(len(offers), gc.Equals, 1) + c.Assert(offers[0], jc.DeepEquals, offer) +} + +func (s *applicationDirectorySuite) TestListOffersManyFilters(c *gc.C) { + sd := state.NewApplicationDirectory(s.State) + offer := s.createOffer(c, "offer1", "description for offer1", "uuid-1", "label") + offer2 := s.createOffer(c, "offer2", "description for offer2", "uuid-2", "label") + s.createOffer(c, "offer3", "description for offer3", "uuid-3", "label") + offers, err := sd.ListOffers( + crossmodel.ApplicationOfferFilter{ + ApplicationOffer: crossmodel.ApplicationOffer{ + ApplicationURL: "local:/u/me/offer1", + ApplicationName: "offer1", + SourceModelUUID: "uuid-1", + SourceLabel: "label", + }}, + crossmodel.ApplicationOfferFilter{ + ApplicationOffer: crossmodel.ApplicationOffer{ + ApplicationURL: "local:/u/me/offer2", + ApplicationDescription: "offer2", + SourceLabel: "label", + }}, + ) + c.Assert(err, jc.ErrorIsNil) + c.Assert(len(offers), gc.Equals, 2) + c.Assert(offers, jc.DeepEquals, []crossmodel.ApplicationOffer{offer, offer2}) +} + +func (s *applicationDirectorySuite) TestListOffersFilterDescriptionRegexp(c *gc.C) { + sd := state.NewApplicationDirectory(s.State) + s.createOffer(c, "offer1", "description for offer1", "uuid-1", "label") + offer := s.createOffer(c, "offer2", "description for offer2", "uuid-2", "label") + s.createOffer(c, "offer3", "description for offer3", "uuid-3", "label") + offers, err := sd.ListOffers(crossmodel.ApplicationOfferFilter{ + ApplicationOffer: crossmodel.ApplicationOffer{ + ApplicationDescription: "for offer2", + }, + }) + c.Assert(err, jc.ErrorIsNil) + c.Assert(len(offers), gc.Equals, 1) + c.Assert(offers[0], jc.DeepEquals, offer) +} + +func (s *applicationDirectorySuite) TestListOffersFilterApplicationURLRegexp(c *gc.C) { + sd := state.NewApplicationDirectory(s.State) + s.createOffer(c, "offer1", "description for offer1", "uuid-1", "label") + offer := s.createOffer(c, "offer2", "description for offer2", "uuid-2", "label") + s.createOffer(c, "offer3", "description for offer3", "uuid-3", "label") + offers, err := sd.ListOffers(crossmodel.ApplicationOfferFilter{ + ApplicationOffer: crossmodel.ApplicationOffer{ + ApplicationURL: "me/offer2", + }, + }) + c.Assert(err, jc.ErrorIsNil) + c.Assert(len(offers), gc.Equals, 1) + c.Assert(offers[0], jc.DeepEquals, offer) +} + +func (s *applicationDirectorySuite) TestAddApplicationOfferUUIDRequired(c *gc.C) { + sd := state.NewApplicationDirectory(s.State) + err := sd.AddOffer(crossmodel.ApplicationOffer{ + ApplicationURL: "local:/u/me/application", + ApplicationName: "mysql", + }) + c.Assert(err, gc.ErrorMatches, `cannot add application offer "mysql" at "local:/u/me/application": missing source model UUID`) +} + +func (s *applicationDirectorySuite) TestAddApplicationOfferDuplicate(c *gc.C) { + sd := state.NewApplicationDirectory(s.State) + err := sd.AddOffer(crossmodel.ApplicationOffer{ + ApplicationURL: "local:/u/me/application", + ApplicationName: "mysql", + SourceModelUUID: "uuid", + }) + c.Assert(err, jc.ErrorIsNil) + err = sd.AddOffer(crossmodel.ApplicationOffer{ + ApplicationURL: "local:/u/me/application", + ApplicationName: "another", + SourceModelUUID: "uuid", + }) + c.Assert(err, gc.ErrorMatches, `cannot add application offer "another" at "local:/u/me/application": application offer already exists`) +} + +func (s *remoteApplicationSuite) TestAddApplicationOfferDuplicateAddedAfterInitial(c *gc.C) { + // Check that a record with a URL conflict cannot be added if + // there is no conflict initially but a record is added + // before the transaction is run. + sd := state.NewApplicationDirectory(s.State) + defer state.SetBeforeHooks(c, s.State, func() { + err := sd.AddOffer(crossmodel.ApplicationOffer{ + ApplicationURL: "local:/u/me/application", + ApplicationName: "mysql", + SourceModelUUID: "uuid", + }) + c.Assert(err, jc.ErrorIsNil) + }).Check() + err := sd.AddOffer(crossmodel.ApplicationOffer{ + ApplicationURL: "local:/u/me/application", + ApplicationName: "mysql", + SourceModelUUID: "uuid", + }) + c.Assert(err, gc.ErrorMatches, `cannot add application offer "mysql" at "local:/u/me/application": application offer already exists`) +} + +func (s *applicationDirectorySuite) TestUpdateApplicationOfferUUIDRequired(c *gc.C) { + sd := state.NewApplicationDirectory(s.State) + err := sd.UpdateOffer(crossmodel.ApplicationOffer{ + ApplicationURL: "local:/u/me/application", + ApplicationName: "mysql", + }) + c.Assert(err, gc.ErrorMatches, `cannot update application offer "mysql": missing source model UUID`) +} + +func (s *applicationDirectorySuite) TestUpdateApplicationOfferNotFound(c *gc.C) { + sd := state.NewApplicationDirectory(s.State) + err := sd.UpdateOffer(crossmodel.ApplicationOffer{ + ApplicationURL: "local:/u/me/application", + ApplicationName: "mysql", + SourceModelUUID: "uuid", + }) + c.Assert(err, gc.ErrorMatches, `cannot update application offer "mysql": application offer "local:/u/me/application" not found`) +} + +func (s *remoteApplicationSuite) TestUpdateApplicationOfferRemovedAfterInitial(c *gc.C) { + // Check that a record with a URL conflict cannot be added if + // there is no conflict initially but a record is added + // before the transaction is run. + sd := state.NewApplicationDirectory(s.State) + err := sd.AddOffer(crossmodel.ApplicationOffer{ + ApplicationURL: "local:/u/me/application", + ApplicationName: "mysql", + SourceModelUUID: "uuid", + }) + c.Assert(err, jc.ErrorIsNil) + defer state.SetBeforeHooks(c, s.State, func() { + err := sd.Remove("local:/u/me/application") + c.Assert(err, jc.ErrorIsNil) + }).Check() + err = sd.UpdateOffer(crossmodel.ApplicationOffer{ + ApplicationURL: "local:/u/me/application", + ApplicationName: "mysql", + SourceModelUUID: "uuid", + }) + c.Assert(err, gc.ErrorMatches, `cannot update application offer "mysql": application offer "local:/u/me/application" not found`) +} diff -Nru juju-core-2.0.0/src/github.com/juju/juju/state/application.go juju-core-2.0.2/src/github.com/juju/juju/state/application.go --- juju-core-2.0.0/src/github.com/juju/juju/state/application.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/state/application.go 2016-11-11 00:08:09.000000000 +0000 @@ -12,6 +12,7 @@ "github.com/juju/errors" jujutxn "github.com/juju/txn" + "github.com/juju/utils/featureflag" "github.com/juju/utils/series" "gopkg.in/juju/charm.v6-unstable" csparams "gopkg.in/juju/charmrepo.v2-unstable/csclient/params" @@ -22,6 +23,7 @@ "github.com/juju/juju/constraints" "github.com/juju/juju/core/leadership" + "github.com/juju/juju/feature" "github.com/juju/juju/status" ) @@ -31,7 +33,7 @@ doc applicationDoc } -// serviceDoc represents the internal state of an application in MongoDB. +// applicationDoc represents the internal state of an application in MongoDB. // Note the correspondence with ApplicationInfo in apiserver. type applicationDoc struct { DocID string `bson:"_id"` @@ -53,11 +55,16 @@ } func newApplication(st *State, doc *applicationDoc) *Application { - svc := &Application{ + app := &Application{ st: st, doc: *doc, } - return svc + return app +} + +// IsRemote returns false for a local application. +func (s *Application) IsRemote() bool { + return false } // Name returns the application name. @@ -65,7 +72,7 @@ return a.doc.Name } -// Tag returns a name identifying the service. +// Tag returns a name identifying the application. // The returned name will be different from other Tag values returned by any // other entities from the same state. func (a *Application) Tag() names.Tag { @@ -155,7 +162,7 @@ return a.st.run(buildTxn) } -// destroyOps returns the operations required to destroy the service. If it +// destroyOps returns the operations required to destroy the application. If it // returns errRefresh, the application should be refreshed and the destruction // operations recalculated. func (a *Application) destroyOps() ([]txn.Op, error) { @@ -222,7 +229,7 @@ // about is that *some* unit is, or is not, keeping the application from // being removed: the difference between 1 unit and 1000 is irrelevant. if a.doc.UnitCount > 0 { - ops = append(ops, newCleanupOp(cleanupUnitsForDyingService, a.doc.Name)) + ops = append(ops, newCleanupOp(cleanupUnitsForDyingApplication, a.doc.Name)) notLastRefs = append(notLastRefs, bson.D{{"unitcount", bson.D{{"$gt", 0}}}}...) } else { notLastRefs = append(notLastRefs, bson.D{{"unitcount", 0}}...) @@ -240,7 +247,7 @@ }), nil } -func removeResourcesOps(st *State, serviceID string) ([]txn.Op, error) { +func removeResourcesOps(st *State, applicationID string) ([]txn.Op, error) { persist, err := st.ResourcesPersistence() if errors.IsNotSupported(err) { // Nothing to see here, move along. @@ -249,14 +256,14 @@ if err != nil { return nil, errors.Trace(err) } - ops, err := persist.NewRemoveResourcesOps(serviceID) + ops, err := persist.NewRemoveResourcesOps(applicationID) if err != nil { return nil, errors.Trace(err) } return ops, nil } -// removeOps returns the operations required to remove the service. Supplied +// removeOps returns the operations required to remove the application. Supplied // asserts will be included in the operation on the application document. func (a *Application) removeOps(asserts bson.D) ([]txn.Op, error) { ops := []txn.Op{ @@ -292,13 +299,13 @@ annotationRemoveOp(a.st, globalKey), removeLeadershipSettingsOp(name), removeStatusOp(a.st, globalKey), - removeModelServiceRefOp(a.st, name), + removeModelApplicationRefOp(a.st, name), ) return ops, nil } // IsExposed returns whether this application is exposed. The explicitly open -// ports (with open-port) for exposed services may be accessed from machines +// ports (with open-port) for exposed applications may be accessed from machines // outside of the local deployment network. See SetExposed and ClearExposed. func (a *Application) IsExposed() bool { return a.doc.Exposed @@ -310,7 +317,7 @@ return a.setExposed(true) } -// ClearExposed removes the exposed flag from the service. +// ClearExposed removes the exposed flag from the application. // See SetExposed and IsExposed. func (a *Application) ClearExposed() error { return a.setExposed(false) @@ -330,7 +337,7 @@ return nil } -// Charm returns the service's charm and whether units should upgrade to that +// Charm returns the application's charm and whether units should upgrade to that // charm even if they are in an error state. func (a *Application) Charm() (ch *Charm, force bool, err error) { // We don't worry about the channel since we aren't interacting @@ -348,26 +355,26 @@ return !a.doc.Subordinate } -// CharmModifiedVersion increases whenever the service's charm is changed in any +// CharmModifiedVersion increases whenever the application's charm is changed in any // way. func (a *Application) CharmModifiedVersion() int { return a.doc.CharmModifiedVersion } -// CharmURL returns the service's charm URL, and whether units should upgrade +// CharmURL returns the application's charm URL, and whether units should upgrade // to the charm with that URL even if they are in an error state. func (a *Application) CharmURL() (curl *charm.URL, force bool) { return a.doc.CharmURL, a.doc.ForceCharm } -// Channel identifies the charm store channel from which the service's +// Channel identifies the charm store channel from which the application's // charm was deployed. It is only needed when interacting with the charm // store. func (a *Application) Channel() csparams.Channel { return csparams.Channel(a.doc.Channel) } -// Endpoints returns the service's currently available relation endpoints. +// Endpoints returns the application's currently available relation endpoints. func (a *Application) Endpoints() (eps []Endpoint, err error) { ch, _, err := a.Charm() if err != nil { @@ -412,7 +419,7 @@ } // extraPeerRelations returns only the peer relations in newMeta not -// present in the service's current charm meta data. +// present in the application's current charm meta data. func (a *Application) extraPeerRelations(newMeta *charm.Meta) map[string]charm.Relation { if newMeta == nil { // This should never happen, since we're checking the charm in SetCharm already. @@ -541,7 +548,7 @@ return ops, nil } -// changeCharmOps returns the operations necessary to set a service's +// changeCharmOps returns the operations necessary to set a application's // charm URL to a new value. func (a *Application) changeCharmOps( ch *Charm, @@ -755,7 +762,7 @@ if err == nil { ops = append(ops, endpointBindingsOp) } else if !errors.IsNotFound(err) && err != jujutxn.ErrNoOperations { - // If endpoint bindings do not exist this most likely means the service + // If endpoint bindings do not exist this most likely means the application // itself no longer exists, which will be caught soon enough anyway. // ErrNoOperations on the other hand means there's nothing to update. return nil, errors.Trace(err) @@ -797,11 +804,11 @@ } // incCharmModifiedVersionOps returns the operations necessary to increment -// the CharmModifiedVersion field for the given service. -func incCharmModifiedVersionOps(serviceID string) []txn.Op { +// the CharmModifiedVersion field for the given application. +func incCharmModifiedVersionOps(applicationID string) []txn.Op { return []txn.Op{{ C: applicationsC, - Id: serviceID, + Id: applicationID, Assert: txn.DocExists, Update: bson.D{{"$inc", bson.D{{"charmmodifiedversion", 1}}}}, }} @@ -924,9 +931,9 @@ } // NOTE: We're explicitly allowing SetCharm to succeed - // when the application is Dying, because service/charm + // when the application is Dying, because application/charm // upgrades should still be allowed to apply to dying - // services and units, so that bugs in departed/broken + // applications and units, so that bugs in departed/broken // hooks can be addressed at runtime. if a.Life() == Dead { return nil, ErrDead @@ -989,14 +996,14 @@ return a.doc.Name } -// Refresh refreshes the contents of the Service from the underlying +// Refresh refreshes the contents of the Application from the underlying // state. It returns an error that satisfies errors.IsNotFound if the // application has been removed. func (a *Application) Refresh() error { - services, closer := a.st.getCollection(applicationsC) + applications, closer := a.st.getCollection(applicationsC) defer closer() - err := services.FindId(a.doc.DocID).One(&a.doc) + err := applications.FindId(a.doc.DocID).One(&a.doc) if err == mgo.ErrNotFound { return errors.NotFoundf("application %q", a) } @@ -1018,7 +1025,7 @@ // addUnitOps returns a unique name for a new unit, and a list of txn operations // necessary to create that unit. The principalName param must be non-empty if -// and only if s is a subordinate service. Only one subordinate of a given +// and only if s is a subordinate application. Only one subordinate of a given // application will be assigned to a given principal. The asserts param can be used // to include additional assertions for the application document. This method // assumes that the application already exists in the db. @@ -1062,9 +1069,9 @@ storageCons map[string]StorageConstraints } -// addServiceUnitOps is just like addUnitOps but explicitly takes a +// addApplicationUnitOps is just like addUnitOps but explicitly takes a // constraints value (this is used at application creation time). -func (a *Application) addServiceUnitOps(args applicationAddUnitOpsArgs) (string, []txn.Op, error) { +func (a *Application) addApplicationUnitOps(args applicationAddUnitOpsArgs) (string, []txn.Op, error) { names, ops, err := a.addUnitOpsWithCons(args) if err == nil { ops = append(ops, a.incUnitCountOp(nil)) @@ -1178,7 +1185,7 @@ return name, ops, nil } -// incUnitCountOp returns the operation to increment the service's unit count. +// incUnitCountOp returns the operation to increment the application's unit count. func (a *Application) incUnitCountOp(asserts bson.D) txn.Op { op := txn.Op{ C: applicationsC, @@ -1191,7 +1198,7 @@ return op } -// AddUnit adds a new principal unit to the service. +// AddUnit adds a new principal unit to the application. func (a *Application) AddUnit() (unit *Unit, err error) { defer errors.DeferredAnnotatef(&err, "cannot add unit to application %q", a) name, ops, err := a.addUnitOps("", nil) @@ -1291,7 +1298,7 @@ return ops, nil } -func removeUnitResourcesOps(st *State, serviceID, unitID string) ([]txn.Op, error) { +func removeUnitResourcesOps(st *State, applicationID, unitID string) ([]txn.Op, error) { persist, err := st.ResourcesPersistence() if errors.IsNotSupported(err) { // Nothing to see here, move along. @@ -1307,7 +1314,7 @@ return ops, nil } -// AllUnits returns all units of the service. +// AllUnits returns all units of the application. func (a *Application) AllUnits() (units []*Unit, err error) { return allUnits(a.st, a.doc.Name) } @@ -1358,7 +1365,7 @@ return settings.Map(), nil } -// UpdateConfigSettings changes a service's charm config settings. Values set +// UpdateConfigSettings changes a application's charm config settings. Values set // to nil will be deleted; unknown and invalid values will return an error. func (a *Application) UpdateConfigSettings(changes charm.Settings) error { charm, _, err := a.Charm() @@ -1371,7 +1378,7 @@ } // TODO(fwereade) state.Settings is itself really problematic in just // about every use case. This needs to be resolved some time; but at - // least the settings docs are keyed by charm url as well as service + // least the settings docs are keyed by charm url as well as application // name, so the actual impact of a race is non-threatening. node, err := readSettings(a.st, settingsC, a.settingsKey()) if err != nil { @@ -1388,10 +1395,10 @@ return err } -// LeaderSettings returns a service's leader settings. If nothing has been set +// LeaderSettings returns a application's leader settings. If nothing has been set // yet, it will return an empty map; this is not an error. func (a *Application) LeaderSettings() (map[string]string, error) { - // There's no compelling reason to have these methods on Service -- and + // There's no compelling reason to have these methods on Application -- and // thus require an extra db read to access them -- but it stops the State // type getting even more cluttered. @@ -1415,11 +1422,11 @@ return result, nil } -// UpdateLeaderSettings updates the service's leader settings with the supplied +// UpdateLeaderSettings updates the application's leader settings with the supplied // values, but will fail (with a suitable error) if the supplied Token loses // validity. Empty values in the supplied map will be cleared in the database. func (a *Application) UpdateLeaderSettings(token leadership.Token, updates map[string]string) error { - // There's no compelling reason to have these methods on Service -- and + // There's no compelling reason to have these methods on Application -- and // thus require an extra db read to access them -- but it stops the State // type getting even more cluttered. @@ -1476,7 +1483,7 @@ return a.st.run(buildTxnWithLeadership(buildTxn, token)) } -var ErrSubordinateConstraints = stderrors.New("constraints do not apply to subordinate services") +var ErrSubordinateConstraints = stderrors.New("constraints do not apply to subordinate applications") // Constraints returns the current application constraints. func (a *Application) Constraints() (constraints.Value, error) { @@ -1545,12 +1552,12 @@ return DefaultEndpointBindingsForCharm(charm.Meta()), nil } -// MetricCredentials returns any metric credentials associated with this service. +// MetricCredentials returns any metric credentials associated with this application. func (a *Application) MetricCredentials() []byte { return a.doc.MetricCredentials } -// SetMetricCredentials updates the metric credentials associated with this service. +// SetMetricCredentials updates the metric credentials associated with this application. func (a *Application) SetMetricCredentials(b []byte) error { buildTxn := func(attempt int) ([]txn.Op, error) { if attempt > 0 { @@ -1592,8 +1599,8 @@ return cons, nil } -// Status returns the status of the service. -// Only unit leaders are allowed to set the status of the service. +// Status returns the status of the application. +// Only unit leaders are allowed to set the status of the application. // If no status is recorded, then there are no unit leaders and the // status is derived from the unit status values. func (a *Application) Status() (status.StatusInfo, error) { @@ -1603,7 +1610,7 @@ if count, err := query.Count(); err != nil { return status.StatusInfo{}, errors.Trace(err) } else if count != 0 { - // This indicates that SetStatus has never been called on this service. + // This indicates that SetStatus has never been called on this application. // This in turn implies the application status document is likely to be // inaccurate, so we return aggregated unit statuses instead. // @@ -1617,7 +1624,7 @@ if err != nil { return status.StatusInfo{}, err } - logger.Tracef("service %q has %d units", a.Name(), len(units)) + logger.Tracef("application %q has %d units", a.Name(), len(units)) if len(units) > 0 { return a.deriveStatus(units) } @@ -1642,7 +1649,7 @@ // StatusHistory returns a slice of at most filter.Size StatusInfo items // or items as old as filter.Date or items newer than now - filter.Delta time -// representing past statuses for this service. +// representing past statuses for this application. func (a *Application) StatusHistory(filter status.StatusHistoryFilter) ([]status.StatusInfo, error) { args := &statusHistoryArgs{ st: a.st, @@ -1652,9 +1659,9 @@ return statusHistory(args) } -// ServiceAndUnitsStatus returns the status for this application and all its units. -func (a *Application) ServiceAndUnitsStatus() (status.StatusInfo, map[string]status.StatusInfo, error) { - serviceStatus, err := a.Status() +// ApplicationAndUnitsStatus returns the status for this application and all its units. +func (a *Application) ApplicationAndUnitsStatus() (status.StatusInfo, map[string]status.StatusInfo, error) { + applicationStatus, err := a.Status() if err != nil { return status.StatusInfo{}, nil, errors.Trace(err) } @@ -1670,7 +1677,7 @@ } results[unit.Name()] = unitStatus } - return serviceStatus, results, nil + return applicationStatus, results, nil } @@ -1711,27 +1718,27 @@ constraints constraints.Value storage map[string]StorageConstraints settings map[string]interface{} - // These are nil when adding a new service, and most likely + // These are nil when adding a new application, and most likely // non-nil when migrating. leadershipSettings map[string]interface{} } // addApplicationOps returns the operations required to add an application to the -// services collection, along with all the associated expected other service -// entries. This method is used by both the *State.AddService method and the +// applications collection, along with all the associated expected other application +// entries. This method is used by both the *State.AddApplication method and the // migration import code. func addApplicationOps(st *State, args addApplicationOpsArgs) ([]txn.Op, error) { - svc := newApplication(st, args.applicationDoc) + app := newApplication(st, args.applicationDoc) charmRefOps, err := appCharmIncRefOps(st, args.applicationDoc.Name, args.applicationDoc.CharmURL, true) if err != nil { return nil, errors.Trace(err) } - globalKey := svc.globalKey() - settingsKey := svc.settingsKey() - storageConstraintsKey := svc.storageConstraintsKey() - leadershipKey := leadershipSettingsKey(svc.Name()) + globalKey := app.globalKey() + settingsKey := app.settingsKey() + storageConstraintsKey := app.storageConstraintsKey() + leadershipKey := leadershipSettingsKey(app.Name()) ops := []txn.Op{ createConstraintsOp(st, globalKey, args.constraints), @@ -1739,14 +1746,21 @@ createSettingsOp(settingsC, settingsKey, args.settings), createSettingsOp(settingsC, leadershipKey, args.leadershipSettings), createStatusOp(st, globalKey, args.statusDoc), - addModelServiceRefOp(st, svc.Name()), + addModelApplicationRefOp(st, app.Name()), } ops = append(ops, charmRefOps...) ops = append(ops, txn.Op{ C: applicationsC, - Id: svc.Name(), + Id: app.Name(), Assert: txn.DocMissing, Insert: args.applicationDoc, }) + if featureflag.Enabled(feature.CrossModelRelations) { + ops = append(ops, txn.Op{ + C: remoteApplicationsC, + Id: app.Name(), + Assert: txn.DocMissing, + }) + } return ops, nil } diff -Nru juju-core-2.0.0/src/github.com/juju/juju/state/charm_test.go juju-core-2.0.2/src/github.com/juju/juju/state/charm_test.go --- juju-core-2.0.0/src/github.com/juju/juju/state/charm_test.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/state/charm_test.go 2016-11-11 00:08:09.000000000 +0000 @@ -193,9 +193,7 @@ Charm: s.charm, } _, err := s.State.AddApplication(args) - // bad message: see lp:1621754. should match - // TestReferenceDyingCharm above. - c.Check(err, gc.ErrorMatches, `cannot add application "blah": application already exists`) + c.Check(err, gc.ErrorMatches, `cannot add application "blah": charm: not found or not alive`) } func (s *CharmSuite) TestDestroyReferencedCharm(c *gc.C) { diff -Nru juju-core-2.0.0/src/github.com/juju/juju/state/cleanup.go juju-core-2.0.2/src/github.com/juju/juju/state/cleanup.go --- juju-core-2.0.0/src/github.com/juju/juju/state/cleanup.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/state/cleanup.go 2016-11-11 00:08:09.000000000 +0000 @@ -19,7 +19,7 @@ const ( // SCHEMACHANGE: the names are expressive, the values not so much. cleanupRelationSettings cleanupKind = "settings" - cleanupUnitsForDyingService cleanupKind = "units" + cleanupUnitsForDyingApplication cleanupKind = "units" cleanupCharm cleanupKind = "charm" cleanupDyingUnit cleanupKind = "dyingUnit" cleanupRemovedUnit cleanupKind = "removedUnit" @@ -85,8 +85,8 @@ err = st.cleanupRelationSettings(doc.Prefix) case cleanupCharm: err = st.cleanupCharm(doc.Prefix) - case cleanupUnitsForDyingService: - err = st.cleanupUnitsForDyingService(doc.Prefix) + case cleanupUnitsForDyingApplication: + err = st.cleanupUnitsForDyingApplication(doc.Prefix) case cleanupDyingUnit: err = st.cleanupDyingUnit(doc.Prefix) case cleanupRemovedUnit: @@ -233,10 +233,10 @@ return nil } -// cleanupUnitsForDyingService sets all units with the given prefix to Dying, +// cleanupUnitsForDyingApplication sets all units with the given prefix to Dying, // if they are not already Dying or Dead. It's expected to be used when a // service is destroyed. -func (st *State) cleanupUnitsForDyingService(applicationname string) (err error) { +func (st *State) cleanupUnitsForDyingApplication(applicationname string) (err error) { // This won't miss units, because a Dying service cannot have units added // to it. But we do have to remove the units themselves via individual // transactions, because they could be in any state at all. diff -Nru juju-core-2.0.0/src/github.com/juju/juju/state/export_test.go juju-core-2.0.2/src/github.com/juju/juju/state/export_test.go --- juju-core-2.0.0/src/github.com/juju/juju/state/export_test.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/state/export_test.go 2016-11-11 00:08:09.000000000 +0000 @@ -22,6 +22,7 @@ "gopkg.in/mgo.v2/bson" "gopkg.in/mgo.v2/txn" + "github.com/juju/juju/core/crossmodel" "github.com/juju/juju/core/lease" "github.com/juju/juju/mongo" "github.com/juju/juju/mongo/utils" @@ -95,6 +96,14 @@ return runner } +func OfferAtURL(sd crossmodel.ApplicationDirectory, url string) (*applicationOfferDoc, error) { + return sd.(*applicationDirectory).offerAtURL(url) +} + +func MakeApplicationOfferDoc(sd crossmodel.ApplicationDirectory, url string, offer crossmodel.ApplicationOffer) applicationOfferDoc { + return sd.(*applicationDirectory).makeApplicationOfferDoc(offer) +} + // SetPolicy updates the State's policy field to the // given Policy, and returns the old value. func SetPolicy(st *State, p Policy) Policy { diff -Nru juju-core-2.0.0/src/github.com/juju/juju/state/interface.go juju-core-2.0.2/src/github.com/juju/juju/state/interface.go --- juju-core-2.0.0/src/github.com/juju/juju/state/interface.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/state/interface.go 2016-11-11 00:08:09.000000000 +0000 @@ -236,3 +236,21 @@ // and end state of the action. Finish(results ActionResults) (Action, error) } + +// ApplicationEntity represents a local or remote application. +type ApplicationEntity interface { + // Life returns the life status of the application. + Life() Life + + // IsRemote returns true if the application is remote (hosted in a different model). + IsRemote() bool + + // Endpoints returns the application's currently available relation endpoints. + Endpoints() ([]Endpoint, error) + + // Endpoint returns the relation endpoint with the supplied name, if it exists. + Endpoint(relationName string) (Endpoint, error) + + // Relations returns a Relation for every relation the application is in. + Relations() (relations []*Relation, err error) +} diff -Nru juju-core-2.0.0/src/github.com/juju/juju/state/internal_test.go juju-core-2.0.2/src/github.com/juju/juju/state/internal_test.go --- juju-core-2.0.0/src/github.com/juju/juju/state/internal_test.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/state/internal_test.go 2016-11-11 00:08:09.000000000 +0000 @@ -14,6 +14,7 @@ "github.com/juju/juju/cloud" "github.com/juju/juju/constraints" "github.com/juju/juju/environs/config" + "github.com/juju/juju/feature" "github.com/juju/juju/instance" "github.com/juju/juju/mongo" "github.com/juju/juju/mongo/mongotest" @@ -45,6 +46,7 @@ } func (s *internalStateSuite) SetUpTest(c *gc.C) { + s.SetInitialFeatureFlags(feature.CrossModelRelations) s.MgoSuite.SetUpTest(c) s.BaseSuite.SetUpTest(c) diff -Nru juju-core-2.0.0/src/github.com/juju/juju/state/ipaddresses_internal_test.go juju-core-2.0.2/src/github.com/juju/juju/state/ipaddresses_internal_test.go --- juju-core-2.0.0/src/github.com/juju/juju/state/ipaddresses_internal_test.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/state/ipaddresses_internal_test.go 2016-11-11 00:08:09.000000000 +0000 @@ -123,6 +123,7 @@ c.Check(result.DNSServers(), jc.DeepEquals, []string{"ns1.example.com", "ns2.example.org"}) c.Check(result.DNSSearchDomains(), jc.DeepEquals, []string{"example.com", "example.org"}) c.Check(result.GatewayAddress(), gc.Equals, "10.20.30.1") + c.Check(result.NetworkAddress(), jc.DeepEquals, network.NewAddress(result.Value())) } func (s *ipAddressesInternalSuite) TestIsValidAddressConfigMethodWithValidValues(c *gc.C) { diff -Nru juju-core-2.0.0/src/github.com/juju/juju/state/ipaddresses_test.go juju-core-2.0.2/src/github.com/juju/juju/state/ipaddresses_test.go --- juju-core-2.0.0/src/github.com/juju/juju/state/ipaddresses_test.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/state/ipaddresses_test.go 2016-11-11 00:08:09.000000000 +0000 @@ -284,6 +284,18 @@ c.Assert(allAddresses, jc.DeepEquals, addedAddresses) } +func (s *ipAddressesStateSuite) TestMachineAllNetworkAddresses(c *gc.C) { + addedAddresses := s.addTwoDevicesWithTwoAddressesEach(c) + expected := make([]network.Address, len(addedAddresses)) + for i := range addedAddresses { + expected[i] = addedAddresses[i].NetworkAddress() + } + + networkAddresses, err := s.machine.AllNetworkAddresses() + c.Assert(err, jc.ErrorIsNil) + c.Assert(networkAddresses, jc.DeepEquals, expected) +} + func (s *ipAddressesStateSuite) TestLinkLayerDeviceRemoveAlsoRemovesDeviceAddresses(c *gc.C) { device, _ := s.addNamedDeviceWithAddresses(c, "eth0", "10.20.30.40/16", "fc00::/64") s.assertAllAddressesOnMachineMatchCount(c, s.machine, 2) diff -Nru juju-core-2.0.0/src/github.com/juju/juju/state/linklayerdevices_ipaddresses.go juju-core-2.0.2/src/github.com/juju/juju/state/linklayerdevices_ipaddresses.go --- juju-core-2.0.0/src/github.com/juju/juju/state/linklayerdevices_ipaddresses.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/state/linklayerdevices_ipaddresses.go 2016-11-11 00:08:09.000000000 +0000 @@ -97,6 +97,11 @@ return &Address{st: st, doc: doc} } +// NetworkAddress returns the address transformed to a network.Address. +func (addr *Address) NetworkAddress() network.Address { + return network.NewAddress(addr.Value()) +} + // DocID returns the globally unique ID of the IP address, including the model // UUID as prefix. func (addr *Address) DocID() string { diff -Nru juju-core-2.0.0/src/github.com/juju/juju/state/machine.go juju-core-2.0.2/src/github.com/juju/juju/state/machine.go --- juju-core-2.0.0/src/github.com/juju/juju/state/machine.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/state/machine.go 2016-11-11 00:08:09.000000000 +0000 @@ -1133,6 +1133,7 @@ volumes map[names.VolumeTag]VolumeInfo, volumeAttachments map[names.VolumeTag]VolumeAttachmentInfo, ) error { + logger.Tracef("setting instance info: machine %v, deviceAddrs: %#v, devicesArgs: %#v", m.Id(), devicesAddrs, devicesArgs) if err := m.SetParentLinkLayerDevicesBeforeTheirChildren(devicesArgs); err != nil { return errors.Trace(err) @@ -1270,11 +1271,13 @@ Update: bson.D{{"$set", bson.D{{fieldName, addr}}}}, Assert: assert, }} + logger.Tracef("setting preferred address to %v (isPublic %#v)", addr, isPublic) return ops } func (m *Machine) setPublicAddressOps(providerAddresses []address, machineAddresses []address) ([]txn.Op, address, bool) { publicAddress := m.doc.PreferredPublicAddress + logger.Tracef("machine %v: current public address: %#v \nprovider addresses: %#v \nmachine addresses: %#v", m.Id(), publicAddress, providerAddresses, machineAddresses) // Always prefer an exact match if available. checkScope := func(addr address) bool { return network.ExactScopeMatch(addr.networkAddress(), network.ScopePublic) diff -Nru juju-core-2.0.0/src/github.com/juju/juju/state/machine_linklayerdevices.go juju-core-2.0.2/src/github.com/juju/juju/state/machine_linklayerdevices.go --- juju-core-2.0.0/src/github.com/juju/juju/state/machine_linklayerdevices.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/state/machine_linklayerdevices.go 2016-11-11 00:08:09.000000000 +0000 @@ -847,6 +847,21 @@ return allAddresses, nil } +// AllNetworkAddresses returns the result of AllAddresses(), but transformed to +// []network.Address. +func (m *Machine) AllNetworkAddresses() ([]network.Address, error) { + stateAddresses, err := m.AllAddresses() + if err != nil { + return nil, errors.Trace(err) + } + + networkAddresses := make([]network.Address, len(stateAddresses)) + for i := range stateAddresses { + networkAddresses[i] = stateAddresses[i].NetworkAddress() + } + return networkAddresses, nil +} + // SetParentLinkLayerDevicesBeforeTheirChildren splits the given devicesArgs // into multiple sets of args and calls SetLinkLayerDevices() for each set, such // that child devices are set only after their parents. diff -Nru juju-core-2.0.0/src/github.com/juju/juju/state/migration_export.go juju-core-2.0.2/src/github.com/juju/juju/state/migration_export.go --- juju-core-2.0.0/src/github.com/juju/juju/state/migration_export.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/state/migration_export.go 2016-11-11 00:08:09.000000000 +0000 @@ -67,6 +67,9 @@ LatestToolsVersion: dbModel.LatestToolsVersion(), Blocks: blocks, } + if creds, credsSet := dbModel.CloudCredential(); credsSet { + args.CloudCredential = creds.Id() + } export.model = description.NewModel(args) modelKey := dbModel.globalKey() export.model.SetAnnotations(export.getAnnotations(modelKey)) @@ -472,6 +475,11 @@ return errors.Trace(err) } + bindings, err := e.readAllEndpointBindings() + if err != nil { + return errors.Trace(err) + } + leaders, err := e.st.ApplicationLeaders() if err != nil { return errors.Trace(err) @@ -486,11 +494,12 @@ applicationUnits := e.units[application.Name()] leader := leaders[application.Name()] if err := e.addApplication(addApplicationContext{ - application: application, - units: applicationUnits, - meterStatus: meterStatus, - leader: leader, - payloads: payloads, + application: application, + units: applicationUnits, + meterStatus: meterStatus, + leader: leader, + payloads: payloads, + endpoingBindings: bindings, }); err != nil { return errors.Trace(err) } @@ -542,16 +551,18 @@ } type addApplicationContext struct { - application *Application - units []*Unit - meterStatus map[string]*meterStatusDoc - leader string - payloads map[string][]payload.FullPayloadInfo + application *Application + units []*Unit + meterStatus map[string]*meterStatusDoc + leader string + payloads map[string][]payload.FullPayloadInfo + endpoingBindings map[string]bindingsMap } func (e *exporter) addApplication(ctx addApplicationContext) error { application := ctx.application appName := application.Name() + globalKey := application.globalKey() settingsKey := application.settingsKey() leadershipKey := leadershipSettingsKey(appName) storageConstraintsKey := application.storageConstraintsKey() @@ -575,6 +586,7 @@ ForceCharm: application.doc.ForceCharm, Exposed: application.doc.Exposed, MinUnits: application.doc.MinUnits, + EndpointBindings: map[string]string(ctx.endpoingBindings[globalKey]), Settings: applicationSettingsDoc.Settings, Leader: ctx.leader, LeadershipSettings: leadershipSettingsDoc.Settings, @@ -585,7 +597,6 @@ } exApplication := e.model.AddApplication(args) // Find the current application status. - globalKey := application.globalKey() statusArgs, err := e.statusArgs(globalKey) if err != nil { return errors.Annotatef(err, "status for application %s", appName) @@ -932,6 +943,23 @@ } return result, nil } + +func (e *exporter) readAllEndpointBindings() (map[string]bindingsMap, error) { + bindings, closer := e.st.getCollection(endpointBindingsC) + defer closer() + + docs := []endpointBindingsDoc{} + err := bindings.Find(nil).All(&docs) + if err != nil { + return nil, errors.Annotate(err, "cannot get all application endpoint bindings") + } + e.logger.Debugf("found %d application endpoint binding docs", len(docs)) + result := make(map[string]bindingsMap) + for _, doc := range docs { + result[e.st.localID(doc.DocID)] = doc.Bindings + } + return result, nil +} func (e *exporter) readAllMeterStatus() (map[string]*meterStatusDoc, error) { meterStatuses, closer := e.st.getCollection(meterStatusC) diff -Nru juju-core-2.0.0/src/github.com/juju/juju/state/migration_export_test.go juju-core-2.0.2/src/github.com/juju/juju/state/migration_export_test.go --- juju-core-2.0.0/src/github.com/juju/juju/state/migration_export_test.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/state/migration_export_test.go 2016-11-11 00:08:09.000000000 +0000 @@ -486,6 +486,26 @@ c.Assert(opened[0].UnitName(), gc.Equals, unit.Name()) } +func (s *MigrationExportSuite) TestEndpointBindings(c *gc.C) { + s.Factory.MakeSpace(c, &factory.SpaceParams{ + Name: "one", ProviderID: network.Id("provider"), IsPublic: true}) + state.AddTestingServiceWithBindings( + c, s.State, "wordpress", state.AddTestingCharm(c, s.State, "wordpress"), + map[string]string{"db": "one"}) + + model, err := s.State.Export() + c.Assert(err, jc.ErrorIsNil) + + apps := model.Applications() + c.Assert(apps, gc.HasLen, 1) + wordpress := apps[0] + + bindings := wordpress.EndpointBindings() + // There are empty values for every charm endpoint, but we only care about the + // db endpoint. + c.Assert(bindings["db"], gc.Equals, "one") +} + func (s *MigrationExportSuite) TestRelations(c *gc.C) { wordpress := state.AddTestingService(c, s.State, "wordpress", state.AddTestingCharm(c, s.State, "wordpress")) mysql := state.AddTestingService(c, s.State, "mysql", state.AddTestingCharm(c, s.State, "mysql")) diff -Nru juju-core-2.0.0/src/github.com/juju/juju/state/migration_import.go juju-core-2.0.2/src/github.com/juju/juju/state/migration_import.go --- juju-core-2.0.0/src/github.com/juju/juju/state/migration_import.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/state/migration_import.go 2016-11-11 00:08:09.000000000 +0000 @@ -55,7 +55,7 @@ if err != nil { return nil, nil, errors.Trace(err) } - dbModel, newSt, err := st.NewModel(ModelArgs{ + args := ModelArgs{ CloudName: model.Cloud(), CloudRegion: model.CloudRegion(), Config: cfg, @@ -67,7 +67,11 @@ // the model description before adding any volumes, // filesystems or storage instances. StorageProviderRegistry: storage.StaticProviderRegistry{}, - }) + } + if creds := model.CloudCredential(); creds != "" { + args.CloudCredential = names.NewCloudCredentialTag(creds) + } + dbModel, newSt, err := st.NewModel(args) if err != nil { return nil, nil, errors.Trace(err) } @@ -613,18 +617,19 @@ } } -func (i *importer) application(s description.Application) error { +func (i *importer) application(a description.Application) error { // Import this application, then its units. - i.logger.Debugf("importing application %s", s.Name()) + i.logger.Debugf("importing application %s", a.Name()) // 1. construct an applicationDoc - sdoc, err := i.makeApplicationDoc(s) + appDoc, err := i.makeApplicationDoc(a) if err != nil { return errors.Trace(err) } + app := newApplication(i.st, appDoc) // 2. construct a statusDoc - status := s.Status() + status := a.Status() if status == nil { return errors.NotValidf("missing status") } @@ -632,41 +637,49 @@ // TODO: update never set malarky... maybe... ops, err := addApplicationOps(i.st, addApplicationOpsArgs{ - applicationDoc: sdoc, + applicationDoc: appDoc, statusDoc: statusDoc, - constraints: i.constraints(s.Constraints()), - storage: i.storageConstraints(s.StorageConstraints()), - settings: s.Settings(), - leadershipSettings: s.LeadershipSettings(), + constraints: i.constraints(a.Constraints()), + storage: i.storageConstraints(a.StorageConstraints()), + settings: a.Settings(), + leadershipSettings: a.LeadershipSettings(), }) if err != nil { return errors.Trace(err) } + ops = append(ops, txn.Op{ + C: endpointBindingsC, + Id: app.globalKey(), + Assert: txn.DocMissing, + Insert: endpointBindingsDoc{ + Bindings: bindingsMap(a.EndpointBindings()), + }, + }) + if err := i.st.runTransaction(ops); err != nil { return errors.Trace(err) } - svc := newApplication(i.st, sdoc) - if annotations := s.Annotations(); len(annotations) > 0 { - if err := i.st.SetAnnotations(svc, annotations); err != nil { + if annotations := a.Annotations(); len(annotations) > 0 { + if err := i.st.SetAnnotations(app, annotations); err != nil { return errors.Trace(err) } } - if err := i.importStatusHistory(svc.globalKey(), s.StatusHistory()); err != nil { + if err := i.importStatusHistory(app.globalKey(), a.StatusHistory()); err != nil { return errors.Trace(err) } - for _, unit := range s.Units() { - if err := i.unit(s, unit); err != nil { + for _, unit := range a.Units() { + if err := i.unit(a, unit); err != nil { return errors.Trace(err) } } - if s.Leader() != "" { + if a.Leader() != "" { if err := i.st.LeadershipClaimer().ClaimLeadership( - s.Name(), - s.Leader(), + a.Name(), + a.Leader(), initialLeaderClaimTime); err != nil { return errors.Trace(err) } diff -Nru juju-core-2.0.0/src/github.com/juju/juju/state/migration_import_test.go juju-core-2.0.2/src/github.com/juju/juju/state/migration_import_test.go --- juju-core-2.0.0/src/github.com/juju/juju/state/migration_import_test.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/state/migration_import_test.go 2016-11-11 00:08:09.000000000 +0000 @@ -491,6 +491,26 @@ c.Assert(settings.Map(), gc.DeepEquals, relSettings) } +func (s *MigrationImportSuite) TestEndpointBindings(c *gc.C) { + // Endpoint bindings need both valid charms, applications, and spaces. + s.Factory.MakeSpace(c, &factory.SpaceParams{ + Name: "one", ProviderID: network.Id("provider"), IsPublic: true}) + state.AddTestingServiceWithBindings( + c, s.State, "wordpress", state.AddTestingCharm(c, s.State, "wordpress"), + map[string]string{"db": "one"}) + + _, newSt := s.importModel(c) + + newWordpress, err := newSt.Application("wordpress") + c.Assert(err, jc.ErrorIsNil) + + bindings, err := newWordpress.EndpointBindings() + c.Assert(err, jc.ErrorIsNil) + // There are empty values for every charm endpoint, but we only care about the + // db endpoint. + c.Assert(bindings["db"], gc.Equals, "one") +} + func (s *MigrationImportSuite) TestUnitsOpenPorts(c *gc.C) { unit := s.Factory.MakeUnit(c, nil) err := unit.OpenPorts("tcp", 1234, 2345) diff -Nru juju-core-2.0.0/src/github.com/juju/juju/state/migration_internal_test.go juju-core-2.0.2/src/github.com/juju/juju/state/migration_internal_test.go --- juju-core-2.0.0/src/github.com/juju/juju/state/migration_internal_test.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/state/migration_internal_test.go 2016-11-11 00:08:09.000000000 +0000 @@ -48,6 +48,7 @@ relationScopesC, // networking + endpointBindingsC, ipAddressesC, spacesC, linkLayerDevicesC, @@ -155,6 +156,11 @@ // Recreated whilst migrating actions. actionNotificationsC, + + //Cross Model Relations - TODO + localApplicationDirectoryC, + remoteApplicationsC, + applicationOffersC, ) // THIS SET WILL BE REMOVED WHEN MIGRATIONS ARE COMPLETE @@ -168,7 +174,6 @@ // service / unit charmsC, "resources", - endpointBindingsC, // uncategorised metricsManagerC, // should really be copied across @@ -795,6 +800,20 @@ s.AssertExportedFields(c, payloadDoc{}, migrated.Union(definedThroughContainment)) } +func (s *MigrationSuite) TestEndpointBindingFields(c *gc.C) { + definedThroughContainment := set.NewStrings( + "DocID", + ) + migrated := set.NewStrings( + "Bindings", + ) + ignored := set.NewStrings( + "TxnRevno", + ) + fields := definedThroughContainment.Union(migrated).Union(ignored) + s.AssertExportedFields(c, endpointBindingsDoc{}, fields) +} + func (s *MigrationSuite) AssertExportedFields(c *gc.C, doc interface{}, fields set.Strings) { expected := testing.GetExportedFields(doc) unknown := expected.Difference(fields) diff -Nru juju-core-2.0.0/src/github.com/juju/juju/state/model.go juju-core-2.0.2/src/github.com/juju/juju/state/model.go --- juju-core-2.0.0/src/github.com/juju/juju/state/model.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/state/model.go 2016-11-11 00:08:09.000000000 +0000 @@ -909,7 +909,7 @@ } } -func addModelServiceRefOp(st *State, applicationname string) txn.Op { +func addModelApplicationRefOp(st *State, applicationname string) txn.Op { return txn.Op{ C: modelEntityRefsC, Id: st.ModelUUID(), @@ -918,7 +918,7 @@ } } -func removeModelServiceRefOp(st *State, applicationname string) txn.Op { +func removeModelApplicationRefOp(st *State, applicationname string) txn.Op { return txn.Op{ C: modelEntityRefsC, Id: st.ModelUUID(), diff -Nru juju-core-2.0.0/src/github.com/juju/juju/state/multiwatcher/multiwatcher.go juju-core-2.0.2/src/github.com/juju/juju/state/multiwatcher/multiwatcher.go --- juju-core-2.0.0/src/github.com/juju/juju/state/multiwatcher/multiwatcher.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/state/multiwatcher/multiwatcher.go 2016-11-11 00:08:09.000000000 +0000 @@ -93,6 +93,8 @@ d.Entity = new(MachineInfo) case "application": d.Entity = new(ApplicationInfo) + case "remoteApplication": + d.Entity = new(RemoteApplicationInfo) case "unit": d.Entity = new(UnitInfo) case "relation": @@ -194,6 +196,26 @@ ModelUUID: i.ModelUUID, Id: i.Name, } +} + +// RemoteApplicationInfo holds the information about a remote application that is +// tracked by multiwatcherStore. +type RemoteApplicationInfo struct { + ModelUUID string + Name string + ApplicationURL string + Life Life + Status StatusInfo +} + +// EntityId returns a unique identifier for a remote application across +// environments. +func (i *RemoteApplicationInfo) EntityId() EntityId { + return EntityId{ + Kind: "remoteApplication", + ModelUUID: i.ModelUUID, + Id: i.Name, + } } // Port identifies a network port number for a particular protocol. diff -Nru juju-core-2.0.0/src/github.com/juju/juju/state/offeredapplications.go juju-core-2.0.2/src/github.com/juju/juju/state/offeredapplications.go --- juju-core-2.0.0/src/github.com/juju/juju/state/offeredapplications.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/state/offeredapplications.go 2016-11-11 00:08:09.000000000 +0000 @@ -0,0 +1,273 @@ +// Copyright 2015 Canonical Ltd. +// Licensed under the AGPLv3, see LICENCE file for details. + +package state + +import ( + "fmt" + "regexp" + "sort" + + "github.com/juju/errors" + "gopkg.in/juju/names.v2" + "gopkg.in/mgo.v2/bson" + "gopkg.in/mgo.v2/txn" + + "github.com/juju/juju/core/crossmodel" +) + +// applicationOfferDoc represents the internal state of a application offer in MongoDB. +type offeredApplicationDoc struct { + DocID string `bson:"_id"` + + // URL is the URL used to locate the offer in a directory. + URL string `bson:"url"` + + // ApplicationName is the name of the application. + ApplicationName string `bson:"application-name"` + + // CharmName is the name of the charm usd to deploy the service. + CharmName string `bson:"charm-name"` + + // Description is the description of the service. + Description string `bson:"description"` + + // Endpoints is the collection of endpoint names offered (internal->published). + // The map allows for advertised endpoint names to be aliased. + Endpoints map[string]string `bson:"endpoints"` + + // Registered is set to true when the application in this offer is + // to be recorded in the application directory indicated by the URL. + Registered bool `bson:"registered"` +} + +type offeredApplications struct { + st *State +} + +// NewOfferedApplications creates a offered applications manager backed by a state instance. +func NewOfferedApplications(st *State) crossmodel.OfferedApplications { + return &offeredApplications{st: st} +} + +// Remove deletes the application offer at url immediately. +func (s *offeredApplications) RemoveOffer(url string) (err error) { + defer errors.DeferredAnnotatef(&err, "cannot delete application offer at %q", url) + err = s.st.runTransaction(s.removeOps(url)) + if err == txn.ErrAborted { + // Already deleted. + return nil + } + return err +} + +// removeOps returns the operations required to remove the record at url. +func (s *offeredApplications) removeOps(url string) []txn.Op { + return []txn.Op{ + { + C: applicationOffersC, + Id: url, + Assert: txn.DocExists, + Remove: true, + }, + } +} + +func (s *offeredApplications) validateOffer(offer crossmodel.OfferedApplication) (err error) { + // Sanity checks. + if !names.IsValidApplication(offer.ApplicationName) { + return errors.NotValidf("application name %q", offer.ApplicationName) + } + if _, err := crossmodel.ParseApplicationURL(offer.ApplicationURL); err != nil { + return errors.NotValidf("application URL %q", offer.ApplicationURL) + } + return nil +} + +// AddOffer adds a new application offering to state. +func (s *offeredApplications) AddOffer(offer crossmodel.OfferedApplication) (err error) { + defer errors.DeferredAnnotatef(&err, "cannot add application offer %q at %q", offer.ApplicationName, offer.ApplicationURL) + + if err := s.validateOffer(offer); err != nil { + return err + } + + doc := s.makeOfferedApplicationDoc(offer) + ops := []txn.Op{ + assertModelActiveOp(s.st.ModelUUID()), + { + C: applicationOffersC, + Id: doc.DocID, + Assert: txn.DocMissing, + Insert: doc, + }, + } + err = s.st.runTransaction(ops) + if err == txn.ErrAborted { + if err := checkModelActive(s.st); err != nil { + return err + } + return errDuplicateApplicationOffer + } + return errors.Trace(err) +} + +// UpdateOffer updates an existing application offering to state. +func (s *offeredApplications) UpdateOffer(url string, endpoints map[string]string) (err error) { + defer errors.DeferredAnnotatef(&err, "cannot update application offer") + + if _, err := crossmodel.ParseApplicationURL(url); err != nil { + return errors.NotValidf("application URL %q", url) + } + if len(endpoints) == 0 { + return errors.New("no endpoints specified") + } + ops := []txn.Op{ + assertModelActiveOp(s.st.ModelUUID()), + { + C: applicationOffersC, + Id: url, + Assert: txn.DocExists, + Update: bson.D{ + {"$set", bson.D{{"endpoints", endpoints}}}, + }, + }, + } + err = s.st.runTransaction(ops) + if err == txn.ErrAborted { + if err := checkModelActive(s.st); err != nil { + return err + } + return errors.NotFoundf("application offer at %q", url) + } + return errors.Trace(err) +} + +func (s *offeredApplications) makeOfferedApplicationDoc(offer crossmodel.OfferedApplication) offeredApplicationDoc { + doc := offeredApplicationDoc{ + DocID: offer.ApplicationURL, + URL: offer.ApplicationURL, + ApplicationName: offer.ApplicationName, + CharmName: offer.CharmName, + Description: offer.Description, + Registered: true, + } + eps := make(map[string]string, len(offer.Endpoints)) + for internal, published := range offer.Endpoints { + eps[internal] = published + } + doc.Endpoints = eps + return doc +} + +func (s *offeredApplications) makeFilterTerm(filterTerm crossmodel.OfferedApplicationFilter) bson.D { + var filter bson.D + if filterTerm.ApplicationName != "" { + filter = append(filter, bson.DocElem{"application-name", filterTerm.ApplicationName}) + } + if filterTerm.CharmName != "" { + filter = append(filter, bson.DocElem{"charm-name", filterTerm.CharmName}) + } + if filterTerm.Registered != nil { + filter = append(filter, bson.DocElem{"registered", *filterTerm.Registered}) + } + // We match on partial URLs eg /u/user + if filterTerm.ApplicationURL != "" { + url := regexp.QuoteMeta(filterTerm.ApplicationURL) + filter = append(filter, bson.DocElem{"url", bson.D{{"$regex", fmt.Sprintf(".*%s.*", url)}}}) + } + return filter +} + +// ListOffers returns the application offers matching any one of the filter terms. +func (s *offeredApplications) ListOffers(filter ...crossmodel.OfferedApplicationFilter) ([]crossmodel.OfferedApplication, error) { + applicationOffersCollection, closer := s.st.getCollection(applicationOffersC) + defer closer() + + var mgoTerms []bson.D + for _, term := range filter { + elems := s.makeFilterTerm(term) + if len(elems) == 0 { + continue + } + mgoTerms = append(mgoTerms, bson.D{{"$and", []bson.D{elems}}}) + } + var docs []offeredApplicationDoc + var mgoQuery bson.D + if len(mgoTerms) > 0 { + mgoQuery = bson.D{{"$or", mgoTerms}} + } + err := applicationOffersCollection.Find(mgoQuery).All(&docs) + if err != nil { + return nil, errors.Annotate(err, "cannot find application offers") + } + sort.Sort(soSlice(docs)) + offers := make([]crossmodel.OfferedApplication, len(docs)) + for i, doc := range docs { + offers[i] = s.makeApplicationOffer(doc) + } + return offers, nil +} + +func (s *offeredApplications) makeApplicationOffer(doc offeredApplicationDoc) crossmodel.OfferedApplication { + offer := crossmodel.OfferedApplication{ + ApplicationURL: doc.URL, + ApplicationName: doc.ApplicationName, + CharmName: doc.CharmName, + Description: doc.Description, + Registered: doc.Registered, + } + offer.Endpoints = make(map[string]string, len(doc.Endpoints)) + for internal, published := range doc.Endpoints { + offer.Endpoints[internal] = published + } + return offer +} + +// SetOfferRegistered marks a previously saved offer as registered or not. +func (s *offeredApplications) SetOfferRegistered(url string, registered bool) (err error) { + defer errors.DeferredAnnotatef(&err, "cannot register application offer") + + model, err := s.st.Model() + if err != nil { + return errors.Trace(err) + } else if model.Life() != Alive { + return errors.Errorf("model is no longer alive") + } + + buildTxn := func(attempt int) ([]txn.Op, error) { + // If we've tried once already and failed, check that + // model may have been destroyed. + if attempt > 0 { + if err := checkModelActive(s.st); err != nil { + return nil, errors.Trace(err) + } + return nil, errors.NotFoundf("application offer at %q", url) + } + ops := []txn.Op{ + model.assertActiveOp(), + { + C: applicationOffersC, + Id: url, + Assert: txn.DocExists, + Update: bson.M{"$set": bson.M{"registered": registered}}, + }, + } + return ops, nil + } + err = s.st.run(buildTxn) + return errors.Trace(err) +} + +type soSlice []offeredApplicationDoc + +func (so soSlice) Len() int { return len(so) } +func (so soSlice) Swap(i, j int) { so[i], so[j] = so[j], so[i] } +func (so soSlice) Less(i, j int) bool { + so1 := so[i] + so2 := so[j] + if so1.URL != so2.URL { + return so1.ApplicationName < so2.ApplicationName + } + return so1.URL < so2.URL +} diff -Nru juju-core-2.0.0/src/github.com/juju/juju/state/offeredapplications_test.go juju-core-2.0.2/src/github.com/juju/juju/state/offeredapplications_test.go --- juju-core-2.0.0/src/github.com/juju/juju/state/offeredapplications_test.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/state/offeredapplications_test.go 2016-11-11 00:08:09.000000000 +0000 @@ -0,0 +1,290 @@ +// Copyright 2015 Canonical Ltd. +// Licensed under the AGPLv3, see LICENCE file for details. + +package state_test + +import ( + jc "github.com/juju/testing/checkers" + gc "gopkg.in/check.v1" + "gopkg.in/juju/names.v2" + + "github.com/juju/juju/core/crossmodel" + "github.com/juju/juju/mongo/mongotest" + "github.com/juju/juju/state" + "github.com/juju/juju/state/testing" +) + +type offeredApplicationsSuite struct { + ConnSuite +} + +var _ = gc.Suite(&offeredApplicationsSuite{}) + +func (s *offeredApplicationsSuite) createDefaultOffer(c *gc.C) crossmodel.OfferedApplication { + eps := map[string]string{"db": "db", "db-admin": "dbadmin"} + offered := state.NewOfferedApplications(s.State) + offer := crossmodel.OfferedApplication{ + ApplicationURL: "local:/u/me/service", + ApplicationName: "mysql", + CharmName: "charm", + Description: "description", + Endpoints: eps, + Registered: true, + } + err := offered.AddOffer(offer) + c.Assert(err, jc.ErrorIsNil) + return offer +} + +func (s *offeredApplicationsSuite) TestRemove(c *gc.C) { + offer := s.createDefaultOffer(c) + offered := state.NewOfferedApplications(s.State) + err := offered.RemoveOffer(offer.ApplicationURL) + c.Assert(err, jc.ErrorIsNil) + + modelTag := names.NewModelTag(s.State.ModelUUID()) + anotherState, err := state.Open(modelTag, s.State.ControllerTag(), testing.NewMongoInfo(), mongotest.DialOpts(), nil) + c.Assert(err, jc.ErrorIsNil) + defer anotherState.Close() + + offered = state.NewOfferedApplications(anotherState) + offers, err := offered.ListOffers() + c.Assert(err, jc.ErrorIsNil) + c.Assert(offers, gc.HasLen, 0) +} + +func (s *offeredApplicationsSuite) TestAddApplicationOffer(c *gc.C) { + eps := map[string]string{"mysql": "mysql", "mysql-admin": "admin"} + offered := state.NewOfferedApplications(s.State) + offer := crossmodel.OfferedApplication{ + ApplicationURL: "local:/u/me/service", + ApplicationName: "mysql", + CharmName: "charm", + Description: "description", + Endpoints: eps, + } + err := offered.AddOffer(offer) + c.Assert(err, jc.ErrorIsNil) + + modelTag := names.NewModelTag(s.State.ModelUUID()) + anotherState, err := state.Open(modelTag, s.State.ControllerTag(), testing.NewMongoInfo(), mongotest.DialOpts(), nil) + c.Assert(err, jc.ErrorIsNil) + defer anotherState.Close() + + offered = state.NewOfferedApplications(anotherState) + offers, err := offered.ListOffers() + c.Assert(err, jc.ErrorIsNil) + offers, err = offered.ListOffers() + c.Assert(err, jc.ErrorIsNil) + c.Assert(offers, gc.HasLen, 1) + // offers are always created as registered. + offer.Registered = true + c.Assert(offers[0], jc.DeepEquals, offer) +} + +func (s *offeredApplicationsSuite) TestUpdateApplicationOffer(c *gc.C) { + eps := map[string]string{"db": "db"} + offered := state.NewOfferedApplications(s.State) + offer := crossmodel.OfferedApplication{ + ApplicationURL: "local:/u/me/service", + ApplicationName: "mysql", + Endpoints: eps, + } + err := offered.AddOffer(offer) + c.Assert(err, jc.ErrorIsNil) + + err = offered.UpdateOffer("local:/u/me/service", map[string]string{"db": "db", "db-admin": "admin"}) + c.Assert(err, jc.ErrorIsNil) + + modelTag := names.NewModelTag(s.State.ModelUUID()) + anotherState, err := state.Open(modelTag, s.State.ControllerTag(), testing.NewMongoInfo(), mongotest.DialOpts(), nil) + c.Assert(err, jc.ErrorIsNil) + defer anotherState.Close() + + offered = state.NewOfferedApplications(anotherState) + offers, err := offered.ListOffers() + c.Assert(err, jc.ErrorIsNil) + offers, err = offered.ListOffers() + c.Assert(err, jc.ErrorIsNil) + c.Assert(offers, gc.HasLen, 1) + + expectedOffer := crossmodel.OfferedApplication{ + ApplicationURL: "local:/u/me/service", + ApplicationName: "mysql", + Endpoints: map[string]string{"db": "db", "db-admin": "admin"}, + Registered: true, + } + c.Assert(offers[0], jc.DeepEquals, expectedOffer) +} + +func (s *offeredApplicationsSuite) TestListOffersNone(c *gc.C) { + sd := state.NewOfferedApplications(s.State) + offers, err := sd.ListOffers() + c.Assert(err, jc.ErrorIsNil) + c.Assert(len(offers), gc.Equals, 0) +} + +func (s *offeredApplicationsSuite) createOffedService(c *gc.C, name string) crossmodel.OfferedApplication { + eps := map[string]string{name + "-interface": "ep1", name + "-interface2": "ep2"} + offers := state.NewOfferedApplications(s.State) + offer := crossmodel.OfferedApplication{ + ApplicationURL: "local:/u/me/" + name, + CharmName: name + "charm", + ApplicationName: name, + Endpoints: eps, + } + err := offers.AddOffer(offer) + // offers are always created as registered. + offer.Registered = true + c.Assert(err, jc.ErrorIsNil) + return offer +} + +func (s *offeredApplicationsSuite) TestListOffersAll(c *gc.C) { + offeredApplications := state.NewOfferedApplications(s.State) + offer := s.createDefaultOffer(c) + offers, err := offeredApplications.ListOffers() + c.Assert(err, jc.ErrorIsNil) + c.Assert(len(offers), gc.Equals, 1) + c.Assert(offers[0], jc.DeepEquals, offer) +} + +func (s *offeredApplicationsSuite) TestListOffersServiceNameFilter(c *gc.C) { + offeredApplications := state.NewOfferedApplications(s.State) + offer := s.createOffedService(c, "offer1") + s.createOffedService(c, "offer2") + s.createOffedService(c, "offer3") + offers, err := offeredApplications.ListOffers(crossmodel.OfferedApplicationFilter{ + ApplicationURL: "local:/u/me/offer1", + ApplicationName: "offer1", + }) + c.Assert(err, jc.ErrorIsNil) + c.Assert(len(offers), gc.Equals, 1) + c.Assert(offers[0], jc.DeepEquals, offer) +} + +func (s *offeredApplicationsSuite) TestListOffersCharmNameFilter(c *gc.C) { + offeredApplications := state.NewOfferedApplications(s.State) + offer := s.createOffedService(c, "offer1") + s.createOffedService(c, "offer2") + s.createOffedService(c, "offer3") + offers, err := offeredApplications.ListOffers(crossmodel.OfferedApplicationFilter{ + ApplicationURL: "local:/u/me/offer1", + CharmName: "offer1charm", + }) + c.Assert(err, jc.ErrorIsNil) + c.Assert(len(offers), gc.Equals, 1) + c.Assert(offers[0], jc.DeepEquals, offer) +} + +func (s *offeredApplicationsSuite) TestListOffersManyFilters(c *gc.C) { + offeredApplications := state.NewOfferedApplications(s.State) + offer := s.createOffedService(c, "offer1") + offer2 := s.createOffedService(c, "offer2") + s.createOffedService(c, "offer3") + offers, err := offeredApplications.ListOffers( + crossmodel.OfferedApplicationFilter{ + ApplicationURL: "local:/u/me/offer1", + ApplicationName: "offer1", + }, + crossmodel.OfferedApplicationFilter{ + ApplicationURL: "local:/u/me/offer2", + }, + ) + c.Assert(err, jc.ErrorIsNil) + c.Assert(len(offers), gc.Equals, 2) + c.Assert(offers, jc.DeepEquals, []crossmodel.OfferedApplication{offer, offer2}) +} + +func (s *offeredApplicationsSuite) TestListOffersFilterApplicationURLRegexp(c *gc.C) { + offeredApplications := state.NewOfferedApplications(s.State) + s.createOffedService(c, "offer1") + offer := s.createOffedService(c, "offer2") + s.createOffedService(c, "offer3") + offers, err := offeredApplications.ListOffers(crossmodel.OfferedApplicationFilter{ + ApplicationURL: "me/offer2", + }) + c.Assert(err, jc.ErrorIsNil) + c.Assert(len(offers), gc.Equals, 1) + c.Assert(offers[0], jc.DeepEquals, offer) +} + +func (s *offeredApplicationsSuite) TestSetOfferRegistered(c *gc.C) { + offeredApplications := state.NewOfferedApplications(s.State) + offer := s.createOffedService(c, "offer1") + offer2 := s.createOffedService(c, "offer2") + s.createOffedService(c, "offer3") + err := offeredApplications.SetOfferRegistered("local:/u/me/offer3", false) + c.Assert(err, jc.ErrorIsNil) + offers, err := offeredApplications.ListOffers(crossmodel.RegisteredFilter(true)) + c.Assert(err, jc.ErrorIsNil) + c.Assert(len(offers), gc.Equals, 2) + c.Assert(offers, jc.DeepEquals, []crossmodel.OfferedApplication{offer, offer2}) +} + +func (s *offeredApplicationsSuite) TestUpdateApplicationOfferNotFound(c *gc.C) { + offered := state.NewOfferedApplications(s.State) + err := offered.UpdateOffer("local:/u/me/service", map[string]string{"foo": "bar"}) + c.Assert(err, gc.ErrorMatches, `.* application offer at "local:/u/me/service" not found`) +} + +func (s *offeredApplicationsSuite) TestUpdateApplicationOfferNoEndpoints(c *gc.C) { + offered := state.NewOfferedApplications(s.State) + err := offered.UpdateOffer("local:/u/me/service", nil) + c.Assert(err, gc.ErrorMatches, ".* no endpoints specified") +} + +func (s *offeredApplicationsSuite) TestAddApplicationOfferDuplicate(c *gc.C) { + offered := state.NewOfferedApplications(s.State) + err := offered.AddOffer(crossmodel.OfferedApplication{ + ApplicationURL: "local:/u/me/service", + ApplicationName: "mysql", + }) + c.Assert(err, jc.ErrorIsNil) + err = offered.AddOffer(crossmodel.OfferedApplication{ + ApplicationURL: "local:/u/me/service", + ApplicationName: "mysql", + }) + c.Assert(err, gc.ErrorMatches, `cannot add application offer "mysql" at "local:/u/me/service": application offer already exists`) +} + +func (s *offeredApplicationsSuite) TestAddApplicationOfferDuplicateAddedAfterInitial(c *gc.C) { + // Check that a record with a URL conflict cannot be added if + // there is no conflict initially but a record is added + // before the transaction is run. + offers := state.NewOfferedApplications(s.State) + defer state.SetBeforeHooks(c, s.State, func() { + err := offers.AddOffer(crossmodel.OfferedApplication{ + ApplicationURL: "local:/u/me/service", + ApplicationName: "mysql", + }) + c.Assert(err, jc.ErrorIsNil) + }).Check() + err := offers.AddOffer(crossmodel.OfferedApplication{ + ApplicationURL: "local:/u/me/service", + ApplicationName: "mysql", + }) + c.Assert(err, gc.ErrorMatches, `cannot add application offer "mysql" at "local:/u/me/service": application offer already exists`) +} + +func (s *offeredApplicationsSuite) TestRegisterOfferDeleteAfterInitial(c *gc.C) { + offeredApplications := state.NewOfferedApplications(s.State) + offer := s.createOffedService(c, "offer1") + defer state.SetBeforeHooks(c, s.State, func() { + err := offeredApplications.RemoveOffer(offer.ApplicationURL) + c.Assert(err, jc.ErrorIsNil) + }).Check() + err := offeredApplications.SetOfferRegistered(offer.ApplicationURL, false) + c.Assert(err, gc.ErrorMatches, `.* application offer at "local:/u/me/offer1" not found`) +} + +func (s *offeredApplicationsSuite) TestUpdateOfferDeleteAfterInitial(c *gc.C) { + offeredApplications := state.NewOfferedApplications(s.State) + offer := s.createOffedService(c, "offer1") + defer state.SetBeforeHooks(c, s.State, func() { + err := offeredApplications.RemoveOffer(offer.ApplicationURL) + c.Assert(err, jc.ErrorIsNil) + }).Check() + err := offeredApplications.UpdateOffer(offer.ApplicationURL, map[string]string{"foo": "bar"}) + c.Assert(err, gc.ErrorMatches, `.* application offer at "local:/u/me/offer1" not found`) +} diff -Nru juju-core-2.0.0/src/github.com/juju/juju/state/persistence.go juju-core-2.0.2/src/github.com/juju/juju/state/persistence.go --- juju-core-2.0.0/src/github.com/juju/juju/state/persistence.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/state/persistence.go 2016-11-11 00:08:09.000000000 +0000 @@ -87,10 +87,10 @@ // NewStorage returns a new blob storage for the environment. func (sp *statePersistence) NewStorage() storage.Storage { - envUUID := sp.st.ModelUUID() + modelUUID := sp.st.ModelUUID() // TODO(ericsnow) Copy the session? session := sp.st.session - store := storage.NewStorage(envUUID, session) + store := storage.NewStorage(modelUUID, session) return store } diff -Nru juju-core-2.0.0/src/github.com/juju/juju/state/relation.go juju-core-2.0.2/src/github.com/juju/juju/state/relation.go --- juju-core-2.0.0/src/github.com/juju/juju/state/relation.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/state/relation.go 2016-11-11 00:08:09.000000000 +0000 @@ -6,7 +6,6 @@ import ( "fmt" "sort" - "strconv" "strings" "github.com/juju/errors" @@ -144,7 +143,7 @@ return nil, false, errAlreadyDying } if r.doc.UnitCount == 0 { - removeOps, err := r.removeOps(ignoreService, nil) + removeOps, err := r.removeOps(ignoreService, "") if err != nil { return nil, false, err } @@ -160,16 +159,16 @@ // removeOps returns the operations necessary to remove the relation. If // ignoreService is not empty, no operations affecting that service will be -// included; if departingUnit is not nil, this implies that the relation's -// services may be Dying and otherwise unreferenced, and may thus require -// removal themselves. -func (r *Relation) removeOps(ignoreService string, departingUnit *Unit) ([]txn.Op, error) { +// included; if departingUnitName is non-empty, this implies that the +// relation's services may be Dying and otherwise unreferenced, and may thus +// require removal themselves. +func (r *Relation) removeOps(ignoreService string, departingUnitName string) ([]txn.Op, error) { relOp := txn.Op{ C: relationsC, Id: r.doc.DocID, Remove: true, } - if departingUnit != nil { + if departingUnitName != "" { relOp.Assert = bson.D{{"life", Dying}, {"unitcount", 1}} } else { relOp.Assert = bson.D{{"life", Alive}, {"unitcount", 0}} @@ -179,55 +178,110 @@ if ep.ApplicationName == ignoreService { continue } - var asserts bson.D - hasRelation := bson.D{{"relationcount", bson.D{{"$gt", 0}}}} - if departingUnit == nil { - // We're constructing a destroy operation, either of the relation - // or one of its services, and can therefore be assured that both - // services are Alive. - asserts = append(hasRelation, isAliveDoc...) - } else if ep.ApplicationName == departingUnit.ApplicationName() { - // This service must have at least one unit -- the one that's - // departing the relation -- so it cannot be ready for removal. - cannotDieYet := bson.D{{"unitcount", bson.D{{"$gt", 0}}}} - asserts = append(hasRelation, cannotDieYet...) + app, err := applicationByName(r.st, ep.ApplicationName) + if err != nil { + return nil, errors.Trace(err) + } + if app.IsRemote() { + epOps, err := r.removeRemoteEndpointOps(ep, departingUnitName != "") + if err != nil { + return nil, errors.Trace(err) + } + ops = append(ops, epOps...) } else { - // This service may require immediate removal. - applications, closer := r.st.getCollection(applicationsC) - defer closer() - - svc := &Application{st: r.st} - hasLastRef := bson.D{{"life", Dying}, {"unitcount", 0}, {"relationcount", 1}} - removable := append(bson.D{{"_id", ep.ApplicationName}}, hasLastRef...) - if err := applications.Find(removable).One(&svc.doc); err == nil { - appRemoveOps, err := svc.removeOps(hasLastRef) - if err != nil { - return nil, errors.Trace(err) - } - ops = append(ops, appRemoveOps...) - continue - } else if err != mgo.ErrNotFound { - return nil, err + epOps, err := r.removeLocalEndpointOps(ep, departingUnitName) + if err != nil { + return nil, errors.Trace(err) } - // If not, we must check that this is still the case when the - // transaction is applied. - asserts = bson.D{{"$or", []bson.D{ - {{"life", Alive}}, - {{"unitcount", bson.D{{"$gt", 0}}}}, - {{"relationcount", bson.D{{"$gt", 1}}}}, - }}} - } - ops = append(ops, txn.Op{ - C: applicationsC, - Id: r.st.docID(ep.ApplicationName), - Assert: asserts, - Update: bson.D{{"$inc", bson.D{{"relationcount", -1}}}}, - }) + ops = append(ops, epOps...) + } } cleanupOp := newCleanupOp(cleanupRelationSettings, fmt.Sprintf("r#%d#", r.Id())) return append(ops, cleanupOp), nil } +func (r *Relation) removeLocalEndpointOps(ep Endpoint, departingUnitName string) ([]txn.Op, error) { + var asserts bson.D + hasRelation := bson.D{{"relationcount", bson.D{{"$gt", 0}}}} + departingUnitServiceMatchesEndpoint := func() bool { + s, err := names.UnitApplication(departingUnitName) + return err == nil && s == ep.ApplicationName + } + if departingUnitName == "" { + // We're constructing a destroy operation, either of the relation + // or one of its services, and can therefore be assured that both + // services are Alive. + asserts = append(hasRelation, isAliveDoc...) + } else if departingUnitServiceMatchesEndpoint() { + // This service must have at least one unit -- the one that's + // departing the relation -- so it cannot be ready for removal. + cannotDieYet := bson.D{{"unitcount", bson.D{{"$gt", 0}}}} + asserts = append(hasRelation, cannotDieYet...) + } else { + // This service may require immediate removal. + applications, closer := r.st.getCollection(applicationsC) + defer closer() + + svc := &Application{st: r.st} + hasLastRef := bson.D{{"life", Dying}, {"unitcount", 0}, {"relationcount", 1}} + removable := append(bson.D{{"_id", ep.ApplicationName}}, hasLastRef...) + if err := applications.Find(removable).One(&svc.doc); err == nil { + return svc.removeOps(hasLastRef) + } else if err != mgo.ErrNotFound { + return nil, err + } + // If not, we must check that this is still the case when the + // transaction is applied. + asserts = bson.D{{"$or", []bson.D{ + {{"life", Alive}}, + {{"unitcount", bson.D{{"$gt", 0}}}}, + {{"relationcount", bson.D{{"$gt", 1}}}}, + }}} + } + return []txn.Op{{ + C: applicationsC, + Id: r.st.docID(ep.ApplicationName), + Assert: asserts, + Update: bson.D{{"$inc", bson.D{{"relationcount", -1}}}}, + }}, nil +} + +func (r *Relation) removeRemoteEndpointOps(ep Endpoint, unitDying bool) ([]txn.Op, error) { + var asserts bson.D + hasRelation := bson.D{{"relationcount", bson.D{{"$gt", 0}}}} + if !unitDying { + // We're constructing a destroy operation, either of the relation + // or one of its services, and can therefore be assured that both + // services are Alive. + asserts = append(hasRelation, isAliveDoc...) + } else { + // The remote application may require immediate removal. + services, closer := r.st.getCollection(remoteApplicationsC) + defer closer() + + svc := &RemoteApplication{st: r.st} + hasLastRef := bson.D{{"life", Dying}, {"relationcount", 1}} + removable := append(bson.D{{"_id", ep.ApplicationName}}, hasLastRef...) + if err := services.Find(removable).One(&svc.doc); err == nil { + return svc.removeOps(hasLastRef), nil + } else if err != mgo.ErrNotFound { + return nil, err + } + // If not, we must check that this is still the case when the + // transaction is applied. + asserts = bson.D{{"$or", []bson.D{ + {{"life", Alive}}, + {{"relationcount", bson.D{{"$gt", 1}}}}, + }}} + } + return []txn.Op{{ + C: remoteApplicationsC, + Id: r.st.docID(ep.ApplicationName), + Assert: asserts, + Update: bson.D{{"$inc", bson.D{{"relationcount", -1}}}}, + }}, nil +} + // Id returns the integer internal relation key. This is exposed // because the unit agent needs to expose a value derived from this // (as JUJU_RELATION_ID) to allow relation hooks to differentiate @@ -275,27 +329,68 @@ // Unit returns a RelationUnit for the supplied unit. func (r *Relation) Unit(u *Unit) (*RelationUnit, error) { - ep, err := r.Endpoint(u.doc.Application) + const checkUnitLife = true + return r.unit(u.Name(), u.doc.Principal, u.IsPrincipal(), checkUnitLife) +} + +// RemoteUnit returns a RelationUnit for the supplied unit +// of a remote application. +func (r *Relation) RemoteUnit(unitName string) (*RelationUnit, error) { + // Verify that the unit belongs to a remote application. + serviceName, err := names.UnitApplication(unitName) + if err != nil { + return nil, errors.Trace(err) + } + if _, err := r.st.RemoteApplication(serviceName); err != nil { + return nil, errors.Trace(err) + } + // Only non-subordinate services may be offered for remote + // relation, so all remote units are principals. + const principal = "" + const isPrincipal = true + const checkUnitLife = false + return r.unit(unitName, principal, isPrincipal, checkUnitLife) +} + +func (r *Relation) unit( + unitName string, + principal string, + isPrincipal bool, + checkUnitLife bool, +) (*RelationUnit, error) { + serviceName, err := names.UnitApplication(unitName) if err != nil { return nil, err } - scope := []string{"r", strconv.Itoa(r.doc.Id)} + ep, err := r.Endpoint(serviceName) + if err != nil { + return nil, err + } + scope := r.globalScope() if ep.Scope == charm.ScopeContainer { - container := u.doc.Principal + container := principal if container == "" { - container = u.doc.Name + container = unitName } - scope = append(scope, container) + scope = fmt.Sprintf("%s#%s", scope, container) } return &RelationUnit{ - st: r.st, - relation: r, - unit: u, - endpoint: ep, - scope: strings.Join(scope, "#"), + st: r.st, + relation: r, + unitName: unitName, + isPrincipal: isPrincipal, + checkUnitLife: checkUnitLife, + endpoint: ep, + scope: scope, }, nil } +// globalScope returns the scope prefix for relation scope document keys +// in the global scope. +func (r *Relation) globalScope() string { + return fmt.Sprintf("r#%d", r.doc.Id) +} + // relationSettingsCleanupChange removes the settings doc. type relationSettingsCleanupChange struct { Prefix string diff -Nru juju-core-2.0.0/src/github.com/juju/juju/state/relationunit.go juju-core-2.0.2/src/github.com/juju/juju/state/relationunit.go --- juju-core-2.0.0/src/github.com/juju/juju/state/relationunit.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/state/relationunit.go 2016-11-11 00:08:09.000000000 +0000 @@ -15,18 +15,18 @@ "gopkg.in/mgo.v2" "gopkg.in/mgo.v2/bson" "gopkg.in/mgo.v2/txn" - - "github.com/juju/juju/network" ) // RelationUnit holds information about a single unit in a relation, and // allows clients to conveniently access unit-specific functionality. type RelationUnit struct { - st *State - relation *Relation - unit *Unit - endpoint Endpoint - scope string + st *State + relation *Relation + unitName string + isPrincipal bool + checkUnitLife bool + endpoint Endpoint + scope string } // Relation returns the relation associated with the unit. @@ -40,11 +40,6 @@ return ru.endpoint } -// PrivateAddress returns the private address of the unit. -func (ru *RelationUnit) PrivateAddress() (network.Address, error) { - return ru.unit.PrivateAddress() -} - // ErrCannotEnterScope indicates that a relation unit failed to enter its scope // due to either the unit or the relation not being Alive. var ErrCannotEnterScope = stderrors.New("cannot enter scope: unit or relation is not alive") @@ -90,17 +85,21 @@ // * TODO(fwereade): check unit status == params.StatusActive (this // breaks a bunch of tests in a boring but noisy-to-fix way, and is // being saved for a followup). - unitDocID, relationDocID := ru.unit.doc.DocID, ru.relation.doc.DocID - ops := []txn.Op{{ - C: unitsC, - Id: unitDocID, - Assert: isAliveDoc, - }, { + relationDocID := ru.relation.doc.DocID + var ops []txn.Op + if ru.checkUnitLife { + ops = append(ops, txn.Op{ + C: unitsC, + Id: ru.unitName, + Assert: isAliveDoc, + }) + } + ops = append(ops, txn.Op{ C: relationsC, Id: relationDocID, Assert: isAliveDoc, Update: bson.D{{"$inc", bson.D{{"unitcount", 1}}}}, - }} + }) // * Create the unit settings in this relation, if they do not already // exist; or completely overwrite them if they do. This must happen @@ -152,34 +151,35 @@ return nil } - units, closer := db.GetCollection(unitsC) - defer closer() - relations, closer := db.GetCollection(relationsC) - defer closer() - // The relation or unit might no longer be Alive. (Note that there is no // need for additional checks if we're trying to create a subordinate // unit: this could fail due to the subordinate service's not being Alive, // but this case will always be caught by the check for the relation's // life (because a relation cannot be Alive if its services are not).) - if alive, err := isAliveWithSession(units, unitDocID); err != nil { - return err - } else if !alive { - return ErrCannotEnterScope - } + relations, closer := db.GetCollection(relationsC) + defer closer() if alive, err := isAliveWithSession(relations, relationDocID); err != nil { return err } else if !alive { return ErrCannotEnterScope } - - // Maybe a subordinate used to exist, but is no longer alive. If that is - // case, we will be unable to enter scope until that unit is gone. - if existingSubName != "" { - if alive, err := isAliveWithSession(units, existingSubName); err != nil { + if ru.checkUnitLife { + units, closer := db.GetCollection(unitsC) + defer closer() + if alive, err := isAliveWithSession(units, ru.unitName); err != nil { return err } else if !alive { - return ErrCannotEnterScopeYet + return ErrCannotEnterScope + } + + // Maybe a subordinate used to exist, but is no longer alive. If that is + // case, we will be unable to enter scope until that unit is gone. + if existingSubName != "" { + if alive, err := isAliveWithSession(units, existingSubName); err != nil { + return err + } else if !alive { + return ErrCannotEnterScopeYet + } } } @@ -187,7 +187,7 @@ // has changed under our feet, preventing us from clearing it properly; if // that is the case, something is seriously wrong (nobody else should be // touching that doc under our feet) and we should bail out. - prefix := fmt.Sprintf("cannot enter scope for unit %q in relation %q: ", ru.unit, ru.relation) + prefix := fmt.Sprintf("cannot enter scope for unit %q in relation %q: ", ru.unitName, ru.relation) if changed, err := settingsChanged(); err != nil { return err } else if changed { @@ -207,7 +207,7 @@ units, closer := ru.st.getCollection(unitsC) defer closer() - if !ru.unit.IsPrincipal() || ru.endpoint.Scope != charm.ScopeContainer { + if !ru.isPrincipal || ru.endpoint.Scope != charm.ScopeContainer { return nil, "", nil } related, err := ru.relation.RelatedEndpoints(ru.endpoint.ApplicationName) @@ -217,7 +217,7 @@ if len(related) != 1 { return nil, "", fmt.Errorf("expected single related endpoint, got %v", related) } - applicationname, unitName := related[0].ApplicationName, ru.unit.doc.Name + applicationname, unitName := related[0].ApplicationName, ru.unitName selSubordinate := bson.D{{"application", applicationname}, {"principal", unitName}} var lDoc lifeDoc if err := units.Find(selSubordinate).One(&lDoc); err == mgo.ErrNotFound { @@ -292,7 +292,7 @@ // to have a Dying relation with a smaller-than-real unit count, because // Destroy changes the Life attribute in memory (units could join before // the database is actually changed). - desc := fmt.Sprintf("unit %q in relation %q", ru.unit, ru.relation) + desc := fmt.Sprintf("unit %q in relation %q", ru.unitName, ru.relation) buildTxn := func(attempt int) ([]txn.Op, error) { if attempt > 0 { if err := ru.relation.Refresh(); errors.IsNotFound(err) { @@ -328,7 +328,7 @@ Update: bson.D{{"$inc", bson.D{{"unitcount", -1}}}}, }) } else { - relOps, err := ru.relation.removeOps("", ru.unit) + relOps, err := ru.relation.removeOps("", ru.unitName) if err != nil { return nil, err } @@ -371,8 +371,14 @@ // entering and leaving the unit's scope. func (ru *RelationUnit) WatchScope() *RelationScopeWatcher { role := counterpartRole(ru.endpoint.Role) - scope := ru.scope + "#" + string(role) - return newRelationScopeWatcher(ru.st, scope, ru.unit.Name()) + return watchRelationScope(ru.st, ru.scope, role, ru.unitName) +} + +func watchRelationScope( + st *State, scope string, role charm.RelationRole, ignore string, +) *RelationScopeWatcher { + scope = scope + "#" + string(role) + return newRelationScopeWatcher(st, scope, ignore) } // Settings returns a Settings which allows access to the unit's settings @@ -421,7 +427,7 @@ // which is used as a key for that unit within this relation in the settings, // presence, and relationScopes collections. func (ru *RelationUnit) key() string { - return ru._key(string(ru.endpoint.Role), ru.unit.Name()) + return ru._key(string(ru.endpoint.Role), ru.unitName) } func (ru *RelationUnit) _key(role, unitname string) string { diff -Nru juju-core-2.0.0/src/github.com/juju/juju/state/relationunit_test.go juju-core-2.0.2/src/github.com/juju/juju/state/relationunit_test.go --- juju-core-2.0.0/src/github.com/juju/juju/state/relationunit_test.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/state/relationunit_test.go 2016-11-11 00:08:09.000000000 +0000 @@ -149,9 +149,51 @@ assertJoined(c, pr.ru1) } +func (s *RelationUnitSuite) TestRemoteUnitErrors(c *gc.C) { + _, err := s.State.AddRemoteApplication("mysql", "local:/u/me/mysql", []charm.Relation{{ + Interface: "mysql", + Name: "server", + Role: charm.RoleProvider, + Scope: charm.ScopeGlobal, + }}) + c.Assert(err, jc.ErrorIsNil) + + _, err = s.State.AddRemoteApplication("mysql1", "local:/u/me/mysql", []charm.Relation{{ + Interface: "mysql", + Name: "server", + Role: charm.RoleProvider, + Scope: charm.ScopeGlobal, + }}) + c.Assert(err, jc.ErrorIsNil) + s.AddTestingService(c, "wordpress", s.AddTestingCharm(c, "wordpress")) + + eps, err := s.State.InferEndpoints("mysql", "wordpress") + c.Assert(err, jc.ErrorIsNil) + rel, err := s.State.AddRelation(eps...) + c.Assert(err, jc.ErrorIsNil) + + _, err = rel.RemoteUnit("mysql") + c.Assert(err, gc.ErrorMatches, `"mysql" is not a valid unit name`) + + _, err = rel.RemoteUnit("wordpress/0") + c.Assert(err, gc.ErrorMatches, `remote application "wordpress" not found`) + + _, err = rel.RemoteUnit("mysql1/0") + c.Assert(err, gc.ErrorMatches, `application "mysql1" is not a member of "wordpress:db mysql:server"`) +} + func (s *RelationUnitSuite) TestProReqSettings(c *gc.C) { prr := NewProReqRelation(c, &s.ConnSuite, charm.ScopeGlobal) - rus := RUs{prr.pru0, prr.pru1, prr.rru0, prr.rru1} + s.testProReqSettings(c, prr.pru0, prr.pru1, prr.rru0, prr.rru1) +} + +func (s *RelationUnitSuite) TestRemoteProReqSettings(c *gc.C) { + prr := NewRemoteProReqRelation(c, &s.ConnSuite) + s.testProReqSettings(c, prr.pru0, prr.pru1, prr.rru0, prr.rru1) +} + +func (s *RelationUnitSuite) testProReqSettings(c *gc.C, pru0, pru1, rru0, rru1 *state.RelationUnit) { + rus := RUs{pru0, pru1, rru0, rru1} // Check missing settings cannot be read by any RU. for _, ru := range rus { @@ -160,15 +202,15 @@ } // Add settings for one RU. - assertNotInScope(c, prr.pru0) - err := prr.pru0.EnterScope(map[string]interface{}{"gene": "simmons"}) + assertNotInScope(c, pru0) + err := pru0.EnterScope(map[string]interface{}{"gene": "simmons"}) c.Assert(err, jc.ErrorIsNil) - node, err := prr.pru0.Settings() + node, err := pru0.Settings() c.Assert(err, jc.ErrorIsNil) node.Set("meme", "foul-bachelor-frog") _, err = node.Write() c.Assert(err, jc.ErrorIsNil) - assertJoined(c, prr.pru0) + assertJoined(c, pru0) // Check settings can be read by every RU. for _, ru := range rus { @@ -481,9 +523,20 @@ func (s *RelationUnitSuite) TestProReqWatchScope(c *gc.C) { prr := NewProReqRelation(c, &s.ConnSuite, charm.ScopeGlobal) + s.testProReqWatchScope(c, prr.pru0, prr.pru1, prr.rru0, prr.rru1, prr.watches) +} +func (s *RelationUnitSuite) TestRemoteProReqWatchScope(c *gc.C) { + prr := NewRemoteProReqRelation(c, &s.ConnSuite) + s.testProReqWatchScope(c, prr.pru0, prr.pru1, prr.rru0, prr.rru1, prr.watches) +} + +func (s *RelationUnitSuite) testProReqWatchScope( + c *gc.C, pru0, pru1, rru0, rru1 *state.RelationUnit, + watches func() []*state.RelationScopeWatcher, +) { // Test empty initial events for all RUs. - ws := prr.watches() + ws := watches() for _, w := range ws { defer testing.AssertStop(c, w) } @@ -493,8 +546,8 @@ s.assertNoScopeChange(c, ws...) // pru0 enters; check detected only by req RUs. - assertNotInScope(c, prr.pru0) - err := prr.pru0.EnterScope(nil) + assertNotInScope(c, pru0) + err := pru0.EnterScope(nil) c.Assert(err, jc.ErrorIsNil) rws := func() []*state.RelationScopeWatcher { return []*state.RelationScopeWatcher{ws[2], ws[3]} @@ -503,11 +556,11 @@ s.assertScopeChange(c, w, []string{"mysql/0"}, nil) } s.assertNoScopeChange(c, ws...) - assertJoined(c, prr.pru0) + assertJoined(c, pru0) // req0 enters; check detected only by pro RUs. - assertNotInScope(c, prr.rru0) - err = prr.rru0.EnterScope(nil) + assertNotInScope(c, rru0) + err = rru0.EnterScope(nil) c.Assert(err, jc.ErrorIsNil) pws := func() []*state.RelationScopeWatcher { return []*state.RelationScopeWatcher{ws[0], ws[1]} @@ -516,23 +569,23 @@ s.assertScopeChange(c, w, []string{"wordpress/0"}, nil) } s.assertNoScopeChange(c, ws...) - assertJoined(c, prr.rru0) + assertJoined(c, rru0) // Stop watches; remaining RUs enter. for _, w := range ws { testing.AssertStop(c, w) } - assertNotInScope(c, prr.pru1) - err = prr.pru1.EnterScope(nil) + assertNotInScope(c, pru1) + err = pru1.EnterScope(nil) c.Assert(err, jc.ErrorIsNil) - assertJoined(c, prr.pru1) - assertNotInScope(c, prr.rru1) - err = prr.rru1.EnterScope(nil) + assertJoined(c, pru1) + assertNotInScope(c, rru1) + err = rru1.EnterScope(nil) c.Assert(err, jc.ErrorIsNil) - assertJoined(c, prr.rru0) + assertJoined(c, rru0) // Start new watches, check initial events. - ws = prr.watches() + ws = watches() for _, w := range ws { defer testing.AssertStop(c, w) } @@ -545,24 +598,24 @@ s.assertNoScopeChange(c, ws...) // pru0 leaves; check detected only by req RUs. - assertJoined(c, prr.pru0) - err = prr.pru0.LeaveScope() + assertJoined(c, pru0) + err = pru0.LeaveScope() c.Assert(err, jc.ErrorIsNil) for _, w := range rws() { s.assertScopeChange(c, w, nil, []string{"mysql/0"}) } s.assertNoScopeChange(c, ws...) - assertNotInScope(c, prr.pru0) + assertNotInScope(c, pru0) // rru0 leaves; check detected only by pro RUs. - assertJoined(c, prr.rru0) - err = prr.rru0.LeaveScope() + assertJoined(c, rru0) + err = rru0.LeaveScope() c.Assert(err, jc.ErrorIsNil) for _, w := range pws() { s.assertScopeChange(c, w, nil, []string{"wordpress/0"}) } s.assertNoScopeChange(c, ws...) - assertNotInScope(c, prr.rru0) + assertNotInScope(c, rru0) } func (s *RelationUnitSuite) TestContainerWatchScope(c *gc.C) { @@ -671,48 +724,56 @@ func (s *RelationUnitSuite) TestPrepareLeaveScope(c *gc.C) { prr := NewProReqRelation(c, &s.ConnSuite, charm.ScopeGlobal) + s.testPrepareLeaveScope(c, prr.rel, prr.pru0, prr.pru1, prr.rru0, prr.rru1) +} + +func (s *RelationUnitSuite) TestPrepareLeaveScopeRemote(c *gc.C) { + prr := NewRemoteProReqRelation(c, &s.ConnSuite) + s.testPrepareLeaveScope(c, prr.rel, prr.pru0, prr.pru1, prr.rru0, prr.rru1) +} +func (s *RelationUnitSuite) testPrepareLeaveScope(c *gc.C, rel *state.Relation, pru0, pru1, rru0, rru1 *state.RelationUnit) { // Test empty initial event. - w0 := prr.pru0.WatchScope() + w0 := pru0.WatchScope() defer testing.AssertStop(c, w0) s.assertScopeChange(c, w0, nil, nil) s.assertNoScopeChange(c, w0) // rru0 and rru1 enter; check changes. - err := prr.rru0.EnterScope(nil) + err := rru0.EnterScope(nil) c.Assert(err, jc.ErrorIsNil) - err = prr.rru1.EnterScope(nil) + err = rru1.EnterScope(nil) c.Assert(err, jc.ErrorIsNil) s.assertScopeChange(c, w0, []string{"wordpress/0", "wordpress/1"}, nil) s.assertNoScopeChange(c, w0) // rru0 notifies that it will leave soon; it's reported as departed by the // watcher, but InScope remains accurate. - err = prr.rru0.PrepareLeaveScope() + err = rru0.PrepareLeaveScope() c.Assert(err, jc.ErrorIsNil) s.assertScopeChange(c, w0, nil, []string{"wordpress/0"}) s.assertNoScopeChange(c, w0) - assertInScope(c, prr.rru0) - assertNotJoined(c, prr.rru0) + assertInScope(c, rru0) + assertNotJoined(c, rru0) // rru1 leaves, and the relation is destroyed; it's not removed, because // rru0 keeps it alive until it really leaves scope. - err = prr.rru1.LeaveScope() + err = rru1.LeaveScope() c.Assert(err, jc.ErrorIsNil) s.assertScopeChange(c, w0, nil, []string{"wordpress/1"}) s.assertNoScopeChange(c, w0) - err = prr.rel.Destroy() + err = rel.Destroy() c.Assert(err, jc.ErrorIsNil) - err = prr.rel.Refresh() + err = rel.Refresh() c.Assert(err, jc.ErrorIsNil) // rru0 really leaves; the relation is cleaned up. - err = prr.rru0.LeaveScope() + err = rru0.LeaveScope() c.Assert(err, jc.ErrorIsNil) - err = prr.rel.Destroy() + err = rel.Destroy() c.Assert(err, jc.ErrorIsNil) s.assertNoScopeChange(c, w0) - err = prr.rel.Refresh() + err = rel.Refresh() c.Assert(err, jc.Satisfies, errors.IsNotFound) } @@ -845,6 +906,50 @@ return u, ru } +type RemoteProReqRelation struct { + rel *state.Relation + psvc *state.RemoteApplication + rsvc *state.Application + pru0, pru1, rru0, rru1 *state.RelationUnit +} + +func NewRemoteProReqRelation(c *gc.C, s *ConnSuite) *RemoteProReqRelation { + psvc, err := s.State.AddRemoteApplication("mysql", "local:/u/me/mysql", []charm.Relation{{ + Interface: "mysql", + Name: "server", + Role: charm.RoleProvider, + Scope: charm.ScopeGlobal, + }}) + c.Assert(err, jc.ErrorIsNil) + rsvc := s.AddTestingService(c, "wordpress", s.AddTestingCharm(c, "wordpress")) + + eps, err := s.State.InferEndpoints("mysql", "wordpress") + c.Assert(err, jc.ErrorIsNil) + rel, err := s.State.AddRelation(eps...) + c.Assert(err, jc.ErrorIsNil) + + prr := &RemoteProReqRelation{rel: rel, psvc: psvc, rsvc: rsvc} + prr.pru0 = addRemoteRU(c, rel, "mysql/0") + prr.pru1 = addRemoteRU(c, rel, "mysql/1") + _, prr.rru0 = addRU(c, rsvc, rel, nil) + _, prr.rru1 = addRU(c, rsvc, rel, nil) + return prr +} + +func (prr *RemoteProReqRelation) watches() []*state.RelationScopeWatcher { + return []*state.RelationScopeWatcher{ + prr.pru0.WatchScope(), prr.pru1.WatchScope(), + prr.rru0.WatchScope(), prr.rru1.WatchScope(), + } +} + +func addRemoteRU(c *gc.C, rel *state.Relation, unitName string) *state.RelationUnit { + // Add a remote unit with the given name to rel. + ru, err := rel.RemoteUnit(unitName) + c.Assert(err, jc.ErrorIsNil) + return ru +} + type WatchScopeSuite struct { ConnSuite } @@ -1256,6 +1361,81 @@ // connections are in place. } +type WatchCounterpartEndpointUnitsSuite struct { + ConnSuite +} + +var _ = gc.Suite(&WatchCounterpartEndpointUnitsSuite{}) + +func (s *WatchCounterpartEndpointUnitsSuite) TestProviderRequirerGlobal(c *gc.C) { + // Create a pair of services and a relation between them. + mysql := s.AddTestingService(c, "mysql", s.AddTestingCharm(c, "mysql")) + mysqlEP, err := mysql.Endpoint("server") + c.Assert(err, jc.ErrorIsNil) + wordpress := s.AddTestingService(c, "wordpress", s.AddTestingCharm(c, "wordpress")) + wordpressEP, err := wordpress.Endpoint("db") + c.Assert(err, jc.ErrorIsNil) + rel, err := s.State.AddRelation(mysqlEP, wordpressEP) + c.Assert(err, jc.ErrorIsNil) + + // Add some units to the services and set their private addresses. + addUnit := func(srv *state.Application) *state.RelationUnit { + unit, err := srv.AddUnit() + c.Assert(err, jc.ErrorIsNil) + ru, err := rel.Unit(unit) + c.Assert(err, jc.ErrorIsNil) + return ru + } + mysql0 := addUnit(mysql) + wordpress0 := addUnit(wordpress) + + wordpressWatcher, err := rel.WatchCounterpartEndpointUnits("mysql") + c.Assert(err, jc.ErrorIsNil) + defer testing.AssertStop(c, wordpressWatcher) + wordpressWatcherC := testing.NewRelationUnitsWatcherC(c, s.State, wordpressWatcher) + wordpressWatcherC.AssertChange(nil, nil) + wordpressWatcherC.AssertNoChange() + + // Join the mysql unit to the relation, change settings, and check + // that only the mysql relation units watcher triggers. + err = mysql0.EnterScope(nil) + c.Assert(err, jc.ErrorIsNil) + changeSettings(c, mysql0) + + mysqlWatcher, err := rel.WatchCounterpartEndpointUnits("wordpress") + c.Assert(err, jc.ErrorIsNil) + defer testing.AssertStop(c, mysqlWatcher) + mysqlWatcherC := testing.NewRelationUnitsWatcherC(c, s.State, mysqlWatcher) + mysqlWatcherC.AssertChange([]string{"mysql/0"}, nil) + mysqlWatcherC.AssertNoChange() + wordpressWatcherC.AssertNoChange() + + // Now join the wordpress unit to the relation, and check that only + // the wordpress relation units watcher triggers. + err = wordpress0.EnterScope(nil) + c.Assert(err, jc.ErrorIsNil) + wordpressWatcherC.AssertChange([]string{"wordpress/0"}, nil) + wordpressWatcherC.AssertNoChange() + mysqlWatcherC.AssertNoChange() +} + +func (s *WatchCounterpartEndpointUnitsSuite) TestProviderRequirerContainer(c *gc.C) { + // Create a pair of services and a relation between them. + mysql := s.AddTestingService(c, "mysql", s.AddTestingCharm(c, "mysql")) + mysqlEP, err := mysql.Endpoint("juju-info") + c.Assert(err, jc.ErrorIsNil) + logging := s.AddTestingService(c, "logging", s.AddTestingCharm(c, "logging")) + loggingEP, err := logging.Endpoint("info") + c.Assert(err, jc.ErrorIsNil) + rel, err := s.State.AddRelation(mysqlEP, loggingEP) + c.Assert(err, jc.ErrorIsNil) + + _, err = rel.WatchCounterpartEndpointUnits("mysql") + c.Assert(err, gc.ErrorMatches, `"juju-info" endpoint is not globally scoped`) + _, err = rel.WatchCounterpartEndpointUnits("logging") + c.Assert(err, gc.ErrorMatches, `"info" endpoint is not globally scoped`) +} + func changeSettings(c *gc.C, ru *state.RelationUnit) { node, err := ru.Settings() c.Assert(err, jc.ErrorIsNil) diff -Nru juju-core-2.0.0/src/github.com/juju/juju/state/remoteapplication.go juju-core-2.0.2/src/github.com/juju/juju/state/remoteapplication.go --- juju-core-2.0.0/src/github.com/juju/juju/state/remoteapplication.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/state/remoteapplication.go 2016-11-11 00:08:09.000000000 +0000 @@ -0,0 +1,412 @@ +// Copyright 2015 Canonical Ltd. +// Licensed under the AGPLv3, see LICENCE file for details. + +package state + +import ( + "fmt" + "sort" + "time" + + "github.com/juju/errors" + jujutxn "github.com/juju/txn" + "gopkg.in/juju/charm.v6-unstable" + "gopkg.in/juju/names.v2" + "gopkg.in/mgo.v2" + "gopkg.in/mgo.v2/bson" + "gopkg.in/mgo.v2/txn" + + "github.com/juju/juju/core/crossmodel" + "github.com/juju/juju/status" +) + +// RemoteApplication represents the state of an application hosted +// in an external (remote) model. +type RemoteApplication struct { + st *State + doc remoteApplicationDoc +} + +// remoteApplicationDoc represents the internal state of a remote application in MongoDB. +type remoteApplicationDoc struct { + DocID string `bson:"_id"` + Name string `bson:"name"` + URL string `bson:"url"` + Endpoints []remoteEndpointDoc `bson:"endpoints"` + Life Life `bson:"life"` + RelationCount int `bson:"relationcount"` +} + +// remoteEndpointDoc represents the internal state of a remote application endpoint in MongoDB. +type remoteEndpointDoc struct { + Name string `bson:"name"` + Role charm.RelationRole `bson:"role"` + Interface string `bson:"interface"` + Limit int `bson:"limit"` + Scope charm.RelationScope `bson:"scope"` +} + +func newRemoteApplication(st *State, doc *remoteApplicationDoc) *RemoteApplication { + app := &RemoteApplication{ + st: st, + doc: *doc, + } + return app +} + +// remoteApplicationGlobalKey returns the global database key for the +// remote application with the given name. +func remoteApplicationGlobalKey(appName string) string { + return "c#" + appName +} + +// globalKey returns the global database key for the remote application. +func (s *RemoteApplication) globalKey() string { + return remoteApplicationGlobalKey(s.doc.Name) +} + +// IsRemote returns true for a remote application. +func (s *RemoteApplication) IsRemote() bool { + return true +} + +// Name returns the application name. +func (s *RemoteApplication) Name() string { + return s.doc.Name +} + +// URL returns the remote application URL. +func (s *RemoteApplication) URL() string { + return s.doc.URL +} + +// Tag returns a name identifying the application. +func (s *RemoteApplication) Tag() names.Tag { + return names.NewApplicationTag(s.Name()) +} + +// Life returns whether the application is Alive, Dying or Dead. +func (s *RemoteApplication) Life() Life { + return s.doc.Life +} + +// Destroy ensures that this remote application reference and all its relations +// will be removed at some point; if no relation involving the +// application has any units in scope, they are all removed immediately. +func (s *RemoteApplication) Destroy() (err error) { + defer errors.DeferredAnnotatef(&err, "cannot destroy remote application %q", s) + defer func() { + if err == nil { + s.doc.Life = Dying + } + }() + app := &RemoteApplication{st: s.st, doc: s.doc} + buildTxn := func(attempt int) ([]txn.Op, error) { + if attempt > 0 { + if err := app.Refresh(); errors.IsNotFound(err) { + return nil, jujutxn.ErrNoOperations + } else if err != nil { + return nil, err + } + } + switch ops, err := app.destroyOps(); err { + case errRefresh: + case errAlreadyDying: + return nil, jujutxn.ErrNoOperations + case nil: + return ops, nil + default: + return nil, err + } + return nil, jujutxn.ErrTransientFailure + } + return s.st.run(buildTxn) +} + +// destroyOps returns the operations required to destroy the application. If it +// returns errRefresh, the application should be refreshed and the destruction +// operations recalculated. +func (s *RemoteApplication) destroyOps() ([]txn.Op, error) { + if s.doc.Life == Dying { + return nil, errAlreadyDying + } + rels, err := s.Relations() + if err != nil { + return nil, err + } + if len(rels) != s.doc.RelationCount { + // This is just an early bail out. The relations obtained may still + // be wrong, but that situation will be caught by a combination of + // asserts on relationcount and on each known relation, below. + return nil, errRefresh + } + var ops []txn.Op + removeCount := 0 + for _, rel := range rels { + relOps, isRemove, err := rel.destroyOps(s.doc.Name) + if err == errAlreadyDying { + relOps = []txn.Op{{ + C: relationsC, + Id: rel.doc.DocID, + Assert: bson.D{{"life", Dying}}, + }} + } else if err != nil { + return nil, err + } + if isRemove { + removeCount++ + } + ops = append(ops, relOps...) + } + // If all of the application's known relations will be + // removed, the application can also be removed. + if s.doc.RelationCount == removeCount { + hasLastRefs := bson.D{{"life", Alive}, {"relationcount", removeCount}} + return append(ops, s.removeOps(hasLastRefs)...), nil + } + // In all other cases, application removal will be handled as a consequence + // of the removal of the relation referencing it. If any relations have + // been removed, they'll be caught by the operations collected above; + // but if any has been added, we need to abort and add a destroy op for + // that relation too. + // In combination, it's enough to check for count equality: + // an add/remove will not touch the count, but will be caught by + // virtue of being a remove. + notLastRefs := bson.D{ + {"life", Alive}, + {"relationcount", s.doc.RelationCount}, + } + update := bson.D{{"$set", bson.D{{"life", Dying}}}} + if removeCount != 0 { + decref := bson.D{{"$inc", bson.D{{"relationcount", -removeCount}}}} + update = append(update, decref...) + } + return append(ops, txn.Op{ + C: remoteApplicationsC, + Id: s.doc.DocID, + Assert: notLastRefs, + Update: update, + }), nil +} + +// removeOps returns the operations required to remove the application. Supplied +// asserts will be included in the operation on the application document. +func (s *RemoteApplication) removeOps(asserts bson.D) []txn.Op { + ops := []txn.Op{ + { + C: remoteApplicationsC, + Id: s.doc.DocID, + Assert: asserts, + Remove: true, + }, + removeStatusOp(s.st, s.globalKey()), + } + return ops +} + +// Status returns the status of the remote application. +func (s *RemoteApplication) Status() (status.StatusInfo, error) { + return getStatus(s.st, s.globalKey(), "remote application") +} + +// SetStatus sets the status for the application. +func (s *RemoteApplication) SetStatus(info status.StatusInfo) error { + if !info.Status.KnownWorkloadStatus() { + return errors.Errorf("cannot set invalid status %q", info.Status) + } + return setStatus(s.st, setStatusParams{ + badge: "remote application", + globalKey: s.globalKey(), + status: info.Status, + message: info.Message, + rawData: info.Data, + updated: info.Since, + }) +} + +// Endpoints returns the application's currently available relation endpoints. +func (s *RemoteApplication) Endpoints() ([]Endpoint, error) { + return remoteEndpointDocsToEndpoints(s.Name(), s.doc.Endpoints), nil +} + +func remoteEndpointDocsToEndpoints(applicationName string, docs []remoteEndpointDoc) []Endpoint { + eps := make([]Endpoint, len(docs)) + for i, ep := range docs { + eps[i] = Endpoint{ + ApplicationName: applicationName, + Relation: charm.Relation{ + Name: ep.Name, + Role: ep.Role, + Interface: ep.Interface, + Limit: ep.Limit, + Scope: ep.Scope, + }} + } + sort.Sort(epSlice(eps)) + return eps +} + +// Endpoint returns the relation endpoint with the supplied name, if it exists. +func (s *RemoteApplication) Endpoint(relationName string) (Endpoint, error) { + eps, err := s.Endpoints() + if err != nil { + return Endpoint{}, err + } + for _, ep := range eps { + if ep.Name == relationName { + return ep, nil + } + } + return Endpoint{}, fmt.Errorf("remote application %q has no %q relation", s, relationName) +} + +// String returns the application name. +func (s *RemoteApplication) String() string { + return s.doc.Name +} + +// Refresh refreshes the contents of the RemoteApplication from the underlying +// state. It returns an error that satisfies errors.IsNotFound if the +// application has been removed. +func (s *RemoteApplication) Refresh() error { + applications, closer := s.st.getCollection(remoteApplicationsC) + defer closer() + + err := applications.FindId(s.doc.DocID).One(&s.doc) + if err == mgo.ErrNotFound { + return errors.NotFoundf("remote application %q", s) + } + if err != nil { + return fmt.Errorf("cannot refresh application %q: %v", s, err) + } + return nil +} + +// Relations returns a Relation for every relation the application is in. +func (s *RemoteApplication) Relations() (relations []*Relation, err error) { + return applicationRelations(s.st, s.doc.Name) +} + +// AddRemoteApplication creates a new remote application record, having the supplied relation endpoints, +// with the supplied name (which must be unique across all applications, local and remote). +func (st *State) AddRemoteApplication(name, url string, endpoints []charm.Relation) (_ *RemoteApplication, err error) { + defer errors.DeferredAnnotatef(&err, "cannot add remote application %q", name) + + // Sanity checks. + if !names.IsValidApplication(name) { + return nil, errors.Errorf("invalid name") + } + if _, err := crossmodel.ParseApplicationURL(url); err != nil { + return nil, errors.Annotate(err, "validating application URL") + } + model, err := st.Model() + if err != nil { + return nil, errors.Trace(err) + } else if model.Life() != Alive { + return nil, errors.Errorf("model is no longer alive") + } + + applicationID := st.docID(name) + // Create the application addition operations. + appDoc := &remoteApplicationDoc{ + DocID: applicationID, + Name: name, + URL: url, + Life: Alive, + } + eps := make([]remoteEndpointDoc, len(endpoints)) + for i, ep := range endpoints { + eps[i] = remoteEndpointDoc{ + Name: ep.Name, + Role: ep.Role, + Interface: ep.Interface, + Limit: ep.Limit, + Scope: ep.Scope, + } + } + appDoc.Endpoints = eps + app := newRemoteApplication(st, appDoc) + + statusDoc := statusDoc{ + ModelUUID: st.ModelUUID(), + Status: status.Unknown, + StatusInfo: "waiting for remote connection", + Updated: time.Now().UnixNano(), + } + + buildTxn := func(attempt int) ([]txn.Op, error) { + // If we've tried once already and failed, check that + // model may have been destroyed. + if attempt > 0 { + if err := checkModelActive(st); err != nil { + return nil, errors.Trace(err) + } + // Ensure a local application with the same name doesn't exist. + if localExists, err := isNotDead(st, applicationsC, name); err != nil { + return nil, errors.Trace(err) + } else if localExists { + return nil, errors.AlreadyExistsf("local application with same name") + } + // Ensure a remote application with the same name doesn't exist. + if exists, err := isNotDead(st, remoteApplicationsC, name); err != nil { + return nil, errors.Trace(err) + } else if exists { + return nil, errors.AlreadyExistsf("remote application") + } + } + ops := []txn.Op{ + model.assertActiveOp(), + createStatusOp(st, app.globalKey(), statusDoc), + { + C: remoteApplicationsC, + Id: appDoc.Name, + Assert: txn.DocMissing, + Insert: appDoc, + }, { + C: applicationsC, + Id: appDoc.Name, + Assert: txn.DocMissing, + }, + } + return ops, nil + } + if err = st.run(buildTxn); err != nil { + return nil, errors.Trace(err) + } + return app, nil +} + +// RemoteApplication returns a remote application state by name. +func (st *State) RemoteApplication(name string) (_ *RemoteApplication, err error) { + applications, closer := st.getCollection(remoteApplicationsC) + defer closer() + + if !names.IsValidApplication(name) { + return nil, errors.NotValidf("remote application name %q", name) + } + sdoc := &remoteApplicationDoc{} + err = applications.FindId(name).One(sdoc) + if err == mgo.ErrNotFound { + return nil, errors.NotFoundf("remote application %q", name) + } + if err != nil { + return nil, errors.Annotatef(err, "cannot get remote application %q", name) + } + return newRemoteApplication(st, sdoc), nil +} + +// AllRemoteApplications returns all the remote applications used by the model. +func (st *State) AllRemoteApplications() (applications []*RemoteApplication, err error) { + applicationsCollection, closer := st.getCollection(remoteApplicationsC) + defer closer() + + appdocs := []remoteApplicationDoc{} + err = applicationsCollection.Find(bson.D{}).All(&appdocs) + if err != nil { + return nil, errors.Errorf("cannot get all remote applications") + } + for _, v := range appdocs { + applications = append(applications, newRemoteApplication(st, &v)) + } + return applications, nil +} diff -Nru juju-core-2.0.0/src/github.com/juju/juju/state/remoteapplication_test.go juju-core-2.0.2/src/github.com/juju/juju/state/remoteapplication_test.go --- juju-core-2.0.0/src/github.com/juju/juju/state/remoteapplication_test.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/state/remoteapplication_test.go 2016-11-11 00:08:09.000000000 +0000 @@ -0,0 +1,545 @@ +// Copyright 2015 Canonical Ltd. +// Licensed under the AGPLv3, see LICENCE file for details. + +package state_test + +import ( + "sort" + "time" + + "github.com/juju/errors" + jc "github.com/juju/testing/checkers" + gc "gopkg.in/check.v1" + "gopkg.in/juju/charm.v6-unstable" + + "github.com/juju/juju/state" + "github.com/juju/juju/state/testing" + "github.com/juju/juju/status" +) + +type remoteApplicationSuite struct { + ConnSuite + application *state.RemoteApplication +} + +var _ = gc.Suite(&remoteApplicationSuite{}) + +func (s *remoteApplicationSuite) SetUpTest(c *gc.C) { + s.ConnSuite.SetUpTest(c) + eps := []charm.Relation{ + { + Interface: "mysql", + Name: "db", + Role: charm.RoleProvider, + Scope: charm.ScopeGlobal, + }, + { + Interface: "mysql-root", + Name: "db-admin", + Role: charm.RoleProvider, + Scope: charm.ScopeGlobal, + }, + { + Interface: "logging", + Name: "logging", + Role: charm.RoleProvider, + Scope: charm.ScopeGlobal, + }, + } + var err error + s.application, err = s.State.AddRemoteApplication("mysql", "local:/u/me/mysql", eps) + c.Assert(err, jc.ErrorIsNil) +} + +func (s *remoteApplicationSuite) assertApplicationRelations(c *gc.C, svc *state.Application, expectedKeys ...string) []*state.Relation { + rels, err := svc.Relations() + c.Assert(err, jc.ErrorIsNil) + if len(rels) == 0 { + return nil + } + relKeys := make([]string, len(expectedKeys)) + for i, rel := range rels { + relKeys[i] = rel.String() + } + sort.Strings(relKeys) + c.Assert(relKeys, gc.DeepEquals, expectedKeys) + return rels +} + +func (s *remoteApplicationSuite) TestInitialStatus(c *gc.C) { + appStatus, err := s.application.Status() + c.Assert(err, jc.ErrorIsNil) + c.Assert(appStatus.Since, gc.NotNil) + appStatus.Since = nil + c.Assert(appStatus, gc.DeepEquals, status.StatusInfo{ + Status: status.Unknown, + Message: "waiting for remote connection", + Data: map[string]interface{}{}, + }) +} + +func (s *remoteApplicationSuite) TestStatus(c *gc.C) { + now := time.Now() + sInfo := status.StatusInfo{ + Status: status.Maintenance, + Message: "busy", + Data: map[string]interface{}{"foo": "bar"}, + Since: &now, + } + err := s.application.SetStatus(sInfo) + c.Assert(err, jc.ErrorIsNil) + app, err := s.State.RemoteApplication("mysql") + c.Assert(err, jc.ErrorIsNil) + appStatus, err := app.Status() + c.Assert(appStatus.Since, gc.NotNil) + appStatus.Since = nil + c.Assert(appStatus, gc.DeepEquals, status.StatusInfo{ + Status: status.Maintenance, + Message: "busy", + Data: map[string]interface{}{"foo": "bar"}, + }) +} + +func (s *remoteApplicationSuite) TestSetStatusSince(c *gc.C) { + now := time.Now() + sInfo := status.StatusInfo{ + Status: status.Maintenance, + Message: "", + Since: &now, + } + err := s.application.SetStatus(sInfo) + c.Assert(err, jc.ErrorIsNil) + appStatus, err := s.application.Status() + c.Assert(err, jc.ErrorIsNil) + firstTime := appStatus.Since + c.Assert(firstTime, gc.NotNil) + c.Assert(timeBeforeOrEqual(now, *firstTime), jc.IsTrue) + + // Setting the same status a second time also updates the timestamp. + err = s.application.SetStatus(sInfo) + c.Assert(err, jc.ErrorIsNil) + appStatus, err = s.application.Status() + c.Assert(err, jc.ErrorIsNil) + c.Assert(timeBeforeOrEqual(*firstTime, *appStatus.Since), jc.IsTrue) +} + +func (s *remoteApplicationSuite) TestGetSetStatusNotFound(c *gc.C) { + err := s.application.Destroy() + c.Assert(err, jc.ErrorIsNil) + + now := time.Now() + sInfo := status.StatusInfo{ + Status: status.Active, + Message: "not really", + Since: &now, + } + err = s.application.SetStatus(sInfo) + c.Check(err, gc.ErrorMatches, `cannot set status: remote application not found`) + + statusInfo, err := s.application.Status() + c.Check(err, gc.ErrorMatches, `cannot get status: remote application not found`) + c.Check(statusInfo, gc.DeepEquals, status.StatusInfo{}) +} + +func (s *remoteApplicationSuite) TestTag(c *gc.C) { + c.Assert(s.application.Tag().String(), gc.Equals, "application-mysql") +} + +func (s *remoteApplicationSuite) TestURL(c *gc.C) { + c.Assert(s.application.URL(), gc.Equals, "local:/u/me/mysql") +} + +func (s *remoteApplicationSuite) TestMysqlEndpoints(c *gc.C) { + _, err := s.application.Endpoint("foo") + c.Assert(err, gc.ErrorMatches, `remote application "mysql" has no "foo" relation`) + + serverEP, err := s.application.Endpoint("db") + c.Assert(err, jc.ErrorIsNil) + c.Assert(serverEP, gc.DeepEquals, state.Endpoint{ + ApplicationName: "mysql", + Relation: charm.Relation{ + Interface: "mysql", + Name: "db", + Role: charm.RoleProvider, + Scope: charm.ScopeGlobal, + }, + }) + + adminEp := state.Endpoint{ + ApplicationName: "mysql", + Relation: charm.Relation{ + Interface: "mysql-root", + Name: "db-admin", + Role: charm.RoleProvider, + Scope: charm.ScopeGlobal, + }, + } + loggingEp := state.Endpoint{ + ApplicationName: "mysql", + Relation: charm.Relation{ + Interface: "logging", + Name: "logging", + Role: charm.RoleProvider, + Scope: charm.ScopeGlobal, + }, + } + eps, err := s.application.Endpoints() + c.Assert(err, jc.ErrorIsNil) + c.Assert(eps, gc.DeepEquals, []state.Endpoint{serverEP, adminEp, loggingEp}) +} + +func (s *remoteApplicationSuite) TestApplicationRefresh(c *gc.C) { + s1, err := s.State.RemoteApplication(s.application.Name()) + c.Assert(err, jc.ErrorIsNil) + + err = s1.Destroy() + c.Assert(err, jc.ErrorIsNil) + err = s.application.Refresh() + c.Assert(err, jc.Satisfies, errors.IsNotFound) +} + +func (s *remoteApplicationSuite) TestAddRelationBothRemote(c *gc.C) { + wpep := []charm.Relation{ + { + Interface: "mysql", + Name: "db", + Role: charm.RoleRequirer, + Scope: charm.ScopeGlobal, + }, + } + _, err := s.State.AddRemoteApplication("wordpress", "local:/u/me/wordpress", wpep) + c.Assert(err, jc.ErrorIsNil) + eps, err := s.State.InferEndpoints("wordpress", "mysql") + c.Assert(err, jc.ErrorIsNil) + _, err = s.State.AddRelation(eps[0], eps[1]) + c.Assert(err, gc.ErrorMatches, `cannot add relation "wordpress:db mysql:db": cannot add relation between remote applications "wordpress" and "mysql"`) +} + +func (s *remoteApplicationSuite) TestInferEndpointsWrongScope(c *gc.C) { + subCharm := s.AddTestingCharm(c, "logging") + s.AddTestingService(c, "logging", subCharm) + _, err := s.State.InferEndpoints("logging", "mysql") + c.Assert(err, gc.ErrorMatches, "no relations found") +} + +func (s *remoteApplicationSuite) TestAddRemoteApplicationErrors(c *gc.C) { + _, err := s.State.AddRemoteApplication("haha/borken", "local:/u/me/mysql", nil) + c.Assert(err, gc.ErrorMatches, `cannot add remote application "haha/borken": invalid name`) + _, err = s.State.RemoteApplication("haha/borken") + c.Assert(err, gc.ErrorMatches, `remote application name "haha/borken" not valid`) + + _, err = s.State.AddRemoteApplication("borken", "haha/borken", nil) + c.Assert(err, gc.ErrorMatches, + `cannot add remote application "borken": validating application URL: `+ + `application URL has invalid form, missing "/u/": "haha/borken"`, + ) + _, err = s.State.RemoteApplication("borken") + c.Assert(err, gc.ErrorMatches, `remote application "borken" not found`) +} + +func (s *remoteApplicationSuite) TestAddRemoteApplication(c *gc.C) { + foo, err := s.State.AddRemoteApplication("foo", "local:/u/me/foo", nil) + c.Assert(err, jc.ErrorIsNil) + c.Assert(foo.Name(), gc.Equals, "foo") + foo, err = s.State.RemoteApplication("foo") + c.Assert(err, jc.ErrorIsNil) + c.Assert(foo.Name(), gc.Equals, "foo") +} + +func (s *remoteApplicationSuite) TestAddRemoteRelationWrongScope(c *gc.C) { + subCharm := s.AddTestingCharm(c, "logging") + s.AddTestingService(c, "logging", subCharm) + ep1 := state.Endpoint{ + ApplicationName: "mysql", + Relation: charm.Relation{ + Interface: "logging", + Name: "logging", + Role: charm.RoleProvider, + Scope: charm.ScopeGlobal, + }, + } + ep2 := state.Endpoint{ + ApplicationName: "logging", + Relation: charm.Relation{ + Interface: "logging", + Name: "logging-client", + Role: charm.RoleRequirer, + Scope: charm.ScopeContainer, + }, + } + _, err := s.State.AddRelation(ep1, ep2) + c.Assert(err, gc.ErrorMatches, `cannot add relation "logging:logging-client mysql:logging": both endpoints must be globally scoped for remote relations`) +} + +func (s *remoteApplicationSuite) TestAddRemoteRelationLocalFirst(c *gc.C) { + s.assertAddRemoteRelation(c, "wordpress", "mysql") +} + +func (s *remoteApplicationSuite) TestAddRemoteRelationRemoteFirst(c *gc.C) { + s.assertAddRemoteRelation(c, "mysql", "wordpress") +} + +func (s *remoteApplicationSuite) assertAddRemoteRelation(c *gc.C, application1, application2 string) { + endpoints := map[string]state.Endpoint{ + "wordpress": state.Endpoint{ + ApplicationName: "wordpress", + Relation: charm.Relation{ + Interface: "mysql", + Name: "db", + Role: charm.RoleRequirer, + Scope: charm.ScopeGlobal, + Limit: 1, + }, + }, + "mysql": state.Endpoint{ + ApplicationName: "mysql", + Relation: charm.Relation{ + Interface: "mysql", + Name: "db", + Role: charm.RoleProvider, + Scope: charm.ScopeGlobal, + }, + }, + } + s.AddTestingService(c, "wordpress", s.AddTestingCharm(c, "wordpress")) + eps, err := s.State.InferEndpoints(application1, application2) + c.Assert(err, jc.ErrorIsNil) + rel, err := s.State.AddRelation(eps[0], eps[1]) + c.Assert(err, jc.ErrorIsNil) + c.Assert(rel.String(), gc.Equals, "wordpress:db mysql:db") + c.Assert(rel.Endpoints(), jc.DeepEquals, []state.Endpoint{endpoints[application1], endpoints[application2]}) + remoteSvc, err := s.State.RemoteApplication("mysql") + c.Assert(err, jc.ErrorIsNil) + relations, err := remoteSvc.Relations() + c.Assert(err, jc.ErrorIsNil) + c.Assert(relations, gc.HasLen, 1) + c.Assert(relations[0], jc.DeepEquals, rel) +} + +func (s *remoteApplicationSuite) TestDestroySimple(c *gc.C) { + err := s.application.Destroy() + c.Assert(err, jc.ErrorIsNil) + c.Assert(s.application.Life(), gc.Equals, state.Dying) + err = s.application.Refresh() + c.Assert(err, jc.Satisfies, errors.IsNotFound) +} + +func (s *remoteApplicationSuite) TestDestroyWithRemovableRelation(c *gc.C) { + wordpress := s.AddTestingService(c, "wordpress", s.AddTestingCharm(c, "wordpress")) + eps, err := s.State.InferEndpoints("wordpress", "mysql") + c.Assert(err, jc.ErrorIsNil) + rel, err := s.State.AddRelation(eps[0], eps[1]) + c.Assert(err, jc.ErrorIsNil) + + // Destroy a local application with no units in relation scope; check application and + // unit removed. + err = wordpress.Destroy() + c.Assert(err, jc.ErrorIsNil) + err = wordpress.Refresh() + c.Assert(err, jc.Satisfies, errors.IsNotFound) + err = rel.Refresh() + c.Assert(err, jc.Satisfies, errors.IsNotFound) +} + +func (s *remoteApplicationSuite) TestDestroyWithReferencedRelation(c *gc.C) { + s.assertDestroyWithReferencedRelation(c, true) +} + +func (s *remoteApplicationSuite) TestDestroyWithReferencedRelationStaleCount(c *gc.C) { + s.assertDestroyWithReferencedRelation(c, false) +} + +func (s *remoteApplicationSuite) assertDestroyWithReferencedRelation(c *gc.C, refresh bool) { + ch := s.AddTestingCharm(c, "wordpress") + wordpress := s.AddTestingService(c, "wordpress", ch) + eps, err := s.State.InferEndpoints("wordpress", "mysql") + c.Assert(err, jc.ErrorIsNil) + rel0, err := s.State.AddRelation(eps[0], eps[1]) + c.Assert(err, jc.ErrorIsNil) + + s.AddTestingService(c, "another", ch) + eps, err = s.State.InferEndpoints("another", "mysql") + c.Assert(err, jc.ErrorIsNil) + rel1, err := s.State.AddRelation(eps[0], eps[1]) + c.Assert(err, jc.ErrorIsNil) + + // Add a separate reference to the first relation. + unit, err := wordpress.AddUnit() + c.Assert(err, jc.ErrorIsNil) + ru, err := rel0.Unit(unit) + c.Assert(err, jc.ErrorIsNil) + err = ru.EnterScope(nil) + c.Assert(err, jc.ErrorIsNil) + + // Optionally update the application document to get correct relation counts. + if refresh { + err = s.application.Destroy() + c.Assert(err, jc.ErrorIsNil) + } + + // Destroy, and check that the first relation becomes Dying... + err = s.application.Destroy() + c.Assert(err, jc.ErrorIsNil) + err = rel0.Refresh() + c.Assert(err, jc.ErrorIsNil) + c.Assert(rel0.Life(), gc.Equals, state.Dying) + + // ...while the second is removed directly. + err = rel1.Refresh() + c.Assert(err, jc.Satisfies, errors.IsNotFound) + + // Drop the last reference to the first relation; check the relation and + // the application are are both removed. + err = ru.LeaveScope() + c.Assert(err, jc.ErrorIsNil) + err = s.application.Refresh() + c.Assert(err, jc.Satisfies, errors.IsNotFound) + err = rel0.Refresh() + c.Assert(err, jc.Satisfies, errors.IsNotFound) +} + +func (s *remoteApplicationSuite) TestAllRemoteApplicationsNone(c *gc.C) { + err := s.application.Destroy() + c.Assert(err, jc.ErrorIsNil) + applications, err := s.State.AllRemoteApplications() + c.Assert(err, jc.ErrorIsNil) + c.Assert(len(applications), gc.Equals, 0) +} + +func (s *remoteApplicationSuite) TestAllRemoteApplications(c *gc.C) { + // There's initially the application created in test setup. + applications, err := s.State.AllRemoteApplications() + c.Assert(err, jc.ErrorIsNil) + c.Assert(len(applications), gc.Equals, 1) + + _, err = s.State.AddRemoteApplication("another", "local:/u/me/another", nil) + c.Assert(err, jc.ErrorIsNil) + applications, err = s.State.AllRemoteApplications() + c.Assert(err, jc.ErrorIsNil) + c.Assert(applications, gc.HasLen, 2) + + // Check the returned application, order is defined by sorted keys. + names := make([]string, len(applications)) + for i, svc := range applications { + names[i] = svc.Name() + } + sort.Strings(names) + c.Assert(names[0], gc.Equals, "another") + c.Assert(names[1], gc.Equals, "mysql") +} + +func (s *remoteApplicationSuite) TestAddApplicationEnvironmentDying(c *gc.C) { + // Check that applications cannot be added if the environment is initially Dying. + model, err := s.State.Model() + c.Assert(err, jc.ErrorIsNil) + err = model.Destroy() + c.Assert(err, jc.ErrorIsNil) + _, err = s.State.AddRemoteApplication("s1", "local:/u/me/s1", nil) + c.Assert(err, gc.ErrorMatches, `cannot add remote application "s1": model is no longer alive`) +} + +func (s *remoteApplicationSuite) TestAddApplicationSameLocalExists(c *gc.C) { + charm := s.AddTestingCharm(c, "dummy") + _, err := s.State.AddApplication(state.AddApplicationArgs{Name: "s1", Charm: charm}) + c.Assert(err, jc.ErrorIsNil) + _, err = s.State.AddRemoteApplication("s1", "local:/u/me/s1", nil) + c.Assert(err, gc.ErrorMatches, `cannot add remote application "s1": local application with same name already exists`) +} + +func (s *remoteApplicationSuite) TestAddApplicationLocalAddedAfterInitial(c *gc.C) { + charm := s.AddTestingCharm(c, "dummy") + // Check that a application with a name conflict cannot be added if + // there is no conflict initially but a local application is added + // before the transaction is run. + defer state.SetBeforeHooks(c, s.State, func() { + _, err := s.State.AddApplication(state.AddApplicationArgs{Name: "s1", Charm: charm}) + c.Assert(err, jc.ErrorIsNil) + }).Check() + _, err := s.State.AddRemoteApplication("s1", "local:/u/me/s1", nil) + c.Assert(err, gc.ErrorMatches, `cannot add remote application "s1": local application with same name already exists`) +} + +func (s *remoteApplicationSuite) TestAddApplicationSameRemoteExists(c *gc.C) { + _, err := s.State.AddRemoteApplication("s1", "local:/u/me/s1", nil) + c.Assert(err, jc.ErrorIsNil) + _, err = s.State.AddRemoteApplication("s1", "local:/u/me/s1", nil) + c.Assert(err, gc.ErrorMatches, `cannot add remote application "s1": remote application already exists`) +} + +func (s *remoteApplicationSuite) TestAddApplicationRemoteAddedAfterInitial(c *gc.C) { + // Check that a application with a name conflict cannot be added if + // there is no conflict initially but a remote application is added + // before the transaction is run. + defer state.SetBeforeHooks(c, s.State, func() { + _, err := s.State.AddRemoteApplication("s1", "local:/u/me/s1", nil) + c.Assert(err, jc.ErrorIsNil) + }).Check() + _, err := s.State.AddRemoteApplication("s1", "local:/u/me/s1", nil) + c.Assert(err, gc.ErrorMatches, `cannot add remote application "s1": remote application already exists`) +} + +func (s *remoteApplicationSuite) TestAddApplicationEnvironDiesAfterInitial(c *gc.C) { + // Check that a application with a name conflict cannot be added if + // there is no conflict initially but a remote application is added + // before the transaction is run. + defer state.SetBeforeHooks(c, s.State, func() { + model, err := s.State.Model() + c.Assert(err, jc.ErrorIsNil) + err = model.Destroy() + c.Assert(err, jc.ErrorIsNil) + }).Check() + _, err := s.State.AddRemoteApplication("s1", "local:/u/me/s1", nil) + c.Assert(err, gc.ErrorMatches, `cannot add remote application "s1": model "testenv" is no longer alive`) +} + +func (s *remoteApplicationSuite) TestWatchRemoteApplications(c *gc.C) { + w := s.State.WatchRemoteApplications() + defer testing.AssertStop(c, w) + wc := testing.NewStringsWatcherC(c, s.State, w) + wc.AssertChangeInSingleEvent("mysql") // initial + wc.AssertNoChange() + + db2, err := s.State.AddRemoteApplication("db2", "local:/u/ibm/db2", nil) + c.Assert(err, jc.ErrorIsNil) + wc.AssertChangeInSingleEvent("db2") + wc.AssertNoChange() + + err = db2.Destroy() + c.Assert(err, jc.ErrorIsNil) + err = db2.Refresh() + c.Assert(err, jc.Satisfies, errors.IsNotFound) + wc.AssertChangeInSingleEvent("db2") + wc.AssertNoChange() +} + +func (s *remoteApplicationSuite) TestWatchRemoteApplicationsDying(c *gc.C) { + w := s.State.WatchRemoteApplications() + defer testing.AssertStop(c, w) + wc := testing.NewStringsWatcherC(c, s.State, w) + wc.AssertChangeInSingleEvent("mysql") // initial + wc.AssertNoChange() + + ch := s.AddTestingCharm(c, "wordpress") + wordpress := s.AddTestingService(c, "wordpress", ch) + eps, err := s.State.InferEndpoints("wordpress", "mysql") + c.Assert(err, jc.ErrorIsNil) + rel, err := s.State.AddRelation(eps[0], eps[1]) + c.Assert(err, jc.ErrorIsNil) + + // Add a unit to the relation so the remote application is not + // short-circuit removed. + unit, err := wordpress.AddUnit() + c.Assert(err, jc.ErrorIsNil) + ru, err := rel.Unit(unit) + c.Assert(err, jc.ErrorIsNil) + err = ru.EnterScope(nil) + c.Assert(err, jc.ErrorIsNil) + + err = s.application.Destroy() + c.Assert(err, jc.ErrorIsNil) + err = s.application.Refresh() + c.Assert(err, jc.ErrorIsNil) + + wc.AssertChangeInSingleEvent("mysql") + wc.AssertNoChange() +} diff -Nru juju-core-2.0.0/src/github.com/juju/juju/state/state.go juju-core-2.0.2/src/github.com/juju/juju/state/state.go --- juju-core-2.0.0/src/github.com/juju/juju/state/state.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/state/state.go 2016-11-11 00:08:09.000000000 +0000 @@ -20,6 +20,7 @@ jujutxn "github.com/juju/txn" "github.com/juju/utils" "github.com/juju/utils/clock" + "github.com/juju/utils/featureflag" "github.com/juju/utils/os" "github.com/juju/utils/series" "github.com/juju/utils/set" @@ -35,6 +36,7 @@ "github.com/juju/juju/audit" "github.com/juju/juju/constraints" "github.com/juju/juju/core/lease" + "github.com/juju/juju/feature" "github.com/juju/juju/instance" "github.com/juju/juju/mongo" "github.com/juju/juju/network" @@ -829,7 +831,7 @@ // FindEntity returns the entity with the given tag. // // The returned value can be of type *Machine, *Unit, -// *User, *Service, *Model, or *Action, depending +// *User, *Application, *Model, or *Action, depending // on the tag. func (st *State) FindEntity(tag names.Tag) (Entity, error) { id := tag.Id() @@ -928,7 +930,7 @@ } // addPeerRelationsOps returns the operations necessary to add the -// specified service peer relations to the state. +// specified application peer relations to the state. func (st *State) addPeerRelationsOps(applicationname string, peers map[string]charm.Relation) ([]txn.Op, error) { var ops []txn.Op for _, rel := range peers { @@ -959,6 +961,11 @@ return ops, nil } +var ( + errSameNameRemoteApplicationExists = errors.Errorf("remote application with same name already exists") + errLocalApplicationExists = errors.Errorf("application already exists") +) + type AddApplicationArgs struct { Name string Series string @@ -1093,12 +1100,12 @@ applicationID := st.docID(args.Name) - // Create the service addition operations. + // Create the application addition operations. peers := args.Charm.Meta().Peers // The doc defaults to CharmModifiedVersion = 0, which is correct, since it // has, by definition, at its initial state. - svcDoc := &applicationDoc{ + appDoc := &applicationDoc{ DocID: applicationID, Name: args.Name, ModelUUID: st.ModelUUID(), @@ -1110,10 +1117,10 @@ Life: Alive, } - svc := newApplication(st, svcDoc) + app := newApplication(st, appDoc) endpointBindingsOp, err := createEndpointBindingsOp( - st, svc.globalKey(), + st, app.globalKey(), args.EndpointBindings, args.Charm.Meta(), ) if err != nil { @@ -1127,92 +1134,101 @@ Updated: st.clock.Now().UnixNano(), // This exists to preserve questionable unit-aggregation behaviour // while we work out how to switch to an implementation that makes - // sense. It is also set in AddMissingServiceStatuses. + // sense. NeverSet: true, } - // The addServiceOps does not include the environment alive assertion, - // so we add it here. - ops := []txn.Op{ - assertModelActiveOp(st.ModelUUID()), - endpointBindingsOp, - } - addOps, err := addApplicationOps(st, addApplicationOpsArgs{ - applicationDoc: svcDoc, - statusDoc: statusDoc, - constraints: args.Constraints, - storage: args.Storage, - settings: map[string]interface{}(args.Settings), - }) - if err != nil { - return nil, errors.Trace(err) - } - ops = append(ops, addOps...) - - // Collect peer relation addition operations. - // - // TODO(dimitern): Ensure each st.Endpoint has a space name associated in a - // follow-up. - peerOps, err := st.addPeerRelationsOps(args.Name, peers) - if err != nil { - return nil, errors.Trace(err) - } - ops = append(ops, peerOps...) - - if len(args.Resources) > 0 { - // Collect pending resource resolution operations. - resources, err := st.Resources() - if err != nil { - return nil, errors.Trace(err) + buildTxn := func(attempt int) ([]txn.Op, error) { + // If we've tried once already and failed, check that + // model may have been destroyed. + if attempt > 0 { + if err := checkModelActive(st); err != nil { + return nil, errors.Trace(err) + } + // Ensure a local application with the same name doesn't exist. + if exists, err := isNotDead(st, applicationsC, args.Name); err != nil { + return nil, errors.Trace(err) + } else if exists { + return nil, errLocalApplicationExists + } + if featureflag.Enabled(feature.CrossModelRelations) { + // Ensure a remote application with the same name doesn't exist. + if remoteExists, err := isNotDead(st, remoteApplicationsC, args.Name); err != nil { + return nil, errors.Trace(err) + } else if remoteExists { + return nil, errSameNameRemoteApplicationExists + } + } + } + // The addApplicationOps does not include the model alive assertion, + // so we add it here. + ops := []txn.Op{ + assertModelActiveOp(st.ModelUUID()), + endpointBindingsOp, } - resOps, err := resources.NewResolvePendingResourcesOps(args.Name, args.Resources) + addOps, err := addApplicationOps(st, addApplicationOpsArgs{ + applicationDoc: appDoc, + statusDoc: statusDoc, + constraints: args.Constraints, + storage: args.Storage, + settings: map[string]interface{}(args.Settings), + }) if err != nil { return nil, errors.Trace(err) } - ops = append(ops, resOps...) - } + ops = append(ops, addOps...) - // Collect unit-adding operations. - for x := 0; x < args.NumUnits; x++ { - unitName, unitOps, err := svc.addServiceUnitOps(applicationAddUnitOpsArgs{cons: args.Constraints, storageCons: args.Storage}) + // Collect peer relation addition operations. + // + // TODO(dimitern): Ensure each st.Endpoint has a space name associated in a + // follow-up. + peerOps, err := st.addPeerRelationsOps(args.Name, peers) if err != nil { return nil, errors.Trace(err) } - ops = append(ops, unitOps...) - placement := instance.Placement{} - if x < len(args.Placement) { - placement = *args.Placement[x] + ops = append(ops, peerOps...) + + if len(args.Resources) > 0 { + // Collect pending resource resolution operations. + resources, err := st.Resources() + if err != nil { + return nil, errors.Trace(err) + } + resOps, err := resources.NewResolvePendingResourcesOps(args.Name, args.Resources) + if err != nil { + return nil, errors.Trace(err) + } + ops = append(ops, resOps...) + } + + // Collect unit-adding operations. + for x := 0; x < args.NumUnits; x++ { + unitName, unitOps, err := app.addApplicationUnitOps(applicationAddUnitOpsArgs{cons: args.Constraints, storageCons: args.Storage}) + if err != nil { + return nil, errors.Trace(err) + } + ops = append(ops, unitOps...) + placement := instance.Placement{} + if x < len(args.Placement) { + placement = *args.Placement[x] + } + ops = append(ops, assignUnitOps(unitName, placement)...) } - ops = append(ops, assignUnitOps(unitName, placement)...) + return ops, nil } - // At the last moment before inserting the service, prime status history. - probablyUpdateStatusHistory(st, svc.globalKey(), statusDoc) + // At the last moment before inserting the application, prime status history. + probablyUpdateStatusHistory(st, app.globalKey(), statusDoc) - if err := st.runTransaction(ops); err == txn.ErrAborted { - if err := checkModelActive(st); err != nil { + if err = st.run(buildTxn); err == nil { + // Refresh to pick the txn-revno. + if err = app.Refresh(); err != nil { return nil, errors.Trace(err) } - // TODO(fwereade): 2016-09-09 lp:1621754 - // This is not always correct -- there are a million - // operations collected in this func, not *all* of them - // imply that this is the problem. (e.g. the charm being - // destroyed just as we add application will fail, but - // not because "application already exists") - return nil, errors.Errorf("application already exists") - } else if err != nil { - return nil, errors.Trace(err) - } - // Refresh to pick the txn-revno. - if err = svc.Refresh(); err != nil { - return nil, errors.Trace(err) + return app, nil } - - return svc, nil + return nil, errors.Trace(err) } -// TODO(natefinch) DEMO code, revisit after demo! -var AddServicePostFuncs = map[string]func(*State, AddApplicationArgs) error{} - // assignUnitOps returns the db ops to save unit assignment for use by the // UnitAssigner worker. func assignUnitOps(unitName string, placement instance.Placement) []txn.Op { @@ -1398,7 +1414,7 @@ } } -// Service returns a service state by name. +// Application returns a application state by name. func (st *State) Application(name string) (_ *Application, err error) { applications, closer := st.getCollection(applicationsC) defer closer() @@ -1417,7 +1433,7 @@ return newApplication(st, sdoc), nil } -// AllApplications returns all deployed services in the model. +// AllApplications returns all deployed applications in the model. func (st *State) AllApplications() (applications []*Application, err error) { applicationsCollection, closer := st.getCollection(applicationsC) defer closer() @@ -1434,7 +1450,7 @@ } // InferEndpoints returns the endpoints corresponding to the supplied names. -// There must be 1 or 2 supplied names, of the form [:]. +// There must be 1 or 2 supplied names, of the form [:]. // If the supplied names uniquely specify a possible relation, or if they // uniquely specify a possible relation once all implicit relations have been // filtered, the endpoints corresponding to that relation will be returned. @@ -1461,7 +1477,11 @@ } for _, ep1 := range eps1 { for _, ep2 := range eps2 { - if ep1.CanRelateTo(ep2) && containerScopeOk(st, ep1, ep2) { + scopeOk, err := containerScopeOk(st, ep1, ep2) + if err != nil { + return nil, errors.Trace(err) + } + if ep1.CanRelateTo(ep2) && scopeOk { candidates = append(candidates, []Endpoint{ep1, ep2}) } } @@ -1506,37 +1526,51 @@ return ep.Role != charm.RolePeer } -func containerScopeOk(st *State, ep1, ep2 Endpoint) bool { +func containerScopeOk(st *State, ep1, ep2 Endpoint) (bool, error) { if ep1.Scope != charm.ScopeContainer && ep2.Scope != charm.ScopeContainer { - return true + return true, nil } var subordinateCount int for _, ep := range []Endpoint{ep1, ep2} { - svc, err := st.Application(ep.ApplicationName) + svc, err := applicationByName(st, ep.ApplicationName) if err != nil { - return false + return false, err + } + // Container scoped relations are not allowed for remote applications. + if svc.IsRemote() { + return false, nil } - if svc.doc.Subordinate { + if svc.(*Application).doc.Subordinate { subordinateCount++ } } - return subordinateCount >= 1 + return subordinateCount >= 1, nil +} + +func applicationByName(st *State, name string) (ApplicationEntity, error) { + s, err := st.RemoteApplication(name) + if err == nil { + return s, nil + } else if err != nil && !errors.IsNotFound(err) { + return nil, err + } + return st.Application(name) } // endpoints returns all endpoints that could be intended by the // supplied endpoint name, and which cause the filter param to // return true. func (st *State) endpoints(name string, filter func(ep Endpoint) bool) ([]Endpoint, error) { - var svcName, relName string + var appName, relName string if i := strings.Index(name, ":"); i == -1 { - svcName = name + appName = name } else if i != 0 && i != len(name)-1 { - svcName = name[:i] + appName = name[:i] relName = name[i+1:] } else { return nil, errors.Errorf("invalid endpoint %q", name) } - svc, err := st.Application(svcName) + svc, err := applicationByName(st, appName) if err != nil { return nil, errors.Trace(err) } @@ -1574,8 +1608,26 @@ if !eps[0].CanRelateTo(eps[1]) { return nil, errors.Errorf("endpoints do not relate") } + + // Check applications are alive and do checks if one is remote. + svc1, err := aliveApplication(st, eps[0].ApplicationName) + if err != nil { + return nil, err + } + svc2, err := aliveApplication(st, eps[1].ApplicationName) + if err != nil { + return nil, err + } + if svc1.IsRemote() && svc2.IsRemote() { + return nil, errors.Errorf("cannot add relation between remote applications %q and %q", eps[0].ApplicationName, eps[1].ApplicationName) + } + remoteRelation := svc1.IsRemote() || svc2.IsRemote() + if remoteRelation && (eps[0].Scope != charm.ScopeGlobal || eps[1].Scope != charm.ScopeGlobal) { + return nil, errors.Errorf("both endpoints must be globally scoped for remote relations") + } + // If either endpoint has container scope, so must the other; and the - // services's series must also match, because they'll be deployed to + // applications's series must also match, because they'll be deployed to // the same machines. matchSeries := true if eps[0].Scope == charm.ScopeContainer { @@ -1589,8 +1641,8 @@ // -1, we haven't got it yet (we don't get it at this stage, because we // still don't know whether it's sane to even attempt creation). id := -1 - // If a service's charm is upgraded while we're trying to add a relation, - // we'll need to re-validate service sanity. + // If a application's charm is upgraded while we're trying to add a relation, + // we'll need to re-validate application sanity. var doc *relationDoc buildTxn := func(attempt int) ([]txn.Op, error) { // Perform initial relation sanity check. @@ -1599,36 +1651,45 @@ } else if exists { return nil, errors.Errorf("relation already exists") } - // Collect per-service operations, checking sanity as we go. + // Collect per-application operations, checking sanity as we go. var ops []txn.Op var subordinateCount int series := map[string]bool{} for _, ep := range eps { - svc, err := st.Application(ep.ApplicationName) - if errors.IsNotFound(err) { - return nil, errors.Errorf("application %q does not exist", ep.ApplicationName) - } else if err != nil { - return nil, errors.Trace(err) - } else if svc.doc.Life != Alive { - return nil, errors.Errorf("application %q is not alive", ep.ApplicationName) - } - if svc.doc.Subordinate { - subordinateCount++ - } - series[svc.doc.Series] = true - ch, _, err := svc.Charm() + svc, err := aliveApplication(st, ep.ApplicationName) if err != nil { - return nil, errors.Trace(err) + return nil, err } - if !ep.ImplementedBy(ch) { - return nil, errors.Errorf("%q does not implement %q", ep.ApplicationName, ep) + if svc.IsRemote() { + ops = append(ops, txn.Op{ + C: remoteApplicationsC, + Id: st.docID(ep.ApplicationName), + Assert: bson.D{{"life", Alive}}, + Update: bson.D{{"$inc", bson.D{{"relationcount", 1}}}}, + }) + } else { + localSvc := svc.(*Application) + if localSvc.doc.Subordinate { + if remoteRelation { + return nil, errors.Errorf("cannot relate subordinate %q to remote application", localSvc.Name()) + } + subordinateCount++ + } + series[localSvc.doc.Series] = true + ch, _, err := localSvc.Charm() + if err != nil { + return nil, errors.Trace(err) + } + if !ep.ImplementedBy(ch) { + return nil, errors.Errorf("%q does not implement %q", ep.ApplicationName, ep) + } + ops = append(ops, txn.Op{ + C: applicationsC, + Id: st.docID(ep.ApplicationName), + Assert: bson.D{{"life", Alive}, {"charmurl", ch.URL()}}, + Update: bson.D{{"$inc", bson.D{{"relationcount", 1}}}}, + }) } - ops = append(ops, txn.Op{ - C: applicationsC, - Id: st.docID(ep.ApplicationName), - Assert: bson.D{{"life", Alive}, {"charmurl", ch.URL()}}, - Update: bson.D{{"$inc", bson.D{{"relationcount", 1}}}}, - }) } if matchSeries && len(series) != 1 { return nil, errors.Errorf("principal and subordinate applications' series must match") @@ -1668,6 +1729,18 @@ return nil, errors.Trace(err) } +func aliveApplication(st *State, name string) (ApplicationEntity, error) { + app, err := applicationByName(st, name) + if errors.IsNotFound(err) { + return nil, errors.Errorf("application %q does not exist", name) + } else if err != nil { + return nil, errors.Trace(err) + } else if app.Life() != Alive { + return nil, errors.Errorf("application %q is not alive", name) + } + return app, err +} + // EndpointsRelation returns the existing relation with the given endpoints. func (st *State) EndpointsRelation(endpoints ...Endpoint) (*Relation, error) { return st.KeyRelation(relationKey(endpoints)) diff -Nru juju-core-2.0.0/src/github.com/juju/juju/state/state_test.go juju-core-2.0.2/src/github.com/juju/juju/state/state_test.go --- juju-core-2.0.0/src/github.com/juju/juju/state/state_test.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/state/state_test.go 2016-11-11 00:08:09.000000000 +0000 @@ -29,6 +29,7 @@ "github.com/juju/juju/agent" "github.com/juju/juju/cloud" "github.com/juju/juju/constraints" + "github.com/juju/juju/core/crossmodel" "github.com/juju/juju/environs/config" "github.com/juju/juju/instance" "github.com/juju/juju/mongo" @@ -374,6 +375,14 @@ f.MakeApplication(c, nil) }, }, { + about: "remote applications", + getWatcher: func(st *state.State) interface{} { + return st.WatchRemoteApplications() + }, + triggerEvent: func(st *state.State) { + st.AddRemoteApplication("db2", "local:/u/ibm/db2", nil) + }, + }, { about: "relations", getWatcher: func(st *state.State) interface{} { f := factory.NewFactory(st) @@ -552,6 +561,24 @@ err = wordpress.SetMinUnits(2) c.Assert(err, jc.ErrorIsNil) }, + }, { + about: "offered applications", + getWatcher: func(st *state.State) interface{} { + return st.WatchOfferedApplications() + }, + setUpState: func(st *state.State) bool { + offeredApplications := state.NewOfferedApplications(st) + offeredApplications.AddOffer(crossmodel.OfferedApplication{ + ApplicationName: "mysql", + ApplicationURL: "local:/u/me/mysql", + }) + return false + }, + triggerEvent: func(st *state.State) { + offeredApplications := state.NewOfferedApplications(st) + err := offeredApplications.SetOfferRegistered("local:/u/me/mysql", false) + c.Assert(err, jc.ErrorIsNil) + }, }, } { c.Logf("Test %d: %s", i, test.about) @@ -1397,7 +1424,47 @@ c.Assert(err, gc.ErrorMatches, `cannot add application "s1": model "testenv" is being migrated`) } -func (s *StateSuite) TestAddServiceEnvironmentDyingAfterInitial(c *gc.C) { +func (s *StateSuite) TestAddApplicationSameRemoteExists(c *gc.C) { + charm := s.AddTestingCharm(c, "dummy") + _, err := s.State.AddRemoteApplication("s1", "local:/u/me/dummy", nil) + c.Assert(err, jc.ErrorIsNil) + _, err = s.State.AddApplication(state.AddApplicationArgs{Name: "s1", Charm: charm}) + c.Assert(err, gc.ErrorMatches, `cannot add application "s1": remote application with same name already exists`) +} + +func (s *StateSuite) TestAddApplicationRemotedAddedAfterInitial(c *gc.C) { + charm := s.AddTestingCharm(c, "dummy") + // Check that a application with a name conflict cannot be added if + // there is no conflict initially but a remote application is added + // before the transaction is run. + defer state.SetBeforeHooks(c, s.State, func() { + _, err := s.State.AddRemoteApplication("s1", "local:/u/me/s1", nil) + c.Assert(err, jc.ErrorIsNil) + }).Check() + _, err := s.State.AddApplication(state.AddApplicationArgs{Name: "s1", Charm: charm}) + c.Assert(err, gc.ErrorMatches, `cannot add application "s1": remote application with same name already exists`) +} + +func (s *StateSuite) TestAddApplicationSameLocalExists(c *gc.C) { + charm := s.AddTestingCharm(c, "dummy") + s.AddTestingService(c, "s0", charm) + _, err := s.State.AddApplication(state.AddApplicationArgs{Name: "s0", Charm: charm}) + c.Assert(err, gc.ErrorMatches, `cannot add application "s0": application already exists`) +} + +func (s *StateSuite) TestAddApplicationLocalAddedAfterInitial(c *gc.C) { + charm := s.AddTestingCharm(c, "dummy") + // Check that a service with a name conflict cannot be added if + // there is no conflict initially but a local service is added + // before the transaction is run. + defer state.SetBeforeHooks(c, s.State, func() { + s.AddTestingService(c, "s1", charm) + }).Check() + _, err := s.State.AddApplication(state.AddApplicationArgs{Name: "s1", Charm: charm}) + c.Assert(err, gc.ErrorMatches, `cannot add application "s1": application already exists`) +} + +func (s *StateSuite) TestAddApplicationEnvironmentDyingAfterInitial(c *gc.C) { charm := s.AddTestingCharm(c, "dummy") s.AddTestingService(c, "s0", charm) env, err := s.State.Model() @@ -1412,7 +1479,7 @@ c.Assert(err, gc.ErrorMatches, `cannot add application "s1": model "testenv" is no longer alive`) } -func (s *StateSuite) TestServiceNotFound(c *gc.C) { +func (s *StateSuite) TestApplicationNotFound(c *gc.C) { _, err := s.State.Application("bummer") c.Assert(err, gc.ErrorMatches, `application "bummer" not found`) c.Assert(err, jc.Satisfies, errors.IsNotFound) @@ -3059,6 +3126,66 @@ <-w.Changes() return w }) +} + +func (s *StateSuite) TestWatchOfferedApplications(c *gc.C) { + // Check initial event. + w := s.State.WatchOfferedApplications() + defer statetesting.AssertStop(c, w) + wc := statetesting.NewStringsWatcherC(c, s.State, w) + wc.AssertChange() + wc.AssertNoChange() + + // Add a new offered application; a single change should occur. + offers := state.NewOfferedApplications(s.State) + offer := crossmodel.OfferedApplication{ + ApplicationName: "service", + ApplicationURL: "local:/u/me/service", + Registered: true, + } + err := offers.AddOffer(offer) + wc.AssertChange("local:/u/me/service") + wc.AssertNoChange() + + // Set the registered value; expect one change. + err = offers.SetOfferRegistered("local:/u/me/service", false) + c.Assert(err, jc.ErrorIsNil) + offer.Registered = false + wc.AssertChange("local:/u/me/service") + wc.AssertNoChange() + + // Insert a new offer2 and set registered value; expect 2 changes. + offer2 := crossmodel.OfferedApplication{ + ApplicationName: "service2", + ApplicationURL: "local:/u/me/service2", + Registered: true, + } + err = offers.AddOffer(offer2) + c.Assert(err, jc.ErrorIsNil) + err = offers.SetOfferRegistered("local:/u/me/service", true) + offer.Registered = true + c.Assert(err, jc.ErrorIsNil) + wc.AssertChange("local:/u/me/service2", "local:/u/me/service") + + // Update endpoints and registered value; expect 2 changes. + err = offers.UpdateOffer("local:/u/me/service2", map[string]string{"foo": "bar"}) + c.Assert(err, jc.ErrorIsNil) + err = offers.SetOfferRegistered("local:/u/me/service", false) + offer.Registered = true + c.Assert(err, jc.ErrorIsNil) + wc.AssertChange("local:/u/me/service2", "local:/u/me/service") + + // Stop watcher, check closed. + statetesting.AssertStop(c, w) + wc.AssertClosed() +} + +func (s *StateSuite) TestWatchOfferedApplicationsDiesOnStateClose(c *gc.C) { + testWatcherDiesWhenStateCloses(c, s.modelTag, s.State.ControllerTag(), func(c *gc.C, st *state.State) waiter { + w := st.WatchOfferedApplications() + <-w.Changes() + return w + }) } func (s *StateSuite) TestNestingLevel(c *gc.C) { diff -Nru juju-core-2.0.0/src/github.com/juju/juju/state/testing/suite.go juju-core-2.0.2/src/github.com/juju/juju/state/testing/suite.go --- juju-core-2.0.0/src/github.com/juju/juju/state/testing/suite.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/state/testing/suite.go 2016-11-11 00:08:09.000000000 +0000 @@ -10,6 +10,7 @@ "github.com/juju/juju/cloud" "github.com/juju/juju/environs/config" + "github.com/juju/juju/feature" "github.com/juju/juju/state" "github.com/juju/juju/testing" "github.com/juju/juju/testing/factory" @@ -43,6 +44,7 @@ } func (s *StateSuite) SetUpTest(c *gc.C) { + s.SetInitialFeatureFlags(feature.CrossModelRelations) s.MgoSuite.SetUpTest(c) s.BaseSuite.SetUpTest(c) diff -Nru juju-core-2.0.0/src/github.com/juju/juju/state/testing/suite_wallclock.go juju-core-2.0.2/src/github.com/juju/juju/state/testing/suite_wallclock.go --- juju-core-2.0.0/src/github.com/juju/juju/state/testing/suite_wallclock.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/state/testing/suite_wallclock.go 2016-11-11 00:08:09.000000000 +0000 @@ -10,6 +10,7 @@ "github.com/juju/juju/cloud" "github.com/juju/juju/environs/config" + "github.com/juju/juju/feature" "github.com/juju/juju/state" coretesting "github.com/juju/juju/testing" "github.com/juju/juju/testing/factory" @@ -43,6 +44,7 @@ } func (s *StateWithWallClockSuite) SetUpTest(c *gc.C) { + s.SetInitialFeatureFlags(feature.CrossModelRelations) s.MgoSuite.SetUpTest(c) s.BaseSuite.SetUpTest(c) diff -Nru juju-core-2.0.0/src/github.com/juju/juju/state/watcher.go juju-core-2.0.2/src/github.com/juju/juju/state/watcher.go --- juju-core-2.0.0/src/github.com/juju/juju/state/watcher.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/state/watcher.go 2016-11-11 00:08:09.000000000 +0000 @@ -13,6 +13,7 @@ "github.com/juju/errors" "github.com/juju/loggo" "github.com/juju/utils/set" + "gopkg.in/juju/charm.v6-unstable" "gopkg.in/juju/names.v2" "gopkg.in/mgo.v2" "gopkg.in/mgo.v2/bson" @@ -318,6 +319,12 @@ return newLifecycleWatcher(st, applicationsC, nil, isLocalID(st), nil) } +// WatchRemoteApplications returns a StringsWatcher that notifies of changes to +// the lifecycles of the remote applications in the model. +func (st *State) WatchRemoteApplications() StringsWatcher { + return newLifecycleWatcher(st, remoteApplicationsC, nil, isLocalID(st), nil) +} + // WatchStorageAttachments returns a StringsWatcher that notifies of // changes to the lifecycles of all storage instances attached to the // specified unit. @@ -356,10 +363,20 @@ // WatchRelations returns a StringsWatcher that notifies of changes to the // lifecycles of relations involving s. func (s *Application) WatchRelations() StringsWatcher { - prefix := s.doc.Name + ":" + return watchApplicationRelations(s.st, s.doc.Name) +} + +// WatchRelations returns a StringsWatcher that notifies of changes to the +// lifecycles of relations involving s. +func (s *RemoteApplication) WatchRelations() StringsWatcher { + return watchApplicationRelations(s.st, s.doc.Name) +} + +func watchApplicationRelations(st *State, applicationName string) StringsWatcher { + prefix := applicationName + ":" infix := " " + prefix filter := func(id interface{}) bool { - k, err := s.st.strictLocalID(id.(string)) + k, err := st.strictLocalID(id.(string)) if err != nil { return false } @@ -367,8 +384,8 @@ return out } - members := bson.D{{"endpoints.applicationname", s.doc.Name}} - return newLifecycleWatcher(s.st, relationsC, members, filter, nil) + members := bson.D{{"endpoints.applicationname", applicationName}} + return newLifecycleWatcher(st, relationsC, members, filter, nil) } // WatchModelMachines returns a StringsWatcher that notifies of changes to @@ -888,13 +905,29 @@ // Watch returns a watcher that notifies of changes to conterpart units in // the relation. func (ru *RelationUnit) Watch() RelationUnitsWatcher { - return newRelationUnitsWatcher(ru) + return newRelationUnitsWatcher(ru.st, ru.WatchScope()) +} + +// WatchCounterpartEndpointUnits returns a watcher that notifies of changes to +// the units of the specified service's counterpart endpoint in the relation. +// This method will return an error if the endpoint is not globally scoped. +func (r *Relation) WatchCounterpartEndpointUnits(applicationName string) (RelationUnitsWatcher, error) { + ep, err := r.Endpoint(applicationName) + if err != nil { + return nil, err + } + if ep.Scope != charm.ScopeGlobal { + return nil, errors.Errorf("%q endpoint is not globally scoped", ep.Name) + } + role := counterpartRole(ep.Role) + rsw := watchRelationScope(r.st, r.globalScope(), role, "") + return newRelationUnitsWatcher(r.st, rsw), nil } -func newRelationUnitsWatcher(ru *RelationUnit) RelationUnitsWatcher { +func newRelationUnitsWatcher(st *State, sw *RelationScopeWatcher) RelationUnitsWatcher { w := &relationUnitsWatcher{ - commonWatcher: newCommonWatcher(ru.st), - sw: ru.WatchScope(), + commonWatcher: newCommonWatcher(st), + sw: sw, watching: make(set.Strings), updates: make(chan watcher.Change), out: make(chan params.RelationUnitsChange), @@ -2544,3 +2577,106 @@ } } } + +// OfferedApplicationWatcher notifies about values in the collection +// of offered applications. The first event returned by the watcher +// is a slice of all current offer urls. +// Subsequent events are generated when a application offer has it's +// registered value changed. +type offeredApplicationsWatcher struct { + commonWatcher + known map[string]int64 + out chan []string +} + +func newOfferedApplicationsWatcher(st *State) StringsWatcher { + w := &offeredApplicationsWatcher{ + commonWatcher: newCommonWatcher(st), + known: make(map[string]int64), + out: make(chan []string), + } + go func() { + defer w.tomb.Done() + defer close(w.out) + w.tomb.Kill(w.loop()) + }() + return w +} + +// WatchOfferedApplications returns a OfferedApplicationsWatcher. +func (st *State) WatchOfferedApplications() StringsWatcher { + return newOfferedApplicationsWatcher(st) +} + +func (w *offeredApplicationsWatcher) initial() (set.Strings, error) { + offered := set.NewStrings() + var revnoDoc struct { + ApplicationURL string `bson:"application-url"` + TxnRevno int64 `bson:"txn-revno"` + } + offeredCollection, closer := w.st.getCollection(applicationOffersC) + defer closer() + + iter := offeredCollection.Find(nil).Iter() + for iter.Next(&revnoDoc) { + w.known[revnoDoc.ApplicationURL] = revnoDoc.TxnRevno + offered.Add(revnoDoc.ApplicationURL) + } + return offered, iter.Close() +} + +func (w *offeredApplicationsWatcher) merge(applicationURLs set.Strings, change watcher.Change) error { + applicationURL := w.st.localID(change.Id.(string)) + if change.Revno == -1 { + delete(w.known, applicationURL) + applicationURLs.Remove(applicationURL) + return nil + } + var revnoDoc struct { + TxnRevno int64 `bson:"txn-revno"` + } + offeredCollection, closer := w.st.getCollection(applicationOffersC) + defer closer() + if err := offeredCollection.FindId(change.Id).One(&revnoDoc); err != nil { + return err + } + revno, known := w.known[applicationURL] + w.known[applicationURL] = revnoDoc.TxnRevno + if !known || revnoDoc.TxnRevno > revno { + applicationURLs.Add(applicationURL) + } + return nil +} + +func (w *offeredApplicationsWatcher) loop() (err error) { + ch := make(chan watcher.Change) + w.watcher.WatchCollectionWithFilter(applicationOffersC, ch, isLocalID(w.st)) + defer w.watcher.UnwatchCollection(applicationOffersC, ch) + offers, err := w.initial() + if err != nil { + return err + } + out := w.out + for { + select { + case <-w.tomb.Dying(): + return tomb.ErrDying + case <-w.watcher.Dead(): + return stateWatcherDeadError(w.watcher.Err()) + case change := <-ch: + if err = w.merge(offers, change); err != nil { + return err + } + if len(offers) > 0 { + out = w.out + } + case out <- offers.Values(): + out = nil + offers = set.NewStrings() + } + } +} + +func (w *offeredApplicationsWatcher) Changes() <-chan []string { + return w.out +} diff -Nru juju-core-2.0.0/src/github.com/juju/juju/version/version.go juju-core-2.0.2/src/github.com/juju/juju/version/version.go --- juju-core-2.0.0/src/github.com/juju/juju/version/version.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/version/version.go 2016-11-11 00:08:09.000000000 +0000 @@ -19,7 +19,7 @@ // The presence and format of this constant is very important. // The debian/rules build recipe uses this value for the version // number of the release package. -const version = "2.0.0" +const version = "2.0.2" // The version that we switched over from old style numbering to new style. var switchOverVersion = semversion.MustParse("1.19.9") diff -Nru juju-core-2.0.0/src/github.com/juju/juju/watcher/applicationrelations.go juju-core-2.0.2/src/github.com/juju/juju/watcher/applicationrelations.go --- juju-core-2.0.0/src/github.com/juju/juju/watcher/applicationrelations.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/watcher/applicationrelations.go 2016-11-11 00:08:09.000000000 +0000 @@ -0,0 +1,55 @@ +// Copyright 2016 Canonical Ltd. +// Licensed under the AGPLv3, see LICENCE file for details. + +package watcher + +import "github.com/juju/juju/state/multiwatcher" + +// RelationUnitChange describes a relation unit change. +type RelationUnitChange struct { + // Settings is the current settings for the relation unit. + Settings map[string]interface{} +} + +// RelationChange describes changes to a relation. +type RelationChange struct { + // RelationId is the numeric ID of the relation. + RelationId int + + // Life is the current lifecycle state of the relation. + Life multiwatcher.Life + + // ChangedUnits maps unit names to relation unit changes. + ChangedUnits map[string]RelationUnitChange + + // DepartedUnits contains the names of units that have departed + // the relation since the last change. + DepartedUnits []string +} + +// ApplicationRelationsChange describes changes to the relations that a service +// is involved in. +type ApplicationRelationsChange struct { + // ChangedRelations maps relation IDs to relation changes. + ChangedRelations []RelationChange + + // RemovedRelations contains the IDs of relations removed + // since the last change. + RemovedRelations []int +} + +// ApplicationRelationsChanges holds a set of ApplicationRelationsChange structures. +type ApplicationRelationsChanges struct { + Changes []ApplicationRelationsChange +} + +// CHECK - PORT params +// ApplicationRelationsChannel is a change channel as described in the CoreWatcher docs. +type ApplicationRelationsChannel <-chan ApplicationRelationsChange + +// ApplicationRelationsWatcher is a watcher that reports on changes to relations +// and relation units related to those relations for a specified service. +type ApplicationRelationsWatcher interface { + CoreWatcher + Changes() ApplicationRelationsChannel +} diff -Nru juju-core-2.0.0/src/github.com/juju/juju/worker/logforwarder/logforwarder_test.go juju-core-2.0.2/src/github.com/juju/juju/worker/logforwarder/logforwarder_test.go --- juju-core-2.0.0/src/github.com/juju/juju/worker/logforwarder/logforwarder_test.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/worker/logforwarder/logforwarder_test.go 2016-11-11 00:08:09.000000000 +0000 @@ -19,7 +19,6 @@ coretesting "github.com/juju/juju/testing" "github.com/juju/juju/version" "github.com/juju/juju/watcher" - "github.com/juju/juju/worker" "github.com/juju/juju/worker/logforwarder" "github.com/juju/juju/worker/workertest" ) @@ -27,7 +26,6 @@ type LogForwarderSuite struct { testing.IsolationSuite - stub *testing.Stub stream *stubStream sender *stubSender rec logfwd.Record @@ -38,9 +36,8 @@ func (s *LogForwarderSuite) SetUpTest(c *gc.C) { s.IsolationSuite.SetUpTest(c) - s.stub = &testing.Stub{} - s.stream = newStubStream(s.stub) - s.sender = newStubSender(s.stub) + s.stream = newStubStream() + s.sender = newStubSender() s.rec = logfwd.Record{ Origin: logfwd.Origin{ ControllerUUID: "feebdaed-2f18-4fd2-967d-db9663db7bea", @@ -66,82 +63,11 @@ } } -func (s *LogForwarderSuite) checkNext(c *gc.C, rec logfwd.Record) { - s.stream.waitBeforeNext(c) - s.stream.waitAfterNext(c) - s.sender.waitAfterSend(c) - s.stub.CheckCallNames(c, "Next", "Send") - s.stub.CheckCall(c, 1, "Send", []logfwd.Record{rec}) - s.stub.ResetCalls() -} - -func (s *LogForwarderSuite) checkClose(c *gc.C, lf worker.Worker, expected error) { - go func() { - s.sender.waitBeforeClose(c) - }() - var err error - if expected == nil { - workertest.CleanKill(c, lf) - } else { - err = workertest.CheckKill(c, lf) - } - c.Check(errors.Cause(err), gc.Equals, expected) - s.stub.CheckCallNames(c, "Close") -} - -type mockLogForwardConfig struct { - enabled bool - host string - changes chan struct{} -} - -type mockWatcher struct { - watcher.NotifyWatcher - changes chan struct{} -} - -func (m *mockWatcher) Changes() watcher.NotifyChannel { - return m.changes -} - -func (*mockWatcher) Kill() { -} - -func (*mockWatcher) Wait() error { - return nil -} - -type mockCaller struct { - base.APICaller -} - -func (*mockCaller) APICall(objType string, version int, id, request string, params, response interface{}) error { - return nil -} - -func (*mockCaller) BestFacadeVersion(facade string) int { - return 0 -} - -func (c *mockLogForwardConfig) WatchForLogForwardConfigChanges() (watcher.NotifyWatcher, error) { - c.changes = make(chan struct{}, 1) - c.changes <- struct{}{} - return &mockWatcher{ - changes: c.changes, - }, nil -} - -func (c *mockLogForwardConfig) LogForwardConfig() (*syslog.RawConfig, bool, error) { - return &syslog.RawConfig{ - Enabled: c.enabled, - Host: c.host, - CACert: coretesting.CACert, - ClientCert: coretesting.ServerCert, - ClientKey: coretesting.ServerKey, - }, true, nil -} - -func (s *LogForwarderSuite) newLogForwarderArgs(c *gc.C, stream logforwarder.LogStream, sender *stubSender) logforwarder.OpenLogForwarderArgs { +func (s *LogForwarderSuite) newLogForwarderArgs( + c *gc.C, + stream logforwarder.LogStream, + sender *stubSender, +) logforwarder.OpenLogForwarderArgs { api := &mockLogForwardConfig{ enabled: stream != nil, host: "10.0.0.1", @@ -149,7 +75,12 @@ return s.newLogForwarderArgsWithAPI(c, api, stream, sender) } -func (s *LogForwarderSuite) newLogForwarderArgsWithAPI(c *gc.C, configAPI logforwarder.LogForwardConfig, stream logforwarder.LogStream, sender *stubSender) logforwarder.OpenLogForwarderArgs { +func (s *LogForwarderSuite) newLogForwarderArgsWithAPI( + c *gc.C, + configAPI logforwarder.LogForwardConfig, + stream logforwarder.LogStream, + sender *stubSender, +) logforwarder.OpenLogForwarderArgs { return logforwarder.OpenLogForwarderArgs{ Caller: &mockCaller{}, LogForwardConfig: configAPI, @@ -170,24 +101,23 @@ } func (s *LogForwarderSuite) TestOne(c *gc.C) { - s.stream.setRecords(c, []logfwd.Record{ - s.rec, - }) - + s.stream.addRecords(c, s.rec) lf, err := logforwarder.NewLogForwarder(s.newLogForwarderArgs(c, s.stream, s.sender)) c.Assert(err, jc.ErrorIsNil) - defer s.checkClose(c, lf, nil) + defer workertest.DirtyKill(c, lf) - s.checkNext(c, s.rec) + s.sender.waitForSend(c) + workertest.CleanKill(c, lf) + s.sender.stub.CheckCalls(c, []testing.StubCall{ + {"Send", []interface{}{[]logfwd.Record{s.rec}}}, + {"Close", nil}, + }) } func (s *LogForwarderSuite) TestConfigChange(c *gc.C) { - rec2 := s.rec - rec2.ID = 11 - s.stream.setRecords(c, []logfwd.Record{ - s.rec, - rec2, - }) + rec0 := s.rec + rec1 := s.rec + rec1.ID = 11 api := &mockLogForwardConfig{ enabled: true, @@ -195,149 +125,176 @@ } lf, err := logforwarder.NewLogForwarder(s.newLogForwarderArgsWithAPI(c, api, s.stream, s.sender)) c.Assert(err, jc.ErrorIsNil) - defer s.checkClose(c, lf, nil) + defer workertest.DirtyKill(c, lf) - s.checkNext(c, s.rec) + // Send the first record. + s.stream.addRecords(c, rec0) + s.sender.waitForSend(c) + // Config change. api.host = "10.0.0.2" api.changes <- struct{}{} - s.sender.waitBeforeClose(c) - s.stream.waitBeforeNext(c) - s.stream.waitAfterNext(c) - s.sender.waitAfterSend(c) - // Check that the config change has been picked up and - // that the second record is sent. - rec2.Message = "send to 10.0.0.2" - s.stub.CheckCall(c, 2, "Send", []logfwd.Record{rec2}) - s.stub.ResetCalls() + s.sender.waitForClose(c) + + // Send the second record. + s.stream.addRecords(c, rec1) + s.sender.waitForSend(c) + + workertest.CleanKill(c, lf) + + // Check that both records were sent with the config change + // applied for the second send. + rec1.Message = "send to 10.0.0.2" + s.sender.stub.CheckCalls(c, []testing.StubCall{ + {"Send", []interface{}{[]logfwd.Record{rec0}}}, + {"Close", nil}, + {"Send", []interface{}{[]logfwd.Record{rec1}}}, + {"Close", nil}, + }) } func (s *LogForwarderSuite) TestNotEnabled(c *gc.C) { lf, err := logforwarder.NewLogForwarder(s.newLogForwarderArgs(c, nil, s.sender)) c.Assert(err, jc.ErrorIsNil) + + time.Sleep(coretesting.ShortWait) workertest.CleanKill(c, lf) + + // There should be no stream or sender activity when log + // forwarding is disabled. + s.stream.stub.CheckCallNames(c) + s.sender.stub.CheckCallNames(c) } func (s *LogForwarderSuite) TestStreamError(c *gc.C) { failure := errors.New("") - s.stub.SetErrors(nil, nil, failure) - s.stream.setRecords(c, []logfwd.Record{ - s.rec, - }) + s.stream.stub.SetErrors(nil, failure) + s.stream.addRecords(c, s.rec) + lf, err := logforwarder.NewLogForwarder(s.newLogForwarderArgs(c, s.stream, s.sender)) c.Assert(err, jc.ErrorIsNil) + defer workertest.DirtyKill(c, lf) - s.checkNext(c, s.rec) - s.stream.waitBeforeNext(c) - s.stream.waitAfterNext(c) - s.stub.CheckCallNames(c, "Next") - s.stub.ResetCalls() - s.checkClose(c, lf, failure) + err = workertest.CheckKilled(c, lf) + c.Check(errors.Cause(err), gc.Equals, failure) + + s.sender.stub.CheckCalls(c, []testing.StubCall{ + {"Send", []interface{}{[]logfwd.Record{s.rec}}}, + {"Close", nil}, + }) } func (s *LogForwarderSuite) TestSenderError(c *gc.C) { failure := errors.New("") - s.stub.SetErrors(nil, nil, nil, failure) - rec2 := s.rec - rec2.ID = 11 - s.stream.setRecords(c, []logfwd.Record{ - s.rec, - rec2, - }) + s.sender.stub.SetErrors(nil, failure) + + rec0 := s.rec + rec1 := s.rec + rec1.ID = 11 + s.stream.addRecords(c, rec0, rec1) + lf, err := logforwarder.NewLogForwarder(s.newLogForwarderArgs(c, s.stream, s.sender)) c.Assert(err, jc.ErrorIsNil) + defer workertest.DirtyKill(c, lf) - s.checkNext(c, s.rec) - s.checkNext(c, rec2) - s.checkClose(c, lf, failure) + err = workertest.CheckKilled(c, lf) + c.Check(errors.Cause(err), gc.Equals, failure) + + s.sender.stub.CheckCalls(c, []testing.StubCall{ + {"Send", []interface{}{[]logfwd.Record{rec0}}}, + {"Send", []interface{}{[]logfwd.Record{rec1}}}, + {"Close", nil}, + }) } -type stubStream struct { - stub *testing.Stub +type mockLogForwardConfig struct { + enabled bool + host string + changes chan struct{} +} - waitCh chan struct{} - ReturnNext <-chan logfwd.Record +type mockWatcher struct { + watcher.NotifyWatcher + changes chan struct{} } -func newStubStream(stub *testing.Stub) *stubStream { - return &stubStream{ - stub: stub, - waitCh: make(chan struct{}), - } +func (m *mockWatcher) Changes() watcher.NotifyChannel { + return m.changes } -func (s *stubStream) setRecords(c *gc.C, recs []logfwd.Record) { - recCh := make(chan logfwd.Record) - go func() { - for _, rec := range recs { - select { - case recCh <- rec: - case <-time.After(coretesting.LongWait): - c.Error("timed out waiting for records on the channel") - } +func (*mockWatcher) Kill() { +} - } - }() - s.ReturnNext = recCh +func (*mockWatcher) Wait() error { + return nil } -func (s *stubStream) waitBeforeNext(c *gc.C) { - select { - case <-s.waitCh: - case <-time.After(coretesting.LongWait): - c.Error("timed out waiting") +type mockCaller struct { + base.APICaller +} + +func (*mockCaller) APICall(objType string, version int, id, request string, params, response interface{}) error { + return nil +} + +func (*mockCaller) BestFacadeVersion(facade string) int { + return 0 +} + +func (c *mockLogForwardConfig) WatchForLogForwardConfigChanges() (watcher.NotifyWatcher, error) { + c.changes = make(chan struct{}, 1) + c.changes <- struct{}{} + return &mockWatcher{ + changes: c.changes, + }, nil +} + +func (c *mockLogForwardConfig) LogForwardConfig() (*syslog.RawConfig, bool, error) { + return &syslog.RawConfig{ + Enabled: c.enabled, + Host: c.host, + CACert: coretesting.CACert, + ClientCert: coretesting.ServerCert, + ClientKey: coretesting.ServerKey, + }, true, nil +} + +type stubStream struct { + stub *testing.Stub + nextRecs chan logfwd.Record +} + +func newStubStream() *stubStream { + return &stubStream{ + stub: new(testing.Stub), + nextRecs: make(chan logfwd.Record, 16), } } -func (s *stubStream) waitAfterNext(c *gc.C) { - select { - case <-s.waitCh: - case <-time.After(coretesting.LongWait): - c.Error("timed out waiting") +func (s *stubStream) addRecords(c *gc.C, recs ...logfwd.Record) { + for _, rec := range recs { + s.nextRecs <- rec } } func (s *stubStream) Next() ([]logfwd.Record, error) { - s.waitCh <- struct{}{} s.stub.AddCall("Next") - s.waitCh <- struct{}{} if err := s.stub.NextErr(); err != nil { return []logfwd.Record{}, errors.Trace(err) } - - rec := <-s.ReturnNext - return []logfwd.Record{rec}, nil + return []logfwd.Record{<-s.nextRecs}, nil } type stubSender struct { - stub *testing.Stub - - host string - waitSendCh chan struct{} - waitCloseCh chan struct{} + stub *testing.Stub + activity chan string + host string } -func newStubSender(stub *testing.Stub) *stubSender { +func newStubSender() *stubSender { return &stubSender{ - stub: stub, - waitSendCh: make(chan struct{}), - waitCloseCh: make(chan struct{}), - } -} - -func (s *stubSender) waitAfterSend(c *gc.C) { - select { - case <-s.waitSendCh: - case <-time.After(coretesting.LongWait): - c.Error("timed out waiting") - } -} - -func (s *stubSender) waitBeforeClose(c *gc.C) { - select { - case <-s.waitCloseCh: - case <-time.After(coretesting.LongWait): - c.Error("timed out waiting") + stub: new(testing.Stub), + activity: make(chan string, 16), } } @@ -347,20 +304,31 @@ records[i] = rec } s.stub.AddCall("Send", records) - s.waitSendCh <- struct{}{} - if err := s.stub.NextErr(); err != nil { - return errors.Trace(err) - } - - return nil + s.activity <- "Send" + return errors.Trace(s.stub.NextErr()) } func (s *stubSender) Close() error { - s.waitCloseCh <- struct{}{} s.stub.AddCall("Close") - if err := s.stub.NextErr(); err != nil { - return errors.Trace(err) - } + s.activity <- "Close" + return errors.Trace(s.stub.NextErr()) +} - return nil +func (s *stubSender) waitForSend(c *gc.C) { + s.waitForActivity(c, "Send") +} + +func (s *stubSender) waitForClose(c *gc.C) { + s.waitForActivity(c, "Close") +} + +func (s *stubSender) waitForActivity(c *gc.C, name string) { + select { + case a := <-s.activity: + if a != name { + c.Fatalf("expected %v, got %v", name, a) + } + case <-time.After(coretesting.LongWait): + c.Fatalf("timeout out waiting for %v", name) + } } diff -Nru juju-core-2.0.0/src/github.com/juju/juju/worker/peergrouper/shim.go juju-core-2.0.2/src/github.com/juju/juju/worker/peergrouper/shim.go --- juju-core-2.0.0/src/github.com/juju/juju/worker/peergrouper/shim.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/worker/peergrouper/shim.go 2016-11-11 00:08:09.000000000 +0000 @@ -37,8 +37,8 @@ Name() string } -func (st *stateShim) Space(name string) (SpaceReader, error) { - return st.Space(name) +func (s *stateShim) Space(name string) (SpaceReader, error) { + return s.State.Space(name) } func (s *stateShim) MongoSession() mongoSession { diff -Nru juju-core-2.0.0/src/github.com/juju/juju/worker/uniter/remotestate/watcher.go juju-core-2.0.2/src/github.com/juju/juju/worker/uniter/remotestate/watcher.go --- juju-core-2.0.0/src/github.com/juju/juju/worker/uniter/remotestate/watcher.go 2016-10-13 14:31:49.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/juju/worker/uniter/remotestate/watcher.go 2016-11-11 00:08:09.000000000 +0000 @@ -186,7 +186,7 @@ } requiredEvents++ - var seenServiceChange bool + var seenApplicationChange bool servicew, err := w.service.Watch() if err != nil { return errors.Trace(err) @@ -319,10 +319,10 @@ if !ok { return errors.New("service watcher closed") } - if err := w.serviceChanged(); err != nil { + if err := w.applicationChanged(); err != nil { return errors.Trace(err) } - observedEvent(&seenServiceChange) + observedEvent(&seenApplicationChange) case _, ok := <-configw.Changes(): logger.Debugf("got config change: ok=%t", ok) @@ -482,8 +482,8 @@ return nil } -// serviceChanged responds to changes in the service. -func (w *RemoteStateWatcher) serviceChanged() error { +// applicationChanged responds to changes in the application. +func (w *RemoteStateWatcher) applicationChanged() error { if err := w.service.Refresh(); err != nil { return errors.Trace(err) } diff -Nru juju-core-2.0.0/src/github.com/juju/txn/export_test.go juju-core-2.0.2/src/github.com/juju/txn/export_test.go --- juju-core-2.0.0/src/github.com/juju/txn/export_test.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/txn/export_test.go 2016-11-11 00:08:14.000000000 +0000 @@ -0,0 +1,14 @@ +// Copyright 2016 Canonical Ltd. +// Licensed under the LGPLv3, see LICENCE file for details. + +package txn + +type TxnRunner txnRunner + +// Specify the function that creates the txnRunner for testing. +func SetRunnerFunc(r Runner, f func() TxnRunner) { + inner := r.(*transactionRunner) + inner.newRunner = func() txnRunner { + return f() + } +} diff -Nru juju-core-2.0.0/src/github.com/juju/txn/prune.go juju-core-2.0.2/src/github.com/juju/txn/prune.go --- juju-core-2.0.0/src/github.com/juju/txn/prune.go 2016-10-13 14:31:52.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/txn/prune.go 2016-11-11 00:08:14.000000000 +0000 @@ -211,8 +211,12 @@ func bulkRemoveTxns(txns *mgo.Collection, txnIds map[bson.ObjectId]struct{}) error { removeCount := 0 removeTxns := func(ids []bson.ObjectId) error { - _, err := txns.RemoveAll(bson.M{"_id": bson.M{"$in": ids}}) - switch err { + bulk := txns.Bulk() + bulk.Unordered() + for _, id := range ids { + bulk.Remove(bson.D{{"_id", id}}) + } + switch _, err := bulk.Run(); err { case nil, mgo.ErrNotFound: // It's OK for txns to no longer exist. Another process // may have concurrently pruned them. @@ -224,7 +228,8 @@ } } - const chunkSize = 1e5 + // There must not be more than 1000 operations in a bulk operation. + const chunkSize = 1000 chunk := make([]bson.ObjectId, 0, chunkSize) for txnId := range txnIds { chunk = append(chunk, txnId) diff -Nru juju-core-2.0.0/src/github.com/juju/utils/series/series.go juju-core-2.0.2/src/github.com/juju/utils/series/series.go --- juju-core-2.0.0/src/github.com/juju/utils/series/series.go 2016-10-13 14:32:08.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/utils/series/series.go 2016-11-11 00:08:15.000000000 +0000 @@ -80,6 +80,7 @@ // macOSXSeries maps from the Darwin Kernel Major Version to the Mac OSX // series. var macOSXSeries = map[int]string{ + 16: "sierra", 15: "elcapitan", 14: "yosemite", 13: "mavericks", diff -Nru juju-core-2.0.0/src/github.com/juju/utils/series/series_test.go juju-core-2.0.2/src/github.com/juju/utils/series/series_test.go --- juju-core-2.0.0/src/github.com/juju/utils/series/series_test.go 2016-10-13 14:32:08.000000000 +0000 +++ juju-core-2.0.2/src/github.com/juju/utils/series/series_test.go 2016-11-11 00:08:15.000000000 +0000 @@ -89,7 +89,7 @@ {version: 12, series: "mountainlion"}, {version: 14, series: "yosemite"}, {version: 15, series: "elcapitan"}, - {version: 16, series: "unknown", err: `unknown series ""`}, + {version: 16, series: "sierra"}, {version: 4, series: "unknown", err: `unknown series ""`}, {version: 0, series: "unknown", err: `unknown series ""`}, } diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/CHANGELOG.md juju-core-2.0.2/src/github.com/vmware/govmomi/CHANGELOG.md --- juju-core-2.0.0/src/github.com/vmware/govmomi/CHANGELOG.md 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/CHANGELOG.md 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,148 @@ +# changelog + +### 0.8.0 (2016-06-30) + +* Add session.Manager.AcquireLocalTicket + +* Include StoragePod in Finder.FolderList + +* Add Finder methods for finding by ManagedObjectReference: Element, ObjectReference + +* Add mo.ManagedObjectReference methods: Reference, String, FromString + +* Add support using SessionManagerGenericServiceTicket.HostName for Datastore HTTP access + +### 0.7.1 (2016-06-03) + +* Fix object.ObjectName method + +### 0.7.0 (2016-06-02) + +* Move InventoryPath field to object.Common + +* Add HostDatastoreSystem.CreateLocalDatastore method + +* Add DatastoreNamespaceManager methods: CreateDirectory, DeleteDirectory + +* Add HostServiceSystem + +* Add HostStorageSystem methods: MarkAsSdd, MarkAsNonSdd, MarkAsLocal, MarkAsNonLocal + +* Add HostStorageSystem.RescanAllHba method + +### 0.6.2 (2016-05-11) + +* Get complete file details in Datastore.Stat + +* SOAP decoding fixes + +* Add VirtualMachine.RemoveAllSnapshot + +### 0.6.1 (2016-04-30) + +* Fix mo.Entity interface + +### 0.6.0 (2016-04-29) + +* Add Common.Rename method + +* Add mo.Entity interface + +* Add OptionManager + +* Add Finder.FolderList method + +* Add VirtualMachine.WaitForNetIP method + +* Add VirtualMachine.RevertToSnapshot method + +* Add Datastore.Download method + +### 0.5.0 (2016-03-30) + +Generated fields using xsd type 'int' change to Go type 'int32' + +VirtualDevice.UnitNumber field changed to pointer type + +### 0.4.0 (2016-02-26) + +* Add method to convert virtual device list to array with virtual device + changes that can be used in the VirtualMachineConfigSpec. + +* Make datastore cluster traversable in lister + +* Add finder.DatastoreCluster methods (also known as storage pods) + +* Add Drone CI check + +* Add object.Datastore Type and AttachedClusterHosts methods + +* Add finder.*OrDefault methods + +### 0.3.0 (2016-01-16) + +* Add object.VirtualNicManager wrapper + +* Add object.HostVsanSystem wrapper + +* Add object.HostSystem methods: EnterMaintenanceMode, ExitMaintenanceMode, Disconnect, Reconnect + +* Add finder.Folder method + +* Add object.Common.Destroy method + +* Add object.ComputeResource.Reconfigure method + +* Add license.AssignmentManager wrapper + +* Add object.HostFirewallSystem wrapper + +* Add object.DiagnosticManager wrapper + +* Add LoginExtensionByCertificate support + +* Add object.ExtensionManager + +... + +### 0.2.0 (2015-09-15) + +* Update to vim25/6.0 API + +* Stop returning children from `ManagedObjectList` + + Change the `ManagedObjectList` function in the `find` package to only + return the managed objects specified by the path argument and not their + children. The original behavior was used by govc's `ls` command and is + now available in the newly added function `ManagedObjectListChildren`. + +* Add retry functionality to vim25 package + +* Change finder functions to no longer take varargs + + The `find` package had functions to return a list of objects, given a + variable number of patterns. This makes it impossible to distinguish which + patterns produced results and which ones didn't. + + In particular for govc, where multiple arguments can be passed from the + command line, it is useful to let the user know which ones produce results + and which ones don't. + + To evaluate multiple patterns, the user should call the find functions + multiple times (either serially or in parallel). + +* Make optional boolean fields pointers (`vim25/types`). + + False is the zero value of a boolean field, which means they are not serialized + if the field is marked "omitempty". If the field is a pointer instead, the zero + value will be the nil pointer, and both true and false values are serialized. + +### 0.1.0 (2015-03-17) + +Prior to this version the API of this library was in flux. + +Notable changes w.r.t. the state of this library before March 2015 are: + +* All functions that may execute a request take a `context.Context` parameter. +* The `vim25` package contains a minimal client implementation. +* The property collector and its convenience functions live in the `property` package. diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/client.go juju-core-2.0.2/src/github.com/vmware/govmomi/client.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/client.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/client.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,167 @@ +/* +Copyright (c) 2014-2016 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +/* +This package is the root package of the govmomi library. + +The library is structured as follows: + +Package vim25 + +The minimal usable functionality is available through the vim25 package. +It contains subpackages that contain generated types, managed objects, and all +available methods. The vim25 package is entirely independent of the other +packages in the govmomi tree -- it has no dependencies on its peers. + +The vim25 package itself contains a client structure that is +passed around throughout the entire library. It abstracts a session and its +immutable state. See the vim25 package for more information. + +Package session + +The session package contains an abstraction for the session manager that allows +a user to login and logout. It also provides access to the current session +(i.e. to determine if the user is in fact logged in) + +Package object + +The object package contains wrappers for a selection of managed objects. The +constructors of these objects all take a *vim25.Client, which they pass along +to derived objects, if applicable. + +Package govc + +The govc package contains the govc CLI. The code in this tree is not intended +to be used as a library. Any functionality that govc contains that _could_ be +used as a library function but isn't, _should_ live in a root level package. + +Other packages + +Other packages, such as "event", "guest", or "license", provide wrappers for +the respective subsystems. They are typically not needed in normal workflows so +are kept outside the object package. +*/ +package govmomi + +import ( + "crypto/tls" + "net/url" + + "github.com/vmware/govmomi/property" + "github.com/vmware/govmomi/session" + "github.com/vmware/govmomi/vim25" + "github.com/vmware/govmomi/vim25/soap" + "github.com/vmware/govmomi/vim25/types" + "golang.org/x/net/context" +) + +type Client struct { + *vim25.Client + + SessionManager *session.Manager +} + +// NewClient creates a new client from a URL. The client authenticates with the +// server with username/password before returning if the URL contains user information. +func NewClient(ctx context.Context, u *url.URL, insecure bool) (*Client, error) { + soapClient := soap.NewClient(u, insecure) + vimClient, err := vim25.NewClient(ctx, soapClient) + if err != nil { + return nil, err + } + + c := &Client{ + Client: vimClient, + SessionManager: session.NewManager(vimClient), + } + + // Only login if the URL contains user information. + if u.User != nil { + err = c.Login(ctx, u.User) + if err != nil { + return nil, err + } + } + + return c, nil +} + +// NewClientWithCertificate creates a new client from a URL. The client authenticates with the +// server with the certificate before returning if the URL contains user information. +func NewClientWithCertificate(ctx context.Context, u *url.URL, insecure bool, cert tls.Certificate) (*Client, error) { + soapClient := soap.NewClient(u, insecure) + soapClient.SetCertificate(cert) + vimClient, err := vim25.NewClient(ctx, soapClient) + if err != nil { + return nil, err + } + + c := &Client{ + Client: vimClient, + SessionManager: session.NewManager(vimClient), + } + + if u.User != nil { + err = c.LoginExtensionByCertificate(ctx, u.User.Username(), "") + if err != nil { + return nil, err + } + } + + return c, nil +} + +// Login dispatches to the SessionManager. +func (c *Client) Login(ctx context.Context, u *url.Userinfo) error { + return c.SessionManager.Login(ctx, u) +} + +// Login dispatches to the SessionManager. +func (c *Client) LoginExtensionByCertificate(ctx context.Context, key string, locale string) error { + return c.SessionManager.LoginExtensionByCertificate(ctx, key, locale) +} + +// Logout dispatches to the SessionManager. +func (c *Client) Logout(ctx context.Context) error { + // Close any idle connections after logging out. + defer c.Client.CloseIdleConnections() + return c.SessionManager.Logout(ctx) +} + +// PropertyCollector returns the session's default property collector. +func (c *Client) PropertyCollector() *property.Collector { + return property.DefaultCollector(c.Client) +} + +// RetrieveOne dispatches to the Retrieve function on the default property collector. +func (c *Client) RetrieveOne(ctx context.Context, obj types.ManagedObjectReference, p []string, dst interface{}) error { + return c.PropertyCollector().RetrieveOne(ctx, obj, p, dst) +} + +// Retrieve dispatches to the Retrieve function on the default property collector. +func (c *Client) Retrieve(ctx context.Context, objs []types.ManagedObjectReference, p []string, dst interface{}) error { + return c.PropertyCollector().Retrieve(ctx, objs, p, dst) +} + +// Wait dispatches to property.Wait. +func (c *Client) Wait(ctx context.Context, obj types.ManagedObjectReference, ps []string, f func([]types.PropertyChange) bool) error { + return property.Wait(ctx, c.PropertyCollector(), obj, ps, f) +} + +// IsVC returns true if we are connected to a vCenter +func (c *Client) IsVC() bool { + return c.Client.IsVC() +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/client_test.go juju-core-2.0.2/src/github.com/vmware/govmomi/client_test.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/client_test.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/client_test.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,138 @@ +/* +Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package govmomi + +import ( + "errors" + "net/http" + "net/url" + "testing" + + "github.com/vmware/govmomi/test" + "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/types" + "golang.org/x/net/context" +) + +func TestNewClient(t *testing.T) { + u := test.URL() + if u == nil { + t.SkipNow() + } + + c, err := NewClient(context.Background(), u, true) + if err != nil { + t.Fatal(err) + } + + f := func() error { + var x mo.Folder + err = mo.RetrieveProperties(context.Background(), c, c.ServiceContent.PropertyCollector, c.ServiceContent.RootFolder, &x) + if err != nil { + return err + } + if len(x.Name) == 0 { + return errors.New("empty response") + } + return nil + } + + // check cookie is valid with an sdk request + if err := f(); err != nil { + t.Fatal(err) + } + + // check cookie is valid with a non-sdk request + u.User = nil // turn off Basic auth + u.Path = "/folder" + r, err := c.Client.Get(u.String()) + if err != nil { + t.Fatal(err) + } + if r.StatusCode != http.StatusOK { + t.Fatal(r) + } + + // sdk request should fail w/o a valid cookie + c.Client.Jar = nil + if err := f(); err == nil { + t.Fatal("should fail") + } + + // invalid login + u.Path = "/sdk" + u.User = url.UserPassword("ENOENT", "EINVAL") + _, err = NewClient(context.Background(), u, true) + if err == nil { + t.Fatal("should fail") + } +} + +func TestInvalidSdk(t *testing.T) { + u := test.URL() + if u == nil { + t.SkipNow() + } + + // a URL other than a valid /sdk should error, not panic + u.Path = "/mob" + _, err := NewClient(context.Background(), u, true) + if err == nil { + t.Fatal("should fail") + } +} + +func TestPropertiesN(t *testing.T) { + u := test.URL() + if u == nil { + t.SkipNow() + } + + c, err := NewClient(context.Background(), u, true) + if err != nil { + t.Fatal(err) + } + + var f mo.Folder + err = c.RetrieveOne(context.Background(), c.ServiceContent.RootFolder, nil, &f) + if err != nil { + t.Fatal(err) + } + + var dc mo.Datacenter + err = c.RetrieveOne(context.Background(), f.ChildEntity[0], nil, &dc) + if err != nil { + t.Fatal(err) + } + + var folderReferences = []types.ManagedObjectReference{ + dc.DatastoreFolder, + dc.HostFolder, + dc.NetworkFolder, + dc.VmFolder, + } + + var folders []mo.Folder + err = c.Retrieve(context.Background(), folderReferences, []string{"name"}, &folders) + if err != nil { + t.Fatal(err) + } + + if len(folders) != len(folderReferences) { + t.Fatalf("Expected %d, got %d", len(folderReferences), len(folders)) + } +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/CONTRIBUTING.md juju-core-2.0.2/src/github.com/vmware/govmomi/CONTRIBUTING.md --- juju-core-2.0.0/src/github.com/vmware/govmomi/CONTRIBUTING.md 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/CONTRIBUTING.md 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,91 @@ +# Contributing to govmomi + +## Getting started + +First, fork the repository on GitHub to your personal account. + +Note that _GOPATH_ can be any directory, the example below uses _$HOME/govmomi_. +Change _$USER_ below to your github username if they are not the same. + +``` shell +export GOPATH=$HOME/govmomi +go get github.com/vmware/govmomi +cd $GOPATH/src/github.com/vmware/govmomi +git config push.default nothing # anything to avoid pushing to vmware/govmomi by default +git remote rename origin vmware +git remote add $USER git@github.com:$USER/govmomi.git +git fetch $USER +``` + +## Contribution flow + +This is a rough outline of what a contributor's workflow looks like: + +- Create a topic branch from where you want to base your work. +- Make commits of logical units. +- Make sure your commit messages are in the proper format (see below). +- Update CHANGELOG.md and/or govc/CHANGELOG.md when appropriate. +- Push your changes to a topic branch in your fork of the repository. +- Submit a pull request to vmware/govmomi. + +Example: + +``` shell +git checkout -b my-new-feature vmware/master +git commit -a +git push $USER my-new-feature +``` + +### Stay in sync with upstream + +When your branch gets out of sync with the vmware/master branch, use the following to update: + +``` shell +git checkout my-new-feature +git fetch -a +git rebase vmware/master +git push --force-with-lease $USER my-new-feature +``` + +### Updating pull requests + +If your PR fails to pass CI or needs changes based on code review, you'll most likely want to squash these changes into +existing commits. + +If your pull request contains a single commit or your changes are related to the most recent commit, you can simply +amend the commit. + +``` shell +git add . +git commit --amend +git push --force-with-lease $USER my-new-feature +``` + +If you need to squash changes into an earlier commit, you can use: + +``` shell +git add . +git commit --fixup +git rebase -i --autosquash vmware/master +git push --force-with-lease $USER my-new-feature +``` + +Be sure to add a comment to the PR indicating your new changes are ready to review, as github does not generate a +notification when you git push. + +### Code style + +The coding style suggested by the Golang community is used in govmomi. See the +[style doc](https://github.com/golang/go/wiki/CodeReviewComments) for details. + +Try to limit column width to 120 characters for both code and markdown documents such as this one. + +### Format of the Commit Message + +We follow the conventions on [How to Write a Git Commit Message](http://chris.beams.io/posts/git-commit/). + +Be sure to include any related GitHub issue references in the commit message. + +## Reporting Bugs and Creating Issues + +When opening a new issue, try to roughly follow the commit message format conventions above. diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/CONTRIBUTORS juju-core-2.0.2/src/github.com/vmware/govmomi/CONTRIBUTORS --- juju-core-2.0.0/src/github.com/vmware/govmomi/CONTRIBUTORS 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/CONTRIBUTORS 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,41 @@ +# People who can (and typically have) contributed to this repository. +# +# Please keep the list sorted. +# + +Alvaro Miranda +Amit Bathla +Andrew Chin +Arran Walker +Austin Parker +Bob Killen +Bruce Downs +Cédric Blomart +Christian Höltje +Clint Greenwood +Danny Lockard +Dave Tucker +David Stark +Doug MacEachern +Eloy Coto +Eric Yutao +Fabio Rapposelli +Faiyaz Ahmed +Gavin Gray +Gavrie Philipson +George Hicken +Gerrit Renker +gthombare +Isaac Rodman +Louie Jiang +Mevan Samaratunga +Pieter Noordhuis +runner.mei +S.Çağlar Onur +Sergey Ignatov +Steve Purcell +Takaaki Furukawa +Yang Yang +Yuya Kusakabe +Zach Tucker +Zee Yang diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/.drone.sec juju-core-2.0.2/src/github.com/vmware/govmomi/.drone.sec --- juju-core-2.0.0/src/github.com/vmware/govmomi/.drone.sec 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/.drone.sec 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1 @@ +eyJhbGciOiJSU0EtT0FFUCIsImVuYyI6IkExMjhHQ00ifQ.kK6pryC8R-O1R0Gj9ydLvQuIZlcYLGze23WdW7xbpiEEKdz6nweJrMm7ysy8lgu1tM47JVo19p2_b26bNKSQshCUOETvd7Hb2UMZOjnyUnqdyAAyoi6UkIquXfUUbHTNS0iMxwSxxW9KMp2GXNq8-o6T8xQZTDirBJFKKd8ZNUasTaoa5j8U9IfdR1aCavTBuOhvk8IVs-jSbY5TVJMJiE0IOPXois7aRJ6uAiANQBk9VKLegEcZD_qAewecXHDsHi-u0jbmg3o3PPaJaK_Qv5dsPlR2M-E2kE3AGUn0-zn5zYRngoAZ8WZr2O4GvLdltJKq9i2z7jOrdOzzRcDRow.96qvwl_E1Hj15u7Q.hWs-jQ8FsqQFD7pE9N-UEP1BWQ9rsJIcCaPvQRIp8Fukm_vvlw9YEaEq0ERLrsUWsJWpd1ca8_h8x7xD6f_d5YppwRqRHIeGIsdBOTMhNs0lG8ikkQXLat-UroCpy8EC17nuUtDE2E2Kdxrk4Cdd6Bk-dKk0Ta4w3Ud0YBKa.P8zrO7xizgv0i98eVWWzEg \ No newline at end of file diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/.drone.yml juju-core-2.0.2/src/github.com/vmware/govmomi/.drone.yml --- juju-core-2.0.0/src/github.com/vmware/govmomi/.drone.yml 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/.drone.yml 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,17 @@ +clone: + tags: true + path: github.com/vmware/govmomi +build: + image: golang:1.6 + pull: true + environment: + - GOVC_TEST_URL=$$GOVC_TEST_URL + - GOVC_INSECURE=1 + - VCA=1 + commands: + - make all install + - git clone https://github.com/sstephenson/bats.git /tmp/bats + - /tmp/bats/install.sh /usr/local + - apt-get -qq update && apt-get install -yqq uuid-runtime bsdmainutils jq + - govc/test/images/update.sh + - bats govc/test diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/event/helper.go juju-core-2.0.2/src/github.com/vmware/govmomi/event/helper.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/event/helper.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/event/helper.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,116 @@ +/* +Copyright (c) 2016 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package event + +import ( + "fmt" + + "golang.org/x/net/context" + + "github.com/vmware/govmomi/property" + "github.com/vmware/govmomi/view" + "github.com/vmware/govmomi/vim25/types" +) + +func multipleObjectEvents(ctx context.Context, m Manager, objects []types.ManagedObjectReference, pageSize int32, tail bool, force bool, prop []string, f func([]types.BaseEvent) error) error { + // create an EventHistoryCollector for each object + var collectors []types.ManagedObjectReference + for _, o := range objects { + filter := types.EventFilterSpec{ + Entity: &types.EventFilterSpecByEntity{ + Entity: o, + Recursion: types.EventFilterSpecRecursionOptionAll, + }, + } + + collector, err := m.CreateCollectorForEvents(ctx, filter) + if err != nil { + return fmt.Errorf("[%#v] %s", o, err) + } + defer collector.Destroy(ctx) + + err = collector.SetPageSize(ctx, pageSize) + if err != nil { + return err + } + + collectors = append(collectors, collector.Reference()) + } + + // create and populate a ListView + viewMgr := view.NewManager(m.Client()) + listView, err := viewMgr.CreateListView(ctx, collectors) + if err != nil { + return err + } + count := 0 + // Retrieve the property from the objects in the ListView + return property.WaitForView(ctx, property.DefaultCollector(m.Client()), listView.Reference(), collectors[0], prop, func(pc []types.PropertyChange) bool { + for _, u := range pc { + if u.Name != prop[0] { + continue + } + if u.Val == nil { + continue + } + f(u.Val.(types.ArrayOfEvent).Event) + } + count++ + if count == len(collectors) && !tail { + return true + } + return false + }) + +} + +func singleObjectEvents(ctx context.Context, m Manager, object types.ManagedObjectReference, pageSize int32, tail bool, force bool, prop []string, f func([]types.BaseEvent) error) error { + filter := types.EventFilterSpec{ + Entity: &types.EventFilterSpecByEntity{ + Entity: object, + Recursion: types.EventFilterSpecRecursionOptionAll, + }, + } + + collector, err := m.CreateCollectorForEvents(ctx, filter) + if err != nil { + return fmt.Errorf("[%#v] %s", object, err) + } + defer collector.Destroy(ctx) + + err = collector.SetPageSize(ctx, pageSize) + if err != nil { + return err + } + + return property.Wait(ctx, property.DefaultCollector(m.Client()), collector.Reference(), prop, func(pc []types.PropertyChange) bool { + for _, u := range pc { + if u.Name != prop[0] { + continue + } + if u.Val == nil { + continue + } + f(u.Val.(types.ArrayOfEvent).Event) + + } + if !tail { + return true + } + return false + }) +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/event/history_collector.go juju-core-2.0.2/src/github.com/vmware/govmomi/event/history_collector.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/event/history_collector.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/event/history_collector.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,75 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package event + +import ( + "github.com/vmware/govmomi/object" + "github.com/vmware/govmomi/vim25" + "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/types" + "golang.org/x/net/context" +) + +type HistoryCollector struct { + *object.HistoryCollector +} + +func NewHistoryCollector(c *vim25.Client, ref types.ManagedObjectReference) *HistoryCollector { + return &HistoryCollector{ + HistoryCollector: object.NewHistoryCollector(c, ref), + } +} + +func (h HistoryCollector) LatestPage(ctx context.Context) ([]types.BaseEvent, error) { + var o mo.EventHistoryCollector + + err := h.Properties(ctx, h.Reference(), []string{"latestPage"}, &o) + if err != nil { + return nil, err + } + + return o.LatestPage, nil +} + +func (h HistoryCollector) ReadNextEvents(ctx context.Context, maxCount int32) ([]types.BaseEvent, error) { + req := types.ReadNextEvents{ + This: h.Reference(), + MaxCount: maxCount, + } + + res, err := methods.ReadNextEvents(ctx, h.Client(), &req) + if err != nil { + return nil, err + } + + return res.Returnval, nil +} + +func (h HistoryCollector) ReadPreviousEvents(ctx context.Context, maxCount int32) ([]types.BaseEvent, error) { + req := types.ReadPreviousEvents{ + This: h.Reference(), + MaxCount: maxCount, + } + + res, err := methods.ReadPreviousEvents(ctx, h.Client(), &req) + if err != nil { + return nil, err + } + + return res.Returnval, nil +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/event/manager.go juju-core-2.0.2/src/github.com/vmware/govmomi/event/manager.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/event/manager.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/event/manager.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,180 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package event + +import ( + "fmt" + "reflect" + "sync" + + "github.com/vmware/govmomi/object" + "github.com/vmware/govmomi/property" + "github.com/vmware/govmomi/vim25" + "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/types" + "golang.org/x/net/context" +) + +type Manager struct { + object.Common + + eventCategory map[string]string + eventCategoryMu *sync.Mutex + maxObjects int +} + +func NewManager(c *vim25.Client) *Manager { + m := Manager{ + Common: object.NewCommon(c, *c.ServiceContent.EventManager), + + eventCategory: make(map[string]string), + eventCategoryMu: new(sync.Mutex), + maxObjects: 10, + } + + return &m +} + +func (m Manager) CreateCollectorForEvents(ctx context.Context, filter types.EventFilterSpec) (*HistoryCollector, error) { + req := types.CreateCollectorForEvents{ + This: m.Common.Reference(), + Filter: filter, + } + + res, err := methods.CreateCollectorForEvents(ctx, m.Client(), &req) + if err != nil { + return nil, err + } + + return NewHistoryCollector(m.Client(), res.Returnval), nil +} + +func (m Manager) LogUserEvent(ctx context.Context, entity types.ManagedObjectReference, msg string) error { + req := types.LogUserEvent{ + This: m.Common.Reference(), + Entity: entity, + Msg: msg, + } + + _, err := methods.LogUserEvent(ctx, m.Client(), &req) + if err != nil { + return err + } + + return nil +} + +func (m Manager) PostEvent(ctx context.Context, eventToPost types.BaseEvent, taskInfo types.TaskInfo) error { + req := types.PostEvent{ + This: m.Common.Reference(), + EventToPost: eventToPost, + TaskInfo: &taskInfo, + } + + _, err := methods.PostEvent(ctx, m.Client(), &req) + if err != nil { + return err + } + + return nil +} + +func (m Manager) QueryEvents(ctx context.Context, filter types.EventFilterSpec) ([]types.BaseEvent, error) { + req := types.QueryEvents{ + This: m.Common.Reference(), + Filter: filter, + } + + res, err := methods.QueryEvents(ctx, m.Client(), &req) + if err != nil { + return nil, err + } + + return res.Returnval, nil +} + +func (m Manager) RetrieveArgumentDescription(ctx context.Context, eventTypeID string) ([]types.EventArgDesc, error) { + req := types.RetrieveArgumentDescription{ + This: m.Common.Reference(), + EventTypeId: eventTypeID, + } + + res, err := methods.RetrieveArgumentDescription(ctx, m.Client(), &req) + if err != nil { + return nil, err + } + + return res.Returnval, nil +} + +func (m Manager) eventCategoryMap(ctx context.Context) (map[string]string, error) { + m.eventCategoryMu.Lock() + defer m.eventCategoryMu.Unlock() + + if len(m.eventCategory) != 0 { + return m.eventCategory, nil + } + + var o mo.EventManager + + ps := []string{"description.eventInfo"} + err := property.DefaultCollector(m.Client()).RetrieveOne(ctx, m.Common.Reference(), ps, &o) + if err != nil { + return nil, err + } + + for _, info := range o.Description.EventInfo { + m.eventCategory[info.Key] = info.Category + } + + return m.eventCategory, nil +} + +// EventCategory returns the category for an event, such as "info" or "error" for example. +func (m Manager) EventCategory(ctx context.Context, event types.BaseEvent) (string, error) { + // Most of the event details are included in the Event.FullFormattedMessage, but the category + // is only available via the EventManager description.eventInfo property. The value of this + // property is static, so we fetch and once and cache. + eventCategory, err := m.eventCategoryMap(ctx) + if err != nil { + return "", err + } + + class := reflect.TypeOf(event).Elem().Name() + + return eventCategory[class], nil +} + +// Get the events from the specified object(s) and optionanlly tail the event stream +func (m Manager) Events(ctx context.Context, objects []types.ManagedObjectReference, pageSize int32, tail bool, force bool, f func([]types.BaseEvent) error) error { + + if len(objects) >= m.maxObjects && !force { + return fmt.Errorf("Maximum number of objects to monitor (%d) exceeded, refine search \n", m.maxObjects) + } + + // property that will be monitored + prop := []string{"latestPage"} + + // call to helper functions to reduce the number of temporary objects + if len(objects) > 1 { + return multipleObjectEvents(ctx, m, objects, pageSize, tail, force, prop, f) + } + + return singleObjectEvents(ctx, m, objects[0], pageSize, tail, force, prop, f) + +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/event/sort.go juju-core-2.0.2/src/github.com/vmware/govmomi/event/sort.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/event/sort.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/event/sort.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,45 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package event + +import ( + "sort" + + "github.com/vmware/govmomi/vim25/types" +) + +// Sort events in accending order base on Key +// From the EventHistoryCollector.latestPage sdk docs: +// The "oldest event" is the one with the smallest key (event ID). +// The events in the returned page are unordered. +func Sort(events []types.BaseEvent) { + sort.Sort(baseEvent(events)) +} + +type baseEvent []types.BaseEvent + +func (d baseEvent) Len() int { + return len(d) +} + +func (d baseEvent) Less(i, j int) bool { + return d[i].GetEvent().Key < d[j].GetEvent().Key +} + +func (d baseEvent) Swap(i, j int) { + d[i], d[j] = d[j], d[i] +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/examples/datastores/main.go juju-core-2.0.2/src/github.com/vmware/govmomi/examples/datastores/main.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/examples/datastores/main.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/examples/datastores/main.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,180 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +/* +This example program shows how the `finder` and `property` packages can +be used to navigate a vSphere inventory structure using govmomi. +*/ + +package main + +import ( + "flag" + "fmt" + "net/url" + "os" + "strings" + "text/tabwriter" + + "github.com/vmware/govmomi" + "github.com/vmware/govmomi/find" + "github.com/vmware/govmomi/property" + "github.com/vmware/govmomi/units" + "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/types" + "golang.org/x/net/context" +) + +// GetEnvString returns string from environment variable. +func GetEnvString(v string, def string) string { + r := os.Getenv(v) + if r == "" { + return def + } + + return r +} + +// GetEnvBool returns boolean from environment variable. +func GetEnvBool(v string, def bool) bool { + r := os.Getenv(v) + if r == "" { + return def + } + + switch strings.ToLower(r[0:1]) { + case "t", "y", "1": + return true + } + + return false +} + +const ( + envURL = "GOVMOMI_URL" + envUserName = "GOVMOMI_USERNAME" + envPassword = "GOVMOMI_PASSWORD" + envInsecure = "GOVMOMI_INSECURE" +) + +var urlDescription = fmt.Sprintf("ESX or vCenter URL [%s]", envURL) +var urlFlag = flag.String("url", GetEnvString(envURL, "https://username:password@host/sdk"), urlDescription) + +var insecureDescription = fmt.Sprintf("Don't verify the server's certificate chain [%s]", envInsecure) +var insecureFlag = flag.Bool("insecure", GetEnvBool(envInsecure, false), insecureDescription) + +func processOverride(u *url.URL) { + envUsername := os.Getenv(envUserName) + envPassword := os.Getenv(envPassword) + + // Override username if provided + if envUsername != "" { + var password string + var ok bool + + if u.User != nil { + password, ok = u.User.Password() + } + + if ok { + u.User = url.UserPassword(envUsername, password) + } else { + u.User = url.User(envUsername) + } + } + + // Override password if provided + if envPassword != "" { + var username string + + if u.User != nil { + username = u.User.Username() + } + + u.User = url.UserPassword(username, envPassword) + } +} + +func exit(err error) { + fmt.Fprintf(os.Stderr, "Error: %s\n", err) + os.Exit(1) +} + +func main() { + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + + flag.Parse() + + // Parse URL from string + u, err := url.Parse(*urlFlag) + if err != nil { + exit(err) + } + + // Override username and/or password as required + processOverride(u) + + // Connect and log in to ESX or vCenter + c, err := govmomi.NewClient(ctx, u, *insecureFlag) + if err != nil { + exit(err) + } + + f := find.NewFinder(c.Client, true) + + // Find one and only datacenter + dc, err := f.DefaultDatacenter(ctx) + if err != nil { + exit(err) + } + + // Make future calls local to this datacenter + f.SetDatacenter(dc) + + // Find datastores in datacenter + dss, err := f.DatastoreList(ctx, "*") + if err != nil { + exit(err) + } + + pc := property.DefaultCollector(c.Client) + + // Convert datastores into list of references + var refs []types.ManagedObjectReference + for _, ds := range dss { + refs = append(refs, ds.Reference()) + } + + // Retrieve summary property for all datastores + var dst []mo.Datastore + err = pc.Retrieve(ctx, refs, []string{"summary"}, &dst) + if err != nil { + exit(err) + } + + // Print summary per datastore + tw := tabwriter.NewWriter(os.Stdout, 2, 0, 2, ' ', 0) + fmt.Fprintf(tw, "Name:\tType:\tCapacity:\tFree:\n") + for _, ds := range dst { + fmt.Fprintf(tw, "%s\t", ds.Summary.Name) + fmt.Fprintf(tw, "%s\t", ds.Summary.Type) + fmt.Fprintf(tw, "%s\t", units.ByteSize(ds.Summary.Capacity)) + fmt.Fprintf(tw, "%s\t", units.ByteSize(ds.Summary.FreeSpace)) + fmt.Fprintf(tw, "\n") + } + tw.Flush() +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/find/error.go juju-core-2.0.2/src/github.com/vmware/govmomi/find/error.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/find/error.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/find/error.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,64 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package find + +import "fmt" + +type NotFoundError struct { + kind string + path string +} + +func (e *NotFoundError) Error() string { + return fmt.Sprintf("%s '%s' not found", e.kind, e.path) +} + +type MultipleFoundError struct { + kind string + path string +} + +func (e *MultipleFoundError) Error() string { + return fmt.Sprintf("path '%s' resolves to multiple %ss", e.path, e.kind) +} + +type DefaultNotFoundError struct { + kind string +} + +func (e *DefaultNotFoundError) Error() string { + return fmt.Sprintf("no default %s found", e.kind) +} + +type DefaultMultipleFoundError struct { + kind string +} + +func (e DefaultMultipleFoundError) Error() string { + return fmt.Sprintf("default %s resolves to multiple instances, please specify", e.kind) +} + +func toDefaultError(err error) error { + switch e := err.(type) { + case *NotFoundError: + return &DefaultNotFoundError{e.kind} + case *MultipleFoundError: + return &DefaultMultipleFoundError{e.kind} + default: + return err + } +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/find/finder.go juju-core-2.0.2/src/github.com/vmware/govmomi/find/finder.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/find/finder.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/find/finder.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,848 @@ +/* +Copyright (c) 2014-2016 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package find + +import ( + "errors" + "path" + + "github.com/vmware/govmomi/list" + "github.com/vmware/govmomi/object" + "github.com/vmware/govmomi/property" + "github.com/vmware/govmomi/vim25" + "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/types" + "golang.org/x/net/context" +) + +type Finder struct { + client *vim25.Client + recurser list.Recurser + + dc *object.Datacenter + folders *object.DatacenterFolders +} + +func NewFinder(client *vim25.Client, all bool) *Finder { + f := &Finder{ + client: client, + recurser: list.Recurser{ + Collector: property.DefaultCollector(client), + All: all, + }, + } + + return f +} + +func (f *Finder) SetDatacenter(dc *object.Datacenter) *Finder { + f.dc = dc + f.folders = nil + return f +} + +type findRelativeFunc func(ctx context.Context) (object.Reference, error) + +func (f *Finder) find(ctx context.Context, fn findRelativeFunc, tl bool, arg string) ([]list.Element, error) { + root := list.Element{ + Path: "/", + Object: object.NewRootFolder(f.client), + } + + parts := list.ToParts(arg) + + if len(parts) > 0 { + switch parts[0] { + case "..": // Not supported; many edge case, little value + return nil, errors.New("cannot traverse up a tree") + case ".": // Relative to whatever + pivot, err := fn(ctx) + if err != nil { + return nil, err + } + + mes, err := mo.Ancestors(ctx, f.client, f.client.ServiceContent.PropertyCollector, pivot.Reference()) + if err != nil { + return nil, err + } + + for _, me := range mes { + // Skip root entity in building inventory path. + if me.Parent == nil { + continue + } + root.Path = path.Join(root.Path, me.Name) + } + + root.Object = pivot + parts = parts[1:] + } + } + + f.recurser.TraverseLeafs = tl + es, err := f.recurser.Recurse(ctx, root, parts) + if err != nil { + return nil, err + } + + return es, nil +} + +func (f *Finder) datacenter() (*object.Datacenter, error) { + if f.dc == nil { + return nil, errors.New("please specify a datacenter") + } + + return f.dc, nil +} + +func (f *Finder) dcFolders(ctx context.Context) (*object.DatacenterFolders, error) { + if f.folders != nil { + return f.folders, nil + } + + dc, err := f.datacenter() + if err != nil { + return nil, err + } + + folders, err := dc.Folders(ctx) + if err != nil { + return nil, err + } + + f.folders = folders + + return f.folders, nil +} + +func (f *Finder) dcReference(_ context.Context) (object.Reference, error) { + dc, err := f.datacenter() + if err != nil { + return nil, err + } + + return dc, nil +} + +func (f *Finder) vmFolder(ctx context.Context) (object.Reference, error) { + folders, err := f.dcFolders(ctx) + if err != nil { + return nil, err + } + + return folders.VmFolder, nil +} + +func (f *Finder) hostFolder(ctx context.Context) (object.Reference, error) { + folders, err := f.dcFolders(ctx) + if err != nil { + return nil, err + } + + return folders.HostFolder, nil +} + +func (f *Finder) datastoreFolder(ctx context.Context) (object.Reference, error) { + folders, err := f.dcFolders(ctx) + if err != nil { + return nil, err + } + + return folders.DatastoreFolder, nil +} + +func (f *Finder) networkFolder(ctx context.Context) (object.Reference, error) { + folders, err := f.dcFolders(ctx) + if err != nil { + return nil, err + } + + return folders.NetworkFolder, nil +} + +func (f *Finder) rootFolder(_ context.Context) (object.Reference, error) { + return object.NewRootFolder(f.client), nil +} + +func (f *Finder) managedObjectList(ctx context.Context, path string, tl bool) ([]list.Element, error) { + fn := f.rootFolder + + if f.dc != nil { + fn = f.dcReference + } + + if len(path) == 0 { + path = "." + } + + return f.find(ctx, fn, tl, path) +} + +// Element returns an Element for the given ManagedObjectReference +// This method is only useful for looking up the InventoryPath of a ManagedObjectReference. +func (f *Finder) Element(ctx context.Context, ref types.ManagedObjectReference) (*list.Element, error) { + rl := func(_ context.Context) (object.Reference, error) { + return ref, nil + } + + e, err := f.find(ctx, rl, false, ".") + if err != nil { + return nil, err + } + + if len(e) == 0 { + return nil, &NotFoundError{ref.Type, ref.Value} + } + + if len(e) > 1 { + panic("ManagedObjectReference must be unique") + } + + return &e[0], nil +} + +// ObjectReference converts the given ManagedObjectReference to a type from the object package via object.NewReference +// with the object.Common.InventoryPath field set. +func (f *Finder) ObjectReference(ctx context.Context, ref types.ManagedObjectReference) (object.Reference, error) { + e, err := f.Element(ctx, ref) + if err != nil { + return nil, err + } + + r := object.NewReference(f.client, ref) + + type common interface { + SetInventoryPath(string) + } + + r.(common).SetInventoryPath(e.Path) + + return r, nil +} + +func (f *Finder) ManagedObjectList(ctx context.Context, path string) ([]list.Element, error) { + return f.managedObjectList(ctx, path, false) +} + +func (f *Finder) ManagedObjectListChildren(ctx context.Context, path string) ([]list.Element, error) { + return f.managedObjectList(ctx, path, true) +} + +func (f *Finder) DatacenterList(ctx context.Context, path string) ([]*object.Datacenter, error) { + es, err := f.find(ctx, f.rootFolder, false, path) + if err != nil { + return nil, err + } + + var dcs []*object.Datacenter + for _, e := range es { + ref := e.Object.Reference() + if ref.Type == "Datacenter" { + dc := object.NewDatacenter(f.client, ref) + dc.InventoryPath = e.Path + dcs = append(dcs, dc) + } + } + + if len(dcs) == 0 { + return nil, &NotFoundError{"datacenter", path} + } + + return dcs, nil +} + +func (f *Finder) Datacenter(ctx context.Context, path string) (*object.Datacenter, error) { + dcs, err := f.DatacenterList(ctx, path) + if err != nil { + return nil, err + } + + if len(dcs) > 1 { + return nil, &MultipleFoundError{"datacenter", path} + } + + return dcs[0], nil +} + +func (f *Finder) DefaultDatacenter(ctx context.Context) (*object.Datacenter, error) { + dc, err := f.Datacenter(ctx, "*") + if err != nil { + return nil, toDefaultError(err) + } + + return dc, nil +} + +func (f *Finder) DatacenterOrDefault(ctx context.Context, path string) (*object.Datacenter, error) { + if path != "" { + dc, err := f.Datacenter(ctx, path) + if err != nil { + return nil, err + } + return dc, nil + } + + return f.DefaultDatacenter(ctx) +} + +func (f *Finder) DatastoreList(ctx context.Context, path string) ([]*object.Datastore, error) { + es, err := f.find(ctx, f.datastoreFolder, false, path) + if err != nil { + return nil, err + } + + var dss []*object.Datastore + for _, e := range es { + ref := e.Object.Reference() + if ref.Type == "Datastore" { + ds := object.NewDatastore(f.client, ref) + ds.InventoryPath = e.Path + + dss = append(dss, ds) + } + } + + if len(dss) == 0 { + return nil, &NotFoundError{"datastore", path} + } + + return dss, nil +} + +func (f *Finder) Datastore(ctx context.Context, path string) (*object.Datastore, error) { + dss, err := f.DatastoreList(ctx, path) + if err != nil { + return nil, err + } + + if len(dss) > 1 { + return nil, &MultipleFoundError{"datastore", path} + } + + return dss[0], nil +} + +func (f *Finder) DefaultDatastore(ctx context.Context) (*object.Datastore, error) { + ds, err := f.Datastore(ctx, "*") + if err != nil { + return nil, toDefaultError(err) + } + + return ds, nil +} + +func (f *Finder) DatastoreOrDefault(ctx context.Context, path string) (*object.Datastore, error) { + if path != "" { + ds, err := f.Datastore(ctx, path) + if err != nil { + return nil, err + } + return ds, nil + } + + return f.DefaultDatastore(ctx) +} + +func (f *Finder) DatastoreClusterList(ctx context.Context, path string) ([]*object.StoragePod, error) { + es, err := f.find(ctx, f.datastoreFolder, false, path) + if err != nil { + return nil, err + } + + var sps []*object.StoragePod + for _, e := range es { + ref := e.Object.Reference() + if ref.Type == "StoragePod" { + sp := object.NewStoragePod(f.client, ref) + sp.InventoryPath = e.Path + sps = append(sps, sp) + } + } + + if len(sps) == 0 { + return nil, &NotFoundError{"datastore cluster", path} + } + + return sps, nil +} + +func (f *Finder) DatastoreCluster(ctx context.Context, path string) (*object.StoragePod, error) { + sps, err := f.DatastoreClusterList(ctx, path) + if err != nil { + return nil, err + } + + if len(sps) > 1 { + return nil, &MultipleFoundError{"datastore cluster", path} + } + + return sps[0], nil +} + +func (f *Finder) DefaultDatastoreCluster(ctx context.Context) (*object.StoragePod, error) { + sp, err := f.DatastoreCluster(ctx, "*") + if err != nil { + return nil, toDefaultError(err) + } + + return sp, nil +} + +func (f *Finder) DatastoreClusterOrDefault(ctx context.Context, path string) (*object.StoragePod, error) { + if path != "" { + sp, err := f.DatastoreCluster(ctx, path) + if err != nil { + return nil, err + } + return sp, nil + } + + return f.DefaultDatastoreCluster(ctx) +} + +func (f *Finder) ComputeResourceList(ctx context.Context, path string) ([]*object.ComputeResource, error) { + es, err := f.find(ctx, f.hostFolder, false, path) + if err != nil { + return nil, err + } + + var crs []*object.ComputeResource + for _, e := range es { + var cr *object.ComputeResource + + switch o := e.Object.(type) { + case mo.ComputeResource, mo.ClusterComputeResource: + cr = object.NewComputeResource(f.client, o.Reference()) + default: + continue + } + + cr.InventoryPath = e.Path + crs = append(crs, cr) + } + + if len(crs) == 0 { + return nil, &NotFoundError{"compute resource", path} + } + + return crs, nil +} + +func (f *Finder) ComputeResource(ctx context.Context, path string) (*object.ComputeResource, error) { + crs, err := f.ComputeResourceList(ctx, path) + if err != nil { + return nil, err + } + + if len(crs) > 1 { + return nil, &MultipleFoundError{"compute resource", path} + } + + return crs[0], nil +} + +func (f *Finder) DefaultComputeResource(ctx context.Context) (*object.ComputeResource, error) { + cr, err := f.ComputeResource(ctx, "*") + if err != nil { + return nil, toDefaultError(err) + } + + return cr, nil +} + +func (f *Finder) ComputeResourceOrDefault(ctx context.Context, path string) (*object.ComputeResource, error) { + if path != "" { + cr, err := f.ComputeResource(ctx, path) + if err != nil { + return nil, err + } + return cr, nil + } + + return f.DefaultComputeResource(ctx) +} + +func (f *Finder) ClusterComputeResourceList(ctx context.Context, path string) ([]*object.ClusterComputeResource, error) { + es, err := f.find(ctx, f.hostFolder, false, path) + if err != nil { + return nil, err + } + + var ccrs []*object.ClusterComputeResource + for _, e := range es { + var ccr *object.ClusterComputeResource + + switch o := e.Object.(type) { + case mo.ClusterComputeResource: + ccr = object.NewClusterComputeResource(f.client, o.Reference()) + default: + continue + } + + ccr.InventoryPath = e.Path + ccrs = append(ccrs, ccr) + } + + if len(ccrs) == 0 { + return nil, &NotFoundError{"cluster", path} + } + + return ccrs, nil +} + +func (f *Finder) ClusterComputeResource(ctx context.Context, path string) (*object.ClusterComputeResource, error) { + ccrs, err := f.ClusterComputeResourceList(ctx, path) + if err != nil { + return nil, err + } + + if len(ccrs) > 1 { + return nil, &MultipleFoundError{"cluster", path} + } + + return ccrs[0], nil +} + +func (f *Finder) HostSystemList(ctx context.Context, path string) ([]*object.HostSystem, error) { + es, err := f.find(ctx, f.hostFolder, false, path) + if err != nil { + return nil, err + } + + var hss []*object.HostSystem + for _, e := range es { + var hs *object.HostSystem + + switch o := e.Object.(type) { + case mo.HostSystem: + hs = object.NewHostSystem(f.client, o.Reference()) + + hs.InventoryPath = e.Path + hss = append(hss, hs) + case mo.ComputeResource, mo.ClusterComputeResource: + cr := object.NewComputeResource(f.client, o.Reference()) + + cr.InventoryPath = e.Path + + hosts, err := cr.Hosts(ctx) + if err != nil { + return nil, err + } + + hss = append(hss, hosts...) + } + } + + if len(hss) == 0 { + return nil, &NotFoundError{"host", path} + } + + return hss, nil +} + +func (f *Finder) HostSystem(ctx context.Context, path string) (*object.HostSystem, error) { + hss, err := f.HostSystemList(ctx, path) + if err != nil { + return nil, err + } + + if len(hss) > 1 { + return nil, &MultipleFoundError{"host", path} + } + + return hss[0], nil +} + +func (f *Finder) DefaultHostSystem(ctx context.Context) (*object.HostSystem, error) { + hs, err := f.HostSystem(ctx, "*/*") + if err != nil { + return nil, toDefaultError(err) + } + + return hs, nil +} + +func (f *Finder) HostSystemOrDefault(ctx context.Context, path string) (*object.HostSystem, error) { + if path != "" { + hs, err := f.HostSystem(ctx, path) + if err != nil { + return nil, err + } + return hs, nil + } + + return f.DefaultHostSystem(ctx) +} + +func (f *Finder) NetworkList(ctx context.Context, path string) ([]object.NetworkReference, error) { + es, err := f.find(ctx, f.networkFolder, false, path) + if err != nil { + return nil, err + } + + var ns []object.NetworkReference + for _, e := range es { + ref := e.Object.Reference() + switch ref.Type { + case "Network": + r := object.NewNetwork(f.client, ref) + r.InventoryPath = e.Path + ns = append(ns, r) + case "DistributedVirtualPortgroup": + r := object.NewDistributedVirtualPortgroup(f.client, ref) + r.InventoryPath = e.Path + ns = append(ns, r) + case "DistributedVirtualSwitch", "VmwareDistributedVirtualSwitch": + r := object.NewDistributedVirtualSwitch(f.client, ref) + r.InventoryPath = e.Path + ns = append(ns, r) + } + } + + if len(ns) == 0 { + return nil, &NotFoundError{"network", path} + } + + return ns, nil +} + +func (f *Finder) Network(ctx context.Context, path string) (object.NetworkReference, error) { + networks, err := f.NetworkList(ctx, path) + if err != nil { + return nil, err + } + + if len(networks) > 1 { + return nil, &MultipleFoundError{"network", path} + } + + return networks[0], nil +} + +func (f *Finder) DefaultNetwork(ctx context.Context) (object.NetworkReference, error) { + network, err := f.Network(ctx, "*") + if err != nil { + return nil, toDefaultError(err) + } + + return network, nil +} + +func (f *Finder) NetworkOrDefault(ctx context.Context, path string) (object.NetworkReference, error) { + if path != "" { + network, err := f.Network(ctx, path) + if err != nil { + return nil, err + } + return network, nil + } + + return f.DefaultNetwork(ctx) +} + +func (f *Finder) ResourcePoolList(ctx context.Context, path string) ([]*object.ResourcePool, error) { + es, err := f.find(ctx, f.hostFolder, true, path) + if err != nil { + return nil, err + } + + var rps []*object.ResourcePool + for _, e := range es { + var rp *object.ResourcePool + + switch o := e.Object.(type) { + case mo.ResourcePool: + rp = object.NewResourcePool(f.client, o.Reference()) + rp.InventoryPath = e.Path + rps = append(rps, rp) + } + } + + if len(rps) == 0 { + return nil, &NotFoundError{"resource pool", path} + } + + return rps, nil +} + +func (f *Finder) ResourcePool(ctx context.Context, path string) (*object.ResourcePool, error) { + rps, err := f.ResourcePoolList(ctx, path) + if err != nil { + return nil, err + } + + if len(rps) > 1 { + return nil, &MultipleFoundError{"resource pool", path} + } + + return rps[0], nil +} + +func (f *Finder) DefaultResourcePool(ctx context.Context) (*object.ResourcePool, error) { + rp, err := f.ResourcePool(ctx, "*/Resources") + if err != nil { + return nil, toDefaultError(err) + } + + return rp, nil +} + +func (f *Finder) ResourcePoolOrDefault(ctx context.Context, path string) (*object.ResourcePool, error) { + if path != "" { + rp, err := f.ResourcePool(ctx, path) + if err != nil { + return nil, err + } + return rp, nil + } + + return f.DefaultResourcePool(ctx) +} + +func (f *Finder) DefaultFolder(ctx context.Context) (*object.Folder, error) { + ref, err := f.vmFolder(ctx) + if err != nil { + return nil, toDefaultError(err) + } + folder := object.NewFolder(f.client, ref.Reference()) + + return folder, nil +} + +func (f *Finder) FolderOrDefault(ctx context.Context, path string) (*object.Folder, error) { + if path != "" { + folder, err := f.Folder(ctx, path) + if err != nil { + return nil, err + } + return folder, nil + } + return f.DefaultFolder(ctx) +} + +func (f *Finder) VirtualMachineList(ctx context.Context, path string) ([]*object.VirtualMachine, error) { + es, err := f.find(ctx, f.vmFolder, false, path) + if err != nil { + return nil, err + } + + var vms []*object.VirtualMachine + for _, e := range es { + switch o := e.Object.(type) { + case mo.VirtualMachine: + vm := object.NewVirtualMachine(f.client, o.Reference()) + vm.InventoryPath = e.Path + vms = append(vms, vm) + } + } + + if len(vms) == 0 { + return nil, &NotFoundError{"vm", path} + } + + return vms, nil +} + +func (f *Finder) VirtualMachine(ctx context.Context, path string) (*object.VirtualMachine, error) { + vms, err := f.VirtualMachineList(ctx, path) + if err != nil { + return nil, err + } + + if len(vms) > 1 { + return nil, &MultipleFoundError{"vm", path} + } + + return vms[0], nil +} + +func (f *Finder) VirtualAppList(ctx context.Context, path string) ([]*object.VirtualApp, error) { + es, err := f.find(ctx, f.vmFolder, false, path) + if err != nil { + return nil, err + } + + var apps []*object.VirtualApp + for _, e := range es { + switch o := e.Object.(type) { + case mo.VirtualApp: + app := object.NewVirtualApp(f.client, o.Reference()) + app.InventoryPath = e.Path + apps = append(apps, app) + } + } + + if len(apps) == 0 { + return nil, &NotFoundError{"app", path} + } + + return apps, nil +} + +func (f *Finder) VirtualApp(ctx context.Context, path string) (*object.VirtualApp, error) { + apps, err := f.VirtualAppList(ctx, path) + if err != nil { + return nil, err + } + + if len(apps) > 1 { + return nil, &MultipleFoundError{"app", path} + } + + return apps[0], nil +} + +func (f *Finder) FolderList(ctx context.Context, path string) ([]*object.Folder, error) { + es, err := f.ManagedObjectList(ctx, path) + if err != nil { + return nil, err + } + + var folders []*object.Folder + + for _, e := range es { + switch o := e.Object.(type) { + case mo.Folder, mo.StoragePod: + folder := object.NewFolder(f.client, o.Reference()) + folder.InventoryPath = e.Path + folders = append(folders, folder) + case *object.Folder: + // RootFolder + folders = append(folders, o) + } + } + + if len(folders) == 0 { + return nil, &NotFoundError{"folder", path} + } + + return folders, nil +} + +func (f *Finder) Folder(ctx context.Context, path string) (*object.Folder, error) { + folders, err := f.FolderList(ctx, path) + if err != nil { + return nil, err + } + + if len(folders) > 1 { + return nil, &MultipleFoundError{"folder", path} + } + + return folders[0], nil +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/gen/Gemfile juju-core-2.0.2/src/github.com/vmware/govmomi/gen/Gemfile --- juju-core-2.0.0/src/github.com/vmware/govmomi/gen/Gemfile 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/gen/Gemfile 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,3 @@ +source "https://rubygems.org" + +gem "nokogiri" diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/gen/Gemfile.lock juju-core-2.0.2/src/github.com/vmware/govmomi/gen/Gemfile.lock --- juju-core-2.0.0/src/github.com/vmware/govmomi/gen/Gemfile.lock 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/gen/Gemfile.lock 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,12 @@ +GEM + remote: https://rubygems.org/ + specs: + mini_portile (0.6.0) + nokogiri (1.6.3.1) + mini_portile (= 0.6.0) + +PLATFORMS + ruby + +DEPENDENCIES + nokogiri diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/gen/gen_from_vmodl.rb juju-core-2.0.2/src/github.com/vmware/govmomi/gen/gen_from_vmodl.rb --- juju-core-2.0.0/src/github.com/vmware/govmomi/gen/gen_from_vmodl.rb 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/gen/gen_from_vmodl.rb 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,227 @@ +# Copyright (c) 2014 VMware, Inc. All Rights Reserved. +# +# 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, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +$:.unshift(File.expand_path(File.dirname(__FILE__))) + +require "vim_wsdl" + +require "test/unit" + +PATH = File.expand_path("../rbvmomi", __FILE__) + +def read(file) + File.open(File.join(PATH, file)) +end + +class Prop + def initialize(vmodl, data) + @vmodl = vmodl + @data = data + end + + def slice? + @data["is-array"] + end + + def optional? + @data["is-optional"] + end + + def name + @data["name"] + end + + def var_field + n = name + n[0].capitalize + n[1..-1] + end + + def var_type_prefix(base=false) + if slice? + "[]" + else + if optional? && !base + "*" + else + "" + end + end + end + + def var_type + type = @data["wsdl_type"] + if @vmodl.managed_hash.has_key?(type) + type = "ManagedObjectReference" + end + + # Fix up type from vmodl + case type + when "TypeName", "MethodName" + type = "xsd:string" + when "ManagedObject" + type = "ManagedObjectReference" + when "xsd:anyType" + type = "AnyType" + end + + if type =~ /^xsd:(.*)$/ + type = $1 + case type + when "string" + when "int" + type = "int32" + when "boolean" + type ="bool" + when "long" + type ="int64" + when "dateTime" + type ="time.Time" + prefix += "*" if !slice? && optional? + when "byte" + when "double" + type ="float64" + when "float" + type ="float32" + when "short" + type ="int16" + when "base64Binary" + type ="[]byte" + else + raise "unknown type: %s" % type + end + else + if Peek.base?(type) + type = "Base" + type + base = true + end + type = "types." + type + end + + var_type_prefix(base) + type + end + + def var_tag + "mo:\"%s\"" % name + end + + def dump(io) + io.print "%s %s `%s`\n" % [var_field, var_type, var_tag] + end +end + +class Managed + def initialize(vmodl, name, data) + @vmodl = vmodl + @name = name + @data = data + end + + def name + @name + end + + def props + @data["props"].map do |p| + Prop.new(@vmodl, p) + end + end + + def dump(io) + include_ref_getter = false + include_ent_getter = false + + io.print "type %s struct {\n" % name + + case @data["wsdl_base"] + when nil, "ManagedObject", "View" + include_ref_getter = true + io.print "Self types.ManagedObjectReference\n\n" + else + io.print "%s\n\n" % @data["wsdl_base"] + if @data["wsdl_base"] == "ManagedEntity" + include_ent_getter = true + end + end + + props.each do |p| + p.dump(io) + end + io.print "}\n\n" + + if include_ref_getter + io.print "func (m %s) Reference() types.ManagedObjectReference {\n" % [name] + io.print "return m.Self\n" + io.print "}\n\n" + end + + if include_ent_getter + io.print "func (m *%s) Entity() *ManagedEntity {\n" % [name] + io.print "return &m.ManagedEntity\n" + io.print "}\n\n" + end + end + + def dump_init(io) + io.print "func init() {\n" + io.print "t[\"%s\"] = reflect.TypeOf((*%s)(nil)).Elem()\n" % [name, name] + io.print "}\n\n" + end +end + +class Vmodl + def initialize(data) + @data = Marshal.load(data) + end + + def managed_hash + @managed_hash ||= begin + h = {} + managed.each do |m| + h[m.name] = m + end + h + end + end + + def managed + @data.map do |k,v| + next if !v.is_a?(Hash) + next if v["kind"] != "managed" + next if k =~ /^pbm/i + + Managed.new(self, k, v) + end.compact + end +end + +if !File.directory?(ARGV.first) + raise "first argument not a directory" +end + +wsdl = WSDL.new(WSDL.read "vim.wsdl") +wsdl.validate_assumptions! +wsdl.peek() + +File.open(File.join(ARGV.first, "mo/mo.go"), "w") do |io| + io.print WSDL.header("mo") + + vmodl = Vmodl.new(read "vmodl.db") + + vmodl. + managed. + sort_by { |m| m.name }. + each { |m| m.dump(io); m.dump_init(io); } +end + +exit(0) diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/gen/gen_from_wsdl.rb juju-core-2.0.2/src/github.com/vmware/govmomi/gen/gen_from_wsdl.rb --- juju-core-2.0.0/src/github.com/vmware/govmomi/gen/gen_from_wsdl.rb 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/gen/gen_from_wsdl.rb 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,70 @@ +# Copyright (c) 2014 VMware, Inc. All Rights Reserved. +# +# 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, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +$:.unshift(File.expand_path(File.dirname(__FILE__))) + +require "vim_wsdl" + +if !File.directory?(ARGV.first) + raise "first argument not a directory" +end + +wsdl = WSDL.new(WSDL.read "vim.wsdl") +wsdl.validate_assumptions! +wsdl.peek() + +ifs = Peek.types.keys.select { |name| Peek.base?(name) }.size() +puts "%d classes, %d interfaces" % [Peek.types.size(), ifs] + +File.open(File.join(ARGV.first, "types/enum.go"), "w") do |io| + io.print WSDL.header("types") + + wsdl. + types. + sort_by { |x| x.name }. + uniq { |x| x.name }. + select { |x| x.name[0] == x.name[0].upcase }. # Only capitalized methods for now... + select { |t| t.is_enum? }. + each { |e| e.dump(io); e.dump_init(io) } +end + +File.open(File.join(ARGV.first, "types/types.go"), "w") do |io| + io.print WSDL.header("types") + + wsdl. + types. + sort_by { |x| x.name }. + uniq { |x| x.name }. + select { |x| x.name[0] == x.name[0].upcase }. # Only capitalized methods for now... + select { |t| !t.is_enum? }. + each { |e| e.dump(io); e.dump_init(io) } +end + +File.open(File.join(ARGV.first, "types/if.go"), "w") do |io| + io.print WSDL.header("types") + + Peek.dump_interfaces(io) +end + +File.open(File.join(ARGV.first, "methods/methods.go"), "w") do |io| + io.print WSDL.header("methods") + + wsdl. + operations. + sort_by { |x| x.name }. + select { |x| x.name[0] == x.name[0].upcase }. # Only capitalized methods for now... + each { |e| e.dump(io) } +end + +exit(0) diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/gen/gen.sh juju-core-2.0.2/src/github.com/vmware/govmomi/gen/gen.sh --- juju-core-2.0.0/src/github.com/vmware/govmomi/gen/gen.sh 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/gen/gen.sh 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,38 @@ +#!/bin/bash + +# Copyright (c) 2014 VMware, Inc. All Rights Reserved. +# +# 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, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -e + +if [ ! -f rbvmomi/vmodl.db ]; then + git clone https://github.com/vmware/rbvmomi +fi + +dst=../vim25 + +pkgs=$(echo $dst/{types,methods,mo}) +mkdir -p $pkgs + +bundle exec ruby gen_from_wsdl.rb $dst +bundle exec ruby gen_from_vmodl.rb $dst + +for p in $pkgs +do + echo $p + cd $p + goimports -w *.go + go install + cd - +done diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/gen/vim_wsdl.rb juju-core-2.0.2/src/github.com/vmware/govmomi/gen/vim_wsdl.rb --- juju-core-2.0.0/src/github.com/vmware/govmomi/gen/vim_wsdl.rb 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/gen/vim_wsdl.rb 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,803 @@ +# Copyright (c) 2014-2016 VMware, Inc. All Rights Reserved. +# +# 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, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +require "nokogiri" +require "test/unit" + +class Peek + class Type + attr_accessor :parent, :children, :klass + + def initialize(name) + @name = name + @children = [] + end + + def base? + return !children.empty? + end + end + + @@types = {} + @@refs = {} + @@enums = {} + + def self.types + return @@types + end + + def self.refs + return @@refs + end + + def self.enums + return @@enums + end + + def self.ref(type) + refs[type] = true + end + + def self.enum(type) + enums[type] = true + end + + def self.enum?(type) + enums[type] + end + + def self.register(name) + raise unless name + types[name] ||= Type.new(name) + end + + def self.base?(name) + return unless c = types[name] + c.base? + end + + def self.dump_interfaces(io) + types.keys.sort.each do |name| + next unless base?(name) + + types[name].klass.dump_interface(io, name) + end + end +end + +class EnumValue + def initialize(type, value) + @type = type + @value = value + end + + def type_name + @type.name + end + + def var_name + n = @type.name + v = var_value + if v == "" + n += "Null" + else + n += (v[0].capitalize + v[1..-1]) + end + + return n + end + + def var_value + @value + end + + def dump(io) + io.print "%s = %s(\"%s\")\n" % [var_name, type_name, var_value] + end +end + +class Simple + include Test::Unit::Assertions + + attr_accessor :name, :type + + def initialize(node) + @node = node + end + + def name + @name || @node["name"] + end + + def type + @type || @node["type"] + end + + def is_enum? + false + end + + def dump_init(io) + # noop + end + + def var_name + n = self.name + n = n[1..-1] if n[0] == "_" # Strip leading _ + n = n[0].capitalize + n[1..-1] # Capitalize + return n + end + + def vim_type? + ns, _ = self.type.split(":", 2) + ns == "vim25" or ns == "internalvim25" or ns == "internalreflect" + end + + def vim_type(t = self.type) + ns, t = t.split(":", 2) + if ns != "vim25" and ns != "internalvim25" and ns != "internalreflect" + raise + end + t + end + + def base_type? + vim_type? && Peek.base?(vim_type) + end + + def enum_type? + vim_type? && Peek.enum?(vim_type) + end + + def any_type? + self.type == "xsd:anyType" + end + + def pointer_type? + ["UnitNumber"].include?(var_name) + end + + def var_type + t = self.type + prefix = "" + + prefix += "[]" if slice? + + if t =~ /^xsd:(.*)$/ + t = $1 + case t + when "string" + when "int" + if pointer_type? + prefix += "*" + self.need_omitempty = false + end + t = "int32" + when "boolean" + t = "bool" + if !slice? && optional? + prefix += "*" + self.need_omitempty = false + end + when "long" + t = "int64" + when "dateTime" + t = "time.Time" + if !slice? && optional? + prefix += "*" + self.need_omitempty = false + end + when "anyType" + t = "AnyType" + when "byte" + when "double" + t = "float64" + when "float" + t = "float32" + when "short" + t = "int16" + when "base64Binary" + t = "[]byte" + when "anyURI" + t = "url.URL" + else + raise "unknown type: %s" % t + end + else + t = vim_type + if base_type? + prefix += "Base" + else + prefix += "*" if !slice? && !enum_type? && optional? + end + end + + prefix + t + end + + def slice? + test_attr("maxOccurs", "unbounded") + end + + def optional? + test_attr("minOccurs", "0") + end + + def need_omitempty=(v) + @need_omitempty = v + end + + def need_omitempty? + var_type # HACK: trigger setting need_omitempty if necessary + if @need_omitempty.nil? + @need_omitempty = optional? + else + @need_omitempty + end + end + + def need_typeattr? + base_type? || any_type? + end + + protected + + def test_attr(attr, expected) + actual = @node.attr(attr) + if actual != nil + case actual + when expected + true + else + raise "%s=%s" % [value, type.attr(value)] + end + else + false + end + end +end + +class Element < Simple + def initialize(node) + super(node) + end + + def has_type? + !@node["type"].nil? + end + + def child + cs = @node.element_children + assert_equal 1, cs.length + assert_equal "complexType", cs.first.name + + t = ComplexType.new(cs.first) + t.name = self.name + t + end + + def dump(io) + if has_type? + io.print "type %s %s\n\n" % [name, var_type] + else + child.dump(io) + end + end + + def dump_init(io) + if has_type? + io.print "func init() {\n" + io.print "t[\"%s\"] = reflect.TypeOf((*%s)(nil)).Elem()\n" % [name, name] + io.print "}\n\n" + end + end + + def dump_field(io) + tag = name + tag += ",omitempty" if need_omitempty? + tag += ",typeattr" if need_typeattr? + io.print "%s %s `xml:\"%s\"`\n" % [var_name, var_type, tag] + end + + def peek(type=nil) + if has_type? + return if self.type =~ /^xsd:/ + + Peek.ref(vim_type) + else + child.peek() + end + end +end + +class Attribute < Simple + def dump_field(io) + tag = name + tag += ",omitempty" if need_omitempty? + tag += ",attr" + io.print "%s %s `xml:\"%s\"`\n" % [var_name, var_type, tag] + end +end + +class SimpleType < Simple + def is_enum? + true + end + + def dump(io) + enums = @node.xpath(".//xsd:enumeration").map do |n| + EnumValue.new(self, n["value"]) + end + + io.print "type %s string\n\n" % name + io.print "const (\n" + enums.each { |e| e.dump(io) } + io.print ")\n\n" + end + + def dump_init(io) + io.print "func init() {\n" + io.print "t[\"%s\"] = reflect.TypeOf((*%s)(nil)).Elem()\n" % [name, name] + io.print "}\n\n" + end + + def peek + Peek.enum(name) + end +end + +class ComplexType < Simple + class SimpleContent < Simple + def dump(io) + attr = Attribute.new(@node.at_xpath(".//xsd:attribute")) + attr.dump_field(io) + + # HACK DELUXE(PN) + extension = @node.at_xpath(".//xsd:extension") + type = extension["base"].split(":", 2)[1] + io.print "Value %s `xml:\",chardata\"`\n" % type + end + + def peek + end + end + + class ComplexContent < Simple + def base + extension = @node.at_xpath(".//xsd:extension") + assert_not_nil extension + + base = extension["base"] + assert_not_nil base + + vim_type(base) + end + + def dump(io) + Sequence.new(@node).dump(io, base) + end + + def dump_interface(io, name) + Sequence.new(@node).dump_interface(io, name) + end + + def peek + Sequence.new(@node).peek(base) + end + end + + class Sequence < Simple + def sequence + sequence = @node.at_xpath(".//xsd:sequence") + if sequence != nil + sequence.element_children.map do |n| + Element.new(n) + end + else + nil + end + end + + def dump(io, base = nil) + return unless elements = sequence + + io.print "%s\n\n" % base + + elements.each do |e| + e.dump_field(io) + end + end + + def dump_interface(io, name) + method = "Get%s() *%s" % [name, name] + io.print "func (b *%s) %s { return b }\n" % [name, method] + io.print "type Base%s interface {\n" % name + io.print "%s\n" % method + io.print "}\n\n" + io.print "func init() {\n" + io.print "t[\"Base%s\"] = reflect.TypeOf((*%s)(nil)).Elem()\n" % [name, name] + io.print "}\n\n" + end + + def peek(base = nil) + return unless elements = sequence + name = @node.attr("name") + return unless name + + elements.each do |e| + e.peek(name) + end + + c = Peek.register(name) + if base + c.parent = base + Peek.register(c.parent).children << name + end + end + end + + def klass + @klass ||= begin + cs = @node.element_children + if !cs.empty? + assert_equal 1, cs.length + + case cs.first.name + when "simpleContent" + SimpleContent.new(@node) + when "complexContent" + ComplexContent.new(@node) + when "sequence" + Sequence.new(@node) + else + raise "don't know what to do for element: %s..." % cs.first.name + end + end + end + end + + def dump_init(io) + io.print "func init() {\n" + io.print "t[\"%s\"] = reflect.TypeOf((*%s)(nil)).Elem()\n" % [name, name] + io.print "}\n\n" + end + + def dump(io) + io.print "type %s struct {\n" % name + klass.dump(io) if klass + io.print "}\n\n" + end + + def peek + Peek.register(name).klass = klass + klass.peek if klass + end +end + +class Schema + include Test::Unit::Assertions + + def initialize(xml, parent = nil) + @xml = Nokogiri::XML.parse(xml) + end + + def targetNamespace + @xml.root["targetNamespace"] + end + + # We have some assumptions about structure, make sure they hold. + def validate_assumptions! + # Every enumeration is part of a restriction + @xml.xpath(".//xsd:enumeration").each do |n| + assert_equal "restriction", n.parent.name + end + + # See type == enum + @xml.xpath(".//xsd:restriction").each do |n| + # Every restriction has type xsd:string (it's an enum) + assert_equal "xsd:string", n["base"] + + # Every restriction is part of a simpleType + assert_equal "simpleType", n.parent.name + + # Every restriction is alone + assert_equal 1, n.parent.element_children.size + end + + # See type == complex_content + @xml.xpath(".//xsd:complexContent").each do |n| + # complexContent is child of complexType + assert_equal "complexType", n.parent.name + + end + + # See type == complex_type + @xml.xpath(".//xsd:complexType").each do |n| + cc = n.element_children + + # OK to have an empty complexType + next if cc.size == 0 + + # Require 1 element otherwise + assert_equal 1, cc.size + + case cc.first.name + when "complexContent" + # complexContent has 1 "extension" element + cc = cc.first.element_children + assert_equal 1, cc.size + assert_equal "extension", cc.first.name + + # extension has 1 "sequence" element + ec = cc.first.element_children + assert_equal 1, ec.size + assert_equal "sequence", ec.first.name + + # sequence has N "element" elements + sc = ec.first.element_children + assert sc.all? { |e| e.name == "element" } + when "simpleContent" + # simpleContent has 1 "extension" element + cc = cc.first.element_children + assert_equal 1, cc.size + assert_equal "extension", cc.first.name + + # extension has 1 or more "attribute" elements + ec = cc.first.element_children + assert_not_equal 0, ec.size + assert_equal "attribute", ec.first.name + when "sequence" + # sequence has N "element" elements + sc = cc.first.element_children + assert sc.all? { |e| e.name == "element" } + else + raise "unknown element: %s" % cc.first.name + end + end + + imports.each do |i| + i.validate_assumptions! + end + + includes.each do |i| + i.validate_assumptions! + end + end + + def types + return to_enum(:types) unless block_given? + + imports.each do |i| + i.types do |t| + yield t + end + end + + includes.each do |i| + i.types do |t| + yield t + end + end + + @xml.root.children.each do |n| + case n.class.to_s + when "Nokogiri::XML::Text" + next + when "Nokogiri::XML::Element" + case n.name + when "include", "import" + next + when "element" + yield Element.new(n) + when "simpleType" + yield SimpleType.new(n) + when "complexType" + yield ComplexType.new(n) + else + raise "unknown child: %s" % n.name + end + else + raise "unknown type: %s" % n.class + end + end + end + + def imports + @imports ||= @xml.root.xpath(".//xmlns:import").map do |n| + Schema.new(WSDL.read n["schemaLocation"]) + end + end + + def includes + @includes ||= @xml.root.xpath(".//xmlns:include").map do |n| + Schema.new(WSDL.read n["schemaLocation"]) + end + end +end + + +class Operation + include Test::Unit::Assertions + + def initialize(wsdl, operation_node) + @wsdl = wsdl + @operation_node = operation_node + end + + def name + @operation_node["name"] + end + + def namespace + type = @operation_node.at_xpath("./xmlns:input").attr("message") + keep_ns(type) + end + + def remove_ns(x) + ns, x = x.split(":", 2) + if ns != "vim25" and ns != "internalvim25" and ns != "internalreflect" + raise + end + x + end + + def keep_ns(x) + ns, x = x.split(":", 2) + if ns != "vim25" and ns != "internalvim25" and ns != "internalreflect" + raise + end + ns + end + + def find_type_for(type) + type = remove_ns(type) + + message = @wsdl.message(type) + assert_not_nil message + + part = message.at_xpath("./xmlns:part") + assert_not_nil message + + remove_ns(part["element"]) + end + + def input + type = @operation_node.at_xpath("./xmlns:input").attr("message") + find_type_for(type) + end + + def go_input + "types." + input + end + + def output + type = @operation_node.at_xpath("./xmlns:output").attr("message") + find_type_for(type) + end + + def go_output + "types." + output + end + + def dump(io) + io.print </dev/null) && [ -n "${git_status}" ]; then + git_version="${git_version}-dirty" +fi + +ldflags="-X github.com/vmware/govmomi/govc/version.gitVersion=${git_version}" + +BUILD_OS=${BUILD_OS:-darwin linux windows freebsd} +BUILD_ARCH=${BUILD_ARCH:-386 amd64} + +for os in ${BUILD_OS}; do + export GOOS="${os}" + for arch in ${BUILD_ARCH}; do + export GOARCH="${arch}" + + out="govc_${os}_${arch}" + if [ "${os}" == "windows" ]; then + out="${out}.exe" + fi + + set -x + go build \ + -o="${out}" \ + -pkgdir="./_pkg" \ + -compiler='gc' \ + -ldflags="${ldflags}" \ + github.com/vmware/govmomi/govc + set +x + done +done diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/CHANGELOG.md juju-core-2.0.2/src/github.com/vmware/govmomi/govc/CHANGELOG.md --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/CHANGELOG.md 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/CHANGELOG.md 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,141 @@ +# changelog + +### 0.8.0 (2016-06-30) + +* If username (`-u` / GOVC_USERNAME) is empty, attempt login via local ticket (Workstation) + +* Add StoragePod support to govc folder.create + +* Add `-folder` flag to datacenter.create command + +* Logout when session persistence is disabled + +* Add `-L` flag to ls command for resolving by managed object reference + +* Add `-i` flag to ls command for listing the managed object reference + +* Add vm.markasvm command + +* Add vm.markastemplate command + +### 0.7.1 (2016-06-03) + +* Fix datastore.{upload,download} against VirtualCenter + +### 0.7.0 (2016-06-02) + +* Add `-require` flag to version command + +* Add support for local type in the datastore.create command + +* Add `-namespace` option to datastore.mkdir and datastore.rm to create/remove namespaces on VSANs + +* Add host.service command + +* Add host.storage.mark command + +* Add `-rescan` option to host.storage.info command + +### 0.6.0 (2016-04-29) + +* Add folder commands: info, create, destroy, rename, moveinto + +* Add datastore.info command + +* Add `-a` and `-v4` flags to vm.ip command + +* Add host.account.{create,update,remove} commands + +* Add env command + +* Add vm.clone command + +### 0.5.0 (2016-03-30) + +* Add dvs.portgroup.info command + +* Add `-folder` flag to vm.create command + +* Add `-dump` flag to OutputFlag + +* Add `-f` flag to events command + +* Add `-mode` flag to vm.disk.create command + +* Add `-net` flag to device.info command + +* Add `-eager` and `-thick` options to vm.create command + +### 0.4.0 (2016-02-26) + +* Add support for placement in datastore cluster to vm.create command + +* Add support for creating new disks in vm.create command + +* Add `-p` and `-a` options to govc datastore.ls command + +### 0.3.0 (2016-01-16) + +* Add permissions.{ls,set,remove} commands + +* Add datastore.{create,remove} commands. + The new create command supports both creating NAS and VMFS datastores. + +* Add dvs.{create,add} and dvs.portgroup.add commands + +* Add host.vnic.{service,info} commands + +* Add cluster.{create,change,add} commands + +* Add host.{disconnect,reconnect,remove,maintenance.enter,maintenance.exit} commands + +* Add license.decode, license.assigned.list and license.assign commands + +* Add firewall.ruleset.find command + +* Add logs, logs.ls and logs.download commands + +* Add support for LoginExtensionByCertificate with new `-cert` and `-key` flags + +* Add govc extension.{info,register,unregister,setcert} commands + +* Add govc vapp.{info,destroy,power} commands + +### 0.2.0 (2015-09-15) + +* The `vm.power` guest `-s` and `-r` options will fallback to hard `-off` / `-reset` if tools is unavailable and `-force` flag is given + +* Add `PowerOn, InjectOvfEnv, WaitForIP` options to `import.ovf` and `import.ova` option spec file + +* Add `import.spec` to produce an example json document + +* Add `-options` to `import.ovf` and `import.ova` + +* Add `-folder` to `import.ovf` and `import.ova` + +* Add `fields` command to manage custom fields + +* Add `datastore.info` command + +* Add `events` command + +* Add `-net.address` (Hardware Address) option to `vm.change` and `vm.create` + +* Add `host.add` command to add host to datacenter. + +* Add `GOVC_USERNAME` and `GOVC_PASSWORD` to allow overriding username and/or + password (used when they contain special characters that prevent them from + being embedded in the URL). + +* Add `-e' (ExtraConfig) option to `vm.change` and `vm.info` + +* Retry twice on temporary network errors. + +* Add `host.autostart` commands to manage VM autostart. + +* Add `-persist-session` flag to control whether or not the session is + persisted to disk (defaults to true). + +### 0.1.0 (2015-03-17) + +Prior to this version the changes to govc's command set were not documented. diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/cli/command.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/cli/command.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/cli/command.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/cli/command.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,159 @@ +/* +Copyright (c) 2014-2016 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package cli + +import ( + "flag" + "fmt" + "io/ioutil" + "os" + "sort" + "text/tabwriter" + + "golang.org/x/net/context" +) + +type HasFlags interface { + // Register may be called more than once and should be idempotent. + Register(ctx context.Context, f *flag.FlagSet) + + // Process may be called more than once and should be idempotent. + Process(ctx context.Context) error +} + +type Command interface { + HasFlags + + Run(ctx context.Context, f *flag.FlagSet) error +} + +func generalHelp() { + fmt.Fprintf(os.Stderr, "Usage of %s:\n", os.Args[0]) + + cmds := []string{} + for name := range commands { + cmds = append(cmds, name) + } + + sort.Strings(cmds) + + for _, name := range cmds { + fmt.Fprintf(os.Stderr, " %s\n", name) + } +} + +func commandHelp(name string, cmd Command, f *flag.FlagSet) { + type HasUsage interface { + Usage() string + } + + fmt.Fprintf(os.Stderr, "Usage: %s %s [OPTIONS]", os.Args[0], name) + if u, ok := cmd.(HasUsage); ok { + fmt.Fprintf(os.Stderr, " %s", u.Usage()) + } + fmt.Fprintf(os.Stderr, "\n") + + type HasDescription interface { + Description() string + } + + if u, ok := cmd.(HasDescription); ok { + fmt.Fprintf(os.Stderr, "%s\n", u.Description()) + } + + n := 0 + f.VisitAll(func(_ *flag.Flag) { + n += 1 + }) + + if n > 0 { + fmt.Fprintf(os.Stderr, "\nOptions:\n") + tw := tabwriter.NewWriter(os.Stderr, 2, 0, 2, ' ', 0) + f.VisitAll(func(f *flag.Flag) { + fmt.Fprintf(tw, "\t-%s=%s\t%s\n", f.Name, f.DefValue, f.Usage) + }) + tw.Flush() + } +} + +func clientLogout(ctx context.Context, cmd Command) error { + type logout interface { + Logout(context.Context) error + } + + if l, ok := cmd.(logout); ok { + return l.Logout(ctx) + } + + return nil +} + +func Run(args []string) int { + var err error + + if len(args) == 0 { + generalHelp() + return 1 + } + + // Look up real command name in aliases table. + name, ok := aliases[args[0]] + if !ok { + name = args[0] + } + + cmd, ok := commands[name] + if !ok { + generalHelp() + return 1 + } + + fs := flag.NewFlagSet("", flag.ContinueOnError) + fs.SetOutput(ioutil.Discard) + + ctx := context.Background() + cmd.Register(ctx, fs) + + if err = fs.Parse(args[1:]); err != nil { + goto error + } + + if err = cmd.Process(ctx); err != nil { + goto error + } + + if err = cmd.Run(ctx, fs); err != nil { + goto error + } + + if err = clientLogout(ctx, cmd); err != nil { + goto error + } + + return 0 + +error: + if err == flag.ErrHelp { + commandHelp(args[0], cmd, fs) + } else { + fmt.Fprintf(os.Stderr, "%s: %s\n", os.Args[0], err) + } + + _ = clientLogout(ctx, cmd) + + return 1 +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/cli/register.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/cli/register.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/cli/register.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/cli/register.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,33 @@ +/* +Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package cli + +var commands = map[string]Command{} + +var aliases = map[string]string{} + +func Register(name string, c Command) { + commands[name] = c +} + +func Alias(name string, alias string) { + aliases[alias] = name +} + +func Commands() map[string]Command { + return commands +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/cluster/add.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/cluster/add.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/cluster/add.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/cluster/add.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,129 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package cluster + +import ( + "flag" + "fmt" + + "github.com/vmware/govmomi/govc/cli" + "github.com/vmware/govmomi/govc/flags" + "github.com/vmware/govmomi/object" + "golang.org/x/net/context" +) + +type add struct { + *flags.DatacenterFlag + *flags.HostConnectFlag + + cluster string + connect bool + license string +} + +func init() { + cli.Register("cluster.add", &add{}) +} + +func (cmd *add) Register(ctx context.Context, f *flag.FlagSet) { + cmd.DatacenterFlag, ctx = flags.NewDatacenterFlag(ctx) + cmd.DatacenterFlag.Register(ctx, f) + + cmd.HostConnectFlag, ctx = flags.NewHostConnectFlag(ctx) + cmd.HostConnectFlag.Register(ctx, f) + + f.StringVar(&cmd.cluster, "cluster", "*", "Path to cluster") + + f.StringVar(&cmd.license, "license", "", "Assign license key") + + f.BoolVar(&cmd.connect, "connect", true, "Immediately connect to host") +} + +func (cmd *add) Process(ctx context.Context) error { + if err := cmd.DatacenterFlag.Process(ctx); err != nil { + return err + } + if err := cmd.HostConnectFlag.Process(ctx); err != nil { + return err + } + if cmd.HostName == "" { + return flag.ErrHelp + } + if cmd.UserName == "" { + return flag.ErrHelp + } + if cmd.Password == "" { + return flag.ErrHelp + } + return nil +} + +func (cmd *add) Description() string { + return `Add host to cluster. + +The host is added to the cluster specified by the 'cluster' flag.` +} + +func (cmd *add) Add(ctx context.Context, cluster *object.ClusterComputeResource) error { + spec := cmd.HostConnectSpec + + var license *string + if cmd.license != "" { + license = &cmd.license + } + + task, err := cluster.AddHost(ctx, spec, cmd.connect, license, nil) + if err != nil { + return err + } + + logger := cmd.ProgressLogger(fmt.Sprintf("adding %s to cluster %s... ", spec.HostName, cluster.InventoryPath)) + defer logger.Wait() + + _, err = task.WaitForResult(ctx, logger) + return err +} + +func (cmd *add) Run(ctx context.Context, f *flag.FlagSet) error { + if f.NArg() != 0 { + return flag.ErrHelp + } + + finder, err := cmd.Finder() + if err != nil { + return err + } + + cluster, err := finder.ClusterComputeResource(ctx, cmd.cluster) + if err != nil { + return nil + } + + err = cmd.Add(ctx, cluster) + + if err == nil { + return nil + } + + // Check if we failed due to SSLVerifyFault and -noverify is set + if err := cmd.AcceptThumbprint(err); err != nil { + return err + } + + // Accepted unverified thumbprint, try again + return cmd.Add(ctx, cluster) +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/cluster/change.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/cluster/change.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/cluster/change.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/cluster/change.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,109 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package cluster + +import ( + "flag" + "strings" + + "golang.org/x/net/context" + + "github.com/vmware/govmomi/govc/cli" + "github.com/vmware/govmomi/govc/flags" + "github.com/vmware/govmomi/vim25/types" +) + +type change struct { + *flags.DatacenterFlag + + types.ClusterConfigSpecEx +} + +func init() { + cli.Register("cluster.change", &change{}) +} + +func (cmd *change) Register(ctx context.Context, f *flag.FlagSet) { + cmd.DatacenterFlag, ctx = flags.NewDatacenterFlag(ctx) + cmd.DatacenterFlag.Register(ctx, f) + + cmd.DrsConfig = new(types.ClusterDrsConfigInfo) + cmd.DasConfig = new(types.ClusterDasConfigInfo) + cmd.VsanConfig = new(types.VsanClusterConfigInfo) + cmd.VsanConfig.DefaultConfig = new(types.VsanClusterConfigInfoHostDefaultInfo) + + // DRS + f.Var(flags.NewOptionalBool(&cmd.DrsConfig.Enabled), "drs-enabled", "Enable DRS") + + drsModes := []string{ + string(types.DrsBehaviorManual), + string(types.DrsBehaviorPartiallyAutomated), + string(types.DrsBehaviorFullyAutomated), + } + f.StringVar((*string)(&cmd.DrsConfig.DefaultVmBehavior), "drs-mode", "", + "DRS behavior for virtual machines: "+strings.Join(drsModes, ", ")) + + // HA + f.Var(flags.NewOptionalBool(&cmd.DasConfig.Enabled), "ha-enabled", "Enable HA") + + // vSAN + f.Var(flags.NewOptionalBool(&cmd.VsanConfig.Enabled), "vsan-enabled", "Enable vSAN") + f.Var(flags.NewOptionalBool(&cmd.VsanConfig.DefaultConfig.AutoClaimStorage), "vsan-autoclaim", "") +} + +func (cmd *change) Process(ctx context.Context) error { + if err := cmd.DatacenterFlag.Process(ctx); err != nil { + return err + } + return nil +} + +func (cmd *change) Usage() string { + return "CLUSTER..." +} + +func (cmd *change) Description() string { + return `Change configuration of the given clusters.` +} + +func (cmd *change) Run(ctx context.Context, f *flag.FlagSet) error { + finder, err := cmd.Finder() + if err != nil { + return err + } + + for _, path := range f.Args() { + clusters, err := finder.ClusterComputeResourceList(ctx, path) + if err != nil { + return err + } + + for _, cluster := range clusters { + task, err := cluster.Reconfigure(ctx, &cmd.ClusterConfigSpecEx, true) + if err != nil { + return err + } + + _, err = task.WaitForResult(ctx, nil) + if err != nil { + return err + } + } + } + + return nil +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/cluster/create.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/cluster/create.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/cluster/create.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/cluster/create.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,104 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package cluster + +import ( + "flag" + + "golang.org/x/net/context" + + "github.com/vmware/govmomi/govc/cli" + "github.com/vmware/govmomi/govc/flags" + "github.com/vmware/govmomi/object" + "github.com/vmware/govmomi/vim25/types" +) + +type create struct { + *flags.DatacenterFlag + + parent string + + types.ClusterConfigSpecEx +} + +func init() { + cli.Register("cluster.create", &create{}) +} + +func (cmd *create) Register(ctx context.Context, f *flag.FlagSet) { + cmd.DatacenterFlag, ctx = flags.NewDatacenterFlag(ctx) + cmd.DatacenterFlag.Register(ctx, f) + + f.StringVar(&cmd.parent, "parent", "", "Path to parent folder for the new cluster") +} + +func (cmd *create) Usage() string { + return "CLUSTER" +} + +func (cmd *create) Description() string { + return `Create CLUSTER in datacenter. + +The cluster is added to the folder specified by the 'parent' flag. If not given, +this defaults to the hosts folder in the specified or default datacenter.` +} + +func (cmd *create) Process(ctx context.Context) error { + if err := cmd.DatacenterFlag.Process(ctx); err != nil { + return err + } + return nil +} + +func (cmd *create) Run(ctx context.Context, f *flag.FlagSet) error { + var parent *object.Folder + + if f.NArg() != 1 { + return flag.ErrHelp + } + + if cmd.parent == "" { + dc, err := cmd.Datacenter() + if err != nil { + return err + } + + folders, err := dc.Folders(ctx) + if err != nil { + return err + } + + parent = folders.HostFolder + } else { + finder, err := cmd.Finder() + if err != nil { + return err + } + + parent, err = finder.Folder(ctx, cmd.parent) + if err != nil { + return err + } + } + + _, err := parent.CreateCluster(ctx, f.Arg(0), cmd.ClusterConfigSpecEx) + if err != nil { + return err + } + + return nil +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/datacenter/create.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/datacenter/create.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/datacenter/create.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/datacenter/create.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,69 @@ +/* +Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package datacenter + +import ( + "flag" + + "github.com/vmware/govmomi/govc/cli" + "github.com/vmware/govmomi/govc/flags" + "golang.org/x/net/context" +) + +type create struct { + *flags.FolderFlag +} + +func init() { + cli.Register("datacenter.create", &create{}) +} + +func (cmd *create) Register(ctx context.Context, f *flag.FlagSet) { + cmd.FolderFlag, ctx = flags.NewFolderFlag(ctx) + cmd.FolderFlag.Register(ctx, f) +} + +func (cmd *create) Usage() string { + return "NAME..." +} + +func (cmd *create) Process(ctx context.Context) error { + if err := cmd.FolderFlag.Process(ctx); err != nil { + return err + } + return nil +} + +func (cmd *create) Run(ctx context.Context, f *flag.FlagSet) error { + folder, err := cmd.FolderOrRoot() + if err != nil { + return err + } + + if f.NArg() == 0 { + return flag.ErrHelp + } + + for _, name := range f.Args() { + _, err := folder.CreateDatacenter(ctx, name) + if err != nil { + return err + } + } + + return nil +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/datacenter/destroy.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/datacenter/destroy.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/datacenter/destroy.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/datacenter/destroy.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,83 @@ +/* +Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package datacenter + +import ( + "flag" + + "github.com/vmware/govmomi/find" + "github.com/vmware/govmomi/govc/cli" + "github.com/vmware/govmomi/govc/flags" + "golang.org/x/net/context" +) + +type destroy struct { + *flags.ClientFlag +} + +func init() { + cli.Register("datacenter.destroy", &destroy{}) +} + +func (cmd *destroy) Register(ctx context.Context, f *flag.FlagSet) { + cmd.ClientFlag, ctx = flags.NewClientFlag(ctx) + cmd.ClientFlag.Register(ctx, f) +} + +func (cmd *destroy) Usage() string { + return "PATH..." +} + +func (cmd *destroy) Process(ctx context.Context) error { + if err := cmd.ClientFlag.Process(ctx); err != nil { + return err + } + return nil +} + +func (cmd *destroy) Run(ctx context.Context, f *flag.FlagSet) error { + if f.NArg() == 0 { + return flag.ErrHelp + } + + client, err := cmd.ClientFlag.Client() + if err != nil { + return err + } + + finder := find.NewFinder(client, false) + + for _, path := range f.Args() { + dcs, err := finder.DatacenterList(ctx, path) + if err != nil { + return err + } + + for _, dc := range dcs { + task, err := dc.Destroy(ctx) + if err != nil { + return err + } + + if err := task.Wait(ctx); err != nil { + return err + } + } + } + + return nil +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/datacenter/info.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/datacenter/info.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/datacenter/info.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/datacenter/info.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,173 @@ +/* +Copyright (c) 2016 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package datacenter + +import ( + "flag" + "fmt" + "io" + "path" + "text/tabwriter" + + "github.com/vmware/govmomi/find" + "github.com/vmware/govmomi/govc/cli" + "github.com/vmware/govmomi/govc/flags" + "github.com/vmware/govmomi/object" + "github.com/vmware/govmomi/property" + "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/types" + "golang.org/x/net/context" +) + +type info struct { + *flags.ClientFlag + *flags.OutputFlag + *flags.DatacenterFlag +} + +func init() { + cli.Register("datacenter.info", &info{}) +} + +func (cmd *info) Register(ctx context.Context, f *flag.FlagSet) { + cmd.ClientFlag, ctx = flags.NewClientFlag(ctx) + cmd.ClientFlag.Register(ctx, f) + + cmd.OutputFlag, ctx = flags.NewOutputFlag(ctx) + cmd.OutputFlag.Register(ctx, f) + + cmd.DatacenterFlag, ctx = flags.NewDatacenterFlag(ctx) + cmd.DatacenterFlag.Register(ctx, f) +} + +func (cmd *info) Process(ctx context.Context) error { + if err := cmd.ClientFlag.Process(ctx); err != nil { + return err + } + if err := cmd.OutputFlag.Process(ctx); err != nil { + return err + } + if err := cmd.DatacenterFlag.Process(ctx); err != nil { + return err + } + return nil +} + +func (cmd *info) Usage() string { + return "[PATH]..." +} + +func (cmd *info) Run(ctx context.Context, f *flag.FlagSet) error { + c, err := cmd.Client() + if err != nil { + return err + } + + finder, err := cmd.Finder() + if err != nil { + return err + } + + args := f.Args() + if len(args) == 0 { + args = []string{"*"} + } + + var props []string + res := infoResult{ + finder: finder, + ctx: ctx, + } + + if !cmd.OutputFlag.JSON { + props = []string{ + "name", + "vmFolder", + "hostFolder", + "datastoreFolder", + "networkFolder", + "datastore", + "network", + } + } + + for _, arg := range args { + objects, err := finder.DatacenterList(ctx, arg) + if err != nil { + return err + } + res.objects = append(res.objects, objects...) + } + + if len(res.objects) != 0 { + refs := make([]types.ManagedObjectReference, 0, len(res.objects)) + for _, o := range res.objects { + refs = append(refs, o.Reference()) + } + + pc := property.DefaultCollector(c) + err = pc.Retrieve(ctx, refs, props, &res.Datacenters) + if err != nil { + return err + } + } + + return cmd.WriteResult(&res) +} + +type infoResult struct { + Datacenters []mo.Datacenter + objects []*object.Datacenter + finder *find.Finder + ctx context.Context +} + +func (r *infoResult) Write(w io.Writer) error { + // Maintain order via r.objects as Property collector does not always return results in order. + objects := make(map[types.ManagedObjectReference]mo.Datacenter, len(r.Datacenters)) + for _, o := range r.Datacenters { + objects[o.Reference()] = o + } + + tw := tabwriter.NewWriter(w, 2, 0, 2, ' ', 0) + + for _, o := range r.objects { + dc := objects[o.Reference()] + fmt.Fprintf(tw, "Name:\t%s\n", dc.Name) + + folders, err := o.Folders(r.ctx) + if err != nil { + return err + } + + r.finder.SetDatacenter(o) + + hosts, _ := r.finder.HostSystemList(r.ctx, path.Join(folders.HostFolder.InventoryPath, "*")) + fmt.Fprintf(tw, " Hosts:\t%d\n", len(hosts)) + + clusters, _ := r.finder.ClusterComputeResourceList(r.ctx, path.Join(folders.HostFolder.InventoryPath, "*")) + fmt.Fprintf(tw, " Clusters:\t%d\n", len(clusters)) + + vms, _ := r.finder.VirtualMachineList(r.ctx, path.Join(folders.VmFolder.InventoryPath, "*")) + fmt.Fprintf(tw, " Virtual Machines:\t%d\n", len(vms)) + + fmt.Fprintf(tw, " Networks:\t%d\n", len(dc.Network)) + fmt.Fprintf(tw, " Datastores:\t%d\n", len(dc.Datastore)) + } + + return tw.Flush() +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/datastore/cp.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/datastore/cp.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/datastore/cp.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/datastore/cp.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,99 @@ +/* +Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package datastore + +import ( + "errors" + "flag" + + "github.com/vmware/govmomi/govc/cli" + "github.com/vmware/govmomi/govc/flags" + "github.com/vmware/govmomi/object" + "golang.org/x/net/context" +) + +type cp struct { + *flags.OutputFlag + *flags.DatastoreFlag + + force bool +} + +func init() { + cli.Register("datastore.cp", &cp{}) +} + +func (cmd *cp) Register(ctx context.Context, f *flag.FlagSet) { + cmd.OutputFlag, ctx = flags.NewOutputFlag(ctx) + cmd.OutputFlag.Register(ctx, f) + + cmd.DatastoreFlag, ctx = flags.NewDatastoreFlag(ctx) + cmd.DatastoreFlag.Register(ctx, f) + + f.BoolVar(&cmd.force, "f", false, "If true, overwrite any identically named file at the destination") +} + +func (cmd *cp) Process(ctx context.Context) error { + if err := cmd.OutputFlag.Process(ctx); err != nil { + return err + } + if err := cmd.DatastoreFlag.Process(ctx); err != nil { + return err + } + return nil +} + +func (cmd *cp) Usage() string { + return "SRC DST" +} + +func (cmd *cp) Run(ctx context.Context, f *flag.FlagSet) error { + args := f.Args() + if len(args) != 2 { + return errors.New("SRC and DST arguments are required") + } + + c, err := cmd.Client() + if err != nil { + return err + } + + dc, err := cmd.Datacenter() + if err != nil { + return err + } + + // TODO: support cross-datacenter copy + + src, err := cmd.DatastorePath(args[0]) + if err != nil { + return err + } + + dst, err := cmd.DatastorePath(args[1]) + if err != nil { + return err + } + + m := object.NewFileManager(c) + task, err := m.CopyDatastoreFile(context.TODO(), src, dc, dst, dc, cmd.force) + if err != nil { + return err + } + + return task.Wait(context.TODO()) +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/datastore/create.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/datastore/create.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/datastore/create.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/datastore/create.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,321 @@ +/* +Copyright (c) 2015-2016 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package datastore + +import ( + "errors" + "flag" + "fmt" + "os" + "path/filepath" + "strings" + + "github.com/vmware/govmomi/govc/cli" + "github.com/vmware/govmomi/govc/flags" + "github.com/vmware/govmomi/object" + "github.com/vmware/govmomi/vim25/soap" + "github.com/vmware/govmomi/vim25/types" + "golang.org/x/net/context" +) + +type create struct { + *flags.HostSystemFlag + + // Generic options + Type typeFlag + Name string + Force bool + + // Options for NAS + RemoteHost string + RemotePath string + AccessMode string + UserName string + Password string + + // Options for VMFS + DiskCanonicalName string + + // Options for local + Path string +} + +func init() { + cli.Register("datastore.create", &create{}) +} + +var nasTypes = []string{ + string(types.HostFileSystemVolumeFileSystemTypeNFS), + string(types.HostFileSystemVolumeFileSystemTypeNFS41), + string(types.HostFileSystemVolumeFileSystemTypeCIFS), +} + +var vmfsTypes = []string{ + string(types.HostFileSystemVolumeFileSystemTypeVMFS), +} + +var localTypes = []string{ + "local", +} + +var allTypes = []string{} + +func init() { + allTypes = append(allTypes, nasTypes...) + allTypes = append(allTypes, vmfsTypes...) + allTypes = append(allTypes, localTypes...) +} + +type typeFlag string + +func (t *typeFlag) Set(s string) error { + s = strings.ToLower(s) + for _, e := range allTypes { + if s == strings.ToLower(e) { + *t = typeFlag(e) + return nil + } + } + + return fmt.Errorf("unknown type") +} + +func (t *typeFlag) String() string { + return string(*t) +} + +func (t *typeFlag) partOf(m []string) bool { + for _, e := range m { + if t.String() == e { + return true + } + } + return false +} + +func (t *typeFlag) IsNasType() bool { + return t.partOf(nasTypes) +} + +func (t *typeFlag) IsVmfsType() bool { + return t.partOf(vmfsTypes) +} + +func (t *typeFlag) IsLocalType() bool { + return t.partOf(localTypes) +} + +func (cmd *create) Register(ctx context.Context, f *flag.FlagSet) { + cmd.HostSystemFlag, ctx = flags.NewHostSystemFlag(ctx) + cmd.HostSystemFlag.Register(ctx, f) + + modes := []string{ + string(types.HostMountModeReadOnly), + string(types.HostMountModeReadWrite), + } + + f.StringVar(&cmd.Name, "name", "", "Datastore name") + f.Var(&cmd.Type, "type", fmt.Sprintf("Datastore type (%s)", strings.Join(allTypes, "|"))) + f.BoolVar(&cmd.Force, "force", false, "Ignore DuplicateName error if datastore is already mounted on a host") + + // Options for NAS + f.StringVar(&cmd.RemoteHost, "remote-host", "", "Remote hostname of the NAS datastore") + f.StringVar(&cmd.RemotePath, "remote-path", "", "Remote path of the NFS mount point") + f.StringVar(&cmd.AccessMode, "mode", modes[0], + fmt.Sprintf("Access mode for the mount point (%s)", strings.Join(modes, "|"))) + f.StringVar(&cmd.UserName, "username", "", "Username to use when connecting (CIFS only)") + f.StringVar(&cmd.Password, "password", "", "Password to use when connecting (CIFS only)") + + // Options for VMFS + f.StringVar(&cmd.DiskCanonicalName, "disk", "", "Canonical name of disk (VMFS only)") + + // Options for Local + f.StringVar(&cmd.Path, "path", "", "Local directory path for the datastore (local only)") +} + +func (cmd *create) Process(ctx context.Context) error { + if err := cmd.HostSystemFlag.Process(ctx); err != nil { + return err + } + return nil +} + +func (cmd *create) Usage() string { + return "HOST..." +} + +func (cmd *create) Description() string { + return `Create datastore on HOST. + +Examples: + govc datastore.create -type nfs -name nfsDatastore -remote-host 10.143.2.232 -remote-path /share cluster1 + govc datastore.create -type vmfs -name vmfsDatastore -disk=mpx.vmhba0:C0:T0:L0 cluster1 + govc datastore.create -type local -name localDatastore -path /var/datastore host1` +} + +func (cmd *create) Run(ctx context.Context, f *flag.FlagSet) error { + hosts, err := cmd.HostSystems(f.Args()) + if err != nil { + return err + } + + switch { + case cmd.Type.IsNasType(): + return cmd.CreateNasDatastore(ctx, hosts) + case cmd.Type.IsVmfsType(): + return cmd.CreateVmfsDatastore(ctx, hosts) + case cmd.Type.IsLocalType(): + return cmd.CreateLocalDatastore(ctx, hosts) + default: + return fmt.Errorf("unhandled type %#v", cmd.Type) + } +} + +func (cmd *create) GetHostNasVolumeSpec() types.HostNasVolumeSpec { + localPath := cmd.Path + if localPath == "" { + localPath = cmd.Name + } + + s := types.HostNasVolumeSpec{ + LocalPath: localPath, + Type: cmd.Type.String(), + RemoteHost: cmd.RemoteHost, + RemotePath: cmd.RemotePath, + AccessMode: cmd.AccessMode, + UserName: cmd.UserName, + Password: cmd.Password, + } + + return s +} + +func (cmd *create) CreateNasDatastore(ctx context.Context, hosts []*object.HostSystem) error { + object := types.ManagedObjectReference{ + Type: "Datastore", + Value: fmt.Sprintf("%s:%s", cmd.RemoteHost, cmd.RemotePath), + } + + spec := cmd.GetHostNasVolumeSpec() + + for _, host := range hosts { + ds, err := host.ConfigManager().DatastoreSystem(ctx) + if err != nil { + return err + } + + _, err = ds.CreateNasDatastore(ctx, spec) + if err != nil { + if soap.IsSoapFault(err) { + switch fault := soap.ToSoapFault(err).VimFault().(type) { + case types.PlatformConfigFault: + if len(fault.FaultMessage) != 0 { + return errors.New(fault.FaultMessage[0].Message) + } + case types.DuplicateName: + if cmd.Force && fault.Object == object { + fmt.Fprintf(os.Stderr, "%s: '%s' already mounted\n", + host.InventoryPath, cmd.Name) + continue + } + } + } + + return fmt.Errorf("%s: %s", host.InventoryPath, err) + } + } + + return nil +} + +func (cmd *create) CreateVmfsDatastore(ctx context.Context, hosts []*object.HostSystem) error { + for _, host := range hosts { + ds, err := host.ConfigManager().DatastoreSystem(ctx) + if err != nil { + return err + } + + // Find the specified disk + disks, err := ds.QueryAvailableDisksForVmfs(ctx) + if err != nil { + return err + } + + var disk *types.HostScsiDisk + for _, e := range disks { + if e.CanonicalName == cmd.DiskCanonicalName { + disk = &e + break + } + } + + if disk == nil { + return fmt.Errorf("no eligible disk found for name %#v", cmd.DiskCanonicalName) + } + + // Query for creation options and pick the right one + options, err := ds.QueryVmfsDatastoreCreateOptions(ctx, disk.DevicePath) + if err != nil { + return err + } + + var option *types.VmfsDatastoreOption + for _, e := range options { + if _, ok := e.Info.(*types.VmfsDatastoreAllExtentOption); ok { + option = &e + break + } + } + + if option == nil { + return fmt.Errorf("cannot use entire disk for datastore for name %#v", cmd.DiskCanonicalName) + } + + spec := *option.Spec.(*types.VmfsDatastoreCreateSpec) + spec.Vmfs.VolumeName = cmd.Name + _, err = ds.CreateVmfsDatastore(ctx, spec) + if err != nil { + return err + } + } + + return nil +} + +func (cmd *create) CreateLocalDatastore(ctx context.Context, hosts []*object.HostSystem) error { + for _, host := range hosts { + ds, err := host.ConfigManager().DatastoreSystem(ctx) + if err != nil { + return err + } + + if cmd.Path == "" { + cmd.Path = cmd.Name + } + + if cmd.Name == "" { + cmd.Name = filepath.Base(cmd.Path) + } + + _, err = ds.CreateLocalDatastore(ctx, cmd.Name, cmd.Path) + if err != nil { + return err + } + } + + return nil +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/datastore/download.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/datastore/download.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/datastore/download.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/datastore/download.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,73 @@ +/* +Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package datastore + +import ( + "errors" + "flag" + + "golang.org/x/net/context" + + "github.com/vmware/govmomi/govc/cli" + "github.com/vmware/govmomi/govc/flags" + "github.com/vmware/govmomi/vim25/soap" +) + +type download struct { + *flags.DatastoreFlag +} + +func init() { + cli.Register("datastore.download", &download{}) +} + +func (cmd *download) Register(ctx context.Context, f *flag.FlagSet) { + cmd.DatastoreFlag, ctx = flags.NewDatastoreFlag(ctx) + cmd.DatastoreFlag.Register(ctx, f) +} + +func (cmd *download) Process(ctx context.Context) error { + if err := cmd.DatastoreFlag.Process(ctx); err != nil { + return err + } + return nil +} + +func (cmd *download) Usage() string { + return "REMOTE LOCAL" +} + +func (cmd *download) Run(ctx context.Context, f *flag.FlagSet) error { + args := f.Args() + if len(args) != 2 { + return errors.New("invalid arguments") + } + + ds, err := cmd.Datastore() + if err != nil { + return err + } + + p := soap.DefaultDownload + if cmd.OutputFlag.TTY { + logger := cmd.ProgressLogger("Downloading... ") + p.Progress = logger + defer logger.Wait() + } + + return ds.DownloadFile(context.TODO(), args[0], args[1], &p) +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/datastore/info.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/datastore/info.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/datastore/info.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/datastore/info.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,153 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package datastore + +import ( + "flag" + "fmt" + "io" + "os" + "text/tabwriter" + + "github.com/vmware/govmomi/govc/cli" + "github.com/vmware/govmomi/govc/flags" + "github.com/vmware/govmomi/object" + "github.com/vmware/govmomi/property" + "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/types" + "golang.org/x/net/context" +) + +type info struct { + *flags.ClientFlag + *flags.OutputFlag + *flags.DatacenterFlag +} + +func init() { + cli.Register("datastore.info", &info{}) +} + +func (cmd *info) Register(ctx context.Context, f *flag.FlagSet) { + cmd.ClientFlag, ctx = flags.NewClientFlag(ctx) + cmd.ClientFlag.Register(ctx, f) + + cmd.OutputFlag, ctx = flags.NewOutputFlag(ctx) + cmd.OutputFlag.Register(ctx, f) + + cmd.DatacenterFlag, ctx = flags.NewDatacenterFlag(ctx) + cmd.DatacenterFlag.Register(ctx, f) +} + +func (cmd *info) Process(ctx context.Context) error { + if err := cmd.ClientFlag.Process(ctx); err != nil { + return err + } + if err := cmd.OutputFlag.Process(ctx); err != nil { + return err + } + if err := cmd.DatacenterFlag.Process(ctx); err != nil { + return err + } + return nil +} + +func (cmd *info) Usage() string { + return "[PATH]..." +} + +func (cmd *info) Run(ctx context.Context, f *flag.FlagSet) error { + c, err := cmd.Client() + if err != nil { + return err + } + + finder, err := cmd.Finder() + if err != nil { + return err + } + + args := f.Args() + if len(args) == 0 { + args = []string{"*"} + } + + var res infoResult + var props []string + + if cmd.OutputFlag.JSON { + props = nil // Load everything + } else { + props = []string{"info", "summary"} // Load summary + } + + for _, arg := range args { + objects, err := finder.DatastoreList(ctx, arg) + if err != nil { + return err + } + res.objects = append(res.objects, objects...) + } + + if len(res.objects) != 0 { + refs := make([]types.ManagedObjectReference, 0, len(res.objects)) + for _, o := range res.objects { + refs = append(refs, o.Reference()) + } + + pc := property.DefaultCollector(c) + err = pc.Retrieve(ctx, refs, props, &res.Datastores) + if err != nil { + return err + } + } + + return cmd.WriteResult(&res) +} + +type infoResult struct { + Datastores []mo.Datastore + objects []*object.Datastore +} + +func (r *infoResult) Write(w io.Writer) error { + // Maintain order via r.objects as Property collector does not always return results in order. + objects := make(map[types.ManagedObjectReference]mo.Datastore, len(r.Datastores)) + for _, o := range r.Datastores { + objects[o.Reference()] = o + } + + tw := tabwriter.NewWriter(os.Stdout, 2, 0, 2, ' ', 0) + + for _, o := range r.objects { + ds := objects[o.Reference()] + s := ds.Summary + fmt.Fprintf(tw, "Name:\t%s\n", s.Name) + fmt.Fprintf(tw, " Path:\t%s\n", o.InventoryPath) + fmt.Fprintf(tw, " Type:\t%s\n", s.Type) + fmt.Fprintf(tw, " URL:\t%s\n", s.Url) + fmt.Fprintf(tw, " Capacity:\t%.1f GB\n", float64(s.Capacity)/(1<<30)) + fmt.Fprintf(tw, " Free:\t%.1f GB\n", float64(s.FreeSpace)/(1<<30)) + + switch info := ds.Info.(type) { + case *types.NasDatastoreInfo: + fmt.Fprintf(tw, " Remote:\t%s:%s\n", info.Nas.RemoteHost, info.Nas.RemotePath) + } + } + + return tw.Flush() +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/datastore/ls.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/datastore/ls.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/datastore/ls.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/datastore/ls.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,232 @@ +/* +Copyright (c) 2014-2016 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package datastore + +import ( + "encoding/json" + "flag" + "fmt" + "io" + "path" + "text/tabwriter" + + "github.com/vmware/govmomi/govc/cli" + "github.com/vmware/govmomi/govc/flags" + "github.com/vmware/govmomi/object" + "github.com/vmware/govmomi/units" + "github.com/vmware/govmomi/vim25/types" + "golang.org/x/net/context" +) + +type ls struct { + *flags.DatastoreFlag + *flags.OutputFlag + + long bool + slash bool + all bool +} + +func init() { + cli.Register("datastore.ls", &ls{}) +} + +func (cmd *ls) Register(ctx context.Context, f *flag.FlagSet) { + cmd.DatastoreFlag, ctx = flags.NewDatastoreFlag(ctx) + cmd.DatastoreFlag.Register(ctx, f) + + cmd.OutputFlag, ctx = flags.NewOutputFlag(ctx) + cmd.OutputFlag.Register(ctx, f) + + f.BoolVar(&cmd.long, "l", false, "Long listing format") + f.BoolVar(&cmd.slash, "p", false, "Write a slash (`/') after each filename if that file is a directory") + f.BoolVar(&cmd.all, "a", false, "Include entries whose names begin with a dot (.)") +} + +func (cmd *ls) Process(ctx context.Context) error { + if err := cmd.DatastoreFlag.Process(ctx); err != nil { + return err + } + if err := cmd.OutputFlag.Process(ctx); err != nil { + return err + } + return nil +} + +func (cmd *ls) Usage() string { + return "[FILE]..." +} + +func (cmd *ls) Run(ctx context.Context, f *flag.FlagSet) error { + ds, err := cmd.Datastore() + if err != nil { + return err + } + + b, err := ds.Browser(context.TODO()) + if err != nil { + return err + } + + args := f.Args() + if len(args) == 0 { + args = []string{""} + } + + result := &listOutput{ + rs: make([]types.HostDatastoreBrowserSearchResults, 0), + cmd: cmd, + } + + for _, arg := range args { + spec := types.HostDatastoreBrowserSearchSpec{ + MatchPattern: []string{"*"}, + } + + if cmd.long { + spec.Details = &types.FileQueryFlags{ + FileType: true, + FileSize: true, + FileOwner: types.NewBool(true), // TODO: omitempty is generated, but seems to be required + Modification: true, + } + } + + for i := 0; ; i++ { + r, err := cmd.ListPath(b, arg, spec) + if err != nil { + // Treat the argument as a match pattern if not found as directory + if i == 0 && types.IsFileNotFound(err) { + spec.MatchPattern[0] = path.Base(arg) + arg = path.Dir(arg) + continue + } + + return err + } + + // Treat an empty result against match pattern as file not found + if i == 1 && len(r.File) == 0 { + return fmt.Errorf("File %s/%s was not found", r.FolderPath, spec.MatchPattern[0]) + } + + result.add(r) + break + } + } + + return cmd.WriteResult(result) +} + +func (cmd *ls) ListPath(b *object.HostDatastoreBrowser, path string, spec types.HostDatastoreBrowserSearchSpec) (types.HostDatastoreBrowserSearchResults, error) { + var res types.HostDatastoreBrowserSearchResults + + path, err := cmd.DatastorePath(path) + if err != nil { + return res, err + } + + task, err := b.SearchDatastore(context.TODO(), path, &spec) + if err != nil { + return res, err + } + + info, err := task.WaitForResult(context.TODO(), nil) + if err != nil { + return res, err + } + + res = info.Result.(types.HostDatastoreBrowserSearchResults) + return res, nil +} + +type listOutput struct { + rs []types.HostDatastoreBrowserSearchResults + cmd *ls +} + +func (o *listOutput) add(r types.HostDatastoreBrowserSearchResults) { + res := r + res.File = nil + + for _, f := range r.File { + if f.GetFileInfo().Path[0] == '.' && !o.cmd.all { + continue + } + + if o.cmd.slash { + if d, ok := f.(*types.FolderFileInfo); ok { + d.Path += "/" + } + } + + res.File = append(res.File, f) + } + + o.rs = append(o.rs, res) +} + +// hasMultiplePaths returns whether or not the slice of search results contains +// results from more than one folder path. +func (o *listOutput) hasMultiplePaths() bool { + if len(o.rs) == 0 { + return false + } + + p := o.rs[0].FolderPath + + // Multiple paths if any entry is not equal to the first one. + for _, e := range o.rs { + if e.FolderPath != p { + return true + } + } + + return false +} + +func (o *listOutput) MarshalJSON() ([]byte, error) { + return json.Marshal(o.rs) +} + +func (o *listOutput) Write(w io.Writer) error { + // Only include path header if we're dealing with more than one path. + includeHeader := false + if o.hasMultiplePaths() { + includeHeader = true + } + + tw := tabwriter.NewWriter(w, 3, 0, 2, ' ', 0) + for i, r := range o.rs { + if includeHeader { + if i > 0 { + fmt.Fprintf(tw, "\n") + } + fmt.Fprintf(tw, "%s:\n", r.FolderPath) + } + for _, file := range r.File { + info := file.GetFileInfo() + if o.cmd.long { + fmt.Fprintf(tw, "%s\t%s\t%s\n", units.ByteSize(info.FileSize), info.Modification.Format("Mon Jan 2 15:04:05 2006"), info.Path) + } else { + fmt.Fprintf(tw, "%s\n", info.Path) + } + } + } + tw.Flush() + return nil +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/datastore/mkdir.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/datastore/mkdir.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/datastore/mkdir.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/datastore/mkdir.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,118 @@ +/* +Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package datastore + +import ( + "errors" + "flag" + "fmt" + + "github.com/vmware/govmomi/govc/cli" + "github.com/vmware/govmomi/govc/flags" + "github.com/vmware/govmomi/object" + "github.com/vmware/govmomi/vim25/soap" + "github.com/vmware/govmomi/vim25/types" + "golang.org/x/net/context" +) + +type mkdir struct { + *flags.DatastoreFlag + + createParents bool + isNamespace bool +} + +func init() { + cli.Register("datastore.mkdir", &mkdir{}) +} + +func (cmd *mkdir) Register(ctx context.Context, f *flag.FlagSet) { + cmd.DatastoreFlag, ctx = flags.NewDatastoreFlag(ctx) + cmd.DatastoreFlag.Register(ctx, f) + + f.BoolVar(&cmd.createParents, "p", false, "Create intermediate directories as needed") + f.BoolVar(&cmd.isNamespace, "namespace", false, "Return uuid of namespace created on vsan datastore") +} + +func (cmd *mkdir) Process(ctx context.Context) error { + if err := cmd.DatastoreFlag.Process(ctx); err != nil { + return err + } + return nil +} + +func (cmd *mkdir) Usage() string { + return "DIRECTORY" +} + +func (cmd *mkdir) Run(ctx context.Context, f *flag.FlagSet) error { + args := f.Args() + if len(args) == 0 { + return errors.New("missing operand") + } + + c, err := cmd.Client() + if err != nil { + return err + } + + if cmd.isNamespace { + var uuid string + var ds *object.Datastore + + if ds, err = cmd.Datastore(); err != nil { + return err + } + + path := args[0] + + nm := object.NewDatastoreNamespaceManager(c) + if uuid, err = nm.CreateDirectory(ctx, ds, path, ""); err != nil { + return err + } + + fmt.Println(uuid) + } else { + var dc *object.Datacenter + var path string + + dc, err = cmd.Datacenter() + if err != nil { + return err + } + + path, err = cmd.DatastorePath(args[0]) + if err != nil { + return err + } + + m := object.NewFileManager(c) + err = m.MakeDirectory(ctx, path, dc, cmd.createParents) + + // ignore EEXIST if -p flag is given + if err != nil && cmd.createParents { + if soap.IsSoapFault(err) { + soapFault := soap.ToSoapFault(err) + if _, ok := soapFault.VimFault().(types.FileAlreadyExists); ok { + return nil + } + } + } + } + + return err +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/datastore/mv.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/datastore/mv.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/datastore/mv.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/datastore/mv.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,92 @@ +/* +Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package datastore + +import ( + "errors" + "flag" + + "github.com/vmware/govmomi/govc/cli" + "github.com/vmware/govmomi/govc/flags" + "github.com/vmware/govmomi/object" + "golang.org/x/net/context" +) + +type mv struct { + *flags.DatastoreFlag + + force bool +} + +func init() { + cli.Register("datastore.mv", &mv{}) +} + +func (cmd *mv) Register(ctx context.Context, f *flag.FlagSet) { + cmd.DatastoreFlag, ctx = flags.NewDatastoreFlag(ctx) + cmd.DatastoreFlag.Register(ctx, f) + + f.BoolVar(&cmd.force, "f", false, "If true, overwrite any identically named file at the destination") +} + +func (cmd *mv) Process(ctx context.Context) error { + if err := cmd.DatastoreFlag.Process(ctx); err != nil { + return err + } + return nil +} + +func (cmd *mv) Usage() string { + return "SRC DST" +} + +func (cmd *mv) Run(ctx context.Context, f *flag.FlagSet) error { + args := f.Args() + if len(args) != 2 { + return errors.New("SRC and DST arguments are required") + } + + c, err := cmd.Client() + if err != nil { + return err + } + + dc, err := cmd.Datacenter() + if err != nil { + return err + } + + // TODO: support cross-datacenter move + + src, err := cmd.DatastorePath(args[0]) + if err != nil { + return err + } + + dst, err := cmd.DatastorePath(args[1]) + if err != nil { + return err + } + + m := object.NewFileManager(c) + task, err := m.MoveDatastoreFile(context.TODO(), src, dc, dst, dc, cmd.force) + if err != nil { + return err + } + + return task.Wait(context.TODO()) +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/datastore/remove.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/datastore/remove.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/datastore/remove.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/datastore/remove.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,90 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package datastore + +import ( + "flag" + + "golang.org/x/net/context" + + "github.com/vmware/govmomi/govc/cli" + "github.com/vmware/govmomi/govc/flags" +) + +type remove struct { + *flags.HostSystemFlag + *flags.DatastoreFlag +} + +func init() { + cli.Register("datastore.remove", &remove{}) +} + +func (cmd *remove) Register(ctx context.Context, f *flag.FlagSet) { + cmd.HostSystemFlag, ctx = flags.NewHostSystemFlag(ctx) + cmd.HostSystemFlag.Register(ctx, f) + + cmd.DatastoreFlag, ctx = flags.NewDatastoreFlag(ctx) + cmd.DatastoreFlag.Register(ctx, f) +} + +func (cmd *remove) Process(ctx context.Context) error { + if err := cmd.HostSystemFlag.Process(ctx); err != nil { + return err + } + if err := cmd.DatastoreFlag.Process(ctx); err != nil { + return err + } + return nil +} + +func (cmd *remove) Usage() string { + return "HOST..." +} + +func (cmd *remove) Description() string { + return `Remove datastore from HOST. +Example: +govc datastore.remove -ds nfsDatastore cluster1 +` +} + +func (cmd *remove) Run(ctx context.Context, f *flag.FlagSet) error { + ds, err := cmd.Datastore() + if err != nil { + return err + } + + hosts, err := cmd.HostSystems(f.Args()) + if err != nil { + return err + } + + for _, host := range hosts { + hds, err := host.ConfigManager().DatastoreSystem(ctx) + if err != nil { + return err + } + + err = hds.Remove(ctx, ds) + if err != nil { + return err + } + } + + return nil +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/datastore/rm.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/datastore/rm.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/datastore/rm.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/datastore/rm.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,110 @@ +/* +Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package datastore + +import ( + "errors" + "flag" + + "github.com/vmware/govmomi/govc/cli" + "github.com/vmware/govmomi/govc/flags" + "github.com/vmware/govmomi/object" + "github.com/vmware/govmomi/vim25/types" + "golang.org/x/net/context" +) + +type rm struct { + *flags.DatastoreFlag + + force bool + isNamespace bool +} + +func init() { + cli.Register("datastore.rm", &rm{}) + cli.Alias("datastore.rm", "datastore.delete") +} + +func (cmd *rm) Register(ctx context.Context, f *flag.FlagSet) { + cmd.DatastoreFlag, ctx = flags.NewDatastoreFlag(ctx) + cmd.DatastoreFlag.Register(ctx, f) + + f.BoolVar(&cmd.force, "f", false, "Force; ignore nonexistent files and arguments") + f.BoolVar(&cmd.isNamespace, "namespace", false, "Path is uuid of namespace on vsan datastore") +} + +func (cmd *rm) Process(ctx context.Context) error { + if err := cmd.DatastoreFlag.Process(ctx); err != nil { + return err + } + return nil +} + +func (cmd *rm) Usage() string { + return "FILE" +} + +func (cmd *rm) Run(ctx context.Context, f *flag.FlagSet) error { + args := f.Args() + if len(args) == 0 { + return errors.New("missing operand") + } + + c, err := cmd.Client() + if err != nil { + return err + } + + var dc *object.Datacenter + dc, err = cmd.Datacenter() + if err != nil { + return err + } + + if cmd.isNamespace { + path := args[0] + + nm := object.NewDatastoreNamespaceManager(c) + err = nm.DeleteDirectory(ctx, dc, path) + } else { + var path string + var task *object.Task + + // TODO(PN): Accept multiple args + path, err = cmd.DatastorePath(args[0]) + if err != nil { + return err + } + + m := object.NewFileManager(c) + task, err = m.DeleteDatastoreFile(ctx, path, dc) + if err != nil { + return err + } + + err = task.Wait(ctx) + } + + if err != nil { + if types.IsFileNotFound(err) && cmd.force { + // Ignore error + return nil + } + } + + return err +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/datastore/upload.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/datastore/upload.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/datastore/upload.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/datastore/upload.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,80 @@ +/* +Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package datastore + +import ( + "errors" + "flag" + + "golang.org/x/net/context" + + "github.com/vmware/govmomi/govc/cli" + "github.com/vmware/govmomi/govc/flags" + "github.com/vmware/govmomi/vim25/soap" +) + +type upload struct { + *flags.OutputFlag + *flags.DatastoreFlag +} + +func init() { + cli.Register("datastore.upload", &upload{}) +} + +func (cmd *upload) Register(ctx context.Context, f *flag.FlagSet) { + cmd.OutputFlag, ctx = flags.NewOutputFlag(ctx) + cmd.OutputFlag.Register(ctx, f) + + cmd.DatastoreFlag, ctx = flags.NewDatastoreFlag(ctx) + cmd.DatastoreFlag.Register(ctx, f) +} + +func (cmd *upload) Process(ctx context.Context) error { + if err := cmd.OutputFlag.Process(ctx); err != nil { + return err + } + if err := cmd.DatastoreFlag.Process(ctx); err != nil { + return err + } + return nil +} + +func (cmd *upload) Usage() string { + return "LOCAL REMOTE" +} + +func (cmd *upload) Run(ctx context.Context, f *flag.FlagSet) error { + args := f.Args() + if len(args) != 2 { + return errors.New("invalid arguments") + } + + ds, err := cmd.Datastore() + if err != nil { + return err + } + + p := soap.DefaultUpload + if cmd.OutputFlag.TTY { + logger := cmd.ProgressLogger("Uploading... ") + p.Progress = logger + defer logger.Wait() + } + + return ds.UploadFile(context.TODO(), args[0], args[1], &p) +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/device/boot.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/device/boot.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/device/boot.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/device/boot.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,83 @@ +/* +Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package device + +import ( + "flag" + "strings" + + "github.com/vmware/govmomi/govc/cli" + "github.com/vmware/govmomi/govc/flags" + "github.com/vmware/govmomi/vim25/types" + "golang.org/x/net/context" +) + +type boot struct { + *flags.VirtualMachineFlag + + order string + types.VirtualMachineBootOptions +} + +func init() { + cli.Register("device.boot", &boot{}) +} + +func (cmd *boot) Register(ctx context.Context, f *flag.FlagSet) { + cmd.VirtualMachineFlag, ctx = flags.NewVirtualMachineFlag(ctx) + cmd.VirtualMachineFlag.Register(ctx, f) + + f.Int64Var(&cmd.BootDelay, "delay", 0, "Delay in ms before starting the boot sequence") + f.StringVar(&cmd.order, "order", "", "Boot device order") + f.Int64Var(&cmd.BootRetryDelay, "retry-delay", 0, "Delay in ms before a boot retry") + + cmd.BootRetryEnabled = types.NewBool(false) + f.BoolVar(cmd.BootRetryEnabled, "retry", false, "If true, retry boot after retry-delay") + + cmd.EnterBIOSSetup = types.NewBool(false) + f.BoolVar(cmd.EnterBIOSSetup, "setup", false, "If true, enter BIOS setup on next boot") +} + +func (cmd *boot) Process(ctx context.Context) error { + if err := cmd.VirtualMachineFlag.Process(ctx); err != nil { + return err + } + return nil +} + +func (cmd *boot) Run(ctx context.Context, f *flag.FlagSet) error { + vm, err := cmd.VirtualMachine() + if err != nil { + return err + } + + if vm == nil { + return flag.ErrHelp + } + + devices, err := vm.Device(context.TODO()) + if err != nil { + return err + } + + if cmd.order != "" { + o := strings.Split(cmd.order, ",") + cmd.BootOrder = devices.BootOrder(o) + } + + return vm.SetBootOptions(context.TODO(), &cmd.VirtualMachineBootOptions) +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/device/cdrom/add.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/device/cdrom/add.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/device/cdrom/add.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/device/cdrom/add.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,95 @@ +/* +Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package cdrom + +import ( + "flag" + "fmt" + + "github.com/vmware/govmomi/govc/cli" + "github.com/vmware/govmomi/govc/flags" + "golang.org/x/net/context" +) + +type add struct { + *flags.VirtualMachineFlag + + controller string +} + +func init() { + cli.Register("device.cdrom.add", &add{}) +} + +func (cmd *add) Register(ctx context.Context, f *flag.FlagSet) { + cmd.VirtualMachineFlag, ctx = flags.NewVirtualMachineFlag(ctx) + cmd.VirtualMachineFlag.Register(ctx, f) + + f.StringVar(&cmd.controller, "controller", "", "IDE controller name") +} + +func (cmd *add) Process(ctx context.Context) error { + if err := cmd.VirtualMachineFlag.Process(ctx); err != nil { + return err + } + return nil +} + +func (cmd *add) Run(ctx context.Context, f *flag.FlagSet) error { + vm, err := cmd.VirtualMachine() + if err != nil { + return err + } + + if vm == nil { + return flag.ErrHelp + } + + devices, err := vm.Device(context.TODO()) + if err != nil { + return err + } + + c, err := devices.FindIDEController(cmd.controller) + if err != nil { + return err + } + + d, err := devices.CreateCdrom(c) + if err != nil { + return err + } + + err = vm.AddDevice(context.TODO(), d) + if err != nil { + return err + } + + // output name of device we just created + devices, err = vm.Device(context.TODO()) + if err != nil { + return err + } + + devices = devices.SelectByType(d) + + name := devices.Name(devices[len(devices)-1]) + + fmt.Println(name) + + return nil +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/device/cdrom/eject.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/device/cdrom/eject.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/device/cdrom/eject.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/device/cdrom/eject.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,78 @@ +/* +Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package cdrom + +import ( + "flag" + + "github.com/vmware/govmomi/govc/cli" + "github.com/vmware/govmomi/govc/flags" + "golang.org/x/net/context" +) + +type eject struct { + *flags.VirtualMachineFlag + + device string +} + +func init() { + cli.Register("device.cdrom.eject", &eject{}) +} + +func (cmd *eject) Register(ctx context.Context, f *flag.FlagSet) { + cmd.VirtualMachineFlag, ctx = flags.NewVirtualMachineFlag(ctx) + cmd.VirtualMachineFlag.Register(ctx, f) + + f.StringVar(&cmd.device, "device", "", "CD-ROM device name") +} + +func (cmd *eject) Process(ctx context.Context) error { + if err := cmd.VirtualMachineFlag.Process(ctx); err != nil { + return err + } + return nil +} + +func (cmd *eject) Description() string { + return `Eject media from CD-ROM device. + +If device is not specified, the first CD-ROM device is used.` +} + +func (cmd *eject) Run(ctx context.Context, f *flag.FlagSet) error { + vm, err := cmd.VirtualMachine() + if err != nil { + return err + } + + if vm == nil { + return flag.ErrHelp + } + + devices, err := vm.Device(context.TODO()) + if err != nil { + return err + } + + c, err := devices.FindCdrom(cmd.device) + if err != nil { + return err + } + + return vm.EditDevice(context.TODO(), devices.EjectIso(c)) +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/device/cdrom/insert.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/device/cdrom/insert.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/device/cdrom/insert.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/device/cdrom/insert.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,93 @@ +/* +Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package cdrom + +import ( + "flag" + + "github.com/vmware/govmomi/govc/cli" + "github.com/vmware/govmomi/govc/flags" + "golang.org/x/net/context" +) + +type insert struct { + *flags.DatastoreFlag + *flags.VirtualMachineFlag + + device string +} + +func init() { + cli.Register("device.cdrom.insert", &insert{}) +} + +func (cmd *insert) Register(ctx context.Context, f *flag.FlagSet) { + cmd.DatastoreFlag, ctx = flags.NewDatastoreFlag(ctx) + cmd.DatastoreFlag.Register(ctx, f) + cmd.VirtualMachineFlag, ctx = flags.NewVirtualMachineFlag(ctx) + cmd.VirtualMachineFlag.Register(ctx, f) + + f.StringVar(&cmd.device, "device", "", "CD-ROM device name") +} + +func (cmd *insert) Process(ctx context.Context) error { + if err := cmd.DatastoreFlag.Process(ctx); err != nil { + return err + } + if err := cmd.VirtualMachineFlag.Process(ctx); err != nil { + return err + } + return nil +} + +func (cmd *insert) Usage() string { + return "ISO" +} + +func (cmd *insert) Description() string { + return `Insert media on datastore into CD-ROM device. + +If device is not specified, the first CD-ROM device is used.` +} + +func (cmd *insert) Run(ctx context.Context, f *flag.FlagSet) error { + vm, err := cmd.VirtualMachine() + if err != nil { + return err + } + + if vm == nil || f.NArg() != 1 { + return flag.ErrHelp + } + + devices, err := vm.Device(context.TODO()) + if err != nil { + return err + } + + c, err := devices.FindCdrom(cmd.device) + if err != nil { + return err + } + + iso, err := cmd.DatastorePath(f.Arg(0)) + if err != nil { + return nil + } + + return vm.EditDevice(context.TODO(), devices.InsertIso(c, iso)) +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/device/connect.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/device/connect.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/device/connect.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/device/connect.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,83 @@ +/* +Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package device + +import ( + "flag" + "fmt" + + "github.com/vmware/govmomi/govc/cli" + "github.com/vmware/govmomi/govc/flags" + "golang.org/x/net/context" +) + +type connect struct { + *flags.VirtualMachineFlag +} + +func init() { + cli.Register("device.connect", &connect{}) +} + +func (cmd *connect) Register(ctx context.Context, f *flag.FlagSet) { + cmd.VirtualMachineFlag, ctx = flags.NewVirtualMachineFlag(ctx) + cmd.VirtualMachineFlag.Register(ctx, f) +} + +func (cmd *connect) Process(ctx context.Context) error { + if err := cmd.VirtualMachineFlag.Process(ctx); err != nil { + return err + } + return nil +} + +func (cmd *connect) Usage() string { + return "DEVICE..." +} + +func (cmd *connect) Run(ctx context.Context, f *flag.FlagSet) error { + vm, err := cmd.VirtualMachine() + if err != nil { + return err + } + + if vm == nil { + return flag.ErrHelp + } + + devices, err := vm.Device(context.TODO()) + if err != nil { + return err + } + + for _, name := range f.Args() { + device := devices.Find(name) + if device == nil { + return fmt.Errorf("device '%s' not found", name) + } + + if err = devices.Connect(device); err != nil { + return err + } + + if err = vm.EditDevice(context.TODO(), device); err != nil { + return err + } + } + + return nil +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/device/disconnect.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/device/disconnect.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/device/disconnect.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/device/disconnect.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,83 @@ +/* +Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package device + +import ( + "flag" + "fmt" + + "github.com/vmware/govmomi/govc/cli" + "github.com/vmware/govmomi/govc/flags" + "golang.org/x/net/context" +) + +type disconnect struct { + *flags.VirtualMachineFlag +} + +func init() { + cli.Register("device.disconnect", &disconnect{}) +} + +func (cmd *disconnect) Register(ctx context.Context, f *flag.FlagSet) { + cmd.VirtualMachineFlag, ctx = flags.NewVirtualMachineFlag(ctx) + cmd.VirtualMachineFlag.Register(ctx, f) +} + +func (cmd *disconnect) Process(ctx context.Context) error { + if err := cmd.VirtualMachineFlag.Process(ctx); err != nil { + return err + } + return nil +} + +func (cmd *disconnect) Usage() string { + return "DEVICE..." +} + +func (cmd *disconnect) Run(ctx context.Context, f *flag.FlagSet) error { + vm, err := cmd.VirtualMachine() + if err != nil { + return err + } + + if vm == nil { + return flag.ErrHelp + } + + devices, err := vm.Device(context.TODO()) + if err != nil { + return err + } + + for _, name := range f.Args() { + device := devices.Find(name) + if device == nil { + return fmt.Errorf("device '%s' not found", name) + } + + if err = devices.Disconnect(device); err != nil { + return err + } + + if err = vm.EditDevice(context.TODO(), device); err != nil { + return err + } + } + + return nil +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/device/floppy/add.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/device/floppy/add.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/device/floppy/add.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/device/floppy/add.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,86 @@ +/* +Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package floppy + +import ( + "flag" + "fmt" + + "github.com/vmware/govmomi/govc/cli" + "github.com/vmware/govmomi/govc/flags" + "golang.org/x/net/context" +) + +type add struct { + *flags.VirtualMachineFlag +} + +func init() { + cli.Register("device.floppy.add", &add{}) +} + +func (cmd *add) Register(ctx context.Context, f *flag.FlagSet) { + cmd.VirtualMachineFlag, ctx = flags.NewVirtualMachineFlag(ctx) + cmd.VirtualMachineFlag.Register(ctx, f) +} + +func (cmd *add) Process(ctx context.Context) error { + if err := cmd.VirtualMachineFlag.Process(ctx); err != nil { + return err + } + return nil +} + +func (cmd *add) Run(ctx context.Context, f *flag.FlagSet) error { + vm, err := cmd.VirtualMachine() + if err != nil { + return err + } + + if vm == nil { + return flag.ErrHelp + } + + devices, err := vm.Device(context.TODO()) + if err != nil { + return err + } + + d, err := devices.CreateFloppy() + if err != nil { + return err + } + + err = vm.AddDevice(context.TODO(), d) + if err != nil { + return err + } + + // output name of device we just created + devices, err = vm.Device(context.TODO()) + if err != nil { + return err + } + + devices = devices.SelectByType(d) + + name := devices.Name(devices[len(devices)-1]) + + fmt.Println(name) + + return nil +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/device/floppy/eject.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/device/floppy/eject.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/device/floppy/eject.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/device/floppy/eject.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,78 @@ +/* +Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package floppy + +import ( + "flag" + + "github.com/vmware/govmomi/govc/cli" + "github.com/vmware/govmomi/govc/flags" + "golang.org/x/net/context" +) + +type eject struct { + *flags.VirtualMachineFlag + + device string +} + +func init() { + cli.Register("device.floppy.eject", &eject{}) +} + +func (cmd *eject) Register(ctx context.Context, f *flag.FlagSet) { + cmd.VirtualMachineFlag, ctx = flags.NewVirtualMachineFlag(ctx) + cmd.VirtualMachineFlag.Register(ctx, f) + + f.StringVar(&cmd.device, "device", "", "Floppy device name") +} + +func (cmd *eject) Process(ctx context.Context) error { + if err := cmd.VirtualMachineFlag.Process(ctx); err != nil { + return err + } + return nil +} + +func (cmd *eject) Description() string { + return `Eject image from floppy device. + +If device is not specified, the first floppy device is used.` +} + +func (cmd *eject) Run(ctx context.Context, f *flag.FlagSet) error { + vm, err := cmd.VirtualMachine() + if err != nil { + return err + } + + if vm == nil { + return flag.ErrHelp + } + + devices, err := vm.Device(context.TODO()) + if err != nil { + return err + } + + c, err := devices.FindFloppy(cmd.device) + if err != nil { + return err + } + + return vm.EditDevice(context.TODO(), devices.EjectImg(c)) +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/device/floppy/insert.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/device/floppy/insert.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/device/floppy/insert.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/device/floppy/insert.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,93 @@ +/* +Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package floppy + +import ( + "flag" + + "github.com/vmware/govmomi/govc/cli" + "github.com/vmware/govmomi/govc/flags" + "golang.org/x/net/context" +) + +type insert struct { + *flags.DatastoreFlag + *flags.VirtualMachineFlag + + device string +} + +func init() { + cli.Register("device.floppy.insert", &insert{}) +} + +func (cmd *insert) Register(ctx context.Context, f *flag.FlagSet) { + cmd.DatastoreFlag, ctx = flags.NewDatastoreFlag(ctx) + cmd.DatastoreFlag.Register(ctx, f) + cmd.VirtualMachineFlag, ctx = flags.NewVirtualMachineFlag(ctx) + cmd.VirtualMachineFlag.Register(ctx, f) + + f.StringVar(&cmd.device, "device", "", "Floppy device name") +} + +func (cmd *insert) Process(ctx context.Context) error { + if err := cmd.DatastoreFlag.Process(ctx); err != nil { + return err + } + if err := cmd.VirtualMachineFlag.Process(ctx); err != nil { + return err + } + return nil +} + +func (cmd *insert) Usage() string { + return "IMG" +} + +func (cmd *insert) Description() string { + return `Insert image on datastore into floppy device. + +If device is not specified, the first floppy device is used.` +} + +func (cmd *insert) Run(ctx context.Context, f *flag.FlagSet) error { + vm, err := cmd.VirtualMachine() + if err != nil { + return err + } + + if vm == nil || f.NArg() != 1 { + return flag.ErrHelp + } + + devices, err := vm.Device(context.TODO()) + if err != nil { + return err + } + + c, err := devices.FindFloppy(cmd.device) + if err != nil { + return err + } + + img, err := cmd.DatastorePath(f.Arg(0)) + if err != nil { + return nil + } + + return vm.EditDevice(context.TODO(), devices.InsertImg(c, img)) +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/device/info.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/device/info.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/device/info.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/device/info.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,185 @@ +/* +Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package device + +import ( + "flag" + "fmt" + "io" + "os" + "strings" + "text/tabwriter" + + "github.com/vmware/govmomi/govc/cli" + "github.com/vmware/govmomi/govc/flags" + "github.com/vmware/govmomi/object" + "github.com/vmware/govmomi/vim25/types" + "golang.org/x/net/context" +) + +type info struct { + *flags.VirtualMachineFlag + *flags.OutputFlag + *flags.NetworkFlag +} + +func init() { + cli.Register("device.info", &info{}) +} + +func (cmd *info) Register(ctx context.Context, f *flag.FlagSet) { + cmd.VirtualMachineFlag, ctx = flags.NewVirtualMachineFlag(ctx) + cmd.VirtualMachineFlag.Register(ctx, f) + + cmd.OutputFlag, ctx = flags.NewOutputFlag(ctx) + cmd.OutputFlag.Register(ctx, f) + + cmd.NetworkFlag, ctx = flags.NewNetworkFlag(ctx) + cmd.NetworkFlag.Register(ctx, f) +} + +func (cmd *info) Process(ctx context.Context) error { + if err := cmd.VirtualMachineFlag.Process(ctx); err != nil { + return err + } + if err := cmd.OutputFlag.Process(ctx); err != nil { + return err + } + if err := cmd.NetworkFlag.Process(ctx); err != nil { + return err + } + return nil +} + +func (cmd *info) Usage() string { + return "[DEVICE]..." +} + +func (cmd *info) Run(ctx context.Context, f *flag.FlagSet) error { + vm, err := cmd.VirtualMachine() + if err != nil { + return err + } + + if vm == nil { + return flag.ErrHelp + } + + devices, err := vm.Device(context.TODO()) + if err != nil { + return err + } + + res := infoResult{ + list: devices, + } + + if cmd.NetworkFlag.IsSet() { + net, err := cmd.Network() + if err != nil { + return err + } + + backing, err := net.EthernetCardBackingInfo(context.TODO()) + if err != nil { + return err + } + + devices = devices.SelectByBackingInfo(backing) + } + + if f.NArg() == 0 { + res.Devices = devices + } else { + for _, name := range f.Args() { + device := devices.Find(name) + if device == nil { + return fmt.Errorf("device '%s' not found", name) + } + + res.Devices = append(res.Devices, device) + } + } + + return cmd.WriteResult(&res) +} + +type infoResult struct { + Devices object.VirtualDeviceList + // need the full list of devices to lookup attached devices and controllers + list object.VirtualDeviceList +} + +func (r *infoResult) Write(w io.Writer) error { + tw := tabwriter.NewWriter(os.Stdout, 2, 0, 2, ' ', 0) + + for _, device := range r.Devices { + d := device.GetVirtualDevice() + info := d.DeviceInfo.GetDescription() + + fmt.Fprintf(tw, "Name:\t%s\n", r.Devices.Name(device)) + fmt.Fprintf(tw, " Type:\t%s\n", r.Devices.TypeName(device)) + fmt.Fprintf(tw, " Label:\t%s\n", info.Label) + fmt.Fprintf(tw, " Summary:\t%s\n", info.Summary) + fmt.Fprintf(tw, " Key:\t%d\n", d.Key) + + if c, ok := device.(types.BaseVirtualController); ok { + var attached []string + for _, key := range c.GetVirtualController().Device { + attached = append(attached, r.Devices.Name(r.list.FindByKey(key))) + } + fmt.Fprintf(tw, " Devices:\t%s\n", strings.Join(attached, ", ")) + } else { + if c := r.list.FindByKey(d.ControllerKey); c != nil { + fmt.Fprintf(tw, " Controller:\t%s\n", r.Devices.Name(c)) + if d.UnitNumber != nil { + fmt.Fprintf(tw, " Unit number:\t%d\n", *d.UnitNumber) + } else { + fmt.Fprintf(tw, " Unit number:\t\n") + } + } + } + + if ca := d.Connectable; ca != nil { + fmt.Fprintf(tw, " Connected:\t%t\n", ca.Connected) + fmt.Fprintf(tw, " Start connected:\t%t\n", ca.StartConnected) + fmt.Fprintf(tw, " Guest control:\t%t\n", ca.AllowGuestControl) + fmt.Fprintf(tw, " Status:\t%s\n", ca.Status) + } + + switch md := device.(type) { + case types.BaseVirtualEthernetCard: + fmt.Fprintf(tw, " MAC Address:\t%s\n", md.GetVirtualEthernetCard().MacAddress) + fmt.Fprintf(tw, " Address type:\t%s\n", md.GetVirtualEthernetCard().AddressType) + case *types.VirtualDisk: + if b, ok := md.Backing.(types.BaseVirtualDeviceFileBackingInfo); ok { + fmt.Fprintf(tw, " File:\t%s\n", b.GetVirtualDeviceFileBackingInfo().FileName) + } + if b, ok := md.Backing.(*types.VirtualDiskFlatVer2BackingInfo); ok && b.Parent != nil { + fmt.Fprintf(tw, " Parent:\t%s\n", b.Parent.GetVirtualDeviceFileBackingInfo().FileName) + } + case *types.VirtualSerialPort: + if b, ok := md.Backing.(*types.VirtualSerialPortURIBackingInfo); ok { + fmt.Fprintf(tw, " Direction:\t%s\n", b.Direction) + fmt.Fprintf(tw, " Service URI:\t%s\n", b.ServiceURI) + fmt.Fprintf(tw, " Proxy URI:\t%s\n", b.ProxyURI) + } + } + } + + return tw.Flush() +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/device/ls.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/device/ls.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/device/ls.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/device/ls.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,86 @@ +/* +Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package device + +import ( + "flag" + "fmt" + "os" + "text/tabwriter" + + "github.com/vmware/govmomi/govc/cli" + "github.com/vmware/govmomi/govc/flags" + "golang.org/x/net/context" +) + +type ls struct { + *flags.VirtualMachineFlag + + boot bool +} + +func init() { + cli.Register("device.ls", &ls{}) +} + +func (cmd *ls) Register(ctx context.Context, f *flag.FlagSet) { + cmd.VirtualMachineFlag, ctx = flags.NewVirtualMachineFlag(ctx) + cmd.VirtualMachineFlag.Register(ctx, f) + + f.BoolVar(&cmd.boot, "boot", false, "List devices configured in the VM's boot options") +} + +func (cmd *ls) Process(ctx context.Context) error { + if err := cmd.VirtualMachineFlag.Process(ctx); err != nil { + return err + } + return nil +} + +func (cmd *ls) Run(ctx context.Context, f *flag.FlagSet) error { + vm, err := cmd.VirtualMachine() + if err != nil { + return err + } + + if vm == nil { + return flag.ErrHelp + } + + devices, err := vm.Device(context.TODO()) + if err != nil { + return err + } + + if cmd.boot { + options, err := vm.BootOptions(context.TODO()) + if err != nil { + return err + } + + devices = devices.SelectBootOrder(options.BootOrder) + } + + tw := tabwriter.NewWriter(os.Stdout, 3, 0, 2, ' ', 0) + + for _, device := range devices { + fmt.Fprintf(tw, "%s\t%s\t%s\n", devices.Name(device), devices.TypeName(device), + device.GetVirtualDevice().DeviceInfo.GetDescription().Summary) + } + + return tw.Flush() +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/device/remove.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/device/remove.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/device/remove.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/device/remove.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,81 @@ +/* +Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package device + +import ( + "flag" + "fmt" + + "github.com/vmware/govmomi/govc/cli" + "github.com/vmware/govmomi/govc/flags" + "golang.org/x/net/context" +) + +type remove struct { + *flags.VirtualMachineFlag + keepFiles bool +} + +func init() { + cli.Register("device.remove", &remove{}) +} + +func (cmd *remove) Register(ctx context.Context, f *flag.FlagSet) { + cmd.VirtualMachineFlag, ctx = flags.NewVirtualMachineFlag(ctx) + cmd.VirtualMachineFlag.Register(ctx, f) + f.BoolVar(&cmd.keepFiles, "keep", false, "Keep files in datastore") +} + +func (cmd *remove) Process(ctx context.Context) error { + if err := cmd.VirtualMachineFlag.Process(ctx); err != nil { + return err + } + return nil +} + +func (cmd *remove) Usage() string { + return "DEVICE..." +} + +func (cmd *remove) Run(ctx context.Context, f *flag.FlagSet) error { + vm, err := cmd.VirtualMachine() + if err != nil { + return err + } + + if vm == nil { + return flag.ErrHelp + } + + devices, err := vm.Device(context.TODO()) + if err != nil { + return err + } + + for _, name := range f.Args() { + device := devices.Find(name) + if device == nil { + return fmt.Errorf("device '%s' not found", name) + } + + if err = vm.RemoveDevice(context.TODO(), cmd.keepFiles, device); err != nil { + return err + } + } + + return nil +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/device/scsi/add.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/device/scsi/add.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/device/scsi/add.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/device/scsi/add.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,107 @@ +/* +Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package scsi + +import ( + "flag" + "fmt" + "strings" + + "github.com/vmware/govmomi/govc/cli" + "github.com/vmware/govmomi/govc/flags" + "github.com/vmware/govmomi/object" + "github.com/vmware/govmomi/vim25/types" + "golang.org/x/net/context" +) + +type add struct { + *flags.VirtualMachineFlag + + controller string + sharedBus string + hotAddRemove bool +} + +func init() { + cli.Register("device.scsi.add", &add{}) +} + +func (cmd *add) Register(ctx context.Context, f *flag.FlagSet) { + cmd.VirtualMachineFlag, ctx = flags.NewVirtualMachineFlag(ctx) + cmd.VirtualMachineFlag.Register(ctx, f) + + var ctypes []string + ct := object.SCSIControllerTypes() + for _, t := range ct { + ctypes = append(ctypes, ct.Type(t)) + } + f.StringVar(&cmd.controller, "type", ct.Type(ct[0]), + fmt.Sprintf("SCSI controller type (%s)", strings.Join(ctypes, "|"))) + f.StringVar(&cmd.sharedBus, "sharing", string(types.VirtualSCSISharingNoSharing), "SCSI sharing") + f.BoolVar(&cmd.hotAddRemove, "hot", false, "Enable hot-add/remove") +} + +func (cmd *add) Process(ctx context.Context) error { + if err := cmd.VirtualMachineFlag.Process(ctx); err != nil { + return err + } + return nil +} + +func (cmd *add) Run(ctx context.Context, f *flag.FlagSet) error { + vm, err := cmd.VirtualMachine() + if err != nil { + return err + } + + if vm == nil { + return flag.ErrHelp + } + + devices, err := vm.Device(context.TODO()) + if err != nil { + return err + } + + d, err := devices.CreateSCSIController(cmd.controller) + if err != nil { + return err + } + + c := d.(types.BaseVirtualSCSIController).GetVirtualSCSIController() + c.HotAddRemove = &cmd.hotAddRemove + c.SharedBus = types.VirtualSCSISharing(cmd.sharedBus) + + err = vm.AddDevice(context.TODO(), d) + if err != nil { + return err + } + + // output name of device we just created + devices, err = vm.Device(context.TODO()) + if err != nil { + return err + } + + devices = devices.SelectByType(d) + + name := devices.Name(devices[len(devices)-1]) + + fmt.Println(name) + + return nil +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/device/serial/add.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/device/serial/add.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/device/serial/add.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/device/serial/add.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,86 @@ +/* +Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package serial + +import ( + "flag" + "fmt" + + "github.com/vmware/govmomi/govc/cli" + "github.com/vmware/govmomi/govc/flags" + "golang.org/x/net/context" +) + +type add struct { + *flags.VirtualMachineFlag +} + +func init() { + cli.Register("device.serial.add", &add{}) +} + +func (cmd *add) Register(ctx context.Context, f *flag.FlagSet) { + cmd.VirtualMachineFlag, ctx = flags.NewVirtualMachineFlag(ctx) + cmd.VirtualMachineFlag.Register(ctx, f) +} + +func (cmd *add) Process(ctx context.Context) error { + if err := cmd.VirtualMachineFlag.Process(ctx); err != nil { + return err + } + return nil +} + +func (cmd *add) Run(ctx context.Context, f *flag.FlagSet) error { + vm, err := cmd.VirtualMachine() + if err != nil { + return err + } + + if vm == nil { + return flag.ErrHelp + } + + devices, err := vm.Device(context.TODO()) + if err != nil { + return err + } + + d, err := devices.CreateSerialPort() + if err != nil { + return err + } + + err = vm.AddDevice(context.TODO(), d) + if err != nil { + return err + } + + // output name of device we just created + devices, err = vm.Device(context.TODO()) + if err != nil { + return err + } + + devices = devices.SelectByType(d) + + name := devices.Name(devices[len(devices)-1]) + + fmt.Println(name) + + return nil +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/device/serial/connect.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/device/serial/connect.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/device/serial/connect.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/device/serial/connect.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,74 @@ +/* +Copyright (c) 2014-2016 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package serial + +import ( + "flag" + + "github.com/vmware/govmomi/govc/cli" + "github.com/vmware/govmomi/govc/flags" + "golang.org/x/net/context" +) + +type connect struct { + *flags.VirtualMachineFlag + + device string + client bool +} + +func init() { + cli.Register("device.serial.connect", &connect{}) +} + +func (cmd *connect) Register(ctx context.Context, f *flag.FlagSet) { + cmd.VirtualMachineFlag, ctx = flags.NewVirtualMachineFlag(ctx) + cmd.VirtualMachineFlag.Register(ctx, f) + + f.StringVar(&cmd.device, "device", "", "serial port device name") + f.BoolVar(&cmd.client, "client", false, "Use client direction") +} + +func (cmd *connect) Process(ctx context.Context) error { + if err := cmd.VirtualMachineFlag.Process(ctx); err != nil { + return err + } + return nil +} + +func (cmd *connect) Run(ctx context.Context, f *flag.FlagSet) error { + vm, err := cmd.VirtualMachine() + if err != nil { + return err + } + + if vm == nil { + return flag.ErrHelp + } + + devices, err := vm.Device(context.TODO()) + if err != nil { + return err + } + + d, err := devices.FindSerialPort(cmd.device) + if err != nil { + return err + } + + return vm.EditDevice(context.TODO(), devices.ConnectSerialPort(d, f.Arg(0), cmd.client)) +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/device/serial/disconnect.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/device/serial/disconnect.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/device/serial/disconnect.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/device/serial/disconnect.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,72 @@ +/* +Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package serial + +import ( + "flag" + + "github.com/vmware/govmomi/govc/cli" + "github.com/vmware/govmomi/govc/flags" + "golang.org/x/net/context" +) + +type disconnect struct { + *flags.VirtualMachineFlag + + device string +} + +func init() { + cli.Register("device.serial.disconnect", &disconnect{}) +} + +func (cmd *disconnect) Register(ctx context.Context, f *flag.FlagSet) { + cmd.VirtualMachineFlag, ctx = flags.NewVirtualMachineFlag(ctx) + cmd.VirtualMachineFlag.Register(ctx, f) + + f.StringVar(&cmd.device, "device", "", "serial port device name") +} + +func (cmd *disconnect) Process(ctx context.Context) error { + if err := cmd.VirtualMachineFlag.Process(ctx); err != nil { + return err + } + return nil +} + +func (cmd *disconnect) Run(ctx context.Context, f *flag.FlagSet) error { + vm, err := cmd.VirtualMachine() + if err != nil { + return err + } + + if vm == nil { + return flag.ErrHelp + } + + devices, err := vm.Device(context.TODO()) + if err != nil { + return err + } + + d, err := devices.FindSerialPort(cmd.device) + if err != nil { + return err + } + + return vm.EditDevice(context.TODO(), devices.DisconnectSerialPort(d)) +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/dvs/add.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/dvs/add.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/dvs/add.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/dvs/add.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,145 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package dvs + +import ( + "flag" + "fmt" + "os" + "strings" + + "golang.org/x/net/context" + + "github.com/vmware/govmomi/govc/cli" + "github.com/vmware/govmomi/govc/flags" + "github.com/vmware/govmomi/object" + "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/types" +) + +type add struct { + *flags.HostSystemFlag + + path string + pnic string +} + +func init() { + cli.Register("dvs.add", &add{}) +} + +func (cmd *add) Register(ctx context.Context, f *flag.FlagSet) { + cmd.HostSystemFlag, ctx = flags.NewHostSystemFlag(ctx) + cmd.HostSystemFlag.Register(ctx, f) + + f.StringVar(&cmd.path, "dvs", "", "DVS path") + f.StringVar(&cmd.pnic, "pnic", "vmnic0", "Name of the host physical NIC") +} + +func (cmd *add) Process(ctx context.Context) error { + if err := cmd.HostSystemFlag.Process(ctx); err != nil { + return err + } + return nil +} + +func (cmd *add) Usage() string { + return "HOST..." +} + +func (cmd *add) Description() string { + return `Add hosts to DVS.` +} + +func (cmd *add) Run(ctx context.Context, f *flag.FlagSet) error { + if f.NArg() == 0 { + return flag.ErrHelp + } + + finder, err := cmd.Finder() + if err != nil { + return err + } + + net, err := finder.Network(ctx, cmd.path) + if err != nil { + return err + } + + dvs, ok := net.(*object.DistributedVirtualSwitch) + if !ok { + return fmt.Errorf("%s (%T) is not of type %T", cmd.path, net, dvs) + } + + var s mo.VmwareDistributedVirtualSwitch + err = dvs.Properties(ctx, dvs.Reference(), []string{"config"}, &s) + if err != nil { + return err + } + + backing := new(types.DistributedVirtualSwitchHostMemberPnicBacking) + + for _, vmnic := range strings.Split(cmd.pnic, ",") { + backing.PnicSpec = append(backing.PnicSpec, types.DistributedVirtualSwitchHostMemberPnicSpec{ + PnicDevice: strings.TrimSpace(vmnic), + }) + } + + config := &types.DVSConfigSpec{ + ConfigVersion: s.Config.GetDVSConfigInfo().ConfigVersion, + } + + hosts, err := cmd.HostSystems(f.Args()) + if err != nil { + return err + } + + existing := make(map[string]bool) + // TODO: host.pnic.info command + for _, member := range s.Config.GetDVSConfigInfo().Host { + existing[member.Config.Host.Value] = true + } + + for _, host := range hosts { + ref := host.Reference() + if existing[ref.Value] { + fmt.Fprintf(os.Stderr, "%s is already a member of %s\n", host.InventoryPath, dvs.InventoryPath) + continue + } + + config.Host = append(config.Host, types.DistributedVirtualSwitchHostMemberConfigSpec{ + Operation: "add", + Host: ref, + Backing: backing, + }) + } + + if len(config.Host) == 0 { + return nil + } + + task, err := dvs.Reconfigure(ctx, config) + if err != nil { + return err + } + + logger := cmd.ProgressLogger(fmt.Sprintf("adding %d hosts to dvs %s... ", len(config.Host), dvs.InventoryPath)) + defer logger.Wait() + + _, err = task.WaitForResult(ctx, logger) + return err +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/dvs/create.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/dvs/create.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/dvs/create.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/dvs/create.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,119 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package dvs + +import ( + "flag" + "fmt" + + "golang.org/x/net/context" + + "github.com/vmware/govmomi/govc/cli" + "github.com/vmware/govmomi/govc/flags" + "github.com/vmware/govmomi/object" + "github.com/vmware/govmomi/vim25/types" +) + +type create struct { + *flags.DatacenterFlag + + types.DVSCreateSpec + + configSpec *types.VMwareDVSConfigSpec + + parent string +} + +func init() { + cli.Register("dvs.create", &create{}) +} + +func (cmd *create) Register(ctx context.Context, f *flag.FlagSet) { + cmd.DatacenterFlag, ctx = flags.NewDatacenterFlag(ctx) + cmd.DatacenterFlag.Register(ctx, f) + + cmd.configSpec = new(types.VMwareDVSConfigSpec) + + cmd.DVSCreateSpec.ConfigSpec = cmd.configSpec + + f.StringVar(&cmd.parent, "parent", "", "Path to parent folder for the new dvs") +} + +func (cmd *create) Usage() string { + return "DVS" +} + +func (cmd *create) Description() string { + return `Create DVS (DistributedVirtualSwitch) in datacenter. + +The dvs is added to the folder specified by the 'parent' flag. If not given, +this defaults to the network folder in the specified or default datacenter.` +} + +func (cmd *create) Process(ctx context.Context) error { + if err := cmd.DatacenterFlag.Process(ctx); err != nil { + return err + } + return nil +} + +func (cmd *create) Run(ctx context.Context, f *flag.FlagSet) error { + var parent *object.Folder + + if f.NArg() != 1 { + return flag.ErrHelp + } + + name := f.Arg(0) + + if cmd.parent == "" { + dc, err := cmd.Datacenter() + if err != nil { + return err + } + + folders, err := dc.Folders(ctx) + if err != nil { + return err + } + + parent = folders.NetworkFolder + } else { + finder, err := cmd.Finder() + if err != nil { + return err + } + + parent, err = finder.Folder(ctx, cmd.parent) + if err != nil { + return err + } + } + + cmd.configSpec.Name = name + + task, err := parent.CreateDVS(ctx, cmd.DVSCreateSpec) + if err != nil { + return err + } + + logger := cmd.ProgressLogger(fmt.Sprintf("adding %s to folder %s... ", name, parent.InventoryPath)) + defer logger.Wait() + + _, err = task.WaitForResult(ctx, logger) + return err +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/dvs/portgroup/add.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/dvs/portgroup/add.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/dvs/portgroup/add.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/dvs/portgroup/add.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,108 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package portgroup + +import ( + "flag" + "fmt" + "strings" + + "golang.org/x/net/context" + + "github.com/vmware/govmomi/govc/cli" + "github.com/vmware/govmomi/govc/flags" + "github.com/vmware/govmomi/object" + "github.com/vmware/govmomi/vim25/types" +) + +type add struct { + *flags.DatacenterFlag + + types.DVPortgroupConfigSpec + + path string +} + +func init() { + cli.Register("dvs.portgroup.add", &add{}) +} + +func (cmd *add) Register(ctx context.Context, f *flag.FlagSet) { + cmd.DatacenterFlag, ctx = flags.NewDatacenterFlag(ctx) + cmd.DatacenterFlag.Register(ctx, f) + + f.StringVar(&cmd.path, "dvs", "", "DVS path") + + ptypes := []string{ + string(types.DistributedVirtualPortgroupPortgroupTypeEarlyBinding), + string(types.DistributedVirtualPortgroupPortgroupTypeLateBinding), + string(types.DistributedVirtualPortgroupPortgroupTypeEphemeral), + } + + f.StringVar(&cmd.DVPortgroupConfigSpec.Type, "type", ptypes[0], + fmt.Sprintf("Portgroup type (%s)", strings.Join(ptypes, "|"))) + + cmd.DVPortgroupConfigSpec.NumPorts = 128 // default + f.Var(flags.NewInt32(&cmd.DVPortgroupConfigSpec.NumPorts), "nports", "Number of ports") +} + +func (cmd *add) Process(ctx context.Context) error { + if err := cmd.DatacenterFlag.Process(ctx); err != nil { + return err + } + return nil +} + +func (cmd *add) Usage() string { + return "NAME" +} + +func (cmd *add) Run(ctx context.Context, f *flag.FlagSet) error { + if f.NArg() == 0 { + return flag.ErrHelp + } + + name := f.Arg(0) + + finder, err := cmd.Finder() + if err != nil { + return err + } + + net, err := finder.Network(ctx, cmd.path) + if err != nil { + return err + } + + dvs, ok := net.(*object.DistributedVirtualSwitch) + if !ok { + return fmt.Errorf("%s (%T) is not of type %T", cmd.path, net, dvs) + } + + cmd.DVPortgroupConfigSpec.Name = name + + task, err := dvs.AddPortgroup(ctx, []types.DVPortgroupConfigSpec{cmd.DVPortgroupConfigSpec}) + if err != nil { + return err + } + + logger := cmd.ProgressLogger(fmt.Sprintf("adding %s portgroup to dvs %s... ", name, dvs.InventoryPath)) + defer logger.Wait() + + _, err = task.WaitForResult(ctx, logger) + return err +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/dvs/portgroup/info.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/dvs/portgroup/info.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/dvs/portgroup/info.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/dvs/portgroup/info.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,165 @@ +/* +Copyright (c) 2015-2016 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package portgroup + +import ( + "flag" + "fmt" + + "github.com/vmware/govmomi/govc/cli" + "github.com/vmware/govmomi/govc/flags" + "github.com/vmware/govmomi/object" + "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/types" + "golang.org/x/net/context" +) + +type info struct { + *flags.DatacenterFlag + + pg string + active bool + connected bool + inside bool + uplinkPort bool + vlanID int + count uint +} + +func init() { + cli.Register("dvs.portgroup.info", &info{}) +} + +func (cmd *info) Register(ctx context.Context, f *flag.FlagSet) { + cmd.DatacenterFlag, ctx = flags.NewDatacenterFlag(ctx) + cmd.DatacenterFlag.Register(ctx, f) + + f.StringVar(&cmd.pg, "pg", "", "Distributed Virtual Portgroup") + f.BoolVar(&cmd.active, "active", false, "Filter by port active or inactive status") + f.BoolVar(&cmd.connected, "connected", false, "Filter by port connected or disconnected status") + f.BoolVar(&cmd.inside, "inside", true, "Filter by port inside or outside status") + f.BoolVar(&cmd.uplinkPort, "uplinkPort", false, "Filter for uplink ports") + f.IntVar(&cmd.vlanID, "vlan", 0, "Filter by VLAN ID (0 = unfiltered)") + f.UintVar(&cmd.count, "count", 0, "Number of matches to return (0 = unlimited)") +} + +func (cmd *info) Process(ctx context.Context) error { + if err := cmd.ClientFlag.Process(ctx); err != nil { + return err + } + + return nil +} + +func (cmd *info) Run(ctx context.Context, f *flag.FlagSet) error { + if f.NArg() != 1 { + return flag.ErrHelp + } + + client, err := cmd.Client() + if err != nil { + return err + } + + finder, err := cmd.Finder() + if err != nil { + return err + } + + // Retrieve DVS reference + net, err := finder.Network(ctx, f.Arg(0)) + if err != nil { + return err + } + + // Convert to DVS object type + dvs, ok := net.(*object.DistributedVirtualSwitch) + if !ok { + return fmt.Errorf("%s (%s) is not a DVS", f.Arg(0), net.Reference().Type) + } + + // Set base search criteria + criteria := types.DistributedVirtualSwitchPortCriteria{ + Connected: types.NewBool(cmd.connected), + Active: types.NewBool(cmd.active), + UplinkPort: types.NewBool(cmd.uplinkPort), + Inside: types.NewBool(cmd.inside), + } + + // If a distributed virtual portgroup path is set, then add its portgroup key to the base criteria + if len(cmd.pg) > 0 { + // Retrieve distributed virtual portgroup reference + net, err = finder.Network(ctx, cmd.pg) + if err != nil { + return err + } + + // Convert distributed virtual portgroup object type + dvpg, ok := net.(*object.DistributedVirtualPortgroup) + if !ok { + return fmt.Errorf("%s (%s) is not a DVPG", cmd.pg, net.Reference().Type) + } + + // Obtain portgroup key property + var dvp mo.DistributedVirtualPortgroup + if err := dvpg.Properties(ctx, dvpg.Reference(), []string{"key"}, &dvp); err != nil { + return err + } + + // Add portgroup key to port search criteria + criteria.PortgroupKey = []string{dvp.Key} + } + + // Prepare request + req := types.FetchDVPorts{ + This: dvs.Reference(), + Criteria: &criteria, + } + + // Fetch ports + res, err := methods.FetchDVPorts(ctx, client, &req) + if err != nil { + return err + } + + var returnedPorts uint + + // Iterate over returned ports + for _, port := range res.Returnval { + portConfigSetting := port.Config.Setting.(*types.VMwareDVSPortSetting) + portVlan := portConfigSetting.Vlan.(*types.VmwareDistributedVirtualSwitchVlanIdSpec) + portVlanID := portVlan.VlanId + + // Show port info if: VLAN ID is not defined, or VLAN ID matches requested VLAN + if cmd.vlanID == 0 || portVlanID == int32(cmd.vlanID) { + returnedPorts++ + + fmt.Printf("PortgroupKey: %s\n", port.PortgroupKey) + fmt.Printf("DvsUuid: %s\n", port.DvsUuid) + fmt.Printf("VlanId: %d\n", portVlanID) + fmt.Printf("PortKey: %s\n\n", port.Key) + + // If we are limiting the count and have reached the count, then stop returning output + if cmd.count > 0 && returnedPorts == cmd.count { + break + } + } + } + + return nil +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/emacs/Cask juju-core-2.0.2/src/github.com/vmware/govmomi/govc/emacs/Cask --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/emacs/Cask 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/emacs/Cask 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,10 @@ +(source gnu) +(source melpa) + +(package-file "govc.el") + +(development + (depends-on "dash") + (depends-on "json-mode") + (depends-on "magit") + (depends-on "s")) diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/emacs/.gitignore juju-core-2.0.2/src/github.com/vmware/govmomi/govc/emacs/.gitignore --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/emacs/.gitignore 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/emacs/.gitignore 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,3 @@ +.cask +elpa +*.elc diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/emacs/govc.el juju-core-2.0.2/src/github.com/vmware/govmomi/govc/emacs/govc.el --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/emacs/govc.el 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/emacs/govc.el 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,1261 @@ +;;; govc.el --- Interface to govc for managing VMware ESXi and vCenter + +;; Author: The govc developers +;; URL: https://github.com/vmware/govmomi/tree/master/govc/emacs +;; Keywords: convenience +;; Version: 0.1.0 +;; Package-Requires: ((emacs "24.3") (dash "1.5.0") (s "1.9.0") (magit-popup "2.0.50") (json-mode "1.6.0")) + +;; This file is NOT part of GNU Emacs. + +;; This program is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation; either version 3, or (at your option) +;; any later version. +;; +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. +;; +;; You should have received a copy of the GNU General Public License +;; along with GNU Emacs; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. + +;;; Commentary: + +;; The goal of this package is to provide a simple interface for commonly used +;; govc commands within Emacs. This includes table based inventory/state modes +;; for vms, hosts, datastores and pools. The keymap for each mode provides +;; shortcuts for easily feeding the data in view to other govc commands. +;; +;; Within the various govc modes, press `?' to see a popup menu of options. +;; A menu bar is enabled for certain modes, such as `govc-vm-mode' and `govc-host-mode'. +;; There is also a `govc' menu at all times under the `Tools' menu. +;; +;; The recommended way to install govc.el is via MELPA (http://melpa.org/). + +;;; Code: + +(eval-when-compile + (require 'cl)) +(require 'dash) +(require 'dired) +(require 'json-mode) +(require 'magit-popup) +(require 'url-parse) +(require 's) + +(defgroup govc nil + "Emacs customization group for govc." + :group 'convenience) + +(defcustom govc-keymap-prefix "C-c ;" + "Prefix for `govc-mode'." + :group 'govc) + +(defvar govc-command-map + (let ((map (make-sparse-keymap))) + (define-key map "h" 'govc-host) + (define-key map "p" 'govc-pool) + (define-key map "v" 'govc-vm) + (define-key map "s" 'govc-datastore) + (define-key map "?" 'govc-popup) + map) + "Keymap for `govc-mode' after `govc-keymap-prefix' was pressed.") + +(defvar govc-mode-map + (let ((map (make-sparse-keymap))) + (define-key map (kbd govc-keymap-prefix) govc-command-map) + map) + "Keymap for `govc-mode'.") + +;;;###autoload +(define-minor-mode govc-mode + "Running `govc-global-mode' creates key bindings to the various govc modes. +The default prefix is `C-c ;' and can be changed by setting `govc-keymap-prefix'. + +\\{govc-mode-map\}" + nil govc-mode-line govc-mode-map + :group 'govc) + +;;;###autoload +(define-globalized-minor-mode govc-global-mode govc-mode govc-mode) + +(defcustom govc-mode-line + '(:eval (format " govc[%s]" (or (govc-session-name) "-"))) + "Mode line lighter for govc." + :group 'govc + :type 'sexp + :risky t) + + +;;; Tabulated list mode extensions (derived from https://github.com/Silex/docker.el tabulated-list-ext.el) +(defun govc-tabulated-list-mark () + "Mark and move to the next line." + (interactive) + (tabulated-list-put-tag (char-to-string dired-marker-char) t)) + +(defun govc-tabulated-list-unmark () + "Unmark and move to the next line." + (interactive) + (tabulated-list-put-tag "" t)) + +(defun govc-tabulated-list-toggle-marks () + "Toggle mark." + (interactive) + (save-excursion + (goto-char (point-min)) + (let ((cmd)) + (while (not (eobp)) + (setq cmd (char-after)) + (tabulated-list-put-tag + (if (eq cmd dired-marker-char) + "" + (char-to-string dired-marker-char)) t))))) + +(defun govc-tabulated-list-unmark-all () + "Unmark all." + (interactive) + (save-excursion + (goto-char (point-min)) + (while (not (eobp)) + (tabulated-list-put-tag "" t)))) + +(defun govc-selection () + "Get the current selection as a list of names." + (let ((selection)) + (save-excursion + (goto-char (point-min)) + (while (not (eobp)) + (when (eq (char-after) ?*) + (add-to-list 'selection (tabulated-list-get-id))) + (forward-line))) + (or selection (let ((id (tabulated-list-get-id))) + (if id + (list id)))))) + +(defun govc-do-selection (fn action) + "Call FN with `govc-selection' confirming ACTION." + (let* ((selection (govc-selection)) + (count (length selection)) + (prompt (if (= count 1) + (car selection) + (format "* [%d] marked" count)))) + (if (yes-or-no-p (format "%s %s ?" action prompt)) + (funcall fn selection)))) + +(defun govc-copy-selection () + "Copy current selection or region to the kill ring." + (interactive) + (if (region-active-p) + (copy-region-as-kill (mark) (point) 'region) + (kill-new (message "%s" (s-join " " (--map (format "'%s'" it) (govc-selection))))))) + +(defvar govc-font-lock-keywords + (list + (list dired-re-mark '(0 dired-mark-face)))) + +(defvar govc-tabulated-list-mode-map + (let ((map (make-sparse-keymap))) + (define-key map "m" 'govc-tabulated-list-mark) + (define-key map "u" 'govc-tabulated-list-unmark) + (define-key map "t" 'govc-tabulated-list-toggle-marks) + (define-key map "U" 'govc-tabulated-list-unmark-all) + (define-key map (kbd "M-&") 'govc-shell-command) + (define-key map (kbd "M-w") 'govc-copy-selection) + (define-key map (kbd "M-E") 'govc-copy-environment) + map) + "Keymap for `govc-tabulated-list-mode'.") + +(define-derived-mode govc-tabulated-list-mode tabulated-list-mode "Tabulated govc" + "Generic table bindings to mark/unmark rows." + (setq-local font-lock-defaults + '(govc-font-lock-keywords t nil nil beginning-of-line))) + + +;;; Keymap helpers for generating menus and popups +(defun govc-keymap-list (keymap) + "Return a list of (key name function) for govc bindings in the given KEYMAP. +The name returned is the first word of the function `documentation'." + (let ((map)) + (map-keymap + (lambda (k f) + (when (keymapp f) + (setq map (append map + (--map (and (setcar it (kbd (format "M-%s" (char-to-string (car it))))) it) + (govc-keymap-list f))))) + (when (and (symbolp f) + (s-starts-with? "govc-" (symbol-name f))) + (if (not (eq ?? k)) + (add-to-list 'map (list k (car (split-string (documentation f))) f))))) keymap) + map)) + +(defun govc-keymap-menu (keymap) + "Return a list of [key function t] for govc bindings in the given KEYMAP. +For use with `easy-menu-define'." + (-map (lambda (item) + (vector (nth 1 item) (nth 2 item) t)) + (govc-keymap-list keymap))) + +(defun govc-key-description (key) + "Call `key-description' ensuring KEY is a sequence." + (key-description (if (integerp key) (list key) key))) + +(defun govc-keymap-list-to-help (keymap) + "Convert KEYMAP to list of help text." + (--map (list (govc-key-description (car it)) + (car (split-string (documentation (nth 2 it)) "\\."))) + keymap)) + +(defun govc-keymap-popup-help () + "Default keymap help for `govc-keymap-popup'." + (append (govc-keymap-list-to-help (govc-keymap-list govc-tabulated-list-mode-map)) + '(("g" "Refresh current buffer") + ("C-h m" "Show all key bindings")))) + +(defun govc-keymap-popup (keymap) + "Convert a `govc-keymap-list' using KEYMAP for use with `magit-define-popup'. +Keys in the ASCII range of 32-97 are mapped to popup commands, all others are listed as help text." + (let* ((maps (--separate (and (integerp (car it)) + (>= (car it) 32) + (<= (car it) 97)) + (govc-keymap-list keymap))) + (help (govc-keymap-list-to-help (cadr maps)))) + (append + '("Commands") + (car maps) + (list (s-join "\n" (--map (format " %-6s %s" (car it) (cadr it)) + (append help (govc-keymap-popup-help)))) + nil)))) + + +;;; govc process helpers +(defvar govc-urls nil + "List of URLs for use with `govc-session'. +The `govc-session-name' displayed by `govc-mode-line' uses `url-target' (anchor) +if set, otherwise `url-host' is used. + +Example: +``` + (setq govc-urls '(\"root:vagrant@localhost:18443#Vagrant-ESXi\" + \"root:password@192.168.1.192#Intel-NUC\" + \"Administrator@vsphere.local:password!@vcva-clovervm\")) +``` +To enter a URL that is not in the list, prefix `universal-argument', for example: + + `\\[universal-argument] \\[govc-vm]' + +When in `govc-vm' or `govc-host' mode, a default URL is composed with the +current session credentials and the IP address of the current vm/host and +the vm/host name as the session name. This makes it easier to connect to +nested ESX/vCenter VMs or directly to an ESX host.") + +(defvar-local govc-session-url nil + "ESX or vCenter URL set by `govc-session' via `govc-urls' selection.") + +(defvar-local govc-session-insecure nil + "Skip verification of server certificate when true. +This variable is set to the value of the `GOVC_INSECURE' env var by default. +It can also be set per-url via the query string (insecure=true). For example: +``` + (setq govc-urls '(\"root:password@hostname?insecure=true\")) +```") + +(defvar-local govc-session-datacenter nil + "Datacenter to use for the current `govc-session'. +If the endpoint has a single Datacenter it will be used by default, otherwise +`govc-session' will prompt for selection. It can also be set per-url via the +query string. For example: +``` + (setq govc-urls '(\"root:password@hostname?datacenter=dc1\")) +```") + +(defvar-local govc-session-datastore nil + "Datastore to use for the current `govc-session'. +If the endpoint has a single Datastore it will be used by default, otherwise +`govc-session' will prompt for selection. It can also be set per-url via the +query string. For example: +``` + (setq govc-urls '(\"root:password@hostname?datastore=vsanDatastore\")) +```") + +(defvar-local govc-filter nil + "Resource path filter.") + +(defvar-local govc-args nil + "Additional govc arguments.") + +(defun govc-session-name () + "Return a name for the current session. +Derived from `govc-session-url' if set, otherwise from the 'GOVC_URL' env var. +Return value is the url anchor if set, otherwise the hostname is returned." + (let* ((u (or govc-session-url (getenv "GOVC_URL"))) + (url (if u (govc-url-parse u)))) + (if url + (or (url-target url) (url-host url))))) + +(defun govc-command (command &rest args) + "Format govc COMMAND ARGS." + (format "govc %s %s" command + (s-join " " (--map (format "'%s'" it) + (-flatten (-non-nil args)))))) + +(defconst govc-environment-map (--map (cons (concat "GOVC_" (upcase it)) + (intern (concat "govc-session-" it))) + '("url" "insecure" "datacenter" "datastore")) + + "Map of `GOVC_*' environment variable names to `govc-session-*' symbol names.") + +(defun govc-environment (&optional unset) + "Return `process-environment' for govc. +Optionally clear govc env if UNSET is non-nil." + (let ((process-environment (copy-sequence process-environment))) + (dolist (e govc-environment-map) + (setenv (car e) (unless unset (symbol-value (cdr e))))) + process-environment)) + +(defun govc-export-environment (arg) + "Set if ARG is \\[universal-argument], unset if ARG is \\[negative-argument]." + (if (equal arg '-) + (progn (setq process-environment (govc-environment t)) + (cons "unset" (--map (car it) + govc-environment-map))) + (progn (setq process-environment (govc-environment)) + (cons "export" (--map (format "%s='%s'" (car it) (or (symbol-value (cdr it)) "")) + govc-environment-map))))) + +(defun govc-copy-environment (&optional arg) + "Export session to `process-environment' and `kill-ring'. +Optionally set `GOVC_*' vars in `process-environment' using prefix +\\[universal-argument] ARG or unset with prefix \\[negative-argument] ARG." + (interactive "P") + (kill-new (message (if arg (s-join " " (govc-export-environment arg)) govc-session-url)))) + +(defun govc-process (command handler) + "Run COMMAND, calling HANDLER upon successful exit of the process." + (message command) + (let ((process-environment (govc-environment)) + (exit-code)) + (with-temp-buffer + (setq exit-code (call-process-shell-command command nil (current-buffer))) + (if (zerop exit-code) + (funcall handler) + (error (buffer-string)))))) + +(defun govc (command &rest args) + "Execute govc COMMAND with ARGS. +Return value is `buffer-string' split on newlines." + (govc-process (govc-command command args) + (lambda () + (split-string (buffer-string) "\n" t)))) + +(defun govc-json (command &rest args) + "Execute govc COMMAND passing arguments ARGS. +Return value is `json-read'." + (govc-process (govc-command command (cons "-json" args)) + (lambda () + (goto-char (point-min)) + (let ((json-object-type 'plist)) + (json-read))))) + +(defun govc-ls-datacenter () + "List datacenters." + (delete-dups (--map (nth 1 (split-string it "/")) + (govc "ls")))) + +(defun govc-object-prompt (prompt ls) + "PROMPT for object name via LS function. Return object without PROMPT if there is just one instance." + (let ((objs (funcall ls))) + (if (eq 1 (length objs)) + (car objs) + (completing-read prompt objs)))) + +(defun govc-url-parse (url) + "A `url-generic-parse-url' wrapper to handle URL with password, but no scheme. +Also fixes the case where user contains an '@'." + (let* ((full (s-contains? "://" url)) + (u (url-generic-parse-url (concat (unless full "https://") url)))) + (unless full + (setf (url-type u) nil) + (setf (url-fullness u) nil)) + (if (s-contains? "@" (url-host u)) + (let* ((h (split-string (url-host u) "@")) + (p (split-string (car h) ":"))) + (setf (url-host u) (cadr h)) + (setf (url-user u) (concat (url-user u) "@" (car p))) + (setf (url-password u) (cadr p)))) + u)) + +(defun govc-url-default () + "Default URL when creating a new session." + (if govc-session-url + (let ((url (govc-url-parse govc-session-url))) + (if (equal major-mode 'govc-host-mode) + (progn (setf (url-host url) (govc-table-column-value "Name")) + (setf (url-target url) nil)) + (progn (setf (url-host url) (govc-table-column-value "IP address")) + (setf (url-target url) (govc-table-column-value "Name")))) + (url-recreate-url url)))) + +(defun govc-urls-completing-read () + "A wrapper for `completing-read' to mask credentials in `govc-urls'." + (let ((alist)) + (dolist (ent govc-urls) + (let ((u (govc-url-parse ent))) + (setf (url-password u) nil) + (add-to-list 'alist `(,(url-recreate-url u) . ,ent) t))) + (let ((u (completing-read "govc url: " (-map 'car alist)))) + (cdr (assoc u alist))))) + +(defun govc-session-set-url (url) + "Set `govc-session-url' to URL and optionally set other govc-session-* variables via URL query." + (let ((q (cdr (url-path-and-query (govc-url-parse url))))) + (dolist (opt (if q (url-parse-query-string q))) + (let ((var (intern (concat "govc-session-" (car opt))))) + (if (boundp var) + (set var (cadr opt)))))) + (setq govc-session-url url)) + +(defun govc-session () + "Initialize a govc session." + (interactive) + (let ((url (if (or current-prefix-arg (eq 0 (length govc-urls))) + (read-string "govc url: " (govc-url-default)) + (if (eq 1 (length govc-urls)) + (car govc-urls) + (govc-urls-completing-read))))) + ;; Wait until this point to clear so current session is preserved in the + ;; event of `keyboard-quit' in `read-string'. + (setq govc-session-datacenter nil + govc-session-datastore nil + govc-filter nil) + (govc-session-set-url url)) + (unless govc-session-insecure + (setq govc-session-insecure (or (getenv "GOVC_INSECURE") + (completing-read "govc insecure: " '("true" "false"))))) + (unless govc-session-datacenter + (setq govc-session-datacenter (govc-object-prompt "govc datacenter: " 'govc-ls-datacenter))) + (add-to-list 'govc-urls govc-session-url)) + +(defalias 'govc-current-session 'buffer-local-variables) + +(defun govc-session-clone (session) + "Clone a session from SESSION buffer locals." + (dolist (v session) + (let ((s (car v))) + (when (s-starts-with? "govc-session-" (symbol-name s)) + (set s (assoc-default s session)))))) + +(defun govc-shell-command (&optional cmd) + "Shell CMD with current `govc-session' exported as GOVC_ env vars." + (interactive) + (let ((process-environment (govc-environment)) + (current-prefix-arg "*govc*") + (url govc-session-url)) + (if cmd + (async-shell-command cmd current-prefix-arg) + (call-interactively 'async-shell-command)) + (with-current-buffer (get-buffer current-prefix-arg) + (setq govc-session-url url)))) + +(defcustom govc-max-events 50 + "Limit events output to the last N events." + :type 'integer + :group 'govc) + +(defun govc-events () + "Events via govc events -n `govc-max-events'." + (interactive) + (govc-shell-command + (govc-command "events" + (list "-n" govc-max-events (govc-selection))))) + +(defun govc-parse-info (output) + "Parse govc info command OUTPUT." + (let* ((entries) + (entry) + (entry-key)) + (-each output + (lambda (line) + (let* ((ix (s-index-of ":" line)) + (key (s-trim (substring line 0 ix))) + (val (s-trim (substring line (+ ix 1))))) + (unless entry-key + (setq entry-key key)) + (when (s-equals? key entry-key) + (setq entry (make-hash-table :test 'equal)) + (add-to-list 'entries entry)) + (puthash key val entry)))) + entries)) + +(defun govc-table-column-names () + "Return a list of column names from `tabulated-list-format'." + (--map (car (aref tabulated-list-format it)) + (number-sequence 0 (- (length tabulated-list-format) 1)))) + +(defun govc-table-column-value (key) + "Return current column value for given KEY." + (let ((names (govc-table-column-names)) + (entry (tabulated-list-get-entry)) + (value)) + (dotimes (ix (- (length names) 1)) + (if (s-equals? key (nth ix names)) + (setq value (elt entry ix)))) + value)) + +(defun govc-table-info (command &optional args) + "Convert `govc-parse-info' COMMAND ARGS output to `tabulated-list-entries' format." + (let ((names (govc-table-column-names))) + (-map (lambda (info) + (let ((id (or (gethash "Path" info) + (gethash (car names) info)))) + (list id (vconcat + (--map (or (gethash it info) "-") + names))))) + (govc-parse-info (govc command args))))) + +(defun govc-map-info (command &optional args) + "Populate key=val map table with govc COMMAND ARGS output." + (-map (lambda (line) + (let* ((ix (s-index-of ":" line)) + (key (s-trim (substring line 0 ix))) + (val (s-trim (substring line (+ ix 1))))) + (list key (vector key val)))) + (govc command args))) + +(defun govc-map-info-table (entries) + "Tabulated `govc-map-info' data via ENTRIES." + (let ((session (govc-current-session)) + (args (append govc-args (govc-selection))) + (buffer (get-buffer-create "*govc-info*"))) + (pop-to-buffer buffer) + (tabulated-list-mode) + (setq govc-args args) + (govc-session-clone session) + (setq tabulated-list-format [("Name" 50) + ("Value" 50)] + tabulated-list-padding 2 + tabulated-list-entries entries) + (tabulated-list-print))) + +(defun govc-json-info (command &optional selection) + "Run govc COMMAND -json on SELECTION." + (interactive) + (govc-process (govc-command command (append (cons "-json" govc-args) + (or selection (govc-selection)))) + (lambda () + (let ((buffer (get-buffer-create "*govc-json*"))) + (with-current-buffer buffer + (erase-buffer)) + (copy-to-buffer buffer (point-min) (point-max)) + (pop-to-buffer buffer) + (json-mode) + ;; We use `json-mode-beautify' as `json-pretty-print-buffer' does not work for `govc-host-json-info' + (json-mode-beautify) + (goto-char (point-min)))))) + +(defun govc-mode-new-session () + "Connect new session for the current govc mode." + (interactive) + (call-interactively 'govc-session) + (revert-buffer)) + +(defun govc-host-with-session () + "Host-mode with current session." + (interactive) + (govc-host nil (govc-current-session))) + +(defun govc-vm-with-session () + "VM-mode with current session." + (interactive) + (govc-vm nil (govc-current-session))) + +(defun govc-datastore-with-session () + "Datastore-mode with current session." + (interactive) + (govc-datastore nil (govc-current-session))) + +(defun govc-pool-with-session () + "Pool-mode with current session." + (interactive) + (govc-pool nil (govc-current-session))) + + +;;; govc host mode +(defun govc-ls-host () + "List hosts." + (govc "ls" "-t" "HostSystem" "host/*")) + +(defun govc-esxcli-netstat-info () + "Wrapper for govc host.esxcli network ip connection list." + (govc-table-info "host.esxcli" + (append govc-args '("-hints=false" "--" "network" "ip" "connection" "list")))) + +(defun govc-esxcli-netstat (host) + "Tabulated `govc-esxcli-netstat-info' HOST." + (interactive (list (govc-object-prompt "Host: " 'govc-ls-host))) + (let ((session (govc-current-session)) + (buffer (get-buffer-create "*govc-esxcli*"))) + (pop-to-buffer buffer) + (tabulated-list-mode) + (setq govc-args (list "-host.ipath" host)) + (govc-session-clone session) + (setq tabulated-list-format [("CCAlgo" 10 t) + ("ForeignAddress" 20 t) + ("LocalAddress" 20 t) + ("Proto" 5 t) + ("RecvQ" 5 t) + ("SendQ" 5 t) + ("State" 15 t) + ("WorldID" 7 t) + ("WorldName" 10 t)] + tabulated-list-padding 2 + tabulated-list-entries #'govc-esxcli-netstat-info) + (tabulated-list-init-header) + (tabulated-list-print))) + +(defun govc-host-esxcli-netstat () + "Netstat via `govc-esxcli-netstat-info' with current host id." + (interactive) + (govc-esxcli-netstat (tabulated-list-get-id))) + +(defun govc-host-info () + "Wrapper for govc host.info." + (govc-table-info "host.info" (or govc-filter "*/*"))) + +(defun govc-host-json-info () + "JSON via govc host.info -json on current selection." + (interactive) + (govc-json-info "host.info" (govc-selection))) + +(defvar govc-host-mode-map + (let ((map (make-sparse-keymap))) + (define-key map "E" 'govc-events) + (define-key map "J" 'govc-host-json-info) + (define-key map "N" 'govc-host-esxcli-netstat) + (define-key map "c" 'govc-mode-new-session) + (define-key map "p" 'govc-pool-with-session) + (define-key map "s" 'govc-datastore-with-session) + (define-key map "v" 'govc-vm-with-session) + (define-key map "?" 'govc-host-popup) + map) + "Keymap for `govc-host-mode'.") + +(defun govc-host (&optional filter session) + "Host info via govc. +Optionally filter by FILTER and inherit SESSION." + (interactive) + (let ((buffer (get-buffer-create "*govc-host*"))) + (pop-to-buffer buffer) + (govc-host-mode) + (if session + (govc-session-clone session) + (call-interactively 'govc-session)) + (setq govc-filter filter) + (tabulated-list-print))) + +(define-derived-mode govc-host-mode govc-tabulated-list-mode "Host" + "Major mode for handling a list of govc hosts." + (setq tabulated-list-format [("Name" 30 t) + ("Logical CPUs" 20 t) + ("CPU usage" 25 t) + ("Memory" 10 t) + ("Memory usage" 25 t) + ("Manufacturer" 13 t) + ("Boot time" 15 t)] + tabulated-list-sort-key (cons "Name" nil) + tabulated-list-padding 2 + tabulated-list-entries #'govc-host-info) + (tabulated-list-init-header)) + +(magit-define-popup govc-host-popup + "Host popup." + :actions (govc-keymap-popup govc-host-mode-map)) + +(easy-menu-define govc-host-mode-menu govc-host-mode-map + "Host menu." + (cons "Host" (govc-keymap-menu govc-host-mode-map))) + + +;;; govc pool mode +(defun govc-ls-pool (&optional pools) + "List resource POOLS recursively." + (let ((subpools (govc "ls" "-t" "ResourcePool" (--map (concat it "/*") (or pools '("host")))))) + (append pools + (if subpools + (govc-ls-pool subpools))))) + +(defun govc-ls-vapp () + "List virtual apps." + (govc "ls" "-t" "VirtualApp" "vm")) + +(defun govc-pool-destroy (name) + "Destroy pool with given NAME." + (interactive (list (completing-read "Destroy pool: " (govc-ls-pool)))) + (govc "pool.destroy" name)) + +(defun govc-pool-destroy-selection () + "Destroy via `govc-pool-destroy' on the pool selection." + (interactive) + (govc-do-selection 'govc-pool-destroy "Delete") + (tabulated-list-revert)) + +(defun govc-pool-info () + "Wrapper for govc pool.info." + (govc-table-info "pool.info" (or govc-filter (append (govc-ls-pool) (govc-ls-vapp))))) + +(defun govc-pool-json-info () + "JSON via govc pool.info -json on current selection." + (interactive) + (govc-json-info "pool.info" (govc-selection))) + +(defvar govc-pool-mode-map + (let ((map (make-sparse-keymap))) + (define-key map "E" 'govc-events) + (define-key map "J" 'govc-pool-json-info) + (define-key map "D" 'govc-pool-destroy-selection) + (define-key map "c" 'govc-mode-new-session) + (define-key map "h" 'govc-host-with-session) + (define-key map "s" 'govc-datastore-with-session) + (define-key map "v" 'govc-vm-with-session) + (define-key map "?" 'govc-pool-popup) + map) + "Keymap for `govc-pool-mode'.") + +(defun govc-pool (&optional filter session) + "Pool info via govc. +Optionally filter by FILTER and inherit SESSION." + (interactive) + (let ((buffer (get-buffer-create "*govc-pool*"))) + (pop-to-buffer buffer) + (govc-pool-mode) + (if session + (govc-session-clone session) + (call-interactively 'govc-session)) + (setq govc-filter filter) + (tabulated-list-print))) + +(define-derived-mode govc-pool-mode govc-tabulated-list-mode "Pool" + "Major mode for handling a list of govc pools." + (setq tabulated-list-format [("Name" 30 t) + ("CPU Usage" 25 t) + ("CPU Shares" 25 t) + ("CPU Reservation" 25 t) + ("CPU Limit" 10 t) + ("Mem Usage" 25 t) + ("Mem Shares" 25 t) + ("Mem Reservation" 25 t) + ("Mem Limit" 10 t)] + tabulated-list-sort-key (cons "Name" nil) + tabulated-list-padding 2 + tabulated-list-entries #'govc-pool-info) + (tabulated-list-init-header)) + +(magit-define-popup govc-pool-popup + "Pool popup." + :actions (govc-keymap-popup govc-pool-mode-map)) + +(easy-menu-define govc-host-mode-menu govc-pool-mode-map + "Pool menu." + (cons "Pool" (govc-keymap-menu govc-pool-mode-map))) + + +;;; govc datastore mode +(defun govc-ls-datastore () + "List datastores." + (govc "ls" "datastore")) + +(defun govc-datastore-ls-entries () + "Wrapper for govc datastore.ls." + (let* ((data (govc-json "datastore.ls" "-l" "-p" govc-filter)) + (file (plist-get (elt data 0) :File))) + (-map (lambda (ent) + (let ((name (plist-get ent :Path)) + (size (plist-get ent :FileSize)) + (time (plist-get ent :Modification)) + (user (plist-get ent :Owner))) + (list (concat govc-filter name) + (vector (file-size-human-readable size) + (current-time-string (date-to-time time)) + name)))) file))) + +(defun govc-datastore-ls-parent () + "Up to parent folder." + (interactive) + (if (s-blank? govc-filter) + (let ((session (govc-current-session))) + (govc-datastore-mode) + (govc-session-clone session)) + (setq govc-filter (file-name-directory (directory-file-name govc-filter)))) + (tabulated-list-revert)) + +(defun govc-datastore-ls-child () + "Open datastore folder or file." + (interactive) + (let ((id (tabulated-list-get-id))) + (if (s-ends-with? "/" id) + (progn (setq govc-filter id) + (tabulated-list-revert)) + (govc-datastore-open)))) + +(defun govc-datastore-open () + "Open datastore file." + (lexical-let* ((srcfile (tabulated-list-get-id)) + (srcpath (format "[%s] %s" (file-name-nondirectory govc-session-datastore) (s-chop-prefix "/" srcfile))) + (suffix (file-name-extension srcfile t)) + (tmpfile (make-temp-file "govc-ds" nil suffix)) + (session (govc-current-session))) + (when (yes-or-no-p (concat "Open " srcpath "?")) + (govc "datastore.download" srcfile tmpfile) + (with-current-buffer (pop-to-buffer (find-file-noselect tmpfile)) + (govc-session-clone session) + (add-hook 'kill-buffer-hook (lambda () + (with-demoted-errors + (delete-file tmpfile))) t t) + (add-hook 'after-save-hook (lambda () + (if (yes-or-no-p (concat "Upload changes to " srcpath "?")) + (with-demoted-errors + (govc "datastore.upload" tmpfile srcfile)))) t t))))) + +(defun govc-datastore-ls-json () + "JSON via govc datastore.ls -json on current selection." + (interactive) + (let ((govc-args '("-l" "-p"))) + (govc-json-info "datastore.ls" (govc-selection)))) + +(defun govc-datastore-mkdir (name) + "Mkdir via govc datastore.mkdir with given NAME." + (interactive (list (read-from-minibuffer "Create directory: " govc-filter))) + (govc "datastore.mkdir" name) + (tabulated-list-revert)) + +(defun govc-datastore-rm (paths) + "Delete datastore PATHS." + (--each paths (govc "datastore.rm" it))) + +(defun govc-datastore-rm-selection () + "Delete selected datastore paths." + (interactive) + (govc-do-selection 'govc-datastore-rm "Delete") + (tabulated-list-revert)) + +(defvar govc-datastore-ls-mode-map + (let ((map (make-sparse-keymap))) + (define-key map "J" 'govc-datastore-ls-json) + (define-key map "D" 'govc-datastore-rm-selection) + (define-key map "+" 'govc-datastore-mkdir) + (define-key map (kbd "DEL") 'govc-datastore-ls-parent) + (define-key map (kbd "RET") 'govc-datastore-ls-child) + (define-key map "?" 'govc-datastore-ls-popup) + map) + "Keymap for `govc-datastore-ls-mode'.") + +(defun govc-datastore-ls (&optional datastore session) + "List govc datastore. Optionally specify DATASTORE and SESSION." + (interactive) + (let ((buffer (get-buffer-create "*govc-datastore*"))) + (pop-to-buffer buffer) + (govc-datastore-ls-mode) + (if session + (govc-session-clone session) + (call-interactively 'govc-session)) + (setq govc-session-datastore (or datastore (govc-object-prompt "govc datastore: " 'govc-ls-datastore))) + (tabulated-list-print))) + +(define-derived-mode govc-datastore-ls-mode govc-tabulated-list-mode "Datastore" + "Major mode govc datastore.ls." + (setq tabulated-list-format [("Size" 10 t) + ("Modification time" 25 t) + ("Name" 40 t)] + tabulated-list-sort-key (cons "Name" nil) + tabulated-list-padding 2 + tabulated-list-entries #'govc-datastore-ls-entries) + (tabulated-list-init-header)) + +(magit-define-popup govc-datastore-ls-popup + "Datastore ls popup." + :actions (govc-keymap-popup govc-datastore-ls-mode-map)) + +(easy-menu-define govc-datastore-ls-mode-menu govc-datastore-ls-mode-map + "Datastore ls menu." + (cons "Datastore" (govc-keymap-menu govc-datastore-ls-mode-map))) + +(defvar govc-datastore-mode-map + (let ((map (make-sparse-keymap))) + (define-key map "J" 'govc-datastore-json-info) + (define-key map (kbd "RET") 'govc-datastore-ls-selection) + (define-key map "c" 'govc-mode-new-session) + (define-key map "h" 'govc-host-with-session) + (define-key map "p" 'govc-pool-with-session) + (define-key map "v" 'govc-vm-with-session) + (define-key map "?" 'govc-datastore-popup) + map) + "Keymap for `govc-datastore-mode'.") + +(defun govc-datastore-json-info () + "JSON via govc datastore.info -json on current selection." + (interactive) + (govc-json-info "datastore.info")) + +(defun govc-datastore-info () + "Wrapper for govc datastore.info." + (govc-table-info "datastore.info" (or govc-filter "*"))) + +(defun govc-datastore-ls-selection () + "Browse datastore." + (interactive) + (govc-datastore-ls (tabulated-list-get-id) (govc-current-session))) + +(defun govc-datastore (&optional filter session) + "Datastore info via govc. +Optionally filter by FILTER and inherit SESSION." + (interactive) + (let ((buffer (get-buffer-create "*govc-datastore*"))) + (pop-to-buffer buffer) + (govc-datastore-mode) + (if session + (govc-session-clone session) + (call-interactively 'govc-session)) + (setq govc-filter filter) + (tabulated-list-print))) + +(define-derived-mode govc-datastore-mode tabulated-list-mode "Datastore" + "Major mode for govc datastore.info." + (setq tabulated-list-format [("Name" 15 t) + ("Type" 10 t) + ("Capacity" 10 t) + ("Free" 10 t) + ("Remote" 30 t)] + tabulated-list-sort-key (cons "Name" nil) + tabulated-list-padding 2 + tabulated-list-entries #'govc-datastore-info) + (tabulated-list-init-header)) + +(magit-define-popup govc-datastore-popup + "Datastore popup." + :actions (govc-keymap-popup govc-datastore-mode-map)) + +(easy-menu-define govc-datastore-mode-menu govc-datastore-mode-map + "Datastore menu." + (cons "Datastore" (govc-keymap-menu govc-datastore-mode-map))) + + +;;; govc vm mode +(defun govc-vm-prompt (prompt) + "PROMPT for a vm name." + (completing-read prompt (govc "ls" "vm"))) + +(defun govc-vm-start (name) + "Start vm with given NAME." + (interactive (list (govc-vm-prompt "Start vm: "))) + (govc "vm.power" "-on" name)) + +(defun govc-vm-shutdown (name) + "Shutdown vm with given NAME." + (interactive (list (govc-vm-prompt "Shutdown vm: "))) + (govc "vm.power" "-s" "-force" name)) + +(defun govc-vm-reboot (name) + "Reboot vm with given NAME." + (interactive (list (govc-vm-prompt "Reboot vm: "))) + (govc "vm.power" "-r" "-force" name)) + +(defun govc-vm-suspend (name) + "Suspend vm with given NAME." + (interactive (list (govc-vm-prompt "Suspend vm: "))) + (govc "vm.power" "-suspend" name)) + +(defun govc-vm-destroy (name) + "Destroy vm with given NAME." + (interactive (list (govc-vm-prompt "Destroy vm: "))) + (govc "vm.destroy" name)) + +(defun govc-vm-vnc-enable (name) + "Enable vnc on vm with given NAME." + (--map (last (split-string it)) + (govc "vm.vnc" "-enable" + "-port" "-1" + "-password" (format "%08x" (random (expt 16 8))) name))) + +(defun govc-vm-vnc (name &optional arg) + "VNC for vm with given NAME. +By default, enable and open VNC for the given vm NAME. +With prefix \\[negative-argument] ARG, VNC will be disabled. +With prefix \\[universal-argument] ARG, VNC will be enabled but not opened." + (interactive (list (govc-vm-prompt "VNC vm: ") + current-prefix-arg)) + (if (equal arg '-) + (govc "vm.vnc" "-disable" name) + (let ((urls (govc-vm-vnc-enable name))) + (unless arg + (-each (-flatten urls) 'browse-url))))) + +(defun govc-vm-screen (name &optional arg) + "Console screenshot of vm NAME console. +Open via `eww' by default, via `browse-url' if ARG is non-nil." + (interactive (list (govc-vm-prompt "Console screenshot vm: ") + current-prefix-arg)) + (let* ((data (govc-json "vm.info" name)) + (vms (plist-get data :VirtualMachines)) + (url (govc-url-parse govc-session-url))) + (mapc + (lambda (vm) + (let* ((moid (plist-get (plist-get vm :Self) :Value)) + (on (string= "poweredOn" (plist-get (plist-get vm :Runtime) :PowerState))) + (host (format "%s:%d" (url-host url) (or (url-port url) 443))) + (path (concat "/screen?id=" moid)) + (auth (concat (url-user url) ":" (url-password url)))) + (if current-prefix-arg + (browse-url (concat "https://" auth "@" host path)) + (let ((creds `((,host ("VMware HTTP server" . ,(base64-encode-string auth))))) + (url-basic-auth-storage 'creds) + (u (concat "https://" host path))) + (require 'eww) + (if on + (url-retrieve u 'eww-render (list u)) + (kill-new (message u))))))) + vms))) + +(defun govc-vm-start-selection () + "Start via `govc-vm-start' on the current selection." + (interactive) + (govc-vm-start (govc-selection)) + (tabulated-list-revert)) + +(defun govc-vm-shutdown-selection () + "Shutdown via `govc-vm-shutdown' on the current selection." + (interactive) + (govc-vm-shutdown (govc-selection)) + (tabulated-list-revert)) + +(defun govc-vm-reboot-selection () + "Reboot via `govc-vm-reboot' on the current selection." + (interactive) + (govc-vm-reboot (govc-selection)) + (tabulated-list-revert)) + +(defun govc-vm-suspend-selection () + "Suspend via `govc-vm-suspend' on the current selection." + (interactive) + (govc-vm-suspend (govc-selection)) + (tabulated-list-revert)) + +(defun govc-vm-destroy-selection () + "Destroy via `govc-vm-destroy' on the current selection." + (interactive) + (govc-do-selection 'govc-vm-destroy "Destroy") + (tabulated-list-revert)) + +(defun govc-vm-vnc-selection () + "VNC via `govc-vm-vnc' on the current selection." + (interactive) + (govc-vm-vnc (govc-selection) current-prefix-arg)) + +(defun govc-vm-screen-selection () + "Console screenshot via `govc-vm-screen' on the current selection." + (interactive) + (govc-vm-screen (govc-selection) current-prefix-arg)) + +(defun govc-vm-info () + "Wrapper for govc vm.info." + (govc-table-info "vm.info" (list "-r" (or govc-filter (setq govc-filter (govc-vm-filter)))))) + +(defun govc-vm-host () + "Host info via `govc-host' with host(s) of current selection." + (interactive) + (govc-host (concat "*/" (govc-table-column-value "Host")) + (govc-current-session))) + +(defun govc-vm-datastore () + "Datastore via `govc-datastore-ls' with datastore of current selection." + (interactive) + (govc-datastore (s-split ", " (govc-table-column-value "Storage") t) + (govc-current-session))) + +(defun govc-vm-ping () + "Ping VM." + (interactive) + (let ((ping-program-options '("-c" "20"))) + (ping (govc-table-column-value "IP address")))) + +(defun govc-vm-device-ls () + "Devices via `govc-device' on the current selection." + (interactive) + (govc-device (tabulated-list-get-id) + (govc-current-session))) + +(defun govc-vm-extra-config () + "Populate table with govc vm.info -e output." + (let* ((data (govc-json "vm.info" govc-args)) + (vms (plist-get data :VirtualMachines)) + (info)) + (mapc + (lambda (vm) + (let* ((config (plist-get vm :Config)) + (name (plist-get config :Name))) + (mapc (lambda (x) + (let ((key (plist-get x :Key)) + (val (plist-get x :Value))) + (push (list key (vector key val)) info))) + (plist-get config :ExtraConfig)) + (if (> (length vms) 1) + (push (list name (vector "vm.name" name)) info)))) + vms) + info)) + +(defun govc-vm-extra-config-table () + "ExtraConfig via `govc-vm-extra-config' on the current selection." + (interactive) + (govc-map-info-table #'govc-vm-extra-config)) + +(defun govc-vm-json-info () + "JSON via govc vm.info -json on current selection." + (interactive) + (govc-json-info "vm.info")) + +(defvar govc-vm-mode-map + (let ((map (make-sparse-keymap))) + (define-key map "E" 'govc-events) + (define-key map "J" 'govc-vm-json-info) + (define-key map "X" 'govc-vm-extra-config-table) + (define-key map (kbd "RET") 'govc-vm-device-ls) + (define-key map "C" 'govc-vm-screen-selection) + (define-key map "V" 'govc-vm-vnc-selection) + (define-key map "D" 'govc-vm-destroy-selection) + (define-key map "^" 'govc-vm-start-selection) + (define-key map "!" 'govc-vm-shutdown-selection) + (define-key map "@" 'govc-vm-reboot-selection) + (define-key map "&" 'govc-vm-suspend-selection) + (define-key map "H" 'govc-vm-host) + (define-key map "S" 'govc-vm-datastore) + (define-key map "P" 'govc-vm-ping) + (define-key map "c" 'govc-mode-new-session) + (define-key map "h" 'govc-host-with-session) + (define-key map "p" 'govc-pool-with-session) + (define-key map "s" 'govc-datastore-with-session) + (define-key map "?" 'govc-vm-popup) + map) + "Keymap for `govc-vm-mode'.") + +(defun govc-vm-filter () + "Default `govc-filter' for `vm-info'." + (--map (concat it "/*") + (append (govc-ls-folder (list (concat "/" govc-session-datacenter "/vm"))) + (govc "ls" "-t" "VirtualApp" "vm")))) + +(defun govc-ls-folder (folders) + "List FOLDERS recursively." + (let ((subfolders (govc "ls" "-t" "Folder" folders))) + (append folders + (if subfolders + (govc-ls-folder subfolders))))) + +(defun govc-vm (&optional filter session) + "VM info via govc. +Optionally filter by FILTER and inherit SESSION." + (interactive) + (let ((buffer (get-buffer-create "*govc-vm*"))) + (pop-to-buffer buffer) + (govc-vm-mode) + (if session + (govc-session-clone session) + (call-interactively 'govc-session)) + (setq govc-filter filter) + (tabulated-list-print))) + +(define-derived-mode govc-vm-mode govc-tabulated-list-mode "VM" + "Major mode for handling a list of govc vms." + (setq tabulated-list-format [("Name" 40 t) + ("Power state" 12 t) + ("Boot time" 13 t) + ("IP address" 15 t) + ("Guest name" 20 t) + ("Host" 20 t) + ("CPU usage" 15 t) + ("Host memory usage" 18 t) + ("Guest memory usage" 19 t) + ("Storage committed" 18 t) + ("Storage" 10 t) + ("Network" 10 t)] + tabulated-list-sort-key (cons "Name" nil) + tabulated-list-padding 2 + tabulated-list-entries #'govc-vm-info) + (tabulated-list-init-header)) + +(magit-define-popup govc-vm-popup + "VM popup." + :actions (govc-keymap-popup govc-vm-mode-map)) + +(easy-menu-define govc-vm-mode-menu govc-vm-mode-map + "VM menu." + (cons "VM" (govc-keymap-menu govc-vm-mode-map))) + + +;;; govc device mode +(defun govc-device-ls () + "Wrapper for govc device.ls -vm VM." + (-map (lambda (line) + (let* ((entry (s-split-up-to " " (s-collapse-whitespace line) 2)) + (name (car entry)) + (type (nth 1 entry)) + (summary (car (last entry)))) + (list name (vector name type summary)))) + (govc "device.ls" govc-args))) + +(defun govc-device-info () + "Populate table with govc device.info output." + (govc-map-info "device.info" govc-args)) + +(defun govc-device-info-table () + "Tabulated govc device.info." + (interactive) + (govc-map-info-table #'govc-device-info)) + +(defun govc-device-json-info () + "JSON via govc device.info -json on current selection." + (interactive) + (govc-json-info "device.info")) + +(defvar govc-device-mode-map + (let ((map (make-sparse-keymap))) + (define-key map (kbd "J") 'govc-device-json-info) + (define-key map (kbd "RET") 'govc-device-info-table) + map) + "Keymap for `govc-device-mode'.") + +(defun govc-device (&optional vm session) + "List govc devices for VM. Optionally inherit SESSION." + (interactive) + (let ((buffer (get-buffer-create "*govc-device*"))) + (pop-to-buffer buffer) + (govc-device-mode) + (if session + (govc-session-clone session) + (call-interactively 'govc-session)) + (setq govc-args (list "-vm" (or vm (govc-vm-prompt "vm: ")))) + (tabulated-list-print))) + +(define-derived-mode govc-device-mode govc-tabulated-list-mode "Device" + "Major mode for handling a govc device." + (setq tabulated-list-format [("Name" 15 t) + ("Type" 30 t) + ("Summary" 40 t)] + tabulated-list-sort-key (cons "Name" nil) + tabulated-list-padding 2 + tabulated-list-entries #'govc-device-ls) + (tabulated-list-init-header)) + +(magit-define-popup govc-popup + "govc popup." + :actions (govc-keymap-list govc-command-map)) + +(easy-menu-change + '("Tools") "govc" + (govc-keymap-menu govc-command-map) + "Search Files (Grep)...") + +(provide 'govc) + +;;; govc.el ends here diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/emacs/Makefile juju-core-2.0.2/src/github.com/vmware/govmomi/govc/emacs/Makefile --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/emacs/Makefile 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/emacs/Makefile 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,27 @@ +CASK = cask +EMACS_BIN ?= emacs +EMACS_FLAGS = +EMACS_EXEC = $(CASK) exec $(EMACS_BIN) --no-site-file --no-site-lisp --batch $(EMACS_FLAGS) + +OBJECTS = govc.elc + +elpa: + $(CASK) install + $(CASK) update + touch $@ + +.PHONY: build test docs clean + +build: elpa $(OBJECTS) + +test: build docs + $(EMACS_EXEC) -l test/make.el -f make-test + +docs: build + $(EMACS_EXEC) -l test/make.el -f make-docs +clean: + rm -f $(OBJECTS) elpa + rm -rf .cask + +%.elc: %.el + $(EMACS_EXEC) -f batch-byte-compile $< diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/emacs/README.md juju-core-2.0.2/src/github.com/vmware/govmomi/govc/emacs/README.md --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/emacs/README.md 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/emacs/README.md 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,226 @@ +# govc.el + +Interface to govc for managing VMware ESXi and vCenter. + + +The goal of this package is to provide a simple interface for commonly used +govc commands within Emacs. This includes table based inventory/state modes +for vms, hosts, datastores and pools. The keymap for each mode provides +shortcuts for easily feeding the data in view to other govc commands. + +Within the various govc modes, press `?` to see a popup menu of options. +A menu bar is enabled for certain modes, such as `govc-vm-mode` and `govc-host-mode`. +There is also a `govc` menu at all times under the `Tools` menu. + +The recommended way to install govc.el is via MELPA (http://melpa.org/). + +## govc-mode + +Running `govc-global-mode` creates key bindings to the various govc modes. +The default prefix is `C-c ;` and can be changed by setting `govc-keymap-prefix`. + +### govc-command-map + +Keybinding | Description +---------------|------------------------------------------------------------ +h | Host info via govc +p | Pool info via govc +v | VM info via govc +s | Datastore info via govc + +### govc-urls + +List of URLs for use with `govc-session`. +The `govc-session-name` displayed by `govc-mode-line` uses `url-target` (anchor) +if set, otherwise `url-host` is used. + +Example: +``` + (setq govc-urls `("root:vagrant@localhost:18443#Vagrant-ESXi" + "root:password@192.168.1.192#Intel-NUC" + "Administrator@vsphere.local:password!@vcva-clovervm")) +``` +To enter a URL that is not in the list, prefix `universal-argument`, for example: + + `C-u M-x govc-vm` + +When in `govc-vm` or `govc-host` mode, a default URL is composed with the +current session credentials and the IP address of the current vm/host and +the vm/host name as the session name. This makes it easier to connect to +nested ESX/vCenter VMs or directly to an ESX host. + +### govc-session-url + +ESX or vCenter URL set by `govc-session` via `govc-urls` selection. + +### govc-session-insecure + +Skip verification of server certificate when true. +This variable is set to the value of the `GOVC_INSECURE` env var by default. +It can also be set per-url via the query string (insecure=true). For example: +``` + (setq govc-urls `("root:password@hostname?insecure=true")) +``` + +### govc-session-datacenter + +Datacenter to use for the current `govc-session`. +If the endpoint has a single Datacenter it will be used by default, otherwise +`govc-session` will prompt for selection. It can also be set per-url via the +query string. For example: +``` + (setq govc-urls `("root:password@hostname?datacenter=dc1")) +``` + +### govc-session-datastore + +Datastore to use for the current `govc-session`. +If the endpoint has a single Datastore it will be used by default, otherwise +`govc-session` will prompt for selection. It can also be set per-url via the +query string. For example: +``` + (setq govc-urls `("root:password@hostname?datastore=vsanDatastore")) +``` + +## govc-tabulated-list-mode + +Generic table bindings to mark/unmark rows. + +In addition to any hooks its parent mode `tabulated-list-mode` might have run, +this mode runs the hook `govc-tabulated-list-mode-hook`, as the final step +during initialization. + +### govc-tabulated-list-mode-map + +Keybinding | Description +---------------|------------------------------------------------------------ +m | Mark and move to the next line +u | Unmark and move to the next line +t | Toggle mark +U | Unmark all +M-& | Shell CMD with current `govc-session` exported as GOVC_ env vars +M-w | Copy current selection or region to the kill ring +M-E | Export session to `process-environment` and `kill-ring` + +## govc-host-mode + +Major mode for handling a list of govc hosts. + +In addition to any hooks its parent mode `govc-tabulated-list-mode` might have run, +this mode runs the hook `govc-host-mode-hook`, as the final step +during initialization. + +### govc-host-mode-map + +Keybinding | Description +---------------|------------------------------------------------------------ +E | Events via govc events -n `govc-max-events` +J | JSON via govc host +N | Netstat via `govc-esxcli-netstat-info` with current host id +c | Connect new session for the current govc mode +p | Pool-mode with current session +s | Datastore-mode with current session +v | VM-mode with current session + +## govc-pool-mode + +Major mode for handling a list of govc pools. + +In addition to any hooks its parent mode `govc-tabulated-list-mode` might have run, +this mode runs the hook `govc-pool-mode-hook`, as the final step +during initialization. + +### govc-pool-mode-map + +Keybinding | Description +---------------|------------------------------------------------------------ +E | Events via govc events -n `govc-max-events` +J | JSON via govc pool +D | Destroy via `govc-pool-destroy` on the pool selection +c | Connect new session for the current govc mode +h | Host-mode with current session +s | Datastore-mode with current session +v | VM-mode with current session + +## govc-datastore-mode + +Major mode for govc datastore.info. + +In addition to any hooks its parent mode `tabulated-list-mode` might have run, +this mode runs the hook `govc-datastore-mode-hook`, as the final step +during initialization. + +### govc-datastore-mode-map + +Keybinding | Description +---------------|------------------------------------------------------------ +J | JSON via govc datastore +RET | Browse datastore +c | Connect new session for the current govc mode +h | Host-mode with current session +p | Pool-mode with current session +v | VM-mode with current session + +## govc-datastore-ls-mode + +Major mode govc datastore.ls. + +In addition to any hooks its parent mode `govc-tabulated-list-mode` might have run, +this mode runs the hook `govc-datastore-ls-mode-hook`, as the final step +during initialization. + +### govc-datastore-ls-mode-map + +Keybinding | Description +---------------|------------------------------------------------------------ +J | JSON via govc datastore +D | Delete selected datastore paths ++ | Mkdir via govc datastore +DEL | Up to parent folder +RET | Open datastore folder or file + +## govc-vm-mode + +Major mode for handling a list of govc vms. + +In addition to any hooks its parent mode `govc-tabulated-list-mode` might have run, +this mode runs the hook `govc-vm-mode-hook`, as the final step +during initialization. + +### govc-vm-mode-map + +Keybinding | Description +---------------|------------------------------------------------------------ +E | Events via govc events -n `govc-max-events` +J | JSON via govc vm +X | ExtraConfig via `govc-vm-extra-config` on the current selection +RET | Devices via `govc-device` on the current selection +C | Console screenshot via `govc-vm-screen` on the current selection +V | VNC via `govc-vm-vnc` on the current selection +D | Destroy via `govc-vm-destroy` on the current selection +^ | Start via `govc-vm-start` on the current selection +! | Shutdown via `govc-vm-shutdown` on the current selection +@ | Reboot via `govc-vm-reboot` on the current selection +& | Suspend via `govc-vm-suspend` on the current selection +H | Host info via `govc-host` with host(s) of current selection +S | Datastore via `govc-datastore-ls` with datastore of current selection +P | Ping VM +c | Connect new session for the current govc mode +h | Host-mode with current session +p | Pool-mode with current session +s | Datastore-mode with current session + +## govc-device-mode + +Major mode for handling a govc device. + +In addition to any hooks its parent mode `govc-tabulated-list-mode` might have run, +this mode runs the hook `govc-device-mode-hook`, as the final step +during initialization. + +### govc-device-mode-map + +Keybinding | Description +---------------|------------------------------------------------------------ +J | JSON via govc device +RET | Tabulated govc device diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/emacs/test/govc-test.el juju-core-2.0.2/src/github.com/vmware/govmomi/govc/emacs/test/govc-test.el --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/emacs/test/govc-test.el 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/emacs/test/govc-test.el 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,137 @@ +(defconst testsuite-dir + (if load-file-name + (file-name-directory load-file-name) + ;; Fall back to default directory (in case of M-x eval-buffer) + default-directory) + "Directory of the test suite.") + +(defconst govc-test-helper-path + (concat (expand-file-name (concat testsuite-dir "/../../test/test_helper.bash")))) + +(load (expand-file-name "../govc" testsuite-dir) nil :no-message) + +(ert-deftest test-govc-url-parse () + (dolist (u '("root:vagrant@localhost:18443" + "Administrator@vsphere.local:vagrant@localhost" + "https://root:vagrant@localhost:18443/sdk" + "https://Administrator@vsphere.local:vagrant@localhost/sdk")) + (should (equal u (url-recreate-url (govc-url-parse u)))))) + +(ert-deftest test-govc-session-set-url () + (should (equal govc-session-insecure nil)) + (should (equal govc-session-datacenter nil)) + (with-temp-buffer + (govc-session-set-url "vc.example.com?insecure=true&datacenter=foo&ignored=true") + (should (equal govc-session-insecure "true")) + (should (equal govc-session-datacenter "foo")) + (should (equal govc-session-datastore nil)))) + +(ert-deftest test-govc-copy-environment () + (let ((process-environment) + (govc-session-url "vc.example.com") + (govc-session-insecure "false") + (govc-session-datacenter "dc1") + (govc-session-datastore "ds1")) + (govc-export-environment '-) + (dolist (e govc-environment-map) + (should (equal nil (getenv (car e))))) + (govc-export-environment (universal-argument)) + (dolist (e govc-environment-map) + (should (not (equal nil (getenv (car e)))))))) + +(defun govc-test-env () + (let ((url (getenv "GOVC_TEST_URL"))) + (unless url + (ert-skip "env GOVC_TEST_URL not set")) + (setq govc-session-url url + govc-session-insecure "true"))) + +(defun govc-test-helper (arg) + (shell-command-to-string (format "bash -c \"source %s; %s\"" govc-test-helper-path arg))) + +(defun govc-test-new-vm () + (s-trim-right (govc-test-helper "new_empty_vm"))) + +(defun govc-test-new-id () + (s-trim-right (govc-test-helper "new_id"))) + +(defun govc-test-teardown () + (ignore-errors + (govc-test-helper "teardown"))) + +(ert-deftest test-govc-vm-info () + (govc-test-env) + (unwind-protect + (let ((id (govc-test-new-vm))) + (govc-json-info "vm.info" (list id)) + (with-current-buffer "*govc-json*" + (goto-char (point-min)) + (let ((data (json-read))) + (should (= (length data) 1)) + (should (cdr (assq 'VirtualMachines data))))) + + (govc-json-info "vm.info" (list "ENOENT")) + (with-current-buffer "*govc-json*" + (goto-char (point-min)) + (let ((data (json-read))) + (should (= (length data) 1)) + (should (not (cdr (assq 'VirtualMachines data)))))) + + (let ((govc-args (list id)) + (len1) + (len2)) + (setq len1 (length (govc-vm-extra-config))) + (should (>= len1 1)) + (govc "vm.change" "-vm" id + "-e" "govc-test-one=1" + "-e" "govc-test-two:2.2=2" + ;; test that we don't choke on \n + "-e" "foo=bar +baz") + (setq len2 (length (govc-vm-extra-config))) + + (should (= (- len2 len1) 3))) + + (let ((govc-filter "*")) + (should (>= (length (govc-vm-info)) 1))) + + (let ((govc-filter "ENOENT")) + (should (= (length (govc-vm-info)) 0))) + + (govc-vm-screen id)) + (govc-test-teardown))) + +(ert-deftest test-govc-datastore-ls-entries () + (govc-test-env) + (unwind-protect + (let ((id (govc-test-new-id))) + (should (>= (length (govc-datastore-ls-entries)) 1)) + + (let ((govc-filter (concat id "/"))) + (should-error (govc-datastore-ls-entries)) + (govc "datastore.mkdir" id) + (should (= (length (govc-datastore-ls-entries)) 0)) + (dotimes (i 3) + (govc "datastore.mkdir" (format "%s/dir %d" id i))) + (let ((entries (govc-datastore-ls-entries))) + (should (= (length entries) 3)) + (should (s-starts-with? (concat id "/dir ") (caar entries)))))) + (govc-test-teardown))) + +(ert-deftest test-govc-pool-ls () + (govc-test-env) + (unwind-protect + (let* ((pools (govc-ls-pool)) + (num (length pools)) + (path (concat (car pools) "/" (govc-test-new-id)))) + (should (>= num 1)) + (message "%d existing pools [%S]" num pools) + (govc "pool.create" path) + (setq pools (govc-ls-pool)) + (govc-pool-destroy path) + (should (= (- (length pools) num) 1))) + (govc-test-teardown))) + +(ert-deftest test-govc-about () + (govc-test-env) + (govc "about")) diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/emacs/test/make.el juju-core-2.0.2/src/github.com/vmware/govmomi/govc/emacs/test/make.el --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/emacs/test/make.el 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/emacs/test/make.el 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,58 @@ +#!/usr/bin/env emacs --script + +(let ((current-directory (file-name-directory load-file-name))) + (setq project-test-path (expand-file-name "." current-directory)) + (setq project-root-path (expand-file-name ".." current-directory))) + +(add-to-list 'load-path project-root-path) +(add-to-list 'load-path project-test-path) + +(require 'lisp-mnt) +(require 'govc) +(require 's) + +(defun make-test () + (dolist (test-file (or argv (directory-files project-test-path t "-test.el$"))) + (load test-file nil t)) + (ert-run-tests-batch-and-exit t)) + +(defun govc-help () + "Summary of govc modes in markdown format." + (interactive) + (with-help-window (help-buffer) ; TODO: this turned into a mess, but does the job of generating README.md from govc.el + (dolist (kind '(govc-mode govc-urls govc-session-url govc-session-insecure govc-session-datacenter govc-session-datastore + tabulated-list host pool datastore datastore-ls vm device)) + (let* ((name (if (boundp kind) (symbol-name kind) (format "govc-%s-mode" kind))) + (map (if (equal 'govc-mode kind) 'govc-command-map (intern (concat name "-map")))) + (doc (lambda (f &optional all) + (let* ((txt (if (functionp f) (documentation f t) (documentation-property f 'variable-documentation))) + (ix (if all (length txt) (s-index-of "." txt)))) + (s-replace (format "\n\n\\\{%s\}" (concat name "-map")) "" + (s-replace "'" "`" (substring txt 0 ix))))))) + (princ (concat (s-repeat (if (and (boundp kind) (not (fboundp kind))) 3 2) "#") " " name "\n")) + (princ (concat "\n" (funcall doc (intern name) t) "\n\n")) + (when (boundp map) + (princ (concat "### " (symbol-name map) "\n\n")) + (princ "Keybinding | Description\n") + (princ "---------------|------------------------------------------------------------\n") + (dolist (kl (govc-keymap-list (symbol-value map))) + (let ((key (govc-key-description (car kl)))) + (princ (format "%s%s| %s\n" key (s-repeat (- 4 (length key)) " ") (funcall doc (nth 2 kl)))))) + (princ "\n")))))) + +(defun make-docs () + (let ((commentary) + (summary)) + (with-current-buffer (find-file-noselect (concat project-root-path "/govc.el")) + (setq commentary (s-replace ";;; Commentary:" "" (lm-commentary)) + summary (lm-summary))) + (let ((readme (find-file-noselect (concat project-root-path "/README.md")))) + (with-current-buffer readme + (erase-buffer) + (govc-help) + (with-current-buffer (help-buffer) + (copy-to-buffer readme (point-min) (point-max))) + (goto-char (point-min)) + (insert (concat "# govc.el\n\n" summary ".\n")) + (insert (s-replace "'" "`" (replace-regexp-in-string ";; ?" "" commentary t t))) + (save-buffer 0))))) diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/env/command.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/env/command.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/env/command.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/env/command.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,103 @@ +/* +Copyright (c) 2016 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package env + +import ( + "flag" + "fmt" + "io" + "strings" + + "golang.org/x/net/context" + + "github.com/vmware/govmomi/govc/cli" + "github.com/vmware/govmomi/govc/flags" +) + +type env struct { + *flags.OutputFlag + *flags.ClientFlag + + extra bool +} + +func init() { + cli.Register("env", &env{}) +} + +func (cmd *env) Register(ctx context.Context, f *flag.FlagSet) { + cmd.OutputFlag, ctx = flags.NewOutputFlag(ctx) + cmd.OutputFlag.Register(ctx, f) + + cmd.ClientFlag, ctx = flags.NewClientFlag(ctx) + cmd.ClientFlag.Register(ctx, f) + + f.BoolVar(&cmd.extra, "x", false, "Output variables for each GOVC_URL component") +} + +func (cmd *env) Process(ctx context.Context) error { + if err := cmd.OutputFlag.Process(ctx); err != nil { + return err + } + if err := cmd.ClientFlag.Process(ctx); err != nil { + return err + } + return nil +} + +func (cmd *env) Description() string { + return `Output the environment variables for this client. +If credentials are included in the url, they are split into separate variables. +Useful as bash scripting helper to parse GOVC_URL.` +} + +func (cmd *env) Run(ctx context.Context, f *flag.FlagSet) error { + env := envResult(cmd.ClientFlag.Environ(cmd.extra)) + + if f.NArg() > 1 { + return flag.ErrHelp + } + + // Option to just output the value, example use: + // password=$(govc env GOVC_PASSWORD) + if f.NArg() == 1 { + var output []string + + prefix := fmt.Sprintf("%s=", f.Arg(0)) + + for _, e := range env { + if strings.HasPrefix(e, prefix) { + output = append(output, e[len(prefix):]) + break + } + } + + return cmd.WriteResult(envResult(output)) + } + + return cmd.WriteResult(env) +} + +type envResult []string + +func (r envResult) Write(w io.Writer) error { + for _, e := range r { + fmt.Println(e) + } + + return nil +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/events/command.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/events/command.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/events/command.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/events/command.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,120 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package events + +import ( + "flag" + "fmt" + "os" + "strings" + "time" + + "github.com/vmware/govmomi/event" + "github.com/vmware/govmomi/govc/cli" + "github.com/vmware/govmomi/govc/flags" + "github.com/vmware/govmomi/vim25/types" + "golang.org/x/net/context" +) + +type events struct { + *flags.DatacenterFlag + + Max int32 + Tail bool + Force bool +} + +func init() { + // initialize with the maximum allowed objects set + cli.Register("events", &events{}) +} + +func (cmd *events) Register(ctx context.Context, f *flag.FlagSet) { + cmd.DatacenterFlag, ctx = flags.NewDatacenterFlag(ctx) + cmd.DatacenterFlag.Register(ctx, f) + + cmd.Max = 25 // default + f.Var(flags.NewInt32(&cmd.Max), "n", "Output the last N events") + f.BoolVar(&cmd.Tail, "f", false, "Tail event stream") + f.BoolVar(&cmd.Force, "force", false, "Force event collection: use with CAUTION ") +} + +func (cmd *events) Process(ctx context.Context) error { + if err := cmd.DatacenterFlag.Process(ctx); err != nil { + return err + } + return nil +} + +func (cmd *events) printEvents(ctx context.Context, page []types.BaseEvent, m *event.Manager) error { + event.Sort(page) + for _, e := range page { + cat, err := m.EventCategory(ctx, e) + if err != nil { + return err + } + + event := e.GetEvent() + msg := strings.TrimSpace(event.FullFormattedMessage) + + if t, ok := e.(*types.TaskEvent); ok { + msg = fmt.Sprintf("%s (target=%s %s)", msg, t.Info.Entity.Type, t.Info.EntityName) + } + + fmt.Fprintf(os.Stdout, "[%s] [%s] %s\n", + event.CreatedTime.Local().Format(time.ANSIC), + cat, msg) + } + return nil +} + +func (cmd *events) Usage() string { + return "[PATH]..." +} + +func (cmd *events) Run(ctx context.Context, f *flag.FlagSet) error { + c, err := cmd.Client() + if err != nil { + return err + } + + objs, err := cmd.ManagedObjects(ctx, f.Args()) + if err != nil { + return err + } + + if len(objs) > 0 { + // need an event manager + m := event.NewManager(c) + + // get the event stream + err := m.Events(ctx, objs, cmd.Max, cmd.Tail, cmd.Force, func(ee []types.BaseEvent) error { + err = cmd.printEvents(ctx, ee, m) + if err != nil { + return err + } + return nil + }) + + if err != nil { + return err + } + + } + + return nil +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/examples/lib/ssh.sh juju-core-2.0.2/src/github.com/vmware/govmomi/govc/examples/lib/ssh.sh --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/examples/lib/ssh.sh 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/examples/lib/ssh.sh 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,44 @@ +function public-key { + local dir=${HOME}/.ssh + + for f in $HOME/.ssh/{id_{rsa,dsa},*}.pub; do + if [ -r $f ]; then + echo $f + return + fi + done + + echo "Can't find public key file..." + exit 1 +} + +PUBLIC_KEY_FILE=${PUBLIC_KEY_FILE-$(public-key)} +SSH_OPTS="-oStrictHostKeyChecking=no -oUserKnownHostsFile=/dev/null -oLogLevel=quiet" + +function upload-public-key { + local vm_name=$1 + local dir=$2 + + if [ -z "$dir" ] + then + uid=$(echo $GOVC_GUEST_LOGIN | awk -F: '{print $1}') + dir=$(govc guest.getenv -vm ${vm_name} HOME | awk -F= '{print $2}') + + if [ -z "$dir" ] + then + echo "Can't find ${uid}'s HOME dir..." + exit 1 + fi + fi + + govc guest.mkdir \ + -vm ${vm_name} \ + -p \ + ${dir}/.ssh + + govc guest.upload \ + -vm ${vm_name} \ + -f \ + ${PUBLIC_KEY_FILE} \ + ${dir}/.ssh/authorized_keys +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/examples/vcsa.sh juju-core-2.0.2/src/github.com/vmware/govmomi/govc/examples/vcsa.sh --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/examples/vcsa.sh 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/examples/vcsa.sh 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,57 @@ +#!/bin/bash -e + +lib=$(readlink -nf $(dirname $0))/lib +. $lib/ssh.sh + +ova=$1 + +if [ -z "$ova" ] +then + ova=./VMware-vCenter-Server-Appliance-5.5.0.10300-2000350_OVF10.ova +fi + +# default to local Vagrant esxbox for testing +export GOVC_URL=${GOVC_URL-"https://root:vagrant@localhost:8443/sdk"} + +# default VCSA credentials +export GOVC_GUEST_LOGIN=root:vmware + +# VM name as defined in the VCSA .ovf +vm_name=VMware_vCenter_Server_Appliance + +echo "Importing $ova..." +govc import.ova $ova + +echo "Powering on $vm_name..." +govc vm.power -on $vm_name + +echo "Waiting for $vm_name's IP address..." +vc=$(govc vm.ip $vm_name) + +govc vm.info $vm_name + +echo "Uploading ssh public key to $vm_name..." +upload-public-key $vm_name + +echo "Configuring vCenter Server Appliance..." + +# http://www.virtuallyghetto.com/2012/02/automating-vcenter-server-appliance.html +ssh ${SSH_OPTS} root@$vc < 1 + return nil, flag.err + } + + return flag.dc, err +} + +func (flag *DatacenterFlag) ManagedObjects(ctx context.Context, args []string) ([]types.ManagedObjectReference, error) { + var refs []types.ManagedObjectReference + + c, err := flag.Client() + if err != nil { + return nil, err + } + + if len(args) == 0 { + refs = append(refs, c.ServiceContent.RootFolder) + return refs, nil + } + + finder, err := flag.Finder() + if err != nil { + return nil, err + } + + for _, arg := range args { + elements, err := finder.ManagedObjectList(ctx, arg) + if err != nil { + return nil, err + } + + for _, e := range elements { + refs = append(refs, e.Object.Reference()) + } + } + + return refs, nil +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/flags/datastore.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/flags/datastore.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/flags/datastore.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/flags/datastore.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,133 @@ +/* +Copyright (c) 2014-2016 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package flags + +import ( + "flag" + "fmt" + "net/url" + "os" + + "github.com/vmware/govmomi/object" + "github.com/vmware/govmomi/vim25/types" + "golang.org/x/net/context" +) + +type DatastoreFlag struct { + common + + *DatacenterFlag + + Name string + + ds *object.Datastore +} + +var datastoreFlagKey = flagKey("datastore") + +// NewCustomDatastoreFlag creates and returns a new DatastoreFlag without +// trying to retrieve an existing one from the specified context. +func NewCustomDatastoreFlag(ctx context.Context) (*DatastoreFlag, context.Context) { + v := &DatastoreFlag{} + v.DatacenterFlag, ctx = NewDatacenterFlag(ctx) + return v, ctx +} + +func NewDatastoreFlag(ctx context.Context) (*DatastoreFlag, context.Context) { + if v := ctx.Value(datastoreFlagKey); v != nil { + return v.(*DatastoreFlag), ctx + } + + v, ctx := NewCustomDatastoreFlag(ctx) + ctx = context.WithValue(ctx, datastoreFlagKey, v) + return v, ctx +} + +func (f *DatastoreFlag) Register(ctx context.Context, fs *flag.FlagSet) { + f.RegisterOnce(func() { + f.DatacenterFlag.Register(ctx, fs) + + env := "GOVC_DATASTORE" + value := os.Getenv(env) + usage := fmt.Sprintf("Datastore [%s]", env) + fs.StringVar(&f.Name, "ds", value, usage) + }) +} + +func (f *DatastoreFlag) Process(ctx context.Context) error { + return f.ProcessOnce(func() error { + if err := f.DatacenterFlag.Process(ctx); err != nil { + return err + } + return nil + }) +} + +func (f *DatastoreFlag) Datastore() (*object.Datastore, error) { + if f.ds != nil { + return f.ds, nil + } + + finder, err := f.Finder() + if err != nil { + return nil, err + } + + if f.ds, err = finder.DatastoreOrDefault(context.TODO(), f.Name); err != nil { + return nil, err + } + + return f.ds, nil +} + +func (f *DatastoreFlag) DatastorePath(name string) (string, error) { + ds, err := f.Datastore() + if err != nil { + return "", err + } + + return ds.Path(name), nil +} + +func (f *DatastoreFlag) DatastoreURL(path string) (*url.URL, error) { + dc, err := f.Datacenter() + if err != nil { + return nil, err + } + + ds, err := f.Datastore() + if err != nil { + return nil, err + } + + u, err := ds.URL(context.TODO(), dc, path) + if err != nil { + return nil, err + } + + return u, nil +} + +func (f *DatastoreFlag) Stat(ctx context.Context, file string) (types.BaseFileInfo, error) { + ds, err := f.Datastore() + if err != nil { + return nil, err + } + + return ds.Stat(ctx, file) + +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/flags/debug.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/flags/debug.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/flags/debug.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/flags/debug.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,100 @@ +/* +Copyright (c) 2014-2016 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package flags + +import ( + "flag" + "fmt" + "os" + "path/filepath" + "strings" + "time" + + "golang.org/x/net/context" + + "github.com/vmware/govmomi/vim25/debug" +) + +type DebugFlag struct { + common + + enable bool +} + +var debugFlagKey = flagKey("debug") + +func NewDebugFlag(ctx context.Context) (*DebugFlag, context.Context) { + if v := ctx.Value(debugFlagKey); v != nil { + return v.(*DebugFlag), ctx + } + + v := &DebugFlag{} + ctx = context.WithValue(ctx, debugFlagKey, v) + return v, ctx +} + +func (flag *DebugFlag) Register(ctx context.Context, f *flag.FlagSet) { + flag.RegisterOnce(func() { + env := "GOVC_DEBUG" + enable := false + switch env := strings.ToLower(os.Getenv(env)); env { + case "1", "true": + enable = true + } + + usage := fmt.Sprintf("Store debug logs [%s]", env) + f.BoolVar(&flag.enable, "debug", enable, usage) + }) +} + +func (flag *DebugFlag) Process(ctx context.Context) error { + if !flag.enable { + return nil + } + + return flag.ProcessOnce(func() error { + // Base path for storing debug logs. + r := os.Getenv("GOVC_DEBUG_PATH") + if r == "" { + r = filepath.Join(os.Getenv("HOME"), ".govmomi") + } + r = filepath.Join(r, "debug") + + // Path for this particular run. + run := os.Getenv("GOVC_DEBUG_PATH_RUN") + if run == "" { + now := time.Now().Format("2006-01-02T15-04-05.999999999") + r = filepath.Join(r, now) + } else { + // reuse the same path + r = filepath.Join(r, run) + _ = os.RemoveAll(r) + } + + err := os.MkdirAll(r, 0700) + if err != nil { + return err + } + + p := debug.FileProvider{ + Path: r, + } + + debug.SetProvider(&p) + return nil + }) +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/flags/empty.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/flags/empty.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/flags/empty.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/flags/empty.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,32 @@ +/* +Copyright (c) 2014-2016 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package flags + +import ( + "flag" + + "golang.org/x/net/context" +) + +type EmptyFlag struct{} + +func (flag *EmptyFlag) Register(ctx context.Context, f *flag.FlagSet) { +} + +func (flag *EmptyFlag) Process(ctx context.Context) error { + return nil +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/flags/folder.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/flags/folder.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/flags/folder.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/flags/folder.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,99 @@ +/* +Copyright (c) 2014-2016 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package flags + +import ( + "flag" + "fmt" + "os" + + "github.com/vmware/govmomi/object" + "golang.org/x/net/context" +) + +type FolderFlag struct { + common + + *DatacenterFlag + + name string + folder *object.Folder +} + +var folderFlagKey = flagKey("folder") + +func NewFolderFlag(ctx context.Context) (*FolderFlag, context.Context) { + if v := ctx.Value(folderFlagKey); v != nil { + return v.(*FolderFlag), ctx + } + + v := &FolderFlag{} + v.DatacenterFlag, ctx = NewDatacenterFlag(ctx) + ctx = context.WithValue(ctx, folderFlagKey, v) + return v, ctx +} + +func (flag *FolderFlag) Register(ctx context.Context, f *flag.FlagSet) { + flag.RegisterOnce(func() { + flag.DatacenterFlag.Register(ctx, f) + + env := "GOVC_FOLDER" + value := os.Getenv(env) + usage := fmt.Sprintf("Folder [%s]", env) + f.StringVar(&flag.name, "folder", value, usage) + }) +} + +func (flag *FolderFlag) Process(ctx context.Context) error { + return flag.ProcessOnce(func() error { + if err := flag.DatacenterFlag.Process(ctx); err != nil { + return err + } + return nil + }) +} + +func (flag *FolderFlag) Folder() (*object.Folder, error) { + if flag.folder != nil { + return flag.folder, nil + } + + finder, err := flag.Finder() + if err != nil { + return nil, err + } + + if flag.folder, err = finder.FolderOrDefault(context.TODO(), flag.name); err != nil { + return nil, err + } + + return flag.folder, nil +} + +func (flag *FolderFlag) FolderOrRoot() (*object.Folder, error) { + if flag.name == "" { + client, err := flag.Client() + if err != nil { + return nil, err + } + + flag.folder = object.NewRootFolder(client) + return flag.folder, nil + } + + return flag.Folder() +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/flags/host_connect.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/flags/host_connect.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/flags/host_connect.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/flags/host_connect.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,79 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package flags + +import ( + "flag" + "fmt" + + "golang.org/x/net/context" + + "github.com/vmware/govmomi/vim25/types" +) + +type HostConnectFlag struct { + common + + types.HostConnectSpec + + noverify bool +} + +var hostConnectFlagKey = flagKey("hostConnect") + +func NewHostConnectFlag(ctx context.Context) (*HostConnectFlag, context.Context) { + if v := ctx.Value(hostConnectFlagKey); v != nil { + return v.(*HostConnectFlag), ctx + } + + v := &HostConnectFlag{} + ctx = context.WithValue(ctx, hostConnectFlagKey, v) + return v, ctx +} + +func (flag *HostConnectFlag) Register(ctx context.Context, f *flag.FlagSet) { + flag.RegisterOnce(func() { + f.StringVar(&flag.HostName, "hostname", "", "Hostname or IP address of the host") + f.StringVar(&flag.UserName, "username", "", "Username of administration account on the host") + f.StringVar(&flag.Password, "password", "", "Password of administration account on the host") + f.StringVar(&flag.SslThumbprint, "fingerprint", "", "Fingerprint of the host's SSL certificate") + f.BoolVar(&flag.Force, "force", false, "Force when host is managed by another VC") + + f.BoolVar(&flag.noverify, "noverify", false, "When true, ignore host SSL certificate verification error") + }) +} + +func (flag *HostConnectFlag) Process(ctx context.Context) error { + return nil +} + +// AcceptThumbprint returns nil if the given error is an SSLVerifyFault and -noverify is true. +// In which case, flag.SslThumbprint is set to fault.Thumbprint and the caller should retry the task. +func (flag *HostConnectFlag) AcceptThumbprint(err error) error { + if f, ok := err.(types.HasFault); ok { + switch fault := f.Fault().(type) { + case *types.SSLVerifyFault: + if flag.noverify { + flag.SslThumbprint = fault.Thumbprint + return nil + } + return fmt.Errorf("%s Fingerprint is %s", err, fault.Thumbprint) + } + } + + return err +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/flags/host_system.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/flags/host_system.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/flags/host_system.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/flags/host_system.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,141 @@ +/* +Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package flags + +import ( + "flag" + "fmt" + "os" + + "github.com/vmware/govmomi/object" + "golang.org/x/net/context" +) + +type HostSystemFlag struct { + common + + *ClientFlag + *DatacenterFlag + *SearchFlag + + name string + host *object.HostSystem + pool *object.ResourcePool +} + +var hostSystemFlagKey = flagKey("hostSystem") + +func NewHostSystemFlag(ctx context.Context) (*HostSystemFlag, context.Context) { + if v := ctx.Value(hostSystemFlagKey); v != nil { + return v.(*HostSystemFlag), ctx + } + + v := &HostSystemFlag{} + v.ClientFlag, ctx = NewClientFlag(ctx) + v.DatacenterFlag, ctx = NewDatacenterFlag(ctx) + v.SearchFlag, ctx = NewSearchFlag(ctx, SearchHosts) + ctx = context.WithValue(ctx, hostSystemFlagKey, v) + return v, ctx +} + +func (flag *HostSystemFlag) Register(ctx context.Context, f *flag.FlagSet) { + flag.RegisterOnce(func() { + flag.ClientFlag.Register(ctx, f) + flag.DatacenterFlag.Register(ctx, f) + flag.SearchFlag.Register(ctx, f) + + env := "GOVC_HOST" + value := os.Getenv(env) + usage := fmt.Sprintf("Host system [%s]", env) + f.StringVar(&flag.name, "host", value, usage) + }) +} + +func (flag *HostSystemFlag) Process(ctx context.Context) error { + return flag.ProcessOnce(func() error { + if err := flag.ClientFlag.Process(ctx); err != nil { + return err + } + if err := flag.DatacenterFlag.Process(ctx); err != nil { + return err + } + if err := flag.SearchFlag.Process(ctx); err != nil { + return err + } + return nil + }) +} + +func (flag *HostSystemFlag) HostSystemIfSpecified() (*object.HostSystem, error) { + if flag.host != nil { + return flag.host, nil + } + + // Use search flags if specified. + if flag.SearchFlag.IsSet() { + host, err := flag.SearchFlag.HostSystem() + if err != nil { + return nil, err + } + + flag.host = host + return flag.host, nil + } + + // Never look for a default host system. + // A host system parameter is optional for vm creation. It uses a mandatory + // resource pool parameter to determine where the vm should be placed. + if flag.name == "" { + return nil, nil + } + + finder, err := flag.Finder() + if err != nil { + return nil, err + } + + flag.host, err = finder.HostSystem(context.TODO(), flag.name) + return flag.host, err +} + +func (flag *HostSystemFlag) HostSystem() (*object.HostSystem, error) { + host, err := flag.HostSystemIfSpecified() + if err != nil { + return nil, err + } + + if host != nil { + return host, nil + } + + finder, err := flag.Finder() + if err != nil { + return nil, err + } + + flag.host, err = finder.DefaultHostSystem(context.TODO()) + return flag.host, err +} + +func (flag *HostSystemFlag) HostNetworkSystem() (*object.HostNetworkSystem, error) { + host, err := flag.HostSystem() + if err != nil { + return nil, err + } + + return host.ConfigManager().NetworkSystem(context.TODO()) +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/flags/int32.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/flags/int32.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/flags/int32.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/flags/int32.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,46 @@ +/* +Copyright (c) 2016 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package flags + +import ( + "flag" + "fmt" + "strconv" +) + +// This flag type is internal to stdlib: +// https://github.com/golang/go/blob/master/src/cmd/internal/obj/flag.go +type int32Value int32 + +func (i *int32Value) Set(s string) error { + v, err := strconv.ParseInt(s, 0, 64) + *i = int32Value(v) + return err +} + +func (i *int32Value) Get() interface{} { + return int32(*i) +} + +func (i *int32Value) String() string { + return fmt.Sprintf("%v", *i) +} + +// NewInt32 behaves as flag.IntVar, but using an int32 type. +func NewInt32(v *int32) flag.Value { + return (*int32Value)(v) +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/flags/network.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/flags/network.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/flags/network.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/flags/network.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,131 @@ +/* +Copyright (c) 2014-2016 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package flags + +import ( + "flag" + "fmt" + "os" + + "github.com/vmware/govmomi/object" + "github.com/vmware/govmomi/vim25/types" + "golang.org/x/net/context" +) + +type NetworkFlag struct { + common + + *DatacenterFlag + + name string + net object.NetworkReference + adapter string + address string + isset bool +} + +var networkFlagKey = flagKey("network") + +func NewNetworkFlag(ctx context.Context) (*NetworkFlag, context.Context) { + if v := ctx.Value(networkFlagKey); v != nil { + return v.(*NetworkFlag), ctx + } + + v := &NetworkFlag{} + v.DatacenterFlag, ctx = NewDatacenterFlag(ctx) + ctx = context.WithValue(ctx, networkFlagKey, v) + return v, ctx +} + +func (flag *NetworkFlag) Register(ctx context.Context, f *flag.FlagSet) { + flag.RegisterOnce(func() { + flag.DatacenterFlag.Register(ctx, f) + + env := "GOVC_NETWORK" + value := os.Getenv(env) + flag.name = value + usage := fmt.Sprintf("Network [%s]", env) + f.Var(flag, "net", usage) + f.StringVar(&flag.adapter, "net.adapter", "e1000", "Network adapter type") + f.StringVar(&flag.address, "net.address", "", "Network hardware address") + }) +} + +func (flag *NetworkFlag) Process(ctx context.Context) error { + return flag.ProcessOnce(func() error { + if err := flag.DatacenterFlag.Process(ctx); err != nil { + return err + } + return nil + }) +} + +func (flag *NetworkFlag) String() string { + return flag.name +} + +func (flag *NetworkFlag) Set(name string) error { + flag.name = name + flag.isset = true + return nil +} + +func (flag *NetworkFlag) IsSet() bool { + return flag.isset +} + +func (flag *NetworkFlag) Network() (object.NetworkReference, error) { + if flag.net != nil { + return flag.net, nil + } + + finder, err := flag.Finder() + if err != nil { + return nil, err + } + + if flag.net, err = finder.NetworkOrDefault(context.TODO(), flag.name); err != nil { + return nil, err + } + + return flag.net, nil +} + +func (flag *NetworkFlag) Device() (types.BaseVirtualDevice, error) { + net, err := flag.Network() + if err != nil { + return nil, err + } + + backing, err := net.EthernetCardBackingInfo(context.TODO()) + if err != nil { + return nil, err + } + + device, err := object.EthernetCardTypes().CreateEthernetCard(flag.adapter, backing) + if err != nil { + return nil, err + } + + if flag.address != "" { + card := device.(types.BaseVirtualEthernetCard).GetVirtualEthernetCard() + card.AddressType = string(types.VirtualEthernetCardMacTypeManual) + card.MacAddress = flag.address + } + + return device, nil +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/flags/optional_bool.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/flags/optional_bool.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/flags/optional_bool.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/flags/optional_bool.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,55 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package flags + +import ( + "flag" + "fmt" + "strconv" +) + +type optionalBool struct { + val **bool +} + +func (b *optionalBool) Set(s string) error { + v, err := strconv.ParseBool(s) + *b.val = &v + return err +} + +func (b *optionalBool) Get() interface{} { + if *b.val == nil { + return nil + } + return **b.val +} + +func (b *optionalBool) String() string { + if *b.val == nil { + return "" + } + return fmt.Sprintf("%v", **b.val) +} + +func (b *optionalBool) IsBoolFlag() bool { return true } + +// NewOptionalBool returns a flag.Value implementation where there is no default value. +// This avoids sending a default value over the wire as using flag.BoolVar() would. +func NewOptionalBool(v **bool) flag.Value { + return &optionalBool{v} +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/flags/optional_bool_test.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/flags/optional_bool_test.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/flags/optional_bool_test.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/flags/optional_bool_test.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,63 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package flags + +import ( + "flag" + "testing" +) + +func TestOptionalBool(t *testing.T) { + fs := flag.NewFlagSet("", flag.ContinueOnError) + var val *bool + + fs.Var(NewOptionalBool(&val), "obool", "optional bool") + + b := fs.Lookup("obool") + + if b.DefValue != "" { + t.Fail() + } + + if b.Value.String() != "" { + t.Fail() + } + + if b.Value.(flag.Getter).Get() != nil { + t.Fail() + } + + b.Value.Set("true") + + if b.Value.String() != "true" { + t.Fail() + } + + if b.Value.(flag.Getter).Get() != true { + t.Fail() + } + + b.Value.Set("false") + + if b.Value.String() != "false" { + t.Fail() + } + + if b.Value.(flag.Getter).Get() != false { + t.Fail() + } +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/flags/output.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/flags/output.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/flags/output.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/flags/output.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,217 @@ +/* +Copyright (c) 2014-2016 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package flags + +import ( + "encoding/json" + "flag" + "fmt" + "io" + "os" + "sync" + "time" + + "golang.org/x/net/context" + + "github.com/vmware/govmomi/vim25/progress" + + "github.com/davecgh/go-spew/spew" +) + +type OutputWriter interface { + Write(io.Writer) error +} + +type OutputFlag struct { + common + + JSON bool + TTY bool + Dump bool +} + +var outputFlagKey = flagKey("output") + +func NewOutputFlag(ctx context.Context) (*OutputFlag, context.Context) { + if v := ctx.Value(outputFlagKey); v != nil { + return v.(*OutputFlag), ctx + } + + v := &OutputFlag{} + ctx = context.WithValue(ctx, outputFlagKey, v) + return v, ctx +} + +func (flag *OutputFlag) Register(ctx context.Context, f *flag.FlagSet) { + flag.RegisterOnce(func() { + f.BoolVar(&flag.JSON, "json", false, "Enable JSON output") + f.BoolVar(&flag.Dump, "dump", false, "Enable output dump") + }) +} + +func (flag *OutputFlag) Process(ctx context.Context) error { + return flag.ProcessOnce(func() error { + if !flag.JSON { + // Assume we have a tty if not outputting JSON + flag.TTY = true + } + + return nil + }) +} + +// Log outputs the specified string, prefixed with the current time. +// A newline is not automatically added. If the specified string +// starts with a '\r', the current line is cleared first. +func (flag *OutputFlag) Log(s string) (int, error) { + if len(s) > 0 && s[0] == '\r' { + flag.Write([]byte{'\r', 033, '[', 'K'}) + s = s[1:] + } + + return flag.WriteString(time.Now().Format("[02-01-06 15:04:05] ") + s) +} + +func (flag *OutputFlag) Write(b []byte) (int, error) { + if !flag.TTY { + return 0, nil + } + + n, err := os.Stdout.Write(b) + os.Stdout.Sync() + return n, err +} + +func (flag *OutputFlag) WriteString(s string) (int, error) { + return flag.Write([]byte(s)) +} + +func (flag *OutputFlag) WriteResult(result OutputWriter) error { + var err error + var out = os.Stdout + + if flag.JSON { + err = json.NewEncoder(out).Encode(result) + } else if flag.Dump { + scs := spew.ConfigState{Indent: " "} + scs.Fdump(out, result) + } else { + err = result.Write(out) + } + + return err +} + +type progressLogger struct { + flag *OutputFlag + prefix string + + wg sync.WaitGroup + + sink chan chan progress.Report + done chan struct{} +} + +func newProgressLogger(flag *OutputFlag, prefix string) *progressLogger { + p := &progressLogger{ + flag: flag, + prefix: prefix, + + sink: make(chan chan progress.Report), + done: make(chan struct{}), + } + + p.wg.Add(1) + + go p.loopA() + + return p +} + +// loopA runs before Sink() has been called. +func (p *progressLogger) loopA() { + var err error + + defer p.wg.Done() + + tick := time.NewTicker(100 * time.Millisecond) + defer tick.Stop() + + for stop := false; !stop; { + select { + case ch := <-p.sink: + err = p.loopB(tick, ch) + stop = true + case <-p.done: + stop = true + case <-tick.C: + line := fmt.Sprintf("\r%s", p.prefix) + p.flag.Log(line) + } + } + + if err != nil && err != io.EOF { + p.flag.Log(fmt.Sprintf("\r%sError: %s\n", p.prefix, err)) + } else { + p.flag.Log(fmt.Sprintf("\r%sOK\n", p.prefix)) + } +} + +// loopA runs after Sink() has been called. +func (p *progressLogger) loopB(tick *time.Ticker, ch <-chan progress.Report) error { + var r progress.Report + var ok bool + var err error + + for ok = true; ok; { + select { + case r, ok = <-ch: + if !ok { + break + } + err = r.Error() + case <-tick.C: + line := fmt.Sprintf("\r%s", p.prefix) + if r != nil { + line += fmt.Sprintf("(%.0f%%", r.Percentage()) + detail := r.Detail() + if detail != "" { + line += fmt.Sprintf(", %s", detail) + } + line += ")" + } + p.flag.Log(line) + } + } + + return err +} + +func (p *progressLogger) Sink() chan<- progress.Report { + ch := make(chan progress.Report) + p.sink <- ch + return ch +} + +func (p *progressLogger) Wait() { + close(p.done) + p.wg.Wait() +} + +func (flag *OutputFlag) ProgressLogger(prefix string) *progressLogger { + return newProgressLogger(flag, prefix) +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/flags/resource_pool.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/flags/resource_pool.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/flags/resource_pool.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/flags/resource_pool.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,85 @@ +/* +Copyright (c) 2014-2016 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package flags + +import ( + "flag" + "fmt" + "os" + + "github.com/vmware/govmomi/object" + "golang.org/x/net/context" +) + +type ResourcePoolFlag struct { + common + + *DatacenterFlag + + name string + pool *object.ResourcePool +} + +var resourcePoolFlagKey = flagKey("resourcePool") + +func NewResourcePoolFlag(ctx context.Context) (*ResourcePoolFlag, context.Context) { + if v := ctx.Value(resourcePoolFlagKey); v != nil { + return v.(*ResourcePoolFlag), ctx + } + + v := &ResourcePoolFlag{} + v.DatacenterFlag, ctx = NewDatacenterFlag(ctx) + ctx = context.WithValue(ctx, resourcePoolFlagKey, v) + return v, ctx +} + +func (flag *ResourcePoolFlag) Register(ctx context.Context, f *flag.FlagSet) { + flag.RegisterOnce(func() { + flag.DatacenterFlag.Register(ctx, f) + + env := "GOVC_RESOURCE_POOL" + value := os.Getenv(env) + usage := fmt.Sprintf("Resource pool [%s]", env) + f.StringVar(&flag.name, "pool", value, usage) + }) +} + +func (flag *ResourcePoolFlag) Process(ctx context.Context) error { + return flag.ProcessOnce(func() error { + if err := flag.DatacenterFlag.Process(ctx); err != nil { + return err + } + return nil + }) +} + +func (flag *ResourcePoolFlag) ResourcePool() (*object.ResourcePool, error) { + if flag.pool != nil { + return flag.pool, nil + } + + finder, err := flag.Finder() + if err != nil { + return nil, err + } + + if flag.pool, err = finder.ResourcePoolOrDefault(context.TODO(), flag.name); err != nil { + return nil, err + } + + return flag.pool, nil +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/flags/search.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/flags/search.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/flags/search.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/flags/search.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,392 @@ +/* +Copyright (c) 2014-2016 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package flags + +import ( + "errors" + "flag" + "fmt" + "strings" + + "github.com/vmware/govmomi/find" + "github.com/vmware/govmomi/object" + "github.com/vmware/govmomi/vim25" + "golang.org/x/net/context" +) + +const ( + SearchVirtualMachines = iota + 1 + SearchHosts + SearchVirtualApps +) + +type SearchFlag struct { + common + + *ClientFlag + *DatacenterFlag + + t int + entity string + + byDatastorePath string + byDNSName string + byInventoryPath string + byIP string + byUUID string + + isset bool +} + +var searchFlagKey = flagKey("search") + +func NewSearchFlag(ctx context.Context, t int) (*SearchFlag, context.Context) { + if v := ctx.Value(searchFlagKey); v != nil { + return v.(*SearchFlag), ctx + } + + v := &SearchFlag{ + t: t, + } + + v.ClientFlag, ctx = NewClientFlag(ctx) + v.DatacenterFlag, ctx = NewDatacenterFlag(ctx) + + switch t { + case SearchVirtualMachines: + v.entity = "VM" + case SearchHosts: + v.entity = "host" + case SearchVirtualApps: + v.entity = "vapp" + default: + panic("invalid search type") + } + + ctx = context.WithValue(ctx, searchFlagKey, v) + return v, ctx +} + +func (flag *SearchFlag) Register(ctx context.Context, fs *flag.FlagSet) { + flag.RegisterOnce(func() { + flag.ClientFlag.Register(ctx, fs) + flag.DatacenterFlag.Register(ctx, fs) + + register := func(v *string, f string, d string) { + f = fmt.Sprintf("%s.%s", strings.ToLower(flag.entity), f) + d = fmt.Sprintf(d, flag.entity) + fs.StringVar(v, f, "", d) + } + + switch flag.t { + case SearchVirtualMachines: + register(&flag.byDatastorePath, "path", "Find %s by path to .vmx file") + } + + switch flag.t { + case SearchVirtualMachines, SearchHosts: + register(&flag.byDNSName, "dns", "Find %s by FQDN") + register(&flag.byIP, "ip", "Find %s by IP address") + register(&flag.byUUID, "uuid", "Find %s by instance UUID") + } + + register(&flag.byInventoryPath, "ipath", "Find %s by inventory path") + }) +} + +func (flag *SearchFlag) Process(ctx context.Context) error { + return flag.ProcessOnce(func() error { + if err := flag.ClientFlag.Process(ctx); err != nil { + return err + } + if err := flag.DatacenterFlag.Process(ctx); err != nil { + return err + } + + flags := []string{ + flag.byDatastorePath, + flag.byDNSName, + flag.byInventoryPath, + flag.byIP, + flag.byUUID, + } + + flag.isset = false + for _, f := range flags { + if f != "" { + if flag.isset { + return errors.New("cannot use more than one search flag") + } + flag.isset = true + } + } + + return nil + }) +} + +func (flag *SearchFlag) IsSet() bool { + return flag.isset +} + +func (flag *SearchFlag) searchIndex(c *vim25.Client) *object.SearchIndex { + return object.NewSearchIndex(c) +} + +func (flag *SearchFlag) searchByDatastorePath(c *vim25.Client, dc *object.Datacenter) (object.Reference, error) { + switch flag.t { + case SearchVirtualMachines: + return flag.searchIndex(c).FindByDatastorePath(context.TODO(), dc, flag.byDatastorePath) + default: + panic("unsupported type") + } +} + +func (flag *SearchFlag) searchByDNSName(c *vim25.Client, dc *object.Datacenter) (object.Reference, error) { + switch flag.t { + case SearchVirtualMachines: + return flag.searchIndex(c).FindByDnsName(context.TODO(), dc, flag.byDNSName, true) + case SearchHosts: + return flag.searchIndex(c).FindByDnsName(context.TODO(), dc, flag.byDNSName, false) + default: + panic("unsupported type") + } +} + +func (flag *SearchFlag) searchByInventoryPath(c *vim25.Client, dc *object.Datacenter) (object.Reference, error) { + // TODO(PN): The datacenter flag should not be set because it is ignored. + return flag.searchIndex(c).FindByInventoryPath(context.TODO(), flag.byInventoryPath) +} + +func (flag *SearchFlag) searchByIP(c *vim25.Client, dc *object.Datacenter) (object.Reference, error) { + switch flag.t { + case SearchVirtualMachines: + return flag.searchIndex(c).FindByIp(context.TODO(), dc, flag.byIP, true) + case SearchHosts: + return flag.searchIndex(c).FindByIp(context.TODO(), dc, flag.byIP, false) + default: + panic("unsupported type") + } +} + +func (flag *SearchFlag) searchByUUID(c *vim25.Client, dc *object.Datacenter) (object.Reference, error) { + switch flag.t { + case SearchVirtualMachines: + return flag.searchIndex(c).FindByUuid(context.TODO(), dc, flag.byUUID, true, nil) + case SearchHosts: + return flag.searchIndex(c).FindByUuid(context.TODO(), dc, flag.byUUID, false, nil) + default: + panic("unsupported type") + } +} + +func (flag *SearchFlag) search() (object.Reference, error) { + var ref object.Reference + var err error + + c, err := flag.Client() + if err != nil { + return nil, err + } + + dc, err := flag.Datacenter() + if err != nil { + return nil, err + } + + switch { + case flag.byDatastorePath != "": + ref, err = flag.searchByDatastorePath(c, dc) + case flag.byDNSName != "": + ref, err = flag.searchByDNSName(c, dc) + case flag.byInventoryPath != "": + ref, err = flag.searchByInventoryPath(c, dc) + case flag.byIP != "": + ref, err = flag.searchByIP(c, dc) + case flag.byUUID != "": + ref, err = flag.searchByUUID(c, dc) + default: + err = errors.New("no search flag specified") + } + + if err != nil { + return nil, err + } + + if ref == nil { + return nil, fmt.Errorf("no such %s", flag.entity) + } + + return ref, nil +} + +func (flag *SearchFlag) VirtualMachine() (*object.VirtualMachine, error) { + ref, err := flag.search() + if err != nil { + return nil, err + } + + vm, ok := ref.(*object.VirtualMachine) + if !ok { + return nil, fmt.Errorf("expected VirtualMachine entity, got %s", ref.Reference().Type) + } + + return vm, nil +} + +func (flag *SearchFlag) VirtualMachines(args []string) ([]*object.VirtualMachine, error) { + var out []*object.VirtualMachine + + if flag.IsSet() { + vm, err := flag.VirtualMachine() + if err != nil { + return nil, err + } + + out = append(out, vm) + return out, nil + } + + // List virtual machines + if len(args) == 0 { + return nil, errors.New("no argument") + } + + finder, err := flag.Finder() + if err != nil { + return nil, err + } + + var nfe error + + // List virtual machines for every argument + for _, arg := range args { + vms, err := finder.VirtualMachineList(context.TODO(), arg) + if err != nil { + if _, ok := err.(*find.NotFoundError); ok { + // Let caller decide how to handle NotFoundError + nfe = err + continue + } + return nil, err + } + + out = append(out, vms...) + } + + return out, nfe +} + +func (flag *SearchFlag) VirtualApp() (*object.VirtualApp, error) { + ref, err := flag.search() + if err != nil { + return nil, err + } + + app, ok := ref.(*object.VirtualApp) + if !ok { + return nil, fmt.Errorf("expected VirtualApp entity, got %s", ref.Reference().Type) + } + + return app, nil +} + +func (flag *SearchFlag) VirtualApps(args []string) ([]*object.VirtualApp, error) { + var out []*object.VirtualApp + + if flag.IsSet() { + app, err := flag.VirtualApp() + if err != nil { + return nil, err + } + + out = append(out, app) + return out, nil + } + + // List virtual apps + if len(args) == 0 { + return nil, errors.New("no argument") + } + + finder, err := flag.Finder() + if err != nil { + return nil, err + } + + // List virtual apps for every argument + for _, arg := range args { + apps, err := finder.VirtualAppList(context.TODO(), arg) + if err != nil { + return nil, err + } + + out = append(out, apps...) + } + + return out, nil +} + +func (flag *SearchFlag) HostSystem() (*object.HostSystem, error) { + ref, err := flag.search() + if err != nil { + return nil, err + } + + host, ok := ref.(*object.HostSystem) + if !ok { + return nil, fmt.Errorf("expected HostSystem entity, got %s", ref.Reference().Type) + } + + return host, nil +} + +func (flag *SearchFlag) HostSystems(args []string) ([]*object.HostSystem, error) { + var out []*object.HostSystem + + if flag.IsSet() { + host, err := flag.HostSystem() + if err != nil { + return nil, err + } + + out = append(out, host) + return out, nil + } + + // List host system + if len(args) == 0 { + return nil, errors.New("no argument") + } + + finder, err := flag.Finder() + if err != nil { + return nil, err + } + + // List host systems for every argument + for _, arg := range args { + vms, err := finder.HostSystemList(context.TODO(), arg) + if err != nil { + return nil, err + } + + out = append(out, vms...) + } + + return out, nil +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/flags/storage_pod.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/flags/storage_pod.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/flags/storage_pod.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/flags/storage_pod.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,78 @@ +package flags + +import ( + "flag" + "fmt" + "os" + + "golang.org/x/net/context" + + "github.com/vmware/govmomi/object" +) + +type StoragePodFlag struct { + common + + *DatacenterFlag + + Name string + + sp *object.StoragePod +} + +var storagePodFlagKey = flagKey("storagePod") + +func NewStoragePodFlag(ctx context.Context) (*StoragePodFlag, context.Context) { + if v := ctx.Value(storagePodFlagKey); v != nil { + return v.(*StoragePodFlag), ctx + } + + v := &StoragePodFlag{} + v.DatacenterFlag, ctx = NewDatacenterFlag(ctx) + ctx = context.WithValue(ctx, storagePodFlagKey, v) + return v, ctx +} + +func (f *StoragePodFlag) Register(ctx context.Context, fs *flag.FlagSet) { + f.RegisterOnce(func() { + f.DatacenterFlag.Register(ctx, fs) + + env := "GOVC_DATASTORE_CLUSTER" + value := os.Getenv(env) + usage := fmt.Sprintf("Datastore cluster [%s]", env) + fs.StringVar(&f.Name, "datastore-cluster", value, usage) + }) +} + +func (f *StoragePodFlag) Process(ctx context.Context) error { + return f.DatacenterFlag.Process(ctx) +} + +func (f *StoragePodFlag) Isset() bool { + return f.Name != "" +} + +func (f *StoragePodFlag) StoragePod() (*object.StoragePod, error) { + if f.sp != nil { + return f.sp, nil + } + + finder, err := f.Finder() + if err != nil { + return nil, err + } + + if f.Isset() { + f.sp, err = finder.DatastoreCluster(context.TODO(), f.Name) + if err != nil { + return nil, err + } + } else { + f.sp, err = finder.DefaultDatastoreCluster(context.TODO()) + if err != nil { + return nil, err + } + } + + return f.sp, nil +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/flags/version.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/flags/version.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/flags/version.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/flags/version.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,61 @@ +/* +Copyright (c) 2014 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package flags + +import ( + "strconv" + "strings" +) + +type version []int + +func ParseVersion(s string) (version, error) { + v := make(version, 0) + ps := strings.Split(s, ".") + for _, p := range ps { + i, err := strconv.Atoi(p) + if err != nil { + return nil, err + } + + v = append(v, i) + } + + return v, nil +} + +func (v version) Lte(u version) bool { + lv := len(v) + lu := len(u) + + for i := 0; i < lv; i++ { + // Everything up to here has been equal and v has more elements than u. + if i >= lu { + return false + } + + // Move to next digit if equal. + if v[i] == u[i] { + continue + } + + return v[i] < u[i] + } + + // Equal. + return true +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/flags/version_test.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/flags/version_test.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/flags/version_test.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/flags/version_test.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,63 @@ +/* +Copyright (c) 2014 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package flags + +import "testing" + +func TestParseVersion(t *testing.T) { + var v version + var err error + + v, err = ParseVersion("5.5.5.5") + if err != nil { + t.Error(err) + } + + if len(v) != 4 { + t.Errorf("Expected %d elements, got %d", 4, len(v)) + } + + for i := 0; i < len(v); i++ { + if v[i] != 5 { + t.Errorf("Expected %d, got %d", 5, v[i]) + } + } +} + +func TestLte(t *testing.T) { + v1, err := ParseVersion("5.5") + if err != nil { + panic(err) + } + + v2, err := ParseVersion("5.6") + if err != nil { + panic(err) + } + + if !v1.Lte(v1) { + t.Errorf("Expected 5.5 <= 5.5") + } + + if !v1.Lte(v2) { + t.Errorf("Expected 5.5 <= 5.6") + } + + if v2.Lte(v1) { + t.Errorf("Expected not 5.6 <= 5.5") + } +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/flags/virtual_app.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/flags/virtual_app.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/flags/virtual_app.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/flags/virtual_app.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,104 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package flags + +import ( + "flag" + "fmt" + "os" + + "github.com/vmware/govmomi/object" + "golang.org/x/net/context" +) + +type VirtualAppFlag struct { + common + + *DatacenterFlag + *SearchFlag + + name string + app *object.VirtualApp +} + +var virtualAppFlagKey = flagKey("virtualApp") + +func NewVirtualAppFlag(ctx context.Context) (*VirtualAppFlag, context.Context) { + if v := ctx.Value(virtualAppFlagKey); v != nil { + return v.(*VirtualAppFlag), ctx + } + + v := &VirtualAppFlag{} + v.DatacenterFlag, ctx = NewDatacenterFlag(ctx) + v.SearchFlag, ctx = NewSearchFlag(ctx, SearchVirtualApps) + ctx = context.WithValue(ctx, virtualAppFlagKey, v) + return v, ctx +} + +func (flag *VirtualAppFlag) Register(ctx context.Context, f *flag.FlagSet) { + flag.RegisterOnce(func() { + flag.DatacenterFlag.Register(ctx, f) + flag.SearchFlag.Register(ctx, f) + + env := "GOVC_VAPP" + value := os.Getenv(env) + usage := fmt.Sprintf("Virtual App [%s]", env) + f.StringVar(&flag.name, "vapp", value, usage) + }) +} + +func (flag *VirtualAppFlag) Process(ctx context.Context) error { + return flag.ProcessOnce(func() error { + if err := flag.DatacenterFlag.Process(ctx); err != nil { + return err + } + if err := flag.SearchFlag.Process(ctx); err != nil { + return err + } + return nil + }) +} + +func (flag *VirtualAppFlag) VirtualApp() (*object.VirtualApp, error) { + if flag.app != nil { + return flag.app, nil + } + + // Use search flags if specified. + if flag.SearchFlag.IsSet() { + app, err := flag.SearchFlag.VirtualApp() + if err != nil { + return nil, err + } + + flag.app = app + return flag.app, nil + } + + // Never look for a default virtual app. + if flag.name == "" { + return nil, nil + } + + finder, err := flag.Finder() + if err != nil { + return nil, err + } + + flag.app, err = finder.VirtualApp(context.TODO(), flag.name) + return flag.app, err +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/flags/virtual_machine.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/flags/virtual_machine.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/flags/virtual_machine.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/flags/virtual_machine.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,110 @@ +/* +Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package flags + +import ( + "flag" + "fmt" + "os" + + "github.com/vmware/govmomi/object" + "golang.org/x/net/context" +) + +type VirtualMachineFlag struct { + common + + *ClientFlag + *DatacenterFlag + *SearchFlag + + name string + vm *object.VirtualMachine +} + +var virtualMachineFlagKey = flagKey("virtualMachine") + +func NewVirtualMachineFlag(ctx context.Context) (*VirtualMachineFlag, context.Context) { + if v := ctx.Value(virtualMachineFlagKey); v != nil { + return v.(*VirtualMachineFlag), ctx + } + + v := &VirtualMachineFlag{} + v.ClientFlag, ctx = NewClientFlag(ctx) + v.DatacenterFlag, ctx = NewDatacenterFlag(ctx) + v.SearchFlag, ctx = NewSearchFlag(ctx, SearchVirtualMachines) + ctx = context.WithValue(ctx, virtualMachineFlagKey, v) + return v, ctx +} + +func (flag *VirtualMachineFlag) Register(ctx context.Context, f *flag.FlagSet) { + flag.RegisterOnce(func() { + flag.ClientFlag.Register(ctx, f) + flag.DatacenterFlag.Register(ctx, f) + flag.SearchFlag.Register(ctx, f) + + env := "GOVC_VM" + value := os.Getenv(env) + usage := fmt.Sprintf("Virtual machine [%s]", env) + f.StringVar(&flag.name, "vm", value, usage) + }) +} + +func (flag *VirtualMachineFlag) Process(ctx context.Context) error { + return flag.ProcessOnce(func() error { + if err := flag.ClientFlag.Process(ctx); err != nil { + return err + } + if err := flag.DatacenterFlag.Process(ctx); err != nil { + return err + } + if err := flag.SearchFlag.Process(ctx); err != nil { + return err + } + return nil + }) +} + +func (flag *VirtualMachineFlag) VirtualMachine() (*object.VirtualMachine, error) { + if flag.vm != nil { + return flag.vm, nil + } + + // Use search flags if specified. + if flag.SearchFlag.IsSet() { + vm, err := flag.SearchFlag.VirtualMachine() + if err != nil { + return nil, err + } + + flag.vm = vm + return flag.vm, nil + } + + // Never look for a default virtual machine. + if flag.name == "" { + return nil, nil + } + + finder, err := flag.Finder() + if err != nil { + return nil, err + } + + flag.vm, err = finder.VirtualMachine(context.TODO(), flag.name) + return flag.vm, err +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/folder/create.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/folder/create.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/folder/create.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/folder/create.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,102 @@ +/* +Copyright (c) 2016 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package folder + +import ( + "flag" + "path" + + "github.com/vmware/govmomi/govc/cli" + "github.com/vmware/govmomi/govc/flags" + "golang.org/x/net/context" +) + +type create struct { + *flags.DatacenterFlag + + pod bool +} + +func init() { + cli.Register("folder.create", &create{}) +} + +func (cmd *create) Register(ctx context.Context, f *flag.FlagSet) { + cmd.DatacenterFlag, ctx = flags.NewDatacenterFlag(ctx) + cmd.DatacenterFlag.Register(ctx, f) + + f.BoolVar(&cmd.pod, "pod", false, "Create folder(s) of type StoragePod (DatastoreCluster)") +} + +func (cmd *create) Usage() string { + return "PATH..." +} + +func (cmd *create) Description() string { + return `Create folder with PATH. +Example: +govc folder.create /dc1/vm/folder-foo +` +} + +func (cmd *create) Process(ctx context.Context) error { + if err := cmd.DatacenterFlag.Process(ctx); err != nil { + return err + } + return nil +} + +func (cmd *create) Run(ctx context.Context, f *flag.FlagSet) error { + finder, err := cmd.Finder() + if err != nil { + return err + } + + for _, arg := range f.Args() { + dir := path.Dir(arg) + name := path.Base(arg) + + if dir == "" { + dir = "/" + } + + folder, err := finder.Folder(ctx, dir) + if err != nil { + return err + } + + var create func() error + if cmd.pod { + create = func() error { + _, err = folder.CreateStoragePod(ctx, name) + return err + } + } else { + create = func() error { + _, err = folder.CreateFolder(ctx, name) + return err + } + } + + err = create() + if err != nil { + return err + } + } + + return nil +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/folder/destroy.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/folder/destroy.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/folder/destroy.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/folder/destroy.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,85 @@ +/* +Copyright (c) 2016 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package folder + +import ( + "flag" + + "github.com/vmware/govmomi/govc/cli" + "github.com/vmware/govmomi/govc/flags" + "golang.org/x/net/context" +) + +type destroy struct { + *flags.DatacenterFlag +} + +func init() { + cli.Register("folder.destroy", &destroy{}) +} + +func (cmd *destroy) Register(ctx context.Context, f *flag.FlagSet) { + cmd.DatacenterFlag, ctx = flags.NewDatacenterFlag(ctx) + cmd.DatacenterFlag.Register(ctx, f) +} + +func (cmd *destroy) Process(ctx context.Context) error { + if err := cmd.DatacenterFlag.Process(ctx); err != nil { + return err + } + return nil +} + +func (cmd *destroy) Usage() string { + return "FOLDER..." +} + +func (cmd *destroy) Description() string { + return "Destroy one or more FOLDERs." +} + +func (cmd *destroy) Run(ctx context.Context, f *flag.FlagSet) error { + if f.NArg() == 0 { + return flag.ErrHelp + } + + finder, err := cmd.Finder() + if err != nil { + return err + } + + for _, arg := range f.Args() { + folders, err := finder.FolderList(ctx, arg) + if err != nil { + return err + } + + for _, folder := range folders { + task, err := folder.Destroy(ctx) + if err != nil { + return err + } + + err = task.Wait(ctx) + if err != nil { + return err + } + } + } + + return nil +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/folder/info.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/folder/info.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/folder/info.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/folder/info.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,147 @@ +/* +Copyright (c) 2016 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package folder + +import ( + "flag" + "fmt" + "io" + "strings" + "text/tabwriter" + + "github.com/vmware/govmomi/govc/cli" + "github.com/vmware/govmomi/govc/flags" + "github.com/vmware/govmomi/object" + "github.com/vmware/govmomi/property" + "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/types" + "golang.org/x/net/context" +) + +type info struct { + *flags.ClientFlag + *flags.OutputFlag + *flags.DatacenterFlag +} + +func init() { + cli.Register("folder.info", &info{}) +} + +func (cmd *info) Register(ctx context.Context, f *flag.FlagSet) { + cmd.ClientFlag, ctx = flags.NewClientFlag(ctx) + cmd.ClientFlag.Register(ctx, f) + + cmd.OutputFlag, ctx = flags.NewOutputFlag(ctx) + cmd.OutputFlag.Register(ctx, f) + + cmd.DatacenterFlag, ctx = flags.NewDatacenterFlag(ctx) + cmd.DatacenterFlag.Register(ctx, f) +} + +func (cmd *info) Process(ctx context.Context) error { + if err := cmd.ClientFlag.Process(ctx); err != nil { + return err + } + if err := cmd.OutputFlag.Process(ctx); err != nil { + return err + } + if err := cmd.DatacenterFlag.Process(ctx); err != nil { + return err + } + return nil +} + +func (cmd *info) Usage() string { + return "[PATH]..." +} + +func (cmd *info) Run(ctx context.Context, f *flag.FlagSet) error { + c, err := cmd.Client() + if err != nil { + return err + } + + finder, err := cmd.Finder() + if err != nil { + return err + } + + args := f.Args() + if len(args) == 0 { + args = []string{"/"} + } + + var props []string + var res infoResult + + if !cmd.OutputFlag.JSON { + props = []string{ + "name", + "childEntity", + "childType", + } + } + + for _, arg := range args { + object, err := finder.FolderList(ctx, arg) + if err != nil { + return err + } + res.objects = append(res.objects, object...) + } + + if len(res.objects) != 0 { + refs := make([]types.ManagedObjectReference, 0, len(res.objects)) + for _, o := range res.objects { + refs = append(refs, o.Reference()) + } + + pc := property.DefaultCollector(c) + err = pc.Retrieve(ctx, refs, props, &res.Folders) + if err != nil { + return err + } + } + + return cmd.WriteResult(&res) +} + +type infoResult struct { + Folders []mo.Folder + objects []*object.Folder +} + +func (r *infoResult) Write(w io.Writer) error { + // Maintain order via r.objects as Property collector does not always return results in order. + objects := make(map[types.ManagedObjectReference]mo.Folder, len(r.Folders)) + for _, o := range r.Folders { + objects[o.Reference()] = o + } + + tw := tabwriter.NewWriter(w, 2, 0, 2, ' ', 0) + + for _, o := range r.objects { + info := objects[o.Reference()] + fmt.Fprintf(tw, "Name:\t%s\n", info.Name) + fmt.Fprintf(tw, " Path:\t%s\n", o.InventoryPath) + fmt.Fprintf(tw, " Types:\t%v\n", strings.Join(info.ChildType, ",")) + fmt.Fprintf(tw, " Children:\t%d\n", len(info.ChildEntity)) + } + + return tw.Flush() +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/folder/move_into.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/folder/move_into.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/folder/move_into.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/folder/move_into.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,86 @@ +/* +Copyright (c) 2016 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package folder + +import ( + "flag" + + "github.com/vmware/govmomi/govc/cli" + "github.com/vmware/govmomi/govc/flags" + "golang.org/x/net/context" +) + +type move struct { + *flags.ClientFlag + *flags.FolderFlag +} + +func init() { + cli.Register("folder.moveinto", &move{}) +} + +func (cmd *move) Register(ctx context.Context, f *flag.FlagSet) { + cmd.ClientFlag, ctx = flags.NewClientFlag(ctx) + cmd.ClientFlag.Register(ctx, f) + + cmd.FolderFlag, ctx = flags.NewFolderFlag(ctx) + cmd.FolderFlag.Register(ctx, f) +} + +func (cmd *move) Usage() string { + return "PATH..." +} + +func (cmd *move) Description() string { + return `Move managed entities into this folder. +Example: +govc folder.moveinto -folder /dc1/folder-foo /dc2/folder-bar/* +` +} + +func (cmd *move) Process(ctx context.Context) error { + if err := cmd.ClientFlag.Process(ctx); err != nil { + return err + } + if err := cmd.FolderFlag.Process(ctx); err != nil { + return err + } + return nil +} + +func (cmd *move) Run(ctx context.Context, f *flag.FlagSet) error { + folder, err := cmd.Folder() + if err != nil { + return err + } + + if f.NArg() == 0 { + return flag.ErrHelp + } + + objs, err := cmd.ManagedObjects(ctx, f.Args()) + if err != nil { + return err + } + + task, err := folder.MoveInto(ctx, objs) + if err != nil { + return err + } + + return task.Wait(ctx) +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/folder/rename.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/folder/rename.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/folder/rename.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/folder/rename.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,81 @@ +/* +Copyright (c) 2016 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package folder + +import ( + "flag" + + "github.com/vmware/govmomi/govc/cli" + "github.com/vmware/govmomi/govc/flags" + "golang.org/x/net/context" +) + +type rename struct { + *flags.ClientFlag + *flags.FolderFlag +} + +func init() { + cli.Register("folder.rename", &rename{}) +} + +func (cmd *rename) Register(ctx context.Context, f *flag.FlagSet) { + cmd.ClientFlag, ctx = flags.NewClientFlag(ctx) + cmd.ClientFlag.Register(ctx, f) + + cmd.FolderFlag, ctx = flags.NewFolderFlag(ctx) + cmd.FolderFlag.Register(ctx, f) +} + +func (cmd *rename) Usage() string { + return "NAME" +} + +func (cmd *rename) Description() string { + return `Rename an existing folder with NAME. +Example: +govc folder.rename -folder /dc1/vm/folder-foo folder-bar +` +} + +func (cmd *rename) Process(ctx context.Context) error { + if err := cmd.ClientFlag.Process(ctx); err != nil { + return err + } + if err := cmd.FolderFlag.Process(ctx); err != nil { + return err + } + return nil +} + +func (cmd *rename) Run(ctx context.Context, f *flag.FlagSet) error { + folder, err := cmd.Folder() + if err != nil { + return err + } + + if f.NArg() != 1 { + return flag.ErrHelp + } + + task, err := folder.Rename(ctx, f.Arg(0)) + if err != nil { + return err + } + + return task.Wait(ctx) +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/.gitignore juju-core-2.0.2/src/github.com/vmware/govmomi/govc/.gitignore --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/.gitignore 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/.gitignore 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1 @@ +/govc* diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/host/account/account.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/host/account/account.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/host/account/account.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/host/account/account.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,74 @@ +/* +Copyright (c) 2016 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package account + +import ( + "flag" + + "github.com/vmware/govmomi/govc/flags" + "github.com/vmware/govmomi/object" + "github.com/vmware/govmomi/vim25/types" + "golang.org/x/net/context" +) + +type AccountFlag struct { + *flags.ClientFlag + *flags.DatacenterFlag + *flags.HostSystemFlag + + types.HostAccountSpec +} + +func newAccountFlag(ctx context.Context) (*AccountFlag, context.Context) { + f := &AccountFlag{} + f.ClientFlag, ctx = flags.NewClientFlag(ctx) + f.DatacenterFlag, ctx = flags.NewDatacenterFlag(ctx) + f.HostSystemFlag, ctx = flags.NewHostSystemFlag(ctx) + return f, ctx +} + +func (f *AccountFlag) Register(ctx context.Context, fs *flag.FlagSet) { + f.ClientFlag.Register(ctx, fs) + f.DatacenterFlag.Register(ctx, fs) + f.HostSystemFlag.Register(ctx, fs) + + fs.StringVar(&f.Id, "id", "", "The ID of the specified account") + fs.StringVar(&f.Password, "password", "", "The password for the specified account id") + fs.StringVar(&f.Description, "description", "", "The description of the specified account") +} + +func (f *AccountFlag) Process(ctx context.Context) error { + if err := f.ClientFlag.Process(ctx); err != nil { + return err + } + if err := f.DatacenterFlag.Process(ctx); err != nil { + return err + } + if err := f.HostSystemFlag.Process(ctx); err != nil { + return err + } + return nil +} + +func (f *AccountFlag) HostAccountManager(ctx context.Context) (*object.HostAccountManager, error) { + h, err := f.HostSystem() + if err != nil { + return nil, err + } + + return h.ConfigManager().AccountManager(ctx) +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/host/account/create.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/host/account/create.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/host/account/create.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/host/account/create.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,53 @@ +/* +Copyright (c) 2016 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package account + +import ( + "flag" + + "golang.org/x/net/context" + + "github.com/vmware/govmomi/govc/cli" +) + +type create struct { + *AccountFlag +} + +func init() { + cli.Register("host.account.create", &create{}) +} + +func (cmd *create) Register(ctx context.Context, f *flag.FlagSet) { + cmd.AccountFlag, ctx = newAccountFlag(ctx) + cmd.AccountFlag.Register(ctx, f) +} + +func (cmd *create) Process(ctx context.Context) error { + if err := cmd.AccountFlag.Process(ctx); err != nil { + return err + } + return nil +} + +func (cmd *create) Run(ctx context.Context, f *flag.FlagSet) error { + m, err := cmd.AccountFlag.HostAccountManager(ctx) + if err != nil { + return err + } + return m.Create(ctx, &cmd.HostAccountSpec) +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/host/account/remove.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/host/account/remove.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/host/account/remove.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/host/account/remove.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,53 @@ +/* +Copyright (c) 2016 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package account + +import ( + "flag" + + "golang.org/x/net/context" + + "github.com/vmware/govmomi/govc/cli" +) + +type remove struct { + *AccountFlag +} + +func init() { + cli.Register("host.account.remove", &remove{}) +} + +func (cmd *remove) Register(ctx context.Context, f *flag.FlagSet) { + cmd.AccountFlag, ctx = newAccountFlag(ctx) + cmd.AccountFlag.Register(ctx, f) +} + +func (cmd *remove) Process(ctx context.Context) error { + if err := cmd.AccountFlag.Process(ctx); err != nil { + return err + } + return nil +} + +func (cmd *remove) Run(ctx context.Context, f *flag.FlagSet) error { + m, err := cmd.AccountFlag.HostAccountManager(ctx) + if err != nil { + return err + } + return m.Remove(ctx, cmd.HostAccountSpec.Id) +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/host/account/update.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/host/account/update.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/host/account/update.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/host/account/update.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,53 @@ +/* +Copyright (c) 2016 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package account + +import ( + "flag" + + "golang.org/x/net/context" + + "github.com/vmware/govmomi/govc/cli" +) + +type update struct { + *AccountFlag +} + +func init() { + cli.Register("host.account.update", &update{}) +} + +func (cmd *update) Register(ctx context.Context, f *flag.FlagSet) { + cmd.AccountFlag, ctx = newAccountFlag(ctx) + cmd.AccountFlag.Register(ctx, f) +} + +func (cmd *update) Process(ctx context.Context) error { + if err := cmd.AccountFlag.Process(ctx); err != nil { + return err + } + return nil +} + +func (cmd *update) Run(ctx context.Context, f *flag.FlagSet) error { + m, err := cmd.AccountFlag.HostAccountManager(ctx) + if err != nil { + return err + } + return m.Update(ctx, &cmd.HostAccountSpec) +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/host/add.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/host/add.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/host/add.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/host/add.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,152 @@ +/* +Copyright (c) 2015-2016 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package host + +import ( + "flag" + "fmt" + + "github.com/vmware/govmomi/govc/cli" + "github.com/vmware/govmomi/govc/flags" + "github.com/vmware/govmomi/object" + "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/types" + "golang.org/x/net/context" +) + +type add struct { + *flags.ClientFlag + *flags.DatacenterFlag + *flags.HostConnectFlag + + parent string + connect bool +} + +func init() { + cli.Register("host.add", &add{}) +} + +func (cmd *add) Register(ctx context.Context, f *flag.FlagSet) { + cmd.ClientFlag, ctx = flags.NewClientFlag(ctx) + cmd.ClientFlag.Register(ctx, f) + + cmd.DatacenterFlag, ctx = flags.NewDatacenterFlag(ctx) + cmd.DatacenterFlag.Register(ctx, f) + + cmd.HostConnectFlag, ctx = flags.NewHostConnectFlag(ctx) + cmd.HostConnectFlag.Register(ctx, f) + + f.StringVar(&cmd.parent, "parent", "", "Path to folder to add the host to") + f.BoolVar(&cmd.connect, "connect", true, "Immediately connect to host") +} + +func (cmd *add) Process(ctx context.Context) error { + if err := cmd.ClientFlag.Process(ctx); err != nil { + return err + } + if err := cmd.DatacenterFlag.Process(ctx); err != nil { + return err + } + if err := cmd.HostConnectFlag.Process(ctx); err != nil { + return err + } + if cmd.HostName == "" { + return flag.ErrHelp + } + if cmd.UserName == "" { + return flag.ErrHelp + } + if cmd.Password == "" { + return flag.ErrHelp + } + return nil +} + +func (cmd *add) Description() string { + return `Add host to datacenter. + +The host is added to the folder specified by the 'parent' flag. If not given, +this defaults to the hosts folder in the specified or default datacenter.` +} + +func (cmd *add) Add(ctx context.Context, parent *object.Folder) error { + spec := cmd.HostConnectSpec + + req := types.AddStandaloneHost_Task{ + This: parent.Reference(), + Spec: spec, + AddConnected: cmd.connect, + } + + res, err := methods.AddStandaloneHost_Task(ctx, parent.Client(), &req) + if err != nil { + return err + } + + logger := cmd.ProgressLogger(fmt.Sprintf("adding %s to folder %s... ", spec.HostName, parent.InventoryPath)) + defer logger.Wait() + + task := object.NewTask(parent.Client(), res.Returnval) + _, err = task.WaitForResult(ctx, logger) + return err +} + +func (cmd *add) Run(ctx context.Context, f *flag.FlagSet) error { + var parent *object.Folder + + if f.NArg() != 0 { + return flag.ErrHelp + } + + if cmd.parent == "" { + dc, err := cmd.Datacenter() + if err != nil { + return err + } + + folders, err := dc.Folders(ctx) + if err != nil { + return err + } + + parent = folders.HostFolder + } else { + finder, err := cmd.Finder() + if err != nil { + return err + } + + parent, err = finder.Folder(ctx, cmd.parent) + if err != nil { + return err + } + } + + err := cmd.Add(ctx, parent) + if err == nil { + return nil + } + + // Check if we failed due to SSLVerifyFault and -noverify is set + if err := cmd.AcceptThumbprint(err); err != nil { + return err + } + + // Accepted unverified thumbprint, try again + return cmd.Add(ctx, parent) +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/host/autostart/add.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/host/autostart/add.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/host/autostart/add.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/host/autostart/add.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,63 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package autostart + +import ( + "flag" + + "golang.org/x/net/context" + + "github.com/vmware/govmomi/govc/cli" + "github.com/vmware/govmomi/vim25/types" +) + +type add struct { + *AutostartFlag +} + +func init() { + cli.Register("host.autostart.add", &add{}) +} + +func (cmd *add) Register(ctx context.Context, f *flag.FlagSet) { + cmd.AutostartFlag, ctx = newAutostartFlag(ctx) + cmd.AutostartFlag.Register(ctx, f) +} + +func (cmd *add) Process(ctx context.Context) error { + if err := cmd.AutostartFlag.Process(ctx); err != nil { + return err + } + return nil +} + +func (cmd *add) Usage() string { + return "VM..." +} + +func (cmd *add) Run(ctx context.Context, f *flag.FlagSet) error { + var powerInfo = types.AutoStartPowerInfo{ + StartAction: "powerOn", + StartDelay: -1, + StartOrder: -1, + StopAction: "systemDefault", + StopDelay: -1, + WaitForHeartbeat: types.AutoStartWaitHeartbeatSettingSystemDefault, + } + + return cmd.ReconfigureVMs(f.Args(), powerInfo) +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/host/autostart/autostart.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/host/autostart/autostart.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/host/autostart/autostart.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/host/autostart/autostart.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,173 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package autostart + +import ( + "errors" + "flag" + + "github.com/vmware/govmomi/govc/flags" + "github.com/vmware/govmomi/object" + "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/types" + "golang.org/x/net/context" +) + +type AutostartFlag struct { + *flags.ClientFlag + *flags.DatacenterFlag + *flags.HostSystemFlag +} + +func newAutostartFlag(ctx context.Context) (*AutostartFlag, context.Context) { + f := &AutostartFlag{} + f.ClientFlag, ctx = flags.NewClientFlag(ctx) + f.DatacenterFlag, ctx = flags.NewDatacenterFlag(ctx) + f.HostSystemFlag, ctx = flags.NewHostSystemFlag(ctx) + return f, ctx +} + +func (f *AutostartFlag) Register(ctx context.Context, fs *flag.FlagSet) { + f.ClientFlag.Register(ctx, fs) + f.DatacenterFlag.Register(ctx, fs) + f.HostSystemFlag.Register(ctx, fs) +} + +func (f *AutostartFlag) Process(ctx context.Context) error { + if err := f.ClientFlag.Process(ctx); err != nil { + return err + } + if err := f.DatacenterFlag.Process(ctx); err != nil { + return err + } + if err := f.HostSystemFlag.Process(ctx); err != nil { + return err + } + return nil +} + +// VirtualMachines returns list of virtual machine objects based on the +// arguments specified on the command line. This helper is defined in +// flags.SearchFlag as well, but that pulls in other virtual machine flags that +// are not relevant here. +func (f *AutostartFlag) VirtualMachines(args []string) ([]*object.VirtualMachine, error) { + if len(args) == 0 { + return nil, errors.New("no argument") + } + + finder, err := f.Finder() + if err != nil { + return nil, err + } + + var out []*object.VirtualMachine + for _, arg := range args { + vms, err := finder.VirtualMachineList(context.TODO(), arg) + if err != nil { + return nil, err + } + + out = append(out, vms...) + } + + return out, nil +} + +func (f *AutostartFlag) HostAutoStartManager() (*mo.HostAutoStartManager, error) { + h, err := f.HostSystem() + if err != nil { + return nil, err + } + + var mhs mo.HostSystem + err = h.Properties(context.TODO(), h.Reference(), []string{"configManager.autoStartManager"}, &mhs) + if err != nil { + return nil, err + } + + var mhas mo.HostAutoStartManager + err = h.Properties(context.TODO(), *mhs.ConfigManager.AutoStartManager, nil, &mhas) + if err != nil { + return nil, err + } + + return &mhas, nil +} + +func (f *AutostartFlag) ReconfigureDefaults(template types.AutoStartDefaults) error { + c, err := f.Client() + if err != nil { + return err + } + + mhas, err := f.HostAutoStartManager() + if err != nil { + return err + } + + req := types.ReconfigureAutostart{ + This: mhas.Reference(), + Spec: types.HostAutoStartManagerConfig{ + Defaults: &template, + }, + } + + _, err = methods.ReconfigureAutostart(context.TODO(), c, &req) + if err != nil { + return err + } + + return nil +} + +func (f *AutostartFlag) ReconfigureVMs(args []string, template types.AutoStartPowerInfo) error { + c, err := f.Client() + if err != nil { + return err + } + + mhas, err := f.HostAutoStartManager() + if err != nil { + return err + } + + req := types.ReconfigureAutostart{ + This: mhas.Reference(), + Spec: types.HostAutoStartManagerConfig{ + PowerInfo: make([]types.AutoStartPowerInfo, 0), + }, + } + + vms, err := f.VirtualMachines(args) + if err != nil { + return err + } + + for _, vm := range vms { + pi := template + pi.Key = vm.Reference() + req.Spec.PowerInfo = append(req.Spec.PowerInfo, pi) + } + + _, err = methods.ReconfigureAutostart(context.TODO(), c, &req) + if err != nil { + return err + } + + return nil +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/host/autostart/configure.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/host/autostart/configure.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/host/autostart/configure.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/host/autostart/configure.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,63 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package autostart + +import ( + "flag" + + "golang.org/x/net/context" + + "github.com/vmware/govmomi/govc/cli" + "github.com/vmware/govmomi/govc/flags" + "github.com/vmware/govmomi/vim25/types" +) + +type configure struct { + *AutostartFlag + + types.AutoStartDefaults +} + +func init() { + cli.Register("host.autostart.configure", &configure{}) +} + +func (cmd *configure) Register(ctx context.Context, f *flag.FlagSet) { + cmd.AutostartFlag, ctx = newAutostartFlag(ctx) + cmd.AutostartFlag.Register(ctx, f) + + f.Var(flags.NewOptionalBool(&cmd.Enabled), "enabled", "") + f.Var(flags.NewInt32(&cmd.StartDelay), "start-delay", "") + f.StringVar(&cmd.StopAction, "stop-action", "", "") + f.Var(flags.NewInt32(&cmd.StopDelay), "stop-delay", "") + f.Var(flags.NewOptionalBool(&cmd.WaitForHeartbeat), "wait-for-heartbeat", "") +} + +func (cmd *configure) Process(ctx context.Context) error { + if err := cmd.AutostartFlag.Process(ctx); err != nil { + return err + } + return nil +} + +func (cmd *configure) Usage() string { + return "" +} + +func (cmd *configure) Run(ctx context.Context, f *flag.FlagSet) error { + return cmd.ReconfigureDefaults(cmd.AutoStartDefaults) +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/host/autostart/info.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/host/autostart/info.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/host/autostart/info.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/host/autostart/info.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,143 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package autostart + +import ( + "encoding/json" + "flag" + "fmt" + "io" + "os" + "text/tabwriter" + + "github.com/vmware/govmomi/govc/cli" + "github.com/vmware/govmomi/govc/flags" + "github.com/vmware/govmomi/vim25" + "github.com/vmware/govmomi/vim25/mo" + "golang.org/x/net/context" +) + +type info struct { + cli.Command + + *AutostartFlag + *flags.OutputFlag +} + +func init() { + cli.Register("host.autostart.info", &info{}) +} + +func (cmd *info) Register(ctx context.Context, f *flag.FlagSet) { + cmd.AutostartFlag, ctx = newAutostartFlag(ctx) + cmd.AutostartFlag.Register(ctx, f) + cmd.OutputFlag, ctx = flags.NewOutputFlag(ctx) + cmd.OutputFlag.Register(ctx, f) +} + +func (cmd *info) Process(ctx context.Context) error { + if err := cmd.AutostartFlag.Process(ctx); err != nil { + return err + } + if err := cmd.OutputFlag.Process(ctx); err != nil { + return err + } + return nil +} + +func (cmd *info) Usage() string { + return "" +} + +func (cmd *info) Run(ctx context.Context, f *flag.FlagSet) error { + client, err := cmd.Client() + if err != nil { + return err + } + + mhas, err := cmd.HostAutoStartManager() + if err != nil { + return err + } + + return cmd.WriteResult(&infoResult{client, mhas}) +} + +type infoResult struct { + client *vim25.Client + mhas *mo.HostAutoStartManager +} + +func (r *infoResult) MarshalJSON() ([]byte, error) { + return json.Marshal(r.mhas) +} + +// vmPaths resolves the paths for the VMs in the result. +func (r *infoResult) vmPaths() (map[string]string, error) { + paths := make(map[string]string) + for _, info := range r.mhas.Config.PowerInfo { + mes, err := mo.Ancestors(context.TODO(), r.client, r.client.ServiceContent.PropertyCollector, info.Key) + if err != nil { + return nil, err + } + + path := "" + for _, me := range mes { + // Skip root entity in building inventory path. + if me.Parent == nil { + continue + } + path += "/" + me.Name + } + + paths[info.Key.Value] = path + } + + return paths, nil +} + +func (r *infoResult) Write(w io.Writer) error { + paths, err := r.vmPaths() + if err != nil { + return err + } + + tw := tabwriter.NewWriter(os.Stdout, 2, 0, 2, ' ', 0) + + fmt.Fprintf(tw, "VM") + fmt.Fprintf(tw, "\tStartAction") + fmt.Fprintf(tw, "\tStartDelay") + fmt.Fprintf(tw, "\tStartOrder") + fmt.Fprintf(tw, "\tStopAction") + fmt.Fprintf(tw, "\tStopDelay") + fmt.Fprintf(tw, "\tWaitForHeartbeat") + fmt.Fprintf(tw, "\n") + + for _, info := range r.mhas.Config.PowerInfo { + fmt.Fprintf(tw, "%s", paths[info.Key.Value]) + fmt.Fprintf(tw, "\t%s", info.StartAction) + fmt.Fprintf(tw, "\t%d", info.StartDelay) + fmt.Fprintf(tw, "\t%d", info.StartOrder) + fmt.Fprintf(tw, "\t%s", info.StopAction) + fmt.Fprintf(tw, "\t%d", info.StopDelay) + fmt.Fprintf(tw, "\t%s", info.WaitForHeartbeat) + fmt.Fprintf(tw, "\n") + } + + _ = tw.Flush() + return nil +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/host/autostart/remove.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/host/autostart/remove.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/host/autostart/remove.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/host/autostart/remove.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,63 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package autostart + +import ( + "flag" + + "golang.org/x/net/context" + + "github.com/vmware/govmomi/govc/cli" + "github.com/vmware/govmomi/vim25/types" +) + +type remove struct { + *AutostartFlag +} + +func init() { + cli.Register("host.autostart.remove", &remove{}) +} + +func (cmd *remove) Register(ctx context.Context, f *flag.FlagSet) { + cmd.AutostartFlag, ctx = newAutostartFlag(ctx) + cmd.AutostartFlag.Register(ctx, f) +} + +func (cmd *remove) Process(ctx context.Context) error { + if err := cmd.AutostartFlag.Process(ctx); err != nil { + return err + } + return nil +} + +func (cmd *remove) Usage() string { + return "VM..." +} + +func (cmd *remove) Run(ctx context.Context, f *flag.FlagSet) error { + var powerInfo = types.AutoStartPowerInfo{ + StartAction: "none", + StartDelay: -1, + StartOrder: -1, + StopAction: "none", + StopDelay: -1, + WaitForHeartbeat: types.AutoStartWaitHeartbeatSettingSystemDefault, + } + + return cmd.ReconfigureVMs(f.Args(), powerInfo) +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/host/disconnect.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/host/disconnect.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/host/disconnect.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/host/disconnect.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,81 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package host + +import ( + "flag" + "fmt" + + "golang.org/x/net/context" + + "github.com/vmware/govmomi/govc/cli" + "github.com/vmware/govmomi/govc/flags" + "github.com/vmware/govmomi/object" +) + +type disconnect struct { + *flags.HostSystemFlag +} + +func init() { + cli.Register("host.disconnect", &disconnect{}) +} + +func (cmd *disconnect) Register(ctx context.Context, f *flag.FlagSet) { + cmd.HostSystemFlag, ctx = flags.NewHostSystemFlag(ctx) + cmd.HostSystemFlag.Register(ctx, f) +} + +func (cmd *disconnect) Process(ctx context.Context) error { + if err := cmd.HostSystemFlag.Process(ctx); err != nil { + return err + } + return nil +} + +func (cmd *disconnect) Description() string { + return `Disconnect host from vCenter and instruct the host to stop sending heartbeats.` +} + +func (cmd *disconnect) Disconnect(ctx context.Context, host *object.HostSystem) error { + task, err := host.Disconnect(ctx) + if err != nil { + return err + } + + logger := cmd.ProgressLogger(fmt.Sprintf("%s disconnecting... ", host.InventoryPath)) + defer logger.Wait() + + _, err = task.WaitForResult(ctx, logger) + return err +} + +func (cmd *disconnect) Run(ctx context.Context, f *flag.FlagSet) error { + hosts, err := cmd.HostSystems(f.Args()) + if err != nil { + return err + } + + for _, host := range hosts { + err = cmd.Disconnect(ctx, host) + if err != nil { + return err + } + } + + return nil +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/host/esxcli/command.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/host/esxcli/command.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/host/esxcli/command.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/host/esxcli/command.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,149 @@ +/* +Copyright (c) 2014 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package esxcli + +import ( + "flag" + "fmt" + "strings" + + "github.com/vmware/govmomi/vim25/types" +) + +type Command struct { + name []string + args []string +} + +type CommandInfoItem struct { + Name string `xml:"name"` + DisplayName string `xml:"displayName"` + Help string `xml:"help"` +} + +type CommandInfoParam struct { + CommandInfoItem + Aliases []string `xml:"aliases"` + Flag bool `xml:"flag"` +} + +type CommandInfoHint struct { + Key string `xml:"key"` + Value string `xml:"value"` +} + +type CommandInfoHints []CommandInfoHint + +type CommandInfoMethod struct { + CommandInfoItem + Param []CommandInfoParam `xml:"param"` + Hints CommandInfoHints `xml:"hints"` +} + +type CommandInfo struct { + CommandInfoItem + Method []*CommandInfoMethod `xml:"method"` +} + +func NewCommand(args []string) *Command { + c := &Command{} + + for i, arg := range args { + if strings.HasPrefix(arg, "-") { + c.args = args[i:] + break + } else { + c.name = append(c.name, arg) + } + } + + return c +} + +func (c *Command) Namespace() string { + return strings.Join(c.name[:len(c.name)-1], ".") +} + +func (c *Command) Name() string { + return c.name[len(c.name)-1] +} + +func (c *Command) Method() string { + return "vim.EsxCLI." + strings.Join(c.name, ".") +} + +func (c *Command) Moid() string { + return "ha-cli-handler-" + strings.Join(c.name[:len(c.name)-1], "-") +} + +// Parse generates a flag.FlagSet based on the given []CommandInfoParam and +// returns arguments for use with methods.ExecuteSoap +func (c *Command) Parse(params []CommandInfoParam) ([]types.ReflectManagedMethodExecuterSoapArgument, error) { + flags := flag.NewFlagSet(strings.Join(c.name, " "), flag.ExitOnError) + vals := make([]string, len(params)) + + for i, p := range params { + v := &vals[i] + for _, a := range p.Aliases { + a = strings.TrimPrefix(a[1:], "-") + flags.StringVar(v, a, "", p.Help) + } + } + + err := flags.Parse(c.args) + if err != nil { + return nil, err + } + + args := []types.ReflectManagedMethodExecuterSoapArgument{} + + for i, p := range params { + if vals[i] == "" { + continue + } + args = append(args, c.Argument(p.Name, vals[i])) + } + + return args, nil +} + +func (c *Command) Argument(name string, val string) types.ReflectManagedMethodExecuterSoapArgument { + return types.ReflectManagedMethodExecuterSoapArgument{ + Name: name, + Val: fmt.Sprintf("<%s>%s", name, val, name), + } +} + +func (h CommandInfoHints) Formatter() string { + for _, hint := range h { + if hint.Key == "formatter" { + return hint.Value + } + } + + return "simple" +} + +func (h CommandInfoHints) Fields() []string { + for _, hint := range h { + if strings.HasPrefix(hint.Key, "fields:") { + return strings.Split(hint.Value, ",") + } + } + + return nil +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/host/esxcli/command_test.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/host/esxcli/command_test.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/host/esxcli/command_test.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/host/esxcli/command_test.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,124 @@ +/* +Copyright (c) 2014 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package esxcli + +import ( + "reflect" + "testing" + + "github.com/vmware/govmomi/vim25/types" +) + +func TestSystemSettingsAdvancedSetCommand(t *testing.T) { + c := NewCommand([]string{"system", "settings", "advanced", "set", "-o", "/Net/GuestIPHack", "-i", "1"}) + + tests := []struct { + f func() string + expect string + }{ + {c.Name, "set"}, + {c.Namespace, "system.settings.advanced"}, + {c.Method, "vim.EsxCLI.system.settings.advanced.set"}, + {c.Moid, "ha-cli-handler-system-settings-advanced"}, + } + + for _, test := range tests { + actual := test.f() + if actual != test.expect { + t.Errorf("%s != %s", actual, test.expect) + } + } + + params := []CommandInfoParam{ + { + CommandInfoItem: CommandInfoItem{Name: "default", DisplayName: "default", Help: "Reset the option to its default value."}, + Aliases: []string{"-d", "--default"}, + Flag: true, + }, + { + CommandInfoItem: CommandInfoItem{Name: "intvalue", DisplayName: "int-value", Help: "If the option is an integer value use this option."}, + Aliases: []string{"-i", "--int-value"}, + Flag: false, + }, + { + CommandInfoItem: CommandInfoItem{Name: "option", DisplayName: "option", Help: "The name of the option to set the value of. Example: \"/Misc/HostName\""}, + Aliases: []string{"-o", "--option"}, + Flag: false, + }, + { + CommandInfoItem: CommandInfoItem{Name: "stringvalue", DisplayName: "string-value", Help: "If the option is a string use this option."}, + Aliases: []string{"-s", "--string-value"}, + Flag: false, + }, + } + + args, err := c.Parse(params) + if err != nil { + t.Fatal(err) + } + + expect := []types.ReflectManagedMethodExecuterSoapArgument{ + { + DynamicData: types.DynamicData{}, + Name: "intvalue", + Val: "1", + }, + { + DynamicData: types.DynamicData{}, + Name: "option", + Val: "", + }, + } + + if !reflect.DeepEqual(args, expect) { + t.Errorf("%s != %s", args, expect) + } +} + +func TestNetworkVmListCommand(t *testing.T) { + c := NewCommand([]string{"network", "vm", "list"}) + + tests := []struct { + f func() string + expect string + }{ + {c.Name, "list"}, + {c.Namespace, "network.vm"}, + {c.Method, "vim.EsxCLI.network.vm.list"}, + {c.Moid, "ha-cli-handler-network-vm"}, + } + + for _, test := range tests { + actual := test.f() + if actual != test.expect { + t.Errorf("%s != %s", actual, test.expect) + } + } + + var params []CommandInfoParam + + args, err := c.Parse(params) + if err != nil { + t.Fatal(err) + } + + expect := []types.ReflectManagedMethodExecuterSoapArgument{} + + if !reflect.DeepEqual(args, expect) { + t.Errorf("%s != %s", args, expect) + } +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/host/esxcli/esxcli.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/host/esxcli/esxcli.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/host/esxcli/esxcli.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/host/esxcli/esxcli.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,153 @@ +/* +Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package esxcli + +import ( + "flag" + "fmt" + "os" + "sort" + "strings" + "text/tabwriter" + + "golang.org/x/net/context" + + "github.com/vmware/govmomi/govc/cli" + "github.com/vmware/govmomi/govc/flags" +) + +type esxcli struct { + *flags.HostSystemFlag + + hints bool +} + +func init() { + cli.Register("host.esxcli", &esxcli{}) +} + +func (cmd *esxcli) Usage() string { + return "COMMAND [ARG]..." +} + +func (cmd *esxcli) Register(ctx context.Context, f *flag.FlagSet) { + cmd.HostSystemFlag, ctx = flags.NewHostSystemFlag(ctx) + cmd.HostSystemFlag.Register(ctx, f) + + f.BoolVar(&cmd.hints, "hints", true, "Use command info hints when formatting output") +} + +func (cmd *esxcli) Process(ctx context.Context) error { + if err := cmd.HostSystemFlag.Process(ctx); err != nil { + return err + } + return nil +} + +func (cmd *esxcli) Run(ctx context.Context, f *flag.FlagSet) error { + c, err := cmd.Client() + if err != nil { + return nil + } + + host, err := cmd.HostSystem() + if err != nil { + return err + } + + e, err := NewExecutor(c, host) + if err != nil { + return err + } + + res, err := e.Run(f.Args()) + if err != nil { + return err + } + + if len(res.Values) == 0 { + return nil + } + + var formatType string + if cmd.hints { + formatType = res.Info.Hints.Formatter() + } + + // TODO: OutputFlag / format options + switch formatType { + case "table": + cmd.formatTable(res) + default: + cmd.formatSimple(res) + } + + return nil +} + +func (cmd *esxcli) formatSimple(res *Response) { + var keys []string + for key := range res.Values[0] { + keys = append(keys, key) + } + sort.Strings(keys) + + tw := tabwriter.NewWriter(os.Stdout, 2, 0, 2, ' ', 0) + + for i, rv := range res.Values { + if i > 0 { + fmt.Fprintln(tw) + _ = tw.Flush() + } + for _, key := range keys { + fmt.Fprintf(tw, "%s:\t%s\n", key, strings.Join(rv[key], ", ")) + } + } + + _ = tw.Flush() +} + +func (cmd *esxcli) formatTable(res *Response) { + fields := res.Info.Hints.Fields() + + tw := tabwriter.NewWriter(os.Stdout, len(fields), 0, 2, ' ', 0) + + var hr []string + for _, name := range fields { + hr = append(hr, strings.Repeat("-", len(name))) + } + + fmt.Fprintln(tw, strings.Join(fields, "\t")) + fmt.Fprintln(tw, strings.Join(hr, "\t")) + + for _, vals := range res.Values { + var row []string + + for _, name := range fields { + key := strings.Replace(name, " ", "", -1) + if val, ok := vals[key]; ok { + row = append(row, strings.Join(val, ", ")) + } else { + row = append(row, "") + } + } + + fmt.Fprintln(tw, strings.Join(row, "\t")) + } + + _ = tw.Flush() +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/host/esxcli/executor.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/host/esxcli/executor.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/host/esxcli/executor.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/host/esxcli/executor.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,166 @@ +/* +Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package esxcli + +import ( + "errors" + "fmt" + + "github.com/vmware/govmomi/object" + "github.com/vmware/govmomi/vim25" + "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/types" + "github.com/vmware/govmomi/vim25/xml" + "golang.org/x/net/context" +) + +type Executor struct { + c *vim25.Client + host *object.HostSystem + mme *types.ReflectManagedMethodExecuter + dtm *types.InternalDynamicTypeManager + info map[string]*CommandInfo +} + +func NewExecutor(c *vim25.Client, host *object.HostSystem) (*Executor, error) { + e := &Executor{ + c: c, + host: host, + info: make(map[string]*CommandInfo), + } + + { + req := types.RetrieveManagedMethodExecuter{ + This: host.Reference(), + } + + res, err := methods.RetrieveManagedMethodExecuter(context.TODO(), c, &req) + if err != nil { + return nil, err + } + + e.mme = res.Returnval + } + + { + req := types.RetrieveDynamicTypeManager{ + This: host.Reference(), + } + + res, err := methods.RetrieveDynamicTypeManager(context.TODO(), c, &req) + if err != nil { + return nil, err + } + + e.dtm = res.Returnval + } + + return e, nil +} + +func (e *Executor) CommandInfo(c *Command) (*CommandInfoMethod, error) { + ns := c.Namespace() + var info *CommandInfo + var ok bool + + if info, ok = e.info[ns]; !ok { + req := types.ExecuteSoap{ + Moid: "ha-dynamic-type-manager-local-cli-cliinfo", + Method: "vim.CLIInfo.FetchCLIInfo", + Argument: []types.ReflectManagedMethodExecuterSoapArgument{ + c.Argument("typeName", "vim.EsxCLI."+ns), + }, + } + + info = new(CommandInfo) + if err := e.Execute(&req, info); err != nil { + return nil, err + } + + e.info[ns] = info + } + + name := c.Name() + for _, method := range info.Method { + if method.Name == name { + return method, nil + } + } + + return nil, fmt.Errorf("method '%s' not found in name space '%s'", name, c.Namespace()) +} + +func (e *Executor) NewRequest(args []string) (*types.ExecuteSoap, *CommandInfoMethod, error) { + c := NewCommand(args) + + info, err := e.CommandInfo(c) + if err != nil { + return nil, nil, err + } + + sargs, err := c.Parse(info.Param) + if err != nil { + return nil, nil, err + } + + sreq := types.ExecuteSoap{ + Moid: c.Moid(), + Method: c.Method(), + Argument: sargs, + } + + return &sreq, info, nil +} + +func (e *Executor) Execute(req *types.ExecuteSoap, res interface{}) error { + req.This = e.mme.ManagedObjectReference + req.Version = "urn:vim25/5.0" + + x, err := methods.ExecuteSoap(context.TODO(), e.c, req) + if err != nil { + return err + } + + if x.Returnval != nil { + if x.Returnval.Fault != nil { + return errors.New(x.Returnval.Fault.FaultMsg) + } + + if err := xml.Unmarshal([]byte(x.Returnval.Response), res); err != nil { + return err + } + } + + return nil +} + +func (e *Executor) Run(args []string) (*Response, error) { + req, info, err := e.NewRequest(args) + if err != nil { + return nil, err + } + + res := &Response{ + Info: info, + } + + if err := e.Execute(req, res); err != nil { + return nil, err + } + + return res, nil +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/host/esxcli/firewall_info.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/host/esxcli/firewall_info.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/host/esxcli/firewall_info.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/host/esxcli/firewall_info.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,45 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package esxcli + +import "github.com/vmware/govmomi/object" + +type FirewallInfo struct { + Loaded bool + Enabled bool + DefaultAction string +} + +// GetFirewallInfo via 'esxcli network firewall get' +// The HostFirewallSystem type does not expose this data. +// This helper can be useful in particular to determine if the firewall is enabled or disabled. +func GetFirewallInfo(s *object.HostSystem) (*FirewallInfo, error) { + x, err := NewExecutor(s.Client(), s) + + res, err := x.Run([]string{"network", "firewall", "get"}) + if err != nil { + return nil, err + } + + info := &FirewallInfo{ + Loaded: res.Values[0]["Loaded"][0] == "true", + Enabled: res.Values[0]["Enabled"][0] == "true", + DefaultAction: res.Values[0]["DefaultAction"][0], + } + + return info, nil +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/host/esxcli/fixtures/network_vm_list.xml juju-core-2.0.2/src/github.com/vmware/govmomi/govc/host/esxcli/fixtures/network_vm_list.xml --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/host/esxcli/fixtures/network_vm_list.xml 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/host/esxcli/fixtures/network_vm_list.xml 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,15 @@ + + + foo + VM Network + dougm + 2 + 98842 + + + bar + VM Network + 1 + 236235 + + diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/host/esxcli/fixtures/network_vm_port_list.xml juju-core-2.0.2/src/github.com/vmware/govmomi/govc/host/esxcli/fixtures/network_vm_port_list.xml --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/host/esxcli/fixtures/network_vm_port_list.xml 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/host/esxcli/fixtures/network_vm_port_list.xml 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,12 @@ + + + + 192.168.247.149 + 00:0c:29:12:b2:cf + 33554438 + VM Network + vmnic0 + 33554434 + vSwitch0 + + diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/host/esxcli/fixtures/system_hostname_get.xml juju-core-2.0.2/src/github.com/vmware/govmomi/govc/host/esxcli/fixtures/system_hostname_get.xml --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/host/esxcli/fixtures/system_hostname_get.xml 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/host/esxcli/fixtures/system_hostname_get.xml 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,5 @@ + + localdomain + esxbox.localdomain + esxbox + diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/host/esxcli/guest_info.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/host/esxcli/guest_info.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/host/esxcli/guest_info.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/host/esxcli/guest_info.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,116 @@ +/* +Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package esxcli + +import ( + "strings" + + "github.com/vmware/govmomi/object" + "github.com/vmware/govmomi/property" + "github.com/vmware/govmomi/vim25" + "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/types" + "golang.org/x/net/context" +) + +type hostInfo struct { + *Executor + wids map[string]string +} + +type GuestInfo struct { + c *vim25.Client + hosts map[string]*hostInfo +} + +func NewGuestInfo(c *vim25.Client) *GuestInfo { + return &GuestInfo{ + c: c, + hosts: make(map[string]*hostInfo), + } +} + +func (g *GuestInfo) hostInfo(ref *types.ManagedObjectReference) (*hostInfo, error) { + // cache exectuor and uuid -> worldid map + if h, ok := g.hosts[ref.Value]; ok { + return h, nil + } + + host := object.NewHostSystem(g.c, *ref) + + e, err := NewExecutor(g.c, host) + if err != nil { + return nil, err + } + + res, err := e.Run([]string{"vm", "process", "list"}) + if err != nil { + return nil, err + } + + ids := make(map[string]string, len(res.Values)) + + for _, process := range res.Values { + // Normalize uuid, esxcli and mo.VirtualMachine have different formats + uuid := strings.Replace(process["UUID"][0], " ", "", -1) + uuid = strings.Replace(uuid, "-", "", -1) + + ids[uuid] = process["WorldID"][0] + } + + h := &hostInfo{e, ids} + g.hosts[ref.Value] = h + + return h, nil +} + +// IpAddress attempts to find the guest IP address using esxcli. +// ESX hosts must be configured with the /Net/GuestIPHack enabled. +// For example: +// $ govc host.esxcli -- system settings advanced set -o /Net/GuestIPHack -i 1 +func (g *GuestInfo) IpAddress(vm *object.VirtualMachine) (string, error) { + var mvm mo.VirtualMachine + + pc := property.DefaultCollector(g.c) + err := pc.RetrieveOne(context.TODO(), vm.Reference(), []string{"runtime.host", "config.uuid"}, &mvm) + if err != nil { + return "", err + } + + h, err := g.hostInfo(mvm.Runtime.Host) + if err != nil { + return "", err + } + + // Normalize uuid, esxcli and mo.VirtualMachine have different formats + uuid := strings.Replace(mvm.Config.Uuid, "-", "", -1) + + if wid, ok := h.wids[uuid]; ok { + res, err := h.Run([]string{"network", "vm", "port", "list", "--world-id", wid}) + if err != nil { + return "", err + } + + if len(res.Values) == 1 { + if ip, ok := res.Values[0]["IPAddress"]; ok { + return ip[0], nil + } + } + } + + return "", nil +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/host/esxcli/response.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/host/esxcli/response.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/host/esxcli/response.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/host/esxcli/response.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,97 @@ +/* +Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package esxcli + +import ( + "io" + + "github.com/vmware/govmomi/vim25/xml" +) + +type Values map[string][]string + +type Response struct { + Info *CommandInfoMethod + Values []Values +} + +func (v Values) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + for { + t, err := d.Token() + if err != nil { + if err == io.EOF { + return nil + } + return err + } + + if s, ok := t.(xml.StartElement); ok { + t, err = d.Token() + if err != nil { + return err + } + + key := s.Name.Local + var val string + if c, ok := t.(xml.CharData); ok { + val = string(c) + } + v[key] = append(v[key], val) + } + } +} + +func (r *Response) Type(start xml.StartElement) string { + for _, a := range start.Attr { + if a.Name.Local == "type" { + return a.Value + } + } + return "" +} + +func (r *Response) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + stype := r.Type(start) + + if stype != "ArrayOfDataObject" { + v := Values{} + if err := d.DecodeElement(&v, &start); err != nil { + return err + } + r.Values = append(r.Values, v) + return nil + } + + for { + t, err := d.Token() + if err != nil { + if err == io.EOF { + return nil + } + return err + } + + if s, ok := t.(xml.StartElement); ok { + if s.Name.Local == "DataObject" { + v := Values{} + if err := d.DecodeElement(&v, &s); err != nil { + return err + } + r.Values = append(r.Values, v) + } + } + } +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/host/esxcli/response_test.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/host/esxcli/response_test.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/host/esxcli/response_test.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/host/esxcli/response_test.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,105 @@ +/* +Copyright (c) 2014 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package esxcli + +import ( + "os" + "reflect" + "testing" + + "github.com/vmware/govmomi/vim25/types" + "github.com/vmware/govmomi/vim25/xml" +) + +func load(name string) *Response { + f, err := os.Open(name) + if err != nil { + panic(err) + } + + defer f.Close() + + var b Response + + dec := xml.NewDecoder(f) + dec.TypeFunc = types.TypeFunc() + if err := dec.Decode(&b); err != nil { + panic(err) + } + + return &b +} + +func TestSystemHostnameGetResponse(t *testing.T) { + res := load("fixtures/system_hostname_get.xml") + + expect := []Values{ + { + "DomainName": {"localdomain"}, + "FullyQualifiedDomainName": {"esxbox.localdomain"}, + "HostName": {"esxbox"}, + }, + } + + if !reflect.DeepEqual(res.Values, expect) { + t.Errorf("%s != %s", res.Values, expect) + } +} + +func TestNetworkVmList(t *testing.T) { + res := load("fixtures/network_vm_list.xml") + + expect := []Values{ + { + "Name": {"foo"}, + "Networks": {"VM Network", "dougm"}, + "NumPorts": {"2"}, + "WorldID": {"98842"}, + }, + { + "Name": {"bar"}, + "Networks": {"VM Network"}, + "NumPorts": {"1"}, + "WorldID": {"236235"}, + }, + } + + if !reflect.DeepEqual(res.Values, expect) { + t.Errorf("%s != %s", res.Values, expect) + } +} + +func TestNetworkVmPortList(t *testing.T) { + r := load("fixtures/network_vm_port_list.xml") + + expect := []Values{ + { + "IPAddress": {"192.168.247.149"}, + "MACAddress": {"00:0c:29:12:b2:cf"}, + "PortID": {"33554438"}, + "Portgroup": {"VM Network"}, + "TeamUplink": {"vmnic0"}, + "UplinkPortID": {"33554434"}, + "vSwitch": {"vSwitch0"}, + "DVPortID": {""}, + }, + } + + if !reflect.DeepEqual(r.Values, expect) { + t.Errorf("%s != %s", r.Values, expect) + } +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/host/firewall/find.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/host/firewall/find.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/host/firewall/find.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/host/firewall/find.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,128 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package firewall + +import ( + "flag" + "fmt" + "os" + + "golang.org/x/net/context" + + "github.com/vmware/govmomi/govc/cli" + "github.com/vmware/govmomi/govc/flags" + "github.com/vmware/govmomi/govc/host/esxcli" + "github.com/vmware/govmomi/object" + "github.com/vmware/govmomi/vim25/types" +) + +type find struct { + *flags.ClientFlag + *flags.OutputFlag + *flags.HostSystemFlag + + enabled bool + check bool + + types.HostFirewallRule +} + +func init() { + cli.Register("firewall.ruleset.find", &find{}) +} + +func (cmd *find) Register(ctx context.Context, f *flag.FlagSet) { + cmd.ClientFlag, ctx = flags.NewClientFlag(ctx) + cmd.ClientFlag.Register(ctx, f) + cmd.OutputFlag, ctx = flags.NewOutputFlag(ctx) + cmd.OutputFlag.Register(ctx, f) + cmd.HostSystemFlag, ctx = flags.NewHostSystemFlag(ctx) + cmd.HostSystemFlag.Register(ctx, f) + + f.BoolVar(&cmd.check, "c", true, "Check if esx firewall is enabled") + f.BoolVar(&cmd.enabled, "enabled", true, "Find enabled rule sets if true, disabled if false") + f.StringVar((*string)(&cmd.Direction), "direction", string(types.HostFirewallRuleDirectionOutbound), "Direction") + f.StringVar((*string)(&cmd.PortType), "type", string(types.HostFirewallRulePortTypeDst), "Port type") + f.StringVar((*string)(&cmd.Protocol), "proto", string(types.HostFirewallRuleProtocolTcp), "Protocol") + f.Var(flags.NewInt32(&cmd.Port), "port", "Port") +} + +func (cmd *find) Process(ctx context.Context) error { + if err := cmd.ClientFlag.Process(ctx); err != nil { + return err + } + if err := cmd.OutputFlag.Process(ctx); err != nil { + return err + } + if err := cmd.HostSystemFlag.Process(ctx); err != nil { + return err + } + return nil +} + +func (cmd *find) Description() string { + return `Find firewall rulesets matching the given rule. + +For a complete list of rulesets: govc host.esxcli network firewall ruleset list +For a complete list of rules: govc host.esxcli network firewall ruleset rule list` +} + +func (cmd *find) Run(ctx context.Context, f *flag.FlagSet) error { + host, err := cmd.HostSystem() + if err != nil { + return err + } + + fs, err := host.ConfigManager().FirewallSystem(ctx) + if err != nil { + return err + } + + if cmd.check { + esxfw, err := esxcli.GetFirewallInfo(host) + if err != nil { + return err + } + + if !esxfw.Enabled { + fmt.Fprintln(os.Stderr, "host firewall is disabled") + } + } + + info, err := fs.Info(ctx) + if err != nil { + return err + } + + if f.NArg() != 0 { + // TODO: f.Args() -> types.HostFirewallRulesetIpList + return flag.ErrHelp + } + + rs := object.HostFirewallRulesetList(info.Ruleset) + matched, err := rs.EnabledByRule(cmd.HostFirewallRule, cmd.enabled) + + if err != nil { + return err + } + + for _, r := range matched { + fmt.Println(r.Key) + } + + return nil +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/host/info.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/host/info.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/host/info.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/host/info.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,159 @@ +/* +Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package host + +import ( + "flag" + "fmt" + "io" + "os" + "text/tabwriter" + + "golang.org/x/net/context" + + "github.com/vmware/govmomi/govc/cli" + "github.com/vmware/govmomi/govc/flags" + "github.com/vmware/govmomi/object" + "github.com/vmware/govmomi/property" + "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/types" +) + +type info struct { + *flags.ClientFlag + *flags.OutputFlag + *flags.HostSystemFlag +} + +func init() { + cli.Register("host.info", &info{}) +} + +func (cmd *info) Register(ctx context.Context, f *flag.FlagSet) { + cmd.ClientFlag, ctx = flags.NewClientFlag(ctx) + cmd.ClientFlag.Register(ctx, f) + + cmd.OutputFlag, ctx = flags.NewOutputFlag(ctx) + cmd.OutputFlag.Register(ctx, f) + + cmd.HostSystemFlag, ctx = flags.NewHostSystemFlag(ctx) + cmd.HostSystemFlag.Register(ctx, f) +} + +func (cmd *info) Process(ctx context.Context) error { + if err := cmd.ClientFlag.Process(ctx); err != nil { + return err + } + if err := cmd.OutputFlag.Process(ctx); err != nil { + return err + } + if err := cmd.HostSystemFlag.Process(ctx); err != nil { + return err + } + return nil +} + +func (cmd *info) Run(ctx context.Context, f *flag.FlagSet) error { + c, err := cmd.Client() + if err != nil { + return err + } + + var res infoResult + var props []string + + if cmd.OutputFlag.JSON { + props = nil // Load everything + } else { + props = []string{"summary"} // Load summary + } + + // We could do without the -host flag, leaving it for compat + host, err := cmd.HostSystemIfSpecified() + if err != nil { + return err + } + + // Default only if there is a single host + if host == nil && f.NArg() == 0 { + host, err = cmd.HostSystem() + if err != nil { + return err + } + } + + if host != nil { + res.objects = append(res.objects, host) + } else { + res.objects, err = cmd.HostSystems(f.Args()) + if err != nil { + return err + } + } + + if len(res.objects) != 0 { + refs := make([]types.ManagedObjectReference, 0, len(res.objects)) + for _, o := range res.objects { + refs = append(refs, o.Reference()) + } + + pc := property.DefaultCollector(c) + err = pc.Retrieve(ctx, refs, props, &res.HostSystems) + if err != nil { + return err + } + } + + return cmd.WriteResult(&res) +} + +type infoResult struct { + HostSystems []mo.HostSystem + objects []*object.HostSystem +} + +func (r *infoResult) Write(w io.Writer) error { + // Maintain order via r.objects as Property collector does not always return results in order. + objects := make(map[types.ManagedObjectReference]mo.HostSystem, len(r.HostSystems)) + for _, o := range r.HostSystems { + objects[o.Reference()] = o + } + + tw := tabwriter.NewWriter(os.Stdout, 2, 0, 2, ' ', 0) + + for _, o := range r.objects { + host := objects[o.Reference()] + s := host.Summary + h := s.Hardware + z := s.QuickStats + ncpu := int32(h.NumCpuPkgs * h.NumCpuCores) + cpuUsage := 100 * float64(z.OverallCpuUsage) / float64(ncpu*h.CpuMhz) + memUsage := 100 * float64(z.OverallMemoryUsage<<20) / float64(h.MemorySize) + + fmt.Fprintf(tw, "Name:\t%s\n", s.Config.Name) + fmt.Fprintf(tw, " Path:\t%s\n", o.InventoryPath) + fmt.Fprintf(tw, " Manufacturer:\t%s\n", h.Vendor) + fmt.Fprintf(tw, " Logical CPUs:\t%d CPUs @ %dMHz\n", ncpu, h.CpuMhz) + fmt.Fprintf(tw, " Processor type:\t%s\n", h.CpuModel) + fmt.Fprintf(tw, " CPU usage:\t%d MHz (%.1f%%)\n", z.OverallCpuUsage, cpuUsage) + fmt.Fprintf(tw, " Memory:\t%dMB\n", h.MemorySize/(1024*1024)) + fmt.Fprintf(tw, " Memory usage:\t%d MB (%.1f%%)\n", z.OverallMemoryUsage, memUsage) + fmt.Fprintf(tw, " Boot time:\t%s\n", s.Runtime.BootTime) + } + + return tw.Flush() +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/host/maintenance/enter.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/host/maintenance/enter.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/host/maintenance/enter.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/host/maintenance/enter.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,94 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package maintenancec + +import ( + "flag" + "fmt" + + "golang.org/x/net/context" + + "github.com/vmware/govmomi/govc/cli" + "github.com/vmware/govmomi/govc/flags" + "github.com/vmware/govmomi/object" +) + +type enter struct { + *flags.HostSystemFlag + + timeout int32 + evacuate bool +} + +func init() { + cli.Register("host.maintenance.enter", &enter{}) +} + +func (cmd *enter) Register(ctx context.Context, f *flag.FlagSet) { + cmd.HostSystemFlag, ctx = flags.NewHostSystemFlag(ctx) + cmd.HostSystemFlag.Register(ctx, f) + + f.Var(flags.NewInt32(&cmd.timeout), "timeout", "Timeout") + f.BoolVar(&cmd.evacuate, "evacuate", false, "Evacuate powered off VMs") +} + +func (cmd *enter) Process(ctx context.Context) error { + if err := cmd.HostSystemFlag.Process(ctx); err != nil { + return err + } + return nil +} + +func (cmd *enter) Usage() string { + return "HOST..." +} + +func (cmd *enter) Description() string { + return `Put the hosts in maintenance mode. + +While this task is running and when the host is in maintenance mode, +no virtual machines can be powered on and no provisioning operations can be performed on the host.` +} + +func (cmd *enter) EnterMaintenanceMode(ctx context.Context, host *object.HostSystem) error { + task, err := host.EnterMaintenanceMode(ctx, cmd.timeout, cmd.evacuate, nil) // TODO: spec param + if err != nil { + return err + } + + logger := cmd.ProgressLogger(fmt.Sprintf("%s entering maintenance mode... ", host.InventoryPath)) + defer logger.Wait() + + _, err = task.WaitForResult(ctx, logger) + return err +} + +func (cmd *enter) Run(ctx context.Context, f *flag.FlagSet) error { + hosts, err := cmd.HostSystems(f.Args()) + if err != nil { + return err + } + + for _, host := range hosts { + err = cmd.EnterMaintenanceMode(ctx, host) + if err != nil { + return err + } + } + + return nil +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/host/maintenance/exit.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/host/maintenance/exit.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/host/maintenance/exit.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/host/maintenance/exit.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,95 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package maintenancec + +import ( + "flag" + "fmt" + + "golang.org/x/net/context" + + "github.com/vmware/govmomi/govc/cli" + "github.com/vmware/govmomi/govc/flags" + "github.com/vmware/govmomi/object" +) + +type exit struct { + *flags.HostSystemFlag + + timeout int32 +} + +func init() { + cli.Register("host.maintenance.exit", &exit{}) +} + +func (cmd *exit) Register(ctx context.Context, f *flag.FlagSet) { + cmd.HostSystemFlag, ctx = flags.NewHostSystemFlag(ctx) + cmd.HostSystemFlag.Register(ctx, f) + + f.Var(flags.NewInt32(&cmd.timeout), "timeout", "Timeout") +} + +func (cmd *exit) Process(ctx context.Context) error { + if err := cmd.HostSystemFlag.Process(ctx); err != nil { + return err + } + return nil +} + +func (cmd *exit) Usage() string { + return "HOST..." +} + +func (cmd *exit) Description() string { + return `Take hosts out of maintenance mode. + +This blocks if any concurrent running maintenance-only host configurations operations are being performed. +For example, if VMFS volumes are being upgraded. + +The 'timeout' flag is the number of seconds to wait for the exit maintenance mode to succeed. +If the timeout is less than or equal to zero, there is no timeout.` +} + +func (cmd *exit) ExitMaintenanceMode(ctx context.Context, host *object.HostSystem) error { + task, err := host.ExitMaintenanceMode(ctx, cmd.timeout) + if err != nil { + return err + } + + logger := cmd.ProgressLogger(fmt.Sprintf("%s exiting maintenance mode... ", host.InventoryPath)) + defer logger.Wait() + + _, err = task.WaitForResult(ctx, logger) + return err +} + +func (cmd *exit) Run(ctx context.Context, f *flag.FlagSet) error { + hosts, err := cmd.HostSystems(f.Args()) + if err != nil { + return err + } + + for _, host := range hosts { + err = cmd.ExitMaintenanceMode(ctx, host) + if err != nil { + return err + } + } + + return nil +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/host/option/ls.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/host/option/ls.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/host/option/ls.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/host/option/ls.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,110 @@ +/* +Copyright (c) 2016 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package option + +import ( + "flag" + "fmt" + "io" + "os" + "text/tabwriter" + + "golang.org/x/net/context" + + "github.com/vmware/govmomi/govc/cli" + "github.com/vmware/govmomi/govc/flags" + "github.com/vmware/govmomi/vim25/types" +) + +type ls struct { + *flags.ClientFlag + *flags.OutputFlag + *flags.HostSystemFlag +} + +func init() { + cli.Register("host.option.ls", &ls{}) +} + +func (cmd *ls) Register(ctx context.Context, f *flag.FlagSet) { + cmd.ClientFlag, ctx = flags.NewClientFlag(ctx) + cmd.ClientFlag.Register(ctx, f) + + cmd.OutputFlag, ctx = flags.NewOutputFlag(ctx) + cmd.OutputFlag.Register(ctx, f) + + cmd.HostSystemFlag, ctx = flags.NewHostSystemFlag(ctx) + cmd.HostSystemFlag.Register(ctx, f) +} + +func (cmd *ls) Process(ctx context.Context) error { + if err := cmd.ClientFlag.Process(ctx); err != nil { + return err + } + if err := cmd.OutputFlag.Process(ctx); err != nil { + return err + } + if err := cmd.HostSystemFlag.Process(ctx); err != nil { + return err + } + return nil +} + +func (cmd *ls) Usage() string { + return "NAME" +} + +func (cmd *ls) Description() string { + return ` +List option with the given NAME. +If NAME ends with a dot, all options for that subtree are listed. +` +} + +func (cmd *ls) Run(ctx context.Context, f *flag.FlagSet) error { + if f.NArg() != 1 { + return flag.ErrHelp + } + + host, err := cmd.HostSystem() + if err != nil { + return err + } + + m, err := host.ConfigManager().OptionManager(ctx) + if err != nil { + return err + } + + opts, err := m.Query(ctx, f.Arg(0)) + if err != nil { + return err + } + + return cmd.WriteResult(optionResult(opts)) +} + +type optionResult []types.BaseOptionValue + +func (r optionResult) Write(w io.Writer) error { + tw := tabwriter.NewWriter(os.Stdout, 2, 0, 2, ' ', 0) + for _, opt := range r { + o := opt.GetOptionValue() + fmt.Fprintf(tw, "%s:\t%v\n", o.Key, o.Value) + } + return tw.Flush() +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/host/option/set.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/host/option/set.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/host/option/set.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/host/option/set.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,123 @@ +/* +Copyright (c) 2016 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package option + +import ( + "flag" + "fmt" + "strconv" + + "golang.org/x/net/context" + + "github.com/vmware/govmomi/govc/cli" + "github.com/vmware/govmomi/govc/flags" + "github.com/vmware/govmomi/vim25/types" +) + +type set struct { + *flags.ClientFlag + *flags.HostSystemFlag +} + +func init() { + cli.Register("host.option.set", &set{}) +} + +func (cmd *set) Register(ctx context.Context, f *flag.FlagSet) { + cmd.ClientFlag, ctx = flags.NewClientFlag(ctx) + cmd.ClientFlag.Register(ctx, f) + + cmd.HostSystemFlag, ctx = flags.NewHostSystemFlag(ctx) + cmd.HostSystemFlag.Register(ctx, f) +} + +func (cmd *set) Process(ctx context.Context) error { + if err := cmd.ClientFlag.Process(ctx); err != nil { + return err + } + if err := cmd.HostSystemFlag.Process(ctx); err != nil { + return err + } + return nil +} + +func (cmd *set) Usage() string { + return "NAME VALUE" +} + +func (cmd *set) Description() string { + return `Set host option NAME to VALUE. +Example: +govc host.option.set Config.HostAgent.plugins.solo.enableMob true +` +} + +func (cmd *set) Run(ctx context.Context, f *flag.FlagSet) error { + host, err := cmd.HostSystem() + if err != nil { + return err + } + + m, err := host.ConfigManager().OptionManager(ctx) + if err != nil { + return err + } + + if f.NArg() != 2 { + return flag.ErrHelp + } + + name := f.Arg(0) + opts, err := m.Query(ctx, name) + if err != nil { + return err + } + + if len(opts) != 1 { + return flag.ErrHelp + } + + val := f.Arg(1) + var set types.AnyType + + switch x := opts[0].GetOptionValue().Value.(type) { + case string: + set = val + case bool: + set, err = strconv.ParseBool(val) + if err != nil { + return err + } + case int32: + s, err := strconv.ParseInt(val, 10, 32) + if err != nil { + return err + } + set = s + case int64: + set, err = strconv.ParseInt(val, 10, 64) + if err != nil { + return err + } + default: + return fmt.Errorf("type %T conversion not supported", x) + } + + opts[0].GetOptionValue().Value = set + + return m.Update(ctx, opts) +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/host/portgroup/add.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/host/portgroup/add.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/host/portgroup/add.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/host/portgroup/add.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,66 @@ +/* +Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package portgroup + +import ( + "flag" + + "github.com/vmware/govmomi/govc/cli" + "github.com/vmware/govmomi/govc/flags" + "github.com/vmware/govmomi/vim25/types" + "golang.org/x/net/context" +) + +type add struct { + *flags.HostSystemFlag + + spec types.HostPortGroupSpec +} + +func init() { + cli.Register("host.portgroup.add", &add{}) +} + +func (cmd *add) Register(ctx context.Context, f *flag.FlagSet) { + cmd.HostSystemFlag, ctx = flags.NewHostSystemFlag(ctx) + cmd.HostSystemFlag.Register(ctx, f) + + f.StringVar(&cmd.spec.VswitchName, "vswitch", "", "vSwitch Name") + f.Var(flags.NewInt32(&cmd.spec.VlanId), "vlan", "VLAN ID") +} + +func (cmd *add) Process(ctx context.Context) error { + if err := cmd.HostSystemFlag.Process(ctx); err != nil { + return err + } + return nil +} + +func (cmd *add) Usage() string { + return "NAME" +} + +func (cmd *add) Run(ctx context.Context, f *flag.FlagSet) error { + ns, err := cmd.HostNetworkSystem() + if err != nil { + return err + } + + cmd.spec.Name = f.Arg(0) + + return ns.AddPortGroup(context.TODO(), cmd.spec) +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/host/portgroup/remove.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/host/portgroup/remove.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/host/portgroup/remove.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/host/portgroup/remove.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,58 @@ +/* +Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package portgroup + +import ( + "flag" + + "github.com/vmware/govmomi/govc/cli" + "github.com/vmware/govmomi/govc/flags" + "golang.org/x/net/context" +) + +type remove struct { + *flags.HostSystemFlag +} + +func init() { + cli.Register("host.portgroup.remove", &remove{}) +} + +func (cmd *remove) Register(ctx context.Context, f *flag.FlagSet) { + cmd.HostSystemFlag, ctx = flags.NewHostSystemFlag(ctx) + cmd.HostSystemFlag.Register(ctx, f) +} + +func (cmd *remove) Process(ctx context.Context) error { + if err := cmd.HostSystemFlag.Process(ctx); err != nil { + return err + } + return nil +} + +func (cmd *remove) Usage() string { + return "NAME" +} + +func (cmd *remove) Run(ctx context.Context, f *flag.FlagSet) error { + ns, err := cmd.HostNetworkSystem() + if err != nil { + return err + } + + return ns.RemovePortGroup(context.TODO(), f.Arg(0)) +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/host/reconnect.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/host/reconnect.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/host/reconnect.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/host/reconnect.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,97 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package host + +import ( + "flag" + "fmt" + + "golang.org/x/net/context" + + "github.com/vmware/govmomi/govc/cli" + "github.com/vmware/govmomi/govc/flags" + "github.com/vmware/govmomi/object" + "github.com/vmware/govmomi/vim25/types" +) + +type reconnect struct { + *flags.HostSystemFlag + *flags.HostConnectFlag + + types.HostSystemReconnectSpec +} + +func init() { + cli.Register("host.reconnect", &reconnect{}) +} + +func (cmd *reconnect) Register(ctx context.Context, f *flag.FlagSet) { + cmd.HostSystemFlag, ctx = flags.NewHostSystemFlag(ctx) + cmd.HostSystemFlag.Register(ctx, f) + + cmd.HostConnectFlag, ctx = flags.NewHostConnectFlag(ctx) + cmd.HostConnectFlag.Register(ctx, f) + + cmd.HostSystemReconnectSpec.SyncState = types.NewBool(false) + f.BoolVar(cmd.HostSystemReconnectSpec.SyncState, "sync-state", false, "Sync state") +} + +func (cmd *reconnect) Process(ctx context.Context) error { + if err := cmd.HostSystemFlag.Process(ctx); err != nil { + return err + } + if err := cmd.HostConnectFlag.Process(ctx); err != nil { + return err + } + return nil +} + +func (cmd *reconnect) Description() string { + return `Reconnect host to vCenter. + +This command can also be used to change connection properties (hostname, fingerprint, username, password), +without disconnecting the host.` +} + +func (cmd *reconnect) Reconnect(ctx context.Context, host *object.HostSystem) error { + task, err := host.Reconnect(ctx, &cmd.HostConnectSpec, &cmd.HostSystemReconnectSpec) + if err != nil { + return err + } + + logger := cmd.ProgressLogger(fmt.Sprintf("%s reconnecting... ", host.InventoryPath)) + defer logger.Wait() + + _, err = task.WaitForResult(ctx, logger) + return err +} + +func (cmd *reconnect) Run(ctx context.Context, f *flag.FlagSet) error { + hosts, err := cmd.HostSystems(f.Args()) + if err != nil { + return err + } + + for _, host := range hosts { + err = cmd.Reconnect(ctx, host) + if err != nil { + return err + } + } + + return nil +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/host/remove.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/host/remove.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/host/remove.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/host/remove.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,101 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package host + +import ( + "flag" + "fmt" + + "golang.org/x/net/context" + + "github.com/vmware/govmomi/govc/cli" + "github.com/vmware/govmomi/govc/flags" + "github.com/vmware/govmomi/object" + "github.com/vmware/govmomi/vim25/mo" +) + +type remove struct { + *flags.HostSystemFlag +} + +func init() { + cli.Register("host.remove", &remove{}) +} + +func (cmd *remove) Register(ctx context.Context, f *flag.FlagSet) { + cmd.HostSystemFlag, ctx = flags.NewHostSystemFlag(ctx) + cmd.HostSystemFlag.Register(ctx, f) +} + +func (cmd *remove) Process(ctx context.Context) error { + if err := cmd.HostSystemFlag.Process(ctx); err != nil { + return err + } + return nil +} + +func (cmd *remove) Usage() string { + return "HOST..." +} + +func (cmd *remove) Description() string { + return `Remove hosts from vCenter.` +} + +func (cmd *remove) Remove(ctx context.Context, host *object.HostSystem) error { + var h mo.HostSystem + err := host.Properties(ctx, host.Reference(), []string{"parent"}, &h) + if err != nil { + return err + } + + remove := host.Destroy + + if h.Parent.Type == "ComputeResource" { + // Standalone host. From the docs: + // "Invoking remove on a HostSystem of standalone type throws a NotSupported fault. + // A standalone HostSystem can be removeed only by invoking remove on its parent ComputeResource." + remove = object.NewComputeResource(host.Client(), *h.Parent).Destroy + } + + task, err := remove(ctx) + if err != nil { + return err + } + + logger := cmd.ProgressLogger(fmt.Sprintf("%s removing... ", host.InventoryPath)) + defer logger.Wait() + + _, err = task.WaitForResult(ctx, logger) + return err +} + +func (cmd *remove) Run(ctx context.Context, f *flag.FlagSet) error { + hosts, err := cmd.HostSystems(f.Args()) + if err != nil { + return err + } + + for _, host := range hosts { + err = cmd.Remove(ctx, host) + if err != nil { + return err + } + } + + return nil +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/host/service/command.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/host/service/command.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/host/service/command.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/host/service/command.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,125 @@ +/* +Copyright (c) 2016 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package service + +import ( + "flag" + "fmt" + + "golang.org/x/net/context" + + "github.com/vmware/govmomi/govc/cli" + "github.com/vmware/govmomi/govc/flags" + "github.com/vmware/govmomi/object" + "github.com/vmware/govmomi/vim25/types" +) + +type service struct { + *flags.ClientFlag + *flags.HostSystemFlag +} + +func init() { + cli.Register("host.service", &service{}) +} + +func (cmd *service) Register(ctx context.Context, f *flag.FlagSet) { + cmd.ClientFlag, ctx = flags.NewClientFlag(ctx) + cmd.ClientFlag.Register(ctx, f) + + cmd.HostSystemFlag, ctx = flags.NewHostSystemFlag(ctx) + cmd.HostSystemFlag.Register(ctx, f) +} + +func (cmd *service) Process(ctx context.Context) error { + if err := cmd.ClientFlag.Process(ctx); err != nil { + return err + } + if err := cmd.HostSystemFlag.Process(ctx); err != nil { + return err + } + return nil +} + +func (cmd *service) Usage() string { + return "ACTION ID" +} + +func (cmd *service) Description() string { + return `Apply host service ACTION to service ID. +Where ACTION is one of: start, stop, restart, status, enable, disable +Example: +govc host.service enable TSM-SSH +govc host.service start TSM-SSH +` +} + +func (cmd *service) status(ctx context.Context, s *object.HostServiceSystem, id string) (string, error) { + services, err := s.Service(ctx) + if err != nil { + return "", err + } + + for _, service := range services { + if id == service.Key { + return status(service), nil + } + } + + return "N/A", nil +} + +func (cmd *service) Run(ctx context.Context, f *flag.FlagSet) error { + host, err := cmd.HostSystem() + if err != nil { + return err + } + + if f.NArg() != 2 { + return flag.ErrHelp + } + + arg := f.Arg(0) + id := f.Arg(1) + + s, err := host.ConfigManager().ServiceSystem(ctx) + if err != nil { + return err + } + + switch arg { + case "start": + return s.Start(ctx, id) + case "stop": + return s.Stop(ctx, id) + case "restart": + return s.Restart(ctx, id) + case "status": + ss, err := cmd.status(ctx, s, id) + if err != nil { + return err + } + fmt.Println(ss) + return nil + case "enable": + return s.UpdatePolicy(ctx, id, string(types.HostServicePolicyOn)) + case "disable": + return s.UpdatePolicy(ctx, id, string(types.HostServicePolicyOff)) + } + + return flag.ErrHelp +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/host/service/ls.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/host/service/ls.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/host/service/ls.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/host/service/ls.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,108 @@ +/* +Copyright (c) 2016 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package service + +import ( + "flag" + "fmt" + "io" + "text/tabwriter" + + "golang.org/x/net/context" + + "github.com/vmware/govmomi/govc/cli" + "github.com/vmware/govmomi/govc/flags" + "github.com/vmware/govmomi/vim25/types" +) + +type ls struct { + *flags.ClientFlag + *flags.OutputFlag + *flags.HostSystemFlag +} + +func init() { + cli.Register("host.service.ls", &ls{}) +} + +func (cmd *ls) Register(ctx context.Context, f *flag.FlagSet) { + cmd.ClientFlag, ctx = flags.NewClientFlag(ctx) + cmd.ClientFlag.Register(ctx, f) + + cmd.OutputFlag, ctx = flags.NewOutputFlag(ctx) + cmd.OutputFlag.Register(ctx, f) + + cmd.HostSystemFlag, ctx = flags.NewHostSystemFlag(ctx) + cmd.HostSystemFlag.Register(ctx, f) +} + +func (cmd *ls) Process(ctx context.Context) error { + if err := cmd.ClientFlag.Process(ctx); err != nil { + return err + } + if err := cmd.OutputFlag.Process(ctx); err != nil { + return err + } + if err := cmd.HostSystemFlag.Process(ctx); err != nil { + return err + } + return nil +} + +func (cmd *ls) Description() string { + return `List host services.` +} + +func status(s types.HostService) string { + if s.Running { + return "Running" + } + return "Stopped" +} + +func (cmd *ls) Run(ctx context.Context, f *flag.FlagSet) error { + host, err := cmd.HostSystem() + if err != nil { + return err + } + + s, err := host.ConfigManager().ServiceSystem(ctx) + if err != nil { + return err + } + + services, err := s.Service(ctx) + if err != nil { + return err + } + + return cmd.WriteResult(optionResult(services)) +} + +type optionResult []types.HostService + +func (services optionResult) Write(w io.Writer) error { + tw := tabwriter.NewWriter(w, 2, 0, 2, ' ', 0) + + fmt.Fprintf(tw, "%s\t%s\t%v\t%s\n", "Key", "Policy", "Status", "Label") + + for _, s := range services { + fmt.Fprintf(tw, "%s\t%s\t%s\t%s\n", s.Key, s.Policy, status(s), s.Label) + } + + return tw.Flush() +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/host/storage/info.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/host/storage/info.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/host/storage/info.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/host/storage/info.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,208 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package storage + +import ( + "flag" + "fmt" + "io" + "strings" + "text/tabwriter" + + "github.com/vmware/govmomi/govc/cli" + "github.com/vmware/govmomi/govc/flags" + "github.com/vmware/govmomi/units" + "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/types" + "golang.org/x/net/context" +) + +var infoTypes = []string{"hba", "lun"} + +type infoType string + +func (t *infoType) Set(s string) error { + s = strings.ToLower(s) + + for _, e := range infoTypes { + if s == e { + *t = infoType(s) + return nil + } + } + + return fmt.Errorf("invalid type") +} + +func (t *infoType) String() string { + return string(*t) +} + +func (t *infoType) Result(hss mo.HostStorageSystem) flags.OutputWriter { + switch string(*t) { + case "hba": + return hbaResult(hss) + case "lun": + return lunResult(hss) + default: + panic("unsupported") + } +} + +type info struct { + *flags.HostSystemFlag + *flags.OutputFlag + + typ infoType + rescan bool +} + +func init() { + cli.Register("host.storage.info", &info{}) +} + +func (cmd *info) Register(ctx context.Context, f *flag.FlagSet) { + cmd.HostSystemFlag, ctx = flags.NewHostSystemFlag(ctx) + cmd.HostSystemFlag.Register(ctx, f) + cmd.OutputFlag, ctx = flags.NewOutputFlag(ctx) + cmd.OutputFlag.Register(ctx, f) + + err := cmd.typ.Set("lun") + if err != nil { + panic(err) + } + + f.Var(&cmd.typ, "t", fmt.Sprintf("Type (%s)", strings.Join(infoTypes, ","))) + + f.BoolVar(&cmd.rescan, "rescan", false, "Rescan for new storage devices") +} + +func (cmd *info) Process(ctx context.Context) error { + if err := cmd.HostSystemFlag.Process(ctx); err != nil { + return err + } + if err := cmd.OutputFlag.Process(ctx); err != nil { + return err + } + return nil +} + +func (cmd *info) Usage() string { + return "[-t TYPE]" +} + +func (cmd *info) Description() string { + return `Show information about a host's storage system.` +} + +func (cmd *info) Run(ctx context.Context, f *flag.FlagSet) error { + host, err := cmd.HostSystem() + if err != nil { + return err + } + + ss, err := host.ConfigManager().StorageSystem(ctx) + if err != nil { + return err + } + + if cmd.rescan { + err = ss.RescanAllHba(ctx) + if err != nil { + return err + } + } + + var hss mo.HostStorageSystem + err = ss.Properties(ctx, ss.Reference(), nil, &hss) + if err != nil { + return nil + } + + return cmd.WriteResult(cmd.typ.Result(hss)) +} + +type hbaResult mo.HostStorageSystem + +func (r hbaResult) Write(w io.Writer) error { + tw := tabwriter.NewWriter(w, 2, 0, 2, ' ', 0) + + fmt.Fprintf(tw, "Device\t") + fmt.Fprintf(tw, "PCI\t") + fmt.Fprintf(tw, "Driver\t") + fmt.Fprintf(tw, "Status\t") + fmt.Fprintf(tw, "Model\t") + fmt.Fprintf(tw, "\n") + + for _, e := range r.StorageDeviceInfo.HostBusAdapter { + hba := e.GetHostHostBusAdapter() + + fmt.Fprintf(tw, "%s\t", hba.Device) + fmt.Fprintf(tw, "%s\t", hba.Pci) + fmt.Fprintf(tw, "%s\t", hba.Driver) + fmt.Fprintf(tw, "%s\t", hba.Status) + fmt.Fprintf(tw, "%s\t", hba.Model) + fmt.Fprintf(tw, "\n") + } + + return tw.Flush() +} + +type lunResult mo.HostStorageSystem + +func (r lunResult) Write(w io.Writer) error { + tw := tabwriter.NewWriter(w, 2, 0, 2, ' ', 0) + + fmt.Fprintf(tw, "Name\t") + fmt.Fprintf(tw, "Type\t") + fmt.Fprintf(tw, "Capacity\t") + fmt.Fprintf(tw, "Model\t") + fmt.Fprintf(tw, "\n") + + for _, e := range r.StorageDeviceInfo.ScsiLun { + var tags []string + var capacity int64 + + lun := e.GetScsiLun() + if disk, ok := e.(*types.HostScsiDisk); ok { + capacity = int64(disk.Capacity.Block) * int64(disk.Capacity.BlockSize) + if disk.LocalDisk != nil && *disk.LocalDisk { + tags = append(tags, "local") + } + if disk.Ssd != nil && *disk.Ssd { + tags = append(tags, "sdd") + } + } + + fmt.Fprintf(tw, "%s\t", lun.DeviceName) + fmt.Fprintf(tw, "%s\t", lun.DeviceType) + + if capacity == 0 { + fmt.Fprintf(tw, "-\t") + } else { + fmt.Fprintf(tw, "%s\t", units.ByteSize(capacity)) + } + + fmt.Fprintf(tw, "%s", lun.Model) + if len(tags) > 0 { + fmt.Fprintf(tw, " (%s)", strings.Join(tags, ",")) + } + fmt.Fprintf(tw, "\n") + } + + return tw.Flush() +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/host/storage/mark.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/host/storage/mark.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/host/storage/mark.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/host/storage/mark.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,142 @@ +/* +Copyright (c) 2016 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package storage + +import ( + "flag" + "fmt" + + "golang.org/x/net/context" + + "github.com/vmware/govmomi/govc/cli" + "github.com/vmware/govmomi/govc/flags" + "github.com/vmware/govmomi/object" + "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/types" +) + +type mark struct { + *flags.HostSystemFlag + + ssd *bool + local *bool +} + +func init() { + cli.Register("host.storage.mark", &mark{}) +} + +func (cmd *mark) Register(ctx context.Context, f *flag.FlagSet) { + cmd.HostSystemFlag, ctx = flags.NewHostSystemFlag(ctx) + cmd.HostSystemFlag.Register(ctx, f) + + f.Var(flags.NewOptionalBool(&cmd.ssd), "ssd", "Mark as SSD") + f.Var(flags.NewOptionalBool(&cmd.local), "local", "Mark as local") +} + +func (cmd *mark) Process(ctx context.Context) error { + if err := cmd.HostSystemFlag.Process(ctx); err != nil { + return err + } + return nil +} + +func (cmd *mark) Usage() string { + return "DEVICE_PATH" +} + +func (cmd *mark) Description() string { + return `Mark device at DEVICE_PATH.` +} + +func (cmd *mark) Mark(ctx context.Context, ss *object.HostStorageSystem, uuid string) error { + var err error + var task *object.Task + + if cmd.ssd != nil { + if *cmd.ssd { + task, err = ss.MarkAsSsd(ctx, uuid) + } else { + task, err = ss.MarkAsNonSsd(ctx, uuid) + } + + if err != nil { + return err + } + + err = task.Wait(ctx) + if err != nil { + return err + } + } + + if cmd.local != nil { + if *cmd.local { + task, err = ss.MarkAsLocal(ctx, uuid) + } else { + task, err = ss.MarkAsNonLocal(ctx, uuid) + } + + if err != nil { + return err + } + + err = task.Wait(ctx) + if err != nil { + return err + } + } + + return nil +} + +func (cmd *mark) Run(ctx context.Context, f *flag.FlagSet) error { + if f.NArg() != 1 { + return fmt.Errorf("specify device path") + } + + path := f.Args()[0] + + host, err := cmd.HostSystem() + if err != nil { + return err + } + + ss, err := host.ConfigManager().StorageSystem(ctx) + if err != nil { + return err + } + + var hss mo.HostStorageSystem + err = ss.Properties(ctx, ss.Reference(), nil, &hss) + if err != nil { + return nil + } + + for _, e := range hss.StorageDeviceInfo.ScsiLun { + disk, ok := e.(*types.HostScsiDisk) + if !ok { + continue + } + + if disk.DevicePath == path { + return cmd.Mark(ctx, ss, disk.Uuid) + } + } + + return fmt.Errorf("%s not found", path) +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/host/storage/partition.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/host/storage/partition.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/host/storage/partition.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/host/storage/partition.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,127 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package storage + +import ( + "flag" + "fmt" + "io" + "text/tabwriter" + + "golang.org/x/net/context" + + "github.com/vmware/govmomi/govc/cli" + "github.com/vmware/govmomi/govc/flags" + "github.com/vmware/govmomi/units" + "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/types" +) + +type partition struct { + *flags.HostSystemFlag + *flags.OutputFlag +} + +func init() { + cli.Register("host.storage.partition", &partition{}) +} + +func (cmd *partition) Register(ctx context.Context, f *flag.FlagSet) { + cmd.HostSystemFlag, ctx = flags.NewHostSystemFlag(ctx) + cmd.HostSystemFlag.Register(ctx, f) + cmd.OutputFlag, ctx = flags.NewOutputFlag(ctx) + cmd.OutputFlag.Register(ctx, f) +} + +func (cmd *partition) Process(ctx context.Context) error { + if err := cmd.HostSystemFlag.Process(ctx); err != nil { + return err + } + if err := cmd.OutputFlag.Process(ctx); err != nil { + return err + } + return nil +} + +func (cmd *partition) Usage() string { + return "DEVICE_PATH" +} + +func (cmd *partition) Description() string { + return `Show partition table for device at DEVICE_PATH.` +} + +func (cmd *partition) Run(ctx context.Context, f *flag.FlagSet) error { + if f.NArg() != 1 { + return fmt.Errorf("specify device path") + } + + path := f.Args()[0] + + host, err := cmd.HostSystem() + if err != nil { + return err + } + + ss, err := host.ConfigManager().StorageSystem(ctx) + if err != nil { + return err + } + + var hss mo.HostStorageSystem + err = ss.Properties(ctx, ss.Reference(), nil, &hss) + if err != nil { + return nil + } + + info, err := ss.RetrieveDiskPartitionInfo(ctx, path) + if err != nil { + return err + } + + return cmd.WriteResult(partitionInfo(*info)) +} + +type partitionInfo types.HostDiskPartitionInfo + +func (p partitionInfo) Write(w io.Writer) error { + tw := tabwriter.NewWriter(w, 2, 0, 2, ' ', 0) + + fmt.Fprintf(tw, "Table format: %s\n", p.Spec.PartitionFormat) + fmt.Fprintf(tw, "Number of sectors: %d\n", p.Spec.TotalSectors) + fmt.Fprintf(tw, "\n") + + fmt.Fprintf(tw, "Number\t") + fmt.Fprintf(tw, "Start\t") + fmt.Fprintf(tw, "End\t") + fmt.Fprintf(tw, "Size\t") + fmt.Fprintf(tw, "Type\t") + fmt.Fprintf(tw, "\n") + + for _, e := range p.Spec.Partition { + sectors := e.EndSector - e.StartSector + + fmt.Fprintf(tw, "%d\t", e.Partition) + fmt.Fprintf(tw, "%d\t", e.StartSector) + fmt.Fprintf(tw, "%d\t", e.EndSector) + fmt.Fprintf(tw, "%s\t", units.ByteSize(sectors*512)) + fmt.Fprintf(tw, "%s\t", e.Type) + fmt.Fprintf(tw, "\n") + } + + return tw.Flush() +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/host/vnic/info.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/host/vnic/info.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/host/vnic/info.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/host/vnic/info.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,146 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package vnic + +import ( + "flag" + "fmt" + "os" + "strings" + "text/tabwriter" + + "github.com/vmware/govmomi/govc/cli" + "github.com/vmware/govmomi/govc/flags" + "github.com/vmware/govmomi/object" + "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/types" + "golang.org/x/net/context" +) + +type info struct { + *flags.HostSystemFlag +} + +func init() { + cli.Register("host.vnic.info", &info{}) +} + +func (cmd *info) Register(ctx context.Context, f *flag.FlagSet) { + cmd.HostSystemFlag, ctx = flags.NewHostSystemFlag(ctx) + cmd.HostSystemFlag.Register(ctx, f) +} + +func (cmd *info) Process(ctx context.Context) error { + if err := cmd.HostSystemFlag.Process(ctx); err != nil { + return err + } + return nil +} + +func (cmd *info) Run(ctx context.Context, f *flag.FlagSet) error { + host, err := cmd.HostSystem() + if err != nil { + return err + } + + ns, err := cmd.HostNetworkSystem() + if err != nil { + return err + } + + var mns mo.HostNetworkSystem + + m, err := host.ConfigManager().VirtualNicManager(ctx) + if err != nil { + return err + } + + info, err := m.Info(ctx) + if err != nil { + return err + } + + err = ns.Properties(ctx, ns.Reference(), []string{"networkInfo"}, &mns) + if err != nil { + return err + } + + tw := tabwriter.NewWriter(os.Stdout, 2, 0, 2, ' ', 0) + + type dnet struct { + dvp mo.DistributedVirtualPortgroup + dvs mo.VmwareDistributedVirtualSwitch + } + + dnets := make(map[string]*dnet) + + for _, nic := range mns.NetworkInfo.Vnic { + fmt.Fprintf(tw, "Device:\t%s\n", nic.Device) + + if dvp := nic.Spec.DistributedVirtualPort; dvp != nil { + dn, ok := dnets[dvp.PortgroupKey] + + if !ok { + dn = new(dnet) + o := object.NewDistributedVirtualPortgroup(host.Client(), types.ManagedObjectReference{ + Type: "DistributedVirtualPortgroup", + Value: dvp.PortgroupKey, + }) + + err = o.Properties(ctx, o.Reference(), []string{"name", "config.distributedVirtualSwitch"}, &dn.dvp) + if err != nil { + return err + } + + err = o.Properties(ctx, *dn.dvp.Config.DistributedVirtualSwitch, []string{"name"}, &dn.dvs) + if err != nil { + return err + } + + dnets[dvp.PortgroupKey] = dn + } + + fmt.Fprintf(tw, "Network label:\t%s\n", dn.dvp.Name) + fmt.Fprintf(tw, "Switch:\t%s\n", dn.dvs.Name) + } else { + fmt.Fprintf(tw, "Network label:\t%s\n", nic.Portgroup) + for _, pg := range mns.NetworkInfo.Portgroup { + if pg.Spec.Name == nic.Portgroup { + fmt.Fprintf(tw, "Switch:\t%s\n", pg.Spec.VswitchName) + break + } + } + } + + fmt.Fprintf(tw, "IP address:\t%s\n", nic.Spec.Ip.IpAddress) + fmt.Fprintf(tw, "TCP/IP stack:\t%s\n", nic.Spec.NetStackInstanceKey) + + var services []string + for _, nc := range info.NetConfig { + for _, dev := range nc.SelectedVnic { + key := nc.NicType + "." + nic.Key + if dev == key { + services = append(services, nc.NicType) + } + } + + } + fmt.Fprintf(tw, "Enabled services:\t%s\n", strings.Join(services, ", ")) + } + + return tw.Flush() +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/host/vnic/service.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/host/vnic/service.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/host/vnic/service.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/host/vnic/service.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,112 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package vnic + +import ( + "flag" + "fmt" + "strings" + + "github.com/vmware/govmomi/govc/cli" + "github.com/vmware/govmomi/govc/flags" + "github.com/vmware/govmomi/vim25/types" + "golang.org/x/net/context" +) + +type service struct { + *flags.HostSystemFlag + + Enable bool + Disable bool +} + +func init() { + cli.Register("host.vnic.service", &service{}) +} + +func (cmd *service) Register(ctx context.Context, f *flag.FlagSet) { + cmd.HostSystemFlag, ctx = flags.NewHostSystemFlag(ctx) + cmd.HostSystemFlag.Register(ctx, f) + + f.BoolVar(&cmd.Enable, "enable", false, "Enable service") + f.BoolVar(&cmd.Disable, "disable", false, "Disable service") +} + +func (cmd *service) Process(ctx context.Context) error { + if err := cmd.HostSystemFlag.Process(ctx); err != nil { + return err + } + // Either may be true or none may be true. + if cmd.Enable && cmd.Disable { + return flag.ErrHelp + } + + return nil +} + +func (cmd *service) Usage() string { + return "SERVICE DEVICE" +} + +func (cmd *service) Description() string { + nicTypes := []string{ + string(types.HostVirtualNicManagerNicTypeVmotion), + string(types.HostVirtualNicManagerNicTypeFaultToleranceLogging), + string(types.HostVirtualNicManagerNicTypeVSphereReplication), + string(types.HostVirtualNicManagerNicTypeVSphereReplicationNFC), + string(types.HostVirtualNicManagerNicTypeManagement), + string(types.HostVirtualNicManagerNicTypeVsan), + string(types.HostVirtualNicManagerNicTypeVSphereProvisioning), + } + + return fmt.Sprintf(` +Enable or disable service on a virtual nic device. Example: +SERVICE [%s] DEVICE [%s]`, strings.Join(nicTypes, "|"), strings.Join([]string{"vmk0", "vmk1", "..."}, "|")) +} + +func (cmd *service) Run(ctx context.Context, f *flag.FlagSet) error { + if f.NArg() != 2 { + return flag.ErrHelp + } + + service := f.Arg(0) + device := f.Arg(1) + + host, err := cmd.HostSystem() + if err != nil { + return err + } + + m, err := host.ConfigManager().VirtualNicManager(ctx) + if err != nil { + return err + } + + var method func(context.Context, string, string) error + + if cmd.Enable { + method = m.SelectVnic + } else if cmd.Disable { + method = m.DeselectVnic + } + + if method == nil { + return flag.ErrHelp + } + + return method(ctx, service, device) +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/host/vswitch/add.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/host/vswitch/add.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/host/vswitch/add.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/host/vswitch/add.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,73 @@ +/* +Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package vswitch + +import ( + "flag" + + "github.com/vmware/govmomi/govc/cli" + "github.com/vmware/govmomi/govc/flags" + "github.com/vmware/govmomi/vim25/types" + "golang.org/x/net/context" +) + +type add struct { + *flags.HostSystemFlag + + nic string + spec types.HostVirtualSwitchSpec +} + +func init() { + cli.Register("host.vswitch.add", &add{}) +} + +func (cmd *add) Register(ctx context.Context, f *flag.FlagSet) { + cmd.HostSystemFlag, ctx = flags.NewHostSystemFlag(ctx) + cmd.HostSystemFlag.Register(ctx, f) + + cmd.spec.NumPorts = 128 // default + f.Var(flags.NewInt32(&cmd.spec.NumPorts), "ports", "Number of ports") + f.Var(flags.NewInt32(&cmd.spec.Mtu), "mtu", "MTU") + f.StringVar(&cmd.nic, "nic", "", "Bridge nic device") +} + +func (cmd *add) Process(ctx context.Context) error { + if err := cmd.HostSystemFlag.Process(ctx); err != nil { + return err + } + return nil +} + +func (cmd *add) Usage() string { + return "NAME" +} + +func (cmd *add) Run(ctx context.Context, f *flag.FlagSet) error { + ns, err := cmd.HostNetworkSystem() + if err != nil { + return err + } + + if cmd.nic != "" { + cmd.spec.Bridge = &types.HostVirtualSwitchBondBridge{ + NicDevice: []string{cmd.nic}, + } + } + + return ns.AddVirtualSwitch(context.TODO(), f.Arg(0), &cmd.spec) +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/host/vswitch/info.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/host/vswitch/info.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/host/vswitch/info.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/host/vswitch/info.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,106 @@ +/* +Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package vswitch + +import ( + "flag" + "fmt" + "os" + "strings" + "text/tabwriter" + + "github.com/vmware/govmomi/govc/cli" + "github.com/vmware/govmomi/govc/flags" + "github.com/vmware/govmomi/property" + "github.com/vmware/govmomi/vim25/mo" + "golang.org/x/net/context" +) + +type info struct { + *flags.ClientFlag + *flags.OutputFlag + *flags.HostSystemFlag +} + +func init() { + cli.Register("host.vswitch.info", &info{}) +} + +func (cmd *info) Register(ctx context.Context, f *flag.FlagSet) { + cmd.ClientFlag, ctx = flags.NewClientFlag(ctx) + cmd.ClientFlag.Register(ctx, f) + cmd.OutputFlag, ctx = flags.NewOutputFlag(ctx) + cmd.OutputFlag.Register(ctx, f) + cmd.HostSystemFlag, ctx = flags.NewHostSystemFlag(ctx) + cmd.HostSystemFlag.Register(ctx, f) +} + +func (cmd *info) Process(ctx context.Context) error { + if err := cmd.ClientFlag.Process(ctx); err != nil { + return err + } + if err := cmd.OutputFlag.Process(ctx); err != nil { + return err + } + if err := cmd.HostSystemFlag.Process(ctx); err != nil { + return err + } + return nil +} + +func (cmd *info) Run(ctx context.Context, f *flag.FlagSet) error { + client, err := cmd.Client() + if err != nil { + return err + } + + ns, err := cmd.HostNetworkSystem() + if err != nil { + return err + } + + var mns mo.HostNetworkSystem + + pc := property.DefaultCollector(client) + err = pc.RetrieveOne(context.TODO(), ns.Reference(), []string{"networkInfo.vswitch"}, &mns) + if err != nil { + return err + } + + tw := tabwriter.NewWriter(os.Stdout, 2, 0, 2, ' ', 0) + + for i, s := range mns.NetworkInfo.Vswitch { + if i > 0 { + fmt.Fprintln(tw) + } + fmt.Fprintf(tw, "Name:\t%s\n", s.Name) + fmt.Fprintf(tw, "Portgroup:\t%s\n", cmd.keys("key-vim.host.PortGroup-", s.Portgroup)) + fmt.Fprintf(tw, "Pnic:\t%s\n", cmd.keys("key-vim.host.PhysicalNic-", s.Pnic)) + fmt.Fprintf(tw, "MTU:\t%d\n", s.Mtu) + fmt.Fprintf(tw, "Ports:\t%d\n", s.NumPorts) + fmt.Fprintf(tw, "Ports Available:\t%d\n", s.NumPortsAvailable) + } + + return tw.Flush() +} + +func (cmd *info) keys(key string, vals []string) string { + for i, val := range vals { + vals[i] = strings.TrimPrefix(val, key) + } + return strings.Join(vals, ", ") +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/host/vswitch/remove.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/host/vswitch/remove.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/host/vswitch/remove.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/host/vswitch/remove.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,58 @@ +/* +Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package vswitch + +import ( + "flag" + + "github.com/vmware/govmomi/govc/cli" + "github.com/vmware/govmomi/govc/flags" + "golang.org/x/net/context" +) + +type remove struct { + *flags.HostSystemFlag +} + +func init() { + cli.Register("host.vswitch.remove", &remove{}) +} + +func (cmd *remove) Register(ctx context.Context, f *flag.FlagSet) { + cmd.HostSystemFlag, ctx = flags.NewHostSystemFlag(ctx) + cmd.HostSystemFlag.Register(ctx, f) +} + +func (cmd *remove) Process(ctx context.Context) error { + if err := cmd.HostSystemFlag.Process(ctx); err != nil { + return err + } + return nil +} + +func (cmd *remove) Usage() string { + return "NAME" +} + +func (cmd *remove) Run(ctx context.Context, f *flag.FlagSet) error { + ns, err := cmd.HostNetworkSystem() + if err != nil { + return err + } + + return ns.RemoveVirtualSwitch(context.TODO(), f.Arg(0)) +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/importx/archive.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/importx/archive.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/importx/archive.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/importx/archive.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,150 @@ +/* +Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package importx + +import ( + "archive/tar" + "flag" + "fmt" + "io" + "io/ioutil" + "os" + "path" + "path/filepath" + + "golang.org/x/net/context" + + "github.com/vmware/govmomi/ovf" +) + +// ArchiveFlag doesn't register any flags; +// only encapsulates some common archive related functionality. +type ArchiveFlag struct { + Archive +} + +func newArchiveFlag(ctx context.Context) (*ArchiveFlag, context.Context) { + return &ArchiveFlag{}, ctx +} + +func (f *ArchiveFlag) Register(ctx context.Context, fs *flag.FlagSet) { +} + +func (f *ArchiveFlag) Process(ctx context.Context) error { + return nil +} + +func (f *ArchiveFlag) ReadOvf(fpath string) ([]byte, error) { + r, _, err := f.Archive.Open(fpath) + if err != nil { + return nil, err + } + defer r.Close() + + return ioutil.ReadAll(r) +} + +func (f *ArchiveFlag) ReadEnvelope(fpath string) (*ovf.Envelope, error) { + if fpath == "" { + return nil, nil + } + + r, _, err := f.Open(fpath) + if err != nil { + return nil, err + } + defer r.Close() + + e, err := ovf.Unmarshal(r) + if err != nil { + return nil, fmt.Errorf("failed to parse ovf: %s", err.Error()) + } + + return e, nil +} + +type Archive interface { + Open(string) (io.ReadCloser, int64, error) +} + +type TapeArchive struct { + path string +} + +type TapeArchiveEntry struct { + io.Reader + f *os.File +} + +func (t *TapeArchiveEntry) Close() error { + return t.f.Close() +} + +func (t *TapeArchive) Open(name string) (io.ReadCloser, int64, error) { + f, err := os.Open(t.path) + if err != nil { + return nil, 0, err + } + + r := tar.NewReader(f) + + for { + h, err := r.Next() + if err == io.EOF { + break + } + if err != nil { + return nil, 0, err + } + + matched, err := filepath.Match(name, path.Base(h.Name)) + if err != nil { + return nil, 0, err + } + + if matched { + return &TapeArchiveEntry{r, f}, h.Size, nil + } + } + + _ = f.Close() + + return nil, 0, os.ErrNotExist +} + +type FileArchive struct { + path string +} + +func (t *FileArchive) Open(name string) (io.ReadCloser, int64, error) { + fpath := name + if name != t.path { + fpath = filepath.Join(filepath.Dir(t.path), name) + } + + s, err := os.Stat(fpath) + if err != nil { + return nil, 0, err + } + + f, err := os.Open(fpath) + if err != nil { + return nil, 0, err + } + + return f, s.Size(), nil +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/importx/folder.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/importx/folder.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/importx/folder.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/importx/folder.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,91 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package importx + +import ( + "errors" + "flag" + + "golang.org/x/net/context" + + "github.com/vmware/govmomi/govc/flags" + "github.com/vmware/govmomi/object" +) + +type FolderFlag struct { + *flags.DatacenterFlag + + folder string +} + +func newFolderFlag(ctx context.Context) (*FolderFlag, context.Context) { + f := &FolderFlag{} + f.DatacenterFlag, ctx = flags.NewDatacenterFlag(ctx) + return f, ctx +} + +func (flag *FolderFlag) Register(ctx context.Context, f *flag.FlagSet) { + flag.DatacenterFlag.Register(ctx, f) + + f.StringVar(&flag.folder, "folder", "", "Path to folder to add the VM to") +} + +func (flag *FolderFlag) Process(ctx context.Context) error { + return flag.DatacenterFlag.Process(ctx) +} + +func (flag *FolderFlag) Folder() (*object.Folder, error) { + if len(flag.folder) == 0 { + dc, err := flag.Datacenter() + if err != nil { + return nil, err + } + folders, err := dc.Folders(context.TODO()) + if err != nil { + return nil, err + } + return folders.VmFolder, nil + } + + finder, err := flag.Finder() + if err != nil { + return nil, err + } + + mo, err := finder.ManagedObjectList(context.TODO(), flag.folder) + if err != nil { + return nil, err + } + if len(mo) == 0 { + return nil, errors.New("folder argument does not resolve to object") + } + if len(mo) > 1 { + return nil, errors.New("folder argument resolves to more than one object") + } + + ref := mo[0].Object.Reference() + if ref.Type != "Folder" { + return nil, errors.New("folder argument does not resolve to folder") + } + + c, err := flag.Client() + if err != nil { + return nil, err + } + + return object.NewFolder(c, ref), nil +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/importx/importable.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/importx/importable.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/importx/importable.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/importx/importable.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,59 @@ +/* +Copyright (c) 2014 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package importx + +import ( + "fmt" + "path" +) + +type importable struct { + localPath string + remotePath string +} + +func (i importable) Ext() string { + return path.Ext(i.localPath) +} + +func (i importable) Base() string { + return path.Base(i.localPath) +} + +func (i importable) BaseClean() string { + b := i.Base() + e := i.Ext() + return b[:len(b)-len(e)] +} + +func (i importable) RemoteSrcVMDK() string { + file := fmt.Sprintf("%s-src.vmdk", i.BaseClean()) + return i.toRemotePath(file) +} + +func (i importable) RemoteDstVMDK() string { + file := fmt.Sprintf("%s.vmdk", i.BaseClean()) + return i.toRemotePath(file) +} + +func (i importable) toRemotePath(p string) string { + if i.remotePath == "" { + return p + } + + return path.Join(i.remotePath, p) +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/importx/lease_updater.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/importx/lease_updater.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/importx/lease_updater.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/importx/lease_updater.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,131 @@ +/* +Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package importx + +import ( + "fmt" + "net/url" + "sync" + "sync/atomic" + "time" + + "github.com/vmware/govmomi/object" + "github.com/vmware/govmomi/vim25" + "github.com/vmware/govmomi/vim25/progress" + "github.com/vmware/govmomi/vim25/types" + "golang.org/x/net/context" +) + +type ovfFileItem struct { + url *url.URL + item types.OvfFileItem + ch chan progress.Report +} + +func (o ovfFileItem) Sink() chan<- progress.Report { + return o.ch +} + +type leaseUpdater struct { + client *vim25.Client + lease *object.HttpNfcLease + + pos int64 // Number of bytes + total int64 // Total number of bytes + + done chan struct{} // When lease updater should stop + + wg sync.WaitGroup // Track when update loop is done +} + +func newLeaseUpdater(client *vim25.Client, lease *object.HttpNfcLease, items []ovfFileItem) *leaseUpdater { + l := leaseUpdater{ + client: client, + lease: lease, + + done: make(chan struct{}), + } + + for _, item := range items { + l.total += item.item.Size + go l.waitForProgress(item) + } + + // Kickstart update loop + l.wg.Add(1) + go l.run() + + return &l +} + +func (l *leaseUpdater) waitForProgress(item ovfFileItem) { + var pos, total int64 + + total = item.item.Size + + for { + select { + case <-l.done: + return + case p, ok := <-item.ch: + // Return in case of error + if ok && p.Error() != nil { + return + } + + if !ok { + // Last element on the channel, add to total + atomic.AddInt64(&l.pos, total-pos) + return + } + + // Approximate progress in number of bytes + x := int64(float32(total) * (p.Percentage() / 100.0)) + atomic.AddInt64(&l.pos, x-pos) + pos = x + } + } +} + +func (l *leaseUpdater) run() { + defer l.wg.Done() + + tick := time.NewTicker(2 * time.Second) + defer tick.Stop() + + for { + select { + case <-l.done: + return + case <-tick.C: + // From the vim api HttpNfcLeaseProgress(percent) doc, percent == + // "Completion status represented as an integer in the 0-100 range." + // Always report the current value of percent, as it will renew the + // lease even if the value hasn't changed or is 0. + percent := int32(float32(100*atomic.LoadInt64(&l.pos)) / float32(l.total)) + err := l.lease.HttpNfcLeaseProgress(context.TODO(), percent) + if err != nil { + fmt.Printf("from lease updater: %s\n", err) + } + } + } +} + +func (l *leaseUpdater) Done() { + close(l.done) + l.wg.Wait() +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/importx/options.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/importx/options.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/importx/options.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/importx/options.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,84 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package importx + +import ( + "encoding/json" + "flag" + "os" + + "golang.org/x/net/context" + + "github.com/vmware/govmomi/ovf" + "github.com/vmware/govmomi/vim25/types" +) + +type Property struct { + types.KeyValue + Spec *ovf.Property `json:",omitempty"` +} + +type Options struct { + AllDeploymentOptions []string `json:",omitempty"` + Deployment string + + AllDiskProvisioningOptions []string `json:",omitempty"` + DiskProvisioning string + + AllIPAllocationPolicyOptions []string `json:",omitempty"` + IPAllocationPolicy string + + AllIPProtocolOptions []string `json:",omitempty"` + IPProtocol string + + PropertyMapping []Property `json:",omitempty"` + + PowerOn bool + InjectOvfEnv bool + WaitForIP bool + Name *string +} + +type OptionsFlag struct { + Options Options + + path string +} + +func newOptionsFlag(ctx context.Context) (*OptionsFlag, context.Context) { + return &OptionsFlag{}, ctx +} + +func (flag *OptionsFlag) Register(ctx context.Context, f *flag.FlagSet) { + f.StringVar(&flag.path, "options", "", "Options spec file path for VM deployment") +} + +func (flag *OptionsFlag) Process(ctx context.Context) error { + if len(flag.path) > 0 { + f, err := os.Open(flag.path) + if err != nil { + return err + } + defer f.Close() + + if err := json.NewDecoder(f).Decode(&flag.Options); err != nil { + return err + } + } + + return nil +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/importx/ova.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/importx/ova.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/importx/ova.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/importx/ova.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,61 @@ +/* +Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package importx + +import ( + "flag" + + "golang.org/x/net/context" + + "github.com/vmware/govmomi/govc/cli" + "github.com/vmware/govmomi/object" + "github.com/vmware/govmomi/vim25/types" +) + +type ova struct { + *ovfx +} + +func init() { + cli.Register("import.ova", &ova{&ovfx{}}) +} + +func (cmd *ova) Usage() string { + return "PATH_TO_OVA" +} + +func (cmd *ova) Run(ctx context.Context, f *flag.FlagSet) error { + fpath, err := cmd.Prepare(f) + if err != nil { + return err + } + + cmd.Archive = &TapeArchive{fpath} + + moref, err := cmd.Import(fpath) + if err != nil { + return err + } + + vm := object.NewVirtualMachine(cmd.Client, *moref) + return cmd.Deploy(vm) +} + +func (cmd *ova) Import(fpath string) (*types.ManagedObjectReference, error) { + ovf := "*.ovf" + return cmd.ovfx.Import(ovf) +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/importx/ovf.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/importx/ovf.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/importx/ovf.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/importx/ovf.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,405 @@ +/* +Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package importx + +import ( + "errors" + "flag" + "fmt" + "path" + "strings" + + "github.com/vmware/govmomi/govc/cli" + "github.com/vmware/govmomi/govc/flags" + "github.com/vmware/govmomi/object" + "github.com/vmware/govmomi/ovf" + "github.com/vmware/govmomi/vim25" + "github.com/vmware/govmomi/vim25/progress" + "github.com/vmware/govmomi/vim25/soap" + "github.com/vmware/govmomi/vim25/types" + "golang.org/x/net/context" +) + +type ovfx struct { + *flags.DatastoreFlag + *flags.HostSystemFlag + *flags.OutputFlag + *flags.ResourcePoolFlag + + *ArchiveFlag + *OptionsFlag + *FolderFlag + + Name string + + Client *vim25.Client + Datacenter *object.Datacenter + Datastore *object.Datastore + ResourcePool *object.ResourcePool +} + +func init() { + cli.Register("import.ovf", &ovfx{}) +} + +func (cmd *ovfx) Register(ctx context.Context, f *flag.FlagSet) { + cmd.DatastoreFlag, ctx = flags.NewDatastoreFlag(ctx) + cmd.DatastoreFlag.Register(ctx, f) + cmd.HostSystemFlag, ctx = flags.NewHostSystemFlag(ctx) + cmd.HostSystemFlag.Register(ctx, f) + cmd.OutputFlag, ctx = flags.NewOutputFlag(ctx) + cmd.OutputFlag.Register(ctx, f) + cmd.ResourcePoolFlag, ctx = flags.NewResourcePoolFlag(ctx) + cmd.ResourcePoolFlag.Register(ctx, f) + + cmd.ArchiveFlag, ctx = newArchiveFlag(ctx) + cmd.ArchiveFlag.Register(ctx, f) + cmd.OptionsFlag, ctx = newOptionsFlag(ctx) + cmd.OptionsFlag.Register(ctx, f) + cmd.FolderFlag, ctx = newFolderFlag(ctx) + cmd.FolderFlag.Register(ctx, f) + + f.StringVar(&cmd.Name, "name", "", "Name to use for new entity") +} + +func (cmd *ovfx) Process(ctx context.Context) error { + if err := cmd.DatastoreFlag.Process(ctx); err != nil { + return err + } + if err := cmd.HostSystemFlag.Process(ctx); err != nil { + return err + } + if err := cmd.OutputFlag.Process(ctx); err != nil { + return err + } + if err := cmd.ResourcePoolFlag.Process(ctx); err != nil { + return err + } + if err := cmd.ArchiveFlag.Process(ctx); err != nil { + return err + } + if err := cmd.OptionsFlag.Process(ctx); err != nil { + return err + } + if err := cmd.FolderFlag.Process(ctx); err != nil { + return err + } + return nil +} + +func (cmd *ovfx) Usage() string { + return "PATH_TO_OVF" +} + +func (cmd *ovfx) Run(ctx context.Context, f *flag.FlagSet) error { + fpath, err := cmd.Prepare(f) + if err != nil { + return err + } + + cmd.Archive = &FileArchive{fpath} + + moref, err := cmd.Import(fpath) + if err != nil { + return err + } + + vm := object.NewVirtualMachine(cmd.Client, *moref) + return cmd.Deploy(vm) +} + +func (cmd *ovfx) Prepare(f *flag.FlagSet) (string, error) { + var err error + + args := f.Args() + if len(args) != 1 { + return "", errors.New("no file specified") + } + + cmd.Client, err = cmd.DatastoreFlag.Client() + if err != nil { + return "", err + } + + cmd.Datacenter, err = cmd.DatastoreFlag.Datacenter() + if err != nil { + return "", err + } + + cmd.Datastore, err = cmd.DatastoreFlag.Datastore() + if err != nil { + return "", err + } + + cmd.ResourcePool, err = cmd.ResourcePoolFlag.ResourcePool() + if err != nil { + return "", err + } + + return f.Arg(0), nil +} + +func (cmd *ovfx) Deploy(vm *object.VirtualMachine) error { + if err := cmd.PowerOn(vm); err != nil { + return err + } + + if err := cmd.InjectOvfEnv(vm); err != nil { + return err + } + + if err := cmd.WaitForIP(vm); err != nil { + return err + } + + return nil +} + +func (cmd *ovfx) Map(op []Property) (p []types.KeyValue) { + for _, v := range op { + p = append(p, v.KeyValue) + } + + return +} + +func (cmd *ovfx) Import(fpath string) (*types.ManagedObjectReference, error) { + o, err := cmd.ReadOvf(fpath) + if err != nil { + return nil, err + } + + e, err := cmd.ReadEnvelope(fpath) + if err != nil { + return nil, fmt.Errorf("failed to parse ovf: %s", err.Error()) + } + + name := "Govc Virtual Appliance" + if e.VirtualSystem != nil { + name = e.VirtualSystem.ID + if e.VirtualSystem.Name != nil { + name = *e.VirtualSystem.Name + } + } + + // Override name from options if specified + if cmd.Options.Name != nil { + name = *cmd.Options.Name + } + + // Override name from arguments if specified + if cmd.Name != "" { + name = cmd.Name + } + + cisp := types.OvfCreateImportSpecParams{ + DiskProvisioning: cmd.Options.DiskProvisioning, + EntityName: name, + IpAllocationPolicy: cmd.Options.IPAllocationPolicy, + IpProtocol: cmd.Options.IPProtocol, + OvfManagerCommonParams: types.OvfManagerCommonParams{ + DeploymentOption: cmd.Options.Deployment, + Locale: "US"}, + PropertyMapping: cmd.Map(cmd.Options.PropertyMapping), + } + + m := object.NewOvfManager(cmd.Client) + spec, err := m.CreateImportSpec(context.TODO(), string(o), cmd.ResourcePool, cmd.Datastore, cisp) + if err != nil { + return nil, err + } + if spec.Error != nil { + return nil, errors.New(spec.Error[0].LocalizedMessage) + } + if spec.Warning != nil { + for _, w := range spec.Warning { + _, _ = cmd.Log(fmt.Sprintf("Warning: %s\n", w.LocalizedMessage)) + } + } + + var host *object.HostSystem + if cmd.SearchFlag.IsSet() { + if host, err = cmd.HostSystem(); err != nil { + return nil, err + } + } + + folder, err := cmd.Folder() + if err != nil { + return nil, err + } + + lease, err := cmd.ResourcePool.ImportVApp(context.TODO(), spec.ImportSpec, folder, host) + if err != nil { + return nil, err + } + + info, err := lease.Wait(context.TODO()) + if err != nil { + return nil, err + } + + // Build slice of items and URLs first, so that the lease updater can know + // about every item that needs to be uploaded, and thereby infer progress. + var items []ovfFileItem + + for _, device := range info.DeviceUrl { + for _, item := range spec.FileItem { + if device.ImportKey != item.DeviceId { + continue + } + + u, err := cmd.Client.ParseURL(device.Url) + if err != nil { + return nil, err + } + + i := ovfFileItem{ + url: u, + item: item, + ch: make(chan progress.Report), + } + + items = append(items, i) + } + } + + u := newLeaseUpdater(cmd.Client, lease, items) + defer u.Done() + + for _, i := range items { + err = cmd.Upload(lease, i) + if err != nil { + return nil, err + } + } + + return &info.Entity, lease.HttpNfcLeaseComplete(context.TODO()) +} + +func (cmd *ovfx) Upload(lease *object.HttpNfcLease, ofi ovfFileItem) error { + item := ofi.item + file := item.Path + + f, size, err := cmd.Open(file) + if err != nil { + return err + } + defer f.Close() + + logger := cmd.ProgressLogger(fmt.Sprintf("Uploading %s... ", path.Base(file))) + defer logger.Wait() + + opts := soap.Upload{ + ContentLength: size, + Progress: progress.Tee(ofi, logger), + } + + // Non-disk files (such as .iso) use the PUT method. + // Overwrite: t header is also required in this case (ovftool does the same) + if item.Create { + opts.Method = "PUT" + opts.Headers = map[string]string{ + "Overwrite": "t", + } + } else { + opts.Method = "POST" + opts.Type = "application/x-vnd.vmware-streamVmdk" + } + + return cmd.Client.Client.Upload(f, ofi.url, &opts) +} + +func (cmd *ovfx) PowerOn(vm *object.VirtualMachine) error { + if !cmd.Options.PowerOn { + return nil + } + + cmd.Log("Powering on VM...\n") + + task, err := vm.PowerOn(context.TODO()) + if err != nil { + return err + } + + if _, err = task.WaitForResult(context.TODO(), nil); err != nil { + return err + } + + return nil +} + +func (cmd *ovfx) InjectOvfEnv(vm *object.VirtualMachine) error { + if !cmd.Options.PowerOn || !cmd.Options.InjectOvfEnv { + return nil + } + + a := cmd.Client.ServiceContent.About + if strings.EqualFold(a.ProductLineId, "esx") || strings.EqualFold(a.ProductLineId, "embeddedEsx") || strings.EqualFold(a.ProductLineId, "vpx") { + cmd.Log("Injecting OVF environment...\n") + + // build up Environment in order to marshal to xml + var epa []ovf.EnvProperty + for _, p := range cmd.Options.PropertyMapping { + epa = append(epa, ovf.EnvProperty{ + Key: p.Key, + Value: p.Value}) + } + env := ovf.Env{ + EsxID: vm.Reference().Value, + Platform: &ovf.PlatformSection{ + Kind: a.Name, + Version: a.Version, + Vendor: a.Vendor, + Locale: "US", + }, + Property: &ovf.PropertySection{ + Properties: epa}, + } + + xenv := env.MarshalManual() + vmConfigSpec := types.VirtualMachineConfigSpec{ + ExtraConfig: []types.BaseOptionValue{&types.OptionValue{ + Key: "guestinfo.ovfEnv", + Value: xenv}}} + + task, err := vm.Reconfigure(context.TODO(), vmConfigSpec) + if err != nil { + return err + } + if err := task.Wait(context.TODO()); err != nil { + return err + } + } + + return nil +} + +func (cmd *ovfx) WaitForIP(vm *object.VirtualMachine) error { + if !cmd.Options.PowerOn || !cmd.Options.WaitForIP { + return nil + } + + cmd.Log("Waiting for IP address...\n") + ip, err := vm.WaitForIP(context.TODO()) + if err != nil { + return err + } + + cmd.Log(fmt.Sprintf("Received IP address: %s\n", ip)) + return nil +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/importx/spec.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/importx/spec.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/importx/spec.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/importx/spec.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,172 @@ +/* +Copyright (c) 2015-2016 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package importx + +import ( + "encoding/json" + "flag" + "fmt" + "path" + + "golang.org/x/net/context" + + "github.com/vmware/govmomi/govc/cli" + "github.com/vmware/govmomi/ovf" + "github.com/vmware/govmomi/vim25/types" +) + +var ( + // all possible ovf property values + // the first element being the default value + allDeploymentOptions = []string{"small", "medium", "large"} + allDiskProvisioningOptions = []string{"thin", "monolithicSparse", "monolithicFlat", "twoGbMaxExtentSparse", "twoGbMaxExtentFlat", "seSparse", "eagerZeroedThick", "thick", "sparse", "flat"} + allIPAllocationPolicyOptions = []string{"dhcpPolicy", "transientPolicy", "fixedPolicy", "fixedAllocatedPolicy"} + allIPProtocolOptions = []string{"IPv4", "IPv6"} +) + +type spec struct { + *ArchiveFlag + + verbose bool +} + +func init() { + cli.Register("import.spec", &spec{}) +} + +func (cmd *spec) Register(ctx context.Context, f *flag.FlagSet) { + cmd.ArchiveFlag, ctx = newArchiveFlag(ctx) + cmd.ArchiveFlag.Register(ctx, f) + + f.BoolVar(&cmd.verbose, "verbose", false, "Verbose spec output") +} + +func (cmd *spec) Process(ctx context.Context) error { + if err := cmd.ArchiveFlag.Process(ctx); err != nil { + return err + } + return nil +} + +func (cmd *spec) Usage() string { + return "PATH_TO_OVF_OR_OVA" +} + +func (cmd *spec) Run(ctx context.Context, f *flag.FlagSet) error { + fpath := "" + args := f.Args() + if len(args) == 1 { + fpath = f.Arg(0) + } + + if len(fpath) > 0 { + switch path.Ext(fpath) { + case ".ovf": + cmd.Archive = &FileArchive{fpath} + case "", ".ova": + cmd.Archive = &TapeArchive{fpath} + fpath = "*.ovf" + default: + return fmt.Errorf("invalid file extension %s", path.Ext(fpath)) + } + } + + return cmd.Spec(fpath) +} + +func (cmd *spec) Map(e *ovf.Envelope) (res []Property) { + if e == nil { + return nil + } + + for _, p := range e.VirtualSystem.Product { + for i, v := range p.Property { + d := "" + if v.Default != nil { + d = *v.Default + } + + // From OVF spec, section 9.5.1: + // key-value-env = [class-value "."] key-value-prod ["." instance-value] + k := v.Key + if p.Class != nil { + k = fmt.Sprintf("%s.%s", *p.Class, k) + } + if p.Instance != nil { + k = fmt.Sprintf("%s.%s", k, *p.Instance) + } + + np := Property{KeyValue: types.KeyValue{Key: k, Value: d}} + if cmd.verbose { + np.Spec = &p.Property[i] + } + + res = append(res, np) + } + } + + return +} + +func (cmd *spec) Spec(fpath string) error { + e, err := cmd.ReadEnvelope(fpath) + if err != nil { + return err + } + + var deploymentOptions = allDeploymentOptions + if e != nil && e.DeploymentOption != nil && e.DeploymentOption.Configuration != nil { + deploymentOptions = nil + + // add default first + for _, c := range e.DeploymentOption.Configuration { + if c.Default != nil && *c.Default { + deploymentOptions = append(deploymentOptions, c.ID) + } + } + + for _, c := range e.DeploymentOption.Configuration { + if c.Default == nil || !*c.Default { + deploymentOptions = append(deploymentOptions, c.ID) + } + } + } + + o := Options{ + Deployment: deploymentOptions[0], + DiskProvisioning: allDiskProvisioningOptions[0], + IPAllocationPolicy: allIPAllocationPolicyOptions[0], + IPProtocol: allIPProtocolOptions[0], + PowerOn: false, + WaitForIP: false, + InjectOvfEnv: false, + PropertyMapping: cmd.Map(e)} + if cmd.verbose { + o.AllDeploymentOptions = deploymentOptions + o.AllDiskProvisioningOptions = allDiskProvisioningOptions + o.AllIPAllocationPolicyOptions = allIPAllocationPolicyOptions + o.AllIPProtocolOptions = allIPProtocolOptions + } + + j, err := json.Marshal(&o) + if err != nil { + return err + } + + fmt.Println(string(j)) + return nil +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/importx/vmdk.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/importx/vmdk.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/importx/vmdk.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/importx/vmdk.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,495 @@ +/* +Copyright (c) 2014-2016 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package importx + +import ( + "errors" + "flag" + "fmt" + "path" + "reflect" + "regexp" + + "github.com/vmware/govmomi/govc/cli" + "github.com/vmware/govmomi/govc/flags" + "github.com/vmware/govmomi/object" + "github.com/vmware/govmomi/property" + "github.com/vmware/govmomi/vim25" + "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/progress" + "github.com/vmware/govmomi/vim25/soap" + "github.com/vmware/govmomi/vim25/types" + "golang.org/x/net/context" +) + +type vmdk struct { + *flags.DatastoreFlag + *flags.ResourcePoolFlag + *flags.OutputFlag + + upload bool + force bool + keep bool + + Client *vim25.Client + Datacenter *object.Datacenter + Datastore *object.Datastore + ResourcePool *object.ResourcePool +} + +func init() { + cli.Register("import.vmdk", &vmdk{}) + cli.Alias("import.vmdk", "datastore.import") +} + +func (cmd *vmdk) Register(ctx context.Context, f *flag.FlagSet) { + cmd.DatastoreFlag, ctx = flags.NewDatastoreFlag(ctx) + cmd.DatastoreFlag.Register(ctx, f) + cmd.ResourcePoolFlag, ctx = flags.NewResourcePoolFlag(ctx) + cmd.ResourcePoolFlag.Register(ctx, f) + cmd.OutputFlag, ctx = flags.NewOutputFlag(ctx) + cmd.OutputFlag.Register(ctx, f) + + f.BoolVar(&cmd.upload, "upload", true, "Upload specified disk") + f.BoolVar(&cmd.force, "force", false, "Overwrite existing disk") + f.BoolVar(&cmd.keep, "keep", false, "Keep uploaded disk after import") +} + +func (cmd *vmdk) Process(ctx context.Context) error { + if err := cmd.DatastoreFlag.Process(ctx); err != nil { + return err + } + if err := cmd.ResourcePoolFlag.Process(ctx); err != nil { + return err + } + if err := cmd.OutputFlag.Process(ctx); err != nil { + return err + } + return nil +} + +func (cmd *vmdk) Usage() string { + return "PATH_TO_VMDK [REMOTE_DIRECTORY]" +} + +func (cmd *vmdk) Run(ctx context.Context, f *flag.FlagSet) error { + var err error + + args := f.Args() + if len(args) < 1 { + return errors.New("no file to import") + } + + file := importable{ + localPath: f.Arg(0), + } + + // Include remote path if specified + if len(args) >= 2 { + file.remotePath = f.Arg(1) + } + + cmd.Client, err = cmd.DatastoreFlag.Client() + if err != nil { + return err + } + + cmd.Datacenter, err = cmd.DatastoreFlag.Datacenter() + if err != nil { + return err + } + + cmd.Datastore, err = cmd.DatastoreFlag.Datastore() + if err != nil { + return err + } + + cmd.ResourcePool, err = cmd.ResourcePoolFlag.ResourcePool() + if err != nil { + return err + } + + err = cmd.PrepareDestination(file) + if err != nil { + return err + } + + if cmd.upload { + err = cmd.Upload(file) + if err != nil { + return err + } + } + + return cmd.Import(file) +} + +// PrepareDestination makes sure that the destination VMDK does not yet exist. +// If the force flag is passed, it removes the existing VMDK. This functions +// exists to give a meaningful error if the remote VMDK already exists. +// +// CopyVirtualDisk can return a " file does not exist" error while in fact +// the source file *does* exist and the *destination* file also exist. +// +func (cmd *vmdk) PrepareDestination(i importable) error { + vmdkPath := i.RemoteDstVMDK() + res, err := cmd.Datastore.Stat(context.TODO(), vmdkPath) + if err != nil { + switch err.(type) { + case object.DatastoreNoSuchDirectoryError: + // The base path doesn't exist. Create it. + dsPath := cmd.Datastore.Path(path.Dir(vmdkPath)) + m := object.NewFileManager(cmd.Client) + return m.MakeDirectory(context.TODO(), dsPath, cmd.Datacenter, true) + case object.DatastoreNoSuchFileError: + // Destination path doesn't exist; all good to continue with import. + return nil + } + + return err + } + + // Check that the returned entry has the right type. + switch res.(type) { + case *types.VmDiskFileInfo: + default: + expected := "VmDiskFileInfo" + actual := reflect.TypeOf(res) + panic(fmt.Sprintf("Expected: %s, actual: %s", expected, actual)) + } + + if !cmd.force { + dsPath := cmd.Datastore.Path(vmdkPath) + err = fmt.Errorf("File %s already exists", dsPath) + return err + } + + // Delete existing disk. + err = cmd.DeleteDisk(vmdkPath) + if err != nil { + return err + } + + return nil +} + +func (cmd *vmdk) Upload(i importable) error { + p := soap.DefaultUpload + if cmd.OutputFlag.TTY { + logger := cmd.ProgressLogger("Uploading... ") + p.Progress = logger + defer logger.Wait() + } + + return cmd.Datastore.UploadFile(context.TODO(), i.localPath, i.RemoteSrcVMDK(), &p) +} + +func (cmd *vmdk) Import(i importable) error { + err := cmd.Copy(i) + if err != nil { + return err + } + + if !cmd.keep { + err = cmd.DeleteDisk(i.RemoteSrcVMDK()) + if err != nil { + return err + } + } + + return nil +} + +func (cmd *vmdk) Copy(i importable) error { + var err error + + logger := cmd.ProgressLogger("Importing... ") + defer logger.Wait() + + agg := progress.NewAggregator(logger) + defer agg.Done() + + switch p := cmd.Client.ServiceContent.About.ApiType; p { + case "HostAgent": + err = cmd.CopyHostAgent(i, agg) + case "VirtualCenter": + err = cmd.CopyVirtualCenter(i, agg) + default: + return fmt.Errorf("unsupported ApiType: %s", p) + } + + return err +} + +func (cmd *vmdk) CopyHostAgent(i importable, s progress.Sinker) error { + spec := &types.VirtualDiskSpec{ + AdapterType: "lsiLogic", + DiskType: "thin", + } + + dc := cmd.Datacenter + src := cmd.Datastore.Path(i.RemoteSrcVMDK()) + dst := cmd.Datastore.Path(i.RemoteDstVMDK()) + vdm := object.NewVirtualDiskManager(cmd.Client) + task, err := vdm.CopyVirtualDisk(context.TODO(), src, dc, dst, dc, spec, false) + if err != nil { + return err + } + + ps := progress.Prefix(s, "copying disk") + _, err = task.WaitForResult(context.TODO(), ps) + if err != nil { + return err + } + + return nil +} + +func (cmd *vmdk) CopyVirtualCenter(i importable, s progress.Sinker) error { + var err error + + srcName := i.BaseClean() + "-srcvm" + dstName := i.BaseClean() + "-dstvm" + + spec := &configSpec{ + Name: srcName, + GuestId: "otherGuest", + Files: &types.VirtualMachineFileInfo{ + VmPathName: fmt.Sprintf("[%s]", cmd.Datastore.Name()), + }, + } + + spec.AddDisk(cmd.Datastore, i.RemoteSrcVMDK()) + + src, err := cmd.CreateVM(spec) + if err != nil { + return err + } + + dst, err := cmd.CloneVM(src, dstName) + if err != nil { + return err + } + + err = cmd.DestroyVM(src) + if err != nil { + return err + } + + vmdk, err := cmd.DetachDisk(dst) + if err != nil { + return err + } + + err = cmd.MoveDisk(vmdk, i.RemoteDstVMDK()) + if err != nil { + return err + } + + err = cmd.DestroyVM(dst) + if err != nil { + return err + } + + return nil +} + +func (cmd *vmdk) MoveDisk(src, dst string) error { + dsSrc := cmd.Datastore.Path(src) + dsDst := cmd.Datastore.Path(dst) + vdm := object.NewVirtualDiskManager(cmd.Client) + task, err := vdm.MoveVirtualDisk(context.TODO(), dsSrc, cmd.Datacenter, dsDst, cmd.Datacenter, true) + if err != nil { + return err + } + + return task.Wait(context.TODO()) +} + +func (cmd *vmdk) DeleteDisk(path string) error { + vdm := object.NewVirtualDiskManager(cmd.Client) + task, err := vdm.DeleteVirtualDisk(context.TODO(), cmd.Datastore.Path(path), cmd.Datacenter) + if err != nil { + return err + } + + return task.Wait(context.TODO()) +} + +func (cmd *vmdk) DetachDisk(vm *object.VirtualMachine) (string, error) { + var mvm mo.VirtualMachine + + pc := property.DefaultCollector(cmd.Client) + err := pc.RetrieveOne(context.TODO(), vm.Reference(), []string{"config.hardware"}, &mvm) + if err != nil { + return "", err + } + + spec := new(configSpec) + dsFile := spec.RemoveDisk(&mvm) + + task, err := vm.Reconfigure(context.TODO(), spec.ToSpec()) + if err != nil { + return "", err + } + + err = task.Wait(context.TODO()) + if err != nil { + return "", err + } + + return dsFile, nil +} + +func (cmd *vmdk) CreateVM(spec *configSpec) (*object.VirtualMachine, error) { + folders, err := cmd.Datacenter.Folders(context.TODO()) + if err != nil { + return nil, err + } + + task, err := folders.VmFolder.CreateVM(context.TODO(), spec.ToSpec(), cmd.ResourcePool, nil) + if err != nil { + return nil, err + } + + info, err := task.WaitForResult(context.TODO(), nil) + if err != nil { + return nil, err + } + + return object.NewVirtualMachine(cmd.Client, info.Result.(types.ManagedObjectReference)), nil +} + +func (cmd *vmdk) CloneVM(vm *object.VirtualMachine, name string) (*object.VirtualMachine, error) { + folders, err := cmd.Datacenter.Folders(context.TODO()) + if err != nil { + return nil, err + } + + spec := types.VirtualMachineCloneSpec{ + Config: &types.VirtualMachineConfigSpec{}, + Location: types.VirtualMachineRelocateSpec{}, + } + + task, err := vm.Clone(context.TODO(), folders.VmFolder, name, spec) + if err != nil { + return nil, err + } + + info, err := task.WaitForResult(context.TODO(), nil) + if err != nil { + return nil, err + } + + return object.NewVirtualMachine(cmd.Client, info.Result.(types.ManagedObjectReference)), nil +} + +func (cmd *vmdk) DestroyVM(vm *object.VirtualMachine) error { + _, err := cmd.DetachDisk(vm) + if err != nil { + return err + } + + task, err := vm.Destroy(context.TODO()) + if err != nil { + return err + } + + err = task.Wait(context.TODO()) + if err != nil { + return err + } + + return nil +} + +type configSpec types.VirtualMachineConfigSpec + +func (c *configSpec) ToSpec() types.VirtualMachineConfigSpec { + return types.VirtualMachineConfigSpec(*c) +} + +func (c *configSpec) AddChange(d types.BaseVirtualDeviceConfigSpec) { + c.DeviceChange = append(c.DeviceChange, d) +} + +func (c *configSpec) AddDisk(ds *object.Datastore, path string) { + var devices object.VirtualDeviceList + + controller, err := devices.CreateSCSIController("") + if err != nil { + panic(err) + } + devices = append(devices, controller) + + disk := devices.CreateDisk(controller.(types.BaseVirtualController), ds.Reference(), ds.Path(path)) + devices = append(devices, disk) + + spec, err := devices.ConfigSpec(types.VirtualDeviceConfigSpecOperationAdd) + if err != nil { + panic(err) + } + + c.DeviceChange = append(c.DeviceChange, spec...) +} + +var dsPathRegexp = regexp.MustCompile(`^\[.*\] (.*)$`) + +func (c *configSpec) RemoveDisk(vm *mo.VirtualMachine) string { + var file string + + for _, d := range vm.Config.Hardware.Device { + switch device := d.(type) { + case *types.VirtualDisk: + if file != "" { + panic("expected VM to have only one disk") + } + + switch backing := device.Backing.(type) { + case *types.VirtualDiskFlatVer1BackingInfo: + file = backing.FileName + case *types.VirtualDiskFlatVer2BackingInfo: + file = backing.FileName + case *types.VirtualDiskSeSparseBackingInfo: + file = backing.FileName + case *types.VirtualDiskSparseVer1BackingInfo: + file = backing.FileName + case *types.VirtualDiskSparseVer2BackingInfo: + file = backing.FileName + default: + name := reflect.TypeOf(device.Backing).String() + panic(fmt.Sprintf("unexpected backing type: %s", name)) + } + + // Remove [datastore] prefix + m := dsPathRegexp.FindStringSubmatch(file) + if len(m) != 2 { + panic(fmt.Sprintf("expected regexp match for %#v", file)) + } + file = m[1] + + removeOp := &types.VirtualDeviceConfigSpec{ + Operation: types.VirtualDeviceConfigSpecOperationRemove, + Device: device, + } + + c.AddChange(removeOp) + } + } + + return file +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/license/add.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/license/add.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/license/add.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/license/add.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,96 @@ +/* +Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package license + +import ( + "flag" + "fmt" + + "github.com/vmware/govmomi/govc/cli" + "github.com/vmware/govmomi/govc/flags" + "github.com/vmware/govmomi/license" + "github.com/vmware/govmomi/vim25/types" + "golang.org/x/net/context" +) + +type add struct { + *flags.ClientFlag + *flags.OutputFlag +} + +func init() { + cli.Register("license.add", &add{}) +} + +func (cmd *add) Register(ctx context.Context, f *flag.FlagSet) { + cmd.ClientFlag, ctx = flags.NewClientFlag(ctx) + cmd.ClientFlag.Register(ctx, f) + + cmd.OutputFlag, ctx = flags.NewOutputFlag(ctx) + cmd.OutputFlag.Register(ctx, f) +} + +func (cmd *add) Process(ctx context.Context) error { + if err := cmd.ClientFlag.Process(ctx); err != nil { + return err + } + if err := cmd.OutputFlag.Process(ctx); err != nil { + return err + } + return nil +} + +func (cmd *add) Usage() string { + return "KEY..." +} + +func (cmd *add) Run(ctx context.Context, f *flag.FlagSet) error { + client, err := cmd.Client() + if err != nil { + return err + } + + m := license.NewManager(client) + + // From the vSphere 5.5 documentation: + // + // To specify the edition type and any optional functions, use + // updateLicense for ESX Server and addLicense follow by + // LicenseAssingmentManager.updateAssignedLicense for VirtualCenter. + // + var addFunc func(ctx context.Context, key string, labels map[string]string) (types.LicenseManagerLicenseInfo, error) + switch t := client.ServiceContent.About.ApiType; t { + case "HostAgent": + addFunc = m.Update + case "VirtualCenter": + addFunc = m.Add + default: + return fmt.Errorf("unsupported ApiType: %s", t) + } + + result := make(licenseOutput, 0) + for _, v := range f.Args() { + license, err := addFunc(context.TODO(), v, nil) + if err != nil { + return err + } + + result = append(result, license) + } + + return cmd.WriteResult(licenseOutput(result)) +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/license/assigned.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/license/assigned.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/license/assigned.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/license/assigned.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,96 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package license + +import ( + "flag" + "fmt" + "io" + "os" + "text/tabwriter" + + "github.com/vmware/govmomi/govc/cli" + "github.com/vmware/govmomi/govc/flags" + "github.com/vmware/govmomi/license" + "github.com/vmware/govmomi/vim25/types" + "golang.org/x/net/context" +) + +type assigned struct { + *flags.ClientFlag + *flags.OutputFlag + + id string +} + +func init() { + cli.Register("license.assigned.list", &assigned{}) +} + +func (cmd *assigned) Register(ctx context.Context, f *flag.FlagSet) { + cmd.ClientFlag, ctx = flags.NewClientFlag(ctx) + cmd.ClientFlag.Register(ctx, f) + + cmd.OutputFlag, ctx = flags.NewOutputFlag(ctx) + cmd.OutputFlag.Register(ctx, f) + + f.StringVar(&cmd.id, "id", "", "Entity ID") +} + +func (cmd *assigned) Process(ctx context.Context) error { + if err := cmd.ClientFlag.Process(ctx); err != nil { + return err + } + if err := cmd.OutputFlag.Process(ctx); err != nil { + return err + } + return nil +} + +func (cmd *assigned) Run(ctx context.Context, f *flag.FlagSet) error { + client, err := cmd.Client() + if err != nil { + return err + } + + m, err := license.NewManager(client).AssignmentManager(context.TODO()) + if err != nil { + return err + } + + assigned, err := m.QueryAssigned(context.TODO(), cmd.id) + if err != nil { + return err + } + + return cmd.WriteResult(assignedOutput(assigned)) +} + +type assignedOutput []types.LicenseAssignmentManagerLicenseAssignment + +func (res assignedOutput) Write(w io.Writer) error { + tw := tabwriter.NewWriter(os.Stdout, 4, 0, 2, ' ', 0) + fmt.Fprintf(tw, "Id:\tScope:\tName:\tLicense:\n") + for _, v := range res { + fmt.Fprintf(tw, "%s\t", v.EntityId) + fmt.Fprintf(tw, "%s\t", v.Scope) + fmt.Fprintf(tw, "%s\t", v.EntityDisplayName) + fmt.Fprintf(tw, "%s\t", v.AssignedLicense.LicenseKey) + fmt.Fprintf(tw, "\n") + } + return tw.Flush() +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/license/assign.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/license/assign.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/license/assign.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/license/assign.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,114 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package license + +import ( + "flag" + + "github.com/vmware/govmomi/govc/cli" + "github.com/vmware/govmomi/govc/flags" + "github.com/vmware/govmomi/license" + "github.com/vmware/govmomi/vim25/types" + "golang.org/x/net/context" +) + +type assign struct { + *flags.ClientFlag + *flags.OutputFlag + *flags.HostSystemFlag + + name string + remove bool +} + +func init() { + cli.Register("license.assign", &assign{}) +} + +func (cmd *assign) Register(ctx context.Context, f *flag.FlagSet) { + cmd.ClientFlag, ctx = flags.NewClientFlag(ctx) + cmd.ClientFlag.Register(ctx, f) + + cmd.OutputFlag, ctx = flags.NewOutputFlag(ctx) + cmd.OutputFlag.Register(ctx, f) + + cmd.HostSystemFlag, ctx = flags.NewHostSystemFlag(ctx) + cmd.HostSystemFlag.Register(ctx, f) + + f.StringVar(&cmd.name, "name", "", "Display name") + f.BoolVar(&cmd.remove, "remove", false, "Remove assignment") +} + +func (cmd *assign) Process(ctx context.Context) error { + if err := cmd.ClientFlag.Process(ctx); err != nil { + return err + } + if err := cmd.OutputFlag.Process(ctx); err != nil { + return err + } + if err := cmd.HostSystemFlag.Process(ctx); err != nil { + return err + } + return nil +} + +func (cmd *assign) Usage() string { + return "KEY" +} + +func (cmd *assign) Run(ctx context.Context, f *flag.FlagSet) error { + if f.NArg() != 1 { + return flag.ErrHelp + } + + key := f.Arg(0) + + client, err := cmd.Client() + if err != nil { + return err + } + + m, err := license.NewManager(client).AssignmentManager(ctx) + if err != nil { + return err + } + + host, err := cmd.HostSystemIfSpecified() + if err != nil { + return err + } + + var id string + + if host == nil { + // Default to vCenter UUID + id = client.ServiceContent.About.InstanceUuid + } else { + id = host.Reference().Value + } + + if cmd.remove { + return m.Remove(ctx, id) + } + + info, err := m.Update(ctx, id, key, cmd.name) + if err != nil { + return err + } + + return cmd.WriteResult(licenseOutput([]types.LicenseManagerLicenseInfo{*info})) +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/license/decode.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/license/decode.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/license/decode.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/license/decode.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,85 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package license + +import ( + "flag" + + "github.com/vmware/govmomi/govc/cli" + "github.com/vmware/govmomi/govc/flags" + "github.com/vmware/govmomi/license" + "golang.org/x/net/context" +) + +type decode struct { + *flags.ClientFlag + *flags.OutputFlag + + feature string +} + +func init() { + cli.Register("license.decode", &decode{}) +} + +func (cmd *decode) Register(ctx context.Context, f *flag.FlagSet) { + cmd.ClientFlag, ctx = flags.NewClientFlag(ctx) + cmd.ClientFlag.Register(ctx, f) + + cmd.OutputFlag, ctx = flags.NewOutputFlag(ctx) + cmd.OutputFlag.Register(ctx, f) + + f.StringVar(&cmd.feature, "feature", "", featureUsage) +} + +func (cmd *decode) Process(ctx context.Context) error { + if err := cmd.ClientFlag.Process(ctx); err != nil { + return err + } + if err := cmd.OutputFlag.Process(ctx); err != nil { + return err + } + return nil +} + +func (cmd *decode) Usage() string { + return "KEY..." +} + +func (cmd *decode) Run(ctx context.Context, f *flag.FlagSet) error { + client, err := cmd.Client() + if err != nil { + return err + } + + var result license.InfoList + m := license.NewManager(client) + for _, v := range f.Args() { + license, err := m.Decode(context.TODO(), v) + if err != nil { + return err + } + + result = append(result, license) + } + + if cmd.feature != "" { + result = result.WithFeature(cmd.feature) + } + + return cmd.WriteResult(licenseOutput(result)) +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/license/list.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/license/list.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/license/list.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/license/list.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,78 @@ +/* +Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package license + +import ( + "flag" + + "github.com/vmware/govmomi/govc/cli" + "github.com/vmware/govmomi/govc/flags" + "github.com/vmware/govmomi/license" + "golang.org/x/net/context" +) + +var featureUsage = "List licenses with given feature" + +type list struct { + *flags.ClientFlag + *flags.OutputFlag + + feature string +} + +func init() { + cli.Register("license.list", &list{}) +} + +func (cmd *list) Register(ctx context.Context, f *flag.FlagSet) { + cmd.ClientFlag, ctx = flags.NewClientFlag(ctx) + cmd.ClientFlag.Register(ctx, f) + + cmd.OutputFlag, ctx = flags.NewOutputFlag(ctx) + cmd.OutputFlag.Register(ctx, f) + + f.StringVar(&cmd.feature, "feature", "", featureUsage) +} + +func (cmd *list) Process(ctx context.Context) error { + if err := cmd.ClientFlag.Process(ctx); err != nil { + return err + } + if err := cmd.OutputFlag.Process(ctx); err != nil { + return err + } + return nil +} + +func (cmd *list) Run(ctx context.Context, f *flag.FlagSet) error { + client, err := cmd.Client() + if err != nil { + return err + } + + m := license.NewManager(client) + result, err := m.List(context.TODO()) + if err != nil { + return err + } + + if cmd.feature != "" { + result = result.WithFeature(cmd.feature) + } + + return cmd.WriteResult(licenseOutput(result)) +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/license/output.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/license/output.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/license/output.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/license/output.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,41 @@ +/* +Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package license + +import ( + "fmt" + "io" + "os" + "text/tabwriter" + + "github.com/vmware/govmomi/vim25/types" +) + +type licenseOutput []types.LicenseManagerLicenseInfo + +func (res licenseOutput) Write(w io.Writer) error { + tw := tabwriter.NewWriter(os.Stdout, 4, 0, 2, ' ', 0) + fmt.Fprintf(tw, "Key:\tEdition:\tUsed:\tTotal:\n") + for _, v := range res { + fmt.Fprintf(tw, "%s\t", v.LicenseKey) + fmt.Fprintf(tw, "%s\t", v.EditionKey) + fmt.Fprintf(tw, "%d\t", v.Used) + fmt.Fprintf(tw, "%d\t", v.Total) + fmt.Fprintf(tw, "\n") + } + return tw.Flush() +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/license/remove.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/license/remove.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/license/remove.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/license/remove.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,74 @@ +/* +Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package license + +import ( + "flag" + + "github.com/vmware/govmomi/govc/cli" + "github.com/vmware/govmomi/govc/flags" + "github.com/vmware/govmomi/license" + "golang.org/x/net/context" +) + +type remove struct { + *flags.ClientFlag + *flags.OutputFlag +} + +func init() { + cli.Register("license.remove", &remove{}) +} + +func (cmd *remove) Register(ctx context.Context, f *flag.FlagSet) { + cmd.ClientFlag, ctx = flags.NewClientFlag(ctx) + cmd.ClientFlag.Register(ctx, f) + + cmd.OutputFlag, ctx = flags.NewOutputFlag(ctx) + cmd.OutputFlag.Register(ctx, f) +} + +func (cmd *remove) Process(ctx context.Context) error { + if err := cmd.ClientFlag.Process(ctx); err != nil { + return err + } + if err := cmd.OutputFlag.Process(ctx); err != nil { + return err + } + return nil +} + +func (cmd *remove) Usage() string { + return "KEY..." +} + +func (cmd *remove) Run(ctx context.Context, f *flag.FlagSet) error { + client, err := cmd.Client() + if err != nil { + return err + } + + m := license.NewManager(client) + for _, v := range f.Args() { + err = m.Remove(context.TODO(), v) + if err != nil { + return err + } + } + + return nil +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/logs/command.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/logs/command.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/logs/command.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/logs/command.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,111 @@ +/* +Copyright (c) 2015-2016 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package logs + +import ( + "flag" + "fmt" + "math" + + "golang.org/x/net/context" + + "github.com/vmware/govmomi/govc/cli" + "github.com/vmware/govmomi/govc/flags" + "github.com/vmware/govmomi/object" +) + +type logs struct { + *flags.HostSystemFlag + + Max int32 + Key string +} + +func init() { + cli.Register("logs", &logs{}) +} + +func (cmd *logs) Register(ctx context.Context, f *flag.FlagSet) { + cmd.HostSystemFlag, ctx = flags.NewHostSystemFlag(ctx) + cmd.HostSystemFlag.Register(ctx, f) + + cmd.Max = 25 // default + f.Var(flags.NewInt32(&cmd.Max), "n", "Output the last N logs") + f.StringVar(&cmd.Key, "log", "", "Log file key") +} + +func (cmd *logs) Process(ctx context.Context) error { + if err := cmd.HostSystemFlag.Process(ctx); err != nil { + return err + } + return nil +} + +func (cmd *logs) Description() string { + return ` +The '-log' option defaults to "hostd" when connected directly to a host or +when connected to VirtualCenter and a '-host' option is given. Otherwise, +the '-log' option defaults to "vpxd:vpxd.log". The '-host' option is ignored +when connected directly to host. +See 'govc logs.ls' for other '-log' options.` +} + +func (cmd *logs) Run(ctx context.Context, f *flag.FlagSet) error { + c, err := cmd.Client() + if err != nil { + return err + } + + defaultKey := "hostd" + var host *object.HostSystem + + if c.IsVC() { + host, err = cmd.HostSystemIfSpecified() + if err != nil { + return err + } + + if host == nil { + defaultKey = "vpxd:vpxd.log" + } + } + + m := object.NewDiagnosticManager(c) + + key := cmd.Key + if key == "" { + key = defaultKey + } + + // get LineEnd without any LineText + h, err := m.BrowseLog(ctx, host, key, math.MaxInt32, 0) + if err != nil { + return err + } + + start := h.LineEnd - cmd.Max + h, err = m.BrowseLog(ctx, host, key, start, 0) + if err != nil { + return err + } + + for _, line := range h.LineText { + fmt.Println(line) + } + + return nil +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/logs/download.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/logs/download.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/logs/download.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/logs/download.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,133 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package logs + +import ( + "flag" + "fmt" + "path" + + "golang.org/x/net/context" + + "github.com/vmware/govmomi/govc/cli" + "github.com/vmware/govmomi/govc/flags" + "github.com/vmware/govmomi/object" + "github.com/vmware/govmomi/vim25" + "github.com/vmware/govmomi/vim25/soap" + "github.com/vmware/govmomi/vim25/types" +) + +type download struct { + *flags.DatacenterFlag + + IncludeDefault bool +} + +func init() { + cli.Register("logs.download", &download{}) +} + +func (cmd *download) Register(ctx context.Context, f *flag.FlagSet) { + cmd.DatacenterFlag, ctx = flags.NewDatacenterFlag(ctx) + cmd.DatacenterFlag.Register(ctx, f) + + f.BoolVar(&cmd.IncludeDefault, "default", true, "Specifies if the bundle should include the default server") +} + +func (cmd *download) Process(ctx context.Context) error { + if err := cmd.DatacenterFlag.Process(ctx); err != nil { + return err + } + return nil +} + +func (cmd *download) Usage() string { + return "[PATH]..." +} + +func (cmd *download) DownloadFile(c *vim25.Client, b string) error { + u, err := c.Client.ParseURL(b) + if err != nil { + return err + } + + dst := path.Base(u.Path) + p := soap.DefaultDownload + if cmd.OutputFlag.TTY { + logger := cmd.ProgressLogger(fmt.Sprintf("Downloading %s... ", dst)) + defer logger.Wait() + p.Progress = logger + } + + return c.Client.DownloadFile(dst, u, &p) +} + +func (cmd *download) GenerateLogBundles(m *object.DiagnosticManager, host []*object.HostSystem) ([]types.DiagnosticManagerBundleInfo, error) { + logger := cmd.ProgressLogger("Generating log bundles... ") + defer logger.Wait() + + task, err := m.GenerateLogBundles(context.TODO(), cmd.IncludeDefault, host) + if err != nil { + return nil, err + } + + r, err := task.WaitForResult(context.TODO(), logger) + if err != nil { + return nil, err + } + + return r.Result.(types.ArrayOfDiagnosticManagerBundleInfo).DiagnosticManagerBundleInfo, nil +} + +func (cmd *download) Run(ctx context.Context, f *flag.FlagSet) error { + finder, err := cmd.Finder() + if err != nil { + return err + } + + var host []*object.HostSystem + + for _, arg := range f.Args() { + hs, err := finder.HostSystemList(context.TODO(), arg) + if err != nil { + return err + } + + host = append(host, hs...) + } + + c, err := cmd.Client() + if err != nil { + return err + } + + m := object.NewDiagnosticManager(c) + + bundles, err := cmd.GenerateLogBundles(m, host) + if err != nil { + return err + } + + for _, bundle := range bundles { + err := cmd.DownloadFile(c, bundle.Url) + if err != nil { + return err + } + } + + return nil +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/logs/ls.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/logs/ls.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/logs/ls.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/logs/ls.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,81 @@ +/* +Copyright (c) 2015-2016 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package logs + +import ( + "flag" + "fmt" + "os" + "text/tabwriter" + + "golang.org/x/net/context" + + "github.com/vmware/govmomi/govc/cli" + "github.com/vmware/govmomi/govc/flags" + "github.com/vmware/govmomi/object" +) + +type ls struct { + *flags.HostSystemFlag +} + +func init() { + cli.Register("logs.ls", &ls{}) +} + +func (cmd *ls) Register(ctx context.Context, f *flag.FlagSet) { + cmd.HostSystemFlag, ctx = flags.NewHostSystemFlag(ctx) + cmd.HostSystemFlag.Register(ctx, f) +} + +func (cmd *ls) Process(ctx context.Context) error { + if err := cmd.HostSystemFlag.Process(ctx); err != nil { + return err + } + return nil +} + +func (cmd *ls) Run(ctx context.Context, f *flag.FlagSet) error { + c, err := cmd.Client() + if err != nil { + return err + } + + var host *object.HostSystem + + if c.IsVC() { + host, err = cmd.HostSystemIfSpecified() + if err != nil { + return err + } + } + + m := object.NewDiagnosticManager(c) + + desc, err := m.QueryDescriptions(ctx, host) + if err != nil { + return err + } + + tw := tabwriter.NewWriter(os.Stdout, 2, 0, 2, ' ', 0) + + for _, d := range desc { + fmt.Fprintf(tw, "%s\t%s\n", d.Key, d.FileName) + } + + return tw.Flush() +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/ls/command.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/ls/command.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/ls/command.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/ls/command.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,155 @@ +/* +Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package ls + +import ( + "flag" + "fmt" + "io" + "strings" + + "github.com/vmware/govmomi/govc/cli" + "github.com/vmware/govmomi/govc/flags" + "github.com/vmware/govmomi/list" + "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/types" + "golang.org/x/net/context" +) + +type ls struct { + *flags.DatacenterFlag + + Long bool + Type string + ToRef bool + DeRef bool +} + +func init() { + cli.Register("ls", &ls{}) +} + +func (cmd *ls) Register(ctx context.Context, f *flag.FlagSet) { + cmd.DatacenterFlag, ctx = flags.NewDatacenterFlag(ctx) + cmd.DatacenterFlag.Register(ctx, f) + + f.BoolVar(&cmd.Long, "l", false, "Long listing format") + f.BoolVar(&cmd.ToRef, "i", false, "Print the managed object reference") + f.BoolVar(&cmd.DeRef, "L", false, "Follow managed object references") + f.StringVar(&cmd.Type, "t", "", "Object type") +} + +func (cmd *ls) Process(ctx context.Context) error { + if err := cmd.DatacenterFlag.Process(ctx); err != nil { + return err + } + return nil +} + +func (cmd *ls) Usage() string { + return "[PATH]..." +} + +func (cmd *ls) typeMatch(ref types.ManagedObjectReference) bool { + if cmd.Type == "" { + return true + } + + return strings.ToLower(cmd.Type) == strings.ToLower(ref.Type) +} + +func (cmd *ls) Run(ctx context.Context, f *flag.FlagSet) error { + finder, err := cmd.Finder() + if err != nil { + return err + } + + lr := listResult{ + ls: cmd, + Elements: nil, + } + + args := f.Args() + if len(args) == 0 { + args = []string{"."} + } + + var ref = new(types.ManagedObjectReference) + + for _, arg := range args { + if cmd.DeRef && ref.FromString(arg) { + e, err := finder.Element(ctx, *ref) + if err == nil { + if cmd.typeMatch(*ref) { + lr.Elements = append(lr.Elements, *e) + } + continue + } + } + + es, err := finder.ManagedObjectListChildren(context.TODO(), arg) + if err != nil { + return err + } + + for _, e := range es { + if cmd.typeMatch(e.Object.Reference()) { + lr.Elements = append(lr.Elements, e) + } + } + } + + return cmd.WriteResult(lr) +} + +type listResult struct { + *ls + Elements []list.Element `json:"elements"` +} + +func (l listResult) Write(w io.Writer) error { + var err error + + for _, e := range l.Elements { + if l.ToRef { + fmt.Fprint(w, e.Object.Reference().String()) + if l.Long { + fmt.Fprintf(w, " %s", e.Path) + } + fmt.Fprintln(w) + continue + } + + if !l.Long { + fmt.Fprintf(w, "%s\n", e.Path) + continue + } + + switch e.Object.(type) { + case mo.Folder: + if _, err = fmt.Fprintf(w, "%s/\n", e.Path); err != nil { + return err + } + default: + if _, err = fmt.Fprintf(w, "%s (%s)\n", e.Path, e.Object.Reference().Type); err != nil { + return err + } + } + } + + return nil +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/main.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/main.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/main.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/main.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,68 @@ +/* +Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package main + +import ( + "os" + + "github.com/vmware/govmomi/govc/cli" + + _ "github.com/vmware/govmomi/govc/about" + _ "github.com/vmware/govmomi/govc/cluster" + _ "github.com/vmware/govmomi/govc/datacenter" + _ "github.com/vmware/govmomi/govc/datastore" + _ "github.com/vmware/govmomi/govc/device" + _ "github.com/vmware/govmomi/govc/device/cdrom" + _ "github.com/vmware/govmomi/govc/device/floppy" + _ "github.com/vmware/govmomi/govc/device/scsi" + _ "github.com/vmware/govmomi/govc/device/serial" + _ "github.com/vmware/govmomi/govc/dvs" + _ "github.com/vmware/govmomi/govc/dvs/portgroup" + _ "github.com/vmware/govmomi/govc/env" + _ "github.com/vmware/govmomi/govc/events" + _ "github.com/vmware/govmomi/govc/extension" + _ "github.com/vmware/govmomi/govc/fields" + _ "github.com/vmware/govmomi/govc/folder" + _ "github.com/vmware/govmomi/govc/host" + _ "github.com/vmware/govmomi/govc/host/account" + _ "github.com/vmware/govmomi/govc/host/autostart" + _ "github.com/vmware/govmomi/govc/host/esxcli" + _ "github.com/vmware/govmomi/govc/host/firewall" + _ "github.com/vmware/govmomi/govc/host/maintenance" + _ "github.com/vmware/govmomi/govc/host/option" + _ "github.com/vmware/govmomi/govc/host/portgroup" + _ "github.com/vmware/govmomi/govc/host/service" + _ "github.com/vmware/govmomi/govc/host/storage" + _ "github.com/vmware/govmomi/govc/host/vnic" + _ "github.com/vmware/govmomi/govc/host/vswitch" + _ "github.com/vmware/govmomi/govc/importx" + _ "github.com/vmware/govmomi/govc/license" + _ "github.com/vmware/govmomi/govc/logs" + _ "github.com/vmware/govmomi/govc/ls" + _ "github.com/vmware/govmomi/govc/permissions" + _ "github.com/vmware/govmomi/govc/pool" + _ "github.com/vmware/govmomi/govc/vapp" + _ "github.com/vmware/govmomi/govc/version" + _ "github.com/vmware/govmomi/govc/vm" + _ "github.com/vmware/govmomi/govc/vm/disk" + _ "github.com/vmware/govmomi/govc/vm/guest" + _ "github.com/vmware/govmomi/govc/vm/network" +) + +func main() { + os.Exit(cli.Run(os.Args[1:])) +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/main_test.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/main_test.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/main_test.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/main_test.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,38 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package main + +import ( + "flag" + "testing" + + "golang.org/x/net/context" + + "github.com/vmware/govmomi/govc/cli" +) + +func TestMain(t *testing.T) { + // Execute flag registration for every command to verify there are no + // commands with flag name collisions + for _, cmd := range cli.Commands() { + fs := flag.NewFlagSet("", flag.ContinueOnError) + + // Use fresh context for every command + ctx, _ := context.WithCancel(context.Background()) + cmd.Register(ctx, fs) + } +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/permissions/ls.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/permissions/ls.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/permissions/ls.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/permissions/ls.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,97 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package cluster + +import ( + "flag" + "fmt" + "os" + "text/tabwriter" + + "github.com/vmware/govmomi/govc/cli" + "github.com/vmware/govmomi/govc/flags" + "github.com/vmware/govmomi/object" + "golang.org/x/net/context" +) + +type ls struct { + *flags.DatacenterFlag + *flags.OutputFlag +} + +func init() { + cli.Register("permissions.ls", &ls{}) +} + +func (cmd *ls) Register(ctx context.Context, f *flag.FlagSet) { + cmd.DatacenterFlag, ctx = flags.NewDatacenterFlag(ctx) + cmd.DatacenterFlag.Register(ctx, f) + + cmd.OutputFlag, ctx = flags.NewOutputFlag(ctx) + cmd.OutputFlag.Register(ctx, f) +} + +func (cmd *ls) Process(ctx context.Context) error { + if err := cmd.DatacenterFlag.Process(ctx); err != nil { + return err + } + if err := cmd.OutputFlag.Process(ctx); err != nil { + return err + } + return nil +} + +func (cmd *ls) Usage() string { + return "[PATH]..." +} + +func (cmd *ls) Description() string { + return `List the permissions defined on or effective on managed entities.` +} + +func (cmd *ls) Run(ctx context.Context, f *flag.FlagSet) error { + c, err := cmd.Client() + if err != nil { + return err + } + + refs, err := cmd.ManagedObjects(ctx, f.Args()) + if err != nil { + return err + } + + m := object.NewAuthorizationManager(c) + rl, err := m.RoleList(ctx) + if err != nil { + return err + } + + tw := tabwriter.NewWriter(os.Stdout, 2, 0, 2, ' ', 0) + + for _, ref := range refs { + perms, err := m.RetrieveEntityPermissions(ctx, ref, true) + if err != nil { + return err + } + + for _, perm := range perms { + fmt.Fprintf(tw, "%s\t%s\n", perm.Principal, rl.ById(perm.RoleId).Name) + } + } + + return tw.Flush() +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/permissions/remove.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/permissions/remove.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/permissions/remove.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/permissions/remove.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,85 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package cluster + +import ( + "flag" + + "github.com/vmware/govmomi/govc/cli" + "github.com/vmware/govmomi/govc/flags" + "github.com/vmware/govmomi/object" + "github.com/vmware/govmomi/vim25/types" + "golang.org/x/net/context" +) + +type remove struct { + *flags.DatacenterFlag + + types.Permission + + role string +} + +func init() { + cli.Register("permissions.remove", &remove{}) +} + +func (cmd *remove) Register(ctx context.Context, f *flag.FlagSet) { + cmd.DatacenterFlag, ctx = flags.NewDatacenterFlag(ctx) + cmd.DatacenterFlag.Register(ctx, f) + + f.StringVar(&cmd.Principal, "principal", "", "User or group for which the permission is defined") + f.BoolVar(&cmd.Group, "group", false, "True, if principal refers to a group name; false, for a user name") +} + +func (cmd *remove) Process(ctx context.Context) error { + if err := cmd.DatacenterFlag.Process(ctx); err != nil { + return err + } + return nil +} + +func (cmd *remove) Usage() string { + return "[PATH]..." +} + +func (cmd *remove) Description() string { + return `Removes a permission rule from managed entities.` +} + +func (cmd *remove) Run(ctx context.Context, f *flag.FlagSet) error { + c, err := cmd.Client() + if err != nil { + return err + } + + refs, err := cmd.ManagedObjects(ctx, f.Args()) + if err != nil { + return err + } + + m := object.NewAuthorizationManager(c) + + for _, ref := range refs { + err = m.RemoveEntityPermission(ctx, ref, cmd.Principal, cmd.Group) + if err != nil { + return err + } + } + + return nil +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/permissions/set.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/permissions/set.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/permissions/set.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/permissions/set.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,103 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package cluster + +import ( + "flag" + "fmt" + + "github.com/vmware/govmomi/govc/cli" + "github.com/vmware/govmomi/govc/flags" + "github.com/vmware/govmomi/object" + "github.com/vmware/govmomi/vim25/types" + "golang.org/x/net/context" +) + +type set struct { + *flags.DatacenterFlag + + types.Permission + + role string +} + +func init() { + cli.Register("permissions.set", &set{}) +} + +func (cmd *set) Register(ctx context.Context, f *flag.FlagSet) { + cmd.DatacenterFlag, ctx = flags.NewDatacenterFlag(ctx) + cmd.DatacenterFlag.Register(ctx, f) + + f.StringVar(&cmd.Principal, "principal", "", "User or group for which the permission is defined") + f.BoolVar(&cmd.Group, "group", false, "True, if principal refers to a group name; false, for a user name") + f.BoolVar(&cmd.Propagate, "propagate", true, "Whether or not this permission propagates down the hierarchy to sub-entities") + f.StringVar(&cmd.role, "role", "Admin", "Permission role name") +} + +func (cmd *set) Process(ctx context.Context) error { + if err := cmd.DatacenterFlag.Process(ctx); err != nil { + return err + } + return nil +} + +func (cmd *set) Usage() string { + return "[PATH]..." +} + +func (cmd *set) Description() string { + return `Set the permissions managed entities. +Example: +govc permissions.set -principal root -role Admin +` +} + +func (cmd *set) Run(ctx context.Context, f *flag.FlagSet) error { + c, err := cmd.Client() + if err != nil { + return err + } + + refs, err := cmd.ManagedObjects(ctx, f.Args()) + if err != nil { + return err + } + + m := object.NewAuthorizationManager(c) + rl, err := m.RoleList(ctx) + if err != nil { + return err + } + + role := rl.ByName(cmd.role) + if role == nil { + return fmt.Errorf("role '%s' not found", cmd.role) + } + cmd.Permission.RoleId = role.RoleId + + perms := []types.Permission{cmd.Permission} + + for _, ref := range refs { + err = m.SetEntityPermissions(ctx, ref, perms) + if err != nil { + return err + } + } + + return nil +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/pool/change.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/pool/change.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/pool/change.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/pool/change.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,98 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package pool + +import ( + "flag" + + "github.com/vmware/govmomi/govc/cli" + "github.com/vmware/govmomi/govc/flags" + "github.com/vmware/govmomi/vim25/types" + "golang.org/x/net/context" +) + +type change struct { + *flags.DatacenterFlag + *ResourceConfigSpecFlag + + name string +} + +func init() { + cli.Register("pool.change", &change{}) +} + +func (cmd *change) Register(ctx context.Context, f *flag.FlagSet) { + cmd.DatacenterFlag, ctx = flags.NewDatacenterFlag(ctx) + cmd.DatacenterFlag.Register(ctx, f) + cmd.ResourceConfigSpecFlag = NewResourceConfigSpecFlag() + cmd.ResourceConfigSpecFlag.Register(ctx, f) + + f.StringVar(&cmd.name, "name", "", "Resource pool name") +} + +func (cmd *change) Process(ctx context.Context) error { + if err := cmd.DatacenterFlag.Process(ctx); err != nil { + return err + } + if err := cmd.ResourceConfigSpecFlag.Process(ctx); err != nil { + return err + } + return nil +} + +func (cmd *change) Usage() string { + return "POOL..." +} + +func (cmd *change) Description() string { + return "Change the configuration of one or more resource POOLs.\n" + poolNameHelp +} + +func (cmd *change) Run(ctx context.Context, f *flag.FlagSet) error { + if f.NArg() == 0 { + return flag.ErrHelp + } + + finder, err := cmd.Finder() + if err != nil { + return err + } + + cmd.SetAllocation(func(a types.BaseResourceAllocationInfo) { + ra := a.GetResourceAllocationInfo() + if ra.Shares.Level == "" { + ra.Shares = nil + } + }) + + for _, arg := range f.Args() { + pools, err := finder.ResourcePoolList(context.TODO(), arg) + if err != nil { + return err + } + + for _, pool := range pools { + err := pool.UpdateConfig(context.TODO(), cmd.name, &cmd.ResourceConfigSpec) + if err != nil { + return err + } + } + } + + return nil +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/pool/create.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/pool/create.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/pool/create.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/pool/create.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,101 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package pool + +import ( + "flag" + "fmt" + "path" + + "github.com/vmware/govmomi/find" + "github.com/vmware/govmomi/govc/cli" + "github.com/vmware/govmomi/govc/flags" + "github.com/vmware/govmomi/vim25/types" + "golang.org/x/net/context" +) + +type create struct { + *flags.DatacenterFlag + *ResourceConfigSpecFlag +} + +func init() { + cli.Register("pool.create", &create{}) +} + +func (cmd *create) Register(ctx context.Context, f *flag.FlagSet) { + cmd.DatacenterFlag, ctx = flags.NewDatacenterFlag(ctx) + cmd.DatacenterFlag.Register(ctx, f) + + cmd.ResourceConfigSpecFlag = NewResourceConfigSpecFlag() + cmd.ResourceConfigSpecFlag.SetAllocation(func(a types.BaseResourceAllocationInfo) { + ra := a.GetResourceAllocationInfo() + ra.Shares.Level = types.SharesLevelNormal + ra.ExpandableReservation = types.NewBool(true) + }) + cmd.ResourceConfigSpecFlag.Register(ctx, f) +} + +func (cmd *create) Process(ctx context.Context) error { + if err := cmd.DatacenterFlag.Process(ctx); err != nil { + return err + } + if err := cmd.ResourceConfigSpecFlag.Process(ctx); err != nil { + return err + } + return nil +} + +func (cmd *create) Usage() string { + return "POOL..." +} + +func (cmd *create) Description() string { + return "Create one or more resource POOLs.\n" + poolCreateHelp +} + +func (cmd *create) Run(ctx context.Context, f *flag.FlagSet) error { + if f.NArg() == 0 { + return flag.ErrHelp + } + + finder, err := cmd.Finder() + if err != nil { + return err + } + + for _, arg := range f.Args() { + dir := path.Dir(arg) + base := path.Base(arg) + parents, err := finder.ResourcePoolList(context.TODO(), dir) + if err != nil { + if _, ok := err.(*find.NotFoundError); ok { + return fmt.Errorf("cannot create resource pool '%s': parent not found", base) + } + return err + } + + for _, parent := range parents { + _, err = parent.Create(context.TODO(), base, cmd.ResourceConfigSpec) + if err != nil { + return err + } + } + } + + return nil +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/pool/destroy.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/pool/destroy.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/pool/destroy.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/pool/destroy.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,101 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package pool + +import ( + "flag" + + "github.com/vmware/govmomi/find" + "github.com/vmware/govmomi/govc/cli" + "github.com/vmware/govmomi/govc/flags" + "golang.org/x/net/context" +) + +type destroy struct { + *flags.DatacenterFlag + + children bool +} + +func init() { + cli.Register("pool.destroy", &destroy{}) +} + +func (cmd *destroy) Register(ctx context.Context, f *flag.FlagSet) { + cmd.DatacenterFlag, ctx = flags.NewDatacenterFlag(ctx) + cmd.DatacenterFlag.Register(ctx, f) + + f.BoolVar(&cmd.children, "children", false, "Remove all children pools") +} + +func (cmd *destroy) Process(ctx context.Context) error { + if err := cmd.DatacenterFlag.Process(ctx); err != nil { + return err + } + return nil +} + +func (cmd *destroy) Usage() string { + return "POOL..." +} + +func (cmd *destroy) Description() string { + return "Destroy one or more resource POOLs.\n" + poolNameHelp +} + +func (cmd *destroy) Run(ctx context.Context, f *flag.FlagSet) error { + if f.NArg() == 0 { + return flag.ErrHelp + } + + finder, err := cmd.Finder() + if err != nil { + return err + } + + for _, arg := range f.Args() { + pools, err := finder.ResourcePoolList(context.TODO(), arg) + if err != nil { + if _, ok := err.(*find.NotFoundError); ok { + // Ignore if pool cannot be found + continue + } + + return err + } + + for _, pool := range pools { + if cmd.children { + err = pool.DestroyChildren(context.TODO()) + if err != nil { + return err + } + } else { + task, err := pool.Destroy(context.TODO()) + if err != nil { + return err + } + err = task.Wait(context.TODO()) + if err != nil { + return err + } + } + } + } + + return nil +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/pool/help.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/pool/help.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/pool/help.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/pool/help.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,50 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package pool + +var poolNameHelp = ` +POOL may be an absolute or relative path to a resource pool or a (clustered) +compute host. If it resolves to a compute host, the associated root resource +pool is returned. If a relative path is specified, it is resolved with respect +to the current datacenter's "host" folder (i.e. /ha-datacenter/host). + +Paths to nested resource pools must traverse through the root resource pool of +the selected compute host, i.e. "compute-host/Resources/nested-pool". + +The same globbing rules that apply to the "ls" command apply here. For example, +POOL may be specified as "*/Resources/*" to expand to all resource pools that +are nested one level under the root resource pool, on all (clustered) compute +hosts in the current datacenter.` + +var poolCreateHelp = ` +POOL may be an absolute or relative path to a resource pool. The parent of the +specified POOL must be an existing resource pool. If a relative path is +specified, it is resolved with respect to the current datacenter's "host" +folder (i.e. /ha-datacenter/host). The basename of the specified POOL is used +as the name for the new resource pool. + +The same globbing rules that apply to the "ls" command apply here. For example, +the path to the parent resource pool in POOL may be specified as "*/Resources" +to expand to the root resource pools on all (clustered) compute hosts in the +current datacenter. + +For example: + */Resources/test Create resource pool "test" on all (clustered) + compute hosts in the current datacenter. + somehost/Resources/*/nested Create resource pool "nested" in every + resource pool that is a direct descendant of + the root resource pool on "somehost".` diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/pool/info.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/pool/info.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/pool/info.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/pool/info.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,212 @@ +/* +Copyright (c) 2015-2016 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package pool + +import ( + "flag" + "fmt" + "io" + "text/tabwriter" + + "github.com/vmware/govmomi/find" + "github.com/vmware/govmomi/govc/cli" + "github.com/vmware/govmomi/govc/flags" + "github.com/vmware/govmomi/object" + "github.com/vmware/govmomi/property" + "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/types" + "golang.org/x/net/context" +) + +type info struct { + *flags.DatacenterFlag + *flags.OutputFlag + + pools bool + apps bool +} + +func init() { + cli.Register("pool.info", &info{}) +} + +func (cmd *info) Register(ctx context.Context, f *flag.FlagSet) { + cmd.DatacenterFlag, ctx = flags.NewDatacenterFlag(ctx) + cmd.DatacenterFlag.Register(ctx, f) + cmd.OutputFlag, ctx = flags.NewOutputFlag(ctx) + cmd.OutputFlag.Register(ctx, f) + + f.BoolVar(&cmd.pools, "p", true, "List resource pools") + f.BoolVar(&cmd.apps, "a", false, "List virtual app resource pools") +} + +func (cmd *info) Process(ctx context.Context) error { + if err := cmd.DatacenterFlag.Process(ctx); err != nil { + return err + } + if err := cmd.OutputFlag.Process(ctx); err != nil { + return err + } + return nil +} + +func (cmd *info) Usage() string { + return "POOL..." +} + +func (cmd *info) Description() string { + return "Retrieve information about one or more resource POOLs.\n" + poolNameHelp +} + +func (cmd *info) Run(ctx context.Context, f *flag.FlagSet) error { + if f.NArg() == 0 { + return flag.ErrHelp + } + + c, err := cmd.Client() + if err != nil { + return err + } + + finder, err := cmd.Finder() + if err != nil { + return err + } + + var res infoResult + var props []string + + if cmd.OutputFlag.JSON { + props = nil + } else { + props = []string{ + "name", + "config.cpuAllocation", + "config.memoryAllocation", + "runtime.cpu", + "runtime.memory", + } + } + + var vapps []*object.VirtualApp + + for _, arg := range f.Args() { + if cmd.pools { + objects, err := finder.ResourcePoolList(ctx, arg) + if err != nil { + if _, ok := err.(*find.NotFoundError); !ok { + return err + } + } + res.objects = append(res.objects, objects...) + } + + if cmd.apps { + apps, err := finder.VirtualAppList(ctx, arg) + if err != nil { + if _, ok := err.(*find.NotFoundError); !ok { + return err + } + } + vapps = append(vapps, apps...) + } + } + + if len(res.objects) != 0 { + refs := make([]types.ManagedObjectReference, 0, len(res.objects)) + for _, o := range res.objects { + refs = append(refs, o.Reference()) + } + + pc := property.DefaultCollector(c) + err = pc.Retrieve(ctx, refs, props, &res.ResourcePools) + if err != nil { + return err + } + } + + if len(vapps) != 0 { + var apps []mo.VirtualApp + refs := make([]types.ManagedObjectReference, 0, len(vapps)) + for _, o := range vapps { + refs = append(refs, o.Reference()) + p := object.NewResourcePool(c, o.Reference()) + p.InventoryPath = o.InventoryPath + res.objects = append(res.objects, p) + } + + pc := property.DefaultCollector(c) + err = pc.Retrieve(ctx, refs, props, &apps) + if err != nil { + return err + } + + for _, app := range apps { + res.ResourcePools = append(res.ResourcePools, app.ResourcePool) + } + } + + return cmd.WriteResult(&res) +} + +type infoResult struct { + ResourcePools []mo.ResourcePool + objects []*object.ResourcePool +} + +func (r *infoResult) Write(w io.Writer) error { + // Maintain order via r.objects as Property collector does not always return results in order. + objects := make(map[types.ManagedObjectReference]mo.ResourcePool, len(r.ResourcePools)) + for _, o := range r.ResourcePools { + objects[o.Reference()] = o + } + + tw := tabwriter.NewWriter(w, 2, 0, 2, ' ', 0) + + for _, o := range r.objects { + pool := objects[o.Reference()] + fmt.Fprintf(tw, "Name:\t%s\n", pool.Name) + fmt.Fprintf(tw, " Path:\t%s\n", o.InventoryPath) + + writeInfo(tw, "CPU", "MHz", &pool.Runtime.Cpu, pool.Config.CpuAllocation) + pool.Runtime.Memory.MaxUsage >>= 20 + pool.Runtime.Memory.OverallUsage >>= 20 + writeInfo(tw, "Mem", "MB", &pool.Runtime.Memory, pool.Config.MemoryAllocation) + } + + return tw.Flush() +} + +func writeInfo(w io.Writer, name string, units string, ru *types.ResourcePoolResourceUsage, b types.BaseResourceAllocationInfo) { + ra := b.GetResourceAllocationInfo() + usage := 100.0 * float64(ru.OverallUsage) / float64(ru.MaxUsage) + shares := "" + limit := "unlimited" + + if ra.Shares.Level == types.SharesLevelCustom { + shares = fmt.Sprintf(" (%d)", ra.Shares.Shares) + } + + if ra.Limit != -1 { + limit = fmt.Sprintf("%d%s", ra.Limit, units) + } + + fmt.Fprintf(w, " %s Usage:\t%d%s (%0.1f%%)\n", name, ru.OverallUsage, units, usage) + fmt.Fprintf(w, " %s Shares:\t%s%s\n", name, ra.Shares.Level, shares) + fmt.Fprintf(w, " %s Reservation:\t%d%s (expandable=%v)\n", name, ra.Reservation, units, *ra.ExpandableReservation) + fmt.Fprintf(w, " %s Limit:\t%s\n", name, limit) +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/pool/resource_config_spec.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/pool/resource_config_spec.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/pool/resource_config_spec.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/pool/resource_config_spec.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,98 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package pool + +import ( + "flag" + "strconv" + "strings" + + "golang.org/x/net/context" + + "github.com/vmware/govmomi/govc/flags" + "github.com/vmware/govmomi/vim25/types" +) + +type sharesInfo types.SharesInfo + +func (s *sharesInfo) String() string { + return string(s.Level) +} + +func (s *sharesInfo) Set(val string) error { + switch val { + case string(types.SharesLevelNormal), string(types.SharesLevelLow), string(types.SharesLevelHigh): + s.Level = types.SharesLevel(val) + default: + n, err := strconv.Atoi(val) + if err != nil { + return err + } + + s.Level = types.SharesLevelCustom + s.Shares = int32(n) + } + + return nil +} + +func NewResourceConfigSpecFlag() *ResourceConfigSpecFlag { + f := new(ResourceConfigSpecFlag) + f.MemoryAllocation = new(types.ResourceAllocationInfo) + f.CpuAllocation = new(types.ResourceAllocationInfo) + + f.SetAllocation(func(a types.BaseResourceAllocationInfo) { + a.GetResourceAllocationInfo().Shares = new(types.SharesInfo) + }) + return f +} + +type ResourceConfigSpecFlag struct { + types.ResourceConfigSpec +} + +func (s *ResourceConfigSpecFlag) Register(ctx context.Context, f *flag.FlagSet) { + opts := []struct { + name string + units string + types.BaseResourceAllocationInfo + }{ + {"CPU", "MHz", s.CpuAllocation}, + {"Memory", "MB", s.MemoryAllocation}, + } + + for _, opt := range opts { + prefix := strings.ToLower(opt.name)[:3] + ra := opt.GetResourceAllocationInfo() + shares := (*sharesInfo)(ra.Shares) + + f.Int64Var(&ra.Limit, prefix+".limit", 0, opt.name+" limit in "+opt.units) + f.Int64Var(&ra.Reservation, prefix+".reservation", 0, opt.name+" reservation in "+opt.units) + f.Var(flags.NewOptionalBool(&ra.ExpandableReservation), prefix+".expandable", opt.name+" expandable reservation") + f.Var(shares, prefix+".shares", opt.name+" shares level or number") + } +} + +func (s *ResourceConfigSpecFlag) Process(ctx context.Context) error { + return nil +} + +func (s *ResourceConfigSpecFlag) SetAllocation(f func(types.BaseResourceAllocationInfo)) { + for _, a := range []types.BaseResourceAllocationInfo{s.CpuAllocation, s.MemoryAllocation} { + f(a) + } +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/README.md juju-core-2.0.2/src/github.com/vmware/govmomi/govc/README.md --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/README.md 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/README.md 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,135 @@ +# govc + +govc is a vSphere CLI built on top of govmomi. + +## Installation + +You can find prebuilt govc binaries on the [releases page](https://github.com/vmware/govmomi/releases). + +Download and install a binary locally like this: + +```sh +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. + +```sh +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 + +* `GOVC_VIM_NAMESPACE`: Vim namespace defaults to `urn:vim25` + +* `GOVC_VIM_VERSION`: Vim version defaults to `6.0` + +## 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](examples/lib/ssh.sh) + +* [Create and configure a vCenter VM](examples/vcsa.sh) + +## Status + +Changes to the cli are subject to [semantic versioning](http://semver.org). + +Refer to the [CHANGELOG](CHANGELOG.md) for version to version changes. + +When new govc commands or flags are added, the PATCH version will be incremented. This enables you to require a minimum +version from within a script, for example: + +``` +govc version -require 0.7.1 +``` + +## Projects using govc + +* [Kubernetes vSphere Provider](https://github.com/GoogleCloudPlatform/kubernetes/tree/master/cluster/vsphere) + +* [Emacs govc package](./emacs) + +## License + +govc is available under the [Apache 2 license](../LICENSE). diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/release.sh juju-core-2.0.2/src/github.com/vmware/govmomi/govc/release.sh --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/release.sh 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/release.sh 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,76 @@ +#!/bin/bash -e + +if ! which github-release > /dev/null; then + echo 'Please install github-release...' + echo '' + echo ' $ go get github.com/aktau/github-release' + echo '' + exit 1 +fi + +if [ -z "${GITHUB_TOKEN}" ]; then + echo 'Please set GITHUB_TOKEN...' + exit 1 +fi + +export GITHUB_USER="${GITHUB_USER:-vmware}" +export GITHUB_REPO="${GITHUB_REPO:-govmomi}" + +name="$(git describe)" + +case "$1" in + release) + tag="${name}" + ;; + prerelease) + tag="prerelease-${name}" + ;; + *) + echo "Usage: $0 [release|prerelease]" + exit 1 + ;; +esac + +echo "Building govc..." +rm -f govc_* +./build.sh +gzip -f govc_* + +echo "Pushing tag ${tag}..." +git tag -f "${tag}" +git push origin "refs/tags/${tag}" + +# Generate description +description=$( +if [[ "${tag}" == "prerelease-"* ]]; then + echo '**This is a PRERELEASE version.**' +fi + +echo ' +The binaries below are provided without warranty, following the [Apache license](LICENSE). +' + +echo ' +Instructions: +* Download the file relevant to your operating system +* Decompress (i.e. `gzip -d govc_linux_amd64.gz`) +* Set the executable bit (i.e. `chmod +x govc_linux_amd64`) +* Move the file to a directory in your `$PATH` (i.e. `mv govc_linux_amd64 /usr/local/bin/govc`) +' + +echo '```' +echo '$ sha1sum govc_*.gz' +sha1sum govc_*.gz +echo '```' +) + +echo "Creating release..." +github-release release --tag "${tag}" --name "${name}" --description "${description}" --draft --pre-release + +# Upload build artifacts +for f in govc_*.gz; do + echo "Uploading $f..." + github-release upload --tag "${tag}" --name "${f}" --file "${f}" +done + +echo "Remember to publish the draft release!" diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/test/boot_order_test.sh juju-core-2.0.2/src/github.com/vmware/govmomi/govc/test/boot_order_test.sh --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/test/boot_order_test.sh 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/test/boot_order_test.sh 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,75 @@ +#!/bin/bash -e + +# This test is not run via bats. +# A VNC session will be opened to observe the VM boot order: +# 1) from floppy (followed by: eject floppy, reboot) +# 2) from cdrom (followed by: eject cdrom, reboot) +# 3) from network (will timeout) +# 4) from disk + +. $(dirname $0)/test_helper.bash + +upload_img +upload_iso + +id=$(new_ttylinux_vm) + +function cleanup() { + quit_vnc $vnc + govc vm.destroy $id + pkill -TERM -g $$ ^nc +} + +trap cleanup EXIT + +govc device.cdrom.add -vm $id > /dev/null +govc device.cdrom.insert -vm $id $GOVC_TEST_ISO + +govc device.floppy.add -vm $id > /dev/null +govc device.floppy.insert -vm $id $GOVC_TEST_IMG + +govc device.boot -vm $id -delay 1000 -order floppy,cdrom,ethernet,disk + +vnc=$(govc vm.vnc -port 21122 -password govmomi -enable "${id}" | awk '{print $2}') + +echo "booting from floppy..." +govc vm.power -on $id + +open_vnc $vnc + +sleep 10 + +govc vm.power -off $id + +govc device.floppy.eject -vm $id + +# this is ttylinux-live, notice the 'boot:' prompt vs 'login:' prompt when booted from disk +echo "booting from cdrom..." +govc vm.power -on $id + +sleep 10 + +govc vm.power -off $id + +govc device.cdrom.eject -vm $id + +host_ip=$(echo $vnc | awk -F@ '{print $2}' | awk -F: '{print $1}') +serial_port=33233 +govc device.serial.add -vm $id > /dev/null +govc device.serial.connect -vm $id $uri telnet://:$serial_port + +echo "booting from network, will timeout then boot from disk..." +govc vm.power -on $id + +# capture serial console +echo | nc $host_ip $serial_port 2>/dev/null & + +ip=$(govc vm.ip $id) + +echo "VM booted from disk (ip=$ip)" + +sleep 5 + +govc vm.power -s $id + +sleep 5 diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/test/clean.sh juju-core-2.0.2/src/github.com/vmware/govmomi/govc/test/clean.sh --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/test/clean.sh 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/test/clean.sh 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,24 @@ +#!/bin/bash +# +# Cleanup any artifacts created by govc +# + +. $(dirname $0)/test_helper.bash + +teardown + +datastore_rm() { + name=$1 + govc datastore.rm $name 2> /dev/null +} + +datastore_rm $GOVC_TEST_IMG +datastore_rm $GOVC_TEST_ISO +datastore_rm $GOVC_TEST_VMDK +datastore_rm $(echo $GOVC_TEST_VMDK | sed 's/.vmdk/-flat.vmdk/') + +# Recursively destroy all resource pools created by the test suite +govc ls host/*/Resources/govc-test-* | \ + xargs -rt govc pool.destroy -r + +govc datastore.ls diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/test/cli.bats juju-core-2.0.2/src/github.com/vmware/govmomi/govc/test/cli.bats --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/test/cli.bats 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/test/cli.bats 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,69 @@ +#!/usr/bin/env bats + +load test_helper + +@test "about" { + run govc about + assert_success + assert_line "Vendor: VMware, Inc." + + run govc about -json + assert_success + + run govc about -json -l + assert_success +} + +@test "version" { + run govc version + assert_success + + v=$(govc version | awk '{print $NF}') + run govc version -require "$v" + assert_success + + run govc version -require "not-a-version-string" + assert_failure + + run govc version -require 100.0.0 + assert_failure +} + +@test "login attempt without credentials" { + run govc about -u $(echo $GOVC_URL | awk -F@ '{print $2}') + assert_failure "govc: ServerFaultCode: Cannot complete login due to an incorrect user name or password." +} + +@test "login attempt with GOVC_URL, GOVC_USERNAME, and GOVC_PASSWORD" { + govc_url_to_vars + run govc about + assert_success +} + +@test "connect to an endpoint with a non-supported API version" { + run env GOVC_MIN_API_VERSION=24.4 govc about + assert grep -q "^govc: Require API version 24.4," <<<${output} +} + +@test "connect to an endpoint with user provided Vim namespace and Vim version" { + run govc about -vim-namespace urn:vim25 -vim-version 6.0 + assert_success +} + +@test "govc env" { + output="$(govc env -x -u 'user:pass@enoent:99999?key=val#anchor')" + assert grep -q GOVC_URL=enoent:99999 <<<${output} + assert grep -q GOVC_USERNAME=user <<<${output} + assert grep -q GOVC_PASSWORD=pass <<<${output} + + assert grep -q GOVC_URL_SCHEME=https <<<${output} + assert grep -q GOVC_URL_HOST=enoent <<<${output} + assert grep -q GOVC_URL_PORT=99999 <<<${output} + assert grep -q GOVC_URL_PATH=/sdk <<<${output} + assert grep -q GOVC_URL_QUERY=key=val <<<${output} + assert grep -q GOVC_URL_FRAGMENT=anchor <<<${output} + + password="pa\$sword\!ok" + run govc env -u "user:${password}@enoent:99999" GOVC_PASSWORD + assert_output "$password" +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/test/datacenter.bats juju-core-2.0.2/src/github.com/vmware/govmomi/govc/test/datacenter.bats --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/test/datacenter.bats 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/test/datacenter.bats 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,93 @@ +#!/usr/bin/env bats + +load test_helper + +@test "datacenter.info" { + dc=$(govc ls -t Datacenter / | head -n1) + run govc datacenter.info "$dc" + assert_success + + run govc datacenter.info -json "$dc" + assert_success + + run govc datacenter.info /enoent + assert_failure +} + +@test "create and destroy datacenters" { + vcsim_env + + dcs=($(new_id) $(new_id)) + run govc datacenter.create "${dcs[@]}" + assert_success + + for dc in ${dcs[*]}; do + run govc ls "/$dc" + assert_success + # //{vm,network,host,datastore} + [ ${#lines[@]} -eq 4 ] + + run govc datacenter.info "/$dc" + assert_success + done + + run govc datacenter.destroy "${dcs[@]}" + assert_success + + for dc in ${dcs[*]}; do + run govc ls "/$dc" + assert_success + [ ${#lines[@]} -eq 0 ] + done +} + +@test "destroy datacenter using glob" { + vcsim_env + unset GOVC_DATACENTER GOVC_DATASTORE + + folder=$(new_id) + dcs=($(new_id) $(new_id)) + + run govc folder.create "$folder" + assert_success + + run govc datacenter.create -folder "$folder" "${dcs[@]}" + assert_success + + run govc datacenter.destroy "$folder/*" + assert_success + + for dc in ${dcs[*]}; do + run govc ls "/$dc" + assert_success + [ ${#lines[@]} -eq 0 ] + done + + run govc folder.destroy "$folder" + assert_success +} + +@test "destroy datacenter that does not exist" { + vcsim_env + + run govc datacenter.destroy "/enoent" + assert_failure +} + +@test "fails when datacenter name not specified" { + run govc datacenter.create + assert_failure + + run govc datacenter.destroy + assert_failure +} + +@test "datacenter commands fail against ESX" { + run govc datacenter.create something + assert_failure + assert_output "govc: ServerFaultCode: The operation is not supported on the object." + + run govc datacenter.destroy ha-datacenter + assert_failure + assert_output "govc: The operation is not supported on the object." +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/test/datastore.bats juju-core-2.0.2/src/github.com/vmware/govmomi/govc/test/datastore.bats --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/test/datastore.bats 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/test/datastore.bats 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,107 @@ +#!/usr/bin/env bats + +load test_helper + +upload_file() { + file=$($mktemp --tmpdir govc-test-XXXXX) + name=$(basename ${file}) + echo "Hello world!" > ${file} + + run govc datastore.upload "${file}" "${name}" + assert_success + + rm -f "${file}" + echo "${name}" +} + +@test "datastore.ls" { + name=$(upload_file) + + # Single argument + run govc datastore.ls "${name}" + assert_success + [ ${#lines[@]} -eq 1 ] + + # Multiple arguments + run govc datastore.ls "${name}" "${name}" + assert_success + [ ${#lines[@]} -eq 2 ] + + # Pattern argument + run govc datastore.ls "./govc-test-*" + assert_success + [ ${#lines[@]} -ge 1 ] + + # Long listing + run govc datastore.ls -l "./govc-test-*" + assert_success + assert_equal "13B" $(awk '{ print $1 }' <<<${output}) +} + +@test "datastore.rm" { + name=$(upload_file) + + # Not found is a failure + run govc datastore.rm "${name}.notfound" + assert_failure + assert_matches "govc: File .* was not found" "${output}" + + # Not found is NOT a failure with the force flag + run govc datastore.rm -f "${name}.notfound" + assert_success + assert_empty "${output}" + + # Verify the file is present + run govc datastore.ls "${name}" + assert_success + + # Delete the file + run govc datastore.rm "${name}" + assert_success + assert_empty "${output}" + + # Verify the file is gone + run govc datastore.ls "${name}" + assert_failure +} + +@test "datastore.info" { + run govc datastore.info enoent + assert_failure + + run govc datastore.info + assert_success + [ ${#lines[@]} -gt 1 ] +} + + +@test "datastore.mkdir" { + name=$(new_id) + + # Not supported datastore type is a failure + run govc datastore.mkdir -namespace "notfound" + assert_failure + assert_matches "govc: ServerFaultCode: .*" "${output}" + + run govc datastore.mkdir "${name}" + assert_success + assert_empty "${output}" + + # Verify the dir is present + run govc datastore.ls "${name}" + assert_success + + # Delete the dir on an unsupported datastore type is a failure + run govc datastore.rm -namespace "${name}" + assert_failure + assert_matches "govc: ServerFaultCode: .*" "${output}" + + # Delete the dir + run govc datastore.rm "${name}" + assert_success + assert_empty "${output}" + + # Verify the dir is gone + run govc datastore.ls "${name}" + assert_failure +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/test/device.bats juju-core-2.0.2/src/github.com/vmware/govmomi/govc/test/device.bats --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/test/device.bats 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/test/device.bats 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,208 @@ +#!/usr/bin/env bats + +load test_helper + +@test "device.ls" { + vm=$(new_empty_vm) + + result=$(govc device.ls -vm $vm | grep ethernet-0 | wc -l) + [ $result -eq 1 ] +} + +@test "device.info" { + vm=$(new_empty_vm) + + run govc device.info -vm $vm ide-200 + assert_success + + run govc device.info -vm $vm ide-20000 + assert_failure + + run govc device.info -vm $vm -net enoent + assert_failure + + run govc device.info -vm $vm -net "VM Network" ide-200 + assert_failure + + result=$(govc device.info -vm $vm -net "VM Network" | grep "MAC Address" | wc -l) + [ $result -eq 1 ] +} + +@test "device.boot" { + vm=$(new_ttylinux_vm) + + result=$(govc device.ls -vm $vm -boot | wc -l) + [ $result -eq 0 ] + + run govc device.boot -vm $vm -order floppy,cdrom,ethernet,disk + assert_success + + result=$(govc device.ls -vm $vm -boot | wc -l) + [ $result -eq 2 ] + + run govc device.cdrom.add -vm $vm + assert_success + + run govc device.floppy.add -vm $vm + assert_success + + run govc device.boot -vm $vm -order floppy,cdrom,ethernet,disk + assert_success + + result=$(govc device.ls -vm $vm -boot | wc -l) + [ $result -eq 4 ] +} + +@test "device.cdrom" { + vm=$(new_empty_vm) + + result=$(govc device.ls -vm $vm | grep cdrom- | wc -l) + [ $result -eq 0 ] + + run govc device.cdrom.add -vm $vm + assert_success + id=$output + + result=$(govc device.ls -vm $vm | grep $id | wc -l) + [ $result -eq 1 ] + + run govc device.info -vm $vm $id + assert_success + + run govc device.cdrom.insert -vm $vm -device $id x.iso + assert_success + + run govc device.info -vm $vm $id + assert_line "Summary: ISO [${GOVC_DATASTORE}] x.iso" + + run govc device.disconnect -vm $vm $id + assert_success + + run govc device.connect -vm $vm $id + assert_success + + run govc device.remove -vm $vm $id + assert_success + + run govc device.disconnect -vm $vm $id + assert_failure "govc: device '$id' not found" + + run govc device.cdrom.insert -vm $vm -device $id x.iso + assert_failure "govc: device '$id' not found" + + run govc device.remove -vm $vm $id + assert_failure "govc: device '$id' not found" +} + +@test "device.floppy" { + vm=$(new_empty_vm) + + result=$(govc device.ls -vm $vm | grep floppy- | wc -l) + [ $result -eq 0 ] + + run govc device.floppy.add -vm $vm + assert_success + id=$output + + result=$(govc device.ls -vm $vm | grep $id | wc -l) + [ $result -eq 1 ] + + run govc device.info -vm $vm $id + assert_success + + run govc device.floppy.insert -vm $vm -device $id x.img + assert_success + + run govc device.info -vm $vm $id + assert_line "Summary: Image [${GOVC_DATASTORE}] x.img" + + run govc device.disconnect -vm $vm $id + assert_success + + run govc device.connect -vm $vm $id + assert_success + + run govc device.remove -vm $vm $id + assert_success + + run govc device.disconnect -vm $vm $id + assert_failure "govc: device '$id' not found" + + run govc device.floppy.insert -vm $vm -device $id x.img + assert_failure "govc: device '$id' not found" + + run govc device.remove -vm $vm $id + assert_failure "govc: device '$id' not found" +} + +@test "device.serial" { + vm=$(new_empty_vm) + + result=$(govc device.ls -vm $vm | grep serial- | wc -l) + [ $result -eq 0 ] + + run govc device.serial.add -vm $vm + assert_success + id=$output + + result=$(govc device.ls -vm $vm | grep $id | wc -l) + [ $result -eq 1 ] + + run govc device.info -vm $vm $id + assert_success + + uri=telnet://:33233 + run govc device.serial.connect -vm $vm -device $id $uri + assert_success + + run govc device.info -vm $vm $id + assert_line "Summary: Remote $uri" + + run govc device.serial.disconnect -vm $vm -device $id + assert_success + + run govc device.info -vm $vm $id + assert_line "Summary: Remote localhost:0" + + run govc device.disconnect -vm $vm $id + assert_success + + run govc device.connect -vm $vm $id + assert_success + + run govc device.remove -vm $vm $id + assert_success + + run govc device.disconnect -vm $vm $id + assert_failure "govc: device '$id' not found" + + run govc device.serial.connect -vm $vm -device $id $uri + assert_failure "govc: device '$id' not found" + + run govc device.remove -vm $vm $id + assert_failure "govc: device '$id' not found" +} + +@test "device.scsi" { + vm=$(new_empty_vm) + + result=$(govc device.ls -vm $vm | grep lsilogic- | wc -l) + [ $result -eq 1 ] + + run govc device.scsi.add -vm $vm + assert_success + id=$output + + result=$(govc device.ls -vm $vm | grep $id | wc -l) + [ $result -eq 1 ] + + result=$(govc device.ls -vm $vm | grep lsilogic- | wc -l) + [ $result -eq 2 ] + + run govc device.scsi.add -vm $vm -type pvscsi + assert_success + id=$output + + result=$(govc device.ls -vm $vm | grep $id | wc -l) + [ $result -eq 1 ] +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/test/esxbox/Vagrantfile juju-core-2.0.2/src/github.com/vmware/govmomi/govc/test/esxbox/Vagrantfile --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/test/esxbox/Vagrantfile 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/test/esxbox/Vagrantfile 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,27 @@ +# -*- mode: ruby -*- +# vi: set ft=ruby : + +Vagrant.configure("2") do |config| + config.ssh.insert_key = false + config.ssh.default.username = "root" + config.ssh.shell = "sh" + config.vm.hostname = "esxbox" + + config.vm.box = "esxi55" + config.vm.synced_folder ".", "/vagrant", disabled: true + config.vm.network "forwarded_port", guest: 443, host: 18443 + + [:vmware_fusion, :vmware_workstation].each do |name| + config.vm.provider name do |v,override| + v.vmx["memsize"] = "4096" + end + end + + config.vm.provision "shell", privileged: false, :inline => </dev/null + run govc import.ovf ./images/${TTYLINUX_NAME}.ovf + assert_success + popd >/dev/null + + run govc vm.destroy ${TTYLINUX_NAME} + assert_success +} + +@test "import.ovf with name in options" { + name=$(new_id) + file=$($mktemp --tmpdir govc-test-XXXXX) + echo "{ \"Name\": \"${name}\"}" > ${file} + + run govc import.ovf -options="${file}" $GOVC_IMAGES/${TTYLINUX_NAME}.ovf + assert_success + + run govc vm.destroy "${name}" + assert_success + + rm -f ${file} +} + +@test "import.ovf with name as argument" { + skip_if_vca + name=$(new_id) + + run govc import.ova -name="${name}" $GOVC_IMAGES/${TTYLINUX_NAME}.ova + assert_success + + run govc vm.destroy "${name}" + assert_success +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/test/license.bats juju-core-2.0.2/src/github.com/vmware/govmomi/govc/test/license.bats --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/test/license.bats 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/test/license.bats 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,55 @@ +#!/usr/bin/env bats + +load test_helper + +# These tests should only run against a server running an evaluation license. +verify_evaluation() { + if [ "$(govc license.list -json | jq -r .[0].EditionKey)" != "eval" ]; then + skip "requires evaluation license" + fi +} + +get_key() { + jq ".[] | select(.LicenseKey == \"$1\")" +} + +get_property() { + jq -r ".Properties[] | select(.Key == \"$1\") | .Value" +} + +@test "license.add" { + skip_if_vca + verify_evaluation + + run govc license.add -json 00000-00000-00000-00000-00001 00000-00000-00000-00000-00002 + assert_success + + # Expect to see an entry for both the first and the second key + assert_equal "License is not valid for this product" $(get_key 00000-00000-00000-00000-00001 <<<${output} | get_property diagnostic) + assert_equal "License is not valid for this product" $(get_key 00000-00000-00000-00000-00002 <<<${output} | get_property diagnostic) +} + +@test "license.remove" { + verify_evaluation + + run govc license.remove -json 00000-00000-00000-00000-00001 + assert_success +} + +@test "license.list" { + skip_if_vca + verify_evaluation + + run govc license.list -json + assert_success + + # Expect the test instance to run in evaluation mode + assert_equal "Evaluation Mode" $(get_key 00000-00000-00000-00000-00000 <<<$output | jq -r ".Name") +} + +@test "license.decode" { + verify_evaluation + + key=00000-00000-00000-00000-00000 + assert_equal "eval" $(govc license.decode $key | grep $key | awk '{print $2}') +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/test/logs.bats juju-core-2.0.2/src/github.com/vmware/govmomi/govc/test/logs.bats --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/test/logs.bats 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/test/logs.bats 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,38 @@ +#!/usr/bin/env bats + +load test_helper + +@test "logs" { + run govc logs + assert_success + nlogs=${#lines[@]} + # there should be plenty more than 1 line of hostd logs + [ $nlogs -ge 1 ] + + # test -n flag + run govc logs -n $((nlogs - 1)) + assert_success + [ ${#lines[@]} -le $nlogs ] + + run govc logs -log vmkernel + assert_success + nlogs=${#lines[@]} + # there should be plenty more than 1 line of vmkernel logs + [ $nlogs -ge 1 ] + + # -host ignored against ESX + run govc logs -host enoent + assert_success + + run govc logs -log enoent + assert_failure +} + +@test "logs.ls" { + run govc logs.ls + assert_success + + # -host ignored against ESX + run govc logs.ls -host enoent + assert_success +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/test/ls.bats juju-core-2.0.2/src/github.com/vmware/govmomi/govc/test/ls.bats --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/test/ls.bats 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/test/ls.bats 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,116 @@ +#!/usr/bin/env bats + +load test_helper + +@test "ls" { + run govc ls + assert_success + # /dc/{vm,network,host,datastore} + [ ${#lines[@]} -ge 4 ] + + run govc ls host + assert_success + [ ${#lines[@]} -ge 1 ] + + run govc ls enoent + assert_success + [ ${#lines[@]} -eq 0 ] +} + +@test "ls vm" { + vm=$(new_empty_vm) + + run govc ls vm + assert_success + [ ${#lines[@]} -ge 1 ] + + run govc ls vm/$vm + assert_success + [ ${#lines[@]} -eq 1 ] + + run govc ls /*/vm/$vm + assert_success + [ ${#lines[@]} -eq 1 ] +} + +@test "ls network" { + run govc ls network + assert_success + [ ${#lines[@]} -ge 1 ] + + local path=${lines[0]} + run govc ls "$path" + assert_success + [ ${#lines[@]} -eq 1 ] + + run govc ls "network/$(basename "$path")" + assert_success + [ ${#lines[@]} -eq 1 ] + + run govc ls "/*/network/$(basename "$path")" + assert_success + [ ${#lines[@]} -eq 1 ] +} + +@test "ls multi ds" { + vcsim_env + + run govc ls + assert_success + # /DC0/{vm,network,host,datastore} + [ ${#lines[@]} -eq 4 ] + + run govc ls /DC* + assert_success + # /DC[0,1]/{vm,network,host,datastore} + [ ${#lines[@]} -eq 8 ] + + # here 'vm' is relative to /DC0 + run govc ls vm + assert_success + [ ${#lines[@]} -gt 0 ] + + unset GOVC_DATACENTER + + run govc ls + assert_success + # /DC[0,1] + [ ${#lines[@]} -eq 2 ] + + run govc ls -dc enoent + assert_failure + [ ${#lines[@]} -gt 0 ] + + # here 'vm' is relative to '/' - so there are no matches + run govc ls vm + assert_success + [ ${#lines[@]} -eq 0 ] + + # ls all vms in all datacenters + run govc ls */vm + assert_success + [ ${#lines[@]} -gt 0 ] +} + +@test "ls moref" { + # ensure the vm folder isn't empty + run govc vm.create -on=false "$(new_id)" + assert_success + + # list dc folder paths + folders1=$(govc ls) + # list dc folder refs | govc ls -L ; should output the same paths + folders2=$(govc ls -i | xargs govc ls -L) + + assert_equal "$folders1" "$folders2" + + for folder in $folders1 + do + # list paths in $folder + items1=$(govc ls "$folder") + # list refs in $folder | govc ls -L ; should output the same paths + items2=$(govc ls -i "$folder" | xargs -d '\n' govc ls -L) + + assert_equal "$items1" "$items2" + done +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/test/network.bats juju-core-2.0.2/src/github.com/vmware/govmomi/govc/test/network.bats --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/test/network.bats 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/test/network.bats 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,144 @@ +#!/usr/bin/env bats + +load test_helper + +@test "network dvs backing" { + vcsim_env + + # DVS backed network by default (from vcsim_env) + vm=$(new_empty_vm) + + eth0=$(govc device.ls -vm $vm | grep ethernet- | awk '{print $1}') + run govc device.info -vm $vm $eth0 + assert_success + + summary=$(govc device.info -vm $vm $eth0 | grep Summary: | awk '{print $2}') + assert_equal "DVSwitch:" $summary + + run govc device.remove -vm $vm $eth0 + assert_success + + eth0=$(govc device.ls -vm $vm | grep ethernet- | awk '{print $1}') + [ -z "$eth0" ] + + # Standard network backing + run govc vm.network.add -vm $vm -net "VM Network" + assert_success + + eth0=$(govc device.ls -vm $vm | grep ethernet- | awk '{print $1}') + + run govc device.info -vm $vm $eth0 + assert_success + + summary=$(govc device.info -vm $vm $eth0 | grep Summary: | awk -F: '{print $2}') + assert_equal "VM Network" $(collapse_ws $summary) + + run govc device.remove -vm $vm $eth0 + assert_success + + run govc device.remove -vm $vm $eth0 + assert_failure "govc: device '$eth0' not found" +} + +@test "network change backing" { + vcsim_env + + vm=$(new_empty_vm) + + eth0=$(govc device.ls -vm $vm | grep ethernet- | awk '{print $1}') + run govc vm.network.change -vm $vm $eth0 enoent + assert_failure "govc: network 'enoent' not found" + + run govc vm.network.change -vm $vm enoent "VM Network" + assert_failure "govc: device 'enoent' not found" + + run govc vm.network.change -vm $vm $eth0 "VM Network" + assert_success + + run govc vm.network.change -vm $vm $eth0 + assert_success + + unset GOVC_NETWORK + run govc vm.network.change -vm $vm $eth0 + assert_failure "govc: default network resolves to multiple instances, please specify" + + run govc vm.power -on $vm + assert_success + run govc vm.power -off $vm + + mac=$(vm_mac $vm) + run govc vm.network.change -vm $vm -net "VM Network" $eth0 + assert_success + + # verify we didn't change the mac address + run govc vm.power -on $vm + assert_success + assert_equal $mac $(vm_mac $vm) +} + +@test "network standard backing" { + vm=$(new_empty_vm) + + run govc device.info -vm $vm ethernet-0 + assert_success + + run govc device.remove -vm $vm ethernet-0 + assert_success + + run govc device.info -vm $vm ethernet-0 + assert_failure + + run govc vm.network.add -vm $vm enoent + assert_failure "govc: network 'enoent' not found" + + run govc vm.network.add -vm $vm "VM Network" + assert_success + + run govc device.info -vm $vm ethernet-0 + assert_success +} + +@test "network adapter" { + vm=$(new_id) + run govc vm.create -on=false -net.adapter=enoent $vm + assert_failure "govc: unknown ethernet card type 'enoent'" + + vm=$(new_id) + run govc vm.create -on=false -net.adapter=vmxnet3 $vm + assert_success + + eth0=$(govc device.ls -vm $vm | grep ethernet- | awk '{print $1}') + type=$(govc device.info -vm $vm $eth0 | grep Type: | awk -F: '{print $2}') + assert_equal "VirtualVmxnet3" $(collapse_ws $type) + + run govc vm.network.add -vm $vm -net.adapter e1000e "VM Network" + assert_success + + eth1=$(govc device.ls -vm $vm | grep ethernet- | grep -v $eth0 | awk '{print $1}') + type=$(govc device.info -vm $vm $eth1 | grep Type: | awk -F: '{print $2}') + assert_equal "VirtualE1000e" $(collapse_ws $type) +} + +@test "network flag required" { + vcsim_env + + # -net flag is required when there are multiple networks + unset GOVC_NETWORK + run govc vm.create -on=false $(new_id) + assert_failure "govc: default network resolves to multiple instances, please specify" +} + +@test "network change hardware address" { + mac="00:00:0f$(dd bs=1 count=3 if=/dev/random 2>/dev/null | hexdump -v -e '/1 ":%02x"')" + vm=$(new_id) + run govc vm.create -on=false $vm + assert_success + + run govc vm.network.change -vm $vm -net.address $mac ethernet-0 + assert_success + + run govc vm.power -on $vm + assert_success + + assert_equal $mac $(vm_mac $vm) +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/test/pool.bats juju-core-2.0.2/src/github.com/vmware/govmomi/govc/test/pool.bats --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/test/pool.bats 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/test/pool.bats 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,293 @@ +#!/usr/bin/env bats + +load test_helper + +@test "pool.create" { + path="*/Resources/$(new_id)/$(new_id)" + run govc pool.create $path + assert_failure + assert_line "govc: cannot create resource pool '$(basename ${path})': parent not found" + + id=$(new_id) + path="*/Resources/$id" + run govc pool.create -cpu.shares low -mem.reservation 500 $path + assert_success + + run govc pool.info $path + assert_success + + assert_line "Name: $id" + assert_line "CPU Shares: low" + assert_line "Mem Reservation: 500MB (expandable=true)" + + run govc pool.destroy $path + assert_success +} + +@test "pool.create multiple" { + id=$(new_id) + path="*/Resources/$id" + govc pool.create $path + + # Create multiple parent pools with multiple arguments (without globbing) + run govc pool.create $path/a $path/b + assert_success + result=$(govc ls "host/$path/*" | wc -l) + [ $result -eq 2 ] + + # Create multiple child pools with one argument (with globbing) + run govc pool.create $path/*/{a,b} + assert_success + result=$(govc ls "host/$path/*/*" | wc -l) + [ $result -eq 4 ] + + # Clean up + run govc pool.destroy $path/*/* $path/* $path + assert_success +} + +@test "pool.change" { + id=$(new_id) + path="*/Resources/$id" + govc pool.create $path + + run govc pool.change -mem.shares high $path + assert_success + run govc pool.info $path + assert_success + assert_line "Mem Shares: high" + assert_line "CPU Shares: normal" + + nid=$(new_id) + run govc pool.change -name $nid $path + assert_success + path="*/Resources/$nid" + + run govc pool.info $path + assert_success + assert_line "Name: $nid" + + run govc pool.destroy $path + assert_success +} + +@test "pool.change multiple" { + id=$(new_id) + path="*/Resources/$id" + govc pool.create $path + + # Create some nested pools so that we can test changing multiple in one call + govc pool.create $path/{a,b} $path/{a,b}/test + + # Test precondition + run govc pool.info $path/a/test + assert_success + assert_line "Name: test" + run govc pool.info $path/b/test + assert_success + assert_line "Name: test" + + # Change name of both test pools + run govc pool.change -name hello $path/*/test + assert_success + + # Test postcondition + run govc pool.info $path/a/hello + assert_success + assert_line "Name: hello" + run govc pool.info $path/b/hello + assert_success + assert_line "Name: hello" + + # Clean up + govc pool.destroy $path/a/hello + govc pool.destroy $path/a + govc pool.destroy $path/b/hello + govc pool.destroy $path/b + govc pool.destroy $path +} + +@test "pool.destroy" { + id=$(new_id) + + # parent pool + path="*/Resources/$id" + run govc pool.create $path + assert_success + + result=$(govc ls "host/$path/*" | wc -l) + [ $result -eq 0 ] + + # child pools + id1=$(new_id) + run govc pool.create $path/$id1 + assert_success + + id2=$(new_id) + run govc pool.create $path/$id2 + assert_success + + # 2 child pools + result=$(govc ls "host/$path/*" | wc -l) + [ $result -eq 2 ] + + # 1 parent pool + result=$(govc ls "host/$path" | wc -l) + [ $result -eq 1 ] + + run govc pool.destroy $path + assert_success + + # no more parent pool + result=$(govc ls "host/$path" | wc -l) + [ $result -eq 0 ] + + # the child pools are not present anymore + # the only place they could pop into is the parent pool + + # first child pool + result=$(govc ls "host/*/Resources/$id1" | wc -l) + [ $result -eq 0 ] + + # second child pool + result=$(govc ls "host/*/Resources/$id2" | wc -l) + [ $result -eq 0 ] +} + +@test "pool.destroy children" { + id=$(new_id) + + # parent pool + path="*/Resources/$id" + run govc pool.create $path + assert_success + + result=$(govc ls "host/$path/*" | wc -l) + [ $result -eq 0 ] + + # child pools + run govc pool.create $path/$(new_id) + assert_success + + run govc pool.create $path/$(new_id) + assert_success + + # 2 child pools + result=$(govc ls "host/$path/*" | wc -l) + [ $result -eq 2 ] + + # 1 parent pool + result=$(govc ls "host/*/Resources/govc-test-*" | wc -l) + [ $result -eq 1 ] + + # delete childs + run govc pool.destroy -children $path + assert_success + + # no more child pools + result=$(govc ls "host/$path/*" | wc -l) + [ $result -eq 0 ] + + # cleanup + run govc pool.destroy $path + assert_success + + # cleanup check + result=$(govc ls "host/$path" | wc -l) + [ $result -eq 0 ] +} + +@test "pool.destroy multiple" { + id=$(new_id) + path="*/Resources/$id" + govc pool.create $path + + # Create some nested pools so that we can test destroying multiple in one call + govc pool.create $path/{a,b} + + # Test precondition + result=$(govc ls "host/$path/*" | wc -l) + [ $result -eq 2 ] + + # Destroy both pools + run govc pool.destroy $path/{a,b} + assert_success + + # Test postcondition + result=$(govc ls "host/$path/*" | wc -l) + [ $result -eq 0 ] + + # Clean up + govc pool.destroy $path +} + +@test "vm.create -pool" { + # test with full inventory path to pools + parent_path=$(govc ls 'host/*/Resources') + parent_name=$(basename $parent_path) + [ "$parent_name" = "Resources" ] + + child_name=$(new_id) + child_path="$parent_path/$child_name" + + grand_child_name=$(new_id) + grand_child_path="$child_path/$grand_child_name" + + run govc pool.create $parent_path/$child_name{,/$grand_child_name} + assert_success + + for path in $parent_path $child_path $grand_child_path + do + run govc vm.create -pool $path $(new_id) + assert_success + done + + run govc pool.change -mem.limit 100 -mem.expandable=false $child_path + assert_failure + + run govc pool.change -mem.limit 100 $child_path + assert_success + + run govc pool.change -mem.limit 120 -mem.expandable $child_path + assert_success + + # test with glob inventory path to pools + parent_path="*/$parent_name" + child_path="$parent_path/$child_name" + grand_child_path="$child_path/$grand_child_name" + + for path in $grand_child_path $child_path + do + run govc pool.destroy $path + assert_success + done +} + +@test "vm.create -pool host" { + id=$(new_id) + + path=$(govc ls host) + + run govc vm.create -on=false -pool enoent $id + assert_failure "govc: resource pool 'enoent' not found" + + run govc vm.create -on=false -pool $path $id + assert_success +} + +@test "vm.create -pool cluster" { + vcsim_env + + id=$(new_id) + + path=$(dirname $GOVC_HOST) + + unset GOVC_HOST + unset GOVC_RESOURCE_POOL + + run govc vm.create -on=false -pool enoent $id + assert_failure "govc: resource pool 'enoent' not found" + + run govc vm.create -on=false -pool $path $id + assert_success +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/test/README.md juju-core-2.0.2/src/github.com/vmware/govmomi/govc/test/README.md --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/test/README.md 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/test/README.md 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,73 @@ +# Functional tests for govc + +## Bats + +Install [Bats](https://github.com/sstephenson/bats/) + +## coreutils + +Install gxargs, greadlink and gmktemp on Darwin + +``` +brew install coreutils +brew install findutils +``` + +## Download test images + +Some tests depend on ttylinux images, these can be downloaded by running: + +``` +./images/update.sh +``` + +These images are uploaded to the esxbox as needed by tests and can be +removed with the following command: + +``` +./clean.sh +``` + +## GOVC_TEST_URL + +The govc tests need an ESX instance to run against. The default +`GOVC_TEST_URL` is that of the vagrant box in the *esxbox* directory: + +``` +(cd esxbox && vagrant up) +``` + +Any other ESX box can be used by exporting the following variable: + +``` +export GOVC_TEST_URL=user:pass@hostname +``` + +## vCenter Simulator + +Some tests require vCenter and depend on the Vagrant box in the +*vcsim* directory. These tests are skipped if the vcsim box is not +running. To enable these tests: + +``` +(cd vcsim && vagrant up) +``` + +## Running tests + +The test helper prepends ../govc to `PATH`. + +The tests can be run from any directory, as *govc* is found related to +`PATH` and *images* are found relative to `$BATS_TEST_DIRNAME`. + +The entire suite can be run with the following command: + +``` +bats . +``` + +Or individually, for example: + +``` +./cli.bats +``` diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/test/test_helper.bash juju-core-2.0.2/src/github.com/vmware/govmomi/govc/test/test_helper.bash --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/test/test_helper.bash 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/test/test_helper.bash 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,255 @@ +# set the following variables only if they've not been set +GOVC_TEST_URL=${GOVC_TEST_URL-"https://root:vagrant@localhost:18443/sdk"} +export GOVC_URL=$GOVC_TEST_URL +export GOVC_DATASTORE=${GOVC_DATASTORE-datastore1} +export GOVC_NETWORK=${GOVC_NETWORK-"VM Network"} + +export GOVC_INSECURE=true +unset GOVC_DATACENTER +unset GOVC_USERNAME +unset GOVC_PASSWORD + +if [ -z "$BATS_TEST_DIRNAME" ]; then + BATS_TEST_DIRNAME=$(dirname ${BASH_SOURCE}) +fi + +# gnu core utils +readlink=$(type -p greadlink readlink | head -1) +xargs=$(type -p gxargs xargs | head -1) +mktemp=$(type -p gmktemp mktemp | head -1) + +BATS_TEST_DIRNAME=$($readlink -nf $BATS_TEST_DIRNAME) + +GOVC_IMAGES=$BATS_TEST_DIRNAME/images +TTYLINUX_NAME=ttylinux-pc_i486-16.1 + +GOVC_TEST_VMDK_SRC=$GOVC_IMAGES/${TTYLINUX_NAME}-disk1.vmdk +GOVC_TEST_VMDK=$(basename $GOVC_TEST_VMDK_SRC) + +GOVC_TEST_ISO_SRC=$GOVC_IMAGES/${TTYLINUX_NAME}.iso +GOVC_TEST_ISO=$(basename $GOVC_TEST_ISO_SRC) + +GOVC_TEST_IMG_SRC=$GOVC_IMAGES/floppybird.img +GOVC_TEST_IMG=$(basename $GOVC_TEST_IMG_SRC) + +PATH="$(dirname $BATS_TEST_DIRNAME):$PATH" + +teardown() { + govc ls vm | grep govc-test- | $xargs -r govc vm.destroy + govc datastore.ls | grep govc-test- | awk '{print ($NF)}' | $xargs -n1 -r govc datastore.rm + govc ls "host/*/Resources/govc-test-*" | $xargs -r govc pool.destroy +} + +new_id() { + echo "govc-test-$(uuidgen)" +} + +import_ttylinux_vmdk() { + # TODO: fix datastore.ls do we don't need grep + govc datastore.ls | grep -q $GOVC_TEST_VMDK || \ + govc import.vmdk $GOVC_TEST_VMDK_SRC > /dev/null +} + +datastore_upload() { + src=$1 + dst=$(basename $src) + # TODO: fix datastore.ls do we don't need grep + govc datastore.ls | grep -q $dst || \ + govc datastore.upload $src $dst > /dev/null +} + +upload_img() { + datastore_upload $GOVC_TEST_IMG_SRC +} + +upload_iso() { + datastore_upload $GOVC_TEST_ISO_SRC +} + +new_ttylinux_vm() { + import_ttylinux_vmdk # TODO: make this part of vagrant provision + id=$(new_id) + govc vm.create -m 32 -disk $GOVC_TEST_VMDK -disk.controller ide -on=false $id + echo $id +} + +new_empty_vm() { + id=$(new_id) + govc vm.create -on=false $id + echo $id +} + +vm_power_state() { + govc vm.info "$1" | grep "Power state:" | awk -F: '{print $2}' | collapse_ws +} + +vm_mac() { + govc device.info -vm "$1" ethernet-0 | grep "MAC Address" | awk '{print $NF}' +} + +# exports an enviroment for using vcsim if running, otherwise skips the calling test. +vcsim_env() { + if [ "$(uname)" == "Darwin" ]; then + PATH="/Applications/VMware Fusion.app/Contents/Library:$PATH" + fi + + if [ "$(vmrun list | grep $BATS_TEST_DIRNAME/vcsim | wc -l)" -eq 1 ]; then + export GOVC_URL=https://root:vmware@localhost:16443/sdk \ + GOVC_DATACENTER=DC0 \ + GOVC_DATASTORE=GlobalDS_0 \ + GOVC_HOST=/DC0/host/DC0_C0/DC0_C0_H0 \ + GOVC_RESOURCE_POOL=/DC0/host/DC0_C0/Resources \ + GOVC_NETWORK=/DC0/network/DC0_DVPG0 + else + skip "requires vcsim" + fi +} + +skip_if_vca() { + if [ -n "$VCA" ]; then + skip "disabled in vCA" + fi +} + +# remove username/password from $GOVC_URL and set $GOVC_{USERNAME,PASSWORD} +govc_url_to_vars() { + GOVC_USERNAME="$(govc env GOVC_USERNAME)" + GOVC_PASSWORD="$(govc env GOVC_PASSWORD)" + GOVC_URL="$(govc env GOVC_URL)" + export GOVC_URL GOVC_USERNAME GOVC_PASSWORD + + # double check that we removed user/pass + grep -q -v @ <<<"$GOVC_URL" +} + +quit_vnc() { + if [ "$(uname)" = "Darwin" ]; then + osascript <&2 + return 1 +} + +assert_success() { + if [ "$status" -ne 0 ]; then + flunk "command failed with exit status $status: $output" + elif [ "$#" -gt 0 ]; then + assert_output "$1" + fi +} + +assert_failure() { + if [ "$status" -ne 1 ]; then + flunk $(printf "expected failed exit status=1, got status=%d" $status) + elif [ "$#" -gt 0 ]; then + assert_output "$1" + fi +} + +assert_equal() { + if [ "$1" != "$2" ]; then + { echo "expected: $1" + echo "actual: $2" + } | flunk + fi +} + +assert_output() { + local expected + if [ $# -eq 0 ]; then expected="$(cat -)" + else expected="$1" + fi + assert_equal "$expected" "$output" +} + +assert_matches() { + local pattern="${1}" + local actual="${2}" + + if [ $# -eq 1 ]; then + actual="$(cat -)" + fi + + if ! grep -q "${pattern}" <<<"${actual}"; then + { echo "pattern: ${pattern}" + echo "actual: ${actual}" + } | flunk + fi +} + +assert_empty() { + local actual="${1}" + + if [ $# -eq 0 ]; then + actual="$(cat -)" + fi + + if [ -n "${actual}" ]; then + { echo "actual: ${actual}" + } | flunk + fi +} + +assert_line() { + if [ "$1" -ge 0 ] 2>/dev/null; then + assert_equal "$2" "$(collapse_ws ${lines[$1]})" + else + local line + for line in "${lines[@]}"; do + if [ "$(collapse_ws $line)" = "$1" ]; then return 0; fi + done + flunk "expected line \`$1'" + fi +} + +refute_line() { + if [ "$1" -ge 0 ] 2>/dev/null; then + local num_lines="${#lines[@]}" + if [ "$1" -lt "$num_lines" ]; then + flunk "output has $num_lines lines" + fi + else + local line + for line in "${lines[@]}"; do + if [ "$line" = "$1" ]; then + flunk "expected to not find line \`$line'" + fi + done + fi +} + +assert() { + if ! "$@"; then + flunk "failed: $@" + fi +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/test/vcsim/provision.sh juju-core-2.0.2/src/github.com/vmware/govmomi/govc/test/vcsim/provision.sh --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/test/vcsim/provision.sh 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/test/vcsim/provision.sh 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,30 @@ +PATH=$PATH:/sbin:/usr/sbin:/usr/local/sbin + +echo "Creating vcsim model..." +cat > /etc/vmware-vpx/vcsim/model/initInventory-govc.cfg < + + 2 + 3 + 3 + 2 + 2 + 3 + 3 + 4 + 3 + 2 + + +EOF + +cat > /etc/vmware-vpx/vcsim/model/vcsim-default.cfg < +true +vcsim/model/initInventory-govc.cfg + +EOF + +echo "Starting VC simulator..." +vmware-vcsim-stop +vmware-vcsim-start default diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/test/vcsim/Vagrantfile juju-core-2.0.2/src/github.com/vmware/govmomi/govc/test/vcsim/Vagrantfile --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/test/vcsim/Vagrantfile 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/test/vcsim/Vagrantfile 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,24 @@ +# -*- mode: ruby -*- +# vi: set ft=ruby : + +# VCSA with VC simulator enabled. +# 'vagrant provision' will erase any existing inventory and +# populate with the config in ./provision.sh + +Vagrant.configure("2") do |config| + config.vm.hostname = "vcsim" + + config.vm.box = "vcsa" + config.vm.synced_folder ".", "/vagrant", disabled: true + + config.vm.provision "shell", path: "provision.sh" + + config.vm.network "forwarded_port", guest: 443, host: 16443 + config.vm.network "forwarded_port", guest: 80, host: 16080 + + [:vmware_fusion, :vmware_workstation].each do |name| + config.vm.provider name do |v,override| + v.vmx["memsize"] = "4096" + end + end +end diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/test/vm.bats juju-core-2.0.2/src/github.com/vmware/govmomi/govc/test/vm.bats --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/test/vm.bats 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/test/vm.bats 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,437 @@ +#!/usr/bin/env bats + +load test_helper + +@test "vm.ip" { + skip_if_vca + id=$(new_ttylinux_vm) + + run govc vm.power -on $id + assert_success + + run govc vm.ip $id + assert_success + + run govc vm.ip -a -v4 $id + assert_success +} + +@test "vm.ip -esxcli" { + skip_if_vca + id=$(new_ttylinux_vm) + + run govc vm.power -on $id + assert_success + + run govc vm.ip -esxcli $id + assert_success + + ip_esxcli=$output + + run govc vm.ip $id + assert_success + ip_tools=$output + + assert_equal $ip_esxcli $ip_tools +} + +@test "vm.create" { + id=$(new_ttylinux_vm) + + run govc vm.power -on $id + assert_success + + result=$(govc device.ls -vm $vm | grep disk- | wc -l) + [ $result -eq 0 ] + + result=$(govc device.ls -vm $vm | grep cdrom- | wc -l) + [ $result -eq 0 ] +} + +@test "vm.change" { + id=$(new_ttylinux_vm) + + run govc vm.change -g ubuntu64Guest -m 1024 -c 2 -vm $id + assert_success + + run govc vm.info $id + assert_success + assert_line "Guest name: Ubuntu Linux (64-bit)" + assert_line "Memory: 1024MB" + assert_line "CPU: 2 vCPU(s)" + + run govc vm.change -e "guestinfo.a=1" -e "guestinfo.b=2" -vm $id + assert_success + + run govc vm.info -e $id + assert_success + assert_line "guestinfo.a: 1" + assert_line "guestinfo.b: 2" + + nid=$(new_id) + run govc vm.change -name $nid -vm $id + assert_success + + run govc vm.info $id + [ ${#lines[@]} -eq 0 ] + + run govc vm.info $nid + [ ${#lines[@]} -gt 0 ] +} + +@test "vm.power" { + vm=$(new_ttylinux_vm) + + run vm_power_state $vm + assert_success "poweredOff" + + run govc vm.power $vm + assert_failure + + run govc vm.power -on -off $vm + assert_failure + + run govc vm.power -on $vm + assert_success + run vm_power_state $vm + assert_success "poweredOn" + + run govc vm.power -suspend $vm + assert_success + run vm_power_state $vm + assert_success "suspended" + + run govc vm.power -on $vm + assert_success + run vm_power_state $vm + assert_success "poweredOn" +} + +@test "vm.power -force" { + vm=$(new_id) + govc vm.create $vm + + run govc vm.power -r $vm + assert_failure + + run govc vm.power -r -force $vm + assert_success + + run govc vm.power -s $vm + assert_failure + + run govc vm.power -s -force $vm + assert_success + + run govc vm.power -off $vm + assert_failure + + run govc vm.power -off -force $vm + assert_success + + run govc vm.destroy $vm + assert_success + + run govc vm.power -off $vm + assert_failure + + run govc vm.power -off -force $vm + assert_failure +} + +@test "vm.create pvscsi" { + vm=$(new_id) + govc vm.create -on=false -disk.controller pvscsi $vm + + result=$(govc device.ls -vm $vm | grep pvscsi- | wc -l) + [ $result -eq 1 ] + + result=$(govc device.ls -vm $vm | grep lsilogic- | wc -l) + [ $result -eq 0 ] + + vm=$(new_id) + govc vm.create -on=false -disk.controller pvscsi -disk=1GB $vm +} + +@test "vm.create in cluster" { + vcsim_env + + # using GOVC_HOST and its resource pool + run govc vm.create -on=false $(new_id) + assert_success + + # using no -host and the default resource pool for DC0 + unset GOVC_HOST + run govc vm.create -on=false $(new_id) + assert_success +} + +@test "vm.info" { + local num=3 + + local prefix=$(new_id) + + for x in $(seq $num) + do + local id="${prefix}-${x}" + + # If VM is not found: No output, exit code==0 + run govc vm.info $id + assert_success + [ ${#lines[@]} -eq 0 ] + + # If VM is not found (using -json flag): Valid json output, exit code==0 + run govc vm.info -json $id + assert_success + assert_line "{\"VirtualMachines\":null}" + + run govc vm.create -on=false $id + assert_success + + local info=$(govc vm.info -r $id) + local found=$(grep Name: <<<"$info" | wc -l) + [ "$found" -eq 1 ] + + # test that mo names are printed + found=$(grep Host: <<<"$info" | awk '{print $2}') + [ -n "$found" ] + found=$(grep Storage: <<<"$info" | awk '{print $2}') + [ -n "$found" ] + found=$(grep Network: <<<"$info" | awk '{print $2}') + [ -n "$found" ] + done + + # test find slice + local slice=$(govc vm.info ${prefix}-*) + local found=$(grep Name: <<<"$slice" | wc -l) + [ "$found" -eq $num ] + + # test -r + found=$(grep Storage: <<<"$slice" | wc -l) + [ "$found" -eq 0 ] + found=$(grep Network: <<<"$slice" | wc -l) + [ "$found" -eq 0 ] + slice=$(govc vm.info -r ${prefix}-*) + found=$(grep Storage: <<<"$slice" | wc -l) + [ "$found" -eq $num ] + found=$(grep Network: <<<"$slice" | wc -l) + [ "$found" -eq $num ] + + # test extraConfig + run govc vm.change -e "guestinfo.a=2" -vm $id + assert_success + run govc vm.info -e $id + assert_success + assert_line "guestinfo.a: 2" +} + +@test "vm.create linked ide disk" { + import_ttylinux_vmdk + + vm=$(new_id) + + run govc vm.create -disk $GOVC_TEST_VMDK -disk.controller ide -on=false $vm + assert_success + + run govc device.info -vm $vm disk-200-0 + assert_success + assert_line "Controller: ide-200" +} + +@test "vm.create linked scsi disk" { + import_ttylinux_vmdk + + vm=$(new_id) + + run govc vm.create -disk enoent -on=false $vm + assert_failure "govc: cannot stat '[${GOVC_DATASTORE##*/}] enoent': No such file" + + run govc vm.create -disk $GOVC_TEST_VMDK -on=false $vm + assert_success + + run govc device.info -vm $vm disk-1000-0 + assert_success + assert_line "Controller: lsilogic-1000" + assert_line "Parent: [${GOVC_DATASTORE##*/}] $GOVC_TEST_VMDK" + assert_line "File: [${GOVC_DATASTORE##*/}] $vm/${vm}.vmdk" +} + +@test "vm.create scsi disk" { + import_ttylinux_vmdk + + vm=$(new_id) + + run govc vm.create -disk enoent -on=false $vm + assert_failure "govc: cannot stat '[${GOVC_DATASTORE##*/}] enoent': No such file" + + + run govc vm.create -disk $GOVC_TEST_VMDK -on=false -link=false $vm + assert_success + + run govc device.info -vm $vm disk-1000-0 + assert_success + assert_line "Controller: lsilogic-1000" + refute_line "Parent: [${GOVC_DATASTORE##*/}] $GOVC_TEST_VMDK" + assert_line "File: [${GOVC_DATASTORE##*/}] $GOVC_TEST_VMDK" +} + +@test "vm.create scsi disk with datastore argument" { + import_ttylinux_vmdk + + vm=$(new_id) + + run govc vm.create -disk="${GOVC_TEST_VMDK}" -disk-datastore="${GOVC_DATASTORE}" -on=false -link=false $vm + assert_success + + run govc device.info -vm $vm disk-1000-0 + assert_success + assert_line "File: [${GOVC_DATASTORE##*/}] $GOVC_TEST_VMDK" +} + +@test "vm.create iso" { + upload_iso + + vm=$(new_id) + + run govc vm.create -iso enoent -on=false $vm + assert_failure "govc: cannot stat '[${GOVC_DATASTORE##*/}] enoent': No such file" + + run govc vm.create -iso $GOVC_TEST_ISO -on=false $vm + assert_success + + run govc device.info -vm $vm cdrom-3000 + assert_success + assert_line "Controller: ide-200" + assert_line "Summary: ISO [${GOVC_DATASTORE##*/}] $GOVC_TEST_ISO" +} + +@test "vm.create iso with datastore argument" { + upload_iso + + vm=$(new_id) + + run govc vm.create -iso="${GOVC_TEST_ISO}" -iso-datastore="${GOVC_DATASTORE}" -on=false $vm + assert_success + + run govc device.info -vm $vm cdrom-3000 + assert_success + assert_line "Summary: ISO [${GOVC_DATASTORE##*/}] $GOVC_TEST_ISO" +} + +@test "vm.disk.create empty vm" { + vm=$(new_empty_vm) + + local name=$(new_id) + + run govc vm.disk.create -vm $vm -name $name -size 1G + assert_success + result=$(govc device.ls -vm $vm | grep disk- | wc -l) + [ $result -eq 1 ] + + name=$(new_id) + + run govc vm.disk.create -vm $vm -name $name -controller lsilogic-1000 -size 2G + assert_success + result=$(govc device.ls -vm $vm | grep disk- | wc -l) + [ $result -eq 2 ] +} + +@test "vm.disk.create" { + import_ttylinux_vmdk + + vm=$(new_id) + + govc vm.create -disk $GOVC_TEST_VMDK -on=false $vm + result=$(govc device.ls -vm $vm | grep disk- | wc -l) + [ $result -eq 1 ] + + local name=$(new_id) + + run govc vm.disk.create -vm $vm -name $name -size 1G + assert_success + result=$(govc device.ls -vm $vm | grep disk- | wc -l) + [ $result -eq 2 ] + + run govc vm.disk.create -vm $vm -name $name -size 1G + assert_success # TODO: should fail? + result=$(govc device.ls -vm $vm | grep disk- | wc -l) + [ $result -eq 2 ] +} + +@test "vm.disk.attach" { + import_ttylinux_vmdk + + vm=$(new_id) + + govc vm.create -disk $GOVC_TEST_VMDK -on=false $vm + result=$(govc device.ls -vm $vm | grep disk- | wc -l) + [ $result -eq 1 ] + + run govc import.vmdk $GOVC_TEST_VMDK_SRC $vm + assert_success + + run govc vm.disk.attach -vm $vm -link=false -disk enoent.vmdk + assert_failure "govc: File [${GOVC_DATASTORE##*/}] enoent.vmdk was not found" + + run govc vm.disk.attach -vm $vm -disk enoent.vmdk + assert_failure "govc: Invalid configuration for device '0'." + + run govc vm.disk.attach -vm $vm -disk $vm/$GOVC_TEST_VMDK -controller lsilogic-1000 + assert_success + result=$(govc device.ls -vm $vm | grep disk- | wc -l) + [ $result -eq 2 ] +} + +@test "vm.create new disk with datastore argument" { + vm=$(new_id) + + run govc vm.create -disk="1GiB" -ds="${GOVC_DATASTORE}" -on=false -link=false $vm + assert_success + + run govc device.info -vm $vm disk-1000-0 + assert_success + assert_line "File: [${GOVC_DATASTORE##*/}] ${vm}/${vm}.vmdk" +} + +@test "vm.create new disk with datastore cluster argument" { + if [ -z "${GOVC_DATASTORE_CLUSTER}" ]; then + skip "requires datastore cluster" + fi + + vm=$(new_id) + + run govc vm.create -disk="1GiB" -datastore-cluster="${GOVC_DATASTORE_CLUSTER}" -on=false -link=false $vm + assert_success + + run govc device.info -vm $vm disk-1000-0 + assert_success +} + +@test "vm.clone" { + vcsim_env + vm=$(new_ttylinux_vm) + clone=$(new_id) + + run govc vm.clone -vm $vm $clone + assert_success + + result=$(govc device.ls -vm $clone | grep disk- | wc -l) + [ $result -eq 0 ] + + result=$(govc device.ls -vm $clone | grep cdrom- | wc -l) + [ $result -eq 0 ] +} + +@test "vm.clone change resources" { + vcsim_env + vm=$(new_ttylinux_vm) + clone=$(new_id) + + run govc vm.clone -m 1024 -c 2 -vm $vm $clone + assert_success + + run govc vm.info $clone + assert_success + assert_line "Memory: 1024MB" + assert_line "CPU: 2 vCPU(s)" +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/vapp/destroy.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/vapp/destroy.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/vapp/destroy.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/vapp/destroy.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,95 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package vapp + +import ( + "flag" + + "github.com/vmware/govmomi/find" + "github.com/vmware/govmomi/govc/cli" + "github.com/vmware/govmomi/govc/flags" + "golang.org/x/net/context" +) + +type destroy struct { + *flags.DatacenterFlag +} + +func init() { + cli.Register("vapp.destroy", &destroy{}) +} + +func (cmd *destroy) Register(ctx context.Context, f *flag.FlagSet) { + cmd.DatacenterFlag, ctx = flags.NewDatacenterFlag(ctx) + cmd.DatacenterFlag.Register(ctx, f) +} + +func (cmd *destroy) Process(ctx context.Context) error { + if err := cmd.DatacenterFlag.Process(ctx); err != nil { + return err + } + return nil +} + +func (cmd *destroy) Usage() string { + return "VAPP..." +} + +func (cmd *destroy) Run(ctx context.Context, f *flag.FlagSet) error { + if f.NArg() == 0 { + return flag.ErrHelp + } + + finder, err := cmd.Finder() + if err != nil { + return err + } + + for _, arg := range f.Args() { + vapps, err := finder.VirtualAppList(context.TODO(), arg) + if err != nil { + if _, ok := err.(*find.NotFoundError); ok { + // Ignore if vapp cannot be found + continue + } + + return err + } + + for _, vapp := range vapps { + task, err := vapp.PowerOffVApp_Task(context.TODO(), false) + if err != nil { + return err + } + err = task.Wait(context.TODO()) + if err != nil { + return err + } + + task, err = vapp.Destroy(context.TODO()) + if err != nil { + return err + } + err = task.Wait(context.TODO()) + if err != nil { + return err + } + } + } + + return nil +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/vapp/power.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/vapp/power.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/vapp/power.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/vapp/power.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,112 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package vapp + +import ( + "flag" + "fmt" + + "github.com/vmware/govmomi/govc/cli" + "github.com/vmware/govmomi/govc/flags" + "github.com/vmware/govmomi/object" + "golang.org/x/net/context" +) + +type power struct { + *flags.SearchFlag + + On bool + Off bool + Suspend bool + Force bool +} + +func init() { + cli.Register("vapp.power", &power{}) +} + +func (cmd *power) Register(ctx context.Context, f *flag.FlagSet) { + cmd.SearchFlag, ctx = flags.NewSearchFlag(ctx, flags.SearchVirtualApps) + cmd.SearchFlag.Register(ctx, f) + + f.BoolVar(&cmd.On, "on", false, "Power on") + f.BoolVar(&cmd.Off, "off", false, "Power off") + f.BoolVar(&cmd.Suspend, "suspend", false, "Power suspend") + f.BoolVar(&cmd.Force, "force", false, "Force (If force is false, the shutdown order in the vApp is executed. If force is true, all virtual machines are powered-off (regardless of shutdown order))") +} + +func (cmd *power) Process(ctx context.Context) error { + if err := cmd.SearchFlag.Process(ctx); err != nil { + return err + } + opts := []bool{cmd.On, cmd.Off, cmd.Suspend} + selected := false + + for _, opt := range opts { + if opt { + if selected { + return flag.ErrHelp + } + selected = opt + } + } + + if !selected { + return flag.ErrHelp + } + + return nil +} + +func (cmd *power) Run(ctx context.Context, f *flag.FlagSet) error { + vapps, err := cmd.VirtualApps(f.Args()) + if err != nil { + return err + } + + for _, vapp := range vapps { + var task *object.Task + + switch { + case cmd.On: + fmt.Fprintf(cmd, "Powering on %s... ", vapp.Reference()) + task, err = vapp.PowerOnVApp_Task(context.TODO()) + case cmd.Off: + fmt.Fprintf(cmd, "Powering off %s... ", vapp.Reference()) + task, err = vapp.PowerOffVApp_Task(context.TODO(), cmd.Force) + case cmd.Suspend: + fmt.Fprintf(cmd, "Suspend %s... ", vapp.Reference()) + task, err = vapp.SuspendVApp_Task(context.TODO()) + } + + if err != nil { + return err + } + + if task != nil { + err = task.Wait(context.TODO()) + } + if err == nil { + fmt.Fprintf(cmd, "OK\n") + continue + } + + return err + } + + return nil +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/version/command.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/version/command.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/version/command.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/version/command.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,72 @@ +/* +Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package version + +import ( + "flag" + "fmt" + "log" + + "golang.org/x/net/context" + + "github.com/vmware/govmomi/govc/cli" + "github.com/vmware/govmomi/govc/flags" +) + +const Version = "0.8.0" + +var gitVersion string + +type version struct { + *flags.EmptyFlag + + require string +} + +func init() { + // Check that git tag in the release builds match the hardcoded version + if gitVersion != "" && gitVersion[1:] != Version { + log.Panicf("version mismatch: git=%s vs govc=%s", gitVersion, Version) + } + + cli.Register("version", &version{}) +} + +func (cmd *version) Register(ctx context.Context, f *flag.FlagSet) { + f.StringVar(&cmd.require, "require", "", "Require govc version >= this value") +} + +func (cmd *version) Run(ctx context.Context, f *flag.FlagSet) error { + if cmd.require != "" { + v, err := flags.ParseVersion(Version) + if err != nil { + panic(err) + } + + rv, err := flags.ParseVersion(cmd.require) + if err != nil { + return fmt.Errorf("failed to parse required version '%s': %s", cmd.require, err) + } + + if !rv.Lte(v) { + return fmt.Errorf("version %s or higher is required, this is version %s", cmd.require, Version) + } + } + + fmt.Printf("govc %s\n", Version) + return nil +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/vm/change.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/vm/change.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/vm/change.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/vm/change.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,98 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package vm + +import ( + "flag" + "fmt" + "strings" + + "github.com/vmware/govmomi/govc/cli" + "github.com/vmware/govmomi/govc/flags" + "github.com/vmware/govmomi/vim25/types" + "golang.org/x/net/context" +) + +type extraConfig []types.BaseOptionValue + +func (e *extraConfig) String() string { + return fmt.Sprintf("%v", *e) +} + +func (e *extraConfig) Set(v string) error { + r := strings.SplitN(v, "=", 2) + if len(r) < 2 { + return fmt.Errorf("failed to parse extraConfig: %s", v) + } else if r[1] == "" { + return fmt.Errorf("empty value: %s", v) + } + *e = append(*e, &types.OptionValue{Key: r[0], Value: r[1]}) + return nil +} + +type change struct { + *flags.VirtualMachineFlag + + types.VirtualMachineConfigSpec + extraConfig extraConfig +} + +func init() { + cli.Register("vm.change", &change{}) +} + +func (cmd *change) Register(ctx context.Context, f *flag.FlagSet) { + cmd.VirtualMachineFlag, ctx = flags.NewVirtualMachineFlag(ctx) + cmd.VirtualMachineFlag.Register(ctx, f) + + f.Int64Var(&cmd.MemoryMB, "m", 0, "Size in MB of memory") + f.Var(flags.NewInt32(&cmd.NumCPUs), "c", "Number of CPUs") + f.StringVar(&cmd.GuestId, "g", "", "Guest OS") + f.StringVar(&cmd.Name, "name", "", "Display name") + f.Var(&cmd.extraConfig, "e", "ExtraConfig. =") + + f.Var(flags.NewOptionalBool(&cmd.NestedHVEnabled), "nested-hv-enabled", "Enable nested hardware-assisted virtualization") +} + +func (cmd *change) Process(ctx context.Context) error { + if err := cmd.VirtualMachineFlag.Process(ctx); err != nil { + return err + } + return nil +} + +func (cmd *change) Run(ctx context.Context, f *flag.FlagSet) error { + vm, err := cmd.VirtualMachine() + if err != nil { + return err + } + + if vm == nil { + return flag.ErrHelp + } + + if len(cmd.extraConfig) > 0 { + cmd.VirtualMachineConfigSpec.ExtraConfig = cmd.extraConfig + } + + task, err := vm.Reconfigure(context.TODO(), cmd.VirtualMachineConfigSpec) + if err != nil { + return err + } + + return task.Wait(context.TODO()) +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/vm/clone.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/vm/clone.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/vm/clone.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/vm/clone.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,383 @@ +/* +Copyright (c) 2014-2016 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package vm + +import ( + "flag" + "fmt" + + "github.com/vmware/govmomi/govc/cli" + "github.com/vmware/govmomi/govc/flags" + "github.com/vmware/govmomi/object" + "github.com/vmware/govmomi/vim25" + "github.com/vmware/govmomi/vim25/types" + "golang.org/x/net/context" +) + +type clone struct { + *flags.ClientFlag + *flags.DatacenterFlag + *flags.DatastoreFlag + *flags.StoragePodFlag + *flags.ResourcePoolFlag + *flags.HostSystemFlag + *flags.NetworkFlag + *flags.FolderFlag + *flags.VirtualMachineFlag + + name string + memory int + cpus int + on bool + force bool + template bool + customization string + waitForIP bool + + Client *vim25.Client + Datacenter *object.Datacenter + Datastore *object.Datastore + StoragePod *object.StoragePod + ResourcePool *object.ResourcePool + HostSystem *object.HostSystem + Folder *object.Folder + VirtualMachine *object.VirtualMachine +} + +func init() { + cli.Register("vm.clone", &clone{}) +} + +func (cmd *clone) Register(ctx context.Context, f *flag.FlagSet) { + cmd.ClientFlag, ctx = flags.NewClientFlag(ctx) + cmd.ClientFlag.Register(ctx, f) + + cmd.DatacenterFlag, ctx = flags.NewDatacenterFlag(ctx) + cmd.DatacenterFlag.Register(ctx, f) + + cmd.DatastoreFlag, ctx = flags.NewDatastoreFlag(ctx) + cmd.DatastoreFlag.Register(ctx, f) + + cmd.StoragePodFlag, ctx = flags.NewStoragePodFlag(ctx) + cmd.StoragePodFlag.Register(ctx, f) + + cmd.ResourcePoolFlag, ctx = flags.NewResourcePoolFlag(ctx) + cmd.ResourcePoolFlag.Register(ctx, f) + + cmd.HostSystemFlag, ctx = flags.NewHostSystemFlag(ctx) + cmd.HostSystemFlag.Register(ctx, f) + + cmd.NetworkFlag, ctx = flags.NewNetworkFlag(ctx) + cmd.NetworkFlag.Register(ctx, f) + + cmd.FolderFlag, ctx = flags.NewFolderFlag(ctx) + cmd.FolderFlag.Register(ctx, f) + + cmd.VirtualMachineFlag, ctx = flags.NewVirtualMachineFlag(ctx) + cmd.VirtualMachineFlag.Register(ctx, f) + + f.IntVar(&cmd.memory, "m", 0, "Size in MB of memory") + f.IntVar(&cmd.cpus, "c", 0, "Number of CPUs") + f.BoolVar(&cmd.on, "on", true, "Power on VM. Default is true if -disk argument is given.") + f.BoolVar(&cmd.force, "force", false, "Create VM if vmx already exists") + f.BoolVar(&cmd.template, "template", false, "Create a Template") + f.StringVar(&cmd.customization, "customization", "", "Customization Specification Name") + f.BoolVar(&cmd.waitForIP, "waitip", false, "Wait for VM to acquire IP address") +} + +func (cmd *clone) Process(ctx context.Context) error { + if err := cmd.ClientFlag.Process(ctx); err != nil { + return err + } + if err := cmd.DatacenterFlag.Process(ctx); err != nil { + return err + } + if err := cmd.DatastoreFlag.Process(ctx); err != nil { + return err + } + if err := cmd.StoragePodFlag.Process(ctx); err != nil { + return err + } + if err := cmd.ResourcePoolFlag.Process(ctx); err != nil { + return err + } + if err := cmd.HostSystemFlag.Process(ctx); err != nil { + return err + } + if err := cmd.NetworkFlag.Process(ctx); err != nil { + return err + } + if err := cmd.FolderFlag.Process(ctx); err != nil { + return err + } + if err := cmd.VirtualMachineFlag.Process(ctx); err != nil { + return err + } + + return nil +} + +func (cmd *clone) Run(ctx context.Context, f *flag.FlagSet) error { + var err error + + if len(f.Args()) != 1 { + return flag.ErrHelp + } + + cmd.name = f.Arg(0) + if cmd.name == "" { + return flag.ErrHelp + } + + cmd.Client, err = cmd.ClientFlag.Client() + if err != nil { + return err + } + + cmd.Datacenter, err = cmd.DatacenterFlag.Datacenter() + if err != nil { + return err + } + + if cmd.StoragePodFlag.Isset() { + cmd.StoragePod, err = cmd.StoragePodFlag.StoragePod() + if err != nil { + return err + } + } else { + cmd.Datastore, err = cmd.DatastoreFlag.Datastore() + if err != nil { + return err + } + } + + cmd.HostSystem, err = cmd.HostSystemFlag.HostSystemIfSpecified() + if err != nil { + return err + } + + if cmd.HostSystem != nil { + if cmd.ResourcePool, err = cmd.HostSystem.ResourcePool(context.TODO()); err != nil { + return err + } + } else { + // -host is optional + if cmd.ResourcePool, err = cmd.ResourcePoolFlag.ResourcePool(); err != nil { + return err + } + } + + if cmd.Folder, err = cmd.FolderFlag.Folder(); err != nil { + return err + } + + if cmd.VirtualMachine, err = cmd.VirtualMachineFlag.VirtualMachine(); err != nil { + return err + } + + task, err := cmd.cloneVM(context.TODO()) + if err != nil { + return err + } + + info, err := task.WaitForResult(context.TODO(), nil) + if err != nil { + return err + } + + vm := object.NewVirtualMachine(cmd.Client, info.Result.(types.ManagedObjectReference)) + + if cmd.cpus > 0 || cmd.memory > 0 { + vmConfigSpec := types.VirtualMachineConfigSpec{} + if cmd.cpus > 0 { + vmConfigSpec.NumCPUs = int32(cmd.cpus) + } + if cmd.memory > 0 { + vmConfigSpec.MemoryMB = int64(cmd.memory) + } + task, err := vm.Reconfigure(context.TODO(), vmConfigSpec) + if err != nil { + return err + } + _, err = task.WaitForResult(context.TODO(), nil) + if err != nil { + return err + } + } + + if cmd.on { + task, err := vm.PowerOn(context.TODO()) + if err != nil { + return err + } + + _, err = task.WaitForResult(context.TODO(), nil) + if err != nil { + return err + } + + if cmd.waitForIP { + _, err = vm.WaitForIP(ctx) + if err != nil { + return err + } + } + } + + return nil +} + +func (cmd *clone) cloneVM(ctx context.Context) (*object.Task, error) { + + // search for the first network card of the source + devices, err := cmd.VirtualMachine.Device(ctx) + if err != nil { + return nil, err + } + var card *types.VirtualEthernetCard + for _, device := range devices { + if c, ok := device.(types.BaseVirtualEthernetCard); ok { + card = c.GetVirtualEthernetCard() + break + } + } + if card == nil { + return nil, fmt.Errorf("No network device found.") + } + + // get the new backing information + dev, err := cmd.NetworkFlag.Device() + if err != nil { + return nil, err + } + + //set backing info + card.Backing = dev.(types.BaseVirtualEthernetCard).GetVirtualEthernetCard().Backing + + // prepare virtual device config spec for network card + configSpecs := []types.BaseVirtualDeviceConfigSpec{ + &types.VirtualDeviceConfigSpec{ + Operation: types.VirtualDeviceConfigSpecOperationEdit, + Device: card, + }, + } + + folderref := cmd.Folder.Reference() + poolref := cmd.ResourcePool.Reference() + + relocateSpec := types.VirtualMachineRelocateSpec{ + DeviceChange: configSpecs, + Folder: &folderref, + Pool: &poolref, + } + + if cmd.HostSystem != nil { + hostref := cmd.HostSystem.Reference() + relocateSpec.Host = &hostref + } + + cloneSpec := &types.VirtualMachineCloneSpec{ + Location: relocateSpec, + PowerOn: false, + Template: cmd.template, + } + + // clone to storage pod + datastoreref := types.ManagedObjectReference{} + if cmd.StoragePod != nil && cmd.Datastore == nil { + storagePod := cmd.StoragePod.Reference() + + // Build pod selection spec from config spec + podSelectionSpec := types.StorageDrsPodSelectionSpec{ + StoragePod: &storagePod, + } + + // Get the virtual machine reference + vmref := cmd.VirtualMachine.Reference() + + // Build the placement spec + storagePlacementSpec := types.StoragePlacementSpec{ + Folder: &folderref, + Vm: &vmref, + CloneName: cmd.name, + CloneSpec: cloneSpec, + PodSelectionSpec: podSelectionSpec, + Type: string(types.StoragePlacementSpecPlacementTypeClone), + } + + // Get the storage placement result + storageResourceManager := object.NewStorageResourceManager(cmd.Client) + result, err := storageResourceManager.RecommendDatastores(ctx, storagePlacementSpec) + if err != nil { + return nil, err + } + + // Get the recommendations + recommendations := result.Recommendations + if len(recommendations) == 0 { + return nil, fmt.Errorf("no recommendations") + } + + // Get the first recommendation + datastoreref = recommendations[0].Action[0].(*types.StoragePlacementAction).Destination + } else if cmd.StoragePod == nil && cmd.Datastore != nil { + datastoreref = cmd.Datastore.Reference() + } else { + return nil, fmt.Errorf("Please provide either a datastore or a storagepod") + } + + // Set the destination datastore + cloneSpec.Location.Datastore = &datastoreref + + // Check if vmx already exists + if !cmd.force { + vmxPath := fmt.Sprintf("%s/%s.vmx", cmd.name, cmd.name) + + datastore := object.NewDatastore(cmd.Client, datastoreref) + + _, err := datastore.Stat(ctx, vmxPath) + if err == nil { + dsPath := cmd.Datastore.Path(vmxPath) + return nil, fmt.Errorf("File %s already exists", dsPath) + } + } + + // check if customization specification requested + if len(cmd.customization) > 0 { + // get the customization spec manager + customizationSpecManager := object.NewCustomizationSpecManager(cmd.Client) + // check if customization specification exists + exists, err := customizationSpecManager.DoesCustomizationSpecExist(ctx, cmd.customization) + if err != nil { + return nil, err + } + if exists == false { + return nil, fmt.Errorf("Customization specification %s does not exists.", cmd.customization) + } + // get the customization specification + customSpecItem, err := customizationSpecManager.GetCustomizationSpec(ctx, cmd.customization) + if err != nil { + return nil, err + } + customSpec := customSpecItem.Spec + // set the customization + cloneSpec.Customization = &customSpec + } + + // clone virtualmachine + return cmd.VirtualMachine.Clone(ctx, cmd.Folder, cmd.name, *cloneSpec) +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/vm/create.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/vm/create.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/vm/create.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/vm/create.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,494 @@ +/* +Copyright (c) 2014-2016 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package vm + +import ( + "flag" + "fmt" + + "github.com/vmware/govmomi/govc/cli" + "github.com/vmware/govmomi/govc/flags" + "github.com/vmware/govmomi/object" + "github.com/vmware/govmomi/property" + "github.com/vmware/govmomi/units" + "github.com/vmware/govmomi/vim25" + "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/types" + "golang.org/x/net/context" +) + +type create struct { + *flags.ClientFlag + *flags.DatacenterFlag + *flags.DatastoreFlag + *flags.StoragePodFlag + *flags.ResourcePoolFlag + *flags.HostSystemFlag + *flags.NetworkFlag + *flags.FolderFlag + + name string + memory int + cpus int + guestID string + link bool + on bool + force bool + controller string + + iso string + isoDatastoreFlag *flags.DatastoreFlag + isoDatastore *object.Datastore + + disk string + diskDatastoreFlag *flags.DatastoreFlag + diskDatastore *object.Datastore + + // Only set if the disk argument is a byte size, which means the disk + // doesn't exist yet and should be created + diskByteSize int64 + + Client *vim25.Client + Datacenter *object.Datacenter + Datastore *object.Datastore + StoragePod *object.StoragePod + ResourcePool *object.ResourcePool + HostSystem *object.HostSystem + Folder *object.Folder +} + +func init() { + cli.Register("vm.create", &create{}) +} + +func (cmd *create) Register(ctx context.Context, f *flag.FlagSet) { + cmd.ClientFlag, ctx = flags.NewClientFlag(ctx) + cmd.ClientFlag.Register(ctx, f) + + cmd.DatacenterFlag, ctx = flags.NewDatacenterFlag(ctx) + cmd.DatacenterFlag.Register(ctx, f) + + cmd.DatastoreFlag, ctx = flags.NewDatastoreFlag(ctx) + cmd.DatastoreFlag.Register(ctx, f) + + cmd.StoragePodFlag, ctx = flags.NewStoragePodFlag(ctx) + cmd.StoragePodFlag.Register(ctx, f) + + cmd.ResourcePoolFlag, ctx = flags.NewResourcePoolFlag(ctx) + cmd.ResourcePoolFlag.Register(ctx, f) + + cmd.HostSystemFlag, ctx = flags.NewHostSystemFlag(ctx) + cmd.HostSystemFlag.Register(ctx, f) + + cmd.NetworkFlag, ctx = flags.NewNetworkFlag(ctx) + cmd.NetworkFlag.Register(ctx, f) + + cmd.FolderFlag, ctx = flags.NewFolderFlag(ctx) + cmd.FolderFlag.Register(ctx, f) + + f.IntVar(&cmd.memory, "m", 1024, "Size in MB of memory") + f.IntVar(&cmd.cpus, "c", 1, "Number of CPUs") + f.StringVar(&cmd.guestID, "g", "otherGuest", "Guest OS") + f.BoolVar(&cmd.link, "link", true, "Link specified disk") + f.BoolVar(&cmd.on, "on", true, "Power on VM. Default is true if -disk argument is given.") + f.BoolVar(&cmd.force, "force", false, "Create VM if vmx already exists") + f.StringVar(&cmd.controller, "disk.controller", "scsi", "Disk controller type") + + f.StringVar(&cmd.iso, "iso", "", "ISO path") + cmd.isoDatastoreFlag, ctx = flags.NewCustomDatastoreFlag(ctx) + f.StringVar(&cmd.isoDatastoreFlag.Name, "iso-datastore", "", "Datastore for ISO file") + + f.StringVar(&cmd.disk, "disk", "", "Disk path (to use existing) OR size (to create new, e.g. 20GB)") + cmd.diskDatastoreFlag, ctx = flags.NewCustomDatastoreFlag(ctx) + f.StringVar(&cmd.diskDatastoreFlag.Name, "disk-datastore", "", "Datastore for disk file") +} + +func (cmd *create) Process(ctx context.Context) error { + if err := cmd.ClientFlag.Process(ctx); err != nil { + return err + } + if err := cmd.DatacenterFlag.Process(ctx); err != nil { + return err + } + if err := cmd.DatastoreFlag.Process(ctx); err != nil { + return err + } + if err := cmd.StoragePodFlag.Process(ctx); err != nil { + return err + } + if err := cmd.ResourcePoolFlag.Process(ctx); err != nil { + return err + } + if err := cmd.HostSystemFlag.Process(ctx); err != nil { + return err + } + if err := cmd.NetworkFlag.Process(ctx); err != nil { + return err + } + if err := cmd.FolderFlag.Process(ctx); err != nil { + return err + } + + // Default iso/disk datastores to the VM's datastore + if cmd.isoDatastoreFlag.Name == "" { + cmd.isoDatastoreFlag = cmd.DatastoreFlag + } + if cmd.diskDatastoreFlag.Name == "" { + cmd.diskDatastoreFlag = cmd.DatastoreFlag + } + + return nil +} + +func (cmd *create) Run(ctx context.Context, f *flag.FlagSet) error { + var err error + + if len(f.Args()) != 1 { + return flag.ErrHelp + } + + cmd.name = f.Arg(0) + if cmd.name == "" { + return flag.ErrHelp + } + + cmd.Client, err = cmd.ClientFlag.Client() + if err != nil { + return err + } + + cmd.Datacenter, err = cmd.DatacenterFlag.Datacenter() + if err != nil { + return err + } + + if cmd.StoragePodFlag.Isset() { + cmd.StoragePod, err = cmd.StoragePodFlag.StoragePod() + if err != nil { + return err + } + } else { + cmd.Datastore, err = cmd.DatastoreFlag.Datastore() + if err != nil { + return err + } + } + + cmd.HostSystem, err = cmd.HostSystemFlag.HostSystemIfSpecified() + if err != nil { + return err + } + + if cmd.HostSystem != nil { + if cmd.ResourcePool, err = cmd.HostSystem.ResourcePool(context.TODO()); err != nil { + return err + } + } else { + // -host is optional + if cmd.ResourcePool, err = cmd.ResourcePoolFlag.ResourcePool(); err != nil { + return err + } + } + + if cmd.Folder, err = cmd.FolderFlag.Folder(); err != nil { + return err + } + + // Verify ISO exists + if cmd.iso != "" { + _, err = cmd.isoDatastoreFlag.Stat(context.TODO(), cmd.iso) + if err != nil { + return err + } + + cmd.isoDatastore, err = cmd.isoDatastoreFlag.Datastore() + if err != nil { + return err + } + } + + // Verify disk exists + if cmd.disk != "" { + var b units.ByteSize + + // If disk can be parsed as byte units, don't stat + err = b.Set(cmd.disk) + if err == nil { + cmd.diskByteSize = int64(b) + } else { + _, err = cmd.diskDatastoreFlag.Stat(context.TODO(), cmd.disk) + if err != nil { + return err + } + + cmd.diskDatastore, err = cmd.diskDatastoreFlag.Datastore() + if err != nil { + return err + } + } + } + + task, err := cmd.createVM(context.TODO()) + if err != nil { + return err + } + + info, err := task.WaitForResult(context.TODO(), nil) + if err != nil { + return err + } + + vm := object.NewVirtualMachine(cmd.Client, info.Result.(types.ManagedObjectReference)) + + if cmd.on { + task, err := vm.PowerOn(context.TODO()) + if err != nil { + return err + } + + _, err = task.WaitForResult(context.TODO(), nil) + if err != nil { + return err + } + } + + return nil +} + +func (cmd *create) createVM(ctx context.Context) (*object.Task, error) { + var devices object.VirtualDeviceList + var err error + + spec := &types.VirtualMachineConfigSpec{ + Name: cmd.name, + GuestId: cmd.guestID, + NumCPUs: int32(cmd.cpus), + MemoryMB: int64(cmd.memory), + } + + devices, err = cmd.addStorage(nil) + if err != nil { + return nil, err + } + + devices, err = cmd.addNetwork(devices) + if err != nil { + return nil, err + } + + deviceChange, err := devices.ConfigSpec(types.VirtualDeviceConfigSpecOperationAdd) + if err != nil { + return nil, err + } + + spec.DeviceChange = deviceChange + + var datastore *object.Datastore + + // If storage pod is specified, collect placement recommendations + if cmd.StoragePod != nil { + datastore, err = cmd.recommendDatastore(ctx, spec) + if err != nil { + return nil, err + } + } else { + datastore = cmd.Datastore + } + + if !cmd.force { + vmxPath := fmt.Sprintf("%s/%s.vmx", cmd.name, cmd.name) + + _, err := datastore.Stat(ctx, vmxPath) + if err == nil { + dsPath := cmd.Datastore.Path(vmxPath) + return nil, fmt.Errorf("File %s already exists", dsPath) + } + } + + folder := cmd.Folder + + spec.Files = &types.VirtualMachineFileInfo{ + VmPathName: fmt.Sprintf("[%s]", datastore.Name()), + } + + return folder.CreateVM(ctx, *spec, cmd.ResourcePool, cmd.HostSystem) +} + +func (cmd *create) addStorage(devices object.VirtualDeviceList) (object.VirtualDeviceList, error) { + if cmd.controller != "ide" { + scsi, err := devices.CreateSCSIController(cmd.controller) + if err != nil { + return nil, err + } + + devices = append(devices, scsi) + cmd.controller = devices.Name(scsi) + } + + // If controller is specified to be IDE or if an ISO is specified, add IDE controller. + if cmd.controller == "ide" || cmd.iso != "" { + ide, err := devices.CreateIDEController() + if err != nil { + return nil, err + } + + devices = append(devices, ide) + } + + if cmd.diskByteSize != 0 { + controller, err := devices.FindDiskController(cmd.controller) + if err != nil { + return nil, err + } + + disk := &types.VirtualDisk{ + VirtualDevice: types.VirtualDevice{ + Key: devices.NewKey(), + Backing: &types.VirtualDiskFlatVer2BackingInfo{ + DiskMode: string(types.VirtualDiskModePersistent), + ThinProvisioned: types.NewBool(true), + }, + }, + CapacityInKB: cmd.diskByteSize / 1024, + } + + devices.AssignController(disk, controller) + devices = append(devices, disk) + } else if cmd.disk != "" { + controller, err := devices.FindDiskController(cmd.controller) + if err != nil { + return nil, err + } + + ds := cmd.diskDatastore.Reference() + path := cmd.diskDatastore.Path(cmd.disk) + disk := devices.CreateDisk(controller, ds, path) + + if cmd.link { + disk = devices.ChildDisk(disk) + } + + devices = append(devices, disk) + } + + if cmd.iso != "" { + ide, err := devices.FindIDEController("") + if err != nil { + return nil, err + } + + cdrom, err := devices.CreateCdrom(ide) + if err != nil { + return nil, err + } + + cdrom = devices.InsertIso(cdrom, cmd.isoDatastore.Path(cmd.iso)) + devices = append(devices, cdrom) + } + + return devices, nil +} + +func (cmd *create) addNetwork(devices object.VirtualDeviceList) (object.VirtualDeviceList, error) { + netdev, err := cmd.NetworkFlag.Device() + if err != nil { + return nil, err + } + + devices = append(devices, netdev) + return devices, nil +} + +func (cmd *create) recommendDatastore(ctx context.Context, spec *types.VirtualMachineConfigSpec) (*object.Datastore, error) { + sp := cmd.StoragePod.Reference() + + // Build pod selection spec from config spec + podSelectionSpec := types.StorageDrsPodSelectionSpec{ + StoragePod: &sp, + } + + // Keep list of disks that need to be placed + var disks []*types.VirtualDisk + + // Collect disks eligible for placement + for _, deviceConfigSpec := range spec.DeviceChange { + s := deviceConfigSpec.GetVirtualDeviceConfigSpec() + if s.Operation != types.VirtualDeviceConfigSpecOperationAdd { + continue + } + + if s.FileOperation != types.VirtualDeviceConfigSpecFileOperationCreate { + continue + } + + d, ok := s.Device.(*types.VirtualDisk) + if !ok { + continue + } + + podConfigForPlacement := types.VmPodConfigForPlacement{ + StoragePod: sp, + Disk: []types.PodDiskLocator{ + { + DiskId: d.Key, + DiskBackingInfo: d.Backing, + }, + }, + } + + podSelectionSpec.InitialVmConfig = append(podSelectionSpec.InitialVmConfig, podConfigForPlacement) + disks = append(disks, d) + } + + sps := types.StoragePlacementSpec{ + Type: string(types.StoragePlacementSpecPlacementTypeCreate), + ResourcePool: types.NewReference(cmd.ResourcePool.Reference()), + PodSelectionSpec: podSelectionSpec, + ConfigSpec: spec, + } + + srm := object.NewStorageResourceManager(cmd.Client) + result, err := srm.RecommendDatastores(ctx, sps) + if err != nil { + return nil, err + } + + // Use result to pin disks to recommended datastores + recs := result.Recommendations + if len(recs) == 0 { + return nil, fmt.Errorf("no recommendations") + } + + ds := recs[0].Action[0].(*types.StoragePlacementAction).Destination + + var mds mo.Datastore + err = property.DefaultCollector(cmd.Client).RetrieveOne(ctx, ds, []string{"name"}, &mds) + if err != nil { + return nil, err + } + + datastore := object.NewDatastore(cmd.Client, ds) + datastore.InventoryPath = mds.Name + + // Apply recommendation to eligible disks + for _, disk := range disks { + backing := disk.Backing.(*types.VirtualDiskFlatVer2BackingInfo) + backing.Datastore = &ds + } + + return datastore, nil +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/vm/destroy.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/vm/destroy.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/vm/destroy.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/vm/destroy.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,82 @@ +/* +Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package vm + +import ( + "flag" + + "github.com/vmware/govmomi/govc/cli" + "github.com/vmware/govmomi/govc/flags" + "golang.org/x/net/context" +) + +type destroy struct { + *flags.ClientFlag + *flags.SearchFlag +} + +func init() { + cli.Register("vm.destroy", &destroy{}) +} + +func (cmd *destroy) Register(ctx context.Context, f *flag.FlagSet) { + cmd.ClientFlag, ctx = flags.NewClientFlag(ctx) + cmd.ClientFlag.Register(ctx, f) + + cmd.SearchFlag, ctx = flags.NewSearchFlag(ctx, flags.SearchVirtualMachines) + cmd.SearchFlag.Register(ctx, f) +} + +func (cmd *destroy) Process(ctx context.Context) error { + if err := cmd.ClientFlag.Process(ctx); err != nil { + return err + } + if err := cmd.SearchFlag.Process(ctx); err != nil { + return err + } + return nil +} + +func (cmd *destroy) Run(ctx context.Context, f *flag.FlagSet) error { + vms, err := cmd.VirtualMachines(f.Args()) + if err != nil { + return err + } + + for _, vm := range vms { + task, err := vm.PowerOff(context.TODO()) + if err != nil { + return err + } + + // Ignore error since the VM may already been in powered off state. + // vm.Destroy will fail if the VM is still powered on. + _ = task.Wait(context.TODO()) + + task, err = vm.Destroy(context.TODO()) + if err != nil { + return err + } + + err = task.Wait(context.TODO()) + if err != nil { + return err + } + } + + return nil +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/vm/disk/attach.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/vm/disk/attach.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/vm/disk/attach.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/vm/disk/attach.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,110 @@ +/* +Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package disk + +import ( + "flag" + + "github.com/vmware/govmomi/govc/cli" + "github.com/vmware/govmomi/govc/flags" + "github.com/vmware/govmomi/vim25/types" + "golang.org/x/net/context" +) + +type attach struct { + *flags.DatastoreFlag + *flags.VirtualMachineFlag + + persist bool + link bool + disk string + controller string +} + +func init() { + cli.Register("vm.disk.attach", &attach{}) +} + +func (cmd *attach) Register(ctx context.Context, f *flag.FlagSet) { + cmd.DatastoreFlag, ctx = flags.NewDatastoreFlag(ctx) + cmd.DatastoreFlag.Register(ctx, f) + cmd.VirtualMachineFlag, ctx = flags.NewVirtualMachineFlag(ctx) + cmd.VirtualMachineFlag.Register(ctx, f) + + f.BoolVar(&cmd.persist, "persist", true, "Persist attached disk") + f.BoolVar(&cmd.link, "link", true, "Link specified disk") + f.StringVar(&cmd.controller, "controller", "", "Disk controller") + f.StringVar(&cmd.disk, "disk", "", "Disk path name") +} + +func (cmd *attach) Process(ctx context.Context) error { + if err := cmd.DatastoreFlag.Process(ctx); err != nil { + return err + } + if err := cmd.VirtualMachineFlag.Process(ctx); err != nil { + return err + } + return nil +} + +func (cmd *attach) Run(ctx context.Context, f *flag.FlagSet) error { + vm, err := cmd.VirtualMachine() + if err != nil { + return err + } + + if vm == nil { + return flag.ErrHelp + } + + ds, err := cmd.Datastore() + if err != nil { + return err + } + + devices, err := vm.Device(context.TODO()) + if err != nil { + return err + } + + controller, err := devices.FindDiskController(cmd.controller) + if err != nil { + return err + } + + disk := devices.CreateDisk(controller, ds.Reference(), ds.Path(cmd.disk)) + backing := disk.Backing.(*types.VirtualDiskFlatVer2BackingInfo) + + if cmd.link { + if cmd.persist { + backing.DiskMode = string(types.VirtualDiskModeIndependent_persistent) + } else { + backing.DiskMode = string(types.VirtualDiskModeIndependent_persistent) + } + + disk = devices.ChildDisk(disk) + return vm.AddDevice(context.TODO(), disk) + } + + if cmd.persist { + backing.DiskMode = string(types.VirtualDiskModePersistent) + } else { + backing.DiskMode = string(types.VirtualDiskModeNonpersistent) + } + + return vm.AddDevice(context.TODO(), disk) +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/vm/disk/create.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/vm/disk/create.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/vm/disk/create.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/vm/disk/create.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,152 @@ +/* +Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package disk + +import ( + "errors" + "flag" + "fmt" + "strings" + + "github.com/vmware/govmomi/govc/cli" + "github.com/vmware/govmomi/govc/flags" + "github.com/vmware/govmomi/units" + "github.com/vmware/govmomi/vim25/types" + "golang.org/x/net/context" +) + +type create struct { + *flags.DatastoreFlag + *flags.OutputFlag + *flags.VirtualMachineFlag + + controller string + Name string + Bytes units.ByteSize + Thick bool + Eager bool + DiskMode string +} + +var vdmTypes = []string{ + string(types.VirtualDiskModePersistent), + string(types.VirtualDiskModeNonpersistent), + string(types.VirtualDiskModeUndoable), + string(types.VirtualDiskModeIndependent_persistent), + string(types.VirtualDiskModeIndependent_nonpersistent), + string(types.VirtualDiskModeAppend), +} + +func init() { + cli.Register("vm.disk.create", &create{}) +} + +func (cmd *create) Register(ctx context.Context, f *flag.FlagSet) { + cmd.DatastoreFlag, ctx = flags.NewDatastoreFlag(ctx) + cmd.DatastoreFlag.Register(ctx, f) + cmd.OutputFlag, ctx = flags.NewOutputFlag(ctx) + cmd.OutputFlag.Register(ctx, f) + cmd.VirtualMachineFlag, ctx = flags.NewVirtualMachineFlag(ctx) + cmd.VirtualMachineFlag.Register(ctx, f) + + err := (&cmd.Bytes).Set("10G") + if err != nil { + panic(err) + } + + f.StringVar(&cmd.controller, "controller", "", "Disk controller") + f.StringVar(&cmd.Name, "name", "", "Name for new disk") + f.Var(&cmd.Bytes, "size", "Size of new disk") + f.BoolVar(&cmd.Thick, "thick", false, "Thick provision new disk") + f.BoolVar(&cmd.Eager, "eager", false, "Eagerly scrub new disk") + f.StringVar(&cmd.DiskMode, "mode", "persistent", fmt.Sprintf("Disk mode (%s)", strings.Join(vdmTypes, "|"))) +} + +func (cmd *create) Process(ctx context.Context) error { + if err := cmd.DatastoreFlag.Process(ctx); err != nil { + return err + } + if err := cmd.OutputFlag.Process(ctx); err != nil { + return err + } + if err := cmd.VirtualMachineFlag.Process(ctx); err != nil { + return err + } + return nil +} + +func (cmd *create) Run(ctx context.Context, f *flag.FlagSet) error { + if len(cmd.Name) == 0 { + return errors.New("please specify a disk name") + } + + vm, err := cmd.VirtualMachine() + if err != nil { + return err + } + if vm == nil { + return errors.New("please specify a vm") + } + + ds, err := cmd.Datastore() + if err != nil { + return err + } + + devices, err := vm.Device(context.TODO()) + if err != nil { + return err + } + + controller, err := devices.FindDiskController(cmd.controller) + if err != nil { + return err + } + + vdmMatch := false + for _, vdm := range vdmTypes { + if cmd.DiskMode == vdm { + vdmMatch = true + } + } + + if vdmMatch == false { + return errors.New("please specify a valid disk mode") + } + + disk := devices.CreateDisk(controller, ds.Reference(), ds.Path(cmd.Name)) + + existing := devices.SelectByBackingInfo(disk.Backing) + + if len(existing) > 0 { + cmd.Log("Disk already present\n") + return nil + } + + backing := disk.Backing.(*types.VirtualDiskFlatVer2BackingInfo) + + if cmd.Thick { + backing.ThinProvisioned = types.NewBool(false) + backing.EagerlyScrub = types.NewBool(cmd.Eager) + } + + backing.DiskMode = cmd.DiskMode + + cmd.Log("Creating disk\n") + disk.CapacityInKB = int64(cmd.Bytes) / 1024 + return vm.AddDevice(context.TODO(), disk) +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/vm/guest/auth.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/vm/guest/auth.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/vm/guest/auth.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/vm/guest/auth.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,68 @@ +/* +Copyright (c) 2014-2016 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package guest + +import ( + "flag" + "fmt" + "os" + "strings" + + "golang.org/x/net/context" + + "github.com/vmware/govmomi/vim25/types" +) + +type AuthFlag struct { + auth types.NamePasswordAuthentication +} + +func newAuthFlag(ctx context.Context) (*AuthFlag, context.Context) { + return &AuthFlag{}, ctx +} + +func (flag *AuthFlag) String() string { + return fmt.Sprintf("%s:%s", flag.auth.Username, strings.Repeat("x", len(flag.auth.Password))) +} + +func (flag *AuthFlag) Set(s string) error { + c := strings.Split(s, ":") + if len(c) > 0 { + flag.auth.Username = c[0] + if len(c) > 1 { + flag.auth.Password = c[1] + } + } + + return nil +} + +func (flag *AuthFlag) Register(ctx context.Context, f *flag.FlagSet) { + env := "GOVC_GUEST_LOGIN" + value := os.Getenv(env) + flag.Set(value) + usage := fmt.Sprintf("Guest VM credentials [%s]", env) + f.Var(flag, "l", usage) +} + +func (flag *AuthFlag) Process(ctx context.Context) error { + return nil +} + +func (flag *AuthFlag) Auth() types.BaseGuestAuthentication { + return &flag.auth +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/vm/guest/chmod.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/vm/guest/chmod.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/vm/guest/chmod.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/vm/guest/chmod.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,59 @@ +/* +Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package guest + +import ( + "flag" + + "github.com/vmware/govmomi/govc/cli" + "golang.org/x/net/context" +) + +type chmod struct { + *GuestFlag + *FileAttrFlag +} + +func init() { + cli.Register("guest.chmod", &chmod{}) +} + +func (cmd *chmod) Register(ctx context.Context, f *flag.FlagSet) { + cmd.GuestFlag, ctx = newGuestFlag(ctx) + cmd.GuestFlag.Register(ctx, f) + cmd.FileAttrFlag, ctx = newFileAttrFlag(ctx) + cmd.FileAttrFlag.Register(ctx, f) +} + +func (cmd *chmod) Process(ctx context.Context) error { + if err := cmd.GuestFlag.Process(ctx); err != nil { + return err + } + if err := cmd.FileAttrFlag.Process(ctx); err != nil { + return err + } + return nil +} + +func (cmd *chmod) Run(ctx context.Context, f *flag.FlagSet) error { + m, err := cmd.FileManager() + if err != nil { + return err + } + + return m.ChangeFileAttributes(context.TODO(), cmd.Auth(), f.Arg(0), cmd.Attr()) +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/vm/guest/download.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/vm/guest/download.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/vm/guest/download.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/vm/guest/download.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,82 @@ +/* +Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package guest + +import ( + "flag" + + "os" + + "github.com/vmware/govmomi/govc/cli" + "golang.org/x/net/context" +) + +type download struct { + *GuestFlag + + overwrite bool +} + +func init() { + cli.Register("guest.download", &download{}) +} + +func (cmd *download) Register(ctx context.Context, f *flag.FlagSet) { + cmd.GuestFlag, ctx = newGuestFlag(ctx) + cmd.GuestFlag.Register(ctx, f) + + f.BoolVar(&cmd.overwrite, "f", false, "If set, the local destination file is clobbered") +} + +func (cmd *download) Process(ctx context.Context) error { + if err := cmd.GuestFlag.Process(ctx); err != nil { + return err + } + return nil +} + +func (cmd *download) Run(ctx context.Context, f *flag.FlagSet) error { + m, err := cmd.FileManager() + if err != nil { + return err + } + + src := f.Arg(0) + dst := f.Arg(1) + + _, err = os.Stat(dst) + if err == nil && !cmd.overwrite { + return os.ErrExist + } + + info, err := m.InitiateFileTransferFromGuest(context.TODO(), cmd.Auth(), src) + if err != nil { + return err + } + + u, err := cmd.ParseURL(info.Url) + if err != nil { + return err + } + + c, err := cmd.Client() + if err != nil { + return nil + } + + return c.Client.DownloadFile(dst, u, nil) +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/vm/guest/file_attr.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/vm/guest/file_attr.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/vm/guest/file_attr.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/vm/guest/file_attr.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,48 @@ +/* +Copyright (c) 2014-2016 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package guest + +import ( + "flag" + + "golang.org/x/net/context" + + "github.com/vmware/govmomi/govc/flags" + "github.com/vmware/govmomi/vim25/types" +) + +type FileAttrFlag struct { + types.GuestPosixFileAttributes +} + +func newFileAttrFlag(ctx context.Context) (*FileAttrFlag, context.Context) { + return &FileAttrFlag{}, ctx +} + +func (flag *FileAttrFlag) Register(ctx context.Context, f *flag.FlagSet) { + f.Var(flags.NewInt32(&flag.OwnerId), "uid", "User ID") + f.Var(flags.NewInt32(&flag.GroupId), "gid", "Group ID") + f.Int64Var(&flag.Permissions, "perm", 0, "File permissions") +} + +func (flag *FileAttrFlag) Process(ctx context.Context) error { + return nil +} + +func (flag *FileAttrFlag) Attr() types.BaseGuestFileAttributes { + return &flag.GuestPosixFileAttributes +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/vm/guest/getenv.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/vm/guest/getenv.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/vm/guest/getenv.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/vm/guest/getenv.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,63 @@ +/* +Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package guest + +import ( + "flag" + "fmt" + + "github.com/vmware/govmomi/govc/cli" + "golang.org/x/net/context" +) + +type getenv struct { + *GuestFlag +} + +func init() { + cli.Register("guest.getenv", &getenv{}) +} + +func (cmd *getenv) Register(ctx context.Context, f *flag.FlagSet) { + cmd.GuestFlag, ctx = newGuestFlag(ctx) + cmd.GuestFlag.Register(ctx, f) +} + +func (cmd *getenv) Process(ctx context.Context) error { + if err := cmd.GuestFlag.Process(ctx); err != nil { + return err + } + return nil +} + +func (cmd *getenv) Run(ctx context.Context, f *flag.FlagSet) error { + m, err := cmd.ProcessManager() + if err != nil { + return err + } + + vars, err := m.ReadEnvironmentVariable(context.TODO(), cmd.Auth(), f.Args()) + if err != nil { + return err + } + + for _, v := range vars { + fmt.Printf("%s\n", v) + } + + return nil +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/vm/guest/guest.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/vm/guest/guest.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/vm/guest/guest.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/vm/guest/guest.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,113 @@ +/* +Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package guest + +import ( + "errors" + "flag" + + "net/url" + + "github.com/vmware/govmomi/govc/flags" + "github.com/vmware/govmomi/guest" + "github.com/vmware/govmomi/object" + "golang.org/x/net/context" +) + +type GuestFlag struct { + *flags.ClientFlag + *flags.VirtualMachineFlag + + *AuthFlag +} + +func newGuestFlag(ctx context.Context) (*GuestFlag, context.Context) { + f := &GuestFlag{} + f.ClientFlag, ctx = flags.NewClientFlag(ctx) + f.VirtualMachineFlag, ctx = flags.NewVirtualMachineFlag(ctx) + f.AuthFlag, ctx = newAuthFlag(ctx) + return f, ctx +} + +func (flag *GuestFlag) Register(ctx context.Context, f *flag.FlagSet) { + flag.ClientFlag.Register(ctx, f) + flag.VirtualMachineFlag.Register(ctx, f) + flag.AuthFlag.Register(ctx, f) +} + +func (flag *GuestFlag) Process(ctx context.Context) error { + if err := flag.ClientFlag.Process(ctx); err != nil { + return err + } + if err := flag.VirtualMachineFlag.Process(ctx); err != nil { + return err + } + if err := flag.AuthFlag.Process(ctx); err != nil { + return err + } + return nil +} + +func (flag *GuestFlag) FileManager() (*guest.FileManager, error) { + c, err := flag.Client() + if err != nil { + return nil, err + } + + vm, err := flag.VirtualMachine() + if err != nil { + return nil, err + } + + o := guest.NewOperationsManager(c, vm.Reference()) + return o.FileManager(context.TODO()) +} + +func (flag *GuestFlag) ProcessManager() (*guest.ProcessManager, error) { + c, err := flag.Client() + if err != nil { + return nil, err + } + + vm, err := flag.VirtualMachine() + if err != nil { + return nil, err + } + + o := guest.NewOperationsManager(c, vm.Reference()) + return o.ProcessManager(context.TODO()) +} + +func (flag *GuestFlag) ParseURL(urlStr string) (*url.URL, error) { + c, err := flag.Client() + if err != nil { + return nil, err + } + + return c.Client.ParseURL(urlStr) +} + +func (flag *GuestFlag) VirtualMachine() (*object.VirtualMachine, error) { + vm, err := flag.VirtualMachineFlag.VirtualMachine() + if err != nil { + return nil, err + } + if vm == nil { + return nil, errors.New("no vm specified") + } + return vm, nil +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/vm/guest/kill.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/vm/guest/kill.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/vm/guest/kill.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/vm/guest/kill.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,63 @@ +/* +Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package guest + +import ( + "flag" + + "github.com/vmware/govmomi/govc/cli" + "golang.org/x/net/context" +) + +type kill struct { + *GuestFlag + + pids pidSelector +} + +func init() { + cli.Register("guest.kill", &kill{}) +} + +func (cmd *kill) Register(ctx context.Context, f *flag.FlagSet) { + cmd.GuestFlag, ctx = newGuestFlag(ctx) + cmd.GuestFlag.Register(ctx, f) + + f.Var(&cmd.pids, "p", "Process ID") +} + +func (cmd *kill) Process(ctx context.Context) error { + if err := cmd.GuestFlag.Process(ctx); err != nil { + return err + } + return nil +} + +func (cmd *kill) Run(ctx context.Context, f *flag.FlagSet) error { + m, err := cmd.ProcessManager() + if err != nil { + return err + } + + for _, pid := range cmd.pids { + if err := m.TerminateProcess(context.TODO(), cmd.Auth(), pid); err != nil { + return err + } + } + + return nil +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/vm/guest/ls.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/vm/guest/ls.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/vm/guest/ls.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/vm/guest/ls.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,78 @@ +/* +Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package guest + +import ( + "flag" + "fmt" + "os" + "text/tabwriter" + + "github.com/vmware/govmomi/govc/cli" + "golang.org/x/net/context" +) + +type ls struct { + *GuestFlag +} + +func init() { + cli.Register("guest.ls", &ls{}) +} + +func (cmd *ls) Register(ctx context.Context, f *flag.FlagSet) { + cmd.GuestFlag, ctx = newGuestFlag(ctx) + cmd.GuestFlag.Register(ctx, f) +} + +func (cmd *ls) Process(ctx context.Context) error { + if err := cmd.GuestFlag.Process(ctx); err != nil { + return err + } + return nil +} + +func (cmd *ls) Run(ctx context.Context, f *flag.FlagSet) error { + m, err := cmd.FileManager() + if err != nil { + return err + } + + var offset int32 + tw := tabwriter.NewWriter(os.Stdout, 3, 0, 2, ' ', 0) + + for { + info, err := m.ListFiles(context.TODO(), cmd.Auth(), f.Arg(0), offset, 0, f.Arg(1)) + if err != nil { + return err + } + + for _, f := range info.Files { + attr := f.Attributes.GetGuestFileAttributes() // TODO: GuestPosixFileAttributes + fmt.Fprintf(tw, "%d\t%s\t%s\n", f.Size, attr.ModificationTime.Format("Mon Jan 2 15:04:05 2006"), f.Path) + } + + _ = tw.Flush() + + if info.Remaining == 0 { + break + } + offset += int32(len(info.Files)) + } + + return nil +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/vm/guest/mkdir.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/vm/guest/mkdir.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/vm/guest/mkdir.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/vm/guest/mkdir.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,71 @@ +/* +Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package guest + +import ( + "flag" + + "github.com/vmware/govmomi/govc/cli" + "github.com/vmware/govmomi/vim25/soap" + "github.com/vmware/govmomi/vim25/types" + "golang.org/x/net/context" +) + +type mkdir struct { + *GuestFlag + + createParents bool +} + +func init() { + cli.Register("guest.mkdir", &mkdir{}) +} + +func (cmd *mkdir) Register(ctx context.Context, f *flag.FlagSet) { + cmd.GuestFlag, ctx = newGuestFlag(ctx) + cmd.GuestFlag.Register(ctx, f) + + f.BoolVar(&cmd.createParents, "p", false, "Create intermediate directories as needed") +} + +func (cmd *mkdir) Process(ctx context.Context) error { + if err := cmd.GuestFlag.Process(ctx); err != nil { + return err + } + return nil +} + +func (cmd *mkdir) Run(ctx context.Context, f *flag.FlagSet) error { + m, err := cmd.FileManager() + if err != nil { + return err + } + + err = m.MakeDirectory(context.TODO(), cmd.Auth(), f.Arg(0), cmd.createParents) + + // ignore EEXIST if -p flag is given + if err != nil && cmd.createParents { + if soap.IsSoapFault(err) { + soapFault := soap.ToSoapFault(err) + if _, ok := soapFault.VimFault().(types.FileAlreadyExists); ok { + return nil + } + } + } + + return err +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/vm/guest/mktemp.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/vm/guest/mktemp.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/vm/guest/mktemp.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/vm/guest/mktemp.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,74 @@ +/* +Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package guest + +import ( + "flag" + "fmt" + + "github.com/vmware/govmomi/govc/cli" + "golang.org/x/net/context" +) + +type mktemp struct { + *GuestFlag + + dir bool + prefix string + suffix string +} + +func init() { + cli.Register("guest.mktemp", &mktemp{}) +} + +func (cmd *mktemp) Register(ctx context.Context, f *flag.FlagSet) { + cmd.GuestFlag, ctx = newGuestFlag(ctx) + cmd.GuestFlag.Register(ctx, f) + + f.BoolVar(&cmd.dir, "d", false, "Make a directory instead of a file") + f.StringVar(&cmd.prefix, "t", "", "Prefix") + f.StringVar(&cmd.suffix, "s", "", "Suffix") +} + +func (cmd *mktemp) Process(ctx context.Context) error { + if err := cmd.GuestFlag.Process(ctx); err != nil { + return err + } + return nil +} + +func (cmd *mktemp) Run(ctx context.Context, f *flag.FlagSet) error { + m, err := cmd.FileManager() + if err != nil { + return err + } + + mk := m.CreateTemporaryFile + if cmd.dir { + mk = m.CreateTemporaryDirectory + } + + name, err := mk(context.TODO(), cmd.Auth(), cmd.prefix, cmd.suffix) + if err != nil { + return err + } + + fmt.Println(name) + + return nil +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/vm/guest/ps.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/vm/guest/ps.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/vm/guest/ps.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/vm/guest/ps.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,112 @@ +/* +Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package guest + +import ( + "flag" + "fmt" + "os" + "strconv" + "text/tabwriter" + + "github.com/vmware/govmomi/govc/cli" + "golang.org/x/net/context" +) + +type ps struct { + *GuestFlag + + every bool + + pids pidSelector + uids uidSelector +} + +type pidSelector []int64 + +func (s *pidSelector) String() string { + return fmt.Sprint(*s) +} + +func (s *pidSelector) Set(value string) error { + v, err := strconv.ParseInt(value, 0, 64) + if err != nil { + return err + } + *s = append(*s, v) + return nil +} + +type uidSelector map[string]bool + +func (s uidSelector) String() string { + return "" +} + +func (s uidSelector) Set(value string) error { + s[value] = true + return nil +} + +func init() { + cli.Register("guest.ps", &ps{}) +} + +func (cmd *ps) Register(ctx context.Context, f *flag.FlagSet) { + cmd.GuestFlag, ctx = newGuestFlag(ctx) + cmd.GuestFlag.Register(ctx, f) + + cmd.uids = make(map[string]bool) + f.BoolVar(&cmd.every, "e", false, "Select all processes") + f.Var(&cmd.pids, "p", "Select by process ID") + f.Var(&cmd.uids, "U", "Select by process UID") +} + +func (cmd *ps) Process(ctx context.Context) error { + if err := cmd.GuestFlag.Process(ctx); err != nil { + return err + } + return nil +} + +func (cmd *ps) Run(ctx context.Context, f *flag.FlagSet) error { + m, err := cmd.ProcessManager() + if err != nil { + return err + } + + if !cmd.every && len(cmd.uids) == 0 { + cmd.uids[cmd.auth.Username] = true + } + + procs, err := m.ListProcesses(context.TODO(), cmd.Auth(), cmd.pids) + if err != nil { + return err + } + + tw := tabwriter.NewWriter(os.Stdout, 4, 0, 2, ' ', 0) + + fmt.Fprintf(tw, "%s\t%s\t%s\t%s\n", "UID", "PID", "STIME", "CMD") + + for _, p := range procs { + if cmd.every || cmd.uids[p.Owner] { + fmt.Fprintf(tw, "%s\t%d\t%s\t%s\n", p.Owner, p.Pid, p.StartTime.Format("15:04"), p.CmdLine) + } + } + + return tw.Flush() +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/vm/guest/rmdir.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/vm/guest/rmdir.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/vm/guest/rmdir.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/vm/guest/rmdir.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,57 @@ +/* +Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package guest + +import ( + "flag" + + "github.com/vmware/govmomi/govc/cli" + "golang.org/x/net/context" +) + +type rmdir struct { + *GuestFlag + + recursive bool +} + +func init() { + cli.Register("guest.rmdir", &rmdir{}) +} + +func (cmd *rmdir) Register(ctx context.Context, f *flag.FlagSet) { + cmd.GuestFlag, ctx = newGuestFlag(ctx) + cmd.GuestFlag.Register(ctx, f) + + f.BoolVar(&cmd.recursive, "p", false, "Recursive removal") +} + +func (cmd *rmdir) Process(ctx context.Context) error { + if err := cmd.GuestFlag.Process(ctx); err != nil { + return err + } + return nil +} + +func (cmd *rmdir) Run(ctx context.Context, f *flag.FlagSet) error { + m, err := cmd.FileManager() + if err != nil { + return err + } + + return m.DeleteDirectory(context.TODO(), cmd.Auth(), f.Arg(0), cmd.recursive) +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/vm/guest/rm.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/vm/guest/rm.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/vm/guest/rm.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/vm/guest/rm.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,53 @@ +/* +Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package guest + +import ( + "flag" + + "github.com/vmware/govmomi/govc/cli" + "golang.org/x/net/context" +) + +type rm struct { + *GuestFlag +} + +func init() { + cli.Register("guest.rm", &rm{}) +} + +func (cmd *rm) Register(ctx context.Context, f *flag.FlagSet) { + cmd.GuestFlag, ctx = newGuestFlag(ctx) + cmd.GuestFlag.Register(ctx, f) +} + +func (cmd *rm) Process(ctx context.Context) error { + if err := cmd.GuestFlag.Process(ctx); err != nil { + return err + } + return nil +} + +func (cmd *rm) Run(ctx context.Context, f *flag.FlagSet) error { + m, err := cmd.FileManager() + if err != nil { + return err + } + + return m.DeleteFile(context.TODO(), cmd.Auth(), f.Arg(0)) +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/vm/guest/start.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/vm/guest/start.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/vm/guest/start.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/vm/guest/start.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,87 @@ +/* +Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package guest + +import ( + "flag" + "fmt" + "strings" + + "github.com/vmware/govmomi/govc/cli" + "github.com/vmware/govmomi/vim25/types" + "golang.org/x/net/context" +) + +type start struct { + *GuestFlag + + dir string + vars env +} + +type env []string + +func (e *env) String() string { + return fmt.Sprint(*e) +} + +func (e *env) Set(value string) error { + *e = append(*e, value) + return nil +} + +func init() { + cli.Register("guest.start", &start{}) +} + +func (cmd *start) Register(ctx context.Context, f *flag.FlagSet) { + cmd.GuestFlag, ctx = newGuestFlag(ctx) + cmd.GuestFlag.Register(ctx, f) + + f.StringVar(&cmd.dir, "C", "", "The absolute path of the working directory for the program to start") + f.Var(&cmd.vars, "e", "Set environment variable (key=val)") +} + +func (cmd *start) Process(ctx context.Context) error { + if err := cmd.GuestFlag.Process(ctx); err != nil { + return err + } + return nil +} + +func (cmd *start) Run(ctx context.Context, f *flag.FlagSet) error { + m, err := cmd.ProcessManager() + if err != nil { + return err + } + + spec := types.GuestProgramSpec{ + ProgramPath: f.Arg(0), + Arguments: strings.Join(f.Args()[1:], " "), + WorkingDirectory: cmd.dir, + EnvVariables: cmd.vars, + } + + pid, err := m.StartProgram(context.TODO(), cmd.Auth(), &spec) + if err != nil { + return err + } + + fmt.Printf("%d\n", pid) + + return nil +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/vm/guest/upload.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/vm/guest/upload.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/vm/guest/upload.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/vm/guest/upload.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,87 @@ +/* +Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package guest + +import ( + "flag" + "os" + + "github.com/vmware/govmomi/govc/cli" + "golang.org/x/net/context" +) + +type upload struct { + *GuestFlag + *FileAttrFlag + + overwrite bool +} + +func init() { + cli.Register("guest.upload", &upload{}) +} + +func (cmd *upload) Register(ctx context.Context, f *flag.FlagSet) { + cmd.GuestFlag, ctx = newGuestFlag(ctx) + cmd.GuestFlag.Register(ctx, f) + cmd.FileAttrFlag, ctx = newFileAttrFlag(ctx) + cmd.FileAttrFlag.Register(ctx, f) + + f.BoolVar(&cmd.overwrite, "f", false, "If set, the guest destination file is clobbered") +} + +func (cmd *upload) Process(ctx context.Context) error { + if err := cmd.GuestFlag.Process(ctx); err != nil { + return err + } + if err := cmd.FileAttrFlag.Process(ctx); err != nil { + return err + } + return nil +} + +func (cmd *upload) Run(ctx context.Context, f *flag.FlagSet) error { + m, err := cmd.FileManager() + if err != nil { + return err + } + + src := f.Arg(0) + dst := f.Arg(1) + + s, err := os.Stat(src) + if err != nil { + return err + } + + url, err := m.InitiateFileTransferToGuest(context.TODO(), cmd.Auth(), dst, cmd.Attr(), s.Size(), cmd.overwrite) + if err != nil { + return err + } + + u, err := cmd.ParseURL(url) + if err != nil { + return err + } + + c, err := cmd.Client() + if err != nil { + return nil + } + + return c.Client.UploadFile(src, u, nil) +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/vm/info.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/vm/info.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/vm/info.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/vm/info.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,317 @@ +/* +Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package vm + +import ( + "flag" + "fmt" + "io" + "os" + "strings" + "text/tabwriter" + + "github.com/vmware/govmomi/find" + "github.com/vmware/govmomi/govc/cli" + "github.com/vmware/govmomi/govc/flags" + "github.com/vmware/govmomi/object" + "github.com/vmware/govmomi/property" + + "github.com/vmware/govmomi/units" + "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/types" + "golang.org/x/net/context" +) + +type info struct { + *flags.ClientFlag + *flags.OutputFlag + *flags.SearchFlag + + WaitForIP bool + General bool + ExtraConfig bool + Resources bool +} + +func init() { + cli.Register("vm.info", &info{}) +} + +func (cmd *info) Register(ctx context.Context, f *flag.FlagSet) { + cmd.ClientFlag, ctx = flags.NewClientFlag(ctx) + cmd.ClientFlag.Register(ctx, f) + + cmd.OutputFlag, ctx = flags.NewOutputFlag(ctx) + cmd.OutputFlag.Register(ctx, f) + + cmd.SearchFlag, ctx = flags.NewSearchFlag(ctx, flags.SearchVirtualMachines) + cmd.SearchFlag.Register(ctx, f) + + f.BoolVar(&cmd.WaitForIP, "waitip", false, "Wait for VM to acquire IP address") + f.BoolVar(&cmd.General, "g", true, "Show general summary") + f.BoolVar(&cmd.ExtraConfig, "e", false, "Show ExtraConfig") + f.BoolVar(&cmd.Resources, "r", false, "Show resource summary") +} + +func (cmd *info) Process(ctx context.Context) error { + if err := cmd.ClientFlag.Process(ctx); err != nil { + return err + } + if err := cmd.OutputFlag.Process(ctx); err != nil { + return err + } + if err := cmd.SearchFlag.Process(ctx); err != nil { + return err + } + return nil +} + +func (cmd *info) Run(ctx context.Context, f *flag.FlagSet) error { + c, err := cmd.Client() + if err != nil { + return err + } + + vms, err := cmd.VirtualMachines(f.Args()) + if err != nil { + if _, ok := err.(*find.NotFoundError); ok { + // Continue with empty VM slice + } else { + return err + } + } + + refs := make([]types.ManagedObjectReference, 0, len(vms)) + for _, vm := range vms { + refs = append(refs, vm.Reference()) + } + + var res infoResult + var props []string + + if cmd.OutputFlag.JSON { + props = nil // Load everything + } else { + props = []string{"summary"} // Load summary + if cmd.General { + props = append(props, "guest.ipAddress") + } + if cmd.ExtraConfig { + props = append(props, "config.extraConfig") + } + if cmd.Resources { + props = append(props, "datastore", "network") + } + } + + pc := property.DefaultCollector(c) + if len(refs) != 0 { + err = pc.Retrieve(ctx, refs, props, &res.VirtualMachines) + if err != nil { + return err + } + } + + if cmd.WaitForIP { + for i, vm := range res.VirtualMachines { + if vm.Guest == nil || vm.Guest.IpAddress == "" { + _, err = vms[i].WaitForIP(ctx) + if err != nil { + return err + } + // Reload virtual machine object + err = pc.RetrieveOne(ctx, vms[i].Reference(), props, &res.VirtualMachines[i]) + if err != nil { + return err + } + } + } + } + + if !cmd.OutputFlag.JSON { + res.objects = vms + res.cmd = cmd + if err = res.collectReferences(pc, ctx); err != nil { + return err + } + } + + return cmd.WriteResult(&res) +} + +type infoResult struct { + VirtualMachines []mo.VirtualMachine + objects []*object.VirtualMachine + entities map[types.ManagedObjectReference]string + cmd *info +} + +// collectReferences builds a unique set of MORs to the set of VirtualMachines, +// so we can collect properties in a single call for each reference type {host,datastore,network}. +func (r *infoResult) collectReferences(pc *property.Collector, ctx context.Context) error { + r.entities = make(map[types.ManagedObjectReference]string) // MOR -> Name map + + var host []mo.HostSystem + var network []mo.Network + var dvp []mo.DistributedVirtualPortgroup + var datastore []mo.Datastore + // Table to drive inflating refs to their mo.* counterparts (dest) + // and save() the Name to r.entities w/o using reflection here. + // Note that we cannot use a []mo.ManagedEntity here, since mo.Network has its own 'Name' field, + // the mo.Network.ManagedEntity.Name field will not be set. + vrefs := map[string]*struct { + dest interface{} + refs []types.ManagedObjectReference + save func() + }{ + "HostSystem": { + &host, nil, func() { + for _, e := range host { + r.entities[e.Reference()] = e.Name + } + }, + }, + "Network": { + &network, nil, func() { + for _, e := range network { + r.entities[e.Reference()] = e.Name + } + }, + }, + "DistributedVirtualPortgroup": { + &dvp, nil, func() { + for _, e := range dvp { + r.entities[e.Reference()] = e.Name + } + }, + }, + "Datastore": { + &datastore, nil, func() { + for _, e := range datastore { + r.entities[e.Reference()] = e.Name + } + }, + }, + } + + xrefs := make(map[types.ManagedObjectReference]bool) + // Add MOR to vrefs[kind].refs avoiding any duplicates. + addRef := func(refs ...types.ManagedObjectReference) { + for _, ref := range refs { + if _, exists := xrefs[ref]; exists { + return + } + xrefs[ref] = true + vref := vrefs[ref.Type] + vref.refs = append(vref.refs, ref) + } + } + + for _, vm := range r.VirtualMachines { + if r.cmd.General { + if ref := vm.Summary.Runtime.Host; ref != nil { + addRef(*ref) + } + } + + if r.cmd.Resources { + addRef(vm.Datastore...) + addRef(vm.Network...) + } + } + + for _, vref := range vrefs { + if vref.refs == nil { + continue + } + err := pc.Retrieve(ctx, vref.refs, []string{"name"}, vref.dest) + if err != nil { + return err + } + vref.save() + } + + return nil +} + +func (r *infoResult) entityNames(refs []types.ManagedObjectReference) string { + var names []string + for _, ref := range refs { + names = append(names, r.entities[ref]) + } + return strings.Join(names, ", ") +} + +func (r *infoResult) Write(w io.Writer) error { + // Maintain order via r.objects as Property collector does not always return results in order. + objects := make(map[types.ManagedObjectReference]mo.VirtualMachine, len(r.VirtualMachines)) + for _, o := range r.VirtualMachines { + objects[o.Reference()] = o + } + + tw := tabwriter.NewWriter(os.Stdout, 2, 0, 2, ' ', 0) + + for _, o := range r.objects { + vm := objects[o.Reference()] + s := vm.Summary + + fmt.Fprintf(tw, "Name:\t%s\n", s.Config.Name) + + if r.cmd.General { + hostName := "" + + if href := vm.Summary.Runtime.Host; href != nil { + if name, ok := r.entities[*href]; ok { + hostName = name + } + } + + fmt.Fprintf(tw, " Path:\t%s\n", o.InventoryPath) + fmt.Fprintf(tw, " UUID:\t%s\n", s.Config.Uuid) + fmt.Fprintf(tw, " Guest name:\t%s\n", s.Config.GuestFullName) + fmt.Fprintf(tw, " Memory:\t%dMB\n", s.Config.MemorySizeMB) + fmt.Fprintf(tw, " CPU:\t%d vCPU(s)\n", s.Config.NumCpu) + fmt.Fprintf(tw, " Power state:\t%s\n", s.Runtime.PowerState) + fmt.Fprintf(tw, " Boot time:\t%s\n", s.Runtime.BootTime) + fmt.Fprintf(tw, " IP address:\t%s\n", s.Guest.IpAddress) + fmt.Fprintf(tw, " Host:\t%s\n", hostName) + } + + if r.cmd.Resources { + if s.Storage == nil { + s.Storage = new(types.VirtualMachineStorageSummary) + } + fmt.Fprintf(tw, " CPU usage:\t%dMHz\n", s.QuickStats.OverallCpuUsage) + fmt.Fprintf(tw, " Host memory usage:\t%dMB\n", s.QuickStats.HostMemoryUsage) + fmt.Fprintf(tw, " Guest memory usage:\t%dMB\n", s.QuickStats.GuestMemoryUsage) + fmt.Fprintf(tw, " Storage uncommitted:\t%s\n", units.ByteSize(s.Storage.Uncommitted)) + fmt.Fprintf(tw, " Storage committed:\t%s\n", units.ByteSize(s.Storage.Committed)) + fmt.Fprintf(tw, " Storage unshared:\t%s\n", units.ByteSize(s.Storage.Unshared)) + fmt.Fprintf(tw, " Storage:\t%s\n", r.entityNames(vm.Datastore)) + fmt.Fprintf(tw, " Network:\t%s\n", r.entityNames(vm.Network)) + } + + if r.cmd.ExtraConfig { + fmt.Fprintf(tw, " ExtraConfig:\n") + for _, v := range vm.Config.ExtraConfig { + fmt.Fprintf(tw, " %s:\t%s\n", v.GetOptionValue().Key, v.GetOptionValue().Value) + } + } + } + + return tw.Flush() +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/vm/ip.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/vm/ip.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/vm/ip.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/vm/ip.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,132 @@ +/* +Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package vm + +import ( + "flag" + "fmt" + "strings" + "time" + + "github.com/vmware/govmomi/govc/cli" + "github.com/vmware/govmomi/govc/flags" + "github.com/vmware/govmomi/govc/host/esxcli" + "github.com/vmware/govmomi/object" + "golang.org/x/net/context" +) + +type ip struct { + *flags.OutputFlag + *flags.SearchFlag + + esx bool + all bool + v4 bool +} + +func init() { + cli.Register("vm.ip", &ip{}) +} + +func (cmd *ip) Register(ctx context.Context, f *flag.FlagSet) { + cmd.OutputFlag, ctx = flags.NewOutputFlag(ctx) + cmd.OutputFlag.Register(ctx, f) + + cmd.SearchFlag, ctx = flags.NewSearchFlag(ctx, flags.SearchVirtualMachines) + cmd.SearchFlag.Register(ctx, f) + + f.BoolVar(&cmd.esx, "esxcli", false, "Use esxcli instead of guest tools") + f.BoolVar(&cmd.all, "a", false, "Wait for an IP address on all NICs") + f.BoolVar(&cmd.v4, "v4", false, "Only report IPv4 addresses") +} + +func (cmd *ip) Process(ctx context.Context) error { + if err := cmd.OutputFlag.Process(ctx); err != nil { + return err + } + if err := cmd.SearchFlag.Process(ctx); err != nil { + return err + } + return nil +} + +func (cmd *ip) Run(ctx context.Context, f *flag.FlagSet) error { + c, err := cmd.Client() + if err != nil { + return err + } + + vms, err := cmd.VirtualMachines(f.Args()) + if err != nil { + return err + } + + var get func(*object.VirtualMachine) (string, error) + + if cmd.esx { + get = func(vm *object.VirtualMachine) (string, error) { + guest := esxcli.NewGuestInfo(c) + + ticker := time.NewTicker(time.Millisecond * 500) + defer ticker.Stop() + + for { + select { + case <-ticker.C: + ip, err := guest.IpAddress(vm) + if err != nil { + return "", err + } + + if ip != "0.0.0.0" { + return ip, nil + } + } + } + } + } else { + get = func(vm *object.VirtualMachine) (string, error) { + if cmd.all { + macs, err := vm.WaitForNetIP(context.TODO(), cmd.v4) + if err != nil { + return "", err + } + + var ips []string + for _, addrs := range macs { + for _, ip := range addrs { + ips = append(ips, ip) + } + } + return strings.Join(ips, ","), nil + } + return vm.WaitForIP(context.TODO()) + } + } + + for _, vm := range vms { + ip, err := get(vm) + if err != nil { + return err + } + + // TODO(PN): Display inventory path to VM + fmt.Fprintf(cmd, "%s\n", ip) + } + + return nil +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/vm/markastemplate.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/vm/markastemplate.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/vm/markastemplate.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/vm/markastemplate.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,68 @@ +/* +Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package vm + +import ( + "flag" + + "github.com/vmware/govmomi/govc/cli" + "github.com/vmware/govmomi/govc/flags" + "golang.org/x/net/context" +) + +type markastemplate struct { + *flags.ClientFlag + *flags.SearchFlag +} + +func init() { + cli.Register("vm.markastemplate", &markastemplate{}) +} + +func (cmd *markastemplate) Register(ctx context.Context, f *flag.FlagSet) { + cmd.ClientFlag, ctx = flags.NewClientFlag(ctx) + cmd.ClientFlag.Register(ctx, f) + + cmd.SearchFlag, ctx = flags.NewSearchFlag(ctx, flags.SearchVirtualMachines) + cmd.SearchFlag.Register(ctx, f) +} + +func (cmd *markastemplate) Process(ctx context.Context) error { + if err := cmd.ClientFlag.Process(ctx); err != nil { + return err + } + if err := cmd.SearchFlag.Process(ctx); err != nil { + return err + } + return nil +} + +func (cmd *markastemplate) Run(ctx context.Context, f *flag.FlagSet) error { + vms, err := cmd.VirtualMachines(f.Args()) + if err != nil { + return err + } + + for _, vm := range vms { + err := vm.MarkAsTemplate(context.TODO()) + if err != nil { + return err + } + } + + return nil +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/vm/markasvm.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/vm/markasvm.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/vm/markasvm.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/vm/markasvm.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,83 @@ +/* +Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package vm + +import ( + "flag" + + "github.com/vmware/govmomi/govc/cli" + "github.com/vmware/govmomi/govc/flags" + "github.com/vmware/govmomi/object" + "golang.org/x/net/context" +) + +type markasvm struct { + *flags.ClientFlag + *flags.SearchFlag + *flags.HostSystemFlag + *flags.ResourcePoolFlag + HostSystem *object.HostSystem + ResourcePool *object.ResourcePool +} + +func init() { + cli.Register("vm.markasvm", &markasvm{}) +} + +func (cmd *markasvm) Register(ctx context.Context, f *flag.FlagSet) { + cmd.ClientFlag, ctx = flags.NewClientFlag(ctx) + cmd.ClientFlag.Register(ctx, f) + cmd.SearchFlag, ctx = flags.NewSearchFlag(ctx, flags.SearchVirtualMachines) + cmd.SearchFlag.Register(ctx, f) + cmd.HostSystemFlag, ctx = flags.NewHostSystemFlag(ctx) + cmd.HostSystemFlag.Register(ctx, f) +} + +func (cmd *markasvm) Process(ctx context.Context) error { + if err := cmd.ClientFlag.Process(ctx); err != nil { + return err + } + if err := cmd.SearchFlag.Process(ctx); err != nil { + return err + } + if err := cmd.HostSystemFlag.Process(ctx); err != nil { + return err + } + return nil +} + +func (cmd *markasvm) Run(ctx context.Context, f *flag.FlagSet) error { + vms, err := cmd.VirtualMachines(f.Args()) + if err != nil { + return err + } + cmd.HostSystem, err = cmd.HostSystemFlag.HostSystem() + if err != nil { + return err + } + cmd.ResourcePool, err = cmd.HostSystem.ResourcePool(context.TODO()) + if err != nil { + return err + } + for _, vm := range vms { + err := vm.MarkAsVirtualMachine(context.TODO(), *cmd.ResourcePool, cmd.HostSystem) + if err != nil { + return err + } + } + return nil +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/vm/network/add.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/vm/network/add.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/vm/network/add.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/vm/network/add.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,75 @@ +/* +Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package network + +import ( + "errors" + "flag" + + "github.com/vmware/govmomi/govc/cli" + "github.com/vmware/govmomi/govc/flags" + "golang.org/x/net/context" +) + +type add struct { + *flags.VirtualMachineFlag + *flags.NetworkFlag +} + +func init() { + cli.Register("vm.network.add", &add{}) +} + +func (cmd *add) Register(ctx context.Context, f *flag.FlagSet) { + cmd.VirtualMachineFlag, ctx = flags.NewVirtualMachineFlag(ctx) + cmd.VirtualMachineFlag.Register(ctx, f) + cmd.NetworkFlag, ctx = flags.NewNetworkFlag(ctx) + cmd.NetworkFlag.Register(ctx, f) +} + +func (cmd *add) Process(ctx context.Context) error { + if err := cmd.VirtualMachineFlag.Process(ctx); err != nil { + return err + } + if err := cmd.NetworkFlag.Process(ctx); err != nil { + return err + } + return nil +} + +func (cmd *add) Run(ctx context.Context, f *flag.FlagSet) error { + vm, err := cmd.VirtualMachineFlag.VirtualMachine() + if err != nil { + return err + } + + if vm == nil { + return errors.New("please specify a vm") + } + + // Set network if specified as extra argument. + if f.NArg() > 0 { + _ = cmd.NetworkFlag.Set(f.Arg(0)) + } + + net, err := cmd.NetworkFlag.Device() + if err != nil { + return err + } + + return vm.AddDevice(context.TODO(), net) +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/vm/network/change.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/vm/network/change.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/vm/network/change.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/vm/network/change.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,107 @@ +/* +Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package network + +import ( + "errors" + "flag" + "fmt" + + "github.com/vmware/govmomi/govc/cli" + "github.com/vmware/govmomi/govc/flags" + "github.com/vmware/govmomi/vim25/types" + "golang.org/x/net/context" +) + +type change struct { + *flags.VirtualMachineFlag + *flags.NetworkFlag +} + +func init() { + cli.Register("vm.network.change", &change{}) +} + +func (cmd *change) Register(ctx context.Context, f *flag.FlagSet) { + cmd.VirtualMachineFlag, ctx = flags.NewVirtualMachineFlag(ctx) + cmd.VirtualMachineFlag.Register(ctx, f) + cmd.NetworkFlag, ctx = flags.NewNetworkFlag(ctx) + cmd.NetworkFlag.Register(ctx, f) +} + +func (cmd *change) Process(ctx context.Context) error { + if err := cmd.VirtualMachineFlag.Process(ctx); err != nil { + return err + } + if err := cmd.NetworkFlag.Process(ctx); err != nil { + return err + } + return nil +} + +func (cmd *change) Run(ctx context.Context, f *flag.FlagSet) error { + vm, err := cmd.VirtualMachineFlag.VirtualMachine() + if err != nil { + return err + } + + if vm == nil { + return errors.New("please specify a vm") + } + + name := f.Arg(0) + + if name == "" { + return errors.New("please specify a device name") + } + + // Set network if specified as extra argument. + if f.NArg() > 1 { + _ = cmd.NetworkFlag.Set(f.Arg(1)) + } + + devices, err := vm.Device(context.TODO()) + if err != nil { + return err + } + + net := devices.Find(name) + + if net == nil { + return fmt.Errorf("device '%s' not found", name) + } + + dev, err := cmd.NetworkFlag.Device() + if err != nil { + return err + } + + current := net.(types.BaseVirtualEthernetCard).GetVirtualEthernetCard() + changed := dev.(types.BaseVirtualEthernetCard).GetVirtualEthernetCard() + + current.Backing = changed.Backing + + if changed.MacAddress != "" { + current.MacAddress = changed.MacAddress + } + + if changed.AddressType != "" { + current.AddressType = changed.AddressType + } + + return vm.EditDevice(context.TODO(), net) +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/vm/power.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/vm/power.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/vm/power.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/vm/power.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,160 @@ +/* +Copyright (c) 2014-2016 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package vm + +import ( + "flag" + "fmt" + + "github.com/vmware/govmomi/govc/cli" + "github.com/vmware/govmomi/govc/flags" + "github.com/vmware/govmomi/object" + "github.com/vmware/govmomi/vim25/soap" + "github.com/vmware/govmomi/vim25/types" + "golang.org/x/net/context" +) + +type power struct { + *flags.ClientFlag + *flags.SearchFlag + + On bool + Off bool + Reset bool + Reboot bool + Shutdown bool + Suspend bool + Force bool +} + +func init() { + cli.Register("vm.power", &power{}) +} + +func (cmd *power) Register(ctx context.Context, f *flag.FlagSet) { + cmd.ClientFlag, ctx = flags.NewClientFlag(ctx) + cmd.ClientFlag.Register(ctx, f) + + cmd.SearchFlag, ctx = flags.NewSearchFlag(ctx, flags.SearchVirtualMachines) + cmd.SearchFlag.Register(ctx, f) + + f.BoolVar(&cmd.On, "on", false, "Power on") + f.BoolVar(&cmd.Off, "off", false, "Power off") + f.BoolVar(&cmd.Reset, "reset", false, "Power reset") + f.BoolVar(&cmd.Suspend, "suspend", false, "Power suspend") + f.BoolVar(&cmd.Reboot, "r", false, "Reboot guest") + f.BoolVar(&cmd.Shutdown, "s", false, "Shutdown guest") + f.BoolVar(&cmd.Force, "force", false, "Force (ignore state error and hard shutdown/reboot if tools unavailable)") +} + +func (cmd *power) Process(ctx context.Context) error { + if err := cmd.ClientFlag.Process(ctx); err != nil { + return err + } + if err := cmd.SearchFlag.Process(ctx); err != nil { + return err + } + opts := []bool{cmd.On, cmd.Off, cmd.Reset, cmd.Suspend, cmd.Reboot, cmd.Shutdown} + selected := false + + for _, opt := range opts { + if opt { + if selected { + return flag.ErrHelp + } + selected = opt + } + } + + if !selected { + return flag.ErrHelp + } + + return nil +} + +func isToolsUnavailable(err error) bool { + if soap.IsSoapFault(err) { + soapFault := soap.ToSoapFault(err) + if _, ok := soapFault.VimFault().(types.ToolsUnavailable); ok { + return ok + } + } + + return false +} + +func (cmd *power) Run(ctx context.Context, f *flag.FlagSet) error { + vms, err := cmd.VirtualMachines(f.Args()) + if err != nil { + return err + } + + for _, vm := range vms { + var task *object.Task + + switch { + case cmd.On: + fmt.Fprintf(cmd, "Powering on %s... ", vm.Reference()) + task, err = vm.PowerOn(context.TODO()) + case cmd.Off: + fmt.Fprintf(cmd, "Powering off %s... ", vm.Reference()) + task, err = vm.PowerOff(context.TODO()) + case cmd.Reset: + fmt.Fprintf(cmd, "Reset %s... ", vm.Reference()) + task, err = vm.Reset(context.TODO()) + case cmd.Suspend: + fmt.Fprintf(cmd, "Suspend %s... ", vm.Reference()) + task, err = vm.Suspend(context.TODO()) + case cmd.Reboot: + fmt.Fprintf(cmd, "Reboot guest %s... ", vm.Reference()) + err = vm.RebootGuest(context.TODO()) + + if err != nil && cmd.Force && isToolsUnavailable(err) { + task, err = vm.Reset(context.TODO()) + } + case cmd.Shutdown: + fmt.Fprintf(cmd, "Shutdown guest %s... ", vm.Reference()) + err = vm.ShutdownGuest(context.TODO()) + + if err != nil && cmd.Force && isToolsUnavailable(err) { + task, err = vm.PowerOff(context.TODO()) + } + } + + if err != nil { + return err + } + + if task != nil { + err = task.Wait(context.TODO()) + } + if err == nil { + fmt.Fprintf(cmd, "OK\n") + continue + } + + if cmd.Force { + fmt.Fprintf(cmd, "Error: %s\n", err) + continue + } + + return err + } + + return nil +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/vm/question.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/vm/question.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/vm/question.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/vm/question.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,98 @@ +/* +Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package vm + +import ( + "errors" + "flag" + "fmt" + + "github.com/vmware/govmomi/govc/cli" + "github.com/vmware/govmomi/govc/flags" + "github.com/vmware/govmomi/property" + "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/types" + "golang.org/x/net/context" +) + +type question struct { + *flags.VirtualMachineFlag + + answer string +} + +func init() { + cli.Register("vm.question", &question{}) +} + +func (cmd *question) Register(ctx context.Context, f *flag.FlagSet) { + cmd.VirtualMachineFlag, ctx = flags.NewVirtualMachineFlag(ctx) + cmd.VirtualMachineFlag.Register(ctx, f) + + f.StringVar(&cmd.answer, "answer", "", "Answer to question") +} + +func (cmd *question) Process(ctx context.Context) error { + if err := cmd.VirtualMachineFlag.Process(ctx); err != nil { + return err + } + return nil +} + +func (cmd *question) Run(ctx context.Context, f *flag.FlagSet) error { + c, err := cmd.Client() + if err != nil { + return err + } + + vm, err := cmd.VirtualMachine() + if err != nil { + return err + } + + if vm == nil { + return errors.New("No VM specified") + } + + var mvm mo.VirtualMachine + + pc := property.DefaultCollector(c) + err = pc.RetrieveOne(context.TODO(), vm.Reference(), []string{"runtime.question"}, &mvm) + if err != nil { + return err + } + + q := mvm.Runtime.Question + if q == nil { + fmt.Printf("No pending question\n") + return nil + } + + // Print question if no answer is specified + if cmd.answer == "" { + fmt.Printf("Question:\n%s\n\n", q.Text) + fmt.Printf("Possible answers:\n") + for _, e := range q.Choice.ChoiceInfo { + ed := e.(*types.ElementDescription) + fmt.Printf("%s) %s\n", ed.Key, ed.Description.Label) + } + return nil + } + + // Answer question + return vm.Answer(context.TODO(), q.Id, cmd.answer) +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/govc/vm/vnc.go juju-core-2.0.2/src/github.com/vmware/govmomi/govc/vm/vnc.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/govc/vm/vnc.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/govc/vm/vnc.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,480 @@ +/* +Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package vm + +import ( + "encoding/json" + "flag" + "fmt" + "io" + "reflect" + "regexp" + "strconv" + "strings" + + "github.com/vmware/govmomi/govc/cli" + "github.com/vmware/govmomi/govc/flags" + "github.com/vmware/govmomi/object" + "github.com/vmware/govmomi/property" + "github.com/vmware/govmomi/vim25" + "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/types" + "golang.org/x/net/context" +) + +type intRange struct { + low, high int +} + +var intRangeRegexp = regexp.MustCompile("^([0-9]+)-([0-9]+)$") + +func (i *intRange) Set(s string) error { + m := intRangeRegexp.FindStringSubmatch(s) + if m == nil { + return fmt.Errorf("invalid range: %s", s) + } + + low, _ := strconv.Atoi(m[1]) + high, _ := strconv.Atoi(m[2]) + if low > high { + return fmt.Errorf("invalid range: low > high") + } + + i.low = low + i.high = high + return nil +} + +func (i *intRange) String() string { + return fmt.Sprintf("%d-%d", i.low, i.high) +} + +type vnc struct { + *flags.SearchFlag + + Enable bool + Disable bool + Port int + PortRange intRange + Password string +} + +func init() { + cmd := &vnc{} + cmd.PortRange.Set("5900-5999") + cli.Register("vm.vnc", cmd) +} + +func (cmd *vnc) Register(ctx context.Context, f *flag.FlagSet) { + cmd.SearchFlag, ctx = flags.NewSearchFlag(ctx, flags.SearchVirtualMachines) + cmd.SearchFlag.Register(ctx, f) + + f.BoolVar(&cmd.Enable, "enable", false, "Enable VNC") + f.BoolVar(&cmd.Disable, "disable", false, "Disable VNC") + f.IntVar(&cmd.Port, "port", -1, "VNC port (-1 for auto-select)") + f.Var(&cmd.PortRange, "port-range", "VNC port auto-select range") + f.StringVar(&cmd.Password, "password", "", "VNC password") +} + +func (cmd *vnc) Process(ctx context.Context) error { + if err := cmd.SearchFlag.Process(ctx); err != nil { + return err + } + // Either may be true or none may be true. + if cmd.Enable && cmd.Disable { + return flag.ErrHelp + } + + return nil +} + +func (cmd *vnc) Usage() string { + return "VM..." +} + +func (cmd *vnc) Description() string { + return `VNC controls for VM(s). + +Port numbers are automatically chosen from a range if not specified. + +If neither -enable or -disable is specified, the current state is returned.` +} + +func (cmd *vnc) Run(ctx context.Context, f *flag.FlagSet) error { + vms, err := cmd.loadVMs(f.Args()) + if err != nil { + return err + } + + // Actuate settings in VMs + for _, vm := range vms { + switch { + case cmd.Enable: + vm.enable(cmd.Port, cmd.Password) + case cmd.Disable: + vm.disable() + } + } + + // Reconfigure VMs to reflect updates + for _, vm := range vms { + err = vm.reconfigure() + if err != nil { + return err + } + } + + return cmd.WriteResult(vncResult(vms)) +} + +func (cmd *vnc) loadVMs(args []string) ([]*vncVM, error) { + c, err := cmd.Client() + if err != nil { + return nil, err + } + + vms, err := cmd.VirtualMachines(args) + if err != nil { + return nil, err + } + + var vncVMs []*vncVM + for _, vm := range vms { + v, err := newVNCVM(c, vm) + if err != nil { + return nil, err + } + vncVMs = append(vncVMs, v) + } + + // Assign vncHosts to vncVMs + hosts := make(map[string]*vncHost) + for _, vm := range vncVMs { + if h, ok := hosts[vm.hostReference().Value]; ok { + vm.host = h + continue + } + + hs := object.NewHostSystem(c, vm.hostReference()) + h, err := newVNCHost(c, hs, cmd.PortRange.low, cmd.PortRange.high) + if err != nil { + return nil, err + } + + hosts[vm.hostReference().Value] = h + vm.host = h + } + + return vncVMs, nil +} + +type vncVM struct { + c *vim25.Client + vm *object.VirtualMachine + mvm mo.VirtualMachine + host *vncHost + + curOptions vncOptions + newOptions vncOptions +} + +func newVNCVM(c *vim25.Client, vm *object.VirtualMachine) (*vncVM, error) { + v := &vncVM{ + c: c, + vm: vm, + } + + virtualMachineProperties := []string{ + "name", + "config.extraConfig", + "runtime.host", + } + + pc := property.DefaultCollector(c) + err := pc.RetrieveOne(context.TODO(), vm.Reference(), virtualMachineProperties, &v.mvm) + if err != nil { + return nil, err + } + + v.curOptions = vncOptionsFromExtraConfig(v.mvm.Config.ExtraConfig) + v.newOptions = vncOptionsFromExtraConfig(v.mvm.Config.ExtraConfig) + + return v, nil +} + +func (v *vncVM) hostReference() types.ManagedObjectReference { + return *v.mvm.Runtime.Host +} + +func (v *vncVM) enable(port int, password string) error { + v.newOptions["enabled"] = "true" + v.newOptions["port"] = fmt.Sprintf("%d", port) + v.newOptions["password"] = password + + // Find port if auto-select + if port == -1 { + // Reuse port if If VM already has a port, reuse it. + // Otherwise, find unused VNC port on host. + if p, ok := v.curOptions["port"]; ok && p != "" { + v.newOptions["port"] = p + } else { + port, err := v.host.popUnusedPort() + if err != nil { + return err + } + v.newOptions["port"] = fmt.Sprintf("%d", port) + } + } + return nil +} + +func (v *vncVM) disable() error { + v.newOptions["enabled"] = "false" + v.newOptions["port"] = "" + v.newOptions["password"] = "" + return nil +} + +func (v *vncVM) reconfigure() error { + if reflect.DeepEqual(v.curOptions, v.newOptions) { + // No changes to settings + return nil + } + + spec := types.VirtualMachineConfigSpec{ + ExtraConfig: v.newOptions.ToExtraConfig(), + } + + task, err := v.vm.Reconfigure(context.TODO(), spec) + if err != nil { + return err + } + + return task.Wait(context.TODO()) +} + +func (v *vncVM) uri() (string, error) { + ip, err := v.host.managementIP() + if err != nil { + return "", err + } + + uri := fmt.Sprintf("vnc://:%s@%s:%s", + v.newOptions["password"], + ip, + v.newOptions["port"]) + + return uri, nil +} + +func (v *vncVM) write(w io.Writer) error { + if v.newOptions["enabled"] == "true" { + uri, err := v.uri() + if err != nil { + return err + } + fmt.Printf("%s: %s\n", v.mvm.Name, uri) + } else { + fmt.Printf("%s: disabled\n", v.mvm.Name) + } + return nil +} + +type vncHost struct { + c *vim25.Client + host *object.HostSystem + ports map[int]struct{} + ip string // This field is populated by `managementIP` +} + +func newVNCHost(c *vim25.Client, host *object.HostSystem, low, high int) (*vncHost, error) { + ports := make(map[int]struct{}) + for i := low; i <= high; i++ { + ports[i] = struct{}{} + } + + used, err := loadUsedPorts(c, host.Reference()) + if err != nil { + return nil, err + } + + // Remove used ports from range + for _, u := range used { + delete(ports, u) + } + + h := &vncHost{ + c: c, + host: host, + ports: ports, + } + + return h, nil +} + +func loadUsedPorts(c *vim25.Client, host types.ManagedObjectReference) ([]int, error) { + ospec := types.ObjectSpec{ + Obj: host, + SelectSet: []types.BaseSelectionSpec{ + &types.TraversalSpec{ + Type: "HostSystem", + Path: "vm", + Skip: types.NewBool(false), + }, + }, + Skip: types.NewBool(false), + } + + pspec := types.PropertySpec{ + Type: "VirtualMachine", + PathSet: []string{"config.extraConfig"}, + } + + req := types.RetrieveProperties{ + This: c.ServiceContent.PropertyCollector, + SpecSet: []types.PropertyFilterSpec{ + { + ObjectSet: []types.ObjectSpec{ospec}, + PropSet: []types.PropertySpec{pspec}, + }, + }, + } + + var vms []mo.VirtualMachine + err := mo.RetrievePropertiesForRequest(context.TODO(), c, req, &vms) + if err != nil { + return nil, err + } + + var ports []int + for _, vm := range vms { + if vm.Config == nil || vm.Config.ExtraConfig == nil { + continue + } + + options := vncOptionsFromExtraConfig(vm.Config.ExtraConfig) + if ps, ok := options["port"]; ok && ps != "" { + pi, err := strconv.Atoi(ps) + if err == nil { + ports = append(ports, pi) + } + } + } + + return ports, nil +} + +func (h *vncHost) popUnusedPort() (int, error) { + if len(h.ports) == 0 { + return 0, fmt.Errorf("no unused ports in range") + } + + // Return first port we get when iterating + var port int + for port, _ = range h.ports { + break + } + delete(h.ports, port) + return port, nil +} + +func (h *vncHost) managementIP() (string, error) { + if h.ip != "" { + return h.ip, nil + } + + ips, err := h.host.ManagementIPs(context.TODO()) + if err != nil { + return "", err + } + + if len(ips) > 0 { + h.ip = ips[0].String() + } else { + h.ip = "" + } + + return h.ip, nil +} + +type vncResult []*vncVM + +func (vms vncResult) MarshalJSON() ([]byte, error) { + out := make(map[string]string) + for _, vm := range vms { + uri, err := vm.uri() + if err != nil { + return nil, err + } + out[vm.mvm.Name] = uri + } + return json.Marshal(out) +} + +func (vms vncResult) Write(w io.Writer) error { + for _, vm := range vms { + err := vm.write(w) + if err != nil { + return err + } + } + + return nil +} + +type vncOptions map[string]string + +var vncPrefix = "RemoteDisplay.vnc." + +func vncOptionsFromExtraConfig(ov []types.BaseOptionValue) vncOptions { + vo := make(vncOptions) + for _, b := range ov { + o := b.GetOptionValue() + if strings.HasPrefix(o.Key, vncPrefix) { + key := o.Key[len(vncPrefix):] + if key != "key" { + vo[key] = o.Value.(string) + } + } + } + return vo +} + +func (vo vncOptions) ToExtraConfig() []types.BaseOptionValue { + ov := make([]types.BaseOptionValue, 0, 0) + for k, v := range vo { + key := vncPrefix + k + value := v + + o := types.OptionValue{ + Key: key, + Value: &value, // Pass pointer to avoid omitempty + } + + ov = append(ov, &o) + } + + // Don't know how to deal with the key option, set it to be empty... + o := types.OptionValue{ + Key: vncPrefix + "key", + Value: new(string), // Pass pointer to avoid omitempty + } + + ov = append(ov, &o) + + return ov +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/guest/auth_manager.go juju-core-2.0.2/src/github.com/vmware/govmomi/guest/auth_manager.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/guest/auth_manager.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/guest/auth_manager.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,79 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package guest + +import ( + "github.com/vmware/govmomi/vim25" + "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/types" + "golang.org/x/net/context" +) + +type AuthManager struct { + types.ManagedObjectReference + + vm types.ManagedObjectReference + + c *vim25.Client +} + +func (m AuthManager) Reference() types.ManagedObjectReference { + return m.ManagedObjectReference +} + +func (m AuthManager) AcquireCredentials(ctx context.Context, requestedAuth types.BaseGuestAuthentication, sessionID int64) (types.BaseGuestAuthentication, error) { + req := types.AcquireCredentialsInGuest{ + This: m.Reference(), + Vm: m.vm, + RequestedAuth: requestedAuth, + SessionID: sessionID, + } + + res, err := methods.AcquireCredentialsInGuest(ctx, m.c, &req) + if err != nil { + return nil, err + } + + return res.Returnval, nil +} + +func (m AuthManager) ReleaseCredentials(ctx context.Context, auth types.BaseGuestAuthentication) error { + req := types.ReleaseCredentialsInGuest{ + This: m.Reference(), + Vm: m.vm, + Auth: auth, + } + + _, err := methods.ReleaseCredentialsInGuest(ctx, m.c, &req) + + return err +} + +func (m AuthManager) ValidateCredentials(ctx context.Context, auth types.BaseGuestAuthentication) error { + req := types.ValidateCredentialsInGuest{ + This: m.Reference(), + Vm: m.vm, + Auth: auth, + } + + _, err := methods.ValidateCredentialsInGuest(ctx, m.c, &req) + if err != nil { + return err + } + + return nil +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/guest/file_manager.go juju-core-2.0.2/src/github.com/vmware/govmomi/guest/file_manager.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/guest/file_manager.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/guest/file_manager.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,202 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package guest + +import ( + "github.com/vmware/govmomi/vim25" + "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/types" + "golang.org/x/net/context" +) + +type FileManager struct { + types.ManagedObjectReference + + vm types.ManagedObjectReference + + c *vim25.Client +} + +func (m FileManager) Reference() types.ManagedObjectReference { + return m.ManagedObjectReference +} + +func (m FileManager) ChangeFileAttributes(ctx context.Context, auth types.BaseGuestAuthentication, guestFilePath string, fileAttributes types.BaseGuestFileAttributes) error { + req := types.ChangeFileAttributesInGuest{ + This: m.Reference(), + Vm: m.vm, + Auth: auth, + GuestFilePath: guestFilePath, + FileAttributes: fileAttributes, + } + + _, err := methods.ChangeFileAttributesInGuest(ctx, m.c, &req) + return err +} + +func (m FileManager) CreateTemporaryDirectory(ctx context.Context, auth types.BaseGuestAuthentication, prefix, suffix string) (string, error) { + req := types.CreateTemporaryDirectoryInGuest{ + This: m.Reference(), + Vm: m.vm, + Auth: auth, + Prefix: prefix, + Suffix: suffix, + } + + res, err := methods.CreateTemporaryDirectoryInGuest(ctx, m.c, &req) + if err != nil { + return "", err + } + + return res.Returnval, nil +} + +func (m FileManager) CreateTemporaryFile(ctx context.Context, auth types.BaseGuestAuthentication, prefix, suffix string) (string, error) { + req := types.CreateTemporaryFileInGuest{ + This: m.Reference(), + Vm: m.vm, + Auth: auth, + Prefix: prefix, + Suffix: suffix, + } + + res, err := methods.CreateTemporaryFileInGuest(ctx, m.c, &req) + if err != nil { + return "", err + } + + return res.Returnval, nil +} + +func (m FileManager) DeleteDirectory(ctx context.Context, auth types.BaseGuestAuthentication, directoryPath string, recursive bool) error { + req := types.DeleteDirectoryInGuest{ + This: m.Reference(), + Vm: m.vm, + Auth: auth, + DirectoryPath: directoryPath, + Recursive: recursive, + } + + _, err := methods.DeleteDirectoryInGuest(ctx, m.c, &req) + return err +} + +func (m FileManager) DeleteFile(ctx context.Context, auth types.BaseGuestAuthentication, filePath string) error { + req := types.DeleteFileInGuest{ + This: m.Reference(), + Vm: m.vm, + Auth: auth, + FilePath: filePath, + } + + _, err := methods.DeleteFileInGuest(ctx, m.c, &req) + return err +} + +func (m FileManager) InitiateFileTransferFromGuest(ctx context.Context, auth types.BaseGuestAuthentication, guestFilePath string) (*types.FileTransferInformation, error) { + req := types.InitiateFileTransferFromGuest{ + This: m.Reference(), + Vm: m.vm, + Auth: auth, + GuestFilePath: guestFilePath, + } + + res, err := methods.InitiateFileTransferFromGuest(ctx, m.c, &req) + if err != nil { + return nil, err + } + + return &res.Returnval, nil +} + +func (m FileManager) InitiateFileTransferToGuest(ctx context.Context, auth types.BaseGuestAuthentication, guestFilePath string, fileAttributes types.BaseGuestFileAttributes, fileSize int64, overwrite bool) (string, error) { + req := types.InitiateFileTransferToGuest{ + This: m.Reference(), + Vm: m.vm, + Auth: auth, + GuestFilePath: guestFilePath, + FileAttributes: fileAttributes, + FileSize: fileSize, + Overwrite: overwrite, + } + + res, err := methods.InitiateFileTransferToGuest(ctx, m.c, &req) + if err != nil { + return "", err + } + + return res.Returnval, nil +} + +func (m FileManager) ListFiles(ctx context.Context, auth types.BaseGuestAuthentication, filePath string, index int32, maxResults int32, matchPattern string) (*types.GuestListFileInfo, error) { + req := types.ListFilesInGuest{ + This: m.Reference(), + Vm: m.vm, + Auth: auth, + FilePath: filePath, + Index: index, + MaxResults: maxResults, + MatchPattern: matchPattern, + } + + res, err := methods.ListFilesInGuest(ctx, m.c, &req) + if err != nil { + return nil, err + } + + return &res.Returnval, nil +} + +func (m FileManager) MakeDirectory(ctx context.Context, auth types.BaseGuestAuthentication, directoryPath string, createParentDirectories bool) error { + req := types.MakeDirectoryInGuest{ + This: m.Reference(), + Vm: m.vm, + Auth: auth, + DirectoryPath: directoryPath, + CreateParentDirectories: createParentDirectories, + } + + _, err := methods.MakeDirectoryInGuest(ctx, m.c, &req) + return err +} + +func (m FileManager) MoveDirectory(ctx context.Context, auth types.BaseGuestAuthentication, srcDirectoryPath string, dstDirectoryPath string) error { + req := types.MoveDirectoryInGuest{ + This: m.Reference(), + Vm: m.vm, + Auth: auth, + SrcDirectoryPath: srcDirectoryPath, + DstDirectoryPath: dstDirectoryPath, + } + + _, err := methods.MoveDirectoryInGuest(ctx, m.c, &req) + return err +} + +func (m FileManager) MoveFile(ctx context.Context, auth types.BaseGuestAuthentication, srcFilePath string, dstFilePath string, overwrite bool) error { + req := types.MoveFileInGuest{ + This: m.Reference(), + Vm: m.vm, + Auth: auth, + SrcFilePath: srcFilePath, + DstFilePath: dstFilePath, + Overwrite: overwrite, + } + + _, err := methods.MoveFileInGuest(ctx, m.c, &req) + return err +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/guest/operations_manager.go juju-core-2.0.2/src/github.com/vmware/govmomi/guest/operations_manager.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/guest/operations_manager.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/guest/operations_manager.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,72 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package guest + +import ( + "github.com/vmware/govmomi/property" + "github.com/vmware/govmomi/vim25" + "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/types" + "golang.org/x/net/context" +) + +type OperationsManager struct { + c *vim25.Client + vm types.ManagedObjectReference +} + +func NewOperationsManager(c *vim25.Client, vm types.ManagedObjectReference) *OperationsManager { + return &OperationsManager{c, vm} +} + +func (m OperationsManager) retrieveOne(ctx context.Context, p string, dst *mo.GuestOperationsManager) error { + pc := property.DefaultCollector(m.c) + return pc.RetrieveOne(ctx, *m.c.ServiceContent.GuestOperationsManager, []string{p}, dst) +} + +func (m OperationsManager) AuthManager(ctx context.Context) (*AuthManager, error) { + var g mo.GuestOperationsManager + + err := m.retrieveOne(ctx, "authManager", &g) + if err != nil { + return nil, err + } + + return &AuthManager{*g.AuthManager, m.vm, m.c}, nil +} + +func (m OperationsManager) FileManager(ctx context.Context) (*FileManager, error) { + var g mo.GuestOperationsManager + + err := m.retrieveOne(ctx, "fileManager", &g) + if err != nil { + return nil, err + } + + return &FileManager{*g.FileManager, m.vm, m.c}, nil +} + +func (m OperationsManager) ProcessManager(ctx context.Context) (*ProcessManager, error) { + var g mo.GuestOperationsManager + + err := m.retrieveOne(ctx, "processManager", &g) + if err != nil { + return nil, err + } + + return &ProcessManager{*g.ProcessManager, m.vm, m.c}, nil +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/guest/process_manager.go juju-core-2.0.2/src/github.com/vmware/govmomi/guest/process_manager.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/guest/process_manager.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/guest/process_manager.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,96 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package guest + +import ( + "github.com/vmware/govmomi/vim25" + "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/types" + "golang.org/x/net/context" +) + +type ProcessManager struct { + types.ManagedObjectReference + + vm types.ManagedObjectReference + + c *vim25.Client +} + +func (m ProcessManager) Reference() types.ManagedObjectReference { + return m.ManagedObjectReference +} + +func (m ProcessManager) ListProcesses(ctx context.Context, auth types.BaseGuestAuthentication, pids []int64) ([]types.GuestProcessInfo, error) { + req := types.ListProcessesInGuest{ + This: m.Reference(), + Vm: m.vm, + Auth: auth, + Pids: pids, + } + + res, err := methods.ListProcessesInGuest(ctx, m.c, &req) + if err != nil { + return nil, err + } + + return res.Returnval, err +} + +func (m ProcessManager) ReadEnvironmentVariable(ctx context.Context, auth types.BaseGuestAuthentication, names []string) ([]string, error) { + req := types.ReadEnvironmentVariableInGuest{ + This: m.Reference(), + Vm: m.vm, + Auth: auth, + Names: names, + } + + res, err := methods.ReadEnvironmentVariableInGuest(ctx, m.c, &req) + if err != nil { + return nil, err + } + + return res.Returnval, err +} + +func (m ProcessManager) StartProgram(ctx context.Context, auth types.BaseGuestAuthentication, spec types.BaseGuestProgramSpec) (int64, error) { + req := types.StartProgramInGuest{ + This: m.Reference(), + Vm: m.vm, + Auth: auth, + Spec: spec, + } + + res, err := methods.StartProgramInGuest(ctx, m.c, &req) + if err != nil { + return 0, err + } + + return res.Returnval, err +} + +func (m ProcessManager) TerminateProcess(ctx context.Context, auth types.BaseGuestAuthentication, pid int64) error { + req := types.TerminateProcessInGuest{ + This: m.Reference(), + Vm: m.vm, + Auth: auth, + Pid: pid, + } + + _, err := methods.TerminateProcessInGuest(ctx, m.c, &req) + return err +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/license/assignment_manager.go juju-core-2.0.2/src/github.com/vmware/govmomi/license/assignment_manager.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/license/assignment_manager.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/license/assignment_manager.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,69 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package license + +import ( + "github.com/vmware/govmomi/object" + "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/types" + "golang.org/x/net/context" +) + +type AssignmentManager struct { + object.Common +} + +func (m AssignmentManager) QueryAssigned(ctx context.Context, id string) ([]types.LicenseAssignmentManagerLicenseAssignment, error) { + req := types.QueryAssignedLicenses{ + This: m.Reference(), + EntityId: id, + } + + res, err := methods.QueryAssignedLicenses(ctx, m.Client(), &req) + if err != nil { + return nil, err + } + + return res.Returnval, nil +} + +func (m AssignmentManager) Remove(ctx context.Context, id string) error { + req := types.RemoveAssignedLicense{ + This: m.Reference(), + EntityId: id, + } + + _, err := methods.RemoveAssignedLicense(ctx, m.Client(), &req) + + return err +} + +func (m AssignmentManager) Update(ctx context.Context, id string, key string, name string) (*types.LicenseManagerLicenseInfo, error) { + req := types.UpdateAssignedLicense{ + This: m.Reference(), + Entity: id, + LicenseKey: key, + EntityDisplayName: name, + } + + res, err := methods.UpdateAssignedLicense(ctx, m.Client(), &req) + if err != nil { + return nil, err + } + + return &res.Returnval, nil +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/license/manager.go juju-core-2.0.2/src/github.com/vmware/govmomi/license/manager.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/license/manager.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/license/manager.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,195 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package license + +import ( + "strconv" + "strings" + + "github.com/vmware/govmomi/object" + "github.com/vmware/govmomi/vim25" + "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/types" + "golang.org/x/net/context" +) + +type Manager struct { + object.Common +} + +func NewManager(c *vim25.Client) *Manager { + m := Manager{ + object.NewCommon(c, *c.ServiceContent.LicenseManager), + } + + return &m +} + +func mapToKeyValueSlice(m map[string]string) []types.KeyValue { + r := make([]types.KeyValue, len(m)) + for k, v := range m { + r = append(r, types.KeyValue{Key: k, Value: v}) + } + return r +} + +func (m Manager) Add(ctx context.Context, key string, labels map[string]string) (types.LicenseManagerLicenseInfo, error) { + req := types.AddLicense{ + This: m.Reference(), + LicenseKey: key, + Labels: mapToKeyValueSlice(labels), + } + + res, err := methods.AddLicense(ctx, m.Client(), &req) + if err != nil { + return types.LicenseManagerLicenseInfo{}, err + } + + return res.Returnval, nil +} + +func (m Manager) Decode(ctx context.Context, key string) (types.LicenseManagerLicenseInfo, error) { + req := types.DecodeLicense{ + This: m.Reference(), + LicenseKey: key, + } + + res, err := methods.DecodeLicense(ctx, m.Client(), &req) + if err != nil { + return types.LicenseManagerLicenseInfo{}, err + } + + return res.Returnval, nil +} + +func (m Manager) Remove(ctx context.Context, key string) error { + req := types.RemoveLicense{ + This: m.Reference(), + LicenseKey: key, + } + + _, err := methods.RemoveLicense(ctx, m.Client(), &req) + return err +} + +func (m Manager) Update(ctx context.Context, key string, labels map[string]string) (types.LicenseManagerLicenseInfo, error) { + req := types.UpdateLicense{ + This: m.Reference(), + LicenseKey: key, + Labels: mapToKeyValueSlice(labels), + } + + res, err := methods.UpdateLicense(ctx, m.Client(), &req) + if err != nil { + return types.LicenseManagerLicenseInfo{}, err + } + + return res.Returnval, nil +} + +func (m Manager) List(ctx context.Context) (InfoList, error) { + var mlm mo.LicenseManager + + err := m.Properties(ctx, m.Reference(), []string{"licenses"}, &mlm) + if err != nil { + return nil, err + } + + return InfoList(mlm.Licenses), nil +} + +func (m Manager) AssignmentManager(ctx context.Context) (*AssignmentManager, error) { + var mlm mo.LicenseManager + + err := m.Properties(ctx, m.Reference(), []string{"licenseAssignmentManager"}, &mlm) + if err != nil { + return nil, err + } + + if mlm.LicenseAssignmentManager == nil { + return nil, object.ErrNotSupported + } + + am := AssignmentManager{ + object.NewCommon(m.Client(), *mlm.LicenseAssignmentManager), + } + + return &am, nil +} + +type licenseFeature struct { + name string + level int +} + +func parseLicenseFeature(feature string) *licenseFeature { + lf := new(licenseFeature) + + f := strings.Split(feature, ":") + + lf.name = f[0] + + if len(f) > 1 { + var err error + lf.level, err = strconv.Atoi(f[1]) + if err != nil { + lf.name = feature + } + } + + return lf +} + +func HasFeature(license types.LicenseManagerLicenseInfo, key string) bool { + feature := parseLicenseFeature(key) + + for _, p := range license.Properties { + if p.Key != "feature" { + continue + } + + kv, ok := p.Value.(types.KeyValue) + + if !ok { + continue + } + + lf := parseLicenseFeature(kv.Key) + + if lf.name == feature.name && lf.level >= feature.level { + return true + } + } + + return false +} + +// InfoList provides helper methods for []types.LicenseManagerLicenseInfo +type InfoList []types.LicenseManagerLicenseInfo + +func (l InfoList) WithFeature(key string) InfoList { + var result InfoList + + for _, license := range l { + if HasFeature(license, key) { + result = append(result, license) + } + } + + return result +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/LICENSE.txt juju-core-2.0.2/src/github.com/vmware/govmomi/LICENSE.txt --- juju-core-2.0.0/src/github.com/vmware/govmomi/LICENSE.txt 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/LICENSE.txt 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + 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, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/list/lister.go juju-core-2.0.2/src/github.com/vmware/govmomi/list/lister.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/list/lister.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/list/lister.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,572 @@ +/* +Copyright (c) 2014-2016 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package list + +import ( + "fmt" + "path" + "reflect" + + "github.com/vmware/govmomi/property" + "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/soap" + "github.com/vmware/govmomi/vim25/types" + "golang.org/x/net/context" +) + +type Element struct { + Path string + Object mo.Reference +} + +func ToElement(r mo.Reference, prefix string) Element { + var name string + + // Comments about types to be expected in folders copied from the + // documentation of the Folder managed object: + // http://pubs.vmware.com/vsphere-55/topic/com.vmware.wssdk.apiref.doc/vim.Folder.html + switch m := r.(type) { + case mo.Folder: + name = m.Name + case mo.StoragePod: + name = m.Name + + // { "vim.Datacenter" } - Identifies the root folder and its descendant + // folders. Data center folders can contain child data center folders and + // Datacenter managed objects. Datacenter objects contain virtual machine, + // compute resource, network entity, and datastore folders. + case mo.Datacenter: + name = m.Name + + // { "vim.Virtualmachine", "vim.VirtualApp" } - Identifies a virtual machine + // folder. A virtual machine folder may contain child virtual machine + // folders. It also can contain VirtualMachine managed objects, templates, + // and VirtualApp managed objects. + case mo.VirtualMachine: + name = m.Name + case mo.VirtualApp: + name = m.Name + + // { "vim.ComputeResource" } - Identifies a compute resource + // folder, which contains child compute resource folders and ComputeResource + // hierarchies. + case mo.ComputeResource: + name = m.Name + case mo.ClusterComputeResource: + name = m.Name + case mo.HostSystem: + name = m.Name + case mo.ResourcePool: + name = m.Name + + // { "vim.Network" } - Identifies a network entity folder. + // Network entity folders on a vCenter Server can contain Network, + // DistributedVirtualSwitch, and DistributedVirtualPortgroup managed objects. + // Network entity folders on an ESXi host can contain only Network objects. + case mo.Network: + name = m.Name + case mo.DistributedVirtualSwitch: + name = m.Name + case mo.DistributedVirtualPortgroup: + name = m.Name + case mo.VmwareDistributedVirtualSwitch: + name = m.Name + + // { "vim.Datastore" } - Identifies a datastore folder. Datastore folders can + // contain child datastore folders and Datastore managed objects. + case mo.Datastore: + name = m.Name + + default: + panic("not implemented for type " + reflect.TypeOf(r).String()) + } + + e := Element{ + Path: path.Join(prefix, name), + Object: r, + } + + return e +} + +type Lister struct { + Collector *property.Collector + Reference types.ManagedObjectReference + Prefix string + All bool +} + +func traversable(ref types.ManagedObjectReference) bool { + switch ref.Type { + case "Folder": + case "Datacenter": + case "ComputeResource", "ClusterComputeResource": + // Treat ComputeResource and ClusterComputeResource as one and the same. + // It doesn't matter from the perspective of the lister. + case "HostSystem": + case "VirtualApp": + case "StoragePod": + default: + return false + } + + return true +} + +func (l Lister) retrieveProperties(ctx context.Context, req types.RetrieveProperties, dst *[]interface{}) error { + res, err := l.Collector.RetrieveProperties(ctx, req) + if err != nil { + return err + } + + // Instead of using mo.LoadRetrievePropertiesResponse, use a custom loop to + // iterate over the results and ignore entries that have properties that + // could not be retrieved (a non-empty `missingSet` property). Since the + // returned objects are enumerated by vSphere in the first place, any object + // that has a non-empty `missingSet` property is indicative of a race + // condition in vSphere where the object was enumerated initially, but was + // removed before its properties could be collected. + for _, p := range res.Returnval { + v, err := mo.ObjectContentToType(p) + if err != nil { + // Ignore fault if it is ManagedObjectNotFound + if soap.IsVimFault(err) { + switch soap.ToVimFault(err).(type) { + case *types.ManagedObjectNotFound: + continue + } + } + + return err + } + + *dst = append(*dst, v) + } + + return nil +} + +func (l Lister) List(ctx context.Context) ([]Element, error) { + switch l.Reference.Type { + case "Folder", "StoragePod": + return l.ListFolder(ctx) + case "Datacenter": + return l.ListDatacenter(ctx) + case "ComputeResource", "ClusterComputeResource": + // Treat ComputeResource and ClusterComputeResource as one and the same. + // It doesn't matter from the perspective of the lister. + return l.ListComputeResource(ctx) + case "ResourcePool": + return l.ListResourcePool(ctx) + case "HostSystem": + return l.ListHostSystem(ctx) + case "VirtualApp": + return l.ListVirtualApp(ctx) + default: + return nil, fmt.Errorf("cannot traverse type " + l.Reference.Type) + } +} + +func (l Lister) ListFolder(ctx context.Context) ([]Element, error) { + spec := types.PropertyFilterSpec{ + ObjectSet: []types.ObjectSpec{ + { + Obj: l.Reference, + SelectSet: []types.BaseSelectionSpec{ + &types.TraversalSpec{ + Path: "childEntity", + Skip: types.NewBool(false), + Type: "Folder", + }, + }, + Skip: types.NewBool(true), + }, + }, + } + + // Retrieve all objects that we can deal with + childTypes := []string{ + "Folder", + "Datacenter", + "VirtualApp", + "VirtualMachine", + "Network", + "ComputeResource", + "ClusterComputeResource", + "Datastore", + "DistributedVirtualSwitch", + } + + for _, t := range childTypes { + pspec := types.PropertySpec{ + Type: t, + } + + if l.All { + pspec.All = types.NewBool(true) + } else { + pspec.PathSet = []string{"name"} + + // Additional basic properties. + switch t { + case "ComputeResource", "ClusterComputeResource": + // The ComputeResource and ClusterComputeResource are dereferenced in + // the ResourcePoolFlag. Make sure they always have their resourcePool + // field populated. + pspec.PathSet = append(pspec.PathSet, "resourcePool") + } + } + + spec.PropSet = append(spec.PropSet, pspec) + } + + req := types.RetrieveProperties{ + SpecSet: []types.PropertyFilterSpec{spec}, + } + + var dst []interface{} + + err := l.retrieveProperties(ctx, req, &dst) + if err != nil { + return nil, err + } + + es := []Element{} + for _, v := range dst { + es = append(es, ToElement(v.(mo.Reference), l.Prefix)) + } + + return es, nil +} + +func (l Lister) ListDatacenter(ctx context.Context) ([]Element, error) { + ospec := types.ObjectSpec{ + Obj: l.Reference, + Skip: types.NewBool(true), + } + + // Include every datastore folder in the select set + fields := []string{ + "vmFolder", + "hostFolder", + "datastoreFolder", + "networkFolder", + } + + for _, f := range fields { + tspec := types.TraversalSpec{ + Path: f, + Skip: types.NewBool(false), + Type: "Datacenter", + } + + ospec.SelectSet = append(ospec.SelectSet, &tspec) + } + + pspec := types.PropertySpec{ + Type: "Folder", + } + + if l.All { + pspec.All = types.NewBool(true) + } else { + pspec.PathSet = []string{"name"} + } + + req := types.RetrieveProperties{ + SpecSet: []types.PropertyFilterSpec{ + { + ObjectSet: []types.ObjectSpec{ospec}, + PropSet: []types.PropertySpec{pspec}, + }, + }, + } + + var dst []interface{} + + err := l.retrieveProperties(ctx, req, &dst) + if err != nil { + return nil, err + } + + es := []Element{} + for _, v := range dst { + es = append(es, ToElement(v.(mo.Reference), l.Prefix)) + } + + return es, nil +} + +func (l Lister) ListComputeResource(ctx context.Context) ([]Element, error) { + ospec := types.ObjectSpec{ + Obj: l.Reference, + Skip: types.NewBool(true), + } + + fields := []string{ + "host", + "resourcePool", + } + + for _, f := range fields { + tspec := types.TraversalSpec{ + Path: f, + Skip: types.NewBool(false), + Type: "ComputeResource", + } + + ospec.SelectSet = append(ospec.SelectSet, &tspec) + } + + childTypes := []string{ + "HostSystem", + "ResourcePool", + } + + var pspecs []types.PropertySpec + for _, t := range childTypes { + pspec := types.PropertySpec{ + Type: t, + } + + if l.All { + pspec.All = types.NewBool(true) + } else { + pspec.PathSet = []string{"name"} + } + + pspecs = append(pspecs, pspec) + } + + req := types.RetrieveProperties{ + SpecSet: []types.PropertyFilterSpec{ + { + ObjectSet: []types.ObjectSpec{ospec}, + PropSet: pspecs, + }, + }, + } + + var dst []interface{} + + err := l.retrieveProperties(ctx, req, &dst) + if err != nil { + return nil, err + } + + es := []Element{} + for _, v := range dst { + es = append(es, ToElement(v.(mo.Reference), l.Prefix)) + } + + return es, nil +} + +func (l Lister) ListResourcePool(ctx context.Context) ([]Element, error) { + ospec := types.ObjectSpec{ + Obj: l.Reference, + Skip: types.NewBool(true), + } + + fields := []string{ + "resourcePool", + } + + for _, f := range fields { + tspec := types.TraversalSpec{ + Path: f, + Skip: types.NewBool(false), + Type: "ResourcePool", + } + + ospec.SelectSet = append(ospec.SelectSet, &tspec) + } + + childTypes := []string{ + "ResourcePool", + } + + var pspecs []types.PropertySpec + for _, t := range childTypes { + pspec := types.PropertySpec{ + Type: t, + } + + if l.All { + pspec.All = types.NewBool(true) + } else { + pspec.PathSet = []string{"name"} + } + + pspecs = append(pspecs, pspec) + } + + req := types.RetrieveProperties{ + SpecSet: []types.PropertyFilterSpec{ + { + ObjectSet: []types.ObjectSpec{ospec}, + PropSet: pspecs, + }, + }, + } + + var dst []interface{} + + err := l.retrieveProperties(ctx, req, &dst) + if err != nil { + return nil, err + } + + es := []Element{} + for _, v := range dst { + es = append(es, ToElement(v.(mo.Reference), l.Prefix)) + } + + return es, nil +} + +func (l Lister) ListHostSystem(ctx context.Context) ([]Element, error) { + ospec := types.ObjectSpec{ + Obj: l.Reference, + Skip: types.NewBool(true), + } + + fields := []string{ + "datastore", + "network", + "vm", + } + + for _, f := range fields { + tspec := types.TraversalSpec{ + Path: f, + Skip: types.NewBool(false), + Type: "HostSystem", + } + + ospec.SelectSet = append(ospec.SelectSet, &tspec) + } + + childTypes := []string{ + "Datastore", + "Network", + "VirtualMachine", + } + + var pspecs []types.PropertySpec + for _, t := range childTypes { + pspec := types.PropertySpec{ + Type: t, + } + + if l.All { + pspec.All = types.NewBool(true) + } else { + pspec.PathSet = []string{"name"} + } + + pspecs = append(pspecs, pspec) + } + + req := types.RetrieveProperties{ + SpecSet: []types.PropertyFilterSpec{ + { + ObjectSet: []types.ObjectSpec{ospec}, + PropSet: pspecs, + }, + }, + } + + var dst []interface{} + + err := l.retrieveProperties(ctx, req, &dst) + if err != nil { + return nil, err + } + + es := []Element{} + for _, v := range dst { + es = append(es, ToElement(v.(mo.Reference), l.Prefix)) + } + + return es, nil +} + +func (l Lister) ListVirtualApp(ctx context.Context) ([]Element, error) { + ospec := types.ObjectSpec{ + Obj: l.Reference, + Skip: types.NewBool(true), + } + + fields := []string{ + "resourcePool", + "vm", + } + + for _, f := range fields { + tspec := types.TraversalSpec{ + Path: f, + Skip: types.NewBool(false), + Type: "VirtualApp", + } + + ospec.SelectSet = append(ospec.SelectSet, &tspec) + } + + childTypes := []string{ + "ResourcePool", + "VirtualMachine", + } + + var pspecs []types.PropertySpec + for _, t := range childTypes { + pspec := types.PropertySpec{ + Type: t, + } + + if l.All { + pspec.All = types.NewBool(true) + } else { + pspec.PathSet = []string{"name"} + } + + pspecs = append(pspecs, pspec) + } + + req := types.RetrieveProperties{ + SpecSet: []types.PropertyFilterSpec{ + { + ObjectSet: []types.ObjectSpec{ospec}, + PropSet: pspecs, + }, + }, + } + + var dst []interface{} + + err := l.retrieveProperties(ctx, req, &dst) + if err != nil { + return nil, err + } + + es := []Element{} + for _, v := range dst { + es = append(es, ToElement(v.(mo.Reference), l.Prefix)) + } + + return es, nil +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/list/path.go juju-core-2.0.2/src/github.com/vmware/govmomi/list/path.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/list/path.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/list/path.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,44 @@ +/* +Copyright (c) 2014 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package list + +import ( + "path" + "strings" +) + +func ToParts(p string) []string { + p = path.Clean(p) + if p == "/" { + return []string{} + } + + if len(p) > 0 { + // Prefix ./ if relative + if p[0] != '/' && p[0] != '.' { + p = "./" + p + } + } + + ps := strings.Split(p, "/") + if ps[0] == "" { + // Start at root + ps = ps[1:] + } + + return ps +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/list/path_test.go juju-core-2.0.2/src/github.com/vmware/govmomi/list/path_test.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/list/path_test.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/list/path_test.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,93 @@ +/* +Copyright (c) 2014 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package list + +import ( + "reflect" + "testing" +) + +func TestToParts(t *testing.T) { + tests := []struct { + In string + Out []string + }{ + { + In: "/", + Out: []string{}, + }, + { + In: "/foo", + Out: []string{"foo"}, + }, + { + In: "/foo/..", + Out: []string{}, + }, + { + In: "/./foo", + Out: []string{"foo"}, + }, + { + In: "/../foo", + Out: []string{"foo"}, + }, + { + In: "/foo/bar", + Out: []string{"foo", "bar"}, + }, + { + In: "/foo/bar/..", + Out: []string{"foo"}, + }, + { + In: "", + Out: []string{"."}, + }, + { + In: ".", + Out: []string{"."}, + }, + { + In: "foo", + Out: []string{".", "foo"}, + }, + { + In: "foo/..", + Out: []string{"."}, + }, + { + In: "./foo", + Out: []string{".", "foo"}, + }, + { + In: "../foo", // Special case... + Out: []string{"..", "foo"}, + }, + { + In: "foo/bar/..", + Out: []string{".", "foo"}, + }, + } + + for _, test := range tests { + out := ToParts(test.In) + if !reflect.DeepEqual(test.Out, out) { + t.Errorf("Expected %s to return: %#v, actual: %#v", test.In, test.Out, out) + } + } +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/list/recurser.go juju-core-2.0.2/src/github.com/vmware/govmomi/list/recurser.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/list/recurser.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/list/recurser.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,97 @@ +/* +Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package list + +import ( + "path" + "path/filepath" + + "github.com/vmware/govmomi/property" + "golang.org/x/net/context" +) + +type Recurser struct { + Collector *property.Collector + + // All configures the recurses to fetch complete objects for leaf nodes. + All bool + + // TraverseLeafs configures the Recurser to traverse traversable leaf nodes. + // This is typically set to true when used from the ls command, where listing + // a folder means listing its contents. This is typically set to false for + // commands that take managed entities that are not folders as input. + TraverseLeafs bool +} + +func (r Recurser) Recurse(ctx context.Context, root Element, parts []string) ([]Element, error) { + if len(parts) == 0 { + // Include non-traversable leaf elements in result. For example, consider + // the pattern "./vm/my-vm-*", where the pattern should match the VMs and + // not try to traverse them. + // + // Include traversable leaf elements in result, if the TraverseLeafs + // field is set to false. + // + if !traversable(root.Object.Reference()) || !r.TraverseLeafs { + return []Element{root}, nil + } + } + + k := Lister{ + Collector: r.Collector, + Reference: root.Object.Reference(), + Prefix: root.Path, + } + + if r.All && len(parts) < 2 { + k.All = true + } + + in, err := k.List(ctx) + if err != nil { + return nil, err + } + + // This folder is a leaf as far as the glob goes. + if len(parts) == 0 { + return in, nil + } + + pattern := parts[0] + parts = parts[1:] + + var out []Element + for _, e := range in { + matched, err := filepath.Match(pattern, path.Base(e.Path)) + if err != nil { + return nil, err + } + + if !matched { + continue + } + + nres, err := r.Recurse(ctx, e, parts) + if err != nil { + return nil, err + } + + out = append(out, nres...) + } + + return out, nil +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/Makefile juju-core-2.0.2/src/github.com/vmware/govmomi/Makefile --- juju-core-2.0.0/src/github.com/vmware/govmomi/Makefile 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/Makefile 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,24 @@ +.PHONY: test + +all: check test + +check: goimports govet + +vendor: + go get golang.org/x/tools/cmd/goimports + go get github.com/davecgh/go-spew/spew + go get golang.org/x/net/context + +goimports: vendor + @echo checking go imports... + @! goimports -d . 2>&1 | egrep -v '^$$' + +govet: + @echo checking go vet... + @go tool vet -structtags=false -methods=false . + +test: vendor + go test -v $(TEST_OPTS) ./... + +install: vendor + go install github.com/vmware/govmomi/govc diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/object/authorization_manager.go juju-core-2.0.2/src/github.com/vmware/govmomi/object/authorization_manager.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/object/authorization_manager.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/object/authorization_manager.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,108 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package object + +import ( + "github.com/vmware/govmomi/vim25" + "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/types" + "golang.org/x/net/context" +) + +type AuthorizationManager struct { + Common +} + +func NewAuthorizationManager(c *vim25.Client) *AuthorizationManager { + m := AuthorizationManager{ + Common: NewCommon(c, *c.ServiceContent.AuthorizationManager), + } + + return &m +} + +type AuthorizationRoleList []types.AuthorizationRole + +func (l AuthorizationRoleList) ById(id int32) *types.AuthorizationRole { + for _, role := range l { + if role.RoleId == id { + return &role + } + } + + return nil +} + +func (l AuthorizationRoleList) ByName(name string) *types.AuthorizationRole { + for _, role := range l { + if role.Name == name { + return &role + } + } + + return nil +} + +func (m AuthorizationManager) RoleList(ctx context.Context) (AuthorizationRoleList, error) { + var am mo.AuthorizationManager + + err := m.Properties(ctx, m.Reference(), []string{"roleList"}, &am) + if err != nil { + return nil, err + } + + return AuthorizationRoleList(am.RoleList), nil +} + +func (m AuthorizationManager) RetrieveEntityPermissions(ctx context.Context, entity types.ManagedObjectReference, inherited bool) ([]types.Permission, error) { + req := types.RetrieveEntityPermissions{ + This: m.Reference(), + Entity: entity, + Inherited: inherited, + } + + res, err := methods.RetrieveEntityPermissions(ctx, m.Client(), &req) + if err != nil { + return nil, err + } + + return res.Returnval, nil +} + +func (m AuthorizationManager) RemoveEntityPermission(ctx context.Context, entity types.ManagedObjectReference, user string, isGroup bool) error { + req := types.RemoveEntityPermission{ + This: m.Reference(), + Entity: entity, + User: user, + IsGroup: isGroup, + } + + _, err := methods.RemoveEntityPermission(ctx, m.Client(), &req) + return err +} + +func (m AuthorizationManager) SetEntityPermissions(ctx context.Context, entity types.ManagedObjectReference, permission []types.Permission) error { + req := types.SetEntityPermissions{ + This: m.Reference(), + Entity: entity, + Permission: permission, + } + + _, err := methods.SetEntityPermissions(ctx, m.Client(), &req) + return err +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/object/cluster_compute_resource.go juju-core-2.0.2/src/github.com/vmware/govmomi/object/cluster_compute_resource.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/object/cluster_compute_resource.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/object/cluster_compute_resource.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,85 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package object + +import ( + "github.com/vmware/govmomi/vim25" + "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/types" + "golang.org/x/net/context" +) + +type ClusterComputeResource struct { + ComputeResource +} + +func NewClusterComputeResource(c *vim25.Client, ref types.ManagedObjectReference) *ClusterComputeResource { + return &ClusterComputeResource{ + ComputeResource: *NewComputeResource(c, ref), + } +} + +func (c ClusterComputeResource) ReconfigureCluster(ctx context.Context, spec types.ClusterConfigSpec) (*Task, error) { + req := types.ReconfigureCluster_Task{ + This: c.Reference(), + Spec: spec, + Modify: true, + } + + res, err := methods.ReconfigureCluster_Task(ctx, c.c, &req) + if err != nil { + return nil, err + } + + return NewTask(c.c, res.Returnval), nil +} + +func (c ClusterComputeResource) AddHost(ctx context.Context, spec types.HostConnectSpec, asConnected bool, license *string, resourcePool *types.ManagedObjectReference) (*Task, error) { + req := types.AddHost_Task{ + This: c.Reference(), + Spec: spec, + AsConnected: asConnected, + } + + if license != nil { + req.License = *license + } + + if resourcePool != nil { + req.ResourcePool = resourcePool + } + + res, err := methods.AddHost_Task(ctx, c.c, &req) + if err != nil { + return nil, err + } + + return NewTask(c.c, res.Returnval), nil +} + +func (c ClusterComputeResource) Destroy(ctx context.Context) (*Task, error) { + req := types.Destroy_Task{ + This: c.Reference(), + } + + res, err := methods.Destroy_Task(ctx, c.c, &req) + if err != nil { + return nil, err + } + + return NewTask(c.c, res.Returnval), nil +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/object/cluster_compute_resource_test.go juju-core-2.0.2/src/github.com/vmware/govmomi/object/cluster_compute_resource_test.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/object/cluster_compute_resource_test.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/object/cluster_compute_resource_test.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,20 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package object + +// ComputeResource should implement the Reference interface. +var _ Reference = ClusterComputeResource{} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/object/common.go juju-core-2.0.2/src/github.com/vmware/govmomi/object/common.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/object/common.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/object/common.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,125 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package object + +import ( + "errors" + "fmt" + "path" + + "github.com/vmware/govmomi/property" + "github.com/vmware/govmomi/vim25" + "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/types" + "golang.org/x/net/context" +) + +var ( + ErrNotSupported = errors.New("not supported (vCenter only)") +) + +// Common contains the fields and functions common to all objects. +type Common struct { + InventoryPath string + + c *vim25.Client + r types.ManagedObjectReference +} + +func (c Common) String() string { + ref := fmt.Sprintf("%v", c.Reference()) + + if c.InventoryPath == "" { + return ref + } + + return fmt.Sprintf("%s @ %s", ref, c.InventoryPath) +} + +func NewCommon(c *vim25.Client, r types.ManagedObjectReference) Common { + return Common{c: c, r: r} +} + +func (c Common) Reference() types.ManagedObjectReference { + return c.r +} + +func (c Common) Client() *vim25.Client { + return c.c +} + +// Name returns the base name of the InventoryPath field +func (c Common) Name() string { + if c.InventoryPath == "" { + return "" + } + return path.Base(c.InventoryPath) +} + +func (c *Common) SetInventoryPath(p string) { + c.InventoryPath = p +} + +// ObjectName returns the base name of the InventoryPath field if set, +// otherwise fetches the mo.ManagedEntity.Name field via the property collector. +func (c Common) ObjectName(ctx context.Context) (string, error) { + var o mo.ManagedEntity + + name := c.Name() + if name != "" { + return name, nil + } + + err := c.Properties(ctx, c.Reference(), []string{"name"}, &o) + if err != nil { + return "", err + } + + return o.Name, nil +} + +func (c Common) Properties(ctx context.Context, r types.ManagedObjectReference, ps []string, dst interface{}) error { + return property.DefaultCollector(c.c).RetrieveOne(ctx, r, ps, dst) +} + +func (c Common) Destroy(ctx context.Context) (*Task, error) { + req := types.Destroy_Task{ + This: c.Reference(), + } + + res, err := methods.Destroy_Task(ctx, c.c, &req) + if err != nil { + return nil, err + } + + return NewTask(c.c, res.Returnval), nil +} + +func (c Common) Rename(ctx context.Context, name string) (*Task, error) { + req := types.Rename_Task{ + This: c.Reference(), + NewName: name, + } + + res, err := methods.Rename_Task(ctx, c.c, &req) + if err != nil { + return nil, err + } + + return NewTask(c.c, res.Returnval), nil +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/object/common_test.go juju-core-2.0.2/src/github.com/vmware/govmomi/object/common_test.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/object/common_test.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/object/common_test.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,34 @@ +/* +Copyright (c) 2016 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package object + +import "testing" + +func TestCommonName(t *testing.T) { + c := &Common{} + + name := c.Name() + if name != "" { + t.Errorf("Name=%s", name) + } + + c.InventoryPath = "/foo/bar" + name = c.Name() + if name != "bar" { + t.Errorf("Name=%s", name) + } +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/object/compute_resource.go juju-core-2.0.2/src/github.com/vmware/govmomi/object/compute_resource.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/object/compute_resource.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/object/compute_resource.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,124 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package object + +import ( + "path" + + "github.com/vmware/govmomi/property" + "github.com/vmware/govmomi/vim25" + "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/types" + "golang.org/x/net/context" +) + +type ComputeResource struct { + Common +} + +func NewComputeResource(c *vim25.Client, ref types.ManagedObjectReference) *ComputeResource { + return &ComputeResource{ + Common: NewCommon(c, ref), + } +} + +func (c ComputeResource) Hosts(ctx context.Context) ([]*HostSystem, error) { + var cr mo.ComputeResource + + err := c.Properties(ctx, c.Reference(), []string{"host"}, &cr) + if err != nil { + return nil, err + } + + if len(cr.Host) == 0 { + return nil, nil + } + + var hs []mo.HostSystem + pc := property.DefaultCollector(c.Client()) + err = pc.Retrieve(ctx, cr.Host, []string{"name"}, &hs) + if err != nil { + return nil, err + } + + var hosts []*HostSystem + + for _, h := range hs { + host := NewHostSystem(c.Client(), h.Reference()) + host.InventoryPath = path.Join(c.InventoryPath, h.Name) + hosts = append(hosts, host) + } + + return hosts, nil +} + +func (c ComputeResource) Datastores(ctx context.Context) ([]*Datastore, error) { + var cr mo.ComputeResource + + err := c.Properties(ctx, c.Reference(), []string{"datastore"}, &cr) + if err != nil { + return nil, err + } + + var dss []*Datastore + for _, ref := range cr.Datastore { + ds := NewDatastore(c.c, ref) + dss = append(dss, ds) + } + + return dss, nil +} + +func (c ComputeResource) ResourcePool(ctx context.Context) (*ResourcePool, error) { + var cr mo.ComputeResource + + err := c.Properties(ctx, c.Reference(), []string{"resourcePool"}, &cr) + if err != nil { + return nil, err + } + + return NewResourcePool(c.c, *cr.ResourcePool), nil +} + +func (c ComputeResource) Reconfigure(ctx context.Context, spec types.BaseComputeResourceConfigSpec, modify bool) (*Task, error) { + req := types.ReconfigureComputeResource_Task{ + This: c.Reference(), + Spec: spec, + Modify: modify, + } + + res, err := methods.ReconfigureComputeResource_Task(ctx, c.c, &req) + if err != nil { + return nil, err + } + + return NewTask(c.c, res.Returnval), nil +} + +func (c ComputeResource) Destroy(ctx context.Context) (*Task, error) { + req := types.Destroy_Task{ + This: c.Reference(), + } + + res, err := methods.Destroy_Task(ctx, c.c, &req) + if err != nil { + return nil, err + } + + return NewTask(c.c, res.Returnval), nil +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/object/compute_resource_test.go juju-core-2.0.2/src/github.com/vmware/govmomi/object/compute_resource_test.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/object/compute_resource_test.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/object/compute_resource_test.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,20 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package object + +// ComputeResource should implement the Reference interface. +var _ Reference = ComputeResource{} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/object/custom_fields_manager.go juju-core-2.0.2/src/github.com/vmware/govmomi/object/custom_fields_manager.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/object/custom_fields_manager.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/object/custom_fields_manager.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,135 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package object + +import ( + "errors" + "strconv" + + "github.com/vmware/govmomi/vim25" + "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/types" + "golang.org/x/net/context" +) + +var ( + ErrKeyNameNotFound = errors.New("key name not found") +) + +type CustomFieldsManager struct { + Common +} + +// GetCustomFieldsManager wraps NewCustomFieldsManager, returning ErrNotSupported +// when the client is not connected to a vCenter instance. +func GetCustomFieldsManager(c *vim25.Client) (*CustomFieldsManager, error) { + if c.ServiceContent.CustomFieldsManager == nil { + return nil, ErrNotSupported + } + return NewCustomFieldsManager(c), nil +} + +func NewCustomFieldsManager(c *vim25.Client) *CustomFieldsManager { + m := CustomFieldsManager{ + Common: NewCommon(c, *c.ServiceContent.CustomFieldsManager), + } + + return &m +} + +func (m CustomFieldsManager) Add(ctx context.Context, name string, moType string, fieldDefPolicy *types.PrivilegePolicyDef, fieldPolicy *types.PrivilegePolicyDef) (*types.CustomFieldDef, error) { + req := types.AddCustomFieldDef{ + This: m.Reference(), + Name: name, + MoType: moType, + FieldDefPolicy: fieldDefPolicy, + FieldPolicy: fieldPolicy, + } + + res, err := methods.AddCustomFieldDef(ctx, m.c, &req) + if err != nil { + return nil, err + } + + return &res.Returnval, nil +} + +func (m CustomFieldsManager) Remove(ctx context.Context, key int32) error { + req := types.RemoveCustomFieldDef{ + This: m.Reference(), + Key: key, + } + + _, err := methods.RemoveCustomFieldDef(ctx, m.c, &req) + return err +} + +func (m CustomFieldsManager) Rename(ctx context.Context, key int32, name string) error { + req := types.RenameCustomFieldDef{ + This: m.Reference(), + Key: key, + Name: name, + } + + _, err := methods.RenameCustomFieldDef(ctx, m.c, &req) + return err +} + +func (m CustomFieldsManager) Set(ctx context.Context, entity types.ManagedObjectReference, key int32, value string) error { + req := types.SetField{ + This: m.Reference(), + Entity: entity, + Key: key, + Value: value, + } + + _, err := methods.SetField(ctx, m.c, &req) + return err +} + +func (m CustomFieldsManager) Field(ctx context.Context) ([]types.CustomFieldDef, error) { + var fm mo.CustomFieldsManager + + err := m.Properties(ctx, m.Reference(), []string{"field"}, &fm) + if err != nil { + return nil, err + } + + return fm.Field, nil +} + +func (m CustomFieldsManager) FindKey(ctx context.Context, key string) (int32, error) { + field, err := m.Field(ctx) + if err != nil { + return -1, err + } + + for _, def := range field { + if def.Name == key { + return def.Key, nil + } + } + + k, err := strconv.Atoi(key) + if err == nil { + // assume literal int key + return int32(k), nil + } + + return -1, ErrKeyNameNotFound +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/object/customization_spec_manager.go juju-core-2.0.2/src/github.com/vmware/govmomi/object/customization_spec_manager.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/object/customization_spec_manager.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/object/customization_spec_manager.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,165 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package object + +import ( + "github.com/vmware/govmomi/vim25" + "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/types" + "golang.org/x/net/context" +) + +type CustomizationSpecManager struct { + Common +} + +func NewCustomizationSpecManager(c *vim25.Client) *CustomizationSpecManager { + cs := CustomizationSpecManager{ + Common: NewCommon(c, *c.ServiceContent.CustomizationSpecManager), + } + + return &cs +} + +func (cs CustomizationSpecManager) DoesCustomizationSpecExist(ctx context.Context, name string) (bool, error) { + req := types.DoesCustomizationSpecExist{ + This: cs.Reference(), + Name: name, + } + + res, err := methods.DoesCustomizationSpecExist(ctx, cs.c, &req) + + if err != nil { + return false, err + } + + return res.Returnval, nil +} + +func (cs CustomizationSpecManager) GetCustomizationSpec(ctx context.Context, name string) (*types.CustomizationSpecItem, error) { + req := types.GetCustomizationSpec{ + This: cs.Reference(), + Name: name, + } + + res, err := methods.GetCustomizationSpec(ctx, cs.c, &req) + + if err != nil { + return nil, err + } + + return &res.Returnval, nil +} + +func (cs CustomizationSpecManager) CreateCustomizationSpec(ctx context.Context, item types.CustomizationSpecItem) error { + req := types.CreateCustomizationSpec{ + This: cs.Reference(), + Item: item, + } + + _, err := methods.CreateCustomizationSpec(ctx, cs.c, &req) + if err != nil { + return err + } + + return nil +} + +func (cs CustomizationSpecManager) OverwriteCustomizationSpec(ctx context.Context, item types.CustomizationSpecItem) error { + req := types.OverwriteCustomizationSpec{ + This: cs.Reference(), + Item: item, + } + + _, err := methods.OverwriteCustomizationSpec(ctx, cs.c, &req) + if err != nil { + return err + } + + return nil +} + +func (cs CustomizationSpecManager) DeleteCustomizationSpec(ctx context.Context, name string) error { + req := types.DeleteCustomizationSpec{ + This: cs.Reference(), + Name: name, + } + + _, err := methods.DeleteCustomizationSpec(ctx, cs.c, &req) + if err != nil { + return err + } + + return nil +} + +func (cs CustomizationSpecManager) DuplicateCustomizationSpec(ctx context.Context, name string, newName string) error { + req := types.DuplicateCustomizationSpec{ + This: cs.Reference(), + Name: name, + NewName: newName, + } + + _, err := methods.DuplicateCustomizationSpec(ctx, cs.c, &req) + if err != nil { + return err + } + + return nil +} + +func (cs CustomizationSpecManager) RenameCustomizationSpec(ctx context.Context, name string, newName string) error { + req := types.RenameCustomizationSpec{ + This: cs.Reference(), + Name: name, + NewName: newName, + } + + _, err := methods.RenameCustomizationSpec(ctx, cs.c, &req) + if err != nil { + return err + } + + return nil +} + +func (cs CustomizationSpecManager) CustomizationSpecItemToXml(ctx context.Context, item types.CustomizationSpecItem) (string, error) { + req := types.CustomizationSpecItemToXml{ + This: cs.Reference(), + Item: item, + } + + res, err := methods.CustomizationSpecItemToXml(ctx, cs.c, &req) + if err != nil { + return "", err + } + + return res.Returnval, nil +} + +func (cs CustomizationSpecManager) XmlToCustomizationSpecItem(ctx context.Context, xml string) (*types.CustomizationSpecItem, error) { + req := types.XmlToCustomizationSpecItem{ + This: cs.Reference(), + SpecItemXml: xml, + } + + res, err := methods.XmlToCustomizationSpecItem(ctx, cs.c, &req) + if err != nil { + return nil, err + } + return &res.Returnval, nil +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/object/datacenter.go juju-core-2.0.2/src/github.com/vmware/govmomi/object/datacenter.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/object/datacenter.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/object/datacenter.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,90 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package object + +import ( + "fmt" + + "github.com/vmware/govmomi/vim25" + "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/types" + "golang.org/x/net/context" +) + +type DatacenterFolders struct { + VmFolder *Folder + HostFolder *Folder + DatastoreFolder *Folder + NetworkFolder *Folder +} + +type Datacenter struct { + Common +} + +func NewDatacenter(c *vim25.Client, ref types.ManagedObjectReference) *Datacenter { + return &Datacenter{ + Common: NewCommon(c, ref), + } +} + +func (d *Datacenter) Folders(ctx context.Context) (*DatacenterFolders, error) { + var md mo.Datacenter + + ps := []string{"name", "vmFolder", "hostFolder", "datastoreFolder", "networkFolder"} + err := d.Properties(ctx, d.Reference(), ps, &md) + if err != nil { + return nil, err + } + + df := &DatacenterFolders{ + VmFolder: NewFolder(d.c, md.VmFolder), + HostFolder: NewFolder(d.c, md.HostFolder), + DatastoreFolder: NewFolder(d.c, md.DatastoreFolder), + NetworkFolder: NewFolder(d.c, md.NetworkFolder), + } + + paths := []struct { + name string + path *string + }{ + {"vm", &df.VmFolder.InventoryPath}, + {"host", &df.HostFolder.InventoryPath}, + {"datastore", &df.DatastoreFolder.InventoryPath}, + {"network", &df.NetworkFolder.InventoryPath}, + } + + for _, p := range paths { + *p.path = fmt.Sprintf("/%s/%s", md.Name, p.name) + } + + return df, nil +} + +func (d Datacenter) Destroy(ctx context.Context) (*Task, error) { + req := types.Destroy_Task{ + This: d.Reference(), + } + + res, err := methods.Destroy_Task(ctx, d.c, &req) + if err != nil { + return nil, err + } + + return NewTask(d.c, res.Returnval), nil +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/object/datacenter_test.go juju-core-2.0.2/src/github.com/vmware/govmomi/object/datacenter_test.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/object/datacenter_test.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/object/datacenter_test.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,20 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package object + +// Datacenter should implement the Reference interface. +var _ Reference = Datacenter{} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/object/datastore.go juju-core-2.0.2/src/github.com/vmware/govmomi/object/datastore.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/object/datastore.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/object/datastore.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,397 @@ +/* +Copyright (c) 2015-2016 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package object + +import ( + "fmt" + "io" + "math/rand" + "os" + "path" + "strings" + + "net/http" + "net/url" + + "github.com/vmware/govmomi/property" + "github.com/vmware/govmomi/session" + "github.com/vmware/govmomi/vim25" + "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/soap" + "github.com/vmware/govmomi/vim25/types" + "golang.org/x/net/context" +) + +// DatastoreNoSuchDirectoryError is returned when a directory could not be found. +type DatastoreNoSuchDirectoryError struct { + verb string + subject string +} + +func (e DatastoreNoSuchDirectoryError) Error() string { + return fmt.Sprintf("cannot %s '%s': No such directory", e.verb, e.subject) +} + +// DatastoreNoSuchFileError is returned when a file could not be found. +type DatastoreNoSuchFileError struct { + verb string + subject string +} + +func (e DatastoreNoSuchFileError) Error() string { + return fmt.Sprintf("cannot %s '%s': No such file", e.verb, e.subject) +} + +type Datastore struct { + Common +} + +func NewDatastore(c *vim25.Client, ref types.ManagedObjectReference) *Datastore { + return &Datastore{ + Common: NewCommon(c, ref), + } +} + +func (d Datastore) Path(path string) string { + name := d.Name() + if name == "" { + panic("expected non-empty name") + } + + return fmt.Sprintf("[%s] %s", name, path) +} + +// URL for datastore access over HTTP +func (d Datastore) URL(ctx context.Context, dc *Datacenter, path string) (*url.URL, error) { + var mdc mo.Datacenter + if err := dc.Properties(ctx, dc.Reference(), []string{"name"}, &mdc); err != nil { + return nil, err + } + + var mds mo.Datastore + if err := d.Properties(ctx, d.Reference(), []string{"name"}, &mds); err != nil { + return nil, err + } + + u := d.c.URL() + + return &url.URL{ + Scheme: u.Scheme, + Host: u.Host, + Path: fmt.Sprintf("/folder/%s", path), + RawQuery: url.Values{ + "dcPath": []string{mdc.Name}, + "dsName": []string{mds.Name}, + }.Encode(), + }, nil +} + +func (d Datastore) Browser(ctx context.Context) (*HostDatastoreBrowser, error) { + var do mo.Datastore + + err := d.Properties(ctx, d.Reference(), []string{"browser"}, &do) + if err != nil { + return nil, err + } + + return NewHostDatastoreBrowser(d.c, do.Browser), nil +} + +func (d Datastore) useServiceTicketHostName(name string) bool { + // No need if talking directly to ESX. + if !d.c.IsVC() { + return false + } + + // If version happens to be < 5.1 + if name == "" { + return false + } + + // If the HostSystem is using DHCP on a network without dynamic DNS, + // HostSystem.Config.Network.DnsConfig.HostName is set to "localhost" by default. + // This resolves to "localhost.localdomain" by default via /etc/hosts on ESX. + // In that case, we will stick with the HostSystem.Name which is the IP address that + // was used to connect the host to VC. + if name == "localhost.localdomain" { + return false + } + + // Still possible to have HostName that don't resolve via DNS, + // so we default to false. + key := "GOVMOMI_USE_SERVICE_TICKET_HOSTNAME" + + val := d.c.URL().Query().Get(key) + if val == "" { + val = os.Getenv(key) + } + + if val == "1" || val == "true" { + return true + } + + return false +} + +// ServiceTicket obtains a ticket via AcquireGenericServiceTicket and returns it an http.Cookie with the url.URL +// that can be used along with the ticket cookie to access the given path. +func (d Datastore) ServiceTicket(ctx context.Context, path string, method string) (*url.URL, *http.Cookie, error) { + // We are uploading to an ESX host + u := &url.URL{ + Scheme: d.c.URL().Scheme, + Host: d.c.URL().Host, + Path: fmt.Sprintf("/folder/%s", path), + RawQuery: url.Values{ + "dsName": []string{d.Name()}, + }.Encode(), + } + + // If connected to VC, the ticket request must be for an ESX host. + if d.c.IsVC() { + hosts, err := d.AttachedHosts(ctx) + if err != nil { + return nil, nil, err + } + + if len(hosts) == 0 { + return nil, nil, fmt.Errorf("no hosts attached to datastore %#v", d.Reference()) + } + + // Pick a random attached host + host := hosts[rand.Intn(len(hosts))] + name, err := host.ObjectName(ctx) + if err != nil { + return nil, nil, err + } + u.Host = name + } + + spec := types.SessionManagerHttpServiceRequestSpec{ + Url: u.String(), + // See SessionManagerHttpServiceRequestSpecMethod enum + Method: fmt.Sprintf("http%s%s", method[0:1], strings.ToLower(method[1:])), + } + + sm := session.NewManager(d.Client()) + + ticket, err := sm.AcquireGenericServiceTicket(ctx, &spec) + if err != nil { + return nil, nil, err + } + + cookie := &http.Cookie{ + Name: "vmware_cgi_ticket", + Value: ticket.Id, + } + + if d.useServiceTicketHostName(ticket.HostName) { + u.Host = ticket.HostName + } + + return u, cookie, nil +} + +func (d Datastore) uploadTicket(ctx context.Context, path string, param *soap.Upload) (*url.URL, *soap.Upload, error) { + p := soap.DefaultUpload + if param != nil { + p = *param // copy + } + + u, ticket, err := d.ServiceTicket(ctx, path, p.Method) + if err != nil { + return nil, nil, err + } + + p.Ticket = ticket + + return u, &p, nil +} + +func (d Datastore) downloadTicket(ctx context.Context, path string, param *soap.Download) (*url.URL, *soap.Download, error) { + p := soap.DefaultDownload + if param != nil { + p = *param // copy + } + + u, ticket, err := d.ServiceTicket(ctx, path, p.Method) + if err != nil { + return nil, nil, err + } + + p.Ticket = ticket + + return u, &p, nil +} + +// Upload via soap.Upload with an http service ticket +func (d Datastore) Upload(ctx context.Context, f io.Reader, path string, param *soap.Upload) error { + u, p, err := d.uploadTicket(ctx, path, param) + if err != nil { + return err + } + return d.Client().Upload(f, u, p) +} + +// UploadFile via soap.Upload with an http service ticket +func (d Datastore) UploadFile(ctx context.Context, file string, path string, param *soap.Upload) error { + u, p, err := d.uploadTicket(ctx, path, param) + if err != nil { + return err + } + return d.Client().UploadFile(file, u, p) +} + +// Download via soap.Download with an http service ticket +func (d Datastore) Download(ctx context.Context, path string, param *soap.Download) (io.ReadCloser, int64, error) { + u, p, err := d.downloadTicket(ctx, path, param) + if err != nil { + return nil, 0, err + } + return d.Client().Download(u, p) +} + +// DownloadFile via soap.Download with an http service ticket +func (d Datastore) DownloadFile(ctx context.Context, path string, file string, param *soap.Download) error { + u, p, err := d.downloadTicket(ctx, path, param) + if err != nil { + return err + } + return d.Client().DownloadFile(file, u, p) +} + +// AttachedHosts returns hosts that have this Datastore attached, accessible and writable. +func (d Datastore) AttachedHosts(ctx context.Context) ([]*HostSystem, error) { + var ds mo.Datastore + var hosts []*HostSystem + + pc := property.DefaultCollector(d.Client()) + err := pc.RetrieveOne(ctx, d.Reference(), []string{"host"}, &ds) + if err != nil { + return nil, err + } + + mounts := make(map[types.ManagedObjectReference]types.DatastoreHostMount) + var refs []types.ManagedObjectReference + for _, host := range ds.Host { + refs = append(refs, host.Key) + mounts[host.Key] = host + } + + var hs []mo.HostSystem + err = pc.Retrieve(ctx, refs, []string{"runtime.connectionState", "runtime.powerState"}, &hs) + if err != nil { + return nil, err + } + + for _, host := range hs { + if host.Runtime.ConnectionState == types.HostSystemConnectionStateConnected && + host.Runtime.PowerState == types.HostSystemPowerStatePoweredOn { + + mount := mounts[host.Reference()] + info := mount.MountInfo + + if *info.Mounted && *info.Accessible && info.AccessMode == string(types.HostMountModeReadWrite) { + hosts = append(hosts, NewHostSystem(d.Client(), mount.Key)) + } + } + } + + return hosts, nil +} + +// AttachedHosts returns hosts that have this Datastore attached, accessible and writable and are members of the given cluster. +func (d Datastore) AttachedClusterHosts(ctx context.Context, cluster *ComputeResource) ([]*HostSystem, error) { + var hosts []*HostSystem + + clusterHosts, err := cluster.Hosts(ctx) + if err != nil { + return nil, err + } + + attachedHosts, err := d.AttachedHosts(ctx) + if err != nil { + return nil, err + } + + refs := make(map[types.ManagedObjectReference]bool) + for _, host := range attachedHosts { + refs[host.Reference()] = true + } + + for _, host := range clusterHosts { + if refs[host.Reference()] { + hosts = append(hosts, host) + } + } + + return hosts, nil +} + +func (d Datastore) Stat(ctx context.Context, file string) (types.BaseFileInfo, error) { + b, err := d.Browser(ctx) + if err != nil { + return nil, err + } + + spec := types.HostDatastoreBrowserSearchSpec{ + Details: &types.FileQueryFlags{ + FileType: true, + FileSize: true, + Modification: true, + FileOwner: types.NewBool(true), + }, + MatchPattern: []string{path.Base(file)}, + } + + dsPath := d.Path(path.Dir(file)) + task, err := b.SearchDatastore(context.TODO(), dsPath, &spec) + if err != nil { + return nil, err + } + + info, err := task.WaitForResult(context.TODO(), nil) + if err != nil { + if info == nil || info.Error != nil { + _, ok := info.Error.Fault.(*types.FileNotFound) + if ok { + // FileNotFound means the base path doesn't exist. + return nil, DatastoreNoSuchDirectoryError{"stat", dsPath} + } + } + + return nil, err + } + + res := info.Result.(types.HostDatastoreBrowserSearchResults) + if len(res.File) == 0 { + // File doesn't exist + return nil, DatastoreNoSuchFileError{"stat", d.Path(file)} + } + + return res.File[0], nil + +} + +// Type returns the type of file system volume. +func (d Datastore) Type(ctx context.Context) (types.HostFileSystemVolumeFileSystemType, error) { + var mds mo.Datastore + + if err := d.Properties(ctx, d.Reference(), []string{"summary.type"}, &mds); err != nil { + return types.HostFileSystemVolumeFileSystemType(""), err + } + return types.HostFileSystemVolumeFileSystemType(mds.Summary.Type), nil +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/object/datastore_test.go juju-core-2.0.2/src/github.com/vmware/govmomi/object/datastore_test.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/object/datastore_test.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/object/datastore_test.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,20 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package object + +// Datastore should implement the Reference interface. +var _ Reference = Datastore{} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/object/diagnostic_manager.go juju-core-2.0.2/src/github.com/vmware/govmomi/object/diagnostic_manager.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/object/diagnostic_manager.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/object/diagnostic_manager.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,95 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package object + +import ( + "github.com/vmware/govmomi/vim25" + "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/types" + "golang.org/x/net/context" +) + +type DiagnosticManager struct { + Common +} + +func NewDiagnosticManager(c *vim25.Client) *DiagnosticManager { + m := DiagnosticManager{ + Common: NewCommon(c, *c.ServiceContent.DiagnosticManager), + } + + return &m +} + +func (m DiagnosticManager) BrowseLog(ctx context.Context, host *HostSystem, key string, start, lines int32) (*types.DiagnosticManagerLogHeader, error) { + req := types.BrowseDiagnosticLog{ + This: m.Reference(), + Key: key, + Start: start, + Lines: lines, + } + + if host != nil { + ref := host.Reference() + req.Host = &ref + } + + res, err := methods.BrowseDiagnosticLog(ctx, m.Client(), &req) + if err != nil { + return nil, err + } + + return &res.Returnval, nil +} + +func (m DiagnosticManager) GenerateLogBundles(ctx context.Context, includeDefault bool, host []*HostSystem) (*Task, error) { + req := types.GenerateLogBundles_Task{ + This: m.Reference(), + IncludeDefault: includeDefault, + } + + if host != nil { + for _, h := range host { + req.Host = append(req.Host, h.Reference()) + } + } + + res, err := methods.GenerateLogBundles_Task(ctx, m.c, &req) + if err != nil { + return nil, err + } + + return NewTask(m.c, res.Returnval), nil +} + +func (m DiagnosticManager) QueryDescriptions(ctx context.Context, host *HostSystem) ([]types.DiagnosticManagerLogDescriptor, error) { + req := types.QueryDescriptions{ + This: m.Reference(), + } + + if host != nil { + ref := host.Reference() + req.Host = &ref + } + + res, err := methods.QueryDescriptions(ctx, m.Client(), &req) + if err != nil { + return nil, err + } + + return res.Returnval, nil +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/object/distributed_virtual_portgroup.go juju-core-2.0.2/src/github.com/vmware/govmomi/object/distributed_virtual_portgroup.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/object/distributed_virtual_portgroup.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/object/distributed_virtual_portgroup.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,57 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package object + +import ( + "github.com/vmware/govmomi/vim25" + "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/types" + "golang.org/x/net/context" +) + +type DistributedVirtualPortgroup struct { + Common +} + +func NewDistributedVirtualPortgroup(c *vim25.Client, ref types.ManagedObjectReference) *DistributedVirtualPortgroup { + return &DistributedVirtualPortgroup{ + Common: NewCommon(c, ref), + } +} + +// EthernetCardBackingInfo returns the VirtualDeviceBackingInfo for this DistributedVirtualPortgroup +func (p DistributedVirtualPortgroup) EthernetCardBackingInfo(ctx context.Context) (types.BaseVirtualDeviceBackingInfo, error) { + var dvp mo.DistributedVirtualPortgroup + var dvs mo.VmwareDistributedVirtualSwitch // TODO: should be mo.BaseDistributedVirtualSwitch + + if err := p.Properties(ctx, p.Reference(), []string{"key", "config.distributedVirtualSwitch"}, &dvp); err != nil { + return nil, err + } + + if err := p.Properties(ctx, *dvp.Config.DistributedVirtualSwitch, []string{"uuid"}, &dvs); err != nil { + return nil, err + } + + backing := &types.VirtualEthernetCardDistributedVirtualPortBackingInfo{ + Port: types.DistributedVirtualSwitchPortConnection{ + PortgroupKey: dvp.Key, + SwitchUuid: dvs.Uuid, + }, + } + + return backing, nil +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/object/distributed_virtual_portgroup_test.go juju-core-2.0.2/src/github.com/vmware/govmomi/object/distributed_virtual_portgroup_test.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/object/distributed_virtual_portgroup_test.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/object/distributed_virtual_portgroup_test.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,23 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package object + +// DistributedVirtualPortgroup should implement the Reference interface. +var _ Reference = DistributedVirtualPortgroup{} + +// DistributedVirtualPortgroup should implement the NetworkReference interface. +var _ NetworkReference = DistributedVirtualPortgroup{} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/object/distributed_virtual_switch.go juju-core-2.0.2/src/github.com/vmware/govmomi/object/distributed_virtual_switch.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/object/distributed_virtual_switch.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/object/distributed_virtual_switch.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,66 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package object + +import ( + "github.com/vmware/govmomi/vim25" + "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/types" + "golang.org/x/net/context" +) + +type DistributedVirtualSwitch struct { + Common +} + +func NewDistributedVirtualSwitch(c *vim25.Client, ref types.ManagedObjectReference) *DistributedVirtualSwitch { + return &DistributedVirtualSwitch{ + Common: NewCommon(c, ref), + } +} + +func (s DistributedVirtualSwitch) EthernetCardBackingInfo(ctx context.Context) (types.BaseVirtualDeviceBackingInfo, error) { + return nil, ErrNotSupported // TODO: just to satisfy NetworkReference interface for the finder +} + +func (s DistributedVirtualSwitch) Reconfigure(ctx context.Context, spec types.BaseDVSConfigSpec) (*Task, error) { + req := types.ReconfigureDvs_Task{ + This: s.Reference(), + Spec: spec, + } + + res, err := methods.ReconfigureDvs_Task(ctx, s.Client(), &req) + if err != nil { + return nil, err + } + + return NewTask(s.Client(), res.Returnval), nil +} + +func (s DistributedVirtualSwitch) AddPortgroup(ctx context.Context, spec []types.DVPortgroupConfigSpec) (*Task, error) { + req := types.AddDVPortgroup_Task{ + This: s.Reference(), + Spec: spec, + } + + res, err := methods.AddDVPortgroup_Task(ctx, s.Client(), &req) + if err != nil { + return nil, err + } + + return NewTask(s.Client(), res.Returnval), nil +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/object/extension_manager.go juju-core-2.0.2/src/github.com/vmware/govmomi/object/extension_manager.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/object/extension_manager.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/object/extension_manager.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,112 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package object + +import ( + "github.com/vmware/govmomi/vim25" + "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/types" + "golang.org/x/net/context" +) + +type ExtensionManager struct { + Common +} + +// GetExtensionManager wraps NewExtensionManager, returning ErrNotSupported +// when the client is not connected to a vCenter instance. +func GetExtensionManager(c *vim25.Client) (*ExtensionManager, error) { + if c.ServiceContent.ExtensionManager == nil { + return nil, ErrNotSupported + } + return NewExtensionManager(c), nil +} + +func NewExtensionManager(c *vim25.Client) *ExtensionManager { + o := ExtensionManager{ + Common: NewCommon(c, *c.ServiceContent.ExtensionManager), + } + + return &o +} + +func (m ExtensionManager) List(ctx context.Context) ([]types.Extension, error) { + var em mo.ExtensionManager + + err := m.Properties(ctx, m.Reference(), []string{"extensionList"}, &em) + if err != nil { + return nil, err + } + + return em.ExtensionList, nil +} + +func (m ExtensionManager) Find(ctx context.Context, key string) (*types.Extension, error) { + req := types.FindExtension{ + This: m.Reference(), + ExtensionKey: key, + } + + res, err := methods.FindExtension(ctx, m.c, &req) + if err != nil { + return nil, err + } + + return res.Returnval, nil +} + +func (m ExtensionManager) Register(ctx context.Context, extension types.Extension) error { + req := types.RegisterExtension{ + This: m.Reference(), + Extension: extension, + } + + _, err := methods.RegisterExtension(ctx, m.c, &req) + return err +} + +func (m ExtensionManager) SetCertificate(ctx context.Context, key string, certificatePem string) error { + req := types.SetExtensionCertificate{ + This: m.Reference(), + ExtensionKey: key, + CertificatePem: certificatePem, + } + + _, err := methods.SetExtensionCertificate(ctx, m.c, &req) + return err +} + +func (m ExtensionManager) Unregister(ctx context.Context, key string) error { + req := types.UnregisterExtension{ + This: m.Reference(), + ExtensionKey: key, + } + + _, err := methods.UnregisterExtension(ctx, m.c, &req) + return err +} + +func (m ExtensionManager) Update(ctx context.Context, extension types.Extension) error { + req := types.UpdateExtension{ + This: m.Reference(), + Extension: extension, + } + + _, err := methods.UpdateExtension(ctx, m.c, &req) + return err +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/object/file_manager.go juju-core-2.0.2/src/github.com/vmware/govmomi/object/file_manager.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/object/file_manager.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/object/file_manager.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,125 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package object + +import ( + "github.com/vmware/govmomi/vim25" + "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/types" + "golang.org/x/net/context" +) + +type FileManager struct { + Common +} + +func NewFileManager(c *vim25.Client) *FileManager { + f := FileManager{ + Common: NewCommon(c, *c.ServiceContent.FileManager), + } + + return &f +} + +func (f FileManager) CopyDatastoreFile(ctx context.Context, sourceName string, sourceDatacenter *Datacenter, destinationName string, destinationDatacenter *Datacenter, force bool) (*Task, error) { + req := types.CopyDatastoreFile_Task{ + This: f.Reference(), + SourceName: sourceName, + DestinationName: destinationName, + Force: types.NewBool(force), + } + + if sourceDatacenter != nil { + ref := sourceDatacenter.Reference() + req.SourceDatacenter = &ref + } + + if destinationDatacenter != nil { + ref := destinationDatacenter.Reference() + req.DestinationDatacenter = &ref + } + + res, err := methods.CopyDatastoreFile_Task(ctx, f.c, &req) + if err != nil { + return nil, err + } + + return NewTask(f.c, res.Returnval), nil +} + +// DeleteDatastoreFile deletes the specified file or folder from the datastore. +func (f FileManager) DeleteDatastoreFile(ctx context.Context, name string, dc *Datacenter) (*Task, error) { + req := types.DeleteDatastoreFile_Task{ + This: f.Reference(), + Name: name, + } + + if dc != nil { + ref := dc.Reference() + req.Datacenter = &ref + } + + res, err := methods.DeleteDatastoreFile_Task(ctx, f.c, &req) + if err != nil { + return nil, err + } + + return NewTask(f.c, res.Returnval), nil +} + +// MakeDirectory creates a folder using the specified name. +func (f FileManager) MakeDirectory(ctx context.Context, name string, dc *Datacenter, createParentDirectories bool) error { + req := types.MakeDirectory{ + This: f.Reference(), + Name: name, + CreateParentDirectories: types.NewBool(createParentDirectories), + } + + if dc != nil { + ref := dc.Reference() + req.Datacenter = &ref + } + + _, err := methods.MakeDirectory(ctx, f.c, &req) + return err +} + +func (f FileManager) MoveDatastoreFile(ctx context.Context, sourceName string, sourceDatacenter *Datacenter, destinationName string, destinationDatacenter *Datacenter, force bool) (*Task, error) { + req := types.MoveDatastoreFile_Task{ + This: f.Reference(), + SourceName: sourceName, + DestinationName: destinationName, + Force: types.NewBool(force), + } + + if sourceDatacenter != nil { + ref := sourceDatacenter.Reference() + req.SourceDatacenter = &ref + } + + if destinationDatacenter != nil { + ref := destinationDatacenter.Reference() + req.DestinationDatacenter = &ref + } + + res, err := methods.MoveDatastoreFile_Task(ctx, f.c, &req) + if err != nil { + return nil, err + } + + return NewTask(f.c, res.Returnval), nil +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/object/folder.go juju-core-2.0.2/src/github.com/vmware/govmomi/object/folder.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/object/folder.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/object/folder.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,226 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package object + +import ( + "github.com/vmware/govmomi/vim25" + "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/types" + "golang.org/x/net/context" +) + +type Folder struct { + Common +} + +func NewFolder(c *vim25.Client, ref types.ManagedObjectReference) *Folder { + return &Folder{ + Common: NewCommon(c, ref), + } +} + +func NewRootFolder(c *vim25.Client) *Folder { + f := NewFolder(c, c.ServiceContent.RootFolder) + f.InventoryPath = "/" + return f +} + +func (f Folder) Children(ctx context.Context) ([]Reference, error) { + var mf mo.Folder + + err := f.Properties(ctx, f.Reference(), []string{"childEntity"}, &mf) + if err != nil { + return nil, err + } + + var rs []Reference + for _, e := range mf.ChildEntity { + if r := NewReference(f.c, e); r != nil { + rs = append(rs, r) + } + } + + return rs, nil +} + +func (f Folder) CreateDatacenter(ctx context.Context, datacenter string) (*Datacenter, error) { + req := types.CreateDatacenter{ + This: f.Reference(), + Name: datacenter, + } + + res, err := methods.CreateDatacenter(ctx, f.c, &req) + if err != nil { + return nil, err + } + + // Response will be nil if this is an ESX host that does not belong to a vCenter + if res == nil { + return nil, nil + } + + return NewDatacenter(f.c, res.Returnval), nil +} + +func (f Folder) CreateCluster(ctx context.Context, cluster string, spec types.ClusterConfigSpecEx) (*ClusterComputeResource, error) { + req := types.CreateClusterEx{ + This: f.Reference(), + Name: cluster, + Spec: spec, + } + + res, err := methods.CreateClusterEx(ctx, f.c, &req) + if err != nil { + return nil, err + } + + // Response will be nil if this is an ESX host that does not belong to a vCenter + if res == nil { + return nil, nil + } + + return NewClusterComputeResource(f.c, res.Returnval), nil +} + +func (f Folder) CreateFolder(ctx context.Context, name string) (*Folder, error) { + req := types.CreateFolder{ + This: f.Reference(), + Name: name, + } + + res, err := methods.CreateFolder(ctx, f.c, &req) + if err != nil { + return nil, err + } + + return NewFolder(f.c, res.Returnval), err +} + +func (f Folder) CreateStoragePod(ctx context.Context, name string) (*StoragePod, error) { + req := types.CreateStoragePod{ + This: f.Reference(), + Name: name, + } + + res, err := methods.CreateStoragePod(ctx, f.c, &req) + if err != nil { + return nil, err + } + + return NewStoragePod(f.c, res.Returnval), err +} + +func (f Folder) AddStandaloneHost(ctx context.Context, spec types.HostConnectSpec, addConnected bool, license *string, compResSpec *types.BaseComputeResourceConfigSpec) (*Task, error) { + req := types.AddStandaloneHost_Task{ + This: f.Reference(), + Spec: spec, + AddConnected: addConnected, + } + + if license != nil { + req.License = *license + } + + if compResSpec != nil { + req.CompResSpec = *compResSpec + } + + res, err := methods.AddStandaloneHost_Task(ctx, f.c, &req) + if err != nil { + return nil, err + } + + return NewTask(f.c, res.Returnval), nil +} + +func (f Folder) CreateVM(ctx context.Context, config types.VirtualMachineConfigSpec, pool *ResourcePool, host *HostSystem) (*Task, error) { + req := types.CreateVM_Task{ + This: f.Reference(), + Config: config, + Pool: pool.Reference(), + } + + if host != nil { + ref := host.Reference() + req.Host = &ref + } + + res, err := methods.CreateVM_Task(ctx, f.c, &req) + if err != nil { + return nil, err + } + + return NewTask(f.c, res.Returnval), nil +} + +func (f Folder) RegisterVM(ctx context.Context, path string, name string, asTemplate bool, pool *ResourcePool, host *HostSystem) (*Task, error) { + req := types.RegisterVM_Task{ + This: f.Reference(), + Path: path, + AsTemplate: asTemplate, + } + + if name != "" { + req.Name = name + } + + if host != nil { + ref := host.Reference() + req.Host = &ref + } + + if pool != nil { + ref := pool.Reference() + req.Pool = &ref + } + + res, err := methods.RegisterVM_Task(ctx, f.c, &req) + if err != nil { + return nil, err + } + + return NewTask(f.c, res.Returnval), nil +} + +func (f Folder) CreateDVS(ctx context.Context, spec types.DVSCreateSpec) (*Task, error) { + req := types.CreateDVS_Task{ + This: f.Reference(), + Spec: spec, + } + + res, err := methods.CreateDVS_Task(ctx, f.c, &req) + if err != nil { + return nil, err + } + + return NewTask(f.c, res.Returnval), nil +} + +func (f Folder) MoveInto(ctx context.Context, list []types.ManagedObjectReference) (*Task, error) { + req := types.MoveIntoFolder_Task{ + This: f.Reference(), + List: list, + } + + res, err := methods.MoveIntoFolder_Task(ctx, f.c, &req) + if err != nil { + return nil, err + } + + return NewTask(f.c, res.Returnval), nil +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/object/folder_test.go juju-core-2.0.2/src/github.com/vmware/govmomi/object/folder_test.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/object/folder_test.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/object/folder_test.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,20 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package object + +// Folder should implement the Reference interface. +var _ Reference = Folder{} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/object/history_collector.go juju-core-2.0.2/src/github.com/vmware/govmomi/object/history_collector.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/object/history_collector.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/object/history_collector.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,71 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package object + +import ( + "github.com/vmware/govmomi/vim25" + "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/types" + "golang.org/x/net/context" +) + +type HistoryCollector struct { + Common +} + +func NewHistoryCollector(c *vim25.Client, ref types.ManagedObjectReference) *HistoryCollector { + return &HistoryCollector{ + Common: NewCommon(c, ref), + } +} + +func (h HistoryCollector) Destroy(ctx context.Context) error { + req := types.DestroyCollector{ + This: h.Reference(), + } + + _, err := methods.DestroyCollector(ctx, h.c, &req) + return err +} + +func (h HistoryCollector) Reset(ctx context.Context) error { + req := types.ResetCollector{ + This: h.Reference(), + } + + _, err := methods.ResetCollector(ctx, h.c, &req) + return err +} + +func (h HistoryCollector) Rewind(ctx context.Context) error { + req := types.RewindCollector{ + This: h.Reference(), + } + + _, err := methods.RewindCollector(ctx, h.c, &req) + return err +} + +func (h HistoryCollector) SetPageSize(ctx context.Context, maxCount int32) error { + req := types.SetCollectorPageSize{ + This: h.Reference(), + MaxCount: maxCount, + } + + _, err := methods.SetCollectorPageSize(ctx, h.c, &req) + return err +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/object/host_account_manager.go juju-core-2.0.2/src/github.com/vmware/govmomi/object/host_account_manager.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/object/host_account_manager.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/object/host_account_manager.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,64 @@ +/* +Copyright (c) 2016 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package object + +import ( + "github.com/vmware/govmomi/vim25" + "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/types" + "golang.org/x/net/context" +) + +type HostAccountManager struct { + Common +} + +func NewHostAccountManager(c *vim25.Client, ref types.ManagedObjectReference) *HostAccountManager { + return &HostAccountManager{ + Common: NewCommon(c, ref), + } +} + +func (m HostAccountManager) Create(ctx context.Context, user *types.HostAccountSpec) error { + req := types.CreateUser{ + This: m.Reference(), + User: user, + } + + _, err := methods.CreateUser(ctx, m.Client(), &req) + return err +} + +func (m HostAccountManager) Update(ctx context.Context, user *types.HostAccountSpec) error { + req := types.UpdateUser{ + This: m.Reference(), + User: user, + } + + _, err := methods.UpdateUser(ctx, m.Client(), &req) + return err +} + +func (m HostAccountManager) Remove(ctx context.Context, userName string) error { + req := types.RemoveUser{ + This: m.Reference(), + UserName: userName, + } + + _, err := methods.RemoveUser(ctx, m.Client(), &req) + return err +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/object/host_config_manager.go juju-core-2.0.2/src/github.com/vmware/govmomi/object/host_config_manager.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/object/host_config_manager.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/object/host_config_manager.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,133 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package object + +import ( + "github.com/vmware/govmomi/vim25" + "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/types" + "golang.org/x/net/context" +) + +type HostConfigManager struct { + Common +} + +func NewHostConfigManager(c *vim25.Client, ref types.ManagedObjectReference) *HostConfigManager { + return &HostConfigManager{ + Common: NewCommon(c, ref), + } +} + +func (m HostConfigManager) DatastoreSystem(ctx context.Context) (*HostDatastoreSystem, error) { + var h mo.HostSystem + + err := m.Properties(ctx, m.Reference(), []string{"configManager.datastoreSystem"}, &h) + if err != nil { + return nil, err + } + + return NewHostDatastoreSystem(m.c, *h.ConfigManager.DatastoreSystem), nil +} + +func (m HostConfigManager) NetworkSystem(ctx context.Context) (*HostNetworkSystem, error) { + var h mo.HostSystem + + err := m.Properties(ctx, m.Reference(), []string{"configManager.networkSystem"}, &h) + if err != nil { + return nil, err + } + + return NewHostNetworkSystem(m.c, *h.ConfigManager.NetworkSystem), nil +} + +func (m HostConfigManager) FirewallSystem(ctx context.Context) (*HostFirewallSystem, error) { + var h mo.HostSystem + + err := m.Properties(ctx, m.Reference(), []string{"configManager.firewallSystem"}, &h) + if err != nil { + return nil, err + } + + return NewHostFirewallSystem(m.c, *h.ConfigManager.FirewallSystem), nil +} + +func (m HostConfigManager) StorageSystem(ctx context.Context) (*HostStorageSystem, error) { + var h mo.HostSystem + + err := m.Properties(ctx, m.Reference(), []string{"configManager.storageSystem"}, &h) + if err != nil { + return nil, err + } + + return NewHostStorageSystem(m.c, *h.ConfigManager.StorageSystem), nil +} + +func (m HostConfigManager) VirtualNicManager(ctx context.Context) (*HostVirtualNicManager, error) { + var h mo.HostSystem + + err := m.Properties(ctx, m.Reference(), []string{"configManager.virtualNicManager"}, &h) + if err != nil { + return nil, err + } + + return NewHostVirtualNicManager(m.c, *h.ConfigManager.VirtualNicManager, m.Reference()), nil +} + +func (m HostConfigManager) VsanSystem(ctx context.Context) (*HostVsanSystem, error) { + var h mo.HostSystem + + err := m.Properties(ctx, m.Reference(), []string{"configManager.vsanSystem"}, &h) + if err != nil { + return nil, err + } + + return NewHostVsanSystem(m.c, *h.ConfigManager.VsanSystem), nil +} + +func (m HostConfigManager) AccountManager(ctx context.Context) (*HostAccountManager, error) { + var h mo.HostSystem + + err := m.Properties(ctx, m.Reference(), []string{"configManager.accountManager"}, &h) + if err != nil { + return nil, err + } + + return NewHostAccountManager(m.c, *h.ConfigManager.AccountManager), nil +} + +func (m HostConfigManager) OptionManager(ctx context.Context) (*OptionManager, error) { + var h mo.HostSystem + + err := m.Properties(ctx, m.Reference(), []string{"configManager.advancedOption"}, &h) + if err != nil { + return nil, err + } + + return NewOptionManager(m.c, *h.ConfigManager.AdvancedOption), nil +} + +func (m HostConfigManager) ServiceSystem(ctx context.Context) (*HostServiceSystem, error) { + var h mo.HostSystem + + err := m.Properties(ctx, m.Reference(), []string{"configManager.serviceSystem"}, &h) + if err != nil { + return nil, err + } + + return NewHostServiceSystem(m.c, *h.ConfigManager.ServiceSystem), nil +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/object/host_datastore_browser.go juju-core-2.0.2/src/github.com/vmware/govmomi/object/host_datastore_browser.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/object/host_datastore_browser.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/object/host_datastore_browser.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,64 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package object + +import ( + "github.com/vmware/govmomi/vim25" + "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/types" + "golang.org/x/net/context" +) + +type HostDatastoreBrowser struct { + Common +} + +func NewHostDatastoreBrowser(c *vim25.Client, ref types.ManagedObjectReference) *HostDatastoreBrowser { + return &HostDatastoreBrowser{ + Common: NewCommon(c, ref), + } +} + +func (b HostDatastoreBrowser) SearchDatastore(ctx context.Context, datastorePath string, searchSpec *types.HostDatastoreBrowserSearchSpec) (*Task, error) { + req := types.SearchDatastore_Task{ + This: b.Reference(), + DatastorePath: datastorePath, + SearchSpec: searchSpec, + } + + res, err := methods.SearchDatastore_Task(ctx, b.c, &req) + if err != nil { + return nil, err + } + + return NewTask(b.c, res.Returnval), nil +} + +func (b HostDatastoreBrowser) SearchDatastoreSubFolders(ctx context.Context, datastorePath string, searchSpec *types.HostDatastoreBrowserSearchSpec) (*Task, error) { + req := types.SearchDatastoreSubFolders_Task{ + This: b.Reference(), + DatastorePath: datastorePath, + SearchSpec: searchSpec, + } + + res, err := methods.SearchDatastoreSubFolders_Task(ctx, b.c, &req) + if err != nil { + return nil, err + } + + return NewTask(b.c, res.Returnval), nil +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/object/host_datastore_system.go juju-core-2.0.2/src/github.com/vmware/govmomi/object/host_datastore_system.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/object/host_datastore_system.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/object/host_datastore_system.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,118 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package object + +import ( + "github.com/vmware/govmomi/vim25" + "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/types" + "golang.org/x/net/context" +) + +type HostDatastoreSystem struct { + Common +} + +func NewHostDatastoreSystem(c *vim25.Client, ref types.ManagedObjectReference) *HostDatastoreSystem { + return &HostDatastoreSystem{ + Common: NewCommon(c, ref), + } +} + +func (s HostDatastoreSystem) CreateLocalDatastore(ctx context.Context, name string, path string) (*Datastore, error) { + req := types.CreateLocalDatastore{ + This: s.Reference(), + Name: name, + Path: path, + } + + res, err := methods.CreateLocalDatastore(ctx, s.Client(), &req) + if err != nil { + return nil, err + } + + return NewDatastore(s.Client(), res.Returnval), nil +} + +func (s HostDatastoreSystem) CreateNasDatastore(ctx context.Context, spec types.HostNasVolumeSpec) (*Datastore, error) { + req := types.CreateNasDatastore{ + This: s.Reference(), + Spec: spec, + } + + res, err := methods.CreateNasDatastore(ctx, s.Client(), &req) + if err != nil { + return nil, err + } + + return NewDatastore(s.Client(), res.Returnval), nil +} + +func (s HostDatastoreSystem) CreateVmfsDatastore(ctx context.Context, spec types.VmfsDatastoreCreateSpec) (*Datastore, error) { + req := types.CreateVmfsDatastore{ + This: s.Reference(), + Spec: spec, + } + + res, err := methods.CreateVmfsDatastore(ctx, s.Client(), &req) + if err != nil { + return nil, err + } + + return NewDatastore(s.Client(), res.Returnval), nil +} + +func (s HostDatastoreSystem) Remove(ctx context.Context, ds *Datastore) error { + req := types.RemoveDatastore{ + This: s.Reference(), + Datastore: ds.Reference(), + } + + _, err := methods.RemoveDatastore(ctx, s.Client(), &req) + if err != nil { + return err + } + + return nil +} + +func (s HostDatastoreSystem) QueryAvailableDisksForVmfs(ctx context.Context) ([]types.HostScsiDisk, error) { + req := types.QueryAvailableDisksForVmfs{ + This: s.Reference(), + } + + res, err := methods.QueryAvailableDisksForVmfs(ctx, s.Client(), &req) + if err != nil { + return nil, err + } + + return res.Returnval, nil +} + +func (s HostDatastoreSystem) QueryVmfsDatastoreCreateOptions(ctx context.Context, devicePath string) ([]types.VmfsDatastoreOption, error) { + req := types.QueryVmfsDatastoreCreateOptions{ + This: s.Reference(), + DevicePath: devicePath, + } + + res, err := methods.QueryVmfsDatastoreCreateOptions(ctx, s.Client(), &req) + if err != nil { + return nil, err + } + + return res.Returnval, nil +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/object/host_firewall_system.go juju-core-2.0.2/src/github.com/vmware/govmomi/object/host_firewall_system.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/object/host_firewall_system.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/object/host_firewall_system.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,181 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package object + +import ( + "errors" + "fmt" + "strings" + + "github.com/vmware/govmomi/vim25" + "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/types" + "golang.org/x/net/context" +) + +type HostFirewallSystem struct { + Common +} + +func NewHostFirewallSystem(c *vim25.Client, ref types.ManagedObjectReference) *HostFirewallSystem { + return &HostFirewallSystem{ + Common: NewCommon(c, ref), + } +} + +func (s HostFirewallSystem) DisableRuleset(ctx context.Context, id string) error { + req := types.DisableRuleset{ + This: s.Reference(), + Id: id, + } + + _, err := methods.DisableRuleset(ctx, s.c, &req) + return err +} + +func (s HostFirewallSystem) EnableRuleset(ctx context.Context, id string) error { + req := types.EnableRuleset{ + This: s.Reference(), + Id: id, + } + + _, err := methods.EnableRuleset(ctx, s.c, &req) + return err +} + +func (s HostFirewallSystem) Refresh(ctx context.Context) error { + req := types.RefreshFirewall{ + This: s.Reference(), + } + + _, err := methods.RefreshFirewall(ctx, s.c, &req) + return err +} + +func (s HostFirewallSystem) Info(ctx context.Context) (*types.HostFirewallInfo, error) { + var fs mo.HostFirewallSystem + + err := s.Properties(ctx, s.Reference(), []string{"firewallInfo"}, &fs) + if err != nil { + return nil, err + } + + return fs.FirewallInfo, nil +} + +// HostFirewallRulesetList provides helpers for a slice of types.HostFirewallRuleset +type HostFirewallRulesetList []types.HostFirewallRuleset + +// ByRule returns a HostFirewallRulesetList where Direction, PortType and Protocol are equal and Port is within range +func (l HostFirewallRulesetList) ByRule(rule types.HostFirewallRule) HostFirewallRulesetList { + var matches HostFirewallRulesetList + + for _, rs := range l { + for _, r := range rs.Rule { + if r.PortType != rule.PortType || + r.Protocol != rule.Protocol || + r.Direction != rule.Direction { + continue + } + + if r.EndPort == 0 && rule.Port == r.Port || + rule.Port >= r.Port && rule.Port <= r.EndPort { + matches = append(matches, rs) + break + } + } + } + + return matches +} + +// EnabledByRule returns a HostFirewallRulesetList with Match(rule) applied and filtered via Enabled() +// if enabled param is true, otherwise filtered via Disabled(). +// An error is returned if the resulting list is empty. +func (l HostFirewallRulesetList) EnabledByRule(rule types.HostFirewallRule, enabled bool) (HostFirewallRulesetList, error) { + var matched, skipped HostFirewallRulesetList + var matchedKind, skippedKind string + + l = l.ByRule(rule) + + if enabled { + matched = l.Enabled() + matchedKind = "enabled" + + skipped = l.Disabled() + skippedKind = "disabled" + } else { + matched = l.Disabled() + matchedKind = "disabled" + + skipped = l.Enabled() + skippedKind = "enabled" + } + + if len(matched) == 0 { + msg := fmt.Sprintf("%d %s firewall rulesets match %s %s %s %d, %d %s rulesets match", + len(matched), matchedKind, + rule.Direction, rule.Protocol, rule.PortType, rule.Port, + len(skipped), skippedKind) + + if len(skipped) != 0 { + msg += fmt.Sprintf(": %s", strings.Join(skipped.Keys(), ", ")) + } + + return nil, errors.New(msg) + } + + return matched, nil +} + +// Enabled returns a HostFirewallRulesetList with enabled rules +func (l HostFirewallRulesetList) Enabled() HostFirewallRulesetList { + var matches HostFirewallRulesetList + + for _, rs := range l { + if rs.Enabled { + matches = append(matches, rs) + } + } + + return matches +} + +// Disabled returns a HostFirewallRulesetList with disabled rules +func (l HostFirewallRulesetList) Disabled() HostFirewallRulesetList { + var matches HostFirewallRulesetList + + for _, rs := range l { + if !rs.Enabled { + matches = append(matches, rs) + } + } + + return matches +} + +// Keys returns the HostFirewallRuleset.Key for each ruleset in the list +func (l HostFirewallRulesetList) Keys() []string { + var keys []string + + for _, rs := range l { + keys = append(keys, rs.Key) + } + + return keys +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/object/host_network_system.go juju-core-2.0.2/src/github.com/vmware/govmomi/object/host_network_system.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/object/host_network_system.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/object/host_network_system.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,357 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package object + +import ( + "github.com/vmware/govmomi/vim25" + "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/types" + "golang.org/x/net/context" +) + +type HostNetworkSystem struct { + Common +} + +func NewHostNetworkSystem(c *vim25.Client, ref types.ManagedObjectReference) *HostNetworkSystem { + return &HostNetworkSystem{ + Common: NewCommon(c, ref), + } +} + +// AddPortGroup wraps methods.AddPortGroup +func (o HostNetworkSystem) AddPortGroup(ctx context.Context, portgrp types.HostPortGroupSpec) error { + req := types.AddPortGroup{ + This: o.Reference(), + Portgrp: portgrp, + } + + _, err := methods.AddPortGroup(ctx, o.c, &req) + if err != nil { + return err + } + + return nil +} + +// AddServiceConsoleVirtualNic wraps methods.AddServiceConsoleVirtualNic +func (o HostNetworkSystem) AddServiceConsoleVirtualNic(ctx context.Context, portgroup string, nic types.HostVirtualNicSpec) (string, error) { + req := types.AddServiceConsoleVirtualNic{ + This: o.Reference(), + Portgroup: portgroup, + Nic: nic, + } + + res, err := methods.AddServiceConsoleVirtualNic(ctx, o.c, &req) + if err != nil { + return "", err + } + + return res.Returnval, nil +} + +// AddVirtualNic wraps methods.AddVirtualNic +func (o HostNetworkSystem) AddVirtualNic(ctx context.Context, portgroup string, nic types.HostVirtualNicSpec) (string, error) { + req := types.AddVirtualNic{ + This: o.Reference(), + Portgroup: portgroup, + Nic: nic, + } + + res, err := methods.AddVirtualNic(ctx, o.c, &req) + if err != nil { + return "", err + } + + return res.Returnval, nil +} + +// AddVirtualSwitch wraps methods.AddVirtualSwitch +func (o HostNetworkSystem) AddVirtualSwitch(ctx context.Context, vswitchName string, spec *types.HostVirtualSwitchSpec) error { + req := types.AddVirtualSwitch{ + This: o.Reference(), + VswitchName: vswitchName, + Spec: spec, + } + + _, err := methods.AddVirtualSwitch(ctx, o.c, &req) + if err != nil { + return err + } + + return nil +} + +// QueryNetworkHint wraps methods.QueryNetworkHint +func (o HostNetworkSystem) QueryNetworkHint(ctx context.Context, device []string) error { + req := types.QueryNetworkHint{ + This: o.Reference(), + Device: device, + } + + _, err := methods.QueryNetworkHint(ctx, o.c, &req) + if err != nil { + return err + } + + return nil +} + +// RefreshNetworkSystem wraps methods.RefreshNetworkSystem +func (o HostNetworkSystem) RefreshNetworkSystem(ctx context.Context) error { + req := types.RefreshNetworkSystem{ + This: o.Reference(), + } + + _, err := methods.RefreshNetworkSystem(ctx, o.c, &req) + if err != nil { + return err + } + + return nil +} + +// RemovePortGroup wraps methods.RemovePortGroup +func (o HostNetworkSystem) RemovePortGroup(ctx context.Context, pgName string) error { + req := types.RemovePortGroup{ + This: o.Reference(), + PgName: pgName, + } + + _, err := methods.RemovePortGroup(ctx, o.c, &req) + if err != nil { + return err + } + + return nil +} + +// RemoveServiceConsoleVirtualNic wraps methods.RemoveServiceConsoleVirtualNic +func (o HostNetworkSystem) RemoveServiceConsoleVirtualNic(ctx context.Context, device string) error { + req := types.RemoveServiceConsoleVirtualNic{ + This: o.Reference(), + Device: device, + } + + _, err := methods.RemoveServiceConsoleVirtualNic(ctx, o.c, &req) + if err != nil { + return err + } + + return nil +} + +// RemoveVirtualNic wraps methods.RemoveVirtualNic +func (o HostNetworkSystem) RemoveVirtualNic(ctx context.Context, device string) error { + req := types.RemoveVirtualNic{ + This: o.Reference(), + Device: device, + } + + _, err := methods.RemoveVirtualNic(ctx, o.c, &req) + if err != nil { + return err + } + + return nil +} + +// RemoveVirtualSwitch wraps methods.RemoveVirtualSwitch +func (o HostNetworkSystem) RemoveVirtualSwitch(ctx context.Context, vswitchName string) error { + req := types.RemoveVirtualSwitch{ + This: o.Reference(), + VswitchName: vswitchName, + } + + _, err := methods.RemoveVirtualSwitch(ctx, o.c, &req) + if err != nil { + return err + } + + return nil +} + +// RestartServiceConsoleVirtualNic wraps methods.RestartServiceConsoleVirtualNic +func (o HostNetworkSystem) RestartServiceConsoleVirtualNic(ctx context.Context, device string) error { + req := types.RestartServiceConsoleVirtualNic{ + This: o.Reference(), + Device: device, + } + + _, err := methods.RestartServiceConsoleVirtualNic(ctx, o.c, &req) + if err != nil { + return err + } + + return nil +} + +// UpdateConsoleIpRouteConfig wraps methods.UpdateConsoleIpRouteConfig +func (o HostNetworkSystem) UpdateConsoleIpRouteConfig(ctx context.Context, config types.BaseHostIpRouteConfig) error { + req := types.UpdateConsoleIpRouteConfig{ + This: o.Reference(), + Config: config, + } + + _, err := methods.UpdateConsoleIpRouteConfig(ctx, o.c, &req) + if err != nil { + return err + } + + return nil +} + +// UpdateDnsConfig wraps methods.UpdateDnsConfig +func (o HostNetworkSystem) UpdateDnsConfig(ctx context.Context, config types.BaseHostDnsConfig) error { + req := types.UpdateDnsConfig{ + This: o.Reference(), + Config: config, + } + + _, err := methods.UpdateDnsConfig(ctx, o.c, &req) + if err != nil { + return err + } + + return nil +} + +// UpdateIpRouteConfig wraps methods.UpdateIpRouteConfig +func (o HostNetworkSystem) UpdateIpRouteConfig(ctx context.Context, config types.BaseHostIpRouteConfig) error { + req := types.UpdateIpRouteConfig{ + This: o.Reference(), + Config: config, + } + + _, err := methods.UpdateIpRouteConfig(ctx, o.c, &req) + if err != nil { + return err + } + + return nil +} + +// UpdateIpRouteTableConfig wraps methods.UpdateIpRouteTableConfig +func (o HostNetworkSystem) UpdateIpRouteTableConfig(ctx context.Context, config types.HostIpRouteTableConfig) error { + req := types.UpdateIpRouteTableConfig{ + This: o.Reference(), + Config: config, + } + + _, err := methods.UpdateIpRouteTableConfig(ctx, o.c, &req) + if err != nil { + return err + } + + return nil +} + +// UpdateNetworkConfig wraps methods.UpdateNetworkConfig +func (o HostNetworkSystem) UpdateNetworkConfig(ctx context.Context, config types.HostNetworkConfig, changeMode string) (*types.HostNetworkConfigResult, error) { + req := types.UpdateNetworkConfig{ + This: o.Reference(), + Config: config, + ChangeMode: changeMode, + } + + res, err := methods.UpdateNetworkConfig(ctx, o.c, &req) + if err != nil { + return nil, err + } + + return &res.Returnval, nil +} + +// UpdatePhysicalNicLinkSpeed wraps methods.UpdatePhysicalNicLinkSpeed +func (o HostNetworkSystem) UpdatePhysicalNicLinkSpeed(ctx context.Context, device string, linkSpeed *types.PhysicalNicLinkInfo) error { + req := types.UpdatePhysicalNicLinkSpeed{ + This: o.Reference(), + Device: device, + LinkSpeed: linkSpeed, + } + + _, err := methods.UpdatePhysicalNicLinkSpeed(ctx, o.c, &req) + if err != nil { + return err + } + + return nil +} + +// UpdatePortGroup wraps methods.UpdatePortGroup +func (o HostNetworkSystem) UpdatePortGroup(ctx context.Context, pgName string, portgrp types.HostPortGroupSpec) error { + req := types.UpdatePortGroup{ + This: o.Reference(), + PgName: pgName, + Portgrp: portgrp, + } + + _, err := methods.UpdatePortGroup(ctx, o.c, &req) + if err != nil { + return err + } + + return nil +} + +// UpdateServiceConsoleVirtualNic wraps methods.UpdateServiceConsoleVirtualNic +func (o HostNetworkSystem) UpdateServiceConsoleVirtualNic(ctx context.Context, device string, nic types.HostVirtualNicSpec) error { + req := types.UpdateServiceConsoleVirtualNic{ + This: o.Reference(), + Device: device, + Nic: nic, + } + + _, err := methods.UpdateServiceConsoleVirtualNic(ctx, o.c, &req) + if err != nil { + return err + } + + return nil +} + +// UpdateVirtualNic wraps methods.UpdateVirtualNic +func (o HostNetworkSystem) UpdateVirtualNic(ctx context.Context, device string, nic types.HostVirtualNicSpec) error { + req := types.UpdateVirtualNic{ + This: o.Reference(), + Device: device, + Nic: nic, + } + + _, err := methods.UpdateVirtualNic(ctx, o.c, &req) + if err != nil { + return err + } + + return nil +} + +// UpdateVirtualSwitch wraps methods.UpdateVirtualSwitch +func (o HostNetworkSystem) UpdateVirtualSwitch(ctx context.Context, vswitchName string, spec types.HostVirtualSwitchSpec) error { + req := types.UpdateVirtualSwitch{ + This: o.Reference(), + VswitchName: vswitchName, + Spec: spec, + } + + _, err := methods.UpdateVirtualSwitch(ctx, o.c, &req) + if err != nil { + return err + } + + return nil +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/object/host_service_system.go juju-core-2.0.2/src/github.com/vmware/govmomi/object/host_service_system.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/object/host_service_system.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/object/host_service_system.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,87 @@ +/* +Copyright (c) 2016 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package object + +import ( + "github.com/vmware/govmomi/vim25" + "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/types" + "golang.org/x/net/context" +) + +type HostServiceSystem struct { + Common +} + +func NewHostServiceSystem(c *vim25.Client, ref types.ManagedObjectReference) *HostServiceSystem { + return &HostServiceSystem{ + Common: NewCommon(c, ref), + } +} + +func (s HostServiceSystem) Service(ctx context.Context) ([]types.HostService, error) { + var ss mo.HostServiceSystem + + err := s.Properties(ctx, s.Reference(), []string{"serviceInfo.service"}, &ss) + if err != nil { + return nil, err + } + + return ss.ServiceInfo.Service, nil +} + +func (s HostServiceSystem) Start(ctx context.Context, id string) error { + req := types.StartService{ + This: s.Reference(), + Id: id, + } + + _, err := methods.StartService(ctx, s.Client(), &req) + return err +} + +func (s HostServiceSystem) Stop(ctx context.Context, id string) error { + req := types.StopService{ + This: s.Reference(), + Id: id, + } + + _, err := methods.StopService(ctx, s.Client(), &req) + return err +} + +func (s HostServiceSystem) Restart(ctx context.Context, id string) error { + req := types.RestartService{ + This: s.Reference(), + Id: id, + } + + _, err := methods.RestartService(ctx, s.Client(), &req) + return err +} + +func (s HostServiceSystem) UpdatePolicy(ctx context.Context, id string, policy string) error { + req := types.UpdateServicePolicy{ + This: s.Reference(), + Id: id, + Policy: policy, + } + + _, err := methods.UpdateServicePolicy(ctx, s.Client(), &req) + return err +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/object/host_storage_system.go juju-core-2.0.2/src/github.com/vmware/govmomi/object/host_storage_system.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/object/host_storage_system.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/object/host_storage_system.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,145 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package object + +import ( + "errors" + + "github.com/vmware/govmomi/vim25" + "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/types" + "golang.org/x/net/context" +) + +type HostStorageSystem struct { + Common +} + +func NewHostStorageSystem(c *vim25.Client, ref types.ManagedObjectReference) *HostStorageSystem { + return &HostStorageSystem{ + Common: NewCommon(c, ref), + } +} + +func (s HostStorageSystem) RetrieveDiskPartitionInfo(ctx context.Context, devicePath string) (*types.HostDiskPartitionInfo, error) { + req := types.RetrieveDiskPartitionInfo{ + This: s.Reference(), + DevicePath: []string{devicePath}, + } + + res, err := methods.RetrieveDiskPartitionInfo(ctx, s.c, &req) + if err != nil { + return nil, err + } + + if res.Returnval == nil || len(res.Returnval) == 0 { + return nil, errors.New("no partition info") + } + + return &res.Returnval[0], nil +} + +func (s HostStorageSystem) ComputeDiskPartitionInfo(ctx context.Context, devicePath string, layout types.HostDiskPartitionLayout) (*types.HostDiskPartitionInfo, error) { + req := types.ComputeDiskPartitionInfo{ + This: s.Reference(), + DevicePath: devicePath, + Layout: layout, + } + + res, err := methods.ComputeDiskPartitionInfo(ctx, s.c, &req) + if err != nil { + return nil, err + } + + return &res.Returnval, nil +} + +func (s HostStorageSystem) UpdateDiskPartitionInfo(ctx context.Context, devicePath string, spec types.HostDiskPartitionSpec) error { + req := types.UpdateDiskPartitions{ + This: s.Reference(), + DevicePath: devicePath, + Spec: spec, + } + + _, err := methods.UpdateDiskPartitions(ctx, s.c, &req) + return err +} + +func (s HostStorageSystem) RescanAllHba(ctx context.Context) error { + req := types.RescanAllHba{ + This: s.Reference(), + } + + _, err := methods.RescanAllHba(ctx, s.c, &req) + return err +} + +func (s HostStorageSystem) MarkAsSsd(ctx context.Context, uuid string) (*Task, error) { + req := types.MarkAsSsd_Task{ + This: s.Reference(), + ScsiDiskUuid: uuid, + } + + res, err := methods.MarkAsSsd_Task(ctx, s.c, &req) + if err != nil { + return nil, err + } + + return NewTask(s.c, res.Returnval), nil +} + +func (s HostStorageSystem) MarkAsNonSsd(ctx context.Context, uuid string) (*Task, error) { + req := types.MarkAsNonSsd_Task{ + This: s.Reference(), + ScsiDiskUuid: uuid, + } + + res, err := methods.MarkAsNonSsd_Task(ctx, s.c, &req) + if err != nil { + return nil, err + } + + return NewTask(s.c, res.Returnval), nil +} + +func (s HostStorageSystem) MarkAsLocal(ctx context.Context, uuid string) (*Task, error) { + req := types.MarkAsLocal_Task{ + This: s.Reference(), + ScsiDiskUuid: uuid, + } + + res, err := methods.MarkAsLocal_Task(ctx, s.c, &req) + if err != nil { + return nil, err + } + + return NewTask(s.c, res.Returnval), nil +} + +func (s HostStorageSystem) MarkAsNonLocal(ctx context.Context, uuid string) (*Task, error) { + req := types.MarkAsNonLocal_Task{ + This: s.Reference(), + ScsiDiskUuid: uuid, + } + + res, err := methods.MarkAsNonLocal_Task(ctx, s.c, &req) + if err != nil { + return nil, err + } + + return NewTask(s.c, res.Returnval), nil +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/object/host_system.go juju-core-2.0.2/src/github.com/vmware/govmomi/object/host_system.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/object/host_system.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/object/host_system.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,153 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package object + +import ( + "fmt" + "net" + + "github.com/vmware/govmomi/vim25" + "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/types" + "golang.org/x/net/context" +) + +type HostSystem struct { + Common +} + +func NewHostSystem(c *vim25.Client, ref types.ManagedObjectReference) *HostSystem { + return &HostSystem{ + Common: NewCommon(c, ref), + } +} + +func (h HostSystem) ConfigManager() *HostConfigManager { + return NewHostConfigManager(h.c, h.Reference()) +} + +func (h HostSystem) ResourcePool(ctx context.Context) (*ResourcePool, error) { + var mh mo.HostSystem + + err := h.Properties(ctx, h.Reference(), []string{"parent"}, &mh) + if err != nil { + return nil, err + } + + var mcr *mo.ComputeResource + var parent interface{} + + switch mh.Parent.Type { + case "ComputeResource": + mcr = new(mo.ComputeResource) + parent = mcr + case "ClusterComputeResource": + mcc := new(mo.ClusterComputeResource) + mcr = &mcc.ComputeResource + parent = mcc + default: + return nil, fmt.Errorf("unknown host parent type: %s", mh.Parent.Type) + } + + err = h.Properties(ctx, *mh.Parent, []string{"resourcePool"}, parent) + if err != nil { + return nil, err + } + + pool := NewResourcePool(h.c, *mcr.ResourcePool) + return pool, nil +} + +func (h HostSystem) ManagementIPs(ctx context.Context) ([]net.IP, error) { + var mh mo.HostSystem + + err := h.Properties(ctx, h.Reference(), []string{"config.virtualNicManagerInfo.netConfig"}, &mh) + if err != nil { + return nil, err + } + + var ips []net.IP + for _, nc := range mh.Config.VirtualNicManagerInfo.NetConfig { + if nc.NicType == "management" && len(nc.CandidateVnic) > 0 { + ip := net.ParseIP(nc.CandidateVnic[0].Spec.Ip.IpAddress) + if ip != nil { + ips = append(ips, ip) + } + } + } + + return ips, nil +} + +func (h HostSystem) Disconnect(ctx context.Context) (*Task, error) { + req := types.DisconnectHost_Task{ + This: h.Reference(), + } + + res, err := methods.DisconnectHost_Task(ctx, h.c, &req) + if err != nil { + return nil, err + } + + return NewTask(h.c, res.Returnval), nil +} + +func (h HostSystem) Reconnect(ctx context.Context, cnxSpec *types.HostConnectSpec, reconnectSpec *types.HostSystemReconnectSpec) (*Task, error) { + req := types.ReconnectHost_Task{ + This: h.Reference(), + CnxSpec: cnxSpec, + ReconnectSpec: reconnectSpec, + } + + res, err := methods.ReconnectHost_Task(ctx, h.c, &req) + if err != nil { + return nil, err + } + + return NewTask(h.c, res.Returnval), nil +} + +func (h HostSystem) EnterMaintenanceMode(ctx context.Context, timeout int32, evacuate bool, spec *types.HostMaintenanceSpec) (*Task, error) { + req := types.EnterMaintenanceMode_Task{ + This: h.Reference(), + Timeout: timeout, + EvacuatePoweredOffVms: types.NewBool(evacuate), + MaintenanceSpec: spec, + } + + res, err := methods.EnterMaintenanceMode_Task(ctx, h.c, &req) + if err != nil { + return nil, err + } + + return NewTask(h.c, res.Returnval), nil +} + +func (h HostSystem) ExitMaintenanceMode(ctx context.Context, timeout int32) (*Task, error) { + req := types.ExitMaintenanceMode_Task{ + This: h.Reference(), + Timeout: timeout, + } + + res, err := methods.ExitMaintenanceMode_Task(ctx, h.c, &req) + if err != nil { + return nil, err + } + + return NewTask(h.c, res.Returnval), nil +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/object/host_virtual_nic_manager.go juju-core-2.0.2/src/github.com/vmware/govmomi/object/host_virtual_nic_manager.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/object/host_virtual_nic_manager.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/object/host_virtual_nic_manager.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,92 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package object + +import ( + "github.com/vmware/govmomi/vim25" + "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/types" + "golang.org/x/net/context" +) + +type HostVirtualNicManager struct { + Common + Host *HostSystem +} + +func NewHostVirtualNicManager(c *vim25.Client, ref types.ManagedObjectReference, host types.ManagedObjectReference) *HostVirtualNicManager { + return &HostVirtualNicManager{ + Common: NewCommon(c, ref), + Host: NewHostSystem(c, host), + } +} + +func (m HostVirtualNicManager) Info(ctx context.Context) (*types.HostVirtualNicManagerInfo, error) { + var vnm mo.HostVirtualNicManager + + err := m.Properties(ctx, m.Reference(), []string{"info"}, &vnm) + if err != nil { + return nil, err + } + + return &vnm.Info, nil +} + +func (m HostVirtualNicManager) DeselectVnic(ctx context.Context, nicType string, device string) error { + if nicType == string(types.HostVirtualNicManagerNicTypeVsan) { + // Avoid fault.NotSupported: + // "Error deselecting device '$device': VSAN interfaces must be deselected using vim.host.VsanSystem" + s, err := m.Host.ConfigManager().VsanSystem(ctx) + if err != nil { + return err + } + + return s.updateVnic(ctx, device, false) + } + + req := types.DeselectVnicForNicType{ + This: m.Reference(), + NicType: nicType, + Device: device, + } + + _, err := methods.DeselectVnicForNicType(ctx, m.Client(), &req) + return err +} + +func (m HostVirtualNicManager) SelectVnic(ctx context.Context, nicType string, device string) error { + if nicType == string(types.HostVirtualNicManagerNicTypeVsan) { + // Avoid fault.NotSupported: + // "Error selecting device '$device': VSAN interfaces must be selected using vim.host.VsanSystem" + s, err := m.Host.ConfigManager().VsanSystem(ctx) + if err != nil { + return err + } + + return s.updateVnic(ctx, device, true) + } + + req := types.SelectVnicForNicType{ + This: m.Reference(), + NicType: nicType, + Device: device, + } + + _, err := methods.SelectVnicForNicType(ctx, m.Client(), &req) + return err +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/object/host_vsan_system.go juju-core-2.0.2/src/github.com/vmware/govmomi/object/host_vsan_system.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/object/host_vsan_system.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/object/host_vsan_system.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,87 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package object + +import ( + "github.com/vmware/govmomi/vim25" + "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/types" + "golang.org/x/net/context" +) + +type HostVsanSystem struct { + Common +} + +func NewHostVsanSystem(c *vim25.Client, ref types.ManagedObjectReference) *HostVsanSystem { + return &HostVsanSystem{ + Common: NewCommon(c, ref), + } +} + +func (s HostVsanSystem) Update(ctx context.Context, config types.VsanHostConfigInfo) (*Task, error) { + req := types.UpdateVsan_Task{ + This: s.Reference(), + Config: config, + } + + res, err := methods.UpdateVsan_Task(ctx, s.Client(), &req) + if err != nil { + return nil, err + } + + return NewTask(s.Client(), res.Returnval), nil +} + +// updateVnic in support of the HostVirtualNicManager.{SelectVnic,DeselectVnic} methods +func (s HostVsanSystem) updateVnic(ctx context.Context, device string, enable bool) error { + var vsan mo.HostVsanSystem + + err := s.Properties(ctx, s.Reference(), []string{"config.networkInfo.port"}, &vsan) + if err != nil { + return err + } + + info := vsan.Config + + var port []types.VsanHostConfigInfoNetworkInfoPortConfig + + for _, p := range info.NetworkInfo.Port { + if p.Device == device { + continue + } + + port = append(port, p) + } + + if enable { + port = append(port, types.VsanHostConfigInfoNetworkInfoPortConfig{ + Device: device, + }) + } + + info.NetworkInfo.Port = port + + task, err := s.Update(ctx, info) + if err != nil { + return err + } + + _, err = task.WaitForResult(ctx, nil) + return err +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/object/http_nfc_lease.go juju-core-2.0.2/src/github.com/vmware/govmomi/object/http_nfc_lease.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/object/http_nfc_lease.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/object/http_nfc_lease.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,143 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package object + +import ( + "errors" + "fmt" + + "github.com/vmware/govmomi/property" + "github.com/vmware/govmomi/vim25" + "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/types" + "golang.org/x/net/context" +) + +type HttpNfcLease struct { + Common +} + +func NewHttpNfcLease(c *vim25.Client, ref types.ManagedObjectReference) *HttpNfcLease { + return &HttpNfcLease{ + Common: NewCommon(c, ref), + } +} + +// HttpNfcLeaseAbort wraps methods.HttpNfcLeaseAbort +func (o HttpNfcLease) HttpNfcLeaseAbort(ctx context.Context, fault *types.LocalizedMethodFault) error { + req := types.HttpNfcLeaseAbort{ + This: o.Reference(), + Fault: fault, + } + + _, err := methods.HttpNfcLeaseAbort(ctx, o.c, &req) + if err != nil { + return err + } + + return nil +} + +// HttpNfcLeaseComplete wraps methods.HttpNfcLeaseComplete +func (o HttpNfcLease) HttpNfcLeaseComplete(ctx context.Context) error { + req := types.HttpNfcLeaseComplete{ + This: o.Reference(), + } + + _, err := methods.HttpNfcLeaseComplete(ctx, o.c, &req) + if err != nil { + return err + } + + return nil +} + +// HttpNfcLeaseGetManifest wraps methods.HttpNfcLeaseGetManifest +func (o HttpNfcLease) HttpNfcLeaseGetManifest(ctx context.Context) error { + req := types.HttpNfcLeaseGetManifest{ + This: o.Reference(), + } + + _, err := methods.HttpNfcLeaseGetManifest(ctx, o.c, &req) + if err != nil { + return err + } + + return nil +} + +// HttpNfcLeaseProgress wraps methods.HttpNfcLeaseProgress +func (o HttpNfcLease) HttpNfcLeaseProgress(ctx context.Context, percent int32) error { + req := types.HttpNfcLeaseProgress{ + This: o.Reference(), + Percent: percent, + } + + _, err := methods.HttpNfcLeaseProgress(ctx, o.c, &req) + if err != nil { + return err + } + + return nil +} + +func (o HttpNfcLease) Wait(ctx context.Context) (*types.HttpNfcLeaseInfo, error) { + var lease mo.HttpNfcLease + + pc := property.DefaultCollector(o.c) + err := property.Wait(ctx, pc, o.Reference(), []string{"state", "info", "error"}, func(pc []types.PropertyChange) bool { + done := false + + for _, c := range pc { + if c.Val == nil { + continue + } + + switch c.Name { + case "error": + val := c.Val.(types.LocalizedMethodFault) + lease.Error = &val + done = true + case "info": + val := c.Val.(types.HttpNfcLeaseInfo) + lease.Info = &val + case "state": + lease.State = c.Val.(types.HttpNfcLeaseState) + if lease.State != types.HttpNfcLeaseStateInitializing { + done = true + } + } + } + + return done + }) + + if err != nil { + return nil, err + } + + if lease.State == types.HttpNfcLeaseStateReady { + return lease.Info, nil + } + + if lease.Error != nil { + return nil, errors.New(lease.Error.LocalizedMessage) + } + + return nil, fmt.Errorf("unexpected nfc lease state: %s", lease.State) +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/object/list_view.go juju-core-2.0.2/src/github.com/vmware/govmomi/object/list_view.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/object/list_view.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/object/list_view.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,43 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package object + +import ( + "github.com/vmware/govmomi/vim25" + "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/types" + "golang.org/x/net/context" +) + +type ListView struct { + Common +} + +func NewListView(c *vim25.Client, ref types.ManagedObjectReference) *ListView { + return &ListView{ + Common: NewCommon(c, ref), + } +} + +func (v ListView) Destroy(ctx context.Context) error { + req := types.DestroyView{ + This: v.Reference(), + } + + _, err := methods.DestroyView(ctx, v.c, &req) + return err +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/object/namespace_manager.go juju-core-2.0.2/src/github.com/vmware/govmomi/object/namespace_manager.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/object/namespace_manager.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/object/namespace_manager.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,75 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package object + +import ( + "github.com/vmware/govmomi/vim25" + "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/types" + "golang.org/x/net/context" +) + +type DatastoreNamespaceManager struct { + Common +} + +func NewDatastoreNamespaceManager(c *vim25.Client) *DatastoreNamespaceManager { + n := DatastoreNamespaceManager{ + Common: NewCommon(c, *c.ServiceContent.DatastoreNamespaceManager), + } + + return &n +} + +// CreateDirectory creates a top-level directory on the given vsan datastore, using +// the given user display name hint and opaque storage policy. +func (nm DatastoreNamespaceManager) CreateDirectory(ctx context.Context, ds *Datastore, displayName string, policy string) (string, error) { + + req := &types.CreateDirectory{ + This: nm.Reference(), + Datastore: ds.Reference(), + DisplayName: displayName, + Policy: policy, + } + + resp, err := methods.CreateDirectory(ctx, nm.c, req) + if err != nil { + return "", err + } + + return resp.Returnval, nil +} + +// DeleteDirectory deletes the given top-level directory from a vsan datastore. +func (nm DatastoreNamespaceManager) DeleteDirectory(ctx context.Context, dc *Datacenter, datastorePath string) error { + + req := &types.DeleteDirectory{ + This: nm.Reference(), + DatastorePath: datastorePath, + } + + if dc != nil { + ref := dc.Reference() + req.Datacenter = &ref + } + + if _, err := methods.DeleteDirectory(ctx, nm.c, req); err != nil { + return err + } + + return nil +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/object/network.go juju-core-2.0.2/src/github.com/vmware/govmomi/object/network.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/object/network.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/object/network.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,46 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package object + +import ( + "github.com/vmware/govmomi/vim25" + "github.com/vmware/govmomi/vim25/types" + "golang.org/x/net/context" +) + +type Network struct { + Common +} + +func NewNetwork(c *vim25.Client, ref types.ManagedObjectReference) *Network { + return &Network{ + Common: NewCommon(c, ref), + } +} + +// EthernetCardBackingInfo returns the VirtualDeviceBackingInfo for this Network +func (n Network) EthernetCardBackingInfo(_ context.Context) (types.BaseVirtualDeviceBackingInfo, error) { + name := n.Name() + + backing := &types.VirtualEthernetCardNetworkBackingInfo{ + VirtualDeviceDeviceBackingInfo: types.VirtualDeviceDeviceBackingInfo{ + DeviceName: name, + }, + } + + return backing, nil +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/object/network_reference.go juju-core-2.0.2/src/github.com/vmware/govmomi/object/network_reference.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/object/network_reference.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/object/network_reference.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,30 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package object + +import ( + "github.com/vmware/govmomi/vim25/types" + "golang.org/x/net/context" +) + +// The NetworkReference interface is implemented by managed objects +// which can be used as the backing for a VirtualEthernetCard. +type NetworkReference interface { + Reference + + EthernetCardBackingInfo(ctx context.Context) (types.BaseVirtualDeviceBackingInfo, error) +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/object/network_test.go juju-core-2.0.2/src/github.com/vmware/govmomi/object/network_test.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/object/network_test.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/object/network_test.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,23 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package object + +// Network should implement the Reference interface. +var _ Reference = Network{} + +// Network should implement the NetworkReference interface. +var _ NetworkReference = Network{} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/object/option_manager.go juju-core-2.0.2/src/github.com/vmware/govmomi/object/option_manager.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/object/option_manager.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/object/option_manager.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,58 @@ +/* +Copyright (c) 2016 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package object + +import ( + "github.com/vmware/govmomi/vim25" + "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/types" + "golang.org/x/net/context" +) + +type OptionManager struct { + Common +} + +func NewOptionManager(c *vim25.Client, ref types.ManagedObjectReference) *OptionManager { + return &OptionManager{ + Common: NewCommon(c, ref), + } +} + +func (m OptionManager) Query(ctx context.Context, name string) ([]types.BaseOptionValue, error) { + req := types.QueryOptions{ + This: m.Reference(), + Name: name, + } + + res, err := methods.QueryOptions(ctx, m.Client(), &req) + if err != nil { + return nil, err + } + + return res.Returnval, nil +} + +func (m OptionManager) Update(ctx context.Context, value []types.BaseOptionValue) error { + req := types.UpdateOptions{ + This: m.Reference(), + ChangedValue: value, + } + + _, err := methods.UpdateOptions(ctx, m.Client(), &req) + return err +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/object/ovf_manager.go juju-core-2.0.2/src/github.com/vmware/govmomi/object/ovf_manager.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/object/ovf_manager.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/object/ovf_manager.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,103 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package object + +import ( + "github.com/vmware/govmomi/vim25" + "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/types" + "golang.org/x/net/context" +) + +type OvfManager struct { + Common +} + +func NewOvfManager(c *vim25.Client) *OvfManager { + o := OvfManager{ + Common: NewCommon(c, *c.ServiceContent.OvfManager), + } + + return &o +} + +// CreateDescriptor wraps methods.CreateDescriptor +func (o OvfManager) CreateDescriptor(ctx context.Context, obj Reference, cdp types.OvfCreateDescriptorParams) (*types.OvfCreateDescriptorResult, error) { + req := types.CreateDescriptor{ + This: o.Reference(), + Obj: obj.Reference(), + Cdp: cdp, + } + + res, err := methods.CreateDescriptor(ctx, o.c, &req) + if err != nil { + return nil, err + } + + return &res.Returnval, nil +} + +// CreateImportSpec wraps methods.CreateImportSpec +func (o OvfManager) CreateImportSpec(ctx context.Context, ovfDescriptor string, resourcePool Reference, datastore Reference, cisp types.OvfCreateImportSpecParams) (*types.OvfCreateImportSpecResult, error) { + req := types.CreateImportSpec{ + This: o.Reference(), + OvfDescriptor: ovfDescriptor, + ResourcePool: resourcePool.Reference(), + Datastore: datastore.Reference(), + Cisp: cisp, + } + + res, err := methods.CreateImportSpec(ctx, o.c, &req) + if err != nil { + return nil, err + } + + return &res.Returnval, nil +} + +// ParseDescriptor wraps methods.ParseDescriptor +func (o OvfManager) ParseDescriptor(ctx context.Context, ovfDescriptor string, pdp types.OvfParseDescriptorParams) (*types.OvfParseDescriptorResult, error) { + req := types.ParseDescriptor{ + This: o.Reference(), + OvfDescriptor: ovfDescriptor, + Pdp: pdp, + } + + res, err := methods.ParseDescriptor(ctx, o.c, &req) + if err != nil { + return nil, err + } + + return &res.Returnval, nil +} + +// ValidateHost wraps methods.ValidateHost +func (o OvfManager) ValidateHost(ctx context.Context, ovfDescriptor string, host Reference, vhp types.OvfValidateHostParams) (*types.OvfValidateHostResult, error) { + req := types.ValidateHost{ + This: o.Reference(), + OvfDescriptor: ovfDescriptor, + Host: host.Reference(), + Vhp: vhp, + } + + res, err := methods.ValidateHost(ctx, o.c, &req) + if err != nil { + return nil, err + } + + return &res.Returnval, nil +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/object/resource_pool.go juju-core-2.0.2/src/github.com/vmware/govmomi/object/resource_pool.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/object/resource_pool.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/object/resource_pool.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,136 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package object + +import ( + "github.com/vmware/govmomi/vim25" + "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/types" + "golang.org/x/net/context" +) + +type ResourcePool struct { + Common +} + +func NewResourcePool(c *vim25.Client, ref types.ManagedObjectReference) *ResourcePool { + return &ResourcePool{ + Common: NewCommon(c, ref), + } +} + +func (p ResourcePool) ImportVApp(ctx context.Context, spec types.BaseImportSpec, folder *Folder, host *HostSystem) (*HttpNfcLease, error) { + req := types.ImportVApp{ + This: p.Reference(), + Spec: spec, + } + + if folder != nil { + ref := folder.Reference() + req.Folder = &ref + } + + if host != nil { + ref := host.Reference() + req.Host = &ref + } + + res, err := methods.ImportVApp(ctx, p.c, &req) + if err != nil { + return nil, err + } + + return NewHttpNfcLease(p.c, res.Returnval), nil +} + +func (p ResourcePool) Create(ctx context.Context, name string, spec types.ResourceConfigSpec) (*ResourcePool, error) { + req := types.CreateResourcePool{ + This: p.Reference(), + Name: name, + Spec: spec, + } + + res, err := methods.CreateResourcePool(ctx, p.c, &req) + if err != nil { + return nil, err + } + + return NewResourcePool(p.c, res.Returnval), nil +} + +func (p ResourcePool) CreateVApp(ctx context.Context, name string, resSpec types.ResourceConfigSpec, configSpec types.VAppConfigSpec, folder *Folder) (*VirtualApp, error) { + req := types.CreateVApp{ + This: p.Reference(), + Name: name, + ResSpec: resSpec, + ConfigSpec: configSpec, + } + + if folder != nil { + ref := folder.Reference() + req.VmFolder = &ref + } + + res, err := methods.CreateVApp(ctx, p.c, &req) + if err != nil { + return nil, err + } + + return NewVirtualApp(p.c, res.Returnval), nil +} + +func (p ResourcePool) UpdateConfig(ctx context.Context, name string, config *types.ResourceConfigSpec) error { + req := types.UpdateConfig{ + This: p.Reference(), + Name: name, + Config: config, + } + + if config != nil && config.Entity == nil { + ref := p.Reference() + + // Create copy of config so changes won't leak back to the caller + newConfig := *config + newConfig.Entity = &ref + req.Config = &newConfig + } + + _, err := methods.UpdateConfig(ctx, p.c, &req) + return err +} + +func (p ResourcePool) DestroyChildren(ctx context.Context) error { + req := types.DestroyChildren{ + This: p.Reference(), + } + + _, err := methods.DestroyChildren(ctx, p.c, &req) + return err +} + +func (p ResourcePool) Destroy(ctx context.Context) (*Task, error) { + req := types.Destroy_Task{ + This: p.Reference(), + } + + res, err := methods.Destroy_Task(ctx, p.c, &req) + if err != nil { + return nil, err + } + + return NewTask(p.c, res.Returnval), nil +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/object/search_index.go juju-core-2.0.2/src/github.com/vmware/govmomi/object/search_index.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/object/search_index.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/object/search_index.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,162 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package object + +import ( + "github.com/vmware/govmomi/vim25" + "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/types" + "golang.org/x/net/context" +) + +type SearchIndex struct { + Common +} + +func NewSearchIndex(c *vim25.Client) *SearchIndex { + s := SearchIndex{ + Common: NewCommon(c, *c.ServiceContent.SearchIndex), + } + + return &s +} + +// FindByDatastorePath finds a virtual machine by its location on a datastore. +func (s SearchIndex) FindByDatastorePath(ctx context.Context, dc *Datacenter, path string) (Reference, error) { + req := types.FindByDatastorePath{ + This: s.Reference(), + Datacenter: dc.Reference(), + Path: path, + } + + res, err := methods.FindByDatastorePath(ctx, s.c, &req) + if err != nil { + return nil, err + } + + if res.Returnval == nil { + return nil, nil + } + return NewReference(s.c, *res.Returnval), nil +} + +// FindByDnsName finds a virtual machine or host by DNS name. +func (s SearchIndex) FindByDnsName(ctx context.Context, dc *Datacenter, dnsName string, vmSearch bool) (Reference, error) { + req := types.FindByDnsName{ + This: s.Reference(), + DnsName: dnsName, + VmSearch: vmSearch, + } + if dc != nil { + ref := dc.Reference() + req.Datacenter = &ref + } + + res, err := methods.FindByDnsName(ctx, s.c, &req) + if err != nil { + return nil, err + } + + if res.Returnval == nil { + return nil, nil + } + return NewReference(s.c, *res.Returnval), nil +} + +// FindByInventoryPath finds a managed entity based on its location in the inventory. +func (s SearchIndex) FindByInventoryPath(ctx context.Context, path string) (Reference, error) { + req := types.FindByInventoryPath{ + This: s.Reference(), + InventoryPath: path, + } + + res, err := methods.FindByInventoryPath(ctx, s.c, &req) + if err != nil { + return nil, err + } + + if res.Returnval == nil { + return nil, nil + } + return NewReference(s.c, *res.Returnval), nil +} + +// FindByIp finds a virtual machine or host by IP address. +func (s SearchIndex) FindByIp(ctx context.Context, dc *Datacenter, ip string, vmSearch bool) (Reference, error) { + req := types.FindByIp{ + This: s.Reference(), + Ip: ip, + VmSearch: vmSearch, + } + if dc != nil { + ref := dc.Reference() + req.Datacenter = &ref + } + + res, err := methods.FindByIp(ctx, s.c, &req) + if err != nil { + return nil, err + } + + if res.Returnval == nil { + return nil, nil + } + return NewReference(s.c, *res.Returnval), nil +} + +// FindByUuid finds a virtual machine or host by UUID. +func (s SearchIndex) FindByUuid(ctx context.Context, dc *Datacenter, uuid string, vmSearch bool, instanceUuid *bool) (Reference, error) { + req := types.FindByUuid{ + This: s.Reference(), + Uuid: uuid, + VmSearch: vmSearch, + InstanceUuid: instanceUuid, + } + if dc != nil { + ref := dc.Reference() + req.Datacenter = &ref + } + + res, err := methods.FindByUuid(ctx, s.c, &req) + if err != nil { + return nil, err + } + + if res.Returnval == nil { + return nil, nil + } + return NewReference(s.c, *res.Returnval), nil +} + +// FindChild finds a particular child based on a managed entity name. +func (s SearchIndex) FindChild(ctx context.Context, entity Reference, name string) (Reference, error) { + req := types.FindChild{ + This: s.Reference(), + Entity: entity.Reference(), + Name: name, + } + + res, err := methods.FindChild(ctx, s.c, &req) + if err != nil { + return nil, err + } + + if res.Returnval == nil { + return nil, nil + } + return NewReference(s.c, *res.Returnval), nil +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/object/search_index_test.go juju-core-2.0.2/src/github.com/vmware/govmomi/object/search_index_test.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/object/search_index_test.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/object/search_index_test.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,155 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package object + +import ( + "fmt" + "reflect" + "testing" + + "github.com/vmware/govmomi/test" + "github.com/vmware/govmomi/vim25/mo" + "golang.org/x/net/context" +) + +func TestSearch(t *testing.T) { + c := test.NewAuthenticatedClient(t) + s := NewSearchIndex(c) + + ref, err := s.FindChild(context.Background(), NewRootFolder(c), "ha-datacenter") + if err != nil { + t.Fatal(err) + } + + dc, ok := ref.(*Datacenter) + if !ok { + t.Errorf("Expected Datacenter: %#v", ref) + } + + folders, err := dc.Folders(context.Background()) + if err != nil { + t.Fatal(err) + } + + ref, err = s.FindChild(context.Background(), folders.DatastoreFolder, "datastore1") + if err != nil { + t.Fatal(err) + } + + _, ok = ref.(*Datastore) + if !ok { + t.Errorf("Expected Datastore: %#v", ref) + } + + ref, err = s.FindByInventoryPath(context.Background(), "/ha-datacenter/network/VM Network") + if err != nil { + t.Fatal(err) + } + + _, ok = ref.(*Network) + if !ok { + t.Errorf("Expected Network: %#v", ref) + } + + crs, err := folders.HostFolder.Children(context.Background()) + if err != nil { + if err != nil { + t.Fatal(err) + } + } + if len(crs) != 0 { + var cr mo.ComputeResource + ref = crs[0] + err = s.Properties(context.Background(), ref.Reference(), []string{"host"}, &cr) + if err != nil { + t.Fatal(err) + } + + var host mo.HostSystem + ref = NewHostSystem(c, cr.Host[0]) + err = s.Properties(context.Background(), ref.Reference(), []string{"name", "hardware", "config"}, &host) + if err != nil { + t.Fatal(err) + } + + dnsConfig := host.Config.Network.DnsConfig.GetHostDnsConfig() + dnsName := fmt.Sprintf("%s.%s", dnsConfig.HostName, dnsConfig.DomainName) + shost, err := s.FindByDnsName(context.Background(), dc, dnsName, false) + if err != nil { + t.Fatal(err) + } + if !reflect.DeepEqual(ref, shost) { + t.Errorf("%#v != %#v\n", ref, shost) + } + + shost, err = s.FindByUuid(context.Background(), dc, host.Hardware.SystemInfo.Uuid, false, nil) + if err != nil { + t.Fatal(err) + } + if !reflect.DeepEqual(ref, shost) { + t.Errorf("%#v != %#v\n", ref, shost) + } + } + + vms, err := folders.VmFolder.Children(context.Background()) + if err != nil { + t.Fatal(err) + } + if len(vms) != 0 { + var vm mo.VirtualMachine + ref = vms[0] + err = s.Properties(context.Background(), ref.Reference(), []string{"config", "guest"}, &vm) + if err != nil { + t.Fatal(err) + } + svm, err := s.FindByDatastorePath(context.Background(), dc, vm.Config.Files.VmPathName) + if err != nil { + t.Fatal(err) + } + if !reflect.DeepEqual(ref, svm) { + t.Errorf("%#v != %#v\n", ref, svm) + } + + svm, err = s.FindByUuid(context.Background(), dc, vm.Config.Uuid, true, nil) + if err != nil { + t.Fatal(err) + } + if !reflect.DeepEqual(ref, svm) { + t.Errorf("%#v != %#v\n", ref, svm) + } + + if vm.Guest.HostName != "" { + svm, err := s.FindByDnsName(context.Background(), dc, vm.Guest.HostName, true) + if err != nil { + t.Fatal(err) + } + if !reflect.DeepEqual(ref, svm) { + t.Errorf("%#v != %#v\n", ref, svm) + } + } + + if vm.Guest.IpAddress != "" { + svm, err := s.FindByIp(context.Background(), dc, vm.Guest.IpAddress, true) + if err != nil { + t.Fatal(err) + } + if !reflect.DeepEqual(ref, svm) { + t.Errorf("%#v != %#v\n", ref, svm) + } + } + } +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/object/storage_pod.go juju-core-2.0.2/src/github.com/vmware/govmomi/object/storage_pod.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/object/storage_pod.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/object/storage_pod.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,34 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package object + +import ( + "github.com/vmware/govmomi/vim25" + "github.com/vmware/govmomi/vim25/types" +) + +type StoragePod struct { + *Folder +} + +func NewStoragePod(c *vim25.Client, ref types.ManagedObjectReference) *StoragePod { + return &StoragePod{ + Folder: &Folder{ + Common: NewCommon(c, ref), + }, + } +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/object/storage_resource_manager.go juju-core-2.0.2/src/github.com/vmware/govmomi/object/storage_resource_manager.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/object/storage_resource_manager.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/object/storage_resource_manager.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,178 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package object + +import ( + "github.com/vmware/govmomi/vim25" + "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/types" + "golang.org/x/net/context" +) + +type StorageResourceManager struct { + Common +} + +func NewStorageResourceManager(c *vim25.Client) *StorageResourceManager { + sr := StorageResourceManager{ + Common: NewCommon(c, *c.ServiceContent.StorageResourceManager), + } + + return &sr +} + +func (sr StorageResourceManager) ApplyStorageDrsRecommendation(ctx context.Context, key []string) (*Task, error) { + req := types.ApplyStorageDrsRecommendation_Task{ + This: sr.Reference(), + Key: key, + } + + res, err := methods.ApplyStorageDrsRecommendation_Task(ctx, sr.c, &req) + if err != nil { + return nil, err + } + + return NewTask(sr.c, res.Returnval), nil +} + +func (sr StorageResourceManager) ApplyStorageDrsRecommendationToPod(ctx context.Context, pod *StoragePod, key string) (*Task, error) { + req := types.ApplyStorageDrsRecommendationToPod_Task{ + This: sr.Reference(), + Key: key, + } + + if pod != nil { + req.Pod = pod.Reference() + } + + res, err := methods.ApplyStorageDrsRecommendationToPod_Task(ctx, sr.c, &req) + if err != nil { + return nil, err + } + + return NewTask(sr.c, res.Returnval), nil +} + +func (sr StorageResourceManager) CancelStorageDrsRecommendation(ctx context.Context, key []string) error { + req := types.CancelStorageDrsRecommendation{ + This: sr.Reference(), + Key: key, + } + + _, err := methods.CancelStorageDrsRecommendation(ctx, sr.c, &req) + + return err +} + +func (sr StorageResourceManager) ConfigureDatastoreIORM(ctx context.Context, datastore *Datastore, spec types.StorageIORMConfigSpec, key string) (*Task, error) { + req := types.ConfigureDatastoreIORM_Task{ + This: sr.Reference(), + Spec: spec, + } + + if datastore != nil { + req.Datastore = datastore.Reference() + } + + res, err := methods.ConfigureDatastoreIORM_Task(ctx, sr.c, &req) + if err != nil { + return nil, err + } + + return NewTask(sr.c, res.Returnval), nil +} + +func (sr StorageResourceManager) ConfigureStorageDrsForPod(ctx context.Context, pod *StoragePod, spec types.StorageDrsConfigSpec, modify bool) (*Task, error) { + req := types.ConfigureStorageDrsForPod_Task{ + This: sr.Reference(), + Spec: spec, + Modify: modify, + } + + if pod != nil { + req.Pod = pod.Reference() + } + + res, err := methods.ConfigureStorageDrsForPod_Task(ctx, sr.c, &req) + if err != nil { + return nil, err + } + + return NewTask(sr.c, res.Returnval), nil +} + +func (sr StorageResourceManager) QueryDatastorePerformanceSummary(ctx context.Context, datastore *Datastore) ([]types.StoragePerformanceSummary, error) { + req := types.QueryDatastorePerformanceSummary{ + This: sr.Reference(), + } + + if datastore != nil { + req.Datastore = datastore.Reference() + } + + res, err := methods.QueryDatastorePerformanceSummary(ctx, sr.c, &req) + if err != nil { + return nil, err + } + + return res.Returnval, nil +} + +func (sr StorageResourceManager) QueryIORMConfigOption(ctx context.Context, host *HostSystem) (*types.StorageIORMConfigOption, error) { + req := types.QueryIORMConfigOption{ + This: sr.Reference(), + } + + if host != nil { + req.Host = host.Reference() + } + + res, err := methods.QueryIORMConfigOption(ctx, sr.c, &req) + if err != nil { + return nil, err + } + + return &res.Returnval, nil +} + +func (sr StorageResourceManager) RecommendDatastores(ctx context.Context, storageSpec types.StoragePlacementSpec) (*types.StoragePlacementResult, error) { + req := types.RecommendDatastores{ + This: sr.Reference(), + StorageSpec: storageSpec, + } + + res, err := methods.RecommendDatastores(ctx, sr.c, &req) + if err != nil { + return nil, err + } + + return &res.Returnval, nil +} + +func (sr StorageResourceManager) RefreshStorageDrsRecommendation(ctx context.Context, pod *StoragePod) error { + req := types.RefreshStorageDrsRecommendation{ + This: sr.Reference(), + } + + if pod != nil { + req.Pod = pod.Reference() + } + + _, err := methods.RefreshStorageDrsRecommendation(ctx, sr.c, &req) + + return err +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/object/task.go juju-core-2.0.2/src/github.com/vmware/govmomi/object/task.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/object/task.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/object/task.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,52 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package object + +import ( + "github.com/vmware/govmomi/property" + "github.com/vmware/govmomi/task" + "github.com/vmware/govmomi/vim25" + "github.com/vmware/govmomi/vim25/progress" + "github.com/vmware/govmomi/vim25/types" + "golang.org/x/net/context" +) + +// Task is a convenience wrapper around task.Task that keeps a reference to +// the client that was used to create it. This allows users to call the Wait() +// function with only a context parameter, instead of a context parameter, a +// soap.RoundTripper, and reference to the root property collector. +type Task struct { + Common +} + +func NewTask(c *vim25.Client, ref types.ManagedObjectReference) *Task { + t := Task{ + Common: NewCommon(c, ref), + } + + return &t +} + +func (t *Task) Wait(ctx context.Context) error { + _, err := t.WaitForResult(ctx, nil) + return err +} + +func (t *Task) WaitForResult(ctx context.Context, s progress.Sinker) (*types.TaskInfo, error) { + p := property.DefaultCollector(t.c) + return task.Wait(ctx, t.Reference(), p, s) +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/object/types.go juju-core-2.0.2/src/github.com/vmware/govmomi/object/types.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/object/types.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/object/types.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,65 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package object + +import ( + "github.com/vmware/govmomi/vim25" + "github.com/vmware/govmomi/vim25/types" +) + +type Reference interface { + Reference() types.ManagedObjectReference +} + +func NewReference(c *vim25.Client, e types.ManagedObjectReference) Reference { + switch e.Type { + case "Folder": + return NewFolder(c, e) + case "StoragePod": + return &StoragePod{ + NewFolder(c, e), + } + case "Datacenter": + return NewDatacenter(c, e) + case "VirtualMachine": + return NewVirtualMachine(c, e) + case "VirtualApp": + return &VirtualApp{ + NewResourcePool(c, e), + } + case "ComputeResource": + return NewComputeResource(c, e) + case "ClusterComputeResource": + return NewClusterComputeResource(c, e) + case "HostSystem": + return NewHostSystem(c, e) + case "Network": + return NewNetwork(c, e) + case "ResourcePool": + return NewResourcePool(c, e) + case "DistributedVirtualSwitch": + return NewDistributedVirtualSwitch(c, e) + case "VmwareDistributedVirtualSwitch": + return &VmwareDistributedVirtualSwitch{*NewDistributedVirtualSwitch(c, e)} + case "DistributedVirtualPortgroup": + return NewDistributedVirtualPortgroup(c, e) + case "Datastore": + return NewDatastore(c, e) + default: + panic("Unknown managed entity: " + e.Type) + } +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/object/virtual_app.go juju-core-2.0.2/src/github.com/vmware/govmomi/object/virtual_app.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/object/virtual_app.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/object/virtual_app.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,105 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package object + +import ( + "golang.org/x/net/context" + + "github.com/vmware/govmomi/vim25" + "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/types" +) + +type VirtualApp struct { + *ResourcePool +} + +func NewVirtualApp(c *vim25.Client, ref types.ManagedObjectReference) *VirtualApp { + return &VirtualApp{ + ResourcePool: NewResourcePool(c, ref), + } +} + +func (p VirtualApp) CreateChildVM_Task(ctx context.Context, config types.VirtualMachineConfigSpec, host *HostSystem) (*Task, error) { + req := types.CreateChildVM_Task{ + This: p.Reference(), + Config: config, + } + + if host != nil { + ref := host.Reference() + req.Host = &ref + } + + res, err := methods.CreateChildVM_Task(ctx, p.c, &req) + if err != nil { + return nil, err + } + + return NewTask(p.c, res.Returnval), nil +} + +func (p VirtualApp) UpdateVAppConfig(ctx context.Context, spec types.VAppConfigSpec) error { + req := types.UpdateVAppConfig{ + This: p.Reference(), + Spec: spec, + } + + _, err := methods.UpdateVAppConfig(ctx, p.c, &req) + return err +} + +func (p VirtualApp) PowerOnVApp_Task(ctx context.Context) (*Task, error) { + req := types.PowerOnVApp_Task{ + This: p.Reference(), + } + + res, err := methods.PowerOnVApp_Task(ctx, p.c, &req) + if err != nil { + return nil, err + } + + return NewTask(p.c, res.Returnval), nil +} + +func (p VirtualApp) PowerOffVApp_Task(ctx context.Context, force bool) (*Task, error) { + req := types.PowerOffVApp_Task{ + This: p.Reference(), + Force: force, + } + + res, err := methods.PowerOffVApp_Task(ctx, p.c, &req) + if err != nil { + return nil, err + } + + return NewTask(p.c, res.Returnval), nil + +} + +func (p VirtualApp) SuspendVApp_Task(ctx context.Context) (*Task, error) { + req := types.SuspendVApp_Task{ + This: p.Reference(), + } + + res, err := methods.SuspendVApp_Task(ctx, p.c, &req) + if err != nil { + return nil, err + } + + return NewTask(p.c, res.Returnval), nil +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/object/virtual_device_list.go juju-core-2.0.2/src/github.com/vmware/govmomi/object/virtual_device_list.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/object/virtual_device_list.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/object/virtual_device_list.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,827 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package object + +import ( + "errors" + "fmt" + "path/filepath" + "reflect" + "regexp" + "sort" + "strings" + + "github.com/vmware/govmomi/vim25/types" +) + +// Type values for use in BootOrder +const ( + DeviceTypeCdrom = "cdrom" + DeviceTypeDisk = "disk" + DeviceTypeEthernet = "ethernet" + DeviceTypeFloppy = "floppy" +) + +// VirtualDeviceList provides helper methods for working with a list of virtual devices. +type VirtualDeviceList []types.BaseVirtualDevice + +// SCSIControllerTypes are used for adding a new SCSI controller to a VM. +func SCSIControllerTypes() VirtualDeviceList { + // Return a mutable list of SCSI controller types, initialized with defaults. + return VirtualDeviceList([]types.BaseVirtualDevice{ + &types.VirtualLsiLogicController{}, + &types.VirtualBusLogicController{}, + &types.ParaVirtualSCSIController{}, + &types.VirtualLsiLogicSASController{}, + }).Select(func(device types.BaseVirtualDevice) bool { + c := device.(types.BaseVirtualSCSIController).GetVirtualSCSIController() + c.SharedBus = types.VirtualSCSISharingNoSharing + c.BusNumber = -1 + return true + }) +} + +// EthernetCardTypes are used for adding a new ethernet card to a VM. +func EthernetCardTypes() VirtualDeviceList { + return VirtualDeviceList([]types.BaseVirtualDevice{ + &types.VirtualE1000{}, + &types.VirtualE1000e{}, + &types.VirtualVmxnet3{}, + }).Select(func(device types.BaseVirtualDevice) bool { + c := device.(types.BaseVirtualEthernetCard).GetVirtualEthernetCard() + c.GetVirtualDevice().Key = -1 + return true + }) +} + +// Select returns a new list containing all elements of the list for which the given func returns true. +func (l VirtualDeviceList) Select(f func(device types.BaseVirtualDevice) bool) VirtualDeviceList { + var found VirtualDeviceList + + for _, device := range l { + if f(device) { + found = append(found, device) + } + } + + return found +} + +// SelectByType returns a new list with devices that are equal to or extend the given type. +func (l VirtualDeviceList) SelectByType(deviceType types.BaseVirtualDevice) VirtualDeviceList { + dtype := reflect.TypeOf(deviceType) + dname := dtype.Elem().Name() + + return l.Select(func(device types.BaseVirtualDevice) bool { + t := reflect.TypeOf(device) + + if t == dtype { + return true + } + + _, ok := t.Elem().FieldByName(dname) + + return ok + }) +} + +// SelectByBackingInfo returns a new list with devices matching the given backing info. +// If the value of backing is nil, any device with a backing of the same type will be returned. +func (l VirtualDeviceList) SelectByBackingInfo(backing types.BaseVirtualDeviceBackingInfo) VirtualDeviceList { + t := reflect.TypeOf(backing) + + return l.Select(func(device types.BaseVirtualDevice) bool { + db := device.GetVirtualDevice().Backing + if db == nil { + return false + } + + if reflect.TypeOf(db) != t { + return false + } + + if reflect.ValueOf(backing).IsNil() { + // selecting by backing type + return true + } + + switch a := db.(type) { + case *types.VirtualEthernetCardNetworkBackingInfo: + b := backing.(*types.VirtualEthernetCardNetworkBackingInfo) + return a.DeviceName == b.DeviceName + case *types.VirtualEthernetCardDistributedVirtualPortBackingInfo: + b := backing.(*types.VirtualEthernetCardDistributedVirtualPortBackingInfo) + return a.Port.SwitchUuid == b.Port.SwitchUuid && + a.Port.PortgroupKey == b.Port.PortgroupKey + case *types.VirtualDiskFlatVer2BackingInfo: + b := backing.(*types.VirtualDiskFlatVer2BackingInfo) + if a.Parent != nil && b.Parent != nil { + return a.Parent.FileName == b.Parent.FileName + } + return a.FileName == b.FileName + case *types.VirtualSerialPortURIBackingInfo: + b := backing.(*types.VirtualSerialPortURIBackingInfo) + return a.ServiceURI == b.ServiceURI + case types.BaseVirtualDeviceFileBackingInfo: + b := backing.(types.BaseVirtualDeviceFileBackingInfo) + return a.GetVirtualDeviceFileBackingInfo().FileName == b.GetVirtualDeviceFileBackingInfo().FileName + default: + return false + } + }) +} + +// Find returns the device matching the given name. +func (l VirtualDeviceList) Find(name string) types.BaseVirtualDevice { + for _, device := range l { + if l.Name(device) == name { + return device + } + } + return nil +} + +// FindByKey returns the device matching the given key. +func (l VirtualDeviceList) FindByKey(key int32) types.BaseVirtualDevice { + for _, device := range l { + if device.GetVirtualDevice().Key == key { + return device + } + } + return nil +} + +// FindIDEController will find the named IDE controller if given, otherwise will pick an available controller. +// An error is returned if the named controller is not found or not an IDE controller. Or, if name is not +// given and no available controller can be found. +func (l VirtualDeviceList) FindIDEController(name string) (*types.VirtualIDEController, error) { + if name != "" { + d := l.Find(name) + if d == nil { + return nil, fmt.Errorf("device '%s' not found", name) + } + if c, ok := d.(*types.VirtualIDEController); ok { + return c, nil + } + return nil, fmt.Errorf("%s is not an IDE controller", name) + } + + c := l.PickController((*types.VirtualIDEController)(nil)) + if c == nil { + return nil, errors.New("no available IDE controller") + } + + return c.(*types.VirtualIDEController), nil +} + +// CreateIDEController creates a new IDE controller. +func (l VirtualDeviceList) CreateIDEController() (types.BaseVirtualDevice, error) { + ide := &types.VirtualIDEController{} + ide.Key = l.NewKey() + return ide, nil +} + +// FindSCSIController will find the named SCSI controller if given, otherwise will pick an available controller. +// An error is returned if the named controller is not found or not an SCSI controller. Or, if name is not +// given and no available controller can be found. +func (l VirtualDeviceList) FindSCSIController(name string) (*types.VirtualSCSIController, error) { + if name != "" { + d := l.Find(name) + if d == nil { + return nil, fmt.Errorf("device '%s' not found", name) + } + if c, ok := d.(types.BaseVirtualSCSIController); ok { + return c.GetVirtualSCSIController(), nil + } + return nil, fmt.Errorf("%s is not an SCSI controller", name) + } + + c := l.PickController((*types.VirtualSCSIController)(nil)) + if c == nil { + return nil, errors.New("no available SCSI controller") + } + + return c.(types.BaseVirtualSCSIController).GetVirtualSCSIController(), nil +} + +// CreateSCSIController creates a new SCSI controller of type name if given, otherwise defaults to lsilogic. +func (l VirtualDeviceList) CreateSCSIController(name string) (types.BaseVirtualDevice, error) { + ctypes := SCSIControllerTypes() + + if name == "scsi" || name == "" { + name = ctypes.Type(ctypes[0]) + } + + found := ctypes.Select(func(device types.BaseVirtualDevice) bool { + return l.Type(device) == name + }) + + if len(found) == 0 { + return nil, fmt.Errorf("unknown SCSI controller type '%s'", name) + } + + c, ok := found[0].(types.BaseVirtualSCSIController) + if !ok { + return nil, fmt.Errorf("invalid SCSI controller type '%s'", name) + } + + scsi := c.GetVirtualSCSIController() + scsi.BusNumber = l.newSCSIBusNumber() + scsi.Key = l.NewKey() + return c.(types.BaseVirtualDevice), nil +} + +var scsiBusNumbers = []int{0, 1, 2, 3} + +// newSCSIBusNumber returns the bus number to use for adding a new SCSI bus device. +// -1 is returned if there are no bus numbers available. +func (l VirtualDeviceList) newSCSIBusNumber() int32 { + var used []int + + for _, d := range l.SelectByType((*types.VirtualSCSIController)(nil)) { + num := d.(types.BaseVirtualSCSIController).GetVirtualSCSIController().BusNumber + if num >= 0 { + used = append(used, int(num)) + } // else caller is creating a new vm using SCSIControllerTypes + } + + sort.Ints(used) + + for i, n := range scsiBusNumbers { + if i == len(used) || n != used[i] { + return int32(n) + } + } + + return -1 +} + +// FindDiskController will find an existing ide or scsi disk controller. +func (l VirtualDeviceList) FindDiskController(name string) (types.BaseVirtualController, error) { + switch { + case name == "ide": + return l.FindIDEController("") + case name == "scsi" || name == "": + return l.FindSCSIController("") + default: + if c, ok := l.Find(name).(types.BaseVirtualController); ok { + return c, nil + } + return nil, fmt.Errorf("%s is not a valid controller", name) + } +} + +// PickController returns a controller of the given type(s). +// If no controllers are found or have no available slots, then nil is returned. +func (l VirtualDeviceList) PickController(kind types.BaseVirtualController) types.BaseVirtualController { + l = l.SelectByType(kind.(types.BaseVirtualDevice)).Select(func(device types.BaseVirtualDevice) bool { + num := len(device.(types.BaseVirtualController).GetVirtualController().Device) + + switch device.(type) { + case types.BaseVirtualSCSIController: + return num < 15 + case *types.VirtualIDEController: + return num < 2 + default: + return true + } + }) + + if len(l) == 0 { + return nil + } + + return l[0].(types.BaseVirtualController) +} + +// newUnitNumber returns the unit number to use for attaching a new device to the given controller. +func (l VirtualDeviceList) newUnitNumber(c types.BaseVirtualController) int32 { + key := c.GetVirtualController().Key + var max int32 = -1 + + for _, device := range l { + d := device.GetVirtualDevice() + + if d.ControllerKey == key { + if d.UnitNumber != nil && *d.UnitNumber > max { + max = *d.UnitNumber + } + } + } + + return max + 1 +} + +// NewKey returns the key to use for adding a new device to the device list. +// The device list we're working with here may not be complete (e.g. when +// we're only adding new devices), so any positive keys could conflict with device keys +// that are already in use. To avoid this type of conflict, we can use negative keys +// here, which will be resolved to positive keys by vSphere as the reconfiguration is done. +func (l VirtualDeviceList) NewKey() int32 { + var key int32 = -200 + + for _, device := range l { + d := device.GetVirtualDevice() + if d.Key < key { + key = d.Key + } + } + + return key - 1 +} + +// AssignController assigns a device to a controller. +func (l VirtualDeviceList) AssignController(device types.BaseVirtualDevice, c types.BaseVirtualController) { + d := device.GetVirtualDevice() + d.ControllerKey = c.GetVirtualController().Key + d.UnitNumber = new(int32) + *d.UnitNumber = l.newUnitNumber(c) + if d.Key == 0 { + d.Key = -1 + } +} + +// CreateDisk creates a new VirtualDisk device which can be added to a VM. +func (l VirtualDeviceList) CreateDisk(c types.BaseVirtualController, ds types.ManagedObjectReference, name string) *types.VirtualDisk { + // If name is not specified, one will be chosen for you. + // But if when given, make sure it ends in .vmdk, otherwise it will be treated as a directory. + if len(name) > 0 && filepath.Ext(name) != ".vmdk" { + name += ".vmdk" + } + + device := &types.VirtualDisk{ + VirtualDevice: types.VirtualDevice{ + Backing: &types.VirtualDiskFlatVer2BackingInfo{ + DiskMode: string(types.VirtualDiskModePersistent), + ThinProvisioned: types.NewBool(true), + VirtualDeviceFileBackingInfo: types.VirtualDeviceFileBackingInfo{ + FileName: name, + Datastore: &ds, + }, + }, + }, + } + + l.AssignController(device, c) + return device +} + +// ChildDisk creates a new VirtualDisk device, linked to the given parent disk, which can be added to a VM. +func (l VirtualDeviceList) ChildDisk(parent *types.VirtualDisk) *types.VirtualDisk { + disk := *parent + backing := disk.Backing.(*types.VirtualDiskFlatVer2BackingInfo) + ds := strings.SplitN(backing.FileName[1:], "]", 2) + + // Use specified disk as parent backing to a new disk. + disk.Backing = &types.VirtualDiskFlatVer2BackingInfo{ + VirtualDeviceFileBackingInfo: types.VirtualDeviceFileBackingInfo{ + FileName: fmt.Sprintf("[%s]", ds[0]), + Datastore: backing.Datastore, + }, + Parent: backing, + DiskMode: backing.DiskMode, + ThinProvisioned: backing.ThinProvisioned, + } + + return &disk +} + +func (l VirtualDeviceList) connectivity(device types.BaseVirtualDevice, v bool) error { + c := device.GetVirtualDevice().Connectable + if c == nil { + return fmt.Errorf("%s is not connectable", l.Name(device)) + } + + c.Connected = v + c.StartConnected = v + + return nil +} + +// Connect changes the device to connected, returns an error if the device is not connectable. +func (l VirtualDeviceList) Connect(device types.BaseVirtualDevice) error { + return l.connectivity(device, true) +} + +// Disconnect changes the device to disconnected, returns an error if the device is not connectable. +func (l VirtualDeviceList) Disconnect(device types.BaseVirtualDevice) error { + return l.connectivity(device, false) +} + +// FindCdrom finds a cdrom device with the given name, defaulting to the first cdrom device if any. +func (l VirtualDeviceList) FindCdrom(name string) (*types.VirtualCdrom, error) { + if name != "" { + d := l.Find(name) + if d == nil { + return nil, fmt.Errorf("device '%s' not found", name) + } + if c, ok := d.(*types.VirtualCdrom); ok { + return c, nil + } + return nil, fmt.Errorf("%s is not a cdrom device", name) + } + + c := l.SelectByType((*types.VirtualCdrom)(nil)) + if len(c) == 0 { + return nil, errors.New("no cdrom device found") + } + + return c[0].(*types.VirtualCdrom), nil +} + +// CreateCdrom creates a new VirtualCdrom device which can be added to a VM. +func (l VirtualDeviceList) CreateCdrom(c *types.VirtualIDEController) (*types.VirtualCdrom, error) { + device := &types.VirtualCdrom{} + + l.AssignController(device, c) + + l.setDefaultCdromBacking(device) + + device.Connectable = &types.VirtualDeviceConnectInfo{ + AllowGuestControl: true, + Connected: true, + StartConnected: true, + } + + return device, nil +} + +// InsertIso changes the cdrom device backing to use the given iso file. +func (l VirtualDeviceList) InsertIso(device *types.VirtualCdrom, iso string) *types.VirtualCdrom { + device.Backing = &types.VirtualCdromIsoBackingInfo{ + VirtualDeviceFileBackingInfo: types.VirtualDeviceFileBackingInfo{ + FileName: iso, + }, + } + + return device +} + +// EjectIso removes the iso file based backing and replaces with the default cdrom backing. +func (l VirtualDeviceList) EjectIso(device *types.VirtualCdrom) *types.VirtualCdrom { + l.setDefaultCdromBacking(device) + return device +} + +func (l VirtualDeviceList) setDefaultCdromBacking(device *types.VirtualCdrom) { + device.Backing = &types.VirtualCdromAtapiBackingInfo{ + VirtualDeviceDeviceBackingInfo: types.VirtualDeviceDeviceBackingInfo{ + DeviceName: fmt.Sprintf("%s-%d-%d", DeviceTypeCdrom, device.ControllerKey, device.UnitNumber), + UseAutoDetect: types.NewBool(false), + }, + } +} + +// FindFloppy finds a floppy device with the given name, defaulting to the first floppy device if any. +func (l VirtualDeviceList) FindFloppy(name string) (*types.VirtualFloppy, error) { + if name != "" { + d := l.Find(name) + if d == nil { + return nil, fmt.Errorf("device '%s' not found", name) + } + if c, ok := d.(*types.VirtualFloppy); ok { + return c, nil + } + return nil, fmt.Errorf("%s is not a floppy device", name) + } + + c := l.SelectByType((*types.VirtualFloppy)(nil)) + if len(c) == 0 { + return nil, errors.New("no floppy device found") + } + + return c[0].(*types.VirtualFloppy), nil +} + +// CreateFloppy creates a new VirtualFloppy device which can be added to a VM. +func (l VirtualDeviceList) CreateFloppy() (*types.VirtualFloppy, error) { + device := &types.VirtualFloppy{} + + c := l.PickController((*types.VirtualSIOController)(nil)) + if c == nil { + return nil, errors.New("no available SIO controller") + } + + l.AssignController(device, c) + + l.setDefaultFloppyBacking(device) + + device.Connectable = &types.VirtualDeviceConnectInfo{ + AllowGuestControl: true, + Connected: true, + StartConnected: true, + } + + return device, nil +} + +// InsertImg changes the floppy device backing to use the given img file. +func (l VirtualDeviceList) InsertImg(device *types.VirtualFloppy, img string) *types.VirtualFloppy { + device.Backing = &types.VirtualFloppyImageBackingInfo{ + VirtualDeviceFileBackingInfo: types.VirtualDeviceFileBackingInfo{ + FileName: img, + }, + } + + return device +} + +// EjectImg removes the img file based backing and replaces with the default floppy backing. +func (l VirtualDeviceList) EjectImg(device *types.VirtualFloppy) *types.VirtualFloppy { + l.setDefaultFloppyBacking(device) + return device +} + +func (l VirtualDeviceList) setDefaultFloppyBacking(device *types.VirtualFloppy) { + device.Backing = &types.VirtualFloppyDeviceBackingInfo{ + VirtualDeviceDeviceBackingInfo: types.VirtualDeviceDeviceBackingInfo{ + DeviceName: fmt.Sprintf("%s-%d", DeviceTypeFloppy, device.UnitNumber), + UseAutoDetect: types.NewBool(false), + }, + } +} + +// FindSerialPort finds a serial port device with the given name, defaulting to the first serial port device if any. +func (l VirtualDeviceList) FindSerialPort(name string) (*types.VirtualSerialPort, error) { + if name != "" { + d := l.Find(name) + if d == nil { + return nil, fmt.Errorf("device '%s' not found", name) + } + if c, ok := d.(*types.VirtualSerialPort); ok { + return c, nil + } + return nil, fmt.Errorf("%s is not a serial port device", name) + } + + c := l.SelectByType((*types.VirtualSerialPort)(nil)) + if len(c) == 0 { + return nil, errors.New("no serial port device found") + } + + return c[0].(*types.VirtualSerialPort), nil +} + +// CreateSerialPort creates a new VirtualSerialPort device which can be added to a VM. +func (l VirtualDeviceList) CreateSerialPort() (*types.VirtualSerialPort, error) { + device := &types.VirtualSerialPort{ + YieldOnPoll: true, + } + + c := l.PickController((*types.VirtualSIOController)(nil)) + if c == nil { + return nil, errors.New("no available SIO controller") + } + + l.AssignController(device, c) + + l.setDefaultSerialPortBacking(device) + + return device, nil +} + +// ConnectSerialPort connects a serial port to a server or client uri. +func (l VirtualDeviceList) ConnectSerialPort(device *types.VirtualSerialPort, uri string, client bool) *types.VirtualSerialPort { + direction := types.VirtualDeviceURIBackingOptionDirectionServer + if client { + direction = types.VirtualDeviceURIBackingOptionDirectionClient + } + + device.Backing = &types.VirtualSerialPortURIBackingInfo{ + VirtualDeviceURIBackingInfo: types.VirtualDeviceURIBackingInfo{ + Direction: string(direction), + ServiceURI: uri, + }, + } + + return device +} + +// DisconnectSerialPort disconnects the serial port backing. +func (l VirtualDeviceList) DisconnectSerialPort(device *types.VirtualSerialPort) *types.VirtualSerialPort { + l.setDefaultSerialPortBacking(device) + return device +} + +func (l VirtualDeviceList) setDefaultSerialPortBacking(device *types.VirtualSerialPort) { + device.Backing = &types.VirtualSerialPortURIBackingInfo{ + VirtualDeviceURIBackingInfo: types.VirtualDeviceURIBackingInfo{ + Direction: "client", + ServiceURI: "localhost:0", + }, + } +} + +// CreateEthernetCard creates a new VirtualEthernetCard of the given name name and initialized with the given backing. +func (l VirtualDeviceList) CreateEthernetCard(name string, backing types.BaseVirtualDeviceBackingInfo) (types.BaseVirtualDevice, error) { + ctypes := EthernetCardTypes() + + if name == "" { + name = ctypes.deviceName(ctypes[0]) + } + + found := ctypes.Select(func(device types.BaseVirtualDevice) bool { + return l.deviceName(device) == name + }) + + if len(found) == 0 { + return nil, fmt.Errorf("unknown ethernet card type '%s'", name) + } + + c, ok := found[0].(types.BaseVirtualEthernetCard) + if !ok { + return nil, fmt.Errorf("invalid ethernet card type '%s'", name) + } + + c.GetVirtualEthernetCard().Backing = backing + + return c.(types.BaseVirtualDevice), nil +} + +// PrimaryMacAddress returns the MacAddress field of the primary VirtualEthernetCard +func (l VirtualDeviceList) PrimaryMacAddress() string { + eth0 := l.Find("ethernet-0") + + if eth0 == nil { + return "" + } + + return eth0.(types.BaseVirtualEthernetCard).GetVirtualEthernetCard().MacAddress +} + +// convert a BaseVirtualDevice to a BaseVirtualMachineBootOptionsBootableDevice +var bootableDevices = map[string]func(device types.BaseVirtualDevice) types.BaseVirtualMachineBootOptionsBootableDevice{ + DeviceTypeCdrom: func(types.BaseVirtualDevice) types.BaseVirtualMachineBootOptionsBootableDevice { + return &types.VirtualMachineBootOptionsBootableCdromDevice{} + }, + DeviceTypeDisk: func(d types.BaseVirtualDevice) types.BaseVirtualMachineBootOptionsBootableDevice { + return &types.VirtualMachineBootOptionsBootableDiskDevice{ + DeviceKey: d.GetVirtualDevice().Key, + } + }, + DeviceTypeEthernet: func(d types.BaseVirtualDevice) types.BaseVirtualMachineBootOptionsBootableDevice { + return &types.VirtualMachineBootOptionsBootableEthernetDevice{ + DeviceKey: d.GetVirtualDevice().Key, + } + }, + DeviceTypeFloppy: func(types.BaseVirtualDevice) types.BaseVirtualMachineBootOptionsBootableDevice { + return &types.VirtualMachineBootOptionsBootableFloppyDevice{} + }, +} + +// BootOrder returns a list of devices which can be used to set boot order via VirtualMachine.SetBootOptions. +// The order can any of "ethernet", "cdrom", "floppy" or "disk" or by specific device name. +func (l VirtualDeviceList) BootOrder(order []string) []types.BaseVirtualMachineBootOptionsBootableDevice { + var devices []types.BaseVirtualMachineBootOptionsBootableDevice + + for _, name := range order { + if kind, ok := bootableDevices[name]; ok { + for _, device := range l { + if l.Type(device) == name { + devices = append(devices, kind(device)) + } + + } + continue + } + + if d := l.Find(name); d != nil { + if kind, ok := bootableDevices[l.Type(d)]; ok { + devices = append(devices, kind(d)) + } + } + } + + return devices +} + +// SelectBootOrder returns an ordered list of devices matching the given bootable device order +func (l VirtualDeviceList) SelectBootOrder(order []types.BaseVirtualMachineBootOptionsBootableDevice) VirtualDeviceList { + var devices VirtualDeviceList + + for _, bd := range order { + for _, device := range l { + if kind, ok := bootableDevices[l.Type(device)]; ok { + if reflect.DeepEqual(kind(device), bd) { + devices = append(devices, device) + } + } + } + } + + return devices +} + +// TypeName returns the vmodl type name of the device +func (l VirtualDeviceList) TypeName(device types.BaseVirtualDevice) string { + return reflect.TypeOf(device).Elem().Name() +} + +var deviceNameRegexp = regexp.MustCompile(`(?:Virtual)?(?:Machine)?(\w+?)(?:Card|Device|Controller)?$`) + +func (l VirtualDeviceList) deviceName(device types.BaseVirtualDevice) string { + name := "device" + typeName := l.TypeName(device) + + m := deviceNameRegexp.FindStringSubmatch(typeName) + if len(m) == 2 { + name = strings.ToLower(m[1]) + } + + return name +} + +// Type returns a human-readable name for the given device +func (l VirtualDeviceList) Type(device types.BaseVirtualDevice) string { + switch device.(type) { + case types.BaseVirtualEthernetCard: + return DeviceTypeEthernet + case *types.ParaVirtualSCSIController: + return "pvscsi" + case *types.VirtualLsiLogicSASController: + return "lsilogic-sas" + default: + return l.deviceName(device) + } +} + +// Name returns a stable, human-readable name for the given device +func (l VirtualDeviceList) Name(device types.BaseVirtualDevice) string { + var key string + var UnitNumber int32 + d := device.GetVirtualDevice() + if d.UnitNumber != nil { + UnitNumber = *d.UnitNumber + } + + dtype := l.Type(device) + switch dtype { + case DeviceTypeEthernet: + key = fmt.Sprintf("%d", UnitNumber-7) + case DeviceTypeDisk: + key = fmt.Sprintf("%d-%d", d.ControllerKey, UnitNumber) + default: + key = fmt.Sprintf("%d", d.Key) + } + + return fmt.Sprintf("%s-%s", dtype, key) +} + +// ConfigSpec creates a virtual machine configuration spec for +// the specified operation, for the list of devices in the device list. +func (l VirtualDeviceList) ConfigSpec(op types.VirtualDeviceConfigSpecOperation) ([]types.BaseVirtualDeviceConfigSpec, error) { + var fop types.VirtualDeviceConfigSpecFileOperation + switch op { + case types.VirtualDeviceConfigSpecOperationAdd: + fop = types.VirtualDeviceConfigSpecFileOperationCreate + case types.VirtualDeviceConfigSpecOperationEdit: + fop = types.VirtualDeviceConfigSpecFileOperationReplace + case types.VirtualDeviceConfigSpecOperationRemove: + fop = types.VirtualDeviceConfigSpecFileOperationDestroy + default: + panic("unknown op") + } + + var res []types.BaseVirtualDeviceConfigSpec + for _, device := range l { + config := &types.VirtualDeviceConfigSpec{ + Device: device, + Operation: op, + } + + if disk, ok := device.(*types.VirtualDisk); ok { + config.FileOperation = fop + + // Special case to attach an existing disk + if op == types.VirtualDeviceConfigSpecOperationAdd && disk.CapacityInKB == 0 { + childDisk := false + if b, ok := disk.Backing.(*types.VirtualDiskFlatVer2BackingInfo); ok { + childDisk = b.Parent != nil + } + + if !childDisk { + // Existing disk, clear file operation + config.FileOperation = "" + } + } + } + + res = append(res, config) + } + + return res, nil +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/object/virtual_device_list_test.go juju-core-2.0.2/src/github.com/vmware/govmomi/object/virtual_device_list_test.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/object/virtual_device_list_test.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/object/virtual_device_list_test.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,853 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package object + +import ( + "math/rand" + "reflect" + "testing" + + "github.com/vmware/govmomi/vim25/types" +) + +func intPtrValue(val int32) *int32 { + return &val +} + +var devices = VirtualDeviceList([]types.BaseVirtualDevice{ + &types.VirtualIDEController{ + VirtualController: types.VirtualController{ + VirtualDevice: types.VirtualDevice{ + DynamicData: types.DynamicData{}, + Key: 200, + DeviceInfo: &types.Description{ + DynamicData: types.DynamicData{}, + Label: "IDE 0", + Summary: "IDE 0", + }, + Backing: nil, + Connectable: (*types.VirtualDeviceConnectInfo)(nil), + SlotInfo: nil, + ControllerKey: 0, + UnitNumber: intPtrValue(0), + }, + BusNumber: 0, + Device: []int32{3001, 3000}, + }, + }, + &types.VirtualIDEController{ + VirtualController: types.VirtualController{ + VirtualDevice: types.VirtualDevice{ + DynamicData: types.DynamicData{}, + Key: 201, + DeviceInfo: &types.Description{ + DynamicData: types.DynamicData{}, + Label: "IDE 1", + Summary: "IDE 1", + }, + Backing: nil, + Connectable: (*types.VirtualDeviceConnectInfo)(nil), + SlotInfo: nil, + ControllerKey: 0, + UnitNumber: intPtrValue(0), + }, + BusNumber: 1, + Device: []int32{3002}, + }, + }, + &types.VirtualPS2Controller{ + VirtualController: types.VirtualController{ + VirtualDevice: types.VirtualDevice{ + DynamicData: types.DynamicData{}, + Key: 300, + DeviceInfo: &types.Description{ + DynamicData: types.DynamicData{}, + Label: "PS2 controller 0", + Summary: "PS2 controller 0", + }, + Backing: nil, + Connectable: (*types.VirtualDeviceConnectInfo)(nil), + SlotInfo: nil, + ControllerKey: 0, + UnitNumber: intPtrValue(0), + }, + BusNumber: 0, + Device: []int32{600, 700}, + }, + }, + &types.VirtualPCIController{ + VirtualController: types.VirtualController{ + VirtualDevice: types.VirtualDevice{ + DynamicData: types.DynamicData{}, + Key: 100, + DeviceInfo: &types.Description{ + DynamicData: types.DynamicData{}, + Label: "PCI controller 0", + Summary: "PCI controller 0", + }, + Backing: nil, + Connectable: (*types.VirtualDeviceConnectInfo)(nil), + SlotInfo: nil, + ControllerKey: 0, + UnitNumber: intPtrValue(0), + }, + BusNumber: 0, + Device: []int32{500, 12000, 1000, 4000}, + }, + }, + &types.VirtualSIOController{ + VirtualController: types.VirtualController{ + VirtualDevice: types.VirtualDevice{ + DynamicData: types.DynamicData{}, + Key: 400, + DeviceInfo: &types.Description{ + DynamicData: types.DynamicData{}, + Label: "SIO controller 0", + Summary: "SIO controller 0", + }, + Backing: nil, + Connectable: (*types.VirtualDeviceConnectInfo)(nil), + SlotInfo: nil, + ControllerKey: 0, + UnitNumber: intPtrValue(0), + }, + BusNumber: 0, + Device: []int32{9000}, + }, + }, + &types.VirtualKeyboard{ + VirtualDevice: types.VirtualDevice{ + DynamicData: types.DynamicData{}, + Key: 600, + DeviceInfo: &types.Description{ + DynamicData: types.DynamicData{}, + Label: "Keyboard ", + Summary: "Keyboard", + }, + Backing: nil, + Connectable: (*types.VirtualDeviceConnectInfo)(nil), + SlotInfo: nil, + ControllerKey: 300, + UnitNumber: intPtrValue(0), + }, + }, + &types.VirtualPointingDevice{ + VirtualDevice: types.VirtualDevice{ + DynamicData: types.DynamicData{}, + Key: 700, + DeviceInfo: &types.Description{ + DynamicData: types.DynamicData{}, + Label: "Pointing device", + Summary: "Pointing device; Device", + }, + Backing: &types.VirtualPointingDeviceDeviceBackingInfo{ + VirtualDeviceDeviceBackingInfo: types.VirtualDeviceDeviceBackingInfo{}, + HostPointingDevice: "autodetect", + }, + Connectable: (*types.VirtualDeviceConnectInfo)(nil), + SlotInfo: nil, + ControllerKey: 300, + UnitNumber: intPtrValue(1), + }, + }, + &types.VirtualMachineVideoCard{ + VirtualDevice: types.VirtualDevice{ + DynamicData: types.DynamicData{}, + Key: 500, + DeviceInfo: &types.Description{ + DynamicData: types.DynamicData{}, + Label: "Video card ", + Summary: "Video card", + }, + Backing: nil, + Connectable: (*types.VirtualDeviceConnectInfo)(nil), + SlotInfo: nil, + ControllerKey: 100, + UnitNumber: intPtrValue(0), + }, + VideoRamSizeInKB: 4096, + NumDisplays: 1, + UseAutoDetect: types.NewBool(false), + Enable3DSupport: types.NewBool(false), + Use3dRenderer: "automatic", + }, + &types.VirtualMachineVMCIDevice{ + VirtualDevice: types.VirtualDevice{ + DynamicData: types.DynamicData{}, + Key: 12000, + DeviceInfo: &types.Description{ + DynamicData: types.DynamicData{}, + Label: "VMCI device", + Summary: "Device on the virtual machine PCI bus that provides support for the virtual machine communication interface", + }, + Backing: nil, + Connectable: (*types.VirtualDeviceConnectInfo)(nil), + SlotInfo: &types.VirtualDevicePciBusSlotInfo{ + VirtualDeviceBusSlotInfo: types.VirtualDeviceBusSlotInfo{}, + PciSlotNumber: 33, + }, + ControllerKey: 100, + UnitNumber: intPtrValue(17), + }, + Id: 1754519335, + AllowUnrestrictedCommunication: types.NewBool(false), + }, + &types.VirtualLsiLogicController{ + VirtualSCSIController: types.VirtualSCSIController{ + VirtualController: types.VirtualController{ + VirtualDevice: types.VirtualDevice{ + DynamicData: types.DynamicData{}, + Key: 1000, + DeviceInfo: &types.Description{ + DynamicData: types.DynamicData{}, + Label: "SCSI controller 0", + Summary: "LSI Logic", + }, + Backing: nil, + Connectable: (*types.VirtualDeviceConnectInfo)(nil), + SlotInfo: nil, + ControllerKey: 100, + UnitNumber: intPtrValue(3), + }, + BusNumber: 0, + Device: nil, + }, + HotAddRemove: types.NewBool(true), + SharedBus: "noSharing", + ScsiCtlrUnitNumber: 7, + }, + }, + &types.VirtualCdrom{ + VirtualDevice: types.VirtualDevice{ + DynamicData: types.DynamicData{}, + Key: 3001, + DeviceInfo: &types.Description{ + DynamicData: types.DynamicData{}, + Label: "CD/DVD drive 1", + Summary: "ISO [datastore1] ttylinux-pc_i486-16.1.iso", + }, + Backing: &types.VirtualCdromIsoBackingInfo{ + VirtualDeviceFileBackingInfo: types.VirtualDeviceFileBackingInfo{ + VirtualDeviceBackingInfo: types.VirtualDeviceBackingInfo{}, + FileName: "[datastore1] foo.iso", + Datastore: &types.ManagedObjectReference{Type: "Datastore", Value: "53fe43cc-75dc5110-3643-000c2918dc41"}, + BackingObjectId: "", + }, + }, + Connectable: &types.VirtualDeviceConnectInfo{ + DynamicData: types.DynamicData{}, + StartConnected: true, + AllowGuestControl: true, + Connected: false, + Status: "untried", + }, + SlotInfo: nil, + ControllerKey: 200, + UnitNumber: intPtrValue(1), + }, + }, + &types.VirtualDisk{ + VirtualDevice: types.VirtualDevice{ + DynamicData: types.DynamicData{}, + Key: 3000, + DeviceInfo: &types.Description{ + DynamicData: types.DynamicData{}, + Label: "Hard disk 1", + Summary: "30,720 KB", + }, + Backing: &types.VirtualDiskFlatVer2BackingInfo{ + VirtualDeviceFileBackingInfo: types.VirtualDeviceFileBackingInfo{ + VirtualDeviceBackingInfo: types.VirtualDeviceBackingInfo{}, + FileName: "[datastore1] bar/bar.vmdk", + Datastore: &types.ManagedObjectReference{Type: "Datastore", Value: "53fe43cc-75dc5110-3643-000c2918dc41"}, + BackingObjectId: "3-3000-0", + }, + DiskMode: "persistent", + Split: types.NewBool(false), + WriteThrough: types.NewBool(false), + ThinProvisioned: types.NewBool(false), + EagerlyScrub: types.NewBool(true), + Uuid: "6000C296-d0af-1209-1975-10c98eae10e4", + ContentId: "d46395062e2d1b1790985bdec573b211", + ChangeId: "", + Parent: &types.VirtualDiskFlatVer2BackingInfo{ + VirtualDeviceFileBackingInfo: types.VirtualDeviceFileBackingInfo{ + VirtualDeviceBackingInfo: types.VirtualDeviceBackingInfo{}, + FileName: "[datastore1] ttylinux.vmdk", + Datastore: &types.ManagedObjectReference{Type: "Datastore", Value: "53fe43cc-75dc5110-3643-000c2918dc41"}, + BackingObjectId: "3-3000-1", + }, + DiskMode: "persistent", + Split: types.NewBool(false), + WriteThrough: types.NewBool(false), + ThinProvisioned: types.NewBool(false), + EagerlyScrub: types.NewBool(true), + Uuid: "6000C296-d0af-1209-1975-10c98eae10e4", + ContentId: "1c2dad9e1662219e962a620c6d238a7c", + ChangeId: "", + Parent: (*types.VirtualDiskFlatVer2BackingInfo)(nil), + DeltaDiskFormat: "", + DigestEnabled: types.NewBool(false), + DeltaGrainSize: 0, + }, + DeltaDiskFormat: "redoLogFormat", + DigestEnabled: types.NewBool(false), + DeltaGrainSize: 0, + }, + Connectable: (*types.VirtualDeviceConnectInfo)(nil), + SlotInfo: nil, + ControllerKey: 200, + UnitNumber: intPtrValue(0), + }, + CapacityInKB: 30720, + CapacityInBytes: 31457280, + Shares: &types.SharesInfo{ + DynamicData: types.DynamicData{}, + Shares: 1000, + Level: "normal", + }, + StorageIOAllocation: &types.StorageIOAllocationInfo{ + DynamicData: types.DynamicData{}, + Limit: -1, + Shares: &types.SharesInfo{ + DynamicData: types.DynamicData{}, + Shares: 1000, + Level: "normal", + }, + Reservation: 0, + }, + DiskObjectId: "3-3000", + VFlashCacheConfigInfo: (*types.VirtualDiskVFlashCacheConfigInfo)(nil), + }, + &types.VirtualDisk{ + VirtualDevice: types.VirtualDevice{ + DynamicData: types.DynamicData{}, + Key: 3002, + DeviceInfo: &types.Description{ + DynamicData: types.DynamicData{}, + Label: "Hard disk 2", + Summary: "10,000,000 KB", + }, + Backing: &types.VirtualDiskFlatVer2BackingInfo{ + VirtualDeviceFileBackingInfo: types.VirtualDeviceFileBackingInfo{ + VirtualDeviceBackingInfo: types.VirtualDeviceBackingInfo{}, + FileName: "[datastore1] bar/disk-201-0.vmdk", + Datastore: &types.ManagedObjectReference{Type: "Datastore", Value: "53fe43cc-75dc5110-3643-000c2918dc41"}, + BackingObjectId: "3-3002-0", + }, + DiskMode: "persistent", + Split: types.NewBool(false), + WriteThrough: types.NewBool(false), + ThinProvisioned: types.NewBool(true), + EagerlyScrub: types.NewBool(false), + Uuid: "6000C293-fde5-4457-5118-dd267ea992a7", + ContentId: "90399989b9d520eed6793ab0fffffffe", + ChangeId: "", + Parent: (*types.VirtualDiskFlatVer2BackingInfo)(nil), + DeltaDiskFormat: "", + DigestEnabled: types.NewBool(false), + DeltaGrainSize: 0, + }, + Connectable: (*types.VirtualDeviceConnectInfo)(nil), + SlotInfo: nil, + ControllerKey: 201, + UnitNumber: intPtrValue(0), + }, + CapacityInKB: 10000000, + CapacityInBytes: 10240000000, + Shares: &types.SharesInfo{ + DynamicData: types.DynamicData{}, + Shares: 1000, + Level: "normal", + }, + StorageIOAllocation: &types.StorageIOAllocationInfo{ + DynamicData: types.DynamicData{}, + Limit: -1, + Shares: &types.SharesInfo{ + DynamicData: types.DynamicData{}, + Shares: 1000, + Level: "normal", + }, + Reservation: 0, + }, + DiskObjectId: "3-3002", + VFlashCacheConfigInfo: (*types.VirtualDiskVFlashCacheConfigInfo)(nil), + }, + &types.VirtualE1000{ + VirtualEthernetCard: types.VirtualEthernetCard{ + VirtualDevice: types.VirtualDevice{ + DynamicData: types.DynamicData{}, + Key: 4000, + DeviceInfo: &types.Description{ + DynamicData: types.DynamicData{}, + Label: "Network adapter 1", + Summary: "VM Network", + }, + Backing: &types.VirtualEthernetCardNetworkBackingInfo{ + VirtualDeviceDeviceBackingInfo: types.VirtualDeviceDeviceBackingInfo{ + VirtualDeviceBackingInfo: types.VirtualDeviceBackingInfo{}, + DeviceName: "VM Network", + UseAutoDetect: types.NewBool(false), + }, + Network: &types.ManagedObjectReference{Type: "Network", Value: "HaNetwork-VM Network"}, + InPassthroughMode: types.NewBool(false), + }, + Connectable: &types.VirtualDeviceConnectInfo{ + DynamicData: types.DynamicData{}, + StartConnected: true, + AllowGuestControl: true, + Connected: false, + Status: "untried", + }, + SlotInfo: &types.VirtualDevicePciBusSlotInfo{ + VirtualDeviceBusSlotInfo: types.VirtualDeviceBusSlotInfo{}, + PciSlotNumber: 32, + }, + ControllerKey: 100, + UnitNumber: intPtrValue(7), + }, + AddressType: "generated", + MacAddress: "00:0c:29:93:d7:27", + WakeOnLanEnabled: types.NewBool(true), + }, + }, + &types.VirtualSerialPort{ + VirtualDevice: types.VirtualDevice{ + DynamicData: types.DynamicData{}, + Key: 9000, + DeviceInfo: &types.Description{ + DynamicData: types.DynamicData{}, + Label: "Serial port 1", + Summary: "Remote localhost:0", + }, + Backing: &types.VirtualSerialPortURIBackingInfo{ + VirtualDeviceURIBackingInfo: types.VirtualDeviceURIBackingInfo{ + VirtualDeviceBackingInfo: types.VirtualDeviceBackingInfo{}, + ServiceURI: "localhost:0", + Direction: "client", + ProxyURI: "", + }, + }, + Connectable: &types.VirtualDeviceConnectInfo{ + DynamicData: types.DynamicData{}, + StartConnected: true, + AllowGuestControl: true, + Connected: false, + Status: "untried", + }, + SlotInfo: nil, + ControllerKey: 400, + UnitNumber: intPtrValue(0), + }, + YieldOnPoll: true, + }, +}) + +func TestSelectByType(t *testing.T) { + tests := []struct { + dtype types.BaseVirtualDevice + expect int + }{ + { + (*types.VirtualCdrom)(nil), + 1, + }, + { + (*types.VirtualEthernetCard)(nil), + 1, + }, + { + (*types.VirtualDisk)(nil), + 2, + }, + { + (*types.VirtualController)(nil), + 6, + }, + { + (*types.VirtualIDEController)(nil), + 2, + }, + { + (*types.VirtualSCSIController)(nil), + 1, + }, + { + (*types.VirtualLsiLogicController)(nil), + 1, + }, + { + (*types.ParaVirtualSCSIController)(nil), + 0, + }, + } + + for _, test := range tests { + d := devices.SelectByType(test.dtype) + + if len(d) != test.expect { + t.Errorf("%#v has %d", test.dtype, len(devices)) + } + } +} + +func TestSelectByBackingInfo(t *testing.T) { + tests := []types.BaseVirtualDeviceBackingInfo{ + &types.VirtualEthernetCardNetworkBackingInfo{ + VirtualDeviceDeviceBackingInfo: types.VirtualDeviceDeviceBackingInfo{ + DeviceName: "VM Network", + }, + }, + &types.VirtualDiskFlatVer2BackingInfo{ + VirtualDeviceFileBackingInfo: types.VirtualDeviceFileBackingInfo{ + FileName: "[datastore1] bar/bar.vmdk", + }, + }, + &types.VirtualDiskFlatVer2BackingInfo{ + Parent: &types.VirtualDiskFlatVer2BackingInfo{ + VirtualDeviceFileBackingInfo: types.VirtualDeviceFileBackingInfo{ + FileName: "[datastore1] ttylinux.vmdk", + }, + }, + }, + &types.VirtualCdromIsoBackingInfo{ + VirtualDeviceFileBackingInfo: types.VirtualDeviceFileBackingInfo{ + VirtualDeviceBackingInfo: types.VirtualDeviceBackingInfo{}, + FileName: "[datastore1] foo.iso", + }, + }, + (*types.VirtualCdromIsoBackingInfo)(nil), + &types.VirtualSerialPortURIBackingInfo{ + VirtualDeviceURIBackingInfo: types.VirtualDeviceURIBackingInfo{ + VirtualDeviceBackingInfo: types.VirtualDeviceBackingInfo{}, + ServiceURI: "localhost:0", + Direction: "client", + ProxyURI: "", + }, + }, + (*types.VirtualSerialPortURIBackingInfo)(nil), + } + + for _, test := range tests { + l := devices.SelectByBackingInfo(test) + + if len(l) != 1 { + t.Errorf("Expected 1, got %d: %#v", len(l), test) + } + } + + // test selecting by backing type + tests = []types.BaseVirtualDeviceBackingInfo{ + (*types.VirtualDiskFlatVer2BackingInfo)(nil), + } + + for _, test := range tests { + l := devices.SelectByBackingInfo(test) + + if len(l) != 2 { + t.Errorf("Expected 2, got %d: %#v", len(l), test) + } + } +} + +func TestFind(t *testing.T) { + for _, device := range devices { + name := devices.Name(device) + d := devices.Find(name) + if name != devices.Name(d) { + t.Errorf("expected name: %s, got: %s", name, devices.Name(d)) + } + } + + d := devices.Find("enoent") + if d != nil { + t.Errorf("unexpected: %#v", d) + } +} + +func TestFindController(t *testing.T) { + for _, name := range []string{"", "ide-200"} { + _, err := devices.FindIDEController(name) + if err != nil { + t.Error(err) + } + } + + for _, name := range []string{"", "lsilogic-1000"} { + _, err := devices.FindSCSIController(name) + if err != nil { + t.Error(err) + } + } + + fns := []func() error{ + func() error { + _, err := devices.FindIDEController("lsilogic-1000") + return err + }, + func() error { + _, err := devices.FindSCSIController("ide-200") + return err + }, + } + + for _, f := range fns { + err := f() + if err == nil { + t.Error("should fail") + } + } +} + +func TestPickController(t *testing.T) { + list := devices + + tests := []struct { + ctype types.BaseVirtualController + key int32 + unit int32 + }{ + { + (*types.VirtualIDEController)(nil), 201, 1, + }, + { + (*types.VirtualSCSIController)(nil), 1000, 0, + }, + { + (*types.VirtualSCSIController)(nil), 1000, 1, + }, + } + + for _, test := range tests { + c := list.PickController(test.ctype).GetVirtualController() + + key := c.Key + if key != test.key { + t.Errorf("expected controller key: %d, got: %d\n", test.key, key) + } + + unit := list.newUnitNumber(c) + if unit != test.unit { + t.Errorf("expected unit number: %d, got: %d\n", test.unit, unit) + } + + dev := &types.VirtualDevice{ + Key: int32(rand.Int()), + UnitNumber: new(int32), + ControllerKey: key, + } + *dev.UnitNumber = unit + + list = append(list, dev) + c.Device = append(c.Device, dev.Key) + } + + if list.PickController((*types.VirtualIDEController)(nil)) != nil { + t.Error("should be nil") + } + + if list.PickController((*types.VirtualSCSIController)(nil)) == nil { + t.Errorf("should not be nil") + } +} + +func TestCreateSCSIController(t *testing.T) { + for _, l := range []VirtualDeviceList{SCSIControllerTypes(), devices} { + _, err := l.CreateSCSIController("enoent") + if err == nil { + t.Error("should fail") + } + + for _, name := range []string{"", "scsi", "pvscsi", "buslogic", "lsilogic", "lsilogic-sas"} { + _, err = l.CreateSCSIController(name) + if err != nil { + t.Error(err) + } + } + } +} + +func TestCreateEthernetCard(t *testing.T) { + _, err := EthernetCardTypes().CreateEthernetCard("enoent", nil) + if err == nil { + t.Error("should fail") + } + + for _, name := range []string{"", "e1000", "e1000e", "vmxnet3"} { + _, err := EthernetCardTypes().CreateEthernetCard(name, nil) + if err != nil { + t.Error(err) + } + } +} + +func TestCdrom(t *testing.T) { + c, err := devices.FindCdrom("") + if err != nil { + t.Error(err) + } + + d := devices.Find(devices.Name(c)) + + if c.Key != d.GetVirtualDevice().Key { + t.Error("device key mismatch") + } + + for _, name := range []string{"enoent", "ide-200"} { + c, err = devices.FindCdrom(name) + if err == nil { + t.Errorf("FindCdrom(%s) should fail", name) + } + } + + c, err = devices.Select(func(device types.BaseVirtualDevice) bool { + if _, ok := device.(*types.VirtualCdrom); ok { + return false + } + return true + }).FindCdrom("") + + if err == nil { + t.Error("FindCdrom('') should fail") + } +} + +func TestSerialPort(t *testing.T) { + device, err := devices.CreateSerialPort() + if err != nil { + t.Error(err) + } + devices.ConnectSerialPort(device, "telnet://:33233", false) +} + +func TestPrimaryMacAddress(t *testing.T) { + expect := "00:0c:29:93:d7:27" + mac := devices.PrimaryMacAddress() + if expect != mac { + t.Errorf("expected: %s, got: %s", expect, mac) + } +} + +func TestBootOrder(t *testing.T) { + o := []string{DeviceTypeEthernet, DeviceTypeCdrom, DeviceTypeFloppy, DeviceTypeDisk} + list := devices + + n := 4 // 1 ethernet, 1 cdrom, 2 disk + order := list.BootOrder(o) + if len(order) != n { + t.Errorf("expected %d boot devices, got: %d", n, len(order)) + } + + list = list.SelectBootOrder(order) + if len(list) != n { + t.Errorf("expected %d boot devices, got: %d", n, len(list)) + } + + // test lookup by name + var names []string + for _, x := range list { + names = append(names, list.Name(x)) + } + + order = list.BootOrder(names) + if len(order) != n { + t.Errorf("expected %d boot devices, got: %d", n, len(order)) + } + + if !reflect.DeepEqual(list, list.SelectBootOrder(order)) { + t.Error("boot order mismatch") + } + + // remove disks + list = list.Select(func(device types.BaseVirtualDevice) bool { + if _, ok := device.(*types.VirtualDisk); ok { + return false + } + return true + }) + + n = 2 // 1 ethernet, 1 cdrom + order = list.BootOrder(o) + if len(order) != n { + t.Errorf("expected %d boot devices, got: %d", n, len(order)) + } + + if !reflect.DeepEqual(list, list.SelectBootOrder(order)) { + t.Error("boot order mismatch") + } + + if len(list.BootOrder([]string{DeviceTypeDisk})) != 0 { + t.Error("expected 0 disks") + } +} + +func TestName(t *testing.T) { + tests := []struct { + device types.BaseVirtualDevice + expect string + }{ + { + &types.VirtualCdrom{}, + "cdrom-0", + }, + { + &types.VirtualDisk{}, + "disk-0-0", + }, + { + &types.VirtualFloppy{}, + "floppy-0", + }, + { + &types.VirtualIDEController{}, + "ide-0", + }, + { + &types.VirtualMachineVideoCard{}, + "video-0", + }, + { + &types.VirtualPointingDevice{}, + "pointing-0", + }, + { + &types.ParaVirtualSCSIController{}, + "pvscsi-0", + }, + { + &types.VirtualSerialPort{}, + "serialport-0", + }, + { + &types.VirtualE1000{ + VirtualEthernetCard: types.VirtualEthernetCard{ + VirtualDevice: types.VirtualDevice{ + UnitNumber: intPtrValue(7), + }, + }, + }, + "ethernet-0", + }, + } + + for _, test := range tests { + name := devices.Name(test.device) + if name != test.expect { + t.Errorf("expected: %s, got: %s", test.expect, name) + } + } +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/object/virtual_disk_manager.go juju-core-2.0.2/src/github.com/vmware/govmomi/object/virtual_disk_manager.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/object/virtual_disk_manager.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/object/virtual_disk_manager.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,145 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package object + +import ( + "github.com/vmware/govmomi/vim25" + "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/types" + "golang.org/x/net/context" +) + +type VirtualDiskManager struct { + Common +} + +func NewVirtualDiskManager(c *vim25.Client) *VirtualDiskManager { + m := VirtualDiskManager{ + Common: NewCommon(c, *c.ServiceContent.VirtualDiskManager), + } + + return &m +} + +// CopyVirtualDisk copies a virtual disk, performing conversions as specified in the spec. +func (m VirtualDiskManager) CopyVirtualDisk( + ctx context.Context, + sourceName string, sourceDatacenter *Datacenter, + destName string, destDatacenter *Datacenter, + destSpec *types.VirtualDiskSpec, force bool) (*Task, error) { + + req := types.CopyVirtualDisk_Task{ + This: m.Reference(), + SourceName: sourceName, + DestName: destName, + DestSpec: destSpec, + Force: types.NewBool(force), + } + + if sourceDatacenter != nil { + ref := sourceDatacenter.Reference() + req.SourceDatacenter = &ref + } + + if destDatacenter != nil { + ref := destDatacenter.Reference() + req.DestDatacenter = &ref + } + + res, err := methods.CopyVirtualDisk_Task(ctx, m.c, &req) + if err != nil { + return nil, err + } + + return NewTask(m.c, res.Returnval), nil +} + +// CreateVirtualDisk creates a new virtual disk. +func (m VirtualDiskManager) CreateVirtualDisk( + ctx context.Context, + name string, datacenter *Datacenter, + spec types.BaseVirtualDiskSpec) (*Task, error) { + + req := types.CreateVirtualDisk_Task{ + This: m.Reference(), + Name: name, + Spec: spec, + } + + if datacenter != nil { + ref := datacenter.Reference() + req.Datacenter = &ref + } + + res, err := methods.CreateVirtualDisk_Task(ctx, m.c, &req) + if err != nil { + return nil, err + } + + return NewTask(m.c, res.Returnval), nil +} + +// MoveVirtualDisk moves a virtual disk. +func (m VirtualDiskManager) MoveVirtualDisk( + ctx context.Context, + sourceName string, sourceDatacenter *Datacenter, + destName string, destDatacenter *Datacenter, + force bool) (*Task, error) { + req := types.MoveVirtualDisk_Task{ + This: m.Reference(), + SourceName: sourceName, + DestName: destName, + Force: types.NewBool(force), + } + + if sourceDatacenter != nil { + ref := sourceDatacenter.Reference() + req.SourceDatacenter = &ref + } + + if destDatacenter != nil { + ref := destDatacenter.Reference() + req.DestDatacenter = &ref + } + + res, err := methods.MoveVirtualDisk_Task(ctx, m.c, &req) + if err != nil { + return nil, err + } + + return NewTask(m.c, res.Returnval), nil +} + +// DeleteVirtualDisk deletes a virtual disk. +func (m VirtualDiskManager) DeleteVirtualDisk(ctx context.Context, name string, dc *Datacenter) (*Task, error) { + req := types.DeleteVirtualDisk_Task{ + This: m.Reference(), + Name: name, + } + + if dc != nil { + ref := dc.Reference() + req.Datacenter = &ref + } + + res, err := methods.DeleteVirtualDisk_Task(ctx, m.c, &req) + if err != nil { + return nil, err + } + + return NewTask(m.c, res.Returnval), nil +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/object/virtual_machine.go juju-core-2.0.2/src/github.com/vmware/govmomi/object/virtual_machine.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/object/virtual_machine.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/object/virtual_machine.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,593 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package object + +import ( + "errors" + "net" + + "github.com/vmware/govmomi/property" + "github.com/vmware/govmomi/vim25" + "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/types" + "golang.org/x/net/context" +) + +const ( + PropRuntimePowerState = "summary.runtime.powerState" +) + +type VirtualMachine struct { + Common +} + +func NewVirtualMachine(c *vim25.Client, ref types.ManagedObjectReference) *VirtualMachine { + return &VirtualMachine{ + Common: NewCommon(c, ref), + } +} + +func (v VirtualMachine) PowerState(ctx context.Context) (types.VirtualMachinePowerState, error) { + var o mo.VirtualMachine + + err := v.Properties(ctx, v.Reference(), []string{PropRuntimePowerState}, &o) + if err != nil { + return "", err + } + + return o.Summary.Runtime.PowerState, nil +} + +func (v VirtualMachine) PowerOn(ctx context.Context) (*Task, error) { + req := types.PowerOnVM_Task{ + This: v.Reference(), + } + + res, err := methods.PowerOnVM_Task(ctx, v.c, &req) + if err != nil { + return nil, err + } + + return NewTask(v.c, res.Returnval), nil +} + +func (v VirtualMachine) PowerOff(ctx context.Context) (*Task, error) { + req := types.PowerOffVM_Task{ + This: v.Reference(), + } + + res, err := methods.PowerOffVM_Task(ctx, v.c, &req) + if err != nil { + return nil, err + } + + return NewTask(v.c, res.Returnval), nil +} + +func (v VirtualMachine) Reset(ctx context.Context) (*Task, error) { + req := types.ResetVM_Task{ + This: v.Reference(), + } + + res, err := methods.ResetVM_Task(ctx, v.c, &req) + if err != nil { + return nil, err + } + + return NewTask(v.c, res.Returnval), nil +} + +func (v VirtualMachine) Suspend(ctx context.Context) (*Task, error) { + req := types.SuspendVM_Task{ + This: v.Reference(), + } + + res, err := methods.SuspendVM_Task(ctx, v.c, &req) + if err != nil { + return nil, err + } + + return NewTask(v.c, res.Returnval), nil +} + +func (v VirtualMachine) ShutdownGuest(ctx context.Context) error { + req := types.ShutdownGuest{ + This: v.Reference(), + } + + _, err := methods.ShutdownGuest(ctx, v.c, &req) + return err +} + +func (v VirtualMachine) RebootGuest(ctx context.Context) error { + req := types.RebootGuest{ + This: v.Reference(), + } + + _, err := methods.RebootGuest(ctx, v.c, &req) + return err +} + +func (v VirtualMachine) Destroy(ctx context.Context) (*Task, error) { + req := types.Destroy_Task{ + This: v.Reference(), + } + + res, err := methods.Destroy_Task(ctx, v.c, &req) + if err != nil { + return nil, err + } + + return NewTask(v.c, res.Returnval), nil +} + +func (v VirtualMachine) Clone(ctx context.Context, folder *Folder, name string, config types.VirtualMachineCloneSpec) (*Task, error) { + req := types.CloneVM_Task{ + This: v.Reference(), + Folder: folder.Reference(), + Name: name, + Spec: config, + } + + res, err := methods.CloneVM_Task(ctx, v.c, &req) + if err != nil { + return nil, err + } + + return NewTask(v.c, res.Returnval), nil +} + +func (v VirtualMachine) Customize(ctx context.Context, spec types.CustomizationSpec) (*Task, error) { + req := types.CustomizeVM_Task{ + This: v.Reference(), + Spec: spec, + } + + res, err := methods.CustomizeVM_Task(ctx, v.c, &req) + if err != nil { + return nil, err + } + + return NewTask(v.c, res.Returnval), nil +} + +func (v VirtualMachine) Relocate(ctx context.Context, config types.VirtualMachineRelocateSpec, priority types.VirtualMachineMovePriority) (*Task, error) { + req := types.RelocateVM_Task{ + This: v.Reference(), + Spec: config, + Priority: priority, + } + + res, err := methods.RelocateVM_Task(ctx, v.c, &req) + if err != nil { + return nil, err + } + + return NewTask(v.c, res.Returnval), nil +} + +func (v VirtualMachine) Reconfigure(ctx context.Context, config types.VirtualMachineConfigSpec) (*Task, error) { + req := types.ReconfigVM_Task{ + This: v.Reference(), + Spec: config, + } + + res, err := methods.ReconfigVM_Task(ctx, v.c, &req) + if err != nil { + return nil, err + } + + return NewTask(v.c, res.Returnval), nil +} + +func (v VirtualMachine) WaitForIP(ctx context.Context) (string, error) { + var ip string + + p := property.DefaultCollector(v.c) + err := property.Wait(ctx, p, v.Reference(), []string{"guest.ipAddress"}, func(pc []types.PropertyChange) bool { + for _, c := range pc { + if c.Name != "guest.ipAddress" { + continue + } + if c.Op != types.PropertyChangeOpAssign { + continue + } + if c.Val == nil { + continue + } + + ip = c.Val.(string) + return true + } + + return false + }) + + if err != nil { + return "", err + } + + return ip, nil +} + +// WaitForNetIP waits for the VM guest.net property to report an IP address for all VM NICs. +// Only consider IPv4 addresses if the v4 param is true. +// Returns a map with MAC address as the key and IP address list as the value. +func (v VirtualMachine) WaitForNetIP(ctx context.Context, v4 bool) (map[string][]string, error) { + macs := make(map[string][]string) + + p := property.DefaultCollector(v.c) + + // Wait for all NICs to have a MacAddress, which may not be generated yet. + err := property.Wait(ctx, p, v.Reference(), []string{"config.hardware.device"}, func(pc []types.PropertyChange) bool { + for _, c := range pc { + if c.Op != types.PropertyChangeOpAssign { + continue + } + + devices := c.Val.(types.ArrayOfVirtualDevice).VirtualDevice + for _, device := range devices { + if nic, ok := device.(types.BaseVirtualEthernetCard); ok { + mac := nic.GetVirtualEthernetCard().MacAddress + if mac == "" { + return false + } + macs[mac] = nil + } + } + } + + return true + }) + + err = property.Wait(ctx, p, v.Reference(), []string{"guest.net"}, func(pc []types.PropertyChange) bool { + for _, c := range pc { + if c.Op != types.PropertyChangeOpAssign { + continue + } + + nics := c.Val.(types.ArrayOfGuestNicInfo).GuestNicInfo + for _, nic := range nics { + mac := nic.MacAddress + if mac == "" || nic.IpConfig == nil { + continue + } + + for _, ip := range nic.IpConfig.IpAddress { + if _, ok := macs[mac]; !ok { + continue // Ignore any that don't correspond to a VM device + } + if v4 && net.ParseIP(ip.IpAddress).To4() == nil { + continue // Ignore non IPv4 address + } + macs[mac] = append(macs[mac], ip.IpAddress) + } + } + } + + for _, ips := range macs { + if len(ips) == 0 { + return false + } + } + + return true + }) + + if err != nil { + return nil, err + } + + return macs, nil +} + +// Device returns the VirtualMachine's config.hardware.device property. +func (v VirtualMachine) Device(ctx context.Context) (VirtualDeviceList, error) { + var o mo.VirtualMachine + + err := v.Properties(ctx, v.Reference(), []string{"config.hardware.device"}, &o) + if err != nil { + return nil, err + } + + return VirtualDeviceList(o.Config.Hardware.Device), nil +} + +func (v VirtualMachine) HostSystem(ctx context.Context) (*HostSystem, error) { + var o mo.VirtualMachine + + err := v.Properties(ctx, v.Reference(), []string{"summary"}, &o) + if err != nil { + return nil, err + } + + host := o.Summary.Runtime.Host + if host == nil { + return nil, errors.New("VM doesn't have a HostSystem") + } + + return NewHostSystem(v.c, *host), nil +} + +func (v VirtualMachine) ResourcePool(ctx context.Context) (*ResourcePool, error) { + var o mo.VirtualMachine + + err := v.Properties(ctx, v.Reference(), []string{"resourcePool"}, &o) + if err != nil { + return nil, err + } + + rp := o.ResourcePool + if rp == nil { + return nil, errors.New("VM doesn't have a resourcePool") + } + + return NewResourcePool(v.c, *rp), nil +} + +func (v VirtualMachine) configureDevice(ctx context.Context, op types.VirtualDeviceConfigSpecOperation, fop types.VirtualDeviceConfigSpecFileOperation, devices ...types.BaseVirtualDevice) error { + spec := types.VirtualMachineConfigSpec{} + + for _, device := range devices { + config := &types.VirtualDeviceConfigSpec{ + Device: device, + Operation: op, + } + + if disk, ok := device.(*types.VirtualDisk); ok { + config.FileOperation = fop + + // Special case to attach an existing disk + if op == types.VirtualDeviceConfigSpecOperationAdd && disk.CapacityInKB == 0 { + childDisk := false + if b, ok := disk.Backing.(*types.VirtualDiskFlatVer2BackingInfo); ok { + childDisk = b.Parent != nil + } + + if !childDisk { + config.FileOperation = "" // existing disk + } + } + } + + spec.DeviceChange = append(spec.DeviceChange, config) + } + + task, err := v.Reconfigure(ctx, spec) + if err != nil { + return err + } + + return task.Wait(ctx) +} + +// AddDevice adds the given devices to the VirtualMachine +func (v VirtualMachine) AddDevice(ctx context.Context, device ...types.BaseVirtualDevice) error { + return v.configureDevice(ctx, types.VirtualDeviceConfigSpecOperationAdd, types.VirtualDeviceConfigSpecFileOperationCreate, device...) +} + +// EditDevice edits the given (existing) devices on the VirtualMachine +func (v VirtualMachine) EditDevice(ctx context.Context, device ...types.BaseVirtualDevice) error { + return v.configureDevice(ctx, types.VirtualDeviceConfigSpecOperationEdit, types.VirtualDeviceConfigSpecFileOperationReplace, device...) +} + +// RemoveDevice removes the given devices on the VirtualMachine +func (v VirtualMachine) RemoveDevice(ctx context.Context, keepFiles bool, device ...types.BaseVirtualDevice) error { + fop := types.VirtualDeviceConfigSpecFileOperationDestroy + if keepFiles { + fop = "" + } + return v.configureDevice(ctx, types.VirtualDeviceConfigSpecOperationRemove, fop, device...) +} + +// BootOptions returns the VirtualMachine's config.bootOptions property. +func (v VirtualMachine) BootOptions(ctx context.Context) (*types.VirtualMachineBootOptions, error) { + var o mo.VirtualMachine + + err := v.Properties(ctx, v.Reference(), []string{"config.bootOptions"}, &o) + if err != nil { + return nil, err + } + + return o.Config.BootOptions, nil +} + +// SetBootOptions reconfigures the VirtualMachine with the given options. +func (v VirtualMachine) SetBootOptions(ctx context.Context, options *types.VirtualMachineBootOptions) error { + spec := types.VirtualMachineConfigSpec{} + + spec.BootOptions = options + + task, err := v.Reconfigure(ctx, spec) + if err != nil { + return err + } + + return task.Wait(ctx) +} + +// Answer answers a pending question. +func (v VirtualMachine) Answer(ctx context.Context, id, answer string) error { + req := types.AnswerVM{ + This: v.Reference(), + QuestionId: id, + AnswerChoice: answer, + } + + _, err := methods.AnswerVM(ctx, v.c, &req) + if err != nil { + return err + } + + return nil +} + +// CreateSnapshot creates a new snapshot of a virtual machine. +func (v VirtualMachine) CreateSnapshot(ctx context.Context, name string, description string, memory bool, quiesce bool) (*Task, error) { + req := types.CreateSnapshot_Task{ + This: v.Reference(), + Name: name, + Description: description, + Memory: memory, + Quiesce: quiesce, + } + + res, err := methods.CreateSnapshot_Task(ctx, v.c, &req) + if err != nil { + return nil, err + } + + return NewTask(v.c, res.Returnval), nil +} + +// RemoveAllSnapshot removes all snapshots of a virtual machine +func (v VirtualMachine) RemoveAllSnapshot(ctx context.Context, consolidate *bool) (*Task, error) { + req := types.RemoveAllSnapshots_Task{ + This: v.Reference(), + Consolidate: consolidate, + } + + res, err := methods.RemoveAllSnapshots_Task(ctx, v.c, &req) + if err != nil { + return nil, err + } + + return NewTask(v.c, res.Returnval), nil +} + +// RevertToSnapshot reverts to a named snapshot +func (v VirtualMachine) RevertToSnapshot(ctx context.Context, name string, suppressPowerOn bool) (*Task, error) { + var o mo.VirtualMachine + + err := v.Properties(ctx, v.Reference(), []string{"snapshot"}, &o) + + snapshotTree := o.Snapshot.RootSnapshotList + if len(snapshotTree) < 1 { + return nil, errors.New("No snapshots for this VM") + } + + snapshot, err := traverseSnapshotInTree(snapshotTree, name) + if err != nil { + return nil, err + } + + req := types.RevertToSnapshot_Task{ + This: snapshot, + SuppressPowerOn: types.NewBool(suppressPowerOn), + } + + res, err := methods.RevertToSnapshot_Task(ctx, v.c, &req) + if err != nil { + return nil, err + } + + return NewTask(v.c, res.Returnval), nil +} + +// traverseSnapshotInTree is a recursive function that will traverse a snapshot tree to find a given snapshot +func traverseSnapshotInTree(tree []types.VirtualMachineSnapshotTree, name string) (types.ManagedObjectReference, error) { + var o types.ManagedObjectReference + if tree == nil { + return o, errors.New("Snapshot tree is empty") + } + for _, s := range tree { + if s.Name == name { + o = s.Snapshot + break + } else { + childTree := s.ChildSnapshotList + var err error + o, err = traverseSnapshotInTree(childTree, name) + if err != nil { + return o, err + } + } + } + if o.Value == "" { + return o, errors.New("Snapshot not found") + } + + return o, nil +} + +// IsToolsRunning returns true if VMware Tools is currently running in the guest OS, and false otherwise. +func (v VirtualMachine) IsToolsRunning(ctx context.Context) (bool, error) { + var o mo.VirtualMachine + + err := v.Properties(ctx, v.Reference(), []string{"guest.toolsRunningStatus"}, &o) + if err != nil { + return false, err + } + + return o.Guest.ToolsRunningStatus == string(types.VirtualMachineToolsRunningStatusGuestToolsRunning), nil +} + +// Wait for the VirtualMachine to change to the desired power state. +func (v VirtualMachine) WaitForPowerState(ctx context.Context, state types.VirtualMachinePowerState) error { + p := property.DefaultCollector(v.c) + err := property.Wait(ctx, p, v.Reference(), []string{PropRuntimePowerState}, func(pc []types.PropertyChange) bool { + for _, c := range pc { + if c.Name != PropRuntimePowerState { + continue + } + if c.Val == nil { + continue + } + + ps := c.Val.(types.VirtualMachinePowerState) + if ps == state { + return true + } + } + return false + }) + + return err +} + +func (v VirtualMachine) MarkAsTemplate(ctx context.Context) error { + req := types.MarkAsTemplate{ + This: v.Reference(), + } + + _, err := methods.MarkAsTemplate(ctx, v.c, &req) + if err != nil { + return err + } + + return nil +} + +func (v VirtualMachine) MarkAsVirtualMachine(ctx context.Context, pool ResourcePool, host *HostSystem) error { + req := types.MarkAsVirtualMachine{ + This: v.Reference(), + Pool: pool.Reference(), + } + + if host != nil { + ref := host.Reference() + req.Host = &ref + } + + _, err := methods.MarkAsVirtualMachine(ctx, v.c, &req) + if err != nil { + return err + } + + return nil +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/object/virtual_machine_test.go juju-core-2.0.2/src/github.com/vmware/govmomi/object/virtual_machine_test.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/object/virtual_machine_test.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/object/virtual_machine_test.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,20 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package object + +// VirtualMachine should implement the Reference interface. +var _ Reference = VirtualMachine{} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/object/vmware_distributed_virtual_switch.go juju-core-2.0.2/src/github.com/vmware/govmomi/object/vmware_distributed_virtual_switch.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/object/vmware_distributed_virtual_switch.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/object/vmware_distributed_virtual_switch.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,21 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package object + +type VmwareDistributedVirtualSwitch struct { + DistributedVirtualSwitch +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/ovf/cim.go juju-core-2.0.2/src/github.com/vmware/govmomi/ovf/cim.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/ovf/cim.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/ovf/cim.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,78 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package ovf + +/* +Source: http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2.24.0/CIM_VirtualSystemSettingData.xsd +*/ + +type CIMVirtualSystemSettingData struct { + ElementName string `xml:"ElementName"` + InstanceID string `xml:"InstanceID"` + + AutomaticRecoveryAction *uint8 `xml:"AutomaticRecoveryAction"` + AutomaticShutdownAction *uint8 `xml:"AutomaticShutdownAction"` + AutomaticStartupAction *uint8 `xml:"AutomaticStartupAction"` + AutomaticStartupActionDelay *string `xml:"AutomaticStartupActionDelay>Interval"` + AutomaticStartupActionSequenceNumber *uint16 `xml:"AutomaticStartupActionSequenceNumber"` + Caption *string `xml:"Caption"` + ConfigurationDataRoot *string `xml:"ConfigurationDataRoot"` + ConfigurationFile *string `xml:"ConfigurationFile"` + ConfigurationID *string `xml:"ConfigurationID"` + CreationTime *string `xml:"CreationTime"` + Description *string `xml:"Description"` + LogDataRoot *string `xml:"LogDataRoot"` + Notes []string `xml:"Notes"` + RecoveryFile *string `xml:"RecoveryFile"` + SnapshotDataRoot *string `xml:"SnapshotDataRoot"` + SuspendDataRoot *string `xml:"SuspendDataRoot"` + SwapFileDataRoot *string `xml:"SwapFileDataRoot"` + VirtualSystemIdentifier *string `xml:"VirtualSystemIdentifier"` + VirtualSystemType *string `xml:"VirtualSystemType"` +} + +/* +Source: http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2.24.0/CIM_ResourceAllocationSettingData.xsd +*/ + +type CIMResourceAllocationSettingData struct { + ElementName string `xml:"ElementName"` + InstanceID string `xml:"InstanceID"` + + ResourceType *uint16 `xml:"ResourceType"` + OtherResourceType *string `xml:"OtherResourceType"` + ResourceSubType *string `xml:"ResourceSubType"` + + AddressOnParent *string `xml:"AddressOnParent"` + Address *string `xml:"Address"` + AllocationUnits *string `xml:"AllocationUnits"` + AutomaticAllocation *bool `xml:"AutomaticAllocation"` + AutomaticDeallocation *bool `xml:"AutomaticDeallocation"` + Caption *string `xml:"Caption"` + Connection []string `xml:"Connection"` + ConsumerVisibility *uint16 `xml:"ConsumerVisibility"` + Description *string `xml:"Description"` + HostResource []string `xml:"HostResource"` + Limit *uint64 `xml:"Limit"` + MappingBehavior *uint `xml:"MappingBehavior"` + Parent *string `xml:"Parent"` + PoolID *string `xml:"PoolID"` + Reservation *uint64 `xml:"Reservation"` + VirtualQuantity *uint `xml:"VirtualQuantity"` + VirtualQuantityUnits *string `xml:"VirtualQuantityUnits"` + Weight *uint `xml:"Weight"` +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/ovf/doc.go juju-core-2.0.2/src/github.com/vmware/govmomi/ovf/doc.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/ovf/doc.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/ovf/doc.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,25 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +/* +Package ovf provides functionality to unmarshal and inspect the structure +of an OVF file. It is not a complete implementation of the specification and +is intended to be used to import virtual infrastructure into vSphere. + +For a complete specification of the OVF standard, refer to: +https://www.dmtf.org/sites/default/files/standards/documents/DSP0243_2.1.0.pdf +*/ +package ovf diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/ovf/envelope.go juju-core-2.0.2/src/github.com/vmware/govmomi/ovf/envelope.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/ovf/envelope.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/ovf/envelope.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,191 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package ovf + +type Envelope struct { + References []File `xml:"References>File"` + + // Package level meta-data + Annotation *AnnotationSection `xml:"AnnotationSection"` + Product *ProductSection `xml:"ProductSection"` + Network *NetworkSection `xml:"NetworkSection"` + Disk *DiskSection `xml:"DiskSection"` + OperatingSystem *OperatingSystemSection `xml:"OperatingSystemSection"` + Eula *EulaSection `xml:"EulaSection"` + VirtualHardware *VirtualHardwareSection `xml:"VirtualHardwareSection"` + ResourceAllocation *ResourceAllocationSection `xml:"ResourceAllocationSection"` + DeploymentOption *DeploymentOptionSection `xml:"DeploymentOptionSection"` + + // Content: A VirtualSystem or a VirtualSystemCollection + VirtualSystem *VirtualSystem `xml:"VirtualSystem"` +} + +type VirtualSystem struct { + Content + + Annotation []AnnotationSection `xml:"AnnotationSection"` + Product []ProductSection `xml:"ProductSection"` + OperatingSystem []OperatingSystemSection `xml:"OperatingSystemSection"` + Eula []EulaSection `xml:"EulaSection"` + VirtualHardware []VirtualHardwareSection `xml:"VirtualHardwareSection"` +} + +type File struct { + ID string `xml:"id,attr"` + Href string `xml:"href,attr"` + Size uint `xml:"size,attr"` + Compression *string `xml:"compression,attr"` + ChunkSize *int `xml:"chunkSize,attr"` +} + +type Content struct { + ID string `xml:"id,attr"` + Info string `xml:"Info"` + Name *string `xml:"Name"` +} + +type Section struct { + Required *bool `xml:"required,attr"` + Info string `xml:"Info"` +} + +type AnnotationSection struct { + Section + + Annotation string `xml:"Annotation"` +} + +type ProductSection struct { + Section + + Class *string `xml:"class,attr"` + Instance *string `xml:"instance,attr"` + + Product string `xml:"Product"` + Vendor string `xml:"Vendor"` + Version string `xml:"Version"` + FullVersion string `xml:"FullVersion"` + ProductURL string `xml:"ProductUrl"` + VendorURL string `xml:"VendorUrl"` + AppURL string `xml:"AppUrl"` + Property []Property `xml:"Property"` +} + +type Property struct { + Key string `xml:"key,attr"` + Type string `xml:"type,attr"` + Qualifiers *string `xml:"qualifiers,attr"` + UserConfigurable *bool `xml:"userConfigurable,attr"` + Default *string `xml:"value,attr"` + Password *bool `xml:"password,attr"` + + Label *string `xml:"Label"` + Description *string `xml:"Description"` + + Values []PropertyConfigurationValue `xml:"Value"` +} + +type PropertyConfigurationValue struct { + Value string `xml:"value,attr"` + Configuration *string `xml:"configuration,attr"` +} + +type NetworkSection struct { + Section + + Networks []Network `xml:"Network"` +} + +type Network struct { + Name string `xml:"name,attr"` + + Description string `xml:"Description"` +} + +type DiskSection struct { + Section + + Disks []VirtualDiskDesc `xml:"Disk"` +} + +type VirtualDiskDesc struct { + DiskID string `xml:"diskId,attr"` + FileRef *string `xml:"fileRef,attr"` + Capacity string `xml:"capacity,attr"` + CapacityAllocationUnits *string `xml:"capacityAllocationUnits,attr"` + Format *string `xml:"format,attr"` + PopulatedSize *int `xml:"populatedSize,attr"` + ParentRef *string `xml:"parentRef,attr"` +} + +type OperatingSystemSection struct { + Section + + ID uint16 `xml:"id,attr"` + Version *string `xml:"version,attr"` + OSType *string `xml:"osType,attr"` + + Description *string `xml:"Description"` +} + +type EulaSection struct { + Section + + License string `xml:"License"` +} + +type VirtualHardwareSection struct { + Section + + ID *string `xml:"id,attr"` + Transport *string `xml:"transport,attr"` + + System *VirtualSystemSettingData `xml:"System"` + Item []ResourceAllocationSettingData `xml:"Item"` +} + +type VirtualSystemSettingData struct { + CIMVirtualSystemSettingData +} + +type ResourceAllocationSettingData struct { + CIMResourceAllocationSettingData + + Required *bool `xml:"required,attr"` + Configuration *string `xml:"configuration,attr"` + Bound *string `xml:"bound,attr"` +} + +type ResourceAllocationSection struct { + Section + + Item []ResourceAllocationSettingData `xml:"Item"` +} + +type DeploymentOptionSection struct { + Section + + Configuration []DeploymentOptionConfiguration `xml:"Configuration"` +} + +type DeploymentOptionConfiguration struct { + ID string `xml:"id,attr"` + Default *bool `xml:"default,attr"` + + Label string `xml:"Label"` + Description string `xml:"Description"` +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/ovf/env.go juju-core-2.0.2/src/github.com/vmware/govmomi/ovf/env.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/ovf/env.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/ovf/env.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,98 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package ovf + +import ( + "bytes" + "encoding/xml" + "fmt" +) + +const ( + ovfEnvHeader = `` + ovfEnvPlatformSection = ` + %s + %s + %s + %s + ` + ovfEnvPropertyHeader = `` + ovfEnvPropertyEntry = `` + ovfEnvPropertyFooter = `` + ovfEnvFooter = `` +) + +type Env struct { + XMLName xml.Name `xml:"http://schemas.dmtf.org/ovf/environment/1 Environment"` + ID string `xml:"id,attr"` + EsxID string `xml:"http://www.vmware.com/schema/ovfenv esxId,attr"` + + Platform *PlatformSection `xml:"PlatformSection"` + Property *PropertySection `xml:"PropertySection"` +} + +type PlatformSection struct { + Kind string `xml:"Kind"` + Version string `xml:"Version"` + Vendor string `xml:"Vendor"` + Locale string `xml:"Locale"` +} + +type PropertySection struct { + Properties []EnvProperty `xml:"Property"` +} + +type EnvProperty struct { + Key string `xml:"key,attr"` + Value string `xml:"value,attr"` +} + +// Marshal marshals Env to xml by using xml.Marshal. +func (e Env) Marshal() (string, error) { + x, err := xml.Marshal(e) + if err != nil { + return "", err + } + + return fmt.Sprintf("%s%s", xml.Header, x), nil +} + +// MarshalManual manually marshals Env to xml suitable for a vApp guest. +// It exists to overcome the lack of expressiveness in Go's XML namespaces. +func (e Env) MarshalManual() string { + var buffer bytes.Buffer + + buffer.WriteString(xml.Header) + buffer.WriteString(fmt.Sprintf(ovfEnvHeader, e.EsxID)) + buffer.WriteString(fmt.Sprintf(ovfEnvPlatformSection, e.Platform.Kind, e.Platform.Version, e.Platform.Vendor, e.Platform.Locale)) + + buffer.WriteString(fmt.Sprintf(ovfEnvPropertyHeader)) + for _, p := range e.Property.Properties { + buffer.WriteString(fmt.Sprintf(ovfEnvPropertyEntry, p.Key, p.Value)) + } + buffer.WriteString(fmt.Sprintf(ovfEnvPropertyFooter)) + + buffer.WriteString(fmt.Sprintf(ovfEnvFooter)) + + return buffer.String() +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/ovf/env_test.go juju-core-2.0.2/src/github.com/vmware/govmomi/ovf/env_test.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/ovf/env_test.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/ovf/env_test.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,57 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package ovf + +import "testing" + +func testEnv() Env { + return Env{ + EsxID: "vm moref", + Platform: &PlatformSection{ + Kind: "VMware vCenter Server", + Version: "5.5.0", + Vendor: "VMware, Inc.", + Locale: "US", + }, + Property: &PropertySection{ + Properties: []EnvProperty{ + EnvProperty{"foo", "bar"}, + EnvProperty{"ham", "eggs"}}}, + } +} + +func TestMarshalEnv(t *testing.T) { + env := testEnv() + + xenv, err := env.Marshal() + if err != nil { + t.Fatal("Error marshalling environment") + } + if len(xenv) < 1 { + t.Fatal("Marshalled document is empty") + } + t.Log(xenv) +} + +func TestMarshalManualEnv(t *testing.T) { + env := testEnv() + + xenv := env.MarshalManual() + if len(xenv) < 1 { + t.Fatal("Marshalled document is empty") + } + t.Log(xenv) +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/ovf/ovf.go juju-core-2.0.2/src/github.com/vmware/govmomi/ovf/ovf.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/ovf/ovf.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/ovf/ovf.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,34 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package ovf + +import ( + "encoding/xml" + "io" +) + +func Unmarshal(r io.Reader) (*Envelope, error) { + var e Envelope + + dec := xml.NewDecoder(r) + err := dec.Decode(&e) + if err != nil { + return nil, err + } + + return &e, nil +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/ovf/ovf_test.go juju-core-2.0.2/src/github.com/vmware/govmomi/ovf/ovf_test.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/ovf/ovf_test.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/ovf/ovf_test.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,85 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package ovf + +import ( + "bytes" + "fmt" + "os" + "testing" + "text/tabwriter" +) + +func testFile(t *testing.T) *os.File { + n := os.Getenv("OVF_TEST_FILE") + if n == "" { + t.Skip("Please specify OVF_TEST_FILE") + } + + f, err := os.Open(n) + if err != nil { + t.Fatal(err) + } + + return f +} + +func testEnvelope(t *testing.T) *Envelope { + f := testFile(t) + defer f.Close() + + e, err := Unmarshal(f) + if err != nil { + t.Fatal(f) + } + + if e == nil { + t.Fatal("Empty envelope") + } + + return e +} + +func TestUnmarshal(t *testing.T) { + testEnvelope(t) +} + +func TestDeploymentOptions(t *testing.T) { + e := testEnvelope(t) + + if e.DeploymentOption == nil { + t.Fatal("Missing DeploymentOptionSection") + } + + var b bytes.Buffer + tw := tabwriter.NewWriter(&b, 2, 0, 2, ' ', 0) + fmt.Fprintf(tw, "\n") + for _, c := range e.DeploymentOption.Configuration { + fmt.Fprintf(tw, "id=%s\t", c.ID) + fmt.Fprintf(tw, "label=%s\t", c.Label) + + d := false + if c.Default != nil { + d = *c.Default + } + + fmt.Fprintf(tw, "default=%t\t", d) + fmt.Fprintf(tw, "\n") + } + tw.Flush() + t.Log(b.String()) +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/property/collector.go juju-core-2.0.2/src/github.com/vmware/govmomi/property/collector.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/property/collector.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/property/collector.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,174 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package property + +import ( + "errors" + + "github.com/vmware/govmomi/vim25" + "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/soap" + "github.com/vmware/govmomi/vim25/types" + "golang.org/x/net/context" +) + +// Collector models the PropertyCollector managed object. +// +// For more information, see: +// http://pubs.vmware.com/vsphere-55/index.jsp#com.vmware.wssdk.apiref.doc/vmodl.query.PropertyCollector.html +// +type Collector struct { + roundTripper soap.RoundTripper + reference types.ManagedObjectReference +} + +// DefaultCollector returns the session's default property collector. +func DefaultCollector(c *vim25.Client) *Collector { + p := Collector{ + roundTripper: c, + reference: c.ServiceContent.PropertyCollector, + } + + return &p +} + +func (p Collector) Reference() types.ManagedObjectReference { + return p.reference +} + +// Create creates a new session-specific Collector that can be used to +// retrieve property updates independent of any other Collector. +func (p *Collector) Create(ctx context.Context) (*Collector, error) { + req := types.CreatePropertyCollector{ + This: p.Reference(), + } + + res, err := methods.CreatePropertyCollector(ctx, p.roundTripper, &req) + if err != nil { + return nil, err + } + + newp := Collector{ + roundTripper: p.roundTripper, + reference: res.Returnval, + } + + return &newp, nil +} + +// Destroy destroys this Collector. +func (p *Collector) Destroy(ctx context.Context) error { + req := types.DestroyPropertyCollector{ + This: p.Reference(), + } + + _, err := methods.DestroyPropertyCollector(ctx, p.roundTripper, &req) + if err != nil { + return err + } + + p.reference = types.ManagedObjectReference{} + return nil +} + +func (p *Collector) CreateFilter(ctx context.Context, req types.CreateFilter) error { + req.This = p.Reference() + + _, err := methods.CreateFilter(ctx, p.roundTripper, &req) + if err != nil { + return err + } + + return nil +} + +func (p *Collector) WaitForUpdates(ctx context.Context, v string) (*types.UpdateSet, error) { + req := types.WaitForUpdatesEx{ + This: p.Reference(), + Version: v, + } + + res, err := methods.WaitForUpdatesEx(ctx, p.roundTripper, &req) + if err != nil { + return nil, err + } + + return res.Returnval, nil +} + +func (p *Collector) RetrieveProperties(ctx context.Context, req types.RetrieveProperties) (*types.RetrievePropertiesResponse, error) { + req.This = p.Reference() + return methods.RetrieveProperties(ctx, p.roundTripper, &req) +} + +// Retrieve loads properties for a slice of managed objects. The dst argument +// must be a pointer to a []interface{}, which is populated with the instances +// of the specified managed objects, with the relevant properties filled in. If +// the properties slice is nil, all properties are loaded. +func (p *Collector) Retrieve(ctx context.Context, objs []types.ManagedObjectReference, ps []string, dst interface{}) error { + var propSpec *types.PropertySpec + var objectSet []types.ObjectSpec + + for _, obj := range objs { + // Ensure that all object reference types are the same + if propSpec == nil { + propSpec = &types.PropertySpec{ + Type: obj.Type, + } + + if ps == nil { + propSpec.All = types.NewBool(true) + } else { + propSpec.PathSet = ps + } + } else { + if obj.Type != propSpec.Type { + return errors.New("object references must have the same type") + } + } + + objectSpec := types.ObjectSpec{ + Obj: obj, + Skip: types.NewBool(false), + } + + objectSet = append(objectSet, objectSpec) + } + + req := types.RetrieveProperties{ + SpecSet: []types.PropertyFilterSpec{ + { + ObjectSet: objectSet, + PropSet: []types.PropertySpec{*propSpec}, + }, + }, + } + + res, err := p.RetrieveProperties(ctx, req) + if err != nil { + return err + } + + return mo.LoadRetrievePropertiesResponse(res, dst) +} + +// RetrieveOne calls Retrieve with a single managed object reference. +func (p *Collector) RetrieveOne(ctx context.Context, obj types.ManagedObjectReference, ps []string, dst interface{}) error { + var objs = []types.ManagedObjectReference{obj} + return p.Retrieve(ctx, objs, ps, dst) +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/property/wait.go juju-core-2.0.2/src/github.com/vmware/govmomi/property/wait.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/property/wait.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/property/wait.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,147 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package property + +import ( + "github.com/vmware/govmomi/vim25/types" + "golang.org/x/net/context" +) + +// Wait waits for any of the specified properties of the specified managed +// object to change. It calls the specified function for every update it +// receives. If this function returns false, it continues waiting for +// subsequent updates. If this function returns true, it stops waiting and +// returns. +// +// To only receive updates for the specified managed object, the function +// creates a new property collector and calls CreateFilter. A new property +// collector is required because filters can only be added, not removed. +// +// The newly created collector is destroyed before this function returns (both +// in case of success or error). +// +func Wait(ctx context.Context, c *Collector, obj types.ManagedObjectReference, ps []string, f func([]types.PropertyChange) bool) error { + p, err := c.Create(ctx) + if err != nil { + return err + } + + // Attempt to destroy the collector using the background context, as the + // specified context may have timed out or have been cancelled. + defer p.Destroy(context.Background()) + + req := types.CreateFilter{ + Spec: types.PropertyFilterSpec{ + ObjectSet: []types.ObjectSpec{ + { + Obj: obj, + }, + }, + PropSet: []types.PropertySpec{ + { + PathSet: ps, + Type: obj.Type, + }, + }, + }, + } + + err = p.CreateFilter(ctx, req) + if err != nil { + return err + } + return waitLoop(ctx, p, f) +} + +// WaitForView waits for any of the specified properties of the managed +// objects in the View to change. It calls the specified function for every update it +// receives. If this function returns false, it continues waiting for +// subsequent updates. If this function returns true, it stops waiting and +// returns. +// +// To only receive updates for the View's specified managed objects, the function +// creates a new property collector and calls CreateFilter. A new property +// collector is required because filters can only be added, not removed. +// +// The newly created collector is destroyed before this function returns (both +// in case of success or error). +// +// The code assumes that all objects in the View are the same type +func WaitForView(ctx context.Context, c *Collector, view types.ManagedObjectReference, obj types.ManagedObjectReference, ps []string, f func([]types.PropertyChange) bool) error { + p, err := c.Create(ctx) + if err != nil { + return err + } + + // Attempt to destroy the collector using the background context, as the + // specified context may have timed out or have been cancelled. + defer p.Destroy(context.Background()) + + req := types.CreateFilter{ + + Spec: types.PropertyFilterSpec{ + ObjectSet: []types.ObjectSpec{ + { + Obj: view, + SelectSet: []types.BaseSelectionSpec{ + &types.TraversalSpec{ + SelectionSpec: types.SelectionSpec{ + Name: "traverseEntities", + }, + Path: "view", + Type: view.Type}}, + }, + }, + PropSet: []types.PropertySpec{ + types.PropertySpec{ + Type: obj.Type, + PathSet: ps, + }, + }, + }} + + err = p.CreateFilter(ctx, req) + if err != nil { + return err + } + return waitLoop(ctx, p, f) +} + +func waitLoop(ctx context.Context, c *Collector, f func([]types.PropertyChange) bool) error { + for version := ""; ; { + res, err := c.WaitForUpdates(ctx, version) + if err != nil { + return err + } + + // Retry if the result came back empty + if res == nil { + continue + } + + version = res.Version + + for _, fs := range res.FilterSet { + for _, os := range fs.ObjectSet { + if f(os.ChangeSet) { + return nil + } + } + } + } + +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/README.md juju-core-2.0.2/src/github.com/vmware/govmomi/README.md --- juju-core-2.0.0/src/github.com/vmware/govmomi/README.md 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/README.md 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,54 @@ +[![Build Status](https://travis-ci.org/vmware/govmomi.png?branch=master)](https://travis-ci.org/vmware/govmomi) +[![Build Status](https://ci.vmware.run/api/badges/vmware/govmomi/status.svg)](https://ci.vmware.run/vmware/govmomi) + +# govmomi + +A Go library for interacting with VMware vSphere APIs (ESXi and/or vCenter). + +For `govc`, a CLI built on top of govmomi, check out the [govc](./govc) directory. + +## Compatibility + +This library is built for and tested against ESXi and vCenter 5.5 and 6.0. + +If you're able to use it against older versions of ESXi and/or vCenter, please +leave a note and we'll include it in this compatibility list. + +## Documentation + +The APIs exposed by this library very closely follow the API described in the [VMware vSphere API Reference Documentation][apiref]. +Refer to this document to become familiar with the upstream API. + +The code in the `govmomi` package is a wrapper for the code that is generated from the vSphere API description. +It primarily provides convenience functions for working with the vSphere API. +See [godoc.org][godoc] for documentation. + +[apiref]:http://pubs.vmware.com/vsphere-60/index.jsp#com.vmware.wssdk.apiref.doc/right-pane.html +[godoc]:http://godoc.org/github.com/vmware/govmomi +[drone]:https://drone.io +[dronesrc]:https://github.com/drone/drone +[dronecli]:http://readme.drone.io/devs/cli/ + +#### Building with CI +Merges to this repository will trigger builds in both Travis and [Drone][drone]. + +To build locally with Drone: +- Ensure that you have Docker 1.6 or higher installed. +- Install the [Drone command line tools][dronecli]. +- Run `drone exec` from within the root directory of the govmomi repository. + +## Status + +Changes to the API are subject to [semantic versioning](http://semver.org). + +Refer to the [CHANGELOG](CHANGELOG.md) for version to version changes. + +## Projects using govmomi + +* [Docker Machine](https://github.com/docker/machine/tree/master/drivers/vmwarevsphere) + +* [Terraform](https://github.com/hashicorp/terraform/tree/master/builtin/providers/vsphere) + +## License + +govmomi is available under the [Apache 2 license](LICENSE). diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/scripts/contributors.sh juju-core-2.0.2/src/github.com/vmware/govmomi/scripts/contributors.sh --- juju-core-2.0.0/src/github.com/vmware/govmomi/scripts/contributors.sh 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/scripts/contributors.sh 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,24 @@ +#!/bin/bash + +set -e + +outfile="CONTRIBUTORS" +tmpfile="CONTRIBUTORS.tmp" +cp "${outfile}" "${tmpfile}" + +# Make sure the email address of every contributor is listed +git shortlog -sne | while read line; do + name=$(perl -pe 's/\d+\s+//' <<<"${line}") + email=$(grep -Po '(?<=<).*(?=>)' <<<"${name}") + if ! grep -q "${email}" "${outfile}"; then + echo "${name}" >> "${tmpfile}" + fi +done + +# Sort entries +( + sed -ne '1,5p' "${tmpfile}" + sed -ne '1,5!p' "${tmpfile}" | sort +) > "${outfile}" + +rm -f "${tmpfile}" diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/scripts/debug-ls.sh juju-core-2.0.2/src/github.com/vmware/govmomi/scripts/debug-ls.sh --- juju-core-2.0.0/src/github.com/vmware/govmomi/scripts/debug-ls.sh 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/scripts/debug-ls.sh 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,43 @@ +#!/bin/bash + +# Copyright (c) 2014 VMware, Inc. All Rights Reserved. +# +# 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, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -e + +# This script shows for every request in a debug trace how long it took +# and the name of the request body. + +function body-name { + ( + xmllint --shell $1 <\n" "$1" "$PWD" "$2" "$(tr -d '\r' < "$3")" +} + +for file in *.req.xml; do + base=$(basename "$file" .req.xml) + header Request "$file" "${base}.req.headers" + xmlformat < "$file" + file="${base}.res.xml" + header Response "$file" "${base}.res.headers" + xmlformat < "$file" +done diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/scripts/.gitignore juju-core-2.0.2/src/github.com/vmware/govmomi/scripts/.gitignore --- juju-core-2.0.0/src/github.com/vmware/govmomi/scripts/.gitignore 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/scripts/.gitignore 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1 @@ +.wireshark-* diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/scripts/govc-env.bash juju-core-2.0.2/src/github.com/vmware/govmomi/scripts/govc-env.bash --- juju-core-2.0.0/src/github.com/vmware/govmomi/scripts/govc-env.bash 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/scripts/govc-env.bash 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,62 @@ +# Copyright (c) 2015 VMware, Inc. All Rights Reserved. +# +# 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, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Provide a simple shell extension to save and load govc +# environments to disk. No more running `export GOVC_ABC=xyz` +# in different shells over and over again. Loading the right +# govc environment variables is now only one short and +# autocompleted command away! +# +# Usage: +# * Source this file from your `~/.bashrc` or running shell. +# * Execute `govc-env` to print GOVC_* variables. +# * Execute `govc-env --save ` to save GOVC_* variables. +# * Execute `govc-env ` to load GOVC_* variables. +# + +_govc_env_dir=$HOME/.govmomi/env +mkdir -p "${_govc_env_dir}" + +_govc-env-complete() { + local w="${COMP_WORDS[COMP_CWORD]}" + local c="$(find ${_govc_env_dir} -mindepth 1 -maxdepth 1 -type f | sort | xargs -r -L1 basename | xargs echo)" + + # Only allow completion if preceding argument if the function itself + if [ "$3" == "govc-env" ]; then + COMPREPLY=( $(compgen -W "${c}" -- "${w}") ) + fi +} + +govc-env() { + # Print current environment + if [ -z "$1" ]; then + for VAR in $(env | grep ^GOVC_ | cut -d= -f1); do + echo "export ${VAR}='${!VAR}'" + done + + return + fi + + # Save current environment + if [ "$1" == "--save" ]; then + govc-env > ${_govc_env_dir}/$2 + return + fi + + # Load specified environment + source ${_govc_env_dir}/$1 +} + +complete -F _govc-env-complete govc-env + diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/scripts/headers/go.txt juju-core-2.0.2/src/github.com/vmware/govmomi/scripts/headers/go.txt --- juju-core-2.0.0/src/github.com/vmware/govmomi/scripts/headers/go.txt 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/scripts/headers/go.txt 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,15 @@ +/* +Copyright (c) ${YEARS} VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/scripts/headers/rb.txt juju-core-2.0.2/src/github.com/vmware/govmomi/scripts/headers/rb.txt --- juju-core-2.0.0/src/github.com/vmware/govmomi/scripts/headers/rb.txt 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/scripts/headers/rb.txt 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,13 @@ +# Copyright (c) ${YEARS} VMware, Inc. All Rights Reserved. +# +# 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, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/scripts/license.sh juju-core-2.0.2/src/github.com/vmware/govmomi/scripts/license.sh --- juju-core-2.0.0/src/github.com/vmware/govmomi/scripts/license.sh 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/scripts/license.sh 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,48 @@ +#!/bin/bash + +set -e + +header_dir=$(dirname $0)/headers + +tmpfile=$(mktemp) +trap "rm -f ${tmpfile}" EXIT + +git ls-files | while read file; do + years=( $(git log --format='%ai' $file | cut -d- -f1 | sort -u) ) + num_years=${#years[@]} + + if [ "${num_years}" == 0 ]; then + export YEARS="$(date +%Y)" + else + yearA=${years[0]} + yearB=${years[$((${num_years}-1))]} + + if [ ${yearA} == ${yearB} ]; then + export YEARS="${yearA}" + else + export YEARS="${yearA}-${yearB}" + fi + fi + + case "$file" in + vim25/xml/*) + # Ignore + ;; + *.go) + sed -e "s/\${YEARS}/${YEARS}/" ${header_dir}/go.txt > ${tmpfile} + last_header_line=$(grep -n '\*/' ${file} | head -1 | cut -d: -f1) + tail -n +$((${last_header_line} + 1)) ${file} >> ${tmpfile} + mv ${tmpfile} ${file} + ;; + *.rb) + sed -e "s/\${YEARS}/${YEARS}/" ${header_dir}/rb.txt > ${tmpfile} + last_header_line=$(grep -n '^$' ${file} | head -1 | cut -d: -f1) + tail -n +$((${last_header_line})) ${file} >> ${tmpfile} + mv ${tmpfile} ${file} + ;; + *) + echo "Unhandled file: $file" + ;; + esac +done + diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/scripts/vagrant/vcsa/create-box.sh juju-core-2.0.2/src/github.com/vmware/govmomi/scripts/vagrant/vcsa/create-box.sh --- juju-core-2.0.0/src/github.com/vmware/govmomi/scripts/vagrant/vcsa/create-box.sh 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/scripts/vagrant/vcsa/create-box.sh 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,81 @@ +#!/bin/sh + +set -e + +if [ "$(uname -s)" == "Darwin" ]; then + PATH="/Applications/VMware Fusion.app/Contents/Library:$PATH" + PATH="/Applications/VMware Fusion.app/Contents/Library/VMware OVF Tool:$PATH" +fi + +ovf="$1" + +if [ -z "$ovf" ]; then + ovf="./VMware-vCenter-Server-Appliance-5.5.0.10300-2000350_OVA10.ova" +fi + +# check for greadlink and gmktemp +readlink=$(type -p greadlink readlink | head -1) +mktemp=$(type -p gmktemp mktemp | head -1) + +dir=$($readlink -nf $(dirname $0)) +tmp=$($mktemp -d) +trap "rm -rf $tmp" EXIT + +cd $tmp + +echo "Converting ovf..." +ovftool \ + --noSSLVerify \ + --acceptAllEulas \ + --overwrite \ + --powerOffTarget \ + $ovf vcsa.vmx + +echo "Starting vm..." +vmrun start vcsa.vmx nogui + +echo "Waiting for vm ip..." +ip=$(vmrun getGuestIPAddress vcsa.vmx -wait) + +echo "Configuring vm for use with vagrant..." +vmrun -gu root -gp vmware CopyFileFromHostToGuest vcsa.vmx \ + $dir/vagrant.sh /tmp/vagrant.sh + +vmrun -gu root -gp vmware runProgramInGuest vcsa.vmx \ + /bin/sh -e /tmp/vagrant.sh + +vmrun -gu root -gp vmware deleteFileInGuest vcsa.vmx \ + /tmp/vagrant.sh + +echo "Configuring vCenter Server Appliance..." + +ssh_opts="-oStrictHostKeyChecking=no -oUserKnownHostsFile=/dev/null -T" + +ssh ${ssh_opts} -i ~/.vagrant.d/insecure_private_key vagrant@$ip < ./metadata.json + +cd $dir + +tar -C $tmp -cvzf vcsa.box . + +vagrant box add --name vcsa vcsa.box diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/scripts/vagrant/vcsa/.gitignore juju-core-2.0.2/src/github.com/vmware/govmomi/scripts/vagrant/vcsa/.gitignore --- juju-core-2.0.0/src/github.com/vmware/govmomi/scripts/vagrant/vcsa/.gitignore 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/scripts/vagrant/vcsa/.gitignore 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,3 @@ +*.box +*.ova +.vagrant diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/scripts/vagrant/vcsa/Vagrantfile juju-core-2.0.2/src/github.com/vmware/govmomi/scripts/vagrant/vcsa/Vagrantfile --- juju-core-2.0.0/src/github.com/vmware/govmomi/scripts/vagrant/vcsa/Vagrantfile 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/scripts/vagrant/vcsa/Vagrantfile 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,13 @@ +# -*- mode: ruby -*- +# vi: set ft=ruby : + +# Using the VCSA base box, no provisioning, inventory will be empty. + +Vagrant.configure("2") do |config| + config.vm.hostname = "vcsa" + + config.vm.box = "vcsa" + config.vm.synced_folder ".", "/vagrant", disabled: true + + config.vm.network "forwarded_port", guest: 443, host: 16443 +end diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/scripts/vagrant/vcsa/vagrant.sh juju-core-2.0.2/src/github.com/vmware/govmomi/scripts/vagrant/vcsa/vagrant.sh --- juju-core-2.0.0/src/github.com/vmware/govmomi/scripts/vagrant/vcsa/vagrant.sh 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/scripts/vagrant/vcsa/vagrant.sh 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,23 @@ +#!/bin/sh + +useradd vagrant -m -s /bin/bash +groupmod -A vagrant wheel + +echo "vagrant ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers + +mkdir ~vagrant/.ssh +wget --no-check-certificate \ + https://raw.githubusercontent.com/mitchellh/vagrant/master/keys/vagrant.pub \ + -O ~vagrant/.ssh/authorized_keys +chown -R vagrant ~vagrant/.ssh +chmod -R go-rwsx ~vagrant/.ssh + +sed -i -e 's/^#UseDNS yes/UseDNS no/' /etc/ssh/sshd_config +sed -i -e 's/^AllowTcpForwarding no//' /etc/ssh/sshd_config +sed -i -e 's/^PermitTunnel no//' /etc/ssh/sshd_config +sed -i -e 's/^MaxSessions 1//' /etc/ssh/sshd_config + +# disable password expiration +for uid in root vagrant; do + chage -I -1 -E -1 -m 0 -M -1 $uid +done diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/scripts/wireshark-esx.sh juju-core-2.0.2/src/github.com/vmware/govmomi/scripts/wireshark-esx.sh --- juju-core-2.0.0/src/github.com/vmware/govmomi/scripts/wireshark-esx.sh 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/scripts/wireshark-esx.sh 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,63 @@ +#!/bin/bash -e +# +# Capture ESXi traffic and decrypt SOAP traffic on port 443 via wireshark + +# Device to capture +dev="${1-vmk0}" + +# Device to get the ip for wireshark ssl_keys config +if [ "$dev" = "lo0" ] ; then + ip_dev="vmk0" +else + ip_dev="$dev" +fi + +ip=$(govc host.info -k -json | \ + jq -r ".HostSystems[].Config.Network.Vnic[] | select(.Device == \"${ip_dev}\") | .Spec.Ip.IpAddress") + +scp=(scp) +ssh=(ssh) + +# Check if vagrant ssh-config applies to $ip +if [ -d ".vagrant" ] ; then + vssh_opts=($(vagrant ssh-config | awk NF | awk -v ORS=' ' '{print "-o " $1 "=" $2}')) + if grep "HostName=${ip}" >/dev/null <<<"${vssh_opts[*]}" ; then + ssh_opts=("${vssh_opts[@]}") + fi +fi + +# Otherwise, use default ssh opts + sshpass if available +if [ ${#ssh_opts[@]} -eq 0 ] ; then + user="$(govc env GOVC_USERNAME)" + ssh_opts=(-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o LogLevel=FATAL -o User=$user) + + if [ -x "$(which sshpass)" ] ; then + password="$(govc env GOVC_PASSWORD)" + scp=(sshpass -p $password scp) + ssh=(sshpass -p $password ssh) + fi +fi + +if [ "$dev" != "lo0" ] ; then + # If you change this filter, be sure to exclude the ssh port (not tcp port 22) + filter="host $ip and \(port 80 or port 443\)" + + dst="$HOME/.wireshark/rui-${ip}.key" + if [ ! -f "$dst" ] ; then + # Copy key from ESX + "${scp[@]}" "${ssh_opts[@]}" "${ip}:/etc/vmware/ssl/rui.key" "$dst" + fi + + if ! grep "$ip" ~/.wireshark/ssl_keys 2>/dev/null ; then + # Add key to wireshark ssl_keys config + echo "adding rui.key for $ip" + + cat <> ~/.wireshark/ssl_keys +"$ip","443","http","$dst","" +EOF + fi +fi + +echo "Capturing $dev on $ip..." + +"${ssh[@]}" "${ssh_opts[@]}" "$ip" tcpdump-uw -i "$dev" -s0 -v -w - "$filter" | wireshark -k -i - diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/scripts/wireshark-vcsa.sh juju-core-2.0.2/src/github.com/vmware/govmomi/scripts/wireshark-vcsa.sh --- juju-core-2.0.0/src/github.com/vmware/govmomi/scripts/wireshark-vcsa.sh 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/scripts/wireshark-vcsa.sh 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,64 @@ +#!/bin/bash -e +# +# Capture SOAP traffic between web client and vpxd on 127.0.0.1:8085. +# +# Caveats: tested with VCSA 6.0, unlikely to work for other versions. +# + +set -e + +cache_deb() { + wget $1 + ar x *.deb data.tar.gz + tar zxf data.tar.gz + rm -f data.tar.gz + rm -f *.deb +} + +dirname="$(dirname $0)" +basename="$(basename $0)" +bindir="${dirname}/.${basename}" + +mkdir -p "${bindir}" + +# Cache binaries required to run tcpdump on vcsa +if [ ! -f "${bindir}/.done" ]; then + pushd ${bindir} + cache_deb https://launchpadlibrarian.net/200649143/libssl0.9.8_0.9.8k-7ubuntu8.27_amd64.deb + cache_deb https://launchpadlibrarian.net/37430984/libpcap0.8_1.0.0-6_amd64.deb + cache_deb https://launchpadlibrarian.net/41774869/tcpdump_4.0.0-6ubuntu3_amd64.deb + touch .done + popd +fi + +scp=(scp) +ssh=(ssh) + +# Extract host from GOVC_URL +host="$(govc env -x GOVC_HOST)" +username=root +password="$(govc env GOVC_PASSWORD)" + +if [ -x "$(which sshpass)" ] ; then + scp=(sshpass -p "$password" scp) + ssh=(sshpass -p "$password" ssh) +fi + +ssh_opts=(-o UserKnownHostsFile=/dev/null + -o StrictHostKeyChecking=no + -o LogLevel=FATAL + -o User=${username} + -o ControlMaster=no) +dev="lo" +filter="port 8085" +tcpdump="env LD_LIBRARY_PATH=/tmp /tmp/tcpdump" + +echo "Capturing $dev on $host..." + +"${scp[@]}" "${ssh_opts[@]}" \ + "${bindir}/lib/libcrypto.so.0.9.8" \ + "${bindir}/usr/lib/libpcap.so.0.8" \ + "${bindir}/usr/sbin/tcpdump" \ + "${host}:/tmp" + +"${ssh[@]}" "${ssh_opts[@]}" "$host" ${tcpdump} -i "$dev" -s0 -v -w - "$filter" | wireshark -k -i - 2>/dev/null diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/session/keep_alive.go juju-core-2.0.2/src/github.com/vmware/govmomi/session/keep_alive.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/session/keep_alive.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/session/keep_alive.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,127 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package session + +import ( + "sync" + "time" + + "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/soap" + "golang.org/x/net/context" +) + +type keepAlive struct { + sync.Mutex + + roundTripper soap.RoundTripper + idleTime time.Duration + notifyRequest chan struct{} + notifyStop chan struct{} + notifyWaitGroup sync.WaitGroup + + // keepAlive executes a request in the background with the purpose of + // keeping the session active. The response for this request is discarded. + keepAlive func(soap.RoundTripper) error +} + +func defaultKeepAlive(roundTripper soap.RoundTripper) error { + _, _ = methods.GetCurrentTime(context.Background(), roundTripper) + return nil +} + +// KeepAlive wraps the specified soap.RoundTripper and executes a meaningless +// API request in the background after the RoundTripper has been idle for the +// specified amount of idle time. The keep alive process only starts once a +// user logs in and runs until the user logs out again. +func KeepAlive(roundTripper soap.RoundTripper, idleTime time.Duration) soap.RoundTripper { + return KeepAliveHandler(roundTripper, idleTime, defaultKeepAlive) +} + +// KeepAliveHandler works as KeepAlive() does, but the handler param can decide how to handle errors. +// For example, if connectivity to ESX/VC is down long enough for a session to expire, a handler can choose to +// Login() on a types.NotAuthenticated error. If handler returns non-nil, the keep alive go routine will be stopped. +func KeepAliveHandler(roundTripper soap.RoundTripper, idleTime time.Duration, handler func(soap.RoundTripper) error) soap.RoundTripper { + k := &keepAlive{ + roundTripper: roundTripper, + idleTime: idleTime, + notifyRequest: make(chan struct{}), + } + + k.keepAlive = handler + + return k +} + +func (k *keepAlive) start() { + k.Lock() + defer k.Unlock() + + if k.notifyStop != nil { + return + } + + // This channel must be closed to terminate idle timer. + k.notifyStop = make(chan struct{}) + k.notifyWaitGroup.Add(1) + + go func() { + defer k.notifyWaitGroup.Done() + + for t := time.NewTimer(k.idleTime); ; { + select { + case <-k.notifyStop: + return + case <-k.notifyRequest: + t.Reset(k.idleTime) + case <-t.C: + if err := k.keepAlive(k.roundTripper); err != nil { + k.stop() + } + t = time.NewTimer(k.idleTime) + } + } + }() +} + +func (k *keepAlive) stop() { + k.Lock() + defer k.Unlock() + + if k.notifyStop != nil { + close(k.notifyStop) + k.notifyWaitGroup.Wait() + k.notifyStop = nil + } +} + +func (k *keepAlive) RoundTrip(ctx context.Context, req, res soap.HasFault) error { + err := k.roundTripper.RoundTrip(ctx, req, res) + if err != nil { + return err + } + + // Start ticker on login, stop ticker on logout. + switch req.(type) { + case *methods.LoginBody, *methods.LoginExtensionByCertificateBody: + k.start() + case *methods.LogoutBody: + k.stop() + } + + return nil +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/session/keep_alive_test.go juju-core-2.0.2/src/github.com/vmware/govmomi/session/keep_alive_test.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/session/keep_alive_test.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/session/keep_alive_test.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,280 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package session + +import ( + "fmt" + "net/url" + "os" + "runtime" + "testing" + "time" + + "github.com/vmware/govmomi/test" + "github.com/vmware/govmomi/vim25" + "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/soap" + "github.com/vmware/govmomi/vim25/types" + "golang.org/x/net/context" +) + +type testKeepAlive int + +func (t *testKeepAlive) Func(soap.RoundTripper) error { + *t++ + return nil +} + +func newManager(t *testing.T) (*Manager, *url.URL) { + u := test.URL() + if u == nil { + t.SkipNow() + } + + soapClient := soap.NewClient(u, true) + vimClient, err := vim25.NewClient(context.Background(), soapClient) + if err != nil { + t.Fatal(err) + } + + return NewManager(vimClient), u +} + +func TestKeepAlive(t *testing.T) { + var i testKeepAlive + var j int + + m, u := newManager(t) + k := KeepAlive(m.client.RoundTripper, time.Millisecond) + k.(*keepAlive).keepAlive = i.Func + m.client.RoundTripper = k + + // Expect keep alive to not have triggered yet + if i != 0 { + t.Errorf("Expected i == 0, got i: %d", i) + } + + // Logging in starts keep alive + err := m.Login(context.Background(), u.User) + if err != nil { + t.Error(err) + } + + time.Sleep(2 * time.Millisecond) + + // Expect keep alive to triggered at least once + if i == 0 { + t.Errorf("Expected i != 0, got i: %d", i) + } + + j = int(i) + time.Sleep(2 * time.Millisecond) + + // Expect keep alive to triggered at least once more + if int(i) <= j { + t.Errorf("Expected i > j, got i: %d, j: %d", i, j) + } + + // Logging out stops keep alive + err = m.Logout(context.Background()) + if err != nil { + t.Error(err) + } + + j = int(i) + time.Sleep(2 * time.Millisecond) + + // Expect keep alive to have stopped + if int(i) != j { + t.Errorf("Expected i == j, got i: %d, j: %d", i, j) + } +} + +func testSessionOK(t *testing.T, m *Manager, ok bool) { + s, err := m.UserSession(context.Background()) + if err != nil { + t.Fatal(err) + } + + _, file, line, _ := runtime.Caller(1) + prefix := fmt.Sprintf("%s:%d", file, line) + + if ok && s == nil { + t.Fatalf("%s: Expected session to be OK, but is invalid", prefix) + } + + if !ok && s != nil { + t.Fatalf("%s: Expected session to be invalid, but is OK", prefix) + } +} + +// Run with: +// +// env GOVMOMI_KEEPALIVE_TEST=1 go test -timeout=60m -run TestRealKeepAlive +// +func TestRealKeepAlive(t *testing.T) { + if os.Getenv("GOVMOMI_KEEPALIVE_TEST") != "1" { + t.SkipNow() + } + + m1, u1 := newManager(t) + m2, u2 := newManager(t) + + // Enable keepalive on m2 + k := KeepAlive(m2.client.RoundTripper, 10*time.Minute) + m2.client.RoundTripper = k + + // Expect both sessions to be invalid + testSessionOK(t, m1, false) + testSessionOK(t, m2, false) + + // Logging in starts keep alive + if err := m1.Login(context.Background(), u1.User); err != nil { + t.Error(err) + } + if err := m2.Login(context.Background(), u2.User); err != nil { + t.Error(err) + } + + // Expect both sessions to be valid + testSessionOK(t, m1, true) + testSessionOK(t, m2, true) + + // Wait for m1 to time out + delay := 31 * time.Minute + fmt.Printf("%s: Waiting %d minutes for session to time out...\n", time.Now(), int(delay.Minutes())) + time.Sleep(delay) + + // Expect m1's session to be invalid, m2's session to be valid + testSessionOK(t, m1, false) + testSessionOK(t, m2, true) +} + +func isNotAuthenticated(err error) bool { + if soap.IsSoapFault(err) { + switch soap.ToSoapFault(err).VimFault().(type) { + case types.NotAuthenticated: + return true + } + } + return false +} + +func isInvalidLogin(err error) bool { + if soap.IsSoapFault(err) { + switch soap.ToSoapFault(err).VimFault().(type) { + case types.InvalidLogin: + return true + } + } + return false +} + +func TestKeepAliveHandler(t *testing.T) { + u := test.URL() + if u == nil { + t.SkipNow() + } + + m1, u1 := newManager(t) + m2, u2 := newManager(t) + + reauth := make(chan bool) + + // Keep alive handler that will re-login. + // Real-world case: connectivity to ESX/VC is down long enough for the session to expire + // Test-world case: we call TerminateSession below + k := KeepAliveHandler(m2.client.RoundTripper, 2*time.Second, func(roundTripper soap.RoundTripper) error { + _, err := methods.GetCurrentTime(context.Background(), roundTripper) + if err != nil { + if isNotAuthenticated(err) { + err = m2.Login(context.Background(), u2.User) + + if err != nil { + if isInvalidLogin(err) { + reauth <- false + t.Log("failed to re-authenticate, quitting keep alive handler") + return err + } + } else { + reauth <- true + } + } + } + + return nil + }) + + m2.client.RoundTripper = k + + // Logging in starts keep alive + if err := m1.Login(context.Background(), u1.User); err != nil { + t.Error(err) + } + if err := m2.Login(context.Background(), u2.User); err != nil { + t.Error(err) + } + + // Terminate session for m2. Note that self terminate fails, so we need 2 sessions for this test. + s, err := m2.UserSession(context.Background()) + if err != nil { + t.Fatal(err) + } + + err = m1.TerminateSession(context.Background(), []string{s.Key}) + if err != nil { + t.Fatal(err) + } + + _, err = methods.GetCurrentTime(context.Background(), m2.client) + if err == nil { + t.Error("expected to fail") + } + + // Wait for keepalive to re-authenticate + <-reauth + + _, err = methods.GetCurrentTime(context.Background(), m2.client) + if err != nil { + t.Fatal(err) + } + + // Clear credentials to test re-authentication failure + u2.User = nil + + s, err = m2.UserSession(context.Background()) + if err != nil { + t.Fatal(err) + } + + err = m1.TerminateSession(context.Background(), []string{s.Key}) + if err != nil { + t.Fatal(err) + } + + // Wait for keepalive re-authenticate attempt + result := <-reauth + + _, err = methods.GetCurrentTime(context.Background(), m2.client) + if err == nil { + t.Error("expected to fail") + } + + if result { + t.Errorf("expected reauth to fail") + } +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/session/manager.go juju-core-2.0.2/src/github.com/vmware/govmomi/session/manager.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/session/manager.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/session/manager.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,177 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package session + +import ( + "net/url" + + "github.com/vmware/govmomi/property" + "github.com/vmware/govmomi/vim25" + "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/types" + "golang.org/x/net/context" +) + +type Manager struct { + client *vim25.Client + userSession *types.UserSession +} + +func NewManager(client *vim25.Client) *Manager { + m := Manager{ + client: client, + } + + return &m +} + +func (sm Manager) Reference() types.ManagedObjectReference { + return *sm.client.ServiceContent.SessionManager +} + +func (sm *Manager) Login(ctx context.Context, u *url.Userinfo) error { + req := types.Login{ + This: sm.Reference(), + } + + if u != nil { + req.UserName = u.Username() + if pw, ok := u.Password(); ok { + req.Password = pw + } + } + + login, err := methods.Login(ctx, sm.client, &req) + if err != nil { + return err + } + + sm.userSession = &login.Returnval + return nil +} + +func (sm *Manager) LoginExtensionByCertificate(ctx context.Context, key string, locale string) error { + req := types.LoginExtensionByCertificate{ + This: sm.Reference(), + ExtensionKey: key, + Locale: locale, + } + + login, err := methods.LoginExtensionByCertificate(ctx, sm.client, &req) + if err != nil { + return err + } + + sm.userSession = &login.Returnval + return nil +} + +func (sm *Manager) Logout(ctx context.Context) error { + req := types.Logout{ + This: sm.Reference(), + } + + _, err := methods.Logout(ctx, sm.client, &req) + if err != nil { + return err + } + + sm.userSession = nil + return nil +} + +// UserSession retrieves and returns the SessionManager's CurrentSession field. +// Nil is returned if the session is not authenticated. +func (sm *Manager) UserSession(ctx context.Context) (*types.UserSession, error) { + var mgr mo.SessionManager + + pc := property.DefaultCollector(sm.client) + err := pc.RetrieveOne(ctx, sm.Reference(), []string{"currentSession"}, &mgr) + if err != nil { + // It's OK if we can't retrieve properties because we're not authenticated + if f, ok := err.(types.HasFault); ok { + switch f.Fault().(type) { + case *types.NotAuthenticated: + return nil, nil + } + } + + return nil, err + } + + return mgr.CurrentSession, nil +} + +func (sm *Manager) TerminateSession(ctx context.Context, sessionId []string) error { + req := types.TerminateSession{ + This: sm.Reference(), + SessionId: sessionId, + } + + _, err := methods.TerminateSession(ctx, sm.client, &req) + return err +} + +// SessionIsActive checks whether the session that was created at login is +// still valid. This function only works against vCenter. +func (sm *Manager) SessionIsActive(ctx context.Context) (bool, error) { + if sm.userSession == nil { + return false, nil + } + + req := types.SessionIsActive{ + This: sm.Reference(), + SessionID: sm.userSession.Key, + UserName: sm.userSession.UserName, + } + + active, err := methods.SessionIsActive(ctx, sm.client, &req) + if err != nil { + return false, err + } + + return active.Returnval, err +} + +func (sm *Manager) AcquireGenericServiceTicket(ctx context.Context, spec types.BaseSessionManagerServiceRequestSpec) (*types.SessionManagerGenericServiceTicket, error) { + req := types.AcquireGenericServiceTicket{ + This: sm.Reference(), + Spec: spec, + } + + res, err := methods.AcquireGenericServiceTicket(ctx, sm.client, &req) + if err != nil { + return nil, err + } + + return &res.Returnval, nil +} + +func (sm *Manager) AcquireLocalTicket(ctx context.Context, userName string) (*types.SessionManagerLocalTicket, error) { + req := types.AcquireLocalTicket{ + This: sm.Reference(), + UserName: userName, + } + + res, err := methods.AcquireLocalTicket(ctx, sm.client, &req) + if err != nil { + return nil, err + } + + return &res.Returnval, nil +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/session/manager_test.go juju-core-2.0.2/src/github.com/vmware/govmomi/session/manager_test.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/session/manager_test.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/session/manager_test.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,106 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package session + +import ( + "net/url" + "testing" + + "github.com/vmware/govmomi/test" + "github.com/vmware/govmomi/vim25" + "github.com/vmware/govmomi/vim25/soap" + "golang.org/x/net/context" +) + +func sessionClient(u *url.URL, t *testing.T) *Manager { + soapClient := soap.NewClient(u, true) + vimClient, err := vim25.NewClient(context.Background(), soapClient) + if err != nil { + t.Fatal(err) + } + + return NewManager(vimClient) +} + +func TestLogin(t *testing.T) { + u := test.URL() + if u == nil { + t.SkipNow() + } + + session := sessionClient(u, t) + err := session.Login(context.Background(), u.User) + if err != nil { + t.Errorf("Expected no error, got %v", err) + } +} + +func TestLogout(t *testing.T) { + u := test.URL() + if u == nil { + t.SkipNow() + } + + session := sessionClient(u, t) + err := session.Login(context.Background(), u.User) + if err != nil { + t.Error("Login Error: ", err) + } + + err = session.Logout(context.Background()) + if err != nil { + t.Errorf("Expected nil, got %v", err) + } + + err = session.Logout(context.Background()) + if err == nil { + t.Errorf("Expected NotAuthenticated, got nil") + } +} + +func TestSessionIsActive(t *testing.T) { + u := test.URL() + if u == nil { + t.SkipNow() + } + + session := sessionClient(u, t) + + // Skip test against ESXi -- SessionIsActive is not implemented + if session.client.ServiceContent.About.ApiType != "VirtualCenter" { + t.Skipf("Talking to %s instead of %s", session.client.ServiceContent.About.ApiType, "VirtualCenter") + } + + err := session.Login(context.Background(), u.User) + if err != nil { + t.Error("Login Error: ", err) + } + + active, err := session.SessionIsActive(context.Background()) + if err != nil || !active { + t.Errorf("Expected %t, got %t", true, active) + t.Errorf("Expected nil, got %v", err) + } + + session.Logout(context.Background()) + + active, err = session.SessionIsActive(context.Background()) + if err == nil || active { + t.Errorf("Expected %t, got %t", false, active) + t.Errorf("Expected NotAuthenticated, got %v", err) + } +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/task/error.go juju-core-2.0.2/src/github.com/vmware/govmomi/task/error.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/task/error.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/task/error.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,32 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package task + +import "github.com/vmware/govmomi/vim25/types" + +type Error struct { + *types.LocalizedMethodFault +} + +// Error returns the task's localized fault message. +func (e Error) Error() string { + return e.LocalizedMethodFault.LocalizedMessage +} + +func (e Error) Fault() types.BaseMethodFault { + return e.LocalizedMethodFault.Fault +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/task/wait.go juju-core-2.0.2/src/github.com/vmware/govmomi/task/wait.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/task/wait.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/task/wait.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,126 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package task + +import ( + "github.com/vmware/govmomi/property" + "github.com/vmware/govmomi/vim25/progress" + "github.com/vmware/govmomi/vim25/types" + "golang.org/x/net/context" +) + +type taskProgress struct { + info *types.TaskInfo +} + +func (t taskProgress) Percentage() float32 { + return float32(t.info.Progress) +} + +func (t taskProgress) Detail() string { + return "" +} + +func (t taskProgress) Error() error { + if t.info.Error != nil { + return Error{t.info.Error} + } + + return nil +} + +type taskCallback struct { + ch chan<- progress.Report + info *types.TaskInfo + err error +} + +func (t *taskCallback) fn(pc []types.PropertyChange) bool { + for _, c := range pc { + if c.Name != "info" { + continue + } + + if c.Op != types.PropertyChangeOpAssign { + continue + } + + if c.Val == nil { + continue + } + + ti := c.Val.(types.TaskInfo) + t.info = &ti + } + + pr := taskProgress{t.info} + + // Store copy of error, so Wait() can return it as well. + t.err = pr.Error() + + switch t.info.State { + case types.TaskInfoStateQueued, types.TaskInfoStateRunning: + if t.ch != nil { + // Don't care if this is dropped + select { + case t.ch <- pr: + default: + } + } + return false + case types.TaskInfoStateSuccess, types.TaskInfoStateError: + if t.ch != nil { + // Last one must always be delivered + t.ch <- pr + } + return true + default: + panic("unknown state: " + t.info.State) + } +} + +// Wait waits for a task to finish with either success or failure. It does so +// by waiting for the "info" property of task managed object to change. The +// function returns when it finds the task in the "success" or "error" state. +// In the former case, the return value is nil. In the latter case the return +// value is an instance of this package's Error struct. +// +// Any error returned while waiting for property changes causes the function to +// return immediately and propagate the error. +// +// If the progress.Sinker argument is specified, any progress updates for the +// task are sent here. The completion percentage is passed through directly. +// The detail for the progress update is set to an empty string. If the task +// finishes in the error state, the error instance is passed through as well. +// Note that this error is the same error that is returned by this function. +// +func Wait(ctx context.Context, ref types.ManagedObjectReference, pc *property.Collector, s progress.Sinker) (*types.TaskInfo, error) { + cb := &taskCallback{} + + // Include progress sink if specified + if s != nil { + cb.ch = s.Sink() + defer close(cb.ch) + } + + err := property.Wait(ctx, pc, ref, []string{"info"}, cb.fn) + if err != nil { + return nil, err + } + + return cb.info, cb.err +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/test/doc.go juju-core-2.0.2/src/github.com/vmware/govmomi/test/doc.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/test/doc.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/test/doc.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,22 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +/* +Package test contains functions that implement common functionality between +tests. The code (non-test) in this package intentionally does not take any +dependendies outside the vim25 tree. +*/ +package test diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/test/functional/helper.go juju-core-2.0.2/src/github.com/vmware/govmomi/test/functional/helper.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/test/functional/helper.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/test/functional/helper.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,130 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package functional + +import ( + "testing" + + "github.com/vmware/govmomi/find" + "github.com/vmware/govmomi/object" + "github.com/vmware/govmomi/property" + "github.com/vmware/govmomi/test" + "github.com/vmware/govmomi/vim25" + "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/types" + "golang.org/x/net/context" +) + +type Helper struct { + *testing.T + + c *vim25.Client + f *find.Finder + fns []func() +} + +func NewHelper(t *testing.T) *Helper { + h := &Helper{ + T: t, + + c: test.NewAuthenticatedClient(t), + fns: make([]func(), 0), + } + + h.f = find.NewFinder(h.c, true) + + return h +} + +func (h *Helper) Defer(fn func()) { + h.fns = append(h.fns, fn) +} + +func (h *Helper) Teardown() { + for _, fn := range h.fns { + fn() + } +} + +func (h *Helper) RequireVirtualCenter() { + var expect = "VirtualCenter" + var actual = h.c.ServiceContent.About.ApiType + if actual != expect { + h.Skipf("Requires %s, running against %s", expect, actual) + } +} + +func (h *Helper) Datacenter() *object.Datacenter { + dc, err := h.f.DefaultDatacenter(context.Background()) + if err != nil { + h.Fatal(err) + } + + h.f.SetDatacenter(dc) + + return dc +} + +func (h *Helper) DatacenterFolders() *object.DatacenterFolders { + df, err := h.Datacenter().Folders(context.Background()) + if err != nil { + h.Fatal(err) + } + + return df +} + +func (h *Helper) ComputeResource() *object.ComputeResource { + cr, err := h.f.DefaultComputeResource(context.Background()) + if err != nil { + h.Fatal(err) + } + + return cr +} + +func (h *Helper) LocalDatastores(ctx context.Context, cr *object.ComputeResource) ([]*object.Datastore, error) { + // List datastores for compute resource + dss, err := cr.Datastores(ctx) + if err != nil { + return nil, err + } + + // Filter local datastores + var ldss []*object.Datastore + for _, ds := range dss { + var mds mo.Datastore + err = property.DefaultCollector(h.c).RetrieveOne(ctx, ds.Reference(), nil, &mds) + if err != nil { + return nil, err + } + + switch i := mds.Info.(type) { + case *types.VmfsDatastoreInfo: + if i.Vmfs.Local != nil && *i.Vmfs.Local == true { + break + } + default: + continue + } + + ds.InventoryPath = mds.Name + ldss = append(ldss, ds) + } + + return ldss, nil +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/test/functional/issue_242_test.go juju-core-2.0.2/src/github.com/vmware/govmomi/test/functional/issue_242_test.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/test/functional/issue_242_test.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/test/functional/issue_242_test.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,104 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package functional + +import ( + "fmt" + "testing" + "time" + + "github.com/vmware/govmomi/object" + "github.com/vmware/govmomi/property" + "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/types" + "golang.org/x/net/context" +) + +func TestIssue242(t *testing.T) { + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + + h := NewHelper(t) + defer h.Teardown() + + h.RequireVirtualCenter() + + df, err := h.Datacenter().Folders(ctx) + if err != nil { + t.Fatal(err) + } + + cr := h.ComputeResource() + + // Get local datastores for compute resource + dss, err := h.LocalDatastores(ctx, cr) + if err != nil { + t.Fatal(err) + } + if len(dss) == 0 { + t.Fatalf("No local datastores") + } + + // Get root resource pool for compute resource + rp, err := cr.ResourcePool(ctx) + if err != nil { + t.Fatal(err) + } + + spec := types.VirtualMachineConfigSpec{ + Name: fmt.Sprintf("govmomi-test-%s", time.Now().Format(time.RFC3339)), + Files: &types.VirtualMachineFileInfo{VmPathName: fmt.Sprintf("[%s]", dss[0].Name())}, + NumCPUs: 1, + MemoryMB: 32, + } + + // Create new VM + task, err := df.VmFolder.CreateVM(context.Background(), spec, rp, nil) + if err != nil { + t.Fatal(err) + } + + info, err := task.WaitForResult(context.Background(), nil) + if err != nil { + t.Fatal(err) + } + + vm := object.NewVirtualMachine(h.c, info.Result.(types.ManagedObjectReference)) + defer func() { + task, err := vm.Destroy(context.Background()) + if err != nil { + panic(err) + } + err = task.Wait(context.Background()) + if err != nil { + panic(err) + } + }() + + // Mark VM as template + err = vm.MarkAsTemplate(context.Background()) + if err != nil { + t.Fatal(err) + } + + // Get "environmentBrowser" property for VM template + var mvm mo.VirtualMachine + err = property.DefaultCollector(h.c).RetrieveOne(ctx, vm.Reference(), []string{"environmentBrowser"}, &mvm) + if err != nil { + t.Fatal(err) + } +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/test/helper.go juju-core-2.0.2/src/github.com/vmware/govmomi/test/helper.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/test/helper.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/test/helper.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,73 @@ +/* +Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package test + +import ( + "net/url" + "os" + "testing" + + "github.com/vmware/govmomi/vim25" + "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/soap" + "github.com/vmware/govmomi/vim25/types" + "golang.org/x/net/context" +) + +// URL parses the GOVMOMI_TEST_URL environment variable if set. +func URL() *url.URL { + s := os.Getenv("GOVMOMI_TEST_URL") + if s == "" { + return nil + } + u, err := soap.ParseURL(s) + if err != nil { + panic(err) + } + return u +} + +// NewAuthenticatedClient creates a new vim25.Client, authenticates the user +// specified in the test URL, and returns it. +func NewAuthenticatedClient(t *testing.T) *vim25.Client { + u := URL() + if u == nil { + t.SkipNow() + } + + soapClient := soap.NewClient(u, true) + vimClient, err := vim25.NewClient(context.Background(), soapClient) + if err != nil { + t.Fatal(err) + } + + req := types.Login{ + This: *vimClient.ServiceContent.SessionManager, + } + + req.UserName = u.User.Username() + if pw, ok := u.User.Password(); ok { + req.Password = pw + } + + _, err = methods.Login(context.Background(), vimClient, &req) + if err != nil { + t.Fatal(err) + } + + return vimClient +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/.travis.yml juju-core-2.0.2/src/github.com/vmware/govmomi/.travis.yml --- juju-core-2.0.0/src/github.com/vmware/govmomi/.travis.yml 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/.travis.yml 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,12 @@ +sudo: false + +language: go + +go: + - 1.6 + +before_install: + - make vendor + +script: + - make check test diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/units/size.go juju-core-2.0.2/src/github.com/vmware/govmomi/units/size.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/units/size.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/units/size.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,89 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package units + +import ( + "errors" + "fmt" + "regexp" + "strconv" +) + +type ByteSize int64 + +const ( + _ = iota + KB = 1 << (10 * iota) + MB + GB + TB + PB + EB +) + +func (b ByteSize) String() string { + switch { + case b >= EB: + return fmt.Sprintf("%.1fEB", float32(b)/EB) + case b >= PB: + return fmt.Sprintf("%.1fPB", float32(b)/PB) + case b >= TB: + return fmt.Sprintf("%.1fTB", float32(b)/TB) + case b >= GB: + return fmt.Sprintf("%.1fGB", float32(b)/GB) + case b >= MB: + return fmt.Sprintf("%.1fMB", float32(b)/MB) + case b >= KB: + return fmt.Sprintf("%.1fKB", float32(b)/KB) + } + return fmt.Sprintf("%dB", b) +} + +var bytesRegexp = regexp.MustCompile(`^(?i)(\d+)([BKMGTPE]?)(ib|b)?$`) + +func (b *ByteSize) Set(s string) error { + m := bytesRegexp.FindStringSubmatch(s) + if len(m) == 0 { + return errors.New("invalid byte value") + } + + i, err := strconv.ParseInt(m[1], 10, 64) + if err != nil { + return err + } + *b = ByteSize(i) + + switch m[2] { + case "B", "b", "": + case "K", "k": + *b *= ByteSize(KB) + case "M", "m": + *b *= ByteSize(MB) + case "G", "g": + *b *= ByteSize(GB) + case "T", "t": + *b *= ByteSize(TB) + case "P", "p": + *b *= ByteSize(PB) + case "E", "e": + *b *= ByteSize(EB) + default: + return errors.New("invalid byte suffix") + } + + return nil +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/units/size_test.go juju-core-2.0.2/src/github.com/vmware/govmomi/units/size_test.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/units/size_test.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/units/size_test.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,145 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package units + +import ( + "fmt" + "math" + "testing" +) + +func TestMB(t *testing.T) { + b := ByteSize(1024 * 1024) + expected := "1.0MB" + if b.String() != expected { + t.Errorf("Expected '%v' but got '%v'", expected, b) + } +} + +func TestTenMB(t *testing.T) { + b := ByteSize(10 * 1024 * 1024) + actual := fmt.Sprintf("%s", b) + expected := "10.0MB" + if actual != expected { + t.Errorf("Expected '%v' but got '%v'", expected, actual) + } +} + +func assertEquals(t *testing.T, expected string, actual ByteSize) { + if expected != actual.String() { + t.Errorf("Expected '%v' but got '%v'", expected, actual.String()) + } +} + +func TestByteSize(t *testing.T) { + assertEquals(t, "1B", ByteSize(1)) + assertEquals(t, "10B", ByteSize(10)) + assertEquals(t, "100B", ByteSize(100)) + assertEquals(t, "1000B", ByteSize(1000)) + assertEquals(t, "1.0KB", ByteSize(1024)) + assertEquals(t, "1.0MB", ByteSize(1024*1024)) + assertEquals(t, "1.0MB", ByteSize(1048576)) + assertEquals(t, "10.0MB", ByteSize(10*math.Pow(1024, 2))) + assertEquals(t, "1.0GB", ByteSize(1024*1024*1024)) + assertEquals(t, "1.0TB", ByteSize(1024*1024*1024*1024)) + assertEquals(t, "1.0TB", ByteSize(1048576*1048576)) + assertEquals(t, "1.0PB", ByteSize(1024*1024*1024*1024*1024)) + assertEquals(t, "1.0EB", ByteSize(1024*1024*1024*1024*1024*1024)) + assertEquals(t, "1.0EB", ByteSize(1048576*1048576*1048576)) +} + +func TestByteSizeSet(t *testing.T) { + var tests = []struct { + In string + OutStr string + Out ByteSize + }{ + { + In: "345", + OutStr: "345B", + Out: 345.0, + }, + { + In: "345b", + OutStr: "345B", + Out: 345.0, + }, + { + In: "345K", + OutStr: "345.0KB", + Out: 345 * KB, + }, + { + In: "345kb", + OutStr: "345.0KB", + Out: 345 * KB, + }, + { + In: "345kib", + OutStr: "345.0KB", + Out: 345 * KB, + }, + { + In: "345KiB", + OutStr: "345.0KB", + Out: 345 * KB, + }, + { + In: "345M", + OutStr: "345.0MB", + Out: 345 * MB, + }, + { + In: "345G", + OutStr: "345.0GB", + Out: 345 * GB, + }, + { + In: "345T", + OutStr: "345.0TB", + Out: 345 * TB, + }, + { + In: "345P", + OutStr: "345.0PB", + Out: 345 * PB, + }, + { + In: "3E", + OutStr: "3.0EB", + Out: 3 * EB, + }, + } + + for _, test := range tests { + var v ByteSize + err := v.Set(test.In) + if err != nil { + t.Errorf("Error: %s [%v]", err, test.In) + continue + } + + if v != test.Out { + t.Errorf("Out: expect '%v' actual '%v'", test.Out, v) + continue + } + + if v.String() != test.OutStr { + t.Errorf("String: expect '%v' actual '%v'", test.OutStr, v.String()) + } + } +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/view/list_view.go juju-core-2.0.2/src/github.com/vmware/govmomi/view/list_view.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/view/list_view.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/view/list_view.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,33 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package view + +import ( + "github.com/vmware/govmomi/object" + "github.com/vmware/govmomi/vim25" + "github.com/vmware/govmomi/vim25/types" +) + +type ListView struct { + *object.ListView +} + +func NewListView(c *vim25.Client, ref types.ManagedObjectReference) *ListView { + return &ListView{ + ListView: object.NewListView(c, ref), + } +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/view/manager.go juju-core-2.0.2/src/github.com/vmware/govmomi/view/manager.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/view/manager.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/view/manager.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,51 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package view + +import ( + "github.com/vmware/govmomi/object" + "github.com/vmware/govmomi/vim25" + "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/types" + "golang.org/x/net/context" +) + +type Manager struct { + object.Common +} + +func NewManager(c *vim25.Client) *Manager { + m := Manager{ + object.NewCommon(c, *c.ServiceContent.ViewManager), + } + + return &m +} + +func (m Manager) CreateListView(ctx context.Context, objects []types.ManagedObjectReference) (*ListView, error) { + req := types.CreateListView{ + This: m.Common.Reference(), + Obj: objects, + } + + res, err := methods.CreateListView(ctx, m.Client(), &req) + if err != nil { + return nil, err + } + + return NewListView(m.Client(), res.Returnval), nil +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/vim25/client.go juju-core-2.0.2/src/github.com/vmware/govmomi/vim25/client.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/vim25/client.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/vim25/client.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,123 @@ +/* +Copyright (c) 2015-2016 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package vim25 + +import ( + "encoding/json" + + "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/soap" + "github.com/vmware/govmomi/vim25/types" + "golang.org/x/net/context" +) + +// Client is a tiny wrapper around the vim25/soap Client that stores session +// specific state (i.e. state that only needs to be retrieved once after the +// client has been created). This means the client can be reused after +// serialization without performing additional requests for initialization. +type Client struct { + *soap.Client + + ServiceContent types.ServiceContent + + // RoundTripper is a separate field such that the client's implementation of + // the RoundTripper interface can be wrapped by separate implementations for + // extra functionality (for example, reauthentication on session timeout). + RoundTripper soap.RoundTripper +} + +// NewClient creates and returns a new client wirh the ServiceContent field +// filled in. +func NewClient(ctx context.Context, rt soap.RoundTripper) (*Client, error) { + serviceContent, err := methods.GetServiceContent(ctx, rt) + if err != nil { + return nil, err + } + + c := Client{ + ServiceContent: serviceContent, + RoundTripper: rt, + } + + // Set client if it happens to be a soap.Client + if sc, ok := rt.(*soap.Client); ok { + c.Client = sc + } + + return &c, nil +} + +// RoundTrip dispatches to the RoundTripper field. +func (c *Client) RoundTrip(ctx context.Context, req, res soap.HasFault) error { + return c.RoundTripper.RoundTrip(ctx, req, res) +} + +type marshaledClient struct { + SoapClient *soap.Client + ServiceContent types.ServiceContent +} + +func (c *Client) MarshalJSON() ([]byte, error) { + m := marshaledClient{ + SoapClient: c.Client, + ServiceContent: c.ServiceContent, + } + + return json.Marshal(m) +} + +func (c *Client) UnmarshalJSON(b []byte) error { + var m marshaledClient + + err := json.Unmarshal(b, &m) + if err != nil { + return err + } + + *c = Client{ + Client: m.SoapClient, + ServiceContent: m.ServiceContent, + RoundTripper: m.SoapClient, + } + + return nil +} + +// Valid returns whether or not the client is valid and ready for use. +// This should be called after unmarshalling the client. +func (c *Client) Valid() bool { + if c == nil { + return false + } + + if c.Client == nil { + return false + } + + // Use arbitrary pointer field in the service content. + // Doesn't matter which one, as long as it is populated by default. + if c.ServiceContent.SessionManager == nil { + return false + } + + return true +} + +// IsVC returns true if we are connected to a vCenter +func (c *Client) IsVC() bool { + return c.ServiceContent.About.ApiType == "VirtualCenter" +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/vim25/client_test.go juju-core-2.0.2/src/github.com/vmware/govmomi/vim25/client_test.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/vim25/client_test.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/vim25/client_test.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,97 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package vim25 + +import ( + "encoding/json" + "net/url" + "os" + "testing" + + "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/soap" + "github.com/vmware/govmomi/vim25/types" + "golang.org/x/net/context" +) + +// Duplicated to prevent cyclic dependency... +func testURL(t *testing.T) *url.URL { + s := os.Getenv("GOVMOMI_TEST_URL") + if s == "" { + t.SkipNow() + } + u, err := soap.ParseURL(s) + if err != nil { + panic(err) + } + return u +} + +func sessionLogin(t *testing.T, c *Client) { + req := types.Login{ + This: *c.ServiceContent.SessionManager, + } + + u := testURL(t).User + req.UserName = u.Username() + if pw, ok := u.Password(); ok { + req.Password = pw + } + + _, err := methods.Login(context.Background(), c, &req) + if err != nil { + t.Fatal(err) + } +} + +func sessionCheck(t *testing.T, c *Client) { + var mgr mo.SessionManager + + err := mo.RetrieveProperties(context.Background(), c, c.ServiceContent.PropertyCollector, *c.ServiceContent.SessionManager, &mgr) + if err != nil { + t.Fatal(err) + } +} + +func TestClientSerialization(t *testing.T) { + var c1, c2 *Client + + soapClient := soap.NewClient(testURL(t), true) + c1, err := NewClient(context.Background(), soapClient) + if err != nil { + t.Fatal(err) + } + + // Login + sessionLogin(t, c1) + sessionCheck(t, c1) + + // Serialize/deserialize + b, err := json.Marshal(c1) + if err != nil { + t.Fatal(err) + } + c2 = &Client{} + err = json.Unmarshal(b, c2) + if err != nil { + t.Fatal(err) + } + + // Check the session is still valid + sessionCheck(t, c2) +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/vim25/debug/debug.go juju-core-2.0.2/src/github.com/vmware/govmomi/vim25/debug/debug.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/vim25/debug/debug.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/vim25/debug/debug.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,81 @@ +/* +Copyright (c) 2014 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package debug + +import ( + "io" + "os" + "path" +) + +// Provider specified the interface types must implement to be used as a +// debugging sink. Having multiple such sink implementations allows it to be +// changed externally (for example when running tests). +type Provider interface { + NewFile(s string) io.WriteCloser + Flush() +} + +var currentProvider Provider = nil + +func SetProvider(p Provider) { + if currentProvider != nil { + currentProvider.Flush() + } + currentProvider = p +} + +// Enabled returns whether debugging is enabled or not. +func Enabled() bool { + return currentProvider != nil +} + +// NewFile dispatches to the current provider's NewFile function. +func NewFile(s string) io.WriteCloser { + return currentProvider.NewFile(s) +} + +// Flush dispatches to the current provider's Flush function. +func Flush() { + currentProvider.Flush() +} + +// FileProvider implements a debugging provider that creates a real file for +// every call to NewFile. It maintains a list of all files that it creates, +// such that it can close them when its Flush function is called. +type FileProvider struct { + Path string + + files []*os.File +} + +func (fp *FileProvider) NewFile(p string) io.WriteCloser { + f, err := os.Create(path.Join(fp.Path, p)) + if err != nil { + panic(err) + } + + fp.files = append(fp.files, f) + + return f +} + +func (fp *FileProvider) Flush() { + for _, f := range fp.files { + f.Close() + } +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/vim25/doc.go juju-core-2.0.2/src/github.com/vmware/govmomi/vim25/doc.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/vim25/doc.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/vim25/doc.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,29 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +/* +Package vim25 provides a minimal client implementation to use with other +packages in the vim25 tree. The code in this package intentionally does not +take any dependendies outside the vim25 tree. + +The client implementation in this package embeds the soap.Client structure. +Additionally, it stores the value of the session's ServiceContent object. This +object stores references to a variety of subsystems, such as the root property +collector, the session manager, and the search index. The client is fully +functional after serialization and deserialization, without the need for +additional requests for initialization. +*/ +package vim25 diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/vim25/methods/fault_test.go juju-core-2.0.2/src/github.com/vmware/govmomi/vim25/methods/fault_test.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/vim25/methods/fault_test.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/vim25/methods/fault_test.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,62 @@ +/* +Copyright (c) 2014 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package methods + +import ( + "bytes" + "testing" + + "github.com/vmware/govmomi/vim25/soap" + "github.com/vmware/govmomi/vim25/types" + "github.com/vmware/govmomi/vim25/xml" +) + +var invalidLoginFault = ` + + + +ServerFaultCodeCannot complete login due to an incorrect user name or password. + +` + +type TestBody struct { + Fault *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func TestFaultDetail(t *testing.T) { + body := TestBody{} + env := soap.Envelope{Body: &body} + + dec := xml.NewDecoder(bytes.NewReader([]byte(invalidLoginFault))) + dec.TypeFunc = types.TypeFunc() + + err := dec.Decode(&env) + if err != nil { + t.Fatalf("Decode: %s", err) + } + + if body.Fault == nil { + t.Fatal("Expected fault") + } + + if _, ok := body.Fault.Detail.Fault.(types.InvalidLogin); !ok { + t.Fatalf("Expected InvalidLogin, got: %#v", body.Fault.Detail.Fault) + } +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/vim25/methods/internal.go juju-core-2.0.2/src/github.com/vmware/govmomi/vim25/methods/internal.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/vim25/methods/internal.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/vim25/methods/internal.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,123 @@ +/* +Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package methods + +import ( + "github.com/vmware/govmomi/vim25/soap" + "github.com/vmware/govmomi/vim25/types" + "golang.org/x/net/context" +) + +type RetrieveDynamicTypeManagerBody struct { + Req *types.RetrieveDynamicTypeManager `xml:"urn:vim25 RetrieveDynamicTypeManager"` + Res *types.RetrieveDynamicTypeManagerResponse `xml:"urn:vim25 RetrieveDynamicTypeManagerResponse"` + Fault_ *soap.Fault +} + +func (b *RetrieveDynamicTypeManagerBody) Fault() *soap.Fault { return b.Fault_ } + +func RetrieveDynamicTypeManager(ctx context.Context, r soap.RoundTripper, req *types.RetrieveDynamicTypeManager) (*types.RetrieveDynamicTypeManagerResponse, error) { + var reqBody, resBody RetrieveDynamicTypeManagerBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type RetrieveManagedMethodExecuterBody struct { + Req *types.RetrieveManagedMethodExecuter `xml:"urn:vim25 RetrieveManagedMethodExecuter"` + Res *types.RetrieveManagedMethodExecuterResponse `xml:"urn:vim25 RetrieveManagedMethodExecuterResponse"` + Fault_ *soap.Fault +} + +func (b *RetrieveManagedMethodExecuterBody) Fault() *soap.Fault { return b.Fault_ } + +func RetrieveManagedMethodExecuter(ctx context.Context, r soap.RoundTripper, req *types.RetrieveManagedMethodExecuter) (*types.RetrieveManagedMethodExecuterResponse, error) { + var reqBody, resBody RetrieveManagedMethodExecuterBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type DynamicTypeMgrQueryMoInstancesBody struct { + Req *types.DynamicTypeMgrQueryMoInstances `xml:"urn:vim25 DynamicTypeMgrQueryMoInstances"` + Res *types.DynamicTypeMgrQueryMoInstancesResponse `xml:"urn:vim25 DynamicTypeMgrQueryMoInstancesResponse"` + Fault_ *soap.Fault +} + +func (b *DynamicTypeMgrQueryMoInstancesBody) Fault() *soap.Fault { return b.Fault_ } + +func DynamicTypeMgrQueryMoInstances(ctx context.Context, r soap.RoundTripper, req *types.DynamicTypeMgrQueryMoInstances) (*types.DynamicTypeMgrQueryMoInstancesResponse, error) { + var reqBody, resBody DynamicTypeMgrQueryMoInstancesBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type DynamicTypeMgrQueryTypeInfoBody struct { + Req *types.DynamicTypeMgrQueryTypeInfo `xml:"urn:vim25 DynamicTypeMgrQueryTypeInfo"` + Res *types.DynamicTypeMgrQueryTypeInfoResponse `xml:"urn:vim25 DynamicTypeMgrQueryTypeInfoResponse"` + Fault_ *soap.Fault +} + +func (b *DynamicTypeMgrQueryTypeInfoBody) Fault() *soap.Fault { return b.Fault_ } + +func DynamicTypeMgrQueryTypeInfo(ctx context.Context, r soap.RoundTripper, req *types.DynamicTypeMgrQueryTypeInfo) (*types.DynamicTypeMgrQueryTypeInfoResponse, error) { + var reqBody, resBody DynamicTypeMgrQueryTypeInfoBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type ExecuteSoapBody struct { + Req *types.ExecuteSoap `xml:"urn:vim25 ExecuteSoap"` + Res *types.ExecuteSoapResponse `xml:"urn:vim25 ExecuteSoapResponse"` + Fault_ *soap.Fault +} + +func (b *ExecuteSoapBody) Fault() *soap.Fault { return b.Fault_ } + +func ExecuteSoap(ctx context.Context, r soap.RoundTripper, req *types.ExecuteSoap) (*types.ExecuteSoapResponse, error) { + var reqBody, resBody ExecuteSoapBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/vim25/methods/methods.go juju-core-2.0.2/src/github.com/vmware/govmomi/vim25/methods/methods.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/vim25/methods/methods.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/vim25/methods/methods.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,14103 @@ +/* +Copyright (c) 2014-2016 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package methods + +import ( + "github.com/vmware/govmomi/vim25/soap" + "github.com/vmware/govmomi/vim25/types" + "golang.org/x/net/context" +) + +type AbdicateDomOwnershipBody struct { + Req *types.AbdicateDomOwnership `xml:"urn:vim25 AbdicateDomOwnership,omitempty"` + Res *types.AbdicateDomOwnershipResponse `xml:"urn:vim25 AbdicateDomOwnershipResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *AbdicateDomOwnershipBody) Fault() *soap.Fault { return b.Fault_ } + +func AbdicateDomOwnership(ctx context.Context, r soap.RoundTripper, req *types.AbdicateDomOwnership) (*types.AbdicateDomOwnershipResponse, error) { + var reqBody, resBody AbdicateDomOwnershipBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type AcknowledgeAlarmBody struct { + Req *types.AcknowledgeAlarm `xml:"urn:vim25 AcknowledgeAlarm,omitempty"` + Res *types.AcknowledgeAlarmResponse `xml:"urn:vim25 AcknowledgeAlarmResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *AcknowledgeAlarmBody) Fault() *soap.Fault { return b.Fault_ } + +func AcknowledgeAlarm(ctx context.Context, r soap.RoundTripper, req *types.AcknowledgeAlarm) (*types.AcknowledgeAlarmResponse, error) { + var reqBody, resBody AcknowledgeAlarmBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type AcquireCimServicesTicketBody struct { + Req *types.AcquireCimServicesTicket `xml:"urn:vim25 AcquireCimServicesTicket,omitempty"` + Res *types.AcquireCimServicesTicketResponse `xml:"urn:vim25 AcquireCimServicesTicketResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *AcquireCimServicesTicketBody) Fault() *soap.Fault { return b.Fault_ } + +func AcquireCimServicesTicket(ctx context.Context, r soap.RoundTripper, req *types.AcquireCimServicesTicket) (*types.AcquireCimServicesTicketResponse, error) { + var reqBody, resBody AcquireCimServicesTicketBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type AcquireCloneTicketBody struct { + Req *types.AcquireCloneTicket `xml:"urn:vim25 AcquireCloneTicket,omitempty"` + Res *types.AcquireCloneTicketResponse `xml:"urn:vim25 AcquireCloneTicketResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *AcquireCloneTicketBody) Fault() *soap.Fault { return b.Fault_ } + +func AcquireCloneTicket(ctx context.Context, r soap.RoundTripper, req *types.AcquireCloneTicket) (*types.AcquireCloneTicketResponse, error) { + var reqBody, resBody AcquireCloneTicketBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type AcquireCredentialsInGuestBody struct { + Req *types.AcquireCredentialsInGuest `xml:"urn:vim25 AcquireCredentialsInGuest,omitempty"` + Res *types.AcquireCredentialsInGuestResponse `xml:"urn:vim25 AcquireCredentialsInGuestResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *AcquireCredentialsInGuestBody) Fault() *soap.Fault { return b.Fault_ } + +func AcquireCredentialsInGuest(ctx context.Context, r soap.RoundTripper, req *types.AcquireCredentialsInGuest) (*types.AcquireCredentialsInGuestResponse, error) { + var reqBody, resBody AcquireCredentialsInGuestBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type AcquireGenericServiceTicketBody struct { + Req *types.AcquireGenericServiceTicket `xml:"urn:vim25 AcquireGenericServiceTicket,omitempty"` + Res *types.AcquireGenericServiceTicketResponse `xml:"urn:vim25 AcquireGenericServiceTicketResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *AcquireGenericServiceTicketBody) Fault() *soap.Fault { return b.Fault_ } + +func AcquireGenericServiceTicket(ctx context.Context, r soap.RoundTripper, req *types.AcquireGenericServiceTicket) (*types.AcquireGenericServiceTicketResponse, error) { + var reqBody, resBody AcquireGenericServiceTicketBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type AcquireLocalTicketBody struct { + Req *types.AcquireLocalTicket `xml:"urn:vim25 AcquireLocalTicket,omitempty"` + Res *types.AcquireLocalTicketResponse `xml:"urn:vim25 AcquireLocalTicketResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *AcquireLocalTicketBody) Fault() *soap.Fault { return b.Fault_ } + +func AcquireLocalTicket(ctx context.Context, r soap.RoundTripper, req *types.AcquireLocalTicket) (*types.AcquireLocalTicketResponse, error) { + var reqBody, resBody AcquireLocalTicketBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type AcquireMksTicketBody struct { + Req *types.AcquireMksTicket `xml:"urn:vim25 AcquireMksTicket,omitempty"` + Res *types.AcquireMksTicketResponse `xml:"urn:vim25 AcquireMksTicketResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *AcquireMksTicketBody) Fault() *soap.Fault { return b.Fault_ } + +func AcquireMksTicket(ctx context.Context, r soap.RoundTripper, req *types.AcquireMksTicket) (*types.AcquireMksTicketResponse, error) { + var reqBody, resBody AcquireMksTicketBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type AcquireTicketBody struct { + Req *types.AcquireTicket `xml:"urn:vim25 AcquireTicket,omitempty"` + Res *types.AcquireTicketResponse `xml:"urn:vim25 AcquireTicketResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *AcquireTicketBody) Fault() *soap.Fault { return b.Fault_ } + +func AcquireTicket(ctx context.Context, r soap.RoundTripper, req *types.AcquireTicket) (*types.AcquireTicketResponse, error) { + var reqBody, resBody AcquireTicketBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type AddAuthorizationRoleBody struct { + Req *types.AddAuthorizationRole `xml:"urn:vim25 AddAuthorizationRole,omitempty"` + Res *types.AddAuthorizationRoleResponse `xml:"urn:vim25 AddAuthorizationRoleResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *AddAuthorizationRoleBody) Fault() *soap.Fault { return b.Fault_ } + +func AddAuthorizationRole(ctx context.Context, r soap.RoundTripper, req *types.AddAuthorizationRole) (*types.AddAuthorizationRoleResponse, error) { + var reqBody, resBody AddAuthorizationRoleBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type AddCustomFieldDefBody struct { + Req *types.AddCustomFieldDef `xml:"urn:vim25 AddCustomFieldDef,omitempty"` + Res *types.AddCustomFieldDefResponse `xml:"urn:vim25 AddCustomFieldDefResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *AddCustomFieldDefBody) Fault() *soap.Fault { return b.Fault_ } + +func AddCustomFieldDef(ctx context.Context, r soap.RoundTripper, req *types.AddCustomFieldDef) (*types.AddCustomFieldDefResponse, error) { + var reqBody, resBody AddCustomFieldDefBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type AddDVPortgroup_TaskBody struct { + Req *types.AddDVPortgroup_Task `xml:"urn:vim25 AddDVPortgroup_Task,omitempty"` + Res *types.AddDVPortgroup_TaskResponse `xml:"urn:vim25 AddDVPortgroup_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *AddDVPortgroup_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func AddDVPortgroup_Task(ctx context.Context, r soap.RoundTripper, req *types.AddDVPortgroup_Task) (*types.AddDVPortgroup_TaskResponse, error) { + var reqBody, resBody AddDVPortgroup_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type AddDisks_TaskBody struct { + Req *types.AddDisks_Task `xml:"urn:vim25 AddDisks_Task,omitempty"` + Res *types.AddDisks_TaskResponse `xml:"urn:vim25 AddDisks_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *AddDisks_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func AddDisks_Task(ctx context.Context, r soap.RoundTripper, req *types.AddDisks_Task) (*types.AddDisks_TaskResponse, error) { + var reqBody, resBody AddDisks_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type AddGuestAliasBody struct { + Req *types.AddGuestAlias `xml:"urn:vim25 AddGuestAlias,omitempty"` + Res *types.AddGuestAliasResponse `xml:"urn:vim25 AddGuestAliasResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *AddGuestAliasBody) Fault() *soap.Fault { return b.Fault_ } + +func AddGuestAlias(ctx context.Context, r soap.RoundTripper, req *types.AddGuestAlias) (*types.AddGuestAliasResponse, error) { + var reqBody, resBody AddGuestAliasBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type AddHost_TaskBody struct { + Req *types.AddHost_Task `xml:"urn:vim25 AddHost_Task,omitempty"` + Res *types.AddHost_TaskResponse `xml:"urn:vim25 AddHost_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *AddHost_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func AddHost_Task(ctx context.Context, r soap.RoundTripper, req *types.AddHost_Task) (*types.AddHost_TaskResponse, error) { + var reqBody, resBody AddHost_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type AddInternetScsiSendTargetsBody struct { + Req *types.AddInternetScsiSendTargets `xml:"urn:vim25 AddInternetScsiSendTargets,omitempty"` + Res *types.AddInternetScsiSendTargetsResponse `xml:"urn:vim25 AddInternetScsiSendTargetsResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *AddInternetScsiSendTargetsBody) Fault() *soap.Fault { return b.Fault_ } + +func AddInternetScsiSendTargets(ctx context.Context, r soap.RoundTripper, req *types.AddInternetScsiSendTargets) (*types.AddInternetScsiSendTargetsResponse, error) { + var reqBody, resBody AddInternetScsiSendTargetsBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type AddInternetScsiStaticTargetsBody struct { + Req *types.AddInternetScsiStaticTargets `xml:"urn:vim25 AddInternetScsiStaticTargets,omitempty"` + Res *types.AddInternetScsiStaticTargetsResponse `xml:"urn:vim25 AddInternetScsiStaticTargetsResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *AddInternetScsiStaticTargetsBody) Fault() *soap.Fault { return b.Fault_ } + +func AddInternetScsiStaticTargets(ctx context.Context, r soap.RoundTripper, req *types.AddInternetScsiStaticTargets) (*types.AddInternetScsiStaticTargetsResponse, error) { + var reqBody, resBody AddInternetScsiStaticTargetsBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type AddLicenseBody struct { + Req *types.AddLicense `xml:"urn:vim25 AddLicense,omitempty"` + Res *types.AddLicenseResponse `xml:"urn:vim25 AddLicenseResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *AddLicenseBody) Fault() *soap.Fault { return b.Fault_ } + +func AddLicense(ctx context.Context, r soap.RoundTripper, req *types.AddLicense) (*types.AddLicenseResponse, error) { + var reqBody, resBody AddLicenseBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type AddNetworkResourcePoolBody struct { + Req *types.AddNetworkResourcePool `xml:"urn:vim25 AddNetworkResourcePool,omitempty"` + Res *types.AddNetworkResourcePoolResponse `xml:"urn:vim25 AddNetworkResourcePoolResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *AddNetworkResourcePoolBody) Fault() *soap.Fault { return b.Fault_ } + +func AddNetworkResourcePool(ctx context.Context, r soap.RoundTripper, req *types.AddNetworkResourcePool) (*types.AddNetworkResourcePoolResponse, error) { + var reqBody, resBody AddNetworkResourcePoolBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type AddPortGroupBody struct { + Req *types.AddPortGroup `xml:"urn:vim25 AddPortGroup,omitempty"` + Res *types.AddPortGroupResponse `xml:"urn:vim25 AddPortGroupResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *AddPortGroupBody) Fault() *soap.Fault { return b.Fault_ } + +func AddPortGroup(ctx context.Context, r soap.RoundTripper, req *types.AddPortGroup) (*types.AddPortGroupResponse, error) { + var reqBody, resBody AddPortGroupBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type AddServiceConsoleVirtualNicBody struct { + Req *types.AddServiceConsoleVirtualNic `xml:"urn:vim25 AddServiceConsoleVirtualNic,omitempty"` + Res *types.AddServiceConsoleVirtualNicResponse `xml:"urn:vim25 AddServiceConsoleVirtualNicResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *AddServiceConsoleVirtualNicBody) Fault() *soap.Fault { return b.Fault_ } + +func AddServiceConsoleVirtualNic(ctx context.Context, r soap.RoundTripper, req *types.AddServiceConsoleVirtualNic) (*types.AddServiceConsoleVirtualNicResponse, error) { + var reqBody, resBody AddServiceConsoleVirtualNicBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type AddStandaloneHost_TaskBody struct { + Req *types.AddStandaloneHost_Task `xml:"urn:vim25 AddStandaloneHost_Task,omitempty"` + Res *types.AddStandaloneHost_TaskResponse `xml:"urn:vim25 AddStandaloneHost_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *AddStandaloneHost_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func AddStandaloneHost_Task(ctx context.Context, r soap.RoundTripper, req *types.AddStandaloneHost_Task) (*types.AddStandaloneHost_TaskResponse, error) { + var reqBody, resBody AddStandaloneHost_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type AddVirtualNicBody struct { + Req *types.AddVirtualNic `xml:"urn:vim25 AddVirtualNic,omitempty"` + Res *types.AddVirtualNicResponse `xml:"urn:vim25 AddVirtualNicResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *AddVirtualNicBody) Fault() *soap.Fault { return b.Fault_ } + +func AddVirtualNic(ctx context.Context, r soap.RoundTripper, req *types.AddVirtualNic) (*types.AddVirtualNicResponse, error) { + var reqBody, resBody AddVirtualNicBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type AddVirtualSwitchBody struct { + Req *types.AddVirtualSwitch `xml:"urn:vim25 AddVirtualSwitch,omitempty"` + Res *types.AddVirtualSwitchResponse `xml:"urn:vim25 AddVirtualSwitchResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *AddVirtualSwitchBody) Fault() *soap.Fault { return b.Fault_ } + +func AddVirtualSwitch(ctx context.Context, r soap.RoundTripper, req *types.AddVirtualSwitch) (*types.AddVirtualSwitchResponse, error) { + var reqBody, resBody AddVirtualSwitchBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type AllocateIpv4AddressBody struct { + Req *types.AllocateIpv4Address `xml:"urn:vim25 AllocateIpv4Address,omitempty"` + Res *types.AllocateIpv4AddressResponse `xml:"urn:vim25 AllocateIpv4AddressResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *AllocateIpv4AddressBody) Fault() *soap.Fault { return b.Fault_ } + +func AllocateIpv4Address(ctx context.Context, r soap.RoundTripper, req *types.AllocateIpv4Address) (*types.AllocateIpv4AddressResponse, error) { + var reqBody, resBody AllocateIpv4AddressBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type AllocateIpv6AddressBody struct { + Req *types.AllocateIpv6Address `xml:"urn:vim25 AllocateIpv6Address,omitempty"` + Res *types.AllocateIpv6AddressResponse `xml:"urn:vim25 AllocateIpv6AddressResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *AllocateIpv6AddressBody) Fault() *soap.Fault { return b.Fault_ } + +func AllocateIpv6Address(ctx context.Context, r soap.RoundTripper, req *types.AllocateIpv6Address) (*types.AllocateIpv6AddressResponse, error) { + var reqBody, resBody AllocateIpv6AddressBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type AnswerVMBody struct { + Req *types.AnswerVM `xml:"urn:vim25 AnswerVM,omitempty"` + Res *types.AnswerVMResponse `xml:"urn:vim25 AnswerVMResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *AnswerVMBody) Fault() *soap.Fault { return b.Fault_ } + +func AnswerVM(ctx context.Context, r soap.RoundTripper, req *types.AnswerVM) (*types.AnswerVMResponse, error) { + var reqBody, resBody AnswerVMBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type ApplyHostConfig_TaskBody struct { + Req *types.ApplyHostConfig_Task `xml:"urn:vim25 ApplyHostConfig_Task,omitempty"` + Res *types.ApplyHostConfig_TaskResponse `xml:"urn:vim25 ApplyHostConfig_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *ApplyHostConfig_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func ApplyHostConfig_Task(ctx context.Context, r soap.RoundTripper, req *types.ApplyHostConfig_Task) (*types.ApplyHostConfig_TaskResponse, error) { + var reqBody, resBody ApplyHostConfig_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type ApplyRecommendationBody struct { + Req *types.ApplyRecommendation `xml:"urn:vim25 ApplyRecommendation,omitempty"` + Res *types.ApplyRecommendationResponse `xml:"urn:vim25 ApplyRecommendationResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *ApplyRecommendationBody) Fault() *soap.Fault { return b.Fault_ } + +func ApplyRecommendation(ctx context.Context, r soap.RoundTripper, req *types.ApplyRecommendation) (*types.ApplyRecommendationResponse, error) { + var reqBody, resBody ApplyRecommendationBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type ApplyStorageDrsRecommendationToPod_TaskBody struct { + Req *types.ApplyStorageDrsRecommendationToPod_Task `xml:"urn:vim25 ApplyStorageDrsRecommendationToPod_Task,omitempty"` + Res *types.ApplyStorageDrsRecommendationToPod_TaskResponse `xml:"urn:vim25 ApplyStorageDrsRecommendationToPod_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *ApplyStorageDrsRecommendationToPod_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func ApplyStorageDrsRecommendationToPod_Task(ctx context.Context, r soap.RoundTripper, req *types.ApplyStorageDrsRecommendationToPod_Task) (*types.ApplyStorageDrsRecommendationToPod_TaskResponse, error) { + var reqBody, resBody ApplyStorageDrsRecommendationToPod_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type ApplyStorageDrsRecommendation_TaskBody struct { + Req *types.ApplyStorageDrsRecommendation_Task `xml:"urn:vim25 ApplyStorageDrsRecommendation_Task,omitempty"` + Res *types.ApplyStorageDrsRecommendation_TaskResponse `xml:"urn:vim25 ApplyStorageDrsRecommendation_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *ApplyStorageDrsRecommendation_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func ApplyStorageDrsRecommendation_Task(ctx context.Context, r soap.RoundTripper, req *types.ApplyStorageDrsRecommendation_Task) (*types.ApplyStorageDrsRecommendation_TaskResponse, error) { + var reqBody, resBody ApplyStorageDrsRecommendation_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type AreAlarmActionsEnabledBody struct { + Req *types.AreAlarmActionsEnabled `xml:"urn:vim25 AreAlarmActionsEnabled,omitempty"` + Res *types.AreAlarmActionsEnabledResponse `xml:"urn:vim25 AreAlarmActionsEnabledResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *AreAlarmActionsEnabledBody) Fault() *soap.Fault { return b.Fault_ } + +func AreAlarmActionsEnabled(ctx context.Context, r soap.RoundTripper, req *types.AreAlarmActionsEnabled) (*types.AreAlarmActionsEnabledResponse, error) { + var reqBody, resBody AreAlarmActionsEnabledBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type AssignUserToGroupBody struct { + Req *types.AssignUserToGroup `xml:"urn:vim25 AssignUserToGroup,omitempty"` + Res *types.AssignUserToGroupResponse `xml:"urn:vim25 AssignUserToGroupResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *AssignUserToGroupBody) Fault() *soap.Fault { return b.Fault_ } + +func AssignUserToGroup(ctx context.Context, r soap.RoundTripper, req *types.AssignUserToGroup) (*types.AssignUserToGroupResponse, error) { + var reqBody, resBody AssignUserToGroupBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type AssociateProfileBody struct { + Req *types.AssociateProfile `xml:"urn:vim25 AssociateProfile,omitempty"` + Res *types.AssociateProfileResponse `xml:"urn:vim25 AssociateProfileResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *AssociateProfileBody) Fault() *soap.Fault { return b.Fault_ } + +func AssociateProfile(ctx context.Context, r soap.RoundTripper, req *types.AssociateProfile) (*types.AssociateProfileResponse, error) { + var reqBody, resBody AssociateProfileBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type AttachScsiLunBody struct { + Req *types.AttachScsiLun `xml:"urn:vim25 AttachScsiLun,omitempty"` + Res *types.AttachScsiLunResponse `xml:"urn:vim25 AttachScsiLunResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *AttachScsiLunBody) Fault() *soap.Fault { return b.Fault_ } + +func AttachScsiLun(ctx context.Context, r soap.RoundTripper, req *types.AttachScsiLun) (*types.AttachScsiLunResponse, error) { + var reqBody, resBody AttachScsiLunBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type AttachScsiLunEx_TaskBody struct { + Req *types.AttachScsiLunEx_Task `xml:"urn:vim25 AttachScsiLunEx_Task,omitempty"` + Res *types.AttachScsiLunEx_TaskResponse `xml:"urn:vim25 AttachScsiLunEx_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *AttachScsiLunEx_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func AttachScsiLunEx_Task(ctx context.Context, r soap.RoundTripper, req *types.AttachScsiLunEx_Task) (*types.AttachScsiLunEx_TaskResponse, error) { + var reqBody, resBody AttachScsiLunEx_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type AttachVmfsExtentBody struct { + Req *types.AttachVmfsExtent `xml:"urn:vim25 AttachVmfsExtent,omitempty"` + Res *types.AttachVmfsExtentResponse `xml:"urn:vim25 AttachVmfsExtentResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *AttachVmfsExtentBody) Fault() *soap.Fault { return b.Fault_ } + +func AttachVmfsExtent(ctx context.Context, r soap.RoundTripper, req *types.AttachVmfsExtent) (*types.AttachVmfsExtentResponse, error) { + var reqBody, resBody AttachVmfsExtentBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type AutoStartPowerOffBody struct { + Req *types.AutoStartPowerOff `xml:"urn:vim25 AutoStartPowerOff,omitempty"` + Res *types.AutoStartPowerOffResponse `xml:"urn:vim25 AutoStartPowerOffResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *AutoStartPowerOffBody) Fault() *soap.Fault { return b.Fault_ } + +func AutoStartPowerOff(ctx context.Context, r soap.RoundTripper, req *types.AutoStartPowerOff) (*types.AutoStartPowerOffResponse, error) { + var reqBody, resBody AutoStartPowerOffBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type AutoStartPowerOnBody struct { + Req *types.AutoStartPowerOn `xml:"urn:vim25 AutoStartPowerOn,omitempty"` + Res *types.AutoStartPowerOnResponse `xml:"urn:vim25 AutoStartPowerOnResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *AutoStartPowerOnBody) Fault() *soap.Fault { return b.Fault_ } + +func AutoStartPowerOn(ctx context.Context, r soap.RoundTripper, req *types.AutoStartPowerOn) (*types.AutoStartPowerOnResponse, error) { + var reqBody, resBody AutoStartPowerOnBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type BackupFirmwareConfigurationBody struct { + Req *types.BackupFirmwareConfiguration `xml:"urn:vim25 BackupFirmwareConfiguration,omitempty"` + Res *types.BackupFirmwareConfigurationResponse `xml:"urn:vim25 BackupFirmwareConfigurationResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *BackupFirmwareConfigurationBody) Fault() *soap.Fault { return b.Fault_ } + +func BackupFirmwareConfiguration(ctx context.Context, r soap.RoundTripper, req *types.BackupFirmwareConfiguration) (*types.BackupFirmwareConfigurationResponse, error) { + var reqBody, resBody BackupFirmwareConfigurationBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type BindVnicBody struct { + Req *types.BindVnic `xml:"urn:vim25 BindVnic,omitempty"` + Res *types.BindVnicResponse `xml:"urn:vim25 BindVnicResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *BindVnicBody) Fault() *soap.Fault { return b.Fault_ } + +func BindVnic(ctx context.Context, r soap.RoundTripper, req *types.BindVnic) (*types.BindVnicResponse, error) { + var reqBody, resBody BindVnicBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type BrowseDiagnosticLogBody struct { + Req *types.BrowseDiagnosticLog `xml:"urn:vim25 BrowseDiagnosticLog,omitempty"` + Res *types.BrowseDiagnosticLogResponse `xml:"urn:vim25 BrowseDiagnosticLogResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *BrowseDiagnosticLogBody) Fault() *soap.Fault { return b.Fault_ } + +func BrowseDiagnosticLog(ctx context.Context, r soap.RoundTripper, req *types.BrowseDiagnosticLog) (*types.BrowseDiagnosticLogResponse, error) { + var reqBody, resBody BrowseDiagnosticLogBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type CanProvisionObjectsBody struct { + Req *types.CanProvisionObjects `xml:"urn:vim25 CanProvisionObjects,omitempty"` + Res *types.CanProvisionObjectsResponse `xml:"urn:vim25 CanProvisionObjectsResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *CanProvisionObjectsBody) Fault() *soap.Fault { return b.Fault_ } + +func CanProvisionObjects(ctx context.Context, r soap.RoundTripper, req *types.CanProvisionObjects) (*types.CanProvisionObjectsResponse, error) { + var reqBody, resBody CanProvisionObjectsBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type CancelRecommendationBody struct { + Req *types.CancelRecommendation `xml:"urn:vim25 CancelRecommendation,omitempty"` + Res *types.CancelRecommendationResponse `xml:"urn:vim25 CancelRecommendationResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *CancelRecommendationBody) Fault() *soap.Fault { return b.Fault_ } + +func CancelRecommendation(ctx context.Context, r soap.RoundTripper, req *types.CancelRecommendation) (*types.CancelRecommendationResponse, error) { + var reqBody, resBody CancelRecommendationBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type CancelRetrievePropertiesExBody struct { + Req *types.CancelRetrievePropertiesEx `xml:"urn:vim25 CancelRetrievePropertiesEx,omitempty"` + Res *types.CancelRetrievePropertiesExResponse `xml:"urn:vim25 CancelRetrievePropertiesExResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *CancelRetrievePropertiesExBody) Fault() *soap.Fault { return b.Fault_ } + +func CancelRetrievePropertiesEx(ctx context.Context, r soap.RoundTripper, req *types.CancelRetrievePropertiesEx) (*types.CancelRetrievePropertiesExResponse, error) { + var reqBody, resBody CancelRetrievePropertiesExBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type CancelStorageDrsRecommendationBody struct { + Req *types.CancelStorageDrsRecommendation `xml:"urn:vim25 CancelStorageDrsRecommendation,omitempty"` + Res *types.CancelStorageDrsRecommendationResponse `xml:"urn:vim25 CancelStorageDrsRecommendationResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *CancelStorageDrsRecommendationBody) Fault() *soap.Fault { return b.Fault_ } + +func CancelStorageDrsRecommendation(ctx context.Context, r soap.RoundTripper, req *types.CancelStorageDrsRecommendation) (*types.CancelStorageDrsRecommendationResponse, error) { + var reqBody, resBody CancelStorageDrsRecommendationBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type CancelTaskBody struct { + Req *types.CancelTask `xml:"urn:vim25 CancelTask,omitempty"` + Res *types.CancelTaskResponse `xml:"urn:vim25 CancelTaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *CancelTaskBody) Fault() *soap.Fault { return b.Fault_ } + +func CancelTask(ctx context.Context, r soap.RoundTripper, req *types.CancelTask) (*types.CancelTaskResponse, error) { + var reqBody, resBody CancelTaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type CancelWaitForUpdatesBody struct { + Req *types.CancelWaitForUpdates `xml:"urn:vim25 CancelWaitForUpdates,omitempty"` + Res *types.CancelWaitForUpdatesResponse `xml:"urn:vim25 CancelWaitForUpdatesResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *CancelWaitForUpdatesBody) Fault() *soap.Fault { return b.Fault_ } + +func CancelWaitForUpdates(ctx context.Context, r soap.RoundTripper, req *types.CancelWaitForUpdates) (*types.CancelWaitForUpdatesResponse, error) { + var reqBody, resBody CancelWaitForUpdatesBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type CertMgrRefreshCACertificatesAndCRLs_TaskBody struct { + Req *types.CertMgrRefreshCACertificatesAndCRLs_Task `xml:"urn:vim25 CertMgrRefreshCACertificatesAndCRLs_Task,omitempty"` + Res *types.CertMgrRefreshCACertificatesAndCRLs_TaskResponse `xml:"urn:vim25 CertMgrRefreshCACertificatesAndCRLs_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *CertMgrRefreshCACertificatesAndCRLs_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func CertMgrRefreshCACertificatesAndCRLs_Task(ctx context.Context, r soap.RoundTripper, req *types.CertMgrRefreshCACertificatesAndCRLs_Task) (*types.CertMgrRefreshCACertificatesAndCRLs_TaskResponse, error) { + var reqBody, resBody CertMgrRefreshCACertificatesAndCRLs_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type CertMgrRefreshCertificates_TaskBody struct { + Req *types.CertMgrRefreshCertificates_Task `xml:"urn:vim25 CertMgrRefreshCertificates_Task,omitempty"` + Res *types.CertMgrRefreshCertificates_TaskResponse `xml:"urn:vim25 CertMgrRefreshCertificates_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *CertMgrRefreshCertificates_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func CertMgrRefreshCertificates_Task(ctx context.Context, r soap.RoundTripper, req *types.CertMgrRefreshCertificates_Task) (*types.CertMgrRefreshCertificates_TaskResponse, error) { + var reqBody, resBody CertMgrRefreshCertificates_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type CertMgrRevokeCertificates_TaskBody struct { + Req *types.CertMgrRevokeCertificates_Task `xml:"urn:vim25 CertMgrRevokeCertificates_Task,omitempty"` + Res *types.CertMgrRevokeCertificates_TaskResponse `xml:"urn:vim25 CertMgrRevokeCertificates_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *CertMgrRevokeCertificates_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func CertMgrRevokeCertificates_Task(ctx context.Context, r soap.RoundTripper, req *types.CertMgrRevokeCertificates_Task) (*types.CertMgrRevokeCertificates_TaskResponse, error) { + var reqBody, resBody CertMgrRevokeCertificates_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type ChangeAccessModeBody struct { + Req *types.ChangeAccessMode `xml:"urn:vim25 ChangeAccessMode,omitempty"` + Res *types.ChangeAccessModeResponse `xml:"urn:vim25 ChangeAccessModeResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *ChangeAccessModeBody) Fault() *soap.Fault { return b.Fault_ } + +func ChangeAccessMode(ctx context.Context, r soap.RoundTripper, req *types.ChangeAccessMode) (*types.ChangeAccessModeResponse, error) { + var reqBody, resBody ChangeAccessModeBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type ChangeFileAttributesInGuestBody struct { + Req *types.ChangeFileAttributesInGuest `xml:"urn:vim25 ChangeFileAttributesInGuest,omitempty"` + Res *types.ChangeFileAttributesInGuestResponse `xml:"urn:vim25 ChangeFileAttributesInGuestResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *ChangeFileAttributesInGuestBody) Fault() *soap.Fault { return b.Fault_ } + +func ChangeFileAttributesInGuest(ctx context.Context, r soap.RoundTripper, req *types.ChangeFileAttributesInGuest) (*types.ChangeFileAttributesInGuestResponse, error) { + var reqBody, resBody ChangeFileAttributesInGuestBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type ChangeLockdownModeBody struct { + Req *types.ChangeLockdownMode `xml:"urn:vim25 ChangeLockdownMode,omitempty"` + Res *types.ChangeLockdownModeResponse `xml:"urn:vim25 ChangeLockdownModeResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *ChangeLockdownModeBody) Fault() *soap.Fault { return b.Fault_ } + +func ChangeLockdownMode(ctx context.Context, r soap.RoundTripper, req *types.ChangeLockdownMode) (*types.ChangeLockdownModeResponse, error) { + var reqBody, resBody ChangeLockdownModeBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type ChangeNFSUserPasswordBody struct { + Req *types.ChangeNFSUserPassword `xml:"urn:vim25 ChangeNFSUserPassword,omitempty"` + Res *types.ChangeNFSUserPasswordResponse `xml:"urn:vim25 ChangeNFSUserPasswordResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *ChangeNFSUserPasswordBody) Fault() *soap.Fault { return b.Fault_ } + +func ChangeNFSUserPassword(ctx context.Context, r soap.RoundTripper, req *types.ChangeNFSUserPassword) (*types.ChangeNFSUserPasswordResponse, error) { + var reqBody, resBody ChangeNFSUserPasswordBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type ChangeOwnerBody struct { + Req *types.ChangeOwner `xml:"urn:vim25 ChangeOwner,omitempty"` + Res *types.ChangeOwnerResponse `xml:"urn:vim25 ChangeOwnerResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *ChangeOwnerBody) Fault() *soap.Fault { return b.Fault_ } + +func ChangeOwner(ctx context.Context, r soap.RoundTripper, req *types.ChangeOwner) (*types.ChangeOwnerResponse, error) { + var reqBody, resBody ChangeOwnerBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type CheckAddHostEvc_TaskBody struct { + Req *types.CheckAddHostEvc_Task `xml:"urn:vim25 CheckAddHostEvc_Task,omitempty"` + Res *types.CheckAddHostEvc_TaskResponse `xml:"urn:vim25 CheckAddHostEvc_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *CheckAddHostEvc_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func CheckAddHostEvc_Task(ctx context.Context, r soap.RoundTripper, req *types.CheckAddHostEvc_Task) (*types.CheckAddHostEvc_TaskResponse, error) { + var reqBody, resBody CheckAddHostEvc_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type CheckAnswerFileStatus_TaskBody struct { + Req *types.CheckAnswerFileStatus_Task `xml:"urn:vim25 CheckAnswerFileStatus_Task,omitempty"` + Res *types.CheckAnswerFileStatus_TaskResponse `xml:"urn:vim25 CheckAnswerFileStatus_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *CheckAnswerFileStatus_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func CheckAnswerFileStatus_Task(ctx context.Context, r soap.RoundTripper, req *types.CheckAnswerFileStatus_Task) (*types.CheckAnswerFileStatus_TaskResponse, error) { + var reqBody, resBody CheckAnswerFileStatus_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type CheckCompatibility_TaskBody struct { + Req *types.CheckCompatibility_Task `xml:"urn:vim25 CheckCompatibility_Task,omitempty"` + Res *types.CheckCompatibility_TaskResponse `xml:"urn:vim25 CheckCompatibility_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *CheckCompatibility_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func CheckCompatibility_Task(ctx context.Context, r soap.RoundTripper, req *types.CheckCompatibility_Task) (*types.CheckCompatibility_TaskResponse, error) { + var reqBody, resBody CheckCompatibility_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type CheckCompliance_TaskBody struct { + Req *types.CheckCompliance_Task `xml:"urn:vim25 CheckCompliance_Task,omitempty"` + Res *types.CheckCompliance_TaskResponse `xml:"urn:vim25 CheckCompliance_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *CheckCompliance_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func CheckCompliance_Task(ctx context.Context, r soap.RoundTripper, req *types.CheckCompliance_Task) (*types.CheckCompliance_TaskResponse, error) { + var reqBody, resBody CheckCompliance_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type CheckConfigureEvcMode_TaskBody struct { + Req *types.CheckConfigureEvcMode_Task `xml:"urn:vim25 CheckConfigureEvcMode_Task,omitempty"` + Res *types.CheckConfigureEvcMode_TaskResponse `xml:"urn:vim25 CheckConfigureEvcMode_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *CheckConfigureEvcMode_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func CheckConfigureEvcMode_Task(ctx context.Context, r soap.RoundTripper, req *types.CheckConfigureEvcMode_Task) (*types.CheckConfigureEvcMode_TaskResponse, error) { + var reqBody, resBody CheckConfigureEvcMode_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type CheckCustomizationResourcesBody struct { + Req *types.CheckCustomizationResources `xml:"urn:vim25 CheckCustomizationResources,omitempty"` + Res *types.CheckCustomizationResourcesResponse `xml:"urn:vim25 CheckCustomizationResourcesResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *CheckCustomizationResourcesBody) Fault() *soap.Fault { return b.Fault_ } + +func CheckCustomizationResources(ctx context.Context, r soap.RoundTripper, req *types.CheckCustomizationResources) (*types.CheckCustomizationResourcesResponse, error) { + var reqBody, resBody CheckCustomizationResourcesBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type CheckCustomizationSpecBody struct { + Req *types.CheckCustomizationSpec `xml:"urn:vim25 CheckCustomizationSpec,omitempty"` + Res *types.CheckCustomizationSpecResponse `xml:"urn:vim25 CheckCustomizationSpecResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *CheckCustomizationSpecBody) Fault() *soap.Fault { return b.Fault_ } + +func CheckCustomizationSpec(ctx context.Context, r soap.RoundTripper, req *types.CheckCustomizationSpec) (*types.CheckCustomizationSpecResponse, error) { + var reqBody, resBody CheckCustomizationSpecBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type CheckForUpdatesBody struct { + Req *types.CheckForUpdates `xml:"urn:vim25 CheckForUpdates,omitempty"` + Res *types.CheckForUpdatesResponse `xml:"urn:vim25 CheckForUpdatesResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *CheckForUpdatesBody) Fault() *soap.Fault { return b.Fault_ } + +func CheckForUpdates(ctx context.Context, r soap.RoundTripper, req *types.CheckForUpdates) (*types.CheckForUpdatesResponse, error) { + var reqBody, resBody CheckForUpdatesBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type CheckHostPatch_TaskBody struct { + Req *types.CheckHostPatch_Task `xml:"urn:vim25 CheckHostPatch_Task,omitempty"` + Res *types.CheckHostPatch_TaskResponse `xml:"urn:vim25 CheckHostPatch_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *CheckHostPatch_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func CheckHostPatch_Task(ctx context.Context, r soap.RoundTripper, req *types.CheckHostPatch_Task) (*types.CheckHostPatch_TaskResponse, error) { + var reqBody, resBody CheckHostPatch_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type CheckLicenseFeatureBody struct { + Req *types.CheckLicenseFeature `xml:"urn:vim25 CheckLicenseFeature,omitempty"` + Res *types.CheckLicenseFeatureResponse `xml:"urn:vim25 CheckLicenseFeatureResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *CheckLicenseFeatureBody) Fault() *soap.Fault { return b.Fault_ } + +func CheckLicenseFeature(ctx context.Context, r soap.RoundTripper, req *types.CheckLicenseFeature) (*types.CheckLicenseFeatureResponse, error) { + var reqBody, resBody CheckLicenseFeatureBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type CheckMigrate_TaskBody struct { + Req *types.CheckMigrate_Task `xml:"urn:vim25 CheckMigrate_Task,omitempty"` + Res *types.CheckMigrate_TaskResponse `xml:"urn:vim25 CheckMigrate_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *CheckMigrate_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func CheckMigrate_Task(ctx context.Context, r soap.RoundTripper, req *types.CheckMigrate_Task) (*types.CheckMigrate_TaskResponse, error) { + var reqBody, resBody CheckMigrate_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type CheckProfileCompliance_TaskBody struct { + Req *types.CheckProfileCompliance_Task `xml:"urn:vim25 CheckProfileCompliance_Task,omitempty"` + Res *types.CheckProfileCompliance_TaskResponse `xml:"urn:vim25 CheckProfileCompliance_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *CheckProfileCompliance_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func CheckProfileCompliance_Task(ctx context.Context, r soap.RoundTripper, req *types.CheckProfileCompliance_Task) (*types.CheckProfileCompliance_TaskResponse, error) { + var reqBody, resBody CheckProfileCompliance_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type CheckRelocate_TaskBody struct { + Req *types.CheckRelocate_Task `xml:"urn:vim25 CheckRelocate_Task,omitempty"` + Res *types.CheckRelocate_TaskResponse `xml:"urn:vim25 CheckRelocate_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *CheckRelocate_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func CheckRelocate_Task(ctx context.Context, r soap.RoundTripper, req *types.CheckRelocate_Task) (*types.CheckRelocate_TaskResponse, error) { + var reqBody, resBody CheckRelocate_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type ClearComplianceStatusBody struct { + Req *types.ClearComplianceStatus `xml:"urn:vim25 ClearComplianceStatus,omitempty"` + Res *types.ClearComplianceStatusResponse `xml:"urn:vim25 ClearComplianceStatusResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *ClearComplianceStatusBody) Fault() *soap.Fault { return b.Fault_ } + +func ClearComplianceStatus(ctx context.Context, r soap.RoundTripper, req *types.ClearComplianceStatus) (*types.ClearComplianceStatusResponse, error) { + var reqBody, resBody ClearComplianceStatusBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type ClearNFSUserBody struct { + Req *types.ClearNFSUser `xml:"urn:vim25 ClearNFSUser,omitempty"` + Res *types.ClearNFSUserResponse `xml:"urn:vim25 ClearNFSUserResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *ClearNFSUserBody) Fault() *soap.Fault { return b.Fault_ } + +func ClearNFSUser(ctx context.Context, r soap.RoundTripper, req *types.ClearNFSUser) (*types.ClearNFSUserResponse, error) { + var reqBody, resBody ClearNFSUserBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type CloneSessionBody struct { + Req *types.CloneSession `xml:"urn:vim25 CloneSession,omitempty"` + Res *types.CloneSessionResponse `xml:"urn:vim25 CloneSessionResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *CloneSessionBody) Fault() *soap.Fault { return b.Fault_ } + +func CloneSession(ctx context.Context, r soap.RoundTripper, req *types.CloneSession) (*types.CloneSessionResponse, error) { + var reqBody, resBody CloneSessionBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type CloneVApp_TaskBody struct { + Req *types.CloneVApp_Task `xml:"urn:vim25 CloneVApp_Task,omitempty"` + Res *types.CloneVApp_TaskResponse `xml:"urn:vim25 CloneVApp_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *CloneVApp_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func CloneVApp_Task(ctx context.Context, r soap.RoundTripper, req *types.CloneVApp_Task) (*types.CloneVApp_TaskResponse, error) { + var reqBody, resBody CloneVApp_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type CloneVM_TaskBody struct { + Req *types.CloneVM_Task `xml:"urn:vim25 CloneVM_Task,omitempty"` + Res *types.CloneVM_TaskResponse `xml:"urn:vim25 CloneVM_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *CloneVM_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func CloneVM_Task(ctx context.Context, r soap.RoundTripper, req *types.CloneVM_Task) (*types.CloneVM_TaskResponse, error) { + var reqBody, resBody CloneVM_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type CloseInventoryViewFolderBody struct { + Req *types.CloseInventoryViewFolder `xml:"urn:vim25 CloseInventoryViewFolder,omitempty"` + Res *types.CloseInventoryViewFolderResponse `xml:"urn:vim25 CloseInventoryViewFolderResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *CloseInventoryViewFolderBody) Fault() *soap.Fault { return b.Fault_ } + +func CloseInventoryViewFolder(ctx context.Context, r soap.RoundTripper, req *types.CloseInventoryViewFolder) (*types.CloseInventoryViewFolderResponse, error) { + var reqBody, resBody CloseInventoryViewFolderBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type ClusterEnterMaintenanceModeBody struct { + Req *types.ClusterEnterMaintenanceMode `xml:"urn:vim25 ClusterEnterMaintenanceMode,omitempty"` + Res *types.ClusterEnterMaintenanceModeResponse `xml:"urn:vim25 ClusterEnterMaintenanceModeResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *ClusterEnterMaintenanceModeBody) Fault() *soap.Fault { return b.Fault_ } + +func ClusterEnterMaintenanceMode(ctx context.Context, r soap.RoundTripper, req *types.ClusterEnterMaintenanceMode) (*types.ClusterEnterMaintenanceModeResponse, error) { + var reqBody, resBody ClusterEnterMaintenanceModeBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type ComputeDiskPartitionInfoBody struct { + Req *types.ComputeDiskPartitionInfo `xml:"urn:vim25 ComputeDiskPartitionInfo,omitempty"` + Res *types.ComputeDiskPartitionInfoResponse `xml:"urn:vim25 ComputeDiskPartitionInfoResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *ComputeDiskPartitionInfoBody) Fault() *soap.Fault { return b.Fault_ } + +func ComputeDiskPartitionInfo(ctx context.Context, r soap.RoundTripper, req *types.ComputeDiskPartitionInfo) (*types.ComputeDiskPartitionInfoResponse, error) { + var reqBody, resBody ComputeDiskPartitionInfoBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type ComputeDiskPartitionInfoForResizeBody struct { + Req *types.ComputeDiskPartitionInfoForResize `xml:"urn:vim25 ComputeDiskPartitionInfoForResize,omitempty"` + Res *types.ComputeDiskPartitionInfoForResizeResponse `xml:"urn:vim25 ComputeDiskPartitionInfoForResizeResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *ComputeDiskPartitionInfoForResizeBody) Fault() *soap.Fault { return b.Fault_ } + +func ComputeDiskPartitionInfoForResize(ctx context.Context, r soap.RoundTripper, req *types.ComputeDiskPartitionInfoForResize) (*types.ComputeDiskPartitionInfoForResizeResponse, error) { + var reqBody, resBody ComputeDiskPartitionInfoForResizeBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type ConfigureDatastoreIORM_TaskBody struct { + Req *types.ConfigureDatastoreIORM_Task `xml:"urn:vim25 ConfigureDatastoreIORM_Task,omitempty"` + Res *types.ConfigureDatastoreIORM_TaskResponse `xml:"urn:vim25 ConfigureDatastoreIORM_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *ConfigureDatastoreIORM_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func ConfigureDatastoreIORM_Task(ctx context.Context, r soap.RoundTripper, req *types.ConfigureDatastoreIORM_Task) (*types.ConfigureDatastoreIORM_TaskResponse, error) { + var reqBody, resBody ConfigureDatastoreIORM_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type ConfigureDatastorePrincipalBody struct { + Req *types.ConfigureDatastorePrincipal `xml:"urn:vim25 ConfigureDatastorePrincipal,omitempty"` + Res *types.ConfigureDatastorePrincipalResponse `xml:"urn:vim25 ConfigureDatastorePrincipalResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *ConfigureDatastorePrincipalBody) Fault() *soap.Fault { return b.Fault_ } + +func ConfigureDatastorePrincipal(ctx context.Context, r soap.RoundTripper, req *types.ConfigureDatastorePrincipal) (*types.ConfigureDatastorePrincipalResponse, error) { + var reqBody, resBody ConfigureDatastorePrincipalBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type ConfigureEvcMode_TaskBody struct { + Req *types.ConfigureEvcMode_Task `xml:"urn:vim25 ConfigureEvcMode_Task,omitempty"` + Res *types.ConfigureEvcMode_TaskResponse `xml:"urn:vim25 ConfigureEvcMode_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *ConfigureEvcMode_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func ConfigureEvcMode_Task(ctx context.Context, r soap.RoundTripper, req *types.ConfigureEvcMode_Task) (*types.ConfigureEvcMode_TaskResponse, error) { + var reqBody, resBody ConfigureEvcMode_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type ConfigureHostCache_TaskBody struct { + Req *types.ConfigureHostCache_Task `xml:"urn:vim25 ConfigureHostCache_Task,omitempty"` + Res *types.ConfigureHostCache_TaskResponse `xml:"urn:vim25 ConfigureHostCache_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *ConfigureHostCache_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func ConfigureHostCache_Task(ctx context.Context, r soap.RoundTripper, req *types.ConfigureHostCache_Task) (*types.ConfigureHostCache_TaskResponse, error) { + var reqBody, resBody ConfigureHostCache_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type ConfigureLicenseSourceBody struct { + Req *types.ConfigureLicenseSource `xml:"urn:vim25 ConfigureLicenseSource,omitempty"` + Res *types.ConfigureLicenseSourceResponse `xml:"urn:vim25 ConfigureLicenseSourceResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *ConfigureLicenseSourceBody) Fault() *soap.Fault { return b.Fault_ } + +func ConfigureLicenseSource(ctx context.Context, r soap.RoundTripper, req *types.ConfigureLicenseSource) (*types.ConfigureLicenseSourceResponse, error) { + var reqBody, resBody ConfigureLicenseSourceBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type ConfigurePowerPolicyBody struct { + Req *types.ConfigurePowerPolicy `xml:"urn:vim25 ConfigurePowerPolicy,omitempty"` + Res *types.ConfigurePowerPolicyResponse `xml:"urn:vim25 ConfigurePowerPolicyResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *ConfigurePowerPolicyBody) Fault() *soap.Fault { return b.Fault_ } + +func ConfigurePowerPolicy(ctx context.Context, r soap.RoundTripper, req *types.ConfigurePowerPolicy) (*types.ConfigurePowerPolicyResponse, error) { + var reqBody, resBody ConfigurePowerPolicyBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type ConfigureStorageDrsForPod_TaskBody struct { + Req *types.ConfigureStorageDrsForPod_Task `xml:"urn:vim25 ConfigureStorageDrsForPod_Task,omitempty"` + Res *types.ConfigureStorageDrsForPod_TaskResponse `xml:"urn:vim25 ConfigureStorageDrsForPod_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *ConfigureStorageDrsForPod_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func ConfigureStorageDrsForPod_Task(ctx context.Context, r soap.RoundTripper, req *types.ConfigureStorageDrsForPod_Task) (*types.ConfigureStorageDrsForPod_TaskResponse, error) { + var reqBody, resBody ConfigureStorageDrsForPod_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type ConfigureVFlashResourceEx_TaskBody struct { + Req *types.ConfigureVFlashResourceEx_Task `xml:"urn:vim25 ConfigureVFlashResourceEx_Task,omitempty"` + Res *types.ConfigureVFlashResourceEx_TaskResponse `xml:"urn:vim25 ConfigureVFlashResourceEx_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *ConfigureVFlashResourceEx_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func ConfigureVFlashResourceEx_Task(ctx context.Context, r soap.RoundTripper, req *types.ConfigureVFlashResourceEx_Task) (*types.ConfigureVFlashResourceEx_TaskResponse, error) { + var reqBody, resBody ConfigureVFlashResourceEx_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type ConsolidateVMDisks_TaskBody struct { + Req *types.ConsolidateVMDisks_Task `xml:"urn:vim25 ConsolidateVMDisks_Task,omitempty"` + Res *types.ConsolidateVMDisks_TaskResponse `xml:"urn:vim25 ConsolidateVMDisks_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *ConsolidateVMDisks_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func ConsolidateVMDisks_Task(ctx context.Context, r soap.RoundTripper, req *types.ConsolidateVMDisks_Task) (*types.ConsolidateVMDisks_TaskResponse, error) { + var reqBody, resBody ConsolidateVMDisks_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type ContinueRetrievePropertiesExBody struct { + Req *types.ContinueRetrievePropertiesEx `xml:"urn:vim25 ContinueRetrievePropertiesEx,omitempty"` + Res *types.ContinueRetrievePropertiesExResponse `xml:"urn:vim25 ContinueRetrievePropertiesExResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *ContinueRetrievePropertiesExBody) Fault() *soap.Fault { return b.Fault_ } + +func ContinueRetrievePropertiesEx(ctx context.Context, r soap.RoundTripper, req *types.ContinueRetrievePropertiesEx) (*types.ContinueRetrievePropertiesExResponse, error) { + var reqBody, resBody ContinueRetrievePropertiesExBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type CopyDatastoreFile_TaskBody struct { + Req *types.CopyDatastoreFile_Task `xml:"urn:vim25 CopyDatastoreFile_Task,omitempty"` + Res *types.CopyDatastoreFile_TaskResponse `xml:"urn:vim25 CopyDatastoreFile_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *CopyDatastoreFile_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func CopyDatastoreFile_Task(ctx context.Context, r soap.RoundTripper, req *types.CopyDatastoreFile_Task) (*types.CopyDatastoreFile_TaskResponse, error) { + var reqBody, resBody CopyDatastoreFile_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type CopyVirtualDisk_TaskBody struct { + Req *types.CopyVirtualDisk_Task `xml:"urn:vim25 CopyVirtualDisk_Task,omitempty"` + Res *types.CopyVirtualDisk_TaskResponse `xml:"urn:vim25 CopyVirtualDisk_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *CopyVirtualDisk_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func CopyVirtualDisk_Task(ctx context.Context, r soap.RoundTripper, req *types.CopyVirtualDisk_Task) (*types.CopyVirtualDisk_TaskResponse, error) { + var reqBody, resBody CopyVirtualDisk_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type CreateAlarmBody struct { + Req *types.CreateAlarm `xml:"urn:vim25 CreateAlarm,omitempty"` + Res *types.CreateAlarmResponse `xml:"urn:vim25 CreateAlarmResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *CreateAlarmBody) Fault() *soap.Fault { return b.Fault_ } + +func CreateAlarm(ctx context.Context, r soap.RoundTripper, req *types.CreateAlarm) (*types.CreateAlarmResponse, error) { + var reqBody, resBody CreateAlarmBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type CreateChildVM_TaskBody struct { + Req *types.CreateChildVM_Task `xml:"urn:vim25 CreateChildVM_Task,omitempty"` + Res *types.CreateChildVM_TaskResponse `xml:"urn:vim25 CreateChildVM_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *CreateChildVM_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func CreateChildVM_Task(ctx context.Context, r soap.RoundTripper, req *types.CreateChildVM_Task) (*types.CreateChildVM_TaskResponse, error) { + var reqBody, resBody CreateChildVM_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type CreateClusterBody struct { + Req *types.CreateCluster `xml:"urn:vim25 CreateCluster,omitempty"` + Res *types.CreateClusterResponse `xml:"urn:vim25 CreateClusterResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *CreateClusterBody) Fault() *soap.Fault { return b.Fault_ } + +func CreateCluster(ctx context.Context, r soap.RoundTripper, req *types.CreateCluster) (*types.CreateClusterResponse, error) { + var reqBody, resBody CreateClusterBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type CreateClusterExBody struct { + Req *types.CreateClusterEx `xml:"urn:vim25 CreateClusterEx,omitempty"` + Res *types.CreateClusterExResponse `xml:"urn:vim25 CreateClusterExResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *CreateClusterExBody) Fault() *soap.Fault { return b.Fault_ } + +func CreateClusterEx(ctx context.Context, r soap.RoundTripper, req *types.CreateClusterEx) (*types.CreateClusterExResponse, error) { + var reqBody, resBody CreateClusterExBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type CreateCollectorForEventsBody struct { + Req *types.CreateCollectorForEvents `xml:"urn:vim25 CreateCollectorForEvents,omitempty"` + Res *types.CreateCollectorForEventsResponse `xml:"urn:vim25 CreateCollectorForEventsResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *CreateCollectorForEventsBody) Fault() *soap.Fault { return b.Fault_ } + +func CreateCollectorForEvents(ctx context.Context, r soap.RoundTripper, req *types.CreateCollectorForEvents) (*types.CreateCollectorForEventsResponse, error) { + var reqBody, resBody CreateCollectorForEventsBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type CreateCollectorForTasksBody struct { + Req *types.CreateCollectorForTasks `xml:"urn:vim25 CreateCollectorForTasks,omitempty"` + Res *types.CreateCollectorForTasksResponse `xml:"urn:vim25 CreateCollectorForTasksResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *CreateCollectorForTasksBody) Fault() *soap.Fault { return b.Fault_ } + +func CreateCollectorForTasks(ctx context.Context, r soap.RoundTripper, req *types.CreateCollectorForTasks) (*types.CreateCollectorForTasksResponse, error) { + var reqBody, resBody CreateCollectorForTasksBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type CreateContainerViewBody struct { + Req *types.CreateContainerView `xml:"urn:vim25 CreateContainerView,omitempty"` + Res *types.CreateContainerViewResponse `xml:"urn:vim25 CreateContainerViewResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *CreateContainerViewBody) Fault() *soap.Fault { return b.Fault_ } + +func CreateContainerView(ctx context.Context, r soap.RoundTripper, req *types.CreateContainerView) (*types.CreateContainerViewResponse, error) { + var reqBody, resBody CreateContainerViewBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type CreateCustomizationSpecBody struct { + Req *types.CreateCustomizationSpec `xml:"urn:vim25 CreateCustomizationSpec,omitempty"` + Res *types.CreateCustomizationSpecResponse `xml:"urn:vim25 CreateCustomizationSpecResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *CreateCustomizationSpecBody) Fault() *soap.Fault { return b.Fault_ } + +func CreateCustomizationSpec(ctx context.Context, r soap.RoundTripper, req *types.CreateCustomizationSpec) (*types.CreateCustomizationSpecResponse, error) { + var reqBody, resBody CreateCustomizationSpecBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type CreateDVPortgroup_TaskBody struct { + Req *types.CreateDVPortgroup_Task `xml:"urn:vim25 CreateDVPortgroup_Task,omitempty"` + Res *types.CreateDVPortgroup_TaskResponse `xml:"urn:vim25 CreateDVPortgroup_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *CreateDVPortgroup_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func CreateDVPortgroup_Task(ctx context.Context, r soap.RoundTripper, req *types.CreateDVPortgroup_Task) (*types.CreateDVPortgroup_TaskResponse, error) { + var reqBody, resBody CreateDVPortgroup_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type CreateDVS_TaskBody struct { + Req *types.CreateDVS_Task `xml:"urn:vim25 CreateDVS_Task,omitempty"` + Res *types.CreateDVS_TaskResponse `xml:"urn:vim25 CreateDVS_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *CreateDVS_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func CreateDVS_Task(ctx context.Context, r soap.RoundTripper, req *types.CreateDVS_Task) (*types.CreateDVS_TaskResponse, error) { + var reqBody, resBody CreateDVS_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type CreateDatacenterBody struct { + Req *types.CreateDatacenter `xml:"urn:vim25 CreateDatacenter,omitempty"` + Res *types.CreateDatacenterResponse `xml:"urn:vim25 CreateDatacenterResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *CreateDatacenterBody) Fault() *soap.Fault { return b.Fault_ } + +func CreateDatacenter(ctx context.Context, r soap.RoundTripper, req *types.CreateDatacenter) (*types.CreateDatacenterResponse, error) { + var reqBody, resBody CreateDatacenterBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type CreateDefaultProfileBody struct { + Req *types.CreateDefaultProfile `xml:"urn:vim25 CreateDefaultProfile,omitempty"` + Res *types.CreateDefaultProfileResponse `xml:"urn:vim25 CreateDefaultProfileResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *CreateDefaultProfileBody) Fault() *soap.Fault { return b.Fault_ } + +func CreateDefaultProfile(ctx context.Context, r soap.RoundTripper, req *types.CreateDefaultProfile) (*types.CreateDefaultProfileResponse, error) { + var reqBody, resBody CreateDefaultProfileBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type CreateDescriptorBody struct { + Req *types.CreateDescriptor `xml:"urn:vim25 CreateDescriptor,omitempty"` + Res *types.CreateDescriptorResponse `xml:"urn:vim25 CreateDescriptorResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *CreateDescriptorBody) Fault() *soap.Fault { return b.Fault_ } + +func CreateDescriptor(ctx context.Context, r soap.RoundTripper, req *types.CreateDescriptor) (*types.CreateDescriptorResponse, error) { + var reqBody, resBody CreateDescriptorBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type CreateDiagnosticPartitionBody struct { + Req *types.CreateDiagnosticPartition `xml:"urn:vim25 CreateDiagnosticPartition,omitempty"` + Res *types.CreateDiagnosticPartitionResponse `xml:"urn:vim25 CreateDiagnosticPartitionResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *CreateDiagnosticPartitionBody) Fault() *soap.Fault { return b.Fault_ } + +func CreateDiagnosticPartition(ctx context.Context, r soap.RoundTripper, req *types.CreateDiagnosticPartition) (*types.CreateDiagnosticPartitionResponse, error) { + var reqBody, resBody CreateDiagnosticPartitionBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type CreateDirectoryBody struct { + Req *types.CreateDirectory `xml:"urn:vim25 CreateDirectory,omitempty"` + Res *types.CreateDirectoryResponse `xml:"urn:vim25 CreateDirectoryResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *CreateDirectoryBody) Fault() *soap.Fault { return b.Fault_ } + +func CreateDirectory(ctx context.Context, r soap.RoundTripper, req *types.CreateDirectory) (*types.CreateDirectoryResponse, error) { + var reqBody, resBody CreateDirectoryBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type CreateFilterBody struct { + Req *types.CreateFilter `xml:"urn:vim25 CreateFilter,omitempty"` + Res *types.CreateFilterResponse `xml:"urn:vim25 CreateFilterResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *CreateFilterBody) Fault() *soap.Fault { return b.Fault_ } + +func CreateFilter(ctx context.Context, r soap.RoundTripper, req *types.CreateFilter) (*types.CreateFilterResponse, error) { + var reqBody, resBody CreateFilterBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type CreateFolderBody struct { + Req *types.CreateFolder `xml:"urn:vim25 CreateFolder,omitempty"` + Res *types.CreateFolderResponse `xml:"urn:vim25 CreateFolderResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *CreateFolderBody) Fault() *soap.Fault { return b.Fault_ } + +func CreateFolder(ctx context.Context, r soap.RoundTripper, req *types.CreateFolder) (*types.CreateFolderResponse, error) { + var reqBody, resBody CreateFolderBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type CreateGroupBody struct { + Req *types.CreateGroup `xml:"urn:vim25 CreateGroup,omitempty"` + Res *types.CreateGroupResponse `xml:"urn:vim25 CreateGroupResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *CreateGroupBody) Fault() *soap.Fault { return b.Fault_ } + +func CreateGroup(ctx context.Context, r soap.RoundTripper, req *types.CreateGroup) (*types.CreateGroupResponse, error) { + var reqBody, resBody CreateGroupBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type CreateImportSpecBody struct { + Req *types.CreateImportSpec `xml:"urn:vim25 CreateImportSpec,omitempty"` + Res *types.CreateImportSpecResponse `xml:"urn:vim25 CreateImportSpecResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *CreateImportSpecBody) Fault() *soap.Fault { return b.Fault_ } + +func CreateImportSpec(ctx context.Context, r soap.RoundTripper, req *types.CreateImportSpec) (*types.CreateImportSpecResponse, error) { + var reqBody, resBody CreateImportSpecBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type CreateInventoryViewBody struct { + Req *types.CreateInventoryView `xml:"urn:vim25 CreateInventoryView,omitempty"` + Res *types.CreateInventoryViewResponse `xml:"urn:vim25 CreateInventoryViewResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *CreateInventoryViewBody) Fault() *soap.Fault { return b.Fault_ } + +func CreateInventoryView(ctx context.Context, r soap.RoundTripper, req *types.CreateInventoryView) (*types.CreateInventoryViewResponse, error) { + var reqBody, resBody CreateInventoryViewBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type CreateIpPoolBody struct { + Req *types.CreateIpPool `xml:"urn:vim25 CreateIpPool,omitempty"` + Res *types.CreateIpPoolResponse `xml:"urn:vim25 CreateIpPoolResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *CreateIpPoolBody) Fault() *soap.Fault { return b.Fault_ } + +func CreateIpPool(ctx context.Context, r soap.RoundTripper, req *types.CreateIpPool) (*types.CreateIpPoolResponse, error) { + var reqBody, resBody CreateIpPoolBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type CreateListViewBody struct { + Req *types.CreateListView `xml:"urn:vim25 CreateListView,omitempty"` + Res *types.CreateListViewResponse `xml:"urn:vim25 CreateListViewResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *CreateListViewBody) Fault() *soap.Fault { return b.Fault_ } + +func CreateListView(ctx context.Context, r soap.RoundTripper, req *types.CreateListView) (*types.CreateListViewResponse, error) { + var reqBody, resBody CreateListViewBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type CreateListViewFromViewBody struct { + Req *types.CreateListViewFromView `xml:"urn:vim25 CreateListViewFromView,omitempty"` + Res *types.CreateListViewFromViewResponse `xml:"urn:vim25 CreateListViewFromViewResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *CreateListViewFromViewBody) Fault() *soap.Fault { return b.Fault_ } + +func CreateListViewFromView(ctx context.Context, r soap.RoundTripper, req *types.CreateListViewFromView) (*types.CreateListViewFromViewResponse, error) { + var reqBody, resBody CreateListViewFromViewBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type CreateLocalDatastoreBody struct { + Req *types.CreateLocalDatastore `xml:"urn:vim25 CreateLocalDatastore,omitempty"` + Res *types.CreateLocalDatastoreResponse `xml:"urn:vim25 CreateLocalDatastoreResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *CreateLocalDatastoreBody) Fault() *soap.Fault { return b.Fault_ } + +func CreateLocalDatastore(ctx context.Context, r soap.RoundTripper, req *types.CreateLocalDatastore) (*types.CreateLocalDatastoreResponse, error) { + var reqBody, resBody CreateLocalDatastoreBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type CreateNasDatastoreBody struct { + Req *types.CreateNasDatastore `xml:"urn:vim25 CreateNasDatastore,omitempty"` + Res *types.CreateNasDatastoreResponse `xml:"urn:vim25 CreateNasDatastoreResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *CreateNasDatastoreBody) Fault() *soap.Fault { return b.Fault_ } + +func CreateNasDatastore(ctx context.Context, r soap.RoundTripper, req *types.CreateNasDatastore) (*types.CreateNasDatastoreResponse, error) { + var reqBody, resBody CreateNasDatastoreBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type CreateObjectScheduledTaskBody struct { + Req *types.CreateObjectScheduledTask `xml:"urn:vim25 CreateObjectScheduledTask,omitempty"` + Res *types.CreateObjectScheduledTaskResponse `xml:"urn:vim25 CreateObjectScheduledTaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *CreateObjectScheduledTaskBody) Fault() *soap.Fault { return b.Fault_ } + +func CreateObjectScheduledTask(ctx context.Context, r soap.RoundTripper, req *types.CreateObjectScheduledTask) (*types.CreateObjectScheduledTaskResponse, error) { + var reqBody, resBody CreateObjectScheduledTaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type CreatePerfIntervalBody struct { + Req *types.CreatePerfInterval `xml:"urn:vim25 CreatePerfInterval,omitempty"` + Res *types.CreatePerfIntervalResponse `xml:"urn:vim25 CreatePerfIntervalResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *CreatePerfIntervalBody) Fault() *soap.Fault { return b.Fault_ } + +func CreatePerfInterval(ctx context.Context, r soap.RoundTripper, req *types.CreatePerfInterval) (*types.CreatePerfIntervalResponse, error) { + var reqBody, resBody CreatePerfIntervalBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type CreateProfileBody struct { + Req *types.CreateProfile `xml:"urn:vim25 CreateProfile,omitempty"` + Res *types.CreateProfileResponse `xml:"urn:vim25 CreateProfileResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *CreateProfileBody) Fault() *soap.Fault { return b.Fault_ } + +func CreateProfile(ctx context.Context, r soap.RoundTripper, req *types.CreateProfile) (*types.CreateProfileResponse, error) { + var reqBody, resBody CreateProfileBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type CreatePropertyCollectorBody struct { + Req *types.CreatePropertyCollector `xml:"urn:vim25 CreatePropertyCollector,omitempty"` + Res *types.CreatePropertyCollectorResponse `xml:"urn:vim25 CreatePropertyCollectorResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *CreatePropertyCollectorBody) Fault() *soap.Fault { return b.Fault_ } + +func CreatePropertyCollector(ctx context.Context, r soap.RoundTripper, req *types.CreatePropertyCollector) (*types.CreatePropertyCollectorResponse, error) { + var reqBody, resBody CreatePropertyCollectorBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type CreateRegistryKeyInGuestBody struct { + Req *types.CreateRegistryKeyInGuest `xml:"urn:vim25 CreateRegistryKeyInGuest,omitempty"` + Res *types.CreateRegistryKeyInGuestResponse `xml:"urn:vim25 CreateRegistryKeyInGuestResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *CreateRegistryKeyInGuestBody) Fault() *soap.Fault { return b.Fault_ } + +func CreateRegistryKeyInGuest(ctx context.Context, r soap.RoundTripper, req *types.CreateRegistryKeyInGuest) (*types.CreateRegistryKeyInGuestResponse, error) { + var reqBody, resBody CreateRegistryKeyInGuestBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type CreateResourcePoolBody struct { + Req *types.CreateResourcePool `xml:"urn:vim25 CreateResourcePool,omitempty"` + Res *types.CreateResourcePoolResponse `xml:"urn:vim25 CreateResourcePoolResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *CreateResourcePoolBody) Fault() *soap.Fault { return b.Fault_ } + +func CreateResourcePool(ctx context.Context, r soap.RoundTripper, req *types.CreateResourcePool) (*types.CreateResourcePoolResponse, error) { + var reqBody, resBody CreateResourcePoolBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type CreateScheduledTaskBody struct { + Req *types.CreateScheduledTask `xml:"urn:vim25 CreateScheduledTask,omitempty"` + Res *types.CreateScheduledTaskResponse `xml:"urn:vim25 CreateScheduledTaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *CreateScheduledTaskBody) Fault() *soap.Fault { return b.Fault_ } + +func CreateScheduledTask(ctx context.Context, r soap.RoundTripper, req *types.CreateScheduledTask) (*types.CreateScheduledTaskResponse, error) { + var reqBody, resBody CreateScheduledTaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type CreateScreenshot_TaskBody struct { + Req *types.CreateScreenshot_Task `xml:"urn:vim25 CreateScreenshot_Task,omitempty"` + Res *types.CreateScreenshot_TaskResponse `xml:"urn:vim25 CreateScreenshot_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *CreateScreenshot_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func CreateScreenshot_Task(ctx context.Context, r soap.RoundTripper, req *types.CreateScreenshot_Task) (*types.CreateScreenshot_TaskResponse, error) { + var reqBody, resBody CreateScreenshot_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type CreateSecondaryVMEx_TaskBody struct { + Req *types.CreateSecondaryVMEx_Task `xml:"urn:vim25 CreateSecondaryVMEx_Task,omitempty"` + Res *types.CreateSecondaryVMEx_TaskResponse `xml:"urn:vim25 CreateSecondaryVMEx_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *CreateSecondaryVMEx_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func CreateSecondaryVMEx_Task(ctx context.Context, r soap.RoundTripper, req *types.CreateSecondaryVMEx_Task) (*types.CreateSecondaryVMEx_TaskResponse, error) { + var reqBody, resBody CreateSecondaryVMEx_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type CreateSecondaryVM_TaskBody struct { + Req *types.CreateSecondaryVM_Task `xml:"urn:vim25 CreateSecondaryVM_Task,omitempty"` + Res *types.CreateSecondaryVM_TaskResponse `xml:"urn:vim25 CreateSecondaryVM_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *CreateSecondaryVM_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func CreateSecondaryVM_Task(ctx context.Context, r soap.RoundTripper, req *types.CreateSecondaryVM_Task) (*types.CreateSecondaryVM_TaskResponse, error) { + var reqBody, resBody CreateSecondaryVM_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type CreateSnapshot_TaskBody struct { + Req *types.CreateSnapshot_Task `xml:"urn:vim25 CreateSnapshot_Task,omitempty"` + Res *types.CreateSnapshot_TaskResponse `xml:"urn:vim25 CreateSnapshot_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *CreateSnapshot_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func CreateSnapshot_Task(ctx context.Context, r soap.RoundTripper, req *types.CreateSnapshot_Task) (*types.CreateSnapshot_TaskResponse, error) { + var reqBody, resBody CreateSnapshot_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type CreateStoragePodBody struct { + Req *types.CreateStoragePod `xml:"urn:vim25 CreateStoragePod,omitempty"` + Res *types.CreateStoragePodResponse `xml:"urn:vim25 CreateStoragePodResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *CreateStoragePodBody) Fault() *soap.Fault { return b.Fault_ } + +func CreateStoragePod(ctx context.Context, r soap.RoundTripper, req *types.CreateStoragePod) (*types.CreateStoragePodResponse, error) { + var reqBody, resBody CreateStoragePodBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type CreateTaskBody struct { + Req *types.CreateTask `xml:"urn:vim25 CreateTask,omitempty"` + Res *types.CreateTaskResponse `xml:"urn:vim25 CreateTaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *CreateTaskBody) Fault() *soap.Fault { return b.Fault_ } + +func CreateTask(ctx context.Context, r soap.RoundTripper, req *types.CreateTask) (*types.CreateTaskResponse, error) { + var reqBody, resBody CreateTaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type CreateTemporaryDirectoryInGuestBody struct { + Req *types.CreateTemporaryDirectoryInGuest `xml:"urn:vim25 CreateTemporaryDirectoryInGuest,omitempty"` + Res *types.CreateTemporaryDirectoryInGuestResponse `xml:"urn:vim25 CreateTemporaryDirectoryInGuestResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *CreateTemporaryDirectoryInGuestBody) Fault() *soap.Fault { return b.Fault_ } + +func CreateTemporaryDirectoryInGuest(ctx context.Context, r soap.RoundTripper, req *types.CreateTemporaryDirectoryInGuest) (*types.CreateTemporaryDirectoryInGuestResponse, error) { + var reqBody, resBody CreateTemporaryDirectoryInGuestBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type CreateTemporaryFileInGuestBody struct { + Req *types.CreateTemporaryFileInGuest `xml:"urn:vim25 CreateTemporaryFileInGuest,omitempty"` + Res *types.CreateTemporaryFileInGuestResponse `xml:"urn:vim25 CreateTemporaryFileInGuestResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *CreateTemporaryFileInGuestBody) Fault() *soap.Fault { return b.Fault_ } + +func CreateTemporaryFileInGuest(ctx context.Context, r soap.RoundTripper, req *types.CreateTemporaryFileInGuest) (*types.CreateTemporaryFileInGuestResponse, error) { + var reqBody, resBody CreateTemporaryFileInGuestBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type CreateUserBody struct { + Req *types.CreateUser `xml:"urn:vim25 CreateUser,omitempty"` + Res *types.CreateUserResponse `xml:"urn:vim25 CreateUserResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *CreateUserBody) Fault() *soap.Fault { return b.Fault_ } + +func CreateUser(ctx context.Context, r soap.RoundTripper, req *types.CreateUser) (*types.CreateUserResponse, error) { + var reqBody, resBody CreateUserBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type CreateVAppBody struct { + Req *types.CreateVApp `xml:"urn:vim25 CreateVApp,omitempty"` + Res *types.CreateVAppResponse `xml:"urn:vim25 CreateVAppResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *CreateVAppBody) Fault() *soap.Fault { return b.Fault_ } + +func CreateVApp(ctx context.Context, r soap.RoundTripper, req *types.CreateVApp) (*types.CreateVAppResponse, error) { + var reqBody, resBody CreateVAppBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type CreateVM_TaskBody struct { + Req *types.CreateVM_Task `xml:"urn:vim25 CreateVM_Task,omitempty"` + Res *types.CreateVM_TaskResponse `xml:"urn:vim25 CreateVM_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *CreateVM_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func CreateVM_Task(ctx context.Context, r soap.RoundTripper, req *types.CreateVM_Task) (*types.CreateVM_TaskResponse, error) { + var reqBody, resBody CreateVM_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type CreateVirtualDisk_TaskBody struct { + Req *types.CreateVirtualDisk_Task `xml:"urn:vim25 CreateVirtualDisk_Task,omitempty"` + Res *types.CreateVirtualDisk_TaskResponse `xml:"urn:vim25 CreateVirtualDisk_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *CreateVirtualDisk_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func CreateVirtualDisk_Task(ctx context.Context, r soap.RoundTripper, req *types.CreateVirtualDisk_Task) (*types.CreateVirtualDisk_TaskResponse, error) { + var reqBody, resBody CreateVirtualDisk_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type CreateVmfsDatastoreBody struct { + Req *types.CreateVmfsDatastore `xml:"urn:vim25 CreateVmfsDatastore,omitempty"` + Res *types.CreateVmfsDatastoreResponse `xml:"urn:vim25 CreateVmfsDatastoreResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *CreateVmfsDatastoreBody) Fault() *soap.Fault { return b.Fault_ } + +func CreateVmfsDatastore(ctx context.Context, r soap.RoundTripper, req *types.CreateVmfsDatastore) (*types.CreateVmfsDatastoreResponse, error) { + var reqBody, resBody CreateVmfsDatastoreBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type CreateVvolDatastoreBody struct { + Req *types.CreateVvolDatastore `xml:"urn:vim25 CreateVvolDatastore,omitempty"` + Res *types.CreateVvolDatastoreResponse `xml:"urn:vim25 CreateVvolDatastoreResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *CreateVvolDatastoreBody) Fault() *soap.Fault { return b.Fault_ } + +func CreateVvolDatastore(ctx context.Context, r soap.RoundTripper, req *types.CreateVvolDatastore) (*types.CreateVvolDatastoreResponse, error) { + var reqBody, resBody CreateVvolDatastoreBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type CurrentTimeBody struct { + Req *types.CurrentTime `xml:"urn:vim25 CurrentTime,omitempty"` + Res *types.CurrentTimeResponse `xml:"urn:vim25 CurrentTimeResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *CurrentTimeBody) Fault() *soap.Fault { return b.Fault_ } + +func CurrentTime(ctx context.Context, r soap.RoundTripper, req *types.CurrentTime) (*types.CurrentTimeResponse, error) { + var reqBody, resBody CurrentTimeBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type CustomizationSpecItemToXmlBody struct { + Req *types.CustomizationSpecItemToXml `xml:"urn:vim25 CustomizationSpecItemToXml,omitempty"` + Res *types.CustomizationSpecItemToXmlResponse `xml:"urn:vim25 CustomizationSpecItemToXmlResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *CustomizationSpecItemToXmlBody) Fault() *soap.Fault { return b.Fault_ } + +func CustomizationSpecItemToXml(ctx context.Context, r soap.RoundTripper, req *types.CustomizationSpecItemToXml) (*types.CustomizationSpecItemToXmlResponse, error) { + var reqBody, resBody CustomizationSpecItemToXmlBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type CustomizeVM_TaskBody struct { + Req *types.CustomizeVM_Task `xml:"urn:vim25 CustomizeVM_Task,omitempty"` + Res *types.CustomizeVM_TaskResponse `xml:"urn:vim25 CustomizeVM_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *CustomizeVM_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func CustomizeVM_Task(ctx context.Context, r soap.RoundTripper, req *types.CustomizeVM_Task) (*types.CustomizeVM_TaskResponse, error) { + var reqBody, resBody CustomizeVM_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type DVPortgroupRollback_TaskBody struct { + Req *types.DVPortgroupRollback_Task `xml:"urn:vim25 DVPortgroupRollback_Task,omitempty"` + Res *types.DVPortgroupRollback_TaskResponse `xml:"urn:vim25 DVPortgroupRollback_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *DVPortgroupRollback_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func DVPortgroupRollback_Task(ctx context.Context, r soap.RoundTripper, req *types.DVPortgroupRollback_Task) (*types.DVPortgroupRollback_TaskResponse, error) { + var reqBody, resBody DVPortgroupRollback_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type DVSManagerExportEntity_TaskBody struct { + Req *types.DVSManagerExportEntity_Task `xml:"urn:vim25 DVSManagerExportEntity_Task,omitempty"` + Res *types.DVSManagerExportEntity_TaskResponse `xml:"urn:vim25 DVSManagerExportEntity_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *DVSManagerExportEntity_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func DVSManagerExportEntity_Task(ctx context.Context, r soap.RoundTripper, req *types.DVSManagerExportEntity_Task) (*types.DVSManagerExportEntity_TaskResponse, error) { + var reqBody, resBody DVSManagerExportEntity_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type DVSManagerImportEntity_TaskBody struct { + Req *types.DVSManagerImportEntity_Task `xml:"urn:vim25 DVSManagerImportEntity_Task,omitempty"` + Res *types.DVSManagerImportEntity_TaskResponse `xml:"urn:vim25 DVSManagerImportEntity_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *DVSManagerImportEntity_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func DVSManagerImportEntity_Task(ctx context.Context, r soap.RoundTripper, req *types.DVSManagerImportEntity_Task) (*types.DVSManagerImportEntity_TaskResponse, error) { + var reqBody, resBody DVSManagerImportEntity_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type DVSManagerLookupDvPortGroupBody struct { + Req *types.DVSManagerLookupDvPortGroup `xml:"urn:vim25 DVSManagerLookupDvPortGroup,omitempty"` + Res *types.DVSManagerLookupDvPortGroupResponse `xml:"urn:vim25 DVSManagerLookupDvPortGroupResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *DVSManagerLookupDvPortGroupBody) Fault() *soap.Fault { return b.Fault_ } + +func DVSManagerLookupDvPortGroup(ctx context.Context, r soap.RoundTripper, req *types.DVSManagerLookupDvPortGroup) (*types.DVSManagerLookupDvPortGroupResponse, error) { + var reqBody, resBody DVSManagerLookupDvPortGroupBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type DVSRollback_TaskBody struct { + Req *types.DVSRollback_Task `xml:"urn:vim25 DVSRollback_Task,omitempty"` + Res *types.DVSRollback_TaskResponse `xml:"urn:vim25 DVSRollback_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *DVSRollback_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func DVSRollback_Task(ctx context.Context, r soap.RoundTripper, req *types.DVSRollback_Task) (*types.DVSRollback_TaskResponse, error) { + var reqBody, resBody DVSRollback_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type DatastoreEnterMaintenanceModeBody struct { + Req *types.DatastoreEnterMaintenanceMode `xml:"urn:vim25 DatastoreEnterMaintenanceMode,omitempty"` + Res *types.DatastoreEnterMaintenanceModeResponse `xml:"urn:vim25 DatastoreEnterMaintenanceModeResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *DatastoreEnterMaintenanceModeBody) Fault() *soap.Fault { return b.Fault_ } + +func DatastoreEnterMaintenanceMode(ctx context.Context, r soap.RoundTripper, req *types.DatastoreEnterMaintenanceMode) (*types.DatastoreEnterMaintenanceModeResponse, error) { + var reqBody, resBody DatastoreEnterMaintenanceModeBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type DatastoreExitMaintenanceMode_TaskBody struct { + Req *types.DatastoreExitMaintenanceMode_Task `xml:"urn:vim25 DatastoreExitMaintenanceMode_Task,omitempty"` + Res *types.DatastoreExitMaintenanceMode_TaskResponse `xml:"urn:vim25 DatastoreExitMaintenanceMode_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *DatastoreExitMaintenanceMode_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func DatastoreExitMaintenanceMode_Task(ctx context.Context, r soap.RoundTripper, req *types.DatastoreExitMaintenanceMode_Task) (*types.DatastoreExitMaintenanceMode_TaskResponse, error) { + var reqBody, resBody DatastoreExitMaintenanceMode_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type DecodeLicenseBody struct { + Req *types.DecodeLicense `xml:"urn:vim25 DecodeLicense,omitempty"` + Res *types.DecodeLicenseResponse `xml:"urn:vim25 DecodeLicenseResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *DecodeLicenseBody) Fault() *soap.Fault { return b.Fault_ } + +func DecodeLicense(ctx context.Context, r soap.RoundTripper, req *types.DecodeLicense) (*types.DecodeLicenseResponse, error) { + var reqBody, resBody DecodeLicenseBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type DefragmentAllDisksBody struct { + Req *types.DefragmentAllDisks `xml:"urn:vim25 DefragmentAllDisks,omitempty"` + Res *types.DefragmentAllDisksResponse `xml:"urn:vim25 DefragmentAllDisksResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *DefragmentAllDisksBody) Fault() *soap.Fault { return b.Fault_ } + +func DefragmentAllDisks(ctx context.Context, r soap.RoundTripper, req *types.DefragmentAllDisks) (*types.DefragmentAllDisksResponse, error) { + var reqBody, resBody DefragmentAllDisksBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type DefragmentVirtualDisk_TaskBody struct { + Req *types.DefragmentVirtualDisk_Task `xml:"urn:vim25 DefragmentVirtualDisk_Task,omitempty"` + Res *types.DefragmentVirtualDisk_TaskResponse `xml:"urn:vim25 DefragmentVirtualDisk_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *DefragmentVirtualDisk_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func DefragmentVirtualDisk_Task(ctx context.Context, r soap.RoundTripper, req *types.DefragmentVirtualDisk_Task) (*types.DefragmentVirtualDisk_TaskResponse, error) { + var reqBody, resBody DefragmentVirtualDisk_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type DeleteCustomizationSpecBody struct { + Req *types.DeleteCustomizationSpec `xml:"urn:vim25 DeleteCustomizationSpec,omitempty"` + Res *types.DeleteCustomizationSpecResponse `xml:"urn:vim25 DeleteCustomizationSpecResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *DeleteCustomizationSpecBody) Fault() *soap.Fault { return b.Fault_ } + +func DeleteCustomizationSpec(ctx context.Context, r soap.RoundTripper, req *types.DeleteCustomizationSpec) (*types.DeleteCustomizationSpecResponse, error) { + var reqBody, resBody DeleteCustomizationSpecBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type DeleteDatastoreFile_TaskBody struct { + Req *types.DeleteDatastoreFile_Task `xml:"urn:vim25 DeleteDatastoreFile_Task,omitempty"` + Res *types.DeleteDatastoreFile_TaskResponse `xml:"urn:vim25 DeleteDatastoreFile_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *DeleteDatastoreFile_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func DeleteDatastoreFile_Task(ctx context.Context, r soap.RoundTripper, req *types.DeleteDatastoreFile_Task) (*types.DeleteDatastoreFile_TaskResponse, error) { + var reqBody, resBody DeleteDatastoreFile_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type DeleteDirectoryBody struct { + Req *types.DeleteDirectory `xml:"urn:vim25 DeleteDirectory,omitempty"` + Res *types.DeleteDirectoryResponse `xml:"urn:vim25 DeleteDirectoryResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *DeleteDirectoryBody) Fault() *soap.Fault { return b.Fault_ } + +func DeleteDirectory(ctx context.Context, r soap.RoundTripper, req *types.DeleteDirectory) (*types.DeleteDirectoryResponse, error) { + var reqBody, resBody DeleteDirectoryBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type DeleteDirectoryInGuestBody struct { + Req *types.DeleteDirectoryInGuest `xml:"urn:vim25 DeleteDirectoryInGuest,omitempty"` + Res *types.DeleteDirectoryInGuestResponse `xml:"urn:vim25 DeleteDirectoryInGuestResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *DeleteDirectoryInGuestBody) Fault() *soap.Fault { return b.Fault_ } + +func DeleteDirectoryInGuest(ctx context.Context, r soap.RoundTripper, req *types.DeleteDirectoryInGuest) (*types.DeleteDirectoryInGuestResponse, error) { + var reqBody, resBody DeleteDirectoryInGuestBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type DeleteFileBody struct { + Req *types.DeleteFile `xml:"urn:vim25 DeleteFile,omitempty"` + Res *types.DeleteFileResponse `xml:"urn:vim25 DeleteFileResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *DeleteFileBody) Fault() *soap.Fault { return b.Fault_ } + +func DeleteFile(ctx context.Context, r soap.RoundTripper, req *types.DeleteFile) (*types.DeleteFileResponse, error) { + var reqBody, resBody DeleteFileBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type DeleteFileInGuestBody struct { + Req *types.DeleteFileInGuest `xml:"urn:vim25 DeleteFileInGuest,omitempty"` + Res *types.DeleteFileInGuestResponse `xml:"urn:vim25 DeleteFileInGuestResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *DeleteFileInGuestBody) Fault() *soap.Fault { return b.Fault_ } + +func DeleteFileInGuest(ctx context.Context, r soap.RoundTripper, req *types.DeleteFileInGuest) (*types.DeleteFileInGuestResponse, error) { + var reqBody, resBody DeleteFileInGuestBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type DeleteRegistryKeyInGuestBody struct { + Req *types.DeleteRegistryKeyInGuest `xml:"urn:vim25 DeleteRegistryKeyInGuest,omitempty"` + Res *types.DeleteRegistryKeyInGuestResponse `xml:"urn:vim25 DeleteRegistryKeyInGuestResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *DeleteRegistryKeyInGuestBody) Fault() *soap.Fault { return b.Fault_ } + +func DeleteRegistryKeyInGuest(ctx context.Context, r soap.RoundTripper, req *types.DeleteRegistryKeyInGuest) (*types.DeleteRegistryKeyInGuestResponse, error) { + var reqBody, resBody DeleteRegistryKeyInGuestBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type DeleteRegistryValueInGuestBody struct { + Req *types.DeleteRegistryValueInGuest `xml:"urn:vim25 DeleteRegistryValueInGuest,omitempty"` + Res *types.DeleteRegistryValueInGuestResponse `xml:"urn:vim25 DeleteRegistryValueInGuestResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *DeleteRegistryValueInGuestBody) Fault() *soap.Fault { return b.Fault_ } + +func DeleteRegistryValueInGuest(ctx context.Context, r soap.RoundTripper, req *types.DeleteRegistryValueInGuest) (*types.DeleteRegistryValueInGuestResponse, error) { + var reqBody, resBody DeleteRegistryValueInGuestBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type DeleteScsiLunStateBody struct { + Req *types.DeleteScsiLunState `xml:"urn:vim25 DeleteScsiLunState,omitempty"` + Res *types.DeleteScsiLunStateResponse `xml:"urn:vim25 DeleteScsiLunStateResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *DeleteScsiLunStateBody) Fault() *soap.Fault { return b.Fault_ } + +func DeleteScsiLunState(ctx context.Context, r soap.RoundTripper, req *types.DeleteScsiLunState) (*types.DeleteScsiLunStateResponse, error) { + var reqBody, resBody DeleteScsiLunStateBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type DeleteVffsVolumeStateBody struct { + Req *types.DeleteVffsVolumeState `xml:"urn:vim25 DeleteVffsVolumeState,omitempty"` + Res *types.DeleteVffsVolumeStateResponse `xml:"urn:vim25 DeleteVffsVolumeStateResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *DeleteVffsVolumeStateBody) Fault() *soap.Fault { return b.Fault_ } + +func DeleteVffsVolumeState(ctx context.Context, r soap.RoundTripper, req *types.DeleteVffsVolumeState) (*types.DeleteVffsVolumeStateResponse, error) { + var reqBody, resBody DeleteVffsVolumeStateBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type DeleteVirtualDisk_TaskBody struct { + Req *types.DeleteVirtualDisk_Task `xml:"urn:vim25 DeleteVirtualDisk_Task,omitempty"` + Res *types.DeleteVirtualDisk_TaskResponse `xml:"urn:vim25 DeleteVirtualDisk_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *DeleteVirtualDisk_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func DeleteVirtualDisk_Task(ctx context.Context, r soap.RoundTripper, req *types.DeleteVirtualDisk_Task) (*types.DeleteVirtualDisk_TaskResponse, error) { + var reqBody, resBody DeleteVirtualDisk_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type DeleteVmfsVolumeStateBody struct { + Req *types.DeleteVmfsVolumeState `xml:"urn:vim25 DeleteVmfsVolumeState,omitempty"` + Res *types.DeleteVmfsVolumeStateResponse `xml:"urn:vim25 DeleteVmfsVolumeStateResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *DeleteVmfsVolumeStateBody) Fault() *soap.Fault { return b.Fault_ } + +func DeleteVmfsVolumeState(ctx context.Context, r soap.RoundTripper, req *types.DeleteVmfsVolumeState) (*types.DeleteVmfsVolumeStateResponse, error) { + var reqBody, resBody DeleteVmfsVolumeStateBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type DeleteVsanObjectsBody struct { + Req *types.DeleteVsanObjects `xml:"urn:vim25 DeleteVsanObjects,omitempty"` + Res *types.DeleteVsanObjectsResponse `xml:"urn:vim25 DeleteVsanObjectsResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *DeleteVsanObjectsBody) Fault() *soap.Fault { return b.Fault_ } + +func DeleteVsanObjects(ctx context.Context, r soap.RoundTripper, req *types.DeleteVsanObjects) (*types.DeleteVsanObjectsResponse, error) { + var reqBody, resBody DeleteVsanObjectsBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type DeselectVnicBody struct { + Req *types.DeselectVnic `xml:"urn:vim25 DeselectVnic,omitempty"` + Res *types.DeselectVnicResponse `xml:"urn:vim25 DeselectVnicResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *DeselectVnicBody) Fault() *soap.Fault { return b.Fault_ } + +func DeselectVnic(ctx context.Context, r soap.RoundTripper, req *types.DeselectVnic) (*types.DeselectVnicResponse, error) { + var reqBody, resBody DeselectVnicBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type DeselectVnicForNicTypeBody struct { + Req *types.DeselectVnicForNicType `xml:"urn:vim25 DeselectVnicForNicType,omitempty"` + Res *types.DeselectVnicForNicTypeResponse `xml:"urn:vim25 DeselectVnicForNicTypeResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *DeselectVnicForNicTypeBody) Fault() *soap.Fault { return b.Fault_ } + +func DeselectVnicForNicType(ctx context.Context, r soap.RoundTripper, req *types.DeselectVnicForNicType) (*types.DeselectVnicForNicTypeResponse, error) { + var reqBody, resBody DeselectVnicForNicTypeBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type DestroyChildrenBody struct { + Req *types.DestroyChildren `xml:"urn:vim25 DestroyChildren,omitempty"` + Res *types.DestroyChildrenResponse `xml:"urn:vim25 DestroyChildrenResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *DestroyChildrenBody) Fault() *soap.Fault { return b.Fault_ } + +func DestroyChildren(ctx context.Context, r soap.RoundTripper, req *types.DestroyChildren) (*types.DestroyChildrenResponse, error) { + var reqBody, resBody DestroyChildrenBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type DestroyCollectorBody struct { + Req *types.DestroyCollector `xml:"urn:vim25 DestroyCollector,omitempty"` + Res *types.DestroyCollectorResponse `xml:"urn:vim25 DestroyCollectorResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *DestroyCollectorBody) Fault() *soap.Fault { return b.Fault_ } + +func DestroyCollector(ctx context.Context, r soap.RoundTripper, req *types.DestroyCollector) (*types.DestroyCollectorResponse, error) { + var reqBody, resBody DestroyCollectorBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type DestroyDatastoreBody struct { + Req *types.DestroyDatastore `xml:"urn:vim25 DestroyDatastore,omitempty"` + Res *types.DestroyDatastoreResponse `xml:"urn:vim25 DestroyDatastoreResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *DestroyDatastoreBody) Fault() *soap.Fault { return b.Fault_ } + +func DestroyDatastore(ctx context.Context, r soap.RoundTripper, req *types.DestroyDatastore) (*types.DestroyDatastoreResponse, error) { + var reqBody, resBody DestroyDatastoreBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type DestroyIpPoolBody struct { + Req *types.DestroyIpPool `xml:"urn:vim25 DestroyIpPool,omitempty"` + Res *types.DestroyIpPoolResponse `xml:"urn:vim25 DestroyIpPoolResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *DestroyIpPoolBody) Fault() *soap.Fault { return b.Fault_ } + +func DestroyIpPool(ctx context.Context, r soap.RoundTripper, req *types.DestroyIpPool) (*types.DestroyIpPoolResponse, error) { + var reqBody, resBody DestroyIpPoolBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type DestroyNetworkBody struct { + Req *types.DestroyNetwork `xml:"urn:vim25 DestroyNetwork,omitempty"` + Res *types.DestroyNetworkResponse `xml:"urn:vim25 DestroyNetworkResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *DestroyNetworkBody) Fault() *soap.Fault { return b.Fault_ } + +func DestroyNetwork(ctx context.Context, r soap.RoundTripper, req *types.DestroyNetwork) (*types.DestroyNetworkResponse, error) { + var reqBody, resBody DestroyNetworkBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type DestroyProfileBody struct { + Req *types.DestroyProfile `xml:"urn:vim25 DestroyProfile,omitempty"` + Res *types.DestroyProfileResponse `xml:"urn:vim25 DestroyProfileResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *DestroyProfileBody) Fault() *soap.Fault { return b.Fault_ } + +func DestroyProfile(ctx context.Context, r soap.RoundTripper, req *types.DestroyProfile) (*types.DestroyProfileResponse, error) { + var reqBody, resBody DestroyProfileBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type DestroyPropertyCollectorBody struct { + Req *types.DestroyPropertyCollector `xml:"urn:vim25 DestroyPropertyCollector,omitempty"` + Res *types.DestroyPropertyCollectorResponse `xml:"urn:vim25 DestroyPropertyCollectorResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *DestroyPropertyCollectorBody) Fault() *soap.Fault { return b.Fault_ } + +func DestroyPropertyCollector(ctx context.Context, r soap.RoundTripper, req *types.DestroyPropertyCollector) (*types.DestroyPropertyCollectorResponse, error) { + var reqBody, resBody DestroyPropertyCollectorBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type DestroyPropertyFilterBody struct { + Req *types.DestroyPropertyFilter `xml:"urn:vim25 DestroyPropertyFilter,omitempty"` + Res *types.DestroyPropertyFilterResponse `xml:"urn:vim25 DestroyPropertyFilterResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *DestroyPropertyFilterBody) Fault() *soap.Fault { return b.Fault_ } + +func DestroyPropertyFilter(ctx context.Context, r soap.RoundTripper, req *types.DestroyPropertyFilter) (*types.DestroyPropertyFilterResponse, error) { + var reqBody, resBody DestroyPropertyFilterBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type DestroyVffsBody struct { + Req *types.DestroyVffs `xml:"urn:vim25 DestroyVffs,omitempty"` + Res *types.DestroyVffsResponse `xml:"urn:vim25 DestroyVffsResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *DestroyVffsBody) Fault() *soap.Fault { return b.Fault_ } + +func DestroyVffs(ctx context.Context, r soap.RoundTripper, req *types.DestroyVffs) (*types.DestroyVffsResponse, error) { + var reqBody, resBody DestroyVffsBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type DestroyViewBody struct { + Req *types.DestroyView `xml:"urn:vim25 DestroyView,omitempty"` + Res *types.DestroyViewResponse `xml:"urn:vim25 DestroyViewResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *DestroyViewBody) Fault() *soap.Fault { return b.Fault_ } + +func DestroyView(ctx context.Context, r soap.RoundTripper, req *types.DestroyView) (*types.DestroyViewResponse, error) { + var reqBody, resBody DestroyViewBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type Destroy_TaskBody struct { + Req *types.Destroy_Task `xml:"urn:vim25 Destroy_Task,omitempty"` + Res *types.Destroy_TaskResponse `xml:"urn:vim25 Destroy_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *Destroy_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func Destroy_Task(ctx context.Context, r soap.RoundTripper, req *types.Destroy_Task) (*types.Destroy_TaskResponse, error) { + var reqBody, resBody Destroy_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type DetachScsiLunBody struct { + Req *types.DetachScsiLun `xml:"urn:vim25 DetachScsiLun,omitempty"` + Res *types.DetachScsiLunResponse `xml:"urn:vim25 DetachScsiLunResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *DetachScsiLunBody) Fault() *soap.Fault { return b.Fault_ } + +func DetachScsiLun(ctx context.Context, r soap.RoundTripper, req *types.DetachScsiLun) (*types.DetachScsiLunResponse, error) { + var reqBody, resBody DetachScsiLunBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type DetachScsiLunEx_TaskBody struct { + Req *types.DetachScsiLunEx_Task `xml:"urn:vim25 DetachScsiLunEx_Task,omitempty"` + Res *types.DetachScsiLunEx_TaskResponse `xml:"urn:vim25 DetachScsiLunEx_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *DetachScsiLunEx_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func DetachScsiLunEx_Task(ctx context.Context, r soap.RoundTripper, req *types.DetachScsiLunEx_Task) (*types.DetachScsiLunEx_TaskResponse, error) { + var reqBody, resBody DetachScsiLunEx_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type DisableEvcMode_TaskBody struct { + Req *types.DisableEvcMode_Task `xml:"urn:vim25 DisableEvcMode_Task,omitempty"` + Res *types.DisableEvcMode_TaskResponse `xml:"urn:vim25 DisableEvcMode_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *DisableEvcMode_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func DisableEvcMode_Task(ctx context.Context, r soap.RoundTripper, req *types.DisableEvcMode_Task) (*types.DisableEvcMode_TaskResponse, error) { + var reqBody, resBody DisableEvcMode_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type DisableFeatureBody struct { + Req *types.DisableFeature `xml:"urn:vim25 DisableFeature,omitempty"` + Res *types.DisableFeatureResponse `xml:"urn:vim25 DisableFeatureResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *DisableFeatureBody) Fault() *soap.Fault { return b.Fault_ } + +func DisableFeature(ctx context.Context, r soap.RoundTripper, req *types.DisableFeature) (*types.DisableFeatureResponse, error) { + var reqBody, resBody DisableFeatureBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type DisableHyperThreadingBody struct { + Req *types.DisableHyperThreading `xml:"urn:vim25 DisableHyperThreading,omitempty"` + Res *types.DisableHyperThreadingResponse `xml:"urn:vim25 DisableHyperThreadingResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *DisableHyperThreadingBody) Fault() *soap.Fault { return b.Fault_ } + +func DisableHyperThreading(ctx context.Context, r soap.RoundTripper, req *types.DisableHyperThreading) (*types.DisableHyperThreadingResponse, error) { + var reqBody, resBody DisableHyperThreadingBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type DisableMultipathPathBody struct { + Req *types.DisableMultipathPath `xml:"urn:vim25 DisableMultipathPath,omitempty"` + Res *types.DisableMultipathPathResponse `xml:"urn:vim25 DisableMultipathPathResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *DisableMultipathPathBody) Fault() *soap.Fault { return b.Fault_ } + +func DisableMultipathPath(ctx context.Context, r soap.RoundTripper, req *types.DisableMultipathPath) (*types.DisableMultipathPathResponse, error) { + var reqBody, resBody DisableMultipathPathBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type DisableRulesetBody struct { + Req *types.DisableRuleset `xml:"urn:vim25 DisableRuleset,omitempty"` + Res *types.DisableRulesetResponse `xml:"urn:vim25 DisableRulesetResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *DisableRulesetBody) Fault() *soap.Fault { return b.Fault_ } + +func DisableRuleset(ctx context.Context, r soap.RoundTripper, req *types.DisableRuleset) (*types.DisableRulesetResponse, error) { + var reqBody, resBody DisableRulesetBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type DisableSecondaryVM_TaskBody struct { + Req *types.DisableSecondaryVM_Task `xml:"urn:vim25 DisableSecondaryVM_Task,omitempty"` + Res *types.DisableSecondaryVM_TaskResponse `xml:"urn:vim25 DisableSecondaryVM_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *DisableSecondaryVM_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func DisableSecondaryVM_Task(ctx context.Context, r soap.RoundTripper, req *types.DisableSecondaryVM_Task) (*types.DisableSecondaryVM_TaskResponse, error) { + var reqBody, resBody DisableSecondaryVM_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type DisableSmartCardAuthenticationBody struct { + Req *types.DisableSmartCardAuthentication `xml:"urn:vim25 DisableSmartCardAuthentication,omitempty"` + Res *types.DisableSmartCardAuthenticationResponse `xml:"urn:vim25 DisableSmartCardAuthenticationResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *DisableSmartCardAuthenticationBody) Fault() *soap.Fault { return b.Fault_ } + +func DisableSmartCardAuthentication(ctx context.Context, r soap.RoundTripper, req *types.DisableSmartCardAuthentication) (*types.DisableSmartCardAuthenticationResponse, error) { + var reqBody, resBody DisableSmartCardAuthenticationBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type DisconnectHost_TaskBody struct { + Req *types.DisconnectHost_Task `xml:"urn:vim25 DisconnectHost_Task,omitempty"` + Res *types.DisconnectHost_TaskResponse `xml:"urn:vim25 DisconnectHost_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *DisconnectHost_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func DisconnectHost_Task(ctx context.Context, r soap.RoundTripper, req *types.DisconnectHost_Task) (*types.DisconnectHost_TaskResponse, error) { + var reqBody, resBody DisconnectHost_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type DiscoverFcoeHbasBody struct { + Req *types.DiscoverFcoeHbas `xml:"urn:vim25 DiscoverFcoeHbas,omitempty"` + Res *types.DiscoverFcoeHbasResponse `xml:"urn:vim25 DiscoverFcoeHbasResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *DiscoverFcoeHbasBody) Fault() *soap.Fault { return b.Fault_ } + +func DiscoverFcoeHbas(ctx context.Context, r soap.RoundTripper, req *types.DiscoverFcoeHbas) (*types.DiscoverFcoeHbasResponse, error) { + var reqBody, resBody DiscoverFcoeHbasBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type DissociateProfileBody struct { + Req *types.DissociateProfile `xml:"urn:vim25 DissociateProfile,omitempty"` + Res *types.DissociateProfileResponse `xml:"urn:vim25 DissociateProfileResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *DissociateProfileBody) Fault() *soap.Fault { return b.Fault_ } + +func DissociateProfile(ctx context.Context, r soap.RoundTripper, req *types.DissociateProfile) (*types.DissociateProfileResponse, error) { + var reqBody, resBody DissociateProfileBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type DoesCustomizationSpecExistBody struct { + Req *types.DoesCustomizationSpecExist `xml:"urn:vim25 DoesCustomizationSpecExist,omitempty"` + Res *types.DoesCustomizationSpecExistResponse `xml:"urn:vim25 DoesCustomizationSpecExistResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *DoesCustomizationSpecExistBody) Fault() *soap.Fault { return b.Fault_ } + +func DoesCustomizationSpecExist(ctx context.Context, r soap.RoundTripper, req *types.DoesCustomizationSpecExist) (*types.DoesCustomizationSpecExistResponse, error) { + var reqBody, resBody DoesCustomizationSpecExistBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type DuplicateCustomizationSpecBody struct { + Req *types.DuplicateCustomizationSpec `xml:"urn:vim25 DuplicateCustomizationSpec,omitempty"` + Res *types.DuplicateCustomizationSpecResponse `xml:"urn:vim25 DuplicateCustomizationSpecResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *DuplicateCustomizationSpecBody) Fault() *soap.Fault { return b.Fault_ } + +func DuplicateCustomizationSpec(ctx context.Context, r soap.RoundTripper, req *types.DuplicateCustomizationSpec) (*types.DuplicateCustomizationSpecResponse, error) { + var reqBody, resBody DuplicateCustomizationSpecBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type DvsReconfigureVmVnicNetworkResourcePool_TaskBody struct { + Req *types.DvsReconfigureVmVnicNetworkResourcePool_Task `xml:"urn:vim25 DvsReconfigureVmVnicNetworkResourcePool_Task,omitempty"` + Res *types.DvsReconfigureVmVnicNetworkResourcePool_TaskResponse `xml:"urn:vim25 DvsReconfigureVmVnicNetworkResourcePool_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *DvsReconfigureVmVnicNetworkResourcePool_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func DvsReconfigureVmVnicNetworkResourcePool_Task(ctx context.Context, r soap.RoundTripper, req *types.DvsReconfigureVmVnicNetworkResourcePool_Task) (*types.DvsReconfigureVmVnicNetworkResourcePool_TaskResponse, error) { + var reqBody, resBody DvsReconfigureVmVnicNetworkResourcePool_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type EagerZeroVirtualDisk_TaskBody struct { + Req *types.EagerZeroVirtualDisk_Task `xml:"urn:vim25 EagerZeroVirtualDisk_Task,omitempty"` + Res *types.EagerZeroVirtualDisk_TaskResponse `xml:"urn:vim25 EagerZeroVirtualDisk_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *EagerZeroVirtualDisk_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func EagerZeroVirtualDisk_Task(ctx context.Context, r soap.RoundTripper, req *types.EagerZeroVirtualDisk_Task) (*types.EagerZeroVirtualDisk_TaskResponse, error) { + var reqBody, resBody EagerZeroVirtualDisk_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type EnableAlarmActionsBody struct { + Req *types.EnableAlarmActions `xml:"urn:vim25 EnableAlarmActions,omitempty"` + Res *types.EnableAlarmActionsResponse `xml:"urn:vim25 EnableAlarmActionsResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *EnableAlarmActionsBody) Fault() *soap.Fault { return b.Fault_ } + +func EnableAlarmActions(ctx context.Context, r soap.RoundTripper, req *types.EnableAlarmActions) (*types.EnableAlarmActionsResponse, error) { + var reqBody, resBody EnableAlarmActionsBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type EnableFeatureBody struct { + Req *types.EnableFeature `xml:"urn:vim25 EnableFeature,omitempty"` + Res *types.EnableFeatureResponse `xml:"urn:vim25 EnableFeatureResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *EnableFeatureBody) Fault() *soap.Fault { return b.Fault_ } + +func EnableFeature(ctx context.Context, r soap.RoundTripper, req *types.EnableFeature) (*types.EnableFeatureResponse, error) { + var reqBody, resBody EnableFeatureBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type EnableHyperThreadingBody struct { + Req *types.EnableHyperThreading `xml:"urn:vim25 EnableHyperThreading,omitempty"` + Res *types.EnableHyperThreadingResponse `xml:"urn:vim25 EnableHyperThreadingResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *EnableHyperThreadingBody) Fault() *soap.Fault { return b.Fault_ } + +func EnableHyperThreading(ctx context.Context, r soap.RoundTripper, req *types.EnableHyperThreading) (*types.EnableHyperThreadingResponse, error) { + var reqBody, resBody EnableHyperThreadingBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type EnableMultipathPathBody struct { + Req *types.EnableMultipathPath `xml:"urn:vim25 EnableMultipathPath,omitempty"` + Res *types.EnableMultipathPathResponse `xml:"urn:vim25 EnableMultipathPathResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *EnableMultipathPathBody) Fault() *soap.Fault { return b.Fault_ } + +func EnableMultipathPath(ctx context.Context, r soap.RoundTripper, req *types.EnableMultipathPath) (*types.EnableMultipathPathResponse, error) { + var reqBody, resBody EnableMultipathPathBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type EnableNetworkResourceManagementBody struct { + Req *types.EnableNetworkResourceManagement `xml:"urn:vim25 EnableNetworkResourceManagement,omitempty"` + Res *types.EnableNetworkResourceManagementResponse `xml:"urn:vim25 EnableNetworkResourceManagementResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *EnableNetworkResourceManagementBody) Fault() *soap.Fault { return b.Fault_ } + +func EnableNetworkResourceManagement(ctx context.Context, r soap.RoundTripper, req *types.EnableNetworkResourceManagement) (*types.EnableNetworkResourceManagementResponse, error) { + var reqBody, resBody EnableNetworkResourceManagementBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type EnableRulesetBody struct { + Req *types.EnableRuleset `xml:"urn:vim25 EnableRuleset,omitempty"` + Res *types.EnableRulesetResponse `xml:"urn:vim25 EnableRulesetResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *EnableRulesetBody) Fault() *soap.Fault { return b.Fault_ } + +func EnableRuleset(ctx context.Context, r soap.RoundTripper, req *types.EnableRuleset) (*types.EnableRulesetResponse, error) { + var reqBody, resBody EnableRulesetBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type EnableSecondaryVM_TaskBody struct { + Req *types.EnableSecondaryVM_Task `xml:"urn:vim25 EnableSecondaryVM_Task,omitempty"` + Res *types.EnableSecondaryVM_TaskResponse `xml:"urn:vim25 EnableSecondaryVM_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *EnableSecondaryVM_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func EnableSecondaryVM_Task(ctx context.Context, r soap.RoundTripper, req *types.EnableSecondaryVM_Task) (*types.EnableSecondaryVM_TaskResponse, error) { + var reqBody, resBody EnableSecondaryVM_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type EnableSmartCardAuthenticationBody struct { + Req *types.EnableSmartCardAuthentication `xml:"urn:vim25 EnableSmartCardAuthentication,omitempty"` + Res *types.EnableSmartCardAuthenticationResponse `xml:"urn:vim25 EnableSmartCardAuthenticationResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *EnableSmartCardAuthenticationBody) Fault() *soap.Fault { return b.Fault_ } + +func EnableSmartCardAuthentication(ctx context.Context, r soap.RoundTripper, req *types.EnableSmartCardAuthentication) (*types.EnableSmartCardAuthenticationResponse, error) { + var reqBody, resBody EnableSmartCardAuthenticationBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type EnterLockdownModeBody struct { + Req *types.EnterLockdownMode `xml:"urn:vim25 EnterLockdownMode,omitempty"` + Res *types.EnterLockdownModeResponse `xml:"urn:vim25 EnterLockdownModeResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *EnterLockdownModeBody) Fault() *soap.Fault { return b.Fault_ } + +func EnterLockdownMode(ctx context.Context, r soap.RoundTripper, req *types.EnterLockdownMode) (*types.EnterLockdownModeResponse, error) { + var reqBody, resBody EnterLockdownModeBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type EnterMaintenanceMode_TaskBody struct { + Req *types.EnterMaintenanceMode_Task `xml:"urn:vim25 EnterMaintenanceMode_Task,omitempty"` + Res *types.EnterMaintenanceMode_TaskResponse `xml:"urn:vim25 EnterMaintenanceMode_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *EnterMaintenanceMode_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func EnterMaintenanceMode_Task(ctx context.Context, r soap.RoundTripper, req *types.EnterMaintenanceMode_Task) (*types.EnterMaintenanceMode_TaskResponse, error) { + var reqBody, resBody EnterMaintenanceMode_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type EstimateDatabaseSizeBody struct { + Req *types.EstimateDatabaseSize `xml:"urn:vim25 EstimateDatabaseSize,omitempty"` + Res *types.EstimateDatabaseSizeResponse `xml:"urn:vim25 EstimateDatabaseSizeResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *EstimateDatabaseSizeBody) Fault() *soap.Fault { return b.Fault_ } + +func EstimateDatabaseSize(ctx context.Context, r soap.RoundTripper, req *types.EstimateDatabaseSize) (*types.EstimateDatabaseSizeResponse, error) { + var reqBody, resBody EstimateDatabaseSizeBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type EstimateStorageForConsolidateSnapshots_TaskBody struct { + Req *types.EstimateStorageForConsolidateSnapshots_Task `xml:"urn:vim25 EstimateStorageForConsolidateSnapshots_Task,omitempty"` + Res *types.EstimateStorageForConsolidateSnapshots_TaskResponse `xml:"urn:vim25 EstimateStorageForConsolidateSnapshots_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *EstimateStorageForConsolidateSnapshots_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func EstimateStorageForConsolidateSnapshots_Task(ctx context.Context, r soap.RoundTripper, req *types.EstimateStorageForConsolidateSnapshots_Task) (*types.EstimateStorageForConsolidateSnapshots_TaskResponse, error) { + var reqBody, resBody EstimateStorageForConsolidateSnapshots_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type EsxAgentHostManagerUpdateConfigBody struct { + Req *types.EsxAgentHostManagerUpdateConfig `xml:"urn:vim25 EsxAgentHostManagerUpdateConfig,omitempty"` + Res *types.EsxAgentHostManagerUpdateConfigResponse `xml:"urn:vim25 EsxAgentHostManagerUpdateConfigResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *EsxAgentHostManagerUpdateConfigBody) Fault() *soap.Fault { return b.Fault_ } + +func EsxAgentHostManagerUpdateConfig(ctx context.Context, r soap.RoundTripper, req *types.EsxAgentHostManagerUpdateConfig) (*types.EsxAgentHostManagerUpdateConfigResponse, error) { + var reqBody, resBody EsxAgentHostManagerUpdateConfigBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type EvacuateVsanNode_TaskBody struct { + Req *types.EvacuateVsanNode_Task `xml:"urn:vim25 EvacuateVsanNode_Task,omitempty"` + Res *types.EvacuateVsanNode_TaskResponse `xml:"urn:vim25 EvacuateVsanNode_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *EvacuateVsanNode_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func EvacuateVsanNode_Task(ctx context.Context, r soap.RoundTripper, req *types.EvacuateVsanNode_Task) (*types.EvacuateVsanNode_TaskResponse, error) { + var reqBody, resBody EvacuateVsanNode_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type EvcManagerBody struct { + Req *types.EvcManager `xml:"urn:vim25 EvcManager,omitempty"` + Res *types.EvcManagerResponse `xml:"urn:vim25 EvcManagerResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *EvcManagerBody) Fault() *soap.Fault { return b.Fault_ } + +func EvcManager(ctx context.Context, r soap.RoundTripper, req *types.EvcManager) (*types.EvcManagerResponse, error) { + var reqBody, resBody EvcManagerBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type ExecuteHostProfileBody struct { + Req *types.ExecuteHostProfile `xml:"urn:vim25 ExecuteHostProfile,omitempty"` + Res *types.ExecuteHostProfileResponse `xml:"urn:vim25 ExecuteHostProfileResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *ExecuteHostProfileBody) Fault() *soap.Fault { return b.Fault_ } + +func ExecuteHostProfile(ctx context.Context, r soap.RoundTripper, req *types.ExecuteHostProfile) (*types.ExecuteHostProfileResponse, error) { + var reqBody, resBody ExecuteHostProfileBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type ExecuteSimpleCommandBody struct { + Req *types.ExecuteSimpleCommand `xml:"urn:vim25 ExecuteSimpleCommand,omitempty"` + Res *types.ExecuteSimpleCommandResponse `xml:"urn:vim25 ExecuteSimpleCommandResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *ExecuteSimpleCommandBody) Fault() *soap.Fault { return b.Fault_ } + +func ExecuteSimpleCommand(ctx context.Context, r soap.RoundTripper, req *types.ExecuteSimpleCommand) (*types.ExecuteSimpleCommandResponse, error) { + var reqBody, resBody ExecuteSimpleCommandBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type ExitLockdownModeBody struct { + Req *types.ExitLockdownMode `xml:"urn:vim25 ExitLockdownMode,omitempty"` + Res *types.ExitLockdownModeResponse `xml:"urn:vim25 ExitLockdownModeResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *ExitLockdownModeBody) Fault() *soap.Fault { return b.Fault_ } + +func ExitLockdownMode(ctx context.Context, r soap.RoundTripper, req *types.ExitLockdownMode) (*types.ExitLockdownModeResponse, error) { + var reqBody, resBody ExitLockdownModeBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type ExitMaintenanceMode_TaskBody struct { + Req *types.ExitMaintenanceMode_Task `xml:"urn:vim25 ExitMaintenanceMode_Task,omitempty"` + Res *types.ExitMaintenanceMode_TaskResponse `xml:"urn:vim25 ExitMaintenanceMode_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *ExitMaintenanceMode_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func ExitMaintenanceMode_Task(ctx context.Context, r soap.RoundTripper, req *types.ExitMaintenanceMode_Task) (*types.ExitMaintenanceMode_TaskResponse, error) { + var reqBody, resBody ExitMaintenanceMode_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type ExpandVmfsDatastoreBody struct { + Req *types.ExpandVmfsDatastore `xml:"urn:vim25 ExpandVmfsDatastore,omitempty"` + Res *types.ExpandVmfsDatastoreResponse `xml:"urn:vim25 ExpandVmfsDatastoreResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *ExpandVmfsDatastoreBody) Fault() *soap.Fault { return b.Fault_ } + +func ExpandVmfsDatastore(ctx context.Context, r soap.RoundTripper, req *types.ExpandVmfsDatastore) (*types.ExpandVmfsDatastoreResponse, error) { + var reqBody, resBody ExpandVmfsDatastoreBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type ExpandVmfsExtentBody struct { + Req *types.ExpandVmfsExtent `xml:"urn:vim25 ExpandVmfsExtent,omitempty"` + Res *types.ExpandVmfsExtentResponse `xml:"urn:vim25 ExpandVmfsExtentResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *ExpandVmfsExtentBody) Fault() *soap.Fault { return b.Fault_ } + +func ExpandVmfsExtent(ctx context.Context, r soap.RoundTripper, req *types.ExpandVmfsExtent) (*types.ExpandVmfsExtentResponse, error) { + var reqBody, resBody ExpandVmfsExtentBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type ExportAnswerFile_TaskBody struct { + Req *types.ExportAnswerFile_Task `xml:"urn:vim25 ExportAnswerFile_Task,omitempty"` + Res *types.ExportAnswerFile_TaskResponse `xml:"urn:vim25 ExportAnswerFile_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *ExportAnswerFile_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func ExportAnswerFile_Task(ctx context.Context, r soap.RoundTripper, req *types.ExportAnswerFile_Task) (*types.ExportAnswerFile_TaskResponse, error) { + var reqBody, resBody ExportAnswerFile_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type ExportProfileBody struct { + Req *types.ExportProfile `xml:"urn:vim25 ExportProfile,omitempty"` + Res *types.ExportProfileResponse `xml:"urn:vim25 ExportProfileResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *ExportProfileBody) Fault() *soap.Fault { return b.Fault_ } + +func ExportProfile(ctx context.Context, r soap.RoundTripper, req *types.ExportProfile) (*types.ExportProfileResponse, error) { + var reqBody, resBody ExportProfileBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type ExportSnapshotBody struct { + Req *types.ExportSnapshot `xml:"urn:vim25 ExportSnapshot,omitempty"` + Res *types.ExportSnapshotResponse `xml:"urn:vim25 ExportSnapshotResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *ExportSnapshotBody) Fault() *soap.Fault { return b.Fault_ } + +func ExportSnapshot(ctx context.Context, r soap.RoundTripper, req *types.ExportSnapshot) (*types.ExportSnapshotResponse, error) { + var reqBody, resBody ExportSnapshotBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type ExportVAppBody struct { + Req *types.ExportVApp `xml:"urn:vim25 ExportVApp,omitempty"` + Res *types.ExportVAppResponse `xml:"urn:vim25 ExportVAppResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *ExportVAppBody) Fault() *soap.Fault { return b.Fault_ } + +func ExportVApp(ctx context.Context, r soap.RoundTripper, req *types.ExportVApp) (*types.ExportVAppResponse, error) { + var reqBody, resBody ExportVAppBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type ExportVmBody struct { + Req *types.ExportVm `xml:"urn:vim25 ExportVm,omitempty"` + Res *types.ExportVmResponse `xml:"urn:vim25 ExportVmResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *ExportVmBody) Fault() *soap.Fault { return b.Fault_ } + +func ExportVm(ctx context.Context, r soap.RoundTripper, req *types.ExportVm) (*types.ExportVmResponse, error) { + var reqBody, resBody ExportVmBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type ExtendVffsBody struct { + Req *types.ExtendVffs `xml:"urn:vim25 ExtendVffs,omitempty"` + Res *types.ExtendVffsResponse `xml:"urn:vim25 ExtendVffsResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *ExtendVffsBody) Fault() *soap.Fault { return b.Fault_ } + +func ExtendVffs(ctx context.Context, r soap.RoundTripper, req *types.ExtendVffs) (*types.ExtendVffsResponse, error) { + var reqBody, resBody ExtendVffsBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type ExtendVirtualDisk_TaskBody struct { + Req *types.ExtendVirtualDisk_Task `xml:"urn:vim25 ExtendVirtualDisk_Task,omitempty"` + Res *types.ExtendVirtualDisk_TaskResponse `xml:"urn:vim25 ExtendVirtualDisk_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *ExtendVirtualDisk_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func ExtendVirtualDisk_Task(ctx context.Context, r soap.RoundTripper, req *types.ExtendVirtualDisk_Task) (*types.ExtendVirtualDisk_TaskResponse, error) { + var reqBody, resBody ExtendVirtualDisk_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type ExtendVmfsDatastoreBody struct { + Req *types.ExtendVmfsDatastore `xml:"urn:vim25 ExtendVmfsDatastore,omitempty"` + Res *types.ExtendVmfsDatastoreResponse `xml:"urn:vim25 ExtendVmfsDatastoreResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *ExtendVmfsDatastoreBody) Fault() *soap.Fault { return b.Fault_ } + +func ExtendVmfsDatastore(ctx context.Context, r soap.RoundTripper, req *types.ExtendVmfsDatastore) (*types.ExtendVmfsDatastoreResponse, error) { + var reqBody, resBody ExtendVmfsDatastoreBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type ExtractOvfEnvironmentBody struct { + Req *types.ExtractOvfEnvironment `xml:"urn:vim25 ExtractOvfEnvironment,omitempty"` + Res *types.ExtractOvfEnvironmentResponse `xml:"urn:vim25 ExtractOvfEnvironmentResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *ExtractOvfEnvironmentBody) Fault() *soap.Fault { return b.Fault_ } + +func ExtractOvfEnvironment(ctx context.Context, r soap.RoundTripper, req *types.ExtractOvfEnvironment) (*types.ExtractOvfEnvironmentResponse, error) { + var reqBody, resBody ExtractOvfEnvironmentBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type FetchDVPortKeysBody struct { + Req *types.FetchDVPortKeys `xml:"urn:vim25 FetchDVPortKeys,omitempty"` + Res *types.FetchDVPortKeysResponse `xml:"urn:vim25 FetchDVPortKeysResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *FetchDVPortKeysBody) Fault() *soap.Fault { return b.Fault_ } + +func FetchDVPortKeys(ctx context.Context, r soap.RoundTripper, req *types.FetchDVPortKeys) (*types.FetchDVPortKeysResponse, error) { + var reqBody, resBody FetchDVPortKeysBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type FetchDVPortsBody struct { + Req *types.FetchDVPorts `xml:"urn:vim25 FetchDVPorts,omitempty"` + Res *types.FetchDVPortsResponse `xml:"urn:vim25 FetchDVPortsResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *FetchDVPortsBody) Fault() *soap.Fault { return b.Fault_ } + +func FetchDVPorts(ctx context.Context, r soap.RoundTripper, req *types.FetchDVPorts) (*types.FetchDVPortsResponse, error) { + var reqBody, resBody FetchDVPortsBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type FindAllByDnsNameBody struct { + Req *types.FindAllByDnsName `xml:"urn:vim25 FindAllByDnsName,omitempty"` + Res *types.FindAllByDnsNameResponse `xml:"urn:vim25 FindAllByDnsNameResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *FindAllByDnsNameBody) Fault() *soap.Fault { return b.Fault_ } + +func FindAllByDnsName(ctx context.Context, r soap.RoundTripper, req *types.FindAllByDnsName) (*types.FindAllByDnsNameResponse, error) { + var reqBody, resBody FindAllByDnsNameBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type FindAllByIpBody struct { + Req *types.FindAllByIp `xml:"urn:vim25 FindAllByIp,omitempty"` + Res *types.FindAllByIpResponse `xml:"urn:vim25 FindAllByIpResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *FindAllByIpBody) Fault() *soap.Fault { return b.Fault_ } + +func FindAllByIp(ctx context.Context, r soap.RoundTripper, req *types.FindAllByIp) (*types.FindAllByIpResponse, error) { + var reqBody, resBody FindAllByIpBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type FindAllByUuidBody struct { + Req *types.FindAllByUuid `xml:"urn:vim25 FindAllByUuid,omitempty"` + Res *types.FindAllByUuidResponse `xml:"urn:vim25 FindAllByUuidResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *FindAllByUuidBody) Fault() *soap.Fault { return b.Fault_ } + +func FindAllByUuid(ctx context.Context, r soap.RoundTripper, req *types.FindAllByUuid) (*types.FindAllByUuidResponse, error) { + var reqBody, resBody FindAllByUuidBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type FindAssociatedProfileBody struct { + Req *types.FindAssociatedProfile `xml:"urn:vim25 FindAssociatedProfile,omitempty"` + Res *types.FindAssociatedProfileResponse `xml:"urn:vim25 FindAssociatedProfileResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *FindAssociatedProfileBody) Fault() *soap.Fault { return b.Fault_ } + +func FindAssociatedProfile(ctx context.Context, r soap.RoundTripper, req *types.FindAssociatedProfile) (*types.FindAssociatedProfileResponse, error) { + var reqBody, resBody FindAssociatedProfileBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type FindByDatastorePathBody struct { + Req *types.FindByDatastorePath `xml:"urn:vim25 FindByDatastorePath,omitempty"` + Res *types.FindByDatastorePathResponse `xml:"urn:vim25 FindByDatastorePathResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *FindByDatastorePathBody) Fault() *soap.Fault { return b.Fault_ } + +func FindByDatastorePath(ctx context.Context, r soap.RoundTripper, req *types.FindByDatastorePath) (*types.FindByDatastorePathResponse, error) { + var reqBody, resBody FindByDatastorePathBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type FindByDnsNameBody struct { + Req *types.FindByDnsName `xml:"urn:vim25 FindByDnsName,omitempty"` + Res *types.FindByDnsNameResponse `xml:"urn:vim25 FindByDnsNameResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *FindByDnsNameBody) Fault() *soap.Fault { return b.Fault_ } + +func FindByDnsName(ctx context.Context, r soap.RoundTripper, req *types.FindByDnsName) (*types.FindByDnsNameResponse, error) { + var reqBody, resBody FindByDnsNameBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type FindByInventoryPathBody struct { + Req *types.FindByInventoryPath `xml:"urn:vim25 FindByInventoryPath,omitempty"` + Res *types.FindByInventoryPathResponse `xml:"urn:vim25 FindByInventoryPathResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *FindByInventoryPathBody) Fault() *soap.Fault { return b.Fault_ } + +func FindByInventoryPath(ctx context.Context, r soap.RoundTripper, req *types.FindByInventoryPath) (*types.FindByInventoryPathResponse, error) { + var reqBody, resBody FindByInventoryPathBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type FindByIpBody struct { + Req *types.FindByIp `xml:"urn:vim25 FindByIp,omitempty"` + Res *types.FindByIpResponse `xml:"urn:vim25 FindByIpResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *FindByIpBody) Fault() *soap.Fault { return b.Fault_ } + +func FindByIp(ctx context.Context, r soap.RoundTripper, req *types.FindByIp) (*types.FindByIpResponse, error) { + var reqBody, resBody FindByIpBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type FindByUuidBody struct { + Req *types.FindByUuid `xml:"urn:vim25 FindByUuid,omitempty"` + Res *types.FindByUuidResponse `xml:"urn:vim25 FindByUuidResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *FindByUuidBody) Fault() *soap.Fault { return b.Fault_ } + +func FindByUuid(ctx context.Context, r soap.RoundTripper, req *types.FindByUuid) (*types.FindByUuidResponse, error) { + var reqBody, resBody FindByUuidBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type FindChildBody struct { + Req *types.FindChild `xml:"urn:vim25 FindChild,omitempty"` + Res *types.FindChildResponse `xml:"urn:vim25 FindChildResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *FindChildBody) Fault() *soap.Fault { return b.Fault_ } + +func FindChild(ctx context.Context, r soap.RoundTripper, req *types.FindChild) (*types.FindChildResponse, error) { + var reqBody, resBody FindChildBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type FindExtensionBody struct { + Req *types.FindExtension `xml:"urn:vim25 FindExtension,omitempty"` + Res *types.FindExtensionResponse `xml:"urn:vim25 FindExtensionResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *FindExtensionBody) Fault() *soap.Fault { return b.Fault_ } + +func FindExtension(ctx context.Context, r soap.RoundTripper, req *types.FindExtension) (*types.FindExtensionResponse, error) { + var reqBody, resBody FindExtensionBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type FindRulesForVmBody struct { + Req *types.FindRulesForVm `xml:"urn:vim25 FindRulesForVm,omitempty"` + Res *types.FindRulesForVmResponse `xml:"urn:vim25 FindRulesForVmResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *FindRulesForVmBody) Fault() *soap.Fault { return b.Fault_ } + +func FindRulesForVm(ctx context.Context, r soap.RoundTripper, req *types.FindRulesForVm) (*types.FindRulesForVmResponse, error) { + var reqBody, resBody FindRulesForVmBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type FormatVffsBody struct { + Req *types.FormatVffs `xml:"urn:vim25 FormatVffs,omitempty"` + Res *types.FormatVffsResponse `xml:"urn:vim25 FormatVffsResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *FormatVffsBody) Fault() *soap.Fault { return b.Fault_ } + +func FormatVffs(ctx context.Context, r soap.RoundTripper, req *types.FormatVffs) (*types.FormatVffsResponse, error) { + var reqBody, resBody FormatVffsBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type FormatVmfsBody struct { + Req *types.FormatVmfs `xml:"urn:vim25 FormatVmfs,omitempty"` + Res *types.FormatVmfsResponse `xml:"urn:vim25 FormatVmfsResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *FormatVmfsBody) Fault() *soap.Fault { return b.Fault_ } + +func FormatVmfs(ctx context.Context, r soap.RoundTripper, req *types.FormatVmfs) (*types.FormatVmfsResponse, error) { + var reqBody, resBody FormatVmfsBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type GenerateCertificateSigningRequestBody struct { + Req *types.GenerateCertificateSigningRequest `xml:"urn:vim25 GenerateCertificateSigningRequest,omitempty"` + Res *types.GenerateCertificateSigningRequestResponse `xml:"urn:vim25 GenerateCertificateSigningRequestResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *GenerateCertificateSigningRequestBody) Fault() *soap.Fault { return b.Fault_ } + +func GenerateCertificateSigningRequest(ctx context.Context, r soap.RoundTripper, req *types.GenerateCertificateSigningRequest) (*types.GenerateCertificateSigningRequestResponse, error) { + var reqBody, resBody GenerateCertificateSigningRequestBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type GenerateCertificateSigningRequestByDnBody struct { + Req *types.GenerateCertificateSigningRequestByDn `xml:"urn:vim25 GenerateCertificateSigningRequestByDn,omitempty"` + Res *types.GenerateCertificateSigningRequestByDnResponse `xml:"urn:vim25 GenerateCertificateSigningRequestByDnResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *GenerateCertificateSigningRequestByDnBody) Fault() *soap.Fault { return b.Fault_ } + +func GenerateCertificateSigningRequestByDn(ctx context.Context, r soap.RoundTripper, req *types.GenerateCertificateSigningRequestByDn) (*types.GenerateCertificateSigningRequestByDnResponse, error) { + var reqBody, resBody GenerateCertificateSigningRequestByDnBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type GenerateConfigTaskListBody struct { + Req *types.GenerateConfigTaskList `xml:"urn:vim25 GenerateConfigTaskList,omitempty"` + Res *types.GenerateConfigTaskListResponse `xml:"urn:vim25 GenerateConfigTaskListResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *GenerateConfigTaskListBody) Fault() *soap.Fault { return b.Fault_ } + +func GenerateConfigTaskList(ctx context.Context, r soap.RoundTripper, req *types.GenerateConfigTaskList) (*types.GenerateConfigTaskListResponse, error) { + var reqBody, resBody GenerateConfigTaskListBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type GenerateHostProfileTaskList_TaskBody struct { + Req *types.GenerateHostProfileTaskList_Task `xml:"urn:vim25 GenerateHostProfileTaskList_Task,omitempty"` + Res *types.GenerateHostProfileTaskList_TaskResponse `xml:"urn:vim25 GenerateHostProfileTaskList_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *GenerateHostProfileTaskList_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func GenerateHostProfileTaskList_Task(ctx context.Context, r soap.RoundTripper, req *types.GenerateHostProfileTaskList_Task) (*types.GenerateHostProfileTaskList_TaskResponse, error) { + var reqBody, resBody GenerateHostProfileTaskList_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type GenerateLogBundles_TaskBody struct { + Req *types.GenerateLogBundles_Task `xml:"urn:vim25 GenerateLogBundles_Task,omitempty"` + Res *types.GenerateLogBundles_TaskResponse `xml:"urn:vim25 GenerateLogBundles_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *GenerateLogBundles_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func GenerateLogBundles_Task(ctx context.Context, r soap.RoundTripper, req *types.GenerateLogBundles_Task) (*types.GenerateLogBundles_TaskResponse, error) { + var reqBody, resBody GenerateLogBundles_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type GetAlarmBody struct { + Req *types.GetAlarm `xml:"urn:vim25 GetAlarm,omitempty"` + Res *types.GetAlarmResponse `xml:"urn:vim25 GetAlarmResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *GetAlarmBody) Fault() *soap.Fault { return b.Fault_ } + +func GetAlarm(ctx context.Context, r soap.RoundTripper, req *types.GetAlarm) (*types.GetAlarmResponse, error) { + var reqBody, resBody GetAlarmBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type GetAlarmStateBody struct { + Req *types.GetAlarmState `xml:"urn:vim25 GetAlarmState,omitempty"` + Res *types.GetAlarmStateResponse `xml:"urn:vim25 GetAlarmStateResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *GetAlarmStateBody) Fault() *soap.Fault { return b.Fault_ } + +func GetAlarmState(ctx context.Context, r soap.RoundTripper, req *types.GetAlarmState) (*types.GetAlarmStateResponse, error) { + var reqBody, resBody GetAlarmStateBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type GetCustomizationSpecBody struct { + Req *types.GetCustomizationSpec `xml:"urn:vim25 GetCustomizationSpec,omitempty"` + Res *types.GetCustomizationSpecResponse `xml:"urn:vim25 GetCustomizationSpecResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *GetCustomizationSpecBody) Fault() *soap.Fault { return b.Fault_ } + +func GetCustomizationSpec(ctx context.Context, r soap.RoundTripper, req *types.GetCustomizationSpec) (*types.GetCustomizationSpecResponse, error) { + var reqBody, resBody GetCustomizationSpecBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type GetPublicKeyBody struct { + Req *types.GetPublicKey `xml:"urn:vim25 GetPublicKey,omitempty"` + Res *types.GetPublicKeyResponse `xml:"urn:vim25 GetPublicKeyResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *GetPublicKeyBody) Fault() *soap.Fault { return b.Fault_ } + +func GetPublicKey(ctx context.Context, r soap.RoundTripper, req *types.GetPublicKey) (*types.GetPublicKeyResponse, error) { + var reqBody, resBody GetPublicKeyBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type GetResourceUsageBody struct { + Req *types.GetResourceUsage `xml:"urn:vim25 GetResourceUsage,omitempty"` + Res *types.GetResourceUsageResponse `xml:"urn:vim25 GetResourceUsageResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *GetResourceUsageBody) Fault() *soap.Fault { return b.Fault_ } + +func GetResourceUsage(ctx context.Context, r soap.RoundTripper, req *types.GetResourceUsage) (*types.GetResourceUsageResponse, error) { + var reqBody, resBody GetResourceUsageBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type GetVsanObjExtAttrsBody struct { + Req *types.GetVsanObjExtAttrs `xml:"urn:vim25 GetVsanObjExtAttrs,omitempty"` + Res *types.GetVsanObjExtAttrsResponse `xml:"urn:vim25 GetVsanObjExtAttrsResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *GetVsanObjExtAttrsBody) Fault() *soap.Fault { return b.Fault_ } + +func GetVsanObjExtAttrs(ctx context.Context, r soap.RoundTripper, req *types.GetVsanObjExtAttrs) (*types.GetVsanObjExtAttrsResponse, error) { + var reqBody, resBody GetVsanObjExtAttrsBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type HasPrivilegeOnEntitiesBody struct { + Req *types.HasPrivilegeOnEntities `xml:"urn:vim25 HasPrivilegeOnEntities,omitempty"` + Res *types.HasPrivilegeOnEntitiesResponse `xml:"urn:vim25 HasPrivilegeOnEntitiesResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *HasPrivilegeOnEntitiesBody) Fault() *soap.Fault { return b.Fault_ } + +func HasPrivilegeOnEntities(ctx context.Context, r soap.RoundTripper, req *types.HasPrivilegeOnEntities) (*types.HasPrivilegeOnEntitiesResponse, error) { + var reqBody, resBody HasPrivilegeOnEntitiesBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type HasPrivilegeOnEntityBody struct { + Req *types.HasPrivilegeOnEntity `xml:"urn:vim25 HasPrivilegeOnEntity,omitempty"` + Res *types.HasPrivilegeOnEntityResponse `xml:"urn:vim25 HasPrivilegeOnEntityResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *HasPrivilegeOnEntityBody) Fault() *soap.Fault { return b.Fault_ } + +func HasPrivilegeOnEntity(ctx context.Context, r soap.RoundTripper, req *types.HasPrivilegeOnEntity) (*types.HasPrivilegeOnEntityResponse, error) { + var reqBody, resBody HasPrivilegeOnEntityBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type HostConfigVFlashCacheBody struct { + Req *types.HostConfigVFlashCache `xml:"urn:vim25 HostConfigVFlashCache,omitempty"` + Res *types.HostConfigVFlashCacheResponse `xml:"urn:vim25 HostConfigVFlashCacheResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *HostConfigVFlashCacheBody) Fault() *soap.Fault { return b.Fault_ } + +func HostConfigVFlashCache(ctx context.Context, r soap.RoundTripper, req *types.HostConfigVFlashCache) (*types.HostConfigVFlashCacheResponse, error) { + var reqBody, resBody HostConfigVFlashCacheBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type HostConfigureVFlashResourceBody struct { + Req *types.HostConfigureVFlashResource `xml:"urn:vim25 HostConfigureVFlashResource,omitempty"` + Res *types.HostConfigureVFlashResourceResponse `xml:"urn:vim25 HostConfigureVFlashResourceResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *HostConfigureVFlashResourceBody) Fault() *soap.Fault { return b.Fault_ } + +func HostConfigureVFlashResource(ctx context.Context, r soap.RoundTripper, req *types.HostConfigureVFlashResource) (*types.HostConfigureVFlashResourceResponse, error) { + var reqBody, resBody HostConfigureVFlashResourceBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type HostGetVFlashModuleDefaultConfigBody struct { + Req *types.HostGetVFlashModuleDefaultConfig `xml:"urn:vim25 HostGetVFlashModuleDefaultConfig,omitempty"` + Res *types.HostGetVFlashModuleDefaultConfigResponse `xml:"urn:vim25 HostGetVFlashModuleDefaultConfigResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *HostGetVFlashModuleDefaultConfigBody) Fault() *soap.Fault { return b.Fault_ } + +func HostGetVFlashModuleDefaultConfig(ctx context.Context, r soap.RoundTripper, req *types.HostGetVFlashModuleDefaultConfig) (*types.HostGetVFlashModuleDefaultConfigResponse, error) { + var reqBody, resBody HostGetVFlashModuleDefaultConfigBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type HostImageConfigGetAcceptanceBody struct { + Req *types.HostImageConfigGetAcceptance `xml:"urn:vim25 HostImageConfigGetAcceptance,omitempty"` + Res *types.HostImageConfigGetAcceptanceResponse `xml:"urn:vim25 HostImageConfigGetAcceptanceResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *HostImageConfigGetAcceptanceBody) Fault() *soap.Fault { return b.Fault_ } + +func HostImageConfigGetAcceptance(ctx context.Context, r soap.RoundTripper, req *types.HostImageConfigGetAcceptance) (*types.HostImageConfigGetAcceptanceResponse, error) { + var reqBody, resBody HostImageConfigGetAcceptanceBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type HostImageConfigGetProfileBody struct { + Req *types.HostImageConfigGetProfile `xml:"urn:vim25 HostImageConfigGetProfile,omitempty"` + Res *types.HostImageConfigGetProfileResponse `xml:"urn:vim25 HostImageConfigGetProfileResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *HostImageConfigGetProfileBody) Fault() *soap.Fault { return b.Fault_ } + +func HostImageConfigGetProfile(ctx context.Context, r soap.RoundTripper, req *types.HostImageConfigGetProfile) (*types.HostImageConfigGetProfileResponse, error) { + var reqBody, resBody HostImageConfigGetProfileBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type HostRemoveVFlashResourceBody struct { + Req *types.HostRemoveVFlashResource `xml:"urn:vim25 HostRemoveVFlashResource,omitempty"` + Res *types.HostRemoveVFlashResourceResponse `xml:"urn:vim25 HostRemoveVFlashResourceResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *HostRemoveVFlashResourceBody) Fault() *soap.Fault { return b.Fault_ } + +func HostRemoveVFlashResource(ctx context.Context, r soap.RoundTripper, req *types.HostRemoveVFlashResource) (*types.HostRemoveVFlashResourceResponse, error) { + var reqBody, resBody HostRemoveVFlashResourceBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type HttpNfcLeaseAbortBody struct { + Req *types.HttpNfcLeaseAbort `xml:"urn:vim25 HttpNfcLeaseAbort,omitempty"` + Res *types.HttpNfcLeaseAbortResponse `xml:"urn:vim25 HttpNfcLeaseAbortResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *HttpNfcLeaseAbortBody) Fault() *soap.Fault { return b.Fault_ } + +func HttpNfcLeaseAbort(ctx context.Context, r soap.RoundTripper, req *types.HttpNfcLeaseAbort) (*types.HttpNfcLeaseAbortResponse, error) { + var reqBody, resBody HttpNfcLeaseAbortBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type HttpNfcLeaseCompleteBody struct { + Req *types.HttpNfcLeaseComplete `xml:"urn:vim25 HttpNfcLeaseComplete,omitempty"` + Res *types.HttpNfcLeaseCompleteResponse `xml:"urn:vim25 HttpNfcLeaseCompleteResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *HttpNfcLeaseCompleteBody) Fault() *soap.Fault { return b.Fault_ } + +func HttpNfcLeaseComplete(ctx context.Context, r soap.RoundTripper, req *types.HttpNfcLeaseComplete) (*types.HttpNfcLeaseCompleteResponse, error) { + var reqBody, resBody HttpNfcLeaseCompleteBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type HttpNfcLeaseGetManifestBody struct { + Req *types.HttpNfcLeaseGetManifest `xml:"urn:vim25 HttpNfcLeaseGetManifest,omitempty"` + Res *types.HttpNfcLeaseGetManifestResponse `xml:"urn:vim25 HttpNfcLeaseGetManifestResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *HttpNfcLeaseGetManifestBody) Fault() *soap.Fault { return b.Fault_ } + +func HttpNfcLeaseGetManifest(ctx context.Context, r soap.RoundTripper, req *types.HttpNfcLeaseGetManifest) (*types.HttpNfcLeaseGetManifestResponse, error) { + var reqBody, resBody HttpNfcLeaseGetManifestBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type HttpNfcLeaseProgressBody struct { + Req *types.HttpNfcLeaseProgress `xml:"urn:vim25 HttpNfcLeaseProgress,omitempty"` + Res *types.HttpNfcLeaseProgressResponse `xml:"urn:vim25 HttpNfcLeaseProgressResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *HttpNfcLeaseProgressBody) Fault() *soap.Fault { return b.Fault_ } + +func HttpNfcLeaseProgress(ctx context.Context, r soap.RoundTripper, req *types.HttpNfcLeaseProgress) (*types.HttpNfcLeaseProgressResponse, error) { + var reqBody, resBody HttpNfcLeaseProgressBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type ImpersonateUserBody struct { + Req *types.ImpersonateUser `xml:"urn:vim25 ImpersonateUser,omitempty"` + Res *types.ImpersonateUserResponse `xml:"urn:vim25 ImpersonateUserResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *ImpersonateUserBody) Fault() *soap.Fault { return b.Fault_ } + +func ImpersonateUser(ctx context.Context, r soap.RoundTripper, req *types.ImpersonateUser) (*types.ImpersonateUserResponse, error) { + var reqBody, resBody ImpersonateUserBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type ImportCertificateForCAM_TaskBody struct { + Req *types.ImportCertificateForCAM_Task `xml:"urn:vim25 ImportCertificateForCAM_Task,omitempty"` + Res *types.ImportCertificateForCAM_TaskResponse `xml:"urn:vim25 ImportCertificateForCAM_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *ImportCertificateForCAM_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func ImportCertificateForCAM_Task(ctx context.Context, r soap.RoundTripper, req *types.ImportCertificateForCAM_Task) (*types.ImportCertificateForCAM_TaskResponse, error) { + var reqBody, resBody ImportCertificateForCAM_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type ImportUnmanagedSnapshotBody struct { + Req *types.ImportUnmanagedSnapshot `xml:"urn:vim25 ImportUnmanagedSnapshot,omitempty"` + Res *types.ImportUnmanagedSnapshotResponse `xml:"urn:vim25 ImportUnmanagedSnapshotResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *ImportUnmanagedSnapshotBody) Fault() *soap.Fault { return b.Fault_ } + +func ImportUnmanagedSnapshot(ctx context.Context, r soap.RoundTripper, req *types.ImportUnmanagedSnapshot) (*types.ImportUnmanagedSnapshotResponse, error) { + var reqBody, resBody ImportUnmanagedSnapshotBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type ImportVAppBody struct { + Req *types.ImportVApp `xml:"urn:vim25 ImportVApp,omitempty"` + Res *types.ImportVAppResponse `xml:"urn:vim25 ImportVAppResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *ImportVAppBody) Fault() *soap.Fault { return b.Fault_ } + +func ImportVApp(ctx context.Context, r soap.RoundTripper, req *types.ImportVApp) (*types.ImportVAppResponse, error) { + var reqBody, resBody ImportVAppBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type InflateVirtualDisk_TaskBody struct { + Req *types.InflateVirtualDisk_Task `xml:"urn:vim25 InflateVirtualDisk_Task,omitempty"` + Res *types.InflateVirtualDisk_TaskResponse `xml:"urn:vim25 InflateVirtualDisk_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *InflateVirtualDisk_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func InflateVirtualDisk_Task(ctx context.Context, r soap.RoundTripper, req *types.InflateVirtualDisk_Task) (*types.InflateVirtualDisk_TaskResponse, error) { + var reqBody, resBody InflateVirtualDisk_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type InitializeDisks_TaskBody struct { + Req *types.InitializeDisks_Task `xml:"urn:vim25 InitializeDisks_Task,omitempty"` + Res *types.InitializeDisks_TaskResponse `xml:"urn:vim25 InitializeDisks_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *InitializeDisks_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func InitializeDisks_Task(ctx context.Context, r soap.RoundTripper, req *types.InitializeDisks_Task) (*types.InitializeDisks_TaskResponse, error) { + var reqBody, resBody InitializeDisks_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type InitiateFileTransferFromGuestBody struct { + Req *types.InitiateFileTransferFromGuest `xml:"urn:vim25 InitiateFileTransferFromGuest,omitempty"` + Res *types.InitiateFileTransferFromGuestResponse `xml:"urn:vim25 InitiateFileTransferFromGuestResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *InitiateFileTransferFromGuestBody) Fault() *soap.Fault { return b.Fault_ } + +func InitiateFileTransferFromGuest(ctx context.Context, r soap.RoundTripper, req *types.InitiateFileTransferFromGuest) (*types.InitiateFileTransferFromGuestResponse, error) { + var reqBody, resBody InitiateFileTransferFromGuestBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type InitiateFileTransferToGuestBody struct { + Req *types.InitiateFileTransferToGuest `xml:"urn:vim25 InitiateFileTransferToGuest,omitempty"` + Res *types.InitiateFileTransferToGuestResponse `xml:"urn:vim25 InitiateFileTransferToGuestResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *InitiateFileTransferToGuestBody) Fault() *soap.Fault { return b.Fault_ } + +func InitiateFileTransferToGuest(ctx context.Context, r soap.RoundTripper, req *types.InitiateFileTransferToGuest) (*types.InitiateFileTransferToGuestResponse, error) { + var reqBody, resBody InitiateFileTransferToGuestBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type InstallHostPatchV2_TaskBody struct { + Req *types.InstallHostPatchV2_Task `xml:"urn:vim25 InstallHostPatchV2_Task,omitempty"` + Res *types.InstallHostPatchV2_TaskResponse `xml:"urn:vim25 InstallHostPatchV2_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *InstallHostPatchV2_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func InstallHostPatchV2_Task(ctx context.Context, r soap.RoundTripper, req *types.InstallHostPatchV2_Task) (*types.InstallHostPatchV2_TaskResponse, error) { + var reqBody, resBody InstallHostPatchV2_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type InstallHostPatch_TaskBody struct { + Req *types.InstallHostPatch_Task `xml:"urn:vim25 InstallHostPatch_Task,omitempty"` + Res *types.InstallHostPatch_TaskResponse `xml:"urn:vim25 InstallHostPatch_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *InstallHostPatch_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func InstallHostPatch_Task(ctx context.Context, r soap.RoundTripper, req *types.InstallHostPatch_Task) (*types.InstallHostPatch_TaskResponse, error) { + var reqBody, resBody InstallHostPatch_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type InstallIoFilter_TaskBody struct { + Req *types.InstallIoFilter_Task `xml:"urn:vim25 InstallIoFilter_Task,omitempty"` + Res *types.InstallIoFilter_TaskResponse `xml:"urn:vim25 InstallIoFilter_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *InstallIoFilter_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func InstallIoFilter_Task(ctx context.Context, r soap.RoundTripper, req *types.InstallIoFilter_Task) (*types.InstallIoFilter_TaskResponse, error) { + var reqBody, resBody InstallIoFilter_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type InstallServerCertificateBody struct { + Req *types.InstallServerCertificate `xml:"urn:vim25 InstallServerCertificate,omitempty"` + Res *types.InstallServerCertificateResponse `xml:"urn:vim25 InstallServerCertificateResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *InstallServerCertificateBody) Fault() *soap.Fault { return b.Fault_ } + +func InstallServerCertificate(ctx context.Context, r soap.RoundTripper, req *types.InstallServerCertificate) (*types.InstallServerCertificateResponse, error) { + var reqBody, resBody InstallServerCertificateBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type InstallSmartCardTrustAnchorBody struct { + Req *types.InstallSmartCardTrustAnchor `xml:"urn:vim25 InstallSmartCardTrustAnchor,omitempty"` + Res *types.InstallSmartCardTrustAnchorResponse `xml:"urn:vim25 InstallSmartCardTrustAnchorResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *InstallSmartCardTrustAnchorBody) Fault() *soap.Fault { return b.Fault_ } + +func InstallSmartCardTrustAnchor(ctx context.Context, r soap.RoundTripper, req *types.InstallSmartCardTrustAnchor) (*types.InstallSmartCardTrustAnchorResponse, error) { + var reqBody, resBody InstallSmartCardTrustAnchorBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type IsSharedGraphicsActiveBody struct { + Req *types.IsSharedGraphicsActive `xml:"urn:vim25 IsSharedGraphicsActive,omitempty"` + Res *types.IsSharedGraphicsActiveResponse `xml:"urn:vim25 IsSharedGraphicsActiveResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *IsSharedGraphicsActiveBody) Fault() *soap.Fault { return b.Fault_ } + +func IsSharedGraphicsActive(ctx context.Context, r soap.RoundTripper, req *types.IsSharedGraphicsActive) (*types.IsSharedGraphicsActiveResponse, error) { + var reqBody, resBody IsSharedGraphicsActiveBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type JoinDomainWithCAM_TaskBody struct { + Req *types.JoinDomainWithCAM_Task `xml:"urn:vim25 JoinDomainWithCAM_Task,omitempty"` + Res *types.JoinDomainWithCAM_TaskResponse `xml:"urn:vim25 JoinDomainWithCAM_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *JoinDomainWithCAM_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func JoinDomainWithCAM_Task(ctx context.Context, r soap.RoundTripper, req *types.JoinDomainWithCAM_Task) (*types.JoinDomainWithCAM_TaskResponse, error) { + var reqBody, resBody JoinDomainWithCAM_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type JoinDomain_TaskBody struct { + Req *types.JoinDomain_Task `xml:"urn:vim25 JoinDomain_Task,omitempty"` + Res *types.JoinDomain_TaskResponse `xml:"urn:vim25 JoinDomain_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *JoinDomain_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func JoinDomain_Task(ctx context.Context, r soap.RoundTripper, req *types.JoinDomain_Task) (*types.JoinDomain_TaskResponse, error) { + var reqBody, resBody JoinDomain_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type LeaveCurrentDomain_TaskBody struct { + Req *types.LeaveCurrentDomain_Task `xml:"urn:vim25 LeaveCurrentDomain_Task,omitempty"` + Res *types.LeaveCurrentDomain_TaskResponse `xml:"urn:vim25 LeaveCurrentDomain_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *LeaveCurrentDomain_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func LeaveCurrentDomain_Task(ctx context.Context, r soap.RoundTripper, req *types.LeaveCurrentDomain_Task) (*types.LeaveCurrentDomain_TaskResponse, error) { + var reqBody, resBody LeaveCurrentDomain_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type ListCACertificateRevocationListsBody struct { + Req *types.ListCACertificateRevocationLists `xml:"urn:vim25 ListCACertificateRevocationLists,omitempty"` + Res *types.ListCACertificateRevocationListsResponse `xml:"urn:vim25 ListCACertificateRevocationListsResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *ListCACertificateRevocationListsBody) Fault() *soap.Fault { return b.Fault_ } + +func ListCACertificateRevocationLists(ctx context.Context, r soap.RoundTripper, req *types.ListCACertificateRevocationLists) (*types.ListCACertificateRevocationListsResponse, error) { + var reqBody, resBody ListCACertificateRevocationListsBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type ListCACertificatesBody struct { + Req *types.ListCACertificates `xml:"urn:vim25 ListCACertificates,omitempty"` + Res *types.ListCACertificatesResponse `xml:"urn:vim25 ListCACertificatesResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *ListCACertificatesBody) Fault() *soap.Fault { return b.Fault_ } + +func ListCACertificates(ctx context.Context, r soap.RoundTripper, req *types.ListCACertificates) (*types.ListCACertificatesResponse, error) { + var reqBody, resBody ListCACertificatesBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type ListFilesInGuestBody struct { + Req *types.ListFilesInGuest `xml:"urn:vim25 ListFilesInGuest,omitempty"` + Res *types.ListFilesInGuestResponse `xml:"urn:vim25 ListFilesInGuestResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *ListFilesInGuestBody) Fault() *soap.Fault { return b.Fault_ } + +func ListFilesInGuest(ctx context.Context, r soap.RoundTripper, req *types.ListFilesInGuest) (*types.ListFilesInGuestResponse, error) { + var reqBody, resBody ListFilesInGuestBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type ListGuestAliasesBody struct { + Req *types.ListGuestAliases `xml:"urn:vim25 ListGuestAliases,omitempty"` + Res *types.ListGuestAliasesResponse `xml:"urn:vim25 ListGuestAliasesResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *ListGuestAliasesBody) Fault() *soap.Fault { return b.Fault_ } + +func ListGuestAliases(ctx context.Context, r soap.RoundTripper, req *types.ListGuestAliases) (*types.ListGuestAliasesResponse, error) { + var reqBody, resBody ListGuestAliasesBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type ListGuestMappedAliasesBody struct { + Req *types.ListGuestMappedAliases `xml:"urn:vim25 ListGuestMappedAliases,omitempty"` + Res *types.ListGuestMappedAliasesResponse `xml:"urn:vim25 ListGuestMappedAliasesResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *ListGuestMappedAliasesBody) Fault() *soap.Fault { return b.Fault_ } + +func ListGuestMappedAliases(ctx context.Context, r soap.RoundTripper, req *types.ListGuestMappedAliases) (*types.ListGuestMappedAliasesResponse, error) { + var reqBody, resBody ListGuestMappedAliasesBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type ListProcessesInGuestBody struct { + Req *types.ListProcessesInGuest `xml:"urn:vim25 ListProcessesInGuest,omitempty"` + Res *types.ListProcessesInGuestResponse `xml:"urn:vim25 ListProcessesInGuestResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *ListProcessesInGuestBody) Fault() *soap.Fault { return b.Fault_ } + +func ListProcessesInGuest(ctx context.Context, r soap.RoundTripper, req *types.ListProcessesInGuest) (*types.ListProcessesInGuestResponse, error) { + var reqBody, resBody ListProcessesInGuestBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type ListRegistryKeysInGuestBody struct { + Req *types.ListRegistryKeysInGuest `xml:"urn:vim25 ListRegistryKeysInGuest,omitempty"` + Res *types.ListRegistryKeysInGuestResponse `xml:"urn:vim25 ListRegistryKeysInGuestResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *ListRegistryKeysInGuestBody) Fault() *soap.Fault { return b.Fault_ } + +func ListRegistryKeysInGuest(ctx context.Context, r soap.RoundTripper, req *types.ListRegistryKeysInGuest) (*types.ListRegistryKeysInGuestResponse, error) { + var reqBody, resBody ListRegistryKeysInGuestBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type ListRegistryValuesInGuestBody struct { + Req *types.ListRegistryValuesInGuest `xml:"urn:vim25 ListRegistryValuesInGuest,omitempty"` + Res *types.ListRegistryValuesInGuestResponse `xml:"urn:vim25 ListRegistryValuesInGuestResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *ListRegistryValuesInGuestBody) Fault() *soap.Fault { return b.Fault_ } + +func ListRegistryValuesInGuest(ctx context.Context, r soap.RoundTripper, req *types.ListRegistryValuesInGuest) (*types.ListRegistryValuesInGuestResponse, error) { + var reqBody, resBody ListRegistryValuesInGuestBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type ListSmartCardTrustAnchorsBody struct { + Req *types.ListSmartCardTrustAnchors `xml:"urn:vim25 ListSmartCardTrustAnchors,omitempty"` + Res *types.ListSmartCardTrustAnchorsResponse `xml:"urn:vim25 ListSmartCardTrustAnchorsResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *ListSmartCardTrustAnchorsBody) Fault() *soap.Fault { return b.Fault_ } + +func ListSmartCardTrustAnchors(ctx context.Context, r soap.RoundTripper, req *types.ListSmartCardTrustAnchors) (*types.ListSmartCardTrustAnchorsResponse, error) { + var reqBody, resBody ListSmartCardTrustAnchorsBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type LogUserEventBody struct { + Req *types.LogUserEvent `xml:"urn:vim25 LogUserEvent,omitempty"` + Res *types.LogUserEventResponse `xml:"urn:vim25 LogUserEventResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *LogUserEventBody) Fault() *soap.Fault { return b.Fault_ } + +func LogUserEvent(ctx context.Context, r soap.RoundTripper, req *types.LogUserEvent) (*types.LogUserEventResponse, error) { + var reqBody, resBody LogUserEventBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type LoginBody struct { + Req *types.Login `xml:"urn:vim25 Login,omitempty"` + Res *types.LoginResponse `xml:"urn:vim25 LoginResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *LoginBody) Fault() *soap.Fault { return b.Fault_ } + +func Login(ctx context.Context, r soap.RoundTripper, req *types.Login) (*types.LoginResponse, error) { + var reqBody, resBody LoginBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type LoginBySSPIBody struct { + Req *types.LoginBySSPI `xml:"urn:vim25 LoginBySSPI,omitempty"` + Res *types.LoginBySSPIResponse `xml:"urn:vim25 LoginBySSPIResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *LoginBySSPIBody) Fault() *soap.Fault { return b.Fault_ } + +func LoginBySSPI(ctx context.Context, r soap.RoundTripper, req *types.LoginBySSPI) (*types.LoginBySSPIResponse, error) { + var reqBody, resBody LoginBySSPIBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type LoginByTokenBody struct { + Req *types.LoginByToken `xml:"urn:vim25 LoginByToken,omitempty"` + Res *types.LoginByTokenResponse `xml:"urn:vim25 LoginByTokenResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *LoginByTokenBody) Fault() *soap.Fault { return b.Fault_ } + +func LoginByToken(ctx context.Context, r soap.RoundTripper, req *types.LoginByToken) (*types.LoginByTokenResponse, error) { + var reqBody, resBody LoginByTokenBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type LoginExtensionByCertificateBody struct { + Req *types.LoginExtensionByCertificate `xml:"urn:vim25 LoginExtensionByCertificate,omitempty"` + Res *types.LoginExtensionByCertificateResponse `xml:"urn:vim25 LoginExtensionByCertificateResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *LoginExtensionByCertificateBody) Fault() *soap.Fault { return b.Fault_ } + +func LoginExtensionByCertificate(ctx context.Context, r soap.RoundTripper, req *types.LoginExtensionByCertificate) (*types.LoginExtensionByCertificateResponse, error) { + var reqBody, resBody LoginExtensionByCertificateBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type LoginExtensionBySubjectNameBody struct { + Req *types.LoginExtensionBySubjectName `xml:"urn:vim25 LoginExtensionBySubjectName,omitempty"` + Res *types.LoginExtensionBySubjectNameResponse `xml:"urn:vim25 LoginExtensionBySubjectNameResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *LoginExtensionBySubjectNameBody) Fault() *soap.Fault { return b.Fault_ } + +func LoginExtensionBySubjectName(ctx context.Context, r soap.RoundTripper, req *types.LoginExtensionBySubjectName) (*types.LoginExtensionBySubjectNameResponse, error) { + var reqBody, resBody LoginExtensionBySubjectNameBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type LogoutBody struct { + Req *types.Logout `xml:"urn:vim25 Logout,omitempty"` + Res *types.LogoutResponse `xml:"urn:vim25 LogoutResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *LogoutBody) Fault() *soap.Fault { return b.Fault_ } + +func Logout(ctx context.Context, r soap.RoundTripper, req *types.Logout) (*types.LogoutResponse, error) { + var reqBody, resBody LogoutBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type LookupDvPortGroupBody struct { + Req *types.LookupDvPortGroup `xml:"urn:vim25 LookupDvPortGroup,omitempty"` + Res *types.LookupDvPortGroupResponse `xml:"urn:vim25 LookupDvPortGroupResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *LookupDvPortGroupBody) Fault() *soap.Fault { return b.Fault_ } + +func LookupDvPortGroup(ctx context.Context, r soap.RoundTripper, req *types.LookupDvPortGroup) (*types.LookupDvPortGroupResponse, error) { + var reqBody, resBody LookupDvPortGroupBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type LookupVmOverheadMemoryBody struct { + Req *types.LookupVmOverheadMemory `xml:"urn:vim25 LookupVmOverheadMemory,omitempty"` + Res *types.LookupVmOverheadMemoryResponse `xml:"urn:vim25 LookupVmOverheadMemoryResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *LookupVmOverheadMemoryBody) Fault() *soap.Fault { return b.Fault_ } + +func LookupVmOverheadMemory(ctx context.Context, r soap.RoundTripper, req *types.LookupVmOverheadMemory) (*types.LookupVmOverheadMemoryResponse, error) { + var reqBody, resBody LookupVmOverheadMemoryBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type MakeDirectoryBody struct { + Req *types.MakeDirectory `xml:"urn:vim25 MakeDirectory,omitempty"` + Res *types.MakeDirectoryResponse `xml:"urn:vim25 MakeDirectoryResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *MakeDirectoryBody) Fault() *soap.Fault { return b.Fault_ } + +func MakeDirectory(ctx context.Context, r soap.RoundTripper, req *types.MakeDirectory) (*types.MakeDirectoryResponse, error) { + var reqBody, resBody MakeDirectoryBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type MakeDirectoryInGuestBody struct { + Req *types.MakeDirectoryInGuest `xml:"urn:vim25 MakeDirectoryInGuest,omitempty"` + Res *types.MakeDirectoryInGuestResponse `xml:"urn:vim25 MakeDirectoryInGuestResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *MakeDirectoryInGuestBody) Fault() *soap.Fault { return b.Fault_ } + +func MakeDirectoryInGuest(ctx context.Context, r soap.RoundTripper, req *types.MakeDirectoryInGuest) (*types.MakeDirectoryInGuestResponse, error) { + var reqBody, resBody MakeDirectoryInGuestBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type MakePrimaryVM_TaskBody struct { + Req *types.MakePrimaryVM_Task `xml:"urn:vim25 MakePrimaryVM_Task,omitempty"` + Res *types.MakePrimaryVM_TaskResponse `xml:"urn:vim25 MakePrimaryVM_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *MakePrimaryVM_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func MakePrimaryVM_Task(ctx context.Context, r soap.RoundTripper, req *types.MakePrimaryVM_Task) (*types.MakePrimaryVM_TaskResponse, error) { + var reqBody, resBody MakePrimaryVM_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type MarkAsLocal_TaskBody struct { + Req *types.MarkAsLocal_Task `xml:"urn:vim25 MarkAsLocal_Task,omitempty"` + Res *types.MarkAsLocal_TaskResponse `xml:"urn:vim25 MarkAsLocal_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *MarkAsLocal_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func MarkAsLocal_Task(ctx context.Context, r soap.RoundTripper, req *types.MarkAsLocal_Task) (*types.MarkAsLocal_TaskResponse, error) { + var reqBody, resBody MarkAsLocal_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type MarkAsNonLocal_TaskBody struct { + Req *types.MarkAsNonLocal_Task `xml:"urn:vim25 MarkAsNonLocal_Task,omitempty"` + Res *types.MarkAsNonLocal_TaskResponse `xml:"urn:vim25 MarkAsNonLocal_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *MarkAsNonLocal_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func MarkAsNonLocal_Task(ctx context.Context, r soap.RoundTripper, req *types.MarkAsNonLocal_Task) (*types.MarkAsNonLocal_TaskResponse, error) { + var reqBody, resBody MarkAsNonLocal_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type MarkAsNonSsd_TaskBody struct { + Req *types.MarkAsNonSsd_Task `xml:"urn:vim25 MarkAsNonSsd_Task,omitempty"` + Res *types.MarkAsNonSsd_TaskResponse `xml:"urn:vim25 MarkAsNonSsd_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *MarkAsNonSsd_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func MarkAsNonSsd_Task(ctx context.Context, r soap.RoundTripper, req *types.MarkAsNonSsd_Task) (*types.MarkAsNonSsd_TaskResponse, error) { + var reqBody, resBody MarkAsNonSsd_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type MarkAsSsd_TaskBody struct { + Req *types.MarkAsSsd_Task `xml:"urn:vim25 MarkAsSsd_Task,omitempty"` + Res *types.MarkAsSsd_TaskResponse `xml:"urn:vim25 MarkAsSsd_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *MarkAsSsd_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func MarkAsSsd_Task(ctx context.Context, r soap.RoundTripper, req *types.MarkAsSsd_Task) (*types.MarkAsSsd_TaskResponse, error) { + var reqBody, resBody MarkAsSsd_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type MarkAsTemplateBody struct { + Req *types.MarkAsTemplate `xml:"urn:vim25 MarkAsTemplate,omitempty"` + Res *types.MarkAsTemplateResponse `xml:"urn:vim25 MarkAsTemplateResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *MarkAsTemplateBody) Fault() *soap.Fault { return b.Fault_ } + +func MarkAsTemplate(ctx context.Context, r soap.RoundTripper, req *types.MarkAsTemplate) (*types.MarkAsTemplateResponse, error) { + var reqBody, resBody MarkAsTemplateBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type MarkAsVirtualMachineBody struct { + Req *types.MarkAsVirtualMachine `xml:"urn:vim25 MarkAsVirtualMachine,omitempty"` + Res *types.MarkAsVirtualMachineResponse `xml:"urn:vim25 MarkAsVirtualMachineResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *MarkAsVirtualMachineBody) Fault() *soap.Fault { return b.Fault_ } + +func MarkAsVirtualMachine(ctx context.Context, r soap.RoundTripper, req *types.MarkAsVirtualMachine) (*types.MarkAsVirtualMachineResponse, error) { + var reqBody, resBody MarkAsVirtualMachineBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type MarkForRemovalBody struct { + Req *types.MarkForRemoval `xml:"urn:vim25 MarkForRemoval,omitempty"` + Res *types.MarkForRemovalResponse `xml:"urn:vim25 MarkForRemovalResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *MarkForRemovalBody) Fault() *soap.Fault { return b.Fault_ } + +func MarkForRemoval(ctx context.Context, r soap.RoundTripper, req *types.MarkForRemoval) (*types.MarkForRemovalResponse, error) { + var reqBody, resBody MarkForRemovalBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type MergeDvs_TaskBody struct { + Req *types.MergeDvs_Task `xml:"urn:vim25 MergeDvs_Task,omitempty"` + Res *types.MergeDvs_TaskResponse `xml:"urn:vim25 MergeDvs_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *MergeDvs_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func MergeDvs_Task(ctx context.Context, r soap.RoundTripper, req *types.MergeDvs_Task) (*types.MergeDvs_TaskResponse, error) { + var reqBody, resBody MergeDvs_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type MergePermissionsBody struct { + Req *types.MergePermissions `xml:"urn:vim25 MergePermissions,omitempty"` + Res *types.MergePermissionsResponse `xml:"urn:vim25 MergePermissionsResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *MergePermissionsBody) Fault() *soap.Fault { return b.Fault_ } + +func MergePermissions(ctx context.Context, r soap.RoundTripper, req *types.MergePermissions) (*types.MergePermissionsResponse, error) { + var reqBody, resBody MergePermissionsBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type MigrateVM_TaskBody struct { + Req *types.MigrateVM_Task `xml:"urn:vim25 MigrateVM_Task,omitempty"` + Res *types.MigrateVM_TaskResponse `xml:"urn:vim25 MigrateVM_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *MigrateVM_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func MigrateVM_Task(ctx context.Context, r soap.RoundTripper, req *types.MigrateVM_Task) (*types.MigrateVM_TaskResponse, error) { + var reqBody, resBody MigrateVM_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type ModifyListViewBody struct { + Req *types.ModifyListView `xml:"urn:vim25 ModifyListView,omitempty"` + Res *types.ModifyListViewResponse `xml:"urn:vim25 ModifyListViewResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *ModifyListViewBody) Fault() *soap.Fault { return b.Fault_ } + +func ModifyListView(ctx context.Context, r soap.RoundTripper, req *types.ModifyListView) (*types.ModifyListViewResponse, error) { + var reqBody, resBody ModifyListViewBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type MountToolsInstallerBody struct { + Req *types.MountToolsInstaller `xml:"urn:vim25 MountToolsInstaller,omitempty"` + Res *types.MountToolsInstallerResponse `xml:"urn:vim25 MountToolsInstallerResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *MountToolsInstallerBody) Fault() *soap.Fault { return b.Fault_ } + +func MountToolsInstaller(ctx context.Context, r soap.RoundTripper, req *types.MountToolsInstaller) (*types.MountToolsInstallerResponse, error) { + var reqBody, resBody MountToolsInstallerBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type MountVffsVolumeBody struct { + Req *types.MountVffsVolume `xml:"urn:vim25 MountVffsVolume,omitempty"` + Res *types.MountVffsVolumeResponse `xml:"urn:vim25 MountVffsVolumeResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *MountVffsVolumeBody) Fault() *soap.Fault { return b.Fault_ } + +func MountVffsVolume(ctx context.Context, r soap.RoundTripper, req *types.MountVffsVolume) (*types.MountVffsVolumeResponse, error) { + var reqBody, resBody MountVffsVolumeBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type MountVmfsVolumeBody struct { + Req *types.MountVmfsVolume `xml:"urn:vim25 MountVmfsVolume,omitempty"` + Res *types.MountVmfsVolumeResponse `xml:"urn:vim25 MountVmfsVolumeResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *MountVmfsVolumeBody) Fault() *soap.Fault { return b.Fault_ } + +func MountVmfsVolume(ctx context.Context, r soap.RoundTripper, req *types.MountVmfsVolume) (*types.MountVmfsVolumeResponse, error) { + var reqBody, resBody MountVmfsVolumeBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type MountVmfsVolumeEx_TaskBody struct { + Req *types.MountVmfsVolumeEx_Task `xml:"urn:vim25 MountVmfsVolumeEx_Task,omitempty"` + Res *types.MountVmfsVolumeEx_TaskResponse `xml:"urn:vim25 MountVmfsVolumeEx_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *MountVmfsVolumeEx_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func MountVmfsVolumeEx_Task(ctx context.Context, r soap.RoundTripper, req *types.MountVmfsVolumeEx_Task) (*types.MountVmfsVolumeEx_TaskResponse, error) { + var reqBody, resBody MountVmfsVolumeEx_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type MoveDVPort_TaskBody struct { + Req *types.MoveDVPort_Task `xml:"urn:vim25 MoveDVPort_Task,omitempty"` + Res *types.MoveDVPort_TaskResponse `xml:"urn:vim25 MoveDVPort_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *MoveDVPort_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func MoveDVPort_Task(ctx context.Context, r soap.RoundTripper, req *types.MoveDVPort_Task) (*types.MoveDVPort_TaskResponse, error) { + var reqBody, resBody MoveDVPort_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type MoveDatastoreFile_TaskBody struct { + Req *types.MoveDatastoreFile_Task `xml:"urn:vim25 MoveDatastoreFile_Task,omitempty"` + Res *types.MoveDatastoreFile_TaskResponse `xml:"urn:vim25 MoveDatastoreFile_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *MoveDatastoreFile_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func MoveDatastoreFile_Task(ctx context.Context, r soap.RoundTripper, req *types.MoveDatastoreFile_Task) (*types.MoveDatastoreFile_TaskResponse, error) { + var reqBody, resBody MoveDatastoreFile_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type MoveDirectoryInGuestBody struct { + Req *types.MoveDirectoryInGuest `xml:"urn:vim25 MoveDirectoryInGuest,omitempty"` + Res *types.MoveDirectoryInGuestResponse `xml:"urn:vim25 MoveDirectoryInGuestResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *MoveDirectoryInGuestBody) Fault() *soap.Fault { return b.Fault_ } + +func MoveDirectoryInGuest(ctx context.Context, r soap.RoundTripper, req *types.MoveDirectoryInGuest) (*types.MoveDirectoryInGuestResponse, error) { + var reqBody, resBody MoveDirectoryInGuestBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type MoveFileInGuestBody struct { + Req *types.MoveFileInGuest `xml:"urn:vim25 MoveFileInGuest,omitempty"` + Res *types.MoveFileInGuestResponse `xml:"urn:vim25 MoveFileInGuestResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *MoveFileInGuestBody) Fault() *soap.Fault { return b.Fault_ } + +func MoveFileInGuest(ctx context.Context, r soap.RoundTripper, req *types.MoveFileInGuest) (*types.MoveFileInGuestResponse, error) { + var reqBody, resBody MoveFileInGuestBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type MoveHostInto_TaskBody struct { + Req *types.MoveHostInto_Task `xml:"urn:vim25 MoveHostInto_Task,omitempty"` + Res *types.MoveHostInto_TaskResponse `xml:"urn:vim25 MoveHostInto_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *MoveHostInto_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func MoveHostInto_Task(ctx context.Context, r soap.RoundTripper, req *types.MoveHostInto_Task) (*types.MoveHostInto_TaskResponse, error) { + var reqBody, resBody MoveHostInto_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type MoveIntoFolder_TaskBody struct { + Req *types.MoveIntoFolder_Task `xml:"urn:vim25 MoveIntoFolder_Task,omitempty"` + Res *types.MoveIntoFolder_TaskResponse `xml:"urn:vim25 MoveIntoFolder_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *MoveIntoFolder_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func MoveIntoFolder_Task(ctx context.Context, r soap.RoundTripper, req *types.MoveIntoFolder_Task) (*types.MoveIntoFolder_TaskResponse, error) { + var reqBody, resBody MoveIntoFolder_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type MoveIntoResourcePoolBody struct { + Req *types.MoveIntoResourcePool `xml:"urn:vim25 MoveIntoResourcePool,omitempty"` + Res *types.MoveIntoResourcePoolResponse `xml:"urn:vim25 MoveIntoResourcePoolResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *MoveIntoResourcePoolBody) Fault() *soap.Fault { return b.Fault_ } + +func MoveIntoResourcePool(ctx context.Context, r soap.RoundTripper, req *types.MoveIntoResourcePool) (*types.MoveIntoResourcePoolResponse, error) { + var reqBody, resBody MoveIntoResourcePoolBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type MoveInto_TaskBody struct { + Req *types.MoveInto_Task `xml:"urn:vim25 MoveInto_Task,omitempty"` + Res *types.MoveInto_TaskResponse `xml:"urn:vim25 MoveInto_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *MoveInto_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func MoveInto_Task(ctx context.Context, r soap.RoundTripper, req *types.MoveInto_Task) (*types.MoveInto_TaskResponse, error) { + var reqBody, resBody MoveInto_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type MoveVirtualDisk_TaskBody struct { + Req *types.MoveVirtualDisk_Task `xml:"urn:vim25 MoveVirtualDisk_Task,omitempty"` + Res *types.MoveVirtualDisk_TaskResponse `xml:"urn:vim25 MoveVirtualDisk_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *MoveVirtualDisk_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func MoveVirtualDisk_Task(ctx context.Context, r soap.RoundTripper, req *types.MoveVirtualDisk_Task) (*types.MoveVirtualDisk_TaskResponse, error) { + var reqBody, resBody MoveVirtualDisk_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type OpenInventoryViewFolderBody struct { + Req *types.OpenInventoryViewFolder `xml:"urn:vim25 OpenInventoryViewFolder,omitempty"` + Res *types.OpenInventoryViewFolderResponse `xml:"urn:vim25 OpenInventoryViewFolderResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *OpenInventoryViewFolderBody) Fault() *soap.Fault { return b.Fault_ } + +func OpenInventoryViewFolder(ctx context.Context, r soap.RoundTripper, req *types.OpenInventoryViewFolder) (*types.OpenInventoryViewFolderResponse, error) { + var reqBody, resBody OpenInventoryViewFolderBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type OverwriteCustomizationSpecBody struct { + Req *types.OverwriteCustomizationSpec `xml:"urn:vim25 OverwriteCustomizationSpec,omitempty"` + Res *types.OverwriteCustomizationSpecResponse `xml:"urn:vim25 OverwriteCustomizationSpecResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *OverwriteCustomizationSpecBody) Fault() *soap.Fault { return b.Fault_ } + +func OverwriteCustomizationSpec(ctx context.Context, r soap.RoundTripper, req *types.OverwriteCustomizationSpec) (*types.OverwriteCustomizationSpecResponse, error) { + var reqBody, resBody OverwriteCustomizationSpecBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type ParseDescriptorBody struct { + Req *types.ParseDescriptor `xml:"urn:vim25 ParseDescriptor,omitempty"` + Res *types.ParseDescriptorResponse `xml:"urn:vim25 ParseDescriptorResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *ParseDescriptorBody) Fault() *soap.Fault { return b.Fault_ } + +func ParseDescriptor(ctx context.Context, r soap.RoundTripper, req *types.ParseDescriptor) (*types.ParseDescriptorResponse, error) { + var reqBody, resBody ParseDescriptorBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type PerformDvsProductSpecOperation_TaskBody struct { + Req *types.PerformDvsProductSpecOperation_Task `xml:"urn:vim25 PerformDvsProductSpecOperation_Task,omitempty"` + Res *types.PerformDvsProductSpecOperation_TaskResponse `xml:"urn:vim25 PerformDvsProductSpecOperation_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *PerformDvsProductSpecOperation_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func PerformDvsProductSpecOperation_Task(ctx context.Context, r soap.RoundTripper, req *types.PerformDvsProductSpecOperation_Task) (*types.PerformDvsProductSpecOperation_TaskResponse, error) { + var reqBody, resBody PerformDvsProductSpecOperation_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type PerformVsanUpgradePreflightCheckBody struct { + Req *types.PerformVsanUpgradePreflightCheck `xml:"urn:vim25 PerformVsanUpgradePreflightCheck,omitempty"` + Res *types.PerformVsanUpgradePreflightCheckResponse `xml:"urn:vim25 PerformVsanUpgradePreflightCheckResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *PerformVsanUpgradePreflightCheckBody) Fault() *soap.Fault { return b.Fault_ } + +func PerformVsanUpgradePreflightCheck(ctx context.Context, r soap.RoundTripper, req *types.PerformVsanUpgradePreflightCheck) (*types.PerformVsanUpgradePreflightCheckResponse, error) { + var reqBody, resBody PerformVsanUpgradePreflightCheckBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type PerformVsanUpgrade_TaskBody struct { + Req *types.PerformVsanUpgrade_Task `xml:"urn:vim25 PerformVsanUpgrade_Task,omitempty"` + Res *types.PerformVsanUpgrade_TaskResponse `xml:"urn:vim25 PerformVsanUpgrade_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *PerformVsanUpgrade_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func PerformVsanUpgrade_Task(ctx context.Context, r soap.RoundTripper, req *types.PerformVsanUpgrade_Task) (*types.PerformVsanUpgrade_TaskResponse, error) { + var reqBody, resBody PerformVsanUpgrade_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type PlaceVmBody struct { + Req *types.PlaceVm `xml:"urn:vim25 PlaceVm,omitempty"` + Res *types.PlaceVmResponse `xml:"urn:vim25 PlaceVmResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *PlaceVmBody) Fault() *soap.Fault { return b.Fault_ } + +func PlaceVm(ctx context.Context, r soap.RoundTripper, req *types.PlaceVm) (*types.PlaceVmResponse, error) { + var reqBody, resBody PlaceVmBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type PostEventBody struct { + Req *types.PostEvent `xml:"urn:vim25 PostEvent,omitempty"` + Res *types.PostEventResponse `xml:"urn:vim25 PostEventResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *PostEventBody) Fault() *soap.Fault { return b.Fault_ } + +func PostEvent(ctx context.Context, r soap.RoundTripper, req *types.PostEvent) (*types.PostEventResponse, error) { + var reqBody, resBody PostEventBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type PowerDownHostToStandBy_TaskBody struct { + Req *types.PowerDownHostToStandBy_Task `xml:"urn:vim25 PowerDownHostToStandBy_Task,omitempty"` + Res *types.PowerDownHostToStandBy_TaskResponse `xml:"urn:vim25 PowerDownHostToStandBy_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *PowerDownHostToStandBy_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func PowerDownHostToStandBy_Task(ctx context.Context, r soap.RoundTripper, req *types.PowerDownHostToStandBy_Task) (*types.PowerDownHostToStandBy_TaskResponse, error) { + var reqBody, resBody PowerDownHostToStandBy_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type PowerOffVApp_TaskBody struct { + Req *types.PowerOffVApp_Task `xml:"urn:vim25 PowerOffVApp_Task,omitempty"` + Res *types.PowerOffVApp_TaskResponse `xml:"urn:vim25 PowerOffVApp_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *PowerOffVApp_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func PowerOffVApp_Task(ctx context.Context, r soap.RoundTripper, req *types.PowerOffVApp_Task) (*types.PowerOffVApp_TaskResponse, error) { + var reqBody, resBody PowerOffVApp_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type PowerOffVM_TaskBody struct { + Req *types.PowerOffVM_Task `xml:"urn:vim25 PowerOffVM_Task,omitempty"` + Res *types.PowerOffVM_TaskResponse `xml:"urn:vim25 PowerOffVM_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *PowerOffVM_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func PowerOffVM_Task(ctx context.Context, r soap.RoundTripper, req *types.PowerOffVM_Task) (*types.PowerOffVM_TaskResponse, error) { + var reqBody, resBody PowerOffVM_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type PowerOnMultiVM_TaskBody struct { + Req *types.PowerOnMultiVM_Task `xml:"urn:vim25 PowerOnMultiVM_Task,omitempty"` + Res *types.PowerOnMultiVM_TaskResponse `xml:"urn:vim25 PowerOnMultiVM_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *PowerOnMultiVM_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func PowerOnMultiVM_Task(ctx context.Context, r soap.RoundTripper, req *types.PowerOnMultiVM_Task) (*types.PowerOnMultiVM_TaskResponse, error) { + var reqBody, resBody PowerOnMultiVM_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type PowerOnVApp_TaskBody struct { + Req *types.PowerOnVApp_Task `xml:"urn:vim25 PowerOnVApp_Task,omitempty"` + Res *types.PowerOnVApp_TaskResponse `xml:"urn:vim25 PowerOnVApp_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *PowerOnVApp_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func PowerOnVApp_Task(ctx context.Context, r soap.RoundTripper, req *types.PowerOnVApp_Task) (*types.PowerOnVApp_TaskResponse, error) { + var reqBody, resBody PowerOnVApp_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type PowerOnVM_TaskBody struct { + Req *types.PowerOnVM_Task `xml:"urn:vim25 PowerOnVM_Task,omitempty"` + Res *types.PowerOnVM_TaskResponse `xml:"urn:vim25 PowerOnVM_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *PowerOnVM_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func PowerOnVM_Task(ctx context.Context, r soap.RoundTripper, req *types.PowerOnVM_Task) (*types.PowerOnVM_TaskResponse, error) { + var reqBody, resBody PowerOnVM_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type PowerUpHostFromStandBy_TaskBody struct { + Req *types.PowerUpHostFromStandBy_Task `xml:"urn:vim25 PowerUpHostFromStandBy_Task,omitempty"` + Res *types.PowerUpHostFromStandBy_TaskResponse `xml:"urn:vim25 PowerUpHostFromStandBy_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *PowerUpHostFromStandBy_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func PowerUpHostFromStandBy_Task(ctx context.Context, r soap.RoundTripper, req *types.PowerUpHostFromStandBy_Task) (*types.PowerUpHostFromStandBy_TaskResponse, error) { + var reqBody, resBody PowerUpHostFromStandBy_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type PromoteDisks_TaskBody struct { + Req *types.PromoteDisks_Task `xml:"urn:vim25 PromoteDisks_Task,omitempty"` + Res *types.PromoteDisks_TaskResponse `xml:"urn:vim25 PromoteDisks_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *PromoteDisks_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func PromoteDisks_Task(ctx context.Context, r soap.RoundTripper, req *types.PromoteDisks_Task) (*types.PromoteDisks_TaskResponse, error) { + var reqBody, resBody PromoteDisks_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type QueryAnswerFileStatusBody struct { + Req *types.QueryAnswerFileStatus `xml:"urn:vim25 QueryAnswerFileStatus,omitempty"` + Res *types.QueryAnswerFileStatusResponse `xml:"urn:vim25 QueryAnswerFileStatusResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *QueryAnswerFileStatusBody) Fault() *soap.Fault { return b.Fault_ } + +func QueryAnswerFileStatus(ctx context.Context, r soap.RoundTripper, req *types.QueryAnswerFileStatus) (*types.QueryAnswerFileStatusResponse, error) { + var reqBody, resBody QueryAnswerFileStatusBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type QueryAssignedLicensesBody struct { + Req *types.QueryAssignedLicenses `xml:"urn:vim25 QueryAssignedLicenses,omitempty"` + Res *types.QueryAssignedLicensesResponse `xml:"urn:vim25 QueryAssignedLicensesResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *QueryAssignedLicensesBody) Fault() *soap.Fault { return b.Fault_ } + +func QueryAssignedLicenses(ctx context.Context, r soap.RoundTripper, req *types.QueryAssignedLicenses) (*types.QueryAssignedLicensesResponse, error) { + var reqBody, resBody QueryAssignedLicensesBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type QueryAvailableDisksForVmfsBody struct { + Req *types.QueryAvailableDisksForVmfs `xml:"urn:vim25 QueryAvailableDisksForVmfs,omitempty"` + Res *types.QueryAvailableDisksForVmfsResponse `xml:"urn:vim25 QueryAvailableDisksForVmfsResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *QueryAvailableDisksForVmfsBody) Fault() *soap.Fault { return b.Fault_ } + +func QueryAvailableDisksForVmfs(ctx context.Context, r soap.RoundTripper, req *types.QueryAvailableDisksForVmfs) (*types.QueryAvailableDisksForVmfsResponse, error) { + var reqBody, resBody QueryAvailableDisksForVmfsBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type QueryAvailableDvsSpecBody struct { + Req *types.QueryAvailableDvsSpec `xml:"urn:vim25 QueryAvailableDvsSpec,omitempty"` + Res *types.QueryAvailableDvsSpecResponse `xml:"urn:vim25 QueryAvailableDvsSpecResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *QueryAvailableDvsSpecBody) Fault() *soap.Fault { return b.Fault_ } + +func QueryAvailableDvsSpec(ctx context.Context, r soap.RoundTripper, req *types.QueryAvailableDvsSpec) (*types.QueryAvailableDvsSpecResponse, error) { + var reqBody, resBody QueryAvailableDvsSpecBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type QueryAvailablePartitionBody struct { + Req *types.QueryAvailablePartition `xml:"urn:vim25 QueryAvailablePartition,omitempty"` + Res *types.QueryAvailablePartitionResponse `xml:"urn:vim25 QueryAvailablePartitionResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *QueryAvailablePartitionBody) Fault() *soap.Fault { return b.Fault_ } + +func QueryAvailablePartition(ctx context.Context, r soap.RoundTripper, req *types.QueryAvailablePartition) (*types.QueryAvailablePartitionResponse, error) { + var reqBody, resBody QueryAvailablePartitionBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type QueryAvailablePerfMetricBody struct { + Req *types.QueryAvailablePerfMetric `xml:"urn:vim25 QueryAvailablePerfMetric,omitempty"` + Res *types.QueryAvailablePerfMetricResponse `xml:"urn:vim25 QueryAvailablePerfMetricResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *QueryAvailablePerfMetricBody) Fault() *soap.Fault { return b.Fault_ } + +func QueryAvailablePerfMetric(ctx context.Context, r soap.RoundTripper, req *types.QueryAvailablePerfMetric) (*types.QueryAvailablePerfMetricResponse, error) { + var reqBody, resBody QueryAvailablePerfMetricBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type QueryAvailableSsdsBody struct { + Req *types.QueryAvailableSsds `xml:"urn:vim25 QueryAvailableSsds,omitempty"` + Res *types.QueryAvailableSsdsResponse `xml:"urn:vim25 QueryAvailableSsdsResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *QueryAvailableSsdsBody) Fault() *soap.Fault { return b.Fault_ } + +func QueryAvailableSsds(ctx context.Context, r soap.RoundTripper, req *types.QueryAvailableSsds) (*types.QueryAvailableSsdsResponse, error) { + var reqBody, resBody QueryAvailableSsdsBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type QueryAvailableTimeZonesBody struct { + Req *types.QueryAvailableTimeZones `xml:"urn:vim25 QueryAvailableTimeZones,omitempty"` + Res *types.QueryAvailableTimeZonesResponse `xml:"urn:vim25 QueryAvailableTimeZonesResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *QueryAvailableTimeZonesBody) Fault() *soap.Fault { return b.Fault_ } + +func QueryAvailableTimeZones(ctx context.Context, r soap.RoundTripper, req *types.QueryAvailableTimeZones) (*types.QueryAvailableTimeZonesResponse, error) { + var reqBody, resBody QueryAvailableTimeZonesBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type QueryBootDevicesBody struct { + Req *types.QueryBootDevices `xml:"urn:vim25 QueryBootDevices,omitempty"` + Res *types.QueryBootDevicesResponse `xml:"urn:vim25 QueryBootDevicesResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *QueryBootDevicesBody) Fault() *soap.Fault { return b.Fault_ } + +func QueryBootDevices(ctx context.Context, r soap.RoundTripper, req *types.QueryBootDevices) (*types.QueryBootDevicesResponse, error) { + var reqBody, resBody QueryBootDevicesBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type QueryBoundVnicsBody struct { + Req *types.QueryBoundVnics `xml:"urn:vim25 QueryBoundVnics,omitempty"` + Res *types.QueryBoundVnicsResponse `xml:"urn:vim25 QueryBoundVnicsResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *QueryBoundVnicsBody) Fault() *soap.Fault { return b.Fault_ } + +func QueryBoundVnics(ctx context.Context, r soap.RoundTripper, req *types.QueryBoundVnics) (*types.QueryBoundVnicsResponse, error) { + var reqBody, resBody QueryBoundVnicsBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type QueryCandidateNicsBody struct { + Req *types.QueryCandidateNics `xml:"urn:vim25 QueryCandidateNics,omitempty"` + Res *types.QueryCandidateNicsResponse `xml:"urn:vim25 QueryCandidateNicsResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *QueryCandidateNicsBody) Fault() *soap.Fault { return b.Fault_ } + +func QueryCandidateNics(ctx context.Context, r soap.RoundTripper, req *types.QueryCandidateNics) (*types.QueryCandidateNicsResponse, error) { + var reqBody, resBody QueryCandidateNicsBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type QueryChangedDiskAreasBody struct { + Req *types.QueryChangedDiskAreas `xml:"urn:vim25 QueryChangedDiskAreas,omitempty"` + Res *types.QueryChangedDiskAreasResponse `xml:"urn:vim25 QueryChangedDiskAreasResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *QueryChangedDiskAreasBody) Fault() *soap.Fault { return b.Fault_ } + +func QueryChangedDiskAreas(ctx context.Context, r soap.RoundTripper, req *types.QueryChangedDiskAreas) (*types.QueryChangedDiskAreasResponse, error) { + var reqBody, resBody QueryChangedDiskAreasBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type QueryCmmdsBody struct { + Req *types.QueryCmmds `xml:"urn:vim25 QueryCmmds,omitempty"` + Res *types.QueryCmmdsResponse `xml:"urn:vim25 QueryCmmdsResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *QueryCmmdsBody) Fault() *soap.Fault { return b.Fault_ } + +func QueryCmmds(ctx context.Context, r soap.RoundTripper, req *types.QueryCmmds) (*types.QueryCmmdsResponse, error) { + var reqBody, resBody QueryCmmdsBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type QueryCompatibleHostForExistingDvsBody struct { + Req *types.QueryCompatibleHostForExistingDvs `xml:"urn:vim25 QueryCompatibleHostForExistingDvs,omitempty"` + Res *types.QueryCompatibleHostForExistingDvsResponse `xml:"urn:vim25 QueryCompatibleHostForExistingDvsResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *QueryCompatibleHostForExistingDvsBody) Fault() *soap.Fault { return b.Fault_ } + +func QueryCompatibleHostForExistingDvs(ctx context.Context, r soap.RoundTripper, req *types.QueryCompatibleHostForExistingDvs) (*types.QueryCompatibleHostForExistingDvsResponse, error) { + var reqBody, resBody QueryCompatibleHostForExistingDvsBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type QueryCompatibleHostForNewDvsBody struct { + Req *types.QueryCompatibleHostForNewDvs `xml:"urn:vim25 QueryCompatibleHostForNewDvs,omitempty"` + Res *types.QueryCompatibleHostForNewDvsResponse `xml:"urn:vim25 QueryCompatibleHostForNewDvsResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *QueryCompatibleHostForNewDvsBody) Fault() *soap.Fault { return b.Fault_ } + +func QueryCompatibleHostForNewDvs(ctx context.Context, r soap.RoundTripper, req *types.QueryCompatibleHostForNewDvs) (*types.QueryCompatibleHostForNewDvsResponse, error) { + var reqBody, resBody QueryCompatibleHostForNewDvsBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type QueryComplianceStatusBody struct { + Req *types.QueryComplianceStatus `xml:"urn:vim25 QueryComplianceStatus,omitempty"` + Res *types.QueryComplianceStatusResponse `xml:"urn:vim25 QueryComplianceStatusResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *QueryComplianceStatusBody) Fault() *soap.Fault { return b.Fault_ } + +func QueryComplianceStatus(ctx context.Context, r soap.RoundTripper, req *types.QueryComplianceStatus) (*types.QueryComplianceStatusResponse, error) { + var reqBody, resBody QueryComplianceStatusBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type QueryConfigOptionBody struct { + Req *types.QueryConfigOption `xml:"urn:vim25 QueryConfigOption,omitempty"` + Res *types.QueryConfigOptionResponse `xml:"urn:vim25 QueryConfigOptionResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *QueryConfigOptionBody) Fault() *soap.Fault { return b.Fault_ } + +func QueryConfigOption(ctx context.Context, r soap.RoundTripper, req *types.QueryConfigOption) (*types.QueryConfigOptionResponse, error) { + var reqBody, resBody QueryConfigOptionBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type QueryConfigOptionDescriptorBody struct { + Req *types.QueryConfigOptionDescriptor `xml:"urn:vim25 QueryConfigOptionDescriptor,omitempty"` + Res *types.QueryConfigOptionDescriptorResponse `xml:"urn:vim25 QueryConfigOptionDescriptorResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *QueryConfigOptionDescriptorBody) Fault() *soap.Fault { return b.Fault_ } + +func QueryConfigOptionDescriptor(ctx context.Context, r soap.RoundTripper, req *types.QueryConfigOptionDescriptor) (*types.QueryConfigOptionDescriptorResponse, error) { + var reqBody, resBody QueryConfigOptionDescriptorBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type QueryConfigOptionExBody struct { + Req *types.QueryConfigOptionEx `xml:"urn:vim25 QueryConfigOptionEx,omitempty"` + Res *types.QueryConfigOptionExResponse `xml:"urn:vim25 QueryConfigOptionExResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *QueryConfigOptionExBody) Fault() *soap.Fault { return b.Fault_ } + +func QueryConfigOptionEx(ctx context.Context, r soap.RoundTripper, req *types.QueryConfigOptionEx) (*types.QueryConfigOptionExResponse, error) { + var reqBody, resBody QueryConfigOptionExBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type QueryConfigTargetBody struct { + Req *types.QueryConfigTarget `xml:"urn:vim25 QueryConfigTarget,omitempty"` + Res *types.QueryConfigTargetResponse `xml:"urn:vim25 QueryConfigTargetResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *QueryConfigTargetBody) Fault() *soap.Fault { return b.Fault_ } + +func QueryConfigTarget(ctx context.Context, r soap.RoundTripper, req *types.QueryConfigTarget) (*types.QueryConfigTargetResponse, error) { + var reqBody, resBody QueryConfigTargetBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type QueryConfiguredModuleOptionStringBody struct { + Req *types.QueryConfiguredModuleOptionString `xml:"urn:vim25 QueryConfiguredModuleOptionString,omitempty"` + Res *types.QueryConfiguredModuleOptionStringResponse `xml:"urn:vim25 QueryConfiguredModuleOptionStringResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *QueryConfiguredModuleOptionStringBody) Fault() *soap.Fault { return b.Fault_ } + +func QueryConfiguredModuleOptionString(ctx context.Context, r soap.RoundTripper, req *types.QueryConfiguredModuleOptionString) (*types.QueryConfiguredModuleOptionStringResponse, error) { + var reqBody, resBody QueryConfiguredModuleOptionStringBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type QueryConnectionInfoBody struct { + Req *types.QueryConnectionInfo `xml:"urn:vim25 QueryConnectionInfo,omitempty"` + Res *types.QueryConnectionInfoResponse `xml:"urn:vim25 QueryConnectionInfoResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *QueryConnectionInfoBody) Fault() *soap.Fault { return b.Fault_ } + +func QueryConnectionInfo(ctx context.Context, r soap.RoundTripper, req *types.QueryConnectionInfo) (*types.QueryConnectionInfoResponse, error) { + var reqBody, resBody QueryConnectionInfoBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type QueryConnectionInfoViaSpecBody struct { + Req *types.QueryConnectionInfoViaSpec `xml:"urn:vim25 QueryConnectionInfoViaSpec,omitempty"` + Res *types.QueryConnectionInfoViaSpecResponse `xml:"urn:vim25 QueryConnectionInfoViaSpecResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *QueryConnectionInfoViaSpecBody) Fault() *soap.Fault { return b.Fault_ } + +func QueryConnectionInfoViaSpec(ctx context.Context, r soap.RoundTripper, req *types.QueryConnectionInfoViaSpec) (*types.QueryConnectionInfoViaSpecResponse, error) { + var reqBody, resBody QueryConnectionInfoViaSpecBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type QueryDatastorePerformanceSummaryBody struct { + Req *types.QueryDatastorePerformanceSummary `xml:"urn:vim25 QueryDatastorePerformanceSummary,omitempty"` + Res *types.QueryDatastorePerformanceSummaryResponse `xml:"urn:vim25 QueryDatastorePerformanceSummaryResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *QueryDatastorePerformanceSummaryBody) Fault() *soap.Fault { return b.Fault_ } + +func QueryDatastorePerformanceSummary(ctx context.Context, r soap.RoundTripper, req *types.QueryDatastorePerformanceSummary) (*types.QueryDatastorePerformanceSummaryResponse, error) { + var reqBody, resBody QueryDatastorePerformanceSummaryBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type QueryDateTimeBody struct { + Req *types.QueryDateTime `xml:"urn:vim25 QueryDateTime,omitempty"` + Res *types.QueryDateTimeResponse `xml:"urn:vim25 QueryDateTimeResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *QueryDateTimeBody) Fault() *soap.Fault { return b.Fault_ } + +func QueryDateTime(ctx context.Context, r soap.RoundTripper, req *types.QueryDateTime) (*types.QueryDateTimeResponse, error) { + var reqBody, resBody QueryDateTimeBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type QueryDescriptionsBody struct { + Req *types.QueryDescriptions `xml:"urn:vim25 QueryDescriptions,omitempty"` + Res *types.QueryDescriptionsResponse `xml:"urn:vim25 QueryDescriptionsResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *QueryDescriptionsBody) Fault() *soap.Fault { return b.Fault_ } + +func QueryDescriptions(ctx context.Context, r soap.RoundTripper, req *types.QueryDescriptions) (*types.QueryDescriptionsResponse, error) { + var reqBody, resBody QueryDescriptionsBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type QueryDisksForVsanBody struct { + Req *types.QueryDisksForVsan `xml:"urn:vim25 QueryDisksForVsan,omitempty"` + Res *types.QueryDisksForVsanResponse `xml:"urn:vim25 QueryDisksForVsanResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *QueryDisksForVsanBody) Fault() *soap.Fault { return b.Fault_ } + +func QueryDisksForVsan(ctx context.Context, r soap.RoundTripper, req *types.QueryDisksForVsan) (*types.QueryDisksForVsanResponse, error) { + var reqBody, resBody QueryDisksForVsanBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type QueryDisksUsingFilterBody struct { + Req *types.QueryDisksUsingFilter `xml:"urn:vim25 QueryDisksUsingFilter,omitempty"` + Res *types.QueryDisksUsingFilterResponse `xml:"urn:vim25 QueryDisksUsingFilterResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *QueryDisksUsingFilterBody) Fault() *soap.Fault { return b.Fault_ } + +func QueryDisksUsingFilter(ctx context.Context, r soap.RoundTripper, req *types.QueryDisksUsingFilter) (*types.QueryDisksUsingFilterResponse, error) { + var reqBody, resBody QueryDisksUsingFilterBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type QueryDvsByUuidBody struct { + Req *types.QueryDvsByUuid `xml:"urn:vim25 QueryDvsByUuid,omitempty"` + Res *types.QueryDvsByUuidResponse `xml:"urn:vim25 QueryDvsByUuidResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *QueryDvsByUuidBody) Fault() *soap.Fault { return b.Fault_ } + +func QueryDvsByUuid(ctx context.Context, r soap.RoundTripper, req *types.QueryDvsByUuid) (*types.QueryDvsByUuidResponse, error) { + var reqBody, resBody QueryDvsByUuidBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type QueryDvsCheckCompatibilityBody struct { + Req *types.QueryDvsCheckCompatibility `xml:"urn:vim25 QueryDvsCheckCompatibility,omitempty"` + Res *types.QueryDvsCheckCompatibilityResponse `xml:"urn:vim25 QueryDvsCheckCompatibilityResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *QueryDvsCheckCompatibilityBody) Fault() *soap.Fault { return b.Fault_ } + +func QueryDvsCheckCompatibility(ctx context.Context, r soap.RoundTripper, req *types.QueryDvsCheckCompatibility) (*types.QueryDvsCheckCompatibilityResponse, error) { + var reqBody, resBody QueryDvsCheckCompatibilityBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type QueryDvsCompatibleHostSpecBody struct { + Req *types.QueryDvsCompatibleHostSpec `xml:"urn:vim25 QueryDvsCompatibleHostSpec,omitempty"` + Res *types.QueryDvsCompatibleHostSpecResponse `xml:"urn:vim25 QueryDvsCompatibleHostSpecResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *QueryDvsCompatibleHostSpecBody) Fault() *soap.Fault { return b.Fault_ } + +func QueryDvsCompatibleHostSpec(ctx context.Context, r soap.RoundTripper, req *types.QueryDvsCompatibleHostSpec) (*types.QueryDvsCompatibleHostSpecResponse, error) { + var reqBody, resBody QueryDvsCompatibleHostSpecBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type QueryDvsConfigTargetBody struct { + Req *types.QueryDvsConfigTarget `xml:"urn:vim25 QueryDvsConfigTarget,omitempty"` + Res *types.QueryDvsConfigTargetResponse `xml:"urn:vim25 QueryDvsConfigTargetResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *QueryDvsConfigTargetBody) Fault() *soap.Fault { return b.Fault_ } + +func QueryDvsConfigTarget(ctx context.Context, r soap.RoundTripper, req *types.QueryDvsConfigTarget) (*types.QueryDvsConfigTargetResponse, error) { + var reqBody, resBody QueryDvsConfigTargetBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type QueryDvsFeatureCapabilityBody struct { + Req *types.QueryDvsFeatureCapability `xml:"urn:vim25 QueryDvsFeatureCapability,omitempty"` + Res *types.QueryDvsFeatureCapabilityResponse `xml:"urn:vim25 QueryDvsFeatureCapabilityResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *QueryDvsFeatureCapabilityBody) Fault() *soap.Fault { return b.Fault_ } + +func QueryDvsFeatureCapability(ctx context.Context, r soap.RoundTripper, req *types.QueryDvsFeatureCapability) (*types.QueryDvsFeatureCapabilityResponse, error) { + var reqBody, resBody QueryDvsFeatureCapabilityBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type QueryEventsBody struct { + Req *types.QueryEvents `xml:"urn:vim25 QueryEvents,omitempty"` + Res *types.QueryEventsResponse `xml:"urn:vim25 QueryEventsResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *QueryEventsBody) Fault() *soap.Fault { return b.Fault_ } + +func QueryEvents(ctx context.Context, r soap.RoundTripper, req *types.QueryEvents) (*types.QueryEventsResponse, error) { + var reqBody, resBody QueryEventsBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type QueryExpressionMetadataBody struct { + Req *types.QueryExpressionMetadata `xml:"urn:vim25 QueryExpressionMetadata,omitempty"` + Res *types.QueryExpressionMetadataResponse `xml:"urn:vim25 QueryExpressionMetadataResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *QueryExpressionMetadataBody) Fault() *soap.Fault { return b.Fault_ } + +func QueryExpressionMetadata(ctx context.Context, r soap.RoundTripper, req *types.QueryExpressionMetadata) (*types.QueryExpressionMetadataResponse, error) { + var reqBody, resBody QueryExpressionMetadataBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type QueryExtensionIpAllocationUsageBody struct { + Req *types.QueryExtensionIpAllocationUsage `xml:"urn:vim25 QueryExtensionIpAllocationUsage,omitempty"` + Res *types.QueryExtensionIpAllocationUsageResponse `xml:"urn:vim25 QueryExtensionIpAllocationUsageResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *QueryExtensionIpAllocationUsageBody) Fault() *soap.Fault { return b.Fault_ } + +func QueryExtensionIpAllocationUsage(ctx context.Context, r soap.RoundTripper, req *types.QueryExtensionIpAllocationUsage) (*types.QueryExtensionIpAllocationUsageResponse, error) { + var reqBody, resBody QueryExtensionIpAllocationUsageBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type QueryFaultToleranceCompatibilityBody struct { + Req *types.QueryFaultToleranceCompatibility `xml:"urn:vim25 QueryFaultToleranceCompatibility,omitempty"` + Res *types.QueryFaultToleranceCompatibilityResponse `xml:"urn:vim25 QueryFaultToleranceCompatibilityResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *QueryFaultToleranceCompatibilityBody) Fault() *soap.Fault { return b.Fault_ } + +func QueryFaultToleranceCompatibility(ctx context.Context, r soap.RoundTripper, req *types.QueryFaultToleranceCompatibility) (*types.QueryFaultToleranceCompatibilityResponse, error) { + var reqBody, resBody QueryFaultToleranceCompatibilityBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type QueryFaultToleranceCompatibilityExBody struct { + Req *types.QueryFaultToleranceCompatibilityEx `xml:"urn:vim25 QueryFaultToleranceCompatibilityEx,omitempty"` + Res *types.QueryFaultToleranceCompatibilityExResponse `xml:"urn:vim25 QueryFaultToleranceCompatibilityExResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *QueryFaultToleranceCompatibilityExBody) Fault() *soap.Fault { return b.Fault_ } + +func QueryFaultToleranceCompatibilityEx(ctx context.Context, r soap.RoundTripper, req *types.QueryFaultToleranceCompatibilityEx) (*types.QueryFaultToleranceCompatibilityExResponse, error) { + var reqBody, resBody QueryFaultToleranceCompatibilityExBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type QueryFirmwareConfigUploadURLBody struct { + Req *types.QueryFirmwareConfigUploadURL `xml:"urn:vim25 QueryFirmwareConfigUploadURL,omitempty"` + Res *types.QueryFirmwareConfigUploadURLResponse `xml:"urn:vim25 QueryFirmwareConfigUploadURLResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *QueryFirmwareConfigUploadURLBody) Fault() *soap.Fault { return b.Fault_ } + +func QueryFirmwareConfigUploadURL(ctx context.Context, r soap.RoundTripper, req *types.QueryFirmwareConfigUploadURL) (*types.QueryFirmwareConfigUploadURLResponse, error) { + var reqBody, resBody QueryFirmwareConfigUploadURLBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type QueryHostConnectionInfoBody struct { + Req *types.QueryHostConnectionInfo `xml:"urn:vim25 QueryHostConnectionInfo,omitempty"` + Res *types.QueryHostConnectionInfoResponse `xml:"urn:vim25 QueryHostConnectionInfoResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *QueryHostConnectionInfoBody) Fault() *soap.Fault { return b.Fault_ } + +func QueryHostConnectionInfo(ctx context.Context, r soap.RoundTripper, req *types.QueryHostConnectionInfo) (*types.QueryHostConnectionInfoResponse, error) { + var reqBody, resBody QueryHostConnectionInfoBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type QueryHostPatch_TaskBody struct { + Req *types.QueryHostPatch_Task `xml:"urn:vim25 QueryHostPatch_Task,omitempty"` + Res *types.QueryHostPatch_TaskResponse `xml:"urn:vim25 QueryHostPatch_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *QueryHostPatch_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func QueryHostPatch_Task(ctx context.Context, r soap.RoundTripper, req *types.QueryHostPatch_Task) (*types.QueryHostPatch_TaskResponse, error) { + var reqBody, resBody QueryHostPatch_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type QueryHostProfileMetadataBody struct { + Req *types.QueryHostProfileMetadata `xml:"urn:vim25 QueryHostProfileMetadata,omitempty"` + Res *types.QueryHostProfileMetadataResponse `xml:"urn:vim25 QueryHostProfileMetadataResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *QueryHostProfileMetadataBody) Fault() *soap.Fault { return b.Fault_ } + +func QueryHostProfileMetadata(ctx context.Context, r soap.RoundTripper, req *types.QueryHostProfileMetadata) (*types.QueryHostProfileMetadataResponse, error) { + var reqBody, resBody QueryHostProfileMetadataBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type QueryHostStatusBody struct { + Req *types.QueryHostStatus `xml:"urn:vim25 QueryHostStatus,omitempty"` + Res *types.QueryHostStatusResponse `xml:"urn:vim25 QueryHostStatusResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *QueryHostStatusBody) Fault() *soap.Fault { return b.Fault_ } + +func QueryHostStatus(ctx context.Context, r soap.RoundTripper, req *types.QueryHostStatus) (*types.QueryHostStatusResponse, error) { + var reqBody, resBody QueryHostStatusBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type QueryIORMConfigOptionBody struct { + Req *types.QueryIORMConfigOption `xml:"urn:vim25 QueryIORMConfigOption,omitempty"` + Res *types.QueryIORMConfigOptionResponse `xml:"urn:vim25 QueryIORMConfigOptionResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *QueryIORMConfigOptionBody) Fault() *soap.Fault { return b.Fault_ } + +func QueryIORMConfigOption(ctx context.Context, r soap.RoundTripper, req *types.QueryIORMConfigOption) (*types.QueryIORMConfigOptionResponse, error) { + var reqBody, resBody QueryIORMConfigOptionBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type QueryIPAllocationsBody struct { + Req *types.QueryIPAllocations `xml:"urn:vim25 QueryIPAllocations,omitempty"` + Res *types.QueryIPAllocationsResponse `xml:"urn:vim25 QueryIPAllocationsResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *QueryIPAllocationsBody) Fault() *soap.Fault { return b.Fault_ } + +func QueryIPAllocations(ctx context.Context, r soap.RoundTripper, req *types.QueryIPAllocations) (*types.QueryIPAllocationsResponse, error) { + var reqBody, resBody QueryIPAllocationsBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type QueryIoFilterInfoBody struct { + Req *types.QueryIoFilterInfo `xml:"urn:vim25 QueryIoFilterInfo,omitempty"` + Res *types.QueryIoFilterInfoResponse `xml:"urn:vim25 QueryIoFilterInfoResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *QueryIoFilterInfoBody) Fault() *soap.Fault { return b.Fault_ } + +func QueryIoFilterInfo(ctx context.Context, r soap.RoundTripper, req *types.QueryIoFilterInfo) (*types.QueryIoFilterInfoResponse, error) { + var reqBody, resBody QueryIoFilterInfoBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type QueryIoFilterIssuesBody struct { + Req *types.QueryIoFilterIssues `xml:"urn:vim25 QueryIoFilterIssues,omitempty"` + Res *types.QueryIoFilterIssuesResponse `xml:"urn:vim25 QueryIoFilterIssuesResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *QueryIoFilterIssuesBody) Fault() *soap.Fault { return b.Fault_ } + +func QueryIoFilterIssues(ctx context.Context, r soap.RoundTripper, req *types.QueryIoFilterIssues) (*types.QueryIoFilterIssuesResponse, error) { + var reqBody, resBody QueryIoFilterIssuesBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type QueryIpPoolsBody struct { + Req *types.QueryIpPools `xml:"urn:vim25 QueryIpPools,omitempty"` + Res *types.QueryIpPoolsResponse `xml:"urn:vim25 QueryIpPoolsResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *QueryIpPoolsBody) Fault() *soap.Fault { return b.Fault_ } + +func QueryIpPools(ctx context.Context, r soap.RoundTripper, req *types.QueryIpPools) (*types.QueryIpPoolsResponse, error) { + var reqBody, resBody QueryIpPoolsBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type QueryLicenseSourceAvailabilityBody struct { + Req *types.QueryLicenseSourceAvailability `xml:"urn:vim25 QueryLicenseSourceAvailability,omitempty"` + Res *types.QueryLicenseSourceAvailabilityResponse `xml:"urn:vim25 QueryLicenseSourceAvailabilityResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *QueryLicenseSourceAvailabilityBody) Fault() *soap.Fault { return b.Fault_ } + +func QueryLicenseSourceAvailability(ctx context.Context, r soap.RoundTripper, req *types.QueryLicenseSourceAvailability) (*types.QueryLicenseSourceAvailabilityResponse, error) { + var reqBody, resBody QueryLicenseSourceAvailabilityBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type QueryLicenseUsageBody struct { + Req *types.QueryLicenseUsage `xml:"urn:vim25 QueryLicenseUsage,omitempty"` + Res *types.QueryLicenseUsageResponse `xml:"urn:vim25 QueryLicenseUsageResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *QueryLicenseUsageBody) Fault() *soap.Fault { return b.Fault_ } + +func QueryLicenseUsage(ctx context.Context, r soap.RoundTripper, req *types.QueryLicenseUsage) (*types.QueryLicenseUsageResponse, error) { + var reqBody, resBody QueryLicenseUsageBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type QueryLockdownExceptionsBody struct { + Req *types.QueryLockdownExceptions `xml:"urn:vim25 QueryLockdownExceptions,omitempty"` + Res *types.QueryLockdownExceptionsResponse `xml:"urn:vim25 QueryLockdownExceptionsResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *QueryLockdownExceptionsBody) Fault() *soap.Fault { return b.Fault_ } + +func QueryLockdownExceptions(ctx context.Context, r soap.RoundTripper, req *types.QueryLockdownExceptions) (*types.QueryLockdownExceptionsResponse, error) { + var reqBody, resBody QueryLockdownExceptionsBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type QueryManagedByBody struct { + Req *types.QueryManagedBy `xml:"urn:vim25 QueryManagedBy,omitempty"` + Res *types.QueryManagedByResponse `xml:"urn:vim25 QueryManagedByResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *QueryManagedByBody) Fault() *soap.Fault { return b.Fault_ } + +func QueryManagedBy(ctx context.Context, r soap.RoundTripper, req *types.QueryManagedBy) (*types.QueryManagedByResponse, error) { + var reqBody, resBody QueryManagedByBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type QueryMemoryOverheadBody struct { + Req *types.QueryMemoryOverhead `xml:"urn:vim25 QueryMemoryOverhead,omitempty"` + Res *types.QueryMemoryOverheadResponse `xml:"urn:vim25 QueryMemoryOverheadResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *QueryMemoryOverheadBody) Fault() *soap.Fault { return b.Fault_ } + +func QueryMemoryOverhead(ctx context.Context, r soap.RoundTripper, req *types.QueryMemoryOverhead) (*types.QueryMemoryOverheadResponse, error) { + var reqBody, resBody QueryMemoryOverheadBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type QueryMemoryOverheadExBody struct { + Req *types.QueryMemoryOverheadEx `xml:"urn:vim25 QueryMemoryOverheadEx,omitempty"` + Res *types.QueryMemoryOverheadExResponse `xml:"urn:vim25 QueryMemoryOverheadExResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *QueryMemoryOverheadExBody) Fault() *soap.Fault { return b.Fault_ } + +func QueryMemoryOverheadEx(ctx context.Context, r soap.RoundTripper, req *types.QueryMemoryOverheadEx) (*types.QueryMemoryOverheadExResponse, error) { + var reqBody, resBody QueryMemoryOverheadExBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type QueryMigrationDependenciesBody struct { + Req *types.QueryMigrationDependencies `xml:"urn:vim25 QueryMigrationDependencies,omitempty"` + Res *types.QueryMigrationDependenciesResponse `xml:"urn:vim25 QueryMigrationDependenciesResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *QueryMigrationDependenciesBody) Fault() *soap.Fault { return b.Fault_ } + +func QueryMigrationDependencies(ctx context.Context, r soap.RoundTripper, req *types.QueryMigrationDependencies) (*types.QueryMigrationDependenciesResponse, error) { + var reqBody, resBody QueryMigrationDependenciesBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type QueryModulesBody struct { + Req *types.QueryModules `xml:"urn:vim25 QueryModules,omitempty"` + Res *types.QueryModulesResponse `xml:"urn:vim25 QueryModulesResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *QueryModulesBody) Fault() *soap.Fault { return b.Fault_ } + +func QueryModules(ctx context.Context, r soap.RoundTripper, req *types.QueryModules) (*types.QueryModulesResponse, error) { + var reqBody, resBody QueryModulesBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type QueryNFSUserBody struct { + Req *types.QueryNFSUser `xml:"urn:vim25 QueryNFSUser,omitempty"` + Res *types.QueryNFSUserResponse `xml:"urn:vim25 QueryNFSUserResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *QueryNFSUserBody) Fault() *soap.Fault { return b.Fault_ } + +func QueryNFSUser(ctx context.Context, r soap.RoundTripper, req *types.QueryNFSUser) (*types.QueryNFSUserResponse, error) { + var reqBody, resBody QueryNFSUserBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type QueryNetConfigBody struct { + Req *types.QueryNetConfig `xml:"urn:vim25 QueryNetConfig,omitempty"` + Res *types.QueryNetConfigResponse `xml:"urn:vim25 QueryNetConfigResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *QueryNetConfigBody) Fault() *soap.Fault { return b.Fault_ } + +func QueryNetConfig(ctx context.Context, r soap.RoundTripper, req *types.QueryNetConfig) (*types.QueryNetConfigResponse, error) { + var reqBody, resBody QueryNetConfigBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type QueryNetworkHintBody struct { + Req *types.QueryNetworkHint `xml:"urn:vim25 QueryNetworkHint,omitempty"` + Res *types.QueryNetworkHintResponse `xml:"urn:vim25 QueryNetworkHintResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *QueryNetworkHintBody) Fault() *soap.Fault { return b.Fault_ } + +func QueryNetworkHint(ctx context.Context, r soap.RoundTripper, req *types.QueryNetworkHint) (*types.QueryNetworkHintResponse, error) { + var reqBody, resBody QueryNetworkHintBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type QueryObjectsOnPhysicalVsanDiskBody struct { + Req *types.QueryObjectsOnPhysicalVsanDisk `xml:"urn:vim25 QueryObjectsOnPhysicalVsanDisk,omitempty"` + Res *types.QueryObjectsOnPhysicalVsanDiskResponse `xml:"urn:vim25 QueryObjectsOnPhysicalVsanDiskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *QueryObjectsOnPhysicalVsanDiskBody) Fault() *soap.Fault { return b.Fault_ } + +func QueryObjectsOnPhysicalVsanDisk(ctx context.Context, r soap.RoundTripper, req *types.QueryObjectsOnPhysicalVsanDisk) (*types.QueryObjectsOnPhysicalVsanDiskResponse, error) { + var reqBody, resBody QueryObjectsOnPhysicalVsanDiskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type QueryOptionsBody struct { + Req *types.QueryOptions `xml:"urn:vim25 QueryOptions,omitempty"` + Res *types.QueryOptionsResponse `xml:"urn:vim25 QueryOptionsResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *QueryOptionsBody) Fault() *soap.Fault { return b.Fault_ } + +func QueryOptions(ctx context.Context, r soap.RoundTripper, req *types.QueryOptions) (*types.QueryOptionsResponse, error) { + var reqBody, resBody QueryOptionsBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type QueryPartitionCreateDescBody struct { + Req *types.QueryPartitionCreateDesc `xml:"urn:vim25 QueryPartitionCreateDesc,omitempty"` + Res *types.QueryPartitionCreateDescResponse `xml:"urn:vim25 QueryPartitionCreateDescResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *QueryPartitionCreateDescBody) Fault() *soap.Fault { return b.Fault_ } + +func QueryPartitionCreateDesc(ctx context.Context, r soap.RoundTripper, req *types.QueryPartitionCreateDesc) (*types.QueryPartitionCreateDescResponse, error) { + var reqBody, resBody QueryPartitionCreateDescBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type QueryPartitionCreateOptionsBody struct { + Req *types.QueryPartitionCreateOptions `xml:"urn:vim25 QueryPartitionCreateOptions,omitempty"` + Res *types.QueryPartitionCreateOptionsResponse `xml:"urn:vim25 QueryPartitionCreateOptionsResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *QueryPartitionCreateOptionsBody) Fault() *soap.Fault { return b.Fault_ } + +func QueryPartitionCreateOptions(ctx context.Context, r soap.RoundTripper, req *types.QueryPartitionCreateOptions) (*types.QueryPartitionCreateOptionsResponse, error) { + var reqBody, resBody QueryPartitionCreateOptionsBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type QueryPathSelectionPolicyOptionsBody struct { + Req *types.QueryPathSelectionPolicyOptions `xml:"urn:vim25 QueryPathSelectionPolicyOptions,omitempty"` + Res *types.QueryPathSelectionPolicyOptionsResponse `xml:"urn:vim25 QueryPathSelectionPolicyOptionsResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *QueryPathSelectionPolicyOptionsBody) Fault() *soap.Fault { return b.Fault_ } + +func QueryPathSelectionPolicyOptions(ctx context.Context, r soap.RoundTripper, req *types.QueryPathSelectionPolicyOptions) (*types.QueryPathSelectionPolicyOptionsResponse, error) { + var reqBody, resBody QueryPathSelectionPolicyOptionsBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type QueryPerfBody struct { + Req *types.QueryPerf `xml:"urn:vim25 QueryPerf,omitempty"` + Res *types.QueryPerfResponse `xml:"urn:vim25 QueryPerfResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *QueryPerfBody) Fault() *soap.Fault { return b.Fault_ } + +func QueryPerf(ctx context.Context, r soap.RoundTripper, req *types.QueryPerf) (*types.QueryPerfResponse, error) { + var reqBody, resBody QueryPerfBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type QueryPerfCompositeBody struct { + Req *types.QueryPerfComposite `xml:"urn:vim25 QueryPerfComposite,omitempty"` + Res *types.QueryPerfCompositeResponse `xml:"urn:vim25 QueryPerfCompositeResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *QueryPerfCompositeBody) Fault() *soap.Fault { return b.Fault_ } + +func QueryPerfComposite(ctx context.Context, r soap.RoundTripper, req *types.QueryPerfComposite) (*types.QueryPerfCompositeResponse, error) { + var reqBody, resBody QueryPerfCompositeBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type QueryPerfCounterBody struct { + Req *types.QueryPerfCounter `xml:"urn:vim25 QueryPerfCounter,omitempty"` + Res *types.QueryPerfCounterResponse `xml:"urn:vim25 QueryPerfCounterResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *QueryPerfCounterBody) Fault() *soap.Fault { return b.Fault_ } + +func QueryPerfCounter(ctx context.Context, r soap.RoundTripper, req *types.QueryPerfCounter) (*types.QueryPerfCounterResponse, error) { + var reqBody, resBody QueryPerfCounterBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type QueryPerfCounterByLevelBody struct { + Req *types.QueryPerfCounterByLevel `xml:"urn:vim25 QueryPerfCounterByLevel,omitempty"` + Res *types.QueryPerfCounterByLevelResponse `xml:"urn:vim25 QueryPerfCounterByLevelResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *QueryPerfCounterByLevelBody) Fault() *soap.Fault { return b.Fault_ } + +func QueryPerfCounterByLevel(ctx context.Context, r soap.RoundTripper, req *types.QueryPerfCounterByLevel) (*types.QueryPerfCounterByLevelResponse, error) { + var reqBody, resBody QueryPerfCounterByLevelBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type QueryPerfProviderSummaryBody struct { + Req *types.QueryPerfProviderSummary `xml:"urn:vim25 QueryPerfProviderSummary,omitempty"` + Res *types.QueryPerfProviderSummaryResponse `xml:"urn:vim25 QueryPerfProviderSummaryResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *QueryPerfProviderSummaryBody) Fault() *soap.Fault { return b.Fault_ } + +func QueryPerfProviderSummary(ctx context.Context, r soap.RoundTripper, req *types.QueryPerfProviderSummary) (*types.QueryPerfProviderSummaryResponse, error) { + var reqBody, resBody QueryPerfProviderSummaryBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type QueryPhysicalVsanDisksBody struct { + Req *types.QueryPhysicalVsanDisks `xml:"urn:vim25 QueryPhysicalVsanDisks,omitempty"` + Res *types.QueryPhysicalVsanDisksResponse `xml:"urn:vim25 QueryPhysicalVsanDisksResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *QueryPhysicalVsanDisksBody) Fault() *soap.Fault { return b.Fault_ } + +func QueryPhysicalVsanDisks(ctx context.Context, r soap.RoundTripper, req *types.QueryPhysicalVsanDisks) (*types.QueryPhysicalVsanDisksResponse, error) { + var reqBody, resBody QueryPhysicalVsanDisksBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type QueryPnicStatusBody struct { + Req *types.QueryPnicStatus `xml:"urn:vim25 QueryPnicStatus,omitempty"` + Res *types.QueryPnicStatusResponse `xml:"urn:vim25 QueryPnicStatusResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *QueryPnicStatusBody) Fault() *soap.Fault { return b.Fault_ } + +func QueryPnicStatus(ctx context.Context, r soap.RoundTripper, req *types.QueryPnicStatus) (*types.QueryPnicStatusResponse, error) { + var reqBody, resBody QueryPnicStatusBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type QueryPolicyMetadataBody struct { + Req *types.QueryPolicyMetadata `xml:"urn:vim25 QueryPolicyMetadata,omitempty"` + Res *types.QueryPolicyMetadataResponse `xml:"urn:vim25 QueryPolicyMetadataResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *QueryPolicyMetadataBody) Fault() *soap.Fault { return b.Fault_ } + +func QueryPolicyMetadata(ctx context.Context, r soap.RoundTripper, req *types.QueryPolicyMetadata) (*types.QueryPolicyMetadataResponse, error) { + var reqBody, resBody QueryPolicyMetadataBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type QueryProfileStructureBody struct { + Req *types.QueryProfileStructure `xml:"urn:vim25 QueryProfileStructure,omitempty"` + Res *types.QueryProfileStructureResponse `xml:"urn:vim25 QueryProfileStructureResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *QueryProfileStructureBody) Fault() *soap.Fault { return b.Fault_ } + +func QueryProfileStructure(ctx context.Context, r soap.RoundTripper, req *types.QueryProfileStructure) (*types.QueryProfileStructureResponse, error) { + var reqBody, resBody QueryProfileStructureBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type QueryResourceConfigOptionBody struct { + Req *types.QueryResourceConfigOption `xml:"urn:vim25 QueryResourceConfigOption,omitempty"` + Res *types.QueryResourceConfigOptionResponse `xml:"urn:vim25 QueryResourceConfigOptionResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *QueryResourceConfigOptionBody) Fault() *soap.Fault { return b.Fault_ } + +func QueryResourceConfigOption(ctx context.Context, r soap.RoundTripper, req *types.QueryResourceConfigOption) (*types.QueryResourceConfigOptionResponse, error) { + var reqBody, resBody QueryResourceConfigOptionBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type QueryServiceListBody struct { + Req *types.QueryServiceList `xml:"urn:vim25 QueryServiceList,omitempty"` + Res *types.QueryServiceListResponse `xml:"urn:vim25 QueryServiceListResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *QueryServiceListBody) Fault() *soap.Fault { return b.Fault_ } + +func QueryServiceList(ctx context.Context, r soap.RoundTripper, req *types.QueryServiceList) (*types.QueryServiceListResponse, error) { + var reqBody, resBody QueryServiceListBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type QueryStorageArrayTypePolicyOptionsBody struct { + Req *types.QueryStorageArrayTypePolicyOptions `xml:"urn:vim25 QueryStorageArrayTypePolicyOptions,omitempty"` + Res *types.QueryStorageArrayTypePolicyOptionsResponse `xml:"urn:vim25 QueryStorageArrayTypePolicyOptionsResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *QueryStorageArrayTypePolicyOptionsBody) Fault() *soap.Fault { return b.Fault_ } + +func QueryStorageArrayTypePolicyOptions(ctx context.Context, r soap.RoundTripper, req *types.QueryStorageArrayTypePolicyOptions) (*types.QueryStorageArrayTypePolicyOptionsResponse, error) { + var reqBody, resBody QueryStorageArrayTypePolicyOptionsBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type QuerySupportedFeaturesBody struct { + Req *types.QuerySupportedFeatures `xml:"urn:vim25 QuerySupportedFeatures,omitempty"` + Res *types.QuerySupportedFeaturesResponse `xml:"urn:vim25 QuerySupportedFeaturesResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *QuerySupportedFeaturesBody) Fault() *soap.Fault { return b.Fault_ } + +func QuerySupportedFeatures(ctx context.Context, r soap.RoundTripper, req *types.QuerySupportedFeatures) (*types.QuerySupportedFeaturesResponse, error) { + var reqBody, resBody QuerySupportedFeaturesBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type QuerySyncingVsanObjectsBody struct { + Req *types.QuerySyncingVsanObjects `xml:"urn:vim25 QuerySyncingVsanObjects,omitempty"` + Res *types.QuerySyncingVsanObjectsResponse `xml:"urn:vim25 QuerySyncingVsanObjectsResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *QuerySyncingVsanObjectsBody) Fault() *soap.Fault { return b.Fault_ } + +func QuerySyncingVsanObjects(ctx context.Context, r soap.RoundTripper, req *types.QuerySyncingVsanObjects) (*types.QuerySyncingVsanObjectsResponse, error) { + var reqBody, resBody QuerySyncingVsanObjectsBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type QuerySystemUsersBody struct { + Req *types.QuerySystemUsers `xml:"urn:vim25 QuerySystemUsers,omitempty"` + Res *types.QuerySystemUsersResponse `xml:"urn:vim25 QuerySystemUsersResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *QuerySystemUsersBody) Fault() *soap.Fault { return b.Fault_ } + +func QuerySystemUsers(ctx context.Context, r soap.RoundTripper, req *types.QuerySystemUsers) (*types.QuerySystemUsersResponse, error) { + var reqBody, resBody QuerySystemUsersBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type QueryTargetCapabilitiesBody struct { + Req *types.QueryTargetCapabilities `xml:"urn:vim25 QueryTargetCapabilities,omitempty"` + Res *types.QueryTargetCapabilitiesResponse `xml:"urn:vim25 QueryTargetCapabilitiesResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *QueryTargetCapabilitiesBody) Fault() *soap.Fault { return b.Fault_ } + +func QueryTargetCapabilities(ctx context.Context, r soap.RoundTripper, req *types.QueryTargetCapabilities) (*types.QueryTargetCapabilitiesResponse, error) { + var reqBody, resBody QueryTargetCapabilitiesBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type QueryTpmAttestationReportBody struct { + Req *types.QueryTpmAttestationReport `xml:"urn:vim25 QueryTpmAttestationReport,omitempty"` + Res *types.QueryTpmAttestationReportResponse `xml:"urn:vim25 QueryTpmAttestationReportResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *QueryTpmAttestationReportBody) Fault() *soap.Fault { return b.Fault_ } + +func QueryTpmAttestationReport(ctx context.Context, r soap.RoundTripper, req *types.QueryTpmAttestationReport) (*types.QueryTpmAttestationReportResponse, error) { + var reqBody, resBody QueryTpmAttestationReportBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type QueryUnownedFilesBody struct { + Req *types.QueryUnownedFiles `xml:"urn:vim25 QueryUnownedFiles,omitempty"` + Res *types.QueryUnownedFilesResponse `xml:"urn:vim25 QueryUnownedFilesResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *QueryUnownedFilesBody) Fault() *soap.Fault { return b.Fault_ } + +func QueryUnownedFiles(ctx context.Context, r soap.RoundTripper, req *types.QueryUnownedFiles) (*types.QueryUnownedFilesResponse, error) { + var reqBody, resBody QueryUnownedFilesBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type QueryUnresolvedVmfsVolumeBody struct { + Req *types.QueryUnresolvedVmfsVolume `xml:"urn:vim25 QueryUnresolvedVmfsVolume,omitempty"` + Res *types.QueryUnresolvedVmfsVolumeResponse `xml:"urn:vim25 QueryUnresolvedVmfsVolumeResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *QueryUnresolvedVmfsVolumeBody) Fault() *soap.Fault { return b.Fault_ } + +func QueryUnresolvedVmfsVolume(ctx context.Context, r soap.RoundTripper, req *types.QueryUnresolvedVmfsVolume) (*types.QueryUnresolvedVmfsVolumeResponse, error) { + var reqBody, resBody QueryUnresolvedVmfsVolumeBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type QueryUnresolvedVmfsVolumesBody struct { + Req *types.QueryUnresolvedVmfsVolumes `xml:"urn:vim25 QueryUnresolvedVmfsVolumes,omitempty"` + Res *types.QueryUnresolvedVmfsVolumesResponse `xml:"urn:vim25 QueryUnresolvedVmfsVolumesResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *QueryUnresolvedVmfsVolumesBody) Fault() *soap.Fault { return b.Fault_ } + +func QueryUnresolvedVmfsVolumes(ctx context.Context, r soap.RoundTripper, req *types.QueryUnresolvedVmfsVolumes) (*types.QueryUnresolvedVmfsVolumesResponse, error) { + var reqBody, resBody QueryUnresolvedVmfsVolumesBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type QueryUsedVlanIdInDvsBody struct { + Req *types.QueryUsedVlanIdInDvs `xml:"urn:vim25 QueryUsedVlanIdInDvs,omitempty"` + Res *types.QueryUsedVlanIdInDvsResponse `xml:"urn:vim25 QueryUsedVlanIdInDvsResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *QueryUsedVlanIdInDvsBody) Fault() *soap.Fault { return b.Fault_ } + +func QueryUsedVlanIdInDvs(ctx context.Context, r soap.RoundTripper, req *types.QueryUsedVlanIdInDvs) (*types.QueryUsedVlanIdInDvsResponse, error) { + var reqBody, resBody QueryUsedVlanIdInDvsBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type QueryVMotionCompatibilityBody struct { + Req *types.QueryVMotionCompatibility `xml:"urn:vim25 QueryVMotionCompatibility,omitempty"` + Res *types.QueryVMotionCompatibilityResponse `xml:"urn:vim25 QueryVMotionCompatibilityResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *QueryVMotionCompatibilityBody) Fault() *soap.Fault { return b.Fault_ } + +func QueryVMotionCompatibility(ctx context.Context, r soap.RoundTripper, req *types.QueryVMotionCompatibility) (*types.QueryVMotionCompatibilityResponse, error) { + var reqBody, resBody QueryVMotionCompatibilityBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type QueryVMotionCompatibilityEx_TaskBody struct { + Req *types.QueryVMotionCompatibilityEx_Task `xml:"urn:vim25 QueryVMotionCompatibilityEx_Task,omitempty"` + Res *types.QueryVMotionCompatibilityEx_TaskResponse `xml:"urn:vim25 QueryVMotionCompatibilityEx_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *QueryVMotionCompatibilityEx_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func QueryVMotionCompatibilityEx_Task(ctx context.Context, r soap.RoundTripper, req *types.QueryVMotionCompatibilityEx_Task) (*types.QueryVMotionCompatibilityEx_TaskResponse, error) { + var reqBody, resBody QueryVMotionCompatibilityEx_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type QueryVirtualDiskFragmentationBody struct { + Req *types.QueryVirtualDiskFragmentation `xml:"urn:vim25 QueryVirtualDiskFragmentation,omitempty"` + Res *types.QueryVirtualDiskFragmentationResponse `xml:"urn:vim25 QueryVirtualDiskFragmentationResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *QueryVirtualDiskFragmentationBody) Fault() *soap.Fault { return b.Fault_ } + +func QueryVirtualDiskFragmentation(ctx context.Context, r soap.RoundTripper, req *types.QueryVirtualDiskFragmentation) (*types.QueryVirtualDiskFragmentationResponse, error) { + var reqBody, resBody QueryVirtualDiskFragmentationBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type QueryVirtualDiskGeometryBody struct { + Req *types.QueryVirtualDiskGeometry `xml:"urn:vim25 QueryVirtualDiskGeometry,omitempty"` + Res *types.QueryVirtualDiskGeometryResponse `xml:"urn:vim25 QueryVirtualDiskGeometryResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *QueryVirtualDiskGeometryBody) Fault() *soap.Fault { return b.Fault_ } + +func QueryVirtualDiskGeometry(ctx context.Context, r soap.RoundTripper, req *types.QueryVirtualDiskGeometry) (*types.QueryVirtualDiskGeometryResponse, error) { + var reqBody, resBody QueryVirtualDiskGeometryBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type QueryVirtualDiskUuidBody struct { + Req *types.QueryVirtualDiskUuid `xml:"urn:vim25 QueryVirtualDiskUuid,omitempty"` + Res *types.QueryVirtualDiskUuidResponse `xml:"urn:vim25 QueryVirtualDiskUuidResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *QueryVirtualDiskUuidBody) Fault() *soap.Fault { return b.Fault_ } + +func QueryVirtualDiskUuid(ctx context.Context, r soap.RoundTripper, req *types.QueryVirtualDiskUuid) (*types.QueryVirtualDiskUuidResponse, error) { + var reqBody, resBody QueryVirtualDiskUuidBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type QueryVmfsDatastoreCreateOptionsBody struct { + Req *types.QueryVmfsDatastoreCreateOptions `xml:"urn:vim25 QueryVmfsDatastoreCreateOptions,omitempty"` + Res *types.QueryVmfsDatastoreCreateOptionsResponse `xml:"urn:vim25 QueryVmfsDatastoreCreateOptionsResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *QueryVmfsDatastoreCreateOptionsBody) Fault() *soap.Fault { return b.Fault_ } + +func QueryVmfsDatastoreCreateOptions(ctx context.Context, r soap.RoundTripper, req *types.QueryVmfsDatastoreCreateOptions) (*types.QueryVmfsDatastoreCreateOptionsResponse, error) { + var reqBody, resBody QueryVmfsDatastoreCreateOptionsBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type QueryVmfsDatastoreExpandOptionsBody struct { + Req *types.QueryVmfsDatastoreExpandOptions `xml:"urn:vim25 QueryVmfsDatastoreExpandOptions,omitempty"` + Res *types.QueryVmfsDatastoreExpandOptionsResponse `xml:"urn:vim25 QueryVmfsDatastoreExpandOptionsResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *QueryVmfsDatastoreExpandOptionsBody) Fault() *soap.Fault { return b.Fault_ } + +func QueryVmfsDatastoreExpandOptions(ctx context.Context, r soap.RoundTripper, req *types.QueryVmfsDatastoreExpandOptions) (*types.QueryVmfsDatastoreExpandOptionsResponse, error) { + var reqBody, resBody QueryVmfsDatastoreExpandOptionsBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type QueryVmfsDatastoreExtendOptionsBody struct { + Req *types.QueryVmfsDatastoreExtendOptions `xml:"urn:vim25 QueryVmfsDatastoreExtendOptions,omitempty"` + Res *types.QueryVmfsDatastoreExtendOptionsResponse `xml:"urn:vim25 QueryVmfsDatastoreExtendOptionsResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *QueryVmfsDatastoreExtendOptionsBody) Fault() *soap.Fault { return b.Fault_ } + +func QueryVmfsDatastoreExtendOptions(ctx context.Context, r soap.RoundTripper, req *types.QueryVmfsDatastoreExtendOptions) (*types.QueryVmfsDatastoreExtendOptionsResponse, error) { + var reqBody, resBody QueryVmfsDatastoreExtendOptionsBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type QueryVnicStatusBody struct { + Req *types.QueryVnicStatus `xml:"urn:vim25 QueryVnicStatus,omitempty"` + Res *types.QueryVnicStatusResponse `xml:"urn:vim25 QueryVnicStatusResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *QueryVnicStatusBody) Fault() *soap.Fault { return b.Fault_ } + +func QueryVnicStatus(ctx context.Context, r soap.RoundTripper, req *types.QueryVnicStatus) (*types.QueryVnicStatusResponse, error) { + var reqBody, resBody QueryVnicStatusBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type QueryVsanObjectUuidsByFilterBody struct { + Req *types.QueryVsanObjectUuidsByFilter `xml:"urn:vim25 QueryVsanObjectUuidsByFilter,omitempty"` + Res *types.QueryVsanObjectUuidsByFilterResponse `xml:"urn:vim25 QueryVsanObjectUuidsByFilterResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *QueryVsanObjectUuidsByFilterBody) Fault() *soap.Fault { return b.Fault_ } + +func QueryVsanObjectUuidsByFilter(ctx context.Context, r soap.RoundTripper, req *types.QueryVsanObjectUuidsByFilter) (*types.QueryVsanObjectUuidsByFilterResponse, error) { + var reqBody, resBody QueryVsanObjectUuidsByFilterBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type QueryVsanObjectsBody struct { + Req *types.QueryVsanObjects `xml:"urn:vim25 QueryVsanObjects,omitempty"` + Res *types.QueryVsanObjectsResponse `xml:"urn:vim25 QueryVsanObjectsResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *QueryVsanObjectsBody) Fault() *soap.Fault { return b.Fault_ } + +func QueryVsanObjects(ctx context.Context, r soap.RoundTripper, req *types.QueryVsanObjects) (*types.QueryVsanObjectsResponse, error) { + var reqBody, resBody QueryVsanObjectsBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type QueryVsanStatisticsBody struct { + Req *types.QueryVsanStatistics `xml:"urn:vim25 QueryVsanStatistics,omitempty"` + Res *types.QueryVsanStatisticsResponse `xml:"urn:vim25 QueryVsanStatisticsResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *QueryVsanStatisticsBody) Fault() *soap.Fault { return b.Fault_ } + +func QueryVsanStatistics(ctx context.Context, r soap.RoundTripper, req *types.QueryVsanStatistics) (*types.QueryVsanStatisticsResponse, error) { + var reqBody, resBody QueryVsanStatisticsBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type QueryVsanUpgradeStatusBody struct { + Req *types.QueryVsanUpgradeStatus `xml:"urn:vim25 QueryVsanUpgradeStatus,omitempty"` + Res *types.QueryVsanUpgradeStatusResponse `xml:"urn:vim25 QueryVsanUpgradeStatusResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *QueryVsanUpgradeStatusBody) Fault() *soap.Fault { return b.Fault_ } + +func QueryVsanUpgradeStatus(ctx context.Context, r soap.RoundTripper, req *types.QueryVsanUpgradeStatus) (*types.QueryVsanUpgradeStatusResponse, error) { + var reqBody, resBody QueryVsanUpgradeStatusBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type ReadEnvironmentVariableInGuestBody struct { + Req *types.ReadEnvironmentVariableInGuest `xml:"urn:vim25 ReadEnvironmentVariableInGuest,omitempty"` + Res *types.ReadEnvironmentVariableInGuestResponse `xml:"urn:vim25 ReadEnvironmentVariableInGuestResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *ReadEnvironmentVariableInGuestBody) Fault() *soap.Fault { return b.Fault_ } + +func ReadEnvironmentVariableInGuest(ctx context.Context, r soap.RoundTripper, req *types.ReadEnvironmentVariableInGuest) (*types.ReadEnvironmentVariableInGuestResponse, error) { + var reqBody, resBody ReadEnvironmentVariableInGuestBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type ReadNextEventsBody struct { + Req *types.ReadNextEvents `xml:"urn:vim25 ReadNextEvents,omitempty"` + Res *types.ReadNextEventsResponse `xml:"urn:vim25 ReadNextEventsResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *ReadNextEventsBody) Fault() *soap.Fault { return b.Fault_ } + +func ReadNextEvents(ctx context.Context, r soap.RoundTripper, req *types.ReadNextEvents) (*types.ReadNextEventsResponse, error) { + var reqBody, resBody ReadNextEventsBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type ReadNextTasksBody struct { + Req *types.ReadNextTasks `xml:"urn:vim25 ReadNextTasks,omitempty"` + Res *types.ReadNextTasksResponse `xml:"urn:vim25 ReadNextTasksResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *ReadNextTasksBody) Fault() *soap.Fault { return b.Fault_ } + +func ReadNextTasks(ctx context.Context, r soap.RoundTripper, req *types.ReadNextTasks) (*types.ReadNextTasksResponse, error) { + var reqBody, resBody ReadNextTasksBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type ReadPreviousEventsBody struct { + Req *types.ReadPreviousEvents `xml:"urn:vim25 ReadPreviousEvents,omitempty"` + Res *types.ReadPreviousEventsResponse `xml:"urn:vim25 ReadPreviousEventsResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *ReadPreviousEventsBody) Fault() *soap.Fault { return b.Fault_ } + +func ReadPreviousEvents(ctx context.Context, r soap.RoundTripper, req *types.ReadPreviousEvents) (*types.ReadPreviousEventsResponse, error) { + var reqBody, resBody ReadPreviousEventsBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type ReadPreviousTasksBody struct { + Req *types.ReadPreviousTasks `xml:"urn:vim25 ReadPreviousTasks,omitempty"` + Res *types.ReadPreviousTasksResponse `xml:"urn:vim25 ReadPreviousTasksResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *ReadPreviousTasksBody) Fault() *soap.Fault { return b.Fault_ } + +func ReadPreviousTasks(ctx context.Context, r soap.RoundTripper, req *types.ReadPreviousTasks) (*types.ReadPreviousTasksResponse, error) { + var reqBody, resBody ReadPreviousTasksBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type RebootGuestBody struct { + Req *types.RebootGuest `xml:"urn:vim25 RebootGuest,omitempty"` + Res *types.RebootGuestResponse `xml:"urn:vim25 RebootGuestResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *RebootGuestBody) Fault() *soap.Fault { return b.Fault_ } + +func RebootGuest(ctx context.Context, r soap.RoundTripper, req *types.RebootGuest) (*types.RebootGuestResponse, error) { + var reqBody, resBody RebootGuestBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type RebootHost_TaskBody struct { + Req *types.RebootHost_Task `xml:"urn:vim25 RebootHost_Task,omitempty"` + Res *types.RebootHost_TaskResponse `xml:"urn:vim25 RebootHost_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *RebootHost_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func RebootHost_Task(ctx context.Context, r soap.RoundTripper, req *types.RebootHost_Task) (*types.RebootHost_TaskResponse, error) { + var reqBody, resBody RebootHost_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type RecommendDatastoresBody struct { + Req *types.RecommendDatastores `xml:"urn:vim25 RecommendDatastores,omitempty"` + Res *types.RecommendDatastoresResponse `xml:"urn:vim25 RecommendDatastoresResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *RecommendDatastoresBody) Fault() *soap.Fault { return b.Fault_ } + +func RecommendDatastores(ctx context.Context, r soap.RoundTripper, req *types.RecommendDatastores) (*types.RecommendDatastoresResponse, error) { + var reqBody, resBody RecommendDatastoresBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type RecommendHostsForVmBody struct { + Req *types.RecommendHostsForVm `xml:"urn:vim25 RecommendHostsForVm,omitempty"` + Res *types.RecommendHostsForVmResponse `xml:"urn:vim25 RecommendHostsForVmResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *RecommendHostsForVmBody) Fault() *soap.Fault { return b.Fault_ } + +func RecommendHostsForVm(ctx context.Context, r soap.RoundTripper, req *types.RecommendHostsForVm) (*types.RecommendHostsForVmResponse, error) { + var reqBody, resBody RecommendHostsForVmBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type RecommissionVsanNode_TaskBody struct { + Req *types.RecommissionVsanNode_Task `xml:"urn:vim25 RecommissionVsanNode_Task,omitempty"` + Res *types.RecommissionVsanNode_TaskResponse `xml:"urn:vim25 RecommissionVsanNode_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *RecommissionVsanNode_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func RecommissionVsanNode_Task(ctx context.Context, r soap.RoundTripper, req *types.RecommissionVsanNode_Task) (*types.RecommissionVsanNode_TaskResponse, error) { + var reqBody, resBody RecommissionVsanNode_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type ReconfigVM_TaskBody struct { + Req *types.ReconfigVM_Task `xml:"urn:vim25 ReconfigVM_Task,omitempty"` + Res *types.ReconfigVM_TaskResponse `xml:"urn:vim25 ReconfigVM_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *ReconfigVM_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func ReconfigVM_Task(ctx context.Context, r soap.RoundTripper, req *types.ReconfigVM_Task) (*types.ReconfigVM_TaskResponse, error) { + var reqBody, resBody ReconfigVM_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type ReconfigurationSatisfiableBody struct { + Req *types.ReconfigurationSatisfiable `xml:"urn:vim25 ReconfigurationSatisfiable,omitempty"` + Res *types.ReconfigurationSatisfiableResponse `xml:"urn:vim25 ReconfigurationSatisfiableResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *ReconfigurationSatisfiableBody) Fault() *soap.Fault { return b.Fault_ } + +func ReconfigurationSatisfiable(ctx context.Context, r soap.RoundTripper, req *types.ReconfigurationSatisfiable) (*types.ReconfigurationSatisfiableResponse, error) { + var reqBody, resBody ReconfigurationSatisfiableBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type ReconfigureAlarmBody struct { + Req *types.ReconfigureAlarm `xml:"urn:vim25 ReconfigureAlarm,omitempty"` + Res *types.ReconfigureAlarmResponse `xml:"urn:vim25 ReconfigureAlarmResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *ReconfigureAlarmBody) Fault() *soap.Fault { return b.Fault_ } + +func ReconfigureAlarm(ctx context.Context, r soap.RoundTripper, req *types.ReconfigureAlarm) (*types.ReconfigureAlarmResponse, error) { + var reqBody, resBody ReconfigureAlarmBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type ReconfigureAutostartBody struct { + Req *types.ReconfigureAutostart `xml:"urn:vim25 ReconfigureAutostart,omitempty"` + Res *types.ReconfigureAutostartResponse `xml:"urn:vim25 ReconfigureAutostartResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *ReconfigureAutostartBody) Fault() *soap.Fault { return b.Fault_ } + +func ReconfigureAutostart(ctx context.Context, r soap.RoundTripper, req *types.ReconfigureAutostart) (*types.ReconfigureAutostartResponse, error) { + var reqBody, resBody ReconfigureAutostartBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type ReconfigureCluster_TaskBody struct { + Req *types.ReconfigureCluster_Task `xml:"urn:vim25 ReconfigureCluster_Task,omitempty"` + Res *types.ReconfigureCluster_TaskResponse `xml:"urn:vim25 ReconfigureCluster_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *ReconfigureCluster_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func ReconfigureCluster_Task(ctx context.Context, r soap.RoundTripper, req *types.ReconfigureCluster_Task) (*types.ReconfigureCluster_TaskResponse, error) { + var reqBody, resBody ReconfigureCluster_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type ReconfigureComputeResource_TaskBody struct { + Req *types.ReconfigureComputeResource_Task `xml:"urn:vim25 ReconfigureComputeResource_Task,omitempty"` + Res *types.ReconfigureComputeResource_TaskResponse `xml:"urn:vim25 ReconfigureComputeResource_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *ReconfigureComputeResource_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func ReconfigureComputeResource_Task(ctx context.Context, r soap.RoundTripper, req *types.ReconfigureComputeResource_Task) (*types.ReconfigureComputeResource_TaskResponse, error) { + var reqBody, resBody ReconfigureComputeResource_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type ReconfigureDVPort_TaskBody struct { + Req *types.ReconfigureDVPort_Task `xml:"urn:vim25 ReconfigureDVPort_Task,omitempty"` + Res *types.ReconfigureDVPort_TaskResponse `xml:"urn:vim25 ReconfigureDVPort_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *ReconfigureDVPort_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func ReconfigureDVPort_Task(ctx context.Context, r soap.RoundTripper, req *types.ReconfigureDVPort_Task) (*types.ReconfigureDVPort_TaskResponse, error) { + var reqBody, resBody ReconfigureDVPort_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type ReconfigureDVPortgroup_TaskBody struct { + Req *types.ReconfigureDVPortgroup_Task `xml:"urn:vim25 ReconfigureDVPortgroup_Task,omitempty"` + Res *types.ReconfigureDVPortgroup_TaskResponse `xml:"urn:vim25 ReconfigureDVPortgroup_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *ReconfigureDVPortgroup_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func ReconfigureDVPortgroup_Task(ctx context.Context, r soap.RoundTripper, req *types.ReconfigureDVPortgroup_Task) (*types.ReconfigureDVPortgroup_TaskResponse, error) { + var reqBody, resBody ReconfigureDVPortgroup_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type ReconfigureDatacenter_TaskBody struct { + Req *types.ReconfigureDatacenter_Task `xml:"urn:vim25 ReconfigureDatacenter_Task,omitempty"` + Res *types.ReconfigureDatacenter_TaskResponse `xml:"urn:vim25 ReconfigureDatacenter_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *ReconfigureDatacenter_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func ReconfigureDatacenter_Task(ctx context.Context, r soap.RoundTripper, req *types.ReconfigureDatacenter_Task) (*types.ReconfigureDatacenter_TaskResponse, error) { + var reqBody, resBody ReconfigureDatacenter_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type ReconfigureDomObjectBody struct { + Req *types.ReconfigureDomObject `xml:"urn:vim25 ReconfigureDomObject,omitempty"` + Res *types.ReconfigureDomObjectResponse `xml:"urn:vim25 ReconfigureDomObjectResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *ReconfigureDomObjectBody) Fault() *soap.Fault { return b.Fault_ } + +func ReconfigureDomObject(ctx context.Context, r soap.RoundTripper, req *types.ReconfigureDomObject) (*types.ReconfigureDomObjectResponse, error) { + var reqBody, resBody ReconfigureDomObjectBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type ReconfigureDvs_TaskBody struct { + Req *types.ReconfigureDvs_Task `xml:"urn:vim25 ReconfigureDvs_Task,omitempty"` + Res *types.ReconfigureDvs_TaskResponse `xml:"urn:vim25 ReconfigureDvs_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *ReconfigureDvs_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func ReconfigureDvs_Task(ctx context.Context, r soap.RoundTripper, req *types.ReconfigureDvs_Task) (*types.ReconfigureDvs_TaskResponse, error) { + var reqBody, resBody ReconfigureDvs_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type ReconfigureHostForDAS_TaskBody struct { + Req *types.ReconfigureHostForDAS_Task `xml:"urn:vim25 ReconfigureHostForDAS_Task,omitempty"` + Res *types.ReconfigureHostForDAS_TaskResponse `xml:"urn:vim25 ReconfigureHostForDAS_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *ReconfigureHostForDAS_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func ReconfigureHostForDAS_Task(ctx context.Context, r soap.RoundTripper, req *types.ReconfigureHostForDAS_Task) (*types.ReconfigureHostForDAS_TaskResponse, error) { + var reqBody, resBody ReconfigureHostForDAS_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type ReconfigureScheduledTaskBody struct { + Req *types.ReconfigureScheduledTask `xml:"urn:vim25 ReconfigureScheduledTask,omitempty"` + Res *types.ReconfigureScheduledTaskResponse `xml:"urn:vim25 ReconfigureScheduledTaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *ReconfigureScheduledTaskBody) Fault() *soap.Fault { return b.Fault_ } + +func ReconfigureScheduledTask(ctx context.Context, r soap.RoundTripper, req *types.ReconfigureScheduledTask) (*types.ReconfigureScheduledTaskResponse, error) { + var reqBody, resBody ReconfigureScheduledTaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type ReconfigureServiceConsoleReservationBody struct { + Req *types.ReconfigureServiceConsoleReservation `xml:"urn:vim25 ReconfigureServiceConsoleReservation,omitempty"` + Res *types.ReconfigureServiceConsoleReservationResponse `xml:"urn:vim25 ReconfigureServiceConsoleReservationResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *ReconfigureServiceConsoleReservationBody) Fault() *soap.Fault { return b.Fault_ } + +func ReconfigureServiceConsoleReservation(ctx context.Context, r soap.RoundTripper, req *types.ReconfigureServiceConsoleReservation) (*types.ReconfigureServiceConsoleReservationResponse, error) { + var reqBody, resBody ReconfigureServiceConsoleReservationBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type ReconfigureSnmpAgentBody struct { + Req *types.ReconfigureSnmpAgent `xml:"urn:vim25 ReconfigureSnmpAgent,omitempty"` + Res *types.ReconfigureSnmpAgentResponse `xml:"urn:vim25 ReconfigureSnmpAgentResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *ReconfigureSnmpAgentBody) Fault() *soap.Fault { return b.Fault_ } + +func ReconfigureSnmpAgent(ctx context.Context, r soap.RoundTripper, req *types.ReconfigureSnmpAgent) (*types.ReconfigureSnmpAgentResponse, error) { + var reqBody, resBody ReconfigureSnmpAgentBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type ReconfigureVirtualMachineReservationBody struct { + Req *types.ReconfigureVirtualMachineReservation `xml:"urn:vim25 ReconfigureVirtualMachineReservation,omitempty"` + Res *types.ReconfigureVirtualMachineReservationResponse `xml:"urn:vim25 ReconfigureVirtualMachineReservationResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *ReconfigureVirtualMachineReservationBody) Fault() *soap.Fault { return b.Fault_ } + +func ReconfigureVirtualMachineReservation(ctx context.Context, r soap.RoundTripper, req *types.ReconfigureVirtualMachineReservation) (*types.ReconfigureVirtualMachineReservationResponse, error) { + var reqBody, resBody ReconfigureVirtualMachineReservationBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type ReconnectHost_TaskBody struct { + Req *types.ReconnectHost_Task `xml:"urn:vim25 ReconnectHost_Task,omitempty"` + Res *types.ReconnectHost_TaskResponse `xml:"urn:vim25 ReconnectHost_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *ReconnectHost_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func ReconnectHost_Task(ctx context.Context, r soap.RoundTripper, req *types.ReconnectHost_Task) (*types.ReconnectHost_TaskResponse, error) { + var reqBody, resBody ReconnectHost_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type RectifyDvsHost_TaskBody struct { + Req *types.RectifyDvsHost_Task `xml:"urn:vim25 RectifyDvsHost_Task,omitempty"` + Res *types.RectifyDvsHost_TaskResponse `xml:"urn:vim25 RectifyDvsHost_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *RectifyDvsHost_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func RectifyDvsHost_Task(ctx context.Context, r soap.RoundTripper, req *types.RectifyDvsHost_Task) (*types.RectifyDvsHost_TaskResponse, error) { + var reqBody, resBody RectifyDvsHost_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type RectifyDvsOnHost_TaskBody struct { + Req *types.RectifyDvsOnHost_Task `xml:"urn:vim25 RectifyDvsOnHost_Task,omitempty"` + Res *types.RectifyDvsOnHost_TaskResponse `xml:"urn:vim25 RectifyDvsOnHost_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *RectifyDvsOnHost_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func RectifyDvsOnHost_Task(ctx context.Context, r soap.RoundTripper, req *types.RectifyDvsOnHost_Task) (*types.RectifyDvsOnHost_TaskResponse, error) { + var reqBody, resBody RectifyDvsOnHost_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type RefreshBody struct { + Req *types.Refresh `xml:"urn:vim25 Refresh,omitempty"` + Res *types.RefreshResponse `xml:"urn:vim25 RefreshResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *RefreshBody) Fault() *soap.Fault { return b.Fault_ } + +func Refresh(ctx context.Context, r soap.RoundTripper, req *types.Refresh) (*types.RefreshResponse, error) { + var reqBody, resBody RefreshBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type RefreshDVPortStateBody struct { + Req *types.RefreshDVPortState `xml:"urn:vim25 RefreshDVPortState,omitempty"` + Res *types.RefreshDVPortStateResponse `xml:"urn:vim25 RefreshDVPortStateResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *RefreshDVPortStateBody) Fault() *soap.Fault { return b.Fault_ } + +func RefreshDVPortState(ctx context.Context, r soap.RoundTripper, req *types.RefreshDVPortState) (*types.RefreshDVPortStateResponse, error) { + var reqBody, resBody RefreshDVPortStateBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type RefreshDatastoreBody struct { + Req *types.RefreshDatastore `xml:"urn:vim25 RefreshDatastore,omitempty"` + Res *types.RefreshDatastoreResponse `xml:"urn:vim25 RefreshDatastoreResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *RefreshDatastoreBody) Fault() *soap.Fault { return b.Fault_ } + +func RefreshDatastore(ctx context.Context, r soap.RoundTripper, req *types.RefreshDatastore) (*types.RefreshDatastoreResponse, error) { + var reqBody, resBody RefreshDatastoreBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type RefreshDatastoreStorageInfoBody struct { + Req *types.RefreshDatastoreStorageInfo `xml:"urn:vim25 RefreshDatastoreStorageInfo,omitempty"` + Res *types.RefreshDatastoreStorageInfoResponse `xml:"urn:vim25 RefreshDatastoreStorageInfoResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *RefreshDatastoreStorageInfoBody) Fault() *soap.Fault { return b.Fault_ } + +func RefreshDatastoreStorageInfo(ctx context.Context, r soap.RoundTripper, req *types.RefreshDatastoreStorageInfo) (*types.RefreshDatastoreStorageInfoResponse, error) { + var reqBody, resBody RefreshDatastoreStorageInfoBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type RefreshDateTimeSystemBody struct { + Req *types.RefreshDateTimeSystem `xml:"urn:vim25 RefreshDateTimeSystem,omitempty"` + Res *types.RefreshDateTimeSystemResponse `xml:"urn:vim25 RefreshDateTimeSystemResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *RefreshDateTimeSystemBody) Fault() *soap.Fault { return b.Fault_ } + +func RefreshDateTimeSystem(ctx context.Context, r soap.RoundTripper, req *types.RefreshDateTimeSystem) (*types.RefreshDateTimeSystemResponse, error) { + var reqBody, resBody RefreshDateTimeSystemBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type RefreshFirewallBody struct { + Req *types.RefreshFirewall `xml:"urn:vim25 RefreshFirewall,omitempty"` + Res *types.RefreshFirewallResponse `xml:"urn:vim25 RefreshFirewallResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *RefreshFirewallBody) Fault() *soap.Fault { return b.Fault_ } + +func RefreshFirewall(ctx context.Context, r soap.RoundTripper, req *types.RefreshFirewall) (*types.RefreshFirewallResponse, error) { + var reqBody, resBody RefreshFirewallBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type RefreshGraphicsManagerBody struct { + Req *types.RefreshGraphicsManager `xml:"urn:vim25 RefreshGraphicsManager,omitempty"` + Res *types.RefreshGraphicsManagerResponse `xml:"urn:vim25 RefreshGraphicsManagerResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *RefreshGraphicsManagerBody) Fault() *soap.Fault { return b.Fault_ } + +func RefreshGraphicsManager(ctx context.Context, r soap.RoundTripper, req *types.RefreshGraphicsManager) (*types.RefreshGraphicsManagerResponse, error) { + var reqBody, resBody RefreshGraphicsManagerBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type RefreshHealthStatusSystemBody struct { + Req *types.RefreshHealthStatusSystem `xml:"urn:vim25 RefreshHealthStatusSystem,omitempty"` + Res *types.RefreshHealthStatusSystemResponse `xml:"urn:vim25 RefreshHealthStatusSystemResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *RefreshHealthStatusSystemBody) Fault() *soap.Fault { return b.Fault_ } + +func RefreshHealthStatusSystem(ctx context.Context, r soap.RoundTripper, req *types.RefreshHealthStatusSystem) (*types.RefreshHealthStatusSystemResponse, error) { + var reqBody, resBody RefreshHealthStatusSystemBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type RefreshNetworkSystemBody struct { + Req *types.RefreshNetworkSystem `xml:"urn:vim25 RefreshNetworkSystem,omitempty"` + Res *types.RefreshNetworkSystemResponse `xml:"urn:vim25 RefreshNetworkSystemResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *RefreshNetworkSystemBody) Fault() *soap.Fault { return b.Fault_ } + +func RefreshNetworkSystem(ctx context.Context, r soap.RoundTripper, req *types.RefreshNetworkSystem) (*types.RefreshNetworkSystemResponse, error) { + var reqBody, resBody RefreshNetworkSystemBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type RefreshRecommendationBody struct { + Req *types.RefreshRecommendation `xml:"urn:vim25 RefreshRecommendation,omitempty"` + Res *types.RefreshRecommendationResponse `xml:"urn:vim25 RefreshRecommendationResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *RefreshRecommendationBody) Fault() *soap.Fault { return b.Fault_ } + +func RefreshRecommendation(ctx context.Context, r soap.RoundTripper, req *types.RefreshRecommendation) (*types.RefreshRecommendationResponse, error) { + var reqBody, resBody RefreshRecommendationBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type RefreshRuntimeBody struct { + Req *types.RefreshRuntime `xml:"urn:vim25 RefreshRuntime,omitempty"` + Res *types.RefreshRuntimeResponse `xml:"urn:vim25 RefreshRuntimeResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *RefreshRuntimeBody) Fault() *soap.Fault { return b.Fault_ } + +func RefreshRuntime(ctx context.Context, r soap.RoundTripper, req *types.RefreshRuntime) (*types.RefreshRuntimeResponse, error) { + var reqBody, resBody RefreshRuntimeBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type RefreshServicesBody struct { + Req *types.RefreshServices `xml:"urn:vim25 RefreshServices,omitempty"` + Res *types.RefreshServicesResponse `xml:"urn:vim25 RefreshServicesResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *RefreshServicesBody) Fault() *soap.Fault { return b.Fault_ } + +func RefreshServices(ctx context.Context, r soap.RoundTripper, req *types.RefreshServices) (*types.RefreshServicesResponse, error) { + var reqBody, resBody RefreshServicesBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type RefreshStorageDrsRecommendationBody struct { + Req *types.RefreshStorageDrsRecommendation `xml:"urn:vim25 RefreshStorageDrsRecommendation,omitempty"` + Res *types.RefreshStorageDrsRecommendationResponse `xml:"urn:vim25 RefreshStorageDrsRecommendationResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *RefreshStorageDrsRecommendationBody) Fault() *soap.Fault { return b.Fault_ } + +func RefreshStorageDrsRecommendation(ctx context.Context, r soap.RoundTripper, req *types.RefreshStorageDrsRecommendation) (*types.RefreshStorageDrsRecommendationResponse, error) { + var reqBody, resBody RefreshStorageDrsRecommendationBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type RefreshStorageInfoBody struct { + Req *types.RefreshStorageInfo `xml:"urn:vim25 RefreshStorageInfo,omitempty"` + Res *types.RefreshStorageInfoResponse `xml:"urn:vim25 RefreshStorageInfoResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *RefreshStorageInfoBody) Fault() *soap.Fault { return b.Fault_ } + +func RefreshStorageInfo(ctx context.Context, r soap.RoundTripper, req *types.RefreshStorageInfo) (*types.RefreshStorageInfoResponse, error) { + var reqBody, resBody RefreshStorageInfoBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type RefreshStorageSystemBody struct { + Req *types.RefreshStorageSystem `xml:"urn:vim25 RefreshStorageSystem,omitempty"` + Res *types.RefreshStorageSystemResponse `xml:"urn:vim25 RefreshStorageSystemResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *RefreshStorageSystemBody) Fault() *soap.Fault { return b.Fault_ } + +func RefreshStorageSystem(ctx context.Context, r soap.RoundTripper, req *types.RefreshStorageSystem) (*types.RefreshStorageSystemResponse, error) { + var reqBody, resBody RefreshStorageSystemBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type RegisterChildVM_TaskBody struct { + Req *types.RegisterChildVM_Task `xml:"urn:vim25 RegisterChildVM_Task,omitempty"` + Res *types.RegisterChildVM_TaskResponse `xml:"urn:vim25 RegisterChildVM_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *RegisterChildVM_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func RegisterChildVM_Task(ctx context.Context, r soap.RoundTripper, req *types.RegisterChildVM_Task) (*types.RegisterChildVM_TaskResponse, error) { + var reqBody, resBody RegisterChildVM_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type RegisterExtensionBody struct { + Req *types.RegisterExtension `xml:"urn:vim25 RegisterExtension,omitempty"` + Res *types.RegisterExtensionResponse `xml:"urn:vim25 RegisterExtensionResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *RegisterExtensionBody) Fault() *soap.Fault { return b.Fault_ } + +func RegisterExtension(ctx context.Context, r soap.RoundTripper, req *types.RegisterExtension) (*types.RegisterExtensionResponse, error) { + var reqBody, resBody RegisterExtensionBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type RegisterVM_TaskBody struct { + Req *types.RegisterVM_Task `xml:"urn:vim25 RegisterVM_Task,omitempty"` + Res *types.RegisterVM_TaskResponse `xml:"urn:vim25 RegisterVM_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *RegisterVM_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func RegisterVM_Task(ctx context.Context, r soap.RoundTripper, req *types.RegisterVM_Task) (*types.RegisterVM_TaskResponse, error) { + var reqBody, resBody RegisterVM_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type ReleaseCredentialsInGuestBody struct { + Req *types.ReleaseCredentialsInGuest `xml:"urn:vim25 ReleaseCredentialsInGuest,omitempty"` + Res *types.ReleaseCredentialsInGuestResponse `xml:"urn:vim25 ReleaseCredentialsInGuestResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *ReleaseCredentialsInGuestBody) Fault() *soap.Fault { return b.Fault_ } + +func ReleaseCredentialsInGuest(ctx context.Context, r soap.RoundTripper, req *types.ReleaseCredentialsInGuest) (*types.ReleaseCredentialsInGuestResponse, error) { + var reqBody, resBody ReleaseCredentialsInGuestBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type ReleaseIpAllocationBody struct { + Req *types.ReleaseIpAllocation `xml:"urn:vim25 ReleaseIpAllocation,omitempty"` + Res *types.ReleaseIpAllocationResponse `xml:"urn:vim25 ReleaseIpAllocationResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *ReleaseIpAllocationBody) Fault() *soap.Fault { return b.Fault_ } + +func ReleaseIpAllocation(ctx context.Context, r soap.RoundTripper, req *types.ReleaseIpAllocation) (*types.ReleaseIpAllocationResponse, error) { + var reqBody, resBody ReleaseIpAllocationBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type ReloadBody struct { + Req *types.Reload `xml:"urn:vim25 Reload,omitempty"` + Res *types.ReloadResponse `xml:"urn:vim25 ReloadResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *ReloadBody) Fault() *soap.Fault { return b.Fault_ } + +func Reload(ctx context.Context, r soap.RoundTripper, req *types.Reload) (*types.ReloadResponse, error) { + var reqBody, resBody ReloadBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type RelocateVM_TaskBody struct { + Req *types.RelocateVM_Task `xml:"urn:vim25 RelocateVM_Task,omitempty"` + Res *types.RelocateVM_TaskResponse `xml:"urn:vim25 RelocateVM_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *RelocateVM_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func RelocateVM_Task(ctx context.Context, r soap.RoundTripper, req *types.RelocateVM_Task) (*types.RelocateVM_TaskResponse, error) { + var reqBody, resBody RelocateVM_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type RemoveAlarmBody struct { + Req *types.RemoveAlarm `xml:"urn:vim25 RemoveAlarm,omitempty"` + Res *types.RemoveAlarmResponse `xml:"urn:vim25 RemoveAlarmResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *RemoveAlarmBody) Fault() *soap.Fault { return b.Fault_ } + +func RemoveAlarm(ctx context.Context, r soap.RoundTripper, req *types.RemoveAlarm) (*types.RemoveAlarmResponse, error) { + var reqBody, resBody RemoveAlarmBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type RemoveAllSnapshots_TaskBody struct { + Req *types.RemoveAllSnapshots_Task `xml:"urn:vim25 RemoveAllSnapshots_Task,omitempty"` + Res *types.RemoveAllSnapshots_TaskResponse `xml:"urn:vim25 RemoveAllSnapshots_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *RemoveAllSnapshots_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func RemoveAllSnapshots_Task(ctx context.Context, r soap.RoundTripper, req *types.RemoveAllSnapshots_Task) (*types.RemoveAllSnapshots_TaskResponse, error) { + var reqBody, resBody RemoveAllSnapshots_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type RemoveAssignedLicenseBody struct { + Req *types.RemoveAssignedLicense `xml:"urn:vim25 RemoveAssignedLicense,omitempty"` + Res *types.RemoveAssignedLicenseResponse `xml:"urn:vim25 RemoveAssignedLicenseResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *RemoveAssignedLicenseBody) Fault() *soap.Fault { return b.Fault_ } + +func RemoveAssignedLicense(ctx context.Context, r soap.RoundTripper, req *types.RemoveAssignedLicense) (*types.RemoveAssignedLicenseResponse, error) { + var reqBody, resBody RemoveAssignedLicenseBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type RemoveAuthorizationRoleBody struct { + Req *types.RemoveAuthorizationRole `xml:"urn:vim25 RemoveAuthorizationRole,omitempty"` + Res *types.RemoveAuthorizationRoleResponse `xml:"urn:vim25 RemoveAuthorizationRoleResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *RemoveAuthorizationRoleBody) Fault() *soap.Fault { return b.Fault_ } + +func RemoveAuthorizationRole(ctx context.Context, r soap.RoundTripper, req *types.RemoveAuthorizationRole) (*types.RemoveAuthorizationRoleResponse, error) { + var reqBody, resBody RemoveAuthorizationRoleBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type RemoveCustomFieldDefBody struct { + Req *types.RemoveCustomFieldDef `xml:"urn:vim25 RemoveCustomFieldDef,omitempty"` + Res *types.RemoveCustomFieldDefResponse `xml:"urn:vim25 RemoveCustomFieldDefResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *RemoveCustomFieldDefBody) Fault() *soap.Fault { return b.Fault_ } + +func RemoveCustomFieldDef(ctx context.Context, r soap.RoundTripper, req *types.RemoveCustomFieldDef) (*types.RemoveCustomFieldDefResponse, error) { + var reqBody, resBody RemoveCustomFieldDefBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type RemoveDatastoreBody struct { + Req *types.RemoveDatastore `xml:"urn:vim25 RemoveDatastore,omitempty"` + Res *types.RemoveDatastoreResponse `xml:"urn:vim25 RemoveDatastoreResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *RemoveDatastoreBody) Fault() *soap.Fault { return b.Fault_ } + +func RemoveDatastore(ctx context.Context, r soap.RoundTripper, req *types.RemoveDatastore) (*types.RemoveDatastoreResponse, error) { + var reqBody, resBody RemoveDatastoreBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type RemoveDatastoreEx_TaskBody struct { + Req *types.RemoveDatastoreEx_Task `xml:"urn:vim25 RemoveDatastoreEx_Task,omitempty"` + Res *types.RemoveDatastoreEx_TaskResponse `xml:"urn:vim25 RemoveDatastoreEx_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *RemoveDatastoreEx_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func RemoveDatastoreEx_Task(ctx context.Context, r soap.RoundTripper, req *types.RemoveDatastoreEx_Task) (*types.RemoveDatastoreEx_TaskResponse, error) { + var reqBody, resBody RemoveDatastoreEx_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type RemoveDiskMapping_TaskBody struct { + Req *types.RemoveDiskMapping_Task `xml:"urn:vim25 RemoveDiskMapping_Task,omitempty"` + Res *types.RemoveDiskMapping_TaskResponse `xml:"urn:vim25 RemoveDiskMapping_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *RemoveDiskMapping_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func RemoveDiskMapping_Task(ctx context.Context, r soap.RoundTripper, req *types.RemoveDiskMapping_Task) (*types.RemoveDiskMapping_TaskResponse, error) { + var reqBody, resBody RemoveDiskMapping_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type RemoveDisk_TaskBody struct { + Req *types.RemoveDisk_Task `xml:"urn:vim25 RemoveDisk_Task,omitempty"` + Res *types.RemoveDisk_TaskResponse `xml:"urn:vim25 RemoveDisk_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *RemoveDisk_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func RemoveDisk_Task(ctx context.Context, r soap.RoundTripper, req *types.RemoveDisk_Task) (*types.RemoveDisk_TaskResponse, error) { + var reqBody, resBody RemoveDisk_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type RemoveEntityPermissionBody struct { + Req *types.RemoveEntityPermission `xml:"urn:vim25 RemoveEntityPermission,omitempty"` + Res *types.RemoveEntityPermissionResponse `xml:"urn:vim25 RemoveEntityPermissionResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *RemoveEntityPermissionBody) Fault() *soap.Fault { return b.Fault_ } + +func RemoveEntityPermission(ctx context.Context, r soap.RoundTripper, req *types.RemoveEntityPermission) (*types.RemoveEntityPermissionResponse, error) { + var reqBody, resBody RemoveEntityPermissionBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type RemoveGroupBody struct { + Req *types.RemoveGroup `xml:"urn:vim25 RemoveGroup,omitempty"` + Res *types.RemoveGroupResponse `xml:"urn:vim25 RemoveGroupResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *RemoveGroupBody) Fault() *soap.Fault { return b.Fault_ } + +func RemoveGroup(ctx context.Context, r soap.RoundTripper, req *types.RemoveGroup) (*types.RemoveGroupResponse, error) { + var reqBody, resBody RemoveGroupBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type RemoveGuestAliasBody struct { + Req *types.RemoveGuestAlias `xml:"urn:vim25 RemoveGuestAlias,omitempty"` + Res *types.RemoveGuestAliasResponse `xml:"urn:vim25 RemoveGuestAliasResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *RemoveGuestAliasBody) Fault() *soap.Fault { return b.Fault_ } + +func RemoveGuestAlias(ctx context.Context, r soap.RoundTripper, req *types.RemoveGuestAlias) (*types.RemoveGuestAliasResponse, error) { + var reqBody, resBody RemoveGuestAliasBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type RemoveGuestAliasByCertBody struct { + Req *types.RemoveGuestAliasByCert `xml:"urn:vim25 RemoveGuestAliasByCert,omitempty"` + Res *types.RemoveGuestAliasByCertResponse `xml:"urn:vim25 RemoveGuestAliasByCertResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *RemoveGuestAliasByCertBody) Fault() *soap.Fault { return b.Fault_ } + +func RemoveGuestAliasByCert(ctx context.Context, r soap.RoundTripper, req *types.RemoveGuestAliasByCert) (*types.RemoveGuestAliasByCertResponse, error) { + var reqBody, resBody RemoveGuestAliasByCertBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type RemoveInternetScsiSendTargetsBody struct { + Req *types.RemoveInternetScsiSendTargets `xml:"urn:vim25 RemoveInternetScsiSendTargets,omitempty"` + Res *types.RemoveInternetScsiSendTargetsResponse `xml:"urn:vim25 RemoveInternetScsiSendTargetsResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *RemoveInternetScsiSendTargetsBody) Fault() *soap.Fault { return b.Fault_ } + +func RemoveInternetScsiSendTargets(ctx context.Context, r soap.RoundTripper, req *types.RemoveInternetScsiSendTargets) (*types.RemoveInternetScsiSendTargetsResponse, error) { + var reqBody, resBody RemoveInternetScsiSendTargetsBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type RemoveInternetScsiStaticTargetsBody struct { + Req *types.RemoveInternetScsiStaticTargets `xml:"urn:vim25 RemoveInternetScsiStaticTargets,omitempty"` + Res *types.RemoveInternetScsiStaticTargetsResponse `xml:"urn:vim25 RemoveInternetScsiStaticTargetsResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *RemoveInternetScsiStaticTargetsBody) Fault() *soap.Fault { return b.Fault_ } + +func RemoveInternetScsiStaticTargets(ctx context.Context, r soap.RoundTripper, req *types.RemoveInternetScsiStaticTargets) (*types.RemoveInternetScsiStaticTargetsResponse, error) { + var reqBody, resBody RemoveInternetScsiStaticTargetsBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type RemoveLicenseBody struct { + Req *types.RemoveLicense `xml:"urn:vim25 RemoveLicense,omitempty"` + Res *types.RemoveLicenseResponse `xml:"urn:vim25 RemoveLicenseResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *RemoveLicenseBody) Fault() *soap.Fault { return b.Fault_ } + +func RemoveLicense(ctx context.Context, r soap.RoundTripper, req *types.RemoveLicense) (*types.RemoveLicenseResponse, error) { + var reqBody, resBody RemoveLicenseBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type RemoveLicenseLabelBody struct { + Req *types.RemoveLicenseLabel `xml:"urn:vim25 RemoveLicenseLabel,omitempty"` + Res *types.RemoveLicenseLabelResponse `xml:"urn:vim25 RemoveLicenseLabelResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *RemoveLicenseLabelBody) Fault() *soap.Fault { return b.Fault_ } + +func RemoveLicenseLabel(ctx context.Context, r soap.RoundTripper, req *types.RemoveLicenseLabel) (*types.RemoveLicenseLabelResponse, error) { + var reqBody, resBody RemoveLicenseLabelBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type RemoveNetworkResourcePoolBody struct { + Req *types.RemoveNetworkResourcePool `xml:"urn:vim25 RemoveNetworkResourcePool,omitempty"` + Res *types.RemoveNetworkResourcePoolResponse `xml:"urn:vim25 RemoveNetworkResourcePoolResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *RemoveNetworkResourcePoolBody) Fault() *soap.Fault { return b.Fault_ } + +func RemoveNetworkResourcePool(ctx context.Context, r soap.RoundTripper, req *types.RemoveNetworkResourcePool) (*types.RemoveNetworkResourcePoolResponse, error) { + var reqBody, resBody RemoveNetworkResourcePoolBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type RemovePerfIntervalBody struct { + Req *types.RemovePerfInterval `xml:"urn:vim25 RemovePerfInterval,omitempty"` + Res *types.RemovePerfIntervalResponse `xml:"urn:vim25 RemovePerfIntervalResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *RemovePerfIntervalBody) Fault() *soap.Fault { return b.Fault_ } + +func RemovePerfInterval(ctx context.Context, r soap.RoundTripper, req *types.RemovePerfInterval) (*types.RemovePerfIntervalResponse, error) { + var reqBody, resBody RemovePerfIntervalBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type RemovePortGroupBody struct { + Req *types.RemovePortGroup `xml:"urn:vim25 RemovePortGroup,omitempty"` + Res *types.RemovePortGroupResponse `xml:"urn:vim25 RemovePortGroupResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *RemovePortGroupBody) Fault() *soap.Fault { return b.Fault_ } + +func RemovePortGroup(ctx context.Context, r soap.RoundTripper, req *types.RemovePortGroup) (*types.RemovePortGroupResponse, error) { + var reqBody, resBody RemovePortGroupBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type RemoveScheduledTaskBody struct { + Req *types.RemoveScheduledTask `xml:"urn:vim25 RemoveScheduledTask,omitempty"` + Res *types.RemoveScheduledTaskResponse `xml:"urn:vim25 RemoveScheduledTaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *RemoveScheduledTaskBody) Fault() *soap.Fault { return b.Fault_ } + +func RemoveScheduledTask(ctx context.Context, r soap.RoundTripper, req *types.RemoveScheduledTask) (*types.RemoveScheduledTaskResponse, error) { + var reqBody, resBody RemoveScheduledTaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type RemoveServiceConsoleVirtualNicBody struct { + Req *types.RemoveServiceConsoleVirtualNic `xml:"urn:vim25 RemoveServiceConsoleVirtualNic,omitempty"` + Res *types.RemoveServiceConsoleVirtualNicResponse `xml:"urn:vim25 RemoveServiceConsoleVirtualNicResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *RemoveServiceConsoleVirtualNicBody) Fault() *soap.Fault { return b.Fault_ } + +func RemoveServiceConsoleVirtualNic(ctx context.Context, r soap.RoundTripper, req *types.RemoveServiceConsoleVirtualNic) (*types.RemoveServiceConsoleVirtualNicResponse, error) { + var reqBody, resBody RemoveServiceConsoleVirtualNicBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type RemoveSmartCardTrustAnchorBody struct { + Req *types.RemoveSmartCardTrustAnchor `xml:"urn:vim25 RemoveSmartCardTrustAnchor,omitempty"` + Res *types.RemoveSmartCardTrustAnchorResponse `xml:"urn:vim25 RemoveSmartCardTrustAnchorResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *RemoveSmartCardTrustAnchorBody) Fault() *soap.Fault { return b.Fault_ } + +func RemoveSmartCardTrustAnchor(ctx context.Context, r soap.RoundTripper, req *types.RemoveSmartCardTrustAnchor) (*types.RemoveSmartCardTrustAnchorResponse, error) { + var reqBody, resBody RemoveSmartCardTrustAnchorBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type RemoveSmartCardTrustAnchorByFingerprintBody struct { + Req *types.RemoveSmartCardTrustAnchorByFingerprint `xml:"urn:vim25 RemoveSmartCardTrustAnchorByFingerprint,omitempty"` + Res *types.RemoveSmartCardTrustAnchorByFingerprintResponse `xml:"urn:vim25 RemoveSmartCardTrustAnchorByFingerprintResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *RemoveSmartCardTrustAnchorByFingerprintBody) Fault() *soap.Fault { return b.Fault_ } + +func RemoveSmartCardTrustAnchorByFingerprint(ctx context.Context, r soap.RoundTripper, req *types.RemoveSmartCardTrustAnchorByFingerprint) (*types.RemoveSmartCardTrustAnchorByFingerprintResponse, error) { + var reqBody, resBody RemoveSmartCardTrustAnchorByFingerprintBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type RemoveSnapshot_TaskBody struct { + Req *types.RemoveSnapshot_Task `xml:"urn:vim25 RemoveSnapshot_Task,omitempty"` + Res *types.RemoveSnapshot_TaskResponse `xml:"urn:vim25 RemoveSnapshot_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *RemoveSnapshot_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func RemoveSnapshot_Task(ctx context.Context, r soap.RoundTripper, req *types.RemoveSnapshot_Task) (*types.RemoveSnapshot_TaskResponse, error) { + var reqBody, resBody RemoveSnapshot_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type RemoveUserBody struct { + Req *types.RemoveUser `xml:"urn:vim25 RemoveUser,omitempty"` + Res *types.RemoveUserResponse `xml:"urn:vim25 RemoveUserResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *RemoveUserBody) Fault() *soap.Fault { return b.Fault_ } + +func RemoveUser(ctx context.Context, r soap.RoundTripper, req *types.RemoveUser) (*types.RemoveUserResponse, error) { + var reqBody, resBody RemoveUserBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type RemoveVirtualNicBody struct { + Req *types.RemoveVirtualNic `xml:"urn:vim25 RemoveVirtualNic,omitempty"` + Res *types.RemoveVirtualNicResponse `xml:"urn:vim25 RemoveVirtualNicResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *RemoveVirtualNicBody) Fault() *soap.Fault { return b.Fault_ } + +func RemoveVirtualNic(ctx context.Context, r soap.RoundTripper, req *types.RemoveVirtualNic) (*types.RemoveVirtualNicResponse, error) { + var reqBody, resBody RemoveVirtualNicBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type RemoveVirtualSwitchBody struct { + Req *types.RemoveVirtualSwitch `xml:"urn:vim25 RemoveVirtualSwitch,omitempty"` + Res *types.RemoveVirtualSwitchResponse `xml:"urn:vim25 RemoveVirtualSwitchResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *RemoveVirtualSwitchBody) Fault() *soap.Fault { return b.Fault_ } + +func RemoveVirtualSwitch(ctx context.Context, r soap.RoundTripper, req *types.RemoveVirtualSwitch) (*types.RemoveVirtualSwitchResponse, error) { + var reqBody, resBody RemoveVirtualSwitchBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type RenameCustomFieldDefBody struct { + Req *types.RenameCustomFieldDef `xml:"urn:vim25 RenameCustomFieldDef,omitempty"` + Res *types.RenameCustomFieldDefResponse `xml:"urn:vim25 RenameCustomFieldDefResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *RenameCustomFieldDefBody) Fault() *soap.Fault { return b.Fault_ } + +func RenameCustomFieldDef(ctx context.Context, r soap.RoundTripper, req *types.RenameCustomFieldDef) (*types.RenameCustomFieldDefResponse, error) { + var reqBody, resBody RenameCustomFieldDefBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type RenameCustomizationSpecBody struct { + Req *types.RenameCustomizationSpec `xml:"urn:vim25 RenameCustomizationSpec,omitempty"` + Res *types.RenameCustomizationSpecResponse `xml:"urn:vim25 RenameCustomizationSpecResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *RenameCustomizationSpecBody) Fault() *soap.Fault { return b.Fault_ } + +func RenameCustomizationSpec(ctx context.Context, r soap.RoundTripper, req *types.RenameCustomizationSpec) (*types.RenameCustomizationSpecResponse, error) { + var reqBody, resBody RenameCustomizationSpecBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type RenameDatastoreBody struct { + Req *types.RenameDatastore `xml:"urn:vim25 RenameDatastore,omitempty"` + Res *types.RenameDatastoreResponse `xml:"urn:vim25 RenameDatastoreResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *RenameDatastoreBody) Fault() *soap.Fault { return b.Fault_ } + +func RenameDatastore(ctx context.Context, r soap.RoundTripper, req *types.RenameDatastore) (*types.RenameDatastoreResponse, error) { + var reqBody, resBody RenameDatastoreBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type RenameSnapshotBody struct { + Req *types.RenameSnapshot `xml:"urn:vim25 RenameSnapshot,omitempty"` + Res *types.RenameSnapshotResponse `xml:"urn:vim25 RenameSnapshotResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *RenameSnapshotBody) Fault() *soap.Fault { return b.Fault_ } + +func RenameSnapshot(ctx context.Context, r soap.RoundTripper, req *types.RenameSnapshot) (*types.RenameSnapshotResponse, error) { + var reqBody, resBody RenameSnapshotBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type Rename_TaskBody struct { + Req *types.Rename_Task `xml:"urn:vim25 Rename_Task,omitempty"` + Res *types.Rename_TaskResponse `xml:"urn:vim25 Rename_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *Rename_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func Rename_Task(ctx context.Context, r soap.RoundTripper, req *types.Rename_Task) (*types.Rename_TaskResponse, error) { + var reqBody, resBody Rename_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type ReplaceCACertificatesAndCRLsBody struct { + Req *types.ReplaceCACertificatesAndCRLs `xml:"urn:vim25 ReplaceCACertificatesAndCRLs,omitempty"` + Res *types.ReplaceCACertificatesAndCRLsResponse `xml:"urn:vim25 ReplaceCACertificatesAndCRLsResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *ReplaceCACertificatesAndCRLsBody) Fault() *soap.Fault { return b.Fault_ } + +func ReplaceCACertificatesAndCRLs(ctx context.Context, r soap.RoundTripper, req *types.ReplaceCACertificatesAndCRLs) (*types.ReplaceCACertificatesAndCRLsResponse, error) { + var reqBody, resBody ReplaceCACertificatesAndCRLsBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type ReplaceSmartCardTrustAnchorsBody struct { + Req *types.ReplaceSmartCardTrustAnchors `xml:"urn:vim25 ReplaceSmartCardTrustAnchors,omitempty"` + Res *types.ReplaceSmartCardTrustAnchorsResponse `xml:"urn:vim25 ReplaceSmartCardTrustAnchorsResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *ReplaceSmartCardTrustAnchorsBody) Fault() *soap.Fault { return b.Fault_ } + +func ReplaceSmartCardTrustAnchors(ctx context.Context, r soap.RoundTripper, req *types.ReplaceSmartCardTrustAnchors) (*types.ReplaceSmartCardTrustAnchorsResponse, error) { + var reqBody, resBody ReplaceSmartCardTrustAnchorsBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type RescanAllHbaBody struct { + Req *types.RescanAllHba `xml:"urn:vim25 RescanAllHba,omitempty"` + Res *types.RescanAllHbaResponse `xml:"urn:vim25 RescanAllHbaResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *RescanAllHbaBody) Fault() *soap.Fault { return b.Fault_ } + +func RescanAllHba(ctx context.Context, r soap.RoundTripper, req *types.RescanAllHba) (*types.RescanAllHbaResponse, error) { + var reqBody, resBody RescanAllHbaBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type RescanHbaBody struct { + Req *types.RescanHba `xml:"urn:vim25 RescanHba,omitempty"` + Res *types.RescanHbaResponse `xml:"urn:vim25 RescanHbaResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *RescanHbaBody) Fault() *soap.Fault { return b.Fault_ } + +func RescanHba(ctx context.Context, r soap.RoundTripper, req *types.RescanHba) (*types.RescanHbaResponse, error) { + var reqBody, resBody RescanHbaBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type RescanVffsBody struct { + Req *types.RescanVffs `xml:"urn:vim25 RescanVffs,omitempty"` + Res *types.RescanVffsResponse `xml:"urn:vim25 RescanVffsResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *RescanVffsBody) Fault() *soap.Fault { return b.Fault_ } + +func RescanVffs(ctx context.Context, r soap.RoundTripper, req *types.RescanVffs) (*types.RescanVffsResponse, error) { + var reqBody, resBody RescanVffsBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type RescanVmfsBody struct { + Req *types.RescanVmfs `xml:"urn:vim25 RescanVmfs,omitempty"` + Res *types.RescanVmfsResponse `xml:"urn:vim25 RescanVmfsResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *RescanVmfsBody) Fault() *soap.Fault { return b.Fault_ } + +func RescanVmfs(ctx context.Context, r soap.RoundTripper, req *types.RescanVmfs) (*types.RescanVmfsResponse, error) { + var reqBody, resBody RescanVmfsBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type ResetCollectorBody struct { + Req *types.ResetCollector `xml:"urn:vim25 ResetCollector,omitempty"` + Res *types.ResetCollectorResponse `xml:"urn:vim25 ResetCollectorResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *ResetCollectorBody) Fault() *soap.Fault { return b.Fault_ } + +func ResetCollector(ctx context.Context, r soap.RoundTripper, req *types.ResetCollector) (*types.ResetCollectorResponse, error) { + var reqBody, resBody ResetCollectorBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type ResetCounterLevelMappingBody struct { + Req *types.ResetCounterLevelMapping `xml:"urn:vim25 ResetCounterLevelMapping,omitempty"` + Res *types.ResetCounterLevelMappingResponse `xml:"urn:vim25 ResetCounterLevelMappingResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *ResetCounterLevelMappingBody) Fault() *soap.Fault { return b.Fault_ } + +func ResetCounterLevelMapping(ctx context.Context, r soap.RoundTripper, req *types.ResetCounterLevelMapping) (*types.ResetCounterLevelMappingResponse, error) { + var reqBody, resBody ResetCounterLevelMappingBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type ResetEntityPermissionsBody struct { + Req *types.ResetEntityPermissions `xml:"urn:vim25 ResetEntityPermissions,omitempty"` + Res *types.ResetEntityPermissionsResponse `xml:"urn:vim25 ResetEntityPermissionsResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *ResetEntityPermissionsBody) Fault() *soap.Fault { return b.Fault_ } + +func ResetEntityPermissions(ctx context.Context, r soap.RoundTripper, req *types.ResetEntityPermissions) (*types.ResetEntityPermissionsResponse, error) { + var reqBody, resBody ResetEntityPermissionsBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type ResetFirmwareToFactoryDefaultsBody struct { + Req *types.ResetFirmwareToFactoryDefaults `xml:"urn:vim25 ResetFirmwareToFactoryDefaults,omitempty"` + Res *types.ResetFirmwareToFactoryDefaultsResponse `xml:"urn:vim25 ResetFirmwareToFactoryDefaultsResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *ResetFirmwareToFactoryDefaultsBody) Fault() *soap.Fault { return b.Fault_ } + +func ResetFirmwareToFactoryDefaults(ctx context.Context, r soap.RoundTripper, req *types.ResetFirmwareToFactoryDefaults) (*types.ResetFirmwareToFactoryDefaultsResponse, error) { + var reqBody, resBody ResetFirmwareToFactoryDefaultsBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type ResetGuestInformationBody struct { + Req *types.ResetGuestInformation `xml:"urn:vim25 ResetGuestInformation,omitempty"` + Res *types.ResetGuestInformationResponse `xml:"urn:vim25 ResetGuestInformationResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *ResetGuestInformationBody) Fault() *soap.Fault { return b.Fault_ } + +func ResetGuestInformation(ctx context.Context, r soap.RoundTripper, req *types.ResetGuestInformation) (*types.ResetGuestInformationResponse, error) { + var reqBody, resBody ResetGuestInformationBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type ResetListViewBody struct { + Req *types.ResetListView `xml:"urn:vim25 ResetListView,omitempty"` + Res *types.ResetListViewResponse `xml:"urn:vim25 ResetListViewResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *ResetListViewBody) Fault() *soap.Fault { return b.Fault_ } + +func ResetListView(ctx context.Context, r soap.RoundTripper, req *types.ResetListView) (*types.ResetListViewResponse, error) { + var reqBody, resBody ResetListViewBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type ResetListViewFromViewBody struct { + Req *types.ResetListViewFromView `xml:"urn:vim25 ResetListViewFromView,omitempty"` + Res *types.ResetListViewFromViewResponse `xml:"urn:vim25 ResetListViewFromViewResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *ResetListViewFromViewBody) Fault() *soap.Fault { return b.Fault_ } + +func ResetListViewFromView(ctx context.Context, r soap.RoundTripper, req *types.ResetListViewFromView) (*types.ResetListViewFromViewResponse, error) { + var reqBody, resBody ResetListViewFromViewBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type ResetSystemHealthInfoBody struct { + Req *types.ResetSystemHealthInfo `xml:"urn:vim25 ResetSystemHealthInfo,omitempty"` + Res *types.ResetSystemHealthInfoResponse `xml:"urn:vim25 ResetSystemHealthInfoResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *ResetSystemHealthInfoBody) Fault() *soap.Fault { return b.Fault_ } + +func ResetSystemHealthInfo(ctx context.Context, r soap.RoundTripper, req *types.ResetSystemHealthInfo) (*types.ResetSystemHealthInfoResponse, error) { + var reqBody, resBody ResetSystemHealthInfoBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type ResetVM_TaskBody struct { + Req *types.ResetVM_Task `xml:"urn:vim25 ResetVM_Task,omitempty"` + Res *types.ResetVM_TaskResponse `xml:"urn:vim25 ResetVM_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *ResetVM_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func ResetVM_Task(ctx context.Context, r soap.RoundTripper, req *types.ResetVM_Task) (*types.ResetVM_TaskResponse, error) { + var reqBody, resBody ResetVM_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type ResignatureUnresolvedVmfsVolume_TaskBody struct { + Req *types.ResignatureUnresolvedVmfsVolume_Task `xml:"urn:vim25 ResignatureUnresolvedVmfsVolume_Task,omitempty"` + Res *types.ResignatureUnresolvedVmfsVolume_TaskResponse `xml:"urn:vim25 ResignatureUnresolvedVmfsVolume_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *ResignatureUnresolvedVmfsVolume_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func ResignatureUnresolvedVmfsVolume_Task(ctx context.Context, r soap.RoundTripper, req *types.ResignatureUnresolvedVmfsVolume_Task) (*types.ResignatureUnresolvedVmfsVolume_TaskResponse, error) { + var reqBody, resBody ResignatureUnresolvedVmfsVolume_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type ResolveInstallationErrorsOnCluster_TaskBody struct { + Req *types.ResolveInstallationErrorsOnCluster_Task `xml:"urn:vim25 ResolveInstallationErrorsOnCluster_Task,omitempty"` + Res *types.ResolveInstallationErrorsOnCluster_TaskResponse `xml:"urn:vim25 ResolveInstallationErrorsOnCluster_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *ResolveInstallationErrorsOnCluster_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func ResolveInstallationErrorsOnCluster_Task(ctx context.Context, r soap.RoundTripper, req *types.ResolveInstallationErrorsOnCluster_Task) (*types.ResolveInstallationErrorsOnCluster_TaskResponse, error) { + var reqBody, resBody ResolveInstallationErrorsOnCluster_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type ResolveInstallationErrorsOnHost_TaskBody struct { + Req *types.ResolveInstallationErrorsOnHost_Task `xml:"urn:vim25 ResolveInstallationErrorsOnHost_Task,omitempty"` + Res *types.ResolveInstallationErrorsOnHost_TaskResponse `xml:"urn:vim25 ResolveInstallationErrorsOnHost_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *ResolveInstallationErrorsOnHost_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func ResolveInstallationErrorsOnHost_Task(ctx context.Context, r soap.RoundTripper, req *types.ResolveInstallationErrorsOnHost_Task) (*types.ResolveInstallationErrorsOnHost_TaskResponse, error) { + var reqBody, resBody ResolveInstallationErrorsOnHost_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type ResolveMultipleUnresolvedVmfsVolumesBody struct { + Req *types.ResolveMultipleUnresolvedVmfsVolumes `xml:"urn:vim25 ResolveMultipleUnresolvedVmfsVolumes,omitempty"` + Res *types.ResolveMultipleUnresolvedVmfsVolumesResponse `xml:"urn:vim25 ResolveMultipleUnresolvedVmfsVolumesResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *ResolveMultipleUnresolvedVmfsVolumesBody) Fault() *soap.Fault { return b.Fault_ } + +func ResolveMultipleUnresolvedVmfsVolumes(ctx context.Context, r soap.RoundTripper, req *types.ResolveMultipleUnresolvedVmfsVolumes) (*types.ResolveMultipleUnresolvedVmfsVolumesResponse, error) { + var reqBody, resBody ResolveMultipleUnresolvedVmfsVolumesBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type ResolveMultipleUnresolvedVmfsVolumesEx_TaskBody struct { + Req *types.ResolveMultipleUnresolvedVmfsVolumesEx_Task `xml:"urn:vim25 ResolveMultipleUnresolvedVmfsVolumesEx_Task,omitempty"` + Res *types.ResolveMultipleUnresolvedVmfsVolumesEx_TaskResponse `xml:"urn:vim25 ResolveMultipleUnresolvedVmfsVolumesEx_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *ResolveMultipleUnresolvedVmfsVolumesEx_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func ResolveMultipleUnresolvedVmfsVolumesEx_Task(ctx context.Context, r soap.RoundTripper, req *types.ResolveMultipleUnresolvedVmfsVolumesEx_Task) (*types.ResolveMultipleUnresolvedVmfsVolumesEx_TaskResponse, error) { + var reqBody, resBody ResolveMultipleUnresolvedVmfsVolumesEx_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type RestartServiceBody struct { + Req *types.RestartService `xml:"urn:vim25 RestartService,omitempty"` + Res *types.RestartServiceResponse `xml:"urn:vim25 RestartServiceResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *RestartServiceBody) Fault() *soap.Fault { return b.Fault_ } + +func RestartService(ctx context.Context, r soap.RoundTripper, req *types.RestartService) (*types.RestartServiceResponse, error) { + var reqBody, resBody RestartServiceBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type RestartServiceConsoleVirtualNicBody struct { + Req *types.RestartServiceConsoleVirtualNic `xml:"urn:vim25 RestartServiceConsoleVirtualNic,omitempty"` + Res *types.RestartServiceConsoleVirtualNicResponse `xml:"urn:vim25 RestartServiceConsoleVirtualNicResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *RestartServiceConsoleVirtualNicBody) Fault() *soap.Fault { return b.Fault_ } + +func RestartServiceConsoleVirtualNic(ctx context.Context, r soap.RoundTripper, req *types.RestartServiceConsoleVirtualNic) (*types.RestartServiceConsoleVirtualNicResponse, error) { + var reqBody, resBody RestartServiceConsoleVirtualNicBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type RestoreFirmwareConfigurationBody struct { + Req *types.RestoreFirmwareConfiguration `xml:"urn:vim25 RestoreFirmwareConfiguration,omitempty"` + Res *types.RestoreFirmwareConfigurationResponse `xml:"urn:vim25 RestoreFirmwareConfigurationResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *RestoreFirmwareConfigurationBody) Fault() *soap.Fault { return b.Fault_ } + +func RestoreFirmwareConfiguration(ctx context.Context, r soap.RoundTripper, req *types.RestoreFirmwareConfiguration) (*types.RestoreFirmwareConfigurationResponse, error) { + var reqBody, resBody RestoreFirmwareConfigurationBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type RetrieveAllPermissionsBody struct { + Req *types.RetrieveAllPermissions `xml:"urn:vim25 RetrieveAllPermissions,omitempty"` + Res *types.RetrieveAllPermissionsResponse `xml:"urn:vim25 RetrieveAllPermissionsResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *RetrieveAllPermissionsBody) Fault() *soap.Fault { return b.Fault_ } + +func RetrieveAllPermissions(ctx context.Context, r soap.RoundTripper, req *types.RetrieveAllPermissions) (*types.RetrieveAllPermissionsResponse, error) { + var reqBody, resBody RetrieveAllPermissionsBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type RetrieveAnswerFileBody struct { + Req *types.RetrieveAnswerFile `xml:"urn:vim25 RetrieveAnswerFile,omitempty"` + Res *types.RetrieveAnswerFileResponse `xml:"urn:vim25 RetrieveAnswerFileResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *RetrieveAnswerFileBody) Fault() *soap.Fault { return b.Fault_ } + +func RetrieveAnswerFile(ctx context.Context, r soap.RoundTripper, req *types.RetrieveAnswerFile) (*types.RetrieveAnswerFileResponse, error) { + var reqBody, resBody RetrieveAnswerFileBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type RetrieveAnswerFileForProfileBody struct { + Req *types.RetrieveAnswerFileForProfile `xml:"urn:vim25 RetrieveAnswerFileForProfile,omitempty"` + Res *types.RetrieveAnswerFileForProfileResponse `xml:"urn:vim25 RetrieveAnswerFileForProfileResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *RetrieveAnswerFileForProfileBody) Fault() *soap.Fault { return b.Fault_ } + +func RetrieveAnswerFileForProfile(ctx context.Context, r soap.RoundTripper, req *types.RetrieveAnswerFileForProfile) (*types.RetrieveAnswerFileForProfileResponse, error) { + var reqBody, resBody RetrieveAnswerFileForProfileBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type RetrieveArgumentDescriptionBody struct { + Req *types.RetrieveArgumentDescription `xml:"urn:vim25 RetrieveArgumentDescription,omitempty"` + Res *types.RetrieveArgumentDescriptionResponse `xml:"urn:vim25 RetrieveArgumentDescriptionResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *RetrieveArgumentDescriptionBody) Fault() *soap.Fault { return b.Fault_ } + +func RetrieveArgumentDescription(ctx context.Context, r soap.RoundTripper, req *types.RetrieveArgumentDescription) (*types.RetrieveArgumentDescriptionResponse, error) { + var reqBody, resBody RetrieveArgumentDescriptionBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type RetrieveDasAdvancedRuntimeInfoBody struct { + Req *types.RetrieveDasAdvancedRuntimeInfo `xml:"urn:vim25 RetrieveDasAdvancedRuntimeInfo,omitempty"` + Res *types.RetrieveDasAdvancedRuntimeInfoResponse `xml:"urn:vim25 RetrieveDasAdvancedRuntimeInfoResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *RetrieveDasAdvancedRuntimeInfoBody) Fault() *soap.Fault { return b.Fault_ } + +func RetrieveDasAdvancedRuntimeInfo(ctx context.Context, r soap.RoundTripper, req *types.RetrieveDasAdvancedRuntimeInfo) (*types.RetrieveDasAdvancedRuntimeInfoResponse, error) { + var reqBody, resBody RetrieveDasAdvancedRuntimeInfoBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type RetrieveDescriptionBody struct { + Req *types.RetrieveDescription `xml:"urn:vim25 RetrieveDescription,omitempty"` + Res *types.RetrieveDescriptionResponse `xml:"urn:vim25 RetrieveDescriptionResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *RetrieveDescriptionBody) Fault() *soap.Fault { return b.Fault_ } + +func RetrieveDescription(ctx context.Context, r soap.RoundTripper, req *types.RetrieveDescription) (*types.RetrieveDescriptionResponse, error) { + var reqBody, resBody RetrieveDescriptionBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type RetrieveDiskPartitionInfoBody struct { + Req *types.RetrieveDiskPartitionInfo `xml:"urn:vim25 RetrieveDiskPartitionInfo,omitempty"` + Res *types.RetrieveDiskPartitionInfoResponse `xml:"urn:vim25 RetrieveDiskPartitionInfoResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *RetrieveDiskPartitionInfoBody) Fault() *soap.Fault { return b.Fault_ } + +func RetrieveDiskPartitionInfo(ctx context.Context, r soap.RoundTripper, req *types.RetrieveDiskPartitionInfo) (*types.RetrieveDiskPartitionInfoResponse, error) { + var reqBody, resBody RetrieveDiskPartitionInfoBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type RetrieveEntityPermissionsBody struct { + Req *types.RetrieveEntityPermissions `xml:"urn:vim25 RetrieveEntityPermissions,omitempty"` + Res *types.RetrieveEntityPermissionsResponse `xml:"urn:vim25 RetrieveEntityPermissionsResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *RetrieveEntityPermissionsBody) Fault() *soap.Fault { return b.Fault_ } + +func RetrieveEntityPermissions(ctx context.Context, r soap.RoundTripper, req *types.RetrieveEntityPermissions) (*types.RetrieveEntityPermissionsResponse, error) { + var reqBody, resBody RetrieveEntityPermissionsBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type RetrieveEntityScheduledTaskBody struct { + Req *types.RetrieveEntityScheduledTask `xml:"urn:vim25 RetrieveEntityScheduledTask,omitempty"` + Res *types.RetrieveEntityScheduledTaskResponse `xml:"urn:vim25 RetrieveEntityScheduledTaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *RetrieveEntityScheduledTaskBody) Fault() *soap.Fault { return b.Fault_ } + +func RetrieveEntityScheduledTask(ctx context.Context, r soap.RoundTripper, req *types.RetrieveEntityScheduledTask) (*types.RetrieveEntityScheduledTaskResponse, error) { + var reqBody, resBody RetrieveEntityScheduledTaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type RetrieveHardwareUptimeBody struct { + Req *types.RetrieveHardwareUptime `xml:"urn:vim25 RetrieveHardwareUptime,omitempty"` + Res *types.RetrieveHardwareUptimeResponse `xml:"urn:vim25 RetrieveHardwareUptimeResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *RetrieveHardwareUptimeBody) Fault() *soap.Fault { return b.Fault_ } + +func RetrieveHardwareUptime(ctx context.Context, r soap.RoundTripper, req *types.RetrieveHardwareUptime) (*types.RetrieveHardwareUptimeResponse, error) { + var reqBody, resBody RetrieveHardwareUptimeBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type RetrieveHostAccessControlEntriesBody struct { + Req *types.RetrieveHostAccessControlEntries `xml:"urn:vim25 RetrieveHostAccessControlEntries,omitempty"` + Res *types.RetrieveHostAccessControlEntriesResponse `xml:"urn:vim25 RetrieveHostAccessControlEntriesResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *RetrieveHostAccessControlEntriesBody) Fault() *soap.Fault { return b.Fault_ } + +func RetrieveHostAccessControlEntries(ctx context.Context, r soap.RoundTripper, req *types.RetrieveHostAccessControlEntries) (*types.RetrieveHostAccessControlEntriesResponse, error) { + var reqBody, resBody RetrieveHostAccessControlEntriesBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type RetrieveObjectScheduledTaskBody struct { + Req *types.RetrieveObjectScheduledTask `xml:"urn:vim25 RetrieveObjectScheduledTask,omitempty"` + Res *types.RetrieveObjectScheduledTaskResponse `xml:"urn:vim25 RetrieveObjectScheduledTaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *RetrieveObjectScheduledTaskBody) Fault() *soap.Fault { return b.Fault_ } + +func RetrieveObjectScheduledTask(ctx context.Context, r soap.RoundTripper, req *types.RetrieveObjectScheduledTask) (*types.RetrieveObjectScheduledTaskResponse, error) { + var reqBody, resBody RetrieveObjectScheduledTaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type RetrieveProductComponentsBody struct { + Req *types.RetrieveProductComponents `xml:"urn:vim25 RetrieveProductComponents,omitempty"` + Res *types.RetrieveProductComponentsResponse `xml:"urn:vim25 RetrieveProductComponentsResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *RetrieveProductComponentsBody) Fault() *soap.Fault { return b.Fault_ } + +func RetrieveProductComponents(ctx context.Context, r soap.RoundTripper, req *types.RetrieveProductComponents) (*types.RetrieveProductComponentsResponse, error) { + var reqBody, resBody RetrieveProductComponentsBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type RetrievePropertiesBody struct { + Req *types.RetrieveProperties `xml:"urn:vim25 RetrieveProperties,omitempty"` + Res *types.RetrievePropertiesResponse `xml:"urn:vim25 RetrievePropertiesResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *RetrievePropertiesBody) Fault() *soap.Fault { return b.Fault_ } + +func RetrieveProperties(ctx context.Context, r soap.RoundTripper, req *types.RetrieveProperties) (*types.RetrievePropertiesResponse, error) { + var reqBody, resBody RetrievePropertiesBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type RetrievePropertiesExBody struct { + Req *types.RetrievePropertiesEx `xml:"urn:vim25 RetrievePropertiesEx,omitempty"` + Res *types.RetrievePropertiesExResponse `xml:"urn:vim25 RetrievePropertiesExResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *RetrievePropertiesExBody) Fault() *soap.Fault { return b.Fault_ } + +func RetrievePropertiesEx(ctx context.Context, r soap.RoundTripper, req *types.RetrievePropertiesEx) (*types.RetrievePropertiesExResponse, error) { + var reqBody, resBody RetrievePropertiesExBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type RetrieveRolePermissionsBody struct { + Req *types.RetrieveRolePermissions `xml:"urn:vim25 RetrieveRolePermissions,omitempty"` + Res *types.RetrieveRolePermissionsResponse `xml:"urn:vim25 RetrieveRolePermissionsResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *RetrieveRolePermissionsBody) Fault() *soap.Fault { return b.Fault_ } + +func RetrieveRolePermissions(ctx context.Context, r soap.RoundTripper, req *types.RetrieveRolePermissions) (*types.RetrieveRolePermissionsResponse, error) { + var reqBody, resBody RetrieveRolePermissionsBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type RetrieveServiceContentBody struct { + Req *types.RetrieveServiceContent `xml:"urn:vim25 RetrieveServiceContent,omitempty"` + Res *types.RetrieveServiceContentResponse `xml:"urn:vim25 RetrieveServiceContentResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *RetrieveServiceContentBody) Fault() *soap.Fault { return b.Fault_ } + +func RetrieveServiceContent(ctx context.Context, r soap.RoundTripper, req *types.RetrieveServiceContent) (*types.RetrieveServiceContentResponse, error) { + var reqBody, resBody RetrieveServiceContentBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type RetrieveUserGroupsBody struct { + Req *types.RetrieveUserGroups `xml:"urn:vim25 RetrieveUserGroups,omitempty"` + Res *types.RetrieveUserGroupsResponse `xml:"urn:vim25 RetrieveUserGroupsResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *RetrieveUserGroupsBody) Fault() *soap.Fault { return b.Fault_ } + +func RetrieveUserGroups(ctx context.Context, r soap.RoundTripper, req *types.RetrieveUserGroups) (*types.RetrieveUserGroupsResponse, error) { + var reqBody, resBody RetrieveUserGroupsBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type RevertToCurrentSnapshot_TaskBody struct { + Req *types.RevertToCurrentSnapshot_Task `xml:"urn:vim25 RevertToCurrentSnapshot_Task,omitempty"` + Res *types.RevertToCurrentSnapshot_TaskResponse `xml:"urn:vim25 RevertToCurrentSnapshot_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *RevertToCurrentSnapshot_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func RevertToCurrentSnapshot_Task(ctx context.Context, r soap.RoundTripper, req *types.RevertToCurrentSnapshot_Task) (*types.RevertToCurrentSnapshot_TaskResponse, error) { + var reqBody, resBody RevertToCurrentSnapshot_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type RevertToSnapshot_TaskBody struct { + Req *types.RevertToSnapshot_Task `xml:"urn:vim25 RevertToSnapshot_Task,omitempty"` + Res *types.RevertToSnapshot_TaskResponse `xml:"urn:vim25 RevertToSnapshot_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *RevertToSnapshot_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func RevertToSnapshot_Task(ctx context.Context, r soap.RoundTripper, req *types.RevertToSnapshot_Task) (*types.RevertToSnapshot_TaskResponse, error) { + var reqBody, resBody RevertToSnapshot_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type RewindCollectorBody struct { + Req *types.RewindCollector `xml:"urn:vim25 RewindCollector,omitempty"` + Res *types.RewindCollectorResponse `xml:"urn:vim25 RewindCollectorResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *RewindCollectorBody) Fault() *soap.Fault { return b.Fault_ } + +func RewindCollector(ctx context.Context, r soap.RoundTripper, req *types.RewindCollector) (*types.RewindCollectorResponse, error) { + var reqBody, resBody RewindCollectorBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type RunScheduledTaskBody struct { + Req *types.RunScheduledTask `xml:"urn:vim25 RunScheduledTask,omitempty"` + Res *types.RunScheduledTaskResponse `xml:"urn:vim25 RunScheduledTaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *RunScheduledTaskBody) Fault() *soap.Fault { return b.Fault_ } + +func RunScheduledTask(ctx context.Context, r soap.RoundTripper, req *types.RunScheduledTask) (*types.RunScheduledTaskResponse, error) { + var reqBody, resBody RunScheduledTaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type RunVsanPhysicalDiskDiagnosticsBody struct { + Req *types.RunVsanPhysicalDiskDiagnostics `xml:"urn:vim25 RunVsanPhysicalDiskDiagnostics,omitempty"` + Res *types.RunVsanPhysicalDiskDiagnosticsResponse `xml:"urn:vim25 RunVsanPhysicalDiskDiagnosticsResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *RunVsanPhysicalDiskDiagnosticsBody) Fault() *soap.Fault { return b.Fault_ } + +func RunVsanPhysicalDiskDiagnostics(ctx context.Context, r soap.RoundTripper, req *types.RunVsanPhysicalDiskDiagnostics) (*types.RunVsanPhysicalDiskDiagnosticsResponse, error) { + var reqBody, resBody RunVsanPhysicalDiskDiagnosticsBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type ScanHostPatchV2_TaskBody struct { + Req *types.ScanHostPatchV2_Task `xml:"urn:vim25 ScanHostPatchV2_Task,omitempty"` + Res *types.ScanHostPatchV2_TaskResponse `xml:"urn:vim25 ScanHostPatchV2_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *ScanHostPatchV2_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func ScanHostPatchV2_Task(ctx context.Context, r soap.RoundTripper, req *types.ScanHostPatchV2_Task) (*types.ScanHostPatchV2_TaskResponse, error) { + var reqBody, resBody ScanHostPatchV2_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type ScanHostPatch_TaskBody struct { + Req *types.ScanHostPatch_Task `xml:"urn:vim25 ScanHostPatch_Task,omitempty"` + Res *types.ScanHostPatch_TaskResponse `xml:"urn:vim25 ScanHostPatch_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *ScanHostPatch_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func ScanHostPatch_Task(ctx context.Context, r soap.RoundTripper, req *types.ScanHostPatch_Task) (*types.ScanHostPatch_TaskResponse, error) { + var reqBody, resBody ScanHostPatch_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type SearchDatastoreSubFolders_TaskBody struct { + Req *types.SearchDatastoreSubFolders_Task `xml:"urn:vim25 SearchDatastoreSubFolders_Task,omitempty"` + Res *types.SearchDatastoreSubFolders_TaskResponse `xml:"urn:vim25 SearchDatastoreSubFolders_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *SearchDatastoreSubFolders_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func SearchDatastoreSubFolders_Task(ctx context.Context, r soap.RoundTripper, req *types.SearchDatastoreSubFolders_Task) (*types.SearchDatastoreSubFolders_TaskResponse, error) { + var reqBody, resBody SearchDatastoreSubFolders_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type SearchDatastore_TaskBody struct { + Req *types.SearchDatastore_Task `xml:"urn:vim25 SearchDatastore_Task,omitempty"` + Res *types.SearchDatastore_TaskResponse `xml:"urn:vim25 SearchDatastore_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *SearchDatastore_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func SearchDatastore_Task(ctx context.Context, r soap.RoundTripper, req *types.SearchDatastore_Task) (*types.SearchDatastore_TaskResponse, error) { + var reqBody, resBody SearchDatastore_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type SelectActivePartitionBody struct { + Req *types.SelectActivePartition `xml:"urn:vim25 SelectActivePartition,omitempty"` + Res *types.SelectActivePartitionResponse `xml:"urn:vim25 SelectActivePartitionResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *SelectActivePartitionBody) Fault() *soap.Fault { return b.Fault_ } + +func SelectActivePartition(ctx context.Context, r soap.RoundTripper, req *types.SelectActivePartition) (*types.SelectActivePartitionResponse, error) { + var reqBody, resBody SelectActivePartitionBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type SelectVnicBody struct { + Req *types.SelectVnic `xml:"urn:vim25 SelectVnic,omitempty"` + Res *types.SelectVnicResponse `xml:"urn:vim25 SelectVnicResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *SelectVnicBody) Fault() *soap.Fault { return b.Fault_ } + +func SelectVnic(ctx context.Context, r soap.RoundTripper, req *types.SelectVnic) (*types.SelectVnicResponse, error) { + var reqBody, resBody SelectVnicBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type SelectVnicForNicTypeBody struct { + Req *types.SelectVnicForNicType `xml:"urn:vim25 SelectVnicForNicType,omitempty"` + Res *types.SelectVnicForNicTypeResponse `xml:"urn:vim25 SelectVnicForNicTypeResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *SelectVnicForNicTypeBody) Fault() *soap.Fault { return b.Fault_ } + +func SelectVnicForNicType(ctx context.Context, r soap.RoundTripper, req *types.SelectVnicForNicType) (*types.SelectVnicForNicTypeResponse, error) { + var reqBody, resBody SelectVnicForNicTypeBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type SendNMIBody struct { + Req *types.SendNMI `xml:"urn:vim25 SendNMI,omitempty"` + Res *types.SendNMIResponse `xml:"urn:vim25 SendNMIResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *SendNMIBody) Fault() *soap.Fault { return b.Fault_ } + +func SendNMI(ctx context.Context, r soap.RoundTripper, req *types.SendNMI) (*types.SendNMIResponse, error) { + var reqBody, resBody SendNMIBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type SendTestNotificationBody struct { + Req *types.SendTestNotification `xml:"urn:vim25 SendTestNotification,omitempty"` + Res *types.SendTestNotificationResponse `xml:"urn:vim25 SendTestNotificationResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *SendTestNotificationBody) Fault() *soap.Fault { return b.Fault_ } + +func SendTestNotification(ctx context.Context, r soap.RoundTripper, req *types.SendTestNotification) (*types.SendTestNotificationResponse, error) { + var reqBody, resBody SendTestNotificationBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type SessionIsActiveBody struct { + Req *types.SessionIsActive `xml:"urn:vim25 SessionIsActive,omitempty"` + Res *types.SessionIsActiveResponse `xml:"urn:vim25 SessionIsActiveResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *SessionIsActiveBody) Fault() *soap.Fault { return b.Fault_ } + +func SessionIsActive(ctx context.Context, r soap.RoundTripper, req *types.SessionIsActive) (*types.SessionIsActiveResponse, error) { + var reqBody, resBody SessionIsActiveBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type SetCollectorPageSizeBody struct { + Req *types.SetCollectorPageSize `xml:"urn:vim25 SetCollectorPageSize,omitempty"` + Res *types.SetCollectorPageSizeResponse `xml:"urn:vim25 SetCollectorPageSizeResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *SetCollectorPageSizeBody) Fault() *soap.Fault { return b.Fault_ } + +func SetCollectorPageSize(ctx context.Context, r soap.RoundTripper, req *types.SetCollectorPageSize) (*types.SetCollectorPageSizeResponse, error) { + var reqBody, resBody SetCollectorPageSizeBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type SetDisplayTopologyBody struct { + Req *types.SetDisplayTopology `xml:"urn:vim25 SetDisplayTopology,omitempty"` + Res *types.SetDisplayTopologyResponse `xml:"urn:vim25 SetDisplayTopologyResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *SetDisplayTopologyBody) Fault() *soap.Fault { return b.Fault_ } + +func SetDisplayTopology(ctx context.Context, r soap.RoundTripper, req *types.SetDisplayTopology) (*types.SetDisplayTopologyResponse, error) { + var reqBody, resBody SetDisplayTopologyBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type SetEntityPermissionsBody struct { + Req *types.SetEntityPermissions `xml:"urn:vim25 SetEntityPermissions,omitempty"` + Res *types.SetEntityPermissionsResponse `xml:"urn:vim25 SetEntityPermissionsResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *SetEntityPermissionsBody) Fault() *soap.Fault { return b.Fault_ } + +func SetEntityPermissions(ctx context.Context, r soap.RoundTripper, req *types.SetEntityPermissions) (*types.SetEntityPermissionsResponse, error) { + var reqBody, resBody SetEntityPermissionsBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type SetExtensionCertificateBody struct { + Req *types.SetExtensionCertificate `xml:"urn:vim25 SetExtensionCertificate,omitempty"` + Res *types.SetExtensionCertificateResponse `xml:"urn:vim25 SetExtensionCertificateResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *SetExtensionCertificateBody) Fault() *soap.Fault { return b.Fault_ } + +func SetExtensionCertificate(ctx context.Context, r soap.RoundTripper, req *types.SetExtensionCertificate) (*types.SetExtensionCertificateResponse, error) { + var reqBody, resBody SetExtensionCertificateBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type SetFieldBody struct { + Req *types.SetField `xml:"urn:vim25 SetField,omitempty"` + Res *types.SetFieldResponse `xml:"urn:vim25 SetFieldResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *SetFieldBody) Fault() *soap.Fault { return b.Fault_ } + +func SetField(ctx context.Context, r soap.RoundTripper, req *types.SetField) (*types.SetFieldResponse, error) { + var reqBody, resBody SetFieldBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type SetLicenseEditionBody struct { + Req *types.SetLicenseEdition `xml:"urn:vim25 SetLicenseEdition,omitempty"` + Res *types.SetLicenseEditionResponse `xml:"urn:vim25 SetLicenseEditionResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *SetLicenseEditionBody) Fault() *soap.Fault { return b.Fault_ } + +func SetLicenseEdition(ctx context.Context, r soap.RoundTripper, req *types.SetLicenseEdition) (*types.SetLicenseEditionResponse, error) { + var reqBody, resBody SetLicenseEditionBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type SetLocaleBody struct { + Req *types.SetLocale `xml:"urn:vim25 SetLocale,omitempty"` + Res *types.SetLocaleResponse `xml:"urn:vim25 SetLocaleResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *SetLocaleBody) Fault() *soap.Fault { return b.Fault_ } + +func SetLocale(ctx context.Context, r soap.RoundTripper, req *types.SetLocale) (*types.SetLocaleResponse, error) { + var reqBody, resBody SetLocaleBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type SetMultipathLunPolicyBody struct { + Req *types.SetMultipathLunPolicy `xml:"urn:vim25 SetMultipathLunPolicy,omitempty"` + Res *types.SetMultipathLunPolicyResponse `xml:"urn:vim25 SetMultipathLunPolicyResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *SetMultipathLunPolicyBody) Fault() *soap.Fault { return b.Fault_ } + +func SetMultipathLunPolicy(ctx context.Context, r soap.RoundTripper, req *types.SetMultipathLunPolicy) (*types.SetMultipathLunPolicyResponse, error) { + var reqBody, resBody SetMultipathLunPolicyBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type SetNFSUserBody struct { + Req *types.SetNFSUser `xml:"urn:vim25 SetNFSUser,omitempty"` + Res *types.SetNFSUserResponse `xml:"urn:vim25 SetNFSUserResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *SetNFSUserBody) Fault() *soap.Fault { return b.Fault_ } + +func SetNFSUser(ctx context.Context, r soap.RoundTripper, req *types.SetNFSUser) (*types.SetNFSUserResponse, error) { + var reqBody, resBody SetNFSUserBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type SetPublicKeyBody struct { + Req *types.SetPublicKey `xml:"urn:vim25 SetPublicKey,omitempty"` + Res *types.SetPublicKeyResponse `xml:"urn:vim25 SetPublicKeyResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *SetPublicKeyBody) Fault() *soap.Fault { return b.Fault_ } + +func SetPublicKey(ctx context.Context, r soap.RoundTripper, req *types.SetPublicKey) (*types.SetPublicKeyResponse, error) { + var reqBody, resBody SetPublicKeyBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type SetRegistryValueInGuestBody struct { + Req *types.SetRegistryValueInGuest `xml:"urn:vim25 SetRegistryValueInGuest,omitempty"` + Res *types.SetRegistryValueInGuestResponse `xml:"urn:vim25 SetRegistryValueInGuestResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *SetRegistryValueInGuestBody) Fault() *soap.Fault { return b.Fault_ } + +func SetRegistryValueInGuest(ctx context.Context, r soap.RoundTripper, req *types.SetRegistryValueInGuest) (*types.SetRegistryValueInGuestResponse, error) { + var reqBody, resBody SetRegistryValueInGuestBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type SetScreenResolutionBody struct { + Req *types.SetScreenResolution `xml:"urn:vim25 SetScreenResolution,omitempty"` + Res *types.SetScreenResolutionResponse `xml:"urn:vim25 SetScreenResolutionResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *SetScreenResolutionBody) Fault() *soap.Fault { return b.Fault_ } + +func SetScreenResolution(ctx context.Context, r soap.RoundTripper, req *types.SetScreenResolution) (*types.SetScreenResolutionResponse, error) { + var reqBody, resBody SetScreenResolutionBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type SetTaskDescriptionBody struct { + Req *types.SetTaskDescription `xml:"urn:vim25 SetTaskDescription,omitempty"` + Res *types.SetTaskDescriptionResponse `xml:"urn:vim25 SetTaskDescriptionResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *SetTaskDescriptionBody) Fault() *soap.Fault { return b.Fault_ } + +func SetTaskDescription(ctx context.Context, r soap.RoundTripper, req *types.SetTaskDescription) (*types.SetTaskDescriptionResponse, error) { + var reqBody, resBody SetTaskDescriptionBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type SetTaskStateBody struct { + Req *types.SetTaskState `xml:"urn:vim25 SetTaskState,omitempty"` + Res *types.SetTaskStateResponse `xml:"urn:vim25 SetTaskStateResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *SetTaskStateBody) Fault() *soap.Fault { return b.Fault_ } + +func SetTaskState(ctx context.Context, r soap.RoundTripper, req *types.SetTaskState) (*types.SetTaskStateResponse, error) { + var reqBody, resBody SetTaskStateBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type SetVirtualDiskUuidBody struct { + Req *types.SetVirtualDiskUuid `xml:"urn:vim25 SetVirtualDiskUuid,omitempty"` + Res *types.SetVirtualDiskUuidResponse `xml:"urn:vim25 SetVirtualDiskUuidResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *SetVirtualDiskUuidBody) Fault() *soap.Fault { return b.Fault_ } + +func SetVirtualDiskUuid(ctx context.Context, r soap.RoundTripper, req *types.SetVirtualDiskUuid) (*types.SetVirtualDiskUuidResponse, error) { + var reqBody, resBody SetVirtualDiskUuidBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type ShrinkVirtualDisk_TaskBody struct { + Req *types.ShrinkVirtualDisk_Task `xml:"urn:vim25 ShrinkVirtualDisk_Task,omitempty"` + Res *types.ShrinkVirtualDisk_TaskResponse `xml:"urn:vim25 ShrinkVirtualDisk_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *ShrinkVirtualDisk_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func ShrinkVirtualDisk_Task(ctx context.Context, r soap.RoundTripper, req *types.ShrinkVirtualDisk_Task) (*types.ShrinkVirtualDisk_TaskResponse, error) { + var reqBody, resBody ShrinkVirtualDisk_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type ShutdownGuestBody struct { + Req *types.ShutdownGuest `xml:"urn:vim25 ShutdownGuest,omitempty"` + Res *types.ShutdownGuestResponse `xml:"urn:vim25 ShutdownGuestResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *ShutdownGuestBody) Fault() *soap.Fault { return b.Fault_ } + +func ShutdownGuest(ctx context.Context, r soap.RoundTripper, req *types.ShutdownGuest) (*types.ShutdownGuestResponse, error) { + var reqBody, resBody ShutdownGuestBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type ShutdownHost_TaskBody struct { + Req *types.ShutdownHost_Task `xml:"urn:vim25 ShutdownHost_Task,omitempty"` + Res *types.ShutdownHost_TaskResponse `xml:"urn:vim25 ShutdownHost_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *ShutdownHost_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func ShutdownHost_Task(ctx context.Context, r soap.RoundTripper, req *types.ShutdownHost_Task) (*types.ShutdownHost_TaskResponse, error) { + var reqBody, resBody ShutdownHost_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type StageHostPatch_TaskBody struct { + Req *types.StageHostPatch_Task `xml:"urn:vim25 StageHostPatch_Task,omitempty"` + Res *types.StageHostPatch_TaskResponse `xml:"urn:vim25 StageHostPatch_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *StageHostPatch_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func StageHostPatch_Task(ctx context.Context, r soap.RoundTripper, req *types.StageHostPatch_Task) (*types.StageHostPatch_TaskResponse, error) { + var reqBody, resBody StageHostPatch_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type StampAllRulesWithUuid_TaskBody struct { + Req *types.StampAllRulesWithUuid_Task `xml:"urn:vim25 StampAllRulesWithUuid_Task,omitempty"` + Res *types.StampAllRulesWithUuid_TaskResponse `xml:"urn:vim25 StampAllRulesWithUuid_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *StampAllRulesWithUuid_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func StampAllRulesWithUuid_Task(ctx context.Context, r soap.RoundTripper, req *types.StampAllRulesWithUuid_Task) (*types.StampAllRulesWithUuid_TaskResponse, error) { + var reqBody, resBody StampAllRulesWithUuid_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type StandbyGuestBody struct { + Req *types.StandbyGuest `xml:"urn:vim25 StandbyGuest,omitempty"` + Res *types.StandbyGuestResponse `xml:"urn:vim25 StandbyGuestResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *StandbyGuestBody) Fault() *soap.Fault { return b.Fault_ } + +func StandbyGuest(ctx context.Context, r soap.RoundTripper, req *types.StandbyGuest) (*types.StandbyGuestResponse, error) { + var reqBody, resBody StandbyGuestBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type StartProgramInGuestBody struct { + Req *types.StartProgramInGuest `xml:"urn:vim25 StartProgramInGuest,omitempty"` + Res *types.StartProgramInGuestResponse `xml:"urn:vim25 StartProgramInGuestResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *StartProgramInGuestBody) Fault() *soap.Fault { return b.Fault_ } + +func StartProgramInGuest(ctx context.Context, r soap.RoundTripper, req *types.StartProgramInGuest) (*types.StartProgramInGuestResponse, error) { + var reqBody, resBody StartProgramInGuestBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type StartRecording_TaskBody struct { + Req *types.StartRecording_Task `xml:"urn:vim25 StartRecording_Task,omitempty"` + Res *types.StartRecording_TaskResponse `xml:"urn:vim25 StartRecording_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *StartRecording_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func StartRecording_Task(ctx context.Context, r soap.RoundTripper, req *types.StartRecording_Task) (*types.StartRecording_TaskResponse, error) { + var reqBody, resBody StartRecording_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type StartReplaying_TaskBody struct { + Req *types.StartReplaying_Task `xml:"urn:vim25 StartReplaying_Task,omitempty"` + Res *types.StartReplaying_TaskResponse `xml:"urn:vim25 StartReplaying_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *StartReplaying_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func StartReplaying_Task(ctx context.Context, r soap.RoundTripper, req *types.StartReplaying_Task) (*types.StartReplaying_TaskResponse, error) { + var reqBody, resBody StartReplaying_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type StartServiceBody struct { + Req *types.StartService `xml:"urn:vim25 StartService,omitempty"` + Res *types.StartServiceResponse `xml:"urn:vim25 StartServiceResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *StartServiceBody) Fault() *soap.Fault { return b.Fault_ } + +func StartService(ctx context.Context, r soap.RoundTripper, req *types.StartService) (*types.StartServiceResponse, error) { + var reqBody, resBody StartServiceBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type StopRecording_TaskBody struct { + Req *types.StopRecording_Task `xml:"urn:vim25 StopRecording_Task,omitempty"` + Res *types.StopRecording_TaskResponse `xml:"urn:vim25 StopRecording_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *StopRecording_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func StopRecording_Task(ctx context.Context, r soap.RoundTripper, req *types.StopRecording_Task) (*types.StopRecording_TaskResponse, error) { + var reqBody, resBody StopRecording_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type StopReplaying_TaskBody struct { + Req *types.StopReplaying_Task `xml:"urn:vim25 StopReplaying_Task,omitempty"` + Res *types.StopReplaying_TaskResponse `xml:"urn:vim25 StopReplaying_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *StopReplaying_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func StopReplaying_Task(ctx context.Context, r soap.RoundTripper, req *types.StopReplaying_Task) (*types.StopReplaying_TaskResponse, error) { + var reqBody, resBody StopReplaying_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type StopServiceBody struct { + Req *types.StopService `xml:"urn:vim25 StopService,omitempty"` + Res *types.StopServiceResponse `xml:"urn:vim25 StopServiceResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *StopServiceBody) Fault() *soap.Fault { return b.Fault_ } + +func StopService(ctx context.Context, r soap.RoundTripper, req *types.StopService) (*types.StopServiceResponse, error) { + var reqBody, resBody StopServiceBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type SuspendVApp_TaskBody struct { + Req *types.SuspendVApp_Task `xml:"urn:vim25 SuspendVApp_Task,omitempty"` + Res *types.SuspendVApp_TaskResponse `xml:"urn:vim25 SuspendVApp_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *SuspendVApp_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func SuspendVApp_Task(ctx context.Context, r soap.RoundTripper, req *types.SuspendVApp_Task) (*types.SuspendVApp_TaskResponse, error) { + var reqBody, resBody SuspendVApp_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type SuspendVM_TaskBody struct { + Req *types.SuspendVM_Task `xml:"urn:vim25 SuspendVM_Task,omitempty"` + Res *types.SuspendVM_TaskResponse `xml:"urn:vim25 SuspendVM_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *SuspendVM_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func SuspendVM_Task(ctx context.Context, r soap.RoundTripper, req *types.SuspendVM_Task) (*types.SuspendVM_TaskResponse, error) { + var reqBody, resBody SuspendVM_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type TerminateFaultTolerantVM_TaskBody struct { + Req *types.TerminateFaultTolerantVM_Task `xml:"urn:vim25 TerminateFaultTolerantVM_Task,omitempty"` + Res *types.TerminateFaultTolerantVM_TaskResponse `xml:"urn:vim25 TerminateFaultTolerantVM_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *TerminateFaultTolerantVM_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func TerminateFaultTolerantVM_Task(ctx context.Context, r soap.RoundTripper, req *types.TerminateFaultTolerantVM_Task) (*types.TerminateFaultTolerantVM_TaskResponse, error) { + var reqBody, resBody TerminateFaultTolerantVM_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type TerminateProcessInGuestBody struct { + Req *types.TerminateProcessInGuest `xml:"urn:vim25 TerminateProcessInGuest,omitempty"` + Res *types.TerminateProcessInGuestResponse `xml:"urn:vim25 TerminateProcessInGuestResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *TerminateProcessInGuestBody) Fault() *soap.Fault { return b.Fault_ } + +func TerminateProcessInGuest(ctx context.Context, r soap.RoundTripper, req *types.TerminateProcessInGuest) (*types.TerminateProcessInGuestResponse, error) { + var reqBody, resBody TerminateProcessInGuestBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type TerminateSessionBody struct { + Req *types.TerminateSession `xml:"urn:vim25 TerminateSession,omitempty"` + Res *types.TerminateSessionResponse `xml:"urn:vim25 TerminateSessionResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *TerminateSessionBody) Fault() *soap.Fault { return b.Fault_ } + +func TerminateSession(ctx context.Context, r soap.RoundTripper, req *types.TerminateSession) (*types.TerminateSessionResponse, error) { + var reqBody, resBody TerminateSessionBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type TerminateVMBody struct { + Req *types.TerminateVM `xml:"urn:vim25 TerminateVM,omitempty"` + Res *types.TerminateVMResponse `xml:"urn:vim25 TerminateVMResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *TerminateVMBody) Fault() *soap.Fault { return b.Fault_ } + +func TerminateVM(ctx context.Context, r soap.RoundTripper, req *types.TerminateVM) (*types.TerminateVMResponse, error) { + var reqBody, resBody TerminateVMBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type TurnDiskLocatorLedOff_TaskBody struct { + Req *types.TurnDiskLocatorLedOff_Task `xml:"urn:vim25 TurnDiskLocatorLedOff_Task,omitempty"` + Res *types.TurnDiskLocatorLedOff_TaskResponse `xml:"urn:vim25 TurnDiskLocatorLedOff_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *TurnDiskLocatorLedOff_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func TurnDiskLocatorLedOff_Task(ctx context.Context, r soap.RoundTripper, req *types.TurnDiskLocatorLedOff_Task) (*types.TurnDiskLocatorLedOff_TaskResponse, error) { + var reqBody, resBody TurnDiskLocatorLedOff_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type TurnDiskLocatorLedOn_TaskBody struct { + Req *types.TurnDiskLocatorLedOn_Task `xml:"urn:vim25 TurnDiskLocatorLedOn_Task,omitempty"` + Res *types.TurnDiskLocatorLedOn_TaskResponse `xml:"urn:vim25 TurnDiskLocatorLedOn_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *TurnDiskLocatorLedOn_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func TurnDiskLocatorLedOn_Task(ctx context.Context, r soap.RoundTripper, req *types.TurnDiskLocatorLedOn_Task) (*types.TurnDiskLocatorLedOn_TaskResponse, error) { + var reqBody, resBody TurnDiskLocatorLedOn_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type TurnOffFaultToleranceForVM_TaskBody struct { + Req *types.TurnOffFaultToleranceForVM_Task `xml:"urn:vim25 TurnOffFaultToleranceForVM_Task,omitempty"` + Res *types.TurnOffFaultToleranceForVM_TaskResponse `xml:"urn:vim25 TurnOffFaultToleranceForVM_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *TurnOffFaultToleranceForVM_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func TurnOffFaultToleranceForVM_Task(ctx context.Context, r soap.RoundTripper, req *types.TurnOffFaultToleranceForVM_Task) (*types.TurnOffFaultToleranceForVM_TaskResponse, error) { + var reqBody, resBody TurnOffFaultToleranceForVM_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type UnassignUserFromGroupBody struct { + Req *types.UnassignUserFromGroup `xml:"urn:vim25 UnassignUserFromGroup,omitempty"` + Res *types.UnassignUserFromGroupResponse `xml:"urn:vim25 UnassignUserFromGroupResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *UnassignUserFromGroupBody) Fault() *soap.Fault { return b.Fault_ } + +func UnassignUserFromGroup(ctx context.Context, r soap.RoundTripper, req *types.UnassignUserFromGroup) (*types.UnassignUserFromGroupResponse, error) { + var reqBody, resBody UnassignUserFromGroupBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type UnbindVnicBody struct { + Req *types.UnbindVnic `xml:"urn:vim25 UnbindVnic,omitempty"` + Res *types.UnbindVnicResponse `xml:"urn:vim25 UnbindVnicResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *UnbindVnicBody) Fault() *soap.Fault { return b.Fault_ } + +func UnbindVnic(ctx context.Context, r soap.RoundTripper, req *types.UnbindVnic) (*types.UnbindVnicResponse, error) { + var reqBody, resBody UnbindVnicBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type UninstallHostPatch_TaskBody struct { + Req *types.UninstallHostPatch_Task `xml:"urn:vim25 UninstallHostPatch_Task,omitempty"` + Res *types.UninstallHostPatch_TaskResponse `xml:"urn:vim25 UninstallHostPatch_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *UninstallHostPatch_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func UninstallHostPatch_Task(ctx context.Context, r soap.RoundTripper, req *types.UninstallHostPatch_Task) (*types.UninstallHostPatch_TaskResponse, error) { + var reqBody, resBody UninstallHostPatch_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type UninstallIoFilter_TaskBody struct { + Req *types.UninstallIoFilter_Task `xml:"urn:vim25 UninstallIoFilter_Task,omitempty"` + Res *types.UninstallIoFilter_TaskResponse `xml:"urn:vim25 UninstallIoFilter_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *UninstallIoFilter_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func UninstallIoFilter_Task(ctx context.Context, r soap.RoundTripper, req *types.UninstallIoFilter_Task) (*types.UninstallIoFilter_TaskResponse, error) { + var reqBody, resBody UninstallIoFilter_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type UninstallServiceBody struct { + Req *types.UninstallService `xml:"urn:vim25 UninstallService,omitempty"` + Res *types.UninstallServiceResponse `xml:"urn:vim25 UninstallServiceResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *UninstallServiceBody) Fault() *soap.Fault { return b.Fault_ } + +func UninstallService(ctx context.Context, r soap.RoundTripper, req *types.UninstallService) (*types.UninstallServiceResponse, error) { + var reqBody, resBody UninstallServiceBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type UnmapVmfsVolumeEx_TaskBody struct { + Req *types.UnmapVmfsVolumeEx_Task `xml:"urn:vim25 UnmapVmfsVolumeEx_Task,omitempty"` + Res *types.UnmapVmfsVolumeEx_TaskResponse `xml:"urn:vim25 UnmapVmfsVolumeEx_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *UnmapVmfsVolumeEx_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func UnmapVmfsVolumeEx_Task(ctx context.Context, r soap.RoundTripper, req *types.UnmapVmfsVolumeEx_Task) (*types.UnmapVmfsVolumeEx_TaskResponse, error) { + var reqBody, resBody UnmapVmfsVolumeEx_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type UnmountDiskMapping_TaskBody struct { + Req *types.UnmountDiskMapping_Task `xml:"urn:vim25 UnmountDiskMapping_Task,omitempty"` + Res *types.UnmountDiskMapping_TaskResponse `xml:"urn:vim25 UnmountDiskMapping_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *UnmountDiskMapping_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func UnmountDiskMapping_Task(ctx context.Context, r soap.RoundTripper, req *types.UnmountDiskMapping_Task) (*types.UnmountDiskMapping_TaskResponse, error) { + var reqBody, resBody UnmountDiskMapping_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type UnmountForceMountedVmfsVolumeBody struct { + Req *types.UnmountForceMountedVmfsVolume `xml:"urn:vim25 UnmountForceMountedVmfsVolume,omitempty"` + Res *types.UnmountForceMountedVmfsVolumeResponse `xml:"urn:vim25 UnmountForceMountedVmfsVolumeResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *UnmountForceMountedVmfsVolumeBody) Fault() *soap.Fault { return b.Fault_ } + +func UnmountForceMountedVmfsVolume(ctx context.Context, r soap.RoundTripper, req *types.UnmountForceMountedVmfsVolume) (*types.UnmountForceMountedVmfsVolumeResponse, error) { + var reqBody, resBody UnmountForceMountedVmfsVolumeBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type UnmountToolsInstallerBody struct { + Req *types.UnmountToolsInstaller `xml:"urn:vim25 UnmountToolsInstaller,omitempty"` + Res *types.UnmountToolsInstallerResponse `xml:"urn:vim25 UnmountToolsInstallerResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *UnmountToolsInstallerBody) Fault() *soap.Fault { return b.Fault_ } + +func UnmountToolsInstaller(ctx context.Context, r soap.RoundTripper, req *types.UnmountToolsInstaller) (*types.UnmountToolsInstallerResponse, error) { + var reqBody, resBody UnmountToolsInstallerBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type UnmountVffsVolumeBody struct { + Req *types.UnmountVffsVolume `xml:"urn:vim25 UnmountVffsVolume,omitempty"` + Res *types.UnmountVffsVolumeResponse `xml:"urn:vim25 UnmountVffsVolumeResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *UnmountVffsVolumeBody) Fault() *soap.Fault { return b.Fault_ } + +func UnmountVffsVolume(ctx context.Context, r soap.RoundTripper, req *types.UnmountVffsVolume) (*types.UnmountVffsVolumeResponse, error) { + var reqBody, resBody UnmountVffsVolumeBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type UnmountVmfsVolumeBody struct { + Req *types.UnmountVmfsVolume `xml:"urn:vim25 UnmountVmfsVolume,omitempty"` + Res *types.UnmountVmfsVolumeResponse `xml:"urn:vim25 UnmountVmfsVolumeResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *UnmountVmfsVolumeBody) Fault() *soap.Fault { return b.Fault_ } + +func UnmountVmfsVolume(ctx context.Context, r soap.RoundTripper, req *types.UnmountVmfsVolume) (*types.UnmountVmfsVolumeResponse, error) { + var reqBody, resBody UnmountVmfsVolumeBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type UnmountVmfsVolumeEx_TaskBody struct { + Req *types.UnmountVmfsVolumeEx_Task `xml:"urn:vim25 UnmountVmfsVolumeEx_Task,omitempty"` + Res *types.UnmountVmfsVolumeEx_TaskResponse `xml:"urn:vim25 UnmountVmfsVolumeEx_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *UnmountVmfsVolumeEx_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func UnmountVmfsVolumeEx_Task(ctx context.Context, r soap.RoundTripper, req *types.UnmountVmfsVolumeEx_Task) (*types.UnmountVmfsVolumeEx_TaskResponse, error) { + var reqBody, resBody UnmountVmfsVolumeEx_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type UnregisterAndDestroy_TaskBody struct { + Req *types.UnregisterAndDestroy_Task `xml:"urn:vim25 UnregisterAndDestroy_Task,omitempty"` + Res *types.UnregisterAndDestroy_TaskResponse `xml:"urn:vim25 UnregisterAndDestroy_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *UnregisterAndDestroy_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func UnregisterAndDestroy_Task(ctx context.Context, r soap.RoundTripper, req *types.UnregisterAndDestroy_Task) (*types.UnregisterAndDestroy_TaskResponse, error) { + var reqBody, resBody UnregisterAndDestroy_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type UnregisterExtensionBody struct { + Req *types.UnregisterExtension `xml:"urn:vim25 UnregisterExtension,omitempty"` + Res *types.UnregisterExtensionResponse `xml:"urn:vim25 UnregisterExtensionResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *UnregisterExtensionBody) Fault() *soap.Fault { return b.Fault_ } + +func UnregisterExtension(ctx context.Context, r soap.RoundTripper, req *types.UnregisterExtension) (*types.UnregisterExtensionResponse, error) { + var reqBody, resBody UnregisterExtensionBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type UnregisterVMBody struct { + Req *types.UnregisterVM `xml:"urn:vim25 UnregisterVM,omitempty"` + Res *types.UnregisterVMResponse `xml:"urn:vim25 UnregisterVMResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *UnregisterVMBody) Fault() *soap.Fault { return b.Fault_ } + +func UnregisterVM(ctx context.Context, r soap.RoundTripper, req *types.UnregisterVM) (*types.UnregisterVMResponse, error) { + var reqBody, resBody UnregisterVMBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type UpdateAnswerFile_TaskBody struct { + Req *types.UpdateAnswerFile_Task `xml:"urn:vim25 UpdateAnswerFile_Task,omitempty"` + Res *types.UpdateAnswerFile_TaskResponse `xml:"urn:vim25 UpdateAnswerFile_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *UpdateAnswerFile_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func UpdateAnswerFile_Task(ctx context.Context, r soap.RoundTripper, req *types.UpdateAnswerFile_Task) (*types.UpdateAnswerFile_TaskResponse, error) { + var reqBody, resBody UpdateAnswerFile_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type UpdateAssignedLicenseBody struct { + Req *types.UpdateAssignedLicense `xml:"urn:vim25 UpdateAssignedLicense,omitempty"` + Res *types.UpdateAssignedLicenseResponse `xml:"urn:vim25 UpdateAssignedLicenseResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *UpdateAssignedLicenseBody) Fault() *soap.Fault { return b.Fault_ } + +func UpdateAssignedLicense(ctx context.Context, r soap.RoundTripper, req *types.UpdateAssignedLicense) (*types.UpdateAssignedLicenseResponse, error) { + var reqBody, resBody UpdateAssignedLicenseBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type UpdateAuthorizationRoleBody struct { + Req *types.UpdateAuthorizationRole `xml:"urn:vim25 UpdateAuthorizationRole,omitempty"` + Res *types.UpdateAuthorizationRoleResponse `xml:"urn:vim25 UpdateAuthorizationRoleResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *UpdateAuthorizationRoleBody) Fault() *soap.Fault { return b.Fault_ } + +func UpdateAuthorizationRole(ctx context.Context, r soap.RoundTripper, req *types.UpdateAuthorizationRole) (*types.UpdateAuthorizationRoleResponse, error) { + var reqBody, resBody UpdateAuthorizationRoleBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type UpdateBootDeviceBody struct { + Req *types.UpdateBootDevice `xml:"urn:vim25 UpdateBootDevice,omitempty"` + Res *types.UpdateBootDeviceResponse `xml:"urn:vim25 UpdateBootDeviceResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *UpdateBootDeviceBody) Fault() *soap.Fault { return b.Fault_ } + +func UpdateBootDevice(ctx context.Context, r soap.RoundTripper, req *types.UpdateBootDevice) (*types.UpdateBootDeviceResponse, error) { + var reqBody, resBody UpdateBootDeviceBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type UpdateChildResourceConfigurationBody struct { + Req *types.UpdateChildResourceConfiguration `xml:"urn:vim25 UpdateChildResourceConfiguration,omitempty"` + Res *types.UpdateChildResourceConfigurationResponse `xml:"urn:vim25 UpdateChildResourceConfigurationResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *UpdateChildResourceConfigurationBody) Fault() *soap.Fault { return b.Fault_ } + +func UpdateChildResourceConfiguration(ctx context.Context, r soap.RoundTripper, req *types.UpdateChildResourceConfiguration) (*types.UpdateChildResourceConfigurationResponse, error) { + var reqBody, resBody UpdateChildResourceConfigurationBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type UpdateClusterProfileBody struct { + Req *types.UpdateClusterProfile `xml:"urn:vim25 UpdateClusterProfile,omitempty"` + Res *types.UpdateClusterProfileResponse `xml:"urn:vim25 UpdateClusterProfileResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *UpdateClusterProfileBody) Fault() *soap.Fault { return b.Fault_ } + +func UpdateClusterProfile(ctx context.Context, r soap.RoundTripper, req *types.UpdateClusterProfile) (*types.UpdateClusterProfileResponse, error) { + var reqBody, resBody UpdateClusterProfileBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type UpdateConfigBody struct { + Req *types.UpdateConfig `xml:"urn:vim25 UpdateConfig,omitempty"` + Res *types.UpdateConfigResponse `xml:"urn:vim25 UpdateConfigResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *UpdateConfigBody) Fault() *soap.Fault { return b.Fault_ } + +func UpdateConfig(ctx context.Context, r soap.RoundTripper, req *types.UpdateConfig) (*types.UpdateConfigResponse, error) { + var reqBody, resBody UpdateConfigBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type UpdateConsoleIpRouteConfigBody struct { + Req *types.UpdateConsoleIpRouteConfig `xml:"urn:vim25 UpdateConsoleIpRouteConfig,omitempty"` + Res *types.UpdateConsoleIpRouteConfigResponse `xml:"urn:vim25 UpdateConsoleIpRouteConfigResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *UpdateConsoleIpRouteConfigBody) Fault() *soap.Fault { return b.Fault_ } + +func UpdateConsoleIpRouteConfig(ctx context.Context, r soap.RoundTripper, req *types.UpdateConsoleIpRouteConfig) (*types.UpdateConsoleIpRouteConfigResponse, error) { + var reqBody, resBody UpdateConsoleIpRouteConfigBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type UpdateCounterLevelMappingBody struct { + Req *types.UpdateCounterLevelMapping `xml:"urn:vim25 UpdateCounterLevelMapping,omitempty"` + Res *types.UpdateCounterLevelMappingResponse `xml:"urn:vim25 UpdateCounterLevelMappingResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *UpdateCounterLevelMappingBody) Fault() *soap.Fault { return b.Fault_ } + +func UpdateCounterLevelMapping(ctx context.Context, r soap.RoundTripper, req *types.UpdateCounterLevelMapping) (*types.UpdateCounterLevelMappingResponse, error) { + var reqBody, resBody UpdateCounterLevelMappingBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type UpdateDVSHealthCheckConfig_TaskBody struct { + Req *types.UpdateDVSHealthCheckConfig_Task `xml:"urn:vim25 UpdateDVSHealthCheckConfig_Task,omitempty"` + Res *types.UpdateDVSHealthCheckConfig_TaskResponse `xml:"urn:vim25 UpdateDVSHealthCheckConfig_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *UpdateDVSHealthCheckConfig_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func UpdateDVSHealthCheckConfig_Task(ctx context.Context, r soap.RoundTripper, req *types.UpdateDVSHealthCheckConfig_Task) (*types.UpdateDVSHealthCheckConfig_TaskResponse, error) { + var reqBody, resBody UpdateDVSHealthCheckConfig_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type UpdateDVSLacpGroupConfig_TaskBody struct { + Req *types.UpdateDVSLacpGroupConfig_Task `xml:"urn:vim25 UpdateDVSLacpGroupConfig_Task,omitempty"` + Res *types.UpdateDVSLacpGroupConfig_TaskResponse `xml:"urn:vim25 UpdateDVSLacpGroupConfig_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *UpdateDVSLacpGroupConfig_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func UpdateDVSLacpGroupConfig_Task(ctx context.Context, r soap.RoundTripper, req *types.UpdateDVSLacpGroupConfig_Task) (*types.UpdateDVSLacpGroupConfig_TaskResponse, error) { + var reqBody, resBody UpdateDVSLacpGroupConfig_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type UpdateDateTimeBody struct { + Req *types.UpdateDateTime `xml:"urn:vim25 UpdateDateTime,omitempty"` + Res *types.UpdateDateTimeResponse `xml:"urn:vim25 UpdateDateTimeResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *UpdateDateTimeBody) Fault() *soap.Fault { return b.Fault_ } + +func UpdateDateTime(ctx context.Context, r soap.RoundTripper, req *types.UpdateDateTime) (*types.UpdateDateTimeResponse, error) { + var reqBody, resBody UpdateDateTimeBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type UpdateDateTimeConfigBody struct { + Req *types.UpdateDateTimeConfig `xml:"urn:vim25 UpdateDateTimeConfig,omitempty"` + Res *types.UpdateDateTimeConfigResponse `xml:"urn:vim25 UpdateDateTimeConfigResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *UpdateDateTimeConfigBody) Fault() *soap.Fault { return b.Fault_ } + +func UpdateDateTimeConfig(ctx context.Context, r soap.RoundTripper, req *types.UpdateDateTimeConfig) (*types.UpdateDateTimeConfigResponse, error) { + var reqBody, resBody UpdateDateTimeConfigBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type UpdateDefaultPolicyBody struct { + Req *types.UpdateDefaultPolicy `xml:"urn:vim25 UpdateDefaultPolicy,omitempty"` + Res *types.UpdateDefaultPolicyResponse `xml:"urn:vim25 UpdateDefaultPolicyResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *UpdateDefaultPolicyBody) Fault() *soap.Fault { return b.Fault_ } + +func UpdateDefaultPolicy(ctx context.Context, r soap.RoundTripper, req *types.UpdateDefaultPolicy) (*types.UpdateDefaultPolicyResponse, error) { + var reqBody, resBody UpdateDefaultPolicyBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type UpdateDiskPartitionsBody struct { + Req *types.UpdateDiskPartitions `xml:"urn:vim25 UpdateDiskPartitions,omitempty"` + Res *types.UpdateDiskPartitionsResponse `xml:"urn:vim25 UpdateDiskPartitionsResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *UpdateDiskPartitionsBody) Fault() *soap.Fault { return b.Fault_ } + +func UpdateDiskPartitions(ctx context.Context, r soap.RoundTripper, req *types.UpdateDiskPartitions) (*types.UpdateDiskPartitionsResponse, error) { + var reqBody, resBody UpdateDiskPartitionsBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type UpdateDnsConfigBody struct { + Req *types.UpdateDnsConfig `xml:"urn:vim25 UpdateDnsConfig,omitempty"` + Res *types.UpdateDnsConfigResponse `xml:"urn:vim25 UpdateDnsConfigResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *UpdateDnsConfigBody) Fault() *soap.Fault { return b.Fault_ } + +func UpdateDnsConfig(ctx context.Context, r soap.RoundTripper, req *types.UpdateDnsConfig) (*types.UpdateDnsConfigResponse, error) { + var reqBody, resBody UpdateDnsConfigBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type UpdateDvsCapabilityBody struct { + Req *types.UpdateDvsCapability `xml:"urn:vim25 UpdateDvsCapability,omitempty"` + Res *types.UpdateDvsCapabilityResponse `xml:"urn:vim25 UpdateDvsCapabilityResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *UpdateDvsCapabilityBody) Fault() *soap.Fault { return b.Fault_ } + +func UpdateDvsCapability(ctx context.Context, r soap.RoundTripper, req *types.UpdateDvsCapability) (*types.UpdateDvsCapabilityResponse, error) { + var reqBody, resBody UpdateDvsCapabilityBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type UpdateExtensionBody struct { + Req *types.UpdateExtension `xml:"urn:vim25 UpdateExtension,omitempty"` + Res *types.UpdateExtensionResponse `xml:"urn:vim25 UpdateExtensionResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *UpdateExtensionBody) Fault() *soap.Fault { return b.Fault_ } + +func UpdateExtension(ctx context.Context, r soap.RoundTripper, req *types.UpdateExtension) (*types.UpdateExtensionResponse, error) { + var reqBody, resBody UpdateExtensionBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type UpdateFlagsBody struct { + Req *types.UpdateFlags `xml:"urn:vim25 UpdateFlags,omitempty"` + Res *types.UpdateFlagsResponse `xml:"urn:vim25 UpdateFlagsResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *UpdateFlagsBody) Fault() *soap.Fault { return b.Fault_ } + +func UpdateFlags(ctx context.Context, r soap.RoundTripper, req *types.UpdateFlags) (*types.UpdateFlagsResponse, error) { + var reqBody, resBody UpdateFlagsBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type UpdateHostImageAcceptanceLevelBody struct { + Req *types.UpdateHostImageAcceptanceLevel `xml:"urn:vim25 UpdateHostImageAcceptanceLevel,omitempty"` + Res *types.UpdateHostImageAcceptanceLevelResponse `xml:"urn:vim25 UpdateHostImageAcceptanceLevelResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *UpdateHostImageAcceptanceLevelBody) Fault() *soap.Fault { return b.Fault_ } + +func UpdateHostImageAcceptanceLevel(ctx context.Context, r soap.RoundTripper, req *types.UpdateHostImageAcceptanceLevel) (*types.UpdateHostImageAcceptanceLevelResponse, error) { + var reqBody, resBody UpdateHostImageAcceptanceLevelBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type UpdateHostProfileBody struct { + Req *types.UpdateHostProfile `xml:"urn:vim25 UpdateHostProfile,omitempty"` + Res *types.UpdateHostProfileResponse `xml:"urn:vim25 UpdateHostProfileResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *UpdateHostProfileBody) Fault() *soap.Fault { return b.Fault_ } + +func UpdateHostProfile(ctx context.Context, r soap.RoundTripper, req *types.UpdateHostProfile) (*types.UpdateHostProfileResponse, error) { + var reqBody, resBody UpdateHostProfileBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type UpdateInternetScsiAdvancedOptionsBody struct { + Req *types.UpdateInternetScsiAdvancedOptions `xml:"urn:vim25 UpdateInternetScsiAdvancedOptions,omitempty"` + Res *types.UpdateInternetScsiAdvancedOptionsResponse `xml:"urn:vim25 UpdateInternetScsiAdvancedOptionsResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *UpdateInternetScsiAdvancedOptionsBody) Fault() *soap.Fault { return b.Fault_ } + +func UpdateInternetScsiAdvancedOptions(ctx context.Context, r soap.RoundTripper, req *types.UpdateInternetScsiAdvancedOptions) (*types.UpdateInternetScsiAdvancedOptionsResponse, error) { + var reqBody, resBody UpdateInternetScsiAdvancedOptionsBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type UpdateInternetScsiAliasBody struct { + Req *types.UpdateInternetScsiAlias `xml:"urn:vim25 UpdateInternetScsiAlias,omitempty"` + Res *types.UpdateInternetScsiAliasResponse `xml:"urn:vim25 UpdateInternetScsiAliasResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *UpdateInternetScsiAliasBody) Fault() *soap.Fault { return b.Fault_ } + +func UpdateInternetScsiAlias(ctx context.Context, r soap.RoundTripper, req *types.UpdateInternetScsiAlias) (*types.UpdateInternetScsiAliasResponse, error) { + var reqBody, resBody UpdateInternetScsiAliasBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type UpdateInternetScsiAuthenticationPropertiesBody struct { + Req *types.UpdateInternetScsiAuthenticationProperties `xml:"urn:vim25 UpdateInternetScsiAuthenticationProperties,omitempty"` + Res *types.UpdateInternetScsiAuthenticationPropertiesResponse `xml:"urn:vim25 UpdateInternetScsiAuthenticationPropertiesResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *UpdateInternetScsiAuthenticationPropertiesBody) Fault() *soap.Fault { return b.Fault_ } + +func UpdateInternetScsiAuthenticationProperties(ctx context.Context, r soap.RoundTripper, req *types.UpdateInternetScsiAuthenticationProperties) (*types.UpdateInternetScsiAuthenticationPropertiesResponse, error) { + var reqBody, resBody UpdateInternetScsiAuthenticationPropertiesBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type UpdateInternetScsiDigestPropertiesBody struct { + Req *types.UpdateInternetScsiDigestProperties `xml:"urn:vim25 UpdateInternetScsiDigestProperties,omitempty"` + Res *types.UpdateInternetScsiDigestPropertiesResponse `xml:"urn:vim25 UpdateInternetScsiDigestPropertiesResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *UpdateInternetScsiDigestPropertiesBody) Fault() *soap.Fault { return b.Fault_ } + +func UpdateInternetScsiDigestProperties(ctx context.Context, r soap.RoundTripper, req *types.UpdateInternetScsiDigestProperties) (*types.UpdateInternetScsiDigestPropertiesResponse, error) { + var reqBody, resBody UpdateInternetScsiDigestPropertiesBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type UpdateInternetScsiDiscoveryPropertiesBody struct { + Req *types.UpdateInternetScsiDiscoveryProperties `xml:"urn:vim25 UpdateInternetScsiDiscoveryProperties,omitempty"` + Res *types.UpdateInternetScsiDiscoveryPropertiesResponse `xml:"urn:vim25 UpdateInternetScsiDiscoveryPropertiesResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *UpdateInternetScsiDiscoveryPropertiesBody) Fault() *soap.Fault { return b.Fault_ } + +func UpdateInternetScsiDiscoveryProperties(ctx context.Context, r soap.RoundTripper, req *types.UpdateInternetScsiDiscoveryProperties) (*types.UpdateInternetScsiDiscoveryPropertiesResponse, error) { + var reqBody, resBody UpdateInternetScsiDiscoveryPropertiesBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type UpdateInternetScsiIPPropertiesBody struct { + Req *types.UpdateInternetScsiIPProperties `xml:"urn:vim25 UpdateInternetScsiIPProperties,omitempty"` + Res *types.UpdateInternetScsiIPPropertiesResponse `xml:"urn:vim25 UpdateInternetScsiIPPropertiesResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *UpdateInternetScsiIPPropertiesBody) Fault() *soap.Fault { return b.Fault_ } + +func UpdateInternetScsiIPProperties(ctx context.Context, r soap.RoundTripper, req *types.UpdateInternetScsiIPProperties) (*types.UpdateInternetScsiIPPropertiesResponse, error) { + var reqBody, resBody UpdateInternetScsiIPPropertiesBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type UpdateInternetScsiNameBody struct { + Req *types.UpdateInternetScsiName `xml:"urn:vim25 UpdateInternetScsiName,omitempty"` + Res *types.UpdateInternetScsiNameResponse `xml:"urn:vim25 UpdateInternetScsiNameResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *UpdateInternetScsiNameBody) Fault() *soap.Fault { return b.Fault_ } + +func UpdateInternetScsiName(ctx context.Context, r soap.RoundTripper, req *types.UpdateInternetScsiName) (*types.UpdateInternetScsiNameResponse, error) { + var reqBody, resBody UpdateInternetScsiNameBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type UpdateIpConfigBody struct { + Req *types.UpdateIpConfig `xml:"urn:vim25 UpdateIpConfig,omitempty"` + Res *types.UpdateIpConfigResponse `xml:"urn:vim25 UpdateIpConfigResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *UpdateIpConfigBody) Fault() *soap.Fault { return b.Fault_ } + +func UpdateIpConfig(ctx context.Context, r soap.RoundTripper, req *types.UpdateIpConfig) (*types.UpdateIpConfigResponse, error) { + var reqBody, resBody UpdateIpConfigBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type UpdateIpPoolBody struct { + Req *types.UpdateIpPool `xml:"urn:vim25 UpdateIpPool,omitempty"` + Res *types.UpdateIpPoolResponse `xml:"urn:vim25 UpdateIpPoolResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *UpdateIpPoolBody) Fault() *soap.Fault { return b.Fault_ } + +func UpdateIpPool(ctx context.Context, r soap.RoundTripper, req *types.UpdateIpPool) (*types.UpdateIpPoolResponse, error) { + var reqBody, resBody UpdateIpPoolBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type UpdateIpRouteConfigBody struct { + Req *types.UpdateIpRouteConfig `xml:"urn:vim25 UpdateIpRouteConfig,omitempty"` + Res *types.UpdateIpRouteConfigResponse `xml:"urn:vim25 UpdateIpRouteConfigResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *UpdateIpRouteConfigBody) Fault() *soap.Fault { return b.Fault_ } + +func UpdateIpRouteConfig(ctx context.Context, r soap.RoundTripper, req *types.UpdateIpRouteConfig) (*types.UpdateIpRouteConfigResponse, error) { + var reqBody, resBody UpdateIpRouteConfigBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type UpdateIpRouteTableConfigBody struct { + Req *types.UpdateIpRouteTableConfig `xml:"urn:vim25 UpdateIpRouteTableConfig,omitempty"` + Res *types.UpdateIpRouteTableConfigResponse `xml:"urn:vim25 UpdateIpRouteTableConfigResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *UpdateIpRouteTableConfigBody) Fault() *soap.Fault { return b.Fault_ } + +func UpdateIpRouteTableConfig(ctx context.Context, r soap.RoundTripper, req *types.UpdateIpRouteTableConfig) (*types.UpdateIpRouteTableConfigResponse, error) { + var reqBody, resBody UpdateIpRouteTableConfigBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type UpdateIpmiBody struct { + Req *types.UpdateIpmi `xml:"urn:vim25 UpdateIpmi,omitempty"` + Res *types.UpdateIpmiResponse `xml:"urn:vim25 UpdateIpmiResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *UpdateIpmiBody) Fault() *soap.Fault { return b.Fault_ } + +func UpdateIpmi(ctx context.Context, r soap.RoundTripper, req *types.UpdateIpmi) (*types.UpdateIpmiResponse, error) { + var reqBody, resBody UpdateIpmiBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type UpdateLicenseBody struct { + Req *types.UpdateLicense `xml:"urn:vim25 UpdateLicense,omitempty"` + Res *types.UpdateLicenseResponse `xml:"urn:vim25 UpdateLicenseResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *UpdateLicenseBody) Fault() *soap.Fault { return b.Fault_ } + +func UpdateLicense(ctx context.Context, r soap.RoundTripper, req *types.UpdateLicense) (*types.UpdateLicenseResponse, error) { + var reqBody, resBody UpdateLicenseBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type UpdateLicenseLabelBody struct { + Req *types.UpdateLicenseLabel `xml:"urn:vim25 UpdateLicenseLabel,omitempty"` + Res *types.UpdateLicenseLabelResponse `xml:"urn:vim25 UpdateLicenseLabelResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *UpdateLicenseLabelBody) Fault() *soap.Fault { return b.Fault_ } + +func UpdateLicenseLabel(ctx context.Context, r soap.RoundTripper, req *types.UpdateLicenseLabel) (*types.UpdateLicenseLabelResponse, error) { + var reqBody, resBody UpdateLicenseLabelBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type UpdateLinkedChildrenBody struct { + Req *types.UpdateLinkedChildren `xml:"urn:vim25 UpdateLinkedChildren,omitempty"` + Res *types.UpdateLinkedChildrenResponse `xml:"urn:vim25 UpdateLinkedChildrenResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *UpdateLinkedChildrenBody) Fault() *soap.Fault { return b.Fault_ } + +func UpdateLinkedChildren(ctx context.Context, r soap.RoundTripper, req *types.UpdateLinkedChildren) (*types.UpdateLinkedChildrenResponse, error) { + var reqBody, resBody UpdateLinkedChildrenBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type UpdateLocalSwapDatastoreBody struct { + Req *types.UpdateLocalSwapDatastore `xml:"urn:vim25 UpdateLocalSwapDatastore,omitempty"` + Res *types.UpdateLocalSwapDatastoreResponse `xml:"urn:vim25 UpdateLocalSwapDatastoreResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *UpdateLocalSwapDatastoreBody) Fault() *soap.Fault { return b.Fault_ } + +func UpdateLocalSwapDatastore(ctx context.Context, r soap.RoundTripper, req *types.UpdateLocalSwapDatastore) (*types.UpdateLocalSwapDatastoreResponse, error) { + var reqBody, resBody UpdateLocalSwapDatastoreBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type UpdateLockdownExceptionsBody struct { + Req *types.UpdateLockdownExceptions `xml:"urn:vim25 UpdateLockdownExceptions,omitempty"` + Res *types.UpdateLockdownExceptionsResponse `xml:"urn:vim25 UpdateLockdownExceptionsResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *UpdateLockdownExceptionsBody) Fault() *soap.Fault { return b.Fault_ } + +func UpdateLockdownExceptions(ctx context.Context, r soap.RoundTripper, req *types.UpdateLockdownExceptions) (*types.UpdateLockdownExceptionsResponse, error) { + var reqBody, resBody UpdateLockdownExceptionsBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type UpdateModuleOptionStringBody struct { + Req *types.UpdateModuleOptionString `xml:"urn:vim25 UpdateModuleOptionString,omitempty"` + Res *types.UpdateModuleOptionStringResponse `xml:"urn:vim25 UpdateModuleOptionStringResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *UpdateModuleOptionStringBody) Fault() *soap.Fault { return b.Fault_ } + +func UpdateModuleOptionString(ctx context.Context, r soap.RoundTripper, req *types.UpdateModuleOptionString) (*types.UpdateModuleOptionStringResponse, error) { + var reqBody, resBody UpdateModuleOptionStringBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type UpdateNetworkConfigBody struct { + Req *types.UpdateNetworkConfig `xml:"urn:vim25 UpdateNetworkConfig,omitempty"` + Res *types.UpdateNetworkConfigResponse `xml:"urn:vim25 UpdateNetworkConfigResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *UpdateNetworkConfigBody) Fault() *soap.Fault { return b.Fault_ } + +func UpdateNetworkConfig(ctx context.Context, r soap.RoundTripper, req *types.UpdateNetworkConfig) (*types.UpdateNetworkConfigResponse, error) { + var reqBody, resBody UpdateNetworkConfigBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type UpdateNetworkResourcePoolBody struct { + Req *types.UpdateNetworkResourcePool `xml:"urn:vim25 UpdateNetworkResourcePool,omitempty"` + Res *types.UpdateNetworkResourcePoolResponse `xml:"urn:vim25 UpdateNetworkResourcePoolResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *UpdateNetworkResourcePoolBody) Fault() *soap.Fault { return b.Fault_ } + +func UpdateNetworkResourcePool(ctx context.Context, r soap.RoundTripper, req *types.UpdateNetworkResourcePool) (*types.UpdateNetworkResourcePoolResponse, error) { + var reqBody, resBody UpdateNetworkResourcePoolBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type UpdateOptionsBody struct { + Req *types.UpdateOptions `xml:"urn:vim25 UpdateOptions,omitempty"` + Res *types.UpdateOptionsResponse `xml:"urn:vim25 UpdateOptionsResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *UpdateOptionsBody) Fault() *soap.Fault { return b.Fault_ } + +func UpdateOptions(ctx context.Context, r soap.RoundTripper, req *types.UpdateOptions) (*types.UpdateOptionsResponse, error) { + var reqBody, resBody UpdateOptionsBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type UpdatePassthruConfigBody struct { + Req *types.UpdatePassthruConfig `xml:"urn:vim25 UpdatePassthruConfig,omitempty"` + Res *types.UpdatePassthruConfigResponse `xml:"urn:vim25 UpdatePassthruConfigResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *UpdatePassthruConfigBody) Fault() *soap.Fault { return b.Fault_ } + +func UpdatePassthruConfig(ctx context.Context, r soap.RoundTripper, req *types.UpdatePassthruConfig) (*types.UpdatePassthruConfigResponse, error) { + var reqBody, resBody UpdatePassthruConfigBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type UpdatePerfIntervalBody struct { + Req *types.UpdatePerfInterval `xml:"urn:vim25 UpdatePerfInterval,omitempty"` + Res *types.UpdatePerfIntervalResponse `xml:"urn:vim25 UpdatePerfIntervalResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *UpdatePerfIntervalBody) Fault() *soap.Fault { return b.Fault_ } + +func UpdatePerfInterval(ctx context.Context, r soap.RoundTripper, req *types.UpdatePerfInterval) (*types.UpdatePerfIntervalResponse, error) { + var reqBody, resBody UpdatePerfIntervalBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type UpdatePhysicalNicLinkSpeedBody struct { + Req *types.UpdatePhysicalNicLinkSpeed `xml:"urn:vim25 UpdatePhysicalNicLinkSpeed,omitempty"` + Res *types.UpdatePhysicalNicLinkSpeedResponse `xml:"urn:vim25 UpdatePhysicalNicLinkSpeedResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *UpdatePhysicalNicLinkSpeedBody) Fault() *soap.Fault { return b.Fault_ } + +func UpdatePhysicalNicLinkSpeed(ctx context.Context, r soap.RoundTripper, req *types.UpdatePhysicalNicLinkSpeed) (*types.UpdatePhysicalNicLinkSpeedResponse, error) { + var reqBody, resBody UpdatePhysicalNicLinkSpeedBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type UpdatePortGroupBody struct { + Req *types.UpdatePortGroup `xml:"urn:vim25 UpdatePortGroup,omitempty"` + Res *types.UpdatePortGroupResponse `xml:"urn:vim25 UpdatePortGroupResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *UpdatePortGroupBody) Fault() *soap.Fault { return b.Fault_ } + +func UpdatePortGroup(ctx context.Context, r soap.RoundTripper, req *types.UpdatePortGroup) (*types.UpdatePortGroupResponse, error) { + var reqBody, resBody UpdatePortGroupBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type UpdateProgressBody struct { + Req *types.UpdateProgress `xml:"urn:vim25 UpdateProgress,omitempty"` + Res *types.UpdateProgressResponse `xml:"urn:vim25 UpdateProgressResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *UpdateProgressBody) Fault() *soap.Fault { return b.Fault_ } + +func UpdateProgress(ctx context.Context, r soap.RoundTripper, req *types.UpdateProgress) (*types.UpdateProgressResponse, error) { + var reqBody, resBody UpdateProgressBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type UpdateReferenceHostBody struct { + Req *types.UpdateReferenceHost `xml:"urn:vim25 UpdateReferenceHost,omitempty"` + Res *types.UpdateReferenceHostResponse `xml:"urn:vim25 UpdateReferenceHostResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *UpdateReferenceHostBody) Fault() *soap.Fault { return b.Fault_ } + +func UpdateReferenceHost(ctx context.Context, r soap.RoundTripper, req *types.UpdateReferenceHost) (*types.UpdateReferenceHostResponse, error) { + var reqBody, resBody UpdateReferenceHostBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type UpdateRulesetBody struct { + Req *types.UpdateRuleset `xml:"urn:vim25 UpdateRuleset,omitempty"` + Res *types.UpdateRulesetResponse `xml:"urn:vim25 UpdateRulesetResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *UpdateRulesetBody) Fault() *soap.Fault { return b.Fault_ } + +func UpdateRuleset(ctx context.Context, r soap.RoundTripper, req *types.UpdateRuleset) (*types.UpdateRulesetResponse, error) { + var reqBody, resBody UpdateRulesetBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type UpdateScsiLunDisplayNameBody struct { + Req *types.UpdateScsiLunDisplayName `xml:"urn:vim25 UpdateScsiLunDisplayName,omitempty"` + Res *types.UpdateScsiLunDisplayNameResponse `xml:"urn:vim25 UpdateScsiLunDisplayNameResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *UpdateScsiLunDisplayNameBody) Fault() *soap.Fault { return b.Fault_ } + +func UpdateScsiLunDisplayName(ctx context.Context, r soap.RoundTripper, req *types.UpdateScsiLunDisplayName) (*types.UpdateScsiLunDisplayNameResponse, error) { + var reqBody, resBody UpdateScsiLunDisplayNameBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type UpdateServiceConsoleVirtualNicBody struct { + Req *types.UpdateServiceConsoleVirtualNic `xml:"urn:vim25 UpdateServiceConsoleVirtualNic,omitempty"` + Res *types.UpdateServiceConsoleVirtualNicResponse `xml:"urn:vim25 UpdateServiceConsoleVirtualNicResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *UpdateServiceConsoleVirtualNicBody) Fault() *soap.Fault { return b.Fault_ } + +func UpdateServiceConsoleVirtualNic(ctx context.Context, r soap.RoundTripper, req *types.UpdateServiceConsoleVirtualNic) (*types.UpdateServiceConsoleVirtualNicResponse, error) { + var reqBody, resBody UpdateServiceConsoleVirtualNicBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type UpdateServiceMessageBody struct { + Req *types.UpdateServiceMessage `xml:"urn:vim25 UpdateServiceMessage,omitempty"` + Res *types.UpdateServiceMessageResponse `xml:"urn:vim25 UpdateServiceMessageResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *UpdateServiceMessageBody) Fault() *soap.Fault { return b.Fault_ } + +func UpdateServiceMessage(ctx context.Context, r soap.RoundTripper, req *types.UpdateServiceMessage) (*types.UpdateServiceMessageResponse, error) { + var reqBody, resBody UpdateServiceMessageBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type UpdateServicePolicyBody struct { + Req *types.UpdateServicePolicy `xml:"urn:vim25 UpdateServicePolicy,omitempty"` + Res *types.UpdateServicePolicyResponse `xml:"urn:vim25 UpdateServicePolicyResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *UpdateServicePolicyBody) Fault() *soap.Fault { return b.Fault_ } + +func UpdateServicePolicy(ctx context.Context, r soap.RoundTripper, req *types.UpdateServicePolicy) (*types.UpdateServicePolicyResponse, error) { + var reqBody, resBody UpdateServicePolicyBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type UpdateSoftwareInternetScsiEnabledBody struct { + Req *types.UpdateSoftwareInternetScsiEnabled `xml:"urn:vim25 UpdateSoftwareInternetScsiEnabled,omitempty"` + Res *types.UpdateSoftwareInternetScsiEnabledResponse `xml:"urn:vim25 UpdateSoftwareInternetScsiEnabledResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *UpdateSoftwareInternetScsiEnabledBody) Fault() *soap.Fault { return b.Fault_ } + +func UpdateSoftwareInternetScsiEnabled(ctx context.Context, r soap.RoundTripper, req *types.UpdateSoftwareInternetScsiEnabled) (*types.UpdateSoftwareInternetScsiEnabledResponse, error) { + var reqBody, resBody UpdateSoftwareInternetScsiEnabledBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type UpdateSystemResourcesBody struct { + Req *types.UpdateSystemResources `xml:"urn:vim25 UpdateSystemResources,omitempty"` + Res *types.UpdateSystemResourcesResponse `xml:"urn:vim25 UpdateSystemResourcesResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *UpdateSystemResourcesBody) Fault() *soap.Fault { return b.Fault_ } + +func UpdateSystemResources(ctx context.Context, r soap.RoundTripper, req *types.UpdateSystemResources) (*types.UpdateSystemResourcesResponse, error) { + var reqBody, resBody UpdateSystemResourcesBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type UpdateSystemSwapConfigurationBody struct { + Req *types.UpdateSystemSwapConfiguration `xml:"urn:vim25 UpdateSystemSwapConfiguration,omitempty"` + Res *types.UpdateSystemSwapConfigurationResponse `xml:"urn:vim25 UpdateSystemSwapConfigurationResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *UpdateSystemSwapConfigurationBody) Fault() *soap.Fault { return b.Fault_ } + +func UpdateSystemSwapConfiguration(ctx context.Context, r soap.RoundTripper, req *types.UpdateSystemSwapConfiguration) (*types.UpdateSystemSwapConfigurationResponse, error) { + var reqBody, resBody UpdateSystemSwapConfigurationBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type UpdateSystemUsersBody struct { + Req *types.UpdateSystemUsers `xml:"urn:vim25 UpdateSystemUsers,omitempty"` + Res *types.UpdateSystemUsersResponse `xml:"urn:vim25 UpdateSystemUsersResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *UpdateSystemUsersBody) Fault() *soap.Fault { return b.Fault_ } + +func UpdateSystemUsers(ctx context.Context, r soap.RoundTripper, req *types.UpdateSystemUsers) (*types.UpdateSystemUsersResponse, error) { + var reqBody, resBody UpdateSystemUsersBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type UpdateUserBody struct { + Req *types.UpdateUser `xml:"urn:vim25 UpdateUser,omitempty"` + Res *types.UpdateUserResponse `xml:"urn:vim25 UpdateUserResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *UpdateUserBody) Fault() *soap.Fault { return b.Fault_ } + +func UpdateUser(ctx context.Context, r soap.RoundTripper, req *types.UpdateUser) (*types.UpdateUserResponse, error) { + var reqBody, resBody UpdateUserBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type UpdateVAppConfigBody struct { + Req *types.UpdateVAppConfig `xml:"urn:vim25 UpdateVAppConfig,omitempty"` + Res *types.UpdateVAppConfigResponse `xml:"urn:vim25 UpdateVAppConfigResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *UpdateVAppConfigBody) Fault() *soap.Fault { return b.Fault_ } + +func UpdateVAppConfig(ctx context.Context, r soap.RoundTripper, req *types.UpdateVAppConfig) (*types.UpdateVAppConfigResponse, error) { + var reqBody, resBody UpdateVAppConfigBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type UpdateVirtualMachineFiles_TaskBody struct { + Req *types.UpdateVirtualMachineFiles_Task `xml:"urn:vim25 UpdateVirtualMachineFiles_Task,omitempty"` + Res *types.UpdateVirtualMachineFiles_TaskResponse `xml:"urn:vim25 UpdateVirtualMachineFiles_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *UpdateVirtualMachineFiles_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func UpdateVirtualMachineFiles_Task(ctx context.Context, r soap.RoundTripper, req *types.UpdateVirtualMachineFiles_Task) (*types.UpdateVirtualMachineFiles_TaskResponse, error) { + var reqBody, resBody UpdateVirtualMachineFiles_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type UpdateVirtualNicBody struct { + Req *types.UpdateVirtualNic `xml:"urn:vim25 UpdateVirtualNic,omitempty"` + Res *types.UpdateVirtualNicResponse `xml:"urn:vim25 UpdateVirtualNicResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *UpdateVirtualNicBody) Fault() *soap.Fault { return b.Fault_ } + +func UpdateVirtualNic(ctx context.Context, r soap.RoundTripper, req *types.UpdateVirtualNic) (*types.UpdateVirtualNicResponse, error) { + var reqBody, resBody UpdateVirtualNicBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type UpdateVirtualSwitchBody struct { + Req *types.UpdateVirtualSwitch `xml:"urn:vim25 UpdateVirtualSwitch,omitempty"` + Res *types.UpdateVirtualSwitchResponse `xml:"urn:vim25 UpdateVirtualSwitchResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *UpdateVirtualSwitchBody) Fault() *soap.Fault { return b.Fault_ } + +func UpdateVirtualSwitch(ctx context.Context, r soap.RoundTripper, req *types.UpdateVirtualSwitch) (*types.UpdateVirtualSwitchResponse, error) { + var reqBody, resBody UpdateVirtualSwitchBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type UpdateVsan_TaskBody struct { + Req *types.UpdateVsan_Task `xml:"urn:vim25 UpdateVsan_Task,omitempty"` + Res *types.UpdateVsan_TaskResponse `xml:"urn:vim25 UpdateVsan_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *UpdateVsan_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func UpdateVsan_Task(ctx context.Context, r soap.RoundTripper, req *types.UpdateVsan_Task) (*types.UpdateVsan_TaskResponse, error) { + var reqBody, resBody UpdateVsan_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type UpgradeIoFilter_TaskBody struct { + Req *types.UpgradeIoFilter_Task `xml:"urn:vim25 UpgradeIoFilter_Task,omitempty"` + Res *types.UpgradeIoFilter_TaskResponse `xml:"urn:vim25 UpgradeIoFilter_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *UpgradeIoFilter_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func UpgradeIoFilter_Task(ctx context.Context, r soap.RoundTripper, req *types.UpgradeIoFilter_Task) (*types.UpgradeIoFilter_TaskResponse, error) { + var reqBody, resBody UpgradeIoFilter_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type UpgradeTools_TaskBody struct { + Req *types.UpgradeTools_Task `xml:"urn:vim25 UpgradeTools_Task,omitempty"` + Res *types.UpgradeTools_TaskResponse `xml:"urn:vim25 UpgradeTools_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *UpgradeTools_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func UpgradeTools_Task(ctx context.Context, r soap.RoundTripper, req *types.UpgradeTools_Task) (*types.UpgradeTools_TaskResponse, error) { + var reqBody, resBody UpgradeTools_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type UpgradeVM_TaskBody struct { + Req *types.UpgradeVM_Task `xml:"urn:vim25 UpgradeVM_Task,omitempty"` + Res *types.UpgradeVM_TaskResponse `xml:"urn:vim25 UpgradeVM_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *UpgradeVM_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func UpgradeVM_Task(ctx context.Context, r soap.RoundTripper, req *types.UpgradeVM_Task) (*types.UpgradeVM_TaskResponse, error) { + var reqBody, resBody UpgradeVM_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type UpgradeVmLayoutBody struct { + Req *types.UpgradeVmLayout `xml:"urn:vim25 UpgradeVmLayout,omitempty"` + Res *types.UpgradeVmLayoutResponse `xml:"urn:vim25 UpgradeVmLayoutResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *UpgradeVmLayoutBody) Fault() *soap.Fault { return b.Fault_ } + +func UpgradeVmLayout(ctx context.Context, r soap.RoundTripper, req *types.UpgradeVmLayout) (*types.UpgradeVmLayoutResponse, error) { + var reqBody, resBody UpgradeVmLayoutBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type UpgradeVmfsBody struct { + Req *types.UpgradeVmfs `xml:"urn:vim25 UpgradeVmfs,omitempty"` + Res *types.UpgradeVmfsResponse `xml:"urn:vim25 UpgradeVmfsResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *UpgradeVmfsBody) Fault() *soap.Fault { return b.Fault_ } + +func UpgradeVmfs(ctx context.Context, r soap.RoundTripper, req *types.UpgradeVmfs) (*types.UpgradeVmfsResponse, error) { + var reqBody, resBody UpgradeVmfsBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type UpgradeVsanObjectsBody struct { + Req *types.UpgradeVsanObjects `xml:"urn:vim25 UpgradeVsanObjects,omitempty"` + Res *types.UpgradeVsanObjectsResponse `xml:"urn:vim25 UpgradeVsanObjectsResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *UpgradeVsanObjectsBody) Fault() *soap.Fault { return b.Fault_ } + +func UpgradeVsanObjects(ctx context.Context, r soap.RoundTripper, req *types.UpgradeVsanObjects) (*types.UpgradeVsanObjectsResponse, error) { + var reqBody, resBody UpgradeVsanObjectsBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type ValidateCredentialsInGuestBody struct { + Req *types.ValidateCredentialsInGuest `xml:"urn:vim25 ValidateCredentialsInGuest,omitempty"` + Res *types.ValidateCredentialsInGuestResponse `xml:"urn:vim25 ValidateCredentialsInGuestResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *ValidateCredentialsInGuestBody) Fault() *soap.Fault { return b.Fault_ } + +func ValidateCredentialsInGuest(ctx context.Context, r soap.RoundTripper, req *types.ValidateCredentialsInGuest) (*types.ValidateCredentialsInGuestResponse, error) { + var reqBody, resBody ValidateCredentialsInGuestBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type ValidateHostBody struct { + Req *types.ValidateHost `xml:"urn:vim25 ValidateHost,omitempty"` + Res *types.ValidateHostResponse `xml:"urn:vim25 ValidateHostResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *ValidateHostBody) Fault() *soap.Fault { return b.Fault_ } + +func ValidateHost(ctx context.Context, r soap.RoundTripper, req *types.ValidateHost) (*types.ValidateHostResponse, error) { + var reqBody, resBody ValidateHostBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type ValidateMigrationBody struct { + Req *types.ValidateMigration `xml:"urn:vim25 ValidateMigration,omitempty"` + Res *types.ValidateMigrationResponse `xml:"urn:vim25 ValidateMigrationResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *ValidateMigrationBody) Fault() *soap.Fault { return b.Fault_ } + +func ValidateMigration(ctx context.Context, r soap.RoundTripper, req *types.ValidateMigration) (*types.ValidateMigrationResponse, error) { + var reqBody, resBody ValidateMigrationBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type WaitForUpdatesBody struct { + Req *types.WaitForUpdates `xml:"urn:vim25 WaitForUpdates,omitempty"` + Res *types.WaitForUpdatesResponse `xml:"urn:vim25 WaitForUpdatesResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *WaitForUpdatesBody) Fault() *soap.Fault { return b.Fault_ } + +func WaitForUpdates(ctx context.Context, r soap.RoundTripper, req *types.WaitForUpdates) (*types.WaitForUpdatesResponse, error) { + var reqBody, resBody WaitForUpdatesBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type WaitForUpdatesExBody struct { + Req *types.WaitForUpdatesEx `xml:"urn:vim25 WaitForUpdatesEx,omitempty"` + Res *types.WaitForUpdatesExResponse `xml:"urn:vim25 WaitForUpdatesExResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *WaitForUpdatesExBody) Fault() *soap.Fault { return b.Fault_ } + +func WaitForUpdatesEx(ctx context.Context, r soap.RoundTripper, req *types.WaitForUpdatesEx) (*types.WaitForUpdatesExResponse, error) { + var reqBody, resBody WaitForUpdatesExBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type XmlToCustomizationSpecItemBody struct { + Req *types.XmlToCustomizationSpecItem `xml:"urn:vim25 XmlToCustomizationSpecItem,omitempty"` + Res *types.XmlToCustomizationSpecItemResponse `xml:"urn:vim25 XmlToCustomizationSpecItemResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *XmlToCustomizationSpecItemBody) Fault() *soap.Fault { return b.Fault_ } + +func XmlToCustomizationSpecItem(ctx context.Context, r soap.RoundTripper, req *types.XmlToCustomizationSpecItem) (*types.XmlToCustomizationSpecItemResponse, error) { + var reqBody, resBody XmlToCustomizationSpecItemBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type ZeroFillVirtualDisk_TaskBody struct { + Req *types.ZeroFillVirtualDisk_Task `xml:"urn:vim25 ZeroFillVirtualDisk_Task,omitempty"` + Res *types.ZeroFillVirtualDisk_TaskResponse `xml:"urn:vim25 ZeroFillVirtualDisk_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *ZeroFillVirtualDisk_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func ZeroFillVirtualDisk_Task(ctx context.Context, r soap.RoundTripper, req *types.ZeroFillVirtualDisk_Task) (*types.ZeroFillVirtualDisk_TaskResponse, error) { + var reqBody, resBody ZeroFillVirtualDisk_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/vim25/methods/service_content.go juju-core-2.0.2/src/github.com/vmware/govmomi/vim25/methods/service_content.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/vim25/methods/service_content.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/vim25/methods/service_content.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,56 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package methods + +import ( + "time" + + "github.com/vmware/govmomi/vim25/soap" + "github.com/vmware/govmomi/vim25/types" + "golang.org/x/net/context" +) + +var serviceInstance = types.ManagedObjectReference{ + Type: "ServiceInstance", + Value: "ServiceInstance", +} + +func GetServiceContent(ctx context.Context, r soap.RoundTripper) (types.ServiceContent, error) { + req := types.RetrieveServiceContent{ + This: serviceInstance, + } + + res, err := RetrieveServiceContent(ctx, r, &req) + if err != nil { + return types.ServiceContent{}, err + } + + return res.Returnval, nil +} + +func GetCurrentTime(ctx context.Context, r soap.RoundTripper) (*time.Time, error) { + req := types.CurrentTime{ + This: serviceInstance, + } + + res, err := CurrentTime(ctx, r, &req) + if err != nil { + return nil, err + } + + return &res.Returnval, nil +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/vim25/mo/ancestors.go juju-core-2.0.2/src/github.com/vmware/govmomi/vim25/mo/ancestors.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/vim25/mo/ancestors.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/vim25/mo/ancestors.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,112 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package mo + +import ( + "fmt" + + "github.com/vmware/govmomi/vim25/soap" + "github.com/vmware/govmomi/vim25/types" + "golang.org/x/net/context" +) + +// Ancestors returns the entire ancestry tree of a specified managed object. +// The return value includes the root node and the specified object itself. +func Ancestors(ctx context.Context, rt soap.RoundTripper, pc, obj types.ManagedObjectReference) ([]ManagedEntity, error) { + ospec := types.ObjectSpec{ + Obj: obj, + SelectSet: []types.BaseSelectionSpec{ + &types.TraversalSpec{ + SelectionSpec: types.SelectionSpec{Name: "traverseParent"}, + Type: "ManagedEntity", + Path: "parent", + Skip: types.NewBool(false), + SelectSet: []types.BaseSelectionSpec{ + &types.SelectionSpec{Name: "traverseParent"}, + }, + }, + }, + Skip: types.NewBool(false), + } + + pspec := types.PropertySpec{ + Type: "ManagedEntity", + PathSet: []string{"name", "parent"}, + } + + req := types.RetrieveProperties{ + This: pc, + SpecSet: []types.PropertyFilterSpec{ + { + ObjectSet: []types.ObjectSpec{ospec}, + PropSet: []types.PropertySpec{pspec}, + }, + }, + } + + var ifaces []interface{} + + err := RetrievePropertiesForRequest(ctx, rt, req, &ifaces) + if err != nil { + return nil, err + } + + var out []ManagedEntity + + // Build ancestry tree by iteratively finding a new child. + for len(out) < len(ifaces) { + var find types.ManagedObjectReference + + if len(out) > 0 { + find = out[len(out)-1].Self + } + + // Find entity we're looking for given the last entity in the current tree. + for _, iface := range ifaces { + me := iface.(IsManagedEntity).GetManagedEntity() + + if me.Name == "" { + // The types below have their own 'Name' field, so ManagedEntity.Name (me.Name) is empty. + // We only hit this case when the 'obj' param is one of these types. + // In most cases, 'obj' is a Folder so Name isn't collected in this call. + switch x := iface.(type) { + case Network: + me.Name = x.Name + case DistributedVirtualSwitch: + me.Name = x.Name + case DistributedVirtualPortgroup: + me.Name = x.Name + default: + // ManagedEntity always has a Name, if we hit this point we missed a case above. + panic(fmt.Sprintf("%#v Name is empty", me.Reference())) + } + } + + if me.Parent == nil { + out = append(out, me) + break + } + + if *me.Parent == find { + out = append(out, me) + break + } + } + } + + return out, nil +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/vim25/mo/entity.go juju-core-2.0.2/src/github.com/vmware/govmomi/vim25/mo/entity.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/vim25/mo/entity.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/vim25/mo/entity.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,24 @@ +/* +Copyright (c) 2016 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package mo + +// Entity is the interface that is implemented by all managed objects +// that extend ManagedEntity. +type Entity interface { + Reference + Entity() *ManagedEntity +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/vim25/mo/extra.go juju-core-2.0.2/src/github.com/vmware/govmomi/vim25/mo/extra.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/vim25/mo/extra.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/vim25/mo/extra.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,61 @@ +/* +Copyright (c) 2014 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package mo + +type IsManagedEntity interface { + GetManagedEntity() ManagedEntity +} + +func (m ComputeResource) GetManagedEntity() ManagedEntity { + return m.ManagedEntity +} + +func (m Datacenter) GetManagedEntity() ManagedEntity { + return m.ManagedEntity +} + +func (m Datastore) GetManagedEntity() ManagedEntity { + return m.ManagedEntity +} + +func (m DistributedVirtualSwitch) GetManagedEntity() ManagedEntity { + return m.ManagedEntity +} + +func (m DistributedVirtualPortgroup) GetManagedEntity() ManagedEntity { + return m.ManagedEntity +} + +func (m Folder) GetManagedEntity() ManagedEntity { + return m.ManagedEntity +} + +func (m HostSystem) GetManagedEntity() ManagedEntity { + return m.ManagedEntity +} + +func (m Network) GetManagedEntity() ManagedEntity { + return m.ManagedEntity +} + +func (m ResourcePool) GetManagedEntity() ManagedEntity { + return m.ManagedEntity +} + +func (m VirtualMachine) GetManagedEntity() ManagedEntity { + return m.ManagedEntity +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/vim25/mo/fixtures/cluster_host_property.xml juju-core-2.0.2/src/github.com/vmware/govmomi/vim25/mo/fixtures/cluster_host_property.xml --- juju-core-2.0.0/src/github.com/vmware/govmomi/vim25/mo/fixtures/cluster_host_property.xml 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/vim25/mo/fixtures/cluster_host_property.xml 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,15 @@ + + + + domain-c7 + + host + + host-14 + host-17 + host-19 + host-52 + + + + diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/vim25/mo/fixtures/hostsystem_list_name_property.xml juju-core-2.0.2/src/github.com/vmware/govmomi/vim25/mo/fixtures/hostsystem_list_name_property.xml --- juju-core-2.0.0/src/github.com/vmware/govmomi/vim25/mo/fixtures/hostsystem_list_name_property.xml 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/vim25/mo/fixtures/hostsystem_list_name_property.xml 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,17 @@ + + + + host-10 + + name + host-01.example.com + + + + host-30 + + name + host-02.example.com + + + diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/vim25/mo/fixtures/nested_property.xml juju-core-2.0.2/src/github.com/vmware/govmomi/vim25/mo/fixtures/nested_property.xml --- juju-core-2.0.0/src/github.com/vmware/govmomi/vim25/mo/fixtures/nested_property.xml 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/vim25/mo/fixtures/nested_property.xml 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,14 @@ + + + + vm-411 + + config.name + kubernetes-master + + + config.uuid + 422ec880-ab06-06b4-23f3-beb7a052a4c9 + + + diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/vim25/mo/fixtures/not_authenticated_fault.xml juju-core-2.0.2/src/github.com/vmware/govmomi/vim25/mo/fixtures/not_authenticated_fault.xml --- juju-core-2.0.0/src/github.com/vmware/govmomi/vim25/mo/fixtures/not_authenticated_fault.xml 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/vim25/mo/fixtures/not_authenticated_fault.xml 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,42 @@ + + + + SessionManager + + defaultLocale + en + + + messageLocaleList + + ja + zh_CN + en + de + zh_TW + ko + fr + + + + message + + + group-d1 + System.View + + + + + + sessionList + + + group-d1 + Sessions.TerminateSession + + + + + + diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/vim25/mo/fixtures/pointer_property.xml juju-core-2.0.2/src/github.com/vmware/govmomi/vim25/mo/fixtures/pointer_property.xml --- juju-core-2.0.0/src/github.com/vmware/govmomi/vim25/mo/fixtures/pointer_property.xml 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/vim25/mo/fixtures/pointer_property.xml 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,15 @@ + + + + vm-411 + + config.bootOptions + + 0 + false + false + 10000 + + + + diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/vim25/mo/mo.go juju-core-2.0.2/src/github.com/vmware/govmomi/vim25/mo/mo.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/vim25/mo/mo.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/vim25/mo/mo.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,1660 @@ +/* +Copyright (c) 2014-2016 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package mo + +import ( + "reflect" + "time" + + "github.com/vmware/govmomi/vim25/types" +) + +type Alarm struct { + ExtensibleManagedObject + + Info types.AlarmInfo `mo:"info"` +} + +func init() { + t["Alarm"] = reflect.TypeOf((*Alarm)(nil)).Elem() +} + +type AlarmManager struct { + Self types.ManagedObjectReference + + DefaultExpression []types.BaseAlarmExpression `mo:"defaultExpression"` + Description types.AlarmDescription `mo:"description"` +} + +func (m AlarmManager) Reference() types.ManagedObjectReference { + return m.Self +} + +func init() { + t["AlarmManager"] = reflect.TypeOf((*AlarmManager)(nil)).Elem() +} + +type AuthorizationManager struct { + Self types.ManagedObjectReference + + PrivilegeList []types.AuthorizationPrivilege `mo:"privilegeList"` + RoleList []types.AuthorizationRole `mo:"roleList"` + Description types.AuthorizationDescription `mo:"description"` +} + +func (m AuthorizationManager) Reference() types.ManagedObjectReference { + return m.Self +} + +func init() { + t["AuthorizationManager"] = reflect.TypeOf((*AuthorizationManager)(nil)).Elem() +} + +type CertificateManager struct { + Self types.ManagedObjectReference +} + +func (m CertificateManager) Reference() types.ManagedObjectReference { + return m.Self +} + +func init() { + t["CertificateManager"] = reflect.TypeOf((*CertificateManager)(nil)).Elem() +} + +type ClusterComputeResource struct { + ComputeResource + + Configuration types.ClusterConfigInfo `mo:"configuration"` + Recommendation []types.ClusterRecommendation `mo:"recommendation"` + DrsRecommendation []types.ClusterDrsRecommendation `mo:"drsRecommendation"` + MigrationHistory []types.ClusterDrsMigration `mo:"migrationHistory"` + ActionHistory []types.ClusterActionHistory `mo:"actionHistory"` + DrsFault []types.ClusterDrsFaults `mo:"drsFault"` +} + +func init() { + t["ClusterComputeResource"] = reflect.TypeOf((*ClusterComputeResource)(nil)).Elem() +} + +type ClusterEVCManager struct { + ExtensibleManagedObject + + ManagedCluster types.ManagedObjectReference `mo:"managedCluster"` + EvcState types.ClusterEVCManagerEVCState `mo:"evcState"` +} + +func init() { + t["ClusterEVCManager"] = reflect.TypeOf((*ClusterEVCManager)(nil)).Elem() +} + +type ClusterProfile struct { + Profile +} + +func init() { + t["ClusterProfile"] = reflect.TypeOf((*ClusterProfile)(nil)).Elem() +} + +type ClusterProfileManager struct { + ProfileManager +} + +func init() { + t["ClusterProfileManager"] = reflect.TypeOf((*ClusterProfileManager)(nil)).Elem() +} + +type ComputeResource struct { + ManagedEntity + + ResourcePool *types.ManagedObjectReference `mo:"resourcePool"` + Host []types.ManagedObjectReference `mo:"host"` + Datastore []types.ManagedObjectReference `mo:"datastore"` + Network []types.ManagedObjectReference `mo:"network"` + Summary types.BaseComputeResourceSummary `mo:"summary"` + EnvironmentBrowser *types.ManagedObjectReference `mo:"environmentBrowser"` + ConfigurationEx types.BaseComputeResourceConfigInfo `mo:"configurationEx"` +} + +func (m *ComputeResource) Entity() *ManagedEntity { + return &m.ManagedEntity +} + +func init() { + t["ComputeResource"] = reflect.TypeOf((*ComputeResource)(nil)).Elem() +} + +type ContainerView struct { + ManagedObjectView + + Container types.ManagedObjectReference `mo:"container"` + Type []string `mo:"type"` + Recursive bool `mo:"recursive"` +} + +func init() { + t["ContainerView"] = reflect.TypeOf((*ContainerView)(nil)).Elem() +} + +type CustomFieldsManager struct { + Self types.ManagedObjectReference + + Field []types.CustomFieldDef `mo:"field"` +} + +func (m CustomFieldsManager) Reference() types.ManagedObjectReference { + return m.Self +} + +func init() { + t["CustomFieldsManager"] = reflect.TypeOf((*CustomFieldsManager)(nil)).Elem() +} + +type CustomizationSpecManager struct { + Self types.ManagedObjectReference + + Info []types.CustomizationSpecInfo `mo:"info"` + EncryptionKey []byte `mo:"encryptionKey"` +} + +func (m CustomizationSpecManager) Reference() types.ManagedObjectReference { + return m.Self +} + +func init() { + t["CustomizationSpecManager"] = reflect.TypeOf((*CustomizationSpecManager)(nil)).Elem() +} + +type Datacenter struct { + ManagedEntity + + VmFolder types.ManagedObjectReference `mo:"vmFolder"` + HostFolder types.ManagedObjectReference `mo:"hostFolder"` + DatastoreFolder types.ManagedObjectReference `mo:"datastoreFolder"` + NetworkFolder types.ManagedObjectReference `mo:"networkFolder"` + Datastore []types.ManagedObjectReference `mo:"datastore"` + Network []types.ManagedObjectReference `mo:"network"` + Configuration types.DatacenterConfigInfo `mo:"configuration"` +} + +func (m *Datacenter) Entity() *ManagedEntity { + return &m.ManagedEntity +} + +func init() { + t["Datacenter"] = reflect.TypeOf((*Datacenter)(nil)).Elem() +} + +type Datastore struct { + ManagedEntity + + Info types.BaseDatastoreInfo `mo:"info"` + Summary types.DatastoreSummary `mo:"summary"` + Host []types.DatastoreHostMount `mo:"host"` + Vm []types.ManagedObjectReference `mo:"vm"` + Browser types.ManagedObjectReference `mo:"browser"` + Capability types.DatastoreCapability `mo:"capability"` + IormConfiguration *types.StorageIORMInfo `mo:"iormConfiguration"` +} + +func (m *Datastore) Entity() *ManagedEntity { + return &m.ManagedEntity +} + +func init() { + t["Datastore"] = reflect.TypeOf((*Datastore)(nil)).Elem() +} + +type DatastoreNamespaceManager struct { + Self types.ManagedObjectReference +} + +func (m DatastoreNamespaceManager) Reference() types.ManagedObjectReference { + return m.Self +} + +func init() { + t["DatastoreNamespaceManager"] = reflect.TypeOf((*DatastoreNamespaceManager)(nil)).Elem() +} + +type DiagnosticManager struct { + Self types.ManagedObjectReference +} + +func (m DiagnosticManager) Reference() types.ManagedObjectReference { + return m.Self +} + +func init() { + t["DiagnosticManager"] = reflect.TypeOf((*DiagnosticManager)(nil)).Elem() +} + +type DistributedVirtualPortgroup struct { + Network + + Key string `mo:"key"` + Config types.DVPortgroupConfigInfo `mo:"config"` + PortKeys []string `mo:"portKeys"` +} + +func init() { + t["DistributedVirtualPortgroup"] = reflect.TypeOf((*DistributedVirtualPortgroup)(nil)).Elem() +} + +type DistributedVirtualSwitch struct { + ManagedEntity + + Uuid string `mo:"uuid"` + Capability types.DVSCapability `mo:"capability"` + Summary types.DVSSummary `mo:"summary"` + Config types.BaseDVSConfigInfo `mo:"config"` + NetworkResourcePool []types.DVSNetworkResourcePool `mo:"networkResourcePool"` + Portgroup []types.ManagedObjectReference `mo:"portgroup"` + Runtime *types.DVSRuntimeInfo `mo:"runtime"` +} + +func (m *DistributedVirtualSwitch) Entity() *ManagedEntity { + return &m.ManagedEntity +} + +func init() { + t["DistributedVirtualSwitch"] = reflect.TypeOf((*DistributedVirtualSwitch)(nil)).Elem() +} + +type DistributedVirtualSwitchManager struct { + Self types.ManagedObjectReference +} + +func (m DistributedVirtualSwitchManager) Reference() types.ManagedObjectReference { + return m.Self +} + +func init() { + t["DistributedVirtualSwitchManager"] = reflect.TypeOf((*DistributedVirtualSwitchManager)(nil)).Elem() +} + +type EnvironmentBrowser struct { + Self types.ManagedObjectReference + + DatastoreBrowser *types.ManagedObjectReference `mo:"datastoreBrowser"` +} + +func (m EnvironmentBrowser) Reference() types.ManagedObjectReference { + return m.Self +} + +func init() { + t["EnvironmentBrowser"] = reflect.TypeOf((*EnvironmentBrowser)(nil)).Elem() +} + +type EventHistoryCollector struct { + HistoryCollector + + LatestPage []types.BaseEvent `mo:"latestPage"` +} + +func init() { + t["EventHistoryCollector"] = reflect.TypeOf((*EventHistoryCollector)(nil)).Elem() +} + +type EventManager struct { + Self types.ManagedObjectReference + + Description types.EventDescription `mo:"description"` + LatestEvent types.BaseEvent `mo:"latestEvent"` + MaxCollector int32 `mo:"maxCollector"` +} + +func (m EventManager) Reference() types.ManagedObjectReference { + return m.Self +} + +func init() { + t["EventManager"] = reflect.TypeOf((*EventManager)(nil)).Elem() +} + +type ExtensibleManagedObject struct { + Self types.ManagedObjectReference + + Value []types.BaseCustomFieldValue `mo:"value"` + AvailableField []types.CustomFieldDef `mo:"availableField"` +} + +func (m ExtensibleManagedObject) Reference() types.ManagedObjectReference { + return m.Self +} + +func init() { + t["ExtensibleManagedObject"] = reflect.TypeOf((*ExtensibleManagedObject)(nil)).Elem() +} + +type ExtensionManager struct { + Self types.ManagedObjectReference + + ExtensionList []types.Extension `mo:"extensionList"` +} + +func (m ExtensionManager) Reference() types.ManagedObjectReference { + return m.Self +} + +func init() { + t["ExtensionManager"] = reflect.TypeOf((*ExtensionManager)(nil)).Elem() +} + +type FileManager struct { + Self types.ManagedObjectReference +} + +func (m FileManager) Reference() types.ManagedObjectReference { + return m.Self +} + +func init() { + t["FileManager"] = reflect.TypeOf((*FileManager)(nil)).Elem() +} + +type Folder struct { + ManagedEntity + + ChildType []string `mo:"childType"` + ChildEntity []types.ManagedObjectReference `mo:"childEntity"` +} + +func (m *Folder) Entity() *ManagedEntity { + return &m.ManagedEntity +} + +func init() { + t["Folder"] = reflect.TypeOf((*Folder)(nil)).Elem() +} + +type GuestAliasManager struct { + Self types.ManagedObjectReference +} + +func (m GuestAliasManager) Reference() types.ManagedObjectReference { + return m.Self +} + +func init() { + t["GuestAliasManager"] = reflect.TypeOf((*GuestAliasManager)(nil)).Elem() +} + +type GuestAuthManager struct { + Self types.ManagedObjectReference +} + +func (m GuestAuthManager) Reference() types.ManagedObjectReference { + return m.Self +} + +func init() { + t["GuestAuthManager"] = reflect.TypeOf((*GuestAuthManager)(nil)).Elem() +} + +type GuestFileManager struct { + Self types.ManagedObjectReference +} + +func (m GuestFileManager) Reference() types.ManagedObjectReference { + return m.Self +} + +func init() { + t["GuestFileManager"] = reflect.TypeOf((*GuestFileManager)(nil)).Elem() +} + +type GuestOperationsManager struct { + Self types.ManagedObjectReference + + AuthManager *types.ManagedObjectReference `mo:"authManager"` + FileManager *types.ManagedObjectReference `mo:"fileManager"` + ProcessManager *types.ManagedObjectReference `mo:"processManager"` + GuestWindowsRegistryManager *types.ManagedObjectReference `mo:"guestWindowsRegistryManager"` + AliasManager *types.ManagedObjectReference `mo:"aliasManager"` +} + +func (m GuestOperationsManager) Reference() types.ManagedObjectReference { + return m.Self +} + +func init() { + t["GuestOperationsManager"] = reflect.TypeOf((*GuestOperationsManager)(nil)).Elem() +} + +type GuestProcessManager struct { + Self types.ManagedObjectReference +} + +func (m GuestProcessManager) Reference() types.ManagedObjectReference { + return m.Self +} + +func init() { + t["GuestProcessManager"] = reflect.TypeOf((*GuestProcessManager)(nil)).Elem() +} + +type GuestWindowsRegistryManager struct { + Self types.ManagedObjectReference +} + +func (m GuestWindowsRegistryManager) Reference() types.ManagedObjectReference { + return m.Self +} + +func init() { + t["GuestWindowsRegistryManager"] = reflect.TypeOf((*GuestWindowsRegistryManager)(nil)).Elem() +} + +type HistoryCollector struct { + Self types.ManagedObjectReference + + Filter types.AnyType `mo:"filter"` +} + +func (m HistoryCollector) Reference() types.ManagedObjectReference { + return m.Self +} + +func init() { + t["HistoryCollector"] = reflect.TypeOf((*HistoryCollector)(nil)).Elem() +} + +type HostAccessManager struct { + Self types.ManagedObjectReference + + LockdownMode types.HostLockdownMode `mo:"lockdownMode"` +} + +func (m HostAccessManager) Reference() types.ManagedObjectReference { + return m.Self +} + +func init() { + t["HostAccessManager"] = reflect.TypeOf((*HostAccessManager)(nil)).Elem() +} + +type HostActiveDirectoryAuthentication struct { + HostDirectoryStore +} + +func init() { + t["HostActiveDirectoryAuthentication"] = reflect.TypeOf((*HostActiveDirectoryAuthentication)(nil)).Elem() +} + +type HostAuthenticationManager struct { + Self types.ManagedObjectReference + + Info types.HostAuthenticationManagerInfo `mo:"info"` + SupportedStore []types.ManagedObjectReference `mo:"supportedStore"` +} + +func (m HostAuthenticationManager) Reference() types.ManagedObjectReference { + return m.Self +} + +func init() { + t["HostAuthenticationManager"] = reflect.TypeOf((*HostAuthenticationManager)(nil)).Elem() +} + +type HostAuthenticationStore struct { + Self types.ManagedObjectReference + + Info types.BaseHostAuthenticationStoreInfo `mo:"info"` +} + +func (m HostAuthenticationStore) Reference() types.ManagedObjectReference { + return m.Self +} + +func init() { + t["HostAuthenticationStore"] = reflect.TypeOf((*HostAuthenticationStore)(nil)).Elem() +} + +type HostAutoStartManager struct { + Self types.ManagedObjectReference + + Config types.HostAutoStartManagerConfig `mo:"config"` +} + +func (m HostAutoStartManager) Reference() types.ManagedObjectReference { + return m.Self +} + +func init() { + t["HostAutoStartManager"] = reflect.TypeOf((*HostAutoStartManager)(nil)).Elem() +} + +type HostBootDeviceSystem struct { + Self types.ManagedObjectReference +} + +func (m HostBootDeviceSystem) Reference() types.ManagedObjectReference { + return m.Self +} + +func init() { + t["HostBootDeviceSystem"] = reflect.TypeOf((*HostBootDeviceSystem)(nil)).Elem() +} + +type HostCacheConfigurationManager struct { + Self types.ManagedObjectReference + + CacheConfigurationInfo []types.HostCacheConfigurationInfo `mo:"cacheConfigurationInfo"` +} + +func (m HostCacheConfigurationManager) Reference() types.ManagedObjectReference { + return m.Self +} + +func init() { + t["HostCacheConfigurationManager"] = reflect.TypeOf((*HostCacheConfigurationManager)(nil)).Elem() +} + +type HostCertificateManager struct { + Self types.ManagedObjectReference + + CertificateInfo types.HostCertificateManagerCertificateInfo `mo:"certificateInfo"` +} + +func (m HostCertificateManager) Reference() types.ManagedObjectReference { + return m.Self +} + +func init() { + t["HostCertificateManager"] = reflect.TypeOf((*HostCertificateManager)(nil)).Elem() +} + +type HostCpuSchedulerSystem struct { + ExtensibleManagedObject + + HyperthreadInfo *types.HostHyperThreadScheduleInfo `mo:"hyperthreadInfo"` +} + +func init() { + t["HostCpuSchedulerSystem"] = reflect.TypeOf((*HostCpuSchedulerSystem)(nil)).Elem() +} + +type HostDatastoreBrowser struct { + Self types.ManagedObjectReference + + Datastore []types.ManagedObjectReference `mo:"datastore"` + SupportedType []types.BaseFileQuery `mo:"supportedType"` +} + +func (m HostDatastoreBrowser) Reference() types.ManagedObjectReference { + return m.Self +} + +func init() { + t["HostDatastoreBrowser"] = reflect.TypeOf((*HostDatastoreBrowser)(nil)).Elem() +} + +type HostDatastoreSystem struct { + Self types.ManagedObjectReference + + Datastore []types.ManagedObjectReference `mo:"datastore"` + Capabilities types.HostDatastoreSystemCapabilities `mo:"capabilities"` +} + +func (m HostDatastoreSystem) Reference() types.ManagedObjectReference { + return m.Self +} + +func init() { + t["HostDatastoreSystem"] = reflect.TypeOf((*HostDatastoreSystem)(nil)).Elem() +} + +type HostDateTimeSystem struct { + Self types.ManagedObjectReference + + DateTimeInfo types.HostDateTimeInfo `mo:"dateTimeInfo"` +} + +func (m HostDateTimeSystem) Reference() types.ManagedObjectReference { + return m.Self +} + +func init() { + t["HostDateTimeSystem"] = reflect.TypeOf((*HostDateTimeSystem)(nil)).Elem() +} + +type HostDiagnosticSystem struct { + Self types.ManagedObjectReference + + ActivePartition *types.HostDiagnosticPartition `mo:"activePartition"` +} + +func (m HostDiagnosticSystem) Reference() types.ManagedObjectReference { + return m.Self +} + +func init() { + t["HostDiagnosticSystem"] = reflect.TypeOf((*HostDiagnosticSystem)(nil)).Elem() +} + +type HostDirectoryStore struct { + HostAuthenticationStore +} + +func init() { + t["HostDirectoryStore"] = reflect.TypeOf((*HostDirectoryStore)(nil)).Elem() +} + +type HostEsxAgentHostManager struct { + Self types.ManagedObjectReference + + ConfigInfo types.HostEsxAgentHostManagerConfigInfo `mo:"configInfo"` +} + +func (m HostEsxAgentHostManager) Reference() types.ManagedObjectReference { + return m.Self +} + +func init() { + t["HostEsxAgentHostManager"] = reflect.TypeOf((*HostEsxAgentHostManager)(nil)).Elem() +} + +type HostFirewallSystem struct { + ExtensibleManagedObject + + FirewallInfo *types.HostFirewallInfo `mo:"firewallInfo"` +} + +func init() { + t["HostFirewallSystem"] = reflect.TypeOf((*HostFirewallSystem)(nil)).Elem() +} + +type HostFirmwareSystem struct { + Self types.ManagedObjectReference +} + +func (m HostFirmwareSystem) Reference() types.ManagedObjectReference { + return m.Self +} + +func init() { + t["HostFirmwareSystem"] = reflect.TypeOf((*HostFirmwareSystem)(nil)).Elem() +} + +type HostGraphicsManager struct { + ExtensibleManagedObject + + GraphicsInfo []types.HostGraphicsInfo `mo:"graphicsInfo"` + SharedPassthruGpuTypes []string `mo:"sharedPassthruGpuTypes"` +} + +func init() { + t["HostGraphicsManager"] = reflect.TypeOf((*HostGraphicsManager)(nil)).Elem() +} + +type HostHealthStatusSystem struct { + Self types.ManagedObjectReference + + Runtime types.HealthSystemRuntime `mo:"runtime"` +} + +func (m HostHealthStatusSystem) Reference() types.ManagedObjectReference { + return m.Self +} + +func init() { + t["HostHealthStatusSystem"] = reflect.TypeOf((*HostHealthStatusSystem)(nil)).Elem() +} + +type HostImageConfigManager struct { + Self types.ManagedObjectReference +} + +func (m HostImageConfigManager) Reference() types.ManagedObjectReference { + return m.Self +} + +func init() { + t["HostImageConfigManager"] = reflect.TypeOf((*HostImageConfigManager)(nil)).Elem() +} + +type HostKernelModuleSystem struct { + Self types.ManagedObjectReference +} + +func (m HostKernelModuleSystem) Reference() types.ManagedObjectReference { + return m.Self +} + +func init() { + t["HostKernelModuleSystem"] = reflect.TypeOf((*HostKernelModuleSystem)(nil)).Elem() +} + +type HostLocalAccountManager struct { + Self types.ManagedObjectReference +} + +func (m HostLocalAccountManager) Reference() types.ManagedObjectReference { + return m.Self +} + +func init() { + t["HostLocalAccountManager"] = reflect.TypeOf((*HostLocalAccountManager)(nil)).Elem() +} + +type HostLocalAuthentication struct { + HostAuthenticationStore +} + +func init() { + t["HostLocalAuthentication"] = reflect.TypeOf((*HostLocalAuthentication)(nil)).Elem() +} + +type HostMemorySystem struct { + ExtensibleManagedObject + + ConsoleReservationInfo *types.ServiceConsoleReservationInfo `mo:"consoleReservationInfo"` + VirtualMachineReservationInfo *types.VirtualMachineMemoryReservationInfo `mo:"virtualMachineReservationInfo"` +} + +func init() { + t["HostMemorySystem"] = reflect.TypeOf((*HostMemorySystem)(nil)).Elem() +} + +type HostNetworkSystem struct { + ExtensibleManagedObject + + Capabilities *types.HostNetCapabilities `mo:"capabilities"` + NetworkInfo *types.HostNetworkInfo `mo:"networkInfo"` + OffloadCapabilities *types.HostNetOffloadCapabilities `mo:"offloadCapabilities"` + NetworkConfig *types.HostNetworkConfig `mo:"networkConfig"` + DnsConfig types.BaseHostDnsConfig `mo:"dnsConfig"` + IpRouteConfig types.BaseHostIpRouteConfig `mo:"ipRouteConfig"` + ConsoleIpRouteConfig types.BaseHostIpRouteConfig `mo:"consoleIpRouteConfig"` +} + +func init() { + t["HostNetworkSystem"] = reflect.TypeOf((*HostNetworkSystem)(nil)).Elem() +} + +type HostPatchManager struct { + Self types.ManagedObjectReference +} + +func (m HostPatchManager) Reference() types.ManagedObjectReference { + return m.Self +} + +func init() { + t["HostPatchManager"] = reflect.TypeOf((*HostPatchManager)(nil)).Elem() +} + +type HostPciPassthruSystem struct { + ExtensibleManagedObject + + PciPassthruInfo []types.BaseHostPciPassthruInfo `mo:"pciPassthruInfo"` +} + +func init() { + t["HostPciPassthruSystem"] = reflect.TypeOf((*HostPciPassthruSystem)(nil)).Elem() +} + +type HostPowerSystem struct { + Self types.ManagedObjectReference + + Capability types.PowerSystemCapability `mo:"capability"` + Info types.PowerSystemInfo `mo:"info"` +} + +func (m HostPowerSystem) Reference() types.ManagedObjectReference { + return m.Self +} + +func init() { + t["HostPowerSystem"] = reflect.TypeOf((*HostPowerSystem)(nil)).Elem() +} + +type HostProfile struct { + Profile + + ReferenceHost *types.ManagedObjectReference `mo:"referenceHost"` +} + +func init() { + t["HostProfile"] = reflect.TypeOf((*HostProfile)(nil)).Elem() +} + +type HostProfileManager struct { + ProfileManager +} + +func init() { + t["HostProfileManager"] = reflect.TypeOf((*HostProfileManager)(nil)).Elem() +} + +type HostServiceSystem struct { + ExtensibleManagedObject + + ServiceInfo types.HostServiceInfo `mo:"serviceInfo"` +} + +func init() { + t["HostServiceSystem"] = reflect.TypeOf((*HostServiceSystem)(nil)).Elem() +} + +type HostSnmpSystem struct { + Self types.ManagedObjectReference + + Configuration types.HostSnmpConfigSpec `mo:"configuration"` + Limits types.HostSnmpSystemAgentLimits `mo:"limits"` +} + +func (m HostSnmpSystem) Reference() types.ManagedObjectReference { + return m.Self +} + +func init() { + t["HostSnmpSystem"] = reflect.TypeOf((*HostSnmpSystem)(nil)).Elem() +} + +type HostStorageSystem struct { + ExtensibleManagedObject + + StorageDeviceInfo *types.HostStorageDeviceInfo `mo:"storageDeviceInfo"` + FileSystemVolumeInfo types.HostFileSystemVolumeInfo `mo:"fileSystemVolumeInfo"` + SystemFile []string `mo:"systemFile"` + MultipathStateInfo *types.HostMultipathStateInfo `mo:"multipathStateInfo"` +} + +func init() { + t["HostStorageSystem"] = reflect.TypeOf((*HostStorageSystem)(nil)).Elem() +} + +type HostSystem struct { + ManagedEntity + + Runtime types.HostRuntimeInfo `mo:"runtime"` + Summary types.HostListSummary `mo:"summary"` + Hardware *types.HostHardwareInfo `mo:"hardware"` + Capability *types.HostCapability `mo:"capability"` + LicensableResource types.HostLicensableResourceInfo `mo:"licensableResource"` + ConfigManager types.HostConfigManager `mo:"configManager"` + Config *types.HostConfigInfo `mo:"config"` + Vm []types.ManagedObjectReference `mo:"vm"` + Datastore []types.ManagedObjectReference `mo:"datastore"` + Network []types.ManagedObjectReference `mo:"network"` + DatastoreBrowser types.ManagedObjectReference `mo:"datastoreBrowser"` + SystemResources *types.HostSystemResourceInfo `mo:"systemResources"` +} + +func (m *HostSystem) Entity() *ManagedEntity { + return &m.ManagedEntity +} + +func init() { + t["HostSystem"] = reflect.TypeOf((*HostSystem)(nil)).Elem() +} + +type HostVFlashManager struct { + Self types.ManagedObjectReference + + VFlashConfigInfo *types.HostVFlashManagerVFlashConfigInfo `mo:"vFlashConfigInfo"` +} + +func (m HostVFlashManager) Reference() types.ManagedObjectReference { + return m.Self +} + +func init() { + t["HostVFlashManager"] = reflect.TypeOf((*HostVFlashManager)(nil)).Elem() +} + +type HostVMotionSystem struct { + ExtensibleManagedObject + + NetConfig *types.HostVMotionNetConfig `mo:"netConfig"` + IpConfig *types.HostIpConfig `mo:"ipConfig"` +} + +func init() { + t["HostVMotionSystem"] = reflect.TypeOf((*HostVMotionSystem)(nil)).Elem() +} + +type HostVirtualNicManager struct { + ExtensibleManagedObject + + Info types.HostVirtualNicManagerInfo `mo:"info"` +} + +func init() { + t["HostVirtualNicManager"] = reflect.TypeOf((*HostVirtualNicManager)(nil)).Elem() +} + +type HostVsanInternalSystem struct { + Self types.ManagedObjectReference +} + +func (m HostVsanInternalSystem) Reference() types.ManagedObjectReference { + return m.Self +} + +func init() { + t["HostVsanInternalSystem"] = reflect.TypeOf((*HostVsanInternalSystem)(nil)).Elem() +} + +type HostVsanSystem struct { + Self types.ManagedObjectReference + + Config types.VsanHostConfigInfo `mo:"config"` +} + +func (m HostVsanSystem) Reference() types.ManagedObjectReference { + return m.Self +} + +func init() { + t["HostVsanSystem"] = reflect.TypeOf((*HostVsanSystem)(nil)).Elem() +} + +type HttpNfcLease struct { + Self types.ManagedObjectReference + + InitializeProgress int32 `mo:"initializeProgress"` + Info *types.HttpNfcLeaseInfo `mo:"info"` + State types.HttpNfcLeaseState `mo:"state"` + Error *types.LocalizedMethodFault `mo:"error"` +} + +func (m HttpNfcLease) Reference() types.ManagedObjectReference { + return m.Self +} + +func init() { + t["HttpNfcLease"] = reflect.TypeOf((*HttpNfcLease)(nil)).Elem() +} + +type InventoryView struct { + ManagedObjectView +} + +func init() { + t["InventoryView"] = reflect.TypeOf((*InventoryView)(nil)).Elem() +} + +type IoFilterManager struct { + Self types.ManagedObjectReference +} + +func (m IoFilterManager) Reference() types.ManagedObjectReference { + return m.Self +} + +func init() { + t["IoFilterManager"] = reflect.TypeOf((*IoFilterManager)(nil)).Elem() +} + +type IpPoolManager struct { + Self types.ManagedObjectReference +} + +func (m IpPoolManager) Reference() types.ManagedObjectReference { + return m.Self +} + +func init() { + t["IpPoolManager"] = reflect.TypeOf((*IpPoolManager)(nil)).Elem() +} + +type IscsiManager struct { + Self types.ManagedObjectReference +} + +func (m IscsiManager) Reference() types.ManagedObjectReference { + return m.Self +} + +func init() { + t["IscsiManager"] = reflect.TypeOf((*IscsiManager)(nil)).Elem() +} + +type LicenseAssignmentManager struct { + Self types.ManagedObjectReference +} + +func (m LicenseAssignmentManager) Reference() types.ManagedObjectReference { + return m.Self +} + +func init() { + t["LicenseAssignmentManager"] = reflect.TypeOf((*LicenseAssignmentManager)(nil)).Elem() +} + +type LicenseManager struct { + Self types.ManagedObjectReference + + Source types.BaseLicenseSource `mo:"source"` + SourceAvailable bool `mo:"sourceAvailable"` + Diagnostics *types.LicenseDiagnostics `mo:"diagnostics"` + FeatureInfo []types.LicenseFeatureInfo `mo:"featureInfo"` + LicensedEdition string `mo:"licensedEdition"` + Licenses []types.LicenseManagerLicenseInfo `mo:"licenses"` + LicenseAssignmentManager *types.ManagedObjectReference `mo:"licenseAssignmentManager"` + Evaluation types.LicenseManagerEvaluationInfo `mo:"evaluation"` +} + +func (m LicenseManager) Reference() types.ManagedObjectReference { + return m.Self +} + +func init() { + t["LicenseManager"] = reflect.TypeOf((*LicenseManager)(nil)).Elem() +} + +type ListView struct { + ManagedObjectView +} + +func init() { + t["ListView"] = reflect.TypeOf((*ListView)(nil)).Elem() +} + +type LocalizationManager struct { + Self types.ManagedObjectReference + + Catalog []types.LocalizationManagerMessageCatalog `mo:"catalog"` +} + +func (m LocalizationManager) Reference() types.ManagedObjectReference { + return m.Self +} + +func init() { + t["LocalizationManager"] = reflect.TypeOf((*LocalizationManager)(nil)).Elem() +} + +type ManagedEntity struct { + ExtensibleManagedObject + + Parent *types.ManagedObjectReference `mo:"parent"` + CustomValue []types.BaseCustomFieldValue `mo:"customValue"` + OverallStatus types.ManagedEntityStatus `mo:"overallStatus"` + ConfigStatus types.ManagedEntityStatus `mo:"configStatus"` + ConfigIssue []types.BaseEvent `mo:"configIssue"` + EffectiveRole []int32 `mo:"effectiveRole"` + Permission []types.Permission `mo:"permission"` + Name string `mo:"name"` + DisabledMethod []string `mo:"disabledMethod"` + RecentTask []types.ManagedObjectReference `mo:"recentTask"` + DeclaredAlarmState []types.AlarmState `mo:"declaredAlarmState"` + TriggeredAlarmState []types.AlarmState `mo:"triggeredAlarmState"` + AlarmActionsEnabled *bool `mo:"alarmActionsEnabled"` + Tag []types.Tag `mo:"tag"` +} + +func init() { + t["ManagedEntity"] = reflect.TypeOf((*ManagedEntity)(nil)).Elem() +} + +type ManagedObjectView struct { + Self types.ManagedObjectReference + + View []types.ManagedObjectReference `mo:"view"` +} + +func (m ManagedObjectView) Reference() types.ManagedObjectReference { + return m.Self +} + +func init() { + t["ManagedObjectView"] = reflect.TypeOf((*ManagedObjectView)(nil)).Elem() +} + +type MessageBusProxy struct { + Self types.ManagedObjectReference +} + +func (m MessageBusProxy) Reference() types.ManagedObjectReference { + return m.Self +} + +func init() { + t["MessageBusProxy"] = reflect.TypeOf((*MessageBusProxy)(nil)).Elem() +} + +type Network struct { + ManagedEntity + + Name string `mo:"name"` + Summary types.BaseNetworkSummary `mo:"summary"` + Host []types.ManagedObjectReference `mo:"host"` + Vm []types.ManagedObjectReference `mo:"vm"` +} + +func (m *Network) Entity() *ManagedEntity { + return &m.ManagedEntity +} + +func init() { + t["Network"] = reflect.TypeOf((*Network)(nil)).Elem() +} + +type OpaqueNetwork struct { + Network +} + +func init() { + t["OpaqueNetwork"] = reflect.TypeOf((*OpaqueNetwork)(nil)).Elem() +} + +type OptionManager struct { + Self types.ManagedObjectReference + + SupportedOption []types.OptionDef `mo:"supportedOption"` + Setting []types.BaseOptionValue `mo:"setting"` +} + +func (m OptionManager) Reference() types.ManagedObjectReference { + return m.Self +} + +func init() { + t["OptionManager"] = reflect.TypeOf((*OptionManager)(nil)).Elem() +} + +type OverheadMemoryManager struct { + Self types.ManagedObjectReference +} + +func (m OverheadMemoryManager) Reference() types.ManagedObjectReference { + return m.Self +} + +func init() { + t["OverheadMemoryManager"] = reflect.TypeOf((*OverheadMemoryManager)(nil)).Elem() +} + +type OvfManager struct { + Self types.ManagedObjectReference + + OvfImportOption []types.OvfOptionInfo `mo:"ovfImportOption"` + OvfExportOption []types.OvfOptionInfo `mo:"ovfExportOption"` +} + +func (m OvfManager) Reference() types.ManagedObjectReference { + return m.Self +} + +func init() { + t["OvfManager"] = reflect.TypeOf((*OvfManager)(nil)).Elem() +} + +type PerformanceManager struct { + Self types.ManagedObjectReference + + Description types.PerformanceDescription `mo:"description"` + HistoricalInterval []types.PerfInterval `mo:"historicalInterval"` + PerfCounter []types.PerfCounterInfo `mo:"perfCounter"` +} + +func (m PerformanceManager) Reference() types.ManagedObjectReference { + return m.Self +} + +func init() { + t["PerformanceManager"] = reflect.TypeOf((*PerformanceManager)(nil)).Elem() +} + +type Profile struct { + Self types.ManagedObjectReference + + Config types.BaseProfileConfigInfo `mo:"config"` + Description *types.ProfileDescription `mo:"description"` + Name string `mo:"name"` + CreatedTime time.Time `mo:"createdTime"` + ModifiedTime time.Time `mo:"modifiedTime"` + Entity []types.ManagedObjectReference `mo:"entity"` + ComplianceStatus string `mo:"complianceStatus"` +} + +func (m Profile) Reference() types.ManagedObjectReference { + return m.Self +} + +func init() { + t["Profile"] = reflect.TypeOf((*Profile)(nil)).Elem() +} + +type ProfileComplianceManager struct { + Self types.ManagedObjectReference +} + +func (m ProfileComplianceManager) Reference() types.ManagedObjectReference { + return m.Self +} + +func init() { + t["ProfileComplianceManager"] = reflect.TypeOf((*ProfileComplianceManager)(nil)).Elem() +} + +type ProfileManager struct { + Self types.ManagedObjectReference + + Profile []types.ManagedObjectReference `mo:"profile"` +} + +func (m ProfileManager) Reference() types.ManagedObjectReference { + return m.Self +} + +func init() { + t["ProfileManager"] = reflect.TypeOf((*ProfileManager)(nil)).Elem() +} + +type PropertyCollector struct { + Self types.ManagedObjectReference + + Filter []types.ManagedObjectReference `mo:"filter"` +} + +func (m PropertyCollector) Reference() types.ManagedObjectReference { + return m.Self +} + +func init() { + t["PropertyCollector"] = reflect.TypeOf((*PropertyCollector)(nil)).Elem() +} + +type PropertyFilter struct { + Self types.ManagedObjectReference + + Spec types.PropertyFilterSpec `mo:"spec"` + PartialUpdates bool `mo:"partialUpdates"` +} + +func (m PropertyFilter) Reference() types.ManagedObjectReference { + return m.Self +} + +func init() { + t["PropertyFilter"] = reflect.TypeOf((*PropertyFilter)(nil)).Elem() +} + +type ResourcePlanningManager struct { + Self types.ManagedObjectReference +} + +func (m ResourcePlanningManager) Reference() types.ManagedObjectReference { + return m.Self +} + +func init() { + t["ResourcePlanningManager"] = reflect.TypeOf((*ResourcePlanningManager)(nil)).Elem() +} + +type ResourcePool struct { + ManagedEntity + + Summary types.BaseResourcePoolSummary `mo:"summary"` + Runtime types.ResourcePoolRuntimeInfo `mo:"runtime"` + Owner types.ManagedObjectReference `mo:"owner"` + ResourcePool []types.ManagedObjectReference `mo:"resourcePool"` + Vm []types.ManagedObjectReference `mo:"vm"` + Config types.ResourceConfigSpec `mo:"config"` + ChildConfiguration []types.ResourceConfigSpec `mo:"childConfiguration"` +} + +func (m *ResourcePool) Entity() *ManagedEntity { + return &m.ManagedEntity +} + +func init() { + t["ResourcePool"] = reflect.TypeOf((*ResourcePool)(nil)).Elem() +} + +type ScheduledTask struct { + ExtensibleManagedObject + + Info types.ScheduledTaskInfo `mo:"info"` +} + +func init() { + t["ScheduledTask"] = reflect.TypeOf((*ScheduledTask)(nil)).Elem() +} + +type ScheduledTaskManager struct { + Self types.ManagedObjectReference + + ScheduledTask []types.ManagedObjectReference `mo:"scheduledTask"` + Description types.ScheduledTaskDescription `mo:"description"` +} + +func (m ScheduledTaskManager) Reference() types.ManagedObjectReference { + return m.Self +} + +func init() { + t["ScheduledTaskManager"] = reflect.TypeOf((*ScheduledTaskManager)(nil)).Elem() +} + +type SearchIndex struct { + Self types.ManagedObjectReference +} + +func (m SearchIndex) Reference() types.ManagedObjectReference { + return m.Self +} + +func init() { + t["SearchIndex"] = reflect.TypeOf((*SearchIndex)(nil)).Elem() +} + +type ServiceInstance struct { + Self types.ManagedObjectReference + + ServerClock time.Time `mo:"serverClock"` + Capability types.Capability `mo:"capability"` + Content types.ServiceContent `mo:"content"` +} + +func (m ServiceInstance) Reference() types.ManagedObjectReference { + return m.Self +} + +func init() { + t["ServiceInstance"] = reflect.TypeOf((*ServiceInstance)(nil)).Elem() +} + +type ServiceManager struct { + Self types.ManagedObjectReference + + Service []types.ServiceManagerServiceInfo `mo:"service"` +} + +func (m ServiceManager) Reference() types.ManagedObjectReference { + return m.Self +} + +func init() { + t["ServiceManager"] = reflect.TypeOf((*ServiceManager)(nil)).Elem() +} + +type SessionManager struct { + Self types.ManagedObjectReference + + SessionList []types.UserSession `mo:"sessionList"` + CurrentSession *types.UserSession `mo:"currentSession"` + Message *string `mo:"message"` + MessageLocaleList []string `mo:"messageLocaleList"` + SupportedLocaleList []string `mo:"supportedLocaleList"` + DefaultLocale string `mo:"defaultLocale"` +} + +func (m SessionManager) Reference() types.ManagedObjectReference { + return m.Self +} + +func init() { + t["SessionManager"] = reflect.TypeOf((*SessionManager)(nil)).Elem() +} + +type SimpleCommand struct { + Self types.ManagedObjectReference + + EncodingType types.SimpleCommandEncoding `mo:"encodingType"` + Entity types.ServiceManagerServiceInfo `mo:"entity"` +} + +func (m SimpleCommand) Reference() types.ManagedObjectReference { + return m.Self +} + +func init() { + t["SimpleCommand"] = reflect.TypeOf((*SimpleCommand)(nil)).Elem() +} + +type StoragePod struct { + Folder + + Summary *types.StoragePodSummary `mo:"summary"` + PodStorageDrsEntry *types.PodStorageDrsEntry `mo:"podStorageDrsEntry"` +} + +func init() { + t["StoragePod"] = reflect.TypeOf((*StoragePod)(nil)).Elem() +} + +type StorageResourceManager struct { + Self types.ManagedObjectReference +} + +func (m StorageResourceManager) Reference() types.ManagedObjectReference { + return m.Self +} + +func init() { + t["StorageResourceManager"] = reflect.TypeOf((*StorageResourceManager)(nil)).Elem() +} + +type Task struct { + ExtensibleManagedObject + + Info types.TaskInfo `mo:"info"` +} + +func init() { + t["Task"] = reflect.TypeOf((*Task)(nil)).Elem() +} + +type TaskHistoryCollector struct { + HistoryCollector + + LatestPage []types.TaskInfo `mo:"latestPage"` +} + +func init() { + t["TaskHistoryCollector"] = reflect.TypeOf((*TaskHistoryCollector)(nil)).Elem() +} + +type TaskManager struct { + Self types.ManagedObjectReference + + RecentTask []types.ManagedObjectReference `mo:"recentTask"` + Description types.TaskDescription `mo:"description"` + MaxCollector int32 `mo:"maxCollector"` +} + +func (m TaskManager) Reference() types.ManagedObjectReference { + return m.Self +} + +func init() { + t["TaskManager"] = reflect.TypeOf((*TaskManager)(nil)).Elem() +} + +type UserDirectory struct { + Self types.ManagedObjectReference + + DomainList []string `mo:"domainList"` +} + +func (m UserDirectory) Reference() types.ManagedObjectReference { + return m.Self +} + +func init() { + t["UserDirectory"] = reflect.TypeOf((*UserDirectory)(nil)).Elem() +} + +type VRPResourceManager struct { + Self types.ManagedObjectReference +} + +func (m VRPResourceManager) Reference() types.ManagedObjectReference { + return m.Self +} + +func init() { + t["VRPResourceManager"] = reflect.TypeOf((*VRPResourceManager)(nil)).Elem() +} + +type View struct { + Self types.ManagedObjectReference +} + +func (m View) Reference() types.ManagedObjectReference { + return m.Self +} + +func init() { + t["View"] = reflect.TypeOf((*View)(nil)).Elem() +} + +type ViewManager struct { + Self types.ManagedObjectReference + + ViewList []types.ManagedObjectReference `mo:"viewList"` +} + +func (m ViewManager) Reference() types.ManagedObjectReference { + return m.Self +} + +func init() { + t["ViewManager"] = reflect.TypeOf((*ViewManager)(nil)).Elem() +} + +type VirtualApp struct { + ResourcePool + + ParentFolder *types.ManagedObjectReference `mo:"parentFolder"` + Datastore []types.ManagedObjectReference `mo:"datastore"` + Network []types.ManagedObjectReference `mo:"network"` + VAppConfig *types.VAppConfigInfo `mo:"vAppConfig"` + ParentVApp *types.ManagedObjectReference `mo:"parentVApp"` + ChildLink []types.VirtualAppLinkInfo `mo:"childLink"` +} + +func init() { + t["VirtualApp"] = reflect.TypeOf((*VirtualApp)(nil)).Elem() +} + +type VirtualDiskManager struct { + Self types.ManagedObjectReference +} + +func (m VirtualDiskManager) Reference() types.ManagedObjectReference { + return m.Self +} + +func init() { + t["VirtualDiskManager"] = reflect.TypeOf((*VirtualDiskManager)(nil)).Elem() +} + +type VirtualMachine struct { + ManagedEntity + + Capability types.VirtualMachineCapability `mo:"capability"` + Config *types.VirtualMachineConfigInfo `mo:"config"` + Layout *types.VirtualMachineFileLayout `mo:"layout"` + LayoutEx *types.VirtualMachineFileLayoutEx `mo:"layoutEx"` + Storage *types.VirtualMachineStorageInfo `mo:"storage"` + EnvironmentBrowser types.ManagedObjectReference `mo:"environmentBrowser"` + ResourcePool *types.ManagedObjectReference `mo:"resourcePool"` + ParentVApp *types.ManagedObjectReference `mo:"parentVApp"` + ResourceConfig *types.ResourceConfigSpec `mo:"resourceConfig"` + Runtime types.VirtualMachineRuntimeInfo `mo:"runtime"` + Guest *types.GuestInfo `mo:"guest"` + Summary types.VirtualMachineSummary `mo:"summary"` + Datastore []types.ManagedObjectReference `mo:"datastore"` + Network []types.ManagedObjectReference `mo:"network"` + Snapshot *types.VirtualMachineSnapshotInfo `mo:"snapshot"` + RootSnapshot []types.ManagedObjectReference `mo:"rootSnapshot"` + GuestHeartbeatStatus types.ManagedEntityStatus `mo:"guestHeartbeatStatus"` +} + +func (m *VirtualMachine) Entity() *ManagedEntity { + return &m.ManagedEntity +} + +func init() { + t["VirtualMachine"] = reflect.TypeOf((*VirtualMachine)(nil)).Elem() +} + +type VirtualMachineCompatibilityChecker struct { + Self types.ManagedObjectReference +} + +func (m VirtualMachineCompatibilityChecker) Reference() types.ManagedObjectReference { + return m.Self +} + +func init() { + t["VirtualMachineCompatibilityChecker"] = reflect.TypeOf((*VirtualMachineCompatibilityChecker)(nil)).Elem() +} + +type VirtualMachineProvisioningChecker struct { + Self types.ManagedObjectReference +} + +func (m VirtualMachineProvisioningChecker) Reference() types.ManagedObjectReference { + return m.Self +} + +func init() { + t["VirtualMachineProvisioningChecker"] = reflect.TypeOf((*VirtualMachineProvisioningChecker)(nil)).Elem() +} + +type VirtualMachineSnapshot struct { + ExtensibleManagedObject + + Config types.VirtualMachineConfigInfo `mo:"config"` + ChildSnapshot []types.ManagedObjectReference `mo:"childSnapshot"` + Vm types.ManagedObjectReference `mo:"vm"` +} + +func init() { + t["VirtualMachineSnapshot"] = reflect.TypeOf((*VirtualMachineSnapshot)(nil)).Elem() +} + +type VirtualizationManager struct { + Self types.ManagedObjectReference +} + +func (m VirtualizationManager) Reference() types.ManagedObjectReference { + return m.Self +} + +func init() { + t["VirtualizationManager"] = reflect.TypeOf((*VirtualizationManager)(nil)).Elem() +} + +type VmwareDistributedVirtualSwitch struct { + DistributedVirtualSwitch +} + +func init() { + t["VmwareDistributedVirtualSwitch"] = reflect.TypeOf((*VmwareDistributedVirtualSwitch)(nil)).Elem() +} + +type VsanUpgradeSystem struct { + Self types.ManagedObjectReference +} + +func (m VsanUpgradeSystem) Reference() types.ManagedObjectReference { + return m.Self +} + +func init() { + t["VsanUpgradeSystem"] = reflect.TypeOf((*VsanUpgradeSystem)(nil)).Elem() +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/vim25/mo/reference.go juju-core-2.0.2/src/github.com/vmware/govmomi/vim25/mo/reference.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/vim25/mo/reference.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/vim25/mo/reference.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,26 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package mo + +import "github.com/vmware/govmomi/vim25/types" + +// Reference is the interface that is implemented by all the managed objects +// defined in this package. It specifies that these managed objects have a +// function that returns the managed object reference to themselves. +type Reference interface { + Reference() types.ManagedObjectReference +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/vim25/mo/registry.go juju-core-2.0.2/src/github.com/vmware/govmomi/vim25/mo/registry.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/vim25/mo/registry.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/vim25/mo/registry.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,21 @@ +/* +Copyright (c) 2014 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package mo + +import "reflect" + +var t = map[string]reflect.Type{} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/vim25/mo/retrieve.go juju-core-2.0.2/src/github.com/vmware/govmomi/vim25/mo/retrieve.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/vim25/mo/retrieve.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/vim25/mo/retrieve.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,174 @@ +/* +Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package mo + +import ( + "reflect" + + "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/soap" + "github.com/vmware/govmomi/vim25/types" + "golang.org/x/net/context" +) + +func ignoreMissingProperty(ref types.ManagedObjectReference, p types.MissingProperty) bool { + switch ref.Type { + case "VirtualMachine": + switch p.Path { + case "environmentBrowser": + // See https://github.com/vmware/govmomi/pull/242 + return true + case "alarmActionsEnabled": + // Seen with vApp child VM + return true + } + } + + return false +} + +// ObjectContentToType loads an ObjectContent value into the value it +// represents. If the ObjectContent value has a non-empty 'MissingSet' field, +// it returns the first fault it finds there as error. If the 'MissingSet' +// field is empty, it returns a pointer to a reflect.Value. It handles contain +// nested properties, such as 'guest.ipAddress' or 'config.hardware'. +func ObjectContentToType(o types.ObjectContent) (interface{}, error) { + // Expect no properties in the missing set + for _, p := range o.MissingSet { + if ignoreMissingProperty(o.Obj, p) { + continue + } + + return nil, soap.WrapVimFault(p.Fault.Fault) + } + + ti := typeInfoForType(o.Obj.Type) + v, err := ti.LoadFromObjectContent(o) + if err != nil { + return nil, err + } + + return v.Elem().Interface(), nil +} + +// LoadRetrievePropertiesResponse converts the response of a call to +// RetrieveProperties to one or more managed objects. +func LoadRetrievePropertiesResponse(res *types.RetrievePropertiesResponse, dst interface{}) error { + rt := reflect.TypeOf(dst) + if rt == nil || rt.Kind() != reflect.Ptr { + panic("need pointer") + } + + rv := reflect.ValueOf(dst).Elem() + if !rv.CanSet() { + panic("cannot set dst") + } + + isSlice := false + switch rt.Elem().Kind() { + case reflect.Struct: + case reflect.Slice: + isSlice = true + default: + panic("unexpected type") + } + + if isSlice { + for _, p := range res.Returnval { + v, err := ObjectContentToType(p) + if err != nil { + return err + } + + vt := reflect.TypeOf(v) + + if !rv.Type().AssignableTo(vt) { + // For example: dst is []ManagedEntity, res is []HostSystem + if field, ok := vt.FieldByName(rt.Elem().Elem().Name()); ok && field.Anonymous { + rv.Set(reflect.Append(rv, reflect.ValueOf(v).FieldByIndex(field.Index))) + continue + } + } + + rv.Set(reflect.Append(rv, reflect.ValueOf(v))) + } + } else { + switch len(res.Returnval) { + case 0: + case 1: + v, err := ObjectContentToType(res.Returnval[0]) + if err != nil { + return err + } + + vt := reflect.TypeOf(v) + + if !rv.Type().AssignableTo(vt) { + // For example: dst is ComputeResource, res is ClusterComputeResource + if field, ok := vt.FieldByName(rt.Elem().Name()); ok && field.Anonymous { + rv.Set(reflect.ValueOf(v).FieldByIndex(field.Index)) + return nil + } + } + + rv.Set(reflect.ValueOf(v)) + default: + // If dst is not a slice, expect to receive 0 or 1 results + panic("more than 1 result") + } + } + + return nil +} + +// RetrievePropertiesForRequest calls the RetrieveProperties method with the +// specified request and decodes the response struct into the value pointed to +// by dst. +func RetrievePropertiesForRequest(ctx context.Context, r soap.RoundTripper, req types.RetrieveProperties, dst interface{}) error { + res, err := methods.RetrieveProperties(ctx, r, &req) + if err != nil { + return err + } + + return LoadRetrievePropertiesResponse(res, dst) +} + +// RetrieveProperties retrieves the properties of the managed object specified +// as obj and decodes the response struct into the value pointed to by dst. +func RetrieveProperties(ctx context.Context, r soap.RoundTripper, pc, obj types.ManagedObjectReference, dst interface{}) error { + req := types.RetrieveProperties{ + This: pc, + SpecSet: []types.PropertyFilterSpec{ + { + ObjectSet: []types.ObjectSpec{ + { + Obj: obj, + Skip: types.NewBool(false), + }, + }, + PropSet: []types.PropertySpec{ + { + All: types.NewBool(true), + Type: obj.Type, + }, + }, + }, + }, + } + + return RetrievePropertiesForRequest(ctx, r, req, dst) +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/vim25/mo/retrieve_test.go juju-core-2.0.2/src/github.com/vmware/govmomi/vim25/mo/retrieve_test.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/vim25/mo/retrieve_test.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/vim25/mo/retrieve_test.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,144 @@ +/* +Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package mo + +import ( + "os" + "testing" + + "github.com/vmware/govmomi/vim25/soap" + "github.com/vmware/govmomi/vim25/types" + "github.com/vmware/govmomi/vim25/xml" +) + +func load(name string) *types.RetrievePropertiesResponse { + f, err := os.Open(name) + if err != nil { + panic(err) + } + + defer f.Close() + + var b types.RetrievePropertiesResponse + + dec := xml.NewDecoder(f) + dec.TypeFunc = types.TypeFunc() + if err := dec.Decode(&b); err != nil { + panic(err) + } + + return &b +} + +func TestNotAuthenticatedFault(t *testing.T) { + var s SessionManager + + err := LoadRetrievePropertiesResponse(load("fixtures/not_authenticated_fault.xml"), &s) + if !soap.IsVimFault(err) { + t.Errorf("Expected IsVimFault") + } + + fault := soap.ToVimFault(err).(*types.NotAuthenticated) + if fault.PrivilegeId != "System.View" { + t.Errorf("Expected first fault to be returned") + } +} + +func TestNestedProperty(t *testing.T) { + var vm VirtualMachine + + err := LoadRetrievePropertiesResponse(load("fixtures/nested_property.xml"), &vm) + if err != nil { + t.Fatalf("Expected no error, got: %s", err) + } + + self := types.ManagedObjectReference{ + Type: "VirtualMachine", + Value: "vm-411", + } + + if vm.Self != self { + t.Fatalf("Expected vm.Self to be set") + } + + if vm.Config == nil { + t.Fatalf("Expected vm.Config to be set") + } + + if vm.Config.Name != "kubernetes-master" { + t.Errorf("Got: %s", vm.Config.Name) + } + + if vm.Config.Uuid != "422ec880-ab06-06b4-23f3-beb7a052a4c9" { + t.Errorf("Got: %s", vm.Config.Uuid) + } +} + +func TestPointerProperty(t *testing.T) { + var vm VirtualMachine + + err := LoadRetrievePropertiesResponse(load("fixtures/pointer_property.xml"), &vm) + if err != nil { + t.Fatalf("Expected no error, got: %s", err) + } + + if vm.Config == nil { + t.Fatalf("Expected vm.Config to be set") + } + + if vm.Config.BootOptions == nil { + t.Fatalf("Expected vm.Config.BootOptions to be set") + } +} + +func TestEmbeddedTypeProperty(t *testing.T) { + // Test that we avoid in this case: + // panic: reflect.Set: value of type mo.ClusterComputeResource is not assignable to type mo.ComputeResource + var cr ComputeResource + + err := LoadRetrievePropertiesResponse(load("fixtures/cluster_host_property.xml"), &cr) + if err != nil { + t.Fatalf("Expected no error, got: %s", err) + } + + if len(cr.Host) != 4 { + t.Fatalf("Expected cr.Host to be set") + } +} + +func TestEmbeddedTypePropertySlice(t *testing.T) { + var me []ManagedEntity + + err := LoadRetrievePropertiesResponse(load("fixtures/hostsystem_list_name_property.xml"), &me) + if err != nil { + t.Fatalf("Expected no error, got: %s", err) + } + + if len(me) != 2 { + t.Fatalf("Expected 2 elements") + } + + for _, m := range me { + if m.Name == "" { + t.Fatal("Expected Name field to be set") + } + } + + if me[0].Name == me[1].Name { + t.Fatal("Name fields should not be the same") + } +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/vim25/mo/type_info.go juju-core-2.0.2/src/github.com/vmware/govmomi/vim25/mo/type_info.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/vim25/mo/type_info.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/vim25/mo/type_info.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,247 @@ +/* +Copyright (c) 2014 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package mo + +import ( + "fmt" + "reflect" + "regexp" + "strings" + "sync" + + "github.com/vmware/govmomi/vim25/types" +) + +type typeInfo struct { + typ reflect.Type + + // Field indices of "Self" field. + self []int + + // Map property names to field indices. + props map[string][]int +} + +var typeInfoLock sync.RWMutex +var typeInfoMap = make(map[string]*typeInfo) + +func typeInfoForType(tname string) *typeInfo { + typeInfoLock.RLock() + ti, ok := typeInfoMap[tname] + typeInfoLock.RUnlock() + + if ok { + return ti + } + + // Create new typeInfo for type. + if typ, ok := t[tname]; !ok { + panic("unknown type: " + tname) + } else { + // Multiple routines may race to set it, but the result is the same. + typeInfoLock.Lock() + ti = newTypeInfo(typ) + typeInfoMap[tname] = ti + typeInfoLock.Unlock() + } + + return ti +} + +func newTypeInfo(typ reflect.Type) *typeInfo { + t := typeInfo{ + typ: typ, + props: make(map[string][]int), + } + + t.build(typ, "", []int{}) + + return &t +} + +var managedObjectRefType = reflect.TypeOf((*types.ManagedObjectReference)(nil)).Elem() + +func buildName(fn string, f reflect.StructField) string { + if fn != "" { + fn += "." + } + + motag := f.Tag.Get("mo") + if motag != "" { + return fn + motag + } + + xmltag := f.Tag.Get("xml") + if xmltag != "" { + tokens := strings.Split(xmltag, ",") + if tokens[0] != "" { + return fn + tokens[0] + } + } + + return "" +} + +func (t *typeInfo) build(typ reflect.Type, fn string, fi []int) { + if typ.Kind() == reflect.Ptr { + typ = typ.Elem() + } + + if typ.Kind() != reflect.Struct { + panic("need struct") + } + + for i := 0; i < typ.NumField(); i++ { + f := typ.Field(i) + ftyp := f.Type + + // Copy field indices so they can be passed along. + fic := make([]int, len(fi)+1) + copy(fic, fi) + fic[len(fi)] = i + + // Recurse into embedded field. + if f.Anonymous { + t.build(ftyp, fn, fic) + continue + } + + // Top level type has a "Self" field. + if f.Name == "Self" && ftyp == managedObjectRefType { + t.self = fic + continue + } + + fnc := buildName(fn, f) + if fnc == "" { + continue + } + + t.props[fnc] = fic + + // Dereference pointer. + if ftyp.Kind() == reflect.Ptr { + ftyp = ftyp.Elem() + } + + // Slices are not addressable by `foo.bar.qux`. + if ftyp.Kind() == reflect.Slice { + continue + } + + // Skip the managed reference type. + if ftyp == managedObjectRefType { + continue + } + + // Recurse into structs. + if ftyp.Kind() == reflect.Struct { + t.build(ftyp, fnc, fic) + } + } +} + +// assignValue assignes a value 'pv' to the struct pointed to by 'val', given a +// slice of field indices. It recurses into the struct until it finds the field +// specified by the indices. It creates new values for pointer types where +// needed. +func assignValue(val reflect.Value, fi []int, pv reflect.Value) { + // Create new value if necessary. + if val.Kind() == reflect.Ptr { + if val.IsNil() { + val.Set(reflect.New(val.Type().Elem())) + } + + val = val.Elem() + } + + rv := val.Field(fi[0]) + fi = fi[1:] + if len(fi) == 0 { + rt := rv.Type() + pt := pv.Type() + + // If type is a pointer, create new instance of type. + if rt.Kind() == reflect.Ptr { + rv.Set(reflect.New(rt.Elem())) + rv = rv.Elem() + rt = rv.Type() + } + + // If type is an interface, check if pv implements it. + if rt.Kind() == reflect.Interface && !pt.Implements(rt) { + // Check if pointer to pv implements it. + if reflect.PtrTo(pt).Implements(rt) { + npv := reflect.New(pt) + npv.Elem().Set(pv) + pv = npv + pt = pv.Type() + } else { + panic(fmt.Sprintf("type %s doesn't implement %s", pt.Name(), rt.Name())) + } + } + + if pt.AssignableTo(rt) { + rv.Set(pv) + } else if rt.ConvertibleTo(pt) { + rv.Set(pv.Convert(rt)) + } else { + panic(fmt.Sprintf("cannot assign %s (%s) to %s (%s)", rt.Name(), rt.Kind(), pt.Name(), pt.Kind())) + } + + return + } + + assignValue(rv, fi, pv) +} + +var arrayOfRegexp = regexp.MustCompile("ArrayOf(.*)$") + +func anyTypeToValue(t interface{}) reflect.Value { + rt := reflect.TypeOf(t) + rv := reflect.ValueOf(t) + + // Dereference if ArrayOfXYZ type + m := arrayOfRegexp.FindStringSubmatch(rt.Name()) + if len(m) > 0 { + // ArrayOfXYZ type has single field named XYZ + rv = rv.FieldByName(m[1]) + if !rv.IsValid() { + panic(fmt.Sprintf("expected %s type to have field %s", m[0], m[1])) + } + } + + return rv +} + +// LoadObjectFromContent loads properties from the 'PropSet' field in the +// specified ObjectContent value into the value it represents, which is +// returned as a reflect.Value. +func (t *typeInfo) LoadFromObjectContent(o types.ObjectContent) (reflect.Value, error) { + v := reflect.New(t.typ) + assignValue(v, t.self, reflect.ValueOf(o.Obj)) + + for _, p := range o.PropSet { + rv, ok := t.props[p.Name] + if !ok { + continue + } + assignValue(v, rv, anyTypeToValue(p.Val)) + } + + return v, nil +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/vim25/mo/type_info_test.go juju-core-2.0.2/src/github.com/vmware/govmomi/vim25/mo/type_info_test.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/vim25/mo/type_info_test.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/vim25/mo/type_info_test.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,37 @@ +/* +Copyright (c) 2014 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package mo + +import ( + "reflect" + "testing" +) + +func TestLoadAll(*testing.T) { + for _, typ := range t { + newTypeInfo(typ) + } +} + +// The virtual machine managed object has about 500 nested properties. +// It's likely to be indicative of the function's performance in general. +func BenchmarkLoadVirtualMachine(b *testing.B) { + vmtyp := reflect.TypeOf((*VirtualMachine)(nil)).Elem() + for i := 0; i < b.N; i++ { + newTypeInfo(vmtyp) + } +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/vim25/progress/aggregator.go juju-core-2.0.2/src/github.com/vmware/govmomi/vim25/progress/aggregator.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/vim25/progress/aggregator.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/vim25/progress/aggregator.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,73 @@ +/* +Copyright (c) 2014 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package progress + +import "sync" + +type Aggregator struct { + downstream Sinker + upstream chan (<-chan Report) + + done chan struct{} + w sync.WaitGroup +} + +func NewAggregator(s Sinker) *Aggregator { + a := &Aggregator{ + downstream: s, + upstream: make(chan (<-chan Report)), + + done: make(chan struct{}), + } + + a.w.Add(1) + go a.loop() + + return a +} + +func (a *Aggregator) loop() { + defer a.w.Done() + + dch := a.downstream.Sink() + defer close(dch) + + for { + select { + case uch := <-a.upstream: + // Drain upstream channel + for e := range uch { + dch <- e + } + case <-a.done: + return + } + } +} + +func (a *Aggregator) Sink() chan<- Report { + ch := make(chan Report) + a.upstream <- ch + return ch +} + +// Done marks the aggregator as done. No more calls to Sink() may be made and +// the downstream progress report channel will be closed when Done() returns. +func (a *Aggregator) Done() { + close(a.done) + a.w.Wait() +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/vim25/progress/aggregator_test.go juju-core-2.0.2/src/github.com/vmware/govmomi/vim25/progress/aggregator_test.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/vim25/progress/aggregator_test.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/vim25/progress/aggregator_test.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,81 @@ +/* +Copyright (c) 2014 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package progress + +import ( + "testing" + "time" +) + +func TestAggregatorNoSinks(t *testing.T) { + ch := make(chan Report) + a := NewAggregator(dummySinker{ch}) + a.Done() + + _, ok := <-ch + if ok { + t.Errorf("Expected channel to be closed") + } +} + +func TestAggregatorMultipleSinks(t *testing.T) { + ch := make(chan Report) + a := NewAggregator(dummySinker{ch}) + + for i := 0; i < 5; i++ { + go func(ch chan<- Report) { + ch <- dummyReport{} + ch <- dummyReport{} + close(ch) + }(a.Sink()) + + <-ch + <-ch + } + + a.Done() + + _, ok := <-ch + if ok { + t.Errorf("Expected channel to be closed") + } +} + +func TestAggregatorSinkInFlightOnDone(t *testing.T) { + ch := make(chan Report) + a := NewAggregator(dummySinker{ch}) + + // Simulate upstream + go func(ch chan<- Report) { + time.Sleep(1 * time.Millisecond) + ch <- dummyReport{} + close(ch) + }(a.Sink()) + + // Drain downstream + go func(ch <-chan Report) { + <-ch + }(ch) + + // This should wait for upstream to complete + a.Done() + + _, ok := <-ch + if ok { + t.Errorf("Expected channel to be closed") + } +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/vim25/progress/common_test.go juju-core-2.0.2/src/github.com/vmware/govmomi/vim25/progress/common_test.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/vim25/progress/common_test.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/vim25/progress/common_test.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,43 @@ +/* +Copyright (c) 2014 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package progress + +type dummySinker struct { + ch chan Report +} + +func (d dummySinker) Sink() chan<- Report { + return d.ch +} + +type dummyReport struct { + p float32 + d string + e error +} + +func (p dummyReport) Percentage() float32 { + return p.p +} + +func (p dummyReport) Detail() string { + return p.d +} + +func (p dummyReport) Error() error { + return p.e +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/vim25/progress/doc.go juju-core-2.0.2/src/github.com/vmware/govmomi/vim25/progress/doc.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/vim25/progress/doc.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/vim25/progress/doc.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,32 @@ +/* +Copyright (c) 2014 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package progress + +/* +The progress package contains functionality to deal with progress reporting. +The functionality is built to serve progress reporting for infrastructure +operations when talking the vSphere API, but is generic enough to be used +elsewhere. + +At the core of this progress reporting API lies the Sinker interface. This +interface is implemented by any object that can act as a sink for progress +reports. Callers of the Sink() function receives a send-only channel for +progress reports. They are responsible for closing the channel when done. +This semantic makes it easy to keep track of multiple progress report channels; +they are only created when Sink() is called and assumed closed when any +function that receives a Sinker parameter returns. +*/ diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/vim25/progress/prefix.go juju-core-2.0.2/src/github.com/vmware/govmomi/vim25/progress/prefix.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/vim25/progress/prefix.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/vim25/progress/prefix.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,54 @@ +/* +Copyright (c) 2014 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package progress + +import "fmt" + +type prefixedReport struct { + Report + prefix string +} + +func (r prefixedReport) Detail() string { + if d := r.Report.Detail(); d != "" { + return fmt.Sprintf("%s: %s", r.prefix, d) + } + + return r.prefix +} + +func prefixLoop(upstream <-chan Report, downstream chan<- Report, prefix string) { + defer close(downstream) + + for r := range upstream { + downstream <- prefixedReport{ + Report: r, + prefix: prefix, + } + } +} + +func Prefix(s Sinker, prefix string) Sinker { + fn := func() chan<- Report { + upstream := make(chan Report) + downstream := s.Sink() + go prefixLoop(upstream, downstream, prefix) + return upstream + } + + return SinkFunc(fn) +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/vim25/progress/prefix_test.go juju-core-2.0.2/src/github.com/vmware/govmomi/vim25/progress/prefix_test.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/vim25/progress/prefix_test.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/vim25/progress/prefix_test.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,40 @@ +/* +Copyright (c) 2014 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package progress + +import "testing" + +func TestPrefix(t *testing.T) { + var r Report + + ch := make(chan Report, 1) + s := Prefix(dummySinker{ch}, "prefix").Sink() + + // No detail + s <- dummyReport{d: ""} + r = <-ch + if r.Detail() != "prefix" { + t.Errorf("Expected detail to be prefixed") + } + + // With detail + s <- dummyReport{d: "something"} + r = <-ch + if r.Detail() != "prefix: something" { + t.Errorf("Expected detail to be prefixed") + } +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/vim25/progress/reader.go juju-core-2.0.2/src/github.com/vmware/govmomi/vim25/progress/reader.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/vim25/progress/reader.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/vim25/progress/reader.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,177 @@ +/* +Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package progress + +import ( + "container/list" + "fmt" + "io" + "sync/atomic" + "time" +) + +type readerReport struct { + t time.Time + + pos int64 + size int64 + bps *uint64 + + err error +} + +func (r readerReport) Percentage() float32 { + return 100.0 * float32(r.pos) / float32(r.size) +} + +func (r readerReport) Detail() string { + const ( + KiB = 1024 + MiB = 1024 * KiB + GiB = 1024 * MiB + ) + + // Use the reader's bps field, so this report returns an up-to-date number. + // + // For example: if there hasn't been progress for the last 5 seconds, the + // most recent report should return "0B/s". + // + bps := atomic.LoadUint64(r.bps) + + switch { + case bps >= GiB: + return fmt.Sprintf("%.1fGiB/s", float32(bps)/float32(GiB)) + case bps >= MiB: + return fmt.Sprintf("%.1fMiB/s", float32(bps)/float32(MiB)) + case bps >= KiB: + return fmt.Sprintf("%.1fKiB/s", float32(bps)/float32(KiB)) + default: + return fmt.Sprintf("%dB/s", bps) + } +} + +func (p readerReport) Error() error { + return p.err +} + +// reader wraps an io.Reader and sends a progress report over a channel for +// every read it handles. +type reader struct { + r io.Reader + + pos int64 + size int64 + + bps uint64 + + ch chan<- Report +} + +func NewReader(s Sinker, r io.Reader, size int64) *reader { + pr := reader{ + r: r, + + size: size, + } + + // Reports must be sent downstream and to the bps computation loop. + pr.ch = Tee(s, newBpsLoop(&pr.bps)).Sink() + + return &pr +} + +// Read calls the Read function on the underlying io.Reader. Additionally, +// every read causes a progress report to be sent to the progress reader's +// underlying channel. +func (r *reader) Read(b []byte) (int, error) { + n, err := r.r.Read(b) + if err != nil { + return n, err + } + + r.pos += int64(n) + q := readerReport{ + t: time.Now(), + pos: r.pos, + size: r.size, + bps: &r.bps, + } + + r.ch <- q + + return n, err +} + +// Done marks the progress reader as done, optionally including an error in the +// progress report. After sending it, the underlying channel is closed. +func (r *reader) Done(err error) { + q := readerReport{ + t: time.Now(), + pos: r.pos, + size: r.size, + bps: &r.bps, + err: err, + } + + r.ch <- q + close(r.ch) +} + +// newBpsLoop returns a sink that monitors and stores throughput. +func newBpsLoop(dst *uint64) SinkFunc { + fn := func() chan<- Report { + sink := make(chan Report) + go bpsLoop(sink, dst) + return sink + } + + return fn +} + +func bpsLoop(ch <-chan Report, dst *uint64) { + l := list.New() + + for { + var tch <-chan time.Time + + // Setup timer for front of list to become stale. + if e := l.Front(); e != nil { + dt := time.Second - time.Now().Sub(e.Value.(readerReport).t) + tch = time.After(dt) + } + + select { + case q, ok := <-ch: + if !ok { + return + } + + l.PushBack(q) + case <-tch: + l.Remove(l.Front()) + } + + // Compute new bps + if l.Len() == 0 { + atomic.StoreUint64(dst, 0) + } else { + f := l.Front().Value.(readerReport) + b := l.Back().Value.(readerReport) + atomic.StoreUint64(dst, uint64(b.pos-f.pos)) + } + } +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/vim25/progress/reader_test.go juju-core-2.0.2/src/github.com/vmware/govmomi/vim25/progress/reader_test.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/vim25/progress/reader_test.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/vim25/progress/reader_test.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,90 @@ +/* +Copyright (c) 2014 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package progress + +import ( + "io" + "strings" + "testing" +) + +func TestReader(t *testing.T) { + s := "helloworld" + ch := make(chan Report, 1) + pr := NewReader(&dummySinker{ch}, strings.NewReader(s), int64(len(s))) + + var buf [10]byte + var q Report + var n int + var err error + + // Read first byte + n, err = pr.Read(buf[0:1]) + if n != 1 { + t.Errorf("Expected n=1, but got: %d", n) + } + + if err != nil { + t.Errorf("Error: %s", err) + } + + q = <-ch + if q.Error() != nil { + t.Errorf("Error: %s", err) + } + + if f := q.Percentage(); f != 10.0 { + t.Errorf("Expected percentage after 1 byte to be 10%%, but got: %.0f%%", f) + } + + // Read remaining bytes + n, err = pr.Read(buf[:]) + if n != 9 { + t.Errorf("Expected n=1, but got: %d", n) + } + if err != nil { + t.Errorf("Error: %s", err) + } + + q = <-ch + if q.Error() != nil { + t.Errorf("Error: %s", err) + } + + if f := q.Percentage(); f != 100.0 { + t.Errorf("Expected percentage after 10 bytes to be 100%%, but got: %.0f%%", f) + } + + // Read EOF + _, err = pr.Read(buf[:]) + if err != io.EOF { + t.Errorf("Expected io.EOF, but got: %s", err) + } + + // Mark progress reader as done + pr.Done(io.EOF) + q = <-ch + if err != io.EOF { + t.Errorf("Expected io.EOF, but got: %s", err) + } + + // Progress channel should be closed after progress reader is marked done + _, ok := <-ch + if ok { + t.Errorf("Expected channel to be closed") + } +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/vim25/progress/report.go juju-core-2.0.2/src/github.com/vmware/govmomi/vim25/progress/report.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/vim25/progress/report.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/vim25/progress/report.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,26 @@ +/* +Copyright (c) 2014 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package progress + +// Report defines the interface for types that can deliver progress reports. +// Examples include uploads/downloads in the http client and the task info +// field in the task managed object. +type Report interface { + Percentage() float32 + Detail() string + Error() error +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/vim25/progress/scale.go juju-core-2.0.2/src/github.com/vmware/govmomi/vim25/progress/scale.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/vim25/progress/scale.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/vim25/progress/scale.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,76 @@ +/* +Copyright (c) 2014 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package progress + +type scaledReport struct { + Report + n int + i int +} + +func (r scaledReport) Percentage() float32 { + b := 100 * float32(r.i) / float32(r.n) + return b + (r.Report.Percentage() / float32(r.n)) +} + +type scaleOne struct { + s Sinker + n int + i int +} + +func (s scaleOne) Sink() chan<- Report { + upstream := make(chan Report) + downstream := s.s.Sink() + go s.loop(upstream, downstream) + return upstream +} + +func (s scaleOne) loop(upstream <-chan Report, downstream chan<- Report) { + defer close(downstream) + + for r := range upstream { + downstream <- scaledReport{ + Report: r, + n: s.n, + i: s.i, + } + } +} + +type scaleMany struct { + s Sinker + n int + i int +} + +func Scale(s Sinker, n int) Sinker { + return &scaleMany{ + s: s, + n: n, + } +} + +func (s *scaleMany) Sink() chan<- Report { + if s.i == s.n { + s.n++ + } + + ch := scaleOne{s: s.s, n: s.n, i: s.i}.Sink() + s.i++ + return ch +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/vim25/progress/scale_test.go juju-core-2.0.2/src/github.com/vmware/govmomi/vim25/progress/scale_test.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/vim25/progress/scale_test.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/vim25/progress/scale_test.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,45 @@ +/* +Copyright (c) 2014 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package progress + +import "testing" + +func TestScaleMany(t *testing.T) { + ch := make(chan Report) + a := NewAggregator(dummySinker{ch}) + defer a.Done() + + s := Scale(a, 5) + + go func() { + for i := 0; i < 5; i++ { + go func(ch chan<- Report) { + ch <- dummyReport{p: 0.0} + ch <- dummyReport{p: 50.0} + close(ch) + }(s.Sink()) + } + }() + + // Expect percentages to be scaled across sinks + for p := float32(0.0); p < 100.0; p += 10.0 { + r := <-ch + if r.Percentage() != p { + t.Errorf("Expected percentage to be: %.0f%%", p) + } + } +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/vim25/progress/sinker.go juju-core-2.0.2/src/github.com/vmware/govmomi/vim25/progress/sinker.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/vim25/progress/sinker.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/vim25/progress/sinker.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,33 @@ +/* +Copyright (c) 2014 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package progress + +// Sinker defines what is expected of a type that can act as a sink for +// progress reports. The semantics are as follows. If you call Sink(), you are +// responsible for closing the returned channel. Closing this channel means +// that the related task is done, or resulted in error. +type Sinker interface { + Sink() chan<- Report +} + +// SinkFunc defines a function that returns a progress report channel. +type SinkFunc func() chan<- Report + +// Sink makes the SinkFunc implement the Sinker interface. +func (fn SinkFunc) Sink() chan<- Report { + return fn() +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/vim25/progress/tee.go juju-core-2.0.2/src/github.com/vmware/govmomi/vim25/progress/tee.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/vim25/progress/tee.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/vim25/progress/tee.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,41 @@ +/* +Copyright (c) 2014 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package progress + +// Tee works like Unix tee; it forwards all progress reports it receives to the +// specified sinks +func Tee(s1, s2 Sinker) Sinker { + fn := func() chan<- Report { + d1 := s1.Sink() + d2 := s2.Sink() + u := make(chan Report) + go tee(u, d1, d2) + return u + } + + return SinkFunc(fn) +} + +func tee(u <-chan Report, d1, d2 chan<- Report) { + defer close(d1) + defer close(d2) + + for r := range u { + d1 <- r + d2 <- r + } +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/vim25/progress/tee_test.go juju-core-2.0.2/src/github.com/vmware/govmomi/vim25/progress/tee_test.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/vim25/progress/tee_test.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/vim25/progress/tee_test.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,46 @@ +/* +Copyright (c) 2014 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package progress + +import "testing" + +func TestTee(t *testing.T) { + var ok bool + + ch1 := make(chan Report) + ch2 := make(chan Report) + + s := Tee(&dummySinker{ch: ch1}, &dummySinker{ch: ch2}) + + in := s.Sink() + in <- dummyReport{} + close(in) + + // Receive dummy on both sinks + <-ch1 + <-ch2 + + _, ok = <-ch1 + if ok { + t.Errorf("Expected channel to be closed") + } + + _, ok = <-ch2 + if ok { + t.Errorf("Expected channel to be closed") + } +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/vim25/retry.go juju-core-2.0.2/src/github.com/vmware/govmomi/vim25/retry.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/vim25/retry.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/vim25/retry.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,105 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package vim25 + +import ( + "net" + "net/url" + "time" + + "github.com/vmware/govmomi/vim25/soap" + "golang.org/x/net/context" +) + +type RetryFunc func(err error) (retry bool, delay time.Duration) + +// TemporaryNetworkError returns a RetryFunc that retries up to a maximum of n +// times, only if the error returned by the RoundTrip function is a temporary +// network error (for example: a connect timeout). +func TemporaryNetworkError(n int) RetryFunc { + return func(err error) (retry bool, delay time.Duration) { + var nerr net.Error + var ok bool + + // Never retry if this is not a network error. + switch rerr := err.(type) { + case *url.Error: + if nerr, ok = rerr.Err.(net.Error); !ok { + return false, 0 + } + case net.Error: + nerr = rerr + default: + return false, 0 + } + + if !nerr.Temporary() { + return false, 0 + } + + // Don't retry if we're out of tries. + if n--; n <= 0 { + return false, 0 + } + + return true, 0 + } +} + +type retry struct { + roundTripper soap.RoundTripper + + // fn is a custom function that is called when an error occurs. + // It returns whether or not to retry, and if so, how long to + // delay before retrying. + fn RetryFunc +} + +// Retry wraps the specified soap.RoundTripper and invokes the +// specified RetryFunc. The RetryFunc returns whether or not to +// retry the call, and if so, how long to wait before retrying. If +// the result of this function is to not retry, the original error +// is returned from the RoundTrip function. +func Retry(roundTripper soap.RoundTripper, fn RetryFunc) soap.RoundTripper { + r := &retry{ + roundTripper: roundTripper, + fn: fn, + } + + return r +} + +func (r *retry) RoundTrip(ctx context.Context, req, res soap.HasFault) error { + var err error + + for { + err = r.roundTripper.RoundTrip(ctx, req, res) + if err == nil { + break + } + + // Invoke retry function to see if another attempt should be made. + if retry, delay := r.fn(err); retry { + time.Sleep(delay) + continue + } + + break + } + + return err +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/vim25/retry_test.go juju-core-2.0.2/src/github.com/vmware/govmomi/vim25/retry_test.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/vim25/retry_test.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/vim25/retry_test.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,86 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package vim25 + +import ( + "testing" + + "github.com/vmware/govmomi/vim25/soap" + "golang.org/x/net/context" +) + +type tempError struct{} + +func (tempError) Error() string { return "tempError" } +func (tempError) Timeout() bool { return true } +func (tempError) Temporary() bool { return true } + +type nonTempError struct{} + +func (nonTempError) Error() string { return "nonTempError" } +func (nonTempError) Timeout() bool { return false } +func (nonTempError) Temporary() bool { return false } + +type fakeRoundTripper struct { + errs []error +} + +func (f *fakeRoundTripper) RoundTrip(ctx context.Context, req, res soap.HasFault) error { + err := f.errs[0] + f.errs = f.errs[1:] + return err +} + +func TestRetry(t *testing.T) { + var tcs = []struct { + errs []error + expected error + }{ + { + errs: []error{nil}, + expected: nil, + }, + { + errs: []error{tempError{}, nil}, + expected: nil, + }, + { + errs: []error{tempError{}, tempError{}}, + expected: tempError{}, + }, + { + errs: []error{nonTempError{}}, + expected: nonTempError{}, + }, + { + errs: []error{tempError{}, nonTempError{}}, + expected: nonTempError{}, + }, + } + + for _, tc := range tcs { + var rt soap.RoundTripper + + rt = &fakeRoundTripper{errs: tc.errs} + rt = Retry(rt, TemporaryNetworkError(2)) + + err := rt.RoundTrip(nil, nil, nil) + if err != tc.expected { + t.Errorf("Expected: %s, got: %s", tc.expected, err) + } + } +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/vim25/soap/client.go juju-core-2.0.2/src/github.com/vmware/govmomi/vim25/soap/client.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/vim25/soap/client.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/vim25/soap/client.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,507 @@ +/* +Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package soap + +import ( + "bytes" + "crypto/tls" + "encoding/json" + "errors" + "fmt" + "io" + "net" + "net/http" + "net/http/cookiejar" + "net/url" + "os" + "regexp" + "strings" + "time" + + "github.com/vmware/govmomi/vim25/progress" + "github.com/vmware/govmomi/vim25/types" + "github.com/vmware/govmomi/vim25/xml" + "golang.org/x/net/context" +) + +type HasFault interface { + Fault() *Fault +} + +type RoundTripper interface { + RoundTrip(ctx context.Context, req, res HasFault) error +} + +var DefaultVimNamespace = "urn:vim25" +var DefaultVimVersion = "6.0" + +type Client struct { + http.Client + + u *url.URL + k bool // Named after curl's -k flag + d *debugContainer + t *http.Transport + p *url.URL + + Namespace string // Vim namespace + Version string // Vim version +} + +var schemeMatch = regexp.MustCompile(`^\w+://`) + +// ParseURL is wrapper around url.Parse, where Scheme defaults to "https" and Path defaults to "/sdk" +func ParseURL(s string) (*url.URL, error) { + var err error + var u *url.URL + + if s != "" { + // Default the scheme to https + if !schemeMatch.MatchString(s) { + s = "https://" + s + } + + u, err = url.Parse(s) + if err != nil { + return nil, err + } + + // Default the path to /sdk + if u.Path == "" { + u.Path = "/sdk" + } + + if u.User == nil { + u.User = url.UserPassword("", "") + } + } + + return u, nil +} + +func NewClient(u *url.URL, insecure bool) *Client { + c := Client{ + u: u, + k: insecure, + d: newDebug(), + } + + // Initialize http.RoundTripper on client, so we can customize it below + c.t = &http.Transport{ + Proxy: http.ProxyFromEnvironment, + Dial: (&net.Dialer{ + Timeout: 30 * time.Second, + KeepAlive: 30 * time.Second, + }).Dial, + } + + if c.u.Scheme == "https" { + c.t.TLSClientConfig = &tls.Config{InsecureSkipVerify: c.k} + c.t.TLSHandshakeTimeout = 10 * time.Second + } + + c.Client.Transport = c.t + c.Client.Jar, _ = cookiejar.New(nil) + + // Remove user information from a copy of the URL + c.u = c.URL() + c.u.User = nil + + c.Namespace = DefaultVimNamespace + c.Version = DefaultVimVersion + + return &c +} + +// splitHostPort is similar to net.SplitHostPort, +// but rather than return error if there isn't a ':port', +// return an empty string for the port. +func splitHostPort(host string) (string, string) { + ix := strings.LastIndex(host, ":") + + if ix <= strings.LastIndex(host, "]") { + return host, "" + } + + name := host[:ix] + port := host[ix+1:] + + return name, port +} + +const sdkTunnel = "sdkTunnel:8089" + +func (c *Client) SetCertificate(cert tls.Certificate) { + t := c.Client.Transport.(*http.Transport) + + // Extension certificate + t.TLSClientConfig.Certificates = []tls.Certificate{cert} + + // Proxy to vCenter host on port 80 + host, _ := splitHostPort(c.u.Host) + + // Should be no reason to change the default port other than testing + port := os.Getenv("GOVC_TUNNEL_PROXY_PORT") + if port != "" { + host += ":" + port + } + + c.p = &url.URL{ + Scheme: "http", + Host: host, + } + t.Proxy = func(r *http.Request) (*url.URL, error) { + // Only sdk requests should be proxied + if r.URL.Path == "/sdk" { + return c.p, nil + } + return http.ProxyFromEnvironment(r) + } + + // Rewrite url Host to use the sdk tunnel, required for a certificate request. + c.u.Host = sdkTunnel +} + +func (c *Client) URL() *url.URL { + urlCopy := *c.u + return &urlCopy +} + +type marshaledClient struct { + Cookies []*http.Cookie + URL *url.URL + Insecure bool +} + +func (c *Client) MarshalJSON() ([]byte, error) { + m := marshaledClient{ + Cookies: c.Jar.Cookies(c.u), + URL: c.u, + Insecure: c.k, + } + + return json.Marshal(m) +} + +func (c *Client) UnmarshalJSON(b []byte) error { + var m marshaledClient + + err := json.Unmarshal(b, &m) + if err != nil { + return err + } + + *c = *NewClient(m.URL, m.Insecure) + c.Jar.SetCookies(m.URL, m.Cookies) + + return nil +} + +func (c *Client) do(ctx context.Context, req *http.Request) (*http.Response, error) { + if nil == ctx || nil == ctx.Done() { // ctx.Done() is for context.TODO() + return c.Client.Do(req) + } + + var resc = make(chan *http.Response, 1) + var errc = make(chan error, 1) + + // Perform request from separate routine. + go func() { + res, err := c.Client.Do(req) + if err != nil { + errc <- err + } else { + resc <- res + } + }() + + // Wait for request completion of context expiry. + select { + case <-ctx.Done(): + c.t.CancelRequest(req) + return nil, ctx.Err() + case err := <-errc: + return nil, err + case res := <-resc: + return res, nil + } +} + +func (c *Client) RoundTrip(ctx context.Context, reqBody, resBody HasFault) error { + var err error + + reqEnv := Envelope{Body: reqBody} + resEnv := Envelope{Body: resBody} + + // Create debugging context for this round trip + d := c.d.newRoundTrip() + if d.enabled() { + defer d.done() + } + + b, err := xml.Marshal(reqEnv) + if err != nil { + panic(err) + } + + rawReqBody := io.MultiReader(strings.NewReader(xml.Header), bytes.NewReader(b)) + req, err := http.NewRequest("POST", c.u.String(), rawReqBody) + if err != nil { + panic(err) + } + + req.Header.Set(`Content-Type`, `text/xml; charset="utf-8"`) + soapAction := fmt.Sprintf("%s/%s", c.Namespace, c.Version) + req.Header.Set(`SOAPAction`, soapAction) + + if d.enabled() { + d.debugRequest(req) + } + + tstart := time.Now() + res, err := c.do(ctx, req) + tstop := time.Now() + + if d.enabled() { + d.logf("%6dms (%T)", tstop.Sub(tstart)/time.Millisecond, resBody) + } + + if err != nil { + return err + } + + if d.enabled() { + d.debugResponse(res) + } + + // Close response regardless of what happens next + defer res.Body.Close() + + switch res.StatusCode { + case http.StatusOK: + // OK + case http.StatusInternalServerError: + // Error, but typically includes a body explaining the error + default: + return errors.New(res.Status) + } + + dec := xml.NewDecoder(res.Body) + dec.TypeFunc = types.TypeFunc() + err = dec.Decode(&resEnv) + if err != nil { + return err + } + + if f := resBody.Fault(); f != nil { + return WrapSoapFault(f) + } + + return err +} + +func (c *Client) CloseIdleConnections() { + c.t.CloseIdleConnections() +} + +// ParseURL wraps url.Parse to rewrite the URL.Host field +// In the case of VM guest uploads or NFC lease URLs, a Host +// field with a value of "*" is rewritten to the Client's URL.Host. +func (c *Client) ParseURL(urlStr string) (*url.URL, error) { + u, err := url.Parse(urlStr) + if err != nil { + return nil, err + } + + host, _ := splitHostPort(u.Host) + if host == "*" { + // Also use Client's port, to support port forwarding + u.Host = c.URL().Host + } + + return u, nil +} + +type Upload struct { + Type string + Method string + ContentLength int64 + Headers map[string]string + Ticket *http.Cookie + Progress progress.Sinker +} + +var DefaultUpload = Upload{ + Type: "application/octet-stream", + Method: "PUT", +} + +// Upload PUTs the local file to the given URL +func (c *Client) Upload(f io.Reader, u *url.URL, param *Upload) error { + var err error + + if param.Progress != nil { + pr := progress.NewReader(param.Progress, f, param.ContentLength) + f = pr + + // Mark progress reader as done when returning from this function. + defer func() { + pr.Done(err) + }() + } + + req, err := http.NewRequest(param.Method, u.String(), f) + if err != nil { + return err + } + + req.ContentLength = param.ContentLength + req.Header.Set("Content-Type", param.Type) + + for k, v := range param.Headers { + req.Header.Add(k, v) + } + + if param.Ticket != nil { + req.AddCookie(param.Ticket) + } + + res, err := c.Client.Do(req) + if err != nil { + return err + } + + switch res.StatusCode { + case http.StatusOK: + case http.StatusCreated: + default: + err = errors.New(res.Status) + } + + return err +} + +// UploadFile PUTs the local file to the given URL +func (c *Client) UploadFile(file string, u *url.URL, param *Upload) error { + if param == nil { + p := DefaultUpload // Copy since we set ContentLength + param = &p + } + + s, err := os.Stat(file) + if err != nil { + return err + } + + f, err := os.Open(file) + if err != nil { + return err + } + defer f.Close() + + param.ContentLength = s.Size() + + return c.Upload(f, u, param) +} + +type Download struct { + Method string + Ticket *http.Cookie + Progress progress.Sinker +} + +var DefaultDownload = Download{ + Method: "GET", +} + +// Download GETs the remote file from the given URL +func (c *Client) Download(u *url.URL, param *Download) (io.ReadCloser, int64, error) { + + req, err := http.NewRequest(param.Method, u.String(), nil) + if err != nil { + return nil, 0, err + } + + if param.Ticket != nil { + req.AddCookie(param.Ticket) + } + + res, err := c.Client.Do(req) + if err != nil { + return nil, 0, err + } + + switch res.StatusCode { + case http.StatusOK: + default: + err = errors.New(res.Status) + } + + if err != nil { + return nil, 0, err + } + + var r io.ReadCloser = res.Body + + return r, res.ContentLength, nil +} + +// DownloadFile GETs the given URL to a local file +func (c *Client) DownloadFile(file string, u *url.URL, param *Download) error { + var err error + if param == nil { + param = &DefaultDownload + } + + rc, contentLength, err := c.Download(u, param) + if err != nil { + return err + } + defer rc.Close() + + var r io.Reader = rc + + fh, err := os.Create(file) + if err != nil { + return err + } + defer fh.Close() + + if param.Progress != nil { + pr := progress.NewReader(param.Progress, r, contentLength) + r = pr + + // Mark progress reader as done when returning from this function. + defer func() { + pr.Done(err) + }() + } + + _, err = io.Copy(fh, r) + if err != nil { + return err + } + + // Assign error before returning so that it gets picked up by the deferred + // function marking the progress reader as done. + err = fh.Close() + if err != nil { + return err + } + + return nil +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/vim25/soap/client_test.go juju-core-2.0.2/src/github.com/vmware/govmomi/vim25/soap/client_test.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/vim25/soap/client_test.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/vim25/soap/client_test.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,43 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package soap + +import "testing" + +func TestSplitHostPort(t *testing.T) { + tests := []struct { + url string + host string + port string + }{ + {"127.0.0.1", "127.0.0.1", ""}, + {"*:1234", "*", "1234"}, + {"127.0.0.1:80", "127.0.0.1", "80"}, + {"[::1]:6767", "[::1]", "6767"}, + {"[::1]", "[::1]", ""}, + } + + for _, test := range tests { + host, port := splitHostPort(test.url) + if host != test.host { + t.Errorf("(%s) %s != %s", test.url, host, test.host) + } + if port != test.port { + t.Errorf("(%s) %s != %s", test.url, port, test.port) + } + } +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/vim25/soap/debug.go juju-core-2.0.2/src/github.com/vmware/govmomi/vim25/soap/debug.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/vim25/soap/debug.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/vim25/soap/debug.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,149 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package soap + +import ( + "fmt" + "io" + "net/http" + "net/http/httputil" + "sync/atomic" + "time" + + "github.com/vmware/govmomi/vim25/debug" +) + +// teeReader wraps io.TeeReader and patches through the Close() function. +type teeReader struct { + io.Reader + io.Closer +} + +func newTeeReader(rc io.ReadCloser, w io.Writer) io.ReadCloser { + return teeReader{ + Reader: io.TeeReader(rc, w), + Closer: rc, + } +} + +// debugRoundTrip contains state and logic needed to debug a single round trip. +type debugRoundTrip struct { + cn uint64 // Client number + rn uint64 // Request number + log io.WriteCloser // Request log + cs []io.Closer // Files that need closing when done +} + +func (d *debugRoundTrip) logf(format string, a ...interface{}) { + now := time.Now().Format("2006-01-02T15-04-05.000000000") + fmt.Fprintf(d.log, "%s - %04d: ", now, d.rn) + fmt.Fprintf(d.log, format, a...) + fmt.Fprintf(d.log, "\n") +} + +func (d *debugRoundTrip) enabled() bool { + return d != nil +} + +func (d *debugRoundTrip) done() { + for _, c := range d.cs { + c.Close() + } +} + +func (d *debugRoundTrip) newFile(suffix string) io.WriteCloser { + return debug.NewFile(fmt.Sprintf("%d-%04d.%s", d.cn, d.rn, suffix)) +} + +func (d *debugRoundTrip) debugRequest(req *http.Request) { + if d == nil { + return + } + + var wc io.WriteCloser + + // Capture headers + wc = d.newFile("req.headers") + b, _ := httputil.DumpRequest(req, false) + wc.Write(b) + wc.Close() + + // Capture body + wc = d.newFile("req.xml") + req.Body = newTeeReader(req.Body, wc) + + // Delay closing until marked done + d.cs = append(d.cs, wc) +} + +func (d *debugRoundTrip) debugResponse(res *http.Response) { + if d == nil { + return + } + + var wc io.WriteCloser + + // Capture headers + wc = d.newFile("res.headers") + b, _ := httputil.DumpResponse(res, false) + wc.Write(b) + wc.Close() + + // Capture body + wc = d.newFile("res.xml") + res.Body = newTeeReader(res.Body, wc) + + // Delay closing until marked done + d.cs = append(d.cs, wc) +} + +var cn uint64 // Client counter + +// debugContainer wraps the debugging state for a single client. +type debugContainer struct { + cn uint64 // Client number + rn uint64 // Request counter + log io.WriteCloser // Request log +} + +func newDebug() *debugContainer { + d := debugContainer{ + cn: atomic.AddUint64(&cn, 1), + rn: 0, + } + + if !debug.Enabled() { + return nil + } + + d.log = debug.NewFile(fmt.Sprintf("%d-client.log", d.cn)) + return &d +} + +func (d *debugContainer) newRoundTrip() *debugRoundTrip { + if d == nil { + return nil + } + + drt := debugRoundTrip{ + cn: d.cn, + rn: atomic.AddUint64(&d.rn, 1), + log: d.log, + } + + return &drt +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/vim25/soap/error.go juju-core-2.0.2/src/github.com/vmware/govmomi/vim25/soap/error.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/vim25/soap/error.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/vim25/soap/error.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,109 @@ +/* +Copyright (c) 2014 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package soap + +import ( + "fmt" + "reflect" + + "github.com/vmware/govmomi/vim25/types" +) + +type regularError struct { + err error +} + +func (r regularError) Error() string { + return r.err.Error() +} + +type soapFaultError struct { + fault *Fault +} + +func (s soapFaultError) Error() string { + return fmt.Sprintf("%s: %s", s.fault.Code, s.fault.String) +} + +type vimFaultError struct { + fault types.BaseMethodFault +} + +func (v vimFaultError) Error() string { + typ := reflect.TypeOf(v.fault) + for typ.Kind() == reflect.Ptr { + typ = typ.Elem() + } + + return typ.Name() +} + +func (v vimFaultError) Fault() types.BaseMethodFault { + return v.fault +} + +func Wrap(err error) error { + switch err.(type) { + case regularError: + return err + case soapFaultError: + return err + case vimFaultError: + return err + } + + return WrapRegularError(err) +} + +func WrapRegularError(err error) error { + return regularError{err} +} + +func IsRegularError(err error) bool { + _, ok := err.(regularError) + return ok +} + +func ToRegularError(err error) error { + return err.(regularError).err +} + +func WrapSoapFault(f *Fault) error { + return soapFaultError{f} +} + +func IsSoapFault(err error) bool { + _, ok := err.(soapFaultError) + return ok +} + +func ToSoapFault(err error) *Fault { + return err.(soapFaultError).fault +} + +func WrapVimFault(v types.BaseMethodFault) error { + return vimFaultError{v} +} + +func IsVimFault(err error) bool { + _, ok := err.(vimFaultError) + return ok +} + +func ToVimFault(err error) types.BaseMethodFault { + return err.(vimFaultError).fault +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/vim25/soap/soap.go juju-core-2.0.2/src/github.com/vmware/govmomi/vim25/soap/soap.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/vim25/soap/soap.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/vim25/soap/soap.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,45 @@ +/* +Copyright (c) 2014 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package soap + +import ( + "github.com/vmware/govmomi/vim25/types" + "github.com/vmware/govmomi/vim25/xml" +) + +type Envelope struct { + XMLName xml.Name `xml:"http://schemas.xmlsoap.org/soap/envelope/ Envelope"` + Header *Header `xml:",omitempty"` + Body interface{} +} + +type Header struct { + XMLName xml.Name `xml:"http://schemas.xmlsoap.org/soap/envelope/ Header"` +} + +type Fault struct { + XMLName xml.Name `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault"` + Code string `xml:"faultcode"` + String string `xml:"faultstring"` + Detail struct { + Fault types.AnyType `xml:",any,typeattr"` + } `xml:"detail"` +} + +func (f *Fault) VimFault() types.AnyType { + return f.Detail.Fault +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/vim25/soap/soap_test.go juju-core-2.0.2/src/github.com/vmware/govmomi/vim25/soap/soap_test.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/vim25/soap/soap_test.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/vim25/soap/soap_test.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,55 @@ +/* +Copyright (c) 2014 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package soap + +import ( + "testing" + + "github.com/vmware/govmomi/vim25/xml" +) + +func TestEmptyEnvelope(t *testing.T) { + env := Envelope{} + + b, err := xml.Marshal(env) + if err != nil { + t.Errorf("error: %s", err) + return + } + + expected := `` + actual := string(b) + if expected != actual { + t.Fatalf("expected: %s, actual: %s", expected, actual) + } +} + +func TestEmptyHeader(t *testing.T) { + h := Header{} + + b, err := xml.Marshal(h) + if err != nil { + t.Errorf("error: %s", err) + return + } + + expected := `

` + actual := string(b) + if expected != actual { + t.Fatalf("expected: %s, actual: %s", expected, actual) + } +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/vim25/types/base.go juju-core-2.0.2/src/github.com/vmware/govmomi/vim25/types/base.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/vim25/types/base.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/vim25/types/base.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,19 @@ +/* +Copyright (c) 2014 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package types + +type AnyType interface{} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/vim25/types/base_test.go juju-core-2.0.2/src/github.com/vmware/govmomi/vim25/types/base_test.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/vim25/types/base_test.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/vim25/types/base_test.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,65 @@ +/* +Copyright (c) 2014 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package types + +import ( + "bytes" + "reflect" + "testing" + + "github.com/vmware/govmomi/vim25/xml" +) + +func TestAnyType(t *testing.T) { + x := func(s string) []byte { + s = `` + s + s += `` + return []byte(s) + } + + tests := []struct { + Input []byte + Value interface{} + }{ + { + Input: x(`test`), + Value: "test", + }, + { + Input: x(`AABB`), + Value: ArrayOfString{String: []string{"AA", "BB"}}, + }, + } + + for _, test := range tests { + var r struct { + A interface{} `xml:"name,typeattr"` + } + + dec := xml.NewDecoder(bytes.NewReader(test.Input)) + dec.TypeFunc = TypeFunc() + + err := dec.Decode(&r) + if err != nil { + t.Fatalf("Decode: %s", err) + } + + if !reflect.DeepEqual(r.A, test.Value) { + t.Errorf("Expected: %#v, actual: %#v", r.A, test.Value) + } + } +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/vim25/types/enum.go juju-core-2.0.2/src/github.com/vmware/govmomi/vim25/types/enum.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/vim25/types/enum.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/vim25/types/enum.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,4098 @@ +/* +Copyright (c) 2014-2016 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package types + +import "reflect" + +type ActionParameter string + +const ( + ActionParameterTargetName = ActionParameter("targetName") + ActionParameterAlarmName = ActionParameter("alarmName") + ActionParameterOldStatus = ActionParameter("oldStatus") + ActionParameterNewStatus = ActionParameter("newStatus") + ActionParameterTriggeringSummary = ActionParameter("triggeringSummary") + ActionParameterDeclaringSummary = ActionParameter("declaringSummary") + ActionParameterEventDescription = ActionParameter("eventDescription") + ActionParameterTarget = ActionParameter("target") + ActionParameterAlarm = ActionParameter("alarm") +) + +func init() { + t["ActionParameter"] = reflect.TypeOf((*ActionParameter)(nil)).Elem() +} + +type ActionType string + +const ( + ActionTypeMigrationV1 = ActionType("MigrationV1") + ActionTypeVmPowerV1 = ActionType("VmPowerV1") + ActionTypeHostPowerV1 = ActionType("HostPowerV1") + ActionTypeHostMaintenanceV1 = ActionType("HostMaintenanceV1") + ActionTypeStorageMigrationV1 = ActionType("StorageMigrationV1") + ActionTypeStoragePlacementV1 = ActionType("StoragePlacementV1") + ActionTypePlacementV1 = ActionType("PlacementV1") +) + +func init() { + t["ActionType"] = reflect.TypeOf((*ActionType)(nil)).Elem() +} + +type AffinityType string + +const ( + AffinityTypeMemory = AffinityType("memory") + AffinityTypeCpu = AffinityType("cpu") +) + +func init() { + t["AffinityType"] = reflect.TypeOf((*AffinityType)(nil)).Elem() +} + +type AgentInstallFailedReason string + +const ( + AgentInstallFailedReasonNotEnoughSpaceOnDevice = AgentInstallFailedReason("NotEnoughSpaceOnDevice") + AgentInstallFailedReasonPrepareToUpgradeFailed = AgentInstallFailedReason("PrepareToUpgradeFailed") + AgentInstallFailedReasonAgentNotRunning = AgentInstallFailedReason("AgentNotRunning") + AgentInstallFailedReasonAgentNotReachable = AgentInstallFailedReason("AgentNotReachable") + AgentInstallFailedReasonInstallTimedout = AgentInstallFailedReason("InstallTimedout") + AgentInstallFailedReasonSignatureVerificationFailed = AgentInstallFailedReason("SignatureVerificationFailed") + AgentInstallFailedReasonAgentUploadFailed = AgentInstallFailedReason("AgentUploadFailed") + AgentInstallFailedReasonAgentUploadTimedout = AgentInstallFailedReason("AgentUploadTimedout") + AgentInstallFailedReasonUnknownInstallerError = AgentInstallFailedReason("UnknownInstallerError") +) + +func init() { + t["AgentInstallFailedReason"] = reflect.TypeOf((*AgentInstallFailedReason)(nil)).Elem() +} + +type ArrayUpdateOperation string + +const ( + ArrayUpdateOperationAdd = ArrayUpdateOperation("add") + ArrayUpdateOperationRemove = ArrayUpdateOperation("remove") + ArrayUpdateOperationEdit = ArrayUpdateOperation("edit") +) + +func init() { + t["ArrayUpdateOperation"] = reflect.TypeOf((*ArrayUpdateOperation)(nil)).Elem() +} + +type AutoStartAction string + +const ( + AutoStartActionNone = AutoStartAction("none") + AutoStartActionSystemDefault = AutoStartAction("systemDefault") + AutoStartActionPowerOn = AutoStartAction("powerOn") + AutoStartActionPowerOff = AutoStartAction("powerOff") + AutoStartActionGuestShutdown = AutoStartAction("guestShutdown") + AutoStartActionSuspend = AutoStartAction("suspend") +) + +func init() { + t["AutoStartAction"] = reflect.TypeOf((*AutoStartAction)(nil)).Elem() +} + +type AutoStartWaitHeartbeatSetting string + +const ( + AutoStartWaitHeartbeatSettingYes = AutoStartWaitHeartbeatSetting("yes") + AutoStartWaitHeartbeatSettingNo = AutoStartWaitHeartbeatSetting("no") + AutoStartWaitHeartbeatSettingSystemDefault = AutoStartWaitHeartbeatSetting("systemDefault") +) + +func init() { + t["AutoStartWaitHeartbeatSetting"] = reflect.TypeOf((*AutoStartWaitHeartbeatSetting)(nil)).Elem() +} + +type BatchResultResult string + +const ( + BatchResultResultSuccess = BatchResultResult("success") + BatchResultResultFail = BatchResultResult("fail") +) + +func init() { + t["BatchResultResult"] = reflect.TypeOf((*BatchResultResult)(nil)).Elem() +} + +type CannotEnableVmcpForClusterReason string + +const ( + CannotEnableVmcpForClusterReasonAPDTimeoutDisabled = CannotEnableVmcpForClusterReason("APDTimeoutDisabled") + CannotEnableVmcpForClusterReasonIncompatibleHostVersion = CannotEnableVmcpForClusterReason("IncompatibleHostVersion") +) + +func init() { + t["CannotEnableVmcpForClusterReason"] = reflect.TypeOf((*CannotEnableVmcpForClusterReason)(nil)).Elem() +} + +type CannotMoveFaultToleranceVmMoveType string + +const ( + CannotMoveFaultToleranceVmMoveTypeResourcePool = CannotMoveFaultToleranceVmMoveType("resourcePool") + CannotMoveFaultToleranceVmMoveTypeCluster = CannotMoveFaultToleranceVmMoveType("cluster") +) + +func init() { + t["CannotMoveFaultToleranceVmMoveType"] = reflect.TypeOf((*CannotMoveFaultToleranceVmMoveType)(nil)).Elem() +} + +type CannotPowerOffVmInClusterOperation string + +const ( + CannotPowerOffVmInClusterOperationSuspend = CannotPowerOffVmInClusterOperation("suspend") + CannotPowerOffVmInClusterOperationPowerOff = CannotPowerOffVmInClusterOperation("powerOff") + CannotPowerOffVmInClusterOperationGuestShutdown = CannotPowerOffVmInClusterOperation("guestShutdown") + CannotPowerOffVmInClusterOperationGuestSuspend = CannotPowerOffVmInClusterOperation("guestSuspend") +) + +func init() { + t["CannotPowerOffVmInClusterOperation"] = reflect.TypeOf((*CannotPowerOffVmInClusterOperation)(nil)).Elem() +} + +type CannotUseNetworkReason string + +const ( + CannotUseNetworkReasonNetworkReservationNotSupported = CannotUseNetworkReason("NetworkReservationNotSupported") + CannotUseNetworkReasonMismatchedNetworkPolicies = CannotUseNetworkReason("MismatchedNetworkPolicies") + CannotUseNetworkReasonMismatchedDvsVersionOrVendor = CannotUseNetworkReason("MismatchedDvsVersionOrVendor") + CannotUseNetworkReasonVMotionToUnsupportedNetworkType = CannotUseNetworkReason("VMotionToUnsupportedNetworkType") +) + +func init() { + t["CannotUseNetworkReason"] = reflect.TypeOf((*CannotUseNetworkReason)(nil)).Elem() +} + +type CheckTestType string + +const ( + CheckTestTypeSourceTests = CheckTestType("sourceTests") + CheckTestTypeHostTests = CheckTestType("hostTests") + CheckTestTypeResourcePoolTests = CheckTestType("resourcePoolTests") + CheckTestTypeDatastoreTests = CheckTestType("datastoreTests") + CheckTestTypeNetworkTests = CheckTestType("networkTests") +) + +func init() { + t["CheckTestType"] = reflect.TypeOf((*CheckTestType)(nil)).Elem() +} + +type ClusterDasAamNodeStateDasState string + +const ( + ClusterDasAamNodeStateDasStateUninitialized = ClusterDasAamNodeStateDasState("uninitialized") + ClusterDasAamNodeStateDasStateInitialized = ClusterDasAamNodeStateDasState("initialized") + ClusterDasAamNodeStateDasStateConfiguring = ClusterDasAamNodeStateDasState("configuring") + ClusterDasAamNodeStateDasStateUnconfiguring = ClusterDasAamNodeStateDasState("unconfiguring") + ClusterDasAamNodeStateDasStateRunning = ClusterDasAamNodeStateDasState("running") + ClusterDasAamNodeStateDasStateError = ClusterDasAamNodeStateDasState("error") + ClusterDasAamNodeStateDasStateAgentShutdown = ClusterDasAamNodeStateDasState("agentShutdown") + ClusterDasAamNodeStateDasStateNodeFailed = ClusterDasAamNodeStateDasState("nodeFailed") +) + +func init() { + t["ClusterDasAamNodeStateDasState"] = reflect.TypeOf((*ClusterDasAamNodeStateDasState)(nil)).Elem() +} + +type ClusterDasConfigInfoHBDatastoreCandidate string + +const ( + ClusterDasConfigInfoHBDatastoreCandidateUserSelectedDs = ClusterDasConfigInfoHBDatastoreCandidate("userSelectedDs") + ClusterDasConfigInfoHBDatastoreCandidateAllFeasibleDs = ClusterDasConfigInfoHBDatastoreCandidate("allFeasibleDs") + ClusterDasConfigInfoHBDatastoreCandidateAllFeasibleDsWithUserPreference = ClusterDasConfigInfoHBDatastoreCandidate("allFeasibleDsWithUserPreference") +) + +func init() { + t["ClusterDasConfigInfoHBDatastoreCandidate"] = reflect.TypeOf((*ClusterDasConfigInfoHBDatastoreCandidate)(nil)).Elem() +} + +type ClusterDasConfigInfoServiceState string + +const ( + ClusterDasConfigInfoServiceStateDisabled = ClusterDasConfigInfoServiceState("disabled") + ClusterDasConfigInfoServiceStateEnabled = ClusterDasConfigInfoServiceState("enabled") +) + +func init() { + t["ClusterDasConfigInfoServiceState"] = reflect.TypeOf((*ClusterDasConfigInfoServiceState)(nil)).Elem() +} + +type ClusterDasConfigInfoVmMonitoringState string + +const ( + ClusterDasConfigInfoVmMonitoringStateVmMonitoringDisabled = ClusterDasConfigInfoVmMonitoringState("vmMonitoringDisabled") + ClusterDasConfigInfoVmMonitoringStateVmMonitoringOnly = ClusterDasConfigInfoVmMonitoringState("vmMonitoringOnly") + ClusterDasConfigInfoVmMonitoringStateVmAndAppMonitoring = ClusterDasConfigInfoVmMonitoringState("vmAndAppMonitoring") +) + +func init() { + t["ClusterDasConfigInfoVmMonitoringState"] = reflect.TypeOf((*ClusterDasConfigInfoVmMonitoringState)(nil)).Elem() +} + +type ClusterDasFdmAvailabilityState string + +const ( + ClusterDasFdmAvailabilityStateUninitialized = ClusterDasFdmAvailabilityState("uninitialized") + ClusterDasFdmAvailabilityStateElection = ClusterDasFdmAvailabilityState("election") + ClusterDasFdmAvailabilityStateMaster = ClusterDasFdmAvailabilityState("master") + ClusterDasFdmAvailabilityStateConnectedToMaster = ClusterDasFdmAvailabilityState("connectedToMaster") + ClusterDasFdmAvailabilityStateNetworkPartitionedFromMaster = ClusterDasFdmAvailabilityState("networkPartitionedFromMaster") + ClusterDasFdmAvailabilityStateNetworkIsolated = ClusterDasFdmAvailabilityState("networkIsolated") + ClusterDasFdmAvailabilityStateHostDown = ClusterDasFdmAvailabilityState("hostDown") + ClusterDasFdmAvailabilityStateInitializationError = ClusterDasFdmAvailabilityState("initializationError") + ClusterDasFdmAvailabilityStateUninitializationError = ClusterDasFdmAvailabilityState("uninitializationError") + ClusterDasFdmAvailabilityStateFdmUnreachable = ClusterDasFdmAvailabilityState("fdmUnreachable") +) + +func init() { + t["ClusterDasFdmAvailabilityState"] = reflect.TypeOf((*ClusterDasFdmAvailabilityState)(nil)).Elem() +} + +type ClusterDasVmSettingsIsolationResponse string + +const ( + ClusterDasVmSettingsIsolationResponseNone = ClusterDasVmSettingsIsolationResponse("none") + ClusterDasVmSettingsIsolationResponsePowerOff = ClusterDasVmSettingsIsolationResponse("powerOff") + ClusterDasVmSettingsIsolationResponseShutdown = ClusterDasVmSettingsIsolationResponse("shutdown") + ClusterDasVmSettingsIsolationResponseClusterIsolationResponse = ClusterDasVmSettingsIsolationResponse("clusterIsolationResponse") +) + +func init() { + t["ClusterDasVmSettingsIsolationResponse"] = reflect.TypeOf((*ClusterDasVmSettingsIsolationResponse)(nil)).Elem() +} + +type ClusterDasVmSettingsRestartPriority string + +const ( + ClusterDasVmSettingsRestartPriorityDisabled = ClusterDasVmSettingsRestartPriority("disabled") + ClusterDasVmSettingsRestartPriorityLow = ClusterDasVmSettingsRestartPriority("low") + ClusterDasVmSettingsRestartPriorityMedium = ClusterDasVmSettingsRestartPriority("medium") + ClusterDasVmSettingsRestartPriorityHigh = ClusterDasVmSettingsRestartPriority("high") + ClusterDasVmSettingsRestartPriorityClusterRestartPriority = ClusterDasVmSettingsRestartPriority("clusterRestartPriority") +) + +func init() { + t["ClusterDasVmSettingsRestartPriority"] = reflect.TypeOf((*ClusterDasVmSettingsRestartPriority)(nil)).Elem() +} + +type ClusterPowerOnVmOption string + +const ( + ClusterPowerOnVmOptionOverrideAutomationLevel = ClusterPowerOnVmOption("OverrideAutomationLevel") + ClusterPowerOnVmOptionReserveResources = ClusterPowerOnVmOption("ReserveResources") +) + +func init() { + t["ClusterPowerOnVmOption"] = reflect.TypeOf((*ClusterPowerOnVmOption)(nil)).Elem() +} + +type ClusterProfileServiceType string + +const ( + ClusterProfileServiceTypeDRS = ClusterProfileServiceType("DRS") + ClusterProfileServiceTypeHA = ClusterProfileServiceType("HA") + ClusterProfileServiceTypeDPM = ClusterProfileServiceType("DPM") + ClusterProfileServiceTypeFT = ClusterProfileServiceType("FT") +) + +func init() { + t["ClusterProfileServiceType"] = reflect.TypeOf((*ClusterProfileServiceType)(nil)).Elem() +} + +type ClusterVmComponentProtectionSettingsStorageVmReaction string + +const ( + ClusterVmComponentProtectionSettingsStorageVmReactionDisabled = ClusterVmComponentProtectionSettingsStorageVmReaction("disabled") + ClusterVmComponentProtectionSettingsStorageVmReactionWarning = ClusterVmComponentProtectionSettingsStorageVmReaction("warning") + ClusterVmComponentProtectionSettingsStorageVmReactionRestartConservative = ClusterVmComponentProtectionSettingsStorageVmReaction("restartConservative") + ClusterVmComponentProtectionSettingsStorageVmReactionRestartAggressive = ClusterVmComponentProtectionSettingsStorageVmReaction("restartAggressive") + ClusterVmComponentProtectionSettingsStorageVmReactionClusterDefault = ClusterVmComponentProtectionSettingsStorageVmReaction("clusterDefault") +) + +func init() { + t["ClusterVmComponentProtectionSettingsStorageVmReaction"] = reflect.TypeOf((*ClusterVmComponentProtectionSettingsStorageVmReaction)(nil)).Elem() +} + +type ClusterVmComponentProtectionSettingsVmReactionOnAPDCleared string + +const ( + ClusterVmComponentProtectionSettingsVmReactionOnAPDClearedNone = ClusterVmComponentProtectionSettingsVmReactionOnAPDCleared("none") + ClusterVmComponentProtectionSettingsVmReactionOnAPDClearedReset = ClusterVmComponentProtectionSettingsVmReactionOnAPDCleared("reset") + ClusterVmComponentProtectionSettingsVmReactionOnAPDClearedUseClusterDefault = ClusterVmComponentProtectionSettingsVmReactionOnAPDCleared("useClusterDefault") +) + +func init() { + t["ClusterVmComponentProtectionSettingsVmReactionOnAPDCleared"] = reflect.TypeOf((*ClusterVmComponentProtectionSettingsVmReactionOnAPDCleared)(nil)).Elem() +} + +type ComplianceResultStatus string + +const ( + ComplianceResultStatusCompliant = ComplianceResultStatus("compliant") + ComplianceResultStatusNonCompliant = ComplianceResultStatus("nonCompliant") + ComplianceResultStatusUnknown = ComplianceResultStatus("unknown") +) + +func init() { + t["ComplianceResultStatus"] = reflect.TypeOf((*ComplianceResultStatus)(nil)).Elem() +} + +type ComputeResourceHostSPBMLicenseInfoHostSPBMLicenseState string + +const ( + ComputeResourceHostSPBMLicenseInfoHostSPBMLicenseStateLicensed = ComputeResourceHostSPBMLicenseInfoHostSPBMLicenseState("licensed") + ComputeResourceHostSPBMLicenseInfoHostSPBMLicenseStateUnlicensed = ComputeResourceHostSPBMLicenseInfoHostSPBMLicenseState("unlicensed") + ComputeResourceHostSPBMLicenseInfoHostSPBMLicenseStateUnknown = ComputeResourceHostSPBMLicenseInfoHostSPBMLicenseState("unknown") +) + +func init() { + t["ComputeResourceHostSPBMLicenseInfoHostSPBMLicenseState"] = reflect.TypeOf((*ComputeResourceHostSPBMLicenseInfoHostSPBMLicenseState)(nil)).Elem() +} + +type ConfigSpecOperation string + +const ( + ConfigSpecOperationAdd = ConfigSpecOperation("add") + ConfigSpecOperationEdit = ConfigSpecOperation("edit") + ConfigSpecOperationRemove = ConfigSpecOperation("remove") +) + +func init() { + t["ConfigSpecOperation"] = reflect.TypeOf((*ConfigSpecOperation)(nil)).Elem() +} + +type CustomizationLicenseDataMode string + +const ( + CustomizationLicenseDataModePerServer = CustomizationLicenseDataMode("perServer") + CustomizationLicenseDataModePerSeat = CustomizationLicenseDataMode("perSeat") +) + +func init() { + t["CustomizationLicenseDataMode"] = reflect.TypeOf((*CustomizationLicenseDataMode)(nil)).Elem() +} + +type CustomizationNetBIOSMode string + +const ( + CustomizationNetBIOSModeEnableNetBIOSViaDhcp = CustomizationNetBIOSMode("enableNetBIOSViaDhcp") + CustomizationNetBIOSModeEnableNetBIOS = CustomizationNetBIOSMode("enableNetBIOS") + CustomizationNetBIOSModeDisableNetBIOS = CustomizationNetBIOSMode("disableNetBIOS") +) + +func init() { + t["CustomizationNetBIOSMode"] = reflect.TypeOf((*CustomizationNetBIOSMode)(nil)).Elem() +} + +type CustomizationSysprepRebootOption string + +const ( + CustomizationSysprepRebootOptionReboot = CustomizationSysprepRebootOption("reboot") + CustomizationSysprepRebootOptionNoreboot = CustomizationSysprepRebootOption("noreboot") + CustomizationSysprepRebootOptionShutdown = CustomizationSysprepRebootOption("shutdown") +) + +func init() { + t["CustomizationSysprepRebootOption"] = reflect.TypeOf((*CustomizationSysprepRebootOption)(nil)).Elem() +} + +type DVPortStatusVmDirectPathGen2InactiveReasonNetwork string + +const ( + DVPortStatusVmDirectPathGen2InactiveReasonNetworkPortNptIncompatibleDvs = DVPortStatusVmDirectPathGen2InactiveReasonNetwork("portNptIncompatibleDvs") + DVPortStatusVmDirectPathGen2InactiveReasonNetworkPortNptNoCompatibleNics = DVPortStatusVmDirectPathGen2InactiveReasonNetwork("portNptNoCompatibleNics") + DVPortStatusVmDirectPathGen2InactiveReasonNetworkPortNptNoVirtualFunctionsAvailable = DVPortStatusVmDirectPathGen2InactiveReasonNetwork("portNptNoVirtualFunctionsAvailable") + DVPortStatusVmDirectPathGen2InactiveReasonNetworkPortNptDisabledForPort = DVPortStatusVmDirectPathGen2InactiveReasonNetwork("portNptDisabledForPort") +) + +func init() { + t["DVPortStatusVmDirectPathGen2InactiveReasonNetwork"] = reflect.TypeOf((*DVPortStatusVmDirectPathGen2InactiveReasonNetwork)(nil)).Elem() +} + +type DVPortStatusVmDirectPathGen2InactiveReasonOther string + +const ( + DVPortStatusVmDirectPathGen2InactiveReasonOtherPortNptIncompatibleHost = DVPortStatusVmDirectPathGen2InactiveReasonOther("portNptIncompatibleHost") + DVPortStatusVmDirectPathGen2InactiveReasonOtherPortNptIncompatibleConnectee = DVPortStatusVmDirectPathGen2InactiveReasonOther("portNptIncompatibleConnectee") +) + +func init() { + t["DVPortStatusVmDirectPathGen2InactiveReasonOther"] = reflect.TypeOf((*DVPortStatusVmDirectPathGen2InactiveReasonOther)(nil)).Elem() +} + +type DasConfigFaultDasConfigFaultReason string + +const ( + DasConfigFaultDasConfigFaultReasonHostNetworkMisconfiguration = DasConfigFaultDasConfigFaultReason("HostNetworkMisconfiguration") + DasConfigFaultDasConfigFaultReasonHostMisconfiguration = DasConfigFaultDasConfigFaultReason("HostMisconfiguration") + DasConfigFaultDasConfigFaultReasonInsufficientPrivileges = DasConfigFaultDasConfigFaultReason("InsufficientPrivileges") + DasConfigFaultDasConfigFaultReasonNoPrimaryAgentAvailable = DasConfigFaultDasConfigFaultReason("NoPrimaryAgentAvailable") + DasConfigFaultDasConfigFaultReasonOther = DasConfigFaultDasConfigFaultReason("Other") + DasConfigFaultDasConfigFaultReasonNoDatastoresConfigured = DasConfigFaultDasConfigFaultReason("NoDatastoresConfigured") + DasConfigFaultDasConfigFaultReasonCreateConfigVvolFailed = DasConfigFaultDasConfigFaultReason("CreateConfigVvolFailed") + DasConfigFaultDasConfigFaultReasonVSanNotSupportedOnHost = DasConfigFaultDasConfigFaultReason("VSanNotSupportedOnHost") + DasConfigFaultDasConfigFaultReasonDasNetworkMisconfiguration = DasConfigFaultDasConfigFaultReason("DasNetworkMisconfiguration") +) + +func init() { + t["DasConfigFaultDasConfigFaultReason"] = reflect.TypeOf((*DasConfigFaultDasConfigFaultReason)(nil)).Elem() +} + +type DasVmPriority string + +const ( + DasVmPriorityDisabled = DasVmPriority("disabled") + DasVmPriorityLow = DasVmPriority("low") + DasVmPriorityMedium = DasVmPriority("medium") + DasVmPriorityHigh = DasVmPriority("high") +) + +func init() { + t["DasVmPriority"] = reflect.TypeOf((*DasVmPriority)(nil)).Elem() +} + +type DatastoreAccessible string + +const ( + DatastoreAccessibleTrue = DatastoreAccessible("True") + DatastoreAccessibleFalse = DatastoreAccessible("False") +) + +func init() { + t["DatastoreAccessible"] = reflect.TypeOf((*DatastoreAccessible)(nil)).Elem() +} + +type DatastoreSummaryMaintenanceModeState string + +const ( + DatastoreSummaryMaintenanceModeStateNormal = DatastoreSummaryMaintenanceModeState("normal") + DatastoreSummaryMaintenanceModeStateEnteringMaintenance = DatastoreSummaryMaintenanceModeState("enteringMaintenance") + DatastoreSummaryMaintenanceModeStateInMaintenance = DatastoreSummaryMaintenanceModeState("inMaintenance") +) + +func init() { + t["DatastoreSummaryMaintenanceModeState"] = reflect.TypeOf((*DatastoreSummaryMaintenanceModeState)(nil)).Elem() +} + +type DayOfWeek string + +const ( + DayOfWeekSunday = DayOfWeek("sunday") + DayOfWeekMonday = DayOfWeek("monday") + DayOfWeekTuesday = DayOfWeek("tuesday") + DayOfWeekWednesday = DayOfWeek("wednesday") + DayOfWeekThursday = DayOfWeek("thursday") + DayOfWeekFriday = DayOfWeek("friday") + DayOfWeekSaturday = DayOfWeek("saturday") +) + +func init() { + t["DayOfWeek"] = reflect.TypeOf((*DayOfWeek)(nil)).Elem() +} + +type DeviceNotSupportedReason string + +const ( + DeviceNotSupportedReasonHost = DeviceNotSupportedReason("host") + DeviceNotSupportedReasonGuest = DeviceNotSupportedReason("guest") +) + +func init() { + t["DeviceNotSupportedReason"] = reflect.TypeOf((*DeviceNotSupportedReason)(nil)).Elem() +} + +type DiagnosticManagerLogCreator string + +const ( + DiagnosticManagerLogCreatorVpxd = DiagnosticManagerLogCreator("vpxd") + DiagnosticManagerLogCreatorVpxa = DiagnosticManagerLogCreator("vpxa") + DiagnosticManagerLogCreatorHostd = DiagnosticManagerLogCreator("hostd") + DiagnosticManagerLogCreatorServerd = DiagnosticManagerLogCreator("serverd") + DiagnosticManagerLogCreatorInstall = DiagnosticManagerLogCreator("install") + DiagnosticManagerLogCreatorVpxClient = DiagnosticManagerLogCreator("vpxClient") + DiagnosticManagerLogCreatorRecordLog = DiagnosticManagerLogCreator("recordLog") +) + +func init() { + t["DiagnosticManagerLogCreator"] = reflect.TypeOf((*DiagnosticManagerLogCreator)(nil)).Elem() +} + +type DiagnosticManagerLogFormat string + +const ( + DiagnosticManagerLogFormatPlain = DiagnosticManagerLogFormat("plain") +) + +func init() { + t["DiagnosticManagerLogFormat"] = reflect.TypeOf((*DiagnosticManagerLogFormat)(nil)).Elem() +} + +type DiagnosticPartitionStorageType string + +const ( + DiagnosticPartitionStorageTypeDirectAttached = DiagnosticPartitionStorageType("directAttached") + DiagnosticPartitionStorageTypeNetworkAttached = DiagnosticPartitionStorageType("networkAttached") +) + +func init() { + t["DiagnosticPartitionStorageType"] = reflect.TypeOf((*DiagnosticPartitionStorageType)(nil)).Elem() +} + +type DiagnosticPartitionType string + +const ( + DiagnosticPartitionTypeSingleHost = DiagnosticPartitionType("singleHost") + DiagnosticPartitionTypeMultiHost = DiagnosticPartitionType("multiHost") +) + +func init() { + t["DiagnosticPartitionType"] = reflect.TypeOf((*DiagnosticPartitionType)(nil)).Elem() +} + +type DisallowedChangeByServiceDisallowedChange string + +const ( + DisallowedChangeByServiceDisallowedChangeHotExtendDisk = DisallowedChangeByServiceDisallowedChange("hotExtendDisk") +) + +func init() { + t["DisallowedChangeByServiceDisallowedChange"] = reflect.TypeOf((*DisallowedChangeByServiceDisallowedChange)(nil)).Elem() +} + +type DistributedVirtualPortgroupMetaTagName string + +const ( + DistributedVirtualPortgroupMetaTagNameDvsName = DistributedVirtualPortgroupMetaTagName("dvsName") + DistributedVirtualPortgroupMetaTagNamePortgroupName = DistributedVirtualPortgroupMetaTagName("portgroupName") + DistributedVirtualPortgroupMetaTagNamePortIndex = DistributedVirtualPortgroupMetaTagName("portIndex") +) + +func init() { + t["DistributedVirtualPortgroupMetaTagName"] = reflect.TypeOf((*DistributedVirtualPortgroupMetaTagName)(nil)).Elem() +} + +type DistributedVirtualPortgroupPortgroupType string + +const ( + DistributedVirtualPortgroupPortgroupTypeEarlyBinding = DistributedVirtualPortgroupPortgroupType("earlyBinding") + DistributedVirtualPortgroupPortgroupTypeLateBinding = DistributedVirtualPortgroupPortgroupType("lateBinding") + DistributedVirtualPortgroupPortgroupTypeEphemeral = DistributedVirtualPortgroupPortgroupType("ephemeral") +) + +func init() { + t["DistributedVirtualPortgroupPortgroupType"] = reflect.TypeOf((*DistributedVirtualPortgroupPortgroupType)(nil)).Elem() +} + +type DistributedVirtualSwitchHostInfrastructureTrafficClass string + +const ( + DistributedVirtualSwitchHostInfrastructureTrafficClassManagement = DistributedVirtualSwitchHostInfrastructureTrafficClass("management") + DistributedVirtualSwitchHostInfrastructureTrafficClassFaultTolerance = DistributedVirtualSwitchHostInfrastructureTrafficClass("faultTolerance") + DistributedVirtualSwitchHostInfrastructureTrafficClassVmotion = DistributedVirtualSwitchHostInfrastructureTrafficClass("vmotion") + DistributedVirtualSwitchHostInfrastructureTrafficClassVirtualMachine = DistributedVirtualSwitchHostInfrastructureTrafficClass("virtualMachine") + DistributedVirtualSwitchHostInfrastructureTrafficClassISCSI = DistributedVirtualSwitchHostInfrastructureTrafficClass("iSCSI") + DistributedVirtualSwitchHostInfrastructureTrafficClassNfs = DistributedVirtualSwitchHostInfrastructureTrafficClass("nfs") + DistributedVirtualSwitchHostInfrastructureTrafficClassHbr = DistributedVirtualSwitchHostInfrastructureTrafficClass("hbr") + DistributedVirtualSwitchHostInfrastructureTrafficClassVsan = DistributedVirtualSwitchHostInfrastructureTrafficClass("vsan") + DistributedVirtualSwitchHostInfrastructureTrafficClassVdp = DistributedVirtualSwitchHostInfrastructureTrafficClass("vdp") +) + +func init() { + t["DistributedVirtualSwitchHostInfrastructureTrafficClass"] = reflect.TypeOf((*DistributedVirtualSwitchHostInfrastructureTrafficClass)(nil)).Elem() +} + +type DistributedVirtualSwitchHostMemberHostComponentState string + +const ( + DistributedVirtualSwitchHostMemberHostComponentStateUp = DistributedVirtualSwitchHostMemberHostComponentState("up") + DistributedVirtualSwitchHostMemberHostComponentStatePending = DistributedVirtualSwitchHostMemberHostComponentState("pending") + DistributedVirtualSwitchHostMemberHostComponentStateOutOfSync = DistributedVirtualSwitchHostMemberHostComponentState("outOfSync") + DistributedVirtualSwitchHostMemberHostComponentStateWarning = DistributedVirtualSwitchHostMemberHostComponentState("warning") + DistributedVirtualSwitchHostMemberHostComponentStateDisconnected = DistributedVirtualSwitchHostMemberHostComponentState("disconnected") + DistributedVirtualSwitchHostMemberHostComponentStateDown = DistributedVirtualSwitchHostMemberHostComponentState("down") +) + +func init() { + t["DistributedVirtualSwitchHostMemberHostComponentState"] = reflect.TypeOf((*DistributedVirtualSwitchHostMemberHostComponentState)(nil)).Elem() +} + +type DistributedVirtualSwitchNetworkResourceControlVersion string + +const ( + DistributedVirtualSwitchNetworkResourceControlVersionVersion2 = DistributedVirtualSwitchNetworkResourceControlVersion("version2") + DistributedVirtualSwitchNetworkResourceControlVersionVersion3 = DistributedVirtualSwitchNetworkResourceControlVersion("version3") +) + +func init() { + t["DistributedVirtualSwitchNetworkResourceControlVersion"] = reflect.TypeOf((*DistributedVirtualSwitchNetworkResourceControlVersion)(nil)).Elem() +} + +type DistributedVirtualSwitchNicTeamingPolicyMode string + +const ( + DistributedVirtualSwitchNicTeamingPolicyModeLoadbalance_ip = DistributedVirtualSwitchNicTeamingPolicyMode("loadbalance_ip") + DistributedVirtualSwitchNicTeamingPolicyModeLoadbalance_srcmac = DistributedVirtualSwitchNicTeamingPolicyMode("loadbalance_srcmac") + DistributedVirtualSwitchNicTeamingPolicyModeLoadbalance_srcid = DistributedVirtualSwitchNicTeamingPolicyMode("loadbalance_srcid") + DistributedVirtualSwitchNicTeamingPolicyModeFailover_explicit = DistributedVirtualSwitchNicTeamingPolicyMode("failover_explicit") + DistributedVirtualSwitchNicTeamingPolicyModeLoadbalance_loadbased = DistributedVirtualSwitchNicTeamingPolicyMode("loadbalance_loadbased") +) + +func init() { + t["DistributedVirtualSwitchNicTeamingPolicyMode"] = reflect.TypeOf((*DistributedVirtualSwitchNicTeamingPolicyMode)(nil)).Elem() +} + +type DistributedVirtualSwitchPortConnecteeConnecteeType string + +const ( + DistributedVirtualSwitchPortConnecteeConnecteeTypePnic = DistributedVirtualSwitchPortConnecteeConnecteeType("pnic") + DistributedVirtualSwitchPortConnecteeConnecteeTypeVmVnic = DistributedVirtualSwitchPortConnecteeConnecteeType("vmVnic") + DistributedVirtualSwitchPortConnecteeConnecteeTypeHostConsoleVnic = DistributedVirtualSwitchPortConnecteeConnecteeType("hostConsoleVnic") + DistributedVirtualSwitchPortConnecteeConnecteeTypeHostVmkVnic = DistributedVirtualSwitchPortConnecteeConnecteeType("hostVmkVnic") +) + +func init() { + t["DistributedVirtualSwitchPortConnecteeConnecteeType"] = reflect.TypeOf((*DistributedVirtualSwitchPortConnecteeConnecteeType)(nil)).Elem() +} + +type DistributedVirtualSwitchProductSpecOperationType string + +const ( + DistributedVirtualSwitchProductSpecOperationTypePreInstall = DistributedVirtualSwitchProductSpecOperationType("preInstall") + DistributedVirtualSwitchProductSpecOperationTypeUpgrade = DistributedVirtualSwitchProductSpecOperationType("upgrade") + DistributedVirtualSwitchProductSpecOperationTypeNotifyAvailableUpgrade = DistributedVirtualSwitchProductSpecOperationType("notifyAvailableUpgrade") + DistributedVirtualSwitchProductSpecOperationTypeProceedWithUpgrade = DistributedVirtualSwitchProductSpecOperationType("proceedWithUpgrade") + DistributedVirtualSwitchProductSpecOperationTypeUpdateBundleInfo = DistributedVirtualSwitchProductSpecOperationType("updateBundleInfo") +) + +func init() { + t["DistributedVirtualSwitchProductSpecOperationType"] = reflect.TypeOf((*DistributedVirtualSwitchProductSpecOperationType)(nil)).Elem() +} + +type DpmBehavior string + +const ( + DpmBehaviorManual = DpmBehavior("manual") + DpmBehaviorAutomated = DpmBehavior("automated") +) + +func init() { + t["DpmBehavior"] = reflect.TypeOf((*DpmBehavior)(nil)).Elem() +} + +type DrsBehavior string + +const ( + DrsBehaviorManual = DrsBehavior("manual") + DrsBehaviorPartiallyAutomated = DrsBehavior("partiallyAutomated") + DrsBehaviorFullyAutomated = DrsBehavior("fullyAutomated") +) + +func init() { + t["DrsBehavior"] = reflect.TypeOf((*DrsBehavior)(nil)).Elem() +} + +type DrsInjectorWorkloadCorrelationState string + +const ( + DrsInjectorWorkloadCorrelationStateCorrelated = DrsInjectorWorkloadCorrelationState("Correlated") + DrsInjectorWorkloadCorrelationStateUncorrelated = DrsInjectorWorkloadCorrelationState("Uncorrelated") +) + +func init() { + t["DrsInjectorWorkloadCorrelationState"] = reflect.TypeOf((*DrsInjectorWorkloadCorrelationState)(nil)).Elem() +} + +type DrsRecommendationReasonCode string + +const ( + DrsRecommendationReasonCodeFairnessCpuAvg = DrsRecommendationReasonCode("fairnessCpuAvg") + DrsRecommendationReasonCodeFairnessMemAvg = DrsRecommendationReasonCode("fairnessMemAvg") + DrsRecommendationReasonCodeJointAffin = DrsRecommendationReasonCode("jointAffin") + DrsRecommendationReasonCodeAntiAffin = DrsRecommendationReasonCode("antiAffin") + DrsRecommendationReasonCodeHostMaint = DrsRecommendationReasonCode("hostMaint") +) + +func init() { + t["DrsRecommendationReasonCode"] = reflect.TypeOf((*DrsRecommendationReasonCode)(nil)).Elem() +} + +type DvsFilterOnFailure string + +const ( + DvsFilterOnFailureFailOpen = DvsFilterOnFailure("failOpen") + DvsFilterOnFailureFailClosed = DvsFilterOnFailure("failClosed") +) + +func init() { + t["DvsFilterOnFailure"] = reflect.TypeOf((*DvsFilterOnFailure)(nil)).Elem() +} + +type DvsNetworkRuleDirectionType string + +const ( + DvsNetworkRuleDirectionTypeIncomingPackets = DvsNetworkRuleDirectionType("incomingPackets") + DvsNetworkRuleDirectionTypeOutgoingPackets = DvsNetworkRuleDirectionType("outgoingPackets") + DvsNetworkRuleDirectionTypeBoth = DvsNetworkRuleDirectionType("both") +) + +func init() { + t["DvsNetworkRuleDirectionType"] = reflect.TypeOf((*DvsNetworkRuleDirectionType)(nil)).Elem() +} + +type EntityImportType string + +const ( + EntityImportTypeCreateEntityWithNewIdentifier = EntityImportType("createEntityWithNewIdentifier") + EntityImportTypeCreateEntityWithOriginalIdentifier = EntityImportType("createEntityWithOriginalIdentifier") + EntityImportTypeApplyToEntitySpecified = EntityImportType("applyToEntitySpecified") +) + +func init() { + t["EntityImportType"] = reflect.TypeOf((*EntityImportType)(nil)).Elem() +} + +type EntityType string + +const ( + EntityTypeDistributedVirtualSwitch = EntityType("distributedVirtualSwitch") + EntityTypeDistributedVirtualPortgroup = EntityType("distributedVirtualPortgroup") +) + +func init() { + t["EntityType"] = reflect.TypeOf((*EntityType)(nil)).Elem() +} + +type EventAlarmExpressionComparisonOperator string + +const ( + EventAlarmExpressionComparisonOperatorEquals = EventAlarmExpressionComparisonOperator("equals") + EventAlarmExpressionComparisonOperatorNotEqualTo = EventAlarmExpressionComparisonOperator("notEqualTo") + EventAlarmExpressionComparisonOperatorStartsWith = EventAlarmExpressionComparisonOperator("startsWith") + EventAlarmExpressionComparisonOperatorDoesNotStartWith = EventAlarmExpressionComparisonOperator("doesNotStartWith") + EventAlarmExpressionComparisonOperatorEndsWith = EventAlarmExpressionComparisonOperator("endsWith") + EventAlarmExpressionComparisonOperatorDoesNotEndWith = EventAlarmExpressionComparisonOperator("doesNotEndWith") +) + +func init() { + t["EventAlarmExpressionComparisonOperator"] = reflect.TypeOf((*EventAlarmExpressionComparisonOperator)(nil)).Elem() +} + +type EventCategory string + +const ( + EventCategoryInfo = EventCategory("info") + EventCategoryWarning = EventCategory("warning") + EventCategoryError = EventCategory("error") + EventCategoryUser = EventCategory("user") +) + +func init() { + t["EventCategory"] = reflect.TypeOf((*EventCategory)(nil)).Elem() +} + +type EventEventSeverity string + +const ( + EventEventSeverityError = EventEventSeverity("error") + EventEventSeverityWarning = EventEventSeverity("warning") + EventEventSeverityInfo = EventEventSeverity("info") + EventEventSeverityUser = EventEventSeverity("user") +) + +func init() { + t["EventEventSeverity"] = reflect.TypeOf((*EventEventSeverity)(nil)).Elem() +} + +type EventFilterSpecRecursionOption string + +const ( + EventFilterSpecRecursionOptionSelf = EventFilterSpecRecursionOption("self") + EventFilterSpecRecursionOptionChildren = EventFilterSpecRecursionOption("children") + EventFilterSpecRecursionOptionAll = EventFilterSpecRecursionOption("all") +) + +func init() { + t["EventFilterSpecRecursionOption"] = reflect.TypeOf((*EventFilterSpecRecursionOption)(nil)).Elem() +} + +type FibreChannelPortType string + +const ( + FibreChannelPortTypeFabric = FibreChannelPortType("fabric") + FibreChannelPortTypeLoop = FibreChannelPortType("loop") + FibreChannelPortTypePointToPoint = FibreChannelPortType("pointToPoint") + FibreChannelPortTypeUnknown = FibreChannelPortType("unknown") +) + +func init() { + t["FibreChannelPortType"] = reflect.TypeOf((*FibreChannelPortType)(nil)).Elem() +} + +type FileSystemMountInfoVStorageSupportStatus string + +const ( + FileSystemMountInfoVStorageSupportStatusVStorageSupported = FileSystemMountInfoVStorageSupportStatus("vStorageSupported") + FileSystemMountInfoVStorageSupportStatusVStorageUnsupported = FileSystemMountInfoVStorageSupportStatus("vStorageUnsupported") + FileSystemMountInfoVStorageSupportStatusVStorageUnknown = FileSystemMountInfoVStorageSupportStatus("vStorageUnknown") +) + +func init() { + t["FileSystemMountInfoVStorageSupportStatus"] = reflect.TypeOf((*FileSystemMountInfoVStorageSupportStatus)(nil)).Elem() +} + +type FtIssuesOnHostHostSelectionType string + +const ( + FtIssuesOnHostHostSelectionTypeUser = FtIssuesOnHostHostSelectionType("user") + FtIssuesOnHostHostSelectionTypeVc = FtIssuesOnHostHostSelectionType("vc") + FtIssuesOnHostHostSelectionTypeDrs = FtIssuesOnHostHostSelectionType("drs") +) + +func init() { + t["FtIssuesOnHostHostSelectionType"] = reflect.TypeOf((*FtIssuesOnHostHostSelectionType)(nil)).Elem() +} + +type GuestFileType string + +const ( + GuestFileTypeFile = GuestFileType("file") + GuestFileTypeDirectory = GuestFileType("directory") + GuestFileTypeSymlink = GuestFileType("symlink") +) + +func init() { + t["GuestFileType"] = reflect.TypeOf((*GuestFileType)(nil)).Elem() +} + +type GuestInfoAppStateType string + +const ( + GuestInfoAppStateTypeNone = GuestInfoAppStateType("none") + GuestInfoAppStateTypeAppStateOk = GuestInfoAppStateType("appStateOk") + GuestInfoAppStateTypeAppStateNeedReset = GuestInfoAppStateType("appStateNeedReset") +) + +func init() { + t["GuestInfoAppStateType"] = reflect.TypeOf((*GuestInfoAppStateType)(nil)).Elem() +} + +type GuestOsDescriptorFirmwareType string + +const ( + GuestOsDescriptorFirmwareTypeBios = GuestOsDescriptorFirmwareType("bios") + GuestOsDescriptorFirmwareTypeEfi = GuestOsDescriptorFirmwareType("efi") +) + +func init() { + t["GuestOsDescriptorFirmwareType"] = reflect.TypeOf((*GuestOsDescriptorFirmwareType)(nil)).Elem() +} + +type GuestOsDescriptorSupportLevel string + +const ( + GuestOsDescriptorSupportLevelExperimental = GuestOsDescriptorSupportLevel("experimental") + GuestOsDescriptorSupportLevelLegacy = GuestOsDescriptorSupportLevel("legacy") + GuestOsDescriptorSupportLevelTerminated = GuestOsDescriptorSupportLevel("terminated") + GuestOsDescriptorSupportLevelSupported = GuestOsDescriptorSupportLevel("supported") + GuestOsDescriptorSupportLevelUnsupported = GuestOsDescriptorSupportLevel("unsupported") + GuestOsDescriptorSupportLevelDeprecated = GuestOsDescriptorSupportLevel("deprecated") + GuestOsDescriptorSupportLevelTechPreview = GuestOsDescriptorSupportLevel("techPreview") +) + +func init() { + t["GuestOsDescriptorSupportLevel"] = reflect.TypeOf((*GuestOsDescriptorSupportLevel)(nil)).Elem() +} + +type GuestRegKeyWowSpec string + +const ( + GuestRegKeyWowSpecWOWNative = GuestRegKeyWowSpec("WOWNative") + GuestRegKeyWowSpecWOW32 = GuestRegKeyWowSpec("WOW32") + GuestRegKeyWowSpecWOW64 = GuestRegKeyWowSpec("WOW64") +) + +func init() { + t["GuestRegKeyWowSpec"] = reflect.TypeOf((*GuestRegKeyWowSpec)(nil)).Elem() +} + +type HostAccessMode string + +const ( + HostAccessModeAccessNone = HostAccessMode("accessNone") + HostAccessModeAccessAdmin = HostAccessMode("accessAdmin") + HostAccessModeAccessNoAccess = HostAccessMode("accessNoAccess") + HostAccessModeAccessReadOnly = HostAccessMode("accessReadOnly") + HostAccessModeAccessOther = HostAccessMode("accessOther") +) + +func init() { + t["HostAccessMode"] = reflect.TypeOf((*HostAccessMode)(nil)).Elem() +} + +type HostActiveDirectoryAuthenticationCertificateDigest string + +const ( + HostActiveDirectoryAuthenticationCertificateDigestSHA1 = HostActiveDirectoryAuthenticationCertificateDigest("SHA1") +) + +func init() { + t["HostActiveDirectoryAuthenticationCertificateDigest"] = reflect.TypeOf((*HostActiveDirectoryAuthenticationCertificateDigest)(nil)).Elem() +} + +type HostActiveDirectoryInfoDomainMembershipStatus string + +const ( + HostActiveDirectoryInfoDomainMembershipStatusUnknown = HostActiveDirectoryInfoDomainMembershipStatus("unknown") + HostActiveDirectoryInfoDomainMembershipStatusOk = HostActiveDirectoryInfoDomainMembershipStatus("ok") + HostActiveDirectoryInfoDomainMembershipStatusNoServers = HostActiveDirectoryInfoDomainMembershipStatus("noServers") + HostActiveDirectoryInfoDomainMembershipStatusClientTrustBroken = HostActiveDirectoryInfoDomainMembershipStatus("clientTrustBroken") + HostActiveDirectoryInfoDomainMembershipStatusServerTrustBroken = HostActiveDirectoryInfoDomainMembershipStatus("serverTrustBroken") + HostActiveDirectoryInfoDomainMembershipStatusInconsistentTrust = HostActiveDirectoryInfoDomainMembershipStatus("inconsistentTrust") + HostActiveDirectoryInfoDomainMembershipStatusOtherProblem = HostActiveDirectoryInfoDomainMembershipStatus("otherProblem") +) + +func init() { + t["HostActiveDirectoryInfoDomainMembershipStatus"] = reflect.TypeOf((*HostActiveDirectoryInfoDomainMembershipStatus)(nil)).Elem() +} + +type HostCapabilityFtUnsupportedReason string + +const ( + HostCapabilityFtUnsupportedReasonVMotionNotLicensed = HostCapabilityFtUnsupportedReason("vMotionNotLicensed") + HostCapabilityFtUnsupportedReasonMissingVMotionNic = HostCapabilityFtUnsupportedReason("missingVMotionNic") + HostCapabilityFtUnsupportedReasonMissingFTLoggingNic = HostCapabilityFtUnsupportedReason("missingFTLoggingNic") + HostCapabilityFtUnsupportedReasonFtNotLicensed = HostCapabilityFtUnsupportedReason("ftNotLicensed") + HostCapabilityFtUnsupportedReasonHaAgentIssue = HostCapabilityFtUnsupportedReason("haAgentIssue") + HostCapabilityFtUnsupportedReasonUnsupportedProduct = HostCapabilityFtUnsupportedReason("unsupportedProduct") + HostCapabilityFtUnsupportedReasonCpuHvUnsupported = HostCapabilityFtUnsupportedReason("cpuHvUnsupported") + HostCapabilityFtUnsupportedReasonCpuHwmmuUnsupported = HostCapabilityFtUnsupportedReason("cpuHwmmuUnsupported") + HostCapabilityFtUnsupportedReasonCpuHvDisabled = HostCapabilityFtUnsupportedReason("cpuHvDisabled") +) + +func init() { + t["HostCapabilityFtUnsupportedReason"] = reflect.TypeOf((*HostCapabilityFtUnsupportedReason)(nil)).Elem() +} + +type HostCapabilityVmDirectPathGen2UnsupportedReason string + +const ( + HostCapabilityVmDirectPathGen2UnsupportedReasonHostNptIncompatibleProduct = HostCapabilityVmDirectPathGen2UnsupportedReason("hostNptIncompatibleProduct") + HostCapabilityVmDirectPathGen2UnsupportedReasonHostNptIncompatibleHardware = HostCapabilityVmDirectPathGen2UnsupportedReason("hostNptIncompatibleHardware") + HostCapabilityVmDirectPathGen2UnsupportedReasonHostNptDisabled = HostCapabilityVmDirectPathGen2UnsupportedReason("hostNptDisabled") +) + +func init() { + t["HostCapabilityVmDirectPathGen2UnsupportedReason"] = reflect.TypeOf((*HostCapabilityVmDirectPathGen2UnsupportedReason)(nil)).Elem() +} + +type HostCertificateManagerCertificateInfoCertificateStatus string + +const ( + HostCertificateManagerCertificateInfoCertificateStatusUnknown = HostCertificateManagerCertificateInfoCertificateStatus("unknown") + HostCertificateManagerCertificateInfoCertificateStatusExpired = HostCertificateManagerCertificateInfoCertificateStatus("expired") + HostCertificateManagerCertificateInfoCertificateStatusExpiring = HostCertificateManagerCertificateInfoCertificateStatus("expiring") + HostCertificateManagerCertificateInfoCertificateStatusExpiringShortly = HostCertificateManagerCertificateInfoCertificateStatus("expiringShortly") + HostCertificateManagerCertificateInfoCertificateStatusExpirationImminent = HostCertificateManagerCertificateInfoCertificateStatus("expirationImminent") + HostCertificateManagerCertificateInfoCertificateStatusGood = HostCertificateManagerCertificateInfoCertificateStatus("good") +) + +func init() { + t["HostCertificateManagerCertificateInfoCertificateStatus"] = reflect.TypeOf((*HostCertificateManagerCertificateInfoCertificateStatus)(nil)).Elem() +} + +type HostConfigChangeMode string + +const ( + HostConfigChangeModeModify = HostConfigChangeMode("modify") + HostConfigChangeModeReplace = HostConfigChangeMode("replace") +) + +func init() { + t["HostConfigChangeMode"] = reflect.TypeOf((*HostConfigChangeMode)(nil)).Elem() +} + +type HostConfigChangeOperation string + +const ( + HostConfigChangeOperationAdd = HostConfigChangeOperation("add") + HostConfigChangeOperationRemove = HostConfigChangeOperation("remove") + HostConfigChangeOperationEdit = HostConfigChangeOperation("edit") + HostConfigChangeOperationIgnore = HostConfigChangeOperation("ignore") +) + +func init() { + t["HostConfigChangeOperation"] = reflect.TypeOf((*HostConfigChangeOperation)(nil)).Elem() +} + +type HostCpuPackageVendor string + +const ( + HostCpuPackageVendorUnknown = HostCpuPackageVendor("unknown") + HostCpuPackageVendorIntel = HostCpuPackageVendor("intel") + HostCpuPackageVendorAmd = HostCpuPackageVendor("amd") +) + +func init() { + t["HostCpuPackageVendor"] = reflect.TypeOf((*HostCpuPackageVendor)(nil)).Elem() +} + +type HostCpuPowerManagementInfoPolicyType string + +const ( + HostCpuPowerManagementInfoPolicyTypeOff = HostCpuPowerManagementInfoPolicyType("off") + HostCpuPowerManagementInfoPolicyTypeStaticPolicy = HostCpuPowerManagementInfoPolicyType("staticPolicy") + HostCpuPowerManagementInfoPolicyTypeDynamicPolicy = HostCpuPowerManagementInfoPolicyType("dynamicPolicy") +) + +func init() { + t["HostCpuPowerManagementInfoPolicyType"] = reflect.TypeOf((*HostCpuPowerManagementInfoPolicyType)(nil)).Elem() +} + +type HostDasErrorEventHostDasErrorReason string + +const ( + HostDasErrorEventHostDasErrorReasonConfigFailed = HostDasErrorEventHostDasErrorReason("configFailed") + HostDasErrorEventHostDasErrorReasonTimeout = HostDasErrorEventHostDasErrorReason("timeout") + HostDasErrorEventHostDasErrorReasonCommunicationInitFailed = HostDasErrorEventHostDasErrorReason("communicationInitFailed") + HostDasErrorEventHostDasErrorReasonHealthCheckScriptFailed = HostDasErrorEventHostDasErrorReason("healthCheckScriptFailed") + HostDasErrorEventHostDasErrorReasonAgentFailed = HostDasErrorEventHostDasErrorReason("agentFailed") + HostDasErrorEventHostDasErrorReasonAgentShutdown = HostDasErrorEventHostDasErrorReason("agentShutdown") + HostDasErrorEventHostDasErrorReasonIsolationAddressUnpingable = HostDasErrorEventHostDasErrorReason("isolationAddressUnpingable") + HostDasErrorEventHostDasErrorReasonOther = HostDasErrorEventHostDasErrorReason("other") +) + +func init() { + t["HostDasErrorEventHostDasErrorReason"] = reflect.TypeOf((*HostDasErrorEventHostDasErrorReason)(nil)).Elem() +} + +type HostDigestInfoDigestMethodType string + +const ( + HostDigestInfoDigestMethodTypeSHA1 = HostDigestInfoDigestMethodType("SHA1") + HostDigestInfoDigestMethodTypeMD5 = HostDigestInfoDigestMethodType("MD5") +) + +func init() { + t["HostDigestInfoDigestMethodType"] = reflect.TypeOf((*HostDigestInfoDigestMethodType)(nil)).Elem() +} + +type HostDisconnectedEventReasonCode string + +const ( + HostDisconnectedEventReasonCodeSslThumbprintVerifyFailed = HostDisconnectedEventReasonCode("sslThumbprintVerifyFailed") + HostDisconnectedEventReasonCodeLicenseExpired = HostDisconnectedEventReasonCode("licenseExpired") + HostDisconnectedEventReasonCodeAgentUpgrade = HostDisconnectedEventReasonCode("agentUpgrade") + HostDisconnectedEventReasonCodeUserRequest = HostDisconnectedEventReasonCode("userRequest") + HostDisconnectedEventReasonCodeInsufficientLicenses = HostDisconnectedEventReasonCode("insufficientLicenses") + HostDisconnectedEventReasonCodeAgentOutOfDate = HostDisconnectedEventReasonCode("agentOutOfDate") + HostDisconnectedEventReasonCodePasswordDecryptFailure = HostDisconnectedEventReasonCode("passwordDecryptFailure") + HostDisconnectedEventReasonCodeUnknown = HostDisconnectedEventReasonCode("unknown") + HostDisconnectedEventReasonCodeVcVRAMCapacityExceeded = HostDisconnectedEventReasonCode("vcVRAMCapacityExceeded") +) + +func init() { + t["HostDisconnectedEventReasonCode"] = reflect.TypeOf((*HostDisconnectedEventReasonCode)(nil)).Elem() +} + +type HostDiskPartitionInfoPartitionFormat string + +const ( + HostDiskPartitionInfoPartitionFormatGpt = HostDiskPartitionInfoPartitionFormat("gpt") + HostDiskPartitionInfoPartitionFormatMbr = HostDiskPartitionInfoPartitionFormat("mbr") + HostDiskPartitionInfoPartitionFormatUnknown = HostDiskPartitionInfoPartitionFormat("unknown") +) + +func init() { + t["HostDiskPartitionInfoPartitionFormat"] = reflect.TypeOf((*HostDiskPartitionInfoPartitionFormat)(nil)).Elem() +} + +type HostDiskPartitionInfoType string + +const ( + HostDiskPartitionInfoTypeNone = HostDiskPartitionInfoType("none") + HostDiskPartitionInfoTypeVmfs = HostDiskPartitionInfoType("vmfs") + HostDiskPartitionInfoTypeLinuxNative = HostDiskPartitionInfoType("linuxNative") + HostDiskPartitionInfoTypeLinuxSwap = HostDiskPartitionInfoType("linuxSwap") + HostDiskPartitionInfoTypeExtended = HostDiskPartitionInfoType("extended") + HostDiskPartitionInfoTypeNtfs = HostDiskPartitionInfoType("ntfs") + HostDiskPartitionInfoTypeVmkDiagnostic = HostDiskPartitionInfoType("vmkDiagnostic") + HostDiskPartitionInfoTypeVffs = HostDiskPartitionInfoType("vffs") +) + +func init() { + t["HostDiskPartitionInfoType"] = reflect.TypeOf((*HostDiskPartitionInfoType)(nil)).Elem() +} + +type HostFeatureVersionKey string + +const ( + HostFeatureVersionKeyFaultTolerance = HostFeatureVersionKey("faultTolerance") +) + +func init() { + t["HostFeatureVersionKey"] = reflect.TypeOf((*HostFeatureVersionKey)(nil)).Elem() +} + +type HostFileSystemVolumeFileSystemType string + +const ( + HostFileSystemVolumeFileSystemTypeVMFS = HostFileSystemVolumeFileSystemType("VMFS") + HostFileSystemVolumeFileSystemTypeNFS = HostFileSystemVolumeFileSystemType("NFS") + HostFileSystemVolumeFileSystemTypeNFS41 = HostFileSystemVolumeFileSystemType("NFS41") + HostFileSystemVolumeFileSystemTypeCIFS = HostFileSystemVolumeFileSystemType("CIFS") + HostFileSystemVolumeFileSystemTypeVsan = HostFileSystemVolumeFileSystemType("vsan") + HostFileSystemVolumeFileSystemTypeVFFS = HostFileSystemVolumeFileSystemType("VFFS") + HostFileSystemVolumeFileSystemTypeVVOL = HostFileSystemVolumeFileSystemType("VVOL") + HostFileSystemVolumeFileSystemTypeOTHER = HostFileSystemVolumeFileSystemType("OTHER") +) + +func init() { + t["HostFileSystemVolumeFileSystemType"] = reflect.TypeOf((*HostFileSystemVolumeFileSystemType)(nil)).Elem() +} + +type HostFirewallRuleDirection string + +const ( + HostFirewallRuleDirectionInbound = HostFirewallRuleDirection("inbound") + HostFirewallRuleDirectionOutbound = HostFirewallRuleDirection("outbound") +) + +func init() { + t["HostFirewallRuleDirection"] = reflect.TypeOf((*HostFirewallRuleDirection)(nil)).Elem() +} + +type HostFirewallRulePortType string + +const ( + HostFirewallRulePortTypeSrc = HostFirewallRulePortType("src") + HostFirewallRulePortTypeDst = HostFirewallRulePortType("dst") +) + +func init() { + t["HostFirewallRulePortType"] = reflect.TypeOf((*HostFirewallRulePortType)(nil)).Elem() +} + +type HostFirewallRuleProtocol string + +const ( + HostFirewallRuleProtocolTcp = HostFirewallRuleProtocol("tcp") + HostFirewallRuleProtocolUdp = HostFirewallRuleProtocol("udp") +) + +func init() { + t["HostFirewallRuleProtocol"] = reflect.TypeOf((*HostFirewallRuleProtocol)(nil)).Elem() +} + +type HostGraphicsInfoGraphicsType string + +const ( + HostGraphicsInfoGraphicsTypeBasic = HostGraphicsInfoGraphicsType("basic") + HostGraphicsInfoGraphicsTypeShared = HostGraphicsInfoGraphicsType("shared") + HostGraphicsInfoGraphicsTypeDirect = HostGraphicsInfoGraphicsType("direct") +) + +func init() { + t["HostGraphicsInfoGraphicsType"] = reflect.TypeOf((*HostGraphicsInfoGraphicsType)(nil)).Elem() +} + +type HostHardwareElementStatus string + +const ( + HostHardwareElementStatusUnknown = HostHardwareElementStatus("Unknown") + HostHardwareElementStatusGreen = HostHardwareElementStatus("Green") + HostHardwareElementStatusYellow = HostHardwareElementStatus("Yellow") + HostHardwareElementStatusRed = HostHardwareElementStatus("Red") +) + +func init() { + t["HostHardwareElementStatus"] = reflect.TypeOf((*HostHardwareElementStatus)(nil)).Elem() +} + +type HostHasComponentFailureHostComponentType string + +const ( + HostHasComponentFailureHostComponentTypeDatastore = HostHasComponentFailureHostComponentType("Datastore") +) + +func init() { + t["HostHasComponentFailureHostComponentType"] = reflect.TypeOf((*HostHasComponentFailureHostComponentType)(nil)).Elem() +} + +type HostImageAcceptanceLevel string + +const ( + HostImageAcceptanceLevelVmware_certified = HostImageAcceptanceLevel("vmware_certified") + HostImageAcceptanceLevelVmware_accepted = HostImageAcceptanceLevel("vmware_accepted") + HostImageAcceptanceLevelPartner = HostImageAcceptanceLevel("partner") + HostImageAcceptanceLevelCommunity = HostImageAcceptanceLevel("community") +) + +func init() { + t["HostImageAcceptanceLevel"] = reflect.TypeOf((*HostImageAcceptanceLevel)(nil)).Elem() +} + +type HostIncompatibleForFaultToleranceReason string + +const ( + HostIncompatibleForFaultToleranceReasonProduct = HostIncompatibleForFaultToleranceReason("product") + HostIncompatibleForFaultToleranceReasonProcessor = HostIncompatibleForFaultToleranceReason("processor") +) + +func init() { + t["HostIncompatibleForFaultToleranceReason"] = reflect.TypeOf((*HostIncompatibleForFaultToleranceReason)(nil)).Elem() +} + +type HostIncompatibleForRecordReplayReason string + +const ( + HostIncompatibleForRecordReplayReasonProduct = HostIncompatibleForRecordReplayReason("product") + HostIncompatibleForRecordReplayReasonProcessor = HostIncompatibleForRecordReplayReason("processor") +) + +func init() { + t["HostIncompatibleForRecordReplayReason"] = reflect.TypeOf((*HostIncompatibleForRecordReplayReason)(nil)).Elem() +} + +type HostInternetScsiHbaChapAuthenticationType string + +const ( + HostInternetScsiHbaChapAuthenticationTypeChapProhibited = HostInternetScsiHbaChapAuthenticationType("chapProhibited") + HostInternetScsiHbaChapAuthenticationTypeChapDiscouraged = HostInternetScsiHbaChapAuthenticationType("chapDiscouraged") + HostInternetScsiHbaChapAuthenticationTypeChapPreferred = HostInternetScsiHbaChapAuthenticationType("chapPreferred") + HostInternetScsiHbaChapAuthenticationTypeChapRequired = HostInternetScsiHbaChapAuthenticationType("chapRequired") +) + +func init() { + t["HostInternetScsiHbaChapAuthenticationType"] = reflect.TypeOf((*HostInternetScsiHbaChapAuthenticationType)(nil)).Elem() +} + +type HostInternetScsiHbaDigestType string + +const ( + HostInternetScsiHbaDigestTypeDigestProhibited = HostInternetScsiHbaDigestType("digestProhibited") + HostInternetScsiHbaDigestTypeDigestDiscouraged = HostInternetScsiHbaDigestType("digestDiscouraged") + HostInternetScsiHbaDigestTypeDigestPreferred = HostInternetScsiHbaDigestType("digestPreferred") + HostInternetScsiHbaDigestTypeDigestRequired = HostInternetScsiHbaDigestType("digestRequired") +) + +func init() { + t["HostInternetScsiHbaDigestType"] = reflect.TypeOf((*HostInternetScsiHbaDigestType)(nil)).Elem() +} + +type HostInternetScsiHbaIscsiIpv6AddressAddressConfigurationType string + +const ( + HostInternetScsiHbaIscsiIpv6AddressAddressConfigurationTypeDHCP = HostInternetScsiHbaIscsiIpv6AddressAddressConfigurationType("DHCP") + HostInternetScsiHbaIscsiIpv6AddressAddressConfigurationTypeAutoConfigured = HostInternetScsiHbaIscsiIpv6AddressAddressConfigurationType("AutoConfigured") + HostInternetScsiHbaIscsiIpv6AddressAddressConfigurationTypeStatic = HostInternetScsiHbaIscsiIpv6AddressAddressConfigurationType("Static") + HostInternetScsiHbaIscsiIpv6AddressAddressConfigurationTypeOther = HostInternetScsiHbaIscsiIpv6AddressAddressConfigurationType("Other") +) + +func init() { + t["HostInternetScsiHbaIscsiIpv6AddressAddressConfigurationType"] = reflect.TypeOf((*HostInternetScsiHbaIscsiIpv6AddressAddressConfigurationType)(nil)).Elem() +} + +type HostInternetScsiHbaIscsiIpv6AddressIPv6AddressOperation string + +const ( + HostInternetScsiHbaIscsiIpv6AddressIPv6AddressOperationAdd = HostInternetScsiHbaIscsiIpv6AddressIPv6AddressOperation("add") + HostInternetScsiHbaIscsiIpv6AddressIPv6AddressOperationRemove = HostInternetScsiHbaIscsiIpv6AddressIPv6AddressOperation("remove") +) + +func init() { + t["HostInternetScsiHbaIscsiIpv6AddressIPv6AddressOperation"] = reflect.TypeOf((*HostInternetScsiHbaIscsiIpv6AddressIPv6AddressOperation)(nil)).Elem() +} + +type HostInternetScsiHbaNetworkBindingSupportType string + +const ( + HostInternetScsiHbaNetworkBindingSupportTypeNotsupported = HostInternetScsiHbaNetworkBindingSupportType("notsupported") + HostInternetScsiHbaNetworkBindingSupportTypeOptional = HostInternetScsiHbaNetworkBindingSupportType("optional") + HostInternetScsiHbaNetworkBindingSupportTypeRequired = HostInternetScsiHbaNetworkBindingSupportType("required") +) + +func init() { + t["HostInternetScsiHbaNetworkBindingSupportType"] = reflect.TypeOf((*HostInternetScsiHbaNetworkBindingSupportType)(nil)).Elem() +} + +type HostInternetScsiHbaStaticTargetTargetDiscoveryMethod string + +const ( + HostInternetScsiHbaStaticTargetTargetDiscoveryMethodStaticMethod = HostInternetScsiHbaStaticTargetTargetDiscoveryMethod("staticMethod") + HostInternetScsiHbaStaticTargetTargetDiscoveryMethodSendTargetMethod = HostInternetScsiHbaStaticTargetTargetDiscoveryMethod("sendTargetMethod") + HostInternetScsiHbaStaticTargetTargetDiscoveryMethodSlpMethod = HostInternetScsiHbaStaticTargetTargetDiscoveryMethod("slpMethod") + HostInternetScsiHbaStaticTargetTargetDiscoveryMethodIsnsMethod = HostInternetScsiHbaStaticTargetTargetDiscoveryMethod("isnsMethod") + HostInternetScsiHbaStaticTargetTargetDiscoveryMethodUnknownMethod = HostInternetScsiHbaStaticTargetTargetDiscoveryMethod("unknownMethod") +) + +func init() { + t["HostInternetScsiHbaStaticTargetTargetDiscoveryMethod"] = reflect.TypeOf((*HostInternetScsiHbaStaticTargetTargetDiscoveryMethod)(nil)).Elem() +} + +type HostIpConfigIpV6AddressConfigType string + +const ( + HostIpConfigIpV6AddressConfigTypeOther = HostIpConfigIpV6AddressConfigType("other") + HostIpConfigIpV6AddressConfigTypeManual = HostIpConfigIpV6AddressConfigType("manual") + HostIpConfigIpV6AddressConfigTypeDhcp = HostIpConfigIpV6AddressConfigType("dhcp") + HostIpConfigIpV6AddressConfigTypeLinklayer = HostIpConfigIpV6AddressConfigType("linklayer") + HostIpConfigIpV6AddressConfigTypeRandom = HostIpConfigIpV6AddressConfigType("random") +) + +func init() { + t["HostIpConfigIpV6AddressConfigType"] = reflect.TypeOf((*HostIpConfigIpV6AddressConfigType)(nil)).Elem() +} + +type HostIpConfigIpV6AddressStatus string + +const ( + HostIpConfigIpV6AddressStatusPreferred = HostIpConfigIpV6AddressStatus("preferred") + HostIpConfigIpV6AddressStatusDeprecated = HostIpConfigIpV6AddressStatus("deprecated") + HostIpConfigIpV6AddressStatusInvalid = HostIpConfigIpV6AddressStatus("invalid") + HostIpConfigIpV6AddressStatusInaccessible = HostIpConfigIpV6AddressStatus("inaccessible") + HostIpConfigIpV6AddressStatusUnknown = HostIpConfigIpV6AddressStatus("unknown") + HostIpConfigIpV6AddressStatusTentative = HostIpConfigIpV6AddressStatus("tentative") + HostIpConfigIpV6AddressStatusDuplicate = HostIpConfigIpV6AddressStatus("duplicate") +) + +func init() { + t["HostIpConfigIpV6AddressStatus"] = reflect.TypeOf((*HostIpConfigIpV6AddressStatus)(nil)).Elem() +} + +type HostLicensableResourceKey string + +const ( + HostLicensableResourceKeyNumCpuPackages = HostLicensableResourceKey("numCpuPackages") + HostLicensableResourceKeyNumCpuCores = HostLicensableResourceKey("numCpuCores") + HostLicensableResourceKeyMemorySize = HostLicensableResourceKey("memorySize") + HostLicensableResourceKeyMemoryForVms = HostLicensableResourceKey("memoryForVms") + HostLicensableResourceKeyNumVmsStarted = HostLicensableResourceKey("numVmsStarted") + HostLicensableResourceKeyNumVmsStarting = HostLicensableResourceKey("numVmsStarting") +) + +func init() { + t["HostLicensableResourceKey"] = reflect.TypeOf((*HostLicensableResourceKey)(nil)).Elem() +} + +type HostLockdownMode string + +const ( + HostLockdownModeLockdownDisabled = HostLockdownMode("lockdownDisabled") + HostLockdownModeLockdownNormal = HostLockdownMode("lockdownNormal") + HostLockdownModeLockdownStrict = HostLockdownMode("lockdownStrict") +) + +func init() { + t["HostLockdownMode"] = reflect.TypeOf((*HostLockdownMode)(nil)).Elem() +} + +type HostLowLevelProvisioningManagerFileType string + +const ( + HostLowLevelProvisioningManagerFileTypeFile = HostLowLevelProvisioningManagerFileType("File") + HostLowLevelProvisioningManagerFileTypeVirtualDisk = HostLowLevelProvisioningManagerFileType("VirtualDisk") + HostLowLevelProvisioningManagerFileTypeDirectory = HostLowLevelProvisioningManagerFileType("Directory") +) + +func init() { + t["HostLowLevelProvisioningManagerFileType"] = reflect.TypeOf((*HostLowLevelProvisioningManagerFileType)(nil)).Elem() +} + +type HostLowLevelProvisioningManagerReloadTarget string + +const ( + HostLowLevelProvisioningManagerReloadTargetCurrentConfig = HostLowLevelProvisioningManagerReloadTarget("currentConfig") + HostLowLevelProvisioningManagerReloadTargetSnapshotConfig = HostLowLevelProvisioningManagerReloadTarget("snapshotConfig") +) + +func init() { + t["HostLowLevelProvisioningManagerReloadTarget"] = reflect.TypeOf((*HostLowLevelProvisioningManagerReloadTarget)(nil)).Elem() +} + +type HostMountInfoInaccessibleReason string + +const ( + HostMountInfoInaccessibleReasonAllPathsDown_Start = HostMountInfoInaccessibleReason("AllPathsDown_Start") + HostMountInfoInaccessibleReasonAllPathsDown_Timeout = HostMountInfoInaccessibleReason("AllPathsDown_Timeout") + HostMountInfoInaccessibleReasonPermanentDeviceLoss = HostMountInfoInaccessibleReason("PermanentDeviceLoss") +) + +func init() { + t["HostMountInfoInaccessibleReason"] = reflect.TypeOf((*HostMountInfoInaccessibleReason)(nil)).Elem() +} + +type HostMountMode string + +const ( + HostMountModeReadWrite = HostMountMode("readWrite") + HostMountModeReadOnly = HostMountMode("readOnly") +) + +func init() { + t["HostMountMode"] = reflect.TypeOf((*HostMountMode)(nil)).Elem() +} + +type HostNasVolumeSecurityType string + +const ( + HostNasVolumeSecurityTypeAUTH_SYS = HostNasVolumeSecurityType("AUTH_SYS") + HostNasVolumeSecurityTypeSEC_KRB5 = HostNasVolumeSecurityType("SEC_KRB5") +) + +func init() { + t["HostNasVolumeSecurityType"] = reflect.TypeOf((*HostNasVolumeSecurityType)(nil)).Elem() +} + +type HostNetStackInstanceCongestionControlAlgorithmType string + +const ( + HostNetStackInstanceCongestionControlAlgorithmTypeNewreno = HostNetStackInstanceCongestionControlAlgorithmType("newreno") + HostNetStackInstanceCongestionControlAlgorithmTypeCubic = HostNetStackInstanceCongestionControlAlgorithmType("cubic") +) + +func init() { + t["HostNetStackInstanceCongestionControlAlgorithmType"] = reflect.TypeOf((*HostNetStackInstanceCongestionControlAlgorithmType)(nil)).Elem() +} + +type HostNetStackInstanceSystemStackKey string + +const ( + HostNetStackInstanceSystemStackKeyDefaultTcpipStack = HostNetStackInstanceSystemStackKey("defaultTcpipStack") + HostNetStackInstanceSystemStackKeyVmotion = HostNetStackInstanceSystemStackKey("vmotion") + HostNetStackInstanceSystemStackKeyVSphereProvisioning = HostNetStackInstanceSystemStackKey("vSphereProvisioning") +) + +func init() { + t["HostNetStackInstanceSystemStackKey"] = reflect.TypeOf((*HostNetStackInstanceSystemStackKey)(nil)).Elem() +} + +type HostNumericSensorHealthState string + +const ( + HostNumericSensorHealthStateUnknown = HostNumericSensorHealthState("unknown") + HostNumericSensorHealthStateGreen = HostNumericSensorHealthState("green") + HostNumericSensorHealthStateYellow = HostNumericSensorHealthState("yellow") + HostNumericSensorHealthStateRed = HostNumericSensorHealthState("red") +) + +func init() { + t["HostNumericSensorHealthState"] = reflect.TypeOf((*HostNumericSensorHealthState)(nil)).Elem() +} + +type HostNumericSensorType string + +const ( + HostNumericSensorTypeFan = HostNumericSensorType("fan") + HostNumericSensorTypePower = HostNumericSensorType("power") + HostNumericSensorTypeTemperature = HostNumericSensorType("temperature") + HostNumericSensorTypeVoltage = HostNumericSensorType("voltage") + HostNumericSensorTypeOther = HostNumericSensorType("other") +) + +func init() { + t["HostNumericSensorType"] = reflect.TypeOf((*HostNumericSensorType)(nil)).Elem() +} + +type HostOpaqueSwitchOpaqueSwitchState string + +const ( + HostOpaqueSwitchOpaqueSwitchStateUp = HostOpaqueSwitchOpaqueSwitchState("up") + HostOpaqueSwitchOpaqueSwitchStateWarning = HostOpaqueSwitchOpaqueSwitchState("warning") + HostOpaqueSwitchOpaqueSwitchStateDown = HostOpaqueSwitchOpaqueSwitchState("down") +) + +func init() { + t["HostOpaqueSwitchOpaqueSwitchState"] = reflect.TypeOf((*HostOpaqueSwitchOpaqueSwitchState)(nil)).Elem() +} + +type HostPatchManagerInstallState string + +const ( + HostPatchManagerInstallStateHostRestarted = HostPatchManagerInstallState("hostRestarted") + HostPatchManagerInstallStateImageActive = HostPatchManagerInstallState("imageActive") +) + +func init() { + t["HostPatchManagerInstallState"] = reflect.TypeOf((*HostPatchManagerInstallState)(nil)).Elem() +} + +type HostPatchManagerIntegrityStatus string + +const ( + HostPatchManagerIntegrityStatusValidated = HostPatchManagerIntegrityStatus("validated") + HostPatchManagerIntegrityStatusKeyNotFound = HostPatchManagerIntegrityStatus("keyNotFound") + HostPatchManagerIntegrityStatusKeyRevoked = HostPatchManagerIntegrityStatus("keyRevoked") + HostPatchManagerIntegrityStatusKeyExpired = HostPatchManagerIntegrityStatus("keyExpired") + HostPatchManagerIntegrityStatusDigestMismatch = HostPatchManagerIntegrityStatus("digestMismatch") + HostPatchManagerIntegrityStatusNotEnoughSignatures = HostPatchManagerIntegrityStatus("notEnoughSignatures") + HostPatchManagerIntegrityStatusValidationError = HostPatchManagerIntegrityStatus("validationError") +) + +func init() { + t["HostPatchManagerIntegrityStatus"] = reflect.TypeOf((*HostPatchManagerIntegrityStatus)(nil)).Elem() +} + +type HostPatchManagerReason string + +const ( + HostPatchManagerReasonObsoleted = HostPatchManagerReason("obsoleted") + HostPatchManagerReasonMissingPatch = HostPatchManagerReason("missingPatch") + HostPatchManagerReasonMissingLib = HostPatchManagerReason("missingLib") + HostPatchManagerReasonHasDependentPatch = HostPatchManagerReason("hasDependentPatch") + HostPatchManagerReasonConflictPatch = HostPatchManagerReason("conflictPatch") + HostPatchManagerReasonConflictLib = HostPatchManagerReason("conflictLib") +) + +func init() { + t["HostPatchManagerReason"] = reflect.TypeOf((*HostPatchManagerReason)(nil)).Elem() +} + +type HostPowerOperationType string + +const ( + HostPowerOperationTypePowerOn = HostPowerOperationType("powerOn") + HostPowerOperationTypePowerOff = HostPowerOperationType("powerOff") +) + +func init() { + t["HostPowerOperationType"] = reflect.TypeOf((*HostPowerOperationType)(nil)).Elem() +} + +type HostProfileManagerAnswerFileStatus string + +const ( + HostProfileManagerAnswerFileStatusValid = HostProfileManagerAnswerFileStatus("valid") + HostProfileManagerAnswerFileStatusInvalid = HostProfileManagerAnswerFileStatus("invalid") + HostProfileManagerAnswerFileStatusUnknown = HostProfileManagerAnswerFileStatus("unknown") +) + +func init() { + t["HostProfileManagerAnswerFileStatus"] = reflect.TypeOf((*HostProfileManagerAnswerFileStatus)(nil)).Elem() +} + +type HostProfileManagerTaskListRequirement string + +const ( + HostProfileManagerTaskListRequirementMaintenanceModeRequired = HostProfileManagerTaskListRequirement("maintenanceModeRequired") + HostProfileManagerTaskListRequirementRebootRequired = HostProfileManagerTaskListRequirement("rebootRequired") +) + +func init() { + t["HostProfileManagerTaskListRequirement"] = reflect.TypeOf((*HostProfileManagerTaskListRequirement)(nil)).Elem() +} + +type HostProtocolEndpointPEType string + +const ( + HostProtocolEndpointPETypeBlock = HostProtocolEndpointPEType("block") + HostProtocolEndpointPETypeNas = HostProtocolEndpointPEType("nas") +) + +func init() { + t["HostProtocolEndpointPEType"] = reflect.TypeOf((*HostProtocolEndpointPEType)(nil)).Elem() +} + +type HostReplayUnsupportedReason string + +const ( + HostReplayUnsupportedReasonIncompatibleProduct = HostReplayUnsupportedReason("incompatibleProduct") + HostReplayUnsupportedReasonIncompatibleCpu = HostReplayUnsupportedReason("incompatibleCpu") + HostReplayUnsupportedReasonHvDisabled = HostReplayUnsupportedReason("hvDisabled") + HostReplayUnsupportedReasonCpuidLimitSet = HostReplayUnsupportedReason("cpuidLimitSet") + HostReplayUnsupportedReasonOldBIOS = HostReplayUnsupportedReason("oldBIOS") + HostReplayUnsupportedReasonUnknown = HostReplayUnsupportedReason("unknown") +) + +func init() { + t["HostReplayUnsupportedReason"] = reflect.TypeOf((*HostReplayUnsupportedReason)(nil)).Elem() +} + +type HostRuntimeInfoNetStackInstanceRuntimeInfoState string + +const ( + HostRuntimeInfoNetStackInstanceRuntimeInfoStateInactive = HostRuntimeInfoNetStackInstanceRuntimeInfoState("inactive") + HostRuntimeInfoNetStackInstanceRuntimeInfoStateActive = HostRuntimeInfoNetStackInstanceRuntimeInfoState("active") + HostRuntimeInfoNetStackInstanceRuntimeInfoStateDeactivating = HostRuntimeInfoNetStackInstanceRuntimeInfoState("deactivating") + HostRuntimeInfoNetStackInstanceRuntimeInfoStateActivating = HostRuntimeInfoNetStackInstanceRuntimeInfoState("activating") +) + +func init() { + t["HostRuntimeInfoNetStackInstanceRuntimeInfoState"] = reflect.TypeOf((*HostRuntimeInfoNetStackInstanceRuntimeInfoState)(nil)).Elem() +} + +type HostServicePolicy string + +const ( + HostServicePolicyOn = HostServicePolicy("on") + HostServicePolicyAutomatic = HostServicePolicy("automatic") + HostServicePolicyOff = HostServicePolicy("off") +) + +func init() { + t["HostServicePolicy"] = reflect.TypeOf((*HostServicePolicy)(nil)).Elem() +} + +type HostSnmpAgentCapability string + +const ( + HostSnmpAgentCapabilityCOMPLETE = HostSnmpAgentCapability("COMPLETE") + HostSnmpAgentCapabilityDIAGNOSTICS = HostSnmpAgentCapability("DIAGNOSTICS") + HostSnmpAgentCapabilityCONFIGURATION = HostSnmpAgentCapability("CONFIGURATION") +) + +func init() { + t["HostSnmpAgentCapability"] = reflect.TypeOf((*HostSnmpAgentCapability)(nil)).Elem() +} + +type HostStandbyMode string + +const ( + HostStandbyModeEntering = HostStandbyMode("entering") + HostStandbyModeExiting = HostStandbyMode("exiting") + HostStandbyModeIn = HostStandbyMode("in") + HostStandbyModeNone = HostStandbyMode("none") +) + +func init() { + t["HostStandbyMode"] = reflect.TypeOf((*HostStandbyMode)(nil)).Elem() +} + +type HostSystemConnectionState string + +const ( + HostSystemConnectionStateConnected = HostSystemConnectionState("connected") + HostSystemConnectionStateNotResponding = HostSystemConnectionState("notResponding") + HostSystemConnectionStateDisconnected = HostSystemConnectionState("disconnected") +) + +func init() { + t["HostSystemConnectionState"] = reflect.TypeOf((*HostSystemConnectionState)(nil)).Elem() +} + +type HostSystemIdentificationInfoIdentifier string + +const ( + HostSystemIdentificationInfoIdentifierAssetTag = HostSystemIdentificationInfoIdentifier("AssetTag") + HostSystemIdentificationInfoIdentifierServiceTag = HostSystemIdentificationInfoIdentifier("ServiceTag") + HostSystemIdentificationInfoIdentifierOemSpecificString = HostSystemIdentificationInfoIdentifier("OemSpecificString") +) + +func init() { + t["HostSystemIdentificationInfoIdentifier"] = reflect.TypeOf((*HostSystemIdentificationInfoIdentifier)(nil)).Elem() +} + +type HostSystemPowerState string + +const ( + HostSystemPowerStatePoweredOn = HostSystemPowerState("poweredOn") + HostSystemPowerStatePoweredOff = HostSystemPowerState("poweredOff") + HostSystemPowerStateStandBy = HostSystemPowerState("standBy") + HostSystemPowerStateUnknown = HostSystemPowerState("unknown") +) + +func init() { + t["HostSystemPowerState"] = reflect.TypeOf((*HostSystemPowerState)(nil)).Elem() +} + +type HostUnresolvedVmfsExtentUnresolvedReason string + +const ( + HostUnresolvedVmfsExtentUnresolvedReasonDiskIdMismatch = HostUnresolvedVmfsExtentUnresolvedReason("diskIdMismatch") + HostUnresolvedVmfsExtentUnresolvedReasonUuidConflict = HostUnresolvedVmfsExtentUnresolvedReason("uuidConflict") +) + +func init() { + t["HostUnresolvedVmfsExtentUnresolvedReason"] = reflect.TypeOf((*HostUnresolvedVmfsExtentUnresolvedReason)(nil)).Elem() +} + +type HostUnresolvedVmfsResolutionSpecVmfsUuidResolution string + +const ( + HostUnresolvedVmfsResolutionSpecVmfsUuidResolutionResignature = HostUnresolvedVmfsResolutionSpecVmfsUuidResolution("resignature") + HostUnresolvedVmfsResolutionSpecVmfsUuidResolutionForceMount = HostUnresolvedVmfsResolutionSpecVmfsUuidResolution("forceMount") +) + +func init() { + t["HostUnresolvedVmfsResolutionSpecVmfsUuidResolution"] = reflect.TypeOf((*HostUnresolvedVmfsResolutionSpecVmfsUuidResolution)(nil)).Elem() +} + +type HostVirtualNicManagerNicType string + +const ( + HostVirtualNicManagerNicTypeVmotion = HostVirtualNicManagerNicType("vmotion") + HostVirtualNicManagerNicTypeFaultToleranceLogging = HostVirtualNicManagerNicType("faultToleranceLogging") + HostVirtualNicManagerNicTypeVSphereReplication = HostVirtualNicManagerNicType("vSphereReplication") + HostVirtualNicManagerNicTypeVSphereReplicationNFC = HostVirtualNicManagerNicType("vSphereReplicationNFC") + HostVirtualNicManagerNicTypeManagement = HostVirtualNicManagerNicType("management") + HostVirtualNicManagerNicTypeVsan = HostVirtualNicManagerNicType("vsan") + HostVirtualNicManagerNicTypeVSphereProvisioning = HostVirtualNicManagerNicType("vSphereProvisioning") +) + +func init() { + t["HostVirtualNicManagerNicType"] = reflect.TypeOf((*HostVirtualNicManagerNicType)(nil)).Elem() +} + +type HostVmciAccessManagerMode string + +const ( + HostVmciAccessManagerModeGrant = HostVmciAccessManagerMode("grant") + HostVmciAccessManagerModeReplace = HostVmciAccessManagerMode("replace") + HostVmciAccessManagerModeRevoke = HostVmciAccessManagerMode("revoke") +) + +func init() { + t["HostVmciAccessManagerMode"] = reflect.TypeOf((*HostVmciAccessManagerMode)(nil)).Elem() +} + +type HttpNfcLeaseState string + +const ( + HttpNfcLeaseStateInitializing = HttpNfcLeaseState("initializing") + HttpNfcLeaseStateReady = HttpNfcLeaseState("ready") + HttpNfcLeaseStateDone = HttpNfcLeaseState("done") + HttpNfcLeaseStateError = HttpNfcLeaseState("error") +) + +func init() { + t["HttpNfcLeaseState"] = reflect.TypeOf((*HttpNfcLeaseState)(nil)).Elem() +} + +type IncompatibleHostForVmReplicationIncompatibleReason string + +const ( + IncompatibleHostForVmReplicationIncompatibleReasonRpo = IncompatibleHostForVmReplicationIncompatibleReason("rpo") + IncompatibleHostForVmReplicationIncompatibleReasonNetCompression = IncompatibleHostForVmReplicationIncompatibleReason("netCompression") +) + +func init() { + t["IncompatibleHostForVmReplicationIncompatibleReason"] = reflect.TypeOf((*IncompatibleHostForVmReplicationIncompatibleReason)(nil)).Elem() +} + +type InternetScsiSnsDiscoveryMethod string + +const ( + InternetScsiSnsDiscoveryMethodIsnsStatic = InternetScsiSnsDiscoveryMethod("isnsStatic") + InternetScsiSnsDiscoveryMethodIsnsDhcp = InternetScsiSnsDiscoveryMethod("isnsDhcp") + InternetScsiSnsDiscoveryMethodIsnsSlp = InternetScsiSnsDiscoveryMethod("isnsSlp") +) + +func init() { + t["InternetScsiSnsDiscoveryMethod"] = reflect.TypeOf((*InternetScsiSnsDiscoveryMethod)(nil)).Elem() +} + +type InvalidDasConfigArgumentEntryForInvalidArgument string + +const ( + InvalidDasConfigArgumentEntryForInvalidArgumentAdmissionControl = InvalidDasConfigArgumentEntryForInvalidArgument("admissionControl") + InvalidDasConfigArgumentEntryForInvalidArgumentUserHeartbeatDs = InvalidDasConfigArgumentEntryForInvalidArgument("userHeartbeatDs") + InvalidDasConfigArgumentEntryForInvalidArgumentVmConfig = InvalidDasConfigArgumentEntryForInvalidArgument("vmConfig") +) + +func init() { + t["InvalidDasConfigArgumentEntryForInvalidArgument"] = reflect.TypeOf((*InvalidDasConfigArgumentEntryForInvalidArgument)(nil)).Elem() +} + +type InvalidProfileReferenceHostReason string + +const ( + InvalidProfileReferenceHostReasonIncompatibleVersion = InvalidProfileReferenceHostReason("incompatibleVersion") + InvalidProfileReferenceHostReasonMissingReferenceHost = InvalidProfileReferenceHostReason("missingReferenceHost") +) + +func init() { + t["InvalidProfileReferenceHostReason"] = reflect.TypeOf((*InvalidProfileReferenceHostReason)(nil)).Elem() +} + +type IoFilterOperation string + +const ( + IoFilterOperationInstall = IoFilterOperation("install") + IoFilterOperationUninstall = IoFilterOperation("uninstall") + IoFilterOperationUpgrade = IoFilterOperation("upgrade") +) + +func init() { + t["IoFilterOperation"] = reflect.TypeOf((*IoFilterOperation)(nil)).Elem() +} + +type IscsiPortInfoPathStatus string + +const ( + IscsiPortInfoPathStatusNotUsed = IscsiPortInfoPathStatus("notUsed") + IscsiPortInfoPathStatusActive = IscsiPortInfoPathStatus("active") + IscsiPortInfoPathStatusStandBy = IscsiPortInfoPathStatus("standBy") + IscsiPortInfoPathStatusLastActive = IscsiPortInfoPathStatus("lastActive") +) + +func init() { + t["IscsiPortInfoPathStatus"] = reflect.TypeOf((*IscsiPortInfoPathStatus)(nil)).Elem() +} + +type LatencySensitivitySensitivityLevel string + +const ( + LatencySensitivitySensitivityLevelLow = LatencySensitivitySensitivityLevel("low") + LatencySensitivitySensitivityLevelNormal = LatencySensitivitySensitivityLevel("normal") + LatencySensitivitySensitivityLevelMedium = LatencySensitivitySensitivityLevel("medium") + LatencySensitivitySensitivityLevelHigh = LatencySensitivitySensitivityLevel("high") + LatencySensitivitySensitivityLevelCustom = LatencySensitivitySensitivityLevel("custom") +) + +func init() { + t["LatencySensitivitySensitivityLevel"] = reflect.TypeOf((*LatencySensitivitySensitivityLevel)(nil)).Elem() +} + +type LicenseAssignmentFailedReason string + +const ( + LicenseAssignmentFailedReasonKeyEntityMismatch = LicenseAssignmentFailedReason("keyEntityMismatch") + LicenseAssignmentFailedReasonDowngradeDisallowed = LicenseAssignmentFailedReason("downgradeDisallowed") + LicenseAssignmentFailedReasonInventoryNotManageableByVirtualCenter = LicenseAssignmentFailedReason("inventoryNotManageableByVirtualCenter") + LicenseAssignmentFailedReasonHostsUnmanageableByVirtualCenterWithoutLicenseServer = LicenseAssignmentFailedReason("hostsUnmanageableByVirtualCenterWithoutLicenseServer") +) + +func init() { + t["LicenseAssignmentFailedReason"] = reflect.TypeOf((*LicenseAssignmentFailedReason)(nil)).Elem() +} + +type LicenseFeatureInfoSourceRestriction string + +const ( + LicenseFeatureInfoSourceRestrictionUnrestricted = LicenseFeatureInfoSourceRestriction("unrestricted") + LicenseFeatureInfoSourceRestrictionServed = LicenseFeatureInfoSourceRestriction("served") + LicenseFeatureInfoSourceRestrictionFile = LicenseFeatureInfoSourceRestriction("file") +) + +func init() { + t["LicenseFeatureInfoSourceRestriction"] = reflect.TypeOf((*LicenseFeatureInfoSourceRestriction)(nil)).Elem() +} + +type LicenseFeatureInfoState string + +const ( + LicenseFeatureInfoStateEnabled = LicenseFeatureInfoState("enabled") + LicenseFeatureInfoStateDisabled = LicenseFeatureInfoState("disabled") + LicenseFeatureInfoStateOptional = LicenseFeatureInfoState("optional") +) + +func init() { + t["LicenseFeatureInfoState"] = reflect.TypeOf((*LicenseFeatureInfoState)(nil)).Elem() +} + +type LicenseFeatureInfoUnit string + +const ( + LicenseFeatureInfoUnitHost = LicenseFeatureInfoUnit("host") + LicenseFeatureInfoUnitCpuCore = LicenseFeatureInfoUnit("cpuCore") + LicenseFeatureInfoUnitCpuPackage = LicenseFeatureInfoUnit("cpuPackage") + LicenseFeatureInfoUnitServer = LicenseFeatureInfoUnit("server") + LicenseFeatureInfoUnitVm = LicenseFeatureInfoUnit("vm") +) + +func init() { + t["LicenseFeatureInfoUnit"] = reflect.TypeOf((*LicenseFeatureInfoUnit)(nil)).Elem() +} + +type LicenseManagerLicenseKey string + +const ( + LicenseManagerLicenseKeyEsxFull = LicenseManagerLicenseKey("esxFull") + LicenseManagerLicenseKeyEsxVmtn = LicenseManagerLicenseKey("esxVmtn") + LicenseManagerLicenseKeyEsxExpress = LicenseManagerLicenseKey("esxExpress") + LicenseManagerLicenseKeySan = LicenseManagerLicenseKey("san") + LicenseManagerLicenseKeyIscsi = LicenseManagerLicenseKey("iscsi") + LicenseManagerLicenseKeyNas = LicenseManagerLicenseKey("nas") + LicenseManagerLicenseKeyVsmp = LicenseManagerLicenseKey("vsmp") + LicenseManagerLicenseKeyBackup = LicenseManagerLicenseKey("backup") + LicenseManagerLicenseKeyVc = LicenseManagerLicenseKey("vc") + LicenseManagerLicenseKeyVcExpress = LicenseManagerLicenseKey("vcExpress") + LicenseManagerLicenseKeyEsxHost = LicenseManagerLicenseKey("esxHost") + LicenseManagerLicenseKeyGsxHost = LicenseManagerLicenseKey("gsxHost") + LicenseManagerLicenseKeyServerHost = LicenseManagerLicenseKey("serverHost") + LicenseManagerLicenseKeyDrsPower = LicenseManagerLicenseKey("drsPower") + LicenseManagerLicenseKeyVmotion = LicenseManagerLicenseKey("vmotion") + LicenseManagerLicenseKeyDrs = LicenseManagerLicenseKey("drs") + LicenseManagerLicenseKeyDas = LicenseManagerLicenseKey("das") +) + +func init() { + t["LicenseManagerLicenseKey"] = reflect.TypeOf((*LicenseManagerLicenseKey)(nil)).Elem() +} + +type LicenseManagerState string + +const ( + LicenseManagerStateInitializing = LicenseManagerState("initializing") + LicenseManagerStateNormal = LicenseManagerState("normal") + LicenseManagerStateMarginal = LicenseManagerState("marginal") + LicenseManagerStateFault = LicenseManagerState("fault") +) + +func init() { + t["LicenseManagerState"] = reflect.TypeOf((*LicenseManagerState)(nil)).Elem() +} + +type LicenseReservationInfoState string + +const ( + LicenseReservationInfoStateNotUsed = LicenseReservationInfoState("notUsed") + LicenseReservationInfoStateNoLicense = LicenseReservationInfoState("noLicense") + LicenseReservationInfoStateUnlicensedUse = LicenseReservationInfoState("unlicensedUse") + LicenseReservationInfoStateLicensed = LicenseReservationInfoState("licensed") +) + +func init() { + t["LicenseReservationInfoState"] = reflect.TypeOf((*LicenseReservationInfoState)(nil)).Elem() +} + +type LinkDiscoveryProtocolConfigOperationType string + +const ( + LinkDiscoveryProtocolConfigOperationTypeNone = LinkDiscoveryProtocolConfigOperationType("none") + LinkDiscoveryProtocolConfigOperationTypeListen = LinkDiscoveryProtocolConfigOperationType("listen") + LinkDiscoveryProtocolConfigOperationTypeAdvertise = LinkDiscoveryProtocolConfigOperationType("advertise") + LinkDiscoveryProtocolConfigOperationTypeBoth = LinkDiscoveryProtocolConfigOperationType("both") +) + +func init() { + t["LinkDiscoveryProtocolConfigOperationType"] = reflect.TypeOf((*LinkDiscoveryProtocolConfigOperationType)(nil)).Elem() +} + +type LinkDiscoveryProtocolConfigProtocolType string + +const ( + LinkDiscoveryProtocolConfigProtocolTypeCdp = LinkDiscoveryProtocolConfigProtocolType("cdp") + LinkDiscoveryProtocolConfigProtocolTypeLldp = LinkDiscoveryProtocolConfigProtocolType("lldp") +) + +func init() { + t["LinkDiscoveryProtocolConfigProtocolType"] = reflect.TypeOf((*LinkDiscoveryProtocolConfigProtocolType)(nil)).Elem() +} + +type ManagedEntityStatus string + +const ( + ManagedEntityStatusGray = ManagedEntityStatus("gray") + ManagedEntityStatusGreen = ManagedEntityStatus("green") + ManagedEntityStatusYellow = ManagedEntityStatus("yellow") + ManagedEntityStatusRed = ManagedEntityStatus("red") +) + +func init() { + t["ManagedEntityStatus"] = reflect.TypeOf((*ManagedEntityStatus)(nil)).Elem() +} + +type MetricAlarmOperator string + +const ( + MetricAlarmOperatorIsAbove = MetricAlarmOperator("isAbove") + MetricAlarmOperatorIsBelow = MetricAlarmOperator("isBelow") +) + +func init() { + t["MetricAlarmOperator"] = reflect.TypeOf((*MetricAlarmOperator)(nil)).Elem() +} + +type MultipathState string + +const ( + MultipathStateStandby = MultipathState("standby") + MultipathStateActive = MultipathState("active") + MultipathStateDisabled = MultipathState("disabled") + MultipathStateDead = MultipathState("dead") + MultipathStateUnknown = MultipathState("unknown") +) + +func init() { + t["MultipathState"] = reflect.TypeOf((*MultipathState)(nil)).Elem() +} + +type NetBIOSConfigInfoMode string + +const ( + NetBIOSConfigInfoModeUnknown = NetBIOSConfigInfoMode("unknown") + NetBIOSConfigInfoModeEnabled = NetBIOSConfigInfoMode("enabled") + NetBIOSConfigInfoModeDisabled = NetBIOSConfigInfoMode("disabled") + NetBIOSConfigInfoModeEnabledViaDHCP = NetBIOSConfigInfoMode("enabledViaDHCP") +) + +func init() { + t["NetBIOSConfigInfoMode"] = reflect.TypeOf((*NetBIOSConfigInfoMode)(nil)).Elem() +} + +type NetIpConfigInfoIpAddressOrigin string + +const ( + NetIpConfigInfoIpAddressOriginOther = NetIpConfigInfoIpAddressOrigin("other") + NetIpConfigInfoIpAddressOriginManual = NetIpConfigInfoIpAddressOrigin("manual") + NetIpConfigInfoIpAddressOriginDhcp = NetIpConfigInfoIpAddressOrigin("dhcp") + NetIpConfigInfoIpAddressOriginLinklayer = NetIpConfigInfoIpAddressOrigin("linklayer") + NetIpConfigInfoIpAddressOriginRandom = NetIpConfigInfoIpAddressOrigin("random") +) + +func init() { + t["NetIpConfigInfoIpAddressOrigin"] = reflect.TypeOf((*NetIpConfigInfoIpAddressOrigin)(nil)).Elem() +} + +type NetIpConfigInfoIpAddressStatus string + +const ( + NetIpConfigInfoIpAddressStatusPreferred = NetIpConfigInfoIpAddressStatus("preferred") + NetIpConfigInfoIpAddressStatusDeprecated = NetIpConfigInfoIpAddressStatus("deprecated") + NetIpConfigInfoIpAddressStatusInvalid = NetIpConfigInfoIpAddressStatus("invalid") + NetIpConfigInfoIpAddressStatusInaccessible = NetIpConfigInfoIpAddressStatus("inaccessible") + NetIpConfigInfoIpAddressStatusUnknown = NetIpConfigInfoIpAddressStatus("unknown") + NetIpConfigInfoIpAddressStatusTentative = NetIpConfigInfoIpAddressStatus("tentative") + NetIpConfigInfoIpAddressStatusDuplicate = NetIpConfigInfoIpAddressStatus("duplicate") +) + +func init() { + t["NetIpConfigInfoIpAddressStatus"] = reflect.TypeOf((*NetIpConfigInfoIpAddressStatus)(nil)).Elem() +} + +type NetIpStackInfoEntryType string + +const ( + NetIpStackInfoEntryTypeOther = NetIpStackInfoEntryType("other") + NetIpStackInfoEntryTypeInvalid = NetIpStackInfoEntryType("invalid") + NetIpStackInfoEntryTypeDynamic = NetIpStackInfoEntryType("dynamic") + NetIpStackInfoEntryTypeManual = NetIpStackInfoEntryType("manual") +) + +func init() { + t["NetIpStackInfoEntryType"] = reflect.TypeOf((*NetIpStackInfoEntryType)(nil)).Elem() +} + +type NetIpStackInfoPreference string + +const ( + NetIpStackInfoPreferenceReserved = NetIpStackInfoPreference("reserved") + NetIpStackInfoPreferenceLow = NetIpStackInfoPreference("low") + NetIpStackInfoPreferenceMedium = NetIpStackInfoPreference("medium") + NetIpStackInfoPreferenceHigh = NetIpStackInfoPreference("high") +) + +func init() { + t["NetIpStackInfoPreference"] = reflect.TypeOf((*NetIpStackInfoPreference)(nil)).Elem() +} + +type NotSupportedDeviceForFTDeviceType string + +const ( + NotSupportedDeviceForFTDeviceTypeVirtualVmxnet3 = NotSupportedDeviceForFTDeviceType("virtualVmxnet3") + NotSupportedDeviceForFTDeviceTypeParaVirtualSCSIController = NotSupportedDeviceForFTDeviceType("paraVirtualSCSIController") +) + +func init() { + t["NotSupportedDeviceForFTDeviceType"] = reflect.TypeOf((*NotSupportedDeviceForFTDeviceType)(nil)).Elem() +} + +type NumVirtualCpusIncompatibleReason string + +const ( + NumVirtualCpusIncompatibleReasonRecordReplay = NumVirtualCpusIncompatibleReason("recordReplay") + NumVirtualCpusIncompatibleReasonFaultTolerance = NumVirtualCpusIncompatibleReason("faultTolerance") +) + +func init() { + t["NumVirtualCpusIncompatibleReason"] = reflect.TypeOf((*NumVirtualCpusIncompatibleReason)(nil)).Elem() +} + +type ObjectUpdateKind string + +const ( + ObjectUpdateKindModify = ObjectUpdateKind("modify") + ObjectUpdateKindEnter = ObjectUpdateKind("enter") + ObjectUpdateKindLeave = ObjectUpdateKind("leave") +) + +func init() { + t["ObjectUpdateKind"] = reflect.TypeOf((*ObjectUpdateKind)(nil)).Elem() +} + +type OvfConsumerOstNodeType string + +const ( + OvfConsumerOstNodeTypeEnvelope = OvfConsumerOstNodeType("envelope") + OvfConsumerOstNodeTypeVirtualSystem = OvfConsumerOstNodeType("virtualSystem") + OvfConsumerOstNodeTypeVirtualSystemCollection = OvfConsumerOstNodeType("virtualSystemCollection") +) + +func init() { + t["OvfConsumerOstNodeType"] = reflect.TypeOf((*OvfConsumerOstNodeType)(nil)).Elem() +} + +type OvfCreateImportSpecParamsDiskProvisioningType string + +const ( + OvfCreateImportSpecParamsDiskProvisioningTypeMonolithicSparse = OvfCreateImportSpecParamsDiskProvisioningType("monolithicSparse") + OvfCreateImportSpecParamsDiskProvisioningTypeMonolithicFlat = OvfCreateImportSpecParamsDiskProvisioningType("monolithicFlat") + OvfCreateImportSpecParamsDiskProvisioningTypeTwoGbMaxExtentSparse = OvfCreateImportSpecParamsDiskProvisioningType("twoGbMaxExtentSparse") + OvfCreateImportSpecParamsDiskProvisioningTypeTwoGbMaxExtentFlat = OvfCreateImportSpecParamsDiskProvisioningType("twoGbMaxExtentFlat") + OvfCreateImportSpecParamsDiskProvisioningTypeThin = OvfCreateImportSpecParamsDiskProvisioningType("thin") + OvfCreateImportSpecParamsDiskProvisioningTypeThick = OvfCreateImportSpecParamsDiskProvisioningType("thick") + OvfCreateImportSpecParamsDiskProvisioningTypeSeSparse = OvfCreateImportSpecParamsDiskProvisioningType("seSparse") + OvfCreateImportSpecParamsDiskProvisioningTypeEagerZeroedThick = OvfCreateImportSpecParamsDiskProvisioningType("eagerZeroedThick") + OvfCreateImportSpecParamsDiskProvisioningTypeSparse = OvfCreateImportSpecParamsDiskProvisioningType("sparse") + OvfCreateImportSpecParamsDiskProvisioningTypeFlat = OvfCreateImportSpecParamsDiskProvisioningType("flat") +) + +func init() { + t["OvfCreateImportSpecParamsDiskProvisioningType"] = reflect.TypeOf((*OvfCreateImportSpecParamsDiskProvisioningType)(nil)).Elem() +} + +type PerfFormat string + +const ( + PerfFormatNormal = PerfFormat("normal") + PerfFormatCsv = PerfFormat("csv") +) + +func init() { + t["PerfFormat"] = reflect.TypeOf((*PerfFormat)(nil)).Elem() +} + +type PerfStatsType string + +const ( + PerfStatsTypeAbsolute = PerfStatsType("absolute") + PerfStatsTypeDelta = PerfStatsType("delta") + PerfStatsTypeRate = PerfStatsType("rate") +) + +func init() { + t["PerfStatsType"] = reflect.TypeOf((*PerfStatsType)(nil)).Elem() +} + +type PerfSummaryType string + +const ( + PerfSummaryTypeAverage = PerfSummaryType("average") + PerfSummaryTypeMaximum = PerfSummaryType("maximum") + PerfSummaryTypeMinimum = PerfSummaryType("minimum") + PerfSummaryTypeLatest = PerfSummaryType("latest") + PerfSummaryTypeSummation = PerfSummaryType("summation") + PerfSummaryTypeNone = PerfSummaryType("none") +) + +func init() { + t["PerfSummaryType"] = reflect.TypeOf((*PerfSummaryType)(nil)).Elem() +} + +type PerformanceManagerUnit string + +const ( + PerformanceManagerUnitPercent = PerformanceManagerUnit("percent") + PerformanceManagerUnitKiloBytes = PerformanceManagerUnit("kiloBytes") + PerformanceManagerUnitMegaBytes = PerformanceManagerUnit("megaBytes") + PerformanceManagerUnitMegaHertz = PerformanceManagerUnit("megaHertz") + PerformanceManagerUnitNumber = PerformanceManagerUnit("number") + PerformanceManagerUnitMicrosecond = PerformanceManagerUnit("microsecond") + PerformanceManagerUnitMillisecond = PerformanceManagerUnit("millisecond") + PerformanceManagerUnitSecond = PerformanceManagerUnit("second") + PerformanceManagerUnitKiloBytesPerSecond = PerformanceManagerUnit("kiloBytesPerSecond") + PerformanceManagerUnitMegaBytesPerSecond = PerformanceManagerUnit("megaBytesPerSecond") + PerformanceManagerUnitWatt = PerformanceManagerUnit("watt") + PerformanceManagerUnitJoule = PerformanceManagerUnit("joule") + PerformanceManagerUnitTeraBytes = PerformanceManagerUnit("teraBytes") +) + +func init() { + t["PerformanceManagerUnit"] = reflect.TypeOf((*PerformanceManagerUnit)(nil)).Elem() +} + +type PhysicalNicResourcePoolSchedulerDisallowedReason string + +const ( + PhysicalNicResourcePoolSchedulerDisallowedReasonUserOptOut = PhysicalNicResourcePoolSchedulerDisallowedReason("userOptOut") + PhysicalNicResourcePoolSchedulerDisallowedReasonHardwareUnsupported = PhysicalNicResourcePoolSchedulerDisallowedReason("hardwareUnsupported") +) + +func init() { + t["PhysicalNicResourcePoolSchedulerDisallowedReason"] = reflect.TypeOf((*PhysicalNicResourcePoolSchedulerDisallowedReason)(nil)).Elem() +} + +type PhysicalNicVmDirectPathGen2SupportedMode string + +const ( + PhysicalNicVmDirectPathGen2SupportedModeUpt = PhysicalNicVmDirectPathGen2SupportedMode("upt") +) + +func init() { + t["PhysicalNicVmDirectPathGen2SupportedMode"] = reflect.TypeOf((*PhysicalNicVmDirectPathGen2SupportedMode)(nil)).Elem() +} + +type PlacementAffinityRuleRuleScope string + +const ( + PlacementAffinityRuleRuleScopeCluster = PlacementAffinityRuleRuleScope("cluster") + PlacementAffinityRuleRuleScopeHost = PlacementAffinityRuleRuleScope("host") + PlacementAffinityRuleRuleScopeStoragePod = PlacementAffinityRuleRuleScope("storagePod") + PlacementAffinityRuleRuleScopeDatastore = PlacementAffinityRuleRuleScope("datastore") +) + +func init() { + t["PlacementAffinityRuleRuleScope"] = reflect.TypeOf((*PlacementAffinityRuleRuleScope)(nil)).Elem() +} + +type PlacementAffinityRuleRuleType string + +const ( + PlacementAffinityRuleRuleTypeAffinity = PlacementAffinityRuleRuleType("affinity") + PlacementAffinityRuleRuleTypeAntiAffinity = PlacementAffinityRuleRuleType("antiAffinity") + PlacementAffinityRuleRuleTypeSoftAffinity = PlacementAffinityRuleRuleType("softAffinity") + PlacementAffinityRuleRuleTypeSoftAntiAffinity = PlacementAffinityRuleRuleType("softAntiAffinity") +) + +func init() { + t["PlacementAffinityRuleRuleType"] = reflect.TypeOf((*PlacementAffinityRuleRuleType)(nil)).Elem() +} + +type PlacementSpecPlacementType string + +const ( + PlacementSpecPlacementTypeCreate = PlacementSpecPlacementType("create") + PlacementSpecPlacementTypeReconfigure = PlacementSpecPlacementType("reconfigure") + PlacementSpecPlacementTypeRelocate = PlacementSpecPlacementType("relocate") + PlacementSpecPlacementTypeClone = PlacementSpecPlacementType("clone") +) + +func init() { + t["PlacementSpecPlacementType"] = reflect.TypeOf((*PlacementSpecPlacementType)(nil)).Elem() +} + +type PortGroupConnecteeType string + +const ( + PortGroupConnecteeTypeVirtualMachine = PortGroupConnecteeType("virtualMachine") + PortGroupConnecteeTypeSystemManagement = PortGroupConnecteeType("systemManagement") + PortGroupConnecteeTypeHost = PortGroupConnecteeType("host") + PortGroupConnecteeTypeUnknown = PortGroupConnecteeType("unknown") +) + +func init() { + t["PortGroupConnecteeType"] = reflect.TypeOf((*PortGroupConnecteeType)(nil)).Elem() +} + +type ProfileExecuteResultStatus string + +const ( + ProfileExecuteResultStatusSuccess = ProfileExecuteResultStatus("success") + ProfileExecuteResultStatusNeedInput = ProfileExecuteResultStatus("needInput") + ProfileExecuteResultStatusError = ProfileExecuteResultStatus("error") +) + +func init() { + t["ProfileExecuteResultStatus"] = reflect.TypeOf((*ProfileExecuteResultStatus)(nil)).Elem() +} + +type ProfileNumericComparator string + +const ( + ProfileNumericComparatorLessThan = ProfileNumericComparator("lessThan") + ProfileNumericComparatorLessThanEqual = ProfileNumericComparator("lessThanEqual") + ProfileNumericComparatorEqual = ProfileNumericComparator("equal") + ProfileNumericComparatorNotEqual = ProfileNumericComparator("notEqual") + ProfileNumericComparatorGreaterThanEqual = ProfileNumericComparator("greaterThanEqual") + ProfileNumericComparatorGreaterThan = ProfileNumericComparator("greaterThan") +) + +func init() { + t["ProfileNumericComparator"] = reflect.TypeOf((*ProfileNumericComparator)(nil)).Elem() +} + +type PropertyChangeOp string + +const ( + PropertyChangeOpAdd = PropertyChangeOp("add") + PropertyChangeOpRemove = PropertyChangeOp("remove") + PropertyChangeOpAssign = PropertyChangeOp("assign") + PropertyChangeOpIndirectRemove = PropertyChangeOp("indirectRemove") +) + +func init() { + t["PropertyChangeOp"] = reflect.TypeOf((*PropertyChangeOp)(nil)).Elem() +} + +type QuiesceMode string + +const ( + QuiesceModeApplication = QuiesceMode("application") + QuiesceModeFilesystem = QuiesceMode("filesystem") + QuiesceModeNone = QuiesceMode("none") +) + +func init() { + t["QuiesceMode"] = reflect.TypeOf((*QuiesceMode)(nil)).Elem() +} + +type RecommendationReasonCode string + +const ( + RecommendationReasonCodeFairnessCpuAvg = RecommendationReasonCode("fairnessCpuAvg") + RecommendationReasonCodeFairnessMemAvg = RecommendationReasonCode("fairnessMemAvg") + RecommendationReasonCodeJointAffin = RecommendationReasonCode("jointAffin") + RecommendationReasonCodeAntiAffin = RecommendationReasonCode("antiAffin") + RecommendationReasonCodeHostMaint = RecommendationReasonCode("hostMaint") + RecommendationReasonCodeEnterStandby = RecommendationReasonCode("enterStandby") + RecommendationReasonCodeReservationCpu = RecommendationReasonCode("reservationCpu") + RecommendationReasonCodeReservationMem = RecommendationReasonCode("reservationMem") + RecommendationReasonCodePowerOnVm = RecommendationReasonCode("powerOnVm") + RecommendationReasonCodePowerSaving = RecommendationReasonCode("powerSaving") + RecommendationReasonCodeIncreaseCapacity = RecommendationReasonCode("increaseCapacity") + RecommendationReasonCodeCheckResource = RecommendationReasonCode("checkResource") + RecommendationReasonCodeUnreservedCapacity = RecommendationReasonCode("unreservedCapacity") + RecommendationReasonCodeVmHostHardAffinity = RecommendationReasonCode("vmHostHardAffinity") + RecommendationReasonCodeVmHostSoftAffinity = RecommendationReasonCode("vmHostSoftAffinity") + RecommendationReasonCodeBalanceDatastoreSpaceUsage = RecommendationReasonCode("balanceDatastoreSpaceUsage") + RecommendationReasonCodeBalanceDatastoreIOLoad = RecommendationReasonCode("balanceDatastoreIOLoad") + RecommendationReasonCodeBalanceDatastoreIOPSReservation = RecommendationReasonCode("balanceDatastoreIOPSReservation") + RecommendationReasonCodeDatastoreMaint = RecommendationReasonCode("datastoreMaint") + RecommendationReasonCodeVirtualDiskJointAffin = RecommendationReasonCode("virtualDiskJointAffin") + RecommendationReasonCodeVirtualDiskAntiAffin = RecommendationReasonCode("virtualDiskAntiAffin") + RecommendationReasonCodeDatastoreSpaceOutage = RecommendationReasonCode("datastoreSpaceOutage") + RecommendationReasonCodeStoragePlacement = RecommendationReasonCode("storagePlacement") + RecommendationReasonCodeIolbDisabledInternal = RecommendationReasonCode("iolbDisabledInternal") + RecommendationReasonCodeXvmotionPlacement = RecommendationReasonCode("xvmotionPlacement") + RecommendationReasonCodeNetworkBandwidthReservation = RecommendationReasonCode("networkBandwidthReservation") +) + +func init() { + t["RecommendationReasonCode"] = reflect.TypeOf((*RecommendationReasonCode)(nil)).Elem() +} + +type RecommendationType string + +const ( + RecommendationTypeV1 = RecommendationType("V1") +) + +func init() { + t["RecommendationType"] = reflect.TypeOf((*RecommendationType)(nil)).Elem() +} + +type ReplicationDiskConfigFaultReasonForFault string + +const ( + ReplicationDiskConfigFaultReasonForFaultDiskNotFound = ReplicationDiskConfigFaultReasonForFault("diskNotFound") + ReplicationDiskConfigFaultReasonForFaultDiskTypeNotSupported = ReplicationDiskConfigFaultReasonForFault("diskTypeNotSupported") + ReplicationDiskConfigFaultReasonForFaultInvalidDiskKey = ReplicationDiskConfigFaultReasonForFault("invalidDiskKey") + ReplicationDiskConfigFaultReasonForFaultInvalidDiskReplicationId = ReplicationDiskConfigFaultReasonForFault("invalidDiskReplicationId") + ReplicationDiskConfigFaultReasonForFaultDuplicateDiskReplicationId = ReplicationDiskConfigFaultReasonForFault("duplicateDiskReplicationId") + ReplicationDiskConfigFaultReasonForFaultInvalidPersistentFilePath = ReplicationDiskConfigFaultReasonForFault("invalidPersistentFilePath") + ReplicationDiskConfigFaultReasonForFaultReconfigureDiskReplicationIdNotAllowed = ReplicationDiskConfigFaultReasonForFault("reconfigureDiskReplicationIdNotAllowed") +) + +func init() { + t["ReplicationDiskConfigFaultReasonForFault"] = reflect.TypeOf((*ReplicationDiskConfigFaultReasonForFault)(nil)).Elem() +} + +type ReplicationVmConfigFaultReasonForFault string + +const ( + ReplicationVmConfigFaultReasonForFaultIncompatibleHwVersion = ReplicationVmConfigFaultReasonForFault("incompatibleHwVersion") + ReplicationVmConfigFaultReasonForFaultInvalidVmReplicationId = ReplicationVmConfigFaultReasonForFault("invalidVmReplicationId") + ReplicationVmConfigFaultReasonForFaultInvalidGenerationNumber = ReplicationVmConfigFaultReasonForFault("invalidGenerationNumber") + ReplicationVmConfigFaultReasonForFaultOutOfBoundsRpoValue = ReplicationVmConfigFaultReasonForFault("outOfBoundsRpoValue") + ReplicationVmConfigFaultReasonForFaultInvalidDestinationIpAddress = ReplicationVmConfigFaultReasonForFault("invalidDestinationIpAddress") + ReplicationVmConfigFaultReasonForFaultInvalidDestinationPort = ReplicationVmConfigFaultReasonForFault("invalidDestinationPort") + ReplicationVmConfigFaultReasonForFaultInvalidExtraVmOptions = ReplicationVmConfigFaultReasonForFault("invalidExtraVmOptions") + ReplicationVmConfigFaultReasonForFaultStaleGenerationNumber = ReplicationVmConfigFaultReasonForFault("staleGenerationNumber") + ReplicationVmConfigFaultReasonForFaultReconfigureVmReplicationIdNotAllowed = ReplicationVmConfigFaultReasonForFault("reconfigureVmReplicationIdNotAllowed") + ReplicationVmConfigFaultReasonForFaultCannotRetrieveVmReplicationConfiguration = ReplicationVmConfigFaultReasonForFault("cannotRetrieveVmReplicationConfiguration") + ReplicationVmConfigFaultReasonForFaultReplicationAlreadyEnabled = ReplicationVmConfigFaultReasonForFault("replicationAlreadyEnabled") + ReplicationVmConfigFaultReasonForFaultInvalidPriorConfiguration = ReplicationVmConfigFaultReasonForFault("invalidPriorConfiguration") + ReplicationVmConfigFaultReasonForFaultReplicationNotEnabled = ReplicationVmConfigFaultReasonForFault("replicationNotEnabled") + ReplicationVmConfigFaultReasonForFaultReplicationConfigurationFailed = ReplicationVmConfigFaultReasonForFault("replicationConfigurationFailed") +) + +func init() { + t["ReplicationVmConfigFaultReasonForFault"] = reflect.TypeOf((*ReplicationVmConfigFaultReasonForFault)(nil)).Elem() +} + +type ReplicationVmFaultReasonForFault string + +const ( + ReplicationVmFaultReasonForFaultNotConfigured = ReplicationVmFaultReasonForFault("notConfigured") + ReplicationVmFaultReasonForFaultPoweredOff = ReplicationVmFaultReasonForFault("poweredOff") + ReplicationVmFaultReasonForFaultSuspended = ReplicationVmFaultReasonForFault("suspended") + ReplicationVmFaultReasonForFaultPoweredOn = ReplicationVmFaultReasonForFault("poweredOn") + ReplicationVmFaultReasonForFaultOfflineReplicating = ReplicationVmFaultReasonForFault("offlineReplicating") + ReplicationVmFaultReasonForFaultInvalidState = ReplicationVmFaultReasonForFault("invalidState") + ReplicationVmFaultReasonForFaultInvalidInstanceId = ReplicationVmFaultReasonForFault("invalidInstanceId") +) + +func init() { + t["ReplicationVmFaultReasonForFault"] = reflect.TypeOf((*ReplicationVmFaultReasonForFault)(nil)).Elem() +} + +type ReplicationVmInProgressFaultActivity string + +const ( + ReplicationVmInProgressFaultActivityFullSync = ReplicationVmInProgressFaultActivity("fullSync") + ReplicationVmInProgressFaultActivityDelta = ReplicationVmInProgressFaultActivity("delta") +) + +func init() { + t["ReplicationVmInProgressFaultActivity"] = reflect.TypeOf((*ReplicationVmInProgressFaultActivity)(nil)).Elem() +} + +type ReplicationVmState string + +const ( + ReplicationVmStateNone = ReplicationVmState("none") + ReplicationVmStatePaused = ReplicationVmState("paused") + ReplicationVmStateSyncing = ReplicationVmState("syncing") + ReplicationVmStateIdle = ReplicationVmState("idle") + ReplicationVmStateActive = ReplicationVmState("active") + ReplicationVmStateError = ReplicationVmState("error") +) + +func init() { + t["ReplicationVmState"] = reflect.TypeOf((*ReplicationVmState)(nil)).Elem() +} + +type ScheduledHardwareUpgradeInfoHardwareUpgradePolicy string + +const ( + ScheduledHardwareUpgradeInfoHardwareUpgradePolicyNever = ScheduledHardwareUpgradeInfoHardwareUpgradePolicy("never") + ScheduledHardwareUpgradeInfoHardwareUpgradePolicyOnSoftPowerOff = ScheduledHardwareUpgradeInfoHardwareUpgradePolicy("onSoftPowerOff") + ScheduledHardwareUpgradeInfoHardwareUpgradePolicyAlways = ScheduledHardwareUpgradeInfoHardwareUpgradePolicy("always") +) + +func init() { + t["ScheduledHardwareUpgradeInfoHardwareUpgradePolicy"] = reflect.TypeOf((*ScheduledHardwareUpgradeInfoHardwareUpgradePolicy)(nil)).Elem() +} + +type ScheduledHardwareUpgradeInfoHardwareUpgradeStatus string + +const ( + ScheduledHardwareUpgradeInfoHardwareUpgradeStatusNone = ScheduledHardwareUpgradeInfoHardwareUpgradeStatus("none") + ScheduledHardwareUpgradeInfoHardwareUpgradeStatusPending = ScheduledHardwareUpgradeInfoHardwareUpgradeStatus("pending") + ScheduledHardwareUpgradeInfoHardwareUpgradeStatusSuccess = ScheduledHardwareUpgradeInfoHardwareUpgradeStatus("success") + ScheduledHardwareUpgradeInfoHardwareUpgradeStatusFailed = ScheduledHardwareUpgradeInfoHardwareUpgradeStatus("failed") +) + +func init() { + t["ScheduledHardwareUpgradeInfoHardwareUpgradeStatus"] = reflect.TypeOf((*ScheduledHardwareUpgradeInfoHardwareUpgradeStatus)(nil)).Elem() +} + +type ScsiLunDescriptorQuality string + +const ( + ScsiLunDescriptorQualityHighQuality = ScsiLunDescriptorQuality("highQuality") + ScsiLunDescriptorQualityMediumQuality = ScsiLunDescriptorQuality("mediumQuality") + ScsiLunDescriptorQualityLowQuality = ScsiLunDescriptorQuality("lowQuality") + ScsiLunDescriptorQualityUnknownQuality = ScsiLunDescriptorQuality("unknownQuality") +) + +func init() { + t["ScsiLunDescriptorQuality"] = reflect.TypeOf((*ScsiLunDescriptorQuality)(nil)).Elem() +} + +type ScsiLunState string + +const ( + ScsiLunStateUnknownState = ScsiLunState("unknownState") + ScsiLunStateOk = ScsiLunState("ok") + ScsiLunStateError = ScsiLunState("error") + ScsiLunStateOff = ScsiLunState("off") + ScsiLunStateQuiesced = ScsiLunState("quiesced") + ScsiLunStateDegraded = ScsiLunState("degraded") + ScsiLunStateLostCommunication = ScsiLunState("lostCommunication") + ScsiLunStateTimeout = ScsiLunState("timeout") +) + +func init() { + t["ScsiLunState"] = reflect.TypeOf((*ScsiLunState)(nil)).Elem() +} + +type ScsiLunType string + +const ( + ScsiLunTypeDisk = ScsiLunType("disk") + ScsiLunTypeTape = ScsiLunType("tape") + ScsiLunTypePrinter = ScsiLunType("printer") + ScsiLunTypeProcessor = ScsiLunType("processor") + ScsiLunTypeWorm = ScsiLunType("worm") + ScsiLunTypeCdrom = ScsiLunType("cdrom") + ScsiLunTypeScanner = ScsiLunType("scanner") + ScsiLunTypeOpticalDevice = ScsiLunType("opticalDevice") + ScsiLunTypeMediaChanger = ScsiLunType("mediaChanger") + ScsiLunTypeCommunications = ScsiLunType("communications") + ScsiLunTypeStorageArrayController = ScsiLunType("storageArrayController") + ScsiLunTypeEnclosure = ScsiLunType("enclosure") + ScsiLunTypeUnknown = ScsiLunType("unknown") +) + +func init() { + t["ScsiLunType"] = reflect.TypeOf((*ScsiLunType)(nil)).Elem() +} + +type ScsiLunVStorageSupportStatus string + +const ( + ScsiLunVStorageSupportStatusVStorageSupported = ScsiLunVStorageSupportStatus("vStorageSupported") + ScsiLunVStorageSupportStatusVStorageUnsupported = ScsiLunVStorageSupportStatus("vStorageUnsupported") + ScsiLunVStorageSupportStatusVStorageUnknown = ScsiLunVStorageSupportStatus("vStorageUnknown") +) + +func init() { + t["ScsiLunVStorageSupportStatus"] = reflect.TypeOf((*ScsiLunVStorageSupportStatus)(nil)).Elem() +} + +type SessionManagerHttpServiceRequestSpecMethod string + +const ( + SessionManagerHttpServiceRequestSpecMethodHttpOptions = SessionManagerHttpServiceRequestSpecMethod("httpOptions") + SessionManagerHttpServiceRequestSpecMethodHttpGet = SessionManagerHttpServiceRequestSpecMethod("httpGet") + SessionManagerHttpServiceRequestSpecMethodHttpHead = SessionManagerHttpServiceRequestSpecMethod("httpHead") + SessionManagerHttpServiceRequestSpecMethodHttpPost = SessionManagerHttpServiceRequestSpecMethod("httpPost") + SessionManagerHttpServiceRequestSpecMethodHttpPut = SessionManagerHttpServiceRequestSpecMethod("httpPut") + SessionManagerHttpServiceRequestSpecMethodHttpDelete = SessionManagerHttpServiceRequestSpecMethod("httpDelete") + SessionManagerHttpServiceRequestSpecMethodHttpTrace = SessionManagerHttpServiceRequestSpecMethod("httpTrace") + SessionManagerHttpServiceRequestSpecMethodHttpConnect = SessionManagerHttpServiceRequestSpecMethod("httpConnect") +) + +func init() { + t["SessionManagerHttpServiceRequestSpecMethod"] = reflect.TypeOf((*SessionManagerHttpServiceRequestSpecMethod)(nil)).Elem() +} + +type SharesLevel string + +const ( + SharesLevelLow = SharesLevel("low") + SharesLevelNormal = SharesLevel("normal") + SharesLevelHigh = SharesLevel("high") + SharesLevelCustom = SharesLevel("custom") +) + +func init() { + t["SharesLevel"] = reflect.TypeOf((*SharesLevel)(nil)).Elem() +} + +type SimpleCommandEncoding string + +const ( + SimpleCommandEncodingCSV = SimpleCommandEncoding("CSV") + SimpleCommandEncodingHEX = SimpleCommandEncoding("HEX") + SimpleCommandEncodingSTRING = SimpleCommandEncoding("STRING") +) + +func init() { + t["SimpleCommandEncoding"] = reflect.TypeOf((*SimpleCommandEncoding)(nil)).Elem() +} + +type SlpDiscoveryMethod string + +const ( + SlpDiscoveryMethodSlpDhcp = SlpDiscoveryMethod("slpDhcp") + SlpDiscoveryMethodSlpAutoUnicast = SlpDiscoveryMethod("slpAutoUnicast") + SlpDiscoveryMethodSlpAutoMulticast = SlpDiscoveryMethod("slpAutoMulticast") + SlpDiscoveryMethodSlpManual = SlpDiscoveryMethod("slpManual") +) + +func init() { + t["SlpDiscoveryMethod"] = reflect.TypeOf((*SlpDiscoveryMethod)(nil)).Elem() +} + +type StateAlarmOperator string + +const ( + StateAlarmOperatorIsEqual = StateAlarmOperator("isEqual") + StateAlarmOperatorIsUnequal = StateAlarmOperator("isUnequal") +) + +func init() { + t["StateAlarmOperator"] = reflect.TypeOf((*StateAlarmOperator)(nil)).Elem() +} + +type StorageDrsPodConfigInfoBehavior string + +const ( + StorageDrsPodConfigInfoBehaviorManual = StorageDrsPodConfigInfoBehavior("manual") + StorageDrsPodConfigInfoBehaviorAutomated = StorageDrsPodConfigInfoBehavior("automated") +) + +func init() { + t["StorageDrsPodConfigInfoBehavior"] = reflect.TypeOf((*StorageDrsPodConfigInfoBehavior)(nil)).Elem() +} + +type StorageDrsSpaceLoadBalanceConfigSpaceThresholdMode string + +const ( + StorageDrsSpaceLoadBalanceConfigSpaceThresholdModeUtilization = StorageDrsSpaceLoadBalanceConfigSpaceThresholdMode("utilization") + StorageDrsSpaceLoadBalanceConfigSpaceThresholdModeFreeSpace = StorageDrsSpaceLoadBalanceConfigSpaceThresholdMode("freeSpace") +) + +func init() { + t["StorageDrsSpaceLoadBalanceConfigSpaceThresholdMode"] = reflect.TypeOf((*StorageDrsSpaceLoadBalanceConfigSpaceThresholdMode)(nil)).Elem() +} + +type StorageIORMThresholdMode string + +const ( + StorageIORMThresholdModeAutomatic = StorageIORMThresholdMode("automatic") + StorageIORMThresholdModeManual = StorageIORMThresholdMode("manual") +) + +func init() { + t["StorageIORMThresholdMode"] = reflect.TypeOf((*StorageIORMThresholdMode)(nil)).Elem() +} + +type StoragePlacementSpecPlacementType string + +const ( + StoragePlacementSpecPlacementTypeCreate = StoragePlacementSpecPlacementType("create") + StoragePlacementSpecPlacementTypeReconfigure = StoragePlacementSpecPlacementType("reconfigure") + StoragePlacementSpecPlacementTypeRelocate = StoragePlacementSpecPlacementType("relocate") + StoragePlacementSpecPlacementTypeClone = StoragePlacementSpecPlacementType("clone") +) + +func init() { + t["StoragePlacementSpecPlacementType"] = reflect.TypeOf((*StoragePlacementSpecPlacementType)(nil)).Elem() +} + +type TaskFilterSpecRecursionOption string + +const ( + TaskFilterSpecRecursionOptionSelf = TaskFilterSpecRecursionOption("self") + TaskFilterSpecRecursionOptionChildren = TaskFilterSpecRecursionOption("children") + TaskFilterSpecRecursionOptionAll = TaskFilterSpecRecursionOption("all") +) + +func init() { + t["TaskFilterSpecRecursionOption"] = reflect.TypeOf((*TaskFilterSpecRecursionOption)(nil)).Elem() +} + +type TaskFilterSpecTimeOption string + +const ( + TaskFilterSpecTimeOptionQueuedTime = TaskFilterSpecTimeOption("queuedTime") + TaskFilterSpecTimeOptionStartedTime = TaskFilterSpecTimeOption("startedTime") + TaskFilterSpecTimeOptionCompletedTime = TaskFilterSpecTimeOption("completedTime") +) + +func init() { + t["TaskFilterSpecTimeOption"] = reflect.TypeOf((*TaskFilterSpecTimeOption)(nil)).Elem() +} + +type TaskInfoState string + +const ( + TaskInfoStateQueued = TaskInfoState("queued") + TaskInfoStateRunning = TaskInfoState("running") + TaskInfoStateSuccess = TaskInfoState("success") + TaskInfoStateError = TaskInfoState("error") +) + +func init() { + t["TaskInfoState"] = reflect.TypeOf((*TaskInfoState)(nil)).Elem() +} + +type ThirdPartyLicenseAssignmentFailedReason string + +const ( + ThirdPartyLicenseAssignmentFailedReasonLicenseAssignmentFailed = ThirdPartyLicenseAssignmentFailedReason("licenseAssignmentFailed") + ThirdPartyLicenseAssignmentFailedReasonModuleNotInstalled = ThirdPartyLicenseAssignmentFailedReason("moduleNotInstalled") +) + +func init() { + t["ThirdPartyLicenseAssignmentFailedReason"] = reflect.TypeOf((*ThirdPartyLicenseAssignmentFailedReason)(nil)).Elem() +} + +type UpgradePolicy string + +const ( + UpgradePolicyManual = UpgradePolicy("manual") + UpgradePolicyUpgradeAtPowerCycle = UpgradePolicy("upgradeAtPowerCycle") +) + +func init() { + t["UpgradePolicy"] = reflect.TypeOf((*UpgradePolicy)(nil)).Elem() +} + +type VAppAutoStartAction string + +const ( + VAppAutoStartActionNone = VAppAutoStartAction("none") + VAppAutoStartActionPowerOn = VAppAutoStartAction("powerOn") + VAppAutoStartActionPowerOff = VAppAutoStartAction("powerOff") + VAppAutoStartActionGuestShutdown = VAppAutoStartAction("guestShutdown") + VAppAutoStartActionSuspend = VAppAutoStartAction("suspend") +) + +func init() { + t["VAppAutoStartAction"] = reflect.TypeOf((*VAppAutoStartAction)(nil)).Elem() +} + +type VAppCloneSpecProvisioningType string + +const ( + VAppCloneSpecProvisioningTypeSameAsSource = VAppCloneSpecProvisioningType("sameAsSource") + VAppCloneSpecProvisioningTypeThin = VAppCloneSpecProvisioningType("thin") + VAppCloneSpecProvisioningTypeThick = VAppCloneSpecProvisioningType("thick") +) + +func init() { + t["VAppCloneSpecProvisioningType"] = reflect.TypeOf((*VAppCloneSpecProvisioningType)(nil)).Elem() +} + +type VAppIPAssignmentInfoAllocationSchemes string + +const ( + VAppIPAssignmentInfoAllocationSchemesDhcp = VAppIPAssignmentInfoAllocationSchemes("dhcp") + VAppIPAssignmentInfoAllocationSchemesOvfenv = VAppIPAssignmentInfoAllocationSchemes("ovfenv") +) + +func init() { + t["VAppIPAssignmentInfoAllocationSchemes"] = reflect.TypeOf((*VAppIPAssignmentInfoAllocationSchemes)(nil)).Elem() +} + +type VAppIPAssignmentInfoIpAllocationPolicy string + +const ( + VAppIPAssignmentInfoIpAllocationPolicyDhcpPolicy = VAppIPAssignmentInfoIpAllocationPolicy("dhcpPolicy") + VAppIPAssignmentInfoIpAllocationPolicyTransientPolicy = VAppIPAssignmentInfoIpAllocationPolicy("transientPolicy") + VAppIPAssignmentInfoIpAllocationPolicyFixedPolicy = VAppIPAssignmentInfoIpAllocationPolicy("fixedPolicy") + VAppIPAssignmentInfoIpAllocationPolicyFixedAllocatedPolicy = VAppIPAssignmentInfoIpAllocationPolicy("fixedAllocatedPolicy") +) + +func init() { + t["VAppIPAssignmentInfoIpAllocationPolicy"] = reflect.TypeOf((*VAppIPAssignmentInfoIpAllocationPolicy)(nil)).Elem() +} + +type VAppIPAssignmentInfoProtocols string + +const ( + VAppIPAssignmentInfoProtocolsIPv4 = VAppIPAssignmentInfoProtocols("IPv4") + VAppIPAssignmentInfoProtocolsIPv6 = VAppIPAssignmentInfoProtocols("IPv6") +) + +func init() { + t["VAppIPAssignmentInfoProtocols"] = reflect.TypeOf((*VAppIPAssignmentInfoProtocols)(nil)).Elem() +} + +type VFlashModuleNotSupportedReason string + +const ( + VFlashModuleNotSupportedReasonCacheModeNotSupported = VFlashModuleNotSupportedReason("CacheModeNotSupported") + VFlashModuleNotSupportedReasonCacheConsistencyTypeNotSupported = VFlashModuleNotSupportedReason("CacheConsistencyTypeNotSupported") + VFlashModuleNotSupportedReasonCacheBlockSizeNotSupported = VFlashModuleNotSupportedReason("CacheBlockSizeNotSupported") + VFlashModuleNotSupportedReasonCacheReservationNotSupported = VFlashModuleNotSupportedReason("CacheReservationNotSupported") + VFlashModuleNotSupportedReasonDiskSizeNotSupported = VFlashModuleNotSupportedReason("DiskSizeNotSupported") +) + +func init() { + t["VFlashModuleNotSupportedReason"] = reflect.TypeOf((*VFlashModuleNotSupportedReason)(nil)).Elem() +} + +type VMotionCompatibilityType string + +const ( + VMotionCompatibilityTypeCpu = VMotionCompatibilityType("cpu") + VMotionCompatibilityTypeSoftware = VMotionCompatibilityType("software") +) + +func init() { + t["VMotionCompatibilityType"] = reflect.TypeOf((*VMotionCompatibilityType)(nil)).Elem() +} + +type VMwareDVSTeamingMatchStatus string + +const ( + VMwareDVSTeamingMatchStatusIphashMatch = VMwareDVSTeamingMatchStatus("iphashMatch") + VMwareDVSTeamingMatchStatusNonIphashMatch = VMwareDVSTeamingMatchStatus("nonIphashMatch") + VMwareDVSTeamingMatchStatusIphashMismatch = VMwareDVSTeamingMatchStatus("iphashMismatch") + VMwareDVSTeamingMatchStatusNonIphashMismatch = VMwareDVSTeamingMatchStatus("nonIphashMismatch") +) + +func init() { + t["VMwareDVSTeamingMatchStatus"] = reflect.TypeOf((*VMwareDVSTeamingMatchStatus)(nil)).Elem() +} + +type VMwareDVSVspanSessionType string + +const ( + VMwareDVSVspanSessionTypeMixedDestMirror = VMwareDVSVspanSessionType("mixedDestMirror") + VMwareDVSVspanSessionTypeDvPortMirror = VMwareDVSVspanSessionType("dvPortMirror") + VMwareDVSVspanSessionTypeRemoteMirrorSource = VMwareDVSVspanSessionType("remoteMirrorSource") + VMwareDVSVspanSessionTypeRemoteMirrorDest = VMwareDVSVspanSessionType("remoteMirrorDest") + VMwareDVSVspanSessionTypeEncapsulatedRemoteMirrorSource = VMwareDVSVspanSessionType("encapsulatedRemoteMirrorSource") +) + +func init() { + t["VMwareDVSVspanSessionType"] = reflect.TypeOf((*VMwareDVSVspanSessionType)(nil)).Elem() +} + +type VMwareDvsLacpApiVersion string + +const ( + VMwareDvsLacpApiVersionSingleLag = VMwareDvsLacpApiVersion("singleLag") + VMwareDvsLacpApiVersionMultipleLag = VMwareDvsLacpApiVersion("multipleLag") +) + +func init() { + t["VMwareDvsLacpApiVersion"] = reflect.TypeOf((*VMwareDvsLacpApiVersion)(nil)).Elem() +} + +type VMwareDvsLacpLoadBalanceAlgorithm string + +const ( + VMwareDvsLacpLoadBalanceAlgorithmSrcMac = VMwareDvsLacpLoadBalanceAlgorithm("srcMac") + VMwareDvsLacpLoadBalanceAlgorithmDestMac = VMwareDvsLacpLoadBalanceAlgorithm("destMac") + VMwareDvsLacpLoadBalanceAlgorithmSrcDestMac = VMwareDvsLacpLoadBalanceAlgorithm("srcDestMac") + VMwareDvsLacpLoadBalanceAlgorithmDestIpVlan = VMwareDvsLacpLoadBalanceAlgorithm("destIpVlan") + VMwareDvsLacpLoadBalanceAlgorithmSrcIpVlan = VMwareDvsLacpLoadBalanceAlgorithm("srcIpVlan") + VMwareDvsLacpLoadBalanceAlgorithmSrcDestIpVlan = VMwareDvsLacpLoadBalanceAlgorithm("srcDestIpVlan") + VMwareDvsLacpLoadBalanceAlgorithmDestTcpUdpPort = VMwareDvsLacpLoadBalanceAlgorithm("destTcpUdpPort") + VMwareDvsLacpLoadBalanceAlgorithmSrcTcpUdpPort = VMwareDvsLacpLoadBalanceAlgorithm("srcTcpUdpPort") + VMwareDvsLacpLoadBalanceAlgorithmSrcDestTcpUdpPort = VMwareDvsLacpLoadBalanceAlgorithm("srcDestTcpUdpPort") + VMwareDvsLacpLoadBalanceAlgorithmDestIpTcpUdpPort = VMwareDvsLacpLoadBalanceAlgorithm("destIpTcpUdpPort") + VMwareDvsLacpLoadBalanceAlgorithmSrcIpTcpUdpPort = VMwareDvsLacpLoadBalanceAlgorithm("srcIpTcpUdpPort") + VMwareDvsLacpLoadBalanceAlgorithmSrcDestIpTcpUdpPort = VMwareDvsLacpLoadBalanceAlgorithm("srcDestIpTcpUdpPort") + VMwareDvsLacpLoadBalanceAlgorithmDestIpTcpUdpPortVlan = VMwareDvsLacpLoadBalanceAlgorithm("destIpTcpUdpPortVlan") + VMwareDvsLacpLoadBalanceAlgorithmSrcIpTcpUdpPortVlan = VMwareDvsLacpLoadBalanceAlgorithm("srcIpTcpUdpPortVlan") + VMwareDvsLacpLoadBalanceAlgorithmSrcDestIpTcpUdpPortVlan = VMwareDvsLacpLoadBalanceAlgorithm("srcDestIpTcpUdpPortVlan") + VMwareDvsLacpLoadBalanceAlgorithmDestIp = VMwareDvsLacpLoadBalanceAlgorithm("destIp") + VMwareDvsLacpLoadBalanceAlgorithmSrcIp = VMwareDvsLacpLoadBalanceAlgorithm("srcIp") + VMwareDvsLacpLoadBalanceAlgorithmSrcDestIp = VMwareDvsLacpLoadBalanceAlgorithm("srcDestIp") + VMwareDvsLacpLoadBalanceAlgorithmVlan = VMwareDvsLacpLoadBalanceAlgorithm("vlan") + VMwareDvsLacpLoadBalanceAlgorithmSrcPortId = VMwareDvsLacpLoadBalanceAlgorithm("srcPortId") +) + +func init() { + t["VMwareDvsLacpLoadBalanceAlgorithm"] = reflect.TypeOf((*VMwareDvsLacpLoadBalanceAlgorithm)(nil)).Elem() +} + +type VMwareDvsMulticastFilteringMode string + +const ( + VMwareDvsMulticastFilteringModeLegacyFiltering = VMwareDvsMulticastFilteringMode("legacyFiltering") + VMwareDvsMulticastFilteringModeSnooping = VMwareDvsMulticastFilteringMode("snooping") +) + +func init() { + t["VMwareDvsMulticastFilteringMode"] = reflect.TypeOf((*VMwareDvsMulticastFilteringMode)(nil)).Elem() +} + +type VMwareUplinkLacpMode string + +const ( + VMwareUplinkLacpModeActive = VMwareUplinkLacpMode("active") + VMwareUplinkLacpModePassive = VMwareUplinkLacpMode("passive") +) + +func init() { + t["VMwareUplinkLacpMode"] = reflect.TypeOf((*VMwareUplinkLacpMode)(nil)).Elem() +} + +type ValidateMigrationTestType string + +const ( + ValidateMigrationTestTypeSourceTests = ValidateMigrationTestType("sourceTests") + ValidateMigrationTestTypeCompatibilityTests = ValidateMigrationTestType("compatibilityTests") + ValidateMigrationTestTypeDiskAccessibilityTests = ValidateMigrationTestType("diskAccessibilityTests") + ValidateMigrationTestTypeResourceTests = ValidateMigrationTestType("resourceTests") +) + +func init() { + t["ValidateMigrationTestType"] = reflect.TypeOf((*ValidateMigrationTestType)(nil)).Elem() +} + +type VirtualAppVAppState string + +const ( + VirtualAppVAppStateStarted = VirtualAppVAppState("started") + VirtualAppVAppStateStopped = VirtualAppVAppState("stopped") + VirtualAppVAppStateStarting = VirtualAppVAppState("starting") + VirtualAppVAppStateStopping = VirtualAppVAppState("stopping") +) + +func init() { + t["VirtualAppVAppState"] = reflect.TypeOf((*VirtualAppVAppState)(nil)).Elem() +} + +type VirtualDeviceConfigSpecFileOperation string + +const ( + VirtualDeviceConfigSpecFileOperationCreate = VirtualDeviceConfigSpecFileOperation("create") + VirtualDeviceConfigSpecFileOperationDestroy = VirtualDeviceConfigSpecFileOperation("destroy") + VirtualDeviceConfigSpecFileOperationReplace = VirtualDeviceConfigSpecFileOperation("replace") +) + +func init() { + t["VirtualDeviceConfigSpecFileOperation"] = reflect.TypeOf((*VirtualDeviceConfigSpecFileOperation)(nil)).Elem() +} + +type VirtualDeviceConfigSpecOperation string + +const ( + VirtualDeviceConfigSpecOperationAdd = VirtualDeviceConfigSpecOperation("add") + VirtualDeviceConfigSpecOperationRemove = VirtualDeviceConfigSpecOperation("remove") + VirtualDeviceConfigSpecOperationEdit = VirtualDeviceConfigSpecOperation("edit") +) + +func init() { + t["VirtualDeviceConfigSpecOperation"] = reflect.TypeOf((*VirtualDeviceConfigSpecOperation)(nil)).Elem() +} + +type VirtualDeviceConnectInfoStatus string + +const ( + VirtualDeviceConnectInfoStatusOk = VirtualDeviceConnectInfoStatus("ok") + VirtualDeviceConnectInfoStatusRecoverableError = VirtualDeviceConnectInfoStatus("recoverableError") + VirtualDeviceConnectInfoStatusUnrecoverableError = VirtualDeviceConnectInfoStatus("unrecoverableError") + VirtualDeviceConnectInfoStatusUntried = VirtualDeviceConnectInfoStatus("untried") +) + +func init() { + t["VirtualDeviceConnectInfoStatus"] = reflect.TypeOf((*VirtualDeviceConnectInfoStatus)(nil)).Elem() +} + +type VirtualDeviceFileExtension string + +const ( + VirtualDeviceFileExtensionIso = VirtualDeviceFileExtension("iso") + VirtualDeviceFileExtensionFlp = VirtualDeviceFileExtension("flp") + VirtualDeviceFileExtensionVmdk = VirtualDeviceFileExtension("vmdk") + VirtualDeviceFileExtensionDsk = VirtualDeviceFileExtension("dsk") + VirtualDeviceFileExtensionRdm = VirtualDeviceFileExtension("rdm") +) + +func init() { + t["VirtualDeviceFileExtension"] = reflect.TypeOf((*VirtualDeviceFileExtension)(nil)).Elem() +} + +type VirtualDeviceURIBackingOptionDirection string + +const ( + VirtualDeviceURIBackingOptionDirectionServer = VirtualDeviceURIBackingOptionDirection("server") + VirtualDeviceURIBackingOptionDirectionClient = VirtualDeviceURIBackingOptionDirection("client") +) + +func init() { + t["VirtualDeviceURIBackingOptionDirection"] = reflect.TypeOf((*VirtualDeviceURIBackingOptionDirection)(nil)).Elem() +} + +type VirtualDiskAdapterType string + +const ( + VirtualDiskAdapterTypeIde = VirtualDiskAdapterType("ide") + VirtualDiskAdapterTypeBusLogic = VirtualDiskAdapterType("busLogic") + VirtualDiskAdapterTypeLsiLogic = VirtualDiskAdapterType("lsiLogic") +) + +func init() { + t["VirtualDiskAdapterType"] = reflect.TypeOf((*VirtualDiskAdapterType)(nil)).Elem() +} + +type VirtualDiskCompatibilityMode string + +const ( + VirtualDiskCompatibilityModeVirtualMode = VirtualDiskCompatibilityMode("virtualMode") + VirtualDiskCompatibilityModePhysicalMode = VirtualDiskCompatibilityMode("physicalMode") +) + +func init() { + t["VirtualDiskCompatibilityMode"] = reflect.TypeOf((*VirtualDiskCompatibilityMode)(nil)).Elem() +} + +type VirtualDiskDeltaDiskFormat string + +const ( + VirtualDiskDeltaDiskFormatRedoLogFormat = VirtualDiskDeltaDiskFormat("redoLogFormat") + VirtualDiskDeltaDiskFormatNativeFormat = VirtualDiskDeltaDiskFormat("nativeFormat") + VirtualDiskDeltaDiskFormatSeSparseFormat = VirtualDiskDeltaDiskFormat("seSparseFormat") +) + +func init() { + t["VirtualDiskDeltaDiskFormat"] = reflect.TypeOf((*VirtualDiskDeltaDiskFormat)(nil)).Elem() +} + +type VirtualDiskDeltaDiskFormatVariant string + +const ( + VirtualDiskDeltaDiskFormatVariantVmfsSparseVariant = VirtualDiskDeltaDiskFormatVariant("vmfsSparseVariant") + VirtualDiskDeltaDiskFormatVariantVsanSparseVariant = VirtualDiskDeltaDiskFormatVariant("vsanSparseVariant") +) + +func init() { + t["VirtualDiskDeltaDiskFormatVariant"] = reflect.TypeOf((*VirtualDiskDeltaDiskFormatVariant)(nil)).Elem() +} + +type VirtualDiskMode string + +const ( + VirtualDiskModePersistent = VirtualDiskMode("persistent") + VirtualDiskModeNonpersistent = VirtualDiskMode("nonpersistent") + VirtualDiskModeUndoable = VirtualDiskMode("undoable") + VirtualDiskModeIndependent_persistent = VirtualDiskMode("independent_persistent") + VirtualDiskModeIndependent_nonpersistent = VirtualDiskMode("independent_nonpersistent") + VirtualDiskModeAppend = VirtualDiskMode("append") +) + +func init() { + t["VirtualDiskMode"] = reflect.TypeOf((*VirtualDiskMode)(nil)).Elem() +} + +type VirtualDiskSharing string + +const ( + VirtualDiskSharingSharingNone = VirtualDiskSharing("sharingNone") + VirtualDiskSharingSharingMultiWriter = VirtualDiskSharing("sharingMultiWriter") +) + +func init() { + t["VirtualDiskSharing"] = reflect.TypeOf((*VirtualDiskSharing)(nil)).Elem() +} + +type VirtualDiskType string + +const ( + VirtualDiskTypePreallocated = VirtualDiskType("preallocated") + VirtualDiskTypeThin = VirtualDiskType("thin") + VirtualDiskTypeSeSparse = VirtualDiskType("seSparse") + VirtualDiskTypeRdm = VirtualDiskType("rdm") + VirtualDiskTypeRdmp = VirtualDiskType("rdmp") + VirtualDiskTypeRaw = VirtualDiskType("raw") + VirtualDiskTypeDelta = VirtualDiskType("delta") + VirtualDiskTypeSparse2Gb = VirtualDiskType("sparse2Gb") + VirtualDiskTypeThick2Gb = VirtualDiskType("thick2Gb") + VirtualDiskTypeEagerZeroedThick = VirtualDiskType("eagerZeroedThick") + VirtualDiskTypeSparseMonolithic = VirtualDiskType("sparseMonolithic") + VirtualDiskTypeFlatMonolithic = VirtualDiskType("flatMonolithic") + VirtualDiskTypeThick = VirtualDiskType("thick") +) + +func init() { + t["VirtualDiskType"] = reflect.TypeOf((*VirtualDiskType)(nil)).Elem() +} + +type VirtualDiskVFlashCacheConfigInfoCacheConsistencyType string + +const ( + VirtualDiskVFlashCacheConfigInfoCacheConsistencyTypeStrong = VirtualDiskVFlashCacheConfigInfoCacheConsistencyType("strong") + VirtualDiskVFlashCacheConfigInfoCacheConsistencyTypeWeak = VirtualDiskVFlashCacheConfigInfoCacheConsistencyType("weak") +) + +func init() { + t["VirtualDiskVFlashCacheConfigInfoCacheConsistencyType"] = reflect.TypeOf((*VirtualDiskVFlashCacheConfigInfoCacheConsistencyType)(nil)).Elem() +} + +type VirtualDiskVFlashCacheConfigInfoCacheMode string + +const ( + VirtualDiskVFlashCacheConfigInfoCacheModeWrite_thru = VirtualDiskVFlashCacheConfigInfoCacheMode("write_thru") + VirtualDiskVFlashCacheConfigInfoCacheModeWrite_back = VirtualDiskVFlashCacheConfigInfoCacheMode("write_back") +) + +func init() { + t["VirtualDiskVFlashCacheConfigInfoCacheMode"] = reflect.TypeOf((*VirtualDiskVFlashCacheConfigInfoCacheMode)(nil)).Elem() +} + +type VirtualEthernetCardLegacyNetworkDeviceName string + +const ( + VirtualEthernetCardLegacyNetworkDeviceNameBridged = VirtualEthernetCardLegacyNetworkDeviceName("bridged") + VirtualEthernetCardLegacyNetworkDeviceNameNat = VirtualEthernetCardLegacyNetworkDeviceName("nat") + VirtualEthernetCardLegacyNetworkDeviceNameHostonly = VirtualEthernetCardLegacyNetworkDeviceName("hostonly") +) + +func init() { + t["VirtualEthernetCardLegacyNetworkDeviceName"] = reflect.TypeOf((*VirtualEthernetCardLegacyNetworkDeviceName)(nil)).Elem() +} + +type VirtualEthernetCardMacType string + +const ( + VirtualEthernetCardMacTypeManual = VirtualEthernetCardMacType("manual") + VirtualEthernetCardMacTypeGenerated = VirtualEthernetCardMacType("generated") + VirtualEthernetCardMacTypeAssigned = VirtualEthernetCardMacType("assigned") +) + +func init() { + t["VirtualEthernetCardMacType"] = reflect.TypeOf((*VirtualEthernetCardMacType)(nil)).Elem() +} + +type VirtualMachineAppHeartbeatStatusType string + +const ( + VirtualMachineAppHeartbeatStatusTypeAppStatusGray = VirtualMachineAppHeartbeatStatusType("appStatusGray") + VirtualMachineAppHeartbeatStatusTypeAppStatusGreen = VirtualMachineAppHeartbeatStatusType("appStatusGreen") + VirtualMachineAppHeartbeatStatusTypeAppStatusRed = VirtualMachineAppHeartbeatStatusType("appStatusRed") +) + +func init() { + t["VirtualMachineAppHeartbeatStatusType"] = reflect.TypeOf((*VirtualMachineAppHeartbeatStatusType)(nil)).Elem() +} + +type VirtualMachineBootOptionsNetworkBootProtocolType string + +const ( + VirtualMachineBootOptionsNetworkBootProtocolTypeIpv4 = VirtualMachineBootOptionsNetworkBootProtocolType("ipv4") + VirtualMachineBootOptionsNetworkBootProtocolTypeIpv6 = VirtualMachineBootOptionsNetworkBootProtocolType("ipv6") +) + +func init() { + t["VirtualMachineBootOptionsNetworkBootProtocolType"] = reflect.TypeOf((*VirtualMachineBootOptionsNetworkBootProtocolType)(nil)).Elem() +} + +type VirtualMachineConfigInfoNpivWwnType string + +const ( + VirtualMachineConfigInfoNpivWwnTypeVc = VirtualMachineConfigInfoNpivWwnType("vc") + VirtualMachineConfigInfoNpivWwnTypeHost = VirtualMachineConfigInfoNpivWwnType("host") + VirtualMachineConfigInfoNpivWwnTypeExternal = VirtualMachineConfigInfoNpivWwnType("external") +) + +func init() { + t["VirtualMachineConfigInfoNpivWwnType"] = reflect.TypeOf((*VirtualMachineConfigInfoNpivWwnType)(nil)).Elem() +} + +type VirtualMachineConfigInfoSwapPlacementType string + +const ( + VirtualMachineConfigInfoSwapPlacementTypeInherit = VirtualMachineConfigInfoSwapPlacementType("inherit") + VirtualMachineConfigInfoSwapPlacementTypeVmDirectory = VirtualMachineConfigInfoSwapPlacementType("vmDirectory") + VirtualMachineConfigInfoSwapPlacementTypeHostLocal = VirtualMachineConfigInfoSwapPlacementType("hostLocal") +) + +func init() { + t["VirtualMachineConfigInfoSwapPlacementType"] = reflect.TypeOf((*VirtualMachineConfigInfoSwapPlacementType)(nil)).Elem() +} + +type VirtualMachineConfigSpecNpivWwnOp string + +const ( + VirtualMachineConfigSpecNpivWwnOpGenerate = VirtualMachineConfigSpecNpivWwnOp("generate") + VirtualMachineConfigSpecNpivWwnOpSet = VirtualMachineConfigSpecNpivWwnOp("set") + VirtualMachineConfigSpecNpivWwnOpRemove = VirtualMachineConfigSpecNpivWwnOp("remove") + VirtualMachineConfigSpecNpivWwnOpExtend = VirtualMachineConfigSpecNpivWwnOp("extend") +) + +func init() { + t["VirtualMachineConfigSpecNpivWwnOp"] = reflect.TypeOf((*VirtualMachineConfigSpecNpivWwnOp)(nil)).Elem() +} + +type VirtualMachineConnectionState string + +const ( + VirtualMachineConnectionStateConnected = VirtualMachineConnectionState("connected") + VirtualMachineConnectionStateDisconnected = VirtualMachineConnectionState("disconnected") + VirtualMachineConnectionStateOrphaned = VirtualMachineConnectionState("orphaned") + VirtualMachineConnectionStateInaccessible = VirtualMachineConnectionState("inaccessible") + VirtualMachineConnectionStateInvalid = VirtualMachineConnectionState("invalid") +) + +func init() { + t["VirtualMachineConnectionState"] = reflect.TypeOf((*VirtualMachineConnectionState)(nil)).Elem() +} + +type VirtualMachineDeviceRuntimeInfoVirtualEthernetCardRuntimeStateVmDirectPathGen2InactiveReasonOther string + +const ( + VirtualMachineDeviceRuntimeInfoVirtualEthernetCardRuntimeStateVmDirectPathGen2InactiveReasonOtherVmNptIncompatibleHost = VirtualMachineDeviceRuntimeInfoVirtualEthernetCardRuntimeStateVmDirectPathGen2InactiveReasonOther("vmNptIncompatibleHost") + VirtualMachineDeviceRuntimeInfoVirtualEthernetCardRuntimeStateVmDirectPathGen2InactiveReasonOtherVmNptIncompatibleNetwork = VirtualMachineDeviceRuntimeInfoVirtualEthernetCardRuntimeStateVmDirectPathGen2InactiveReasonOther("vmNptIncompatibleNetwork") +) + +func init() { + t["VirtualMachineDeviceRuntimeInfoVirtualEthernetCardRuntimeStateVmDirectPathGen2InactiveReasonOther"] = reflect.TypeOf((*VirtualMachineDeviceRuntimeInfoVirtualEthernetCardRuntimeStateVmDirectPathGen2InactiveReasonOther)(nil)).Elem() +} + +type VirtualMachineDeviceRuntimeInfoVirtualEthernetCardRuntimeStateVmDirectPathGen2InactiveReasonVm string + +const ( + VirtualMachineDeviceRuntimeInfoVirtualEthernetCardRuntimeStateVmDirectPathGen2InactiveReasonVmVmNptIncompatibleGuest = VirtualMachineDeviceRuntimeInfoVirtualEthernetCardRuntimeStateVmDirectPathGen2InactiveReasonVm("vmNptIncompatibleGuest") + VirtualMachineDeviceRuntimeInfoVirtualEthernetCardRuntimeStateVmDirectPathGen2InactiveReasonVmVmNptIncompatibleGuestDriver = VirtualMachineDeviceRuntimeInfoVirtualEthernetCardRuntimeStateVmDirectPathGen2InactiveReasonVm("vmNptIncompatibleGuestDriver") + VirtualMachineDeviceRuntimeInfoVirtualEthernetCardRuntimeStateVmDirectPathGen2InactiveReasonVmVmNptIncompatibleAdapterType = VirtualMachineDeviceRuntimeInfoVirtualEthernetCardRuntimeStateVmDirectPathGen2InactiveReasonVm("vmNptIncompatibleAdapterType") + VirtualMachineDeviceRuntimeInfoVirtualEthernetCardRuntimeStateVmDirectPathGen2InactiveReasonVmVmNptDisabledOrDisconnectedAdapter = VirtualMachineDeviceRuntimeInfoVirtualEthernetCardRuntimeStateVmDirectPathGen2InactiveReasonVm("vmNptDisabledOrDisconnectedAdapter") + VirtualMachineDeviceRuntimeInfoVirtualEthernetCardRuntimeStateVmDirectPathGen2InactiveReasonVmVmNptIncompatibleAdapterFeatures = VirtualMachineDeviceRuntimeInfoVirtualEthernetCardRuntimeStateVmDirectPathGen2InactiveReasonVm("vmNptIncompatibleAdapterFeatures") + VirtualMachineDeviceRuntimeInfoVirtualEthernetCardRuntimeStateVmDirectPathGen2InactiveReasonVmVmNptIncompatibleBackingType = VirtualMachineDeviceRuntimeInfoVirtualEthernetCardRuntimeStateVmDirectPathGen2InactiveReasonVm("vmNptIncompatibleBackingType") + VirtualMachineDeviceRuntimeInfoVirtualEthernetCardRuntimeStateVmDirectPathGen2InactiveReasonVmVmNptInsufficientMemoryReservation = VirtualMachineDeviceRuntimeInfoVirtualEthernetCardRuntimeStateVmDirectPathGen2InactiveReasonVm("vmNptInsufficientMemoryReservation") + VirtualMachineDeviceRuntimeInfoVirtualEthernetCardRuntimeStateVmDirectPathGen2InactiveReasonVmVmNptFaultToleranceOrRecordReplayConfigured = VirtualMachineDeviceRuntimeInfoVirtualEthernetCardRuntimeStateVmDirectPathGen2InactiveReasonVm("vmNptFaultToleranceOrRecordReplayConfigured") + VirtualMachineDeviceRuntimeInfoVirtualEthernetCardRuntimeStateVmDirectPathGen2InactiveReasonVmVmNptConflictingIOChainConfigured = VirtualMachineDeviceRuntimeInfoVirtualEthernetCardRuntimeStateVmDirectPathGen2InactiveReasonVm("vmNptConflictingIOChainConfigured") + VirtualMachineDeviceRuntimeInfoVirtualEthernetCardRuntimeStateVmDirectPathGen2InactiveReasonVmVmNptMonitorBlocks = VirtualMachineDeviceRuntimeInfoVirtualEthernetCardRuntimeStateVmDirectPathGen2InactiveReasonVm("vmNptMonitorBlocks") + VirtualMachineDeviceRuntimeInfoVirtualEthernetCardRuntimeStateVmDirectPathGen2InactiveReasonVmVmNptConflictingOperationInProgress = VirtualMachineDeviceRuntimeInfoVirtualEthernetCardRuntimeStateVmDirectPathGen2InactiveReasonVm("vmNptConflictingOperationInProgress") + VirtualMachineDeviceRuntimeInfoVirtualEthernetCardRuntimeStateVmDirectPathGen2InactiveReasonVmVmNptRuntimeError = VirtualMachineDeviceRuntimeInfoVirtualEthernetCardRuntimeStateVmDirectPathGen2InactiveReasonVm("vmNptRuntimeError") + VirtualMachineDeviceRuntimeInfoVirtualEthernetCardRuntimeStateVmDirectPathGen2InactiveReasonVmVmNptOutOfIntrVector = VirtualMachineDeviceRuntimeInfoVirtualEthernetCardRuntimeStateVmDirectPathGen2InactiveReasonVm("vmNptOutOfIntrVector") + VirtualMachineDeviceRuntimeInfoVirtualEthernetCardRuntimeStateVmDirectPathGen2InactiveReasonVmVmNptVMCIActive = VirtualMachineDeviceRuntimeInfoVirtualEthernetCardRuntimeStateVmDirectPathGen2InactiveReasonVm("vmNptVMCIActive") +) + +func init() { + t["VirtualMachineDeviceRuntimeInfoVirtualEthernetCardRuntimeStateVmDirectPathGen2InactiveReasonVm"] = reflect.TypeOf((*VirtualMachineDeviceRuntimeInfoVirtualEthernetCardRuntimeStateVmDirectPathGen2InactiveReasonVm)(nil)).Elem() +} + +type VirtualMachineFaultToleranceState string + +const ( + VirtualMachineFaultToleranceStateNotConfigured = VirtualMachineFaultToleranceState("notConfigured") + VirtualMachineFaultToleranceStateDisabled = VirtualMachineFaultToleranceState("disabled") + VirtualMachineFaultToleranceStateEnabled = VirtualMachineFaultToleranceState("enabled") + VirtualMachineFaultToleranceStateNeedSecondary = VirtualMachineFaultToleranceState("needSecondary") + VirtualMachineFaultToleranceStateStarting = VirtualMachineFaultToleranceState("starting") + VirtualMachineFaultToleranceStateRunning = VirtualMachineFaultToleranceState("running") +) + +func init() { + t["VirtualMachineFaultToleranceState"] = reflect.TypeOf((*VirtualMachineFaultToleranceState)(nil)).Elem() +} + +type VirtualMachineFaultToleranceType string + +const ( + VirtualMachineFaultToleranceTypeUnset = VirtualMachineFaultToleranceType("unset") + VirtualMachineFaultToleranceTypeRecordReplay = VirtualMachineFaultToleranceType("recordReplay") + VirtualMachineFaultToleranceTypeCheckpointing = VirtualMachineFaultToleranceType("checkpointing") +) + +func init() { + t["VirtualMachineFaultToleranceType"] = reflect.TypeOf((*VirtualMachineFaultToleranceType)(nil)).Elem() +} + +type VirtualMachineFileLayoutExFileType string + +const ( + VirtualMachineFileLayoutExFileTypeConfig = VirtualMachineFileLayoutExFileType("config") + VirtualMachineFileLayoutExFileTypeExtendedConfig = VirtualMachineFileLayoutExFileType("extendedConfig") + VirtualMachineFileLayoutExFileTypeDiskDescriptor = VirtualMachineFileLayoutExFileType("diskDescriptor") + VirtualMachineFileLayoutExFileTypeDiskExtent = VirtualMachineFileLayoutExFileType("diskExtent") + VirtualMachineFileLayoutExFileTypeDigestDescriptor = VirtualMachineFileLayoutExFileType("digestDescriptor") + VirtualMachineFileLayoutExFileTypeDigestExtent = VirtualMachineFileLayoutExFileType("digestExtent") + VirtualMachineFileLayoutExFileTypeDiskReplicationState = VirtualMachineFileLayoutExFileType("diskReplicationState") + VirtualMachineFileLayoutExFileTypeLog = VirtualMachineFileLayoutExFileType("log") + VirtualMachineFileLayoutExFileTypeStat = VirtualMachineFileLayoutExFileType("stat") + VirtualMachineFileLayoutExFileTypeNamespaceData = VirtualMachineFileLayoutExFileType("namespaceData") + VirtualMachineFileLayoutExFileTypeNvram = VirtualMachineFileLayoutExFileType("nvram") + VirtualMachineFileLayoutExFileTypeSnapshotData = VirtualMachineFileLayoutExFileType("snapshotData") + VirtualMachineFileLayoutExFileTypeSnapshotMemory = VirtualMachineFileLayoutExFileType("snapshotMemory") + VirtualMachineFileLayoutExFileTypeSnapshotList = VirtualMachineFileLayoutExFileType("snapshotList") + VirtualMachineFileLayoutExFileTypeSnapshotManifestList = VirtualMachineFileLayoutExFileType("snapshotManifestList") + VirtualMachineFileLayoutExFileTypeSuspend = VirtualMachineFileLayoutExFileType("suspend") + VirtualMachineFileLayoutExFileTypeSuspendMemory = VirtualMachineFileLayoutExFileType("suspendMemory") + VirtualMachineFileLayoutExFileTypeSwap = VirtualMachineFileLayoutExFileType("swap") + VirtualMachineFileLayoutExFileTypeUwswap = VirtualMachineFileLayoutExFileType("uwswap") + VirtualMachineFileLayoutExFileTypeCore = VirtualMachineFileLayoutExFileType("core") + VirtualMachineFileLayoutExFileTypeScreenshot = VirtualMachineFileLayoutExFileType("screenshot") + VirtualMachineFileLayoutExFileTypeFtMetadata = VirtualMachineFileLayoutExFileType("ftMetadata") + VirtualMachineFileLayoutExFileTypeGuestCustomization = VirtualMachineFileLayoutExFileType("guestCustomization") +) + +func init() { + t["VirtualMachineFileLayoutExFileType"] = reflect.TypeOf((*VirtualMachineFileLayoutExFileType)(nil)).Elem() +} + +type VirtualMachineFlagInfoMonitorType string + +const ( + VirtualMachineFlagInfoMonitorTypeRelease = VirtualMachineFlagInfoMonitorType("release") + VirtualMachineFlagInfoMonitorTypeDebug = VirtualMachineFlagInfoMonitorType("debug") + VirtualMachineFlagInfoMonitorTypeStats = VirtualMachineFlagInfoMonitorType("stats") +) + +func init() { + t["VirtualMachineFlagInfoMonitorType"] = reflect.TypeOf((*VirtualMachineFlagInfoMonitorType)(nil)).Elem() +} + +type VirtualMachineFlagInfoVirtualExecUsage string + +const ( + VirtualMachineFlagInfoVirtualExecUsageHvAuto = VirtualMachineFlagInfoVirtualExecUsage("hvAuto") + VirtualMachineFlagInfoVirtualExecUsageHvOn = VirtualMachineFlagInfoVirtualExecUsage("hvOn") + VirtualMachineFlagInfoVirtualExecUsageHvOff = VirtualMachineFlagInfoVirtualExecUsage("hvOff") +) + +func init() { + t["VirtualMachineFlagInfoVirtualExecUsage"] = reflect.TypeOf((*VirtualMachineFlagInfoVirtualExecUsage)(nil)).Elem() +} + +type VirtualMachineFlagInfoVirtualMmuUsage string + +const ( + VirtualMachineFlagInfoVirtualMmuUsageAutomatic = VirtualMachineFlagInfoVirtualMmuUsage("automatic") + VirtualMachineFlagInfoVirtualMmuUsageOn = VirtualMachineFlagInfoVirtualMmuUsage("on") + VirtualMachineFlagInfoVirtualMmuUsageOff = VirtualMachineFlagInfoVirtualMmuUsage("off") +) + +func init() { + t["VirtualMachineFlagInfoVirtualMmuUsage"] = reflect.TypeOf((*VirtualMachineFlagInfoVirtualMmuUsage)(nil)).Elem() +} + +type VirtualMachineForkConfigInfoChildType string + +const ( + VirtualMachineForkConfigInfoChildTypeNone = VirtualMachineForkConfigInfoChildType("none") + VirtualMachineForkConfigInfoChildTypePersistent = VirtualMachineForkConfigInfoChildType("persistent") + VirtualMachineForkConfigInfoChildTypeNonpersistent = VirtualMachineForkConfigInfoChildType("nonpersistent") +) + +func init() { + t["VirtualMachineForkConfigInfoChildType"] = reflect.TypeOf((*VirtualMachineForkConfigInfoChildType)(nil)).Elem() +} + +type VirtualMachineGuestOsFamily string + +const ( + VirtualMachineGuestOsFamilyWindowsGuest = VirtualMachineGuestOsFamily("windowsGuest") + VirtualMachineGuestOsFamilyLinuxGuest = VirtualMachineGuestOsFamily("linuxGuest") + VirtualMachineGuestOsFamilyNetwareGuest = VirtualMachineGuestOsFamily("netwareGuest") + VirtualMachineGuestOsFamilySolarisGuest = VirtualMachineGuestOsFamily("solarisGuest") + VirtualMachineGuestOsFamilyDarwinGuestFamily = VirtualMachineGuestOsFamily("darwinGuestFamily") + VirtualMachineGuestOsFamilyOtherGuestFamily = VirtualMachineGuestOsFamily("otherGuestFamily") +) + +func init() { + t["VirtualMachineGuestOsFamily"] = reflect.TypeOf((*VirtualMachineGuestOsFamily)(nil)).Elem() +} + +type VirtualMachineGuestOsIdentifier string + +const ( + VirtualMachineGuestOsIdentifierDosGuest = VirtualMachineGuestOsIdentifier("dosGuest") + VirtualMachineGuestOsIdentifierWin31Guest = VirtualMachineGuestOsIdentifier("win31Guest") + VirtualMachineGuestOsIdentifierWin95Guest = VirtualMachineGuestOsIdentifier("win95Guest") + VirtualMachineGuestOsIdentifierWin98Guest = VirtualMachineGuestOsIdentifier("win98Guest") + VirtualMachineGuestOsIdentifierWinMeGuest = VirtualMachineGuestOsIdentifier("winMeGuest") + VirtualMachineGuestOsIdentifierWinNTGuest = VirtualMachineGuestOsIdentifier("winNTGuest") + VirtualMachineGuestOsIdentifierWin2000ProGuest = VirtualMachineGuestOsIdentifier("win2000ProGuest") + VirtualMachineGuestOsIdentifierWin2000ServGuest = VirtualMachineGuestOsIdentifier("win2000ServGuest") + VirtualMachineGuestOsIdentifierWin2000AdvServGuest = VirtualMachineGuestOsIdentifier("win2000AdvServGuest") + VirtualMachineGuestOsIdentifierWinXPHomeGuest = VirtualMachineGuestOsIdentifier("winXPHomeGuest") + VirtualMachineGuestOsIdentifierWinXPProGuest = VirtualMachineGuestOsIdentifier("winXPProGuest") + VirtualMachineGuestOsIdentifierWinXPPro64Guest = VirtualMachineGuestOsIdentifier("winXPPro64Guest") + VirtualMachineGuestOsIdentifierWinNetWebGuest = VirtualMachineGuestOsIdentifier("winNetWebGuest") + VirtualMachineGuestOsIdentifierWinNetStandardGuest = VirtualMachineGuestOsIdentifier("winNetStandardGuest") + VirtualMachineGuestOsIdentifierWinNetEnterpriseGuest = VirtualMachineGuestOsIdentifier("winNetEnterpriseGuest") + VirtualMachineGuestOsIdentifierWinNetDatacenterGuest = VirtualMachineGuestOsIdentifier("winNetDatacenterGuest") + VirtualMachineGuestOsIdentifierWinNetBusinessGuest = VirtualMachineGuestOsIdentifier("winNetBusinessGuest") + VirtualMachineGuestOsIdentifierWinNetStandard64Guest = VirtualMachineGuestOsIdentifier("winNetStandard64Guest") + VirtualMachineGuestOsIdentifierWinNetEnterprise64Guest = VirtualMachineGuestOsIdentifier("winNetEnterprise64Guest") + VirtualMachineGuestOsIdentifierWinLonghornGuest = VirtualMachineGuestOsIdentifier("winLonghornGuest") + VirtualMachineGuestOsIdentifierWinLonghorn64Guest = VirtualMachineGuestOsIdentifier("winLonghorn64Guest") + VirtualMachineGuestOsIdentifierWinNetDatacenter64Guest = VirtualMachineGuestOsIdentifier("winNetDatacenter64Guest") + VirtualMachineGuestOsIdentifierWinVistaGuest = VirtualMachineGuestOsIdentifier("winVistaGuest") + VirtualMachineGuestOsIdentifierWinVista64Guest = VirtualMachineGuestOsIdentifier("winVista64Guest") + VirtualMachineGuestOsIdentifierWindows7Guest = VirtualMachineGuestOsIdentifier("windows7Guest") + VirtualMachineGuestOsIdentifierWindows7_64Guest = VirtualMachineGuestOsIdentifier("windows7_64Guest") + VirtualMachineGuestOsIdentifierWindows7Server64Guest = VirtualMachineGuestOsIdentifier("windows7Server64Guest") + VirtualMachineGuestOsIdentifierWindows8Guest = VirtualMachineGuestOsIdentifier("windows8Guest") + VirtualMachineGuestOsIdentifierWindows8_64Guest = VirtualMachineGuestOsIdentifier("windows8_64Guest") + VirtualMachineGuestOsIdentifierWindows8Server64Guest = VirtualMachineGuestOsIdentifier("windows8Server64Guest") + VirtualMachineGuestOsIdentifierWindows9Guest = VirtualMachineGuestOsIdentifier("windows9Guest") + VirtualMachineGuestOsIdentifierWindows9_64Guest = VirtualMachineGuestOsIdentifier("windows9_64Guest") + VirtualMachineGuestOsIdentifierWindows9Server64Guest = VirtualMachineGuestOsIdentifier("windows9Server64Guest") + VirtualMachineGuestOsIdentifierWindowsHyperVGuest = VirtualMachineGuestOsIdentifier("windowsHyperVGuest") + VirtualMachineGuestOsIdentifierFreebsdGuest = VirtualMachineGuestOsIdentifier("freebsdGuest") + VirtualMachineGuestOsIdentifierFreebsd64Guest = VirtualMachineGuestOsIdentifier("freebsd64Guest") + VirtualMachineGuestOsIdentifierRedhatGuest = VirtualMachineGuestOsIdentifier("redhatGuest") + VirtualMachineGuestOsIdentifierRhel2Guest = VirtualMachineGuestOsIdentifier("rhel2Guest") + VirtualMachineGuestOsIdentifierRhel3Guest = VirtualMachineGuestOsIdentifier("rhel3Guest") + VirtualMachineGuestOsIdentifierRhel3_64Guest = VirtualMachineGuestOsIdentifier("rhel3_64Guest") + VirtualMachineGuestOsIdentifierRhel4Guest = VirtualMachineGuestOsIdentifier("rhel4Guest") + VirtualMachineGuestOsIdentifierRhel4_64Guest = VirtualMachineGuestOsIdentifier("rhel4_64Guest") + VirtualMachineGuestOsIdentifierRhel5Guest = VirtualMachineGuestOsIdentifier("rhel5Guest") + VirtualMachineGuestOsIdentifierRhel5_64Guest = VirtualMachineGuestOsIdentifier("rhel5_64Guest") + VirtualMachineGuestOsIdentifierRhel6Guest = VirtualMachineGuestOsIdentifier("rhel6Guest") + VirtualMachineGuestOsIdentifierRhel6_64Guest = VirtualMachineGuestOsIdentifier("rhel6_64Guest") + VirtualMachineGuestOsIdentifierRhel7Guest = VirtualMachineGuestOsIdentifier("rhel7Guest") + VirtualMachineGuestOsIdentifierRhel7_64Guest = VirtualMachineGuestOsIdentifier("rhel7_64Guest") + VirtualMachineGuestOsIdentifierCentosGuest = VirtualMachineGuestOsIdentifier("centosGuest") + VirtualMachineGuestOsIdentifierCentos64Guest = VirtualMachineGuestOsIdentifier("centos64Guest") + VirtualMachineGuestOsIdentifierOracleLinuxGuest = VirtualMachineGuestOsIdentifier("oracleLinuxGuest") + VirtualMachineGuestOsIdentifierOracleLinux64Guest = VirtualMachineGuestOsIdentifier("oracleLinux64Guest") + VirtualMachineGuestOsIdentifierSuseGuest = VirtualMachineGuestOsIdentifier("suseGuest") + VirtualMachineGuestOsIdentifierSuse64Guest = VirtualMachineGuestOsIdentifier("suse64Guest") + VirtualMachineGuestOsIdentifierSlesGuest = VirtualMachineGuestOsIdentifier("slesGuest") + VirtualMachineGuestOsIdentifierSles64Guest = VirtualMachineGuestOsIdentifier("sles64Guest") + VirtualMachineGuestOsIdentifierSles10Guest = VirtualMachineGuestOsIdentifier("sles10Guest") + VirtualMachineGuestOsIdentifierSles10_64Guest = VirtualMachineGuestOsIdentifier("sles10_64Guest") + VirtualMachineGuestOsIdentifierSles11Guest = VirtualMachineGuestOsIdentifier("sles11Guest") + VirtualMachineGuestOsIdentifierSles11_64Guest = VirtualMachineGuestOsIdentifier("sles11_64Guest") + VirtualMachineGuestOsIdentifierSles12Guest = VirtualMachineGuestOsIdentifier("sles12Guest") + VirtualMachineGuestOsIdentifierSles12_64Guest = VirtualMachineGuestOsIdentifier("sles12_64Guest") + VirtualMachineGuestOsIdentifierNld9Guest = VirtualMachineGuestOsIdentifier("nld9Guest") + VirtualMachineGuestOsIdentifierOesGuest = VirtualMachineGuestOsIdentifier("oesGuest") + VirtualMachineGuestOsIdentifierSjdsGuest = VirtualMachineGuestOsIdentifier("sjdsGuest") + VirtualMachineGuestOsIdentifierMandrakeGuest = VirtualMachineGuestOsIdentifier("mandrakeGuest") + VirtualMachineGuestOsIdentifierMandrivaGuest = VirtualMachineGuestOsIdentifier("mandrivaGuest") + VirtualMachineGuestOsIdentifierMandriva64Guest = VirtualMachineGuestOsIdentifier("mandriva64Guest") + VirtualMachineGuestOsIdentifierTurboLinuxGuest = VirtualMachineGuestOsIdentifier("turboLinuxGuest") + VirtualMachineGuestOsIdentifierTurboLinux64Guest = VirtualMachineGuestOsIdentifier("turboLinux64Guest") + VirtualMachineGuestOsIdentifierUbuntuGuest = VirtualMachineGuestOsIdentifier("ubuntuGuest") + VirtualMachineGuestOsIdentifierUbuntu64Guest = VirtualMachineGuestOsIdentifier("ubuntu64Guest") + VirtualMachineGuestOsIdentifierDebian4Guest = VirtualMachineGuestOsIdentifier("debian4Guest") + VirtualMachineGuestOsIdentifierDebian4_64Guest = VirtualMachineGuestOsIdentifier("debian4_64Guest") + VirtualMachineGuestOsIdentifierDebian5Guest = VirtualMachineGuestOsIdentifier("debian5Guest") + VirtualMachineGuestOsIdentifierDebian5_64Guest = VirtualMachineGuestOsIdentifier("debian5_64Guest") + VirtualMachineGuestOsIdentifierDebian6Guest = VirtualMachineGuestOsIdentifier("debian6Guest") + VirtualMachineGuestOsIdentifierDebian6_64Guest = VirtualMachineGuestOsIdentifier("debian6_64Guest") + VirtualMachineGuestOsIdentifierDebian7Guest = VirtualMachineGuestOsIdentifier("debian7Guest") + VirtualMachineGuestOsIdentifierDebian7_64Guest = VirtualMachineGuestOsIdentifier("debian7_64Guest") + VirtualMachineGuestOsIdentifierDebian8Guest = VirtualMachineGuestOsIdentifier("debian8Guest") + VirtualMachineGuestOsIdentifierDebian8_64Guest = VirtualMachineGuestOsIdentifier("debian8_64Guest") + VirtualMachineGuestOsIdentifierAsianux3Guest = VirtualMachineGuestOsIdentifier("asianux3Guest") + VirtualMachineGuestOsIdentifierAsianux3_64Guest = VirtualMachineGuestOsIdentifier("asianux3_64Guest") + VirtualMachineGuestOsIdentifierAsianux4Guest = VirtualMachineGuestOsIdentifier("asianux4Guest") + VirtualMachineGuestOsIdentifierAsianux4_64Guest = VirtualMachineGuestOsIdentifier("asianux4_64Guest") + VirtualMachineGuestOsIdentifierAsianux5_64Guest = VirtualMachineGuestOsIdentifier("asianux5_64Guest") + VirtualMachineGuestOsIdentifierOpensuseGuest = VirtualMachineGuestOsIdentifier("opensuseGuest") + VirtualMachineGuestOsIdentifierOpensuse64Guest = VirtualMachineGuestOsIdentifier("opensuse64Guest") + VirtualMachineGuestOsIdentifierFedoraGuest = VirtualMachineGuestOsIdentifier("fedoraGuest") + VirtualMachineGuestOsIdentifierFedora64Guest = VirtualMachineGuestOsIdentifier("fedora64Guest") + VirtualMachineGuestOsIdentifierCoreos64Guest = VirtualMachineGuestOsIdentifier("coreos64Guest") + VirtualMachineGuestOsIdentifierOther24xLinuxGuest = VirtualMachineGuestOsIdentifier("other24xLinuxGuest") + VirtualMachineGuestOsIdentifierOther26xLinuxGuest = VirtualMachineGuestOsIdentifier("other26xLinuxGuest") + VirtualMachineGuestOsIdentifierOtherLinuxGuest = VirtualMachineGuestOsIdentifier("otherLinuxGuest") + VirtualMachineGuestOsIdentifierOther3xLinuxGuest = VirtualMachineGuestOsIdentifier("other3xLinuxGuest") + VirtualMachineGuestOsIdentifierGenericLinuxGuest = VirtualMachineGuestOsIdentifier("genericLinuxGuest") + VirtualMachineGuestOsIdentifierOther24xLinux64Guest = VirtualMachineGuestOsIdentifier("other24xLinux64Guest") + VirtualMachineGuestOsIdentifierOther26xLinux64Guest = VirtualMachineGuestOsIdentifier("other26xLinux64Guest") + VirtualMachineGuestOsIdentifierOther3xLinux64Guest = VirtualMachineGuestOsIdentifier("other3xLinux64Guest") + VirtualMachineGuestOsIdentifierOtherLinux64Guest = VirtualMachineGuestOsIdentifier("otherLinux64Guest") + VirtualMachineGuestOsIdentifierSolaris6Guest = VirtualMachineGuestOsIdentifier("solaris6Guest") + VirtualMachineGuestOsIdentifierSolaris7Guest = VirtualMachineGuestOsIdentifier("solaris7Guest") + VirtualMachineGuestOsIdentifierSolaris8Guest = VirtualMachineGuestOsIdentifier("solaris8Guest") + VirtualMachineGuestOsIdentifierSolaris9Guest = VirtualMachineGuestOsIdentifier("solaris9Guest") + VirtualMachineGuestOsIdentifierSolaris10Guest = VirtualMachineGuestOsIdentifier("solaris10Guest") + VirtualMachineGuestOsIdentifierSolaris10_64Guest = VirtualMachineGuestOsIdentifier("solaris10_64Guest") + VirtualMachineGuestOsIdentifierSolaris11_64Guest = VirtualMachineGuestOsIdentifier("solaris11_64Guest") + VirtualMachineGuestOsIdentifierOs2Guest = VirtualMachineGuestOsIdentifier("os2Guest") + VirtualMachineGuestOsIdentifierEComStationGuest = VirtualMachineGuestOsIdentifier("eComStationGuest") + VirtualMachineGuestOsIdentifierEComStation2Guest = VirtualMachineGuestOsIdentifier("eComStation2Guest") + VirtualMachineGuestOsIdentifierNetware4Guest = VirtualMachineGuestOsIdentifier("netware4Guest") + VirtualMachineGuestOsIdentifierNetware5Guest = VirtualMachineGuestOsIdentifier("netware5Guest") + VirtualMachineGuestOsIdentifierNetware6Guest = VirtualMachineGuestOsIdentifier("netware6Guest") + VirtualMachineGuestOsIdentifierOpenServer5Guest = VirtualMachineGuestOsIdentifier("openServer5Guest") + VirtualMachineGuestOsIdentifierOpenServer6Guest = VirtualMachineGuestOsIdentifier("openServer6Guest") + VirtualMachineGuestOsIdentifierUnixWare7Guest = VirtualMachineGuestOsIdentifier("unixWare7Guest") + VirtualMachineGuestOsIdentifierDarwinGuest = VirtualMachineGuestOsIdentifier("darwinGuest") + VirtualMachineGuestOsIdentifierDarwin64Guest = VirtualMachineGuestOsIdentifier("darwin64Guest") + VirtualMachineGuestOsIdentifierDarwin10Guest = VirtualMachineGuestOsIdentifier("darwin10Guest") + VirtualMachineGuestOsIdentifierDarwin10_64Guest = VirtualMachineGuestOsIdentifier("darwin10_64Guest") + VirtualMachineGuestOsIdentifierDarwin11Guest = VirtualMachineGuestOsIdentifier("darwin11Guest") + VirtualMachineGuestOsIdentifierDarwin11_64Guest = VirtualMachineGuestOsIdentifier("darwin11_64Guest") + VirtualMachineGuestOsIdentifierDarwin12_64Guest = VirtualMachineGuestOsIdentifier("darwin12_64Guest") + VirtualMachineGuestOsIdentifierDarwin13_64Guest = VirtualMachineGuestOsIdentifier("darwin13_64Guest") + VirtualMachineGuestOsIdentifierDarwin14_64Guest = VirtualMachineGuestOsIdentifier("darwin14_64Guest") + VirtualMachineGuestOsIdentifierVmkernelGuest = VirtualMachineGuestOsIdentifier("vmkernelGuest") + VirtualMachineGuestOsIdentifierVmkernel5Guest = VirtualMachineGuestOsIdentifier("vmkernel5Guest") + VirtualMachineGuestOsIdentifierVmkernel6Guest = VirtualMachineGuestOsIdentifier("vmkernel6Guest") + VirtualMachineGuestOsIdentifierOtherGuest = VirtualMachineGuestOsIdentifier("otherGuest") + VirtualMachineGuestOsIdentifierOtherGuest64 = VirtualMachineGuestOsIdentifier("otherGuest64") +) + +func init() { + t["VirtualMachineGuestOsIdentifier"] = reflect.TypeOf((*VirtualMachineGuestOsIdentifier)(nil)).Elem() +} + +type VirtualMachineGuestState string + +const ( + VirtualMachineGuestStateRunning = VirtualMachineGuestState("running") + VirtualMachineGuestStateShuttingDown = VirtualMachineGuestState("shuttingDown") + VirtualMachineGuestStateResetting = VirtualMachineGuestState("resetting") + VirtualMachineGuestStateStandby = VirtualMachineGuestState("standby") + VirtualMachineGuestStateNotRunning = VirtualMachineGuestState("notRunning") + VirtualMachineGuestStateUnknown = VirtualMachineGuestState("unknown") +) + +func init() { + t["VirtualMachineGuestState"] = reflect.TypeOf((*VirtualMachineGuestState)(nil)).Elem() +} + +type VirtualMachineHtSharing string + +const ( + VirtualMachineHtSharingAny = VirtualMachineHtSharing("any") + VirtualMachineHtSharingNone = VirtualMachineHtSharing("none") + VirtualMachineHtSharingInternal = VirtualMachineHtSharing("internal") +) + +func init() { + t["VirtualMachineHtSharing"] = reflect.TypeOf((*VirtualMachineHtSharing)(nil)).Elem() +} + +type VirtualMachineMemoryAllocationPolicy string + +const ( + VirtualMachineMemoryAllocationPolicySwapNone = VirtualMachineMemoryAllocationPolicy("swapNone") + VirtualMachineMemoryAllocationPolicySwapSome = VirtualMachineMemoryAllocationPolicy("swapSome") + VirtualMachineMemoryAllocationPolicySwapMost = VirtualMachineMemoryAllocationPolicy("swapMost") +) + +func init() { + t["VirtualMachineMemoryAllocationPolicy"] = reflect.TypeOf((*VirtualMachineMemoryAllocationPolicy)(nil)).Elem() +} + +type VirtualMachineMetadataManagerVmMetadataOp string + +const ( + VirtualMachineMetadataManagerVmMetadataOpUpdate = VirtualMachineMetadataManagerVmMetadataOp("Update") + VirtualMachineMetadataManagerVmMetadataOpRemove = VirtualMachineMetadataManagerVmMetadataOp("Remove") +) + +func init() { + t["VirtualMachineMetadataManagerVmMetadataOp"] = reflect.TypeOf((*VirtualMachineMetadataManagerVmMetadataOp)(nil)).Elem() +} + +type VirtualMachineMetadataManagerVmMetadataOwnerOwner string + +const ( + VirtualMachineMetadataManagerVmMetadataOwnerOwnerComVmwareVsphereHA = VirtualMachineMetadataManagerVmMetadataOwnerOwner("ComVmwareVsphereHA") +) + +func init() { + t["VirtualMachineMetadataManagerVmMetadataOwnerOwner"] = reflect.TypeOf((*VirtualMachineMetadataManagerVmMetadataOwnerOwner)(nil)).Elem() +} + +type VirtualMachineMovePriority string + +const ( + VirtualMachineMovePriorityLowPriority = VirtualMachineMovePriority("lowPriority") + VirtualMachineMovePriorityHighPriority = VirtualMachineMovePriority("highPriority") + VirtualMachineMovePriorityDefaultPriority = VirtualMachineMovePriority("defaultPriority") +) + +func init() { + t["VirtualMachineMovePriority"] = reflect.TypeOf((*VirtualMachineMovePriority)(nil)).Elem() +} + +type VirtualMachineNeedSecondaryReason string + +const ( + VirtualMachineNeedSecondaryReasonInitializing = VirtualMachineNeedSecondaryReason("initializing") + VirtualMachineNeedSecondaryReasonDivergence = VirtualMachineNeedSecondaryReason("divergence") + VirtualMachineNeedSecondaryReasonLostConnection = VirtualMachineNeedSecondaryReason("lostConnection") + VirtualMachineNeedSecondaryReasonPartialHardwareFailure = VirtualMachineNeedSecondaryReason("partialHardwareFailure") + VirtualMachineNeedSecondaryReasonUserAction = VirtualMachineNeedSecondaryReason("userAction") + VirtualMachineNeedSecondaryReasonCheckpointError = VirtualMachineNeedSecondaryReason("checkpointError") + VirtualMachineNeedSecondaryReasonOther = VirtualMachineNeedSecondaryReason("other") +) + +func init() { + t["VirtualMachineNeedSecondaryReason"] = reflect.TypeOf((*VirtualMachineNeedSecondaryReason)(nil)).Elem() +} + +type VirtualMachinePowerOffBehavior string + +const ( + VirtualMachinePowerOffBehaviorPowerOff = VirtualMachinePowerOffBehavior("powerOff") + VirtualMachinePowerOffBehaviorRevert = VirtualMachinePowerOffBehavior("revert") + VirtualMachinePowerOffBehaviorPrompt = VirtualMachinePowerOffBehavior("prompt") + VirtualMachinePowerOffBehaviorTake = VirtualMachinePowerOffBehavior("take") +) + +func init() { + t["VirtualMachinePowerOffBehavior"] = reflect.TypeOf((*VirtualMachinePowerOffBehavior)(nil)).Elem() +} + +type VirtualMachinePowerOpType string + +const ( + VirtualMachinePowerOpTypeSoft = VirtualMachinePowerOpType("soft") + VirtualMachinePowerOpTypeHard = VirtualMachinePowerOpType("hard") + VirtualMachinePowerOpTypePreset = VirtualMachinePowerOpType("preset") +) + +func init() { + t["VirtualMachinePowerOpType"] = reflect.TypeOf((*VirtualMachinePowerOpType)(nil)).Elem() +} + +type VirtualMachinePowerState string + +const ( + VirtualMachinePowerStatePoweredOff = VirtualMachinePowerState("poweredOff") + VirtualMachinePowerStatePoweredOn = VirtualMachinePowerState("poweredOn") + VirtualMachinePowerStateSuspended = VirtualMachinePowerState("suspended") +) + +func init() { + t["VirtualMachinePowerState"] = reflect.TypeOf((*VirtualMachinePowerState)(nil)).Elem() +} + +type VirtualMachineRecordReplayState string + +const ( + VirtualMachineRecordReplayStateRecording = VirtualMachineRecordReplayState("recording") + VirtualMachineRecordReplayStateReplaying = VirtualMachineRecordReplayState("replaying") + VirtualMachineRecordReplayStateInactive = VirtualMachineRecordReplayState("inactive") +) + +func init() { + t["VirtualMachineRecordReplayState"] = reflect.TypeOf((*VirtualMachineRecordReplayState)(nil)).Elem() +} + +type VirtualMachineRelocateDiskMoveOptions string + +const ( + VirtualMachineRelocateDiskMoveOptionsMoveAllDiskBackingsAndAllowSharing = VirtualMachineRelocateDiskMoveOptions("moveAllDiskBackingsAndAllowSharing") + VirtualMachineRelocateDiskMoveOptionsMoveAllDiskBackingsAndDisallowSharing = VirtualMachineRelocateDiskMoveOptions("moveAllDiskBackingsAndDisallowSharing") + VirtualMachineRelocateDiskMoveOptionsMoveChildMostDiskBacking = VirtualMachineRelocateDiskMoveOptions("moveChildMostDiskBacking") + VirtualMachineRelocateDiskMoveOptionsCreateNewChildDiskBacking = VirtualMachineRelocateDiskMoveOptions("createNewChildDiskBacking") + VirtualMachineRelocateDiskMoveOptionsMoveAllDiskBackingsAndConsolidate = VirtualMachineRelocateDiskMoveOptions("moveAllDiskBackingsAndConsolidate") +) + +func init() { + t["VirtualMachineRelocateDiskMoveOptions"] = reflect.TypeOf((*VirtualMachineRelocateDiskMoveOptions)(nil)).Elem() +} + +type VirtualMachineRelocateTransformation string + +const ( + VirtualMachineRelocateTransformationFlat = VirtualMachineRelocateTransformation("flat") + VirtualMachineRelocateTransformationSparse = VirtualMachineRelocateTransformation("sparse") +) + +func init() { + t["VirtualMachineRelocateTransformation"] = reflect.TypeOf((*VirtualMachineRelocateTransformation)(nil)).Elem() +} + +type VirtualMachineScsiPassthroughType string + +const ( + VirtualMachineScsiPassthroughTypeDisk = VirtualMachineScsiPassthroughType("disk") + VirtualMachineScsiPassthroughTypeTape = VirtualMachineScsiPassthroughType("tape") + VirtualMachineScsiPassthroughTypePrinter = VirtualMachineScsiPassthroughType("printer") + VirtualMachineScsiPassthroughTypeProcessor = VirtualMachineScsiPassthroughType("processor") + VirtualMachineScsiPassthroughTypeWorm = VirtualMachineScsiPassthroughType("worm") + VirtualMachineScsiPassthroughTypeCdrom = VirtualMachineScsiPassthroughType("cdrom") + VirtualMachineScsiPassthroughTypeScanner = VirtualMachineScsiPassthroughType("scanner") + VirtualMachineScsiPassthroughTypeOptical = VirtualMachineScsiPassthroughType("optical") + VirtualMachineScsiPassthroughTypeMedia = VirtualMachineScsiPassthroughType("media") + VirtualMachineScsiPassthroughTypeCom = VirtualMachineScsiPassthroughType("com") + VirtualMachineScsiPassthroughTypeRaid = VirtualMachineScsiPassthroughType("raid") + VirtualMachineScsiPassthroughTypeUnknown = VirtualMachineScsiPassthroughType("unknown") +) + +func init() { + t["VirtualMachineScsiPassthroughType"] = reflect.TypeOf((*VirtualMachineScsiPassthroughType)(nil)).Elem() +} + +type VirtualMachineStandbyActionType string + +const ( + VirtualMachineStandbyActionTypeCheckpoint = VirtualMachineStandbyActionType("checkpoint") + VirtualMachineStandbyActionTypePowerOnSuspend = VirtualMachineStandbyActionType("powerOnSuspend") +) + +func init() { + t["VirtualMachineStandbyActionType"] = reflect.TypeOf((*VirtualMachineStandbyActionType)(nil)).Elem() +} + +type VirtualMachineTargetInfoConfigurationTag string + +const ( + VirtualMachineTargetInfoConfigurationTagCompliant = VirtualMachineTargetInfoConfigurationTag("compliant") + VirtualMachineTargetInfoConfigurationTagClusterWide = VirtualMachineTargetInfoConfigurationTag("clusterWide") +) + +func init() { + t["VirtualMachineTargetInfoConfigurationTag"] = reflect.TypeOf((*VirtualMachineTargetInfoConfigurationTag)(nil)).Elem() +} + +type VirtualMachineTicketType string + +const ( + VirtualMachineTicketTypeMks = VirtualMachineTicketType("mks") + VirtualMachineTicketTypeDevice = VirtualMachineTicketType("device") + VirtualMachineTicketTypeGuestControl = VirtualMachineTicketType("guestControl") + VirtualMachineTicketTypeWebmks = VirtualMachineTicketType("webmks") +) + +func init() { + t["VirtualMachineTicketType"] = reflect.TypeOf((*VirtualMachineTicketType)(nil)).Elem() +} + +type VirtualMachineToolsRunningStatus string + +const ( + VirtualMachineToolsRunningStatusGuestToolsNotRunning = VirtualMachineToolsRunningStatus("guestToolsNotRunning") + VirtualMachineToolsRunningStatusGuestToolsRunning = VirtualMachineToolsRunningStatus("guestToolsRunning") + VirtualMachineToolsRunningStatusGuestToolsExecutingScripts = VirtualMachineToolsRunningStatus("guestToolsExecutingScripts") +) + +func init() { + t["VirtualMachineToolsRunningStatus"] = reflect.TypeOf((*VirtualMachineToolsRunningStatus)(nil)).Elem() +} + +type VirtualMachineToolsStatus string + +const ( + VirtualMachineToolsStatusToolsNotInstalled = VirtualMachineToolsStatus("toolsNotInstalled") + VirtualMachineToolsStatusToolsNotRunning = VirtualMachineToolsStatus("toolsNotRunning") + VirtualMachineToolsStatusToolsOld = VirtualMachineToolsStatus("toolsOld") + VirtualMachineToolsStatusToolsOk = VirtualMachineToolsStatus("toolsOk") +) + +func init() { + t["VirtualMachineToolsStatus"] = reflect.TypeOf((*VirtualMachineToolsStatus)(nil)).Elem() +} + +type VirtualMachineToolsVersionStatus string + +const ( + VirtualMachineToolsVersionStatusGuestToolsNotInstalled = VirtualMachineToolsVersionStatus("guestToolsNotInstalled") + VirtualMachineToolsVersionStatusGuestToolsNeedUpgrade = VirtualMachineToolsVersionStatus("guestToolsNeedUpgrade") + VirtualMachineToolsVersionStatusGuestToolsCurrent = VirtualMachineToolsVersionStatus("guestToolsCurrent") + VirtualMachineToolsVersionStatusGuestToolsUnmanaged = VirtualMachineToolsVersionStatus("guestToolsUnmanaged") + VirtualMachineToolsVersionStatusGuestToolsTooOld = VirtualMachineToolsVersionStatus("guestToolsTooOld") + VirtualMachineToolsVersionStatusGuestToolsSupportedOld = VirtualMachineToolsVersionStatus("guestToolsSupportedOld") + VirtualMachineToolsVersionStatusGuestToolsSupportedNew = VirtualMachineToolsVersionStatus("guestToolsSupportedNew") + VirtualMachineToolsVersionStatusGuestToolsTooNew = VirtualMachineToolsVersionStatus("guestToolsTooNew") + VirtualMachineToolsVersionStatusGuestToolsBlacklisted = VirtualMachineToolsVersionStatus("guestToolsBlacklisted") +) + +func init() { + t["VirtualMachineToolsVersionStatus"] = reflect.TypeOf((*VirtualMachineToolsVersionStatus)(nil)).Elem() +} + +type VirtualMachineUsbInfoFamily string + +const ( + VirtualMachineUsbInfoFamilyAudio = VirtualMachineUsbInfoFamily("audio") + VirtualMachineUsbInfoFamilyHid = VirtualMachineUsbInfoFamily("hid") + VirtualMachineUsbInfoFamilyHid_bootable = VirtualMachineUsbInfoFamily("hid_bootable") + VirtualMachineUsbInfoFamilyPhysical = VirtualMachineUsbInfoFamily("physical") + VirtualMachineUsbInfoFamilyCommunication = VirtualMachineUsbInfoFamily("communication") + VirtualMachineUsbInfoFamilyImaging = VirtualMachineUsbInfoFamily("imaging") + VirtualMachineUsbInfoFamilyPrinter = VirtualMachineUsbInfoFamily("printer") + VirtualMachineUsbInfoFamilyStorage = VirtualMachineUsbInfoFamily("storage") + VirtualMachineUsbInfoFamilyHub = VirtualMachineUsbInfoFamily("hub") + VirtualMachineUsbInfoFamilySmart_card = VirtualMachineUsbInfoFamily("smart_card") + VirtualMachineUsbInfoFamilySecurity = VirtualMachineUsbInfoFamily("security") + VirtualMachineUsbInfoFamilyVideo = VirtualMachineUsbInfoFamily("video") + VirtualMachineUsbInfoFamilyWireless = VirtualMachineUsbInfoFamily("wireless") + VirtualMachineUsbInfoFamilyBluetooth = VirtualMachineUsbInfoFamily("bluetooth") + VirtualMachineUsbInfoFamilyWusb = VirtualMachineUsbInfoFamily("wusb") + VirtualMachineUsbInfoFamilyPda = VirtualMachineUsbInfoFamily("pda") + VirtualMachineUsbInfoFamilyVendor_specific = VirtualMachineUsbInfoFamily("vendor_specific") + VirtualMachineUsbInfoFamilyOther = VirtualMachineUsbInfoFamily("other") + VirtualMachineUsbInfoFamilyUnknownFamily = VirtualMachineUsbInfoFamily("unknownFamily") +) + +func init() { + t["VirtualMachineUsbInfoFamily"] = reflect.TypeOf((*VirtualMachineUsbInfoFamily)(nil)).Elem() +} + +type VirtualMachineUsbInfoSpeed string + +const ( + VirtualMachineUsbInfoSpeedLow = VirtualMachineUsbInfoSpeed("low") + VirtualMachineUsbInfoSpeedFull = VirtualMachineUsbInfoSpeed("full") + VirtualMachineUsbInfoSpeedHigh = VirtualMachineUsbInfoSpeed("high") + VirtualMachineUsbInfoSpeedSuperSpeed = VirtualMachineUsbInfoSpeed("superSpeed") + VirtualMachineUsbInfoSpeedUnknownSpeed = VirtualMachineUsbInfoSpeed("unknownSpeed") +) + +func init() { + t["VirtualMachineUsbInfoSpeed"] = reflect.TypeOf((*VirtualMachineUsbInfoSpeed)(nil)).Elem() +} + +type VirtualMachineVMCIDeviceAction string + +const ( + VirtualMachineVMCIDeviceActionAllow = VirtualMachineVMCIDeviceAction("allow") + VirtualMachineVMCIDeviceActionDeny = VirtualMachineVMCIDeviceAction("deny") +) + +func init() { + t["VirtualMachineVMCIDeviceAction"] = reflect.TypeOf((*VirtualMachineVMCIDeviceAction)(nil)).Elem() +} + +type VirtualMachineVMCIDeviceDirection string + +const ( + VirtualMachineVMCIDeviceDirectionGuest = VirtualMachineVMCIDeviceDirection("guest") + VirtualMachineVMCIDeviceDirectionHost = VirtualMachineVMCIDeviceDirection("host") + VirtualMachineVMCIDeviceDirectionAnyDirection = VirtualMachineVMCIDeviceDirection("anyDirection") +) + +func init() { + t["VirtualMachineVMCIDeviceDirection"] = reflect.TypeOf((*VirtualMachineVMCIDeviceDirection)(nil)).Elem() +} + +type VirtualMachineVMCIDeviceProtocol string + +const ( + VirtualMachineVMCIDeviceProtocolHypervisor = VirtualMachineVMCIDeviceProtocol("hypervisor") + VirtualMachineVMCIDeviceProtocolDoorbell = VirtualMachineVMCIDeviceProtocol("doorbell") + VirtualMachineVMCIDeviceProtocolQueuepair = VirtualMachineVMCIDeviceProtocol("queuepair") + VirtualMachineVMCIDeviceProtocolDatagram = VirtualMachineVMCIDeviceProtocol("datagram") + VirtualMachineVMCIDeviceProtocolStream = VirtualMachineVMCIDeviceProtocol("stream") + VirtualMachineVMCIDeviceProtocolAnyProtocol = VirtualMachineVMCIDeviceProtocol("anyProtocol") +) + +func init() { + t["VirtualMachineVMCIDeviceProtocol"] = reflect.TypeOf((*VirtualMachineVMCIDeviceProtocol)(nil)).Elem() +} + +type VirtualMachineVideoCardUse3dRenderer string + +const ( + VirtualMachineVideoCardUse3dRendererAutomatic = VirtualMachineVideoCardUse3dRenderer("automatic") + VirtualMachineVideoCardUse3dRendererSoftware = VirtualMachineVideoCardUse3dRenderer("software") + VirtualMachineVideoCardUse3dRendererHardware = VirtualMachineVideoCardUse3dRenderer("hardware") +) + +func init() { + t["VirtualMachineVideoCardUse3dRenderer"] = reflect.TypeOf((*VirtualMachineVideoCardUse3dRenderer)(nil)).Elem() +} + +type VirtualPointingDeviceHostChoice string + +const ( + VirtualPointingDeviceHostChoiceAutodetect = VirtualPointingDeviceHostChoice("autodetect") + VirtualPointingDeviceHostChoiceIntellimouseExplorer = VirtualPointingDeviceHostChoice("intellimouseExplorer") + VirtualPointingDeviceHostChoiceIntellimousePs2 = VirtualPointingDeviceHostChoice("intellimousePs2") + VirtualPointingDeviceHostChoiceLogitechMouseman = VirtualPointingDeviceHostChoice("logitechMouseman") + VirtualPointingDeviceHostChoiceMicrosoft_serial = VirtualPointingDeviceHostChoice("microsoft_serial") + VirtualPointingDeviceHostChoiceMouseSystems = VirtualPointingDeviceHostChoice("mouseSystems") + VirtualPointingDeviceHostChoiceMousemanSerial = VirtualPointingDeviceHostChoice("mousemanSerial") + VirtualPointingDeviceHostChoicePs2 = VirtualPointingDeviceHostChoice("ps2") +) + +func init() { + t["VirtualPointingDeviceHostChoice"] = reflect.TypeOf((*VirtualPointingDeviceHostChoice)(nil)).Elem() +} + +type VirtualSCSISharing string + +const ( + VirtualSCSISharingNoSharing = VirtualSCSISharing("noSharing") + VirtualSCSISharingVirtualSharing = VirtualSCSISharing("virtualSharing") + VirtualSCSISharingPhysicalSharing = VirtualSCSISharing("physicalSharing") +) + +func init() { + t["VirtualSCSISharing"] = reflect.TypeOf((*VirtualSCSISharing)(nil)).Elem() +} + +type VirtualSerialPortEndPoint string + +const ( + VirtualSerialPortEndPointClient = VirtualSerialPortEndPoint("client") + VirtualSerialPortEndPointServer = VirtualSerialPortEndPoint("server") +) + +func init() { + t["VirtualSerialPortEndPoint"] = reflect.TypeOf((*VirtualSerialPortEndPoint)(nil)).Elem() +} + +type VmDasBeingResetEventReasonCode string + +const ( + VmDasBeingResetEventReasonCodeVmtoolsHeartbeatFailure = VmDasBeingResetEventReasonCode("vmtoolsHeartbeatFailure") + VmDasBeingResetEventReasonCodeAppHeartbeatFailure = VmDasBeingResetEventReasonCode("appHeartbeatFailure") + VmDasBeingResetEventReasonCodeAppImmediateResetRequest = VmDasBeingResetEventReasonCode("appImmediateResetRequest") + VmDasBeingResetEventReasonCodeVmcpResetApdCleared = VmDasBeingResetEventReasonCode("vmcpResetApdCleared") +) + +func init() { + t["VmDasBeingResetEventReasonCode"] = reflect.TypeOf((*VmDasBeingResetEventReasonCode)(nil)).Elem() +} + +type VmFailedStartingSecondaryEventFailureReason string + +const ( + VmFailedStartingSecondaryEventFailureReasonIncompatibleHost = VmFailedStartingSecondaryEventFailureReason("incompatibleHost") + VmFailedStartingSecondaryEventFailureReasonLoginFailed = VmFailedStartingSecondaryEventFailureReason("loginFailed") + VmFailedStartingSecondaryEventFailureReasonRegisterVmFailed = VmFailedStartingSecondaryEventFailureReason("registerVmFailed") + VmFailedStartingSecondaryEventFailureReasonMigrateFailed = VmFailedStartingSecondaryEventFailureReason("migrateFailed") +) + +func init() { + t["VmFailedStartingSecondaryEventFailureReason"] = reflect.TypeOf((*VmFailedStartingSecondaryEventFailureReason)(nil)).Elem() +} + +type VmFaultToleranceConfigIssueReasonForIssue string + +const ( + VmFaultToleranceConfigIssueReasonForIssueHaNotEnabled = VmFaultToleranceConfigIssueReasonForIssue("haNotEnabled") + VmFaultToleranceConfigIssueReasonForIssueMoreThanOneSecondary = VmFaultToleranceConfigIssueReasonForIssue("moreThanOneSecondary") + VmFaultToleranceConfigIssueReasonForIssueRecordReplayNotSupported = VmFaultToleranceConfigIssueReasonForIssue("recordReplayNotSupported") + VmFaultToleranceConfigIssueReasonForIssueReplayNotSupported = VmFaultToleranceConfigIssueReasonForIssue("replayNotSupported") + VmFaultToleranceConfigIssueReasonForIssueTemplateVm = VmFaultToleranceConfigIssueReasonForIssue("templateVm") + VmFaultToleranceConfigIssueReasonForIssueMultipleVCPU = VmFaultToleranceConfigIssueReasonForIssue("multipleVCPU") + VmFaultToleranceConfigIssueReasonForIssueHostInactive = VmFaultToleranceConfigIssueReasonForIssue("hostInactive") + VmFaultToleranceConfigIssueReasonForIssueFtUnsupportedHardware = VmFaultToleranceConfigIssueReasonForIssue("ftUnsupportedHardware") + VmFaultToleranceConfigIssueReasonForIssueFtUnsupportedProduct = VmFaultToleranceConfigIssueReasonForIssue("ftUnsupportedProduct") + VmFaultToleranceConfigIssueReasonForIssueMissingVMotionNic = VmFaultToleranceConfigIssueReasonForIssue("missingVMotionNic") + VmFaultToleranceConfigIssueReasonForIssueMissingFTLoggingNic = VmFaultToleranceConfigIssueReasonForIssue("missingFTLoggingNic") + VmFaultToleranceConfigIssueReasonForIssueThinDisk = VmFaultToleranceConfigIssueReasonForIssue("thinDisk") + VmFaultToleranceConfigIssueReasonForIssueVerifySSLCertificateFlagNotSet = VmFaultToleranceConfigIssueReasonForIssue("verifySSLCertificateFlagNotSet") + VmFaultToleranceConfigIssueReasonForIssueHasSnapshots = VmFaultToleranceConfigIssueReasonForIssue("hasSnapshots") + VmFaultToleranceConfigIssueReasonForIssueNoConfig = VmFaultToleranceConfigIssueReasonForIssue("noConfig") + VmFaultToleranceConfigIssueReasonForIssueFtSecondaryVm = VmFaultToleranceConfigIssueReasonForIssue("ftSecondaryVm") + VmFaultToleranceConfigIssueReasonForIssueHasLocalDisk = VmFaultToleranceConfigIssueReasonForIssue("hasLocalDisk") + VmFaultToleranceConfigIssueReasonForIssueEsxAgentVm = VmFaultToleranceConfigIssueReasonForIssue("esxAgentVm") + VmFaultToleranceConfigIssueReasonForIssueVideo3dEnabled = VmFaultToleranceConfigIssueReasonForIssue("video3dEnabled") + VmFaultToleranceConfigIssueReasonForIssueHasUnsupportedDisk = VmFaultToleranceConfigIssueReasonForIssue("hasUnsupportedDisk") + VmFaultToleranceConfigIssueReasonForIssueInsufficientBandwidth = VmFaultToleranceConfigIssueReasonForIssue("insufficientBandwidth") + VmFaultToleranceConfigIssueReasonForIssueHasNestedHVConfiguration = VmFaultToleranceConfigIssueReasonForIssue("hasNestedHVConfiguration") + VmFaultToleranceConfigIssueReasonForIssueHasVFlashConfiguration = VmFaultToleranceConfigIssueReasonForIssue("hasVFlashConfiguration") + VmFaultToleranceConfigIssueReasonForIssueUnsupportedProduct = VmFaultToleranceConfigIssueReasonForIssue("unsupportedProduct") + VmFaultToleranceConfigIssueReasonForIssueCpuHvUnsupported = VmFaultToleranceConfigIssueReasonForIssue("cpuHvUnsupported") + VmFaultToleranceConfigIssueReasonForIssueCpuHwmmuUnsupported = VmFaultToleranceConfigIssueReasonForIssue("cpuHwmmuUnsupported") + VmFaultToleranceConfigIssueReasonForIssueCpuHvDisabled = VmFaultToleranceConfigIssueReasonForIssue("cpuHvDisabled") + VmFaultToleranceConfigIssueReasonForIssueHasEFIFirmware = VmFaultToleranceConfigIssueReasonForIssue("hasEFIFirmware") +) + +func init() { + t["VmFaultToleranceConfigIssueReasonForIssue"] = reflect.TypeOf((*VmFaultToleranceConfigIssueReasonForIssue)(nil)).Elem() +} + +type VmFaultToleranceInvalidFileBackingDeviceType string + +const ( + VmFaultToleranceInvalidFileBackingDeviceTypeVirtualFloppy = VmFaultToleranceInvalidFileBackingDeviceType("virtualFloppy") + VmFaultToleranceInvalidFileBackingDeviceTypeVirtualCdrom = VmFaultToleranceInvalidFileBackingDeviceType("virtualCdrom") + VmFaultToleranceInvalidFileBackingDeviceTypeVirtualSerialPort = VmFaultToleranceInvalidFileBackingDeviceType("virtualSerialPort") + VmFaultToleranceInvalidFileBackingDeviceTypeVirtualParallelPort = VmFaultToleranceInvalidFileBackingDeviceType("virtualParallelPort") + VmFaultToleranceInvalidFileBackingDeviceTypeVirtualDisk = VmFaultToleranceInvalidFileBackingDeviceType("virtualDisk") +) + +func init() { + t["VmFaultToleranceInvalidFileBackingDeviceType"] = reflect.TypeOf((*VmFaultToleranceInvalidFileBackingDeviceType)(nil)).Elem() +} + +type VmShutdownOnIsolationEventOperation string + +const ( + VmShutdownOnIsolationEventOperationShutdown = VmShutdownOnIsolationEventOperation("shutdown") + VmShutdownOnIsolationEventOperationPoweredOff = VmShutdownOnIsolationEventOperation("poweredOff") +) + +func init() { + t["VmShutdownOnIsolationEventOperation"] = reflect.TypeOf((*VmShutdownOnIsolationEventOperation)(nil)).Elem() +} + +type VmwareDistributedVirtualSwitchPvlanPortType string + +const ( + VmwareDistributedVirtualSwitchPvlanPortTypePromiscuous = VmwareDistributedVirtualSwitchPvlanPortType("promiscuous") + VmwareDistributedVirtualSwitchPvlanPortTypeIsolated = VmwareDistributedVirtualSwitchPvlanPortType("isolated") + VmwareDistributedVirtualSwitchPvlanPortTypeCommunity = VmwareDistributedVirtualSwitchPvlanPortType("community") +) + +func init() { + t["VmwareDistributedVirtualSwitchPvlanPortType"] = reflect.TypeOf((*VmwareDistributedVirtualSwitchPvlanPortType)(nil)).Elem() +} + +type VsanDiskIssueType string + +const ( + VsanDiskIssueTypeNonExist = VsanDiskIssueType("nonExist") + VsanDiskIssueTypeStampMismatch = VsanDiskIssueType("stampMismatch") + VsanDiskIssueTypeUnknown = VsanDiskIssueType("unknown") +) + +func init() { + t["VsanDiskIssueType"] = reflect.TypeOf((*VsanDiskIssueType)(nil)).Elem() +} + +type VsanHostDecommissionModeObjectAction string + +const ( + VsanHostDecommissionModeObjectActionNoAction = VsanHostDecommissionModeObjectAction("noAction") + VsanHostDecommissionModeObjectActionEnsureObjectAccessibility = VsanHostDecommissionModeObjectAction("ensureObjectAccessibility") + VsanHostDecommissionModeObjectActionEvacuateAllData = VsanHostDecommissionModeObjectAction("evacuateAllData") +) + +func init() { + t["VsanHostDecommissionModeObjectAction"] = reflect.TypeOf((*VsanHostDecommissionModeObjectAction)(nil)).Elem() +} + +type VsanHostDiskResultState string + +const ( + VsanHostDiskResultStateInUse = VsanHostDiskResultState("inUse") + VsanHostDiskResultStateEligible = VsanHostDiskResultState("eligible") + VsanHostDiskResultStateIneligible = VsanHostDiskResultState("ineligible") +) + +func init() { + t["VsanHostDiskResultState"] = reflect.TypeOf((*VsanHostDiskResultState)(nil)).Elem() +} + +type VsanHostHealthState string + +const ( + VsanHostHealthStateUnknown = VsanHostHealthState("unknown") + VsanHostHealthStateHealthy = VsanHostHealthState("healthy") + VsanHostHealthStateUnhealthy = VsanHostHealthState("unhealthy") +) + +func init() { + t["VsanHostHealthState"] = reflect.TypeOf((*VsanHostHealthState)(nil)).Elem() +} + +type VsanHostNodeState string + +const ( + VsanHostNodeStateError = VsanHostNodeState("error") + VsanHostNodeStateDisabled = VsanHostNodeState("disabled") + VsanHostNodeStateAgent = VsanHostNodeState("agent") + VsanHostNodeStateMaster = VsanHostNodeState("master") + VsanHostNodeStateBackup = VsanHostNodeState("backup") + VsanHostNodeStateStarting = VsanHostNodeState("starting") + VsanHostNodeStateStopping = VsanHostNodeState("stopping") + VsanHostNodeStateEnteringMaintenanceMode = VsanHostNodeState("enteringMaintenanceMode") + VsanHostNodeStateExitingMaintenanceMode = VsanHostNodeState("exitingMaintenanceMode") + VsanHostNodeStateDecommissioning = VsanHostNodeState("decommissioning") +) + +func init() { + t["VsanHostNodeState"] = reflect.TypeOf((*VsanHostNodeState)(nil)).Elem() +} + +type VsanUpgradeSystemUpgradeHistoryDiskGroupOpType string + +const ( + VsanUpgradeSystemUpgradeHistoryDiskGroupOpTypeAdd = VsanUpgradeSystemUpgradeHistoryDiskGroupOpType("add") + VsanUpgradeSystemUpgradeHistoryDiskGroupOpTypeRemove = VsanUpgradeSystemUpgradeHistoryDiskGroupOpType("remove") +) + +func init() { + t["VsanUpgradeSystemUpgradeHistoryDiskGroupOpType"] = reflect.TypeOf((*VsanUpgradeSystemUpgradeHistoryDiskGroupOpType)(nil)).Elem() +} + +type WeekOfMonth string + +const ( + WeekOfMonthFirst = WeekOfMonth("first") + WeekOfMonthSecond = WeekOfMonth("second") + WeekOfMonthThird = WeekOfMonth("third") + WeekOfMonthFourth = WeekOfMonth("fourth") + WeekOfMonthLast = WeekOfMonth("last") +) + +func init() { + t["WeekOfMonth"] = reflect.TypeOf((*WeekOfMonth)(nil)).Elem() +} + +type WillLoseHAProtectionResolution string + +const ( + WillLoseHAProtectionResolutionSvmotion = WillLoseHAProtectionResolution("svmotion") + WillLoseHAProtectionResolutionRelocate = WillLoseHAProtectionResolution("relocate") +) + +func init() { + t["WillLoseHAProtectionResolution"] = reflect.TypeOf((*WillLoseHAProtectionResolution)(nil)).Elem() +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/vim25/types/fault.go juju-core-2.0.2/src/github.com/vmware/govmomi/vim25/types/fault.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/vim25/types/fault.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/vim25/types/fault.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,32 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package types + +type HasFault interface { + Fault() BaseMethodFault +} + +func IsFileNotFound(err error) bool { + if f, ok := err.(HasFault); ok { + switch f.Fault().(type) { + case *FileNotFound: + return true + } + } + + return false +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/vim25/types/helpers.go juju-core-2.0.2/src/github.com/vmware/govmomi/vim25/types/helpers.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/vim25/types/helpers.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/vim25/types/helpers.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,48 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package types + +import "strings" + +func NewBool(v bool) *bool { + return &v +} + +func NewReference(r ManagedObjectReference) *ManagedObjectReference { + return &r +} + +func (r ManagedObjectReference) Reference() ManagedObjectReference { + return r +} + +func (r ManagedObjectReference) String() string { + return strings.Join([]string{r.Type, r.Value}, ":") +} + +func (r *ManagedObjectReference) FromString(o string) bool { + s := strings.SplitN(o, ":", 2) + + if len(s) < 2 { + return false + } + + r.Type = s[0] + r.Value = s[1] + + return true +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/vim25/types/if.go juju-core-2.0.2/src/github.com/vmware/govmomi/vim25/types/if.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/vim25/types/if.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/vim25/types/if.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,3287 @@ +/* +Copyright (c) 2014-2016 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package types + +import "reflect" + +func (b *Action) GetAction() *Action { return b } + +type BaseAction interface { + GetAction() *Action +} + +func init() { + t["BaseAction"] = reflect.TypeOf((*Action)(nil)).Elem() +} + +func (b *ActiveDirectoryFault) GetActiveDirectoryFault() *ActiveDirectoryFault { return b } + +type BaseActiveDirectoryFault interface { + GetActiveDirectoryFault() *ActiveDirectoryFault +} + +func init() { + t["BaseActiveDirectoryFault"] = reflect.TypeOf((*ActiveDirectoryFault)(nil)).Elem() +} + +func (b *AlarmAction) GetAlarmAction() *AlarmAction { return b } + +type BaseAlarmAction interface { + GetAlarmAction() *AlarmAction +} + +func init() { + t["BaseAlarmAction"] = reflect.TypeOf((*AlarmAction)(nil)).Elem() +} + +func (b *AlarmEvent) GetAlarmEvent() *AlarmEvent { return b } + +type BaseAlarmEvent interface { + GetAlarmEvent() *AlarmEvent +} + +func init() { + t["BaseAlarmEvent"] = reflect.TypeOf((*AlarmEvent)(nil)).Elem() +} + +func (b *AlarmExpression) GetAlarmExpression() *AlarmExpression { return b } + +type BaseAlarmExpression interface { + GetAlarmExpression() *AlarmExpression +} + +func init() { + t["BaseAlarmExpression"] = reflect.TypeOf((*AlarmExpression)(nil)).Elem() +} + +func (b *AlarmSpec) GetAlarmSpec() *AlarmSpec { return b } + +type BaseAlarmSpec interface { + GetAlarmSpec() *AlarmSpec +} + +func init() { + t["BaseAlarmSpec"] = reflect.TypeOf((*AlarmSpec)(nil)).Elem() +} + +func (b *AnswerFileCreateSpec) GetAnswerFileCreateSpec() *AnswerFileCreateSpec { return b } + +type BaseAnswerFileCreateSpec interface { + GetAnswerFileCreateSpec() *AnswerFileCreateSpec +} + +func init() { + t["BaseAnswerFileCreateSpec"] = reflect.TypeOf((*AnswerFileCreateSpec)(nil)).Elem() +} + +func (b *ApplyProfile) GetApplyProfile() *ApplyProfile { return b } + +type BaseApplyProfile interface { + GetApplyProfile() *ApplyProfile +} + +func init() { + t["BaseApplyProfile"] = reflect.TypeOf((*ApplyProfile)(nil)).Elem() +} + +func (b *ArrayUpdateSpec) GetArrayUpdateSpec() *ArrayUpdateSpec { return b } + +type BaseArrayUpdateSpec interface { + GetArrayUpdateSpec() *ArrayUpdateSpec +} + +func init() { + t["BaseArrayUpdateSpec"] = reflect.TypeOf((*ArrayUpdateSpec)(nil)).Elem() +} + +func (b *AuthorizationEvent) GetAuthorizationEvent() *AuthorizationEvent { return b } + +type BaseAuthorizationEvent interface { + GetAuthorizationEvent() *AuthorizationEvent +} + +func init() { + t["BaseAuthorizationEvent"] = reflect.TypeOf((*AuthorizationEvent)(nil)).Elem() +} + +func (b *CannotAccessNetwork) GetCannotAccessNetwork() *CannotAccessNetwork { return b } + +type BaseCannotAccessNetwork interface { + GetCannotAccessNetwork() *CannotAccessNetwork +} + +func init() { + t["BaseCannotAccessNetwork"] = reflect.TypeOf((*CannotAccessNetwork)(nil)).Elem() +} + +func (b *CannotAccessVmComponent) GetCannotAccessVmComponent() *CannotAccessVmComponent { return b } + +type BaseCannotAccessVmComponent interface { + GetCannotAccessVmComponent() *CannotAccessVmComponent +} + +func init() { + t["BaseCannotAccessVmComponent"] = reflect.TypeOf((*CannotAccessVmComponent)(nil)).Elem() +} + +func (b *CannotAccessVmDevice) GetCannotAccessVmDevice() *CannotAccessVmDevice { return b } + +type BaseCannotAccessVmDevice interface { + GetCannotAccessVmDevice() *CannotAccessVmDevice +} + +func init() { + t["BaseCannotAccessVmDevice"] = reflect.TypeOf((*CannotAccessVmDevice)(nil)).Elem() +} + +func (b *CannotAccessVmDisk) GetCannotAccessVmDisk() *CannotAccessVmDisk { return b } + +type BaseCannotAccessVmDisk interface { + GetCannotAccessVmDisk() *CannotAccessVmDisk +} + +func init() { + t["BaseCannotAccessVmDisk"] = reflect.TypeOf((*CannotAccessVmDisk)(nil)).Elem() +} + +func (b *CannotMoveVsanEnabledHost) GetCannotMoveVsanEnabledHost() *CannotMoveVsanEnabledHost { + return b +} + +type BaseCannotMoveVsanEnabledHost interface { + GetCannotMoveVsanEnabledHost() *CannotMoveVsanEnabledHost +} + +func init() { + t["BaseCannotMoveVsanEnabledHost"] = reflect.TypeOf((*CannotMoveVsanEnabledHost)(nil)).Elem() +} + +func (b *ClusterAction) GetClusterAction() *ClusterAction { return b } + +type BaseClusterAction interface { + GetClusterAction() *ClusterAction +} + +func init() { + t["BaseClusterAction"] = reflect.TypeOf((*ClusterAction)(nil)).Elem() +} + +func (b *ClusterDasAdmissionControlInfo) GetClusterDasAdmissionControlInfo() *ClusterDasAdmissionControlInfo { + return b +} + +type BaseClusterDasAdmissionControlInfo interface { + GetClusterDasAdmissionControlInfo() *ClusterDasAdmissionControlInfo +} + +func init() { + t["BaseClusterDasAdmissionControlInfo"] = reflect.TypeOf((*ClusterDasAdmissionControlInfo)(nil)).Elem() +} + +func (b *ClusterDasAdmissionControlPolicy) GetClusterDasAdmissionControlPolicy() *ClusterDasAdmissionControlPolicy { + return b +} + +type BaseClusterDasAdmissionControlPolicy interface { + GetClusterDasAdmissionControlPolicy() *ClusterDasAdmissionControlPolicy +} + +func init() { + t["BaseClusterDasAdmissionControlPolicy"] = reflect.TypeOf((*ClusterDasAdmissionControlPolicy)(nil)).Elem() +} + +func (b *ClusterDasAdvancedRuntimeInfo) GetClusterDasAdvancedRuntimeInfo() *ClusterDasAdvancedRuntimeInfo { + return b +} + +type BaseClusterDasAdvancedRuntimeInfo interface { + GetClusterDasAdvancedRuntimeInfo() *ClusterDasAdvancedRuntimeInfo +} + +func init() { + t["BaseClusterDasAdvancedRuntimeInfo"] = reflect.TypeOf((*ClusterDasAdvancedRuntimeInfo)(nil)).Elem() +} + +func (b *ClusterDasData) GetClusterDasData() *ClusterDasData { return b } + +type BaseClusterDasData interface { + GetClusterDasData() *ClusterDasData +} + +func init() { + t["BaseClusterDasData"] = reflect.TypeOf((*ClusterDasData)(nil)).Elem() +} + +func (b *ClusterDasHostInfo) GetClusterDasHostInfo() *ClusterDasHostInfo { return b } + +type BaseClusterDasHostInfo interface { + GetClusterDasHostInfo() *ClusterDasHostInfo +} + +func init() { + t["BaseClusterDasHostInfo"] = reflect.TypeOf((*ClusterDasHostInfo)(nil)).Elem() +} + +func (b *ClusterDrsFaultsFaultsByVm) GetClusterDrsFaultsFaultsByVm() *ClusterDrsFaultsFaultsByVm { + return b +} + +type BaseClusterDrsFaultsFaultsByVm interface { + GetClusterDrsFaultsFaultsByVm() *ClusterDrsFaultsFaultsByVm +} + +func init() { + t["BaseClusterDrsFaultsFaultsByVm"] = reflect.TypeOf((*ClusterDrsFaultsFaultsByVm)(nil)).Elem() +} + +func (b *ClusterEvent) GetClusterEvent() *ClusterEvent { return b } + +type BaseClusterEvent interface { + GetClusterEvent() *ClusterEvent +} + +func init() { + t["BaseClusterEvent"] = reflect.TypeOf((*ClusterEvent)(nil)).Elem() +} + +func (b *ClusterGroupInfo) GetClusterGroupInfo() *ClusterGroupInfo { return b } + +type BaseClusterGroupInfo interface { + GetClusterGroupInfo() *ClusterGroupInfo +} + +func init() { + t["BaseClusterGroupInfo"] = reflect.TypeOf((*ClusterGroupInfo)(nil)).Elem() +} + +func (b *ClusterOvercommittedEvent) GetClusterOvercommittedEvent() *ClusterOvercommittedEvent { + return b +} + +type BaseClusterOvercommittedEvent interface { + GetClusterOvercommittedEvent() *ClusterOvercommittedEvent +} + +func init() { + t["BaseClusterOvercommittedEvent"] = reflect.TypeOf((*ClusterOvercommittedEvent)(nil)).Elem() +} + +func (b *ClusterProfileConfigSpec) GetClusterProfileConfigSpec() *ClusterProfileConfigSpec { return b } + +type BaseClusterProfileConfigSpec interface { + GetClusterProfileConfigSpec() *ClusterProfileConfigSpec +} + +func init() { + t["BaseClusterProfileConfigSpec"] = reflect.TypeOf((*ClusterProfileConfigSpec)(nil)).Elem() +} + +func (b *ClusterProfileCreateSpec) GetClusterProfileCreateSpec() *ClusterProfileCreateSpec { return b } + +type BaseClusterProfileCreateSpec interface { + GetClusterProfileCreateSpec() *ClusterProfileCreateSpec +} + +func init() { + t["BaseClusterProfileCreateSpec"] = reflect.TypeOf((*ClusterProfileCreateSpec)(nil)).Elem() +} + +func (b *ClusterRuleInfo) GetClusterRuleInfo() *ClusterRuleInfo { return b } + +type BaseClusterRuleInfo interface { + GetClusterRuleInfo() *ClusterRuleInfo +} + +func init() { + t["BaseClusterRuleInfo"] = reflect.TypeOf((*ClusterRuleInfo)(nil)).Elem() +} + +func (b *ClusterSlotPolicy) GetClusterSlotPolicy() *ClusterSlotPolicy { return b } + +type BaseClusterSlotPolicy interface { + GetClusterSlotPolicy() *ClusterSlotPolicy +} + +func init() { + t["BaseClusterSlotPolicy"] = reflect.TypeOf((*ClusterSlotPolicy)(nil)).Elem() +} + +func (b *ClusterStatusChangedEvent) GetClusterStatusChangedEvent() *ClusterStatusChangedEvent { + return b +} + +type BaseClusterStatusChangedEvent interface { + GetClusterStatusChangedEvent() *ClusterStatusChangedEvent +} + +func init() { + t["BaseClusterStatusChangedEvent"] = reflect.TypeOf((*ClusterStatusChangedEvent)(nil)).Elem() +} + +func (b *ComputeResourceConfigInfo) GetComputeResourceConfigInfo() *ComputeResourceConfigInfo { + return b +} + +type BaseComputeResourceConfigInfo interface { + GetComputeResourceConfigInfo() *ComputeResourceConfigInfo +} + +func init() { + t["BaseComputeResourceConfigInfo"] = reflect.TypeOf((*ComputeResourceConfigInfo)(nil)).Elem() +} + +func (b *ComputeResourceConfigSpec) GetComputeResourceConfigSpec() *ComputeResourceConfigSpec { + return b +} + +type BaseComputeResourceConfigSpec interface { + GetComputeResourceConfigSpec() *ComputeResourceConfigSpec +} + +func init() { + t["BaseComputeResourceConfigSpec"] = reflect.TypeOf((*ComputeResourceConfigSpec)(nil)).Elem() +} + +func (b *ComputeResourceSummary) GetComputeResourceSummary() *ComputeResourceSummary { return b } + +type BaseComputeResourceSummary interface { + GetComputeResourceSummary() *ComputeResourceSummary +} + +func init() { + t["BaseComputeResourceSummary"] = reflect.TypeOf((*ComputeResourceSummary)(nil)).Elem() +} + +func (b *CpuIncompatible) GetCpuIncompatible() *CpuIncompatible { return b } + +type BaseCpuIncompatible interface { + GetCpuIncompatible() *CpuIncompatible +} + +func init() { + t["BaseCpuIncompatible"] = reflect.TypeOf((*CpuIncompatible)(nil)).Elem() +} + +func (b *CustomFieldDefEvent) GetCustomFieldDefEvent() *CustomFieldDefEvent { return b } + +type BaseCustomFieldDefEvent interface { + GetCustomFieldDefEvent() *CustomFieldDefEvent +} + +func init() { + t["BaseCustomFieldDefEvent"] = reflect.TypeOf((*CustomFieldDefEvent)(nil)).Elem() +} + +func (b *CustomFieldEvent) GetCustomFieldEvent() *CustomFieldEvent { return b } + +type BaseCustomFieldEvent interface { + GetCustomFieldEvent() *CustomFieldEvent +} + +func init() { + t["BaseCustomFieldEvent"] = reflect.TypeOf((*CustomFieldEvent)(nil)).Elem() +} + +func (b *CustomFieldValue) GetCustomFieldValue() *CustomFieldValue { return b } + +type BaseCustomFieldValue interface { + GetCustomFieldValue() *CustomFieldValue +} + +func init() { + t["BaseCustomFieldValue"] = reflect.TypeOf((*CustomFieldValue)(nil)).Elem() +} + +func (b *CustomizationEvent) GetCustomizationEvent() *CustomizationEvent { return b } + +type BaseCustomizationEvent interface { + GetCustomizationEvent() *CustomizationEvent +} + +func init() { + t["BaseCustomizationEvent"] = reflect.TypeOf((*CustomizationEvent)(nil)).Elem() +} + +func (b *CustomizationFailed) GetCustomizationFailed() *CustomizationFailed { return b } + +type BaseCustomizationFailed interface { + GetCustomizationFailed() *CustomizationFailed +} + +func init() { + t["BaseCustomizationFailed"] = reflect.TypeOf((*CustomizationFailed)(nil)).Elem() +} + +func (b *CustomizationFault) GetCustomizationFault() *CustomizationFault { return b } + +type BaseCustomizationFault interface { + GetCustomizationFault() *CustomizationFault +} + +func init() { + t["BaseCustomizationFault"] = reflect.TypeOf((*CustomizationFault)(nil)).Elem() +} + +func (b *CustomizationIdentitySettings) GetCustomizationIdentitySettings() *CustomizationIdentitySettings { + return b +} + +type BaseCustomizationIdentitySettings interface { + GetCustomizationIdentitySettings() *CustomizationIdentitySettings +} + +func init() { + t["BaseCustomizationIdentitySettings"] = reflect.TypeOf((*CustomizationIdentitySettings)(nil)).Elem() +} + +func (b *CustomizationIpGenerator) GetCustomizationIpGenerator() *CustomizationIpGenerator { return b } + +type BaseCustomizationIpGenerator interface { + GetCustomizationIpGenerator() *CustomizationIpGenerator +} + +func init() { + t["BaseCustomizationIpGenerator"] = reflect.TypeOf((*CustomizationIpGenerator)(nil)).Elem() +} + +func (b *CustomizationIpV6Generator) GetCustomizationIpV6Generator() *CustomizationIpV6Generator { + return b +} + +type BaseCustomizationIpV6Generator interface { + GetCustomizationIpV6Generator() *CustomizationIpV6Generator +} + +func init() { + t["BaseCustomizationIpV6Generator"] = reflect.TypeOf((*CustomizationIpV6Generator)(nil)).Elem() +} + +func (b *CustomizationName) GetCustomizationName() *CustomizationName { return b } + +type BaseCustomizationName interface { + GetCustomizationName() *CustomizationName +} + +func init() { + t["BaseCustomizationName"] = reflect.TypeOf((*CustomizationName)(nil)).Elem() +} + +func (b *CustomizationOptions) GetCustomizationOptions() *CustomizationOptions { return b } + +type BaseCustomizationOptions interface { + GetCustomizationOptions() *CustomizationOptions +} + +func init() { + t["BaseCustomizationOptions"] = reflect.TypeOf((*CustomizationOptions)(nil)).Elem() +} + +func (b *DVPortSetting) GetDVPortSetting() *DVPortSetting { return b } + +type BaseDVPortSetting interface { + GetDVPortSetting() *DVPortSetting +} + +func init() { + t["BaseDVPortSetting"] = reflect.TypeOf((*DVPortSetting)(nil)).Elem() +} + +func (b *DVPortgroupEvent) GetDVPortgroupEvent() *DVPortgroupEvent { return b } + +type BaseDVPortgroupEvent interface { + GetDVPortgroupEvent() *DVPortgroupEvent +} + +func init() { + t["BaseDVPortgroupEvent"] = reflect.TypeOf((*DVPortgroupEvent)(nil)).Elem() +} + +func (b *DVPortgroupPolicy) GetDVPortgroupPolicy() *DVPortgroupPolicy { return b } + +type BaseDVPortgroupPolicy interface { + GetDVPortgroupPolicy() *DVPortgroupPolicy +} + +func init() { + t["BaseDVPortgroupPolicy"] = reflect.TypeOf((*DVPortgroupPolicy)(nil)).Elem() +} + +func (b *DVSConfigInfo) GetDVSConfigInfo() *DVSConfigInfo { return b } + +type BaseDVSConfigInfo interface { + GetDVSConfigInfo() *DVSConfigInfo +} + +func init() { + t["BaseDVSConfigInfo"] = reflect.TypeOf((*DVSConfigInfo)(nil)).Elem() +} + +func (b *DVSConfigSpec) GetDVSConfigSpec() *DVSConfigSpec { return b } + +type BaseDVSConfigSpec interface { + GetDVSConfigSpec() *DVSConfigSpec +} + +func init() { + t["BaseDVSConfigSpec"] = reflect.TypeOf((*DVSConfigSpec)(nil)).Elem() +} + +func (b *DVSFeatureCapability) GetDVSFeatureCapability() *DVSFeatureCapability { return b } + +type BaseDVSFeatureCapability interface { + GetDVSFeatureCapability() *DVSFeatureCapability +} + +func init() { + t["BaseDVSFeatureCapability"] = reflect.TypeOf((*DVSFeatureCapability)(nil)).Elem() +} + +func (b *DVSHealthCheckCapability) GetDVSHealthCheckCapability() *DVSHealthCheckCapability { return b } + +type BaseDVSHealthCheckCapability interface { + GetDVSHealthCheckCapability() *DVSHealthCheckCapability +} + +func init() { + t["BaseDVSHealthCheckCapability"] = reflect.TypeOf((*DVSHealthCheckCapability)(nil)).Elem() +} + +func (b *DVSHealthCheckConfig) GetDVSHealthCheckConfig() *DVSHealthCheckConfig { return b } + +type BaseDVSHealthCheckConfig interface { + GetDVSHealthCheckConfig() *DVSHealthCheckConfig +} + +func init() { + t["BaseDVSHealthCheckConfig"] = reflect.TypeOf((*DVSHealthCheckConfig)(nil)).Elem() +} + +func (b *DVSUplinkPortPolicy) GetDVSUplinkPortPolicy() *DVSUplinkPortPolicy { return b } + +type BaseDVSUplinkPortPolicy interface { + GetDVSUplinkPortPolicy() *DVSUplinkPortPolicy +} + +func init() { + t["BaseDVSUplinkPortPolicy"] = reflect.TypeOf((*DVSUplinkPortPolicy)(nil)).Elem() +} + +func (b *DailyTaskScheduler) GetDailyTaskScheduler() *DailyTaskScheduler { return b } + +type BaseDailyTaskScheduler interface { + GetDailyTaskScheduler() *DailyTaskScheduler +} + +func init() { + t["BaseDailyTaskScheduler"] = reflect.TypeOf((*DailyTaskScheduler)(nil)).Elem() +} + +func (b *DatacenterEvent) GetDatacenterEvent() *DatacenterEvent { return b } + +type BaseDatacenterEvent interface { + GetDatacenterEvent() *DatacenterEvent +} + +func init() { + t["BaseDatacenterEvent"] = reflect.TypeOf((*DatacenterEvent)(nil)).Elem() +} + +func (b *DatastoreEvent) GetDatastoreEvent() *DatastoreEvent { return b } + +type BaseDatastoreEvent interface { + GetDatastoreEvent() *DatastoreEvent +} + +func init() { + t["BaseDatastoreEvent"] = reflect.TypeOf((*DatastoreEvent)(nil)).Elem() +} + +func (b *DatastoreFileEvent) GetDatastoreFileEvent() *DatastoreFileEvent { return b } + +type BaseDatastoreFileEvent interface { + GetDatastoreFileEvent() *DatastoreFileEvent +} + +func init() { + t["BaseDatastoreFileEvent"] = reflect.TypeOf((*DatastoreFileEvent)(nil)).Elem() +} + +func (b *DatastoreInfo) GetDatastoreInfo() *DatastoreInfo { return b } + +type BaseDatastoreInfo interface { + GetDatastoreInfo() *DatastoreInfo +} + +func init() { + t["BaseDatastoreInfo"] = reflect.TypeOf((*DatastoreInfo)(nil)).Elem() +} + +func (b *DatastoreNotWritableOnHost) GetDatastoreNotWritableOnHost() *DatastoreNotWritableOnHost { + return b +} + +type BaseDatastoreNotWritableOnHost interface { + GetDatastoreNotWritableOnHost() *DatastoreNotWritableOnHost +} + +func init() { + t["BaseDatastoreNotWritableOnHost"] = reflect.TypeOf((*DatastoreNotWritableOnHost)(nil)).Elem() +} + +func (b *Description) GetDescription() *Description { return b } + +type BaseDescription interface { + GetDescription() *Description +} + +func init() { + t["BaseDescription"] = reflect.TypeOf((*Description)(nil)).Elem() +} + +func (b *DeviceBackingNotSupported) GetDeviceBackingNotSupported() *DeviceBackingNotSupported { + return b +} + +type BaseDeviceBackingNotSupported interface { + GetDeviceBackingNotSupported() *DeviceBackingNotSupported +} + +func init() { + t["BaseDeviceBackingNotSupported"] = reflect.TypeOf((*DeviceBackingNotSupported)(nil)).Elem() +} + +func (b *DeviceNotSupported) GetDeviceNotSupported() *DeviceNotSupported { return b } + +type BaseDeviceNotSupported interface { + GetDeviceNotSupported() *DeviceNotSupported +} + +func init() { + t["BaseDeviceNotSupported"] = reflect.TypeOf((*DeviceNotSupported)(nil)).Elem() +} + +func (b *DiskNotSupported) GetDiskNotSupported() *DiskNotSupported { return b } + +type BaseDiskNotSupported interface { + GetDiskNotSupported() *DiskNotSupported +} + +func init() { + t["BaseDiskNotSupported"] = reflect.TypeOf((*DiskNotSupported)(nil)).Elem() +} + +func (b *DistributedVirtualSwitchHostMemberBacking) GetDistributedVirtualSwitchHostMemberBacking() *DistributedVirtualSwitchHostMemberBacking { + return b +} + +type BaseDistributedVirtualSwitchHostMemberBacking interface { + GetDistributedVirtualSwitchHostMemberBacking() *DistributedVirtualSwitchHostMemberBacking +} + +func init() { + t["BaseDistributedVirtualSwitchHostMemberBacking"] = reflect.TypeOf((*DistributedVirtualSwitchHostMemberBacking)(nil)).Elem() +} + +func (b *DistributedVirtualSwitchManagerHostDvsFilterSpec) GetDistributedVirtualSwitchManagerHostDvsFilterSpec() *DistributedVirtualSwitchManagerHostDvsFilterSpec { + return b +} + +type BaseDistributedVirtualSwitchManagerHostDvsFilterSpec interface { + GetDistributedVirtualSwitchManagerHostDvsFilterSpec() *DistributedVirtualSwitchManagerHostDvsFilterSpec +} + +func init() { + t["BaseDistributedVirtualSwitchManagerHostDvsFilterSpec"] = reflect.TypeOf((*DistributedVirtualSwitchManagerHostDvsFilterSpec)(nil)).Elem() +} + +func (b *DvsEvent) GetDvsEvent() *DvsEvent { return b } + +type BaseDvsEvent interface { + GetDvsEvent() *DvsEvent +} + +func init() { + t["BaseDvsEvent"] = reflect.TypeOf((*DvsEvent)(nil)).Elem() +} + +func (b *DvsFault) GetDvsFault() *DvsFault { return b } + +type BaseDvsFault interface { + GetDvsFault() *DvsFault +} + +func init() { + t["BaseDvsFault"] = reflect.TypeOf((*DvsFault)(nil)).Elem() +} + +func (b *DvsFilterConfig) GetDvsFilterConfig() *DvsFilterConfig { return b } + +type BaseDvsFilterConfig interface { + GetDvsFilterConfig() *DvsFilterConfig +} + +func init() { + t["BaseDvsFilterConfig"] = reflect.TypeOf((*DvsFilterConfig)(nil)).Elem() +} + +func (b *DvsHealthStatusChangeEvent) GetDvsHealthStatusChangeEvent() *DvsHealthStatusChangeEvent { + return b +} + +type BaseDvsHealthStatusChangeEvent interface { + GetDvsHealthStatusChangeEvent() *DvsHealthStatusChangeEvent +} + +func init() { + t["BaseDvsHealthStatusChangeEvent"] = reflect.TypeOf((*DvsHealthStatusChangeEvent)(nil)).Elem() +} + +func (b *DvsIpPort) GetDvsIpPort() *DvsIpPort { return b } + +type BaseDvsIpPort interface { + GetDvsIpPort() *DvsIpPort +} + +func init() { + t["BaseDvsIpPort"] = reflect.TypeOf((*DvsIpPort)(nil)).Elem() +} + +func (b *DvsNetworkRuleAction) GetDvsNetworkRuleAction() *DvsNetworkRuleAction { return b } + +type BaseDvsNetworkRuleAction interface { + GetDvsNetworkRuleAction() *DvsNetworkRuleAction +} + +func init() { + t["BaseDvsNetworkRuleAction"] = reflect.TypeOf((*DvsNetworkRuleAction)(nil)).Elem() +} + +func (b *DvsNetworkRuleQualifier) GetDvsNetworkRuleQualifier() *DvsNetworkRuleQualifier { return b } + +type BaseDvsNetworkRuleQualifier interface { + GetDvsNetworkRuleQualifier() *DvsNetworkRuleQualifier +} + +func init() { + t["BaseDvsNetworkRuleQualifier"] = reflect.TypeOf((*DvsNetworkRuleQualifier)(nil)).Elem() +} + +func (b *DvsTrafficFilterConfig) GetDvsTrafficFilterConfig() *DvsTrafficFilterConfig { return b } + +type BaseDvsTrafficFilterConfig interface { + GetDvsTrafficFilterConfig() *DvsTrafficFilterConfig +} + +func init() { + t["BaseDvsTrafficFilterConfig"] = reflect.TypeOf((*DvsTrafficFilterConfig)(nil)).Elem() +} + +func (b *DvsVNicProfile) GetDvsVNicProfile() *DvsVNicProfile { return b } + +type BaseDvsVNicProfile interface { + GetDvsVNicProfile() *DvsVNicProfile +} + +func init() { + t["BaseDvsVNicProfile"] = reflect.TypeOf((*DvsVNicProfile)(nil)).Elem() +} + +func (b *DynamicData) GetDynamicData() *DynamicData { return b } + +type BaseDynamicData interface { + GetDynamicData() *DynamicData +} + +func init() { + t["BaseDynamicData"] = reflect.TypeOf((*DynamicData)(nil)).Elem() +} + +func (b *EVCAdmissionFailed) GetEVCAdmissionFailed() *EVCAdmissionFailed { return b } + +type BaseEVCAdmissionFailed interface { + GetEVCAdmissionFailed() *EVCAdmissionFailed +} + +func init() { + t["BaseEVCAdmissionFailed"] = reflect.TypeOf((*EVCAdmissionFailed)(nil)).Elem() +} + +func (b *EVCConfigFault) GetEVCConfigFault() *EVCConfigFault { return b } + +type BaseEVCConfigFault interface { + GetEVCConfigFault() *EVCConfigFault +} + +func init() { + t["BaseEVCConfigFault"] = reflect.TypeOf((*EVCConfigFault)(nil)).Elem() +} + +func (b *ElementDescription) GetElementDescription() *ElementDescription { return b } + +type BaseElementDescription interface { + GetElementDescription() *ElementDescription +} + +func init() { + t["BaseElementDescription"] = reflect.TypeOf((*ElementDescription)(nil)).Elem() +} + +func (b *EnteredStandbyModeEvent) GetEnteredStandbyModeEvent() *EnteredStandbyModeEvent { return b } + +type BaseEnteredStandbyModeEvent interface { + GetEnteredStandbyModeEvent() *EnteredStandbyModeEvent +} + +func init() { + t["BaseEnteredStandbyModeEvent"] = reflect.TypeOf((*EnteredStandbyModeEvent)(nil)).Elem() +} + +func (b *EnteringStandbyModeEvent) GetEnteringStandbyModeEvent() *EnteringStandbyModeEvent { return b } + +type BaseEnteringStandbyModeEvent interface { + GetEnteringStandbyModeEvent() *EnteringStandbyModeEvent +} + +func init() { + t["BaseEnteringStandbyModeEvent"] = reflect.TypeOf((*EnteringStandbyModeEvent)(nil)).Elem() +} + +func (b *EntityEventArgument) GetEntityEventArgument() *EntityEventArgument { return b } + +type BaseEntityEventArgument interface { + GetEntityEventArgument() *EntityEventArgument +} + +func init() { + t["BaseEntityEventArgument"] = reflect.TypeOf((*EntityEventArgument)(nil)).Elem() +} + +func (b *Event) GetEvent() *Event { return b } + +type BaseEvent interface { + GetEvent() *Event +} + +func init() { + t["BaseEvent"] = reflect.TypeOf((*Event)(nil)).Elem() +} + +func (b *EventArgument) GetEventArgument() *EventArgument { return b } + +type BaseEventArgument interface { + GetEventArgument() *EventArgument +} + +func init() { + t["BaseEventArgument"] = reflect.TypeOf((*EventArgument)(nil)).Elem() +} + +func (b *ExitStandbyModeFailedEvent) GetExitStandbyModeFailedEvent() *ExitStandbyModeFailedEvent { + return b +} + +type BaseExitStandbyModeFailedEvent interface { + GetExitStandbyModeFailedEvent() *ExitStandbyModeFailedEvent +} + +func init() { + t["BaseExitStandbyModeFailedEvent"] = reflect.TypeOf((*ExitStandbyModeFailedEvent)(nil)).Elem() +} + +func (b *ExitedStandbyModeEvent) GetExitedStandbyModeEvent() *ExitedStandbyModeEvent { return b } + +type BaseExitedStandbyModeEvent interface { + GetExitedStandbyModeEvent() *ExitedStandbyModeEvent +} + +func init() { + t["BaseExitedStandbyModeEvent"] = reflect.TypeOf((*ExitedStandbyModeEvent)(nil)).Elem() +} + +func (b *ExitingStandbyModeEvent) GetExitingStandbyModeEvent() *ExitingStandbyModeEvent { return b } + +type BaseExitingStandbyModeEvent interface { + GetExitingStandbyModeEvent() *ExitingStandbyModeEvent +} + +func init() { + t["BaseExitingStandbyModeEvent"] = reflect.TypeOf((*ExitingStandbyModeEvent)(nil)).Elem() +} + +func (b *ExpiredFeatureLicense) GetExpiredFeatureLicense() *ExpiredFeatureLicense { return b } + +type BaseExpiredFeatureLicense interface { + GetExpiredFeatureLicense() *ExpiredFeatureLicense +} + +func init() { + t["BaseExpiredFeatureLicense"] = reflect.TypeOf((*ExpiredFeatureLicense)(nil)).Elem() +} + +func (b *FaultToleranceConfigInfo) GetFaultToleranceConfigInfo() *FaultToleranceConfigInfo { return b } + +type BaseFaultToleranceConfigInfo interface { + GetFaultToleranceConfigInfo() *FaultToleranceConfigInfo +} + +func init() { + t["BaseFaultToleranceConfigInfo"] = reflect.TypeOf((*FaultToleranceConfigInfo)(nil)).Elem() +} + +func (b *FcoeFault) GetFcoeFault() *FcoeFault { return b } + +type BaseFcoeFault interface { + GetFcoeFault() *FcoeFault +} + +func init() { + t["BaseFcoeFault"] = reflect.TypeOf((*FcoeFault)(nil)).Elem() +} + +func (b *FileBackedVirtualDiskSpec) GetFileBackedVirtualDiskSpec() *FileBackedVirtualDiskSpec { + return b +} + +type BaseFileBackedVirtualDiskSpec interface { + GetFileBackedVirtualDiskSpec() *FileBackedVirtualDiskSpec +} + +func init() { + t["BaseFileBackedVirtualDiskSpec"] = reflect.TypeOf((*FileBackedVirtualDiskSpec)(nil)).Elem() +} + +func (b *FileFault) GetFileFault() *FileFault { return b } + +type BaseFileFault interface { + GetFileFault() *FileFault +} + +func init() { + t["BaseFileFault"] = reflect.TypeOf((*FileFault)(nil)).Elem() +} + +func (b *FileInfo) GetFileInfo() *FileInfo { return b } + +type BaseFileInfo interface { + GetFileInfo() *FileInfo +} + +func init() { + t["BaseFileInfo"] = reflect.TypeOf((*FileInfo)(nil)).Elem() +} + +func (b *FileQuery) GetFileQuery() *FileQuery { return b } + +type BaseFileQuery interface { + GetFileQuery() *FileQuery +} + +func init() { + t["BaseFileQuery"] = reflect.TypeOf((*FileQuery)(nil)).Elem() +} + +func (b *GatewayConnectFault) GetGatewayConnectFault() *GatewayConnectFault { return b } + +type BaseGatewayConnectFault interface { + GetGatewayConnectFault() *GatewayConnectFault +} + +func init() { + t["BaseGatewayConnectFault"] = reflect.TypeOf((*GatewayConnectFault)(nil)).Elem() +} + +func (b *GatewayToHostConnectFault) GetGatewayToHostConnectFault() *GatewayToHostConnectFault { + return b +} + +type BaseGatewayToHostConnectFault interface { + GetGatewayToHostConnectFault() *GatewayToHostConnectFault +} + +func init() { + t["BaseGatewayToHostConnectFault"] = reflect.TypeOf((*GatewayToHostConnectFault)(nil)).Elem() +} + +func (b *GeneralEvent) GetGeneralEvent() *GeneralEvent { return b } + +type BaseGeneralEvent interface { + GetGeneralEvent() *GeneralEvent +} + +func init() { + t["BaseGeneralEvent"] = reflect.TypeOf((*GeneralEvent)(nil)).Elem() +} + +func (b *GuestAuthSubject) GetGuestAuthSubject() *GuestAuthSubject { return b } + +type BaseGuestAuthSubject interface { + GetGuestAuthSubject() *GuestAuthSubject +} + +func init() { + t["BaseGuestAuthSubject"] = reflect.TypeOf((*GuestAuthSubject)(nil)).Elem() +} + +func (b *GuestAuthentication) GetGuestAuthentication() *GuestAuthentication { return b } + +type BaseGuestAuthentication interface { + GetGuestAuthentication() *GuestAuthentication +} + +func init() { + t["BaseGuestAuthentication"] = reflect.TypeOf((*GuestAuthentication)(nil)).Elem() +} + +func (b *GuestFileAttributes) GetGuestFileAttributes() *GuestFileAttributes { return b } + +type BaseGuestFileAttributes interface { + GetGuestFileAttributes() *GuestFileAttributes +} + +func init() { + t["BaseGuestFileAttributes"] = reflect.TypeOf((*GuestFileAttributes)(nil)).Elem() +} + +func (b *GuestOperationsFault) GetGuestOperationsFault() *GuestOperationsFault { return b } + +type BaseGuestOperationsFault interface { + GetGuestOperationsFault() *GuestOperationsFault +} + +func init() { + t["BaseGuestOperationsFault"] = reflect.TypeOf((*GuestOperationsFault)(nil)).Elem() +} + +func (b *GuestProgramSpec) GetGuestProgramSpec() *GuestProgramSpec { return b } + +type BaseGuestProgramSpec interface { + GetGuestProgramSpec() *GuestProgramSpec +} + +func init() { + t["BaseGuestProgramSpec"] = reflect.TypeOf((*GuestProgramSpec)(nil)).Elem() +} + +func (b *GuestRegValueDataSpec) GetGuestRegValueDataSpec() *GuestRegValueDataSpec { return b } + +type BaseGuestRegValueDataSpec interface { + GetGuestRegValueDataSpec() *GuestRegValueDataSpec +} + +func init() { + t["BaseGuestRegValueDataSpec"] = reflect.TypeOf((*GuestRegValueDataSpec)(nil)).Elem() +} + +func (b *GuestRegistryFault) GetGuestRegistryFault() *GuestRegistryFault { return b } + +type BaseGuestRegistryFault interface { + GetGuestRegistryFault() *GuestRegistryFault +} + +func init() { + t["BaseGuestRegistryFault"] = reflect.TypeOf((*GuestRegistryFault)(nil)).Elem() +} + +func (b *GuestRegistryKeyFault) GetGuestRegistryKeyFault() *GuestRegistryKeyFault { return b } + +type BaseGuestRegistryKeyFault interface { + GetGuestRegistryKeyFault() *GuestRegistryKeyFault +} + +func init() { + t["BaseGuestRegistryKeyFault"] = reflect.TypeOf((*GuestRegistryKeyFault)(nil)).Elem() +} + +func (b *GuestRegistryValueFault) GetGuestRegistryValueFault() *GuestRegistryValueFault { return b } + +type BaseGuestRegistryValueFault interface { + GetGuestRegistryValueFault() *GuestRegistryValueFault +} + +func init() { + t["BaseGuestRegistryValueFault"] = reflect.TypeOf((*GuestRegistryValueFault)(nil)).Elem() +} + +func (b *HostAccountSpec) GetHostAccountSpec() *HostAccountSpec { return b } + +type BaseHostAccountSpec interface { + GetHostAccountSpec() *HostAccountSpec +} + +func init() { + t["BaseHostAccountSpec"] = reflect.TypeOf((*HostAccountSpec)(nil)).Elem() +} + +func (b *HostAuthenticationStoreInfo) GetHostAuthenticationStoreInfo() *HostAuthenticationStoreInfo { + return b +} + +type BaseHostAuthenticationStoreInfo interface { + GetHostAuthenticationStoreInfo() *HostAuthenticationStoreInfo +} + +func init() { + t["BaseHostAuthenticationStoreInfo"] = reflect.TypeOf((*HostAuthenticationStoreInfo)(nil)).Elem() +} + +func (b *HostCommunication) GetHostCommunication() *HostCommunication { return b } + +type BaseHostCommunication interface { + GetHostCommunication() *HostCommunication +} + +func init() { + t["BaseHostCommunication"] = reflect.TypeOf((*HostCommunication)(nil)).Elem() +} + +func (b *HostConfigFault) GetHostConfigFault() *HostConfigFault { return b } + +type BaseHostConfigFault interface { + GetHostConfigFault() *HostConfigFault +} + +func init() { + t["BaseHostConfigFault"] = reflect.TypeOf((*HostConfigFault)(nil)).Elem() +} + +func (b *HostConnectFault) GetHostConnectFault() *HostConnectFault { return b } + +type BaseHostConnectFault interface { + GetHostConnectFault() *HostConnectFault +} + +func init() { + t["BaseHostConnectFault"] = reflect.TypeOf((*HostConnectFault)(nil)).Elem() +} + +func (b *HostConnectInfoNetworkInfo) GetHostConnectInfoNetworkInfo() *HostConnectInfoNetworkInfo { + return b +} + +type BaseHostConnectInfoNetworkInfo interface { + GetHostConnectInfoNetworkInfo() *HostConnectInfoNetworkInfo +} + +func init() { + t["BaseHostConnectInfoNetworkInfo"] = reflect.TypeOf((*HostConnectInfoNetworkInfo)(nil)).Elem() +} + +func (b *HostDasEvent) GetHostDasEvent() *HostDasEvent { return b } + +type BaseHostDasEvent interface { + GetHostDasEvent() *HostDasEvent +} + +func init() { + t["BaseHostDasEvent"] = reflect.TypeOf((*HostDasEvent)(nil)).Elem() +} + +func (b *HostDatastoreConnectInfo) GetHostDatastoreConnectInfo() *HostDatastoreConnectInfo { return b } + +type BaseHostDatastoreConnectInfo interface { + GetHostDatastoreConnectInfo() *HostDatastoreConnectInfo +} + +func init() { + t["BaseHostDatastoreConnectInfo"] = reflect.TypeOf((*HostDatastoreConnectInfo)(nil)).Elem() +} + +func (b *HostDevice) GetHostDevice() *HostDevice { return b } + +type BaseHostDevice interface { + GetHostDevice() *HostDevice +} + +func init() { + t["BaseHostDevice"] = reflect.TypeOf((*HostDevice)(nil)).Elem() +} + +func (b *HostDigestInfo) GetHostDigestInfo() *HostDigestInfo { return b } + +type BaseHostDigestInfo interface { + GetHostDigestInfo() *HostDigestInfo +} + +func init() { + t["BaseHostDigestInfo"] = reflect.TypeOf((*HostDigestInfo)(nil)).Elem() +} + +func (b *HostDirectoryStoreInfo) GetHostDirectoryStoreInfo() *HostDirectoryStoreInfo { return b } + +type BaseHostDirectoryStoreInfo interface { + GetHostDirectoryStoreInfo() *HostDirectoryStoreInfo +} + +func init() { + t["BaseHostDirectoryStoreInfo"] = reflect.TypeOf((*HostDirectoryStoreInfo)(nil)).Elem() +} + +func (b *HostDnsConfig) GetHostDnsConfig() *HostDnsConfig { return b } + +type BaseHostDnsConfig interface { + GetHostDnsConfig() *HostDnsConfig +} + +func init() { + t["BaseHostDnsConfig"] = reflect.TypeOf((*HostDnsConfig)(nil)).Elem() +} + +func (b *HostEvent) GetHostEvent() *HostEvent { return b } + +type BaseHostEvent interface { + GetHostEvent() *HostEvent +} + +func init() { + t["BaseHostEvent"] = reflect.TypeOf((*HostEvent)(nil)).Elem() +} + +func (b *HostFibreChannelHba) GetHostFibreChannelHba() *HostFibreChannelHba { return b } + +type BaseHostFibreChannelHba interface { + GetHostFibreChannelHba() *HostFibreChannelHba +} + +func init() { + t["BaseHostFibreChannelHba"] = reflect.TypeOf((*HostFibreChannelHba)(nil)).Elem() +} + +func (b *HostFibreChannelTargetTransport) GetHostFibreChannelTargetTransport() *HostFibreChannelTargetTransport { + return b +} + +type BaseHostFibreChannelTargetTransport interface { + GetHostFibreChannelTargetTransport() *HostFibreChannelTargetTransport +} + +func init() { + t["BaseHostFibreChannelTargetTransport"] = reflect.TypeOf((*HostFibreChannelTargetTransport)(nil)).Elem() +} + +func (b *HostFileSystemVolume) GetHostFileSystemVolume() *HostFileSystemVolume { return b } + +type BaseHostFileSystemVolume interface { + GetHostFileSystemVolume() *HostFileSystemVolume +} + +func init() { + t["BaseHostFileSystemVolume"] = reflect.TypeOf((*HostFileSystemVolume)(nil)).Elem() +} + +func (b *HostHardwareElementInfo) GetHostHardwareElementInfo() *HostHardwareElementInfo { return b } + +type BaseHostHardwareElementInfo interface { + GetHostHardwareElementInfo() *HostHardwareElementInfo +} + +func init() { + t["BaseHostHardwareElementInfo"] = reflect.TypeOf((*HostHardwareElementInfo)(nil)).Elem() +} + +func (b *HostHostBusAdapter) GetHostHostBusAdapter() *HostHostBusAdapter { return b } + +type BaseHostHostBusAdapter interface { + GetHostHostBusAdapter() *HostHostBusAdapter +} + +func init() { + t["BaseHostHostBusAdapter"] = reflect.TypeOf((*HostHostBusAdapter)(nil)).Elem() +} + +func (b *HostIpRouteConfig) GetHostIpRouteConfig() *HostIpRouteConfig { return b } + +type BaseHostIpRouteConfig interface { + GetHostIpRouteConfig() *HostIpRouteConfig +} + +func init() { + t["BaseHostIpRouteConfig"] = reflect.TypeOf((*HostIpRouteConfig)(nil)).Elem() +} + +func (b *HostMemberHealthCheckResult) GetHostMemberHealthCheckResult() *HostMemberHealthCheckResult { + return b +} + +type BaseHostMemberHealthCheckResult interface { + GetHostMemberHealthCheckResult() *HostMemberHealthCheckResult +} + +func init() { + t["BaseHostMemberHealthCheckResult"] = reflect.TypeOf((*HostMemberHealthCheckResult)(nil)).Elem() +} + +func (b *HostMemberUplinkHealthCheckResult) GetHostMemberUplinkHealthCheckResult() *HostMemberUplinkHealthCheckResult { + return b +} + +type BaseHostMemberUplinkHealthCheckResult interface { + GetHostMemberUplinkHealthCheckResult() *HostMemberUplinkHealthCheckResult +} + +func init() { + t["BaseHostMemberUplinkHealthCheckResult"] = reflect.TypeOf((*HostMemberUplinkHealthCheckResult)(nil)).Elem() +} + +func (b *HostMultipathInfoLogicalUnitPolicy) GetHostMultipathInfoLogicalUnitPolicy() *HostMultipathInfoLogicalUnitPolicy { + return b +} + +type BaseHostMultipathInfoLogicalUnitPolicy interface { + GetHostMultipathInfoLogicalUnitPolicy() *HostMultipathInfoLogicalUnitPolicy +} + +func init() { + t["BaseHostMultipathInfoLogicalUnitPolicy"] = reflect.TypeOf((*HostMultipathInfoLogicalUnitPolicy)(nil)).Elem() +} + +func (b *HostPciPassthruConfig) GetHostPciPassthruConfig() *HostPciPassthruConfig { return b } + +type BaseHostPciPassthruConfig interface { + GetHostPciPassthruConfig() *HostPciPassthruConfig +} + +func init() { + t["BaseHostPciPassthruConfig"] = reflect.TypeOf((*HostPciPassthruConfig)(nil)).Elem() +} + +func (b *HostPciPassthruInfo) GetHostPciPassthruInfo() *HostPciPassthruInfo { return b } + +type BaseHostPciPassthruInfo interface { + GetHostPciPassthruInfo() *HostPciPassthruInfo +} + +func init() { + t["BaseHostPciPassthruInfo"] = reflect.TypeOf((*HostPciPassthruInfo)(nil)).Elem() +} + +func (b *HostPowerOpFailed) GetHostPowerOpFailed() *HostPowerOpFailed { return b } + +type BaseHostPowerOpFailed interface { + GetHostPowerOpFailed() *HostPowerOpFailed +} + +func init() { + t["BaseHostPowerOpFailed"] = reflect.TypeOf((*HostPowerOpFailed)(nil)).Elem() +} + +func (b *HostProfileConfigSpec) GetHostProfileConfigSpec() *HostProfileConfigSpec { return b } + +type BaseHostProfileConfigSpec interface { + GetHostProfileConfigSpec() *HostProfileConfigSpec +} + +func init() { + t["BaseHostProfileConfigSpec"] = reflect.TypeOf((*HostProfileConfigSpec)(nil)).Elem() +} + +func (b *HostSystemSwapConfigurationSystemSwapOption) GetHostSystemSwapConfigurationSystemSwapOption() *HostSystemSwapConfigurationSystemSwapOption { + return b +} + +type BaseHostSystemSwapConfigurationSystemSwapOption interface { + GetHostSystemSwapConfigurationSystemSwapOption() *HostSystemSwapConfigurationSystemSwapOption +} + +func init() { + t["BaseHostSystemSwapConfigurationSystemSwapOption"] = reflect.TypeOf((*HostSystemSwapConfigurationSystemSwapOption)(nil)).Elem() +} + +func (b *HostTargetTransport) GetHostTargetTransport() *HostTargetTransport { return b } + +type BaseHostTargetTransport interface { + GetHostTargetTransport() *HostTargetTransport +} + +func init() { + t["BaseHostTargetTransport"] = reflect.TypeOf((*HostTargetTransport)(nil)).Elem() +} + +func (b *HostTpmEventDetails) GetHostTpmEventDetails() *HostTpmEventDetails { return b } + +type BaseHostTpmEventDetails interface { + GetHostTpmEventDetails() *HostTpmEventDetails +} + +func init() { + t["BaseHostTpmEventDetails"] = reflect.TypeOf((*HostTpmEventDetails)(nil)).Elem() +} + +func (b *HostVirtualSwitchBridge) GetHostVirtualSwitchBridge() *HostVirtualSwitchBridge { return b } + +type BaseHostVirtualSwitchBridge interface { + GetHostVirtualSwitchBridge() *HostVirtualSwitchBridge +} + +func init() { + t["BaseHostVirtualSwitchBridge"] = reflect.TypeOf((*HostVirtualSwitchBridge)(nil)).Elem() +} + +func (b *HourlyTaskScheduler) GetHourlyTaskScheduler() *HourlyTaskScheduler { return b } + +type BaseHourlyTaskScheduler interface { + GetHourlyTaskScheduler() *HourlyTaskScheduler +} + +func init() { + t["BaseHourlyTaskScheduler"] = reflect.TypeOf((*HourlyTaskScheduler)(nil)).Elem() +} + +func (b *ImportSpec) GetImportSpec() *ImportSpec { return b } + +type BaseImportSpec interface { + GetImportSpec() *ImportSpec +} + +func init() { + t["BaseImportSpec"] = reflect.TypeOf((*ImportSpec)(nil)).Elem() +} + +func (b *InaccessibleDatastore) GetInaccessibleDatastore() *InaccessibleDatastore { return b } + +type BaseInaccessibleDatastore interface { + GetInaccessibleDatastore() *InaccessibleDatastore +} + +func init() { + t["BaseInaccessibleDatastore"] = reflect.TypeOf((*InaccessibleDatastore)(nil)).Elem() +} + +func (b *InheritablePolicy) GetInheritablePolicy() *InheritablePolicy { return b } + +type BaseInheritablePolicy interface { + GetInheritablePolicy() *InheritablePolicy +} + +func init() { + t["BaseInheritablePolicy"] = reflect.TypeOf((*InheritablePolicy)(nil)).Elem() +} + +func (b *InsufficientHostCapacityFault) GetInsufficientHostCapacityFault() *InsufficientHostCapacityFault { + return b +} + +type BaseInsufficientHostCapacityFault interface { + GetInsufficientHostCapacityFault() *InsufficientHostCapacityFault +} + +func init() { + t["BaseInsufficientHostCapacityFault"] = reflect.TypeOf((*InsufficientHostCapacityFault)(nil)).Elem() +} + +func (b *InsufficientResourcesFault) GetInsufficientResourcesFault() *InsufficientResourcesFault { + return b +} + +type BaseInsufficientResourcesFault interface { + GetInsufficientResourcesFault() *InsufficientResourcesFault +} + +func init() { + t["BaseInsufficientResourcesFault"] = reflect.TypeOf((*InsufficientResourcesFault)(nil)).Elem() +} + +func (b *InsufficientStandbyResource) GetInsufficientStandbyResource() *InsufficientStandbyResource { + return b +} + +type BaseInsufficientStandbyResource interface { + GetInsufficientStandbyResource() *InsufficientStandbyResource +} + +func init() { + t["BaseInsufficientStandbyResource"] = reflect.TypeOf((*InsufficientStandbyResource)(nil)).Elem() +} + +func (b *InvalidArgument) GetInvalidArgument() *InvalidArgument { return b } + +type BaseInvalidArgument interface { + GetInvalidArgument() *InvalidArgument +} + +func init() { + t["BaseInvalidArgument"] = reflect.TypeOf((*InvalidArgument)(nil)).Elem() +} + +func (b *InvalidCAMServer) GetInvalidCAMServer() *InvalidCAMServer { return b } + +type BaseInvalidCAMServer interface { + GetInvalidCAMServer() *InvalidCAMServer +} + +func init() { + t["BaseInvalidCAMServer"] = reflect.TypeOf((*InvalidCAMServer)(nil)).Elem() +} + +func (b *InvalidDatastore) GetInvalidDatastore() *InvalidDatastore { return b } + +type BaseInvalidDatastore interface { + GetInvalidDatastore() *InvalidDatastore +} + +func init() { + t["BaseInvalidDatastore"] = reflect.TypeOf((*InvalidDatastore)(nil)).Elem() +} + +func (b *InvalidDeviceSpec) GetInvalidDeviceSpec() *InvalidDeviceSpec { return b } + +type BaseInvalidDeviceSpec interface { + GetInvalidDeviceSpec() *InvalidDeviceSpec +} + +func init() { + t["BaseInvalidDeviceSpec"] = reflect.TypeOf((*InvalidDeviceSpec)(nil)).Elem() +} + +func (b *InvalidFolder) GetInvalidFolder() *InvalidFolder { return b } + +type BaseInvalidFolder interface { + GetInvalidFolder() *InvalidFolder +} + +func init() { + t["BaseInvalidFolder"] = reflect.TypeOf((*InvalidFolder)(nil)).Elem() +} + +func (b *InvalidFormat) GetInvalidFormat() *InvalidFormat { return b } + +type BaseInvalidFormat interface { + GetInvalidFormat() *InvalidFormat +} + +func init() { + t["BaseInvalidFormat"] = reflect.TypeOf((*InvalidFormat)(nil)).Elem() +} + +func (b *InvalidHostState) GetInvalidHostState() *InvalidHostState { return b } + +type BaseInvalidHostState interface { + GetInvalidHostState() *InvalidHostState +} + +func init() { + t["BaseInvalidHostState"] = reflect.TypeOf((*InvalidHostState)(nil)).Elem() +} + +func (b *InvalidLogin) GetInvalidLogin() *InvalidLogin { return b } + +type BaseInvalidLogin interface { + GetInvalidLogin() *InvalidLogin +} + +func init() { + t["BaseInvalidLogin"] = reflect.TypeOf((*InvalidLogin)(nil)).Elem() +} + +func (b *InvalidPropertyValue) GetInvalidPropertyValue() *InvalidPropertyValue { return b } + +type BaseInvalidPropertyValue interface { + GetInvalidPropertyValue() *InvalidPropertyValue +} + +func init() { + t["BaseInvalidPropertyValue"] = reflect.TypeOf((*InvalidPropertyValue)(nil)).Elem() +} + +func (b *InvalidRequest) GetInvalidRequest() *InvalidRequest { return b } + +type BaseInvalidRequest interface { + GetInvalidRequest() *InvalidRequest +} + +func init() { + t["BaseInvalidRequest"] = reflect.TypeOf((*InvalidRequest)(nil)).Elem() +} + +func (b *InvalidState) GetInvalidState() *InvalidState { return b } + +type BaseInvalidState interface { + GetInvalidState() *InvalidState +} + +func init() { + t["BaseInvalidState"] = reflect.TypeOf((*InvalidState)(nil)).Elem() +} + +func (b *InvalidVmConfig) GetInvalidVmConfig() *InvalidVmConfig { return b } + +type BaseInvalidVmConfig interface { + GetInvalidVmConfig() *InvalidVmConfig +} + +func init() { + t["BaseInvalidVmConfig"] = reflect.TypeOf((*InvalidVmConfig)(nil)).Elem() +} + +func (b *IoFilterInfo) GetIoFilterInfo() *IoFilterInfo { return b } + +type BaseIoFilterInfo interface { + GetIoFilterInfo() *IoFilterInfo +} + +func init() { + t["BaseIoFilterInfo"] = reflect.TypeOf((*IoFilterInfo)(nil)).Elem() +} + +func (b *IpAddress) GetIpAddress() *IpAddress { return b } + +type BaseIpAddress interface { + GetIpAddress() *IpAddress +} + +func init() { + t["BaseIpAddress"] = reflect.TypeOf((*IpAddress)(nil)).Elem() +} + +func (b *IscsiFault) GetIscsiFault() *IscsiFault { return b } + +type BaseIscsiFault interface { + GetIscsiFault() *IscsiFault +} + +func init() { + t["BaseIscsiFault"] = reflect.TypeOf((*IscsiFault)(nil)).Elem() +} + +func (b *LicenseEvent) GetLicenseEvent() *LicenseEvent { return b } + +type BaseLicenseEvent interface { + GetLicenseEvent() *LicenseEvent +} + +func init() { + t["BaseLicenseEvent"] = reflect.TypeOf((*LicenseEvent)(nil)).Elem() +} + +func (b *LicenseSource) GetLicenseSource() *LicenseSource { return b } + +type BaseLicenseSource interface { + GetLicenseSource() *LicenseSource +} + +func init() { + t["BaseLicenseSource"] = reflect.TypeOf((*LicenseSource)(nil)).Elem() +} + +func (b *MacAddress) GetMacAddress() *MacAddress { return b } + +type BaseMacAddress interface { + GetMacAddress() *MacAddress +} + +func init() { + t["BaseMacAddress"] = reflect.TypeOf((*MacAddress)(nil)).Elem() +} + +func (b *MethodFault) GetMethodFault() *MethodFault { return b } + +type BaseMethodFault interface { + GetMethodFault() *MethodFault +} + +func init() { + t["BaseMethodFault"] = reflect.TypeOf((*MethodFault)(nil)).Elem() +} + +func (b *MigrationEvent) GetMigrationEvent() *MigrationEvent { return b } + +type BaseMigrationEvent interface { + GetMigrationEvent() *MigrationEvent +} + +func init() { + t["BaseMigrationEvent"] = reflect.TypeOf((*MigrationEvent)(nil)).Elem() +} + +func (b *MigrationFault) GetMigrationFault() *MigrationFault { return b } + +type BaseMigrationFault interface { + GetMigrationFault() *MigrationFault +} + +func init() { + t["BaseMigrationFault"] = reflect.TypeOf((*MigrationFault)(nil)).Elem() +} + +func (b *MigrationFeatureNotSupported) GetMigrationFeatureNotSupported() *MigrationFeatureNotSupported { + return b +} + +type BaseMigrationFeatureNotSupported interface { + GetMigrationFeatureNotSupported() *MigrationFeatureNotSupported +} + +func init() { + t["BaseMigrationFeatureNotSupported"] = reflect.TypeOf((*MigrationFeatureNotSupported)(nil)).Elem() +} + +func (b *MonthlyTaskScheduler) GetMonthlyTaskScheduler() *MonthlyTaskScheduler { return b } + +type BaseMonthlyTaskScheduler interface { + GetMonthlyTaskScheduler() *MonthlyTaskScheduler +} + +func init() { + t["BaseMonthlyTaskScheduler"] = reflect.TypeOf((*MonthlyTaskScheduler)(nil)).Elem() +} + +func (b *NasConfigFault) GetNasConfigFault() *NasConfigFault { return b } + +type BaseNasConfigFault interface { + GetNasConfigFault() *NasConfigFault +} + +func init() { + t["BaseNasConfigFault"] = reflect.TypeOf((*NasConfigFault)(nil)).Elem() +} + +func (b *NegatableExpression) GetNegatableExpression() *NegatableExpression { return b } + +type BaseNegatableExpression interface { + GetNegatableExpression() *NegatableExpression +} + +func init() { + t["BaseNegatableExpression"] = reflect.TypeOf((*NegatableExpression)(nil)).Elem() +} + +func (b *NetBIOSConfigInfo) GetNetBIOSConfigInfo() *NetBIOSConfigInfo { return b } + +type BaseNetBIOSConfigInfo interface { + GetNetBIOSConfigInfo() *NetBIOSConfigInfo +} + +func init() { + t["BaseNetBIOSConfigInfo"] = reflect.TypeOf((*NetBIOSConfigInfo)(nil)).Elem() +} + +func (b *NetworkSummary) GetNetworkSummary() *NetworkSummary { return b } + +type BaseNetworkSummary interface { + GetNetworkSummary() *NetworkSummary +} + +func init() { + t["BaseNetworkSummary"] = reflect.TypeOf((*NetworkSummary)(nil)).Elem() +} + +func (b *NoCompatibleHost) GetNoCompatibleHost() *NoCompatibleHost { return b } + +type BaseNoCompatibleHost interface { + GetNoCompatibleHost() *NoCompatibleHost +} + +func init() { + t["BaseNoCompatibleHost"] = reflect.TypeOf((*NoCompatibleHost)(nil)).Elem() +} + +func (b *NoPermission) GetNoPermission() *NoPermission { return b } + +type BaseNoPermission interface { + GetNoPermission() *NoPermission +} + +func init() { + t["BaseNoPermission"] = reflect.TypeOf((*NoPermission)(nil)).Elem() +} + +func (b *NotEnoughCpus) GetNotEnoughCpus() *NotEnoughCpus { return b } + +type BaseNotEnoughCpus interface { + GetNotEnoughCpus() *NotEnoughCpus +} + +func init() { + t["BaseNotEnoughCpus"] = reflect.TypeOf((*NotEnoughCpus)(nil)).Elem() +} + +func (b *NotEnoughLicenses) GetNotEnoughLicenses() *NotEnoughLicenses { return b } + +type BaseNotEnoughLicenses interface { + GetNotEnoughLicenses() *NotEnoughLicenses +} + +func init() { + t["BaseNotEnoughLicenses"] = reflect.TypeOf((*NotEnoughLicenses)(nil)).Elem() +} + +func (b *NotSupported) GetNotSupported() *NotSupported { return b } + +type BaseNotSupported interface { + GetNotSupported() *NotSupported +} + +func init() { + t["BaseNotSupported"] = reflect.TypeOf((*NotSupported)(nil)).Elem() +} + +func (b *NotSupportedHost) GetNotSupportedHost() *NotSupportedHost { return b } + +type BaseNotSupportedHost interface { + GetNotSupportedHost() *NotSupportedHost +} + +func init() { + t["BaseNotSupportedHost"] = reflect.TypeOf((*NotSupportedHost)(nil)).Elem() +} + +func (b *NotSupportedHostInCluster) GetNotSupportedHostInCluster() *NotSupportedHostInCluster { + return b +} + +type BaseNotSupportedHostInCluster interface { + GetNotSupportedHostInCluster() *NotSupportedHostInCluster +} + +func init() { + t["BaseNotSupportedHostInCluster"] = reflect.TypeOf((*NotSupportedHostInCluster)(nil)).Elem() +} + +func (b *OptionType) GetOptionType() *OptionType { return b } + +type BaseOptionType interface { + GetOptionType() *OptionType +} + +func init() { + t["BaseOptionType"] = reflect.TypeOf((*OptionType)(nil)).Elem() +} + +func (b *OptionValue) GetOptionValue() *OptionValue { return b } + +type BaseOptionValue interface { + GetOptionValue() *OptionValue +} + +func init() { + t["BaseOptionValue"] = reflect.TypeOf((*OptionValue)(nil)).Elem() +} + +func (b *OvfAttribute) GetOvfAttribute() *OvfAttribute { return b } + +type BaseOvfAttribute interface { + GetOvfAttribute() *OvfAttribute +} + +func init() { + t["BaseOvfAttribute"] = reflect.TypeOf((*OvfAttribute)(nil)).Elem() +} + +func (b *OvfConnectedDevice) GetOvfConnectedDevice() *OvfConnectedDevice { return b } + +type BaseOvfConnectedDevice interface { + GetOvfConnectedDevice() *OvfConnectedDevice +} + +func init() { + t["BaseOvfConnectedDevice"] = reflect.TypeOf((*OvfConnectedDevice)(nil)).Elem() +} + +func (b *OvfConstraint) GetOvfConstraint() *OvfConstraint { return b } + +type BaseOvfConstraint interface { + GetOvfConstraint() *OvfConstraint +} + +func init() { + t["BaseOvfConstraint"] = reflect.TypeOf((*OvfConstraint)(nil)).Elem() +} + +func (b *OvfConsumerCallbackFault) GetOvfConsumerCallbackFault() *OvfConsumerCallbackFault { return b } + +type BaseOvfConsumerCallbackFault interface { + GetOvfConsumerCallbackFault() *OvfConsumerCallbackFault +} + +func init() { + t["BaseOvfConsumerCallbackFault"] = reflect.TypeOf((*OvfConsumerCallbackFault)(nil)).Elem() +} + +func (b *OvfElement) GetOvfElement() *OvfElement { return b } + +type BaseOvfElement interface { + GetOvfElement() *OvfElement +} + +func init() { + t["BaseOvfElement"] = reflect.TypeOf((*OvfElement)(nil)).Elem() +} + +func (b *OvfExport) GetOvfExport() *OvfExport { return b } + +type BaseOvfExport interface { + GetOvfExport() *OvfExport +} + +func init() { + t["BaseOvfExport"] = reflect.TypeOf((*OvfExport)(nil)).Elem() +} + +func (b *OvfFault) GetOvfFault() *OvfFault { return b } + +type BaseOvfFault interface { + GetOvfFault() *OvfFault +} + +func init() { + t["BaseOvfFault"] = reflect.TypeOf((*OvfFault)(nil)).Elem() +} + +func (b *OvfHardwareExport) GetOvfHardwareExport() *OvfHardwareExport { return b } + +type BaseOvfHardwareExport interface { + GetOvfHardwareExport() *OvfHardwareExport +} + +func init() { + t["BaseOvfHardwareExport"] = reflect.TypeOf((*OvfHardwareExport)(nil)).Elem() +} + +func (b *OvfImport) GetOvfImport() *OvfImport { return b } + +type BaseOvfImport interface { + GetOvfImport() *OvfImport +} + +func init() { + t["BaseOvfImport"] = reflect.TypeOf((*OvfImport)(nil)).Elem() +} + +func (b *OvfInvalidPackage) GetOvfInvalidPackage() *OvfInvalidPackage { return b } + +type BaseOvfInvalidPackage interface { + GetOvfInvalidPackage() *OvfInvalidPackage +} + +func init() { + t["BaseOvfInvalidPackage"] = reflect.TypeOf((*OvfInvalidPackage)(nil)).Elem() +} + +func (b *OvfInvalidValue) GetOvfInvalidValue() *OvfInvalidValue { return b } + +type BaseOvfInvalidValue interface { + GetOvfInvalidValue() *OvfInvalidValue +} + +func init() { + t["BaseOvfInvalidValue"] = reflect.TypeOf((*OvfInvalidValue)(nil)).Elem() +} + +func (b *OvfManagerCommonParams) GetOvfManagerCommonParams() *OvfManagerCommonParams { return b } + +type BaseOvfManagerCommonParams interface { + GetOvfManagerCommonParams() *OvfManagerCommonParams +} + +func init() { + t["BaseOvfManagerCommonParams"] = reflect.TypeOf((*OvfManagerCommonParams)(nil)).Elem() +} + +func (b *OvfMissingElement) GetOvfMissingElement() *OvfMissingElement { return b } + +type BaseOvfMissingElement interface { + GetOvfMissingElement() *OvfMissingElement +} + +func init() { + t["BaseOvfMissingElement"] = reflect.TypeOf((*OvfMissingElement)(nil)).Elem() +} + +func (b *OvfProperty) GetOvfProperty() *OvfProperty { return b } + +type BaseOvfProperty interface { + GetOvfProperty() *OvfProperty +} + +func init() { + t["BaseOvfProperty"] = reflect.TypeOf((*OvfProperty)(nil)).Elem() +} + +func (b *OvfSystemFault) GetOvfSystemFault() *OvfSystemFault { return b } + +type BaseOvfSystemFault interface { + GetOvfSystemFault() *OvfSystemFault +} + +func init() { + t["BaseOvfSystemFault"] = reflect.TypeOf((*OvfSystemFault)(nil)).Elem() +} + +func (b *OvfUnsupportedAttribute) GetOvfUnsupportedAttribute() *OvfUnsupportedAttribute { return b } + +type BaseOvfUnsupportedAttribute interface { + GetOvfUnsupportedAttribute() *OvfUnsupportedAttribute +} + +func init() { + t["BaseOvfUnsupportedAttribute"] = reflect.TypeOf((*OvfUnsupportedAttribute)(nil)).Elem() +} + +func (b *OvfUnsupportedElement) GetOvfUnsupportedElement() *OvfUnsupportedElement { return b } + +type BaseOvfUnsupportedElement interface { + GetOvfUnsupportedElement() *OvfUnsupportedElement +} + +func init() { + t["BaseOvfUnsupportedElement"] = reflect.TypeOf((*OvfUnsupportedElement)(nil)).Elem() +} + +func (b *OvfUnsupportedPackage) GetOvfUnsupportedPackage() *OvfUnsupportedPackage { return b } + +type BaseOvfUnsupportedPackage interface { + GetOvfUnsupportedPackage() *OvfUnsupportedPackage +} + +func init() { + t["BaseOvfUnsupportedPackage"] = reflect.TypeOf((*OvfUnsupportedPackage)(nil)).Elem() +} + +func (b *PatchMetadataInvalid) GetPatchMetadataInvalid() *PatchMetadataInvalid { return b } + +type BasePatchMetadataInvalid interface { + GetPatchMetadataInvalid() *PatchMetadataInvalid +} + +func init() { + t["BasePatchMetadataInvalid"] = reflect.TypeOf((*PatchMetadataInvalid)(nil)).Elem() +} + +func (b *PatchNotApplicable) GetPatchNotApplicable() *PatchNotApplicable { return b } + +type BasePatchNotApplicable interface { + GetPatchNotApplicable() *PatchNotApplicable +} + +func init() { + t["BasePatchNotApplicable"] = reflect.TypeOf((*PatchNotApplicable)(nil)).Elem() +} + +func (b *PerfEntityMetricBase) GetPerfEntityMetricBase() *PerfEntityMetricBase { return b } + +type BasePerfEntityMetricBase interface { + GetPerfEntityMetricBase() *PerfEntityMetricBase +} + +func init() { + t["BasePerfEntityMetricBase"] = reflect.TypeOf((*PerfEntityMetricBase)(nil)).Elem() +} + +func (b *PerfMetricSeries) GetPerfMetricSeries() *PerfMetricSeries { return b } + +type BasePerfMetricSeries interface { + GetPerfMetricSeries() *PerfMetricSeries +} + +func init() { + t["BasePerfMetricSeries"] = reflect.TypeOf((*PerfMetricSeries)(nil)).Elem() +} + +func (b *PermissionEvent) GetPermissionEvent() *PermissionEvent { return b } + +type BasePermissionEvent interface { + GetPermissionEvent() *PermissionEvent +} + +func init() { + t["BasePermissionEvent"] = reflect.TypeOf((*PermissionEvent)(nil)).Elem() +} + +func (b *PhysicalNicHint) GetPhysicalNicHint() *PhysicalNicHint { return b } + +type BasePhysicalNicHint interface { + GetPhysicalNicHint() *PhysicalNicHint +} + +func init() { + t["BasePhysicalNicHint"] = reflect.TypeOf((*PhysicalNicHint)(nil)).Elem() +} + +func (b *PlatformConfigFault) GetPlatformConfigFault() *PlatformConfigFault { return b } + +type BasePlatformConfigFault interface { + GetPlatformConfigFault() *PlatformConfigFault +} + +func init() { + t["BasePlatformConfigFault"] = reflect.TypeOf((*PlatformConfigFault)(nil)).Elem() +} + +func (b *PolicyOption) GetPolicyOption() *PolicyOption { return b } + +type BasePolicyOption interface { + GetPolicyOption() *PolicyOption +} + +func init() { + t["BasePolicyOption"] = reflect.TypeOf((*PolicyOption)(nil)).Elem() +} + +func (b *PortGroupProfile) GetPortGroupProfile() *PortGroupProfile { return b } + +type BasePortGroupProfile interface { + GetPortGroupProfile() *PortGroupProfile +} + +func init() { + t["BasePortGroupProfile"] = reflect.TypeOf((*PortGroupProfile)(nil)).Elem() +} + +func (b *ProfileConfigInfo) GetProfileConfigInfo() *ProfileConfigInfo { return b } + +type BaseProfileConfigInfo interface { + GetProfileConfigInfo() *ProfileConfigInfo +} + +func init() { + t["BaseProfileConfigInfo"] = reflect.TypeOf((*ProfileConfigInfo)(nil)).Elem() +} + +func (b *ProfileCreateSpec) GetProfileCreateSpec() *ProfileCreateSpec { return b } + +type BaseProfileCreateSpec interface { + GetProfileCreateSpec() *ProfileCreateSpec +} + +func init() { + t["BaseProfileCreateSpec"] = reflect.TypeOf((*ProfileCreateSpec)(nil)).Elem() +} + +func (b *ProfileEvent) GetProfileEvent() *ProfileEvent { return b } + +type BaseProfileEvent interface { + GetProfileEvent() *ProfileEvent +} + +func init() { + t["BaseProfileEvent"] = reflect.TypeOf((*ProfileEvent)(nil)).Elem() +} + +func (b *ProfileExpression) GetProfileExpression() *ProfileExpression { return b } + +type BaseProfileExpression interface { + GetProfileExpression() *ProfileExpression +} + +func init() { + t["BaseProfileExpression"] = reflect.TypeOf((*ProfileExpression)(nil)).Elem() +} + +func (b *ProfilePolicyOptionMetadata) GetProfilePolicyOptionMetadata() *ProfilePolicyOptionMetadata { + return b +} + +type BaseProfilePolicyOptionMetadata interface { + GetProfilePolicyOptionMetadata() *ProfilePolicyOptionMetadata +} + +func init() { + t["BaseProfilePolicyOptionMetadata"] = reflect.TypeOf((*ProfilePolicyOptionMetadata)(nil)).Elem() +} + +func (b *ProfileSerializedCreateSpec) GetProfileSerializedCreateSpec() *ProfileSerializedCreateSpec { + return b +} + +type BaseProfileSerializedCreateSpec interface { + GetProfileSerializedCreateSpec() *ProfileSerializedCreateSpec +} + +func init() { + t["BaseProfileSerializedCreateSpec"] = reflect.TypeOf((*ProfileSerializedCreateSpec)(nil)).Elem() +} + +func (b *RDMNotSupported) GetRDMNotSupported() *RDMNotSupported { return b } + +type BaseRDMNotSupported interface { + GetRDMNotSupported() *RDMNotSupported +} + +func init() { + t["BaseRDMNotSupported"] = reflect.TypeOf((*RDMNotSupported)(nil)).Elem() +} + +func (b *RecurrentTaskScheduler) GetRecurrentTaskScheduler() *RecurrentTaskScheduler { return b } + +type BaseRecurrentTaskScheduler interface { + GetRecurrentTaskScheduler() *RecurrentTaskScheduler +} + +func init() { + t["BaseRecurrentTaskScheduler"] = reflect.TypeOf((*RecurrentTaskScheduler)(nil)).Elem() +} + +func (b *ReplicationConfigFault) GetReplicationConfigFault() *ReplicationConfigFault { return b } + +type BaseReplicationConfigFault interface { + GetReplicationConfigFault() *ReplicationConfigFault +} + +func init() { + t["BaseReplicationConfigFault"] = reflect.TypeOf((*ReplicationConfigFault)(nil)).Elem() +} + +func (b *ReplicationFault) GetReplicationFault() *ReplicationFault { return b } + +type BaseReplicationFault interface { + GetReplicationFault() *ReplicationFault +} + +func init() { + t["BaseReplicationFault"] = reflect.TypeOf((*ReplicationFault)(nil)).Elem() +} + +func (b *ReplicationVmFault) GetReplicationVmFault() *ReplicationVmFault { return b } + +type BaseReplicationVmFault interface { + GetReplicationVmFault() *ReplicationVmFault +} + +func init() { + t["BaseReplicationVmFault"] = reflect.TypeOf((*ReplicationVmFault)(nil)).Elem() +} + +func (b *ResourceAllocationInfo) GetResourceAllocationInfo() *ResourceAllocationInfo { return b } + +type BaseResourceAllocationInfo interface { + GetResourceAllocationInfo() *ResourceAllocationInfo +} + +func init() { + t["BaseResourceAllocationInfo"] = reflect.TypeOf((*ResourceAllocationInfo)(nil)).Elem() +} + +func (b *ResourceInUse) GetResourceInUse() *ResourceInUse { return b } + +type BaseResourceInUse interface { + GetResourceInUse() *ResourceInUse +} + +func init() { + t["BaseResourceInUse"] = reflect.TypeOf((*ResourceInUse)(nil)).Elem() +} + +func (b *ResourcePoolEvent) GetResourcePoolEvent() *ResourcePoolEvent { return b } + +type BaseResourcePoolEvent interface { + GetResourcePoolEvent() *ResourcePoolEvent +} + +func init() { + t["BaseResourcePoolEvent"] = reflect.TypeOf((*ResourcePoolEvent)(nil)).Elem() +} + +func (b *ResourcePoolSummary) GetResourcePoolSummary() *ResourcePoolSummary { return b } + +type BaseResourcePoolSummary interface { + GetResourcePoolSummary() *ResourcePoolSummary +} + +func init() { + t["BaseResourcePoolSummary"] = reflect.TypeOf((*ResourcePoolSummary)(nil)).Elem() +} + +func (b *RoleEvent) GetRoleEvent() *RoleEvent { return b } + +type BaseRoleEvent interface { + GetRoleEvent() *RoleEvent +} + +func init() { + t["BaseRoleEvent"] = reflect.TypeOf((*RoleEvent)(nil)).Elem() +} + +func (b *RuntimeFault) GetRuntimeFault() *RuntimeFault { return b } + +type BaseRuntimeFault interface { + GetRuntimeFault() *RuntimeFault +} + +func init() { + t["BaseRuntimeFault"] = reflect.TypeOf((*RuntimeFault)(nil)).Elem() +} + +func (b *ScheduledTaskEvent) GetScheduledTaskEvent() *ScheduledTaskEvent { return b } + +type BaseScheduledTaskEvent interface { + GetScheduledTaskEvent() *ScheduledTaskEvent +} + +func init() { + t["BaseScheduledTaskEvent"] = reflect.TypeOf((*ScheduledTaskEvent)(nil)).Elem() +} + +func (b *ScheduledTaskSpec) GetScheduledTaskSpec() *ScheduledTaskSpec { return b } + +type BaseScheduledTaskSpec interface { + GetScheduledTaskSpec() *ScheduledTaskSpec +} + +func init() { + t["BaseScheduledTaskSpec"] = reflect.TypeOf((*ScheduledTaskSpec)(nil)).Elem() +} + +func (b *ScsiLun) GetScsiLun() *ScsiLun { return b } + +type BaseScsiLun interface { + GetScsiLun() *ScsiLun +} + +func init() { + t["BaseScsiLun"] = reflect.TypeOf((*ScsiLun)(nil)).Elem() +} + +func (b *SecurityError) GetSecurityError() *SecurityError { return b } + +type BaseSecurityError interface { + GetSecurityError() *SecurityError +} + +func init() { + t["BaseSecurityError"] = reflect.TypeOf((*SecurityError)(nil)).Elem() +} + +func (b *SelectionSet) GetSelectionSet() *SelectionSet { return b } + +type BaseSelectionSet interface { + GetSelectionSet() *SelectionSet +} + +func init() { + t["BaseSelectionSet"] = reflect.TypeOf((*SelectionSet)(nil)).Elem() +} + +func (b *SelectionSpec) GetSelectionSpec() *SelectionSpec { return b } + +type BaseSelectionSpec interface { + GetSelectionSpec() *SelectionSpec +} + +func init() { + t["BaseSelectionSpec"] = reflect.TypeOf((*SelectionSpec)(nil)).Elem() +} + +func (b *ServiceLocatorCredential) GetServiceLocatorCredential() *ServiceLocatorCredential { return b } + +type BaseServiceLocatorCredential interface { + GetServiceLocatorCredential() *ServiceLocatorCredential +} + +func init() { + t["BaseServiceLocatorCredential"] = reflect.TypeOf((*ServiceLocatorCredential)(nil)).Elem() +} + +func (b *SessionEvent) GetSessionEvent() *SessionEvent { return b } + +type BaseSessionEvent interface { + GetSessionEvent() *SessionEvent +} + +func init() { + t["BaseSessionEvent"] = reflect.TypeOf((*SessionEvent)(nil)).Elem() +} + +func (b *SessionManagerServiceRequestSpec) GetSessionManagerServiceRequestSpec() *SessionManagerServiceRequestSpec { + return b +} + +type BaseSessionManagerServiceRequestSpec interface { + GetSessionManagerServiceRequestSpec() *SessionManagerServiceRequestSpec +} + +func init() { + t["BaseSessionManagerServiceRequestSpec"] = reflect.TypeOf((*SessionManagerServiceRequestSpec)(nil)).Elem() +} + +func (b *SnapshotCopyNotSupported) GetSnapshotCopyNotSupported() *SnapshotCopyNotSupported { return b } + +type BaseSnapshotCopyNotSupported interface { + GetSnapshotCopyNotSupported() *SnapshotCopyNotSupported +} + +func init() { + t["BaseSnapshotCopyNotSupported"] = reflect.TypeOf((*SnapshotCopyNotSupported)(nil)).Elem() +} + +func (b *SnapshotFault) GetSnapshotFault() *SnapshotFault { return b } + +type BaseSnapshotFault interface { + GetSnapshotFault() *SnapshotFault +} + +func init() { + t["BaseSnapshotFault"] = reflect.TypeOf((*SnapshotFault)(nil)).Elem() +} + +func (b *TaskEvent) GetTaskEvent() *TaskEvent { return b } + +type BaseTaskEvent interface { + GetTaskEvent() *TaskEvent +} + +func init() { + t["BaseTaskEvent"] = reflect.TypeOf((*TaskEvent)(nil)).Elem() +} + +func (b *TaskInProgress) GetTaskInProgress() *TaskInProgress { return b } + +type BaseTaskInProgress interface { + GetTaskInProgress() *TaskInProgress +} + +func init() { + t["BaseTaskInProgress"] = reflect.TypeOf((*TaskInProgress)(nil)).Elem() +} + +func (b *TaskReason) GetTaskReason() *TaskReason { return b } + +type BaseTaskReason interface { + GetTaskReason() *TaskReason +} + +func init() { + t["BaseTaskReason"] = reflect.TypeOf((*TaskReason)(nil)).Elem() +} + +func (b *TaskScheduler) GetTaskScheduler() *TaskScheduler { return b } + +type BaseTaskScheduler interface { + GetTaskScheduler() *TaskScheduler +} + +func init() { + t["BaseTaskScheduler"] = reflect.TypeOf((*TaskScheduler)(nil)).Elem() +} + +func (b *TemplateUpgradeEvent) GetTemplateUpgradeEvent() *TemplateUpgradeEvent { return b } + +type BaseTemplateUpgradeEvent interface { + GetTemplateUpgradeEvent() *TemplateUpgradeEvent +} + +func init() { + t["BaseTemplateUpgradeEvent"] = reflect.TypeOf((*TemplateUpgradeEvent)(nil)).Elem() +} + +func (b *Timedout) GetTimedout() *Timedout { return b } + +type BaseTimedout interface { + GetTimedout() *Timedout +} + +func init() { + t["BaseTimedout"] = reflect.TypeOf((*Timedout)(nil)).Elem() +} + +func (b *TypeDescription) GetTypeDescription() *TypeDescription { return b } + +type BaseTypeDescription interface { + GetTypeDescription() *TypeDescription +} + +func init() { + t["BaseTypeDescription"] = reflect.TypeOf((*TypeDescription)(nil)).Elem() +} + +func (b *UnsupportedDatastore) GetUnsupportedDatastore() *UnsupportedDatastore { return b } + +type BaseUnsupportedDatastore interface { + GetUnsupportedDatastore() *UnsupportedDatastore +} + +func init() { + t["BaseUnsupportedDatastore"] = reflect.TypeOf((*UnsupportedDatastore)(nil)).Elem() +} + +func (b *UpgradeEvent) GetUpgradeEvent() *UpgradeEvent { return b } + +type BaseUpgradeEvent interface { + GetUpgradeEvent() *UpgradeEvent +} + +func init() { + t["BaseUpgradeEvent"] = reflect.TypeOf((*UpgradeEvent)(nil)).Elem() +} + +func (b *UserSearchResult) GetUserSearchResult() *UserSearchResult { return b } + +type BaseUserSearchResult interface { + GetUserSearchResult() *UserSearchResult +} + +func init() { + t["BaseUserSearchResult"] = reflect.TypeOf((*UserSearchResult)(nil)).Elem() +} + +func (b *VAppConfigFault) GetVAppConfigFault() *VAppConfigFault { return b } + +type BaseVAppConfigFault interface { + GetVAppConfigFault() *VAppConfigFault +} + +func init() { + t["BaseVAppConfigFault"] = reflect.TypeOf((*VAppConfigFault)(nil)).Elem() +} + +func (b *VAppPropertyFault) GetVAppPropertyFault() *VAppPropertyFault { return b } + +type BaseVAppPropertyFault interface { + GetVAppPropertyFault() *VAppPropertyFault +} + +func init() { + t["BaseVAppPropertyFault"] = reflect.TypeOf((*VAppPropertyFault)(nil)).Elem() +} + +func (b *VMotionInterfaceIssue) GetVMotionInterfaceIssue() *VMotionInterfaceIssue { return b } + +type BaseVMotionInterfaceIssue interface { + GetVMotionInterfaceIssue() *VMotionInterfaceIssue +} + +func init() { + t["BaseVMotionInterfaceIssue"] = reflect.TypeOf((*VMotionInterfaceIssue)(nil)).Elem() +} + +func (b *VMwareDVSHealthCheckConfig) GetVMwareDVSHealthCheckConfig() *VMwareDVSHealthCheckConfig { + return b +} + +type BaseVMwareDVSHealthCheckConfig interface { + GetVMwareDVSHealthCheckConfig() *VMwareDVSHealthCheckConfig +} + +func init() { + t["BaseVMwareDVSHealthCheckConfig"] = reflect.TypeOf((*VMwareDVSHealthCheckConfig)(nil)).Elem() +} + +func (b *VimFault) GetVimFault() *VimFault { return b } + +type BaseVimFault interface { + GetVimFault() *VimFault +} + +func init() { + t["BaseVimFault"] = reflect.TypeOf((*VimFault)(nil)).Elem() +} + +func (b *VirtualController) GetVirtualController() *VirtualController { return b } + +type BaseVirtualController interface { + GetVirtualController() *VirtualController +} + +func init() { + t["BaseVirtualController"] = reflect.TypeOf((*VirtualController)(nil)).Elem() +} + +func (b *VirtualControllerOption) GetVirtualControllerOption() *VirtualControllerOption { return b } + +type BaseVirtualControllerOption interface { + GetVirtualControllerOption() *VirtualControllerOption +} + +func init() { + t["BaseVirtualControllerOption"] = reflect.TypeOf((*VirtualControllerOption)(nil)).Elem() +} + +func (b *VirtualDevice) GetVirtualDevice() *VirtualDevice { return b } + +type BaseVirtualDevice interface { + GetVirtualDevice() *VirtualDevice +} + +func init() { + t["BaseVirtualDevice"] = reflect.TypeOf((*VirtualDevice)(nil)).Elem() +} + +func (b *VirtualDeviceBackingInfo) GetVirtualDeviceBackingInfo() *VirtualDeviceBackingInfo { return b } + +type BaseVirtualDeviceBackingInfo interface { + GetVirtualDeviceBackingInfo() *VirtualDeviceBackingInfo +} + +func init() { + t["BaseVirtualDeviceBackingInfo"] = reflect.TypeOf((*VirtualDeviceBackingInfo)(nil)).Elem() +} + +func (b *VirtualDeviceBackingOption) GetVirtualDeviceBackingOption() *VirtualDeviceBackingOption { + return b +} + +type BaseVirtualDeviceBackingOption interface { + GetVirtualDeviceBackingOption() *VirtualDeviceBackingOption +} + +func init() { + t["BaseVirtualDeviceBackingOption"] = reflect.TypeOf((*VirtualDeviceBackingOption)(nil)).Elem() +} + +func (b *VirtualDeviceBusSlotInfo) GetVirtualDeviceBusSlotInfo() *VirtualDeviceBusSlotInfo { return b } + +type BaseVirtualDeviceBusSlotInfo interface { + GetVirtualDeviceBusSlotInfo() *VirtualDeviceBusSlotInfo +} + +func init() { + t["BaseVirtualDeviceBusSlotInfo"] = reflect.TypeOf((*VirtualDeviceBusSlotInfo)(nil)).Elem() +} + +func (b *VirtualDeviceConfigSpec) GetVirtualDeviceConfigSpec() *VirtualDeviceConfigSpec { return b } + +type BaseVirtualDeviceConfigSpec interface { + GetVirtualDeviceConfigSpec() *VirtualDeviceConfigSpec +} + +func init() { + t["BaseVirtualDeviceConfigSpec"] = reflect.TypeOf((*VirtualDeviceConfigSpec)(nil)).Elem() +} + +func (b *VirtualDeviceDeviceBackingInfo) GetVirtualDeviceDeviceBackingInfo() *VirtualDeviceDeviceBackingInfo { + return b +} + +type BaseVirtualDeviceDeviceBackingInfo interface { + GetVirtualDeviceDeviceBackingInfo() *VirtualDeviceDeviceBackingInfo +} + +func init() { + t["BaseVirtualDeviceDeviceBackingInfo"] = reflect.TypeOf((*VirtualDeviceDeviceBackingInfo)(nil)).Elem() +} + +func (b *VirtualDeviceDeviceBackingOption) GetVirtualDeviceDeviceBackingOption() *VirtualDeviceDeviceBackingOption { + return b +} + +type BaseVirtualDeviceDeviceBackingOption interface { + GetVirtualDeviceDeviceBackingOption() *VirtualDeviceDeviceBackingOption +} + +func init() { + t["BaseVirtualDeviceDeviceBackingOption"] = reflect.TypeOf((*VirtualDeviceDeviceBackingOption)(nil)).Elem() +} + +func (b *VirtualDeviceFileBackingInfo) GetVirtualDeviceFileBackingInfo() *VirtualDeviceFileBackingInfo { + return b +} + +type BaseVirtualDeviceFileBackingInfo interface { + GetVirtualDeviceFileBackingInfo() *VirtualDeviceFileBackingInfo +} + +func init() { + t["BaseVirtualDeviceFileBackingInfo"] = reflect.TypeOf((*VirtualDeviceFileBackingInfo)(nil)).Elem() +} + +func (b *VirtualDeviceFileBackingOption) GetVirtualDeviceFileBackingOption() *VirtualDeviceFileBackingOption { + return b +} + +type BaseVirtualDeviceFileBackingOption interface { + GetVirtualDeviceFileBackingOption() *VirtualDeviceFileBackingOption +} + +func init() { + t["BaseVirtualDeviceFileBackingOption"] = reflect.TypeOf((*VirtualDeviceFileBackingOption)(nil)).Elem() +} + +func (b *VirtualDeviceOption) GetVirtualDeviceOption() *VirtualDeviceOption { return b } + +type BaseVirtualDeviceOption interface { + GetVirtualDeviceOption() *VirtualDeviceOption +} + +func init() { + t["BaseVirtualDeviceOption"] = reflect.TypeOf((*VirtualDeviceOption)(nil)).Elem() +} + +func (b *VirtualDevicePciBusSlotInfo) GetVirtualDevicePciBusSlotInfo() *VirtualDevicePciBusSlotInfo { + return b +} + +type BaseVirtualDevicePciBusSlotInfo interface { + GetVirtualDevicePciBusSlotInfo() *VirtualDevicePciBusSlotInfo +} + +func init() { + t["BaseVirtualDevicePciBusSlotInfo"] = reflect.TypeOf((*VirtualDevicePciBusSlotInfo)(nil)).Elem() +} + +func (b *VirtualDevicePipeBackingInfo) GetVirtualDevicePipeBackingInfo() *VirtualDevicePipeBackingInfo { + return b +} + +type BaseVirtualDevicePipeBackingInfo interface { + GetVirtualDevicePipeBackingInfo() *VirtualDevicePipeBackingInfo +} + +func init() { + t["BaseVirtualDevicePipeBackingInfo"] = reflect.TypeOf((*VirtualDevicePipeBackingInfo)(nil)).Elem() +} + +func (b *VirtualDevicePipeBackingOption) GetVirtualDevicePipeBackingOption() *VirtualDevicePipeBackingOption { + return b +} + +type BaseVirtualDevicePipeBackingOption interface { + GetVirtualDevicePipeBackingOption() *VirtualDevicePipeBackingOption +} + +func init() { + t["BaseVirtualDevicePipeBackingOption"] = reflect.TypeOf((*VirtualDevicePipeBackingOption)(nil)).Elem() +} + +func (b *VirtualDeviceRemoteDeviceBackingInfo) GetVirtualDeviceRemoteDeviceBackingInfo() *VirtualDeviceRemoteDeviceBackingInfo { + return b +} + +type BaseVirtualDeviceRemoteDeviceBackingInfo interface { + GetVirtualDeviceRemoteDeviceBackingInfo() *VirtualDeviceRemoteDeviceBackingInfo +} + +func init() { + t["BaseVirtualDeviceRemoteDeviceBackingInfo"] = reflect.TypeOf((*VirtualDeviceRemoteDeviceBackingInfo)(nil)).Elem() +} + +func (b *VirtualDeviceRemoteDeviceBackingOption) GetVirtualDeviceRemoteDeviceBackingOption() *VirtualDeviceRemoteDeviceBackingOption { + return b +} + +type BaseVirtualDeviceRemoteDeviceBackingOption interface { + GetVirtualDeviceRemoteDeviceBackingOption() *VirtualDeviceRemoteDeviceBackingOption +} + +func init() { + t["BaseVirtualDeviceRemoteDeviceBackingOption"] = reflect.TypeOf((*VirtualDeviceRemoteDeviceBackingOption)(nil)).Elem() +} + +func (b *VirtualDeviceURIBackingInfo) GetVirtualDeviceURIBackingInfo() *VirtualDeviceURIBackingInfo { + return b +} + +type BaseVirtualDeviceURIBackingInfo interface { + GetVirtualDeviceURIBackingInfo() *VirtualDeviceURIBackingInfo +} + +func init() { + t["BaseVirtualDeviceURIBackingInfo"] = reflect.TypeOf((*VirtualDeviceURIBackingInfo)(nil)).Elem() +} + +func (b *VirtualDeviceURIBackingOption) GetVirtualDeviceURIBackingOption() *VirtualDeviceURIBackingOption { + return b +} + +type BaseVirtualDeviceURIBackingOption interface { + GetVirtualDeviceURIBackingOption() *VirtualDeviceURIBackingOption +} + +func init() { + t["BaseVirtualDeviceURIBackingOption"] = reflect.TypeOf((*VirtualDeviceURIBackingOption)(nil)).Elem() +} + +func (b *VirtualDiskRawDiskVer2BackingInfo) GetVirtualDiskRawDiskVer2BackingInfo() *VirtualDiskRawDiskVer2BackingInfo { + return b +} + +type BaseVirtualDiskRawDiskVer2BackingInfo interface { + GetVirtualDiskRawDiskVer2BackingInfo() *VirtualDiskRawDiskVer2BackingInfo +} + +func init() { + t["BaseVirtualDiskRawDiskVer2BackingInfo"] = reflect.TypeOf((*VirtualDiskRawDiskVer2BackingInfo)(nil)).Elem() +} + +func (b *VirtualDiskRawDiskVer2BackingOption) GetVirtualDiskRawDiskVer2BackingOption() *VirtualDiskRawDiskVer2BackingOption { + return b +} + +type BaseVirtualDiskRawDiskVer2BackingOption interface { + GetVirtualDiskRawDiskVer2BackingOption() *VirtualDiskRawDiskVer2BackingOption +} + +func init() { + t["BaseVirtualDiskRawDiskVer2BackingOption"] = reflect.TypeOf((*VirtualDiskRawDiskVer2BackingOption)(nil)).Elem() +} + +func (b *VirtualDiskSpec) GetVirtualDiskSpec() *VirtualDiskSpec { return b } + +type BaseVirtualDiskSpec interface { + GetVirtualDiskSpec() *VirtualDiskSpec +} + +func init() { + t["BaseVirtualDiskSpec"] = reflect.TypeOf((*VirtualDiskSpec)(nil)).Elem() +} + +func (b *VirtualEthernetCard) GetVirtualEthernetCard() *VirtualEthernetCard { return b } + +type BaseVirtualEthernetCard interface { + GetVirtualEthernetCard() *VirtualEthernetCard +} + +func init() { + t["BaseVirtualEthernetCard"] = reflect.TypeOf((*VirtualEthernetCard)(nil)).Elem() +} + +func (b *VirtualEthernetCardOption) GetVirtualEthernetCardOption() *VirtualEthernetCardOption { + return b +} + +type BaseVirtualEthernetCardOption interface { + GetVirtualEthernetCardOption() *VirtualEthernetCardOption +} + +func init() { + t["BaseVirtualEthernetCardOption"] = reflect.TypeOf((*VirtualEthernetCardOption)(nil)).Elem() +} + +func (b *VirtualHardwareCompatibilityIssue) GetVirtualHardwareCompatibilityIssue() *VirtualHardwareCompatibilityIssue { + return b +} + +type BaseVirtualHardwareCompatibilityIssue interface { + GetVirtualHardwareCompatibilityIssue() *VirtualHardwareCompatibilityIssue +} + +func init() { + t["BaseVirtualHardwareCompatibilityIssue"] = reflect.TypeOf((*VirtualHardwareCompatibilityIssue)(nil)).Elem() +} + +func (b *VirtualMachineBootOptionsBootableDevice) GetVirtualMachineBootOptionsBootableDevice() *VirtualMachineBootOptionsBootableDevice { + return b +} + +type BaseVirtualMachineBootOptionsBootableDevice interface { + GetVirtualMachineBootOptionsBootableDevice() *VirtualMachineBootOptionsBootableDevice +} + +func init() { + t["BaseVirtualMachineBootOptionsBootableDevice"] = reflect.TypeOf((*VirtualMachineBootOptionsBootableDevice)(nil)).Elem() +} + +func (b *VirtualMachineDeviceRuntimeInfoDeviceRuntimeState) GetVirtualMachineDeviceRuntimeInfoDeviceRuntimeState() *VirtualMachineDeviceRuntimeInfoDeviceRuntimeState { + return b +} + +type BaseVirtualMachineDeviceRuntimeInfoDeviceRuntimeState interface { + GetVirtualMachineDeviceRuntimeInfoDeviceRuntimeState() *VirtualMachineDeviceRuntimeInfoDeviceRuntimeState +} + +func init() { + t["BaseVirtualMachineDeviceRuntimeInfoDeviceRuntimeState"] = reflect.TypeOf((*VirtualMachineDeviceRuntimeInfoDeviceRuntimeState)(nil)).Elem() +} + +func (b *VirtualMachineDiskDeviceInfo) GetVirtualMachineDiskDeviceInfo() *VirtualMachineDiskDeviceInfo { + return b +} + +type BaseVirtualMachineDiskDeviceInfo interface { + GetVirtualMachineDiskDeviceInfo() *VirtualMachineDiskDeviceInfo +} + +func init() { + t["BaseVirtualMachineDiskDeviceInfo"] = reflect.TypeOf((*VirtualMachineDiskDeviceInfo)(nil)).Elem() +} + +func (b *VirtualMachinePciPassthroughInfo) GetVirtualMachinePciPassthroughInfo() *VirtualMachinePciPassthroughInfo { + return b +} + +type BaseVirtualMachinePciPassthroughInfo interface { + GetVirtualMachinePciPassthroughInfo() *VirtualMachinePciPassthroughInfo +} + +func init() { + t["BaseVirtualMachinePciPassthroughInfo"] = reflect.TypeOf((*VirtualMachinePciPassthroughInfo)(nil)).Elem() +} + +func (b *VirtualMachineProfileSpec) GetVirtualMachineProfileSpec() *VirtualMachineProfileSpec { + return b +} + +type BaseVirtualMachineProfileSpec interface { + GetVirtualMachineProfileSpec() *VirtualMachineProfileSpec +} + +func init() { + t["BaseVirtualMachineProfileSpec"] = reflect.TypeOf((*VirtualMachineProfileSpec)(nil)).Elem() +} + +func (b *VirtualMachineTargetInfo) GetVirtualMachineTargetInfo() *VirtualMachineTargetInfo { return b } + +type BaseVirtualMachineTargetInfo interface { + GetVirtualMachineTargetInfo() *VirtualMachineTargetInfo +} + +func init() { + t["BaseVirtualMachineTargetInfo"] = reflect.TypeOf((*VirtualMachineTargetInfo)(nil)).Elem() +} + +func (b *VirtualPCIPassthroughPluginBackingInfo) GetVirtualPCIPassthroughPluginBackingInfo() *VirtualPCIPassthroughPluginBackingInfo { + return b +} + +type BaseVirtualPCIPassthroughPluginBackingInfo interface { + GetVirtualPCIPassthroughPluginBackingInfo() *VirtualPCIPassthroughPluginBackingInfo +} + +func init() { + t["BaseVirtualPCIPassthroughPluginBackingInfo"] = reflect.TypeOf((*VirtualPCIPassthroughPluginBackingInfo)(nil)).Elem() +} + +func (b *VirtualPCIPassthroughPluginBackingOption) GetVirtualPCIPassthroughPluginBackingOption() *VirtualPCIPassthroughPluginBackingOption { + return b +} + +type BaseVirtualPCIPassthroughPluginBackingOption interface { + GetVirtualPCIPassthroughPluginBackingOption() *VirtualPCIPassthroughPluginBackingOption +} + +func init() { + t["BaseVirtualPCIPassthroughPluginBackingOption"] = reflect.TypeOf((*VirtualPCIPassthroughPluginBackingOption)(nil)).Elem() +} + +func (b *VirtualSATAController) GetVirtualSATAController() *VirtualSATAController { return b } + +type BaseVirtualSATAController interface { + GetVirtualSATAController() *VirtualSATAController +} + +func init() { + t["BaseVirtualSATAController"] = reflect.TypeOf((*VirtualSATAController)(nil)).Elem() +} + +func (b *VirtualSATAControllerOption) GetVirtualSATAControllerOption() *VirtualSATAControllerOption { + return b +} + +type BaseVirtualSATAControllerOption interface { + GetVirtualSATAControllerOption() *VirtualSATAControllerOption +} + +func init() { + t["BaseVirtualSATAControllerOption"] = reflect.TypeOf((*VirtualSATAControllerOption)(nil)).Elem() +} + +func (b *VirtualSCSIController) GetVirtualSCSIController() *VirtualSCSIController { return b } + +type BaseVirtualSCSIController interface { + GetVirtualSCSIController() *VirtualSCSIController +} + +func init() { + t["BaseVirtualSCSIController"] = reflect.TypeOf((*VirtualSCSIController)(nil)).Elem() +} + +func (b *VirtualSCSIControllerOption) GetVirtualSCSIControllerOption() *VirtualSCSIControllerOption { + return b +} + +type BaseVirtualSCSIControllerOption interface { + GetVirtualSCSIControllerOption() *VirtualSCSIControllerOption +} + +func init() { + t["BaseVirtualSCSIControllerOption"] = reflect.TypeOf((*VirtualSCSIControllerOption)(nil)).Elem() +} + +func (b *VirtualSoundCard) GetVirtualSoundCard() *VirtualSoundCard { return b } + +type BaseVirtualSoundCard interface { + GetVirtualSoundCard() *VirtualSoundCard +} + +func init() { + t["BaseVirtualSoundCard"] = reflect.TypeOf((*VirtualSoundCard)(nil)).Elem() +} + +func (b *VirtualSoundCardOption) GetVirtualSoundCardOption() *VirtualSoundCardOption { return b } + +type BaseVirtualSoundCardOption interface { + GetVirtualSoundCardOption() *VirtualSoundCardOption +} + +func init() { + t["BaseVirtualSoundCardOption"] = reflect.TypeOf((*VirtualSoundCardOption)(nil)).Elem() +} + +func (b *VirtualVmxnet) GetVirtualVmxnet() *VirtualVmxnet { return b } + +type BaseVirtualVmxnet interface { + GetVirtualVmxnet() *VirtualVmxnet +} + +func init() { + t["BaseVirtualVmxnet"] = reflect.TypeOf((*VirtualVmxnet)(nil)).Elem() +} + +func (b *VirtualVmxnetOption) GetVirtualVmxnetOption() *VirtualVmxnetOption { return b } + +type BaseVirtualVmxnetOption interface { + GetVirtualVmxnetOption() *VirtualVmxnetOption +} + +func init() { + t["BaseVirtualVmxnetOption"] = reflect.TypeOf((*VirtualVmxnetOption)(nil)).Elem() +} + +func (b *VmCloneEvent) GetVmCloneEvent() *VmCloneEvent { return b } + +type BaseVmCloneEvent interface { + GetVmCloneEvent() *VmCloneEvent +} + +func init() { + t["BaseVmCloneEvent"] = reflect.TypeOf((*VmCloneEvent)(nil)).Elem() +} + +func (b *VmConfigFault) GetVmConfigFault() *VmConfigFault { return b } + +type BaseVmConfigFault interface { + GetVmConfigFault() *VmConfigFault +} + +func init() { + t["BaseVmConfigFault"] = reflect.TypeOf((*VmConfigFault)(nil)).Elem() +} + +func (b *VmConfigFileInfo) GetVmConfigFileInfo() *VmConfigFileInfo { return b } + +type BaseVmConfigFileInfo interface { + GetVmConfigFileInfo() *VmConfigFileInfo +} + +func init() { + t["BaseVmConfigFileInfo"] = reflect.TypeOf((*VmConfigFileInfo)(nil)).Elem() +} + +func (b *VmConfigFileQuery) GetVmConfigFileQuery() *VmConfigFileQuery { return b } + +type BaseVmConfigFileQuery interface { + GetVmConfigFileQuery() *VmConfigFileQuery +} + +func init() { + t["BaseVmConfigFileQuery"] = reflect.TypeOf((*VmConfigFileQuery)(nil)).Elem() +} + +func (b *VmConfigInfo) GetVmConfigInfo() *VmConfigInfo { return b } + +type BaseVmConfigInfo interface { + GetVmConfigInfo() *VmConfigInfo +} + +func init() { + t["BaseVmConfigInfo"] = reflect.TypeOf((*VmConfigInfo)(nil)).Elem() +} + +func (b *VmConfigSpec) GetVmConfigSpec() *VmConfigSpec { return b } + +type BaseVmConfigSpec interface { + GetVmConfigSpec() *VmConfigSpec +} + +func init() { + t["BaseVmConfigSpec"] = reflect.TypeOf((*VmConfigSpec)(nil)).Elem() +} + +func (b *VmDasBeingResetEvent) GetVmDasBeingResetEvent() *VmDasBeingResetEvent { return b } + +type BaseVmDasBeingResetEvent interface { + GetVmDasBeingResetEvent() *VmDasBeingResetEvent +} + +func init() { + t["BaseVmDasBeingResetEvent"] = reflect.TypeOf((*VmDasBeingResetEvent)(nil)).Elem() +} + +func (b *VmEvent) GetVmEvent() *VmEvent { return b } + +type BaseVmEvent interface { + GetVmEvent() *VmEvent +} + +func init() { + t["BaseVmEvent"] = reflect.TypeOf((*VmEvent)(nil)).Elem() +} + +func (b *VmFaultToleranceIssue) GetVmFaultToleranceIssue() *VmFaultToleranceIssue { return b } + +type BaseVmFaultToleranceIssue interface { + GetVmFaultToleranceIssue() *VmFaultToleranceIssue +} + +func init() { + t["BaseVmFaultToleranceIssue"] = reflect.TypeOf((*VmFaultToleranceIssue)(nil)).Elem() +} + +func (b *VmMigratedEvent) GetVmMigratedEvent() *VmMigratedEvent { return b } + +type BaseVmMigratedEvent interface { + GetVmMigratedEvent() *VmMigratedEvent +} + +func init() { + t["BaseVmMigratedEvent"] = reflect.TypeOf((*VmMigratedEvent)(nil)).Elem() +} + +func (b *VmPoweredOffEvent) GetVmPoweredOffEvent() *VmPoweredOffEvent { return b } + +type BaseVmPoweredOffEvent interface { + GetVmPoweredOffEvent() *VmPoweredOffEvent +} + +func init() { + t["BaseVmPoweredOffEvent"] = reflect.TypeOf((*VmPoweredOffEvent)(nil)).Elem() +} + +func (b *VmPoweredOnEvent) GetVmPoweredOnEvent() *VmPoweredOnEvent { return b } + +type BaseVmPoweredOnEvent interface { + GetVmPoweredOnEvent() *VmPoweredOnEvent +} + +func init() { + t["BaseVmPoweredOnEvent"] = reflect.TypeOf((*VmPoweredOnEvent)(nil)).Elem() +} + +func (b *VmRelocateSpecEvent) GetVmRelocateSpecEvent() *VmRelocateSpecEvent { return b } + +type BaseVmRelocateSpecEvent interface { + GetVmRelocateSpecEvent() *VmRelocateSpecEvent +} + +func init() { + t["BaseVmRelocateSpecEvent"] = reflect.TypeOf((*VmRelocateSpecEvent)(nil)).Elem() +} + +func (b *VmStartingEvent) GetVmStartingEvent() *VmStartingEvent { return b } + +type BaseVmStartingEvent interface { + GetVmStartingEvent() *VmStartingEvent +} + +func init() { + t["BaseVmStartingEvent"] = reflect.TypeOf((*VmStartingEvent)(nil)).Elem() +} + +func (b *VmToolsUpgradeFault) GetVmToolsUpgradeFault() *VmToolsUpgradeFault { return b } + +type BaseVmToolsUpgradeFault interface { + GetVmToolsUpgradeFault() *VmToolsUpgradeFault +} + +func init() { + t["BaseVmToolsUpgradeFault"] = reflect.TypeOf((*VmToolsUpgradeFault)(nil)).Elem() +} + +func (b *VmfsDatastoreBaseOption) GetVmfsDatastoreBaseOption() *VmfsDatastoreBaseOption { return b } + +type BaseVmfsDatastoreBaseOption interface { + GetVmfsDatastoreBaseOption() *VmfsDatastoreBaseOption +} + +func init() { + t["BaseVmfsDatastoreBaseOption"] = reflect.TypeOf((*VmfsDatastoreBaseOption)(nil)).Elem() +} + +func (b *VmfsDatastoreSingleExtentOption) GetVmfsDatastoreSingleExtentOption() *VmfsDatastoreSingleExtentOption { + return b +} + +type BaseVmfsDatastoreSingleExtentOption interface { + GetVmfsDatastoreSingleExtentOption() *VmfsDatastoreSingleExtentOption +} + +func init() { + t["BaseVmfsDatastoreSingleExtentOption"] = reflect.TypeOf((*VmfsDatastoreSingleExtentOption)(nil)).Elem() +} + +func (b *VmfsDatastoreSpec) GetVmfsDatastoreSpec() *VmfsDatastoreSpec { return b } + +type BaseVmfsDatastoreSpec interface { + GetVmfsDatastoreSpec() *VmfsDatastoreSpec +} + +func init() { + t["BaseVmfsDatastoreSpec"] = reflect.TypeOf((*VmfsDatastoreSpec)(nil)).Elem() +} + +func (b *VmfsMountFault) GetVmfsMountFault() *VmfsMountFault { return b } + +type BaseVmfsMountFault interface { + GetVmfsMountFault() *VmfsMountFault +} + +func init() { + t["BaseVmfsMountFault"] = reflect.TypeOf((*VmfsMountFault)(nil)).Elem() +} + +func (b *VmwareDistributedVirtualSwitchVlanSpec) GetVmwareDistributedVirtualSwitchVlanSpec() *VmwareDistributedVirtualSwitchVlanSpec { + return b +} + +type BaseVmwareDistributedVirtualSwitchVlanSpec interface { + GetVmwareDistributedVirtualSwitchVlanSpec() *VmwareDistributedVirtualSwitchVlanSpec +} + +func init() { + t["BaseVmwareDistributedVirtualSwitchVlanSpec"] = reflect.TypeOf((*VmwareDistributedVirtualSwitchVlanSpec)(nil)).Elem() +} + +func (b *VsanDiskFault) GetVsanDiskFault() *VsanDiskFault { return b } + +type BaseVsanDiskFault interface { + GetVsanDiskFault() *VsanDiskFault +} + +func init() { + t["BaseVsanDiskFault"] = reflect.TypeOf((*VsanDiskFault)(nil)).Elem() +} + +func (b *VsanFault) GetVsanFault() *VsanFault { return b } + +type BaseVsanFault interface { + GetVsanFault() *VsanFault +} + +func init() { + t["BaseVsanFault"] = reflect.TypeOf((*VsanFault)(nil)).Elem() +} + +func (b *VsanUpgradeSystemPreflightCheckIssue) GetVsanUpgradeSystemPreflightCheckIssue() *VsanUpgradeSystemPreflightCheckIssue { + return b +} + +type BaseVsanUpgradeSystemPreflightCheckIssue interface { + GetVsanUpgradeSystemPreflightCheckIssue() *VsanUpgradeSystemPreflightCheckIssue +} + +func init() { + t["BaseVsanUpgradeSystemPreflightCheckIssue"] = reflect.TypeOf((*VsanUpgradeSystemPreflightCheckIssue)(nil)).Elem() +} + +func (b *VsanUpgradeSystemUpgradeHistoryItem) GetVsanUpgradeSystemUpgradeHistoryItem() *VsanUpgradeSystemUpgradeHistoryItem { + return b +} + +type BaseVsanUpgradeSystemUpgradeHistoryItem interface { + GetVsanUpgradeSystemUpgradeHistoryItem() *VsanUpgradeSystemUpgradeHistoryItem +} + +func init() { + t["BaseVsanUpgradeSystemUpgradeHistoryItem"] = reflect.TypeOf((*VsanUpgradeSystemUpgradeHistoryItem)(nil)).Elem() +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/vim25/types/internal.go juju-core-2.0.2/src/github.com/vmware/govmomi/vim25/types/internal.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/vim25/types/internal.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/vim25/types/internal.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,262 @@ +/* +Copyright (c) 2014 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package types + +import "reflect" + +type DynamicTypeMgrQueryMoInstances struct { + This ManagedObjectReference `xml:"_this"` + FilterSpec BaseDynamicTypeMgrFilterSpec `xml:"filterSpec,omitempty,typeattr"` +} + +type DynamicTypeMgrQueryMoInstancesResponse struct { + Returnval []DynamicTypeMgrMoInstance `xml:"urn:vim25 returnval"` +} + +type DynamicTypeEnumTypeInfo struct { + DynamicData + + Name string `xml:"name"` + WsdlName string `xml:"wsdlName"` + Version string `xml:"version"` + Value []string `xml:"value,omitempty"` + Annotation []DynamicTypeMgrAnnotation `xml:"annotation,omitempty"` +} + +func init() { + t["DynamicTypeEnumTypeInfo"] = reflect.TypeOf((*DynamicTypeEnumTypeInfo)(nil)).Elem() +} + +type DynamicTypeMgrAllTypeInfo struct { + DynamicData + + ManagedTypeInfo []DynamicTypeMgrManagedTypeInfo `xml:"managedTypeInfo,omitempty"` + EnumTypeInfo []DynamicTypeEnumTypeInfo `xml:"enumTypeInfo,omitempty"` + DataTypeInfo []DynamicTypeMgrDataTypeInfo `xml:"dataTypeInfo,omitempty"` +} + +func init() { + t["DynamicTypeMgrAllTypeInfo"] = reflect.TypeOf((*DynamicTypeMgrAllTypeInfo)(nil)).Elem() +} + +type DynamicTypeMgrAnnotation struct { + DynamicData + + Name string `xml:"name"` + Parameter []string `xml:"parameter,omitempty"` +} + +func init() { + t["DynamicTypeMgrAnnotation"] = reflect.TypeOf((*DynamicTypeMgrAnnotation)(nil)).Elem() +} + +type DynamicTypeMgrDataTypeInfo struct { + DynamicData + + Name string `xml:"name"` + WsdlName string `xml:"wsdlName"` + Version string `xml:"version"` + Base []string `xml:"base,omitempty"` + Property []DynamicTypeMgrPropertyTypeInfo `xml:"property,omitempty"` + Annotation []DynamicTypeMgrAnnotation `xml:"annotation,omitempty"` +} + +func init() { + t["DynamicTypeMgrDataTypeInfo"] = reflect.TypeOf((*DynamicTypeMgrDataTypeInfo)(nil)).Elem() +} + +func (b *DynamicTypeMgrFilterSpec) GetDynamicTypeMgrFilterSpec() *DynamicTypeMgrFilterSpec { return b } + +type BaseDynamicTypeMgrFilterSpec interface { + GetDynamicTypeMgrFilterSpec() *DynamicTypeMgrFilterSpec +} + +type DynamicTypeMgrFilterSpec struct { + DynamicData +} + +func init() { + t["DynamicTypeMgrFilterSpec"] = reflect.TypeOf((*DynamicTypeMgrFilterSpec)(nil)).Elem() +} + +type DynamicTypeMgrManagedTypeInfo struct { + DynamicData + + Name string `xml:"name"` + WsdlName string `xml:"wsdlName"` + Version string `xml:"version"` + Base []string `xml:"base,omitempty"` + Property []DynamicTypeMgrPropertyTypeInfo `xml:"property,omitempty"` + Method []DynamicTypeMgrMethodTypeInfo `xml:"method,omitempty"` + Annotation []DynamicTypeMgrAnnotation `xml:"annotation,omitempty"` +} + +func init() { + t["DynamicTypeMgrManagedTypeInfo"] = reflect.TypeOf((*DynamicTypeMgrManagedTypeInfo)(nil)).Elem() +} + +type DynamicTypeMgrMethodTypeInfo struct { + DynamicData + + Name string `xml:"name"` + WsdlName string `xml:"wsdlName"` + Version string `xml:"version"` + ParamTypeInfo []DynamicTypeMgrParamTypeInfo `xml:"paramTypeInfo,omitempty"` + ReturnTypeInfo *DynamicTypeMgrParamTypeInfo `xml:"returnTypeInfo,omitempty"` + Fault []string `xml:"fault,omitempty"` + PrivId string `xml:"privId,omitempty"` + Annotation []DynamicTypeMgrAnnotation `xml:"annotation,omitempty"` +} + +func init() { + t["DynamicTypeMgrMethodTypeInfo"] = reflect.TypeOf((*DynamicTypeMgrMethodTypeInfo)(nil)).Elem() +} + +type DynamicTypeMgrMoFilterSpec struct { + DynamicTypeMgrFilterSpec + + Id string `xml:"id,omitempty"` + TypeSubstr string `xml:"typeSubstr,omitempty"` +} + +func init() { + t["DynamicTypeMgrMoFilterSpec"] = reflect.TypeOf((*DynamicTypeMgrMoFilterSpec)(nil)).Elem() +} + +type DynamicTypeMgrMoInstance struct { + DynamicData + + Id string `xml:"id"` + MoType string `xml:"moType"` +} + +func init() { + t["DynamicTypeMgrMoInstance"] = reflect.TypeOf((*DynamicTypeMgrMoInstance)(nil)).Elem() +} + +type DynamicTypeMgrParamTypeInfo struct { + DynamicData + + Name string `xml:"name"` + Version string `xml:"version"` + Type string `xml:"type"` + PrivId string `xml:"privId,omitempty"` + Annotation []DynamicTypeMgrAnnotation `xml:"annotation,omitempty"` +} + +func init() { + t["DynamicTypeMgrParamTypeInfo"] = reflect.TypeOf((*DynamicTypeMgrParamTypeInfo)(nil)).Elem() +} + +type DynamicTypeMgrPropertyTypeInfo struct { + DynamicData + + Name string `xml:"name"` + Version string `xml:"version"` + Type string `xml:"type"` + PrivId string `xml:"privId,omitempty"` + MsgIdFormat string `xml:"msgIdFormat,omitempty"` + Annotation []DynamicTypeMgrAnnotation `xml:"annotation,omitempty"` +} + +type DynamicTypeMgrQueryTypeInfo struct { + This ManagedObjectReference `xml:"_this"` + FilterSpec BaseDynamicTypeMgrFilterSpec `xml:"filterSpec,omitempty,typeattr"` +} + +type DynamicTypeMgrQueryTypeInfoResponse struct { + Returnval DynamicTypeMgrAllTypeInfo `xml:"urn:vim25 returnval"` +} + +func init() { + t["DynamicTypeMgrPropertyTypeInfo"] = reflect.TypeOf((*DynamicTypeMgrPropertyTypeInfo)(nil)).Elem() +} + +type DynamicTypeMgrTypeFilterSpec struct { + DynamicTypeMgrFilterSpec + + TypeSubstr string `xml:"typeSubstr,omitempty"` +} + +func init() { + t["DynamicTypeMgrTypeFilterSpec"] = reflect.TypeOf((*DynamicTypeMgrTypeFilterSpec)(nil)).Elem() +} + +type ReflectManagedMethodExecuterSoapArgument struct { + DynamicData + + Name string `xml:"name"` + Val string `xml:"val"` +} + +func init() { + t["ReflectManagedMethodExecuterSoapArgument"] = reflect.TypeOf((*ReflectManagedMethodExecuterSoapArgument)(nil)).Elem() +} + +type ReflectManagedMethodExecuterSoapFault struct { + DynamicData + + FaultMsg string `xml:"faultMsg"` + FaultDetail string `xml:"faultDetail,omitempty"` +} + +func init() { + t["ReflectManagedMethodExecuterSoapFault"] = reflect.TypeOf((*ReflectManagedMethodExecuterSoapFault)(nil)).Elem() +} + +type ReflectManagedMethodExecuterSoapResult struct { + DynamicData + + Response string `xml:"response,omitempty"` + Fault *ReflectManagedMethodExecuterSoapFault `xml:"fault,omitempty"` +} + +type RetrieveDynamicTypeManager struct { + This ManagedObjectReference `xml:"_this"` +} + +type RetrieveDynamicTypeManagerResponse struct { + Returnval *InternalDynamicTypeManager `xml:"urn:vim25 returnval"` +} + +type RetrieveManagedMethodExecuter struct { + This ManagedObjectReference `xml:"_this"` +} + +type RetrieveManagedMethodExecuterResponse struct { + Returnval *ReflectManagedMethodExecuter `xml:"urn:vim25 returnval"` +} + +type InternalDynamicTypeManager struct { + ManagedObjectReference +} + +type ReflectManagedMethodExecuter struct { + ManagedObjectReference +} + +type ExecuteSoap struct { + This ManagedObjectReference `xml:"_this"` + Moid string `xml:"moid"` + Version string `xml:"version"` + Method string `xml:"method"` + Argument []ReflectManagedMethodExecuterSoapArgument `xml:"argument,omitempty"` +} + +type ExecuteSoapResponse struct { + Returnval *ReflectManagedMethodExecuterSoapResult `xml:"urn:vim25 returnval"` +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/vim25/types/registry.go juju-core-2.0.2/src/github.com/vmware/govmomi/vim25/types/registry.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/vim25/types/registry.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/vim25/types/registry.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,30 @@ +/* +Copyright (c) 2014 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package types + +import "reflect" + +var t = map[string]reflect.Type{} + +type Func func(string) (reflect.Type, bool) + +func TypeFunc() Func { + return func(name string) (reflect.Type, bool) { + typ, ok := t[name] + return typ, ok + } +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/vim25/types/registry_test.go juju-core-2.0.2/src/github.com/vmware/govmomi/vim25/types/registry_test.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/vim25/types/registry_test.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/vim25/types/registry_test.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,43 @@ +/* +Copyright (c) 2014 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package types + +import ( + "reflect" + "testing" +) + +func TestTypeFunc(t *testing.T) { + var ok bool + + fn := TypeFunc() + + _, ok = fn("unknown") + if ok { + t.Errorf("Expected ok==false") + } + + actual, ok := fn("UserProfile") + if !ok { + t.Errorf("Expected ok==true") + } + + expected := reflect.TypeOf(UserProfile{}) + if !reflect.DeepEqual(expected, actual) { + t.Errorf("Expected: %#v, actual: %#v", expected, actual) + } +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/vim25/types/types.go juju-core-2.0.2/src/github.com/vmware/govmomi/vim25/types/types.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/vim25/types/types.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/vim25/types/types.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,49702 @@ +/* +Copyright (c) 2014-2016 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package types + +import ( + "net/url" + "reflect" + "time" +) + +type AbdicateDomOwnership AbdicateDomOwnershipRequestType + +func init() { + t["AbdicateDomOwnership"] = reflect.TypeOf((*AbdicateDomOwnership)(nil)).Elem() +} + +type AbdicateDomOwnershipRequestType struct { + This ManagedObjectReference `xml:"_this"` + Uuids []string `xml:"uuids"` +} + +func init() { + t["AbdicateDomOwnershipRequestType"] = reflect.TypeOf((*AbdicateDomOwnershipRequestType)(nil)).Elem() +} + +type AbdicateDomOwnershipResponse struct { + Returnval []string `xml:"returnval,omitempty"` +} + +type AboutInfo struct { + DynamicData + + Name string `xml:"name"` + FullName string `xml:"fullName"` + Vendor string `xml:"vendor"` + Version string `xml:"version"` + Build string `xml:"build"` + LocaleVersion string `xml:"localeVersion,omitempty"` + LocaleBuild string `xml:"localeBuild,omitempty"` + OsType string `xml:"osType"` + ProductLineId string `xml:"productLineId"` + ApiType string `xml:"apiType"` + ApiVersion string `xml:"apiVersion"` + InstanceUuid string `xml:"instanceUuid,omitempty"` + LicenseProductName string `xml:"licenseProductName,omitempty"` + LicenseProductVersion string `xml:"licenseProductVersion,omitempty"` +} + +func init() { + t["AboutInfo"] = reflect.TypeOf((*AboutInfo)(nil)).Elem() +} + +type AccountCreatedEvent struct { + HostEvent + + Spec BaseHostAccountSpec `xml:"spec,typeattr"` + Group bool `xml:"group"` +} + +func init() { + t["AccountCreatedEvent"] = reflect.TypeOf((*AccountCreatedEvent)(nil)).Elem() +} + +type AccountRemovedEvent struct { + HostEvent + + Account string `xml:"account"` + Group bool `xml:"group"` +} + +func init() { + t["AccountRemovedEvent"] = reflect.TypeOf((*AccountRemovedEvent)(nil)).Elem() +} + +type AccountUpdatedEvent struct { + HostEvent + + Spec BaseHostAccountSpec `xml:"spec,typeattr"` + Group bool `xml:"group"` +} + +func init() { + t["AccountUpdatedEvent"] = reflect.TypeOf((*AccountUpdatedEvent)(nil)).Elem() +} + +type AcknowledgeAlarm AcknowledgeAlarmRequestType + +func init() { + t["AcknowledgeAlarm"] = reflect.TypeOf((*AcknowledgeAlarm)(nil)).Elem() +} + +type AcknowledgeAlarmRequestType struct { + This ManagedObjectReference `xml:"_this"` + Alarm ManagedObjectReference `xml:"alarm"` + Entity ManagedObjectReference `xml:"entity"` +} + +func init() { + t["AcknowledgeAlarmRequestType"] = reflect.TypeOf((*AcknowledgeAlarmRequestType)(nil)).Elem() +} + +type AcknowledgeAlarmResponse struct { +} + +type AcquireCimServicesTicket AcquireCimServicesTicketRequestType + +func init() { + t["AcquireCimServicesTicket"] = reflect.TypeOf((*AcquireCimServicesTicket)(nil)).Elem() +} + +type AcquireCimServicesTicketRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["AcquireCimServicesTicketRequestType"] = reflect.TypeOf((*AcquireCimServicesTicketRequestType)(nil)).Elem() +} + +type AcquireCimServicesTicketResponse struct { + Returnval HostServiceTicket `xml:"returnval"` +} + +type AcquireCloneTicket AcquireCloneTicketRequestType + +func init() { + t["AcquireCloneTicket"] = reflect.TypeOf((*AcquireCloneTicket)(nil)).Elem() +} + +type AcquireCloneTicketRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["AcquireCloneTicketRequestType"] = reflect.TypeOf((*AcquireCloneTicketRequestType)(nil)).Elem() +} + +type AcquireCloneTicketResponse struct { + Returnval string `xml:"returnval"` +} + +type AcquireCredentialsInGuest AcquireCredentialsInGuestRequestType + +func init() { + t["AcquireCredentialsInGuest"] = reflect.TypeOf((*AcquireCredentialsInGuest)(nil)).Elem() +} + +type AcquireCredentialsInGuestRequestType struct { + This ManagedObjectReference `xml:"_this"` + Vm ManagedObjectReference `xml:"vm"` + RequestedAuth BaseGuestAuthentication `xml:"requestedAuth,typeattr"` + SessionID int64 `xml:"sessionID,omitempty"` +} + +func init() { + t["AcquireCredentialsInGuestRequestType"] = reflect.TypeOf((*AcquireCredentialsInGuestRequestType)(nil)).Elem() +} + +type AcquireCredentialsInGuestResponse struct { + Returnval BaseGuestAuthentication `xml:"returnval,typeattr"` +} + +type AcquireGenericServiceTicket AcquireGenericServiceTicketRequestType + +func init() { + t["AcquireGenericServiceTicket"] = reflect.TypeOf((*AcquireGenericServiceTicket)(nil)).Elem() +} + +type AcquireGenericServiceTicketRequestType struct { + This ManagedObjectReference `xml:"_this"` + Spec BaseSessionManagerServiceRequestSpec `xml:"spec,typeattr"` +} + +func init() { + t["AcquireGenericServiceTicketRequestType"] = reflect.TypeOf((*AcquireGenericServiceTicketRequestType)(nil)).Elem() +} + +type AcquireGenericServiceTicketResponse struct { + Returnval SessionManagerGenericServiceTicket `xml:"returnval"` +} + +type AcquireLocalTicket AcquireLocalTicketRequestType + +func init() { + t["AcquireLocalTicket"] = reflect.TypeOf((*AcquireLocalTicket)(nil)).Elem() +} + +type AcquireLocalTicketRequestType struct { + This ManagedObjectReference `xml:"_this"` + UserName string `xml:"userName"` +} + +func init() { + t["AcquireLocalTicketRequestType"] = reflect.TypeOf((*AcquireLocalTicketRequestType)(nil)).Elem() +} + +type AcquireLocalTicketResponse struct { + Returnval SessionManagerLocalTicket `xml:"returnval"` +} + +type AcquireMksTicket AcquireMksTicketRequestType + +func init() { + t["AcquireMksTicket"] = reflect.TypeOf((*AcquireMksTicket)(nil)).Elem() +} + +type AcquireMksTicketRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["AcquireMksTicketRequestType"] = reflect.TypeOf((*AcquireMksTicketRequestType)(nil)).Elem() +} + +type AcquireMksTicketResponse struct { + Returnval VirtualMachineMksTicket `xml:"returnval"` +} + +type AcquireTicket AcquireTicketRequestType + +func init() { + t["AcquireTicket"] = reflect.TypeOf((*AcquireTicket)(nil)).Elem() +} + +type AcquireTicketRequestType struct { + This ManagedObjectReference `xml:"_this"` + TicketType string `xml:"ticketType"` +} + +func init() { + t["AcquireTicketRequestType"] = reflect.TypeOf((*AcquireTicketRequestType)(nil)).Elem() +} + +type AcquireTicketResponse struct { + Returnval VirtualMachineTicket `xml:"returnval"` +} + +type Action struct { + DynamicData +} + +func init() { + t["Action"] = reflect.TypeOf((*Action)(nil)).Elem() +} + +type ActiveDirectoryFault struct { + VimFault + + ErrorCode int32 `xml:"errorCode,omitempty"` +} + +func init() { + t["ActiveDirectoryFault"] = reflect.TypeOf((*ActiveDirectoryFault)(nil)).Elem() +} + +type ActiveDirectoryFaultFault BaseActiveDirectoryFault + +func init() { + t["ActiveDirectoryFaultFault"] = reflect.TypeOf((*ActiveDirectoryFaultFault)(nil)).Elem() +} + +type ActiveDirectoryProfile struct { + ApplyProfile +} + +func init() { + t["ActiveDirectoryProfile"] = reflect.TypeOf((*ActiveDirectoryProfile)(nil)).Elem() +} + +type ActiveVMsBlockingEVC struct { + EVCConfigFault + + EvcMode string `xml:"evcMode,omitempty"` + Host []ManagedObjectReference `xml:"host,omitempty"` + HostName []string `xml:"hostName,omitempty"` +} + +func init() { + t["ActiveVMsBlockingEVC"] = reflect.TypeOf((*ActiveVMsBlockingEVC)(nil)).Elem() +} + +type ActiveVMsBlockingEVCFault ActiveVMsBlockingEVC + +func init() { + t["ActiveVMsBlockingEVCFault"] = reflect.TypeOf((*ActiveVMsBlockingEVCFault)(nil)).Elem() +} + +type AddAuthorizationRole AddAuthorizationRoleRequestType + +func init() { + t["AddAuthorizationRole"] = reflect.TypeOf((*AddAuthorizationRole)(nil)).Elem() +} + +type AddAuthorizationRoleRequestType struct { + This ManagedObjectReference `xml:"_this"` + Name string `xml:"name"` + PrivIds []string `xml:"privIds,omitempty"` +} + +func init() { + t["AddAuthorizationRoleRequestType"] = reflect.TypeOf((*AddAuthorizationRoleRequestType)(nil)).Elem() +} + +type AddAuthorizationRoleResponse struct { + Returnval int32 `xml:"returnval"` +} + +type AddCustomFieldDef AddCustomFieldDefRequestType + +func init() { + t["AddCustomFieldDef"] = reflect.TypeOf((*AddCustomFieldDef)(nil)).Elem() +} + +type AddCustomFieldDefRequestType struct { + This ManagedObjectReference `xml:"_this"` + Name string `xml:"name"` + MoType string `xml:"moType,omitempty"` + FieldDefPolicy *PrivilegePolicyDef `xml:"fieldDefPolicy,omitempty"` + FieldPolicy *PrivilegePolicyDef `xml:"fieldPolicy,omitempty"` +} + +func init() { + t["AddCustomFieldDefRequestType"] = reflect.TypeOf((*AddCustomFieldDefRequestType)(nil)).Elem() +} + +type AddCustomFieldDefResponse struct { + Returnval CustomFieldDef `xml:"returnval"` +} + +type AddDVPortgroupRequestType struct { + This ManagedObjectReference `xml:"_this"` + Spec []DVPortgroupConfigSpec `xml:"spec"` +} + +func init() { + t["AddDVPortgroupRequestType"] = reflect.TypeOf((*AddDVPortgroupRequestType)(nil)).Elem() +} + +type AddDVPortgroup_Task AddDVPortgroupRequestType + +func init() { + t["AddDVPortgroup_Task"] = reflect.TypeOf((*AddDVPortgroup_Task)(nil)).Elem() +} + +type AddDVPortgroup_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type AddDisksRequestType struct { + This ManagedObjectReference `xml:"_this"` + Disk []HostScsiDisk `xml:"disk"` +} + +func init() { + t["AddDisksRequestType"] = reflect.TypeOf((*AddDisksRequestType)(nil)).Elem() +} + +type AddDisks_Task AddDisksRequestType + +func init() { + t["AddDisks_Task"] = reflect.TypeOf((*AddDisks_Task)(nil)).Elem() +} + +type AddDisks_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type AddGuestAlias AddGuestAliasRequestType + +func init() { + t["AddGuestAlias"] = reflect.TypeOf((*AddGuestAlias)(nil)).Elem() +} + +type AddGuestAliasRequestType struct { + This ManagedObjectReference `xml:"_this"` + Vm ManagedObjectReference `xml:"vm"` + Auth BaseGuestAuthentication `xml:"auth,typeattr"` + Username string `xml:"username"` + MapCert bool `xml:"mapCert"` + Base64Cert string `xml:"base64Cert"` + AliasInfo GuestAuthAliasInfo `xml:"aliasInfo"` +} + +func init() { + t["AddGuestAliasRequestType"] = reflect.TypeOf((*AddGuestAliasRequestType)(nil)).Elem() +} + +type AddGuestAliasResponse struct { +} + +type AddHostRequestType struct { + This ManagedObjectReference `xml:"_this"` + Spec HostConnectSpec `xml:"spec"` + AsConnected bool `xml:"asConnected"` + ResourcePool *ManagedObjectReference `xml:"resourcePool,omitempty"` + License string `xml:"license,omitempty"` +} + +func init() { + t["AddHostRequestType"] = reflect.TypeOf((*AddHostRequestType)(nil)).Elem() +} + +type AddHost_Task AddHostRequestType + +func init() { + t["AddHost_Task"] = reflect.TypeOf((*AddHost_Task)(nil)).Elem() +} + +type AddHost_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type AddInternetScsiSendTargets AddInternetScsiSendTargetsRequestType + +func init() { + t["AddInternetScsiSendTargets"] = reflect.TypeOf((*AddInternetScsiSendTargets)(nil)).Elem() +} + +type AddInternetScsiSendTargetsRequestType struct { + This ManagedObjectReference `xml:"_this"` + IScsiHbaDevice string `xml:"iScsiHbaDevice"` + Targets []HostInternetScsiHbaSendTarget `xml:"targets"` +} + +func init() { + t["AddInternetScsiSendTargetsRequestType"] = reflect.TypeOf((*AddInternetScsiSendTargetsRequestType)(nil)).Elem() +} + +type AddInternetScsiSendTargetsResponse struct { +} + +type AddInternetScsiStaticTargets AddInternetScsiStaticTargetsRequestType + +func init() { + t["AddInternetScsiStaticTargets"] = reflect.TypeOf((*AddInternetScsiStaticTargets)(nil)).Elem() +} + +type AddInternetScsiStaticTargetsRequestType struct { + This ManagedObjectReference `xml:"_this"` + IScsiHbaDevice string `xml:"iScsiHbaDevice"` + Targets []HostInternetScsiHbaStaticTarget `xml:"targets"` +} + +func init() { + t["AddInternetScsiStaticTargetsRequestType"] = reflect.TypeOf((*AddInternetScsiStaticTargetsRequestType)(nil)).Elem() +} + +type AddInternetScsiStaticTargetsResponse struct { +} + +type AddLicense AddLicenseRequestType + +func init() { + t["AddLicense"] = reflect.TypeOf((*AddLicense)(nil)).Elem() +} + +type AddLicenseRequestType struct { + This ManagedObjectReference `xml:"_this"` + LicenseKey string `xml:"licenseKey"` + Labels []KeyValue `xml:"labels,omitempty"` +} + +func init() { + t["AddLicenseRequestType"] = reflect.TypeOf((*AddLicenseRequestType)(nil)).Elem() +} + +type AddLicenseResponse struct { + Returnval LicenseManagerLicenseInfo `xml:"returnval"` +} + +type AddNetworkResourcePool AddNetworkResourcePoolRequestType + +func init() { + t["AddNetworkResourcePool"] = reflect.TypeOf((*AddNetworkResourcePool)(nil)).Elem() +} + +type AddNetworkResourcePoolRequestType struct { + This ManagedObjectReference `xml:"_this"` + ConfigSpec []DVSNetworkResourcePoolConfigSpec `xml:"configSpec"` +} + +func init() { + t["AddNetworkResourcePoolRequestType"] = reflect.TypeOf((*AddNetworkResourcePoolRequestType)(nil)).Elem() +} + +type AddNetworkResourcePoolResponse struct { +} + +type AddPortGroup AddPortGroupRequestType + +func init() { + t["AddPortGroup"] = reflect.TypeOf((*AddPortGroup)(nil)).Elem() +} + +type AddPortGroupRequestType struct { + This ManagedObjectReference `xml:"_this"` + Portgrp HostPortGroupSpec `xml:"portgrp"` +} + +func init() { + t["AddPortGroupRequestType"] = reflect.TypeOf((*AddPortGroupRequestType)(nil)).Elem() +} + +type AddPortGroupResponse struct { +} + +type AddServiceConsoleVirtualNic AddServiceConsoleVirtualNicRequestType + +func init() { + t["AddServiceConsoleVirtualNic"] = reflect.TypeOf((*AddServiceConsoleVirtualNic)(nil)).Elem() +} + +type AddServiceConsoleVirtualNicRequestType struct { + This ManagedObjectReference `xml:"_this"` + Portgroup string `xml:"portgroup"` + Nic HostVirtualNicSpec `xml:"nic"` +} + +func init() { + t["AddServiceConsoleVirtualNicRequestType"] = reflect.TypeOf((*AddServiceConsoleVirtualNicRequestType)(nil)).Elem() +} + +type AddServiceConsoleVirtualNicResponse struct { + Returnval string `xml:"returnval"` +} + +type AddStandaloneHostRequestType struct { + This ManagedObjectReference `xml:"_this"` + Spec HostConnectSpec `xml:"spec"` + CompResSpec BaseComputeResourceConfigSpec `xml:"compResSpec,omitempty,typeattr"` + AddConnected bool `xml:"addConnected"` + License string `xml:"license,omitempty"` +} + +func init() { + t["AddStandaloneHostRequestType"] = reflect.TypeOf((*AddStandaloneHostRequestType)(nil)).Elem() +} + +type AddStandaloneHost_Task AddStandaloneHostRequestType + +func init() { + t["AddStandaloneHost_Task"] = reflect.TypeOf((*AddStandaloneHost_Task)(nil)).Elem() +} + +type AddStandaloneHost_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type AddVirtualNic AddVirtualNicRequestType + +func init() { + t["AddVirtualNic"] = reflect.TypeOf((*AddVirtualNic)(nil)).Elem() +} + +type AddVirtualNicRequestType struct { + This ManagedObjectReference `xml:"_this"` + Portgroup string `xml:"portgroup"` + Nic HostVirtualNicSpec `xml:"nic"` +} + +func init() { + t["AddVirtualNicRequestType"] = reflect.TypeOf((*AddVirtualNicRequestType)(nil)).Elem() +} + +type AddVirtualNicResponse struct { + Returnval string `xml:"returnval"` +} + +type AddVirtualSwitch AddVirtualSwitchRequestType + +func init() { + t["AddVirtualSwitch"] = reflect.TypeOf((*AddVirtualSwitch)(nil)).Elem() +} + +type AddVirtualSwitchRequestType struct { + This ManagedObjectReference `xml:"_this"` + VswitchName string `xml:"vswitchName"` + Spec *HostVirtualSwitchSpec `xml:"spec,omitempty"` +} + +func init() { + t["AddVirtualSwitchRequestType"] = reflect.TypeOf((*AddVirtualSwitchRequestType)(nil)).Elem() +} + +type AddVirtualSwitchResponse struct { +} + +type AdminDisabled struct { + HostConfigFault +} + +func init() { + t["AdminDisabled"] = reflect.TypeOf((*AdminDisabled)(nil)).Elem() +} + +type AdminDisabledFault AdminDisabled + +func init() { + t["AdminDisabledFault"] = reflect.TypeOf((*AdminDisabledFault)(nil)).Elem() +} + +type AdminNotDisabled struct { + HostConfigFault +} + +func init() { + t["AdminNotDisabled"] = reflect.TypeOf((*AdminNotDisabled)(nil)).Elem() +} + +type AdminNotDisabledFault AdminNotDisabled + +func init() { + t["AdminNotDisabledFault"] = reflect.TypeOf((*AdminNotDisabledFault)(nil)).Elem() +} + +type AdminPasswordNotChangedEvent struct { + HostEvent +} + +func init() { + t["AdminPasswordNotChangedEvent"] = reflect.TypeOf((*AdminPasswordNotChangedEvent)(nil)).Elem() +} + +type AffinityConfigured struct { + MigrationFault + + ConfiguredAffinity []string `xml:"configuredAffinity"` +} + +func init() { + t["AffinityConfigured"] = reflect.TypeOf((*AffinityConfigured)(nil)).Elem() +} + +type AffinityConfiguredFault AffinityConfigured + +func init() { + t["AffinityConfiguredFault"] = reflect.TypeOf((*AffinityConfiguredFault)(nil)).Elem() +} + +type AfterStartupTaskScheduler struct { + TaskScheduler + + Minute int32 `xml:"minute"` +} + +func init() { + t["AfterStartupTaskScheduler"] = reflect.TypeOf((*AfterStartupTaskScheduler)(nil)).Elem() +} + +type AgentInstallFailed struct { + HostConnectFault + + Reason string `xml:"reason,omitempty"` + StatusCode int32 `xml:"statusCode,omitempty"` + InstallerOutput string `xml:"installerOutput,omitempty"` +} + +func init() { + t["AgentInstallFailed"] = reflect.TypeOf((*AgentInstallFailed)(nil)).Elem() +} + +type AgentInstallFailedFault AgentInstallFailed + +func init() { + t["AgentInstallFailedFault"] = reflect.TypeOf((*AgentInstallFailedFault)(nil)).Elem() +} + +type AlarmAcknowledgedEvent struct { + AlarmEvent + + Source ManagedEntityEventArgument `xml:"source"` + Entity ManagedEntityEventArgument `xml:"entity"` +} + +func init() { + t["AlarmAcknowledgedEvent"] = reflect.TypeOf((*AlarmAcknowledgedEvent)(nil)).Elem() +} + +type AlarmAction struct { + DynamicData +} + +func init() { + t["AlarmAction"] = reflect.TypeOf((*AlarmAction)(nil)).Elem() +} + +type AlarmActionTriggeredEvent struct { + AlarmEvent + + Source ManagedEntityEventArgument `xml:"source"` + Entity ManagedEntityEventArgument `xml:"entity"` +} + +func init() { + t["AlarmActionTriggeredEvent"] = reflect.TypeOf((*AlarmActionTriggeredEvent)(nil)).Elem() +} + +type AlarmClearedEvent struct { + AlarmEvent + + Source ManagedEntityEventArgument `xml:"source"` + Entity ManagedEntityEventArgument `xml:"entity"` + From string `xml:"from"` +} + +func init() { + t["AlarmClearedEvent"] = reflect.TypeOf((*AlarmClearedEvent)(nil)).Elem() +} + +type AlarmCreatedEvent struct { + AlarmEvent + + Entity ManagedEntityEventArgument `xml:"entity"` +} + +func init() { + t["AlarmCreatedEvent"] = reflect.TypeOf((*AlarmCreatedEvent)(nil)).Elem() +} + +type AlarmDescription struct { + DynamicData + + Expr []BaseTypeDescription `xml:"expr,typeattr"` + StateOperator []BaseElementDescription `xml:"stateOperator,typeattr"` + MetricOperator []BaseElementDescription `xml:"metricOperator,typeattr"` + HostSystemConnectionState []BaseElementDescription `xml:"hostSystemConnectionState,typeattr"` + VirtualMachinePowerState []BaseElementDescription `xml:"virtualMachinePowerState,typeattr"` + DatastoreConnectionState []BaseElementDescription `xml:"datastoreConnectionState,omitempty,typeattr"` + HostSystemPowerState []BaseElementDescription `xml:"hostSystemPowerState,omitempty,typeattr"` + VirtualMachineGuestHeartbeatStatus []BaseElementDescription `xml:"virtualMachineGuestHeartbeatStatus,omitempty,typeattr"` + EntityStatus []BaseElementDescription `xml:"entityStatus,typeattr"` + Action []BaseTypeDescription `xml:"action,typeattr"` +} + +func init() { + t["AlarmDescription"] = reflect.TypeOf((*AlarmDescription)(nil)).Elem() +} + +type AlarmEmailCompletedEvent struct { + AlarmEvent + + Entity ManagedEntityEventArgument `xml:"entity"` + To string `xml:"to"` +} + +func init() { + t["AlarmEmailCompletedEvent"] = reflect.TypeOf((*AlarmEmailCompletedEvent)(nil)).Elem() +} + +type AlarmEmailFailedEvent struct { + AlarmEvent + + Entity ManagedEntityEventArgument `xml:"entity"` + To string `xml:"to"` + Reason LocalizedMethodFault `xml:"reason"` +} + +func init() { + t["AlarmEmailFailedEvent"] = reflect.TypeOf((*AlarmEmailFailedEvent)(nil)).Elem() +} + +type AlarmEvent struct { + Event + + Alarm AlarmEventArgument `xml:"alarm"` +} + +func init() { + t["AlarmEvent"] = reflect.TypeOf((*AlarmEvent)(nil)).Elem() +} + +type AlarmEventArgument struct { + EntityEventArgument + + Alarm ManagedObjectReference `xml:"alarm"` +} + +func init() { + t["AlarmEventArgument"] = reflect.TypeOf((*AlarmEventArgument)(nil)).Elem() +} + +type AlarmExpression struct { + DynamicData +} + +func init() { + t["AlarmExpression"] = reflect.TypeOf((*AlarmExpression)(nil)).Elem() +} + +type AlarmInfo struct { + AlarmSpec + + Key string `xml:"key"` + Alarm ManagedObjectReference `xml:"alarm"` + Entity ManagedObjectReference `xml:"entity"` + LastModifiedTime time.Time `xml:"lastModifiedTime"` + LastModifiedUser string `xml:"lastModifiedUser"` + CreationEventId int32 `xml:"creationEventId"` +} + +func init() { + t["AlarmInfo"] = reflect.TypeOf((*AlarmInfo)(nil)).Elem() +} + +type AlarmReconfiguredEvent struct { + AlarmEvent + + Entity ManagedEntityEventArgument `xml:"entity"` +} + +func init() { + t["AlarmReconfiguredEvent"] = reflect.TypeOf((*AlarmReconfiguredEvent)(nil)).Elem() +} + +type AlarmRemovedEvent struct { + AlarmEvent + + Entity ManagedEntityEventArgument `xml:"entity"` +} + +func init() { + t["AlarmRemovedEvent"] = reflect.TypeOf((*AlarmRemovedEvent)(nil)).Elem() +} + +type AlarmScriptCompleteEvent struct { + AlarmEvent + + Entity ManagedEntityEventArgument `xml:"entity"` + Script string `xml:"script"` +} + +func init() { + t["AlarmScriptCompleteEvent"] = reflect.TypeOf((*AlarmScriptCompleteEvent)(nil)).Elem() +} + +type AlarmScriptFailedEvent struct { + AlarmEvent + + Entity ManagedEntityEventArgument `xml:"entity"` + Script string `xml:"script"` + Reason LocalizedMethodFault `xml:"reason"` +} + +func init() { + t["AlarmScriptFailedEvent"] = reflect.TypeOf((*AlarmScriptFailedEvent)(nil)).Elem() +} + +type AlarmSetting struct { + DynamicData + + ToleranceRange int32 `xml:"toleranceRange"` + ReportingFrequency int32 `xml:"reportingFrequency"` +} + +func init() { + t["AlarmSetting"] = reflect.TypeOf((*AlarmSetting)(nil)).Elem() +} + +type AlarmSnmpCompletedEvent struct { + AlarmEvent + + Entity ManagedEntityEventArgument `xml:"entity"` +} + +func init() { + t["AlarmSnmpCompletedEvent"] = reflect.TypeOf((*AlarmSnmpCompletedEvent)(nil)).Elem() +} + +type AlarmSnmpFailedEvent struct { + AlarmEvent + + Entity ManagedEntityEventArgument `xml:"entity"` + Reason LocalizedMethodFault `xml:"reason"` +} + +func init() { + t["AlarmSnmpFailedEvent"] = reflect.TypeOf((*AlarmSnmpFailedEvent)(nil)).Elem() +} + +type AlarmSpec struct { + DynamicData + + Name string `xml:"name"` + SystemName string `xml:"systemName,omitempty"` + Description string `xml:"description"` + Enabled bool `xml:"enabled"` + Expression BaseAlarmExpression `xml:"expression,typeattr"` + Action BaseAlarmAction `xml:"action,omitempty,typeattr"` + ActionFrequency int32 `xml:"actionFrequency,omitempty"` + Setting *AlarmSetting `xml:"setting,omitempty"` +} + +func init() { + t["AlarmSpec"] = reflect.TypeOf((*AlarmSpec)(nil)).Elem() +} + +type AlarmState struct { + DynamicData + + Key string `xml:"key"` + Entity ManagedObjectReference `xml:"entity"` + Alarm ManagedObjectReference `xml:"alarm"` + OverallStatus ManagedEntityStatus `xml:"overallStatus"` + Time time.Time `xml:"time"` + Acknowledged *bool `xml:"acknowledged"` + AcknowledgedByUser string `xml:"acknowledgedByUser,omitempty"` + AcknowledgedTime *time.Time `xml:"acknowledgedTime"` + EventKey int32 `xml:"eventKey,omitempty"` +} + +func init() { + t["AlarmState"] = reflect.TypeOf((*AlarmState)(nil)).Elem() +} + +type AlarmStatusChangedEvent struct { + AlarmEvent + + Source ManagedEntityEventArgument `xml:"source"` + Entity ManagedEntityEventArgument `xml:"entity"` + From string `xml:"from"` + To string `xml:"to"` +} + +func init() { + t["AlarmStatusChangedEvent"] = reflect.TypeOf((*AlarmStatusChangedEvent)(nil)).Elem() +} + +type AlarmTriggeringAction struct { + AlarmAction + + Action BaseAction `xml:"action,typeattr"` + TransitionSpecs []AlarmTriggeringActionTransitionSpec `xml:"transitionSpecs,omitempty"` + Green2yellow bool `xml:"green2yellow"` + Yellow2red bool `xml:"yellow2red"` + Red2yellow bool `xml:"red2yellow"` + Yellow2green bool `xml:"yellow2green"` +} + +func init() { + t["AlarmTriggeringAction"] = reflect.TypeOf((*AlarmTriggeringAction)(nil)).Elem() +} + +type AlarmTriggeringActionTransitionSpec struct { + DynamicData + + StartState ManagedEntityStatus `xml:"startState"` + FinalState ManagedEntityStatus `xml:"finalState"` + Repeats bool `xml:"repeats"` +} + +func init() { + t["AlarmTriggeringActionTransitionSpec"] = reflect.TypeOf((*AlarmTriggeringActionTransitionSpec)(nil)).Elem() +} + +type AllVirtualMachinesLicensedEvent struct { + LicenseEvent +} + +func init() { + t["AllVirtualMachinesLicensedEvent"] = reflect.TypeOf((*AllVirtualMachinesLicensedEvent)(nil)).Elem() +} + +type AllocateIpv4Address AllocateIpv4AddressRequestType + +func init() { + t["AllocateIpv4Address"] = reflect.TypeOf((*AllocateIpv4Address)(nil)).Elem() +} + +type AllocateIpv4AddressRequestType struct { + This ManagedObjectReference `xml:"_this"` + Dc ManagedObjectReference `xml:"dc"` + PoolId int32 `xml:"poolId"` + AllocationId string `xml:"allocationId"` +} + +func init() { + t["AllocateIpv4AddressRequestType"] = reflect.TypeOf((*AllocateIpv4AddressRequestType)(nil)).Elem() +} + +type AllocateIpv4AddressResponse struct { + Returnval string `xml:"returnval"` +} + +type AllocateIpv6Address AllocateIpv6AddressRequestType + +func init() { + t["AllocateIpv6Address"] = reflect.TypeOf((*AllocateIpv6Address)(nil)).Elem() +} + +type AllocateIpv6AddressRequestType struct { + This ManagedObjectReference `xml:"_this"` + Dc ManagedObjectReference `xml:"dc"` + PoolId int32 `xml:"poolId"` + AllocationId string `xml:"allocationId"` +} + +func init() { + t["AllocateIpv6AddressRequestType"] = reflect.TypeOf((*AllocateIpv6AddressRequestType)(nil)).Elem() +} + +type AllocateIpv6AddressResponse struct { + Returnval string `xml:"returnval"` +} + +type AlreadyAuthenticatedSessionEvent struct { + SessionEvent +} + +func init() { + t["AlreadyAuthenticatedSessionEvent"] = reflect.TypeOf((*AlreadyAuthenticatedSessionEvent)(nil)).Elem() +} + +type AlreadyBeingManaged struct { + HostConnectFault + + IpAddress string `xml:"ipAddress"` +} + +func init() { + t["AlreadyBeingManaged"] = reflect.TypeOf((*AlreadyBeingManaged)(nil)).Elem() +} + +type AlreadyBeingManagedFault AlreadyBeingManaged + +func init() { + t["AlreadyBeingManagedFault"] = reflect.TypeOf((*AlreadyBeingManagedFault)(nil)).Elem() +} + +type AlreadyConnected struct { + HostConnectFault + + Name string `xml:"name"` +} + +func init() { + t["AlreadyConnected"] = reflect.TypeOf((*AlreadyConnected)(nil)).Elem() +} + +type AlreadyConnectedFault AlreadyConnected + +func init() { + t["AlreadyConnectedFault"] = reflect.TypeOf((*AlreadyConnectedFault)(nil)).Elem() +} + +type AlreadyExists struct { + VimFault + + Name string `xml:"name,omitempty"` +} + +func init() { + t["AlreadyExists"] = reflect.TypeOf((*AlreadyExists)(nil)).Elem() +} + +type AlreadyExistsFault AlreadyExists + +func init() { + t["AlreadyExistsFault"] = reflect.TypeOf((*AlreadyExistsFault)(nil)).Elem() +} + +type AlreadyUpgraded struct { + VimFault +} + +func init() { + t["AlreadyUpgraded"] = reflect.TypeOf((*AlreadyUpgraded)(nil)).Elem() +} + +type AlreadyUpgradedFault AlreadyUpgraded + +func init() { + t["AlreadyUpgradedFault"] = reflect.TypeOf((*AlreadyUpgradedFault)(nil)).Elem() +} + +type AndAlarmExpression struct { + AlarmExpression + + Expression []BaseAlarmExpression `xml:"expression,typeattr"` +} + +func init() { + t["AndAlarmExpression"] = reflect.TypeOf((*AndAlarmExpression)(nil)).Elem() +} + +type AnswerFile struct { + DynamicData + + UserInput []ProfileDeferredPolicyOptionParameter `xml:"userInput,omitempty"` + CreatedTime time.Time `xml:"createdTime"` + ModifiedTime time.Time `xml:"modifiedTime"` +} + +func init() { + t["AnswerFile"] = reflect.TypeOf((*AnswerFile)(nil)).Elem() +} + +type AnswerFileCreateSpec struct { + DynamicData + + Validating *bool `xml:"validating"` +} + +func init() { + t["AnswerFileCreateSpec"] = reflect.TypeOf((*AnswerFileCreateSpec)(nil)).Elem() +} + +type AnswerFileOptionsCreateSpec struct { + AnswerFileCreateSpec + + UserInput []ProfileDeferredPolicyOptionParameter `xml:"userInput,omitempty"` +} + +func init() { + t["AnswerFileOptionsCreateSpec"] = reflect.TypeOf((*AnswerFileOptionsCreateSpec)(nil)).Elem() +} + +type AnswerFileSerializedCreateSpec struct { + AnswerFileCreateSpec + + AnswerFileConfigString string `xml:"answerFileConfigString"` +} + +func init() { + t["AnswerFileSerializedCreateSpec"] = reflect.TypeOf((*AnswerFileSerializedCreateSpec)(nil)).Elem() +} + +type AnswerFileStatusError struct { + DynamicData + + UserInputPath ProfilePropertyPath `xml:"userInputPath"` + ErrMsg LocalizableMessage `xml:"errMsg"` +} + +func init() { + t["AnswerFileStatusError"] = reflect.TypeOf((*AnswerFileStatusError)(nil)).Elem() +} + +type AnswerFileStatusResult struct { + DynamicData + + CheckedTime time.Time `xml:"checkedTime"` + Host ManagedObjectReference `xml:"host"` + Status string `xml:"status"` + Error []AnswerFileStatusError `xml:"error,omitempty"` +} + +func init() { + t["AnswerFileStatusResult"] = reflect.TypeOf((*AnswerFileStatusResult)(nil)).Elem() +} + +type AnswerFileUpdateFailed struct { + VimFault + + Failure []AnswerFileUpdateFailure `xml:"failure"` +} + +func init() { + t["AnswerFileUpdateFailed"] = reflect.TypeOf((*AnswerFileUpdateFailed)(nil)).Elem() +} + +type AnswerFileUpdateFailedFault AnswerFileUpdateFailed + +func init() { + t["AnswerFileUpdateFailedFault"] = reflect.TypeOf((*AnswerFileUpdateFailedFault)(nil)).Elem() +} + +type AnswerFileUpdateFailure struct { + DynamicData + + UserInputPath ProfilePropertyPath `xml:"userInputPath"` + ErrMsg LocalizableMessage `xml:"errMsg"` +} + +func init() { + t["AnswerFileUpdateFailure"] = reflect.TypeOf((*AnswerFileUpdateFailure)(nil)).Elem() +} + +type AnswerVM AnswerVMRequestType + +func init() { + t["AnswerVM"] = reflect.TypeOf((*AnswerVM)(nil)).Elem() +} + +type AnswerVMRequestType struct { + This ManagedObjectReference `xml:"_this"` + QuestionId string `xml:"questionId"` + AnswerChoice string `xml:"answerChoice"` +} + +func init() { + t["AnswerVMRequestType"] = reflect.TypeOf((*AnswerVMRequestType)(nil)).Elem() +} + +type AnswerVMResponse struct { +} + +type ApplicationQuiesceFault struct { + SnapshotFault +} + +func init() { + t["ApplicationQuiesceFault"] = reflect.TypeOf((*ApplicationQuiesceFault)(nil)).Elem() +} + +type ApplicationQuiesceFaultFault ApplicationQuiesceFault + +func init() { + t["ApplicationQuiesceFaultFault"] = reflect.TypeOf((*ApplicationQuiesceFaultFault)(nil)).Elem() +} + +type ApplyHostConfigRequestType struct { + This ManagedObjectReference `xml:"_this"` + Host ManagedObjectReference `xml:"host"` + ConfigSpec HostConfigSpec `xml:"configSpec"` + UserInput []ProfileDeferredPolicyOptionParameter `xml:"userInput,omitempty"` +} + +func init() { + t["ApplyHostConfigRequestType"] = reflect.TypeOf((*ApplyHostConfigRequestType)(nil)).Elem() +} + +type ApplyHostConfig_Task ApplyHostConfigRequestType + +func init() { + t["ApplyHostConfig_Task"] = reflect.TypeOf((*ApplyHostConfig_Task)(nil)).Elem() +} + +type ApplyHostConfig_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type ApplyProfile struct { + DynamicData + + Enabled bool `xml:"enabled"` + Policy []ProfilePolicy `xml:"policy,omitempty"` + ProfileTypeName string `xml:"profileTypeName,omitempty"` + ProfileVersion string `xml:"profileVersion,omitempty"` + Property []ProfileApplyProfileProperty `xml:"property,omitempty"` +} + +func init() { + t["ApplyProfile"] = reflect.TypeOf((*ApplyProfile)(nil)).Elem() +} + +type ApplyRecommendation ApplyRecommendationRequestType + +func init() { + t["ApplyRecommendation"] = reflect.TypeOf((*ApplyRecommendation)(nil)).Elem() +} + +type ApplyRecommendationRequestType struct { + This ManagedObjectReference `xml:"_this"` + Key string `xml:"key"` +} + +func init() { + t["ApplyRecommendationRequestType"] = reflect.TypeOf((*ApplyRecommendationRequestType)(nil)).Elem() +} + +type ApplyRecommendationResponse struct { +} + +type ApplyStorageDrsRecommendationRequestType struct { + This ManagedObjectReference `xml:"_this"` + Key []string `xml:"key"` +} + +func init() { + t["ApplyStorageDrsRecommendationRequestType"] = reflect.TypeOf((*ApplyStorageDrsRecommendationRequestType)(nil)).Elem() +} + +type ApplyStorageDrsRecommendationToPodRequestType struct { + This ManagedObjectReference `xml:"_this"` + Pod ManagedObjectReference `xml:"pod"` + Key string `xml:"key"` +} + +func init() { + t["ApplyStorageDrsRecommendationToPodRequestType"] = reflect.TypeOf((*ApplyStorageDrsRecommendationToPodRequestType)(nil)).Elem() +} + +type ApplyStorageDrsRecommendationToPod_Task ApplyStorageDrsRecommendationToPodRequestType + +func init() { + t["ApplyStorageDrsRecommendationToPod_Task"] = reflect.TypeOf((*ApplyStorageDrsRecommendationToPod_Task)(nil)).Elem() +} + +type ApplyStorageDrsRecommendationToPod_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type ApplyStorageDrsRecommendation_Task ApplyStorageDrsRecommendationRequestType + +func init() { + t["ApplyStorageDrsRecommendation_Task"] = reflect.TypeOf((*ApplyStorageDrsRecommendation_Task)(nil)).Elem() +} + +type ApplyStorageDrsRecommendation_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type ApplyStorageRecommendationResult struct { + DynamicData + + Vm *ManagedObjectReference `xml:"vm,omitempty"` +} + +func init() { + t["ApplyStorageRecommendationResult"] = reflect.TypeOf((*ApplyStorageRecommendationResult)(nil)).Elem() +} + +type AreAlarmActionsEnabled AreAlarmActionsEnabledRequestType + +func init() { + t["AreAlarmActionsEnabled"] = reflect.TypeOf((*AreAlarmActionsEnabled)(nil)).Elem() +} + +type AreAlarmActionsEnabledRequestType struct { + This ManagedObjectReference `xml:"_this"` + Entity ManagedObjectReference `xml:"entity"` +} + +func init() { + t["AreAlarmActionsEnabledRequestType"] = reflect.TypeOf((*AreAlarmActionsEnabledRequestType)(nil)).Elem() +} + +type AreAlarmActionsEnabledResponse struct { + Returnval bool `xml:"returnval"` +} + +type ArrayOfAlarmAction struct { + AlarmAction []BaseAlarmAction `xml:"AlarmAction,omitempty,typeattr"` +} + +func init() { + t["ArrayOfAlarmAction"] = reflect.TypeOf((*ArrayOfAlarmAction)(nil)).Elem() +} + +type ArrayOfAlarmExpression struct { + AlarmExpression []BaseAlarmExpression `xml:"AlarmExpression,omitempty,typeattr"` +} + +func init() { + t["ArrayOfAlarmExpression"] = reflect.TypeOf((*ArrayOfAlarmExpression)(nil)).Elem() +} + +type ArrayOfAlarmState struct { + AlarmState []AlarmState `xml:"AlarmState,omitempty"` +} + +func init() { + t["ArrayOfAlarmState"] = reflect.TypeOf((*ArrayOfAlarmState)(nil)).Elem() +} + +type ArrayOfAlarmTriggeringActionTransitionSpec struct { + AlarmTriggeringActionTransitionSpec []AlarmTriggeringActionTransitionSpec `xml:"AlarmTriggeringActionTransitionSpec,omitempty"` +} + +func init() { + t["ArrayOfAlarmTriggeringActionTransitionSpec"] = reflect.TypeOf((*ArrayOfAlarmTriggeringActionTransitionSpec)(nil)).Elem() +} + +type ArrayOfAnswerFileStatusError struct { + AnswerFileStatusError []AnswerFileStatusError `xml:"AnswerFileStatusError,omitempty"` +} + +func init() { + t["ArrayOfAnswerFileStatusError"] = reflect.TypeOf((*ArrayOfAnswerFileStatusError)(nil)).Elem() +} + +type ArrayOfAnswerFileStatusResult struct { + AnswerFileStatusResult []AnswerFileStatusResult `xml:"AnswerFileStatusResult,omitempty"` +} + +func init() { + t["ArrayOfAnswerFileStatusResult"] = reflect.TypeOf((*ArrayOfAnswerFileStatusResult)(nil)).Elem() +} + +type ArrayOfAnswerFileUpdateFailure struct { + AnswerFileUpdateFailure []AnswerFileUpdateFailure `xml:"AnswerFileUpdateFailure,omitempty"` +} + +func init() { + t["ArrayOfAnswerFileUpdateFailure"] = reflect.TypeOf((*ArrayOfAnswerFileUpdateFailure)(nil)).Elem() +} + +type ArrayOfAnyType struct { + AnyType []AnyType `xml:"anyType,omitempty,typeattr"` +} + +func init() { + t["ArrayOfAnyType"] = reflect.TypeOf((*ArrayOfAnyType)(nil)).Elem() +} + +type ArrayOfAnyURI struct { + AnyURI []url.URL `xml:"anyURI,omitempty"` +} + +func init() { + t["ArrayOfAnyURI"] = reflect.TypeOf((*ArrayOfAnyURI)(nil)).Elem() +} + +type ArrayOfApplyProfile struct { + ApplyProfile []BaseApplyProfile `xml:"ApplyProfile,omitempty,typeattr"` +} + +func init() { + t["ArrayOfApplyProfile"] = reflect.TypeOf((*ArrayOfApplyProfile)(nil)).Elem() +} + +type ArrayOfAuthorizationPrivilege struct { + AuthorizationPrivilege []AuthorizationPrivilege `xml:"AuthorizationPrivilege,omitempty"` +} + +func init() { + t["ArrayOfAuthorizationPrivilege"] = reflect.TypeOf((*ArrayOfAuthorizationPrivilege)(nil)).Elem() +} + +type ArrayOfAuthorizationRole struct { + AuthorizationRole []AuthorizationRole `xml:"AuthorizationRole,omitempty"` +} + +func init() { + t["ArrayOfAuthorizationRole"] = reflect.TypeOf((*ArrayOfAuthorizationRole)(nil)).Elem() +} + +type ArrayOfAutoStartPowerInfo struct { + AutoStartPowerInfo []AutoStartPowerInfo `xml:"AutoStartPowerInfo,omitempty"` +} + +func init() { + t["ArrayOfAutoStartPowerInfo"] = reflect.TypeOf((*ArrayOfAutoStartPowerInfo)(nil)).Elem() +} + +type ArrayOfBoolean struct { + Boolean []bool `xml:"boolean,omitempty"` +} + +func init() { + t["ArrayOfBoolean"] = reflect.TypeOf((*ArrayOfBoolean)(nil)).Elem() +} + +type ArrayOfByte struct { + Byte []byte `xml:"byte,omitempty"` +} + +func init() { + t["ArrayOfByte"] = reflect.TypeOf((*ArrayOfByte)(nil)).Elem() +} + +type ArrayOfCheckResult struct { + CheckResult []CheckResult `xml:"CheckResult,omitempty"` +} + +func init() { + t["ArrayOfCheckResult"] = reflect.TypeOf((*ArrayOfCheckResult)(nil)).Elem() +} + +type ArrayOfClusterAction struct { + ClusterAction []BaseClusterAction `xml:"ClusterAction,omitempty,typeattr"` +} + +func init() { + t["ArrayOfClusterAction"] = reflect.TypeOf((*ArrayOfClusterAction)(nil)).Elem() +} + +type ArrayOfClusterActionHistory struct { + ClusterActionHistory []ClusterActionHistory `xml:"ClusterActionHistory,omitempty"` +} + +func init() { + t["ArrayOfClusterActionHistory"] = reflect.TypeOf((*ArrayOfClusterActionHistory)(nil)).Elem() +} + +type ArrayOfClusterAttemptedVmInfo struct { + ClusterAttemptedVmInfo []ClusterAttemptedVmInfo `xml:"ClusterAttemptedVmInfo,omitempty"` +} + +func init() { + t["ArrayOfClusterAttemptedVmInfo"] = reflect.TypeOf((*ArrayOfClusterAttemptedVmInfo)(nil)).Elem() +} + +type ArrayOfClusterDasAamNodeState struct { + ClusterDasAamNodeState []ClusterDasAamNodeState `xml:"ClusterDasAamNodeState,omitempty"` +} + +func init() { + t["ArrayOfClusterDasAamNodeState"] = reflect.TypeOf((*ArrayOfClusterDasAamNodeState)(nil)).Elem() +} + +type ArrayOfClusterDasFailoverLevelAdvancedRuntimeInfoHostSlots struct { + ClusterDasFailoverLevelAdvancedRuntimeInfoHostSlots []ClusterDasFailoverLevelAdvancedRuntimeInfoHostSlots `xml:"ClusterDasFailoverLevelAdvancedRuntimeInfoHostSlots,omitempty"` +} + +func init() { + t["ArrayOfClusterDasFailoverLevelAdvancedRuntimeInfoHostSlots"] = reflect.TypeOf((*ArrayOfClusterDasFailoverLevelAdvancedRuntimeInfoHostSlots)(nil)).Elem() +} + +type ArrayOfClusterDasFailoverLevelAdvancedRuntimeInfoVmSlots struct { + ClusterDasFailoverLevelAdvancedRuntimeInfoVmSlots []ClusterDasFailoverLevelAdvancedRuntimeInfoVmSlots `xml:"ClusterDasFailoverLevelAdvancedRuntimeInfoVmSlots,omitempty"` +} + +func init() { + t["ArrayOfClusterDasFailoverLevelAdvancedRuntimeInfoVmSlots"] = reflect.TypeOf((*ArrayOfClusterDasFailoverLevelAdvancedRuntimeInfoVmSlots)(nil)).Elem() +} + +type ArrayOfClusterDasVmConfigInfo struct { + ClusterDasVmConfigInfo []ClusterDasVmConfigInfo `xml:"ClusterDasVmConfigInfo,omitempty"` +} + +func init() { + t["ArrayOfClusterDasVmConfigInfo"] = reflect.TypeOf((*ArrayOfClusterDasVmConfigInfo)(nil)).Elem() +} + +type ArrayOfClusterDasVmConfigSpec struct { + ClusterDasVmConfigSpec []ClusterDasVmConfigSpec `xml:"ClusterDasVmConfigSpec,omitempty"` +} + +func init() { + t["ArrayOfClusterDasVmConfigSpec"] = reflect.TypeOf((*ArrayOfClusterDasVmConfigSpec)(nil)).Elem() +} + +type ArrayOfClusterDpmHostConfigInfo struct { + ClusterDpmHostConfigInfo []ClusterDpmHostConfigInfo `xml:"ClusterDpmHostConfigInfo,omitempty"` +} + +func init() { + t["ArrayOfClusterDpmHostConfigInfo"] = reflect.TypeOf((*ArrayOfClusterDpmHostConfigInfo)(nil)).Elem() +} + +type ArrayOfClusterDpmHostConfigSpec struct { + ClusterDpmHostConfigSpec []ClusterDpmHostConfigSpec `xml:"ClusterDpmHostConfigSpec,omitempty"` +} + +func init() { + t["ArrayOfClusterDpmHostConfigSpec"] = reflect.TypeOf((*ArrayOfClusterDpmHostConfigSpec)(nil)).Elem() +} + +type ArrayOfClusterDrsFaults struct { + ClusterDrsFaults []ClusterDrsFaults `xml:"ClusterDrsFaults,omitempty"` +} + +func init() { + t["ArrayOfClusterDrsFaults"] = reflect.TypeOf((*ArrayOfClusterDrsFaults)(nil)).Elem() +} + +type ArrayOfClusterDrsFaultsFaultsByVm struct { + ClusterDrsFaultsFaultsByVm []BaseClusterDrsFaultsFaultsByVm `xml:"ClusterDrsFaultsFaultsByVm,omitempty,typeattr"` +} + +func init() { + t["ArrayOfClusterDrsFaultsFaultsByVm"] = reflect.TypeOf((*ArrayOfClusterDrsFaultsFaultsByVm)(nil)).Elem() +} + +type ArrayOfClusterDrsMigration struct { + ClusterDrsMigration []ClusterDrsMigration `xml:"ClusterDrsMigration,omitempty"` +} + +func init() { + t["ArrayOfClusterDrsMigration"] = reflect.TypeOf((*ArrayOfClusterDrsMigration)(nil)).Elem() +} + +type ArrayOfClusterDrsRecommendation struct { + ClusterDrsRecommendation []ClusterDrsRecommendation `xml:"ClusterDrsRecommendation,omitempty"` +} + +func init() { + t["ArrayOfClusterDrsRecommendation"] = reflect.TypeOf((*ArrayOfClusterDrsRecommendation)(nil)).Elem() +} + +type ArrayOfClusterDrsVmConfigInfo struct { + ClusterDrsVmConfigInfo []ClusterDrsVmConfigInfo `xml:"ClusterDrsVmConfigInfo,omitempty"` +} + +func init() { + t["ArrayOfClusterDrsVmConfigInfo"] = reflect.TypeOf((*ArrayOfClusterDrsVmConfigInfo)(nil)).Elem() +} + +type ArrayOfClusterDrsVmConfigSpec struct { + ClusterDrsVmConfigSpec []ClusterDrsVmConfigSpec `xml:"ClusterDrsVmConfigSpec,omitempty"` +} + +func init() { + t["ArrayOfClusterDrsVmConfigSpec"] = reflect.TypeOf((*ArrayOfClusterDrsVmConfigSpec)(nil)).Elem() +} + +type ArrayOfClusterEVCManagerCheckResult struct { + ClusterEVCManagerCheckResult []ClusterEVCManagerCheckResult `xml:"ClusterEVCManagerCheckResult,omitempty"` +} + +func init() { + t["ArrayOfClusterEVCManagerCheckResult"] = reflect.TypeOf((*ArrayOfClusterEVCManagerCheckResult)(nil)).Elem() +} + +type ArrayOfClusterFailoverHostAdmissionControlInfoHostStatus struct { + ClusterFailoverHostAdmissionControlInfoHostStatus []ClusterFailoverHostAdmissionControlInfoHostStatus `xml:"ClusterFailoverHostAdmissionControlInfoHostStatus,omitempty"` +} + +func init() { + t["ArrayOfClusterFailoverHostAdmissionControlInfoHostStatus"] = reflect.TypeOf((*ArrayOfClusterFailoverHostAdmissionControlInfoHostStatus)(nil)).Elem() +} + +type ArrayOfClusterGroupInfo struct { + ClusterGroupInfo []BaseClusterGroupInfo `xml:"ClusterGroupInfo,omitempty,typeattr"` +} + +func init() { + t["ArrayOfClusterGroupInfo"] = reflect.TypeOf((*ArrayOfClusterGroupInfo)(nil)).Elem() +} + +type ArrayOfClusterGroupSpec struct { + ClusterGroupSpec []ClusterGroupSpec `xml:"ClusterGroupSpec,omitempty"` +} + +func init() { + t["ArrayOfClusterGroupSpec"] = reflect.TypeOf((*ArrayOfClusterGroupSpec)(nil)).Elem() +} + +type ArrayOfClusterHostRecommendation struct { + ClusterHostRecommendation []ClusterHostRecommendation `xml:"ClusterHostRecommendation,omitempty"` +} + +func init() { + t["ArrayOfClusterHostRecommendation"] = reflect.TypeOf((*ArrayOfClusterHostRecommendation)(nil)).Elem() +} + +type ArrayOfClusterIoFilterInfo struct { + ClusterIoFilterInfo []ClusterIoFilterInfo `xml:"ClusterIoFilterInfo,omitempty"` +} + +func init() { + t["ArrayOfClusterIoFilterInfo"] = reflect.TypeOf((*ArrayOfClusterIoFilterInfo)(nil)).Elem() +} + +type ArrayOfClusterNotAttemptedVmInfo struct { + ClusterNotAttemptedVmInfo []ClusterNotAttemptedVmInfo `xml:"ClusterNotAttemptedVmInfo,omitempty"` +} + +func init() { + t["ArrayOfClusterNotAttemptedVmInfo"] = reflect.TypeOf((*ArrayOfClusterNotAttemptedVmInfo)(nil)).Elem() +} + +type ArrayOfClusterRecommendation struct { + ClusterRecommendation []ClusterRecommendation `xml:"ClusterRecommendation,omitempty"` +} + +func init() { + t["ArrayOfClusterRecommendation"] = reflect.TypeOf((*ArrayOfClusterRecommendation)(nil)).Elem() +} + +type ArrayOfClusterRuleInfo struct { + ClusterRuleInfo []BaseClusterRuleInfo `xml:"ClusterRuleInfo,omitempty,typeattr"` +} + +func init() { + t["ArrayOfClusterRuleInfo"] = reflect.TypeOf((*ArrayOfClusterRuleInfo)(nil)).Elem() +} + +type ArrayOfClusterRuleSpec struct { + ClusterRuleSpec []ClusterRuleSpec `xml:"ClusterRuleSpec,omitempty"` +} + +func init() { + t["ArrayOfClusterRuleSpec"] = reflect.TypeOf((*ArrayOfClusterRuleSpec)(nil)).Elem() +} + +type ArrayOfComplianceFailure struct { + ComplianceFailure []ComplianceFailure `xml:"ComplianceFailure,omitempty"` +} + +func init() { + t["ArrayOfComplianceFailure"] = reflect.TypeOf((*ArrayOfComplianceFailure)(nil)).Elem() +} + +type ArrayOfComplianceLocator struct { + ComplianceLocator []ComplianceLocator `xml:"ComplianceLocator,omitempty"` +} + +func init() { + t["ArrayOfComplianceLocator"] = reflect.TypeOf((*ArrayOfComplianceLocator)(nil)).Elem() +} + +type ArrayOfComplianceResult struct { + ComplianceResult []ComplianceResult `xml:"ComplianceResult,omitempty"` +} + +func init() { + t["ArrayOfComplianceResult"] = reflect.TypeOf((*ArrayOfComplianceResult)(nil)).Elem() +} + +type ArrayOfComputeResourceHostSPBMLicenseInfo struct { + ComputeResourceHostSPBMLicenseInfo []ComputeResourceHostSPBMLicenseInfo `xml:"ComputeResourceHostSPBMLicenseInfo,omitempty"` +} + +func init() { + t["ArrayOfComputeResourceHostSPBMLicenseInfo"] = reflect.TypeOf((*ArrayOfComputeResourceHostSPBMLicenseInfo)(nil)).Elem() +} + +type ArrayOfConflictingConfigurationConfig struct { + ConflictingConfigurationConfig []ConflictingConfigurationConfig `xml:"ConflictingConfigurationConfig,omitempty"` +} + +func init() { + t["ArrayOfConflictingConfigurationConfig"] = reflect.TypeOf((*ArrayOfConflictingConfigurationConfig)(nil)).Elem() +} + +type ArrayOfCustomFieldDef struct { + CustomFieldDef []CustomFieldDef `xml:"CustomFieldDef,omitempty"` +} + +func init() { + t["ArrayOfCustomFieldDef"] = reflect.TypeOf((*ArrayOfCustomFieldDef)(nil)).Elem() +} + +type ArrayOfCustomFieldValue struct { + CustomFieldValue []BaseCustomFieldValue `xml:"CustomFieldValue,omitempty,typeattr"` +} + +func init() { + t["ArrayOfCustomFieldValue"] = reflect.TypeOf((*ArrayOfCustomFieldValue)(nil)).Elem() +} + +type ArrayOfCustomizationAdapterMapping struct { + CustomizationAdapterMapping []CustomizationAdapterMapping `xml:"CustomizationAdapterMapping,omitempty"` +} + +func init() { + t["ArrayOfCustomizationAdapterMapping"] = reflect.TypeOf((*ArrayOfCustomizationAdapterMapping)(nil)).Elem() +} + +type ArrayOfCustomizationIpV6Generator struct { + CustomizationIpV6Generator []BaseCustomizationIpV6Generator `xml:"CustomizationIpV6Generator,omitempty,typeattr"` +} + +func init() { + t["ArrayOfCustomizationIpV6Generator"] = reflect.TypeOf((*ArrayOfCustomizationIpV6Generator)(nil)).Elem() +} + +type ArrayOfCustomizationSpecInfo struct { + CustomizationSpecInfo []CustomizationSpecInfo `xml:"CustomizationSpecInfo,omitempty"` +} + +func init() { + t["ArrayOfCustomizationSpecInfo"] = reflect.TypeOf((*ArrayOfCustomizationSpecInfo)(nil)).Elem() +} + +type ArrayOfDVPortConfigSpec struct { + DVPortConfigSpec []DVPortConfigSpec `xml:"DVPortConfigSpec,omitempty"` +} + +func init() { + t["ArrayOfDVPortConfigSpec"] = reflect.TypeOf((*ArrayOfDVPortConfigSpec)(nil)).Elem() +} + +type ArrayOfDVPortgroupConfigSpec struct { + DVPortgroupConfigSpec []DVPortgroupConfigSpec `xml:"DVPortgroupConfigSpec,omitempty"` +} + +func init() { + t["ArrayOfDVPortgroupConfigSpec"] = reflect.TypeOf((*ArrayOfDVPortgroupConfigSpec)(nil)).Elem() +} + +type ArrayOfDVSHealthCheckConfig struct { + DVSHealthCheckConfig []BaseDVSHealthCheckConfig `xml:"DVSHealthCheckConfig,omitempty,typeattr"` +} + +func init() { + t["ArrayOfDVSHealthCheckConfig"] = reflect.TypeOf((*ArrayOfDVSHealthCheckConfig)(nil)).Elem() +} + +type ArrayOfDVSNetworkResourcePool struct { + DVSNetworkResourcePool []DVSNetworkResourcePool `xml:"DVSNetworkResourcePool,omitempty"` +} + +func init() { + t["ArrayOfDVSNetworkResourcePool"] = reflect.TypeOf((*ArrayOfDVSNetworkResourcePool)(nil)).Elem() +} + +type ArrayOfDVSNetworkResourcePoolConfigSpec struct { + DVSNetworkResourcePoolConfigSpec []DVSNetworkResourcePoolConfigSpec `xml:"DVSNetworkResourcePoolConfigSpec,omitempty"` +} + +func init() { + t["ArrayOfDVSNetworkResourcePoolConfigSpec"] = reflect.TypeOf((*ArrayOfDVSNetworkResourcePoolConfigSpec)(nil)).Elem() +} + +type ArrayOfDVSVmVnicNetworkResourcePool struct { + DVSVmVnicNetworkResourcePool []DVSVmVnicNetworkResourcePool `xml:"DVSVmVnicNetworkResourcePool,omitempty"` +} + +func init() { + t["ArrayOfDVSVmVnicNetworkResourcePool"] = reflect.TypeOf((*ArrayOfDVSVmVnicNetworkResourcePool)(nil)).Elem() +} + +type ArrayOfDasHeartbeatDatastoreInfo struct { + DasHeartbeatDatastoreInfo []DasHeartbeatDatastoreInfo `xml:"DasHeartbeatDatastoreInfo,omitempty"` +} + +func init() { + t["ArrayOfDasHeartbeatDatastoreInfo"] = reflect.TypeOf((*ArrayOfDasHeartbeatDatastoreInfo)(nil)).Elem() +} + +type ArrayOfDatacenterMismatchArgument struct { + DatacenterMismatchArgument []DatacenterMismatchArgument `xml:"DatacenterMismatchArgument,omitempty"` +} + +func init() { + t["ArrayOfDatacenterMismatchArgument"] = reflect.TypeOf((*ArrayOfDatacenterMismatchArgument)(nil)).Elem() +} + +type ArrayOfDatastoreHostMount struct { + DatastoreHostMount []DatastoreHostMount `xml:"DatastoreHostMount,omitempty"` +} + +func init() { + t["ArrayOfDatastoreHostMount"] = reflect.TypeOf((*ArrayOfDatastoreHostMount)(nil)).Elem() +} + +type ArrayOfDatastoreMountPathDatastorePair struct { + DatastoreMountPathDatastorePair []DatastoreMountPathDatastorePair `xml:"DatastoreMountPathDatastorePair,omitempty"` +} + +func init() { + t["ArrayOfDatastoreMountPathDatastorePair"] = reflect.TypeOf((*ArrayOfDatastoreMountPathDatastorePair)(nil)).Elem() +} + +type ArrayOfDiagnosticManagerBundleInfo struct { + DiagnosticManagerBundleInfo []DiagnosticManagerBundleInfo `xml:"DiagnosticManagerBundleInfo,omitempty"` +} + +func init() { + t["ArrayOfDiagnosticManagerBundleInfo"] = reflect.TypeOf((*ArrayOfDiagnosticManagerBundleInfo)(nil)).Elem() +} + +type ArrayOfDiagnosticManagerLogDescriptor struct { + DiagnosticManagerLogDescriptor []DiagnosticManagerLogDescriptor `xml:"DiagnosticManagerLogDescriptor,omitempty"` +} + +func init() { + t["ArrayOfDiagnosticManagerLogDescriptor"] = reflect.TypeOf((*ArrayOfDiagnosticManagerLogDescriptor)(nil)).Elem() +} + +type ArrayOfDiskChangeExtent struct { + DiskChangeExtent []DiskChangeExtent `xml:"DiskChangeExtent,omitempty"` +} + +func init() { + t["ArrayOfDiskChangeExtent"] = reflect.TypeOf((*ArrayOfDiskChangeExtent)(nil)).Elem() +} + +type ArrayOfDistributedVirtualPort struct { + DistributedVirtualPort []DistributedVirtualPort `xml:"DistributedVirtualPort,omitempty"` +} + +func init() { + t["ArrayOfDistributedVirtualPort"] = reflect.TypeOf((*ArrayOfDistributedVirtualPort)(nil)).Elem() +} + +type ArrayOfDistributedVirtualPortgroupInfo struct { + DistributedVirtualPortgroupInfo []DistributedVirtualPortgroupInfo `xml:"DistributedVirtualPortgroupInfo,omitempty"` +} + +func init() { + t["ArrayOfDistributedVirtualPortgroupInfo"] = reflect.TypeOf((*ArrayOfDistributedVirtualPortgroupInfo)(nil)).Elem() +} + +type ArrayOfDistributedVirtualSwitchHostMember struct { + DistributedVirtualSwitchHostMember []DistributedVirtualSwitchHostMember `xml:"DistributedVirtualSwitchHostMember,omitempty"` +} + +func init() { + t["ArrayOfDistributedVirtualSwitchHostMember"] = reflect.TypeOf((*ArrayOfDistributedVirtualSwitchHostMember)(nil)).Elem() +} + +type ArrayOfDistributedVirtualSwitchHostMemberConfigSpec struct { + DistributedVirtualSwitchHostMemberConfigSpec []DistributedVirtualSwitchHostMemberConfigSpec `xml:"DistributedVirtualSwitchHostMemberConfigSpec,omitempty"` +} + +func init() { + t["ArrayOfDistributedVirtualSwitchHostMemberConfigSpec"] = reflect.TypeOf((*ArrayOfDistributedVirtualSwitchHostMemberConfigSpec)(nil)).Elem() +} + +type ArrayOfDistributedVirtualSwitchHostMemberPnicSpec struct { + DistributedVirtualSwitchHostMemberPnicSpec []DistributedVirtualSwitchHostMemberPnicSpec `xml:"DistributedVirtualSwitchHostMemberPnicSpec,omitempty"` +} + +func init() { + t["ArrayOfDistributedVirtualSwitchHostMemberPnicSpec"] = reflect.TypeOf((*ArrayOfDistributedVirtualSwitchHostMemberPnicSpec)(nil)).Elem() +} + +type ArrayOfDistributedVirtualSwitchHostProductSpec struct { + DistributedVirtualSwitchHostProductSpec []DistributedVirtualSwitchHostProductSpec `xml:"DistributedVirtualSwitchHostProductSpec,omitempty"` +} + +func init() { + t["ArrayOfDistributedVirtualSwitchHostProductSpec"] = reflect.TypeOf((*ArrayOfDistributedVirtualSwitchHostProductSpec)(nil)).Elem() +} + +type ArrayOfDistributedVirtualSwitchInfo struct { + DistributedVirtualSwitchInfo []DistributedVirtualSwitchInfo `xml:"DistributedVirtualSwitchInfo,omitempty"` +} + +func init() { + t["ArrayOfDistributedVirtualSwitchInfo"] = reflect.TypeOf((*ArrayOfDistributedVirtualSwitchInfo)(nil)).Elem() +} + +type ArrayOfDistributedVirtualSwitchKeyedOpaqueBlob struct { + DistributedVirtualSwitchKeyedOpaqueBlob []DistributedVirtualSwitchKeyedOpaqueBlob `xml:"DistributedVirtualSwitchKeyedOpaqueBlob,omitempty"` +} + +func init() { + t["ArrayOfDistributedVirtualSwitchKeyedOpaqueBlob"] = reflect.TypeOf((*ArrayOfDistributedVirtualSwitchKeyedOpaqueBlob)(nil)).Elem() +} + +type ArrayOfDistributedVirtualSwitchManagerCompatibilityResult struct { + DistributedVirtualSwitchManagerCompatibilityResult []DistributedVirtualSwitchManagerCompatibilityResult `xml:"DistributedVirtualSwitchManagerCompatibilityResult,omitempty"` +} + +func init() { + t["ArrayOfDistributedVirtualSwitchManagerCompatibilityResult"] = reflect.TypeOf((*ArrayOfDistributedVirtualSwitchManagerCompatibilityResult)(nil)).Elem() +} + +type ArrayOfDistributedVirtualSwitchManagerHostDvsFilterSpec struct { + DistributedVirtualSwitchManagerHostDvsFilterSpec []BaseDistributedVirtualSwitchManagerHostDvsFilterSpec `xml:"DistributedVirtualSwitchManagerHostDvsFilterSpec,omitempty,typeattr"` +} + +func init() { + t["ArrayOfDistributedVirtualSwitchManagerHostDvsFilterSpec"] = reflect.TypeOf((*ArrayOfDistributedVirtualSwitchManagerHostDvsFilterSpec)(nil)).Elem() +} + +type ArrayOfDistributedVirtualSwitchProductSpec struct { + DistributedVirtualSwitchProductSpec []DistributedVirtualSwitchProductSpec `xml:"DistributedVirtualSwitchProductSpec,omitempty"` +} + +func init() { + t["ArrayOfDistributedVirtualSwitchProductSpec"] = reflect.TypeOf((*ArrayOfDistributedVirtualSwitchProductSpec)(nil)).Elem() +} + +type ArrayOfDouble struct { + Double []float64 `xml:"double,omitempty"` +} + +func init() { + t["ArrayOfDouble"] = reflect.TypeOf((*ArrayOfDouble)(nil)).Elem() +} + +type ArrayOfDvsApplyOperationFaultFaultOnObject struct { + DvsApplyOperationFaultFaultOnObject []DvsApplyOperationFaultFaultOnObject `xml:"DvsApplyOperationFaultFaultOnObject,omitempty"` +} + +func init() { + t["ArrayOfDvsApplyOperationFaultFaultOnObject"] = reflect.TypeOf((*ArrayOfDvsApplyOperationFaultFaultOnObject)(nil)).Elem() +} + +type ArrayOfDvsFilterConfig struct { + DvsFilterConfig []BaseDvsFilterConfig `xml:"DvsFilterConfig,omitempty,typeattr"` +} + +func init() { + t["ArrayOfDvsFilterConfig"] = reflect.TypeOf((*ArrayOfDvsFilterConfig)(nil)).Elem() +} + +type ArrayOfDvsHostInfrastructureTrafficResource struct { + DvsHostInfrastructureTrafficResource []DvsHostInfrastructureTrafficResource `xml:"DvsHostInfrastructureTrafficResource,omitempty"` +} + +func init() { + t["ArrayOfDvsHostInfrastructureTrafficResource"] = reflect.TypeOf((*ArrayOfDvsHostInfrastructureTrafficResource)(nil)).Elem() +} + +type ArrayOfDvsHostVNicProfile struct { + DvsHostVNicProfile []DvsHostVNicProfile `xml:"DvsHostVNicProfile,omitempty"` +} + +func init() { + t["ArrayOfDvsHostVNicProfile"] = reflect.TypeOf((*ArrayOfDvsHostVNicProfile)(nil)).Elem() +} + +type ArrayOfDvsNetworkRuleQualifier struct { + DvsNetworkRuleQualifier []BaseDvsNetworkRuleQualifier `xml:"DvsNetworkRuleQualifier,omitempty,typeattr"` +} + +func init() { + t["ArrayOfDvsNetworkRuleQualifier"] = reflect.TypeOf((*ArrayOfDvsNetworkRuleQualifier)(nil)).Elem() +} + +type ArrayOfDvsOperationBulkFaultFaultOnHost struct { + DvsOperationBulkFaultFaultOnHost []DvsOperationBulkFaultFaultOnHost `xml:"DvsOperationBulkFaultFaultOnHost,omitempty"` +} + +func init() { + t["ArrayOfDvsOperationBulkFaultFaultOnHost"] = reflect.TypeOf((*ArrayOfDvsOperationBulkFaultFaultOnHost)(nil)).Elem() +} + +type ArrayOfDvsOutOfSyncHostArgument struct { + DvsOutOfSyncHostArgument []DvsOutOfSyncHostArgument `xml:"DvsOutOfSyncHostArgument,omitempty"` +} + +func init() { + t["ArrayOfDvsOutOfSyncHostArgument"] = reflect.TypeOf((*ArrayOfDvsOutOfSyncHostArgument)(nil)).Elem() +} + +type ArrayOfDvsProfile struct { + DvsProfile []DvsProfile `xml:"DvsProfile,omitempty"` +} + +func init() { + t["ArrayOfDvsProfile"] = reflect.TypeOf((*ArrayOfDvsProfile)(nil)).Elem() +} + +type ArrayOfDvsServiceConsoleVNicProfile struct { + DvsServiceConsoleVNicProfile []DvsServiceConsoleVNicProfile `xml:"DvsServiceConsoleVNicProfile,omitempty"` +} + +func init() { + t["ArrayOfDvsServiceConsoleVNicProfile"] = reflect.TypeOf((*ArrayOfDvsServiceConsoleVNicProfile)(nil)).Elem() +} + +type ArrayOfDvsTrafficRule struct { + DvsTrafficRule []DvsTrafficRule `xml:"DvsTrafficRule,omitempty"` +} + +func init() { + t["ArrayOfDvsTrafficRule"] = reflect.TypeOf((*ArrayOfDvsTrafficRule)(nil)).Elem() +} + +type ArrayOfDvsVmVnicNetworkResourcePoolRuntimeInfo struct { + DvsVmVnicNetworkResourcePoolRuntimeInfo []DvsVmVnicNetworkResourcePoolRuntimeInfo `xml:"DvsVmVnicNetworkResourcePoolRuntimeInfo,omitempty"` +} + +func init() { + t["ArrayOfDvsVmVnicNetworkResourcePoolRuntimeInfo"] = reflect.TypeOf((*ArrayOfDvsVmVnicNetworkResourcePoolRuntimeInfo)(nil)).Elem() +} + +type ArrayOfDvsVmVnicResourcePoolConfigSpec struct { + DvsVmVnicResourcePoolConfigSpec []DvsVmVnicResourcePoolConfigSpec `xml:"DvsVmVnicResourcePoolConfigSpec,omitempty"` +} + +func init() { + t["ArrayOfDvsVmVnicResourcePoolConfigSpec"] = reflect.TypeOf((*ArrayOfDvsVmVnicResourcePoolConfigSpec)(nil)).Elem() +} + +type ArrayOfDvsVnicAllocatedResource struct { + DvsVnicAllocatedResource []DvsVnicAllocatedResource `xml:"DvsVnicAllocatedResource,omitempty"` +} + +func init() { + t["ArrayOfDvsVnicAllocatedResource"] = reflect.TypeOf((*ArrayOfDvsVnicAllocatedResource)(nil)).Elem() +} + +type ArrayOfDynamicProperty struct { + DynamicProperty []DynamicProperty `xml:"DynamicProperty,omitempty"` +} + +func init() { + t["ArrayOfDynamicProperty"] = reflect.TypeOf((*ArrayOfDynamicProperty)(nil)).Elem() +} + +type ArrayOfEVCMode struct { + EVCMode []EVCMode `xml:"EVCMode,omitempty"` +} + +func init() { + t["ArrayOfEVCMode"] = reflect.TypeOf((*ArrayOfEVCMode)(nil)).Elem() +} + +type ArrayOfElementDescription struct { + ElementDescription []BaseElementDescription `xml:"ElementDescription,omitempty,typeattr"` +} + +func init() { + t["ArrayOfElementDescription"] = reflect.TypeOf((*ArrayOfElementDescription)(nil)).Elem() +} + +type ArrayOfEntityBackupConfig struct { + EntityBackupConfig []EntityBackupConfig `xml:"EntityBackupConfig,omitempty"` +} + +func init() { + t["ArrayOfEntityBackupConfig"] = reflect.TypeOf((*ArrayOfEntityBackupConfig)(nil)).Elem() +} + +type ArrayOfEntityPrivilege struct { + EntityPrivilege []EntityPrivilege `xml:"EntityPrivilege,omitempty"` +} + +func init() { + t["ArrayOfEntityPrivilege"] = reflect.TypeOf((*ArrayOfEntityPrivilege)(nil)).Elem() +} + +type ArrayOfEnumDescription struct { + EnumDescription []EnumDescription `xml:"EnumDescription,omitempty"` +} + +func init() { + t["ArrayOfEnumDescription"] = reflect.TypeOf((*ArrayOfEnumDescription)(nil)).Elem() +} + +type ArrayOfEvent struct { + Event []BaseEvent `xml:"Event,omitempty,typeattr"` +} + +func init() { + t["ArrayOfEvent"] = reflect.TypeOf((*ArrayOfEvent)(nil)).Elem() +} + +type ArrayOfEventAlarmExpressionComparison struct { + EventAlarmExpressionComparison []EventAlarmExpressionComparison `xml:"EventAlarmExpressionComparison,omitempty"` +} + +func init() { + t["ArrayOfEventAlarmExpressionComparison"] = reflect.TypeOf((*ArrayOfEventAlarmExpressionComparison)(nil)).Elem() +} + +type ArrayOfEventArgDesc struct { + EventArgDesc []EventArgDesc `xml:"EventArgDesc,omitempty"` +} + +func init() { + t["ArrayOfEventArgDesc"] = reflect.TypeOf((*ArrayOfEventArgDesc)(nil)).Elem() +} + +type ArrayOfEventDescriptionEventDetail struct { + EventDescriptionEventDetail []EventDescriptionEventDetail `xml:"EventDescriptionEventDetail,omitempty"` +} + +func init() { + t["ArrayOfEventDescriptionEventDetail"] = reflect.TypeOf((*ArrayOfEventDescriptionEventDetail)(nil)).Elem() +} + +type ArrayOfExtManagedEntityInfo struct { + ExtManagedEntityInfo []ExtManagedEntityInfo `xml:"ExtManagedEntityInfo,omitempty"` +} + +func init() { + t["ArrayOfExtManagedEntityInfo"] = reflect.TypeOf((*ArrayOfExtManagedEntityInfo)(nil)).Elem() +} + +type ArrayOfExtSolutionManagerInfoTabInfo struct { + ExtSolutionManagerInfoTabInfo []ExtSolutionManagerInfoTabInfo `xml:"ExtSolutionManagerInfoTabInfo,omitempty"` +} + +func init() { + t["ArrayOfExtSolutionManagerInfoTabInfo"] = reflect.TypeOf((*ArrayOfExtSolutionManagerInfoTabInfo)(nil)).Elem() +} + +type ArrayOfExtendedEventPair struct { + ExtendedEventPair []ExtendedEventPair `xml:"ExtendedEventPair,omitempty"` +} + +func init() { + t["ArrayOfExtendedEventPair"] = reflect.TypeOf((*ArrayOfExtendedEventPair)(nil)).Elem() +} + +type ArrayOfExtension struct { + Extension []Extension `xml:"Extension,omitempty"` +} + +func init() { + t["ArrayOfExtension"] = reflect.TypeOf((*ArrayOfExtension)(nil)).Elem() +} + +type ArrayOfExtensionClientInfo struct { + ExtensionClientInfo []ExtensionClientInfo `xml:"ExtensionClientInfo,omitempty"` +} + +func init() { + t["ArrayOfExtensionClientInfo"] = reflect.TypeOf((*ArrayOfExtensionClientInfo)(nil)).Elem() +} + +type ArrayOfExtensionEventTypeInfo struct { + ExtensionEventTypeInfo []ExtensionEventTypeInfo `xml:"ExtensionEventTypeInfo,omitempty"` +} + +func init() { + t["ArrayOfExtensionEventTypeInfo"] = reflect.TypeOf((*ArrayOfExtensionEventTypeInfo)(nil)).Elem() +} + +type ArrayOfExtensionFaultTypeInfo struct { + ExtensionFaultTypeInfo []ExtensionFaultTypeInfo `xml:"ExtensionFaultTypeInfo,omitempty"` +} + +func init() { + t["ArrayOfExtensionFaultTypeInfo"] = reflect.TypeOf((*ArrayOfExtensionFaultTypeInfo)(nil)).Elem() +} + +type ArrayOfExtensionManagerIpAllocationUsage struct { + ExtensionManagerIpAllocationUsage []ExtensionManagerIpAllocationUsage `xml:"ExtensionManagerIpAllocationUsage,omitempty"` +} + +func init() { + t["ArrayOfExtensionManagerIpAllocationUsage"] = reflect.TypeOf((*ArrayOfExtensionManagerIpAllocationUsage)(nil)).Elem() +} + +type ArrayOfExtensionPrivilegeInfo struct { + ExtensionPrivilegeInfo []ExtensionPrivilegeInfo `xml:"ExtensionPrivilegeInfo,omitempty"` +} + +func init() { + t["ArrayOfExtensionPrivilegeInfo"] = reflect.TypeOf((*ArrayOfExtensionPrivilegeInfo)(nil)).Elem() +} + +type ArrayOfExtensionResourceInfo struct { + ExtensionResourceInfo []ExtensionResourceInfo `xml:"ExtensionResourceInfo,omitempty"` +} + +func init() { + t["ArrayOfExtensionResourceInfo"] = reflect.TypeOf((*ArrayOfExtensionResourceInfo)(nil)).Elem() +} + +type ArrayOfExtensionServerInfo struct { + ExtensionServerInfo []ExtensionServerInfo `xml:"ExtensionServerInfo,omitempty"` +} + +func init() { + t["ArrayOfExtensionServerInfo"] = reflect.TypeOf((*ArrayOfExtensionServerInfo)(nil)).Elem() +} + +type ArrayOfExtensionTaskTypeInfo struct { + ExtensionTaskTypeInfo []ExtensionTaskTypeInfo `xml:"ExtensionTaskTypeInfo,omitempty"` +} + +func init() { + t["ArrayOfExtensionTaskTypeInfo"] = reflect.TypeOf((*ArrayOfExtensionTaskTypeInfo)(nil)).Elem() +} + +type ArrayOfFaultToleranceDiskSpec struct { + FaultToleranceDiskSpec []FaultToleranceDiskSpec `xml:"FaultToleranceDiskSpec,omitempty"` +} + +func init() { + t["ArrayOfFaultToleranceDiskSpec"] = reflect.TypeOf((*ArrayOfFaultToleranceDiskSpec)(nil)).Elem() +} + +type ArrayOfFcoeConfigVlanRange struct { + FcoeConfigVlanRange []FcoeConfigVlanRange `xml:"FcoeConfigVlanRange,omitempty"` +} + +func init() { + t["ArrayOfFcoeConfigVlanRange"] = reflect.TypeOf((*ArrayOfFcoeConfigVlanRange)(nil)).Elem() +} + +type ArrayOfFileInfo struct { + FileInfo []BaseFileInfo `xml:"FileInfo,omitempty,typeattr"` +} + +func init() { + t["ArrayOfFileInfo"] = reflect.TypeOf((*ArrayOfFileInfo)(nil)).Elem() +} + +type ArrayOfFileQuery struct { + FileQuery []BaseFileQuery `xml:"FileQuery,omitempty,typeattr"` +} + +func init() { + t["ArrayOfFileQuery"] = reflect.TypeOf((*ArrayOfFileQuery)(nil)).Elem() +} + +type ArrayOfFirewallProfileRulesetProfile struct { + FirewallProfileRulesetProfile []FirewallProfileRulesetProfile `xml:"FirewallProfileRulesetProfile,omitempty"` +} + +func init() { + t["ArrayOfFirewallProfileRulesetProfile"] = reflect.TypeOf((*ArrayOfFirewallProfileRulesetProfile)(nil)).Elem() +} + +type ArrayOfGuestAliases struct { + GuestAliases []GuestAliases `xml:"GuestAliases,omitempty"` +} + +func init() { + t["ArrayOfGuestAliases"] = reflect.TypeOf((*ArrayOfGuestAliases)(nil)).Elem() +} + +type ArrayOfGuestAuthAliasInfo struct { + GuestAuthAliasInfo []GuestAuthAliasInfo `xml:"GuestAuthAliasInfo,omitempty"` +} + +func init() { + t["ArrayOfGuestAuthAliasInfo"] = reflect.TypeOf((*ArrayOfGuestAuthAliasInfo)(nil)).Elem() +} + +type ArrayOfGuestAuthSubject struct { + GuestAuthSubject []BaseGuestAuthSubject `xml:"GuestAuthSubject,omitempty,typeattr"` +} + +func init() { + t["ArrayOfGuestAuthSubject"] = reflect.TypeOf((*ArrayOfGuestAuthSubject)(nil)).Elem() +} + +type ArrayOfGuestDiskInfo struct { + GuestDiskInfo []GuestDiskInfo `xml:"GuestDiskInfo,omitempty"` +} + +func init() { + t["ArrayOfGuestDiskInfo"] = reflect.TypeOf((*ArrayOfGuestDiskInfo)(nil)).Elem() +} + +type ArrayOfGuestFileInfo struct { + GuestFileInfo []GuestFileInfo `xml:"GuestFileInfo,omitempty"` +} + +func init() { + t["ArrayOfGuestFileInfo"] = reflect.TypeOf((*ArrayOfGuestFileInfo)(nil)).Elem() +} + +type ArrayOfGuestInfoNamespaceGenerationInfo struct { + GuestInfoNamespaceGenerationInfo []GuestInfoNamespaceGenerationInfo `xml:"GuestInfoNamespaceGenerationInfo,omitempty"` +} + +func init() { + t["ArrayOfGuestInfoNamespaceGenerationInfo"] = reflect.TypeOf((*ArrayOfGuestInfoNamespaceGenerationInfo)(nil)).Elem() +} + +type ArrayOfGuestMappedAliases struct { + GuestMappedAliases []GuestMappedAliases `xml:"GuestMappedAliases,omitempty"` +} + +func init() { + t["ArrayOfGuestMappedAliases"] = reflect.TypeOf((*ArrayOfGuestMappedAliases)(nil)).Elem() +} + +type ArrayOfGuestNicInfo struct { + GuestNicInfo []GuestNicInfo `xml:"GuestNicInfo,omitempty"` +} + +func init() { + t["ArrayOfGuestNicInfo"] = reflect.TypeOf((*ArrayOfGuestNicInfo)(nil)).Elem() +} + +type ArrayOfGuestOsDescriptor struct { + GuestOsDescriptor []GuestOsDescriptor `xml:"GuestOsDescriptor,omitempty"` +} + +func init() { + t["ArrayOfGuestOsDescriptor"] = reflect.TypeOf((*ArrayOfGuestOsDescriptor)(nil)).Elem() +} + +type ArrayOfGuestProcessInfo struct { + GuestProcessInfo []GuestProcessInfo `xml:"GuestProcessInfo,omitempty"` +} + +func init() { + t["ArrayOfGuestProcessInfo"] = reflect.TypeOf((*ArrayOfGuestProcessInfo)(nil)).Elem() +} + +type ArrayOfGuestRegKeyRecordSpec struct { + GuestRegKeyRecordSpec []GuestRegKeyRecordSpec `xml:"GuestRegKeyRecordSpec,omitempty"` +} + +func init() { + t["ArrayOfGuestRegKeyRecordSpec"] = reflect.TypeOf((*ArrayOfGuestRegKeyRecordSpec)(nil)).Elem() +} + +type ArrayOfGuestRegValueSpec struct { + GuestRegValueSpec []GuestRegValueSpec `xml:"GuestRegValueSpec,omitempty"` +} + +func init() { + t["ArrayOfGuestRegValueSpec"] = reflect.TypeOf((*ArrayOfGuestRegValueSpec)(nil)).Elem() +} + +type ArrayOfGuestStackInfo struct { + GuestStackInfo []GuestStackInfo `xml:"GuestStackInfo,omitempty"` +} + +func init() { + t["ArrayOfGuestStackInfo"] = reflect.TypeOf((*ArrayOfGuestStackInfo)(nil)).Elem() +} + +type ArrayOfHbrManagerVmReplicationCapability struct { + HbrManagerVmReplicationCapability []HbrManagerVmReplicationCapability `xml:"HbrManagerVmReplicationCapability,omitempty"` +} + +func init() { + t["ArrayOfHbrManagerVmReplicationCapability"] = reflect.TypeOf((*ArrayOfHbrManagerVmReplicationCapability)(nil)).Elem() +} + +type ArrayOfHostAccessControlEntry struct { + HostAccessControlEntry []HostAccessControlEntry `xml:"HostAccessControlEntry,omitempty"` +} + +func init() { + t["ArrayOfHostAccessControlEntry"] = reflect.TypeOf((*ArrayOfHostAccessControlEntry)(nil)).Elem() +} + +type ArrayOfHostAccountSpec struct { + HostAccountSpec []BaseHostAccountSpec `xml:"HostAccountSpec,omitempty,typeattr"` +} + +func init() { + t["ArrayOfHostAccountSpec"] = reflect.TypeOf((*ArrayOfHostAccountSpec)(nil)).Elem() +} + +type ArrayOfHostActiveDirectory struct { + HostActiveDirectory []HostActiveDirectory `xml:"HostActiveDirectory,omitempty"` +} + +func init() { + t["ArrayOfHostActiveDirectory"] = reflect.TypeOf((*ArrayOfHostActiveDirectory)(nil)).Elem() +} + +type ArrayOfHostAuthenticationStoreInfo struct { + HostAuthenticationStoreInfo []BaseHostAuthenticationStoreInfo `xml:"HostAuthenticationStoreInfo,omitempty,typeattr"` +} + +func init() { + t["ArrayOfHostAuthenticationStoreInfo"] = reflect.TypeOf((*ArrayOfHostAuthenticationStoreInfo)(nil)).Elem() +} + +type ArrayOfHostBootDevice struct { + HostBootDevice []HostBootDevice `xml:"HostBootDevice,omitempty"` +} + +func init() { + t["ArrayOfHostBootDevice"] = reflect.TypeOf((*ArrayOfHostBootDevice)(nil)).Elem() +} + +type ArrayOfHostCacheConfigurationInfo struct { + HostCacheConfigurationInfo []HostCacheConfigurationInfo `xml:"HostCacheConfigurationInfo,omitempty"` +} + +func init() { + t["ArrayOfHostCacheConfigurationInfo"] = reflect.TypeOf((*ArrayOfHostCacheConfigurationInfo)(nil)).Elem() +} + +type ArrayOfHostConnectInfoNetworkInfo struct { + HostConnectInfoNetworkInfo []BaseHostConnectInfoNetworkInfo `xml:"HostConnectInfoNetworkInfo,omitempty,typeattr"` +} + +func init() { + t["ArrayOfHostConnectInfoNetworkInfo"] = reflect.TypeOf((*ArrayOfHostConnectInfoNetworkInfo)(nil)).Elem() +} + +type ArrayOfHostCpuIdInfo struct { + HostCpuIdInfo []HostCpuIdInfo `xml:"HostCpuIdInfo,omitempty"` +} + +func init() { + t["ArrayOfHostCpuIdInfo"] = reflect.TypeOf((*ArrayOfHostCpuIdInfo)(nil)).Elem() +} + +type ArrayOfHostCpuPackage struct { + HostCpuPackage []HostCpuPackage `xml:"HostCpuPackage,omitempty"` +} + +func init() { + t["ArrayOfHostCpuPackage"] = reflect.TypeOf((*ArrayOfHostCpuPackage)(nil)).Elem() +} + +type ArrayOfHostDatastoreBrowserSearchResults struct { + HostDatastoreBrowserSearchResults []HostDatastoreBrowserSearchResults `xml:"HostDatastoreBrowserSearchResults,omitempty"` +} + +func init() { + t["ArrayOfHostDatastoreBrowserSearchResults"] = reflect.TypeOf((*ArrayOfHostDatastoreBrowserSearchResults)(nil)).Elem() +} + +type ArrayOfHostDatastoreConnectInfo struct { + HostDatastoreConnectInfo []BaseHostDatastoreConnectInfo `xml:"HostDatastoreConnectInfo,omitempty,typeattr"` +} + +func init() { + t["ArrayOfHostDatastoreConnectInfo"] = reflect.TypeOf((*ArrayOfHostDatastoreConnectInfo)(nil)).Elem() +} + +type ArrayOfHostDatastoreSystemDatastoreResult struct { + HostDatastoreSystemDatastoreResult []HostDatastoreSystemDatastoreResult `xml:"HostDatastoreSystemDatastoreResult,omitempty"` +} + +func init() { + t["ArrayOfHostDatastoreSystemDatastoreResult"] = reflect.TypeOf((*ArrayOfHostDatastoreSystemDatastoreResult)(nil)).Elem() +} + +type ArrayOfHostDateTimeSystemTimeZone struct { + HostDateTimeSystemTimeZone []HostDateTimeSystemTimeZone `xml:"HostDateTimeSystemTimeZone,omitempty"` +} + +func init() { + t["ArrayOfHostDateTimeSystemTimeZone"] = reflect.TypeOf((*ArrayOfHostDateTimeSystemTimeZone)(nil)).Elem() +} + +type ArrayOfHostDhcpService struct { + HostDhcpService []HostDhcpService `xml:"HostDhcpService,omitempty"` +} + +func init() { + t["ArrayOfHostDhcpService"] = reflect.TypeOf((*ArrayOfHostDhcpService)(nil)).Elem() +} + +type ArrayOfHostDhcpServiceConfig struct { + HostDhcpServiceConfig []HostDhcpServiceConfig `xml:"HostDhcpServiceConfig,omitempty"` +} + +func init() { + t["ArrayOfHostDhcpServiceConfig"] = reflect.TypeOf((*ArrayOfHostDhcpServiceConfig)(nil)).Elem() +} + +type ArrayOfHostDiagnosticPartition struct { + HostDiagnosticPartition []HostDiagnosticPartition `xml:"HostDiagnosticPartition,omitempty"` +} + +func init() { + t["ArrayOfHostDiagnosticPartition"] = reflect.TypeOf((*ArrayOfHostDiagnosticPartition)(nil)).Elem() +} + +type ArrayOfHostDiagnosticPartitionCreateOption struct { + HostDiagnosticPartitionCreateOption []HostDiagnosticPartitionCreateOption `xml:"HostDiagnosticPartitionCreateOption,omitempty"` +} + +func init() { + t["ArrayOfHostDiagnosticPartitionCreateOption"] = reflect.TypeOf((*ArrayOfHostDiagnosticPartitionCreateOption)(nil)).Elem() +} + +type ArrayOfHostDiskConfigurationResult struct { + HostDiskConfigurationResult []HostDiskConfigurationResult `xml:"HostDiskConfigurationResult,omitempty"` +} + +func init() { + t["ArrayOfHostDiskConfigurationResult"] = reflect.TypeOf((*ArrayOfHostDiskConfigurationResult)(nil)).Elem() +} + +type ArrayOfHostDiskMappingPartitionOption struct { + HostDiskMappingPartitionOption []HostDiskMappingPartitionOption `xml:"HostDiskMappingPartitionOption,omitempty"` +} + +func init() { + t["ArrayOfHostDiskMappingPartitionOption"] = reflect.TypeOf((*ArrayOfHostDiskMappingPartitionOption)(nil)).Elem() +} + +type ArrayOfHostDiskPartitionAttributes struct { + HostDiskPartitionAttributes []HostDiskPartitionAttributes `xml:"HostDiskPartitionAttributes,omitempty"` +} + +func init() { + t["ArrayOfHostDiskPartitionAttributes"] = reflect.TypeOf((*ArrayOfHostDiskPartitionAttributes)(nil)).Elem() +} + +type ArrayOfHostDiskPartitionBlockRange struct { + HostDiskPartitionBlockRange []HostDiskPartitionBlockRange `xml:"HostDiskPartitionBlockRange,omitempty"` +} + +func init() { + t["ArrayOfHostDiskPartitionBlockRange"] = reflect.TypeOf((*ArrayOfHostDiskPartitionBlockRange)(nil)).Elem() +} + +type ArrayOfHostDiskPartitionInfo struct { + HostDiskPartitionInfo []HostDiskPartitionInfo `xml:"HostDiskPartitionInfo,omitempty"` +} + +func init() { + t["ArrayOfHostDiskPartitionInfo"] = reflect.TypeOf((*ArrayOfHostDiskPartitionInfo)(nil)).Elem() +} + +type ArrayOfHostEventArgument struct { + HostEventArgument []HostEventArgument `xml:"HostEventArgument,omitempty"` +} + +func init() { + t["ArrayOfHostEventArgument"] = reflect.TypeOf((*ArrayOfHostEventArgument)(nil)).Elem() +} + +type ArrayOfHostFeatureCapability struct { + HostFeatureCapability []HostFeatureCapability `xml:"HostFeatureCapability,omitempty"` +} + +func init() { + t["ArrayOfHostFeatureCapability"] = reflect.TypeOf((*ArrayOfHostFeatureCapability)(nil)).Elem() +} + +type ArrayOfHostFeatureMask struct { + HostFeatureMask []HostFeatureMask `xml:"HostFeatureMask,omitempty"` +} + +func init() { + t["ArrayOfHostFeatureMask"] = reflect.TypeOf((*ArrayOfHostFeatureMask)(nil)).Elem() +} + +type ArrayOfHostFeatureVersionInfo struct { + HostFeatureVersionInfo []HostFeatureVersionInfo `xml:"HostFeatureVersionInfo,omitempty"` +} + +func init() { + t["ArrayOfHostFeatureVersionInfo"] = reflect.TypeOf((*ArrayOfHostFeatureVersionInfo)(nil)).Elem() +} + +type ArrayOfHostFileSystemMountInfo struct { + HostFileSystemMountInfo []HostFileSystemMountInfo `xml:"HostFileSystemMountInfo,omitempty"` +} + +func init() { + t["ArrayOfHostFileSystemMountInfo"] = reflect.TypeOf((*ArrayOfHostFileSystemMountInfo)(nil)).Elem() +} + +type ArrayOfHostFirewallConfigRuleSetConfig struct { + HostFirewallConfigRuleSetConfig []HostFirewallConfigRuleSetConfig `xml:"HostFirewallConfigRuleSetConfig,omitempty"` +} + +func init() { + t["ArrayOfHostFirewallConfigRuleSetConfig"] = reflect.TypeOf((*ArrayOfHostFirewallConfigRuleSetConfig)(nil)).Elem() +} + +type ArrayOfHostFirewallRule struct { + HostFirewallRule []HostFirewallRule `xml:"HostFirewallRule,omitempty"` +} + +func init() { + t["ArrayOfHostFirewallRule"] = reflect.TypeOf((*ArrayOfHostFirewallRule)(nil)).Elem() +} + +type ArrayOfHostFirewallRuleset struct { + HostFirewallRuleset []HostFirewallRuleset `xml:"HostFirewallRuleset,omitempty"` +} + +func init() { + t["ArrayOfHostFirewallRuleset"] = reflect.TypeOf((*ArrayOfHostFirewallRuleset)(nil)).Elem() +} + +type ArrayOfHostFirewallRulesetIpNetwork struct { + HostFirewallRulesetIpNetwork []HostFirewallRulesetIpNetwork `xml:"HostFirewallRulesetIpNetwork,omitempty"` +} + +func init() { + t["ArrayOfHostFirewallRulesetIpNetwork"] = reflect.TypeOf((*ArrayOfHostFirewallRulesetIpNetwork)(nil)).Elem() +} + +type ArrayOfHostGraphicsInfo struct { + HostGraphicsInfo []HostGraphicsInfo `xml:"HostGraphicsInfo,omitempty"` +} + +func init() { + t["ArrayOfHostGraphicsInfo"] = reflect.TypeOf((*ArrayOfHostGraphicsInfo)(nil)).Elem() +} + +type ArrayOfHostHardwareElementInfo struct { + HostHardwareElementInfo []BaseHostHardwareElementInfo `xml:"HostHardwareElementInfo,omitempty,typeattr"` +} + +func init() { + t["ArrayOfHostHardwareElementInfo"] = reflect.TypeOf((*ArrayOfHostHardwareElementInfo)(nil)).Elem() +} + +type ArrayOfHostHostBusAdapter struct { + HostHostBusAdapter []BaseHostHostBusAdapter `xml:"HostHostBusAdapter,omitempty,typeattr"` +} + +func init() { + t["ArrayOfHostHostBusAdapter"] = reflect.TypeOf((*ArrayOfHostHostBusAdapter)(nil)).Elem() +} + +type ArrayOfHostInternetScsiHbaIscsiIpv6Address struct { + HostInternetScsiHbaIscsiIpv6Address []HostInternetScsiHbaIscsiIpv6Address `xml:"HostInternetScsiHbaIscsiIpv6Address,omitempty"` +} + +func init() { + t["ArrayOfHostInternetScsiHbaIscsiIpv6Address"] = reflect.TypeOf((*ArrayOfHostInternetScsiHbaIscsiIpv6Address)(nil)).Elem() +} + +type ArrayOfHostInternetScsiHbaParamValue struct { + HostInternetScsiHbaParamValue []HostInternetScsiHbaParamValue `xml:"HostInternetScsiHbaParamValue,omitempty"` +} + +func init() { + t["ArrayOfHostInternetScsiHbaParamValue"] = reflect.TypeOf((*ArrayOfHostInternetScsiHbaParamValue)(nil)).Elem() +} + +type ArrayOfHostInternetScsiHbaSendTarget struct { + HostInternetScsiHbaSendTarget []HostInternetScsiHbaSendTarget `xml:"HostInternetScsiHbaSendTarget,omitempty"` +} + +func init() { + t["ArrayOfHostInternetScsiHbaSendTarget"] = reflect.TypeOf((*ArrayOfHostInternetScsiHbaSendTarget)(nil)).Elem() +} + +type ArrayOfHostInternetScsiHbaStaticTarget struct { + HostInternetScsiHbaStaticTarget []HostInternetScsiHbaStaticTarget `xml:"HostInternetScsiHbaStaticTarget,omitempty"` +} + +func init() { + t["ArrayOfHostInternetScsiHbaStaticTarget"] = reflect.TypeOf((*ArrayOfHostInternetScsiHbaStaticTarget)(nil)).Elem() +} + +type ArrayOfHostIoFilterInfo struct { + HostIoFilterInfo []HostIoFilterInfo `xml:"HostIoFilterInfo,omitempty"` +} + +func init() { + t["ArrayOfHostIoFilterInfo"] = reflect.TypeOf((*ArrayOfHostIoFilterInfo)(nil)).Elem() +} + +type ArrayOfHostIpConfigIpV6Address struct { + HostIpConfigIpV6Address []HostIpConfigIpV6Address `xml:"HostIpConfigIpV6Address,omitempty"` +} + +func init() { + t["ArrayOfHostIpConfigIpV6Address"] = reflect.TypeOf((*ArrayOfHostIpConfigIpV6Address)(nil)).Elem() +} + +type ArrayOfHostIpRouteEntry struct { + HostIpRouteEntry []HostIpRouteEntry `xml:"HostIpRouteEntry,omitempty"` +} + +func init() { + t["ArrayOfHostIpRouteEntry"] = reflect.TypeOf((*ArrayOfHostIpRouteEntry)(nil)).Elem() +} + +type ArrayOfHostIpRouteOp struct { + HostIpRouteOp []HostIpRouteOp `xml:"HostIpRouteOp,omitempty"` +} + +func init() { + t["ArrayOfHostIpRouteOp"] = reflect.TypeOf((*ArrayOfHostIpRouteOp)(nil)).Elem() +} + +type ArrayOfHostLowLevelProvisioningManagerDiskLayoutSpec struct { + HostLowLevelProvisioningManagerDiskLayoutSpec []HostLowLevelProvisioningManagerDiskLayoutSpec `xml:"HostLowLevelProvisioningManagerDiskLayoutSpec,omitempty"` +} + +func init() { + t["ArrayOfHostLowLevelProvisioningManagerDiskLayoutSpec"] = reflect.TypeOf((*ArrayOfHostLowLevelProvisioningManagerDiskLayoutSpec)(nil)).Elem() +} + +type ArrayOfHostLowLevelProvisioningManagerFileDeleteResult struct { + HostLowLevelProvisioningManagerFileDeleteResult []HostLowLevelProvisioningManagerFileDeleteResult `xml:"HostLowLevelProvisioningManagerFileDeleteResult,omitempty"` +} + +func init() { + t["ArrayOfHostLowLevelProvisioningManagerFileDeleteResult"] = reflect.TypeOf((*ArrayOfHostLowLevelProvisioningManagerFileDeleteResult)(nil)).Elem() +} + +type ArrayOfHostLowLevelProvisioningManagerFileDeleteSpec struct { + HostLowLevelProvisioningManagerFileDeleteSpec []HostLowLevelProvisioningManagerFileDeleteSpec `xml:"HostLowLevelProvisioningManagerFileDeleteSpec,omitempty"` +} + +func init() { + t["ArrayOfHostLowLevelProvisioningManagerFileDeleteSpec"] = reflect.TypeOf((*ArrayOfHostLowLevelProvisioningManagerFileDeleteSpec)(nil)).Elem() +} + +type ArrayOfHostLowLevelProvisioningManagerFileReserveResult struct { + HostLowLevelProvisioningManagerFileReserveResult []HostLowLevelProvisioningManagerFileReserveResult `xml:"HostLowLevelProvisioningManagerFileReserveResult,omitempty"` +} + +func init() { + t["ArrayOfHostLowLevelProvisioningManagerFileReserveResult"] = reflect.TypeOf((*ArrayOfHostLowLevelProvisioningManagerFileReserveResult)(nil)).Elem() +} + +type ArrayOfHostLowLevelProvisioningManagerFileReserveSpec struct { + HostLowLevelProvisioningManagerFileReserveSpec []HostLowLevelProvisioningManagerFileReserveSpec `xml:"HostLowLevelProvisioningManagerFileReserveSpec,omitempty"` +} + +func init() { + t["ArrayOfHostLowLevelProvisioningManagerFileReserveSpec"] = reflect.TypeOf((*ArrayOfHostLowLevelProvisioningManagerFileReserveSpec)(nil)).Elem() +} + +type ArrayOfHostLowLevelProvisioningManagerSnapshotLayoutSpec struct { + HostLowLevelProvisioningManagerSnapshotLayoutSpec []HostLowLevelProvisioningManagerSnapshotLayoutSpec `xml:"HostLowLevelProvisioningManagerSnapshotLayoutSpec,omitempty"` +} + +func init() { + t["ArrayOfHostLowLevelProvisioningManagerSnapshotLayoutSpec"] = reflect.TypeOf((*ArrayOfHostLowLevelProvisioningManagerSnapshotLayoutSpec)(nil)).Elem() +} + +type ArrayOfHostMemberHealthCheckResult struct { + HostMemberHealthCheckResult []BaseHostMemberHealthCheckResult `xml:"HostMemberHealthCheckResult,omitempty,typeattr"` +} + +func init() { + t["ArrayOfHostMemberHealthCheckResult"] = reflect.TypeOf((*ArrayOfHostMemberHealthCheckResult)(nil)).Elem() +} + +type ArrayOfHostMemberRuntimeInfo struct { + HostMemberRuntimeInfo []HostMemberRuntimeInfo `xml:"HostMemberRuntimeInfo,omitempty"` +} + +func init() { + t["ArrayOfHostMemberRuntimeInfo"] = reflect.TypeOf((*ArrayOfHostMemberRuntimeInfo)(nil)).Elem() +} + +type ArrayOfHostMultipathInfoLogicalUnit struct { + HostMultipathInfoLogicalUnit []HostMultipathInfoLogicalUnit `xml:"HostMultipathInfoLogicalUnit,omitempty"` +} + +func init() { + t["ArrayOfHostMultipathInfoLogicalUnit"] = reflect.TypeOf((*ArrayOfHostMultipathInfoLogicalUnit)(nil)).Elem() +} + +type ArrayOfHostMultipathInfoPath struct { + HostMultipathInfoPath []HostMultipathInfoPath `xml:"HostMultipathInfoPath,omitempty"` +} + +func init() { + t["ArrayOfHostMultipathInfoPath"] = reflect.TypeOf((*ArrayOfHostMultipathInfoPath)(nil)).Elem() +} + +type ArrayOfHostMultipathStateInfoPath struct { + HostMultipathStateInfoPath []HostMultipathStateInfoPath `xml:"HostMultipathStateInfoPath,omitempty"` +} + +func init() { + t["ArrayOfHostMultipathStateInfoPath"] = reflect.TypeOf((*ArrayOfHostMultipathStateInfoPath)(nil)).Elem() +} + +type ArrayOfHostNasVolumeConfig struct { + HostNasVolumeConfig []HostNasVolumeConfig `xml:"HostNasVolumeConfig,omitempty"` +} + +func init() { + t["ArrayOfHostNasVolumeConfig"] = reflect.TypeOf((*ArrayOfHostNasVolumeConfig)(nil)).Elem() +} + +type ArrayOfHostNatService struct { + HostNatService []HostNatService `xml:"HostNatService,omitempty"` +} + +func init() { + t["ArrayOfHostNatService"] = reflect.TypeOf((*ArrayOfHostNatService)(nil)).Elem() +} + +type ArrayOfHostNatServiceConfig struct { + HostNatServiceConfig []HostNatServiceConfig `xml:"HostNatServiceConfig,omitempty"` +} + +func init() { + t["ArrayOfHostNatServiceConfig"] = reflect.TypeOf((*ArrayOfHostNatServiceConfig)(nil)).Elem() +} + +type ArrayOfHostNatServicePortForwardSpec struct { + HostNatServicePortForwardSpec []HostNatServicePortForwardSpec `xml:"HostNatServicePortForwardSpec,omitempty"` +} + +func init() { + t["ArrayOfHostNatServicePortForwardSpec"] = reflect.TypeOf((*ArrayOfHostNatServicePortForwardSpec)(nil)).Elem() +} + +type ArrayOfHostNetStackInstance struct { + HostNetStackInstance []HostNetStackInstance `xml:"HostNetStackInstance,omitempty"` +} + +func init() { + t["ArrayOfHostNetStackInstance"] = reflect.TypeOf((*ArrayOfHostNetStackInstance)(nil)).Elem() +} + +type ArrayOfHostNetworkConfigNetStackSpec struct { + HostNetworkConfigNetStackSpec []HostNetworkConfigNetStackSpec `xml:"HostNetworkConfigNetStackSpec,omitempty"` +} + +func init() { + t["ArrayOfHostNetworkConfigNetStackSpec"] = reflect.TypeOf((*ArrayOfHostNetworkConfigNetStackSpec)(nil)).Elem() +} + +type ArrayOfHostNumaNode struct { + HostNumaNode []HostNumaNode `xml:"HostNumaNode,omitempty"` +} + +func init() { + t["ArrayOfHostNumaNode"] = reflect.TypeOf((*ArrayOfHostNumaNode)(nil)).Elem() +} + +type ArrayOfHostNumericSensorInfo struct { + HostNumericSensorInfo []HostNumericSensorInfo `xml:"HostNumericSensorInfo,omitempty"` +} + +func init() { + t["ArrayOfHostNumericSensorInfo"] = reflect.TypeOf((*ArrayOfHostNumericSensorInfo)(nil)).Elem() +} + +type ArrayOfHostOpaqueNetworkInfo struct { + HostOpaqueNetworkInfo []HostOpaqueNetworkInfo `xml:"HostOpaqueNetworkInfo,omitempty"` +} + +func init() { + t["ArrayOfHostOpaqueNetworkInfo"] = reflect.TypeOf((*ArrayOfHostOpaqueNetworkInfo)(nil)).Elem() +} + +type ArrayOfHostOpaqueSwitch struct { + HostOpaqueSwitch []HostOpaqueSwitch `xml:"HostOpaqueSwitch,omitempty"` +} + +func init() { + t["ArrayOfHostOpaqueSwitch"] = reflect.TypeOf((*ArrayOfHostOpaqueSwitch)(nil)).Elem() +} + +type ArrayOfHostOpaqueSwitchPhysicalNicZone struct { + HostOpaqueSwitchPhysicalNicZone []HostOpaqueSwitchPhysicalNicZone `xml:"HostOpaqueSwitchPhysicalNicZone,omitempty"` +} + +func init() { + t["ArrayOfHostOpaqueSwitchPhysicalNicZone"] = reflect.TypeOf((*ArrayOfHostOpaqueSwitchPhysicalNicZone)(nil)).Elem() +} + +type ArrayOfHostPatchManagerStatus struct { + HostPatchManagerStatus []HostPatchManagerStatus `xml:"HostPatchManagerStatus,omitempty"` +} + +func init() { + t["ArrayOfHostPatchManagerStatus"] = reflect.TypeOf((*ArrayOfHostPatchManagerStatus)(nil)).Elem() +} + +type ArrayOfHostPatchManagerStatusPrerequisitePatch struct { + HostPatchManagerStatusPrerequisitePatch []HostPatchManagerStatusPrerequisitePatch `xml:"HostPatchManagerStatusPrerequisitePatch,omitempty"` +} + +func init() { + t["ArrayOfHostPatchManagerStatusPrerequisitePatch"] = reflect.TypeOf((*ArrayOfHostPatchManagerStatusPrerequisitePatch)(nil)).Elem() +} + +type ArrayOfHostPathSelectionPolicyOption struct { + HostPathSelectionPolicyOption []HostPathSelectionPolicyOption `xml:"HostPathSelectionPolicyOption,omitempty"` +} + +func init() { + t["ArrayOfHostPathSelectionPolicyOption"] = reflect.TypeOf((*ArrayOfHostPathSelectionPolicyOption)(nil)).Elem() +} + +type ArrayOfHostPciDevice struct { + HostPciDevice []HostPciDevice `xml:"HostPciDevice,omitempty"` +} + +func init() { + t["ArrayOfHostPciDevice"] = reflect.TypeOf((*ArrayOfHostPciDevice)(nil)).Elem() +} + +type ArrayOfHostPciPassthruConfig struct { + HostPciPassthruConfig []BaseHostPciPassthruConfig `xml:"HostPciPassthruConfig,omitempty,typeattr"` +} + +func init() { + t["ArrayOfHostPciPassthruConfig"] = reflect.TypeOf((*ArrayOfHostPciPassthruConfig)(nil)).Elem() +} + +type ArrayOfHostPciPassthruInfo struct { + HostPciPassthruInfo []BaseHostPciPassthruInfo `xml:"HostPciPassthruInfo,omitempty,typeattr"` +} + +func init() { + t["ArrayOfHostPciPassthruInfo"] = reflect.TypeOf((*ArrayOfHostPciPassthruInfo)(nil)).Elem() +} + +type ArrayOfHostPlacedVirtualNicIdentifier struct { + HostPlacedVirtualNicIdentifier []HostPlacedVirtualNicIdentifier `xml:"HostPlacedVirtualNicIdentifier,omitempty"` +} + +func init() { + t["ArrayOfHostPlacedVirtualNicIdentifier"] = reflect.TypeOf((*ArrayOfHostPlacedVirtualNicIdentifier)(nil)).Elem() +} + +type ArrayOfHostPlugStoreTopologyAdapter struct { + HostPlugStoreTopologyAdapter []HostPlugStoreTopologyAdapter `xml:"HostPlugStoreTopologyAdapter,omitempty"` +} + +func init() { + t["ArrayOfHostPlugStoreTopologyAdapter"] = reflect.TypeOf((*ArrayOfHostPlugStoreTopologyAdapter)(nil)).Elem() +} + +type ArrayOfHostPlugStoreTopologyDevice struct { + HostPlugStoreTopologyDevice []HostPlugStoreTopologyDevice `xml:"HostPlugStoreTopologyDevice,omitempty"` +} + +func init() { + t["ArrayOfHostPlugStoreTopologyDevice"] = reflect.TypeOf((*ArrayOfHostPlugStoreTopologyDevice)(nil)).Elem() +} + +type ArrayOfHostPlugStoreTopologyPath struct { + HostPlugStoreTopologyPath []HostPlugStoreTopologyPath `xml:"HostPlugStoreTopologyPath,omitempty"` +} + +func init() { + t["ArrayOfHostPlugStoreTopologyPath"] = reflect.TypeOf((*ArrayOfHostPlugStoreTopologyPath)(nil)).Elem() +} + +type ArrayOfHostPlugStoreTopologyPlugin struct { + HostPlugStoreTopologyPlugin []HostPlugStoreTopologyPlugin `xml:"HostPlugStoreTopologyPlugin,omitempty"` +} + +func init() { + t["ArrayOfHostPlugStoreTopologyPlugin"] = reflect.TypeOf((*ArrayOfHostPlugStoreTopologyPlugin)(nil)).Elem() +} + +type ArrayOfHostPlugStoreTopologyTarget struct { + HostPlugStoreTopologyTarget []HostPlugStoreTopologyTarget `xml:"HostPlugStoreTopologyTarget,omitempty"` +} + +func init() { + t["ArrayOfHostPlugStoreTopologyTarget"] = reflect.TypeOf((*ArrayOfHostPlugStoreTopologyTarget)(nil)).Elem() +} + +type ArrayOfHostPnicNetworkResourceInfo struct { + HostPnicNetworkResourceInfo []HostPnicNetworkResourceInfo `xml:"HostPnicNetworkResourceInfo,omitempty"` +} + +func init() { + t["ArrayOfHostPnicNetworkResourceInfo"] = reflect.TypeOf((*ArrayOfHostPnicNetworkResourceInfo)(nil)).Elem() +} + +type ArrayOfHostPortGroup struct { + HostPortGroup []HostPortGroup `xml:"HostPortGroup,omitempty"` +} + +func init() { + t["ArrayOfHostPortGroup"] = reflect.TypeOf((*ArrayOfHostPortGroup)(nil)).Elem() +} + +type ArrayOfHostPortGroupConfig struct { + HostPortGroupConfig []HostPortGroupConfig `xml:"HostPortGroupConfig,omitempty"` +} + +func init() { + t["ArrayOfHostPortGroupConfig"] = reflect.TypeOf((*ArrayOfHostPortGroupConfig)(nil)).Elem() +} + +type ArrayOfHostPortGroupPort struct { + HostPortGroupPort []HostPortGroupPort `xml:"HostPortGroupPort,omitempty"` +} + +func init() { + t["ArrayOfHostPortGroupPort"] = reflect.TypeOf((*ArrayOfHostPortGroupPort)(nil)).Elem() +} + +type ArrayOfHostPortGroupProfile struct { + HostPortGroupProfile []HostPortGroupProfile `xml:"HostPortGroupProfile,omitempty"` +} + +func init() { + t["ArrayOfHostPortGroupProfile"] = reflect.TypeOf((*ArrayOfHostPortGroupProfile)(nil)).Elem() +} + +type ArrayOfHostPowerPolicy struct { + HostPowerPolicy []HostPowerPolicy `xml:"HostPowerPolicy,omitempty"` +} + +func init() { + t["ArrayOfHostPowerPolicy"] = reflect.TypeOf((*ArrayOfHostPowerPolicy)(nil)).Elem() +} + +type ArrayOfHostProtocolEndpoint struct { + HostProtocolEndpoint []HostProtocolEndpoint `xml:"HostProtocolEndpoint,omitempty"` +} + +func init() { + t["ArrayOfHostProtocolEndpoint"] = reflect.TypeOf((*ArrayOfHostProtocolEndpoint)(nil)).Elem() +} + +type ArrayOfHostProxySwitch struct { + HostProxySwitch []HostProxySwitch `xml:"HostProxySwitch,omitempty"` +} + +func init() { + t["ArrayOfHostProxySwitch"] = reflect.TypeOf((*ArrayOfHostProxySwitch)(nil)).Elem() +} + +type ArrayOfHostProxySwitchConfig struct { + HostProxySwitchConfig []HostProxySwitchConfig `xml:"HostProxySwitchConfig,omitempty"` +} + +func init() { + t["ArrayOfHostProxySwitchConfig"] = reflect.TypeOf((*ArrayOfHostProxySwitchConfig)(nil)).Elem() +} + +type ArrayOfHostProxySwitchHostLagConfig struct { + HostProxySwitchHostLagConfig []HostProxySwitchHostLagConfig `xml:"HostProxySwitchHostLagConfig,omitempty"` +} + +func init() { + t["ArrayOfHostProxySwitchHostLagConfig"] = reflect.TypeOf((*ArrayOfHostProxySwitchHostLagConfig)(nil)).Elem() +} + +type ArrayOfHostRuntimeInfoNetStackInstanceRuntimeInfo struct { + HostRuntimeInfoNetStackInstanceRuntimeInfo []HostRuntimeInfoNetStackInstanceRuntimeInfo `xml:"HostRuntimeInfoNetStackInstanceRuntimeInfo,omitempty"` +} + +func init() { + t["ArrayOfHostRuntimeInfoNetStackInstanceRuntimeInfo"] = reflect.TypeOf((*ArrayOfHostRuntimeInfoNetStackInstanceRuntimeInfo)(nil)).Elem() +} + +type ArrayOfHostScsiDisk struct { + HostScsiDisk []HostScsiDisk `xml:"HostScsiDisk,omitempty"` +} + +func init() { + t["ArrayOfHostScsiDisk"] = reflect.TypeOf((*ArrayOfHostScsiDisk)(nil)).Elem() +} + +type ArrayOfHostScsiDiskPartition struct { + HostScsiDiskPartition []HostScsiDiskPartition `xml:"HostScsiDiskPartition,omitempty"` +} + +func init() { + t["ArrayOfHostScsiDiskPartition"] = reflect.TypeOf((*ArrayOfHostScsiDiskPartition)(nil)).Elem() +} + +type ArrayOfHostScsiTopologyInterface struct { + HostScsiTopologyInterface []HostScsiTopologyInterface `xml:"HostScsiTopologyInterface,omitempty"` +} + +func init() { + t["ArrayOfHostScsiTopologyInterface"] = reflect.TypeOf((*ArrayOfHostScsiTopologyInterface)(nil)).Elem() +} + +type ArrayOfHostScsiTopologyLun struct { + HostScsiTopologyLun []HostScsiTopologyLun `xml:"HostScsiTopologyLun,omitempty"` +} + +func init() { + t["ArrayOfHostScsiTopologyLun"] = reflect.TypeOf((*ArrayOfHostScsiTopologyLun)(nil)).Elem() +} + +type ArrayOfHostScsiTopologyTarget struct { + HostScsiTopologyTarget []HostScsiTopologyTarget `xml:"HostScsiTopologyTarget,omitempty"` +} + +func init() { + t["ArrayOfHostScsiTopologyTarget"] = reflect.TypeOf((*ArrayOfHostScsiTopologyTarget)(nil)).Elem() +} + +type ArrayOfHostService struct { + HostService []HostService `xml:"HostService,omitempty"` +} + +func init() { + t["ArrayOfHostService"] = reflect.TypeOf((*ArrayOfHostService)(nil)).Elem() +} + +type ArrayOfHostServiceConfig struct { + HostServiceConfig []HostServiceConfig `xml:"HostServiceConfig,omitempty"` +} + +func init() { + t["ArrayOfHostServiceConfig"] = reflect.TypeOf((*ArrayOfHostServiceConfig)(nil)).Elem() +} + +type ArrayOfHostSnmpDestination struct { + HostSnmpDestination []HostSnmpDestination `xml:"HostSnmpDestination,omitempty"` +} + +func init() { + t["ArrayOfHostSnmpDestination"] = reflect.TypeOf((*ArrayOfHostSnmpDestination)(nil)).Elem() +} + +type ArrayOfHostSslThumbprintInfo struct { + HostSslThumbprintInfo []HostSslThumbprintInfo `xml:"HostSslThumbprintInfo,omitempty"` +} + +func init() { + t["ArrayOfHostSslThumbprintInfo"] = reflect.TypeOf((*ArrayOfHostSslThumbprintInfo)(nil)).Elem() +} + +type ArrayOfHostStorageArrayTypePolicyOption struct { + HostStorageArrayTypePolicyOption []HostStorageArrayTypePolicyOption `xml:"HostStorageArrayTypePolicyOption,omitempty"` +} + +func init() { + t["ArrayOfHostStorageArrayTypePolicyOption"] = reflect.TypeOf((*ArrayOfHostStorageArrayTypePolicyOption)(nil)).Elem() +} + +type ArrayOfHostStorageElementInfo struct { + HostStorageElementInfo []HostStorageElementInfo `xml:"HostStorageElementInfo,omitempty"` +} + +func init() { + t["ArrayOfHostStorageElementInfo"] = reflect.TypeOf((*ArrayOfHostStorageElementInfo)(nil)).Elem() +} + +type ArrayOfHostStorageOperationalInfo struct { + HostStorageOperationalInfo []HostStorageOperationalInfo `xml:"HostStorageOperationalInfo,omitempty"` +} + +func init() { + t["ArrayOfHostStorageOperationalInfo"] = reflect.TypeOf((*ArrayOfHostStorageOperationalInfo)(nil)).Elem() +} + +type ArrayOfHostStorageSystemDiskLocatorLedResult struct { + HostStorageSystemDiskLocatorLedResult []HostStorageSystemDiskLocatorLedResult `xml:"HostStorageSystemDiskLocatorLedResult,omitempty"` +} + +func init() { + t["ArrayOfHostStorageSystemDiskLocatorLedResult"] = reflect.TypeOf((*ArrayOfHostStorageSystemDiskLocatorLedResult)(nil)).Elem() +} + +type ArrayOfHostStorageSystemScsiLunResult struct { + HostStorageSystemScsiLunResult []HostStorageSystemScsiLunResult `xml:"HostStorageSystemScsiLunResult,omitempty"` +} + +func init() { + t["ArrayOfHostStorageSystemScsiLunResult"] = reflect.TypeOf((*ArrayOfHostStorageSystemScsiLunResult)(nil)).Elem() +} + +type ArrayOfHostStorageSystemVmfsVolumeResult struct { + HostStorageSystemVmfsVolumeResult []HostStorageSystemVmfsVolumeResult `xml:"HostStorageSystemVmfsVolumeResult,omitempty"` +} + +func init() { + t["ArrayOfHostStorageSystemVmfsVolumeResult"] = reflect.TypeOf((*ArrayOfHostStorageSystemVmfsVolumeResult)(nil)).Elem() +} + +type ArrayOfHostSystemIdentificationInfo struct { + HostSystemIdentificationInfo []HostSystemIdentificationInfo `xml:"HostSystemIdentificationInfo,omitempty"` +} + +func init() { + t["ArrayOfHostSystemIdentificationInfo"] = reflect.TypeOf((*ArrayOfHostSystemIdentificationInfo)(nil)).Elem() +} + +type ArrayOfHostSystemResourceInfo struct { + HostSystemResourceInfo []HostSystemResourceInfo `xml:"HostSystemResourceInfo,omitempty"` +} + +func init() { + t["ArrayOfHostSystemResourceInfo"] = reflect.TypeOf((*ArrayOfHostSystemResourceInfo)(nil)).Elem() +} + +type ArrayOfHostSystemSwapConfigurationSystemSwapOption struct { + HostSystemSwapConfigurationSystemSwapOption []BaseHostSystemSwapConfigurationSystemSwapOption `xml:"HostSystemSwapConfigurationSystemSwapOption,omitempty,typeattr"` +} + +func init() { + t["ArrayOfHostSystemSwapConfigurationSystemSwapOption"] = reflect.TypeOf((*ArrayOfHostSystemSwapConfigurationSystemSwapOption)(nil)).Elem() +} + +type ArrayOfHostTpmDigestInfo struct { + HostTpmDigestInfo []HostTpmDigestInfo `xml:"HostTpmDigestInfo,omitempty"` +} + +func init() { + t["ArrayOfHostTpmDigestInfo"] = reflect.TypeOf((*ArrayOfHostTpmDigestInfo)(nil)).Elem() +} + +type ArrayOfHostTpmEventLogEntry struct { + HostTpmEventLogEntry []HostTpmEventLogEntry `xml:"HostTpmEventLogEntry,omitempty"` +} + +func init() { + t["ArrayOfHostTpmEventLogEntry"] = reflect.TypeOf((*ArrayOfHostTpmEventLogEntry)(nil)).Elem() +} + +type ArrayOfHostUnresolvedVmfsExtent struct { + HostUnresolvedVmfsExtent []HostUnresolvedVmfsExtent `xml:"HostUnresolvedVmfsExtent,omitempty"` +} + +func init() { + t["ArrayOfHostUnresolvedVmfsExtent"] = reflect.TypeOf((*ArrayOfHostUnresolvedVmfsExtent)(nil)).Elem() +} + +type ArrayOfHostUnresolvedVmfsResolutionResult struct { + HostUnresolvedVmfsResolutionResult []HostUnresolvedVmfsResolutionResult `xml:"HostUnresolvedVmfsResolutionResult,omitempty"` +} + +func init() { + t["ArrayOfHostUnresolvedVmfsResolutionResult"] = reflect.TypeOf((*ArrayOfHostUnresolvedVmfsResolutionResult)(nil)).Elem() +} + +type ArrayOfHostUnresolvedVmfsResolutionSpec struct { + HostUnresolvedVmfsResolutionSpec []HostUnresolvedVmfsResolutionSpec `xml:"HostUnresolvedVmfsResolutionSpec,omitempty"` +} + +func init() { + t["ArrayOfHostUnresolvedVmfsResolutionSpec"] = reflect.TypeOf((*ArrayOfHostUnresolvedVmfsResolutionSpec)(nil)).Elem() +} + +type ArrayOfHostUnresolvedVmfsVolume struct { + HostUnresolvedVmfsVolume []HostUnresolvedVmfsVolume `xml:"HostUnresolvedVmfsVolume,omitempty"` +} + +func init() { + t["ArrayOfHostUnresolvedVmfsVolume"] = reflect.TypeOf((*ArrayOfHostUnresolvedVmfsVolume)(nil)).Elem() +} + +type ArrayOfHostVFlashManagerVFlashCacheConfigInfoVFlashModuleConfigOption struct { + HostVFlashManagerVFlashCacheConfigInfoVFlashModuleConfigOption []HostVFlashManagerVFlashCacheConfigInfoVFlashModuleConfigOption `xml:"HostVFlashManagerVFlashCacheConfigInfoVFlashModuleConfigOption,omitempty"` +} + +func init() { + t["ArrayOfHostVFlashManagerVFlashCacheConfigInfoVFlashModuleConfigOption"] = reflect.TypeOf((*ArrayOfHostVFlashManagerVFlashCacheConfigInfoVFlashModuleConfigOption)(nil)).Elem() +} + +type ArrayOfHostVMotionCompatibility struct { + HostVMotionCompatibility []HostVMotionCompatibility `xml:"HostVMotionCompatibility,omitempty"` +} + +func init() { + t["ArrayOfHostVMotionCompatibility"] = reflect.TypeOf((*ArrayOfHostVMotionCompatibility)(nil)).Elem() +} + +type ArrayOfHostVirtualNic struct { + HostVirtualNic []HostVirtualNic `xml:"HostVirtualNic,omitempty"` +} + +func init() { + t["ArrayOfHostVirtualNic"] = reflect.TypeOf((*ArrayOfHostVirtualNic)(nil)).Elem() +} + +type ArrayOfHostVirtualNicConfig struct { + HostVirtualNicConfig []HostVirtualNicConfig `xml:"HostVirtualNicConfig,omitempty"` +} + +func init() { + t["ArrayOfHostVirtualNicConfig"] = reflect.TypeOf((*ArrayOfHostVirtualNicConfig)(nil)).Elem() +} + +type ArrayOfHostVirtualNicManagerNicTypeSelection struct { + HostVirtualNicManagerNicTypeSelection []HostVirtualNicManagerNicTypeSelection `xml:"HostVirtualNicManagerNicTypeSelection,omitempty"` +} + +func init() { + t["ArrayOfHostVirtualNicManagerNicTypeSelection"] = reflect.TypeOf((*ArrayOfHostVirtualNicManagerNicTypeSelection)(nil)).Elem() +} + +type ArrayOfHostVirtualSwitch struct { + HostVirtualSwitch []HostVirtualSwitch `xml:"HostVirtualSwitch,omitempty"` +} + +func init() { + t["ArrayOfHostVirtualSwitch"] = reflect.TypeOf((*ArrayOfHostVirtualSwitch)(nil)).Elem() +} + +type ArrayOfHostVirtualSwitchConfig struct { + HostVirtualSwitchConfig []HostVirtualSwitchConfig `xml:"HostVirtualSwitchConfig,omitempty"` +} + +func init() { + t["ArrayOfHostVirtualSwitchConfig"] = reflect.TypeOf((*ArrayOfHostVirtualSwitchConfig)(nil)).Elem() +} + +type ArrayOfHostVmciAccessManagerAccessSpec struct { + HostVmciAccessManagerAccessSpec []HostVmciAccessManagerAccessSpec `xml:"HostVmciAccessManagerAccessSpec,omitempty"` +} + +func init() { + t["ArrayOfHostVmciAccessManagerAccessSpec"] = reflect.TypeOf((*ArrayOfHostVmciAccessManagerAccessSpec)(nil)).Elem() +} + +type ArrayOfHostVmfsRescanResult struct { + HostVmfsRescanResult []HostVmfsRescanResult `xml:"HostVmfsRescanResult,omitempty"` +} + +func init() { + t["ArrayOfHostVmfsRescanResult"] = reflect.TypeOf((*ArrayOfHostVmfsRescanResult)(nil)).Elem() +} + +type ArrayOfHostVsanInternalSystemCmmdsQuery struct { + HostVsanInternalSystemCmmdsQuery []HostVsanInternalSystemCmmdsQuery `xml:"HostVsanInternalSystemCmmdsQuery,omitempty"` +} + +func init() { + t["ArrayOfHostVsanInternalSystemCmmdsQuery"] = reflect.TypeOf((*ArrayOfHostVsanInternalSystemCmmdsQuery)(nil)).Elem() +} + +type ArrayOfHostVsanInternalSystemDeleteVsanObjectsResult struct { + HostVsanInternalSystemDeleteVsanObjectsResult []HostVsanInternalSystemDeleteVsanObjectsResult `xml:"HostVsanInternalSystemDeleteVsanObjectsResult,omitempty"` +} + +func init() { + t["ArrayOfHostVsanInternalSystemDeleteVsanObjectsResult"] = reflect.TypeOf((*ArrayOfHostVsanInternalSystemDeleteVsanObjectsResult)(nil)).Elem() +} + +type ArrayOfHostVsanInternalSystemVsanObjectOperationResult struct { + HostVsanInternalSystemVsanObjectOperationResult []HostVsanInternalSystemVsanObjectOperationResult `xml:"HostVsanInternalSystemVsanObjectOperationResult,omitempty"` +} + +func init() { + t["ArrayOfHostVsanInternalSystemVsanObjectOperationResult"] = reflect.TypeOf((*ArrayOfHostVsanInternalSystemVsanObjectOperationResult)(nil)).Elem() +} + +type ArrayOfHostVsanInternalSystemVsanPhysicalDiskDiagnosticsResult struct { + HostVsanInternalSystemVsanPhysicalDiskDiagnosticsResult []HostVsanInternalSystemVsanPhysicalDiskDiagnosticsResult `xml:"HostVsanInternalSystemVsanPhysicalDiskDiagnosticsResult,omitempty"` +} + +func init() { + t["ArrayOfHostVsanInternalSystemVsanPhysicalDiskDiagnosticsResult"] = reflect.TypeOf((*ArrayOfHostVsanInternalSystemVsanPhysicalDiskDiagnosticsResult)(nil)).Elem() +} + +type ArrayOfHttpNfcLeaseDatastoreLeaseInfo struct { + HttpNfcLeaseDatastoreLeaseInfo []HttpNfcLeaseDatastoreLeaseInfo `xml:"HttpNfcLeaseDatastoreLeaseInfo,omitempty"` +} + +func init() { + t["ArrayOfHttpNfcLeaseDatastoreLeaseInfo"] = reflect.TypeOf((*ArrayOfHttpNfcLeaseDatastoreLeaseInfo)(nil)).Elem() +} + +type ArrayOfHttpNfcLeaseDeviceUrl struct { + HttpNfcLeaseDeviceUrl []HttpNfcLeaseDeviceUrl `xml:"HttpNfcLeaseDeviceUrl,omitempty"` +} + +func init() { + t["ArrayOfHttpNfcLeaseDeviceUrl"] = reflect.TypeOf((*ArrayOfHttpNfcLeaseDeviceUrl)(nil)).Elem() +} + +type ArrayOfHttpNfcLeaseHostInfo struct { + HttpNfcLeaseHostInfo []HttpNfcLeaseHostInfo `xml:"HttpNfcLeaseHostInfo,omitempty"` +} + +func init() { + t["ArrayOfHttpNfcLeaseHostInfo"] = reflect.TypeOf((*ArrayOfHttpNfcLeaseHostInfo)(nil)).Elem() +} + +type ArrayOfHttpNfcLeaseManifestEntry struct { + HttpNfcLeaseManifestEntry []HttpNfcLeaseManifestEntry `xml:"HttpNfcLeaseManifestEntry,omitempty"` +} + +func init() { + t["ArrayOfHttpNfcLeaseManifestEntry"] = reflect.TypeOf((*ArrayOfHttpNfcLeaseManifestEntry)(nil)).Elem() +} + +type ArrayOfImportOperationBulkFaultFaultOnImport struct { + ImportOperationBulkFaultFaultOnImport []ImportOperationBulkFaultFaultOnImport `xml:"ImportOperationBulkFaultFaultOnImport,omitempty"` +} + +func init() { + t["ArrayOfImportOperationBulkFaultFaultOnImport"] = reflect.TypeOf((*ArrayOfImportOperationBulkFaultFaultOnImport)(nil)).Elem() +} + +type ArrayOfImportSpec struct { + ImportSpec []BaseImportSpec `xml:"ImportSpec,omitempty,typeattr"` +} + +func init() { + t["ArrayOfImportSpec"] = reflect.TypeOf((*ArrayOfImportSpec)(nil)).Elem() +} + +type ArrayOfInt struct { + Int []int32 `xml:"int,omitempty"` +} + +func init() { + t["ArrayOfInt"] = reflect.TypeOf((*ArrayOfInt)(nil)).Elem() +} + +type ArrayOfIoFilterHostIssue struct { + IoFilterHostIssue []IoFilterHostIssue `xml:"IoFilterHostIssue,omitempty"` +} + +func init() { + t["ArrayOfIoFilterHostIssue"] = reflect.TypeOf((*ArrayOfIoFilterHostIssue)(nil)).Elem() +} + +type ArrayOfIpPool struct { + IpPool []IpPool `xml:"IpPool,omitempty"` +} + +func init() { + t["ArrayOfIpPool"] = reflect.TypeOf((*ArrayOfIpPool)(nil)).Elem() +} + +type ArrayOfIpPoolAssociation struct { + IpPoolAssociation []IpPoolAssociation `xml:"IpPoolAssociation,omitempty"` +} + +func init() { + t["ArrayOfIpPoolAssociation"] = reflect.TypeOf((*ArrayOfIpPoolAssociation)(nil)).Elem() +} + +type ArrayOfIpPoolManagerIpAllocation struct { + IpPoolManagerIpAllocation []IpPoolManagerIpAllocation `xml:"IpPoolManagerIpAllocation,omitempty"` +} + +func init() { + t["ArrayOfIpPoolManagerIpAllocation"] = reflect.TypeOf((*ArrayOfIpPoolManagerIpAllocation)(nil)).Elem() +} + +type ArrayOfIscsiDependencyEntity struct { + IscsiDependencyEntity []IscsiDependencyEntity `xml:"IscsiDependencyEntity,omitempty"` +} + +func init() { + t["ArrayOfIscsiDependencyEntity"] = reflect.TypeOf((*ArrayOfIscsiDependencyEntity)(nil)).Elem() +} + +type ArrayOfIscsiPortInfo struct { + IscsiPortInfo []IscsiPortInfo `xml:"IscsiPortInfo,omitempty"` +} + +func init() { + t["ArrayOfIscsiPortInfo"] = reflect.TypeOf((*ArrayOfIscsiPortInfo)(nil)).Elem() +} + +type ArrayOfKernelModuleInfo struct { + KernelModuleInfo []KernelModuleInfo `xml:"KernelModuleInfo,omitempty"` +} + +func init() { + t["ArrayOfKernelModuleInfo"] = reflect.TypeOf((*ArrayOfKernelModuleInfo)(nil)).Elem() +} + +type ArrayOfKeyAnyValue struct { + KeyAnyValue []KeyAnyValue `xml:"KeyAnyValue,omitempty"` +} + +func init() { + t["ArrayOfKeyAnyValue"] = reflect.TypeOf((*ArrayOfKeyAnyValue)(nil)).Elem() +} + +type ArrayOfKeyValue struct { + KeyValue []KeyValue `xml:"KeyValue,omitempty"` +} + +func init() { + t["ArrayOfKeyValue"] = reflect.TypeOf((*ArrayOfKeyValue)(nil)).Elem() +} + +type ArrayOfLicenseAssignmentManagerLicenseAssignment struct { + LicenseAssignmentManagerLicenseAssignment []LicenseAssignmentManagerLicenseAssignment `xml:"LicenseAssignmentManagerLicenseAssignment,omitempty"` +} + +func init() { + t["ArrayOfLicenseAssignmentManagerLicenseAssignment"] = reflect.TypeOf((*ArrayOfLicenseAssignmentManagerLicenseAssignment)(nil)).Elem() +} + +type ArrayOfLicenseAvailabilityInfo struct { + LicenseAvailabilityInfo []LicenseAvailabilityInfo `xml:"LicenseAvailabilityInfo,omitempty"` +} + +func init() { + t["ArrayOfLicenseAvailabilityInfo"] = reflect.TypeOf((*ArrayOfLicenseAvailabilityInfo)(nil)).Elem() +} + +type ArrayOfLicenseFeatureInfo struct { + LicenseFeatureInfo []LicenseFeatureInfo `xml:"LicenseFeatureInfo,omitempty"` +} + +func init() { + t["ArrayOfLicenseFeatureInfo"] = reflect.TypeOf((*ArrayOfLicenseFeatureInfo)(nil)).Elem() +} + +type ArrayOfLicenseManagerLicenseInfo struct { + LicenseManagerLicenseInfo []LicenseManagerLicenseInfo `xml:"LicenseManagerLicenseInfo,omitempty"` +} + +func init() { + t["ArrayOfLicenseManagerLicenseInfo"] = reflect.TypeOf((*ArrayOfLicenseManagerLicenseInfo)(nil)).Elem() +} + +type ArrayOfLicenseReservationInfo struct { + LicenseReservationInfo []LicenseReservationInfo `xml:"LicenseReservationInfo,omitempty"` +} + +func init() { + t["ArrayOfLicenseReservationInfo"] = reflect.TypeOf((*ArrayOfLicenseReservationInfo)(nil)).Elem() +} + +type ArrayOfLocalizableMessage struct { + LocalizableMessage []LocalizableMessage `xml:"LocalizableMessage,omitempty"` +} + +func init() { + t["ArrayOfLocalizableMessage"] = reflect.TypeOf((*ArrayOfLocalizableMessage)(nil)).Elem() +} + +type ArrayOfLocalizationManagerMessageCatalog struct { + LocalizationManagerMessageCatalog []LocalizationManagerMessageCatalog `xml:"LocalizationManagerMessageCatalog,omitempty"` +} + +func init() { + t["ArrayOfLocalizationManagerMessageCatalog"] = reflect.TypeOf((*ArrayOfLocalizationManagerMessageCatalog)(nil)).Elem() +} + +type ArrayOfLong struct { + Long []int64 `xml:"long,omitempty"` +} + +func init() { + t["ArrayOfLong"] = reflect.TypeOf((*ArrayOfLong)(nil)).Elem() +} + +type ArrayOfManagedObjectReference struct { + ManagedObjectReference []ManagedObjectReference `xml:"ManagedObjectReference,omitempty"` +} + +func init() { + t["ArrayOfManagedObjectReference"] = reflect.TypeOf((*ArrayOfManagedObjectReference)(nil)).Elem() +} + +type ArrayOfMethodActionArgument struct { + MethodActionArgument []MethodActionArgument `xml:"MethodActionArgument,omitempty"` +} + +func init() { + t["ArrayOfMethodActionArgument"] = reflect.TypeOf((*ArrayOfMethodActionArgument)(nil)).Elem() +} + +type ArrayOfMethodFault struct { + MethodFault []BaseMethodFault `xml:"MethodFault,omitempty,typeattr"` +} + +func init() { + t["ArrayOfMethodFault"] = reflect.TypeOf((*ArrayOfMethodFault)(nil)).Elem() +} + +type ArrayOfMissingObject struct { + MissingObject []MissingObject `xml:"MissingObject,omitempty"` +} + +func init() { + t["ArrayOfMissingObject"] = reflect.TypeOf((*ArrayOfMissingObject)(nil)).Elem() +} + +type ArrayOfMissingProperty struct { + MissingProperty []MissingProperty `xml:"MissingProperty,omitempty"` +} + +func init() { + t["ArrayOfMissingProperty"] = reflect.TypeOf((*ArrayOfMissingProperty)(nil)).Elem() +} + +type ArrayOfMultipleCertificatesVerifyFaultThumbprintData struct { + MultipleCertificatesVerifyFaultThumbprintData []MultipleCertificatesVerifyFaultThumbprintData `xml:"MultipleCertificatesVerifyFaultThumbprintData,omitempty"` +} + +func init() { + t["ArrayOfMultipleCertificatesVerifyFaultThumbprintData"] = reflect.TypeOf((*ArrayOfMultipleCertificatesVerifyFaultThumbprintData)(nil)).Elem() +} + +type ArrayOfNasStorageProfile struct { + NasStorageProfile []NasStorageProfile `xml:"NasStorageProfile,omitempty"` +} + +func init() { + t["ArrayOfNasStorageProfile"] = reflect.TypeOf((*ArrayOfNasStorageProfile)(nil)).Elem() +} + +type ArrayOfNetIpConfigInfoIpAddress struct { + NetIpConfigInfoIpAddress []NetIpConfigInfoIpAddress `xml:"NetIpConfigInfoIpAddress,omitempty"` +} + +func init() { + t["ArrayOfNetIpConfigInfoIpAddress"] = reflect.TypeOf((*ArrayOfNetIpConfigInfoIpAddress)(nil)).Elem() +} + +type ArrayOfNetIpConfigSpecIpAddressSpec struct { + NetIpConfigSpecIpAddressSpec []NetIpConfigSpecIpAddressSpec `xml:"NetIpConfigSpecIpAddressSpec,omitempty"` +} + +func init() { + t["ArrayOfNetIpConfigSpecIpAddressSpec"] = reflect.TypeOf((*ArrayOfNetIpConfigSpecIpAddressSpec)(nil)).Elem() +} + +type ArrayOfNetIpRouteConfigInfoIpRoute struct { + NetIpRouteConfigInfoIpRoute []NetIpRouteConfigInfoIpRoute `xml:"NetIpRouteConfigInfoIpRoute,omitempty"` +} + +func init() { + t["ArrayOfNetIpRouteConfigInfoIpRoute"] = reflect.TypeOf((*ArrayOfNetIpRouteConfigInfoIpRoute)(nil)).Elem() +} + +type ArrayOfNetIpRouteConfigSpecIpRouteSpec struct { + NetIpRouteConfigSpecIpRouteSpec []NetIpRouteConfigSpecIpRouteSpec `xml:"NetIpRouteConfigSpecIpRouteSpec,omitempty"` +} + +func init() { + t["ArrayOfNetIpRouteConfigSpecIpRouteSpec"] = reflect.TypeOf((*ArrayOfNetIpRouteConfigSpecIpRouteSpec)(nil)).Elem() +} + +type ArrayOfNetIpStackInfoDefaultRouter struct { + NetIpStackInfoDefaultRouter []NetIpStackInfoDefaultRouter `xml:"NetIpStackInfoDefaultRouter,omitempty"` +} + +func init() { + t["ArrayOfNetIpStackInfoDefaultRouter"] = reflect.TypeOf((*ArrayOfNetIpStackInfoDefaultRouter)(nil)).Elem() +} + +type ArrayOfNetIpStackInfoNetToMedia struct { + NetIpStackInfoNetToMedia []NetIpStackInfoNetToMedia `xml:"NetIpStackInfoNetToMedia,omitempty"` +} + +func init() { + t["ArrayOfNetIpStackInfoNetToMedia"] = reflect.TypeOf((*ArrayOfNetIpStackInfoNetToMedia)(nil)).Elem() +} + +type ArrayOfNetStackInstanceProfile struct { + NetStackInstanceProfile []NetStackInstanceProfile `xml:"NetStackInstanceProfile,omitempty"` +} + +func init() { + t["ArrayOfNetStackInstanceProfile"] = reflect.TypeOf((*ArrayOfNetStackInstanceProfile)(nil)).Elem() +} + +type ArrayOfNumericRange struct { + NumericRange []NumericRange `xml:"NumericRange,omitempty"` +} + +func init() { + t["ArrayOfNumericRange"] = reflect.TypeOf((*ArrayOfNumericRange)(nil)).Elem() +} + +type ArrayOfObjectContent struct { + ObjectContent []ObjectContent `xml:"ObjectContent,omitempty"` +} + +func init() { + t["ArrayOfObjectContent"] = reflect.TypeOf((*ArrayOfObjectContent)(nil)).Elem() +} + +type ArrayOfObjectSpec struct { + ObjectSpec []ObjectSpec `xml:"ObjectSpec,omitempty"` +} + +func init() { + t["ArrayOfObjectSpec"] = reflect.TypeOf((*ArrayOfObjectSpec)(nil)).Elem() +} + +type ArrayOfObjectUpdate struct { + ObjectUpdate []ObjectUpdate `xml:"ObjectUpdate,omitempty"` +} + +func init() { + t["ArrayOfObjectUpdate"] = reflect.TypeOf((*ArrayOfObjectUpdate)(nil)).Elem() +} + +type ArrayOfOpaqueNetworkTargetInfo struct { + OpaqueNetworkTargetInfo []OpaqueNetworkTargetInfo `xml:"OpaqueNetworkTargetInfo,omitempty"` +} + +func init() { + t["ArrayOfOpaqueNetworkTargetInfo"] = reflect.TypeOf((*ArrayOfOpaqueNetworkTargetInfo)(nil)).Elem() +} + +type ArrayOfOptionDef struct { + OptionDef []OptionDef `xml:"OptionDef,omitempty"` +} + +func init() { + t["ArrayOfOptionDef"] = reflect.TypeOf((*ArrayOfOptionDef)(nil)).Elem() +} + +type ArrayOfOptionProfile struct { + OptionProfile []OptionProfile `xml:"OptionProfile,omitempty"` +} + +func init() { + t["ArrayOfOptionProfile"] = reflect.TypeOf((*ArrayOfOptionProfile)(nil)).Elem() +} + +type ArrayOfOptionValue struct { + OptionValue []BaseOptionValue `xml:"OptionValue,omitempty,typeattr"` +} + +func init() { + t["ArrayOfOptionValue"] = reflect.TypeOf((*ArrayOfOptionValue)(nil)).Elem() +} + +type ArrayOfOvfConsumerOstNode struct { + OvfConsumerOstNode []OvfConsumerOstNode `xml:"OvfConsumerOstNode,omitempty"` +} + +func init() { + t["ArrayOfOvfConsumerOstNode"] = reflect.TypeOf((*ArrayOfOvfConsumerOstNode)(nil)).Elem() +} + +type ArrayOfOvfConsumerOvfSection struct { + OvfConsumerOvfSection []OvfConsumerOvfSection `xml:"OvfConsumerOvfSection,omitempty"` +} + +func init() { + t["ArrayOfOvfConsumerOvfSection"] = reflect.TypeOf((*ArrayOfOvfConsumerOvfSection)(nil)).Elem() +} + +type ArrayOfOvfDeploymentOption struct { + OvfDeploymentOption []OvfDeploymentOption `xml:"OvfDeploymentOption,omitempty"` +} + +func init() { + t["ArrayOfOvfDeploymentOption"] = reflect.TypeOf((*ArrayOfOvfDeploymentOption)(nil)).Elem() +} + +type ArrayOfOvfFile struct { + OvfFile []OvfFile `xml:"OvfFile,omitempty"` +} + +func init() { + t["ArrayOfOvfFile"] = reflect.TypeOf((*ArrayOfOvfFile)(nil)).Elem() +} + +type ArrayOfOvfFileItem struct { + OvfFileItem []OvfFileItem `xml:"OvfFileItem,omitempty"` +} + +func init() { + t["ArrayOfOvfFileItem"] = reflect.TypeOf((*ArrayOfOvfFileItem)(nil)).Elem() +} + +type ArrayOfOvfNetworkInfo struct { + OvfNetworkInfo []OvfNetworkInfo `xml:"OvfNetworkInfo,omitempty"` +} + +func init() { + t["ArrayOfOvfNetworkInfo"] = reflect.TypeOf((*ArrayOfOvfNetworkInfo)(nil)).Elem() +} + +type ArrayOfOvfNetworkMapping struct { + OvfNetworkMapping []OvfNetworkMapping `xml:"OvfNetworkMapping,omitempty"` +} + +func init() { + t["ArrayOfOvfNetworkMapping"] = reflect.TypeOf((*ArrayOfOvfNetworkMapping)(nil)).Elem() +} + +type ArrayOfOvfOptionInfo struct { + OvfOptionInfo []OvfOptionInfo `xml:"OvfOptionInfo,omitempty"` +} + +func init() { + t["ArrayOfOvfOptionInfo"] = reflect.TypeOf((*ArrayOfOvfOptionInfo)(nil)).Elem() +} + +type ArrayOfOvfResourceMap struct { + OvfResourceMap []OvfResourceMap `xml:"OvfResourceMap,omitempty"` +} + +func init() { + t["ArrayOfOvfResourceMap"] = reflect.TypeOf((*ArrayOfOvfResourceMap)(nil)).Elem() +} + +type ArrayOfPerfCounterInfo struct { + PerfCounterInfo []PerfCounterInfo `xml:"PerfCounterInfo,omitempty"` +} + +func init() { + t["ArrayOfPerfCounterInfo"] = reflect.TypeOf((*ArrayOfPerfCounterInfo)(nil)).Elem() +} + +type ArrayOfPerfEntityMetricBase struct { + PerfEntityMetricBase []BasePerfEntityMetricBase `xml:"PerfEntityMetricBase,omitempty,typeattr"` +} + +func init() { + t["ArrayOfPerfEntityMetricBase"] = reflect.TypeOf((*ArrayOfPerfEntityMetricBase)(nil)).Elem() +} + +type ArrayOfPerfInterval struct { + PerfInterval []PerfInterval `xml:"PerfInterval,omitempty"` +} + +func init() { + t["ArrayOfPerfInterval"] = reflect.TypeOf((*ArrayOfPerfInterval)(nil)).Elem() +} + +type ArrayOfPerfMetricId struct { + PerfMetricId []PerfMetricId `xml:"PerfMetricId,omitempty"` +} + +func init() { + t["ArrayOfPerfMetricId"] = reflect.TypeOf((*ArrayOfPerfMetricId)(nil)).Elem() +} + +type ArrayOfPerfMetricSeries struct { + PerfMetricSeries []BasePerfMetricSeries `xml:"PerfMetricSeries,omitempty,typeattr"` +} + +func init() { + t["ArrayOfPerfMetricSeries"] = reflect.TypeOf((*ArrayOfPerfMetricSeries)(nil)).Elem() +} + +type ArrayOfPerfMetricSeriesCSV struct { + PerfMetricSeriesCSV []PerfMetricSeriesCSV `xml:"PerfMetricSeriesCSV,omitempty"` +} + +func init() { + t["ArrayOfPerfMetricSeriesCSV"] = reflect.TypeOf((*ArrayOfPerfMetricSeriesCSV)(nil)).Elem() +} + +type ArrayOfPerfQuerySpec struct { + PerfQuerySpec []PerfQuerySpec `xml:"PerfQuerySpec,omitempty"` +} + +func init() { + t["ArrayOfPerfQuerySpec"] = reflect.TypeOf((*ArrayOfPerfQuerySpec)(nil)).Elem() +} + +type ArrayOfPerfSampleInfo struct { + PerfSampleInfo []PerfSampleInfo `xml:"PerfSampleInfo,omitempty"` +} + +func init() { + t["ArrayOfPerfSampleInfo"] = reflect.TypeOf((*ArrayOfPerfSampleInfo)(nil)).Elem() +} + +type ArrayOfPerformanceManagerCounterLevelMapping struct { + PerformanceManagerCounterLevelMapping []PerformanceManagerCounterLevelMapping `xml:"PerformanceManagerCounterLevelMapping,omitempty"` +} + +func init() { + t["ArrayOfPerformanceManagerCounterLevelMapping"] = reflect.TypeOf((*ArrayOfPerformanceManagerCounterLevelMapping)(nil)).Elem() +} + +type ArrayOfPermission struct { + Permission []Permission `xml:"Permission,omitempty"` +} + +func init() { + t["ArrayOfPermission"] = reflect.TypeOf((*ArrayOfPermission)(nil)).Elem() +} + +type ArrayOfPermissionProfile struct { + PermissionProfile []PermissionProfile `xml:"PermissionProfile,omitempty"` +} + +func init() { + t["ArrayOfPermissionProfile"] = reflect.TypeOf((*ArrayOfPermissionProfile)(nil)).Elem() +} + +type ArrayOfPhysicalNic struct { + PhysicalNic []PhysicalNic `xml:"PhysicalNic,omitempty"` +} + +func init() { + t["ArrayOfPhysicalNic"] = reflect.TypeOf((*ArrayOfPhysicalNic)(nil)).Elem() +} + +type ArrayOfPhysicalNicConfig struct { + PhysicalNicConfig []PhysicalNicConfig `xml:"PhysicalNicConfig,omitempty"` +} + +func init() { + t["ArrayOfPhysicalNicConfig"] = reflect.TypeOf((*ArrayOfPhysicalNicConfig)(nil)).Elem() +} + +type ArrayOfPhysicalNicHintInfo struct { + PhysicalNicHintInfo []PhysicalNicHintInfo `xml:"PhysicalNicHintInfo,omitempty"` +} + +func init() { + t["ArrayOfPhysicalNicHintInfo"] = reflect.TypeOf((*ArrayOfPhysicalNicHintInfo)(nil)).Elem() +} + +type ArrayOfPhysicalNicIpHint struct { + PhysicalNicIpHint []PhysicalNicIpHint `xml:"PhysicalNicIpHint,omitempty"` +} + +func init() { + t["ArrayOfPhysicalNicIpHint"] = reflect.TypeOf((*ArrayOfPhysicalNicIpHint)(nil)).Elem() +} + +type ArrayOfPhysicalNicLinkInfo struct { + PhysicalNicLinkInfo []PhysicalNicLinkInfo `xml:"PhysicalNicLinkInfo,omitempty"` +} + +func init() { + t["ArrayOfPhysicalNicLinkInfo"] = reflect.TypeOf((*ArrayOfPhysicalNicLinkInfo)(nil)).Elem() +} + +type ArrayOfPhysicalNicNameHint struct { + PhysicalNicNameHint []PhysicalNicNameHint `xml:"PhysicalNicNameHint,omitempty"` +} + +func init() { + t["ArrayOfPhysicalNicNameHint"] = reflect.TypeOf((*ArrayOfPhysicalNicNameHint)(nil)).Elem() +} + +type ArrayOfPhysicalNicProfile struct { + PhysicalNicProfile []PhysicalNicProfile `xml:"PhysicalNicProfile,omitempty"` +} + +func init() { + t["ArrayOfPhysicalNicProfile"] = reflect.TypeOf((*ArrayOfPhysicalNicProfile)(nil)).Elem() +} + +type ArrayOfPlacementAffinityRule struct { + PlacementAffinityRule []PlacementAffinityRule `xml:"PlacementAffinityRule,omitempty"` +} + +func init() { + t["ArrayOfPlacementAffinityRule"] = reflect.TypeOf((*ArrayOfPlacementAffinityRule)(nil)).Elem() +} + +type ArrayOfPlacementSpec struct { + PlacementSpec []PlacementSpec `xml:"PlacementSpec,omitempty"` +} + +func init() { + t["ArrayOfPlacementSpec"] = reflect.TypeOf((*ArrayOfPlacementSpec)(nil)).Elem() +} + +type ArrayOfPnicUplinkProfile struct { + PnicUplinkProfile []PnicUplinkProfile `xml:"PnicUplinkProfile,omitempty"` +} + +func init() { + t["ArrayOfPnicUplinkProfile"] = reflect.TypeOf((*ArrayOfPnicUplinkProfile)(nil)).Elem() +} + +type ArrayOfPodDiskLocator struct { + PodDiskLocator []PodDiskLocator `xml:"PodDiskLocator,omitempty"` +} + +func init() { + t["ArrayOfPodDiskLocator"] = reflect.TypeOf((*ArrayOfPodDiskLocator)(nil)).Elem() +} + +type ArrayOfPolicyOption struct { + PolicyOption []BasePolicyOption `xml:"PolicyOption,omitempty,typeattr"` +} + +func init() { + t["ArrayOfPolicyOption"] = reflect.TypeOf((*ArrayOfPolicyOption)(nil)).Elem() +} + +type ArrayOfPrivilegeAvailability struct { + PrivilegeAvailability []PrivilegeAvailability `xml:"PrivilegeAvailability,omitempty"` +} + +func init() { + t["ArrayOfPrivilegeAvailability"] = reflect.TypeOf((*ArrayOfPrivilegeAvailability)(nil)).Elem() +} + +type ArrayOfProductComponentInfo struct { + ProductComponentInfo []ProductComponentInfo `xml:"ProductComponentInfo,omitempty"` +} + +func init() { + t["ArrayOfProductComponentInfo"] = reflect.TypeOf((*ArrayOfProductComponentInfo)(nil)).Elem() +} + +type ArrayOfProfileApplyProfileProperty struct { + ProfileApplyProfileProperty []ProfileApplyProfileProperty `xml:"ProfileApplyProfileProperty,omitempty"` +} + +func init() { + t["ArrayOfProfileApplyProfileProperty"] = reflect.TypeOf((*ArrayOfProfileApplyProfileProperty)(nil)).Elem() +} + +type ArrayOfProfileDeferredPolicyOptionParameter struct { + ProfileDeferredPolicyOptionParameter []ProfileDeferredPolicyOptionParameter `xml:"ProfileDeferredPolicyOptionParameter,omitempty"` +} + +func init() { + t["ArrayOfProfileDeferredPolicyOptionParameter"] = reflect.TypeOf((*ArrayOfProfileDeferredPolicyOptionParameter)(nil)).Elem() +} + +type ArrayOfProfileDescriptionSection struct { + ProfileDescriptionSection []ProfileDescriptionSection `xml:"ProfileDescriptionSection,omitempty"` +} + +func init() { + t["ArrayOfProfileDescriptionSection"] = reflect.TypeOf((*ArrayOfProfileDescriptionSection)(nil)).Elem() +} + +type ArrayOfProfileExecuteError struct { + ProfileExecuteError []ProfileExecuteError `xml:"ProfileExecuteError,omitempty"` +} + +func init() { + t["ArrayOfProfileExecuteError"] = reflect.TypeOf((*ArrayOfProfileExecuteError)(nil)).Elem() +} + +type ArrayOfProfileExpression struct { + ProfileExpression []BaseProfileExpression `xml:"ProfileExpression,omitempty,typeattr"` +} + +func init() { + t["ArrayOfProfileExpression"] = reflect.TypeOf((*ArrayOfProfileExpression)(nil)).Elem() +} + +type ArrayOfProfileExpressionMetadata struct { + ProfileExpressionMetadata []ProfileExpressionMetadata `xml:"ProfileExpressionMetadata,omitempty"` +} + +func init() { + t["ArrayOfProfileExpressionMetadata"] = reflect.TypeOf((*ArrayOfProfileExpressionMetadata)(nil)).Elem() +} + +type ArrayOfProfileMetadata struct { + ProfileMetadata []ProfileMetadata `xml:"ProfileMetadata,omitempty"` +} + +func init() { + t["ArrayOfProfileMetadata"] = reflect.TypeOf((*ArrayOfProfileMetadata)(nil)).Elem() +} + +type ArrayOfProfileMetadataProfileSortSpec struct { + ProfileMetadataProfileSortSpec []ProfileMetadataProfileSortSpec `xml:"ProfileMetadataProfileSortSpec,omitempty"` +} + +func init() { + t["ArrayOfProfileMetadataProfileSortSpec"] = reflect.TypeOf((*ArrayOfProfileMetadataProfileSortSpec)(nil)).Elem() +} + +type ArrayOfProfileParameterMetadata struct { + ProfileParameterMetadata []ProfileParameterMetadata `xml:"ProfileParameterMetadata,omitempty"` +} + +func init() { + t["ArrayOfProfileParameterMetadata"] = reflect.TypeOf((*ArrayOfProfileParameterMetadata)(nil)).Elem() +} + +type ArrayOfProfilePolicy struct { + ProfilePolicy []ProfilePolicy `xml:"ProfilePolicy,omitempty"` +} + +func init() { + t["ArrayOfProfilePolicy"] = reflect.TypeOf((*ArrayOfProfilePolicy)(nil)).Elem() +} + +type ArrayOfProfilePolicyMetadata struct { + ProfilePolicyMetadata []ProfilePolicyMetadata `xml:"ProfilePolicyMetadata,omitempty"` +} + +func init() { + t["ArrayOfProfilePolicyMetadata"] = reflect.TypeOf((*ArrayOfProfilePolicyMetadata)(nil)).Elem() +} + +type ArrayOfProfilePolicyOptionMetadata struct { + ProfilePolicyOptionMetadata []BaseProfilePolicyOptionMetadata `xml:"ProfilePolicyOptionMetadata,omitempty,typeattr"` +} + +func init() { + t["ArrayOfProfilePolicyOptionMetadata"] = reflect.TypeOf((*ArrayOfProfilePolicyOptionMetadata)(nil)).Elem() +} + +type ArrayOfProfileProfileStructureProperty struct { + ProfileProfileStructureProperty []ProfileProfileStructureProperty `xml:"ProfileProfileStructureProperty,omitempty"` +} + +func init() { + t["ArrayOfProfileProfileStructureProperty"] = reflect.TypeOf((*ArrayOfProfileProfileStructureProperty)(nil)).Elem() +} + +type ArrayOfProfilePropertyPath struct { + ProfilePropertyPath []ProfilePropertyPath `xml:"ProfilePropertyPath,omitempty"` +} + +func init() { + t["ArrayOfProfilePropertyPath"] = reflect.TypeOf((*ArrayOfProfilePropertyPath)(nil)).Elem() +} + +type ArrayOfProfileUpdateFailedUpdateFailure struct { + ProfileUpdateFailedUpdateFailure []ProfileUpdateFailedUpdateFailure `xml:"ProfileUpdateFailedUpdateFailure,omitempty"` +} + +func init() { + t["ArrayOfProfileUpdateFailedUpdateFailure"] = reflect.TypeOf((*ArrayOfProfileUpdateFailedUpdateFailure)(nil)).Elem() +} + +type ArrayOfPropertyChange struct { + PropertyChange []PropertyChange `xml:"PropertyChange,omitempty"` +} + +func init() { + t["ArrayOfPropertyChange"] = reflect.TypeOf((*ArrayOfPropertyChange)(nil)).Elem() +} + +type ArrayOfPropertyFilterSpec struct { + PropertyFilterSpec []PropertyFilterSpec `xml:"PropertyFilterSpec,omitempty"` +} + +func init() { + t["ArrayOfPropertyFilterSpec"] = reflect.TypeOf((*ArrayOfPropertyFilterSpec)(nil)).Elem() +} + +type ArrayOfPropertyFilterUpdate struct { + PropertyFilterUpdate []PropertyFilterUpdate `xml:"PropertyFilterUpdate,omitempty"` +} + +func init() { + t["ArrayOfPropertyFilterUpdate"] = reflect.TypeOf((*ArrayOfPropertyFilterUpdate)(nil)).Elem() +} + +type ArrayOfPropertySpec struct { + PropertySpec []PropertySpec `xml:"PropertySpec,omitempty"` +} + +func init() { + t["ArrayOfPropertySpec"] = reflect.TypeOf((*ArrayOfPropertySpec)(nil)).Elem() +} + +type ArrayOfReplicationInfoDiskSettings struct { + ReplicationInfoDiskSettings []ReplicationInfoDiskSettings `xml:"ReplicationInfoDiskSettings,omitempty"` +} + +func init() { + t["ArrayOfReplicationInfoDiskSettings"] = reflect.TypeOf((*ArrayOfReplicationInfoDiskSettings)(nil)).Elem() +} + +type ArrayOfResourceConfigSpec struct { + ResourceConfigSpec []ResourceConfigSpec `xml:"ResourceConfigSpec,omitempty"` +} + +func init() { + t["ArrayOfResourceConfigSpec"] = reflect.TypeOf((*ArrayOfResourceConfigSpec)(nil)).Elem() +} + +type ArrayOfScheduledTaskDetail struct { + ScheduledTaskDetail []ScheduledTaskDetail `xml:"ScheduledTaskDetail,omitempty"` +} + +func init() { + t["ArrayOfScheduledTaskDetail"] = reflect.TypeOf((*ArrayOfScheduledTaskDetail)(nil)).Elem() +} + +type ArrayOfScsiLun struct { + ScsiLun []BaseScsiLun `xml:"ScsiLun,omitempty,typeattr"` +} + +func init() { + t["ArrayOfScsiLun"] = reflect.TypeOf((*ArrayOfScsiLun)(nil)).Elem() +} + +type ArrayOfScsiLunDescriptor struct { + ScsiLunDescriptor []ScsiLunDescriptor `xml:"ScsiLunDescriptor,omitempty"` +} + +func init() { + t["ArrayOfScsiLunDescriptor"] = reflect.TypeOf((*ArrayOfScsiLunDescriptor)(nil)).Elem() +} + +type ArrayOfScsiLunDurableName struct { + ScsiLunDurableName []ScsiLunDurableName `xml:"ScsiLunDurableName,omitempty"` +} + +func init() { + t["ArrayOfScsiLunDurableName"] = reflect.TypeOf((*ArrayOfScsiLunDurableName)(nil)).Elem() +} + +type ArrayOfSelectionSet struct { + SelectionSet []BaseSelectionSet `xml:"SelectionSet,omitempty,typeattr"` +} + +func init() { + t["ArrayOfSelectionSet"] = reflect.TypeOf((*ArrayOfSelectionSet)(nil)).Elem() +} + +type ArrayOfSelectionSpec struct { + SelectionSpec []BaseSelectionSpec `xml:"SelectionSpec,omitempty,typeattr"` +} + +func init() { + t["ArrayOfSelectionSpec"] = reflect.TypeOf((*ArrayOfSelectionSpec)(nil)).Elem() +} + +type ArrayOfServiceConsolePortGroupProfile struct { + ServiceConsolePortGroupProfile []ServiceConsolePortGroupProfile `xml:"ServiceConsolePortGroupProfile,omitempty"` +} + +func init() { + t["ArrayOfServiceConsolePortGroupProfile"] = reflect.TypeOf((*ArrayOfServiceConsolePortGroupProfile)(nil)).Elem() +} + +type ArrayOfServiceLocator struct { + ServiceLocator []ServiceLocator `xml:"ServiceLocator,omitempty"` +} + +func init() { + t["ArrayOfServiceLocator"] = reflect.TypeOf((*ArrayOfServiceLocator)(nil)).Elem() +} + +type ArrayOfServiceManagerServiceInfo struct { + ServiceManagerServiceInfo []ServiceManagerServiceInfo `xml:"ServiceManagerServiceInfo,omitempty"` +} + +func init() { + t["ArrayOfServiceManagerServiceInfo"] = reflect.TypeOf((*ArrayOfServiceManagerServiceInfo)(nil)).Elem() +} + +type ArrayOfServiceProfile struct { + ServiceProfile []ServiceProfile `xml:"ServiceProfile,omitempty"` +} + +func init() { + t["ArrayOfServiceProfile"] = reflect.TypeOf((*ArrayOfServiceProfile)(nil)).Elem() +} + +type ArrayOfShort struct { + Short []int16 `xml:"short,omitempty"` +} + +func init() { + t["ArrayOfShort"] = reflect.TypeOf((*ArrayOfShort)(nil)).Elem() +} + +type ArrayOfStaticRouteProfile struct { + StaticRouteProfile []StaticRouteProfile `xml:"StaticRouteProfile,omitempty"` +} + +func init() { + t["ArrayOfStaticRouteProfile"] = reflect.TypeOf((*ArrayOfStaticRouteProfile)(nil)).Elem() +} + +type ArrayOfStorageDrsOptionSpec struct { + StorageDrsOptionSpec []StorageDrsOptionSpec `xml:"StorageDrsOptionSpec,omitempty"` +} + +func init() { + t["ArrayOfStorageDrsOptionSpec"] = reflect.TypeOf((*ArrayOfStorageDrsOptionSpec)(nil)).Elem() +} + +type ArrayOfStorageDrsPlacementRankVmSpec struct { + StorageDrsPlacementRankVmSpec []StorageDrsPlacementRankVmSpec `xml:"StorageDrsPlacementRankVmSpec,omitempty"` +} + +func init() { + t["ArrayOfStorageDrsPlacementRankVmSpec"] = reflect.TypeOf((*ArrayOfStorageDrsPlacementRankVmSpec)(nil)).Elem() +} + +type ArrayOfStorageDrsVmConfigInfo struct { + StorageDrsVmConfigInfo []StorageDrsVmConfigInfo `xml:"StorageDrsVmConfigInfo,omitempty"` +} + +func init() { + t["ArrayOfStorageDrsVmConfigInfo"] = reflect.TypeOf((*ArrayOfStorageDrsVmConfigInfo)(nil)).Elem() +} + +type ArrayOfStorageDrsVmConfigSpec struct { + StorageDrsVmConfigSpec []StorageDrsVmConfigSpec `xml:"StorageDrsVmConfigSpec,omitempty"` +} + +func init() { + t["ArrayOfStorageDrsVmConfigSpec"] = reflect.TypeOf((*ArrayOfStorageDrsVmConfigSpec)(nil)).Elem() +} + +type ArrayOfStoragePerformanceSummary struct { + StoragePerformanceSummary []StoragePerformanceSummary `xml:"StoragePerformanceSummary,omitempty"` +} + +func init() { + t["ArrayOfStoragePerformanceSummary"] = reflect.TypeOf((*ArrayOfStoragePerformanceSummary)(nil)).Elem() +} + +type ArrayOfStorageRequirement struct { + StorageRequirement []StorageRequirement `xml:"StorageRequirement,omitempty"` +} + +func init() { + t["ArrayOfStorageRequirement"] = reflect.TypeOf((*ArrayOfStorageRequirement)(nil)).Elem() +} + +type ArrayOfString struct { + String []string `xml:"string,omitempty"` +} + +func init() { + t["ArrayOfString"] = reflect.TypeOf((*ArrayOfString)(nil)).Elem() +} + +type ArrayOfTag struct { + Tag []Tag `xml:"Tag,omitempty"` +} + +func init() { + t["ArrayOfTag"] = reflect.TypeOf((*ArrayOfTag)(nil)).Elem() +} + +type ArrayOfTaskInfo struct { + TaskInfo []TaskInfo `xml:"TaskInfo,omitempty"` +} + +func init() { + t["ArrayOfTaskInfo"] = reflect.TypeOf((*ArrayOfTaskInfo)(nil)).Elem() +} + +type ArrayOfTaskInfoState struct { + TaskInfoState []TaskInfoState `xml:"TaskInfoState,omitempty"` +} + +func init() { + t["ArrayOfTaskInfoState"] = reflect.TypeOf((*ArrayOfTaskInfoState)(nil)).Elem() +} + +type ArrayOfTypeDescription struct { + TypeDescription []BaseTypeDescription `xml:"TypeDescription,omitempty,typeattr"` +} + +func init() { + t["ArrayOfTypeDescription"] = reflect.TypeOf((*ArrayOfTypeDescription)(nil)).Elem() +} + +type ArrayOfUpdateVirtualMachineFilesResultFailedVmFileInfo struct { + UpdateVirtualMachineFilesResultFailedVmFileInfo []UpdateVirtualMachineFilesResultFailedVmFileInfo `xml:"UpdateVirtualMachineFilesResultFailedVmFileInfo,omitempty"` +} + +func init() { + t["ArrayOfUpdateVirtualMachineFilesResultFailedVmFileInfo"] = reflect.TypeOf((*ArrayOfUpdateVirtualMachineFilesResultFailedVmFileInfo)(nil)).Elem() +} + +type ArrayOfUserGroupProfile struct { + UserGroupProfile []UserGroupProfile `xml:"UserGroupProfile,omitempty"` +} + +func init() { + t["ArrayOfUserGroupProfile"] = reflect.TypeOf((*ArrayOfUserGroupProfile)(nil)).Elem() +} + +type ArrayOfUserProfile struct { + UserProfile []UserProfile `xml:"UserProfile,omitempty"` +} + +func init() { + t["ArrayOfUserProfile"] = reflect.TypeOf((*ArrayOfUserProfile)(nil)).Elem() +} + +type ArrayOfUserSearchResult struct { + UserSearchResult []BaseUserSearchResult `xml:"UserSearchResult,omitempty,typeattr"` +} + +func init() { + t["ArrayOfUserSearchResult"] = reflect.TypeOf((*ArrayOfUserSearchResult)(nil)).Elem() +} + +type ArrayOfUserSession struct { + UserSession []UserSession `xml:"UserSession,omitempty"` +} + +func init() { + t["ArrayOfUserSession"] = reflect.TypeOf((*ArrayOfUserSession)(nil)).Elem() +} + +type ArrayOfVASAStorageArray struct { + VASAStorageArray []VASAStorageArray `xml:"VASAStorageArray,omitempty"` +} + +func init() { + t["ArrayOfVASAStorageArray"] = reflect.TypeOf((*ArrayOfVASAStorageArray)(nil)).Elem() +} + +type ArrayOfVAppCloneSpecNetworkMappingPair struct { + VAppCloneSpecNetworkMappingPair []VAppCloneSpecNetworkMappingPair `xml:"VAppCloneSpecNetworkMappingPair,omitempty"` +} + +func init() { + t["ArrayOfVAppCloneSpecNetworkMappingPair"] = reflect.TypeOf((*ArrayOfVAppCloneSpecNetworkMappingPair)(nil)).Elem() +} + +type ArrayOfVAppCloneSpecResourceMap struct { + VAppCloneSpecResourceMap []VAppCloneSpecResourceMap `xml:"VAppCloneSpecResourceMap,omitempty"` +} + +func init() { + t["ArrayOfVAppCloneSpecResourceMap"] = reflect.TypeOf((*ArrayOfVAppCloneSpecResourceMap)(nil)).Elem() +} + +type ArrayOfVAppEntityConfigInfo struct { + VAppEntityConfigInfo []VAppEntityConfigInfo `xml:"VAppEntityConfigInfo,omitempty"` +} + +func init() { + t["ArrayOfVAppEntityConfigInfo"] = reflect.TypeOf((*ArrayOfVAppEntityConfigInfo)(nil)).Elem() +} + +type ArrayOfVAppOvfSectionInfo struct { + VAppOvfSectionInfo []VAppOvfSectionInfo `xml:"VAppOvfSectionInfo,omitempty"` +} + +func init() { + t["ArrayOfVAppOvfSectionInfo"] = reflect.TypeOf((*ArrayOfVAppOvfSectionInfo)(nil)).Elem() +} + +type ArrayOfVAppOvfSectionSpec struct { + VAppOvfSectionSpec []VAppOvfSectionSpec `xml:"VAppOvfSectionSpec,omitempty"` +} + +func init() { + t["ArrayOfVAppOvfSectionSpec"] = reflect.TypeOf((*ArrayOfVAppOvfSectionSpec)(nil)).Elem() +} + +type ArrayOfVAppProductInfo struct { + VAppProductInfo []VAppProductInfo `xml:"VAppProductInfo,omitempty"` +} + +func init() { + t["ArrayOfVAppProductInfo"] = reflect.TypeOf((*ArrayOfVAppProductInfo)(nil)).Elem() +} + +type ArrayOfVAppProductSpec struct { + VAppProductSpec []VAppProductSpec `xml:"VAppProductSpec,omitempty"` +} + +func init() { + t["ArrayOfVAppProductSpec"] = reflect.TypeOf((*ArrayOfVAppProductSpec)(nil)).Elem() +} + +type ArrayOfVAppPropertyInfo struct { + VAppPropertyInfo []VAppPropertyInfo `xml:"VAppPropertyInfo,omitempty"` +} + +func init() { + t["ArrayOfVAppPropertyInfo"] = reflect.TypeOf((*ArrayOfVAppPropertyInfo)(nil)).Elem() +} + +type ArrayOfVAppPropertySpec struct { + VAppPropertySpec []VAppPropertySpec `xml:"VAppPropertySpec,omitempty"` +} + +func init() { + t["ArrayOfVAppPropertySpec"] = reflect.TypeOf((*ArrayOfVAppPropertySpec)(nil)).Elem() +} + +type ArrayOfVMwareDVSPvlanConfigSpec struct { + VMwareDVSPvlanConfigSpec []VMwareDVSPvlanConfigSpec `xml:"VMwareDVSPvlanConfigSpec,omitempty"` +} + +func init() { + t["ArrayOfVMwareDVSPvlanConfigSpec"] = reflect.TypeOf((*ArrayOfVMwareDVSPvlanConfigSpec)(nil)).Elem() +} + +type ArrayOfVMwareDVSPvlanMapEntry struct { + VMwareDVSPvlanMapEntry []VMwareDVSPvlanMapEntry `xml:"VMwareDVSPvlanMapEntry,omitempty"` +} + +func init() { + t["ArrayOfVMwareDVSPvlanMapEntry"] = reflect.TypeOf((*ArrayOfVMwareDVSPvlanMapEntry)(nil)).Elem() +} + +type ArrayOfVMwareDVSVspanConfigSpec struct { + VMwareDVSVspanConfigSpec []VMwareDVSVspanConfigSpec `xml:"VMwareDVSVspanConfigSpec,omitempty"` +} + +func init() { + t["ArrayOfVMwareDVSVspanConfigSpec"] = reflect.TypeOf((*ArrayOfVMwareDVSVspanConfigSpec)(nil)).Elem() +} + +type ArrayOfVMwareDvsLacpGroupConfig struct { + VMwareDvsLacpGroupConfig []VMwareDvsLacpGroupConfig `xml:"VMwareDvsLacpGroupConfig,omitempty"` +} + +func init() { + t["ArrayOfVMwareDvsLacpGroupConfig"] = reflect.TypeOf((*ArrayOfVMwareDvsLacpGroupConfig)(nil)).Elem() +} + +type ArrayOfVMwareDvsLacpGroupSpec struct { + VMwareDvsLacpGroupSpec []VMwareDvsLacpGroupSpec `xml:"VMwareDvsLacpGroupSpec,omitempty"` +} + +func init() { + t["ArrayOfVMwareDvsLacpGroupSpec"] = reflect.TypeOf((*ArrayOfVMwareDvsLacpGroupSpec)(nil)).Elem() +} + +type ArrayOfVMwareVspanSession struct { + VMwareVspanSession []VMwareVspanSession `xml:"VMwareVspanSession,omitempty"` +} + +func init() { + t["ArrayOfVMwareVspanSession"] = reflect.TypeOf((*ArrayOfVMwareVspanSession)(nil)).Elem() +} + +type ArrayOfVVolHostPE struct { + VVolHostPE []VVolHostPE `xml:"VVolHostPE,omitempty"` +} + +func init() { + t["ArrayOfVVolHostPE"] = reflect.TypeOf((*ArrayOfVVolHostPE)(nil)).Elem() +} + +type ArrayOfVimVasaProviderInfo struct { + VimVasaProviderInfo []VimVasaProviderInfo `xml:"VimVasaProviderInfo,omitempty"` +} + +func init() { + t["ArrayOfVimVasaProviderInfo"] = reflect.TypeOf((*ArrayOfVimVasaProviderInfo)(nil)).Elem() +} + +type ArrayOfVimVasaProviderStatePerArray struct { + VimVasaProviderStatePerArray []VimVasaProviderStatePerArray `xml:"VimVasaProviderStatePerArray,omitempty"` +} + +func init() { + t["ArrayOfVimVasaProviderStatePerArray"] = reflect.TypeOf((*ArrayOfVimVasaProviderStatePerArray)(nil)).Elem() +} + +type ArrayOfVirtualAppLinkInfo struct { + VirtualAppLinkInfo []VirtualAppLinkInfo `xml:"VirtualAppLinkInfo,omitempty"` +} + +func init() { + t["ArrayOfVirtualAppLinkInfo"] = reflect.TypeOf((*ArrayOfVirtualAppLinkInfo)(nil)).Elem() +} + +type ArrayOfVirtualDevice struct { + VirtualDevice []BaseVirtualDevice `xml:"VirtualDevice,omitempty,typeattr"` +} + +func init() { + t["ArrayOfVirtualDevice"] = reflect.TypeOf((*ArrayOfVirtualDevice)(nil)).Elem() +} + +type ArrayOfVirtualDeviceBackingOption struct { + VirtualDeviceBackingOption []BaseVirtualDeviceBackingOption `xml:"VirtualDeviceBackingOption,omitempty,typeattr"` +} + +func init() { + t["ArrayOfVirtualDeviceBackingOption"] = reflect.TypeOf((*ArrayOfVirtualDeviceBackingOption)(nil)).Elem() +} + +type ArrayOfVirtualDeviceConfigSpec struct { + VirtualDeviceConfigSpec []BaseVirtualDeviceConfigSpec `xml:"VirtualDeviceConfigSpec,omitempty,typeattr"` +} + +func init() { + t["ArrayOfVirtualDeviceConfigSpec"] = reflect.TypeOf((*ArrayOfVirtualDeviceConfigSpec)(nil)).Elem() +} + +type ArrayOfVirtualDeviceOption struct { + VirtualDeviceOption []BaseVirtualDeviceOption `xml:"VirtualDeviceOption,omitempty,typeattr"` +} + +func init() { + t["ArrayOfVirtualDeviceOption"] = reflect.TypeOf((*ArrayOfVirtualDeviceOption)(nil)).Elem() +} + +type ArrayOfVirtualDisk struct { + VirtualDisk []VirtualDisk `xml:"VirtualDisk,omitempty"` +} + +func init() { + t["ArrayOfVirtualDisk"] = reflect.TypeOf((*ArrayOfVirtualDisk)(nil)).Elem() +} + +type ArrayOfVirtualDiskDeltaDiskFormatsSupported struct { + VirtualDiskDeltaDiskFormatsSupported []VirtualDiskDeltaDiskFormatsSupported `xml:"VirtualDiskDeltaDiskFormatsSupported,omitempty"` +} + +func init() { + t["ArrayOfVirtualDiskDeltaDiskFormatsSupported"] = reflect.TypeOf((*ArrayOfVirtualDiskDeltaDiskFormatsSupported)(nil)).Elem() +} + +type ArrayOfVirtualDiskId struct { + VirtualDiskId []VirtualDiskId `xml:"VirtualDiskId,omitempty"` +} + +func init() { + t["ArrayOfVirtualDiskId"] = reflect.TypeOf((*ArrayOfVirtualDiskId)(nil)).Elem() +} + +type ArrayOfVirtualMachineBootOptionsBootableDevice struct { + VirtualMachineBootOptionsBootableDevice []BaseVirtualMachineBootOptionsBootableDevice `xml:"VirtualMachineBootOptionsBootableDevice,omitempty,typeattr"` +} + +func init() { + t["ArrayOfVirtualMachineBootOptionsBootableDevice"] = reflect.TypeOf((*ArrayOfVirtualMachineBootOptionsBootableDevice)(nil)).Elem() +} + +type ArrayOfVirtualMachineCdromInfo struct { + VirtualMachineCdromInfo []VirtualMachineCdromInfo `xml:"VirtualMachineCdromInfo,omitempty"` +} + +func init() { + t["ArrayOfVirtualMachineCdromInfo"] = reflect.TypeOf((*ArrayOfVirtualMachineCdromInfo)(nil)).Elem() +} + +type ArrayOfVirtualMachineConfigInfoDatastoreUrlPair struct { + VirtualMachineConfigInfoDatastoreUrlPair []VirtualMachineConfigInfoDatastoreUrlPair `xml:"VirtualMachineConfigInfoDatastoreUrlPair,omitempty"` +} + +func init() { + t["ArrayOfVirtualMachineConfigInfoDatastoreUrlPair"] = reflect.TypeOf((*ArrayOfVirtualMachineConfigInfoDatastoreUrlPair)(nil)).Elem() +} + +type ArrayOfVirtualMachineConfigOptionDescriptor struct { + VirtualMachineConfigOptionDescriptor []VirtualMachineConfigOptionDescriptor `xml:"VirtualMachineConfigOptionDescriptor,omitempty"` +} + +func init() { + t["ArrayOfVirtualMachineConfigOptionDescriptor"] = reflect.TypeOf((*ArrayOfVirtualMachineConfigOptionDescriptor)(nil)).Elem() +} + +type ArrayOfVirtualMachineCpuIdInfoSpec struct { + VirtualMachineCpuIdInfoSpec []VirtualMachineCpuIdInfoSpec `xml:"VirtualMachineCpuIdInfoSpec,omitempty"` +} + +func init() { + t["ArrayOfVirtualMachineCpuIdInfoSpec"] = reflect.TypeOf((*ArrayOfVirtualMachineCpuIdInfoSpec)(nil)).Elem() +} + +type ArrayOfVirtualMachineDatastoreInfo struct { + VirtualMachineDatastoreInfo []VirtualMachineDatastoreInfo `xml:"VirtualMachineDatastoreInfo,omitempty"` +} + +func init() { + t["ArrayOfVirtualMachineDatastoreInfo"] = reflect.TypeOf((*ArrayOfVirtualMachineDatastoreInfo)(nil)).Elem() +} + +type ArrayOfVirtualMachineDatastoreVolumeOption struct { + VirtualMachineDatastoreVolumeOption []VirtualMachineDatastoreVolumeOption `xml:"VirtualMachineDatastoreVolumeOption,omitempty"` +} + +func init() { + t["ArrayOfVirtualMachineDatastoreVolumeOption"] = reflect.TypeOf((*ArrayOfVirtualMachineDatastoreVolumeOption)(nil)).Elem() +} + +type ArrayOfVirtualMachineDeviceRuntimeInfo struct { + VirtualMachineDeviceRuntimeInfo []VirtualMachineDeviceRuntimeInfo `xml:"VirtualMachineDeviceRuntimeInfo,omitempty"` +} + +func init() { + t["ArrayOfVirtualMachineDeviceRuntimeInfo"] = reflect.TypeOf((*ArrayOfVirtualMachineDeviceRuntimeInfo)(nil)).Elem() +} + +type ArrayOfVirtualMachineDisplayTopology struct { + VirtualMachineDisplayTopology []VirtualMachineDisplayTopology `xml:"VirtualMachineDisplayTopology,omitempty"` +} + +func init() { + t["ArrayOfVirtualMachineDisplayTopology"] = reflect.TypeOf((*ArrayOfVirtualMachineDisplayTopology)(nil)).Elem() +} + +type ArrayOfVirtualMachineFeatureRequirement struct { + VirtualMachineFeatureRequirement []VirtualMachineFeatureRequirement `xml:"VirtualMachineFeatureRequirement,omitempty"` +} + +func init() { + t["ArrayOfVirtualMachineFeatureRequirement"] = reflect.TypeOf((*ArrayOfVirtualMachineFeatureRequirement)(nil)).Elem() +} + +type ArrayOfVirtualMachineFileLayoutDiskLayout struct { + VirtualMachineFileLayoutDiskLayout []VirtualMachineFileLayoutDiskLayout `xml:"VirtualMachineFileLayoutDiskLayout,omitempty"` +} + +func init() { + t["ArrayOfVirtualMachineFileLayoutDiskLayout"] = reflect.TypeOf((*ArrayOfVirtualMachineFileLayoutDiskLayout)(nil)).Elem() +} + +type ArrayOfVirtualMachineFileLayoutExDiskLayout struct { + VirtualMachineFileLayoutExDiskLayout []VirtualMachineFileLayoutExDiskLayout `xml:"VirtualMachineFileLayoutExDiskLayout,omitempty"` +} + +func init() { + t["ArrayOfVirtualMachineFileLayoutExDiskLayout"] = reflect.TypeOf((*ArrayOfVirtualMachineFileLayoutExDiskLayout)(nil)).Elem() +} + +type ArrayOfVirtualMachineFileLayoutExDiskUnit struct { + VirtualMachineFileLayoutExDiskUnit []VirtualMachineFileLayoutExDiskUnit `xml:"VirtualMachineFileLayoutExDiskUnit,omitempty"` +} + +func init() { + t["ArrayOfVirtualMachineFileLayoutExDiskUnit"] = reflect.TypeOf((*ArrayOfVirtualMachineFileLayoutExDiskUnit)(nil)).Elem() +} + +type ArrayOfVirtualMachineFileLayoutExFileInfo struct { + VirtualMachineFileLayoutExFileInfo []VirtualMachineFileLayoutExFileInfo `xml:"VirtualMachineFileLayoutExFileInfo,omitempty"` +} + +func init() { + t["ArrayOfVirtualMachineFileLayoutExFileInfo"] = reflect.TypeOf((*ArrayOfVirtualMachineFileLayoutExFileInfo)(nil)).Elem() +} + +type ArrayOfVirtualMachineFileLayoutExSnapshotLayout struct { + VirtualMachineFileLayoutExSnapshotLayout []VirtualMachineFileLayoutExSnapshotLayout `xml:"VirtualMachineFileLayoutExSnapshotLayout,omitempty"` +} + +func init() { + t["ArrayOfVirtualMachineFileLayoutExSnapshotLayout"] = reflect.TypeOf((*ArrayOfVirtualMachineFileLayoutExSnapshotLayout)(nil)).Elem() +} + +type ArrayOfVirtualMachineFileLayoutSnapshotLayout struct { + VirtualMachineFileLayoutSnapshotLayout []VirtualMachineFileLayoutSnapshotLayout `xml:"VirtualMachineFileLayoutSnapshotLayout,omitempty"` +} + +func init() { + t["ArrayOfVirtualMachineFileLayoutSnapshotLayout"] = reflect.TypeOf((*ArrayOfVirtualMachineFileLayoutSnapshotLayout)(nil)).Elem() +} + +type ArrayOfVirtualMachineFloppyInfo struct { + VirtualMachineFloppyInfo []VirtualMachineFloppyInfo `xml:"VirtualMachineFloppyInfo,omitempty"` +} + +func init() { + t["ArrayOfVirtualMachineFloppyInfo"] = reflect.TypeOf((*ArrayOfVirtualMachineFloppyInfo)(nil)).Elem() +} + +type ArrayOfVirtualMachineIdeDiskDeviceInfo struct { + VirtualMachineIdeDiskDeviceInfo []VirtualMachineIdeDiskDeviceInfo `xml:"VirtualMachineIdeDiskDeviceInfo,omitempty"` +} + +func init() { + t["ArrayOfVirtualMachineIdeDiskDeviceInfo"] = reflect.TypeOf((*ArrayOfVirtualMachineIdeDiskDeviceInfo)(nil)).Elem() +} + +type ArrayOfVirtualMachineIdeDiskDevicePartitionInfo struct { + VirtualMachineIdeDiskDevicePartitionInfo []VirtualMachineIdeDiskDevicePartitionInfo `xml:"VirtualMachineIdeDiskDevicePartitionInfo,omitempty"` +} + +func init() { + t["ArrayOfVirtualMachineIdeDiskDevicePartitionInfo"] = reflect.TypeOf((*ArrayOfVirtualMachineIdeDiskDevicePartitionInfo)(nil)).Elem() +} + +type ArrayOfVirtualMachineLegacyNetworkSwitchInfo struct { + VirtualMachineLegacyNetworkSwitchInfo []VirtualMachineLegacyNetworkSwitchInfo `xml:"VirtualMachineLegacyNetworkSwitchInfo,omitempty"` +} + +func init() { + t["ArrayOfVirtualMachineLegacyNetworkSwitchInfo"] = reflect.TypeOf((*ArrayOfVirtualMachineLegacyNetworkSwitchInfo)(nil)).Elem() +} + +type ArrayOfVirtualMachineMessage struct { + VirtualMachineMessage []VirtualMachineMessage `xml:"VirtualMachineMessage,omitempty"` +} + +func init() { + t["ArrayOfVirtualMachineMessage"] = reflect.TypeOf((*ArrayOfVirtualMachineMessage)(nil)).Elem() +} + +type ArrayOfVirtualMachineMetadataManagerVmMetadataInput struct { + VirtualMachineMetadataManagerVmMetadataInput []VirtualMachineMetadataManagerVmMetadataInput `xml:"VirtualMachineMetadataManagerVmMetadataInput,omitempty"` +} + +func init() { + t["ArrayOfVirtualMachineMetadataManagerVmMetadataInput"] = reflect.TypeOf((*ArrayOfVirtualMachineMetadataManagerVmMetadataInput)(nil)).Elem() +} + +type ArrayOfVirtualMachineMetadataManagerVmMetadataResult struct { + VirtualMachineMetadataManagerVmMetadataResult []VirtualMachineMetadataManagerVmMetadataResult `xml:"VirtualMachineMetadataManagerVmMetadataResult,omitempty"` +} + +func init() { + t["ArrayOfVirtualMachineMetadataManagerVmMetadataResult"] = reflect.TypeOf((*ArrayOfVirtualMachineMetadataManagerVmMetadataResult)(nil)).Elem() +} + +type ArrayOfVirtualMachineNetworkInfo struct { + VirtualMachineNetworkInfo []VirtualMachineNetworkInfo `xml:"VirtualMachineNetworkInfo,omitempty"` +} + +func init() { + t["ArrayOfVirtualMachineNetworkInfo"] = reflect.TypeOf((*ArrayOfVirtualMachineNetworkInfo)(nil)).Elem() +} + +type ArrayOfVirtualMachineParallelInfo struct { + VirtualMachineParallelInfo []VirtualMachineParallelInfo `xml:"VirtualMachineParallelInfo,omitempty"` +} + +func init() { + t["ArrayOfVirtualMachineParallelInfo"] = reflect.TypeOf((*ArrayOfVirtualMachineParallelInfo)(nil)).Elem() +} + +type ArrayOfVirtualMachinePciPassthroughInfo struct { + VirtualMachinePciPassthroughInfo []BaseVirtualMachinePciPassthroughInfo `xml:"VirtualMachinePciPassthroughInfo,omitempty,typeattr"` +} + +func init() { + t["ArrayOfVirtualMachinePciPassthroughInfo"] = reflect.TypeOf((*ArrayOfVirtualMachinePciPassthroughInfo)(nil)).Elem() +} + +type ArrayOfVirtualMachinePciSharedGpuPassthroughInfo struct { + VirtualMachinePciSharedGpuPassthroughInfo []VirtualMachinePciSharedGpuPassthroughInfo `xml:"VirtualMachinePciSharedGpuPassthroughInfo,omitempty"` +} + +func init() { + t["ArrayOfVirtualMachinePciSharedGpuPassthroughInfo"] = reflect.TypeOf((*ArrayOfVirtualMachinePciSharedGpuPassthroughInfo)(nil)).Elem() +} + +type ArrayOfVirtualMachineProfileSpec struct { + VirtualMachineProfileSpec []BaseVirtualMachineProfileSpec `xml:"VirtualMachineProfileSpec,omitempty,typeattr"` +} + +func init() { + t["ArrayOfVirtualMachineProfileSpec"] = reflect.TypeOf((*ArrayOfVirtualMachineProfileSpec)(nil)).Elem() +} + +type ArrayOfVirtualMachineRelocateSpecDiskLocator struct { + VirtualMachineRelocateSpecDiskLocator []VirtualMachineRelocateSpecDiskLocator `xml:"VirtualMachineRelocateSpecDiskLocator,omitempty"` +} + +func init() { + t["ArrayOfVirtualMachineRelocateSpecDiskLocator"] = reflect.TypeOf((*ArrayOfVirtualMachineRelocateSpecDiskLocator)(nil)).Elem() +} + +type ArrayOfVirtualMachineScsiDiskDeviceInfo struct { + VirtualMachineScsiDiskDeviceInfo []VirtualMachineScsiDiskDeviceInfo `xml:"VirtualMachineScsiDiskDeviceInfo,omitempty"` +} + +func init() { + t["ArrayOfVirtualMachineScsiDiskDeviceInfo"] = reflect.TypeOf((*ArrayOfVirtualMachineScsiDiskDeviceInfo)(nil)).Elem() +} + +type ArrayOfVirtualMachineScsiPassthroughInfo struct { + VirtualMachineScsiPassthroughInfo []VirtualMachineScsiPassthroughInfo `xml:"VirtualMachineScsiPassthroughInfo,omitempty"` +} + +func init() { + t["ArrayOfVirtualMachineScsiPassthroughInfo"] = reflect.TypeOf((*ArrayOfVirtualMachineScsiPassthroughInfo)(nil)).Elem() +} + +type ArrayOfVirtualMachineSerialInfo struct { + VirtualMachineSerialInfo []VirtualMachineSerialInfo `xml:"VirtualMachineSerialInfo,omitempty"` +} + +func init() { + t["ArrayOfVirtualMachineSerialInfo"] = reflect.TypeOf((*ArrayOfVirtualMachineSerialInfo)(nil)).Elem() +} + +type ArrayOfVirtualMachineSnapshotTree struct { + VirtualMachineSnapshotTree []VirtualMachineSnapshotTree `xml:"VirtualMachineSnapshotTree,omitempty"` +} + +func init() { + t["ArrayOfVirtualMachineSnapshotTree"] = reflect.TypeOf((*ArrayOfVirtualMachineSnapshotTree)(nil)).Elem() +} + +type ArrayOfVirtualMachineSoundInfo struct { + VirtualMachineSoundInfo []VirtualMachineSoundInfo `xml:"VirtualMachineSoundInfo,omitempty"` +} + +func init() { + t["ArrayOfVirtualMachineSoundInfo"] = reflect.TypeOf((*ArrayOfVirtualMachineSoundInfo)(nil)).Elem() +} + +type ArrayOfVirtualMachineSriovInfo struct { + VirtualMachineSriovInfo []VirtualMachineSriovInfo `xml:"VirtualMachineSriovInfo,omitempty"` +} + +func init() { + t["ArrayOfVirtualMachineSriovInfo"] = reflect.TypeOf((*ArrayOfVirtualMachineSriovInfo)(nil)).Elem() +} + +type ArrayOfVirtualMachineSummary struct { + VirtualMachineSummary []VirtualMachineSummary `xml:"VirtualMachineSummary,omitempty"` +} + +func init() { + t["ArrayOfVirtualMachineSummary"] = reflect.TypeOf((*ArrayOfVirtualMachineSummary)(nil)).Elem() +} + +type ArrayOfVirtualMachineUsageOnDatastore struct { + VirtualMachineUsageOnDatastore []VirtualMachineUsageOnDatastore `xml:"VirtualMachineUsageOnDatastore,omitempty"` +} + +func init() { + t["ArrayOfVirtualMachineUsageOnDatastore"] = reflect.TypeOf((*ArrayOfVirtualMachineUsageOnDatastore)(nil)).Elem() +} + +type ArrayOfVirtualMachineUsbInfo struct { + VirtualMachineUsbInfo []VirtualMachineUsbInfo `xml:"VirtualMachineUsbInfo,omitempty"` +} + +func init() { + t["ArrayOfVirtualMachineUsbInfo"] = reflect.TypeOf((*ArrayOfVirtualMachineUsbInfo)(nil)).Elem() +} + +type ArrayOfVirtualMachineVFlashModuleInfo struct { + VirtualMachineVFlashModuleInfo []VirtualMachineVFlashModuleInfo `xml:"VirtualMachineVFlashModuleInfo,omitempty"` +} + +func init() { + t["ArrayOfVirtualMachineVFlashModuleInfo"] = reflect.TypeOf((*ArrayOfVirtualMachineVFlashModuleInfo)(nil)).Elem() +} + +type ArrayOfVirtualMachineVMCIDeviceFilterSpec struct { + VirtualMachineVMCIDeviceFilterSpec []VirtualMachineVMCIDeviceFilterSpec `xml:"VirtualMachineVMCIDeviceFilterSpec,omitempty"` +} + +func init() { + t["ArrayOfVirtualMachineVMCIDeviceFilterSpec"] = reflect.TypeOf((*ArrayOfVirtualMachineVMCIDeviceFilterSpec)(nil)).Elem() +} + +type ArrayOfVirtualNicManagerNetConfig struct { + VirtualNicManagerNetConfig []VirtualNicManagerNetConfig `xml:"VirtualNicManagerNetConfig,omitempty"` +} + +func init() { + t["ArrayOfVirtualNicManagerNetConfig"] = reflect.TypeOf((*ArrayOfVirtualNicManagerNetConfig)(nil)).Elem() +} + +type ArrayOfVirtualSCSISharing struct { + VirtualSCSISharing []VirtualSCSISharing `xml:"VirtualSCSISharing,omitempty"` +} + +func init() { + t["ArrayOfVirtualSCSISharing"] = reflect.TypeOf((*ArrayOfVirtualSCSISharing)(nil)).Elem() +} + +type ArrayOfVirtualSwitchProfile struct { + VirtualSwitchProfile []VirtualSwitchProfile `xml:"VirtualSwitchProfile,omitempty"` +} + +func init() { + t["ArrayOfVirtualSwitchProfile"] = reflect.TypeOf((*ArrayOfVirtualSwitchProfile)(nil)).Elem() +} + +type ArrayOfVmEventArgument struct { + VmEventArgument []VmEventArgument `xml:"VmEventArgument,omitempty"` +} + +func init() { + t["ArrayOfVmEventArgument"] = reflect.TypeOf((*ArrayOfVmEventArgument)(nil)).Elem() +} + +type ArrayOfVmPodConfigForPlacement struct { + VmPodConfigForPlacement []VmPodConfigForPlacement `xml:"VmPodConfigForPlacement,omitempty"` +} + +func init() { + t["ArrayOfVmPodConfigForPlacement"] = reflect.TypeOf((*ArrayOfVmPodConfigForPlacement)(nil)).Elem() +} + +type ArrayOfVmPortGroupProfile struct { + VmPortGroupProfile []VmPortGroupProfile `xml:"VmPortGroupProfile,omitempty"` +} + +func init() { + t["ArrayOfVmPortGroupProfile"] = reflect.TypeOf((*ArrayOfVmPortGroupProfile)(nil)).Elem() +} + +type ArrayOfVmfsDatastoreOption struct { + VmfsDatastoreOption []VmfsDatastoreOption `xml:"VmfsDatastoreOption,omitempty"` +} + +func init() { + t["ArrayOfVmfsDatastoreOption"] = reflect.TypeOf((*ArrayOfVmfsDatastoreOption)(nil)).Elem() +} + +type ArrayOfVnicPortArgument struct { + VnicPortArgument []VnicPortArgument `xml:"VnicPortArgument,omitempty"` +} + +func init() { + t["ArrayOfVnicPortArgument"] = reflect.TypeOf((*ArrayOfVnicPortArgument)(nil)).Elem() +} + +type ArrayOfVsanHostConfigInfo struct { + VsanHostConfigInfo []VsanHostConfigInfo `xml:"VsanHostConfigInfo,omitempty"` +} + +func init() { + t["ArrayOfVsanHostConfigInfo"] = reflect.TypeOf((*ArrayOfVsanHostConfigInfo)(nil)).Elem() +} + +type ArrayOfVsanHostConfigInfoNetworkInfoPortConfig struct { + VsanHostConfigInfoNetworkInfoPortConfig []VsanHostConfigInfoNetworkInfoPortConfig `xml:"VsanHostConfigInfoNetworkInfoPortConfig,omitempty"` +} + +func init() { + t["ArrayOfVsanHostConfigInfoNetworkInfoPortConfig"] = reflect.TypeOf((*ArrayOfVsanHostConfigInfoNetworkInfoPortConfig)(nil)).Elem() +} + +type ArrayOfVsanHostDiskMapInfo struct { + VsanHostDiskMapInfo []VsanHostDiskMapInfo `xml:"VsanHostDiskMapInfo,omitempty"` +} + +func init() { + t["ArrayOfVsanHostDiskMapInfo"] = reflect.TypeOf((*ArrayOfVsanHostDiskMapInfo)(nil)).Elem() +} + +type ArrayOfVsanHostDiskMapResult struct { + VsanHostDiskMapResult []VsanHostDiskMapResult `xml:"VsanHostDiskMapResult,omitempty"` +} + +func init() { + t["ArrayOfVsanHostDiskMapResult"] = reflect.TypeOf((*ArrayOfVsanHostDiskMapResult)(nil)).Elem() +} + +type ArrayOfVsanHostDiskMapping struct { + VsanHostDiskMapping []VsanHostDiskMapping `xml:"VsanHostDiskMapping,omitempty"` +} + +func init() { + t["ArrayOfVsanHostDiskMapping"] = reflect.TypeOf((*ArrayOfVsanHostDiskMapping)(nil)).Elem() +} + +type ArrayOfVsanHostDiskResult struct { + VsanHostDiskResult []VsanHostDiskResult `xml:"VsanHostDiskResult,omitempty"` +} + +func init() { + t["ArrayOfVsanHostDiskResult"] = reflect.TypeOf((*ArrayOfVsanHostDiskResult)(nil)).Elem() +} + +type ArrayOfVsanHostMembershipInfo struct { + VsanHostMembershipInfo []VsanHostMembershipInfo `xml:"VsanHostMembershipInfo,omitempty"` +} + +func init() { + t["ArrayOfVsanHostMembershipInfo"] = reflect.TypeOf((*ArrayOfVsanHostMembershipInfo)(nil)).Elem() +} + +type ArrayOfVsanHostRuntimeInfoDiskIssue struct { + VsanHostRuntimeInfoDiskIssue []VsanHostRuntimeInfoDiskIssue `xml:"VsanHostRuntimeInfoDiskIssue,omitempty"` +} + +func init() { + t["ArrayOfVsanHostRuntimeInfoDiskIssue"] = reflect.TypeOf((*ArrayOfVsanHostRuntimeInfoDiskIssue)(nil)).Elem() +} + +type ArrayOfVsanNewPolicyBatch struct { + VsanNewPolicyBatch []VsanNewPolicyBatch `xml:"VsanNewPolicyBatch,omitempty"` +} + +func init() { + t["ArrayOfVsanNewPolicyBatch"] = reflect.TypeOf((*ArrayOfVsanNewPolicyBatch)(nil)).Elem() +} + +type ArrayOfVsanPolicyChangeBatch struct { + VsanPolicyChangeBatch []VsanPolicyChangeBatch `xml:"VsanPolicyChangeBatch,omitempty"` +} + +func init() { + t["ArrayOfVsanPolicyChangeBatch"] = reflect.TypeOf((*ArrayOfVsanPolicyChangeBatch)(nil)).Elem() +} + +type ArrayOfVsanPolicySatisfiability struct { + VsanPolicySatisfiability []VsanPolicySatisfiability `xml:"VsanPolicySatisfiability,omitempty"` +} + +func init() { + t["ArrayOfVsanPolicySatisfiability"] = reflect.TypeOf((*ArrayOfVsanPolicySatisfiability)(nil)).Elem() +} + +type ArrayOfVsanUpgradeSystemNetworkPartitionInfo struct { + VsanUpgradeSystemNetworkPartitionInfo []VsanUpgradeSystemNetworkPartitionInfo `xml:"VsanUpgradeSystemNetworkPartitionInfo,omitempty"` +} + +func init() { + t["ArrayOfVsanUpgradeSystemNetworkPartitionInfo"] = reflect.TypeOf((*ArrayOfVsanUpgradeSystemNetworkPartitionInfo)(nil)).Elem() +} + +type ArrayOfVsanUpgradeSystemPreflightCheckIssue struct { + VsanUpgradeSystemPreflightCheckIssue []BaseVsanUpgradeSystemPreflightCheckIssue `xml:"VsanUpgradeSystemPreflightCheckIssue,omitempty,typeattr"` +} + +func init() { + t["ArrayOfVsanUpgradeSystemPreflightCheckIssue"] = reflect.TypeOf((*ArrayOfVsanUpgradeSystemPreflightCheckIssue)(nil)).Elem() +} + +type ArrayOfVsanUpgradeSystemUpgradeHistoryItem struct { + VsanUpgradeSystemUpgradeHistoryItem []BaseVsanUpgradeSystemUpgradeHistoryItem `xml:"VsanUpgradeSystemUpgradeHistoryItem,omitempty,typeattr"` +} + +func init() { + t["ArrayOfVsanUpgradeSystemUpgradeHistoryItem"] = reflect.TypeOf((*ArrayOfVsanUpgradeSystemUpgradeHistoryItem)(nil)).Elem() +} + +type ArrayUpdateSpec struct { + DynamicData + + Operation ArrayUpdateOperation `xml:"operation"` + RemoveKey AnyType `xml:"removeKey,omitempty,typeattr"` +} + +func init() { + t["ArrayUpdateSpec"] = reflect.TypeOf((*ArrayUpdateSpec)(nil)).Elem() +} + +type AssignUserToGroup AssignUserToGroupRequestType + +func init() { + t["AssignUserToGroup"] = reflect.TypeOf((*AssignUserToGroup)(nil)).Elem() +} + +type AssignUserToGroupRequestType struct { + This ManagedObjectReference `xml:"_this"` + User string `xml:"user"` + Group string `xml:"group"` +} + +func init() { + t["AssignUserToGroupRequestType"] = reflect.TypeOf((*AssignUserToGroupRequestType)(nil)).Elem() +} + +type AssignUserToGroupResponse struct { +} + +type AssociateProfile AssociateProfileRequestType + +func init() { + t["AssociateProfile"] = reflect.TypeOf((*AssociateProfile)(nil)).Elem() +} + +type AssociateProfileRequestType struct { + This ManagedObjectReference `xml:"_this"` + Entity []ManagedObjectReference `xml:"entity"` +} + +func init() { + t["AssociateProfileRequestType"] = reflect.TypeOf((*AssociateProfileRequestType)(nil)).Elem() +} + +type AssociateProfileResponse struct { +} + +type AttachScsiLun AttachScsiLunRequestType + +func init() { + t["AttachScsiLun"] = reflect.TypeOf((*AttachScsiLun)(nil)).Elem() +} + +type AttachScsiLunExRequestType struct { + This ManagedObjectReference `xml:"_this"` + LunUuid []string `xml:"lunUuid"` +} + +func init() { + t["AttachScsiLunExRequestType"] = reflect.TypeOf((*AttachScsiLunExRequestType)(nil)).Elem() +} + +type AttachScsiLunEx_Task AttachScsiLunExRequestType + +func init() { + t["AttachScsiLunEx_Task"] = reflect.TypeOf((*AttachScsiLunEx_Task)(nil)).Elem() +} + +type AttachScsiLunEx_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type AttachScsiLunRequestType struct { + This ManagedObjectReference `xml:"_this"` + LunUuid string `xml:"lunUuid"` +} + +func init() { + t["AttachScsiLunRequestType"] = reflect.TypeOf((*AttachScsiLunRequestType)(nil)).Elem() +} + +type AttachScsiLunResponse struct { +} + +type AttachVmfsExtent AttachVmfsExtentRequestType + +func init() { + t["AttachVmfsExtent"] = reflect.TypeOf((*AttachVmfsExtent)(nil)).Elem() +} + +type AttachVmfsExtentRequestType struct { + This ManagedObjectReference `xml:"_this"` + VmfsPath string `xml:"vmfsPath"` + Extent HostScsiDiskPartition `xml:"extent"` +} + +func init() { + t["AttachVmfsExtentRequestType"] = reflect.TypeOf((*AttachVmfsExtentRequestType)(nil)).Elem() +} + +type AttachVmfsExtentResponse struct { +} + +type AuthMinimumAdminPermission struct { + VimFault +} + +func init() { + t["AuthMinimumAdminPermission"] = reflect.TypeOf((*AuthMinimumAdminPermission)(nil)).Elem() +} + +type AuthMinimumAdminPermissionFault AuthMinimumAdminPermission + +func init() { + t["AuthMinimumAdminPermissionFault"] = reflect.TypeOf((*AuthMinimumAdminPermissionFault)(nil)).Elem() +} + +type AuthenticationProfile struct { + ApplyProfile + + ActiveDirectory *ActiveDirectoryProfile `xml:"activeDirectory,omitempty"` +} + +func init() { + t["AuthenticationProfile"] = reflect.TypeOf((*AuthenticationProfile)(nil)).Elem() +} + +type AuthorizationDescription struct { + DynamicData + + Privilege []BaseElementDescription `xml:"privilege,typeattr"` + PrivilegeGroup []BaseElementDescription `xml:"privilegeGroup,typeattr"` +} + +func init() { + t["AuthorizationDescription"] = reflect.TypeOf((*AuthorizationDescription)(nil)).Elem() +} + +type AuthorizationEvent struct { + Event +} + +func init() { + t["AuthorizationEvent"] = reflect.TypeOf((*AuthorizationEvent)(nil)).Elem() +} + +type AuthorizationPrivilege struct { + DynamicData + + PrivId string `xml:"privId"` + OnParent bool `xml:"onParent"` + Name string `xml:"name"` + PrivGroupName string `xml:"privGroupName"` +} + +func init() { + t["AuthorizationPrivilege"] = reflect.TypeOf((*AuthorizationPrivilege)(nil)).Elem() +} + +type AuthorizationRole struct { + DynamicData + + RoleId int32 `xml:"roleId"` + System bool `xml:"system"` + Name string `xml:"name"` + Info BaseDescription `xml:"info,typeattr"` + Privilege []string `xml:"privilege,omitempty"` +} + +func init() { + t["AuthorizationRole"] = reflect.TypeOf((*AuthorizationRole)(nil)).Elem() +} + +type AutoStartDefaults struct { + DynamicData + + Enabled *bool `xml:"enabled"` + StartDelay int32 `xml:"startDelay,omitempty"` + StopDelay int32 `xml:"stopDelay,omitempty"` + WaitForHeartbeat *bool `xml:"waitForHeartbeat"` + StopAction string `xml:"stopAction,omitempty"` +} + +func init() { + t["AutoStartDefaults"] = reflect.TypeOf((*AutoStartDefaults)(nil)).Elem() +} + +type AutoStartPowerInfo struct { + DynamicData + + Key ManagedObjectReference `xml:"key"` + StartOrder int32 `xml:"startOrder"` + StartDelay int32 `xml:"startDelay"` + WaitForHeartbeat AutoStartWaitHeartbeatSetting `xml:"waitForHeartbeat"` + StartAction string `xml:"startAction"` + StopDelay int32 `xml:"stopDelay"` + StopAction string `xml:"stopAction"` +} + +func init() { + t["AutoStartPowerInfo"] = reflect.TypeOf((*AutoStartPowerInfo)(nil)).Elem() +} + +type AutoStartPowerOff AutoStartPowerOffRequestType + +func init() { + t["AutoStartPowerOff"] = reflect.TypeOf((*AutoStartPowerOff)(nil)).Elem() +} + +type AutoStartPowerOffRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["AutoStartPowerOffRequestType"] = reflect.TypeOf((*AutoStartPowerOffRequestType)(nil)).Elem() +} + +type AutoStartPowerOffResponse struct { +} + +type AutoStartPowerOn AutoStartPowerOnRequestType + +func init() { + t["AutoStartPowerOn"] = reflect.TypeOf((*AutoStartPowerOn)(nil)).Elem() +} + +type AutoStartPowerOnRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["AutoStartPowerOnRequestType"] = reflect.TypeOf((*AutoStartPowerOnRequestType)(nil)).Elem() +} + +type AutoStartPowerOnResponse struct { +} + +type BackupBlobReadFailure struct { + DvsFault + + EntityName string `xml:"entityName"` + EntityType string `xml:"entityType"` + Fault LocalizedMethodFault `xml:"fault"` +} + +func init() { + t["BackupBlobReadFailure"] = reflect.TypeOf((*BackupBlobReadFailure)(nil)).Elem() +} + +type BackupBlobReadFailureFault BackupBlobReadFailure + +func init() { + t["BackupBlobReadFailureFault"] = reflect.TypeOf((*BackupBlobReadFailureFault)(nil)).Elem() +} + +type BackupBlobWriteFailure struct { + DvsFault + + EntityName string `xml:"entityName"` + EntityType string `xml:"entityType"` + Fault LocalizedMethodFault `xml:"fault"` +} + +func init() { + t["BackupBlobWriteFailure"] = reflect.TypeOf((*BackupBlobWriteFailure)(nil)).Elem() +} + +type BackupBlobWriteFailureFault BackupBlobWriteFailure + +func init() { + t["BackupBlobWriteFailureFault"] = reflect.TypeOf((*BackupBlobWriteFailureFault)(nil)).Elem() +} + +type BackupFirmwareConfiguration BackupFirmwareConfigurationRequestType + +func init() { + t["BackupFirmwareConfiguration"] = reflect.TypeOf((*BackupFirmwareConfiguration)(nil)).Elem() +} + +type BackupFirmwareConfigurationRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["BackupFirmwareConfigurationRequestType"] = reflect.TypeOf((*BackupFirmwareConfigurationRequestType)(nil)).Elem() +} + +type BackupFirmwareConfigurationResponse struct { + Returnval string `xml:"returnval"` +} + +type BadUsernameSessionEvent struct { + SessionEvent + + IpAddress string `xml:"ipAddress"` +} + +func init() { + t["BadUsernameSessionEvent"] = reflect.TypeOf((*BadUsernameSessionEvent)(nil)).Elem() +} + +type BatchResult struct { + DynamicData + + Result string `xml:"result"` + HostKey string `xml:"hostKey"` + Ds *ManagedObjectReference `xml:"ds,omitempty"` + Fault *LocalizedMethodFault `xml:"fault,omitempty"` +} + +func init() { + t["BatchResult"] = reflect.TypeOf((*BatchResult)(nil)).Elem() +} + +type BindVnic BindVnicRequestType + +func init() { + t["BindVnic"] = reflect.TypeOf((*BindVnic)(nil)).Elem() +} + +type BindVnicRequestType struct { + This ManagedObjectReference `xml:"_this"` + IScsiHbaName string `xml:"iScsiHbaName"` + VnicDevice string `xml:"vnicDevice"` +} + +func init() { + t["BindVnicRequestType"] = reflect.TypeOf((*BindVnicRequestType)(nil)).Elem() +} + +type BindVnicResponse struct { +} + +type BlockedByFirewall struct { + HostConfigFault +} + +func init() { + t["BlockedByFirewall"] = reflect.TypeOf((*BlockedByFirewall)(nil)).Elem() +} + +type BlockedByFirewallFault BlockedByFirewall + +func init() { + t["BlockedByFirewallFault"] = reflect.TypeOf((*BlockedByFirewallFault)(nil)).Elem() +} + +type BoolOption struct { + OptionType + + Supported bool `xml:"supported"` + DefaultValue bool `xml:"defaultValue"` +} + +func init() { + t["BoolOption"] = reflect.TypeOf((*BoolOption)(nil)).Elem() +} + +type BoolPolicy struct { + InheritablePolicy + + Value *bool `xml:"value"` +} + +func init() { + t["BoolPolicy"] = reflect.TypeOf((*BoolPolicy)(nil)).Elem() +} + +type BrowseDiagnosticLog BrowseDiagnosticLogRequestType + +func init() { + t["BrowseDiagnosticLog"] = reflect.TypeOf((*BrowseDiagnosticLog)(nil)).Elem() +} + +type BrowseDiagnosticLogRequestType struct { + This ManagedObjectReference `xml:"_this"` + Host *ManagedObjectReference `xml:"host,omitempty"` + Key string `xml:"key"` + Start int32 `xml:"start,omitempty"` + Lines int32 `xml:"lines,omitempty"` +} + +func init() { + t["BrowseDiagnosticLogRequestType"] = reflect.TypeOf((*BrowseDiagnosticLogRequestType)(nil)).Elem() +} + +type BrowseDiagnosticLogResponse struct { + Returnval DiagnosticManagerLogHeader `xml:"returnval"` +} + +type CAMServerRefusedConnection struct { + InvalidCAMServer +} + +func init() { + t["CAMServerRefusedConnection"] = reflect.TypeOf((*CAMServerRefusedConnection)(nil)).Elem() +} + +type CAMServerRefusedConnectionFault CAMServerRefusedConnection + +func init() { + t["CAMServerRefusedConnectionFault"] = reflect.TypeOf((*CAMServerRefusedConnectionFault)(nil)).Elem() +} + +type CanProvisionObjects CanProvisionObjectsRequestType + +func init() { + t["CanProvisionObjects"] = reflect.TypeOf((*CanProvisionObjects)(nil)).Elem() +} + +type CanProvisionObjectsRequestType struct { + This ManagedObjectReference `xml:"_this"` + Npbs []VsanNewPolicyBatch `xml:"npbs"` + IgnoreSatisfiability *bool `xml:"ignoreSatisfiability"` +} + +func init() { + t["CanProvisionObjectsRequestType"] = reflect.TypeOf((*CanProvisionObjectsRequestType)(nil)).Elem() +} + +type CanProvisionObjectsResponse struct { + Returnval []VsanPolicySatisfiability `xml:"returnval"` +} + +type CancelRecommendation CancelRecommendationRequestType + +func init() { + t["CancelRecommendation"] = reflect.TypeOf((*CancelRecommendation)(nil)).Elem() +} + +type CancelRecommendationRequestType struct { + This ManagedObjectReference `xml:"_this"` + Key string `xml:"key"` +} + +func init() { + t["CancelRecommendationRequestType"] = reflect.TypeOf((*CancelRecommendationRequestType)(nil)).Elem() +} + +type CancelRecommendationResponse struct { +} + +type CancelRetrievePropertiesEx CancelRetrievePropertiesExRequestType + +func init() { + t["CancelRetrievePropertiesEx"] = reflect.TypeOf((*CancelRetrievePropertiesEx)(nil)).Elem() +} + +type CancelRetrievePropertiesExRequestType struct { + This ManagedObjectReference `xml:"_this"` + Token string `xml:"token"` +} + +func init() { + t["CancelRetrievePropertiesExRequestType"] = reflect.TypeOf((*CancelRetrievePropertiesExRequestType)(nil)).Elem() +} + +type CancelRetrievePropertiesExResponse struct { +} + +type CancelStorageDrsRecommendation CancelStorageDrsRecommendationRequestType + +func init() { + t["CancelStorageDrsRecommendation"] = reflect.TypeOf((*CancelStorageDrsRecommendation)(nil)).Elem() +} + +type CancelStorageDrsRecommendationRequestType struct { + This ManagedObjectReference `xml:"_this"` + Key []string `xml:"key"` +} + +func init() { + t["CancelStorageDrsRecommendationRequestType"] = reflect.TypeOf((*CancelStorageDrsRecommendationRequestType)(nil)).Elem() +} + +type CancelStorageDrsRecommendationResponse struct { +} + +type CancelTask CancelTaskRequestType + +func init() { + t["CancelTask"] = reflect.TypeOf((*CancelTask)(nil)).Elem() +} + +type CancelTaskRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["CancelTaskRequestType"] = reflect.TypeOf((*CancelTaskRequestType)(nil)).Elem() +} + +type CancelTaskResponse struct { +} + +type CancelWaitForUpdates CancelWaitForUpdatesRequestType + +func init() { + t["CancelWaitForUpdates"] = reflect.TypeOf((*CancelWaitForUpdates)(nil)).Elem() +} + +type CancelWaitForUpdatesRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["CancelWaitForUpdatesRequestType"] = reflect.TypeOf((*CancelWaitForUpdatesRequestType)(nil)).Elem() +} + +type CancelWaitForUpdatesResponse struct { +} + +type CanceledHostOperationEvent struct { + HostEvent +} + +func init() { + t["CanceledHostOperationEvent"] = reflect.TypeOf((*CanceledHostOperationEvent)(nil)).Elem() +} + +type CannotAccessFile struct { + FileFault +} + +func init() { + t["CannotAccessFile"] = reflect.TypeOf((*CannotAccessFile)(nil)).Elem() +} + +type CannotAccessFileFault CannotAccessFile + +func init() { + t["CannotAccessFileFault"] = reflect.TypeOf((*CannotAccessFileFault)(nil)).Elem() +} + +type CannotAccessLocalSource struct { + VimFault +} + +func init() { + t["CannotAccessLocalSource"] = reflect.TypeOf((*CannotAccessLocalSource)(nil)).Elem() +} + +type CannotAccessLocalSourceFault CannotAccessLocalSource + +func init() { + t["CannotAccessLocalSourceFault"] = reflect.TypeOf((*CannotAccessLocalSourceFault)(nil)).Elem() +} + +type CannotAccessNetwork struct { + CannotAccessVmDevice + + Network *ManagedObjectReference `xml:"network,omitempty"` +} + +func init() { + t["CannotAccessNetwork"] = reflect.TypeOf((*CannotAccessNetwork)(nil)).Elem() +} + +type CannotAccessNetworkFault BaseCannotAccessNetwork + +func init() { + t["CannotAccessNetworkFault"] = reflect.TypeOf((*CannotAccessNetworkFault)(nil)).Elem() +} + +type CannotAccessVmComponent struct { + VmConfigFault +} + +func init() { + t["CannotAccessVmComponent"] = reflect.TypeOf((*CannotAccessVmComponent)(nil)).Elem() +} + +type CannotAccessVmComponentFault BaseCannotAccessVmComponent + +func init() { + t["CannotAccessVmComponentFault"] = reflect.TypeOf((*CannotAccessVmComponentFault)(nil)).Elem() +} + +type CannotAccessVmConfig struct { + CannotAccessVmComponent + + Reason LocalizedMethodFault `xml:"reason"` +} + +func init() { + t["CannotAccessVmConfig"] = reflect.TypeOf((*CannotAccessVmConfig)(nil)).Elem() +} + +type CannotAccessVmConfigFault CannotAccessVmConfig + +func init() { + t["CannotAccessVmConfigFault"] = reflect.TypeOf((*CannotAccessVmConfigFault)(nil)).Elem() +} + +type CannotAccessVmDevice struct { + CannotAccessVmComponent + + Device string `xml:"device"` + Backing string `xml:"backing"` + Connected bool `xml:"connected"` +} + +func init() { + t["CannotAccessVmDevice"] = reflect.TypeOf((*CannotAccessVmDevice)(nil)).Elem() +} + +type CannotAccessVmDeviceFault BaseCannotAccessVmDevice + +func init() { + t["CannotAccessVmDeviceFault"] = reflect.TypeOf((*CannotAccessVmDeviceFault)(nil)).Elem() +} + +type CannotAccessVmDisk struct { + CannotAccessVmDevice + + Fault LocalizedMethodFault `xml:"fault"` +} + +func init() { + t["CannotAccessVmDisk"] = reflect.TypeOf((*CannotAccessVmDisk)(nil)).Elem() +} + +type CannotAccessVmDiskFault BaseCannotAccessVmDisk + +func init() { + t["CannotAccessVmDiskFault"] = reflect.TypeOf((*CannotAccessVmDiskFault)(nil)).Elem() +} + +type CannotAddHostWithFTVmAsStandalone struct { + HostConnectFault +} + +func init() { + t["CannotAddHostWithFTVmAsStandalone"] = reflect.TypeOf((*CannotAddHostWithFTVmAsStandalone)(nil)).Elem() +} + +type CannotAddHostWithFTVmAsStandaloneFault CannotAddHostWithFTVmAsStandalone + +func init() { + t["CannotAddHostWithFTVmAsStandaloneFault"] = reflect.TypeOf((*CannotAddHostWithFTVmAsStandaloneFault)(nil)).Elem() +} + +type CannotAddHostWithFTVmToDifferentCluster struct { + HostConnectFault +} + +func init() { + t["CannotAddHostWithFTVmToDifferentCluster"] = reflect.TypeOf((*CannotAddHostWithFTVmToDifferentCluster)(nil)).Elem() +} + +type CannotAddHostWithFTVmToDifferentClusterFault CannotAddHostWithFTVmToDifferentCluster + +func init() { + t["CannotAddHostWithFTVmToDifferentClusterFault"] = reflect.TypeOf((*CannotAddHostWithFTVmToDifferentClusterFault)(nil)).Elem() +} + +type CannotAddHostWithFTVmToNonHACluster struct { + HostConnectFault +} + +func init() { + t["CannotAddHostWithFTVmToNonHACluster"] = reflect.TypeOf((*CannotAddHostWithFTVmToNonHACluster)(nil)).Elem() +} + +type CannotAddHostWithFTVmToNonHAClusterFault CannotAddHostWithFTVmToNonHACluster + +func init() { + t["CannotAddHostWithFTVmToNonHAClusterFault"] = reflect.TypeOf((*CannotAddHostWithFTVmToNonHAClusterFault)(nil)).Elem() +} + +type CannotChangeDrsBehaviorForFtSecondary struct { + VmFaultToleranceIssue + + Vm ManagedObjectReference `xml:"vm"` + VmName string `xml:"vmName"` +} + +func init() { + t["CannotChangeDrsBehaviorForFtSecondary"] = reflect.TypeOf((*CannotChangeDrsBehaviorForFtSecondary)(nil)).Elem() +} + +type CannotChangeDrsBehaviorForFtSecondaryFault CannotChangeDrsBehaviorForFtSecondary + +func init() { + t["CannotChangeDrsBehaviorForFtSecondaryFault"] = reflect.TypeOf((*CannotChangeDrsBehaviorForFtSecondaryFault)(nil)).Elem() +} + +type CannotChangeHaSettingsForFtSecondary struct { + VmFaultToleranceIssue + + Vm ManagedObjectReference `xml:"vm"` + VmName string `xml:"vmName"` +} + +func init() { + t["CannotChangeHaSettingsForFtSecondary"] = reflect.TypeOf((*CannotChangeHaSettingsForFtSecondary)(nil)).Elem() +} + +type CannotChangeHaSettingsForFtSecondaryFault CannotChangeHaSettingsForFtSecondary + +func init() { + t["CannotChangeHaSettingsForFtSecondaryFault"] = reflect.TypeOf((*CannotChangeHaSettingsForFtSecondaryFault)(nil)).Elem() +} + +type CannotChangeVsanClusterUuid struct { + VsanFault +} + +func init() { + t["CannotChangeVsanClusterUuid"] = reflect.TypeOf((*CannotChangeVsanClusterUuid)(nil)).Elem() +} + +type CannotChangeVsanClusterUuidFault CannotChangeVsanClusterUuid + +func init() { + t["CannotChangeVsanClusterUuidFault"] = reflect.TypeOf((*CannotChangeVsanClusterUuidFault)(nil)).Elem() +} + +type CannotChangeVsanNodeUuid struct { + VsanFault +} + +func init() { + t["CannotChangeVsanNodeUuid"] = reflect.TypeOf((*CannotChangeVsanNodeUuid)(nil)).Elem() +} + +type CannotChangeVsanNodeUuidFault CannotChangeVsanNodeUuid + +func init() { + t["CannotChangeVsanNodeUuidFault"] = reflect.TypeOf((*CannotChangeVsanNodeUuidFault)(nil)).Elem() +} + +type CannotComputeFTCompatibleHosts struct { + VmFaultToleranceIssue + + Vm ManagedObjectReference `xml:"vm"` + VmName string `xml:"vmName"` +} + +func init() { + t["CannotComputeFTCompatibleHosts"] = reflect.TypeOf((*CannotComputeFTCompatibleHosts)(nil)).Elem() +} + +type CannotComputeFTCompatibleHostsFault CannotComputeFTCompatibleHosts + +func init() { + t["CannotComputeFTCompatibleHostsFault"] = reflect.TypeOf((*CannotComputeFTCompatibleHostsFault)(nil)).Elem() +} + +type CannotCreateFile struct { + FileFault +} + +func init() { + t["CannotCreateFile"] = reflect.TypeOf((*CannotCreateFile)(nil)).Elem() +} + +type CannotCreateFileFault CannotCreateFile + +func init() { + t["CannotCreateFileFault"] = reflect.TypeOf((*CannotCreateFileFault)(nil)).Elem() +} + +type CannotDecryptPasswords struct { + CustomizationFault +} + +func init() { + t["CannotDecryptPasswords"] = reflect.TypeOf((*CannotDecryptPasswords)(nil)).Elem() +} + +type CannotDecryptPasswordsFault CannotDecryptPasswords + +func init() { + t["CannotDecryptPasswordsFault"] = reflect.TypeOf((*CannotDecryptPasswordsFault)(nil)).Elem() +} + +type CannotDeleteFile struct { + FileFault +} + +func init() { + t["CannotDeleteFile"] = reflect.TypeOf((*CannotDeleteFile)(nil)).Elem() +} + +type CannotDeleteFileFault CannotDeleteFile + +func init() { + t["CannotDeleteFileFault"] = reflect.TypeOf((*CannotDeleteFileFault)(nil)).Elem() +} + +type CannotDisableDrsOnClusterManagedByVDC struct { + RuntimeFault +} + +func init() { + t["CannotDisableDrsOnClusterManagedByVDC"] = reflect.TypeOf((*CannotDisableDrsOnClusterManagedByVDC)(nil)).Elem() +} + +type CannotDisableDrsOnClusterManagedByVDCFault CannotDisableDrsOnClusterManagedByVDC + +func init() { + t["CannotDisableDrsOnClusterManagedByVDCFault"] = reflect.TypeOf((*CannotDisableDrsOnClusterManagedByVDCFault)(nil)).Elem() +} + +type CannotDisableDrsOnClustersWithVApps struct { + RuntimeFault +} + +func init() { + t["CannotDisableDrsOnClustersWithVApps"] = reflect.TypeOf((*CannotDisableDrsOnClustersWithVApps)(nil)).Elem() +} + +type CannotDisableDrsOnClustersWithVAppsFault CannotDisableDrsOnClustersWithVApps + +func init() { + t["CannotDisableDrsOnClustersWithVAppsFault"] = reflect.TypeOf((*CannotDisableDrsOnClustersWithVAppsFault)(nil)).Elem() +} + +type CannotDisableSnapshot struct { + VmConfigFault +} + +func init() { + t["CannotDisableSnapshot"] = reflect.TypeOf((*CannotDisableSnapshot)(nil)).Elem() +} + +type CannotDisableSnapshotFault CannotDisableSnapshot + +func init() { + t["CannotDisableSnapshotFault"] = reflect.TypeOf((*CannotDisableSnapshotFault)(nil)).Elem() +} + +type CannotDisconnectHostWithFaultToleranceVm struct { + VimFault + + HostName string `xml:"hostName"` +} + +func init() { + t["CannotDisconnectHostWithFaultToleranceVm"] = reflect.TypeOf((*CannotDisconnectHostWithFaultToleranceVm)(nil)).Elem() +} + +type CannotDisconnectHostWithFaultToleranceVmFault CannotDisconnectHostWithFaultToleranceVm + +func init() { + t["CannotDisconnectHostWithFaultToleranceVmFault"] = reflect.TypeOf((*CannotDisconnectHostWithFaultToleranceVmFault)(nil)).Elem() +} + +type CannotEnableVmcpForCluster struct { + VimFault + + Host *ManagedObjectReference `xml:"host,omitempty"` + HostName string `xml:"hostName,omitempty"` + Reason string `xml:"reason,omitempty"` +} + +func init() { + t["CannotEnableVmcpForCluster"] = reflect.TypeOf((*CannotEnableVmcpForCluster)(nil)).Elem() +} + +type CannotEnableVmcpForClusterFault CannotEnableVmcpForCluster + +func init() { + t["CannotEnableVmcpForClusterFault"] = reflect.TypeOf((*CannotEnableVmcpForClusterFault)(nil)).Elem() +} + +type CannotModifyConfigCpuRequirements struct { + MigrationFault +} + +func init() { + t["CannotModifyConfigCpuRequirements"] = reflect.TypeOf((*CannotModifyConfigCpuRequirements)(nil)).Elem() +} + +type CannotModifyConfigCpuRequirementsFault CannotModifyConfigCpuRequirements + +func init() { + t["CannotModifyConfigCpuRequirementsFault"] = reflect.TypeOf((*CannotModifyConfigCpuRequirementsFault)(nil)).Elem() +} + +type CannotMoveFaultToleranceVm struct { + VimFault + + MoveType string `xml:"moveType"` + VmName string `xml:"vmName"` +} + +func init() { + t["CannotMoveFaultToleranceVm"] = reflect.TypeOf((*CannotMoveFaultToleranceVm)(nil)).Elem() +} + +type CannotMoveFaultToleranceVmFault CannotMoveFaultToleranceVm + +func init() { + t["CannotMoveFaultToleranceVmFault"] = reflect.TypeOf((*CannotMoveFaultToleranceVmFault)(nil)).Elem() +} + +type CannotMoveHostWithFaultToleranceVm struct { + VimFault +} + +func init() { + t["CannotMoveHostWithFaultToleranceVm"] = reflect.TypeOf((*CannotMoveHostWithFaultToleranceVm)(nil)).Elem() +} + +type CannotMoveHostWithFaultToleranceVmFault CannotMoveHostWithFaultToleranceVm + +func init() { + t["CannotMoveHostWithFaultToleranceVmFault"] = reflect.TypeOf((*CannotMoveHostWithFaultToleranceVmFault)(nil)).Elem() +} + +type CannotMoveVmWithDeltaDisk struct { + MigrationFault + + Device string `xml:"device"` +} + +func init() { + t["CannotMoveVmWithDeltaDisk"] = reflect.TypeOf((*CannotMoveVmWithDeltaDisk)(nil)).Elem() +} + +type CannotMoveVmWithDeltaDiskFault CannotMoveVmWithDeltaDisk + +func init() { + t["CannotMoveVmWithDeltaDiskFault"] = reflect.TypeOf((*CannotMoveVmWithDeltaDiskFault)(nil)).Elem() +} + +type CannotMoveVmWithNativeDeltaDisk struct { + MigrationFault +} + +func init() { + t["CannotMoveVmWithNativeDeltaDisk"] = reflect.TypeOf((*CannotMoveVmWithNativeDeltaDisk)(nil)).Elem() +} + +type CannotMoveVmWithNativeDeltaDiskFault CannotMoveVmWithNativeDeltaDisk + +func init() { + t["CannotMoveVmWithNativeDeltaDiskFault"] = reflect.TypeOf((*CannotMoveVmWithNativeDeltaDiskFault)(nil)).Elem() +} + +type CannotMoveVsanEnabledHost struct { + VsanFault +} + +func init() { + t["CannotMoveVsanEnabledHost"] = reflect.TypeOf((*CannotMoveVsanEnabledHost)(nil)).Elem() +} + +type CannotMoveVsanEnabledHostFault BaseCannotMoveVsanEnabledHost + +func init() { + t["CannotMoveVsanEnabledHostFault"] = reflect.TypeOf((*CannotMoveVsanEnabledHostFault)(nil)).Elem() +} + +type CannotPlaceWithoutPrerequisiteMoves struct { + VimFault +} + +func init() { + t["CannotPlaceWithoutPrerequisiteMoves"] = reflect.TypeOf((*CannotPlaceWithoutPrerequisiteMoves)(nil)).Elem() +} + +type CannotPlaceWithoutPrerequisiteMovesFault CannotPlaceWithoutPrerequisiteMoves + +func init() { + t["CannotPlaceWithoutPrerequisiteMovesFault"] = reflect.TypeOf((*CannotPlaceWithoutPrerequisiteMovesFault)(nil)).Elem() +} + +type CannotPowerOffVmInCluster struct { + InvalidState + + Operation string `xml:"operation"` + Vm ManagedObjectReference `xml:"vm"` + VmName string `xml:"vmName"` +} + +func init() { + t["CannotPowerOffVmInCluster"] = reflect.TypeOf((*CannotPowerOffVmInCluster)(nil)).Elem() +} + +type CannotPowerOffVmInClusterFault CannotPowerOffVmInCluster + +func init() { + t["CannotPowerOffVmInClusterFault"] = reflect.TypeOf((*CannotPowerOffVmInClusterFault)(nil)).Elem() +} + +type CannotReconfigureVsanWhenHaEnabled struct { + VsanFault +} + +func init() { + t["CannotReconfigureVsanWhenHaEnabled"] = reflect.TypeOf((*CannotReconfigureVsanWhenHaEnabled)(nil)).Elem() +} + +type CannotReconfigureVsanWhenHaEnabledFault CannotReconfigureVsanWhenHaEnabled + +func init() { + t["CannotReconfigureVsanWhenHaEnabledFault"] = reflect.TypeOf((*CannotReconfigureVsanWhenHaEnabledFault)(nil)).Elem() +} + +type CannotUseNetwork struct { + VmConfigFault + + Device string `xml:"device"` + Backing string `xml:"backing"` + Connected bool `xml:"connected"` + Reason string `xml:"reason"` + Network *ManagedObjectReference `xml:"network,omitempty"` +} + +func init() { + t["CannotUseNetwork"] = reflect.TypeOf((*CannotUseNetwork)(nil)).Elem() +} + +type CannotUseNetworkFault CannotUseNetwork + +func init() { + t["CannotUseNetworkFault"] = reflect.TypeOf((*CannotUseNetworkFault)(nil)).Elem() +} + +type Capability struct { + DynamicData + + ProvisioningSupported bool `xml:"provisioningSupported"` + MultiHostSupported bool `xml:"multiHostSupported"` + UserShellAccessSupported bool `xml:"userShellAccessSupported"` + SupportedEVCMode []EVCMode `xml:"supportedEVCMode,omitempty"` + NetworkBackupAndRestoreSupported *bool `xml:"networkBackupAndRestoreSupported"` +} + +func init() { + t["Capability"] = reflect.TypeOf((*Capability)(nil)).Elem() +} + +type CertMgrRefreshCACertificatesAndCRLsRequestType struct { + This ManagedObjectReference `xml:"_this"` + Host []ManagedObjectReference `xml:"host"` +} + +func init() { + t["CertMgrRefreshCACertificatesAndCRLsRequestType"] = reflect.TypeOf((*CertMgrRefreshCACertificatesAndCRLsRequestType)(nil)).Elem() +} + +type CertMgrRefreshCACertificatesAndCRLs_Task CertMgrRefreshCACertificatesAndCRLsRequestType + +func init() { + t["CertMgrRefreshCACertificatesAndCRLs_Task"] = reflect.TypeOf((*CertMgrRefreshCACertificatesAndCRLs_Task)(nil)).Elem() +} + +type CertMgrRefreshCACertificatesAndCRLs_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type CertMgrRefreshCertificatesRequestType struct { + This ManagedObjectReference `xml:"_this"` + Host []ManagedObjectReference `xml:"host"` +} + +func init() { + t["CertMgrRefreshCertificatesRequestType"] = reflect.TypeOf((*CertMgrRefreshCertificatesRequestType)(nil)).Elem() +} + +type CertMgrRefreshCertificates_Task CertMgrRefreshCertificatesRequestType + +func init() { + t["CertMgrRefreshCertificates_Task"] = reflect.TypeOf((*CertMgrRefreshCertificates_Task)(nil)).Elem() +} + +type CertMgrRefreshCertificates_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type CertMgrRevokeCertificatesRequestType struct { + This ManagedObjectReference `xml:"_this"` + Host []ManagedObjectReference `xml:"host"` +} + +func init() { + t["CertMgrRevokeCertificatesRequestType"] = reflect.TypeOf((*CertMgrRevokeCertificatesRequestType)(nil)).Elem() +} + +type CertMgrRevokeCertificates_Task CertMgrRevokeCertificatesRequestType + +func init() { + t["CertMgrRevokeCertificates_Task"] = reflect.TypeOf((*CertMgrRevokeCertificates_Task)(nil)).Elem() +} + +type CertMgrRevokeCertificates_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type ChangeAccessMode ChangeAccessModeRequestType + +func init() { + t["ChangeAccessMode"] = reflect.TypeOf((*ChangeAccessMode)(nil)).Elem() +} + +type ChangeAccessModeRequestType struct { + This ManagedObjectReference `xml:"_this"` + Principal string `xml:"principal"` + IsGroup bool `xml:"isGroup"` + AccessMode HostAccessMode `xml:"accessMode"` +} + +func init() { + t["ChangeAccessModeRequestType"] = reflect.TypeOf((*ChangeAccessModeRequestType)(nil)).Elem() +} + +type ChangeAccessModeResponse struct { +} + +type ChangeFileAttributesInGuest ChangeFileAttributesInGuestRequestType + +func init() { + t["ChangeFileAttributesInGuest"] = reflect.TypeOf((*ChangeFileAttributesInGuest)(nil)).Elem() +} + +type ChangeFileAttributesInGuestRequestType struct { + This ManagedObjectReference `xml:"_this"` + Vm ManagedObjectReference `xml:"vm"` + Auth BaseGuestAuthentication `xml:"auth,typeattr"` + GuestFilePath string `xml:"guestFilePath"` + FileAttributes BaseGuestFileAttributes `xml:"fileAttributes,typeattr"` +} + +func init() { + t["ChangeFileAttributesInGuestRequestType"] = reflect.TypeOf((*ChangeFileAttributesInGuestRequestType)(nil)).Elem() +} + +type ChangeFileAttributesInGuestResponse struct { +} + +type ChangeLockdownMode ChangeLockdownModeRequestType + +func init() { + t["ChangeLockdownMode"] = reflect.TypeOf((*ChangeLockdownMode)(nil)).Elem() +} + +type ChangeLockdownModeRequestType struct { + This ManagedObjectReference `xml:"_this"` + Mode HostLockdownMode `xml:"mode"` +} + +func init() { + t["ChangeLockdownModeRequestType"] = reflect.TypeOf((*ChangeLockdownModeRequestType)(nil)).Elem() +} + +type ChangeLockdownModeResponse struct { +} + +type ChangeNFSUserPassword ChangeNFSUserPasswordRequestType + +func init() { + t["ChangeNFSUserPassword"] = reflect.TypeOf((*ChangeNFSUserPassword)(nil)).Elem() +} + +type ChangeNFSUserPasswordRequestType struct { + This ManagedObjectReference `xml:"_this"` + Password string `xml:"password"` +} + +func init() { + t["ChangeNFSUserPasswordRequestType"] = reflect.TypeOf((*ChangeNFSUserPasswordRequestType)(nil)).Elem() +} + +type ChangeNFSUserPasswordResponse struct { +} + +type ChangeOwner ChangeOwnerRequestType + +func init() { + t["ChangeOwner"] = reflect.TypeOf((*ChangeOwner)(nil)).Elem() +} + +type ChangeOwnerRequestType struct { + This ManagedObjectReference `xml:"_this"` + Name string `xml:"name"` + Datacenter *ManagedObjectReference `xml:"datacenter,omitempty"` + Owner string `xml:"owner"` +} + +func init() { + t["ChangeOwnerRequestType"] = reflect.TypeOf((*ChangeOwnerRequestType)(nil)).Elem() +} + +type ChangeOwnerResponse struct { +} + +type CheckAddHostEvcRequestType struct { + This ManagedObjectReference `xml:"_this"` + CnxSpec HostConnectSpec `xml:"cnxSpec"` +} + +func init() { + t["CheckAddHostEvcRequestType"] = reflect.TypeOf((*CheckAddHostEvcRequestType)(nil)).Elem() +} + +type CheckAddHostEvc_Task CheckAddHostEvcRequestType + +func init() { + t["CheckAddHostEvc_Task"] = reflect.TypeOf((*CheckAddHostEvc_Task)(nil)).Elem() +} + +type CheckAddHostEvc_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type CheckAnswerFileStatusRequestType struct { + This ManagedObjectReference `xml:"_this"` + Host []ManagedObjectReference `xml:"host"` +} + +func init() { + t["CheckAnswerFileStatusRequestType"] = reflect.TypeOf((*CheckAnswerFileStatusRequestType)(nil)).Elem() +} + +type CheckAnswerFileStatus_Task CheckAnswerFileStatusRequestType + +func init() { + t["CheckAnswerFileStatus_Task"] = reflect.TypeOf((*CheckAnswerFileStatus_Task)(nil)).Elem() +} + +type CheckAnswerFileStatus_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type CheckCompatibilityRequestType struct { + This ManagedObjectReference `xml:"_this"` + Vm ManagedObjectReference `xml:"vm"` + Host *ManagedObjectReference `xml:"host,omitempty"` + Pool *ManagedObjectReference `xml:"pool,omitempty"` + TestType []string `xml:"testType,omitempty"` +} + +func init() { + t["CheckCompatibilityRequestType"] = reflect.TypeOf((*CheckCompatibilityRequestType)(nil)).Elem() +} + +type CheckCompatibility_Task CheckCompatibilityRequestType + +func init() { + t["CheckCompatibility_Task"] = reflect.TypeOf((*CheckCompatibility_Task)(nil)).Elem() +} + +type CheckCompatibility_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type CheckComplianceRequestType struct { + This ManagedObjectReference `xml:"_this"` + Profile []ManagedObjectReference `xml:"profile,omitempty"` + Entity []ManagedObjectReference `xml:"entity,omitempty"` +} + +func init() { + t["CheckComplianceRequestType"] = reflect.TypeOf((*CheckComplianceRequestType)(nil)).Elem() +} + +type CheckCompliance_Task CheckComplianceRequestType + +func init() { + t["CheckCompliance_Task"] = reflect.TypeOf((*CheckCompliance_Task)(nil)).Elem() +} + +type CheckCompliance_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type CheckConfigureEvcModeRequestType struct { + This ManagedObjectReference `xml:"_this"` + EvcModeKey string `xml:"evcModeKey"` +} + +func init() { + t["CheckConfigureEvcModeRequestType"] = reflect.TypeOf((*CheckConfigureEvcModeRequestType)(nil)).Elem() +} + +type CheckConfigureEvcMode_Task CheckConfigureEvcModeRequestType + +func init() { + t["CheckConfigureEvcMode_Task"] = reflect.TypeOf((*CheckConfigureEvcMode_Task)(nil)).Elem() +} + +type CheckConfigureEvcMode_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type CheckCustomizationResources CheckCustomizationResourcesRequestType + +func init() { + t["CheckCustomizationResources"] = reflect.TypeOf((*CheckCustomizationResources)(nil)).Elem() +} + +type CheckCustomizationResourcesRequestType struct { + This ManagedObjectReference `xml:"_this"` + GuestOs string `xml:"guestOs"` +} + +func init() { + t["CheckCustomizationResourcesRequestType"] = reflect.TypeOf((*CheckCustomizationResourcesRequestType)(nil)).Elem() +} + +type CheckCustomizationResourcesResponse struct { +} + +type CheckCustomizationSpec CheckCustomizationSpecRequestType + +func init() { + t["CheckCustomizationSpec"] = reflect.TypeOf((*CheckCustomizationSpec)(nil)).Elem() +} + +type CheckCustomizationSpecRequestType struct { + This ManagedObjectReference `xml:"_this"` + Spec CustomizationSpec `xml:"spec"` +} + +func init() { + t["CheckCustomizationSpecRequestType"] = reflect.TypeOf((*CheckCustomizationSpecRequestType)(nil)).Elem() +} + +type CheckCustomizationSpecResponse struct { +} + +type CheckForUpdates CheckForUpdatesRequestType + +func init() { + t["CheckForUpdates"] = reflect.TypeOf((*CheckForUpdates)(nil)).Elem() +} + +type CheckForUpdatesRequestType struct { + This ManagedObjectReference `xml:"_this"` + Version string `xml:"version,omitempty"` +} + +func init() { + t["CheckForUpdatesRequestType"] = reflect.TypeOf((*CheckForUpdatesRequestType)(nil)).Elem() +} + +type CheckForUpdatesResponse struct { + Returnval *UpdateSet `xml:"returnval,omitempty"` +} + +type CheckHostPatchRequestType struct { + This ManagedObjectReference `xml:"_this"` + MetaUrls []string `xml:"metaUrls,omitempty"` + BundleUrls []string `xml:"bundleUrls,omitempty"` + Spec *HostPatchManagerPatchManagerOperationSpec `xml:"spec,omitempty"` +} + +func init() { + t["CheckHostPatchRequestType"] = reflect.TypeOf((*CheckHostPatchRequestType)(nil)).Elem() +} + +type CheckHostPatch_Task CheckHostPatchRequestType + +func init() { + t["CheckHostPatch_Task"] = reflect.TypeOf((*CheckHostPatch_Task)(nil)).Elem() +} + +type CheckHostPatch_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type CheckLicenseFeature CheckLicenseFeatureRequestType + +func init() { + t["CheckLicenseFeature"] = reflect.TypeOf((*CheckLicenseFeature)(nil)).Elem() +} + +type CheckLicenseFeatureRequestType struct { + This ManagedObjectReference `xml:"_this"` + Host *ManagedObjectReference `xml:"host,omitempty"` + FeatureKey string `xml:"featureKey"` +} + +func init() { + t["CheckLicenseFeatureRequestType"] = reflect.TypeOf((*CheckLicenseFeatureRequestType)(nil)).Elem() +} + +type CheckLicenseFeatureResponse struct { + Returnval bool `xml:"returnval"` +} + +type CheckMigrateRequestType struct { + This ManagedObjectReference `xml:"_this"` + Vm ManagedObjectReference `xml:"vm"` + Host *ManagedObjectReference `xml:"host,omitempty"` + Pool *ManagedObjectReference `xml:"pool,omitempty"` + State VirtualMachinePowerState `xml:"state,omitempty"` + TestType []string `xml:"testType,omitempty"` +} + +func init() { + t["CheckMigrateRequestType"] = reflect.TypeOf((*CheckMigrateRequestType)(nil)).Elem() +} + +type CheckMigrate_Task CheckMigrateRequestType + +func init() { + t["CheckMigrate_Task"] = reflect.TypeOf((*CheckMigrate_Task)(nil)).Elem() +} + +type CheckMigrate_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type CheckProfileComplianceRequestType struct { + This ManagedObjectReference `xml:"_this"` + Entity []ManagedObjectReference `xml:"entity,omitempty"` +} + +func init() { + t["CheckProfileComplianceRequestType"] = reflect.TypeOf((*CheckProfileComplianceRequestType)(nil)).Elem() +} + +type CheckProfileCompliance_Task CheckProfileComplianceRequestType + +func init() { + t["CheckProfileCompliance_Task"] = reflect.TypeOf((*CheckProfileCompliance_Task)(nil)).Elem() +} + +type CheckProfileCompliance_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type CheckRelocateRequestType struct { + This ManagedObjectReference `xml:"_this"` + Vm ManagedObjectReference `xml:"vm"` + Spec VirtualMachineRelocateSpec `xml:"spec"` + TestType []string `xml:"testType,omitempty"` +} + +func init() { + t["CheckRelocateRequestType"] = reflect.TypeOf((*CheckRelocateRequestType)(nil)).Elem() +} + +type CheckRelocate_Task CheckRelocateRequestType + +func init() { + t["CheckRelocate_Task"] = reflect.TypeOf((*CheckRelocate_Task)(nil)).Elem() +} + +type CheckRelocate_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type CheckResult struct { + DynamicData + + Vm *ManagedObjectReference `xml:"vm,omitempty"` + Host *ManagedObjectReference `xml:"host,omitempty"` + Warning []LocalizedMethodFault `xml:"warning,omitempty"` + Error []LocalizedMethodFault `xml:"error,omitempty"` +} + +func init() { + t["CheckResult"] = reflect.TypeOf((*CheckResult)(nil)).Elem() +} + +type ChoiceOption struct { + OptionType + + ChoiceInfo []BaseElementDescription `xml:"choiceInfo,typeattr"` + DefaultIndex int32 `xml:"defaultIndex,omitempty"` +} + +func init() { + t["ChoiceOption"] = reflect.TypeOf((*ChoiceOption)(nil)).Elem() +} + +type ClearComplianceStatus ClearComplianceStatusRequestType + +func init() { + t["ClearComplianceStatus"] = reflect.TypeOf((*ClearComplianceStatus)(nil)).Elem() +} + +type ClearComplianceStatusRequestType struct { + This ManagedObjectReference `xml:"_this"` + Profile []ManagedObjectReference `xml:"profile,omitempty"` + Entity []ManagedObjectReference `xml:"entity,omitempty"` +} + +func init() { + t["ClearComplianceStatusRequestType"] = reflect.TypeOf((*ClearComplianceStatusRequestType)(nil)).Elem() +} + +type ClearComplianceStatusResponse struct { +} + +type ClearNFSUser ClearNFSUserRequestType + +func init() { + t["ClearNFSUser"] = reflect.TypeOf((*ClearNFSUser)(nil)).Elem() +} + +type ClearNFSUserRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["ClearNFSUserRequestType"] = reflect.TypeOf((*ClearNFSUserRequestType)(nil)).Elem() +} + +type ClearNFSUserResponse struct { +} + +type ClockSkew struct { + HostConfigFault +} + +func init() { + t["ClockSkew"] = reflect.TypeOf((*ClockSkew)(nil)).Elem() +} + +type ClockSkewFault ClockSkew + +func init() { + t["ClockSkewFault"] = reflect.TypeOf((*ClockSkewFault)(nil)).Elem() +} + +type CloneFromSnapshotNotSupported struct { + MigrationFault +} + +func init() { + t["CloneFromSnapshotNotSupported"] = reflect.TypeOf((*CloneFromSnapshotNotSupported)(nil)).Elem() +} + +type CloneFromSnapshotNotSupportedFault CloneFromSnapshotNotSupported + +func init() { + t["CloneFromSnapshotNotSupportedFault"] = reflect.TypeOf((*CloneFromSnapshotNotSupportedFault)(nil)).Elem() +} + +type CloneSession CloneSessionRequestType + +func init() { + t["CloneSession"] = reflect.TypeOf((*CloneSession)(nil)).Elem() +} + +type CloneSessionRequestType struct { + This ManagedObjectReference `xml:"_this"` + CloneTicket string `xml:"cloneTicket"` +} + +func init() { + t["CloneSessionRequestType"] = reflect.TypeOf((*CloneSessionRequestType)(nil)).Elem() +} + +type CloneSessionResponse struct { + Returnval UserSession `xml:"returnval"` +} + +type CloneVAppRequestType struct { + This ManagedObjectReference `xml:"_this"` + Name string `xml:"name"` + Target ManagedObjectReference `xml:"target"` + Spec VAppCloneSpec `xml:"spec"` +} + +func init() { + t["CloneVAppRequestType"] = reflect.TypeOf((*CloneVAppRequestType)(nil)).Elem() +} + +type CloneVApp_Task CloneVAppRequestType + +func init() { + t["CloneVApp_Task"] = reflect.TypeOf((*CloneVApp_Task)(nil)).Elem() +} + +type CloneVApp_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type CloneVMRequestType struct { + This ManagedObjectReference `xml:"_this"` + Folder ManagedObjectReference `xml:"folder"` + Name string `xml:"name"` + Spec VirtualMachineCloneSpec `xml:"spec"` +} + +func init() { + t["CloneVMRequestType"] = reflect.TypeOf((*CloneVMRequestType)(nil)).Elem() +} + +type CloneVM_Task CloneVMRequestType + +func init() { + t["CloneVM_Task"] = reflect.TypeOf((*CloneVM_Task)(nil)).Elem() +} + +type CloneVM_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type CloseInventoryViewFolder CloseInventoryViewFolderRequestType + +func init() { + t["CloseInventoryViewFolder"] = reflect.TypeOf((*CloseInventoryViewFolder)(nil)).Elem() +} + +type CloseInventoryViewFolderRequestType struct { + This ManagedObjectReference `xml:"_this"` + Entity []ManagedObjectReference `xml:"entity"` +} + +func init() { + t["CloseInventoryViewFolderRequestType"] = reflect.TypeOf((*CloseInventoryViewFolderRequestType)(nil)).Elem() +} + +type CloseInventoryViewFolderResponse struct { + Returnval []ManagedObjectReference `xml:"returnval,omitempty"` +} + +type ClusterAction struct { + DynamicData + + Type string `xml:"type"` + Target *ManagedObjectReference `xml:"target,omitempty"` +} + +func init() { + t["ClusterAction"] = reflect.TypeOf((*ClusterAction)(nil)).Elem() +} + +type ClusterActionHistory struct { + DynamicData + + Action BaseClusterAction `xml:"action,typeattr"` + Time time.Time `xml:"time"` +} + +func init() { + t["ClusterActionHistory"] = reflect.TypeOf((*ClusterActionHistory)(nil)).Elem() +} + +type ClusterAffinityRuleSpec struct { + ClusterRuleInfo + + Vm []ManagedObjectReference `xml:"vm"` +} + +func init() { + t["ClusterAffinityRuleSpec"] = reflect.TypeOf((*ClusterAffinityRuleSpec)(nil)).Elem() +} + +type ClusterAntiAffinityRuleSpec struct { + ClusterRuleInfo + + Vm []ManagedObjectReference `xml:"vm"` +} + +func init() { + t["ClusterAntiAffinityRuleSpec"] = reflect.TypeOf((*ClusterAntiAffinityRuleSpec)(nil)).Elem() +} + +type ClusterAttemptedVmInfo struct { + DynamicData + + Vm ManagedObjectReference `xml:"vm"` + Task *ManagedObjectReference `xml:"task,omitempty"` +} + +func init() { + t["ClusterAttemptedVmInfo"] = reflect.TypeOf((*ClusterAttemptedVmInfo)(nil)).Elem() +} + +type ClusterComplianceCheckedEvent struct { + ClusterEvent + + Profile ProfileEventArgument `xml:"profile"` +} + +func init() { + t["ClusterComplianceCheckedEvent"] = reflect.TypeOf((*ClusterComplianceCheckedEvent)(nil)).Elem() +} + +type ClusterComputeResourceSummary struct { + ComputeResourceSummary + + CurrentFailoverLevel int32 `xml:"currentFailoverLevel"` + AdmissionControlInfo BaseClusterDasAdmissionControlInfo `xml:"admissionControlInfo,omitempty,typeattr"` + NumVmotions int32 `xml:"numVmotions"` + TargetBalance int32 `xml:"targetBalance,omitempty"` + CurrentBalance int32 `xml:"currentBalance,omitempty"` + UsageSummary *ClusterUsageSummary `xml:"usageSummary,omitempty"` + CurrentEVCModeKey string `xml:"currentEVCModeKey,omitempty"` + DasData BaseClusterDasData `xml:"dasData,omitempty,typeattr"` +} + +func init() { + t["ClusterComputeResourceSummary"] = reflect.TypeOf((*ClusterComputeResourceSummary)(nil)).Elem() +} + +type ClusterConfigInfo struct { + DynamicData + + DasConfig ClusterDasConfigInfo `xml:"dasConfig"` + DasVmConfig []ClusterDasVmConfigInfo `xml:"dasVmConfig,omitempty"` + DrsConfig ClusterDrsConfigInfo `xml:"drsConfig"` + DrsVmConfig []ClusterDrsVmConfigInfo `xml:"drsVmConfig,omitempty"` + Rule []BaseClusterRuleInfo `xml:"rule,omitempty,typeattr"` +} + +func init() { + t["ClusterConfigInfo"] = reflect.TypeOf((*ClusterConfigInfo)(nil)).Elem() +} + +type ClusterConfigInfoEx struct { + ComputeResourceConfigInfo + + DasConfig ClusterDasConfigInfo `xml:"dasConfig"` + DasVmConfig []ClusterDasVmConfigInfo `xml:"dasVmConfig,omitempty"` + DrsConfig ClusterDrsConfigInfo `xml:"drsConfig"` + DrsVmConfig []ClusterDrsVmConfigInfo `xml:"drsVmConfig,omitempty"` + Rule []BaseClusterRuleInfo `xml:"rule,omitempty,typeattr"` + DpmConfigInfo *ClusterDpmConfigInfo `xml:"dpmConfigInfo,omitempty"` + DpmHostConfig []ClusterDpmHostConfigInfo `xml:"dpmHostConfig,omitempty"` + VsanConfigInfo *VsanClusterConfigInfo `xml:"vsanConfigInfo,omitempty"` + VsanHostConfig []VsanHostConfigInfo `xml:"vsanHostConfig,omitempty"` + Group []BaseClusterGroupInfo `xml:"group,omitempty,typeattr"` +} + +func init() { + t["ClusterConfigInfoEx"] = reflect.TypeOf((*ClusterConfigInfoEx)(nil)).Elem() +} + +type ClusterConfigSpec struct { + DynamicData + + DasConfig *ClusterDasConfigInfo `xml:"dasConfig,omitempty"` + DasVmConfigSpec []ClusterDasVmConfigSpec `xml:"dasVmConfigSpec,omitempty"` + DrsConfig *ClusterDrsConfigInfo `xml:"drsConfig,omitempty"` + DrsVmConfigSpec []ClusterDrsVmConfigSpec `xml:"drsVmConfigSpec,omitempty"` + RulesSpec []ClusterRuleSpec `xml:"rulesSpec,omitempty"` +} + +func init() { + t["ClusterConfigSpec"] = reflect.TypeOf((*ClusterConfigSpec)(nil)).Elem() +} + +type ClusterConfigSpecEx struct { + ComputeResourceConfigSpec + + DasConfig *ClusterDasConfigInfo `xml:"dasConfig,omitempty"` + DasVmConfigSpec []ClusterDasVmConfigSpec `xml:"dasVmConfigSpec,omitempty"` + DrsConfig *ClusterDrsConfigInfo `xml:"drsConfig,omitempty"` + DrsVmConfigSpec []ClusterDrsVmConfigSpec `xml:"drsVmConfigSpec,omitempty"` + RulesSpec []ClusterRuleSpec `xml:"rulesSpec,omitempty"` + DpmConfig *ClusterDpmConfigInfo `xml:"dpmConfig,omitempty"` + DpmHostConfigSpec []ClusterDpmHostConfigSpec `xml:"dpmHostConfigSpec,omitempty"` + VsanConfig *VsanClusterConfigInfo `xml:"vsanConfig,omitempty"` + VsanHostConfigSpec []VsanHostConfigInfo `xml:"vsanHostConfigSpec,omitempty"` + GroupSpec []ClusterGroupSpec `xml:"groupSpec,omitempty"` +} + +func init() { + t["ClusterConfigSpecEx"] = reflect.TypeOf((*ClusterConfigSpecEx)(nil)).Elem() +} + +type ClusterCreatedEvent struct { + ClusterEvent + + Parent FolderEventArgument `xml:"parent"` +} + +func init() { + t["ClusterCreatedEvent"] = reflect.TypeOf((*ClusterCreatedEvent)(nil)).Elem() +} + +type ClusterDasAamHostInfo struct { + ClusterDasHostInfo + + HostDasState []ClusterDasAamNodeState `xml:"hostDasState,omitempty"` + PrimaryHosts []string `xml:"primaryHosts,omitempty"` +} + +func init() { + t["ClusterDasAamHostInfo"] = reflect.TypeOf((*ClusterDasAamHostInfo)(nil)).Elem() +} + +type ClusterDasAamNodeState struct { + DynamicData + + Host ManagedObjectReference `xml:"host"` + Name string `xml:"name"` + ConfigState string `xml:"configState"` + RuntimeState string `xml:"runtimeState"` +} + +func init() { + t["ClusterDasAamNodeState"] = reflect.TypeOf((*ClusterDasAamNodeState)(nil)).Elem() +} + +type ClusterDasAdmissionControlInfo struct { + DynamicData +} + +func init() { + t["ClusterDasAdmissionControlInfo"] = reflect.TypeOf((*ClusterDasAdmissionControlInfo)(nil)).Elem() +} + +type ClusterDasAdmissionControlPolicy struct { + DynamicData +} + +func init() { + t["ClusterDasAdmissionControlPolicy"] = reflect.TypeOf((*ClusterDasAdmissionControlPolicy)(nil)).Elem() +} + +type ClusterDasAdvancedRuntimeInfo struct { + DynamicData + + DasHostInfo BaseClusterDasHostInfo `xml:"dasHostInfo,omitempty,typeattr"` + VmcpSupported *ClusterDasAdvancedRuntimeInfoVmcpCapabilityInfo `xml:"vmcpSupported,omitempty"` + HeartbeatDatastoreInfo []DasHeartbeatDatastoreInfo `xml:"heartbeatDatastoreInfo,omitempty"` +} + +func init() { + t["ClusterDasAdvancedRuntimeInfo"] = reflect.TypeOf((*ClusterDasAdvancedRuntimeInfo)(nil)).Elem() +} + +type ClusterDasAdvancedRuntimeInfoVmcpCapabilityInfo struct { + DynamicData + + StorageAPDSupported bool `xml:"storageAPDSupported"` + StoragePDLSupported bool `xml:"storagePDLSupported"` +} + +func init() { + t["ClusterDasAdvancedRuntimeInfoVmcpCapabilityInfo"] = reflect.TypeOf((*ClusterDasAdvancedRuntimeInfoVmcpCapabilityInfo)(nil)).Elem() +} + +type ClusterDasConfigInfo struct { + DynamicData + + Enabled *bool `xml:"enabled"` + VmMonitoring string `xml:"vmMonitoring,omitempty"` + HostMonitoring string `xml:"hostMonitoring,omitempty"` + VmComponentProtecting string `xml:"vmComponentProtecting,omitempty"` + FailoverLevel int32 `xml:"failoverLevel,omitempty"` + AdmissionControlPolicy BaseClusterDasAdmissionControlPolicy `xml:"admissionControlPolicy,omitempty,typeattr"` + AdmissionControlEnabled *bool `xml:"admissionControlEnabled"` + DefaultVmSettings *ClusterDasVmSettings `xml:"defaultVmSettings,omitempty"` + Option []BaseOptionValue `xml:"option,omitempty,typeattr"` + HeartbeatDatastore []ManagedObjectReference `xml:"heartbeatDatastore,omitempty"` + HBDatastoreCandidatePolicy string `xml:"hBDatastoreCandidatePolicy,omitempty"` +} + +func init() { + t["ClusterDasConfigInfo"] = reflect.TypeOf((*ClusterDasConfigInfo)(nil)).Elem() +} + +type ClusterDasData struct { + DynamicData +} + +func init() { + t["ClusterDasData"] = reflect.TypeOf((*ClusterDasData)(nil)).Elem() +} + +type ClusterDasDataSummary struct { + ClusterDasData + + HostListVersion int64 `xml:"hostListVersion"` + ClusterConfigVersion int64 `xml:"clusterConfigVersion"` + CompatListVersion int64 `xml:"compatListVersion"` +} + +func init() { + t["ClusterDasDataSummary"] = reflect.TypeOf((*ClusterDasDataSummary)(nil)).Elem() +} + +type ClusterDasFailoverLevelAdvancedRuntimeInfo struct { + ClusterDasAdvancedRuntimeInfo + + SlotInfo ClusterDasFailoverLevelAdvancedRuntimeInfoSlotInfo `xml:"slotInfo"` + TotalSlots int32 `xml:"totalSlots"` + UsedSlots int32 `xml:"usedSlots"` + UnreservedSlots int32 `xml:"unreservedSlots"` + TotalVms int32 `xml:"totalVms"` + TotalHosts int32 `xml:"totalHosts"` + TotalGoodHosts int32 `xml:"totalGoodHosts"` + HostSlots []ClusterDasFailoverLevelAdvancedRuntimeInfoHostSlots `xml:"hostSlots,omitempty"` + VmsRequiringMultipleSlots []ClusterDasFailoverLevelAdvancedRuntimeInfoVmSlots `xml:"vmsRequiringMultipleSlots,omitempty"` +} + +func init() { + t["ClusterDasFailoverLevelAdvancedRuntimeInfo"] = reflect.TypeOf((*ClusterDasFailoverLevelAdvancedRuntimeInfo)(nil)).Elem() +} + +type ClusterDasFailoverLevelAdvancedRuntimeInfoHostSlots struct { + DynamicData + + Host ManagedObjectReference `xml:"host"` + Slots int32 `xml:"slots"` +} + +func init() { + t["ClusterDasFailoverLevelAdvancedRuntimeInfoHostSlots"] = reflect.TypeOf((*ClusterDasFailoverLevelAdvancedRuntimeInfoHostSlots)(nil)).Elem() +} + +type ClusterDasFailoverLevelAdvancedRuntimeInfoSlotInfo struct { + DynamicData + + NumVcpus int32 `xml:"numVcpus"` + CpuMHz int32 `xml:"cpuMHz"` + MemoryMB int32 `xml:"memoryMB"` +} + +func init() { + t["ClusterDasFailoverLevelAdvancedRuntimeInfoSlotInfo"] = reflect.TypeOf((*ClusterDasFailoverLevelAdvancedRuntimeInfoSlotInfo)(nil)).Elem() +} + +type ClusterDasFailoverLevelAdvancedRuntimeInfoVmSlots struct { + DynamicData + + Vm ManagedObjectReference `xml:"vm"` + Slots int32 `xml:"slots"` +} + +func init() { + t["ClusterDasFailoverLevelAdvancedRuntimeInfoVmSlots"] = reflect.TypeOf((*ClusterDasFailoverLevelAdvancedRuntimeInfoVmSlots)(nil)).Elem() +} + +type ClusterDasFdmHostState struct { + DynamicData + + State string `xml:"state"` + StateReporter *ManagedObjectReference `xml:"stateReporter,omitempty"` +} + +func init() { + t["ClusterDasFdmHostState"] = reflect.TypeOf((*ClusterDasFdmHostState)(nil)).Elem() +} + +type ClusterDasHostInfo struct { + DynamicData +} + +func init() { + t["ClusterDasHostInfo"] = reflect.TypeOf((*ClusterDasHostInfo)(nil)).Elem() +} + +type ClusterDasHostRecommendation struct { + DynamicData + + Host ManagedObjectReference `xml:"host"` + DrsRating int32 `xml:"drsRating,omitempty"` +} + +func init() { + t["ClusterDasHostRecommendation"] = reflect.TypeOf((*ClusterDasHostRecommendation)(nil)).Elem() +} + +type ClusterDasVmConfigInfo struct { + DynamicData + + Key ManagedObjectReference `xml:"key"` + RestartPriority DasVmPriority `xml:"restartPriority,omitempty"` + PowerOffOnIsolation *bool `xml:"powerOffOnIsolation"` + DasSettings *ClusterDasVmSettings `xml:"dasSettings,omitempty"` +} + +func init() { + t["ClusterDasVmConfigInfo"] = reflect.TypeOf((*ClusterDasVmConfigInfo)(nil)).Elem() +} + +type ClusterDasVmConfigSpec struct { + ArrayUpdateSpec + + Info *ClusterDasVmConfigInfo `xml:"info,omitempty"` +} + +func init() { + t["ClusterDasVmConfigSpec"] = reflect.TypeOf((*ClusterDasVmConfigSpec)(nil)).Elem() +} + +type ClusterDasVmSettings struct { + DynamicData + + RestartPriority string `xml:"restartPriority,omitempty"` + IsolationResponse string `xml:"isolationResponse,omitempty"` + VmToolsMonitoringSettings *ClusterVmToolsMonitoringSettings `xml:"vmToolsMonitoringSettings,omitempty"` + VmComponentProtectionSettings *ClusterVmComponentProtectionSettings `xml:"vmComponentProtectionSettings,omitempty"` +} + +func init() { + t["ClusterDasVmSettings"] = reflect.TypeOf((*ClusterDasVmSettings)(nil)).Elem() +} + +type ClusterDestroyedEvent struct { + ClusterEvent +} + +func init() { + t["ClusterDestroyedEvent"] = reflect.TypeOf((*ClusterDestroyedEvent)(nil)).Elem() +} + +type ClusterDpmConfigInfo struct { + DynamicData + + Enabled *bool `xml:"enabled"` + DefaultDpmBehavior DpmBehavior `xml:"defaultDpmBehavior,omitempty"` + HostPowerActionRate int32 `xml:"hostPowerActionRate,omitempty"` + Option []BaseOptionValue `xml:"option,omitempty,typeattr"` +} + +func init() { + t["ClusterDpmConfigInfo"] = reflect.TypeOf((*ClusterDpmConfigInfo)(nil)).Elem() +} + +type ClusterDpmHostConfigInfo struct { + DynamicData + + Key ManagedObjectReference `xml:"key"` + Enabled *bool `xml:"enabled"` + Behavior DpmBehavior `xml:"behavior,omitempty"` +} + +func init() { + t["ClusterDpmHostConfigInfo"] = reflect.TypeOf((*ClusterDpmHostConfigInfo)(nil)).Elem() +} + +type ClusterDpmHostConfigSpec struct { + ArrayUpdateSpec + + Info *ClusterDpmHostConfigInfo `xml:"info,omitempty"` +} + +func init() { + t["ClusterDpmHostConfigSpec"] = reflect.TypeOf((*ClusterDpmHostConfigSpec)(nil)).Elem() +} + +type ClusterDrsConfigInfo struct { + DynamicData + + Enabled *bool `xml:"enabled"` + EnableVmBehaviorOverrides *bool `xml:"enableVmBehaviorOverrides"` + DefaultVmBehavior DrsBehavior `xml:"defaultVmBehavior,omitempty"` + VmotionRate int32 `xml:"vmotionRate,omitempty"` + Option []BaseOptionValue `xml:"option,omitempty,typeattr"` +} + +func init() { + t["ClusterDrsConfigInfo"] = reflect.TypeOf((*ClusterDrsConfigInfo)(nil)).Elem() +} + +type ClusterDrsFaults struct { + DynamicData + + Reason string `xml:"reason"` + FaultsByVm []BaseClusterDrsFaultsFaultsByVm `xml:"faultsByVm,typeattr"` +} + +func init() { + t["ClusterDrsFaults"] = reflect.TypeOf((*ClusterDrsFaults)(nil)).Elem() +} + +type ClusterDrsFaultsFaultsByVirtualDisk struct { + ClusterDrsFaultsFaultsByVm + + Disk *VirtualDiskId `xml:"disk,omitempty"` +} + +func init() { + t["ClusterDrsFaultsFaultsByVirtualDisk"] = reflect.TypeOf((*ClusterDrsFaultsFaultsByVirtualDisk)(nil)).Elem() +} + +type ClusterDrsFaultsFaultsByVm struct { + DynamicData + + Vm *ManagedObjectReference `xml:"vm,omitempty"` + Fault []LocalizedMethodFault `xml:"fault"` +} + +func init() { + t["ClusterDrsFaultsFaultsByVm"] = reflect.TypeOf((*ClusterDrsFaultsFaultsByVm)(nil)).Elem() +} + +type ClusterDrsMigration struct { + DynamicData + + Key string `xml:"key"` + Time time.Time `xml:"time"` + Vm ManagedObjectReference `xml:"vm"` + CpuLoad int32 `xml:"cpuLoad,omitempty"` + MemoryLoad int64 `xml:"memoryLoad,omitempty"` + Source ManagedObjectReference `xml:"source"` + SourceCpuLoad int32 `xml:"sourceCpuLoad,omitempty"` + SourceMemoryLoad int64 `xml:"sourceMemoryLoad,omitempty"` + Destination ManagedObjectReference `xml:"destination"` + DestinationCpuLoad int32 `xml:"destinationCpuLoad,omitempty"` + DestinationMemoryLoad int64 `xml:"destinationMemoryLoad,omitempty"` +} + +func init() { + t["ClusterDrsMigration"] = reflect.TypeOf((*ClusterDrsMigration)(nil)).Elem() +} + +type ClusterDrsRecommendation struct { + DynamicData + + Key string `xml:"key"` + Rating int32 `xml:"rating"` + Reason string `xml:"reason"` + ReasonText string `xml:"reasonText"` + MigrationList []ClusterDrsMigration `xml:"migrationList"` +} + +func init() { + t["ClusterDrsRecommendation"] = reflect.TypeOf((*ClusterDrsRecommendation)(nil)).Elem() +} + +type ClusterDrsVmConfigInfo struct { + DynamicData + + Key ManagedObjectReference `xml:"key"` + Enabled *bool `xml:"enabled"` + Behavior DrsBehavior `xml:"behavior,omitempty"` +} + +func init() { + t["ClusterDrsVmConfigInfo"] = reflect.TypeOf((*ClusterDrsVmConfigInfo)(nil)).Elem() +} + +type ClusterDrsVmConfigSpec struct { + ArrayUpdateSpec + + Info *ClusterDrsVmConfigInfo `xml:"info,omitempty"` +} + +func init() { + t["ClusterDrsVmConfigSpec"] = reflect.TypeOf((*ClusterDrsVmConfigSpec)(nil)).Elem() +} + +type ClusterEVCManagerCheckResult struct { + DynamicData + + EvcModeKey string `xml:"evcModeKey"` + Error LocalizedMethodFault `xml:"error"` + Host []ManagedObjectReference `xml:"host,omitempty"` +} + +func init() { + t["ClusterEVCManagerCheckResult"] = reflect.TypeOf((*ClusterEVCManagerCheckResult)(nil)).Elem() +} + +type ClusterEVCManagerEVCState struct { + DynamicData + + SupportedEVCMode []EVCMode `xml:"supportedEVCMode"` + CurrentEVCModeKey string `xml:"currentEVCModeKey,omitempty"` + GuaranteedCPUFeatures []HostCpuIdInfo `xml:"guaranteedCPUFeatures,omitempty"` + FeatureCapability []HostFeatureCapability `xml:"featureCapability,omitempty"` + FeatureMask []HostFeatureMask `xml:"featureMask,omitempty"` + FeatureRequirement []VirtualMachineFeatureRequirement `xml:"featureRequirement,omitempty"` +} + +func init() { + t["ClusterEVCManagerEVCState"] = reflect.TypeOf((*ClusterEVCManagerEVCState)(nil)).Elem() +} + +type ClusterEnterMaintenanceMode ClusterEnterMaintenanceModeRequestType + +func init() { + t["ClusterEnterMaintenanceMode"] = reflect.TypeOf((*ClusterEnterMaintenanceMode)(nil)).Elem() +} + +type ClusterEnterMaintenanceModeRequestType struct { + This ManagedObjectReference `xml:"_this"` + Host []ManagedObjectReference `xml:"host"` + Option []BaseOptionValue `xml:"option,omitempty,typeattr"` +} + +func init() { + t["ClusterEnterMaintenanceModeRequestType"] = reflect.TypeOf((*ClusterEnterMaintenanceModeRequestType)(nil)).Elem() +} + +type ClusterEnterMaintenanceModeResponse struct { + Returnval ClusterEnterMaintenanceResult `xml:"returnval"` +} + +type ClusterEnterMaintenanceResult struct { + DynamicData + + Recommendations []ClusterRecommendation `xml:"recommendations,omitempty"` + Fault *ClusterDrsFaults `xml:"fault,omitempty"` +} + +func init() { + t["ClusterEnterMaintenanceResult"] = reflect.TypeOf((*ClusterEnterMaintenanceResult)(nil)).Elem() +} + +type ClusterEvent struct { + Event +} + +func init() { + t["ClusterEvent"] = reflect.TypeOf((*ClusterEvent)(nil)).Elem() +} + +type ClusterFailoverHostAdmissionControlInfo struct { + ClusterDasAdmissionControlInfo + + HostStatus []ClusterFailoverHostAdmissionControlInfoHostStatus `xml:"hostStatus,omitempty"` +} + +func init() { + t["ClusterFailoverHostAdmissionControlInfo"] = reflect.TypeOf((*ClusterFailoverHostAdmissionControlInfo)(nil)).Elem() +} + +type ClusterFailoverHostAdmissionControlInfoHostStatus struct { + DynamicData + + Host ManagedObjectReference `xml:"host"` + Status ManagedEntityStatus `xml:"status"` +} + +func init() { + t["ClusterFailoverHostAdmissionControlInfoHostStatus"] = reflect.TypeOf((*ClusterFailoverHostAdmissionControlInfoHostStatus)(nil)).Elem() +} + +type ClusterFailoverHostAdmissionControlPolicy struct { + ClusterDasAdmissionControlPolicy + + FailoverHosts []ManagedObjectReference `xml:"failoverHosts,omitempty"` +} + +func init() { + t["ClusterFailoverHostAdmissionControlPolicy"] = reflect.TypeOf((*ClusterFailoverHostAdmissionControlPolicy)(nil)).Elem() +} + +type ClusterFailoverLevelAdmissionControlInfo struct { + ClusterDasAdmissionControlInfo + + CurrentFailoverLevel int32 `xml:"currentFailoverLevel"` +} + +func init() { + t["ClusterFailoverLevelAdmissionControlInfo"] = reflect.TypeOf((*ClusterFailoverLevelAdmissionControlInfo)(nil)).Elem() +} + +type ClusterFailoverLevelAdmissionControlPolicy struct { + ClusterDasAdmissionControlPolicy + + FailoverLevel int32 `xml:"failoverLevel"` + SlotPolicy BaseClusterSlotPolicy `xml:"slotPolicy,omitempty,typeattr"` +} + +func init() { + t["ClusterFailoverLevelAdmissionControlPolicy"] = reflect.TypeOf((*ClusterFailoverLevelAdmissionControlPolicy)(nil)).Elem() +} + +type ClusterFailoverResourcesAdmissionControlInfo struct { + ClusterDasAdmissionControlInfo + + CurrentCpuFailoverResourcesPercent int32 `xml:"currentCpuFailoverResourcesPercent"` + CurrentMemoryFailoverResourcesPercent int32 `xml:"currentMemoryFailoverResourcesPercent"` +} + +func init() { + t["ClusterFailoverResourcesAdmissionControlInfo"] = reflect.TypeOf((*ClusterFailoverResourcesAdmissionControlInfo)(nil)).Elem() +} + +type ClusterFailoverResourcesAdmissionControlPolicy struct { + ClusterDasAdmissionControlPolicy + + CpuFailoverResourcesPercent int32 `xml:"cpuFailoverResourcesPercent"` + MemoryFailoverResourcesPercent int32 `xml:"memoryFailoverResourcesPercent"` +} + +func init() { + t["ClusterFailoverResourcesAdmissionControlPolicy"] = reflect.TypeOf((*ClusterFailoverResourcesAdmissionControlPolicy)(nil)).Elem() +} + +type ClusterFixedSizeSlotPolicy struct { + ClusterSlotPolicy + + Cpu int32 `xml:"cpu"` + Memory int32 `xml:"memory"` +} + +func init() { + t["ClusterFixedSizeSlotPolicy"] = reflect.TypeOf((*ClusterFixedSizeSlotPolicy)(nil)).Elem() +} + +type ClusterGroupInfo struct { + DynamicData + + Name string `xml:"name"` + UserCreated *bool `xml:"userCreated"` + UniqueID string `xml:"uniqueID,omitempty"` +} + +func init() { + t["ClusterGroupInfo"] = reflect.TypeOf((*ClusterGroupInfo)(nil)).Elem() +} + +type ClusterGroupSpec struct { + ArrayUpdateSpec + + Info BaseClusterGroupInfo `xml:"info,omitempty,typeattr"` +} + +func init() { + t["ClusterGroupSpec"] = reflect.TypeOf((*ClusterGroupSpec)(nil)).Elem() +} + +type ClusterHostGroup struct { + ClusterGroupInfo + + Host []ManagedObjectReference `xml:"host,omitempty"` +} + +func init() { + t["ClusterHostGroup"] = reflect.TypeOf((*ClusterHostGroup)(nil)).Elem() +} + +type ClusterHostPowerAction struct { + ClusterAction + + OperationType HostPowerOperationType `xml:"operationType"` + PowerConsumptionWatt int32 `xml:"powerConsumptionWatt,omitempty"` + CpuCapacityMHz int32 `xml:"cpuCapacityMHz,omitempty"` + MemCapacityMB int32 `xml:"memCapacityMB,omitempty"` +} + +func init() { + t["ClusterHostPowerAction"] = reflect.TypeOf((*ClusterHostPowerAction)(nil)).Elem() +} + +type ClusterHostRecommendation struct { + DynamicData + + Host ManagedObjectReference `xml:"host"` + Rating int32 `xml:"rating"` +} + +func init() { + t["ClusterHostRecommendation"] = reflect.TypeOf((*ClusterHostRecommendation)(nil)).Elem() +} + +type ClusterInitialPlacementAction struct { + ClusterAction + + TargetHost ManagedObjectReference `xml:"targetHost"` + Pool *ManagedObjectReference `xml:"pool,omitempty"` +} + +func init() { + t["ClusterInitialPlacementAction"] = reflect.TypeOf((*ClusterInitialPlacementAction)(nil)).Elem() +} + +type ClusterIoFilterInfo struct { + IoFilterInfo + + OpType string `xml:"opType"` +} + +func init() { + t["ClusterIoFilterInfo"] = reflect.TypeOf((*ClusterIoFilterInfo)(nil)).Elem() +} + +type ClusterMigrationAction struct { + ClusterAction + + DrsMigration *ClusterDrsMigration `xml:"drsMigration,omitempty"` +} + +func init() { + t["ClusterMigrationAction"] = reflect.TypeOf((*ClusterMigrationAction)(nil)).Elem() +} + +type ClusterNotAttemptedVmInfo struct { + DynamicData + + Vm ManagedObjectReference `xml:"vm"` + Fault LocalizedMethodFault `xml:"fault"` +} + +func init() { + t["ClusterNotAttemptedVmInfo"] = reflect.TypeOf((*ClusterNotAttemptedVmInfo)(nil)).Elem() +} + +type ClusterOvercommittedEvent struct { + ClusterEvent +} + +func init() { + t["ClusterOvercommittedEvent"] = reflect.TypeOf((*ClusterOvercommittedEvent)(nil)).Elem() +} + +type ClusterPowerOnVmResult struct { + DynamicData + + Attempted []ClusterAttemptedVmInfo `xml:"attempted,omitempty"` + NotAttempted []ClusterNotAttemptedVmInfo `xml:"notAttempted,omitempty"` + Recommendations []ClusterRecommendation `xml:"recommendations,omitempty"` +} + +func init() { + t["ClusterPowerOnVmResult"] = reflect.TypeOf((*ClusterPowerOnVmResult)(nil)).Elem() +} + +type ClusterProfileCompleteConfigSpec struct { + ClusterProfileConfigSpec + + ComplyProfile *ComplianceProfile `xml:"complyProfile,omitempty"` +} + +func init() { + t["ClusterProfileCompleteConfigSpec"] = reflect.TypeOf((*ClusterProfileCompleteConfigSpec)(nil)).Elem() +} + +type ClusterProfileConfigInfo struct { + ProfileConfigInfo + + ComplyProfile *ComplianceProfile `xml:"complyProfile,omitempty"` +} + +func init() { + t["ClusterProfileConfigInfo"] = reflect.TypeOf((*ClusterProfileConfigInfo)(nil)).Elem() +} + +type ClusterProfileConfigServiceCreateSpec struct { + ClusterProfileConfigSpec + + ServiceType []string `xml:"serviceType,omitempty"` +} + +func init() { + t["ClusterProfileConfigServiceCreateSpec"] = reflect.TypeOf((*ClusterProfileConfigServiceCreateSpec)(nil)).Elem() +} + +type ClusterProfileConfigSpec struct { + ClusterProfileCreateSpec +} + +func init() { + t["ClusterProfileConfigSpec"] = reflect.TypeOf((*ClusterProfileConfigSpec)(nil)).Elem() +} + +type ClusterProfileCreateSpec struct { + ProfileCreateSpec +} + +func init() { + t["ClusterProfileCreateSpec"] = reflect.TypeOf((*ClusterProfileCreateSpec)(nil)).Elem() +} + +type ClusterRecommendation struct { + DynamicData + + Key string `xml:"key"` + Type string `xml:"type"` + Time time.Time `xml:"time"` + Rating int32 `xml:"rating"` + Reason string `xml:"reason"` + ReasonText string `xml:"reasonText"` + WarningText string `xml:"warningText,omitempty"` + WarningDetails *LocalizableMessage `xml:"warningDetails,omitempty"` + Prerequisite []string `xml:"prerequisite,omitempty"` + Action []BaseClusterAction `xml:"action,omitempty,typeattr"` + Target *ManagedObjectReference `xml:"target,omitempty"` +} + +func init() { + t["ClusterRecommendation"] = reflect.TypeOf((*ClusterRecommendation)(nil)).Elem() +} + +type ClusterReconfiguredEvent struct { + ClusterEvent +} + +func init() { + t["ClusterReconfiguredEvent"] = reflect.TypeOf((*ClusterReconfiguredEvent)(nil)).Elem() +} + +type ClusterResourceUsageSummary struct { + DynamicData + + CpuUsedMHz int32 `xml:"cpuUsedMHz"` + CpuCapacityMHz int32 `xml:"cpuCapacityMHz"` + MemUsedMB int32 `xml:"memUsedMB"` + MemCapacityMB int32 `xml:"memCapacityMB"` + StorageUsedMB int64 `xml:"storageUsedMB"` + StorageCapacityMB int64 `xml:"storageCapacityMB"` +} + +func init() { + t["ClusterResourceUsageSummary"] = reflect.TypeOf((*ClusterResourceUsageSummary)(nil)).Elem() +} + +type ClusterRuleInfo struct { + DynamicData + + Key int32 `xml:"key,omitempty"` + Status ManagedEntityStatus `xml:"status,omitempty"` + Enabled *bool `xml:"enabled"` + Name string `xml:"name,omitempty"` + Mandatory *bool `xml:"mandatory"` + UserCreated *bool `xml:"userCreated"` + InCompliance *bool `xml:"inCompliance"` + RuleUuid string `xml:"ruleUuid,omitempty"` +} + +func init() { + t["ClusterRuleInfo"] = reflect.TypeOf((*ClusterRuleInfo)(nil)).Elem() +} + +type ClusterRuleSpec struct { + ArrayUpdateSpec + + Info BaseClusterRuleInfo `xml:"info,omitempty,typeattr"` +} + +func init() { + t["ClusterRuleSpec"] = reflect.TypeOf((*ClusterRuleSpec)(nil)).Elem() +} + +type ClusterSlotPolicy struct { + DynamicData +} + +func init() { + t["ClusterSlotPolicy"] = reflect.TypeOf((*ClusterSlotPolicy)(nil)).Elem() +} + +type ClusterStatusChangedEvent struct { + ClusterEvent + + OldStatus string `xml:"oldStatus"` + NewStatus string `xml:"newStatus"` +} + +func init() { + t["ClusterStatusChangedEvent"] = reflect.TypeOf((*ClusterStatusChangedEvent)(nil)).Elem() +} + +type ClusterUsageSummary struct { + DynamicData + + TotalCpuCapacityMhz int32 `xml:"totalCpuCapacityMhz"` + TotalMemCapacityMB int32 `xml:"totalMemCapacityMB"` + CpuReservationMhz int32 `xml:"cpuReservationMhz"` + MemReservationMB int32 `xml:"memReservationMB"` + PoweredOffCpuReservationMhz int32 `xml:"poweredOffCpuReservationMhz,omitempty"` + PoweredOffMemReservationMB int32 `xml:"poweredOffMemReservationMB,omitempty"` + CpuDemandMhz int32 `xml:"cpuDemandMhz"` + MemDemandMB int32 `xml:"memDemandMB"` + StatsGenNumber int64 `xml:"statsGenNumber"` + CpuEntitledMhz int32 `xml:"cpuEntitledMhz"` + MemEntitledMB int32 `xml:"memEntitledMB"` + PoweredOffVmCount int32 `xml:"poweredOffVmCount"` + TotalVmCount int32 `xml:"totalVmCount"` +} + +func init() { + t["ClusterUsageSummary"] = reflect.TypeOf((*ClusterUsageSummary)(nil)).Elem() +} + +type ClusterVmComponentProtectionSettings struct { + DynamicData + + VmStorageProtectionForAPD string `xml:"vmStorageProtectionForAPD,omitempty"` + EnableAPDTimeoutForHosts *bool `xml:"enableAPDTimeoutForHosts"` + VmTerminateDelayForAPDSec int32 `xml:"vmTerminateDelayForAPDSec,omitempty"` + VmReactionOnAPDCleared string `xml:"vmReactionOnAPDCleared,omitempty"` + VmStorageProtectionForPDL string `xml:"vmStorageProtectionForPDL,omitempty"` +} + +func init() { + t["ClusterVmComponentProtectionSettings"] = reflect.TypeOf((*ClusterVmComponentProtectionSettings)(nil)).Elem() +} + +type ClusterVmGroup struct { + ClusterGroupInfo + + Vm []ManagedObjectReference `xml:"vm,omitempty"` +} + +func init() { + t["ClusterVmGroup"] = reflect.TypeOf((*ClusterVmGroup)(nil)).Elem() +} + +type ClusterVmHostRuleInfo struct { + ClusterRuleInfo + + VmGroupName string `xml:"vmGroupName,omitempty"` + AffineHostGroupName string `xml:"affineHostGroupName,omitempty"` + AntiAffineHostGroupName string `xml:"antiAffineHostGroupName,omitempty"` +} + +func init() { + t["ClusterVmHostRuleInfo"] = reflect.TypeOf((*ClusterVmHostRuleInfo)(nil)).Elem() +} + +type ClusterVmToolsMonitoringSettings struct { + DynamicData + + Enabled *bool `xml:"enabled"` + VmMonitoring string `xml:"vmMonitoring,omitempty"` + ClusterSettings *bool `xml:"clusterSettings"` + FailureInterval int32 `xml:"failureInterval,omitempty"` + MinUpTime int32 `xml:"minUpTime,omitempty"` + MaxFailures int32 `xml:"maxFailures,omitempty"` + MaxFailureWindow int32 `xml:"maxFailureWindow,omitempty"` +} + +func init() { + t["ClusterVmToolsMonitoringSettings"] = reflect.TypeOf((*ClusterVmToolsMonitoringSettings)(nil)).Elem() +} + +type CollectorAddressUnset struct { + DvsFault +} + +func init() { + t["CollectorAddressUnset"] = reflect.TypeOf((*CollectorAddressUnset)(nil)).Elem() +} + +type CollectorAddressUnsetFault CollectorAddressUnset + +func init() { + t["CollectorAddressUnsetFault"] = reflect.TypeOf((*CollectorAddressUnsetFault)(nil)).Elem() +} + +type ComplianceFailure struct { + DynamicData + + FailureType string `xml:"failureType"` + Message LocalizableMessage `xml:"message"` + ExpressionName string `xml:"expressionName,omitempty"` +} + +func init() { + t["ComplianceFailure"] = reflect.TypeOf((*ComplianceFailure)(nil)).Elem() +} + +type ComplianceLocator struct { + DynamicData + + ExpressionName string `xml:"expressionName"` + ApplyPath ProfilePropertyPath `xml:"applyPath"` +} + +func init() { + t["ComplianceLocator"] = reflect.TypeOf((*ComplianceLocator)(nil)).Elem() +} + +type ComplianceProfile struct { + DynamicData + + Expression []BaseProfileExpression `xml:"expression,typeattr"` + RootExpression string `xml:"rootExpression"` +} + +func init() { + t["ComplianceProfile"] = reflect.TypeOf((*ComplianceProfile)(nil)).Elem() +} + +type ComplianceResult struct { + DynamicData + + Profile *ManagedObjectReference `xml:"profile,omitempty"` + ComplianceStatus string `xml:"complianceStatus"` + Entity *ManagedObjectReference `xml:"entity,omitempty"` + CheckTime *time.Time `xml:"checkTime"` + Failure []ComplianceFailure `xml:"failure,omitempty"` +} + +func init() { + t["ComplianceResult"] = reflect.TypeOf((*ComplianceResult)(nil)).Elem() +} + +type CompositePolicyOption struct { + PolicyOption + + Option []BasePolicyOption `xml:"option,omitempty,typeattr"` +} + +func init() { + t["CompositePolicyOption"] = reflect.TypeOf((*CompositePolicyOption)(nil)).Elem() +} + +type ComputeDiskPartitionInfo ComputeDiskPartitionInfoRequestType + +func init() { + t["ComputeDiskPartitionInfo"] = reflect.TypeOf((*ComputeDiskPartitionInfo)(nil)).Elem() +} + +type ComputeDiskPartitionInfoForResize ComputeDiskPartitionInfoForResizeRequestType + +func init() { + t["ComputeDiskPartitionInfoForResize"] = reflect.TypeOf((*ComputeDiskPartitionInfoForResize)(nil)).Elem() +} + +type ComputeDiskPartitionInfoForResizeRequestType struct { + This ManagedObjectReference `xml:"_this"` + Partition HostScsiDiskPartition `xml:"partition"` + BlockRange HostDiskPartitionBlockRange `xml:"blockRange"` + PartitionFormat string `xml:"partitionFormat,omitempty"` +} + +func init() { + t["ComputeDiskPartitionInfoForResizeRequestType"] = reflect.TypeOf((*ComputeDiskPartitionInfoForResizeRequestType)(nil)).Elem() +} + +type ComputeDiskPartitionInfoForResizeResponse struct { + Returnval HostDiskPartitionInfo `xml:"returnval"` +} + +type ComputeDiskPartitionInfoRequestType struct { + This ManagedObjectReference `xml:"_this"` + DevicePath string `xml:"devicePath"` + Layout HostDiskPartitionLayout `xml:"layout"` + PartitionFormat string `xml:"partitionFormat,omitempty"` +} + +func init() { + t["ComputeDiskPartitionInfoRequestType"] = reflect.TypeOf((*ComputeDiskPartitionInfoRequestType)(nil)).Elem() +} + +type ComputeDiskPartitionInfoResponse struct { + Returnval HostDiskPartitionInfo `xml:"returnval"` +} + +type ComputeResourceConfigInfo struct { + DynamicData + + VmSwapPlacement string `xml:"vmSwapPlacement"` + SpbmEnabled *bool `xml:"spbmEnabled"` + DefaultHardwareVersionKey string `xml:"defaultHardwareVersionKey,omitempty"` +} + +func init() { + t["ComputeResourceConfigInfo"] = reflect.TypeOf((*ComputeResourceConfigInfo)(nil)).Elem() +} + +type ComputeResourceConfigSpec struct { + DynamicData + + VmSwapPlacement string `xml:"vmSwapPlacement,omitempty"` + SpbmEnabled *bool `xml:"spbmEnabled"` + DefaultHardwareVersionKey string `xml:"defaultHardwareVersionKey,omitempty"` +} + +func init() { + t["ComputeResourceConfigSpec"] = reflect.TypeOf((*ComputeResourceConfigSpec)(nil)).Elem() +} + +type ComputeResourceEventArgument struct { + EntityEventArgument + + ComputeResource ManagedObjectReference `xml:"computeResource"` +} + +func init() { + t["ComputeResourceEventArgument"] = reflect.TypeOf((*ComputeResourceEventArgument)(nil)).Elem() +} + +type ComputeResourceHostSPBMLicenseInfo struct { + DynamicData + + Host ManagedObjectReference `xml:"host"` + LicenseState ComputeResourceHostSPBMLicenseInfoHostSPBMLicenseState `xml:"licenseState"` +} + +func init() { + t["ComputeResourceHostSPBMLicenseInfo"] = reflect.TypeOf((*ComputeResourceHostSPBMLicenseInfo)(nil)).Elem() +} + +type ComputeResourceSummary struct { + DynamicData + + TotalCpu int32 `xml:"totalCpu"` + TotalMemory int64 `xml:"totalMemory"` + NumCpuCores int16 `xml:"numCpuCores"` + NumCpuThreads int16 `xml:"numCpuThreads"` + EffectiveCpu int32 `xml:"effectiveCpu"` + EffectiveMemory int64 `xml:"effectiveMemory"` + NumHosts int32 `xml:"numHosts"` + NumEffectiveHosts int32 `xml:"numEffectiveHosts"` + OverallStatus ManagedEntityStatus `xml:"overallStatus"` +} + +func init() { + t["ComputeResourceSummary"] = reflect.TypeOf((*ComputeResourceSummary)(nil)).Elem() +} + +type ConcurrentAccess struct { + VimFault +} + +func init() { + t["ConcurrentAccess"] = reflect.TypeOf((*ConcurrentAccess)(nil)).Elem() +} + +type ConcurrentAccessFault ConcurrentAccess + +func init() { + t["ConcurrentAccessFault"] = reflect.TypeOf((*ConcurrentAccessFault)(nil)).Elem() +} + +type ConfigTarget struct { + DynamicData + + NumCpus int32 `xml:"numCpus"` + NumCpuCores int32 `xml:"numCpuCores"` + NumNumaNodes int32 `xml:"numNumaNodes"` + SmcPresent *bool `xml:"smcPresent"` + Datastore []VirtualMachineDatastoreInfo `xml:"datastore,omitempty"` + Network []VirtualMachineNetworkInfo `xml:"network,omitempty"` + OpaqueNetwork []OpaqueNetworkTargetInfo `xml:"opaqueNetwork,omitempty"` + DistributedVirtualPortgroup []DistributedVirtualPortgroupInfo `xml:"distributedVirtualPortgroup,omitempty"` + DistributedVirtualSwitch []DistributedVirtualSwitchInfo `xml:"distributedVirtualSwitch,omitempty"` + CdRom []VirtualMachineCdromInfo `xml:"cdRom,omitempty"` + Serial []VirtualMachineSerialInfo `xml:"serial,omitempty"` + Parallel []VirtualMachineParallelInfo `xml:"parallel,omitempty"` + Sound []VirtualMachineSoundInfo `xml:"sound,omitempty"` + Usb []VirtualMachineUsbInfo `xml:"usb,omitempty"` + Floppy []VirtualMachineFloppyInfo `xml:"floppy,omitempty"` + LegacyNetworkInfo []VirtualMachineLegacyNetworkSwitchInfo `xml:"legacyNetworkInfo,omitempty"` + ScsiPassthrough []VirtualMachineScsiPassthroughInfo `xml:"scsiPassthrough,omitempty"` + ScsiDisk []VirtualMachineScsiDiskDeviceInfo `xml:"scsiDisk,omitempty"` + IdeDisk []VirtualMachineIdeDiskDeviceInfo `xml:"ideDisk,omitempty"` + MaxMemMBOptimalPerf int32 `xml:"maxMemMBOptimalPerf"` + ResourcePool *ResourcePoolRuntimeInfo `xml:"resourcePool,omitempty"` + AutoVmotion *bool `xml:"autoVmotion"` + PciPassthrough []BaseVirtualMachinePciPassthroughInfo `xml:"pciPassthrough,omitempty,typeattr"` + Sriov []VirtualMachineSriovInfo `xml:"sriov,omitempty"` + VFlashModule []VirtualMachineVFlashModuleInfo `xml:"vFlashModule,omitempty"` + SharedGpuPassthroughTypes []VirtualMachinePciSharedGpuPassthroughInfo `xml:"sharedGpuPassthroughTypes,omitempty"` +} + +func init() { + t["ConfigTarget"] = reflect.TypeOf((*ConfigTarget)(nil)).Elem() +} + +type ConfigureDatastoreIORMRequestType struct { + This ManagedObjectReference `xml:"_this"` + Datastore ManagedObjectReference `xml:"datastore"` + Spec StorageIORMConfigSpec `xml:"spec"` +} + +func init() { + t["ConfigureDatastoreIORMRequestType"] = reflect.TypeOf((*ConfigureDatastoreIORMRequestType)(nil)).Elem() +} + +type ConfigureDatastoreIORM_Task ConfigureDatastoreIORMRequestType + +func init() { + t["ConfigureDatastoreIORM_Task"] = reflect.TypeOf((*ConfigureDatastoreIORM_Task)(nil)).Elem() +} + +type ConfigureDatastoreIORM_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type ConfigureDatastorePrincipal ConfigureDatastorePrincipalRequestType + +func init() { + t["ConfigureDatastorePrincipal"] = reflect.TypeOf((*ConfigureDatastorePrincipal)(nil)).Elem() +} + +type ConfigureDatastorePrincipalRequestType struct { + This ManagedObjectReference `xml:"_this"` + UserName string `xml:"userName"` + Password string `xml:"password,omitempty"` +} + +func init() { + t["ConfigureDatastorePrincipalRequestType"] = reflect.TypeOf((*ConfigureDatastorePrincipalRequestType)(nil)).Elem() +} + +type ConfigureDatastorePrincipalResponse struct { +} + +type ConfigureEvcModeRequestType struct { + This ManagedObjectReference `xml:"_this"` + EvcModeKey string `xml:"evcModeKey"` +} + +func init() { + t["ConfigureEvcModeRequestType"] = reflect.TypeOf((*ConfigureEvcModeRequestType)(nil)).Elem() +} + +type ConfigureEvcMode_Task ConfigureEvcModeRequestType + +func init() { + t["ConfigureEvcMode_Task"] = reflect.TypeOf((*ConfigureEvcMode_Task)(nil)).Elem() +} + +type ConfigureEvcMode_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type ConfigureHostCacheRequestType struct { + This ManagedObjectReference `xml:"_this"` + Spec HostCacheConfigurationSpec `xml:"spec"` +} + +func init() { + t["ConfigureHostCacheRequestType"] = reflect.TypeOf((*ConfigureHostCacheRequestType)(nil)).Elem() +} + +type ConfigureHostCache_Task ConfigureHostCacheRequestType + +func init() { + t["ConfigureHostCache_Task"] = reflect.TypeOf((*ConfigureHostCache_Task)(nil)).Elem() +} + +type ConfigureHostCache_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type ConfigureLicenseSource ConfigureLicenseSourceRequestType + +func init() { + t["ConfigureLicenseSource"] = reflect.TypeOf((*ConfigureLicenseSource)(nil)).Elem() +} + +type ConfigureLicenseSourceRequestType struct { + This ManagedObjectReference `xml:"_this"` + Host *ManagedObjectReference `xml:"host,omitempty"` + LicenseSource BaseLicenseSource `xml:"licenseSource,typeattr"` +} + +func init() { + t["ConfigureLicenseSourceRequestType"] = reflect.TypeOf((*ConfigureLicenseSourceRequestType)(nil)).Elem() +} + +type ConfigureLicenseSourceResponse struct { +} + +type ConfigurePowerPolicy ConfigurePowerPolicyRequestType + +func init() { + t["ConfigurePowerPolicy"] = reflect.TypeOf((*ConfigurePowerPolicy)(nil)).Elem() +} + +type ConfigurePowerPolicyRequestType struct { + This ManagedObjectReference `xml:"_this"` + Key int32 `xml:"key"` +} + +func init() { + t["ConfigurePowerPolicyRequestType"] = reflect.TypeOf((*ConfigurePowerPolicyRequestType)(nil)).Elem() +} + +type ConfigurePowerPolicyResponse struct { +} + +type ConfigureStorageDrsForPodRequestType struct { + This ManagedObjectReference `xml:"_this"` + Pod ManagedObjectReference `xml:"pod"` + Spec StorageDrsConfigSpec `xml:"spec"` + Modify bool `xml:"modify"` +} + +func init() { + t["ConfigureStorageDrsForPodRequestType"] = reflect.TypeOf((*ConfigureStorageDrsForPodRequestType)(nil)).Elem() +} + +type ConfigureStorageDrsForPod_Task ConfigureStorageDrsForPodRequestType + +func init() { + t["ConfigureStorageDrsForPod_Task"] = reflect.TypeOf((*ConfigureStorageDrsForPod_Task)(nil)).Elem() +} + +type ConfigureStorageDrsForPod_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type ConfigureVFlashResourceExRequestType struct { + This ManagedObjectReference `xml:"_this"` + DevicePath []string `xml:"devicePath,omitempty"` +} + +func init() { + t["ConfigureVFlashResourceExRequestType"] = reflect.TypeOf((*ConfigureVFlashResourceExRequestType)(nil)).Elem() +} + +type ConfigureVFlashResourceEx_Task ConfigureVFlashResourceExRequestType + +func init() { + t["ConfigureVFlashResourceEx_Task"] = reflect.TypeOf((*ConfigureVFlashResourceEx_Task)(nil)).Elem() +} + +type ConfigureVFlashResourceEx_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type ConflictingConfiguration struct { + DvsFault + + ConfigInConflict []ConflictingConfigurationConfig `xml:"configInConflict"` +} + +func init() { + t["ConflictingConfiguration"] = reflect.TypeOf((*ConflictingConfiguration)(nil)).Elem() +} + +type ConflictingConfigurationConfig struct { + DynamicData + + Entity *ManagedObjectReference `xml:"entity,omitempty"` + PropertyPath string `xml:"propertyPath"` +} + +func init() { + t["ConflictingConfigurationConfig"] = reflect.TypeOf((*ConflictingConfigurationConfig)(nil)).Elem() +} + +type ConflictingConfigurationFault ConflictingConfiguration + +func init() { + t["ConflictingConfigurationFault"] = reflect.TypeOf((*ConflictingConfigurationFault)(nil)).Elem() +} + +type ConflictingDatastoreFound struct { + RuntimeFault + + Name string `xml:"name"` + Url string `xml:"url"` +} + +func init() { + t["ConflictingDatastoreFound"] = reflect.TypeOf((*ConflictingDatastoreFound)(nil)).Elem() +} + +type ConflictingDatastoreFoundFault ConflictingDatastoreFound + +func init() { + t["ConflictingDatastoreFoundFault"] = reflect.TypeOf((*ConflictingDatastoreFoundFault)(nil)).Elem() +} + +type ConnectedIso struct { + OvfExport + + Cdrom VirtualCdrom `xml:"cdrom"` + Filename string `xml:"filename"` +} + +func init() { + t["ConnectedIso"] = reflect.TypeOf((*ConnectedIso)(nil)).Elem() +} + +type ConnectedIsoFault ConnectedIso + +func init() { + t["ConnectedIsoFault"] = reflect.TypeOf((*ConnectedIsoFault)(nil)).Elem() +} + +type ConsolidateVMDisksRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["ConsolidateVMDisksRequestType"] = reflect.TypeOf((*ConsolidateVMDisksRequestType)(nil)).Elem() +} + +type ConsolidateVMDisks_Task ConsolidateVMDisksRequestType + +func init() { + t["ConsolidateVMDisks_Task"] = reflect.TypeOf((*ConsolidateVMDisks_Task)(nil)).Elem() +} + +type ConsolidateVMDisks_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type ContinueRetrievePropertiesEx ContinueRetrievePropertiesExRequestType + +func init() { + t["ContinueRetrievePropertiesEx"] = reflect.TypeOf((*ContinueRetrievePropertiesEx)(nil)).Elem() +} + +type ContinueRetrievePropertiesExRequestType struct { + This ManagedObjectReference `xml:"_this"` + Token string `xml:"token"` +} + +func init() { + t["ContinueRetrievePropertiesExRequestType"] = reflect.TypeOf((*ContinueRetrievePropertiesExRequestType)(nil)).Elem() +} + +type ContinueRetrievePropertiesExResponse struct { + Returnval RetrieveResult `xml:"returnval"` +} + +type CopyDatastoreFileRequestType struct { + This ManagedObjectReference `xml:"_this"` + SourceName string `xml:"sourceName"` + SourceDatacenter *ManagedObjectReference `xml:"sourceDatacenter,omitempty"` + DestinationName string `xml:"destinationName"` + DestinationDatacenter *ManagedObjectReference `xml:"destinationDatacenter,omitempty"` + Force *bool `xml:"force"` +} + +func init() { + t["CopyDatastoreFileRequestType"] = reflect.TypeOf((*CopyDatastoreFileRequestType)(nil)).Elem() +} + +type CopyDatastoreFile_Task CopyDatastoreFileRequestType + +func init() { + t["CopyDatastoreFile_Task"] = reflect.TypeOf((*CopyDatastoreFile_Task)(nil)).Elem() +} + +type CopyDatastoreFile_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type CopyVirtualDiskRequestType struct { + This ManagedObjectReference `xml:"_this"` + SourceName string `xml:"sourceName"` + SourceDatacenter *ManagedObjectReference `xml:"sourceDatacenter,omitempty"` + DestName string `xml:"destName"` + DestDatacenter *ManagedObjectReference `xml:"destDatacenter,omitempty"` + DestSpec BaseVirtualDiskSpec `xml:"destSpec,omitempty,typeattr"` + Force *bool `xml:"force"` +} + +func init() { + t["CopyVirtualDiskRequestType"] = reflect.TypeOf((*CopyVirtualDiskRequestType)(nil)).Elem() +} + +type CopyVirtualDisk_Task CopyVirtualDiskRequestType + +func init() { + t["CopyVirtualDisk_Task"] = reflect.TypeOf((*CopyVirtualDisk_Task)(nil)).Elem() +} + +type CopyVirtualDisk_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type CpuCompatibilityUnknown struct { + CpuIncompatible +} + +func init() { + t["CpuCompatibilityUnknown"] = reflect.TypeOf((*CpuCompatibilityUnknown)(nil)).Elem() +} + +type CpuCompatibilityUnknownFault CpuCompatibilityUnknown + +func init() { + t["CpuCompatibilityUnknownFault"] = reflect.TypeOf((*CpuCompatibilityUnknownFault)(nil)).Elem() +} + +type CpuHotPlugNotSupported struct { + VmConfigFault +} + +func init() { + t["CpuHotPlugNotSupported"] = reflect.TypeOf((*CpuHotPlugNotSupported)(nil)).Elem() +} + +type CpuHotPlugNotSupportedFault CpuHotPlugNotSupported + +func init() { + t["CpuHotPlugNotSupportedFault"] = reflect.TypeOf((*CpuHotPlugNotSupportedFault)(nil)).Elem() +} + +type CpuIncompatible struct { + VirtualHardwareCompatibilityIssue + + Level int32 `xml:"level"` + RegisterName string `xml:"registerName"` + RegisterBits string `xml:"registerBits,omitempty"` + DesiredBits string `xml:"desiredBits,omitempty"` + Host *ManagedObjectReference `xml:"host,omitempty"` +} + +func init() { + t["CpuIncompatible"] = reflect.TypeOf((*CpuIncompatible)(nil)).Elem() +} + +type CpuIncompatible1ECX struct { + CpuIncompatible + + Sse3 bool `xml:"sse3"` + Pclmulqdq *bool `xml:"pclmulqdq"` + Ssse3 bool `xml:"ssse3"` + Sse41 bool `xml:"sse41"` + Sse42 bool `xml:"sse42"` + Aes *bool `xml:"aes"` + Other bool `xml:"other"` + OtherOnly bool `xml:"otherOnly"` +} + +func init() { + t["CpuIncompatible1ECX"] = reflect.TypeOf((*CpuIncompatible1ECX)(nil)).Elem() +} + +type CpuIncompatible1ECXFault CpuIncompatible1ECX + +func init() { + t["CpuIncompatible1ECXFault"] = reflect.TypeOf((*CpuIncompatible1ECXFault)(nil)).Elem() +} + +type CpuIncompatible81EDX struct { + CpuIncompatible + + Nx bool `xml:"nx"` + Ffxsr bool `xml:"ffxsr"` + Rdtscp bool `xml:"rdtscp"` + Lm bool `xml:"lm"` + Other bool `xml:"other"` + OtherOnly bool `xml:"otherOnly"` +} + +func init() { + t["CpuIncompatible81EDX"] = reflect.TypeOf((*CpuIncompatible81EDX)(nil)).Elem() +} + +type CpuIncompatible81EDXFault CpuIncompatible81EDX + +func init() { + t["CpuIncompatible81EDXFault"] = reflect.TypeOf((*CpuIncompatible81EDXFault)(nil)).Elem() +} + +type CpuIncompatibleFault BaseCpuIncompatible + +func init() { + t["CpuIncompatibleFault"] = reflect.TypeOf((*CpuIncompatibleFault)(nil)).Elem() +} + +type CreateAlarm CreateAlarmRequestType + +func init() { + t["CreateAlarm"] = reflect.TypeOf((*CreateAlarm)(nil)).Elem() +} + +type CreateAlarmRequestType struct { + This ManagedObjectReference `xml:"_this"` + Entity ManagedObjectReference `xml:"entity"` + Spec BaseAlarmSpec `xml:"spec,typeattr"` +} + +func init() { + t["CreateAlarmRequestType"] = reflect.TypeOf((*CreateAlarmRequestType)(nil)).Elem() +} + +type CreateAlarmResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type CreateChildVMRequestType struct { + This ManagedObjectReference `xml:"_this"` + Config VirtualMachineConfigSpec `xml:"config"` + Host *ManagedObjectReference `xml:"host,omitempty"` +} + +func init() { + t["CreateChildVMRequestType"] = reflect.TypeOf((*CreateChildVMRequestType)(nil)).Elem() +} + +type CreateChildVM_Task CreateChildVMRequestType + +func init() { + t["CreateChildVM_Task"] = reflect.TypeOf((*CreateChildVM_Task)(nil)).Elem() +} + +type CreateChildVM_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type CreateCluster CreateClusterRequestType + +func init() { + t["CreateCluster"] = reflect.TypeOf((*CreateCluster)(nil)).Elem() +} + +type CreateClusterEx CreateClusterExRequestType + +func init() { + t["CreateClusterEx"] = reflect.TypeOf((*CreateClusterEx)(nil)).Elem() +} + +type CreateClusterExRequestType struct { + This ManagedObjectReference `xml:"_this"` + Name string `xml:"name"` + Spec ClusterConfigSpecEx `xml:"spec"` +} + +func init() { + t["CreateClusterExRequestType"] = reflect.TypeOf((*CreateClusterExRequestType)(nil)).Elem() +} + +type CreateClusterExResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type CreateClusterRequestType struct { + This ManagedObjectReference `xml:"_this"` + Name string `xml:"name"` + Spec ClusterConfigSpec `xml:"spec"` +} + +func init() { + t["CreateClusterRequestType"] = reflect.TypeOf((*CreateClusterRequestType)(nil)).Elem() +} + +type CreateClusterResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type CreateCollectorForEvents CreateCollectorForEventsRequestType + +func init() { + t["CreateCollectorForEvents"] = reflect.TypeOf((*CreateCollectorForEvents)(nil)).Elem() +} + +type CreateCollectorForEventsRequestType struct { + This ManagedObjectReference `xml:"_this"` + Filter EventFilterSpec `xml:"filter"` +} + +func init() { + t["CreateCollectorForEventsRequestType"] = reflect.TypeOf((*CreateCollectorForEventsRequestType)(nil)).Elem() +} + +type CreateCollectorForEventsResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type CreateCollectorForTasks CreateCollectorForTasksRequestType + +func init() { + t["CreateCollectorForTasks"] = reflect.TypeOf((*CreateCollectorForTasks)(nil)).Elem() +} + +type CreateCollectorForTasksRequestType struct { + This ManagedObjectReference `xml:"_this"` + Filter TaskFilterSpec `xml:"filter"` +} + +func init() { + t["CreateCollectorForTasksRequestType"] = reflect.TypeOf((*CreateCollectorForTasksRequestType)(nil)).Elem() +} + +type CreateCollectorForTasksResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type CreateContainerView CreateContainerViewRequestType + +func init() { + t["CreateContainerView"] = reflect.TypeOf((*CreateContainerView)(nil)).Elem() +} + +type CreateContainerViewRequestType struct { + This ManagedObjectReference `xml:"_this"` + Container ManagedObjectReference `xml:"container"` + Type []string `xml:"type,omitempty"` + Recursive bool `xml:"recursive"` +} + +func init() { + t["CreateContainerViewRequestType"] = reflect.TypeOf((*CreateContainerViewRequestType)(nil)).Elem() +} + +type CreateContainerViewResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type CreateCustomizationSpec CreateCustomizationSpecRequestType + +func init() { + t["CreateCustomizationSpec"] = reflect.TypeOf((*CreateCustomizationSpec)(nil)).Elem() +} + +type CreateCustomizationSpecRequestType struct { + This ManagedObjectReference `xml:"_this"` + Item CustomizationSpecItem `xml:"item"` +} + +func init() { + t["CreateCustomizationSpecRequestType"] = reflect.TypeOf((*CreateCustomizationSpecRequestType)(nil)).Elem() +} + +type CreateCustomizationSpecResponse struct { +} + +type CreateDVPortgroupRequestType struct { + This ManagedObjectReference `xml:"_this"` + Spec DVPortgroupConfigSpec `xml:"spec"` +} + +func init() { + t["CreateDVPortgroupRequestType"] = reflect.TypeOf((*CreateDVPortgroupRequestType)(nil)).Elem() +} + +type CreateDVPortgroup_Task CreateDVPortgroupRequestType + +func init() { + t["CreateDVPortgroup_Task"] = reflect.TypeOf((*CreateDVPortgroup_Task)(nil)).Elem() +} + +type CreateDVPortgroup_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type CreateDVSRequestType struct { + This ManagedObjectReference `xml:"_this"` + Spec DVSCreateSpec `xml:"spec"` +} + +func init() { + t["CreateDVSRequestType"] = reflect.TypeOf((*CreateDVSRequestType)(nil)).Elem() +} + +type CreateDVS_Task CreateDVSRequestType + +func init() { + t["CreateDVS_Task"] = reflect.TypeOf((*CreateDVS_Task)(nil)).Elem() +} + +type CreateDVS_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type CreateDatacenter CreateDatacenterRequestType + +func init() { + t["CreateDatacenter"] = reflect.TypeOf((*CreateDatacenter)(nil)).Elem() +} + +type CreateDatacenterRequestType struct { + This ManagedObjectReference `xml:"_this"` + Name string `xml:"name"` +} + +func init() { + t["CreateDatacenterRequestType"] = reflect.TypeOf((*CreateDatacenterRequestType)(nil)).Elem() +} + +type CreateDatacenterResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type CreateDefaultProfile CreateDefaultProfileRequestType + +func init() { + t["CreateDefaultProfile"] = reflect.TypeOf((*CreateDefaultProfile)(nil)).Elem() +} + +type CreateDefaultProfileRequestType struct { + This ManagedObjectReference `xml:"_this"` + ProfileType string `xml:"profileType"` + ProfileTypeName string `xml:"profileTypeName,omitempty"` + Profile *ManagedObjectReference `xml:"profile,omitempty"` +} + +func init() { + t["CreateDefaultProfileRequestType"] = reflect.TypeOf((*CreateDefaultProfileRequestType)(nil)).Elem() +} + +type CreateDefaultProfileResponse struct { + Returnval BaseApplyProfile `xml:"returnval,typeattr"` +} + +type CreateDescriptor CreateDescriptorRequestType + +func init() { + t["CreateDescriptor"] = reflect.TypeOf((*CreateDescriptor)(nil)).Elem() +} + +type CreateDescriptorRequestType struct { + This ManagedObjectReference `xml:"_this"` + Obj ManagedObjectReference `xml:"obj"` + Cdp OvfCreateDescriptorParams `xml:"cdp"` +} + +func init() { + t["CreateDescriptorRequestType"] = reflect.TypeOf((*CreateDescriptorRequestType)(nil)).Elem() +} + +type CreateDescriptorResponse struct { + Returnval OvfCreateDescriptorResult `xml:"returnval"` +} + +type CreateDiagnosticPartition CreateDiagnosticPartitionRequestType + +func init() { + t["CreateDiagnosticPartition"] = reflect.TypeOf((*CreateDiagnosticPartition)(nil)).Elem() +} + +type CreateDiagnosticPartitionRequestType struct { + This ManagedObjectReference `xml:"_this"` + Spec HostDiagnosticPartitionCreateSpec `xml:"spec"` +} + +func init() { + t["CreateDiagnosticPartitionRequestType"] = reflect.TypeOf((*CreateDiagnosticPartitionRequestType)(nil)).Elem() +} + +type CreateDiagnosticPartitionResponse struct { +} + +type CreateDirectory CreateDirectoryRequestType + +func init() { + t["CreateDirectory"] = reflect.TypeOf((*CreateDirectory)(nil)).Elem() +} + +type CreateDirectoryRequestType struct { + This ManagedObjectReference `xml:"_this"` + Datastore ManagedObjectReference `xml:"datastore"` + DisplayName string `xml:"displayName,omitempty"` + Policy string `xml:"policy,omitempty"` +} + +func init() { + t["CreateDirectoryRequestType"] = reflect.TypeOf((*CreateDirectoryRequestType)(nil)).Elem() +} + +type CreateDirectoryResponse struct { + Returnval string `xml:"returnval"` +} + +type CreateFilter CreateFilterRequestType + +func init() { + t["CreateFilter"] = reflect.TypeOf((*CreateFilter)(nil)).Elem() +} + +type CreateFilterRequestType struct { + This ManagedObjectReference `xml:"_this"` + Spec PropertyFilterSpec `xml:"spec"` + PartialUpdates bool `xml:"partialUpdates"` +} + +func init() { + t["CreateFilterRequestType"] = reflect.TypeOf((*CreateFilterRequestType)(nil)).Elem() +} + +type CreateFilterResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type CreateFolder CreateFolderRequestType + +func init() { + t["CreateFolder"] = reflect.TypeOf((*CreateFolder)(nil)).Elem() +} + +type CreateFolderRequestType struct { + This ManagedObjectReference `xml:"_this"` + Name string `xml:"name"` +} + +func init() { + t["CreateFolderRequestType"] = reflect.TypeOf((*CreateFolderRequestType)(nil)).Elem() +} + +type CreateFolderResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type CreateGroup CreateGroupRequestType + +func init() { + t["CreateGroup"] = reflect.TypeOf((*CreateGroup)(nil)).Elem() +} + +type CreateGroupRequestType struct { + This ManagedObjectReference `xml:"_this"` + Group BaseHostAccountSpec `xml:"group,typeattr"` +} + +func init() { + t["CreateGroupRequestType"] = reflect.TypeOf((*CreateGroupRequestType)(nil)).Elem() +} + +type CreateGroupResponse struct { +} + +type CreateImportSpec CreateImportSpecRequestType + +func init() { + t["CreateImportSpec"] = reflect.TypeOf((*CreateImportSpec)(nil)).Elem() +} + +type CreateImportSpecRequestType struct { + This ManagedObjectReference `xml:"_this"` + OvfDescriptor string `xml:"ovfDescriptor"` + ResourcePool ManagedObjectReference `xml:"resourcePool"` + Datastore ManagedObjectReference `xml:"datastore"` + Cisp OvfCreateImportSpecParams `xml:"cisp"` +} + +func init() { + t["CreateImportSpecRequestType"] = reflect.TypeOf((*CreateImportSpecRequestType)(nil)).Elem() +} + +type CreateImportSpecResponse struct { + Returnval OvfCreateImportSpecResult `xml:"returnval"` +} + +type CreateInventoryView CreateInventoryViewRequestType + +func init() { + t["CreateInventoryView"] = reflect.TypeOf((*CreateInventoryView)(nil)).Elem() +} + +type CreateInventoryViewRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["CreateInventoryViewRequestType"] = reflect.TypeOf((*CreateInventoryViewRequestType)(nil)).Elem() +} + +type CreateInventoryViewResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type CreateIpPool CreateIpPoolRequestType + +func init() { + t["CreateIpPool"] = reflect.TypeOf((*CreateIpPool)(nil)).Elem() +} + +type CreateIpPoolRequestType struct { + This ManagedObjectReference `xml:"_this"` + Dc ManagedObjectReference `xml:"dc"` + Pool IpPool `xml:"pool"` +} + +func init() { + t["CreateIpPoolRequestType"] = reflect.TypeOf((*CreateIpPoolRequestType)(nil)).Elem() +} + +type CreateIpPoolResponse struct { + Returnval int32 `xml:"returnval"` +} + +type CreateListView CreateListViewRequestType + +func init() { + t["CreateListView"] = reflect.TypeOf((*CreateListView)(nil)).Elem() +} + +type CreateListViewFromView CreateListViewFromViewRequestType + +func init() { + t["CreateListViewFromView"] = reflect.TypeOf((*CreateListViewFromView)(nil)).Elem() +} + +type CreateListViewFromViewRequestType struct { + This ManagedObjectReference `xml:"_this"` + View ManagedObjectReference `xml:"view"` +} + +func init() { + t["CreateListViewFromViewRequestType"] = reflect.TypeOf((*CreateListViewFromViewRequestType)(nil)).Elem() +} + +type CreateListViewFromViewResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type CreateListViewRequestType struct { + This ManagedObjectReference `xml:"_this"` + Obj []ManagedObjectReference `xml:"obj,omitempty"` +} + +func init() { + t["CreateListViewRequestType"] = reflect.TypeOf((*CreateListViewRequestType)(nil)).Elem() +} + +type CreateListViewResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type CreateLocalDatastore CreateLocalDatastoreRequestType + +func init() { + t["CreateLocalDatastore"] = reflect.TypeOf((*CreateLocalDatastore)(nil)).Elem() +} + +type CreateLocalDatastoreRequestType struct { + This ManagedObjectReference `xml:"_this"` + Name string `xml:"name"` + Path string `xml:"path"` +} + +func init() { + t["CreateLocalDatastoreRequestType"] = reflect.TypeOf((*CreateLocalDatastoreRequestType)(nil)).Elem() +} + +type CreateLocalDatastoreResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type CreateNasDatastore CreateNasDatastoreRequestType + +func init() { + t["CreateNasDatastore"] = reflect.TypeOf((*CreateNasDatastore)(nil)).Elem() +} + +type CreateNasDatastoreRequestType struct { + This ManagedObjectReference `xml:"_this"` + Spec HostNasVolumeSpec `xml:"spec"` +} + +func init() { + t["CreateNasDatastoreRequestType"] = reflect.TypeOf((*CreateNasDatastoreRequestType)(nil)).Elem() +} + +type CreateNasDatastoreResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type CreateObjectScheduledTask CreateObjectScheduledTaskRequestType + +func init() { + t["CreateObjectScheduledTask"] = reflect.TypeOf((*CreateObjectScheduledTask)(nil)).Elem() +} + +type CreateObjectScheduledTaskRequestType struct { + This ManagedObjectReference `xml:"_this"` + Obj ManagedObjectReference `xml:"obj"` + Spec BaseScheduledTaskSpec `xml:"spec,typeattr"` +} + +func init() { + t["CreateObjectScheduledTaskRequestType"] = reflect.TypeOf((*CreateObjectScheduledTaskRequestType)(nil)).Elem() +} + +type CreateObjectScheduledTaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type CreatePerfInterval CreatePerfIntervalRequestType + +func init() { + t["CreatePerfInterval"] = reflect.TypeOf((*CreatePerfInterval)(nil)).Elem() +} + +type CreatePerfIntervalRequestType struct { + This ManagedObjectReference `xml:"_this"` + IntervalId PerfInterval `xml:"intervalId"` +} + +func init() { + t["CreatePerfIntervalRequestType"] = reflect.TypeOf((*CreatePerfIntervalRequestType)(nil)).Elem() +} + +type CreatePerfIntervalResponse struct { +} + +type CreateProfile CreateProfileRequestType + +func init() { + t["CreateProfile"] = reflect.TypeOf((*CreateProfile)(nil)).Elem() +} + +type CreateProfileRequestType struct { + This ManagedObjectReference `xml:"_this"` + CreateSpec BaseProfileCreateSpec `xml:"createSpec,typeattr"` +} + +func init() { + t["CreateProfileRequestType"] = reflect.TypeOf((*CreateProfileRequestType)(nil)).Elem() +} + +type CreateProfileResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type CreatePropertyCollector CreatePropertyCollectorRequestType + +func init() { + t["CreatePropertyCollector"] = reflect.TypeOf((*CreatePropertyCollector)(nil)).Elem() +} + +type CreatePropertyCollectorRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["CreatePropertyCollectorRequestType"] = reflect.TypeOf((*CreatePropertyCollectorRequestType)(nil)).Elem() +} + +type CreatePropertyCollectorResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type CreateRegistryKeyInGuest CreateRegistryKeyInGuestRequestType + +func init() { + t["CreateRegistryKeyInGuest"] = reflect.TypeOf((*CreateRegistryKeyInGuest)(nil)).Elem() +} + +type CreateRegistryKeyInGuestRequestType struct { + This ManagedObjectReference `xml:"_this"` + Vm ManagedObjectReference `xml:"vm"` + Auth BaseGuestAuthentication `xml:"auth,typeattr"` + KeyName GuestRegKeyNameSpec `xml:"keyName"` + IsVolatile bool `xml:"isVolatile"` + ClassType string `xml:"classType,omitempty"` +} + +func init() { + t["CreateRegistryKeyInGuestRequestType"] = reflect.TypeOf((*CreateRegistryKeyInGuestRequestType)(nil)).Elem() +} + +type CreateRegistryKeyInGuestResponse struct { +} + +type CreateResourcePool CreateResourcePoolRequestType + +func init() { + t["CreateResourcePool"] = reflect.TypeOf((*CreateResourcePool)(nil)).Elem() +} + +type CreateResourcePoolRequestType struct { + This ManagedObjectReference `xml:"_this"` + Name string `xml:"name"` + Spec ResourceConfigSpec `xml:"spec"` +} + +func init() { + t["CreateResourcePoolRequestType"] = reflect.TypeOf((*CreateResourcePoolRequestType)(nil)).Elem() +} + +type CreateResourcePoolResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type CreateScheduledTask CreateScheduledTaskRequestType + +func init() { + t["CreateScheduledTask"] = reflect.TypeOf((*CreateScheduledTask)(nil)).Elem() +} + +type CreateScheduledTaskRequestType struct { + This ManagedObjectReference `xml:"_this"` + Entity ManagedObjectReference `xml:"entity"` + Spec BaseScheduledTaskSpec `xml:"spec,typeattr"` +} + +func init() { + t["CreateScheduledTaskRequestType"] = reflect.TypeOf((*CreateScheduledTaskRequestType)(nil)).Elem() +} + +type CreateScheduledTaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type CreateScreenshotRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["CreateScreenshotRequestType"] = reflect.TypeOf((*CreateScreenshotRequestType)(nil)).Elem() +} + +type CreateScreenshot_Task CreateScreenshotRequestType + +func init() { + t["CreateScreenshot_Task"] = reflect.TypeOf((*CreateScreenshot_Task)(nil)).Elem() +} + +type CreateScreenshot_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type CreateSecondaryVMExRequestType struct { + This ManagedObjectReference `xml:"_this"` + Host *ManagedObjectReference `xml:"host,omitempty"` + Spec *FaultToleranceConfigSpec `xml:"spec,omitempty"` +} + +func init() { + t["CreateSecondaryVMExRequestType"] = reflect.TypeOf((*CreateSecondaryVMExRequestType)(nil)).Elem() +} + +type CreateSecondaryVMEx_Task CreateSecondaryVMExRequestType + +func init() { + t["CreateSecondaryVMEx_Task"] = reflect.TypeOf((*CreateSecondaryVMEx_Task)(nil)).Elem() +} + +type CreateSecondaryVMEx_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type CreateSecondaryVMRequestType struct { + This ManagedObjectReference `xml:"_this"` + Host *ManagedObjectReference `xml:"host,omitempty"` +} + +func init() { + t["CreateSecondaryVMRequestType"] = reflect.TypeOf((*CreateSecondaryVMRequestType)(nil)).Elem() +} + +type CreateSecondaryVM_Task CreateSecondaryVMRequestType + +func init() { + t["CreateSecondaryVM_Task"] = reflect.TypeOf((*CreateSecondaryVM_Task)(nil)).Elem() +} + +type CreateSecondaryVM_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type CreateSnapshotRequestType struct { + This ManagedObjectReference `xml:"_this"` + Name string `xml:"name"` + Description string `xml:"description,omitempty"` + Memory bool `xml:"memory"` + Quiesce bool `xml:"quiesce"` +} + +func init() { + t["CreateSnapshotRequestType"] = reflect.TypeOf((*CreateSnapshotRequestType)(nil)).Elem() +} + +type CreateSnapshot_Task CreateSnapshotRequestType + +func init() { + t["CreateSnapshot_Task"] = reflect.TypeOf((*CreateSnapshot_Task)(nil)).Elem() +} + +type CreateSnapshot_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type CreateStoragePod CreateStoragePodRequestType + +func init() { + t["CreateStoragePod"] = reflect.TypeOf((*CreateStoragePod)(nil)).Elem() +} + +type CreateStoragePodRequestType struct { + This ManagedObjectReference `xml:"_this"` + Name string `xml:"name"` +} + +func init() { + t["CreateStoragePodRequestType"] = reflect.TypeOf((*CreateStoragePodRequestType)(nil)).Elem() +} + +type CreateStoragePodResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type CreateTask CreateTaskRequestType + +func init() { + t["CreateTask"] = reflect.TypeOf((*CreateTask)(nil)).Elem() +} + +type CreateTaskAction struct { + Action + + TaskTypeId string `xml:"taskTypeId"` + Cancelable bool `xml:"cancelable"` +} + +func init() { + t["CreateTaskAction"] = reflect.TypeOf((*CreateTaskAction)(nil)).Elem() +} + +type CreateTaskRequestType struct { + This ManagedObjectReference `xml:"_this"` + Obj ManagedObjectReference `xml:"obj"` + TaskTypeId string `xml:"taskTypeId"` + InitiatedBy string `xml:"initiatedBy,omitempty"` + Cancelable bool `xml:"cancelable"` + ParentTaskKey string `xml:"parentTaskKey,omitempty"` + ActivationId string `xml:"activationId,omitempty"` +} + +func init() { + t["CreateTaskRequestType"] = reflect.TypeOf((*CreateTaskRequestType)(nil)).Elem() +} + +type CreateTaskResponse struct { + Returnval TaskInfo `xml:"returnval"` +} + +type CreateTemporaryDirectoryInGuest CreateTemporaryDirectoryInGuestRequestType + +func init() { + t["CreateTemporaryDirectoryInGuest"] = reflect.TypeOf((*CreateTemporaryDirectoryInGuest)(nil)).Elem() +} + +type CreateTemporaryDirectoryInGuestRequestType struct { + This ManagedObjectReference `xml:"_this"` + Vm ManagedObjectReference `xml:"vm"` + Auth BaseGuestAuthentication `xml:"auth,typeattr"` + Prefix string `xml:"prefix"` + Suffix string `xml:"suffix"` + DirectoryPath string `xml:"directoryPath,omitempty"` +} + +func init() { + t["CreateTemporaryDirectoryInGuestRequestType"] = reflect.TypeOf((*CreateTemporaryDirectoryInGuestRequestType)(nil)).Elem() +} + +type CreateTemporaryDirectoryInGuestResponse struct { + Returnval string `xml:"returnval"` +} + +type CreateTemporaryFileInGuest CreateTemporaryFileInGuestRequestType + +func init() { + t["CreateTemporaryFileInGuest"] = reflect.TypeOf((*CreateTemporaryFileInGuest)(nil)).Elem() +} + +type CreateTemporaryFileInGuestRequestType struct { + This ManagedObjectReference `xml:"_this"` + Vm ManagedObjectReference `xml:"vm"` + Auth BaseGuestAuthentication `xml:"auth,typeattr"` + Prefix string `xml:"prefix"` + Suffix string `xml:"suffix"` + DirectoryPath string `xml:"directoryPath,omitempty"` +} + +func init() { + t["CreateTemporaryFileInGuestRequestType"] = reflect.TypeOf((*CreateTemporaryFileInGuestRequestType)(nil)).Elem() +} + +type CreateTemporaryFileInGuestResponse struct { + Returnval string `xml:"returnval"` +} + +type CreateUser CreateUserRequestType + +func init() { + t["CreateUser"] = reflect.TypeOf((*CreateUser)(nil)).Elem() +} + +type CreateUserRequestType struct { + This ManagedObjectReference `xml:"_this"` + User BaseHostAccountSpec `xml:"user,typeattr"` +} + +func init() { + t["CreateUserRequestType"] = reflect.TypeOf((*CreateUserRequestType)(nil)).Elem() +} + +type CreateUserResponse struct { +} + +type CreateVApp CreateVAppRequestType + +func init() { + t["CreateVApp"] = reflect.TypeOf((*CreateVApp)(nil)).Elem() +} + +type CreateVAppRequestType struct { + This ManagedObjectReference `xml:"_this"` + Name string `xml:"name"` + ResSpec ResourceConfigSpec `xml:"resSpec"` + ConfigSpec VAppConfigSpec `xml:"configSpec"` + VmFolder *ManagedObjectReference `xml:"vmFolder,omitempty"` +} + +func init() { + t["CreateVAppRequestType"] = reflect.TypeOf((*CreateVAppRequestType)(nil)).Elem() +} + +type CreateVAppResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type CreateVMRequestType struct { + This ManagedObjectReference `xml:"_this"` + Config VirtualMachineConfigSpec `xml:"config"` + Pool ManagedObjectReference `xml:"pool"` + Host *ManagedObjectReference `xml:"host,omitempty"` +} + +func init() { + t["CreateVMRequestType"] = reflect.TypeOf((*CreateVMRequestType)(nil)).Elem() +} + +type CreateVM_Task CreateVMRequestType + +func init() { + t["CreateVM_Task"] = reflect.TypeOf((*CreateVM_Task)(nil)).Elem() +} + +type CreateVM_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type CreateVirtualDiskRequestType struct { + This ManagedObjectReference `xml:"_this"` + Name string `xml:"name"` + Datacenter *ManagedObjectReference `xml:"datacenter,omitempty"` + Spec BaseVirtualDiskSpec `xml:"spec,typeattr"` +} + +func init() { + t["CreateVirtualDiskRequestType"] = reflect.TypeOf((*CreateVirtualDiskRequestType)(nil)).Elem() +} + +type CreateVirtualDisk_Task CreateVirtualDiskRequestType + +func init() { + t["CreateVirtualDisk_Task"] = reflect.TypeOf((*CreateVirtualDisk_Task)(nil)).Elem() +} + +type CreateVirtualDisk_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type CreateVmfsDatastore CreateVmfsDatastoreRequestType + +func init() { + t["CreateVmfsDatastore"] = reflect.TypeOf((*CreateVmfsDatastore)(nil)).Elem() +} + +type CreateVmfsDatastoreRequestType struct { + This ManagedObjectReference `xml:"_this"` + Spec VmfsDatastoreCreateSpec `xml:"spec"` +} + +func init() { + t["CreateVmfsDatastoreRequestType"] = reflect.TypeOf((*CreateVmfsDatastoreRequestType)(nil)).Elem() +} + +type CreateVmfsDatastoreResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type CreateVvolDatastore CreateVvolDatastoreRequestType + +func init() { + t["CreateVvolDatastore"] = reflect.TypeOf((*CreateVvolDatastore)(nil)).Elem() +} + +type CreateVvolDatastoreRequestType struct { + This ManagedObjectReference `xml:"_this"` + Spec HostDatastoreSystemVvolDatastoreSpec `xml:"spec"` +} + +func init() { + t["CreateVvolDatastoreRequestType"] = reflect.TypeOf((*CreateVvolDatastoreRequestType)(nil)).Elem() +} + +type CreateVvolDatastoreResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type CurrentTime CurrentTimeRequestType + +func init() { + t["CurrentTime"] = reflect.TypeOf((*CurrentTime)(nil)).Elem() +} + +type CurrentTimeRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["CurrentTimeRequestType"] = reflect.TypeOf((*CurrentTimeRequestType)(nil)).Elem() +} + +type CurrentTimeResponse struct { + Returnval time.Time `xml:"returnval"` +} + +type CustomFieldDef struct { + DynamicData + + Key int32 `xml:"key"` + Name string `xml:"name"` + Type string `xml:"type"` + ManagedObjectType string `xml:"managedObjectType,omitempty"` + FieldDefPrivileges *PrivilegePolicyDef `xml:"fieldDefPrivileges,omitempty"` + FieldInstancePrivileges *PrivilegePolicyDef `xml:"fieldInstancePrivileges,omitempty"` +} + +func init() { + t["CustomFieldDef"] = reflect.TypeOf((*CustomFieldDef)(nil)).Elem() +} + +type CustomFieldDefAddedEvent struct { + CustomFieldDefEvent +} + +func init() { + t["CustomFieldDefAddedEvent"] = reflect.TypeOf((*CustomFieldDefAddedEvent)(nil)).Elem() +} + +type CustomFieldDefEvent struct { + CustomFieldEvent + + FieldKey int32 `xml:"fieldKey"` + Name string `xml:"name"` +} + +func init() { + t["CustomFieldDefEvent"] = reflect.TypeOf((*CustomFieldDefEvent)(nil)).Elem() +} + +type CustomFieldDefRemovedEvent struct { + CustomFieldDefEvent +} + +func init() { + t["CustomFieldDefRemovedEvent"] = reflect.TypeOf((*CustomFieldDefRemovedEvent)(nil)).Elem() +} + +type CustomFieldDefRenamedEvent struct { + CustomFieldDefEvent + + NewName string `xml:"newName"` +} + +func init() { + t["CustomFieldDefRenamedEvent"] = reflect.TypeOf((*CustomFieldDefRenamedEvent)(nil)).Elem() +} + +type CustomFieldEvent struct { + Event +} + +func init() { + t["CustomFieldEvent"] = reflect.TypeOf((*CustomFieldEvent)(nil)).Elem() +} + +type CustomFieldStringValue struct { + CustomFieldValue + + Value string `xml:"value"` +} + +func init() { + t["CustomFieldStringValue"] = reflect.TypeOf((*CustomFieldStringValue)(nil)).Elem() +} + +type CustomFieldValue struct { + DynamicData + + Key int32 `xml:"key"` +} + +func init() { + t["CustomFieldValue"] = reflect.TypeOf((*CustomFieldValue)(nil)).Elem() +} + +type CustomFieldValueChangedEvent struct { + CustomFieldEvent + + Entity ManagedEntityEventArgument `xml:"entity"` + FieldKey int32 `xml:"fieldKey"` + Name string `xml:"name"` + Value string `xml:"value"` +} + +func init() { + t["CustomFieldValueChangedEvent"] = reflect.TypeOf((*CustomFieldValueChangedEvent)(nil)).Elem() +} + +type CustomizationAdapterMapping struct { + DynamicData + + MacAddress string `xml:"macAddress,omitempty"` + Adapter CustomizationIPSettings `xml:"adapter"` +} + +func init() { + t["CustomizationAdapterMapping"] = reflect.TypeOf((*CustomizationAdapterMapping)(nil)).Elem() +} + +type CustomizationAutoIpV6Generator struct { + CustomizationIpV6Generator +} + +func init() { + t["CustomizationAutoIpV6Generator"] = reflect.TypeOf((*CustomizationAutoIpV6Generator)(nil)).Elem() +} + +type CustomizationCustomIpGenerator struct { + CustomizationIpGenerator + + Argument string `xml:"argument,omitempty"` +} + +func init() { + t["CustomizationCustomIpGenerator"] = reflect.TypeOf((*CustomizationCustomIpGenerator)(nil)).Elem() +} + +type CustomizationCustomIpV6Generator struct { + CustomizationIpV6Generator + + Argument string `xml:"argument,omitempty"` +} + +func init() { + t["CustomizationCustomIpV6Generator"] = reflect.TypeOf((*CustomizationCustomIpV6Generator)(nil)).Elem() +} + +type CustomizationCustomName struct { + CustomizationName + + Argument string `xml:"argument,omitempty"` +} + +func init() { + t["CustomizationCustomName"] = reflect.TypeOf((*CustomizationCustomName)(nil)).Elem() +} + +type CustomizationDhcpIpGenerator struct { + CustomizationIpGenerator +} + +func init() { + t["CustomizationDhcpIpGenerator"] = reflect.TypeOf((*CustomizationDhcpIpGenerator)(nil)).Elem() +} + +type CustomizationDhcpIpV6Generator struct { + CustomizationIpV6Generator +} + +func init() { + t["CustomizationDhcpIpV6Generator"] = reflect.TypeOf((*CustomizationDhcpIpV6Generator)(nil)).Elem() +} + +type CustomizationEvent struct { + VmEvent + + LogLocation string `xml:"logLocation,omitempty"` +} + +func init() { + t["CustomizationEvent"] = reflect.TypeOf((*CustomizationEvent)(nil)).Elem() +} + +type CustomizationFailed struct { + CustomizationEvent +} + +func init() { + t["CustomizationFailed"] = reflect.TypeOf((*CustomizationFailed)(nil)).Elem() +} + +type CustomizationFault struct { + VimFault +} + +func init() { + t["CustomizationFault"] = reflect.TypeOf((*CustomizationFault)(nil)).Elem() +} + +type CustomizationFaultFault BaseCustomizationFault + +func init() { + t["CustomizationFaultFault"] = reflect.TypeOf((*CustomizationFaultFault)(nil)).Elem() +} + +type CustomizationFixedIp struct { + CustomizationIpGenerator + + IpAddress string `xml:"ipAddress"` +} + +func init() { + t["CustomizationFixedIp"] = reflect.TypeOf((*CustomizationFixedIp)(nil)).Elem() +} + +type CustomizationFixedIpV6 struct { + CustomizationIpV6Generator + + IpAddress string `xml:"ipAddress"` + SubnetMask int32 `xml:"subnetMask"` +} + +func init() { + t["CustomizationFixedIpV6"] = reflect.TypeOf((*CustomizationFixedIpV6)(nil)).Elem() +} + +type CustomizationFixedName struct { + CustomizationName + + Name string `xml:"name"` +} + +func init() { + t["CustomizationFixedName"] = reflect.TypeOf((*CustomizationFixedName)(nil)).Elem() +} + +type CustomizationGlobalIPSettings struct { + DynamicData + + DnsSuffixList []string `xml:"dnsSuffixList,omitempty"` + DnsServerList []string `xml:"dnsServerList,omitempty"` +} + +func init() { + t["CustomizationGlobalIPSettings"] = reflect.TypeOf((*CustomizationGlobalIPSettings)(nil)).Elem() +} + +type CustomizationGuiRunOnce struct { + DynamicData + + CommandList []string `xml:"commandList"` +} + +func init() { + t["CustomizationGuiRunOnce"] = reflect.TypeOf((*CustomizationGuiRunOnce)(nil)).Elem() +} + +type CustomizationGuiUnattended struct { + DynamicData + + Password *CustomizationPassword `xml:"password,omitempty"` + TimeZone int32 `xml:"timeZone"` + AutoLogon bool `xml:"autoLogon"` + AutoLogonCount int32 `xml:"autoLogonCount"` +} + +func init() { + t["CustomizationGuiUnattended"] = reflect.TypeOf((*CustomizationGuiUnattended)(nil)).Elem() +} + +type CustomizationIPSettings struct { + DynamicData + + Ip BaseCustomizationIpGenerator `xml:"ip,typeattr"` + SubnetMask string `xml:"subnetMask,omitempty"` + Gateway []string `xml:"gateway,omitempty"` + IpV6Spec *CustomizationIPSettingsIpV6AddressSpec `xml:"ipV6Spec,omitempty"` + DnsServerList []string `xml:"dnsServerList,omitempty"` + DnsDomain string `xml:"dnsDomain,omitempty"` + PrimaryWINS string `xml:"primaryWINS,omitempty"` + SecondaryWINS string `xml:"secondaryWINS,omitempty"` + NetBIOS CustomizationNetBIOSMode `xml:"netBIOS,omitempty"` +} + +func init() { + t["CustomizationIPSettings"] = reflect.TypeOf((*CustomizationIPSettings)(nil)).Elem() +} + +type CustomizationIPSettingsIpV6AddressSpec struct { + DynamicData + + Ip []BaseCustomizationIpV6Generator `xml:"ip,typeattr"` + Gateway []string `xml:"gateway,omitempty"` +} + +func init() { + t["CustomizationIPSettingsIpV6AddressSpec"] = reflect.TypeOf((*CustomizationIPSettingsIpV6AddressSpec)(nil)).Elem() +} + +type CustomizationIdentification struct { + DynamicData + + JoinWorkgroup string `xml:"joinWorkgroup,omitempty"` + JoinDomain string `xml:"joinDomain,omitempty"` + DomainAdmin string `xml:"domainAdmin,omitempty"` + DomainAdminPassword *CustomizationPassword `xml:"domainAdminPassword,omitempty"` +} + +func init() { + t["CustomizationIdentification"] = reflect.TypeOf((*CustomizationIdentification)(nil)).Elem() +} + +type CustomizationIdentitySettings struct { + DynamicData +} + +func init() { + t["CustomizationIdentitySettings"] = reflect.TypeOf((*CustomizationIdentitySettings)(nil)).Elem() +} + +type CustomizationIpGenerator struct { + DynamicData +} + +func init() { + t["CustomizationIpGenerator"] = reflect.TypeOf((*CustomizationIpGenerator)(nil)).Elem() +} + +type CustomizationIpV6Generator struct { + DynamicData +} + +func init() { + t["CustomizationIpV6Generator"] = reflect.TypeOf((*CustomizationIpV6Generator)(nil)).Elem() +} + +type CustomizationLicenseFilePrintData struct { + DynamicData + + AutoMode CustomizationLicenseDataMode `xml:"autoMode"` + AutoUsers int32 `xml:"autoUsers,omitempty"` +} + +func init() { + t["CustomizationLicenseFilePrintData"] = reflect.TypeOf((*CustomizationLicenseFilePrintData)(nil)).Elem() +} + +type CustomizationLinuxIdentityFailed struct { + CustomizationFailed +} + +func init() { + t["CustomizationLinuxIdentityFailed"] = reflect.TypeOf((*CustomizationLinuxIdentityFailed)(nil)).Elem() +} + +type CustomizationLinuxOptions struct { + CustomizationOptions +} + +func init() { + t["CustomizationLinuxOptions"] = reflect.TypeOf((*CustomizationLinuxOptions)(nil)).Elem() +} + +type CustomizationLinuxPrep struct { + CustomizationIdentitySettings + + HostName BaseCustomizationName `xml:"hostName,typeattr"` + Domain string `xml:"domain"` + TimeZone string `xml:"timeZone,omitempty"` + HwClockUTC *bool `xml:"hwClockUTC"` +} + +func init() { + t["CustomizationLinuxPrep"] = reflect.TypeOf((*CustomizationLinuxPrep)(nil)).Elem() +} + +type CustomizationName struct { + DynamicData +} + +func init() { + t["CustomizationName"] = reflect.TypeOf((*CustomizationName)(nil)).Elem() +} + +type CustomizationNetworkSetupFailed struct { + CustomizationFailed +} + +func init() { + t["CustomizationNetworkSetupFailed"] = reflect.TypeOf((*CustomizationNetworkSetupFailed)(nil)).Elem() +} + +type CustomizationOptions struct { + DynamicData +} + +func init() { + t["CustomizationOptions"] = reflect.TypeOf((*CustomizationOptions)(nil)).Elem() +} + +type CustomizationPassword struct { + DynamicData + + Value string `xml:"value"` + PlainText bool `xml:"plainText"` +} + +func init() { + t["CustomizationPassword"] = reflect.TypeOf((*CustomizationPassword)(nil)).Elem() +} + +type CustomizationPending struct { + CustomizationFault +} + +func init() { + t["CustomizationPending"] = reflect.TypeOf((*CustomizationPending)(nil)).Elem() +} + +type CustomizationPendingFault CustomizationPending + +func init() { + t["CustomizationPendingFault"] = reflect.TypeOf((*CustomizationPendingFault)(nil)).Elem() +} + +type CustomizationPrefixName struct { + CustomizationName + + Base string `xml:"base"` +} + +func init() { + t["CustomizationPrefixName"] = reflect.TypeOf((*CustomizationPrefixName)(nil)).Elem() +} + +type CustomizationSpec struct { + DynamicData + + Options BaseCustomizationOptions `xml:"options,omitempty,typeattr"` + Identity BaseCustomizationIdentitySettings `xml:"identity,typeattr"` + GlobalIPSettings CustomizationGlobalIPSettings `xml:"globalIPSettings"` + NicSettingMap []CustomizationAdapterMapping `xml:"nicSettingMap,omitempty"` + EncryptionKey []byte `xml:"encryptionKey,omitempty"` +} + +func init() { + t["CustomizationSpec"] = reflect.TypeOf((*CustomizationSpec)(nil)).Elem() +} + +type CustomizationSpecInfo struct { + DynamicData + + Name string `xml:"name"` + Description string `xml:"description"` + Type string `xml:"type"` + ChangeVersion string `xml:"changeVersion,omitempty"` + LastUpdateTime *time.Time `xml:"lastUpdateTime"` +} + +func init() { + t["CustomizationSpecInfo"] = reflect.TypeOf((*CustomizationSpecInfo)(nil)).Elem() +} + +type CustomizationSpecItem struct { + DynamicData + + Info CustomizationSpecInfo `xml:"info"` + Spec CustomizationSpec `xml:"spec"` +} + +func init() { + t["CustomizationSpecItem"] = reflect.TypeOf((*CustomizationSpecItem)(nil)).Elem() +} + +type CustomizationSpecItemToXml CustomizationSpecItemToXmlRequestType + +func init() { + t["CustomizationSpecItemToXml"] = reflect.TypeOf((*CustomizationSpecItemToXml)(nil)).Elem() +} + +type CustomizationSpecItemToXmlRequestType struct { + This ManagedObjectReference `xml:"_this"` + Item CustomizationSpecItem `xml:"item"` +} + +func init() { + t["CustomizationSpecItemToXmlRequestType"] = reflect.TypeOf((*CustomizationSpecItemToXmlRequestType)(nil)).Elem() +} + +type CustomizationSpecItemToXmlResponse struct { + Returnval string `xml:"returnval"` +} + +type CustomizationStartedEvent struct { + CustomizationEvent +} + +func init() { + t["CustomizationStartedEvent"] = reflect.TypeOf((*CustomizationStartedEvent)(nil)).Elem() +} + +type CustomizationStatelessIpV6Generator struct { + CustomizationIpV6Generator +} + +func init() { + t["CustomizationStatelessIpV6Generator"] = reflect.TypeOf((*CustomizationStatelessIpV6Generator)(nil)).Elem() +} + +type CustomizationSucceeded struct { + CustomizationEvent +} + +func init() { + t["CustomizationSucceeded"] = reflect.TypeOf((*CustomizationSucceeded)(nil)).Elem() +} + +type CustomizationSysprep struct { + CustomizationIdentitySettings + + GuiUnattended CustomizationGuiUnattended `xml:"guiUnattended"` + UserData CustomizationUserData `xml:"userData"` + GuiRunOnce *CustomizationGuiRunOnce `xml:"guiRunOnce,omitempty"` + Identification CustomizationIdentification `xml:"identification"` + LicenseFilePrintData *CustomizationLicenseFilePrintData `xml:"licenseFilePrintData,omitempty"` +} + +func init() { + t["CustomizationSysprep"] = reflect.TypeOf((*CustomizationSysprep)(nil)).Elem() +} + +type CustomizationSysprepFailed struct { + CustomizationFailed + + SysprepVersion string `xml:"sysprepVersion"` + SystemVersion string `xml:"systemVersion"` +} + +func init() { + t["CustomizationSysprepFailed"] = reflect.TypeOf((*CustomizationSysprepFailed)(nil)).Elem() +} + +type CustomizationSysprepText struct { + CustomizationIdentitySettings + + Value string `xml:"value"` +} + +func init() { + t["CustomizationSysprepText"] = reflect.TypeOf((*CustomizationSysprepText)(nil)).Elem() +} + +type CustomizationUnknownFailure struct { + CustomizationFailed +} + +func init() { + t["CustomizationUnknownFailure"] = reflect.TypeOf((*CustomizationUnknownFailure)(nil)).Elem() +} + +type CustomizationUnknownIpGenerator struct { + CustomizationIpGenerator +} + +func init() { + t["CustomizationUnknownIpGenerator"] = reflect.TypeOf((*CustomizationUnknownIpGenerator)(nil)).Elem() +} + +type CustomizationUnknownIpV6Generator struct { + CustomizationIpV6Generator +} + +func init() { + t["CustomizationUnknownIpV6Generator"] = reflect.TypeOf((*CustomizationUnknownIpV6Generator)(nil)).Elem() +} + +type CustomizationUnknownName struct { + CustomizationName +} + +func init() { + t["CustomizationUnknownName"] = reflect.TypeOf((*CustomizationUnknownName)(nil)).Elem() +} + +type CustomizationUserData struct { + DynamicData + + FullName string `xml:"fullName"` + OrgName string `xml:"orgName"` + ComputerName BaseCustomizationName `xml:"computerName,typeattr"` + ProductId string `xml:"productId"` +} + +func init() { + t["CustomizationUserData"] = reflect.TypeOf((*CustomizationUserData)(nil)).Elem() +} + +type CustomizationVirtualMachineName struct { + CustomizationName +} + +func init() { + t["CustomizationVirtualMachineName"] = reflect.TypeOf((*CustomizationVirtualMachineName)(nil)).Elem() +} + +type CustomizationWinOptions struct { + CustomizationOptions + + ChangeSID bool `xml:"changeSID"` + DeleteAccounts bool `xml:"deleteAccounts"` + Reboot CustomizationSysprepRebootOption `xml:"reboot,omitempty"` +} + +func init() { + t["CustomizationWinOptions"] = reflect.TypeOf((*CustomizationWinOptions)(nil)).Elem() +} + +type CustomizeVMRequestType struct { + This ManagedObjectReference `xml:"_this"` + Spec CustomizationSpec `xml:"spec"` +} + +func init() { + t["CustomizeVMRequestType"] = reflect.TypeOf((*CustomizeVMRequestType)(nil)).Elem() +} + +type CustomizeVM_Task CustomizeVMRequestType + +func init() { + t["CustomizeVM_Task"] = reflect.TypeOf((*CustomizeVM_Task)(nil)).Elem() +} + +type CustomizeVM_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type DVPortConfigInfo struct { + DynamicData + + Name string `xml:"name,omitempty"` + Scope []ManagedObjectReference `xml:"scope,omitempty"` + Description string `xml:"description,omitempty"` + Setting BaseDVPortSetting `xml:"setting,omitempty,typeattr"` + ConfigVersion string `xml:"configVersion"` +} + +func init() { + t["DVPortConfigInfo"] = reflect.TypeOf((*DVPortConfigInfo)(nil)).Elem() +} + +type DVPortConfigSpec struct { + DynamicData + + Operation string `xml:"operation"` + Key string `xml:"key,omitempty"` + Name string `xml:"name,omitempty"` + Scope []ManagedObjectReference `xml:"scope,omitempty"` + Description string `xml:"description,omitempty"` + Setting BaseDVPortSetting `xml:"setting,omitempty,typeattr"` + ConfigVersion string `xml:"configVersion,omitempty"` +} + +func init() { + t["DVPortConfigSpec"] = reflect.TypeOf((*DVPortConfigSpec)(nil)).Elem() +} + +type DVPortNotSupported struct { + DeviceBackingNotSupported +} + +func init() { + t["DVPortNotSupported"] = reflect.TypeOf((*DVPortNotSupported)(nil)).Elem() +} + +type DVPortNotSupportedFault DVPortNotSupported + +func init() { + t["DVPortNotSupportedFault"] = reflect.TypeOf((*DVPortNotSupportedFault)(nil)).Elem() +} + +type DVPortSetting struct { + DynamicData + + Blocked *BoolPolicy `xml:"blocked,omitempty"` + VmDirectPathGen2Allowed *BoolPolicy `xml:"vmDirectPathGen2Allowed,omitempty"` + InShapingPolicy *DVSTrafficShapingPolicy `xml:"inShapingPolicy,omitempty"` + OutShapingPolicy *DVSTrafficShapingPolicy `xml:"outShapingPolicy,omitempty"` + VendorSpecificConfig *DVSVendorSpecificConfig `xml:"vendorSpecificConfig,omitempty"` + NetworkResourcePoolKey *StringPolicy `xml:"networkResourcePoolKey,omitempty"` + FilterPolicy *DvsFilterPolicy `xml:"filterPolicy,omitempty"` +} + +func init() { + t["DVPortSetting"] = reflect.TypeOf((*DVPortSetting)(nil)).Elem() +} + +type DVPortState struct { + DynamicData + + RuntimeInfo *DVPortStatus `xml:"runtimeInfo,omitempty"` + Stats DistributedVirtualSwitchPortStatistics `xml:"stats"` + VendorSpecificState []DistributedVirtualSwitchKeyedOpaqueBlob `xml:"vendorSpecificState,omitempty"` +} + +func init() { + t["DVPortState"] = reflect.TypeOf((*DVPortState)(nil)).Elem() +} + +type DVPortStatus struct { + DynamicData + + LinkUp bool `xml:"linkUp"` + Blocked bool `xml:"blocked"` + VlanIds []NumericRange `xml:"vlanIds,omitempty"` + TrunkingMode *bool `xml:"trunkingMode"` + Mtu int32 `xml:"mtu,omitempty"` + LinkPeer string `xml:"linkPeer,omitempty"` + MacAddress string `xml:"macAddress,omitempty"` + StatusDetail string `xml:"statusDetail,omitempty"` + VmDirectPathGen2Active *bool `xml:"vmDirectPathGen2Active"` + VmDirectPathGen2InactiveReasonNetwork []string `xml:"vmDirectPathGen2InactiveReasonNetwork,omitempty"` + VmDirectPathGen2InactiveReasonOther []string `xml:"vmDirectPathGen2InactiveReasonOther,omitempty"` + VmDirectPathGen2InactiveReasonExtended string `xml:"vmDirectPathGen2InactiveReasonExtended,omitempty"` +} + +func init() { + t["DVPortStatus"] = reflect.TypeOf((*DVPortStatus)(nil)).Elem() +} + +type DVPortgroupConfigInfo struct { + DynamicData + + Key string `xml:"key"` + Name string `xml:"name"` + NumPorts int32 `xml:"numPorts"` + DistributedVirtualSwitch *ManagedObjectReference `xml:"distributedVirtualSwitch,omitempty"` + DefaultPortConfig BaseDVPortSetting `xml:"defaultPortConfig,omitempty,typeattr"` + Description string `xml:"description,omitempty"` + Type string `xml:"type"` + Policy BaseDVPortgroupPolicy `xml:"policy,typeattr"` + PortNameFormat string `xml:"portNameFormat,omitempty"` + Scope []ManagedObjectReference `xml:"scope,omitempty"` + VendorSpecificConfig []DistributedVirtualSwitchKeyedOpaqueBlob `xml:"vendorSpecificConfig,omitempty"` + ConfigVersion string `xml:"configVersion,omitempty"` + AutoExpand *bool `xml:"autoExpand"` + VmVnicNetworkResourcePoolKey string `xml:"vmVnicNetworkResourcePoolKey,omitempty"` +} + +func init() { + t["DVPortgroupConfigInfo"] = reflect.TypeOf((*DVPortgroupConfigInfo)(nil)).Elem() +} + +type DVPortgroupConfigSpec struct { + DynamicData + + ConfigVersion string `xml:"configVersion,omitempty"` + Name string `xml:"name,omitempty"` + NumPorts int32 `xml:"numPorts,omitempty"` + PortNameFormat string `xml:"portNameFormat,omitempty"` + DefaultPortConfig BaseDVPortSetting `xml:"defaultPortConfig,omitempty,typeattr"` + Description string `xml:"description,omitempty"` + Type string `xml:"type,omitempty"` + Scope []ManagedObjectReference `xml:"scope,omitempty"` + Policy BaseDVPortgroupPolicy `xml:"policy,omitempty,typeattr"` + VendorSpecificConfig []DistributedVirtualSwitchKeyedOpaqueBlob `xml:"vendorSpecificConfig,omitempty"` + AutoExpand *bool `xml:"autoExpand"` + VmVnicNetworkResourcePoolKey string `xml:"vmVnicNetworkResourcePoolKey,omitempty"` +} + +func init() { + t["DVPortgroupConfigSpec"] = reflect.TypeOf((*DVPortgroupConfigSpec)(nil)).Elem() +} + +type DVPortgroupCreatedEvent struct { + DVPortgroupEvent +} + +func init() { + t["DVPortgroupCreatedEvent"] = reflect.TypeOf((*DVPortgroupCreatedEvent)(nil)).Elem() +} + +type DVPortgroupDestroyedEvent struct { + DVPortgroupEvent +} + +func init() { + t["DVPortgroupDestroyedEvent"] = reflect.TypeOf((*DVPortgroupDestroyedEvent)(nil)).Elem() +} + +type DVPortgroupEvent struct { + Event +} + +func init() { + t["DVPortgroupEvent"] = reflect.TypeOf((*DVPortgroupEvent)(nil)).Elem() +} + +type DVPortgroupPolicy struct { + DynamicData + + BlockOverrideAllowed bool `xml:"blockOverrideAllowed"` + ShapingOverrideAllowed bool `xml:"shapingOverrideAllowed"` + VendorConfigOverrideAllowed bool `xml:"vendorConfigOverrideAllowed"` + LivePortMovingAllowed bool `xml:"livePortMovingAllowed"` + PortConfigResetAtDisconnect bool `xml:"portConfigResetAtDisconnect"` + NetworkResourcePoolOverrideAllowed *bool `xml:"networkResourcePoolOverrideAllowed"` + TrafficFilterOverrideAllowed *bool `xml:"trafficFilterOverrideAllowed"` +} + +func init() { + t["DVPortgroupPolicy"] = reflect.TypeOf((*DVPortgroupPolicy)(nil)).Elem() +} + +type DVPortgroupReconfiguredEvent struct { + DVPortgroupEvent + + ConfigSpec DVPortgroupConfigSpec `xml:"configSpec"` +} + +func init() { + t["DVPortgroupReconfiguredEvent"] = reflect.TypeOf((*DVPortgroupReconfiguredEvent)(nil)).Elem() +} + +type DVPortgroupRenamedEvent struct { + DVPortgroupEvent + + OldName string `xml:"oldName"` + NewName string `xml:"newName"` +} + +func init() { + t["DVPortgroupRenamedEvent"] = reflect.TypeOf((*DVPortgroupRenamedEvent)(nil)).Elem() +} + +type DVPortgroupRollbackRequestType struct { + This ManagedObjectReference `xml:"_this"` + EntityBackup *EntityBackupConfig `xml:"entityBackup,omitempty"` +} + +func init() { + t["DVPortgroupRollbackRequestType"] = reflect.TypeOf((*DVPortgroupRollbackRequestType)(nil)).Elem() +} + +type DVPortgroupRollback_Task DVPortgroupRollbackRequestType + +func init() { + t["DVPortgroupRollback_Task"] = reflect.TypeOf((*DVPortgroupRollback_Task)(nil)).Elem() +} + +type DVPortgroupRollback_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type DVPortgroupSelection struct { + SelectionSet + + DvsUuid string `xml:"dvsUuid"` + PortgroupKey []string `xml:"portgroupKey"` +} + +func init() { + t["DVPortgroupSelection"] = reflect.TypeOf((*DVPortgroupSelection)(nil)).Elem() +} + +type DVSBackupRestoreCapability struct { + DynamicData + + BackupRestoreSupported bool `xml:"backupRestoreSupported"` +} + +func init() { + t["DVSBackupRestoreCapability"] = reflect.TypeOf((*DVSBackupRestoreCapability)(nil)).Elem() +} + +type DVSCapability struct { + DynamicData + + DvsOperationSupported *bool `xml:"dvsOperationSupported"` + DvPortGroupOperationSupported *bool `xml:"dvPortGroupOperationSupported"` + DvPortOperationSupported *bool `xml:"dvPortOperationSupported"` + CompatibleHostComponentProductInfo []DistributedVirtualSwitchHostProductSpec `xml:"compatibleHostComponentProductInfo,omitempty"` + FeaturesSupported BaseDVSFeatureCapability `xml:"featuresSupported,omitempty,typeattr"` +} + +func init() { + t["DVSCapability"] = reflect.TypeOf((*DVSCapability)(nil)).Elem() +} + +type DVSConfigInfo struct { + DynamicData + + Uuid string `xml:"uuid"` + Name string `xml:"name"` + NumStandalonePorts int32 `xml:"numStandalonePorts"` + NumPorts int32 `xml:"numPorts"` + MaxPorts int32 `xml:"maxPorts"` + UplinkPortPolicy BaseDVSUplinkPortPolicy `xml:"uplinkPortPolicy,typeattr"` + UplinkPortgroup []ManagedObjectReference `xml:"uplinkPortgroup,omitempty"` + DefaultPortConfig BaseDVPortSetting `xml:"defaultPortConfig,typeattr"` + Host []DistributedVirtualSwitchHostMember `xml:"host,omitempty"` + ProductInfo DistributedVirtualSwitchProductSpec `xml:"productInfo"` + TargetInfo *DistributedVirtualSwitchProductSpec `xml:"targetInfo,omitempty"` + ExtensionKey string `xml:"extensionKey,omitempty"` + VendorSpecificConfig []DistributedVirtualSwitchKeyedOpaqueBlob `xml:"vendorSpecificConfig,omitempty"` + Policy *DVSPolicy `xml:"policy,omitempty"` + Description string `xml:"description,omitempty"` + ConfigVersion string `xml:"configVersion"` + Contact DVSContactInfo `xml:"contact"` + SwitchIpAddress string `xml:"switchIpAddress,omitempty"` + CreateTime time.Time `xml:"createTime"` + NetworkResourceManagementEnabled *bool `xml:"networkResourceManagementEnabled"` + DefaultProxySwitchMaxNumPorts int32 `xml:"defaultProxySwitchMaxNumPorts,omitempty"` + HealthCheckConfig []BaseDVSHealthCheckConfig `xml:"healthCheckConfig,omitempty,typeattr"` + InfrastructureTrafficResourceConfig []DvsHostInfrastructureTrafficResource `xml:"infrastructureTrafficResourceConfig,omitempty"` + NetworkResourceControlVersion string `xml:"networkResourceControlVersion,omitempty"` + VmVnicNetworkResourcePool []DVSVmVnicNetworkResourcePool `xml:"vmVnicNetworkResourcePool,omitempty"` + PnicCapacityRatioForReservation int32 `xml:"pnicCapacityRatioForReservation,omitempty"` +} + +func init() { + t["DVSConfigInfo"] = reflect.TypeOf((*DVSConfigInfo)(nil)).Elem() +} + +type DVSConfigSpec struct { + DynamicData + + ConfigVersion string `xml:"configVersion,omitempty"` + Name string `xml:"name,omitempty"` + NumStandalonePorts int32 `xml:"numStandalonePorts,omitempty"` + MaxPorts int32 `xml:"maxPorts,omitempty"` + UplinkPortPolicy BaseDVSUplinkPortPolicy `xml:"uplinkPortPolicy,omitempty,typeattr"` + UplinkPortgroup []ManagedObjectReference `xml:"uplinkPortgroup,omitempty"` + DefaultPortConfig BaseDVPortSetting `xml:"defaultPortConfig,omitempty,typeattr"` + Host []DistributedVirtualSwitchHostMemberConfigSpec `xml:"host,omitempty"` + ExtensionKey string `xml:"extensionKey,omitempty"` + Description string `xml:"description,omitempty"` + Policy *DVSPolicy `xml:"policy,omitempty"` + VendorSpecificConfig []DistributedVirtualSwitchKeyedOpaqueBlob `xml:"vendorSpecificConfig,omitempty"` + Contact *DVSContactInfo `xml:"contact,omitempty"` + SwitchIpAddress string `xml:"switchIpAddress,omitempty"` + DefaultProxySwitchMaxNumPorts int32 `xml:"defaultProxySwitchMaxNumPorts,omitempty"` + InfrastructureTrafficResourceConfig []DvsHostInfrastructureTrafficResource `xml:"infrastructureTrafficResourceConfig,omitempty"` + NetworkResourceControlVersion string `xml:"networkResourceControlVersion,omitempty"` +} + +func init() { + t["DVSConfigSpec"] = reflect.TypeOf((*DVSConfigSpec)(nil)).Elem() +} + +type DVSContactInfo struct { + DynamicData + + Name string `xml:"name,omitempty"` + Contact string `xml:"contact,omitempty"` +} + +func init() { + t["DVSContactInfo"] = reflect.TypeOf((*DVSContactInfo)(nil)).Elem() +} + +type DVSCreateSpec struct { + DynamicData + + ConfigSpec BaseDVSConfigSpec `xml:"configSpec,typeattr"` + ProductInfo *DistributedVirtualSwitchProductSpec `xml:"productInfo,omitempty"` + Capability *DVSCapability `xml:"capability,omitempty"` +} + +func init() { + t["DVSCreateSpec"] = reflect.TypeOf((*DVSCreateSpec)(nil)).Elem() +} + +type DVSFailureCriteria struct { + InheritablePolicy + + CheckSpeed *StringPolicy `xml:"checkSpeed,omitempty"` + Speed *IntPolicy `xml:"speed,omitempty"` + CheckDuplex *BoolPolicy `xml:"checkDuplex,omitempty"` + FullDuplex *BoolPolicy `xml:"fullDuplex,omitempty"` + CheckErrorPercent *BoolPolicy `xml:"checkErrorPercent,omitempty"` + Percentage *IntPolicy `xml:"percentage,omitempty"` + CheckBeacon *BoolPolicy `xml:"checkBeacon,omitempty"` +} + +func init() { + t["DVSFailureCriteria"] = reflect.TypeOf((*DVSFailureCriteria)(nil)).Elem() +} + +type DVSFeatureCapability struct { + DynamicData + + NetworkResourceManagementSupported bool `xml:"networkResourceManagementSupported"` + VmDirectPathGen2Supported bool `xml:"vmDirectPathGen2Supported"` + NicTeamingPolicy []string `xml:"nicTeamingPolicy,omitempty"` + NetworkResourcePoolHighShareValue int32 `xml:"networkResourcePoolHighShareValue,omitempty"` + NetworkResourceManagementCapability *DVSNetworkResourceManagementCapability `xml:"networkResourceManagementCapability,omitempty"` + HealthCheckCapability BaseDVSHealthCheckCapability `xml:"healthCheckCapability,omitempty,typeattr"` + RollbackCapability *DVSRollbackCapability `xml:"rollbackCapability,omitempty"` + BackupRestoreCapability *DVSBackupRestoreCapability `xml:"backupRestoreCapability,omitempty"` + NetworkFilterSupported *bool `xml:"networkFilterSupported"` +} + +func init() { + t["DVSFeatureCapability"] = reflect.TypeOf((*DVSFeatureCapability)(nil)).Elem() +} + +type DVSHealthCheckCapability struct { + DynamicData +} + +func init() { + t["DVSHealthCheckCapability"] = reflect.TypeOf((*DVSHealthCheckCapability)(nil)).Elem() +} + +type DVSHealthCheckConfig struct { + DynamicData + + Enable *bool `xml:"enable"` + Interval int32 `xml:"interval,omitempty"` +} + +func init() { + t["DVSHealthCheckConfig"] = reflect.TypeOf((*DVSHealthCheckConfig)(nil)).Elem() +} + +type DVSHostLocalPortInfo struct { + DynamicData + + SwitchUuid string `xml:"switchUuid"` + PortKey string `xml:"portKey"` + Setting BaseDVPortSetting `xml:"setting,typeattr"` + Vnic string `xml:"vnic"` +} + +func init() { + t["DVSHostLocalPortInfo"] = reflect.TypeOf((*DVSHostLocalPortInfo)(nil)).Elem() +} + +type DVSManagerDvsConfigTarget struct { + DynamicData + + DistributedVirtualPortgroup []DistributedVirtualPortgroupInfo `xml:"distributedVirtualPortgroup,omitempty"` + DistributedVirtualSwitch []DistributedVirtualSwitchInfo `xml:"distributedVirtualSwitch,omitempty"` +} + +func init() { + t["DVSManagerDvsConfigTarget"] = reflect.TypeOf((*DVSManagerDvsConfigTarget)(nil)).Elem() +} + +type DVSManagerExportEntityRequestType struct { + This ManagedObjectReference `xml:"_this"` + SelectionSet []BaseSelectionSet `xml:"selectionSet,typeattr"` +} + +func init() { + t["DVSManagerExportEntityRequestType"] = reflect.TypeOf((*DVSManagerExportEntityRequestType)(nil)).Elem() +} + +type DVSManagerExportEntity_Task DVSManagerExportEntityRequestType + +func init() { + t["DVSManagerExportEntity_Task"] = reflect.TypeOf((*DVSManagerExportEntity_Task)(nil)).Elem() +} + +type DVSManagerExportEntity_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type DVSManagerImportEntityRequestType struct { + This ManagedObjectReference `xml:"_this"` + EntityBackup []EntityBackupConfig `xml:"entityBackup"` + ImportType string `xml:"importType"` +} + +func init() { + t["DVSManagerImportEntityRequestType"] = reflect.TypeOf((*DVSManagerImportEntityRequestType)(nil)).Elem() +} + +type DVSManagerImportEntity_Task DVSManagerImportEntityRequestType + +func init() { + t["DVSManagerImportEntity_Task"] = reflect.TypeOf((*DVSManagerImportEntity_Task)(nil)).Elem() +} + +type DVSManagerImportEntity_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type DVSManagerLookupDvPortGroup DVSManagerLookupDvPortGroupRequestType + +func init() { + t["DVSManagerLookupDvPortGroup"] = reflect.TypeOf((*DVSManagerLookupDvPortGroup)(nil)).Elem() +} + +type DVSManagerLookupDvPortGroupRequestType struct { + This ManagedObjectReference `xml:"_this"` + SwitchUuid string `xml:"switchUuid"` + PortgroupKey string `xml:"portgroupKey"` +} + +func init() { + t["DVSManagerLookupDvPortGroupRequestType"] = reflect.TypeOf((*DVSManagerLookupDvPortGroupRequestType)(nil)).Elem() +} + +type DVSManagerLookupDvPortGroupResponse struct { + Returnval *ManagedObjectReference `xml:"returnval,omitempty"` +} + +type DVSNameArrayUplinkPortPolicy struct { + DVSUplinkPortPolicy + + UplinkPortName []string `xml:"uplinkPortName"` +} + +func init() { + t["DVSNameArrayUplinkPortPolicy"] = reflect.TypeOf((*DVSNameArrayUplinkPortPolicy)(nil)).Elem() +} + +type DVSNetworkResourceManagementCapability struct { + DynamicData + + NetworkResourceManagementSupported bool `xml:"networkResourceManagementSupported"` + NetworkResourcePoolHighShareValue int32 `xml:"networkResourcePoolHighShareValue"` + QosSupported bool `xml:"qosSupported"` + UserDefinedNetworkResourcePoolsSupported bool `xml:"userDefinedNetworkResourcePoolsSupported"` + NetworkResourceControlVersion3Supported *bool `xml:"networkResourceControlVersion3Supported"` +} + +func init() { + t["DVSNetworkResourceManagementCapability"] = reflect.TypeOf((*DVSNetworkResourceManagementCapability)(nil)).Elem() +} + +type DVSNetworkResourcePool struct { + DynamicData + + Key string `xml:"key"` + Name string `xml:"name,omitempty"` + Description string `xml:"description,omitempty"` + ConfigVersion string `xml:"configVersion"` + AllocationInfo DVSNetworkResourcePoolAllocationInfo `xml:"allocationInfo"` +} + +func init() { + t["DVSNetworkResourcePool"] = reflect.TypeOf((*DVSNetworkResourcePool)(nil)).Elem() +} + +type DVSNetworkResourcePoolAllocationInfo struct { + DynamicData + + Limit int64 `xml:"limit,omitempty"` + Shares *SharesInfo `xml:"shares,omitempty"` + PriorityTag int32 `xml:"priorityTag,omitempty"` +} + +func init() { + t["DVSNetworkResourcePoolAllocationInfo"] = reflect.TypeOf((*DVSNetworkResourcePoolAllocationInfo)(nil)).Elem() +} + +type DVSNetworkResourcePoolConfigSpec struct { + DynamicData + + Key string `xml:"key"` + ConfigVersion string `xml:"configVersion,omitempty"` + AllocationInfo *DVSNetworkResourcePoolAllocationInfo `xml:"allocationInfo,omitempty"` + Name string `xml:"name,omitempty"` + Description string `xml:"description,omitempty"` +} + +func init() { + t["DVSNetworkResourcePoolConfigSpec"] = reflect.TypeOf((*DVSNetworkResourcePoolConfigSpec)(nil)).Elem() +} + +type DVSPolicy struct { + DynamicData + + AutoPreInstallAllowed *bool `xml:"autoPreInstallAllowed"` + AutoUpgradeAllowed *bool `xml:"autoUpgradeAllowed"` + PartialUpgradeAllowed *bool `xml:"partialUpgradeAllowed"` +} + +func init() { + t["DVSPolicy"] = reflect.TypeOf((*DVSPolicy)(nil)).Elem() +} + +type DVSRollbackCapability struct { + DynamicData + + RollbackSupported bool `xml:"rollbackSupported"` +} + +func init() { + t["DVSRollbackCapability"] = reflect.TypeOf((*DVSRollbackCapability)(nil)).Elem() +} + +type DVSRollbackRequestType struct { + This ManagedObjectReference `xml:"_this"` + EntityBackup *EntityBackupConfig `xml:"entityBackup,omitempty"` +} + +func init() { + t["DVSRollbackRequestType"] = reflect.TypeOf((*DVSRollbackRequestType)(nil)).Elem() +} + +type DVSRollback_Task DVSRollbackRequestType + +func init() { + t["DVSRollback_Task"] = reflect.TypeOf((*DVSRollback_Task)(nil)).Elem() +} + +type DVSRollback_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type DVSRuntimeInfo struct { + DynamicData + + HostMemberRuntime []HostMemberRuntimeInfo `xml:"hostMemberRuntime,omitempty"` + ResourceRuntimeInfo *DvsResourceRuntimeInfo `xml:"resourceRuntimeInfo,omitempty"` +} + +func init() { + t["DVSRuntimeInfo"] = reflect.TypeOf((*DVSRuntimeInfo)(nil)).Elem() +} + +type DVSSecurityPolicy struct { + InheritablePolicy + + AllowPromiscuous *BoolPolicy `xml:"allowPromiscuous,omitempty"` + MacChanges *BoolPolicy `xml:"macChanges,omitempty"` + ForgedTransmits *BoolPolicy `xml:"forgedTransmits,omitempty"` +} + +func init() { + t["DVSSecurityPolicy"] = reflect.TypeOf((*DVSSecurityPolicy)(nil)).Elem() +} + +type DVSSelection struct { + SelectionSet + + DvsUuid string `xml:"dvsUuid"` +} + +func init() { + t["DVSSelection"] = reflect.TypeOf((*DVSSelection)(nil)).Elem() +} + +type DVSSummary struct { + DynamicData + + Name string `xml:"name"` + Uuid string `xml:"uuid"` + NumPorts int32 `xml:"numPorts"` + ProductInfo *DistributedVirtualSwitchProductSpec `xml:"productInfo,omitempty"` + HostMember []ManagedObjectReference `xml:"hostMember,omitempty"` + Vm []ManagedObjectReference `xml:"vm,omitempty"` + Host []ManagedObjectReference `xml:"host,omitempty"` + PortgroupName []string `xml:"portgroupName,omitempty"` + Description string `xml:"description,omitempty"` + Contact *DVSContactInfo `xml:"contact,omitempty"` + NumHosts int32 `xml:"numHosts,omitempty"` +} + +func init() { + t["DVSSummary"] = reflect.TypeOf((*DVSSummary)(nil)).Elem() +} + +type DVSTrafficShapingPolicy struct { + InheritablePolicy + + Enabled *BoolPolicy `xml:"enabled,omitempty"` + AverageBandwidth *LongPolicy `xml:"averageBandwidth,omitempty"` + PeakBandwidth *LongPolicy `xml:"peakBandwidth,omitempty"` + BurstSize *LongPolicy `xml:"burstSize,omitempty"` +} + +func init() { + t["DVSTrafficShapingPolicy"] = reflect.TypeOf((*DVSTrafficShapingPolicy)(nil)).Elem() +} + +type DVSUplinkPortPolicy struct { + DynamicData +} + +func init() { + t["DVSUplinkPortPolicy"] = reflect.TypeOf((*DVSUplinkPortPolicy)(nil)).Elem() +} + +type DVSVendorSpecificConfig struct { + InheritablePolicy + + KeyValue []DistributedVirtualSwitchKeyedOpaqueBlob `xml:"keyValue,omitempty"` +} + +func init() { + t["DVSVendorSpecificConfig"] = reflect.TypeOf((*DVSVendorSpecificConfig)(nil)).Elem() +} + +type DVSVmVnicNetworkResourcePool struct { + DynamicData + + Key string `xml:"key"` + Name string `xml:"name,omitempty"` + Description string `xml:"description,omitempty"` + ConfigVersion string `xml:"configVersion"` + AllocationInfo *DvsVmVnicResourceAllocation `xml:"allocationInfo,omitempty"` +} + +func init() { + t["DVSVmVnicNetworkResourcePool"] = reflect.TypeOf((*DVSVmVnicNetworkResourcePool)(nil)).Elem() +} + +type DailyTaskScheduler struct { + HourlyTaskScheduler + + Hour int32 `xml:"hour"` +} + +func init() { + t["DailyTaskScheduler"] = reflect.TypeOf((*DailyTaskScheduler)(nil)).Elem() +} + +type DasAdmissionControlDisabledEvent struct { + ClusterEvent +} + +func init() { + t["DasAdmissionControlDisabledEvent"] = reflect.TypeOf((*DasAdmissionControlDisabledEvent)(nil)).Elem() +} + +type DasAdmissionControlEnabledEvent struct { + ClusterEvent +} + +func init() { + t["DasAdmissionControlEnabledEvent"] = reflect.TypeOf((*DasAdmissionControlEnabledEvent)(nil)).Elem() +} + +type DasAgentFoundEvent struct { + ClusterEvent +} + +func init() { + t["DasAgentFoundEvent"] = reflect.TypeOf((*DasAgentFoundEvent)(nil)).Elem() +} + +type DasAgentUnavailableEvent struct { + ClusterEvent +} + +func init() { + t["DasAgentUnavailableEvent"] = reflect.TypeOf((*DasAgentUnavailableEvent)(nil)).Elem() +} + +type DasClusterIsolatedEvent struct { + ClusterEvent +} + +func init() { + t["DasClusterIsolatedEvent"] = reflect.TypeOf((*DasClusterIsolatedEvent)(nil)).Elem() +} + +type DasConfigFault struct { + VimFault + + Reason string `xml:"reason,omitempty"` + Output string `xml:"output,omitempty"` + Event []BaseEvent `xml:"event,omitempty,typeattr"` +} + +func init() { + t["DasConfigFault"] = reflect.TypeOf((*DasConfigFault)(nil)).Elem() +} + +type DasConfigFaultFault DasConfigFault + +func init() { + t["DasConfigFaultFault"] = reflect.TypeOf((*DasConfigFaultFault)(nil)).Elem() +} + +type DasDisabledEvent struct { + ClusterEvent +} + +func init() { + t["DasDisabledEvent"] = reflect.TypeOf((*DasDisabledEvent)(nil)).Elem() +} + +type DasEnabledEvent struct { + ClusterEvent +} + +func init() { + t["DasEnabledEvent"] = reflect.TypeOf((*DasEnabledEvent)(nil)).Elem() +} + +type DasHeartbeatDatastoreInfo struct { + DynamicData + + Datastore ManagedObjectReference `xml:"datastore"` + Hosts []ManagedObjectReference `xml:"hosts"` +} + +func init() { + t["DasHeartbeatDatastoreInfo"] = reflect.TypeOf((*DasHeartbeatDatastoreInfo)(nil)).Elem() +} + +type DasHostFailedEvent struct { + ClusterEvent + + FailedHost HostEventArgument `xml:"failedHost"` +} + +func init() { + t["DasHostFailedEvent"] = reflect.TypeOf((*DasHostFailedEvent)(nil)).Elem() +} + +type DasHostIsolatedEvent struct { + ClusterEvent + + IsolatedHost HostEventArgument `xml:"isolatedHost"` +} + +func init() { + t["DasHostIsolatedEvent"] = reflect.TypeOf((*DasHostIsolatedEvent)(nil)).Elem() +} + +type DatabaseError struct { + RuntimeFault +} + +func init() { + t["DatabaseError"] = reflect.TypeOf((*DatabaseError)(nil)).Elem() +} + +type DatabaseErrorFault DatabaseError + +func init() { + t["DatabaseErrorFault"] = reflect.TypeOf((*DatabaseErrorFault)(nil)).Elem() +} + +type DatabaseSizeEstimate struct { + DynamicData + + Size int64 `xml:"size"` +} + +func init() { + t["DatabaseSizeEstimate"] = reflect.TypeOf((*DatabaseSizeEstimate)(nil)).Elem() +} + +type DatabaseSizeParam struct { + DynamicData + + InventoryDesc InventoryDescription `xml:"inventoryDesc"` + PerfStatsDesc *PerformanceStatisticsDescription `xml:"perfStatsDesc,omitempty"` +} + +func init() { + t["DatabaseSizeParam"] = reflect.TypeOf((*DatabaseSizeParam)(nil)).Elem() +} + +type DatacenterConfigInfo struct { + DynamicData + + DefaultHardwareVersionKey string `xml:"defaultHardwareVersionKey,omitempty"` +} + +func init() { + t["DatacenterConfigInfo"] = reflect.TypeOf((*DatacenterConfigInfo)(nil)).Elem() +} + +type DatacenterConfigSpec struct { + DynamicData + + DefaultHardwareVersionKey string `xml:"defaultHardwareVersionKey,omitempty"` +} + +func init() { + t["DatacenterConfigSpec"] = reflect.TypeOf((*DatacenterConfigSpec)(nil)).Elem() +} + +type DatacenterCreatedEvent struct { + DatacenterEvent + + Parent FolderEventArgument `xml:"parent"` +} + +func init() { + t["DatacenterCreatedEvent"] = reflect.TypeOf((*DatacenterCreatedEvent)(nil)).Elem() +} + +type DatacenterEvent struct { + Event +} + +func init() { + t["DatacenterEvent"] = reflect.TypeOf((*DatacenterEvent)(nil)).Elem() +} + +type DatacenterEventArgument struct { + EntityEventArgument + + Datacenter ManagedObjectReference `xml:"datacenter"` +} + +func init() { + t["DatacenterEventArgument"] = reflect.TypeOf((*DatacenterEventArgument)(nil)).Elem() +} + +type DatacenterMismatch struct { + MigrationFault + + InvalidArgument []DatacenterMismatchArgument `xml:"invalidArgument"` + ExpectedDatacenter ManagedObjectReference `xml:"expectedDatacenter"` +} + +func init() { + t["DatacenterMismatch"] = reflect.TypeOf((*DatacenterMismatch)(nil)).Elem() +} + +type DatacenterMismatchArgument struct { + DynamicData + + Entity ManagedObjectReference `xml:"entity"` + InputDatacenter *ManagedObjectReference `xml:"inputDatacenter,omitempty"` +} + +func init() { + t["DatacenterMismatchArgument"] = reflect.TypeOf((*DatacenterMismatchArgument)(nil)).Elem() +} + +type DatacenterMismatchFault DatacenterMismatch + +func init() { + t["DatacenterMismatchFault"] = reflect.TypeOf((*DatacenterMismatchFault)(nil)).Elem() +} + +type DatacenterRenamedEvent struct { + DatacenterEvent + + OldName string `xml:"oldName"` + NewName string `xml:"newName"` +} + +func init() { + t["DatacenterRenamedEvent"] = reflect.TypeOf((*DatacenterRenamedEvent)(nil)).Elem() +} + +type DatastoreCapability struct { + DynamicData + + DirectoryHierarchySupported bool `xml:"directoryHierarchySupported"` + RawDiskMappingsSupported bool `xml:"rawDiskMappingsSupported"` + PerFileThinProvisioningSupported bool `xml:"perFileThinProvisioningSupported"` + StorageIORMSupported *bool `xml:"storageIORMSupported"` + NativeSnapshotSupported *bool `xml:"nativeSnapshotSupported"` + TopLevelDirectoryCreateSupported *bool `xml:"topLevelDirectoryCreateSupported"` + SeSparseSupported *bool `xml:"seSparseSupported"` +} + +func init() { + t["DatastoreCapability"] = reflect.TypeOf((*DatastoreCapability)(nil)).Elem() +} + +type DatastoreCapacityIncreasedEvent struct { + DatastoreEvent + + OldCapacity int64 `xml:"oldCapacity"` + NewCapacity int64 `xml:"newCapacity"` +} + +func init() { + t["DatastoreCapacityIncreasedEvent"] = reflect.TypeOf((*DatastoreCapacityIncreasedEvent)(nil)).Elem() +} + +type DatastoreDestroyedEvent struct { + DatastoreEvent +} + +func init() { + t["DatastoreDestroyedEvent"] = reflect.TypeOf((*DatastoreDestroyedEvent)(nil)).Elem() +} + +type DatastoreDiscoveredEvent struct { + HostEvent + + Datastore DatastoreEventArgument `xml:"datastore"` +} + +func init() { + t["DatastoreDiscoveredEvent"] = reflect.TypeOf((*DatastoreDiscoveredEvent)(nil)).Elem() +} + +type DatastoreDuplicatedEvent struct { + DatastoreEvent +} + +func init() { + t["DatastoreDuplicatedEvent"] = reflect.TypeOf((*DatastoreDuplicatedEvent)(nil)).Elem() +} + +type DatastoreEnterMaintenanceMode DatastoreEnterMaintenanceModeRequestType + +func init() { + t["DatastoreEnterMaintenanceMode"] = reflect.TypeOf((*DatastoreEnterMaintenanceMode)(nil)).Elem() +} + +type DatastoreEnterMaintenanceModeRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["DatastoreEnterMaintenanceModeRequestType"] = reflect.TypeOf((*DatastoreEnterMaintenanceModeRequestType)(nil)).Elem() +} + +type DatastoreEnterMaintenanceModeResponse struct { + Returnval StoragePlacementResult `xml:"returnval"` +} + +type DatastoreEvent struct { + Event + + Datastore *DatastoreEventArgument `xml:"datastore,omitempty"` +} + +func init() { + t["DatastoreEvent"] = reflect.TypeOf((*DatastoreEvent)(nil)).Elem() +} + +type DatastoreEventArgument struct { + EntityEventArgument + + Datastore ManagedObjectReference `xml:"datastore"` +} + +func init() { + t["DatastoreEventArgument"] = reflect.TypeOf((*DatastoreEventArgument)(nil)).Elem() +} + +type DatastoreExitMaintenanceModeRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["DatastoreExitMaintenanceModeRequestType"] = reflect.TypeOf((*DatastoreExitMaintenanceModeRequestType)(nil)).Elem() +} + +type DatastoreExitMaintenanceMode_Task DatastoreExitMaintenanceModeRequestType + +func init() { + t["DatastoreExitMaintenanceMode_Task"] = reflect.TypeOf((*DatastoreExitMaintenanceMode_Task)(nil)).Elem() +} + +type DatastoreExitMaintenanceMode_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type DatastoreFileCopiedEvent struct { + DatastoreFileEvent + + SourceDatastore DatastoreEventArgument `xml:"sourceDatastore"` + SourceFile string `xml:"sourceFile"` +} + +func init() { + t["DatastoreFileCopiedEvent"] = reflect.TypeOf((*DatastoreFileCopiedEvent)(nil)).Elem() +} + +type DatastoreFileDeletedEvent struct { + DatastoreFileEvent +} + +func init() { + t["DatastoreFileDeletedEvent"] = reflect.TypeOf((*DatastoreFileDeletedEvent)(nil)).Elem() +} + +type DatastoreFileEvent struct { + DatastoreEvent + + TargetFile string `xml:"targetFile"` +} + +func init() { + t["DatastoreFileEvent"] = reflect.TypeOf((*DatastoreFileEvent)(nil)).Elem() +} + +type DatastoreFileMovedEvent struct { + DatastoreFileEvent + + SourceDatastore DatastoreEventArgument `xml:"sourceDatastore"` + SourceFile string `xml:"sourceFile"` +} + +func init() { + t["DatastoreFileMovedEvent"] = reflect.TypeOf((*DatastoreFileMovedEvent)(nil)).Elem() +} + +type DatastoreHostMount struct { + DynamicData + + Key ManagedObjectReference `xml:"key"` + MountInfo HostMountInfo `xml:"mountInfo"` +} + +func init() { + t["DatastoreHostMount"] = reflect.TypeOf((*DatastoreHostMount)(nil)).Elem() +} + +type DatastoreIORMReconfiguredEvent struct { + DatastoreEvent +} + +func init() { + t["DatastoreIORMReconfiguredEvent"] = reflect.TypeOf((*DatastoreIORMReconfiguredEvent)(nil)).Elem() +} + +type DatastoreInfo struct { + DynamicData + + Name string `xml:"name"` + Url string `xml:"url"` + FreeSpace int64 `xml:"freeSpace"` + MaxFileSize int64 `xml:"maxFileSize"` + MaxVirtualDiskCapacity int64 `xml:"maxVirtualDiskCapacity,omitempty"` + MaxMemoryFileSize int64 `xml:"maxMemoryFileSize,omitempty"` + Timestamp *time.Time `xml:"timestamp"` + ContainerId string `xml:"containerId,omitempty"` +} + +func init() { + t["DatastoreInfo"] = reflect.TypeOf((*DatastoreInfo)(nil)).Elem() +} + +type DatastoreMountPathDatastorePair struct { + DynamicData + + OldMountPath string `xml:"oldMountPath"` + Datastore ManagedObjectReference `xml:"datastore"` +} + +func init() { + t["DatastoreMountPathDatastorePair"] = reflect.TypeOf((*DatastoreMountPathDatastorePair)(nil)).Elem() +} + +type DatastoreNotWritableOnHost struct { + InvalidDatastore + + Host ManagedObjectReference `xml:"host"` +} + +func init() { + t["DatastoreNotWritableOnHost"] = reflect.TypeOf((*DatastoreNotWritableOnHost)(nil)).Elem() +} + +type DatastoreNotWritableOnHostFault BaseDatastoreNotWritableOnHost + +func init() { + t["DatastoreNotWritableOnHostFault"] = reflect.TypeOf((*DatastoreNotWritableOnHostFault)(nil)).Elem() +} + +type DatastoreOption struct { + DynamicData + + UnsupportedVolumes []VirtualMachineDatastoreVolumeOption `xml:"unsupportedVolumes,omitempty"` +} + +func init() { + t["DatastoreOption"] = reflect.TypeOf((*DatastoreOption)(nil)).Elem() +} + +type DatastorePrincipalConfigured struct { + HostEvent + + DatastorePrincipal string `xml:"datastorePrincipal"` +} + +func init() { + t["DatastorePrincipalConfigured"] = reflect.TypeOf((*DatastorePrincipalConfigured)(nil)).Elem() +} + +type DatastoreRemovedOnHostEvent struct { + HostEvent + + Datastore DatastoreEventArgument `xml:"datastore"` +} + +func init() { + t["DatastoreRemovedOnHostEvent"] = reflect.TypeOf((*DatastoreRemovedOnHostEvent)(nil)).Elem() +} + +type DatastoreRenamedEvent struct { + DatastoreEvent + + OldName string `xml:"oldName"` + NewName string `xml:"newName"` +} + +func init() { + t["DatastoreRenamedEvent"] = reflect.TypeOf((*DatastoreRenamedEvent)(nil)).Elem() +} + +type DatastoreRenamedOnHostEvent struct { + HostEvent + + OldName string `xml:"oldName"` + NewName string `xml:"newName"` +} + +func init() { + t["DatastoreRenamedOnHostEvent"] = reflect.TypeOf((*DatastoreRenamedOnHostEvent)(nil)).Elem() +} + +type DatastoreSummary struct { + DynamicData + + Datastore *ManagedObjectReference `xml:"datastore,omitempty"` + Name string `xml:"name"` + Url string `xml:"url"` + Capacity int64 `xml:"capacity"` + FreeSpace int64 `xml:"freeSpace"` + Uncommitted int64 `xml:"uncommitted,omitempty"` + Accessible bool `xml:"accessible"` + MultipleHostAccess *bool `xml:"multipleHostAccess"` + Type string `xml:"type"` + MaintenanceMode string `xml:"maintenanceMode,omitempty"` +} + +func init() { + t["DatastoreSummary"] = reflect.TypeOf((*DatastoreSummary)(nil)).Elem() +} + +type DateTimeProfile struct { + ApplyProfile +} + +func init() { + t["DateTimeProfile"] = reflect.TypeOf((*DateTimeProfile)(nil)).Elem() +} + +type DecodeLicense DecodeLicenseRequestType + +func init() { + t["DecodeLicense"] = reflect.TypeOf((*DecodeLicense)(nil)).Elem() +} + +type DecodeLicenseRequestType struct { + This ManagedObjectReference `xml:"_this"` + LicenseKey string `xml:"licenseKey"` +} + +func init() { + t["DecodeLicenseRequestType"] = reflect.TypeOf((*DecodeLicenseRequestType)(nil)).Elem() +} + +type DecodeLicenseResponse struct { + Returnval LicenseManagerLicenseInfo `xml:"returnval"` +} + +type DefragmentAllDisks DefragmentAllDisksRequestType + +func init() { + t["DefragmentAllDisks"] = reflect.TypeOf((*DefragmentAllDisks)(nil)).Elem() +} + +type DefragmentAllDisksRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["DefragmentAllDisksRequestType"] = reflect.TypeOf((*DefragmentAllDisksRequestType)(nil)).Elem() +} + +type DefragmentAllDisksResponse struct { +} + +type DefragmentVirtualDiskRequestType struct { + This ManagedObjectReference `xml:"_this"` + Name string `xml:"name"` + Datacenter *ManagedObjectReference `xml:"datacenter,omitempty"` +} + +func init() { + t["DefragmentVirtualDiskRequestType"] = reflect.TypeOf((*DefragmentVirtualDiskRequestType)(nil)).Elem() +} + +type DefragmentVirtualDisk_Task DefragmentVirtualDiskRequestType + +func init() { + t["DefragmentVirtualDisk_Task"] = reflect.TypeOf((*DefragmentVirtualDisk_Task)(nil)).Elem() +} + +type DefragmentVirtualDisk_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type DeleteCustomizationSpec DeleteCustomizationSpecRequestType + +func init() { + t["DeleteCustomizationSpec"] = reflect.TypeOf((*DeleteCustomizationSpec)(nil)).Elem() +} + +type DeleteCustomizationSpecRequestType struct { + This ManagedObjectReference `xml:"_this"` + Name string `xml:"name"` +} + +func init() { + t["DeleteCustomizationSpecRequestType"] = reflect.TypeOf((*DeleteCustomizationSpecRequestType)(nil)).Elem() +} + +type DeleteCustomizationSpecResponse struct { +} + +type DeleteDatastoreFileRequestType struct { + This ManagedObjectReference `xml:"_this"` + Name string `xml:"name"` + Datacenter *ManagedObjectReference `xml:"datacenter,omitempty"` +} + +func init() { + t["DeleteDatastoreFileRequestType"] = reflect.TypeOf((*DeleteDatastoreFileRequestType)(nil)).Elem() +} + +type DeleteDatastoreFile_Task DeleteDatastoreFileRequestType + +func init() { + t["DeleteDatastoreFile_Task"] = reflect.TypeOf((*DeleteDatastoreFile_Task)(nil)).Elem() +} + +type DeleteDatastoreFile_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type DeleteDirectory DeleteDirectoryRequestType + +func init() { + t["DeleteDirectory"] = reflect.TypeOf((*DeleteDirectory)(nil)).Elem() +} + +type DeleteDirectoryInGuest DeleteDirectoryInGuestRequestType + +func init() { + t["DeleteDirectoryInGuest"] = reflect.TypeOf((*DeleteDirectoryInGuest)(nil)).Elem() +} + +type DeleteDirectoryInGuestRequestType struct { + This ManagedObjectReference `xml:"_this"` + Vm ManagedObjectReference `xml:"vm"` + Auth BaseGuestAuthentication `xml:"auth,typeattr"` + DirectoryPath string `xml:"directoryPath"` + Recursive bool `xml:"recursive"` +} + +func init() { + t["DeleteDirectoryInGuestRequestType"] = reflect.TypeOf((*DeleteDirectoryInGuestRequestType)(nil)).Elem() +} + +type DeleteDirectoryInGuestResponse struct { +} + +type DeleteDirectoryRequestType struct { + This ManagedObjectReference `xml:"_this"` + Datacenter *ManagedObjectReference `xml:"datacenter,omitempty"` + DatastorePath string `xml:"datastorePath"` +} + +func init() { + t["DeleteDirectoryRequestType"] = reflect.TypeOf((*DeleteDirectoryRequestType)(nil)).Elem() +} + +type DeleteDirectoryResponse struct { +} + +type DeleteFile DeleteFileRequestType + +func init() { + t["DeleteFile"] = reflect.TypeOf((*DeleteFile)(nil)).Elem() +} + +type DeleteFileInGuest DeleteFileInGuestRequestType + +func init() { + t["DeleteFileInGuest"] = reflect.TypeOf((*DeleteFileInGuest)(nil)).Elem() +} + +type DeleteFileInGuestRequestType struct { + This ManagedObjectReference `xml:"_this"` + Vm ManagedObjectReference `xml:"vm"` + Auth BaseGuestAuthentication `xml:"auth,typeattr"` + FilePath string `xml:"filePath"` +} + +func init() { + t["DeleteFileInGuestRequestType"] = reflect.TypeOf((*DeleteFileInGuestRequestType)(nil)).Elem() +} + +type DeleteFileInGuestResponse struct { +} + +type DeleteFileRequestType struct { + This ManagedObjectReference `xml:"_this"` + DatastorePath string `xml:"datastorePath"` +} + +func init() { + t["DeleteFileRequestType"] = reflect.TypeOf((*DeleteFileRequestType)(nil)).Elem() +} + +type DeleteFileResponse struct { +} + +type DeleteRegistryKeyInGuest DeleteRegistryKeyInGuestRequestType + +func init() { + t["DeleteRegistryKeyInGuest"] = reflect.TypeOf((*DeleteRegistryKeyInGuest)(nil)).Elem() +} + +type DeleteRegistryKeyInGuestRequestType struct { + This ManagedObjectReference `xml:"_this"` + Vm ManagedObjectReference `xml:"vm"` + Auth BaseGuestAuthentication `xml:"auth,typeattr"` + KeyName GuestRegKeyNameSpec `xml:"keyName"` + Recursive bool `xml:"recursive"` +} + +func init() { + t["DeleteRegistryKeyInGuestRequestType"] = reflect.TypeOf((*DeleteRegistryKeyInGuestRequestType)(nil)).Elem() +} + +type DeleteRegistryKeyInGuestResponse struct { +} + +type DeleteRegistryValueInGuest DeleteRegistryValueInGuestRequestType + +func init() { + t["DeleteRegistryValueInGuest"] = reflect.TypeOf((*DeleteRegistryValueInGuest)(nil)).Elem() +} + +type DeleteRegistryValueInGuestRequestType struct { + This ManagedObjectReference `xml:"_this"` + Vm ManagedObjectReference `xml:"vm"` + Auth BaseGuestAuthentication `xml:"auth,typeattr"` + ValueName GuestRegValueNameSpec `xml:"valueName"` +} + +func init() { + t["DeleteRegistryValueInGuestRequestType"] = reflect.TypeOf((*DeleteRegistryValueInGuestRequestType)(nil)).Elem() +} + +type DeleteRegistryValueInGuestResponse struct { +} + +type DeleteScsiLunState DeleteScsiLunStateRequestType + +func init() { + t["DeleteScsiLunState"] = reflect.TypeOf((*DeleteScsiLunState)(nil)).Elem() +} + +type DeleteScsiLunStateRequestType struct { + This ManagedObjectReference `xml:"_this"` + LunCanonicalName string `xml:"lunCanonicalName"` +} + +func init() { + t["DeleteScsiLunStateRequestType"] = reflect.TypeOf((*DeleteScsiLunStateRequestType)(nil)).Elem() +} + +type DeleteScsiLunStateResponse struct { +} + +type DeleteVffsVolumeState DeleteVffsVolumeStateRequestType + +func init() { + t["DeleteVffsVolumeState"] = reflect.TypeOf((*DeleteVffsVolumeState)(nil)).Elem() +} + +type DeleteVffsVolumeStateRequestType struct { + This ManagedObjectReference `xml:"_this"` + VffsUuid string `xml:"vffsUuid"` +} + +func init() { + t["DeleteVffsVolumeStateRequestType"] = reflect.TypeOf((*DeleteVffsVolumeStateRequestType)(nil)).Elem() +} + +type DeleteVffsVolumeStateResponse struct { +} + +type DeleteVirtualDiskRequestType struct { + This ManagedObjectReference `xml:"_this"` + Name string `xml:"name"` + Datacenter *ManagedObjectReference `xml:"datacenter,omitempty"` +} + +func init() { + t["DeleteVirtualDiskRequestType"] = reflect.TypeOf((*DeleteVirtualDiskRequestType)(nil)).Elem() +} + +type DeleteVirtualDisk_Task DeleteVirtualDiskRequestType + +func init() { + t["DeleteVirtualDisk_Task"] = reflect.TypeOf((*DeleteVirtualDisk_Task)(nil)).Elem() +} + +type DeleteVirtualDisk_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type DeleteVmfsVolumeState DeleteVmfsVolumeStateRequestType + +func init() { + t["DeleteVmfsVolumeState"] = reflect.TypeOf((*DeleteVmfsVolumeState)(nil)).Elem() +} + +type DeleteVmfsVolumeStateRequestType struct { + This ManagedObjectReference `xml:"_this"` + VmfsUuid string `xml:"vmfsUuid"` +} + +func init() { + t["DeleteVmfsVolumeStateRequestType"] = reflect.TypeOf((*DeleteVmfsVolumeStateRequestType)(nil)).Elem() +} + +type DeleteVmfsVolumeStateResponse struct { +} + +type DeleteVsanObjects DeleteVsanObjectsRequestType + +func init() { + t["DeleteVsanObjects"] = reflect.TypeOf((*DeleteVsanObjects)(nil)).Elem() +} + +type DeleteVsanObjectsRequestType struct { + This ManagedObjectReference `xml:"_this"` + Uuids []string `xml:"uuids"` + Force *bool `xml:"force"` +} + +func init() { + t["DeleteVsanObjectsRequestType"] = reflect.TypeOf((*DeleteVsanObjectsRequestType)(nil)).Elem() +} + +type DeleteVsanObjectsResponse struct { + Returnval []HostVsanInternalSystemDeleteVsanObjectsResult `xml:"returnval"` +} + +type DeltaDiskFormatNotSupported struct { + VmConfigFault + + Datastore []ManagedObjectReference `xml:"datastore,omitempty"` + DeltaDiskFormat string `xml:"deltaDiskFormat"` +} + +func init() { + t["DeltaDiskFormatNotSupported"] = reflect.TypeOf((*DeltaDiskFormatNotSupported)(nil)).Elem() +} + +type DeltaDiskFormatNotSupportedFault DeltaDiskFormatNotSupported + +func init() { + t["DeltaDiskFormatNotSupportedFault"] = reflect.TypeOf((*DeltaDiskFormatNotSupportedFault)(nil)).Elem() +} + +type Description struct { + DynamicData + + Label string `xml:"label"` + Summary string `xml:"summary"` +} + +func init() { + t["Description"] = reflect.TypeOf((*Description)(nil)).Elem() +} + +type DeselectVnic DeselectVnicRequestType + +func init() { + t["DeselectVnic"] = reflect.TypeOf((*DeselectVnic)(nil)).Elem() +} + +type DeselectVnicForNicType DeselectVnicForNicTypeRequestType + +func init() { + t["DeselectVnicForNicType"] = reflect.TypeOf((*DeselectVnicForNicType)(nil)).Elem() +} + +type DeselectVnicForNicTypeRequestType struct { + This ManagedObjectReference `xml:"_this"` + NicType string `xml:"nicType"` + Device string `xml:"device"` +} + +func init() { + t["DeselectVnicForNicTypeRequestType"] = reflect.TypeOf((*DeselectVnicForNicTypeRequestType)(nil)).Elem() +} + +type DeselectVnicForNicTypeResponse struct { +} + +type DeselectVnicRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["DeselectVnicRequestType"] = reflect.TypeOf((*DeselectVnicRequestType)(nil)).Elem() +} + +type DeselectVnicResponse struct { +} + +type DestinationSwitchFull struct { + CannotAccessNetwork +} + +func init() { + t["DestinationSwitchFull"] = reflect.TypeOf((*DestinationSwitchFull)(nil)).Elem() +} + +type DestinationSwitchFullFault DestinationSwitchFull + +func init() { + t["DestinationSwitchFullFault"] = reflect.TypeOf((*DestinationSwitchFullFault)(nil)).Elem() +} + +type DestinationVsanDisabled struct { + CannotMoveVsanEnabledHost + + DestinationCluster string `xml:"destinationCluster"` +} + +func init() { + t["DestinationVsanDisabled"] = reflect.TypeOf((*DestinationVsanDisabled)(nil)).Elem() +} + +type DestinationVsanDisabledFault DestinationVsanDisabled + +func init() { + t["DestinationVsanDisabledFault"] = reflect.TypeOf((*DestinationVsanDisabledFault)(nil)).Elem() +} + +type DestroyChildren DestroyChildrenRequestType + +func init() { + t["DestroyChildren"] = reflect.TypeOf((*DestroyChildren)(nil)).Elem() +} + +type DestroyChildrenRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["DestroyChildrenRequestType"] = reflect.TypeOf((*DestroyChildrenRequestType)(nil)).Elem() +} + +type DestroyChildrenResponse struct { +} + +type DestroyCollector DestroyCollectorRequestType + +func init() { + t["DestroyCollector"] = reflect.TypeOf((*DestroyCollector)(nil)).Elem() +} + +type DestroyCollectorRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["DestroyCollectorRequestType"] = reflect.TypeOf((*DestroyCollectorRequestType)(nil)).Elem() +} + +type DestroyCollectorResponse struct { +} + +type DestroyDatastore DestroyDatastoreRequestType + +func init() { + t["DestroyDatastore"] = reflect.TypeOf((*DestroyDatastore)(nil)).Elem() +} + +type DestroyDatastoreRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["DestroyDatastoreRequestType"] = reflect.TypeOf((*DestroyDatastoreRequestType)(nil)).Elem() +} + +type DestroyDatastoreResponse struct { +} + +type DestroyIpPool DestroyIpPoolRequestType + +func init() { + t["DestroyIpPool"] = reflect.TypeOf((*DestroyIpPool)(nil)).Elem() +} + +type DestroyIpPoolRequestType struct { + This ManagedObjectReference `xml:"_this"` + Dc ManagedObjectReference `xml:"dc"` + Id int32 `xml:"id"` + Force bool `xml:"force"` +} + +func init() { + t["DestroyIpPoolRequestType"] = reflect.TypeOf((*DestroyIpPoolRequestType)(nil)).Elem() +} + +type DestroyIpPoolResponse struct { +} + +type DestroyNetwork DestroyNetworkRequestType + +func init() { + t["DestroyNetwork"] = reflect.TypeOf((*DestroyNetwork)(nil)).Elem() +} + +type DestroyNetworkRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["DestroyNetworkRequestType"] = reflect.TypeOf((*DestroyNetworkRequestType)(nil)).Elem() +} + +type DestroyNetworkResponse struct { +} + +type DestroyProfile DestroyProfileRequestType + +func init() { + t["DestroyProfile"] = reflect.TypeOf((*DestroyProfile)(nil)).Elem() +} + +type DestroyProfileRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["DestroyProfileRequestType"] = reflect.TypeOf((*DestroyProfileRequestType)(nil)).Elem() +} + +type DestroyProfileResponse struct { +} + +type DestroyPropertyCollector DestroyPropertyCollectorRequestType + +func init() { + t["DestroyPropertyCollector"] = reflect.TypeOf((*DestroyPropertyCollector)(nil)).Elem() +} + +type DestroyPropertyCollectorRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["DestroyPropertyCollectorRequestType"] = reflect.TypeOf((*DestroyPropertyCollectorRequestType)(nil)).Elem() +} + +type DestroyPropertyCollectorResponse struct { +} + +type DestroyPropertyFilter DestroyPropertyFilterRequestType + +func init() { + t["DestroyPropertyFilter"] = reflect.TypeOf((*DestroyPropertyFilter)(nil)).Elem() +} + +type DestroyPropertyFilterRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["DestroyPropertyFilterRequestType"] = reflect.TypeOf((*DestroyPropertyFilterRequestType)(nil)).Elem() +} + +type DestroyPropertyFilterResponse struct { +} + +type DestroyRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["DestroyRequestType"] = reflect.TypeOf((*DestroyRequestType)(nil)).Elem() +} + +type DestroyVffs DestroyVffsRequestType + +func init() { + t["DestroyVffs"] = reflect.TypeOf((*DestroyVffs)(nil)).Elem() +} + +type DestroyVffsRequestType struct { + This ManagedObjectReference `xml:"_this"` + VffsPath string `xml:"vffsPath"` +} + +func init() { + t["DestroyVffsRequestType"] = reflect.TypeOf((*DestroyVffsRequestType)(nil)).Elem() +} + +type DestroyVffsResponse struct { +} + +type DestroyView DestroyViewRequestType + +func init() { + t["DestroyView"] = reflect.TypeOf((*DestroyView)(nil)).Elem() +} + +type DestroyViewRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["DestroyViewRequestType"] = reflect.TypeOf((*DestroyViewRequestType)(nil)).Elem() +} + +type DestroyViewResponse struct { +} + +type Destroy_Task DestroyRequestType + +func init() { + t["Destroy_Task"] = reflect.TypeOf((*Destroy_Task)(nil)).Elem() +} + +type Destroy_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type DetachScsiLun DetachScsiLunRequestType + +func init() { + t["DetachScsiLun"] = reflect.TypeOf((*DetachScsiLun)(nil)).Elem() +} + +type DetachScsiLunExRequestType struct { + This ManagedObjectReference `xml:"_this"` + LunUuid []string `xml:"lunUuid"` +} + +func init() { + t["DetachScsiLunExRequestType"] = reflect.TypeOf((*DetachScsiLunExRequestType)(nil)).Elem() +} + +type DetachScsiLunEx_Task DetachScsiLunExRequestType + +func init() { + t["DetachScsiLunEx_Task"] = reflect.TypeOf((*DetachScsiLunEx_Task)(nil)).Elem() +} + +type DetachScsiLunEx_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type DetachScsiLunRequestType struct { + This ManagedObjectReference `xml:"_this"` + LunUuid string `xml:"lunUuid"` +} + +func init() { + t["DetachScsiLunRequestType"] = reflect.TypeOf((*DetachScsiLunRequestType)(nil)).Elem() +} + +type DetachScsiLunResponse struct { +} + +type DeviceBackedVirtualDiskSpec struct { + VirtualDiskSpec + + Device string `xml:"device"` +} + +func init() { + t["DeviceBackedVirtualDiskSpec"] = reflect.TypeOf((*DeviceBackedVirtualDiskSpec)(nil)).Elem() +} + +type DeviceBackingNotSupported struct { + DeviceNotSupported + + Backing string `xml:"backing"` +} + +func init() { + t["DeviceBackingNotSupported"] = reflect.TypeOf((*DeviceBackingNotSupported)(nil)).Elem() +} + +type DeviceBackingNotSupportedFault BaseDeviceBackingNotSupported + +func init() { + t["DeviceBackingNotSupportedFault"] = reflect.TypeOf((*DeviceBackingNotSupportedFault)(nil)).Elem() +} + +type DeviceControllerNotSupported struct { + DeviceNotSupported + + Controller string `xml:"controller"` +} + +func init() { + t["DeviceControllerNotSupported"] = reflect.TypeOf((*DeviceControllerNotSupported)(nil)).Elem() +} + +type DeviceControllerNotSupportedFault DeviceControllerNotSupported + +func init() { + t["DeviceControllerNotSupportedFault"] = reflect.TypeOf((*DeviceControllerNotSupportedFault)(nil)).Elem() +} + +type DeviceHotPlugNotSupported struct { + InvalidDeviceSpec +} + +func init() { + t["DeviceHotPlugNotSupported"] = reflect.TypeOf((*DeviceHotPlugNotSupported)(nil)).Elem() +} + +type DeviceHotPlugNotSupportedFault DeviceHotPlugNotSupported + +func init() { + t["DeviceHotPlugNotSupportedFault"] = reflect.TypeOf((*DeviceHotPlugNotSupportedFault)(nil)).Elem() +} + +type DeviceNotFound struct { + InvalidDeviceSpec +} + +func init() { + t["DeviceNotFound"] = reflect.TypeOf((*DeviceNotFound)(nil)).Elem() +} + +type DeviceNotFoundFault DeviceNotFound + +func init() { + t["DeviceNotFoundFault"] = reflect.TypeOf((*DeviceNotFoundFault)(nil)).Elem() +} + +type DeviceNotSupported struct { + VirtualHardwareCompatibilityIssue + + Device string `xml:"device"` + Reason string `xml:"reason,omitempty"` +} + +func init() { + t["DeviceNotSupported"] = reflect.TypeOf((*DeviceNotSupported)(nil)).Elem() +} + +type DeviceNotSupportedFault BaseDeviceNotSupported + +func init() { + t["DeviceNotSupportedFault"] = reflect.TypeOf((*DeviceNotSupportedFault)(nil)).Elem() +} + +type DeviceUnsupportedForVmPlatform struct { + InvalidDeviceSpec +} + +func init() { + t["DeviceUnsupportedForVmPlatform"] = reflect.TypeOf((*DeviceUnsupportedForVmPlatform)(nil)).Elem() +} + +type DeviceUnsupportedForVmPlatformFault DeviceUnsupportedForVmPlatform + +func init() { + t["DeviceUnsupportedForVmPlatformFault"] = reflect.TypeOf((*DeviceUnsupportedForVmPlatformFault)(nil)).Elem() +} + +type DeviceUnsupportedForVmVersion struct { + InvalidDeviceSpec + + CurrentVersion string `xml:"currentVersion"` + ExpectedVersion string `xml:"expectedVersion"` +} + +func init() { + t["DeviceUnsupportedForVmVersion"] = reflect.TypeOf((*DeviceUnsupportedForVmVersion)(nil)).Elem() +} + +type DeviceUnsupportedForVmVersionFault DeviceUnsupportedForVmVersion + +func init() { + t["DeviceUnsupportedForVmVersionFault"] = reflect.TypeOf((*DeviceUnsupportedForVmVersionFault)(nil)).Elem() +} + +type DiagnosticManagerBundleInfo struct { + DynamicData + + System *ManagedObjectReference `xml:"system,omitempty"` + Url string `xml:"url"` +} + +func init() { + t["DiagnosticManagerBundleInfo"] = reflect.TypeOf((*DiagnosticManagerBundleInfo)(nil)).Elem() +} + +type DiagnosticManagerLogDescriptor struct { + DynamicData + + Key string `xml:"key"` + FileName string `xml:"fileName"` + Creator string `xml:"creator"` + Format string `xml:"format"` + MimeType string `xml:"mimeType"` + Info BaseDescription `xml:"info,typeattr"` +} + +func init() { + t["DiagnosticManagerLogDescriptor"] = reflect.TypeOf((*DiagnosticManagerLogDescriptor)(nil)).Elem() +} + +type DiagnosticManagerLogHeader struct { + DynamicData + + LineStart int32 `xml:"lineStart"` + LineEnd int32 `xml:"lineEnd"` + LineText []string `xml:"lineText,omitempty"` +} + +func init() { + t["DiagnosticManagerLogHeader"] = reflect.TypeOf((*DiagnosticManagerLogHeader)(nil)).Elem() +} + +type DigestNotSupported struct { + DeviceNotSupported +} + +func init() { + t["DigestNotSupported"] = reflect.TypeOf((*DigestNotSupported)(nil)).Elem() +} + +type DigestNotSupportedFault DigestNotSupported + +func init() { + t["DigestNotSupportedFault"] = reflect.TypeOf((*DigestNotSupportedFault)(nil)).Elem() +} + +type DirectoryNotEmpty struct { + FileFault +} + +func init() { + t["DirectoryNotEmpty"] = reflect.TypeOf((*DirectoryNotEmpty)(nil)).Elem() +} + +type DirectoryNotEmptyFault DirectoryNotEmpty + +func init() { + t["DirectoryNotEmptyFault"] = reflect.TypeOf((*DirectoryNotEmptyFault)(nil)).Elem() +} + +type DisableAdminNotSupported struct { + HostConfigFault +} + +func init() { + t["DisableAdminNotSupported"] = reflect.TypeOf((*DisableAdminNotSupported)(nil)).Elem() +} + +type DisableAdminNotSupportedFault DisableAdminNotSupported + +func init() { + t["DisableAdminNotSupportedFault"] = reflect.TypeOf((*DisableAdminNotSupportedFault)(nil)).Elem() +} + +type DisableEvcModeRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["DisableEvcModeRequestType"] = reflect.TypeOf((*DisableEvcModeRequestType)(nil)).Elem() +} + +type DisableEvcMode_Task DisableEvcModeRequestType + +func init() { + t["DisableEvcMode_Task"] = reflect.TypeOf((*DisableEvcMode_Task)(nil)).Elem() +} + +type DisableEvcMode_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type DisableFeature DisableFeatureRequestType + +func init() { + t["DisableFeature"] = reflect.TypeOf((*DisableFeature)(nil)).Elem() +} + +type DisableFeatureRequestType struct { + This ManagedObjectReference `xml:"_this"` + Host *ManagedObjectReference `xml:"host,omitempty"` + FeatureKey string `xml:"featureKey"` +} + +func init() { + t["DisableFeatureRequestType"] = reflect.TypeOf((*DisableFeatureRequestType)(nil)).Elem() +} + +type DisableFeatureResponse struct { + Returnval bool `xml:"returnval"` +} + +type DisableHyperThreading DisableHyperThreadingRequestType + +func init() { + t["DisableHyperThreading"] = reflect.TypeOf((*DisableHyperThreading)(nil)).Elem() +} + +type DisableHyperThreadingRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["DisableHyperThreadingRequestType"] = reflect.TypeOf((*DisableHyperThreadingRequestType)(nil)).Elem() +} + +type DisableHyperThreadingResponse struct { +} + +type DisableMultipathPath DisableMultipathPathRequestType + +func init() { + t["DisableMultipathPath"] = reflect.TypeOf((*DisableMultipathPath)(nil)).Elem() +} + +type DisableMultipathPathRequestType struct { + This ManagedObjectReference `xml:"_this"` + PathName string `xml:"pathName"` +} + +func init() { + t["DisableMultipathPathRequestType"] = reflect.TypeOf((*DisableMultipathPathRequestType)(nil)).Elem() +} + +type DisableMultipathPathResponse struct { +} + +type DisableRuleset DisableRulesetRequestType + +func init() { + t["DisableRuleset"] = reflect.TypeOf((*DisableRuleset)(nil)).Elem() +} + +type DisableRulesetRequestType struct { + This ManagedObjectReference `xml:"_this"` + Id string `xml:"id"` +} + +func init() { + t["DisableRulesetRequestType"] = reflect.TypeOf((*DisableRulesetRequestType)(nil)).Elem() +} + +type DisableRulesetResponse struct { +} + +type DisableSecondaryVMRequestType struct { + This ManagedObjectReference `xml:"_this"` + Vm ManagedObjectReference `xml:"vm"` +} + +func init() { + t["DisableSecondaryVMRequestType"] = reflect.TypeOf((*DisableSecondaryVMRequestType)(nil)).Elem() +} + +type DisableSecondaryVM_Task DisableSecondaryVMRequestType + +func init() { + t["DisableSecondaryVM_Task"] = reflect.TypeOf((*DisableSecondaryVM_Task)(nil)).Elem() +} + +type DisableSecondaryVM_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type DisableSmartCardAuthentication DisableSmartCardAuthenticationRequestType + +func init() { + t["DisableSmartCardAuthentication"] = reflect.TypeOf((*DisableSmartCardAuthentication)(nil)).Elem() +} + +type DisableSmartCardAuthenticationRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["DisableSmartCardAuthenticationRequestType"] = reflect.TypeOf((*DisableSmartCardAuthenticationRequestType)(nil)).Elem() +} + +type DisableSmartCardAuthenticationResponse struct { +} + +type DisallowedChangeByService struct { + RuntimeFault + + ServiceName string `xml:"serviceName"` + DisallowedChange string `xml:"disallowedChange,omitempty"` +} + +func init() { + t["DisallowedChangeByService"] = reflect.TypeOf((*DisallowedChangeByService)(nil)).Elem() +} + +type DisallowedChangeByServiceFault DisallowedChangeByService + +func init() { + t["DisallowedChangeByServiceFault"] = reflect.TypeOf((*DisallowedChangeByServiceFault)(nil)).Elem() +} + +type DisallowedDiskModeChange struct { + InvalidDeviceSpec +} + +func init() { + t["DisallowedDiskModeChange"] = reflect.TypeOf((*DisallowedDiskModeChange)(nil)).Elem() +} + +type DisallowedDiskModeChangeFault DisallowedDiskModeChange + +func init() { + t["DisallowedDiskModeChangeFault"] = reflect.TypeOf((*DisallowedDiskModeChangeFault)(nil)).Elem() +} + +type DisallowedMigrationDeviceAttached struct { + MigrationFault + + Fault LocalizedMethodFault `xml:"fault"` +} + +func init() { + t["DisallowedMigrationDeviceAttached"] = reflect.TypeOf((*DisallowedMigrationDeviceAttached)(nil)).Elem() +} + +type DisallowedMigrationDeviceAttachedFault DisallowedMigrationDeviceAttached + +func init() { + t["DisallowedMigrationDeviceAttachedFault"] = reflect.TypeOf((*DisallowedMigrationDeviceAttachedFault)(nil)).Elem() +} + +type DisallowedOperationOnFailoverHost struct { + RuntimeFault + + Host ManagedObjectReference `xml:"host"` + Hostname string `xml:"hostname"` +} + +func init() { + t["DisallowedOperationOnFailoverHost"] = reflect.TypeOf((*DisallowedOperationOnFailoverHost)(nil)).Elem() +} + +type DisallowedOperationOnFailoverHostFault DisallowedOperationOnFailoverHost + +func init() { + t["DisallowedOperationOnFailoverHostFault"] = reflect.TypeOf((*DisallowedOperationOnFailoverHostFault)(nil)).Elem() +} + +type DisconnectHostRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["DisconnectHostRequestType"] = reflect.TypeOf((*DisconnectHostRequestType)(nil)).Elem() +} + +type DisconnectHost_Task DisconnectHostRequestType + +func init() { + t["DisconnectHost_Task"] = reflect.TypeOf((*DisconnectHost_Task)(nil)).Elem() +} + +type DisconnectHost_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type DisconnectedHostsBlockingEVC struct { + EVCConfigFault +} + +func init() { + t["DisconnectedHostsBlockingEVC"] = reflect.TypeOf((*DisconnectedHostsBlockingEVC)(nil)).Elem() +} + +type DisconnectedHostsBlockingEVCFault DisconnectedHostsBlockingEVC + +func init() { + t["DisconnectedHostsBlockingEVCFault"] = reflect.TypeOf((*DisconnectedHostsBlockingEVCFault)(nil)).Elem() +} + +type DiscoverFcoeHbas DiscoverFcoeHbasRequestType + +func init() { + t["DiscoverFcoeHbas"] = reflect.TypeOf((*DiscoverFcoeHbas)(nil)).Elem() +} + +type DiscoverFcoeHbasRequestType struct { + This ManagedObjectReference `xml:"_this"` + FcoeSpec FcoeConfigFcoeSpecification `xml:"fcoeSpec"` +} + +func init() { + t["DiscoverFcoeHbasRequestType"] = reflect.TypeOf((*DiscoverFcoeHbasRequestType)(nil)).Elem() +} + +type DiscoverFcoeHbasResponse struct { +} + +type DiskChangeExtent struct { + DynamicData + + Start int64 `xml:"start"` + Length int64 `xml:"length"` +} + +func init() { + t["DiskChangeExtent"] = reflect.TypeOf((*DiskChangeExtent)(nil)).Elem() +} + +type DiskChangeInfo struct { + DynamicData + + StartOffset int64 `xml:"startOffset"` + Length int64 `xml:"length"` + ChangedArea []DiskChangeExtent `xml:"changedArea,omitempty"` +} + +func init() { + t["DiskChangeInfo"] = reflect.TypeOf((*DiskChangeInfo)(nil)).Elem() +} + +type DiskHasPartitions struct { + VsanDiskFault +} + +func init() { + t["DiskHasPartitions"] = reflect.TypeOf((*DiskHasPartitions)(nil)).Elem() +} + +type DiskHasPartitionsFault DiskHasPartitions + +func init() { + t["DiskHasPartitionsFault"] = reflect.TypeOf((*DiskHasPartitionsFault)(nil)).Elem() +} + +type DiskIsLastRemainingNonSSD struct { + VsanDiskFault +} + +func init() { + t["DiskIsLastRemainingNonSSD"] = reflect.TypeOf((*DiskIsLastRemainingNonSSD)(nil)).Elem() +} + +type DiskIsLastRemainingNonSSDFault DiskIsLastRemainingNonSSD + +func init() { + t["DiskIsLastRemainingNonSSDFault"] = reflect.TypeOf((*DiskIsLastRemainingNonSSDFault)(nil)).Elem() +} + +type DiskIsNonLocal struct { + VsanDiskFault +} + +func init() { + t["DiskIsNonLocal"] = reflect.TypeOf((*DiskIsNonLocal)(nil)).Elem() +} + +type DiskIsNonLocalFault DiskIsNonLocal + +func init() { + t["DiskIsNonLocalFault"] = reflect.TypeOf((*DiskIsNonLocalFault)(nil)).Elem() +} + +type DiskIsUSB struct { + VsanDiskFault +} + +func init() { + t["DiskIsUSB"] = reflect.TypeOf((*DiskIsUSB)(nil)).Elem() +} + +type DiskIsUSBFault DiskIsUSB + +func init() { + t["DiskIsUSBFault"] = reflect.TypeOf((*DiskIsUSBFault)(nil)).Elem() +} + +type DiskMoveTypeNotSupported struct { + MigrationFault +} + +func init() { + t["DiskMoveTypeNotSupported"] = reflect.TypeOf((*DiskMoveTypeNotSupported)(nil)).Elem() +} + +type DiskMoveTypeNotSupportedFault DiskMoveTypeNotSupported + +func init() { + t["DiskMoveTypeNotSupportedFault"] = reflect.TypeOf((*DiskMoveTypeNotSupportedFault)(nil)).Elem() +} + +type DiskNotSupported struct { + VirtualHardwareCompatibilityIssue + + Disk int32 `xml:"disk"` +} + +func init() { + t["DiskNotSupported"] = reflect.TypeOf((*DiskNotSupported)(nil)).Elem() +} + +type DiskNotSupportedFault BaseDiskNotSupported + +func init() { + t["DiskNotSupportedFault"] = reflect.TypeOf((*DiskNotSupportedFault)(nil)).Elem() +} + +type DiskTooSmall struct { + VsanDiskFault +} + +func init() { + t["DiskTooSmall"] = reflect.TypeOf((*DiskTooSmall)(nil)).Elem() +} + +type DiskTooSmallFault DiskTooSmall + +func init() { + t["DiskTooSmallFault"] = reflect.TypeOf((*DiskTooSmallFault)(nil)).Elem() +} + +type DissociateProfile DissociateProfileRequestType + +func init() { + t["DissociateProfile"] = reflect.TypeOf((*DissociateProfile)(nil)).Elem() +} + +type DissociateProfileRequestType struct { + This ManagedObjectReference `xml:"_this"` + Entity []ManagedObjectReference `xml:"entity,omitempty"` +} + +func init() { + t["DissociateProfileRequestType"] = reflect.TypeOf((*DissociateProfileRequestType)(nil)).Elem() +} + +type DissociateProfileResponse struct { +} + +type DistributedVirtualPort struct { + DynamicData + + Key string `xml:"key"` + Config DVPortConfigInfo `xml:"config"` + DvsUuid string `xml:"dvsUuid"` + PortgroupKey string `xml:"portgroupKey,omitempty"` + ProxyHost *ManagedObjectReference `xml:"proxyHost,omitempty"` + Connectee *DistributedVirtualSwitchPortConnectee `xml:"connectee,omitempty"` + Conflict bool `xml:"conflict"` + ConflictPortKey string `xml:"conflictPortKey,omitempty"` + State *DVPortState `xml:"state,omitempty"` + ConnectionCookie int32 `xml:"connectionCookie,omitempty"` + LastStatusChange time.Time `xml:"lastStatusChange"` + HostLocalPort *bool `xml:"hostLocalPort"` +} + +func init() { + t["DistributedVirtualPort"] = reflect.TypeOf((*DistributedVirtualPort)(nil)).Elem() +} + +type DistributedVirtualPortgroupInfo struct { + DynamicData + + SwitchName string `xml:"switchName"` + SwitchUuid string `xml:"switchUuid"` + PortgroupName string `xml:"portgroupName"` + PortgroupKey string `xml:"portgroupKey"` + PortgroupType string `xml:"portgroupType"` + UplinkPortgroup bool `xml:"uplinkPortgroup"` + Portgroup ManagedObjectReference `xml:"portgroup"` + NetworkReservationSupported *bool `xml:"networkReservationSupported"` +} + +func init() { + t["DistributedVirtualPortgroupInfo"] = reflect.TypeOf((*DistributedVirtualPortgroupInfo)(nil)).Elem() +} + +type DistributedVirtualSwitchHostMember struct { + DynamicData + + RuntimeState *DistributedVirtualSwitchHostMemberRuntimeState `xml:"runtimeState,omitempty"` + Config DistributedVirtualSwitchHostMemberConfigInfo `xml:"config"` + ProductInfo *DistributedVirtualSwitchProductSpec `xml:"productInfo,omitempty"` + UplinkPortKey []string `xml:"uplinkPortKey,omitempty"` + Status string `xml:"status"` + StatusDetail string `xml:"statusDetail,omitempty"` +} + +func init() { + t["DistributedVirtualSwitchHostMember"] = reflect.TypeOf((*DistributedVirtualSwitchHostMember)(nil)).Elem() +} + +type DistributedVirtualSwitchHostMemberBacking struct { + DynamicData +} + +func init() { + t["DistributedVirtualSwitchHostMemberBacking"] = reflect.TypeOf((*DistributedVirtualSwitchHostMemberBacking)(nil)).Elem() +} + +type DistributedVirtualSwitchHostMemberConfigInfo struct { + DynamicData + + Host *ManagedObjectReference `xml:"host,omitempty"` + MaxProxySwitchPorts int32 `xml:"maxProxySwitchPorts"` + VendorSpecificConfig []DistributedVirtualSwitchKeyedOpaqueBlob `xml:"vendorSpecificConfig,omitempty"` + Backing BaseDistributedVirtualSwitchHostMemberBacking `xml:"backing,typeattr"` +} + +func init() { + t["DistributedVirtualSwitchHostMemberConfigInfo"] = reflect.TypeOf((*DistributedVirtualSwitchHostMemberConfigInfo)(nil)).Elem() +} + +type DistributedVirtualSwitchHostMemberConfigSpec struct { + DynamicData + + Operation string `xml:"operation"` + Host ManagedObjectReference `xml:"host"` + Backing BaseDistributedVirtualSwitchHostMemberBacking `xml:"backing,omitempty,typeattr"` + MaxProxySwitchPorts int32 `xml:"maxProxySwitchPorts,omitempty"` + VendorSpecificConfig []DistributedVirtualSwitchKeyedOpaqueBlob `xml:"vendorSpecificConfig,omitempty"` +} + +func init() { + t["DistributedVirtualSwitchHostMemberConfigSpec"] = reflect.TypeOf((*DistributedVirtualSwitchHostMemberConfigSpec)(nil)).Elem() +} + +type DistributedVirtualSwitchHostMemberPnicBacking struct { + DistributedVirtualSwitchHostMemberBacking + + PnicSpec []DistributedVirtualSwitchHostMemberPnicSpec `xml:"pnicSpec,omitempty"` +} + +func init() { + t["DistributedVirtualSwitchHostMemberPnicBacking"] = reflect.TypeOf((*DistributedVirtualSwitchHostMemberPnicBacking)(nil)).Elem() +} + +type DistributedVirtualSwitchHostMemberPnicSpec struct { + DynamicData + + PnicDevice string `xml:"pnicDevice"` + UplinkPortKey string `xml:"uplinkPortKey,omitempty"` + UplinkPortgroupKey string `xml:"uplinkPortgroupKey,omitempty"` + ConnectionCookie int32 `xml:"connectionCookie,omitempty"` +} + +func init() { + t["DistributedVirtualSwitchHostMemberPnicSpec"] = reflect.TypeOf((*DistributedVirtualSwitchHostMemberPnicSpec)(nil)).Elem() +} + +type DistributedVirtualSwitchHostMemberRuntimeState struct { + DynamicData + + CurrentMaxProxySwitchPorts int32 `xml:"currentMaxProxySwitchPorts"` +} + +func init() { + t["DistributedVirtualSwitchHostMemberRuntimeState"] = reflect.TypeOf((*DistributedVirtualSwitchHostMemberRuntimeState)(nil)).Elem() +} + +type DistributedVirtualSwitchHostProductSpec struct { + DynamicData + + ProductLineId string `xml:"productLineId,omitempty"` + Version string `xml:"version,omitempty"` +} + +func init() { + t["DistributedVirtualSwitchHostProductSpec"] = reflect.TypeOf((*DistributedVirtualSwitchHostProductSpec)(nil)).Elem() +} + +type DistributedVirtualSwitchInfo struct { + DynamicData + + SwitchName string `xml:"switchName"` + SwitchUuid string `xml:"switchUuid"` + DistributedVirtualSwitch ManagedObjectReference `xml:"distributedVirtualSwitch"` + NetworkReservationSupported *bool `xml:"networkReservationSupported"` +} + +func init() { + t["DistributedVirtualSwitchInfo"] = reflect.TypeOf((*DistributedVirtualSwitchInfo)(nil)).Elem() +} + +type DistributedVirtualSwitchKeyedOpaqueBlob struct { + DynamicData + + Key string `xml:"key"` + OpaqueData string `xml:"opaqueData"` +} + +func init() { + t["DistributedVirtualSwitchKeyedOpaqueBlob"] = reflect.TypeOf((*DistributedVirtualSwitchKeyedOpaqueBlob)(nil)).Elem() +} + +type DistributedVirtualSwitchManagerCompatibilityResult struct { + DynamicData + + Host ManagedObjectReference `xml:"host"` + Error []LocalizedMethodFault `xml:"error,omitempty"` +} + +func init() { + t["DistributedVirtualSwitchManagerCompatibilityResult"] = reflect.TypeOf((*DistributedVirtualSwitchManagerCompatibilityResult)(nil)).Elem() +} + +type DistributedVirtualSwitchManagerDvsProductSpec struct { + DynamicData + + NewSwitchProductSpec *DistributedVirtualSwitchProductSpec `xml:"newSwitchProductSpec,omitempty"` + DistributedVirtualSwitch *ManagedObjectReference `xml:"distributedVirtualSwitch,omitempty"` +} + +func init() { + t["DistributedVirtualSwitchManagerDvsProductSpec"] = reflect.TypeOf((*DistributedVirtualSwitchManagerDvsProductSpec)(nil)).Elem() +} + +type DistributedVirtualSwitchManagerHostArrayFilter struct { + DistributedVirtualSwitchManagerHostDvsFilterSpec + + Host []ManagedObjectReference `xml:"host"` +} + +func init() { + t["DistributedVirtualSwitchManagerHostArrayFilter"] = reflect.TypeOf((*DistributedVirtualSwitchManagerHostArrayFilter)(nil)).Elem() +} + +type DistributedVirtualSwitchManagerHostContainer struct { + DynamicData + + Container ManagedObjectReference `xml:"container"` + Recursive bool `xml:"recursive"` +} + +func init() { + t["DistributedVirtualSwitchManagerHostContainer"] = reflect.TypeOf((*DistributedVirtualSwitchManagerHostContainer)(nil)).Elem() +} + +type DistributedVirtualSwitchManagerHostContainerFilter struct { + DistributedVirtualSwitchManagerHostDvsFilterSpec + + HostContainer DistributedVirtualSwitchManagerHostContainer `xml:"hostContainer"` +} + +func init() { + t["DistributedVirtualSwitchManagerHostContainerFilter"] = reflect.TypeOf((*DistributedVirtualSwitchManagerHostContainerFilter)(nil)).Elem() +} + +type DistributedVirtualSwitchManagerHostDvsFilterSpec struct { + DynamicData + + Inclusive bool `xml:"inclusive"` +} + +func init() { + t["DistributedVirtualSwitchManagerHostDvsFilterSpec"] = reflect.TypeOf((*DistributedVirtualSwitchManagerHostDvsFilterSpec)(nil)).Elem() +} + +type DistributedVirtualSwitchManagerHostDvsMembershipFilter struct { + DistributedVirtualSwitchManagerHostDvsFilterSpec + + DistributedVirtualSwitch ManagedObjectReference `xml:"distributedVirtualSwitch"` +} + +func init() { + t["DistributedVirtualSwitchManagerHostDvsMembershipFilter"] = reflect.TypeOf((*DistributedVirtualSwitchManagerHostDvsMembershipFilter)(nil)).Elem() +} + +type DistributedVirtualSwitchManagerImportResult struct { + DynamicData + + DistributedVirtualSwitch []ManagedObjectReference `xml:"distributedVirtualSwitch,omitempty"` + DistributedVirtualPortgroup []ManagedObjectReference `xml:"distributedVirtualPortgroup,omitempty"` + ImportFault []ImportOperationBulkFaultFaultOnImport `xml:"importFault,omitempty"` +} + +func init() { + t["DistributedVirtualSwitchManagerImportResult"] = reflect.TypeOf((*DistributedVirtualSwitchManagerImportResult)(nil)).Elem() +} + +type DistributedVirtualSwitchPortConnectee struct { + DynamicData + + ConnectedEntity *ManagedObjectReference `xml:"connectedEntity,omitempty"` + NicKey string `xml:"nicKey,omitempty"` + Type string `xml:"type,omitempty"` + AddressHint string `xml:"addressHint,omitempty"` +} + +func init() { + t["DistributedVirtualSwitchPortConnectee"] = reflect.TypeOf((*DistributedVirtualSwitchPortConnectee)(nil)).Elem() +} + +type DistributedVirtualSwitchPortConnection struct { + DynamicData + + SwitchUuid string `xml:"switchUuid"` + PortgroupKey string `xml:"portgroupKey,omitempty"` + PortKey string `xml:"portKey,omitempty"` + ConnectionCookie int32 `xml:"connectionCookie,omitempty"` +} + +func init() { + t["DistributedVirtualSwitchPortConnection"] = reflect.TypeOf((*DistributedVirtualSwitchPortConnection)(nil)).Elem() +} + +type DistributedVirtualSwitchPortCriteria struct { + DynamicData + + Connected *bool `xml:"connected"` + Active *bool `xml:"active"` + UplinkPort *bool `xml:"uplinkPort"` + Scope *ManagedObjectReference `xml:"scope,omitempty"` + PortgroupKey []string `xml:"portgroupKey,omitempty"` + Inside *bool `xml:"inside"` + PortKey []string `xml:"portKey,omitempty"` +} + +func init() { + t["DistributedVirtualSwitchPortCriteria"] = reflect.TypeOf((*DistributedVirtualSwitchPortCriteria)(nil)).Elem() +} + +type DistributedVirtualSwitchPortStatistics struct { + DynamicData + + PacketsInMulticast int64 `xml:"packetsInMulticast"` + PacketsOutMulticast int64 `xml:"packetsOutMulticast"` + BytesInMulticast int64 `xml:"bytesInMulticast"` + BytesOutMulticast int64 `xml:"bytesOutMulticast"` + PacketsInUnicast int64 `xml:"packetsInUnicast"` + PacketsOutUnicast int64 `xml:"packetsOutUnicast"` + BytesInUnicast int64 `xml:"bytesInUnicast"` + BytesOutUnicast int64 `xml:"bytesOutUnicast"` + PacketsInBroadcast int64 `xml:"packetsInBroadcast"` + PacketsOutBroadcast int64 `xml:"packetsOutBroadcast"` + BytesInBroadcast int64 `xml:"bytesInBroadcast"` + BytesOutBroadcast int64 `xml:"bytesOutBroadcast"` + PacketsInDropped int64 `xml:"packetsInDropped"` + PacketsOutDropped int64 `xml:"packetsOutDropped"` + PacketsInException int64 `xml:"packetsInException"` + PacketsOutException int64 `xml:"packetsOutException"` +} + +func init() { + t["DistributedVirtualSwitchPortStatistics"] = reflect.TypeOf((*DistributedVirtualSwitchPortStatistics)(nil)).Elem() +} + +type DistributedVirtualSwitchProductSpec struct { + DynamicData + + Name string `xml:"name,omitempty"` + Vendor string `xml:"vendor,omitempty"` + Version string `xml:"version,omitempty"` + Build string `xml:"build,omitempty"` + ForwardingClass string `xml:"forwardingClass,omitempty"` + BundleId string `xml:"bundleId,omitempty"` + BundleUrl string `xml:"bundleUrl,omitempty"` +} + +func init() { + t["DistributedVirtualSwitchProductSpec"] = reflect.TypeOf((*DistributedVirtualSwitchProductSpec)(nil)).Elem() +} + +type DoesCustomizationSpecExist DoesCustomizationSpecExistRequestType + +func init() { + t["DoesCustomizationSpecExist"] = reflect.TypeOf((*DoesCustomizationSpecExist)(nil)).Elem() +} + +type DoesCustomizationSpecExistRequestType struct { + This ManagedObjectReference `xml:"_this"` + Name string `xml:"name"` +} + +func init() { + t["DoesCustomizationSpecExistRequestType"] = reflect.TypeOf((*DoesCustomizationSpecExistRequestType)(nil)).Elem() +} + +type DoesCustomizationSpecExistResponse struct { + Returnval bool `xml:"returnval"` +} + +type DomainNotFound struct { + ActiveDirectoryFault + + DomainName string `xml:"domainName"` +} + +func init() { + t["DomainNotFound"] = reflect.TypeOf((*DomainNotFound)(nil)).Elem() +} + +type DomainNotFoundFault DomainNotFound + +func init() { + t["DomainNotFoundFault"] = reflect.TypeOf((*DomainNotFoundFault)(nil)).Elem() +} + +type DrsDisabledEvent struct { + ClusterEvent +} + +func init() { + t["DrsDisabledEvent"] = reflect.TypeOf((*DrsDisabledEvent)(nil)).Elem() +} + +type DrsDisabledOnVm struct { + VimFault +} + +func init() { + t["DrsDisabledOnVm"] = reflect.TypeOf((*DrsDisabledOnVm)(nil)).Elem() +} + +type DrsDisabledOnVmFault DrsDisabledOnVm + +func init() { + t["DrsDisabledOnVmFault"] = reflect.TypeOf((*DrsDisabledOnVmFault)(nil)).Elem() +} + +type DrsEnabledEvent struct { + ClusterEvent + + Behavior string `xml:"behavior"` +} + +func init() { + t["DrsEnabledEvent"] = reflect.TypeOf((*DrsEnabledEvent)(nil)).Elem() +} + +type DrsEnteredStandbyModeEvent struct { + EnteredStandbyModeEvent +} + +func init() { + t["DrsEnteredStandbyModeEvent"] = reflect.TypeOf((*DrsEnteredStandbyModeEvent)(nil)).Elem() +} + +type DrsEnteringStandbyModeEvent struct { + EnteringStandbyModeEvent +} + +func init() { + t["DrsEnteringStandbyModeEvent"] = reflect.TypeOf((*DrsEnteringStandbyModeEvent)(nil)).Elem() +} + +type DrsExitStandbyModeFailedEvent struct { + ExitStandbyModeFailedEvent +} + +func init() { + t["DrsExitStandbyModeFailedEvent"] = reflect.TypeOf((*DrsExitStandbyModeFailedEvent)(nil)).Elem() +} + +type DrsExitedStandbyModeEvent struct { + ExitedStandbyModeEvent +} + +func init() { + t["DrsExitedStandbyModeEvent"] = reflect.TypeOf((*DrsExitedStandbyModeEvent)(nil)).Elem() +} + +type DrsExitingStandbyModeEvent struct { + ExitingStandbyModeEvent +} + +func init() { + t["DrsExitingStandbyModeEvent"] = reflect.TypeOf((*DrsExitingStandbyModeEvent)(nil)).Elem() +} + +type DrsInvocationFailedEvent struct { + ClusterEvent +} + +func init() { + t["DrsInvocationFailedEvent"] = reflect.TypeOf((*DrsInvocationFailedEvent)(nil)).Elem() +} + +type DrsRecoveredFromFailureEvent struct { + ClusterEvent +} + +func init() { + t["DrsRecoveredFromFailureEvent"] = reflect.TypeOf((*DrsRecoveredFromFailureEvent)(nil)).Elem() +} + +type DrsResourceConfigureFailedEvent struct { + HostEvent + + Reason LocalizedMethodFault `xml:"reason"` +} + +func init() { + t["DrsResourceConfigureFailedEvent"] = reflect.TypeOf((*DrsResourceConfigureFailedEvent)(nil)).Elem() +} + +type DrsResourceConfigureSyncedEvent struct { + HostEvent +} + +func init() { + t["DrsResourceConfigureSyncedEvent"] = reflect.TypeOf((*DrsResourceConfigureSyncedEvent)(nil)).Elem() +} + +type DrsRuleComplianceEvent struct { + VmEvent +} + +func init() { + t["DrsRuleComplianceEvent"] = reflect.TypeOf((*DrsRuleComplianceEvent)(nil)).Elem() +} + +type DrsRuleViolationEvent struct { + VmEvent +} + +func init() { + t["DrsRuleViolationEvent"] = reflect.TypeOf((*DrsRuleViolationEvent)(nil)).Elem() +} + +type DrsSoftRuleViolationEvent struct { + VmEvent +} + +func init() { + t["DrsSoftRuleViolationEvent"] = reflect.TypeOf((*DrsSoftRuleViolationEvent)(nil)).Elem() +} + +type DrsVmMigratedEvent struct { + VmMigratedEvent +} + +func init() { + t["DrsVmMigratedEvent"] = reflect.TypeOf((*DrsVmMigratedEvent)(nil)).Elem() +} + +type DrsVmPoweredOnEvent struct { + VmPoweredOnEvent +} + +func init() { + t["DrsVmPoweredOnEvent"] = reflect.TypeOf((*DrsVmPoweredOnEvent)(nil)).Elem() +} + +type DrsVmotionIncompatibleFault struct { + VirtualHardwareCompatibilityIssue + + Host ManagedObjectReference `xml:"host"` +} + +func init() { + t["DrsVmotionIncompatibleFault"] = reflect.TypeOf((*DrsVmotionIncompatibleFault)(nil)).Elem() +} + +type DrsVmotionIncompatibleFaultFault DrsVmotionIncompatibleFault + +func init() { + t["DrsVmotionIncompatibleFaultFault"] = reflect.TypeOf((*DrsVmotionIncompatibleFaultFault)(nil)).Elem() +} + +type DuplicateCustomizationSpec DuplicateCustomizationSpecRequestType + +func init() { + t["DuplicateCustomizationSpec"] = reflect.TypeOf((*DuplicateCustomizationSpec)(nil)).Elem() +} + +type DuplicateCustomizationSpecRequestType struct { + This ManagedObjectReference `xml:"_this"` + Name string `xml:"name"` + NewName string `xml:"newName"` +} + +func init() { + t["DuplicateCustomizationSpecRequestType"] = reflect.TypeOf((*DuplicateCustomizationSpecRequestType)(nil)).Elem() +} + +type DuplicateCustomizationSpecResponse struct { +} + +type DuplicateDisks struct { + VsanDiskFault +} + +func init() { + t["DuplicateDisks"] = reflect.TypeOf((*DuplicateDisks)(nil)).Elem() +} + +type DuplicateDisksFault DuplicateDisks + +func init() { + t["DuplicateDisksFault"] = reflect.TypeOf((*DuplicateDisksFault)(nil)).Elem() +} + +type DuplicateIpDetectedEvent struct { + HostEvent + + DuplicateIP string `xml:"duplicateIP"` + MacAddress string `xml:"macAddress"` +} + +func init() { + t["DuplicateIpDetectedEvent"] = reflect.TypeOf((*DuplicateIpDetectedEvent)(nil)).Elem() +} + +type DuplicateName struct { + VimFault + + Name string `xml:"name"` + Object ManagedObjectReference `xml:"object"` +} + +func init() { + t["DuplicateName"] = reflect.TypeOf((*DuplicateName)(nil)).Elem() +} + +type DuplicateNameFault DuplicateName + +func init() { + t["DuplicateNameFault"] = reflect.TypeOf((*DuplicateNameFault)(nil)).Elem() +} + +type DuplicateVsanNetworkInterface struct { + VsanFault + + Device string `xml:"device"` +} + +func init() { + t["DuplicateVsanNetworkInterface"] = reflect.TypeOf((*DuplicateVsanNetworkInterface)(nil)).Elem() +} + +type DuplicateVsanNetworkInterfaceFault DuplicateVsanNetworkInterface + +func init() { + t["DuplicateVsanNetworkInterfaceFault"] = reflect.TypeOf((*DuplicateVsanNetworkInterfaceFault)(nil)).Elem() +} + +type DvpgImportEvent struct { + DVPortgroupEvent + + ImportType string `xml:"importType"` +} + +func init() { + t["DvpgImportEvent"] = reflect.TypeOf((*DvpgImportEvent)(nil)).Elem() +} + +type DvpgRestoreEvent struct { + DVPortgroupEvent +} + +func init() { + t["DvpgRestoreEvent"] = reflect.TypeOf((*DvpgRestoreEvent)(nil)).Elem() +} + +type DvsAcceptNetworkRuleAction struct { + DvsNetworkRuleAction +} + +func init() { + t["DvsAcceptNetworkRuleAction"] = reflect.TypeOf((*DvsAcceptNetworkRuleAction)(nil)).Elem() +} + +type DvsApplyOperationFault struct { + DvsFault + + ObjectFault []DvsApplyOperationFaultFaultOnObject `xml:"objectFault"` +} + +func init() { + t["DvsApplyOperationFault"] = reflect.TypeOf((*DvsApplyOperationFault)(nil)).Elem() +} + +type DvsApplyOperationFaultFault DvsApplyOperationFault + +func init() { + t["DvsApplyOperationFaultFault"] = reflect.TypeOf((*DvsApplyOperationFaultFault)(nil)).Elem() +} + +type DvsApplyOperationFaultFaultOnObject struct { + DynamicData + + ObjectId string `xml:"objectId"` + Type string `xml:"type"` + Fault LocalizedMethodFault `xml:"fault"` +} + +func init() { + t["DvsApplyOperationFaultFaultOnObject"] = reflect.TypeOf((*DvsApplyOperationFaultFaultOnObject)(nil)).Elem() +} + +type DvsCopyNetworkRuleAction struct { + DvsNetworkRuleAction +} + +func init() { + t["DvsCopyNetworkRuleAction"] = reflect.TypeOf((*DvsCopyNetworkRuleAction)(nil)).Elem() +} + +type DvsCreatedEvent struct { + DvsEvent + + Parent FolderEventArgument `xml:"parent"` +} + +func init() { + t["DvsCreatedEvent"] = reflect.TypeOf((*DvsCreatedEvent)(nil)).Elem() +} + +type DvsDestroyedEvent struct { + DvsEvent +} + +func init() { + t["DvsDestroyedEvent"] = reflect.TypeOf((*DvsDestroyedEvent)(nil)).Elem() +} + +type DvsDropNetworkRuleAction struct { + DvsNetworkRuleAction +} + +func init() { + t["DvsDropNetworkRuleAction"] = reflect.TypeOf((*DvsDropNetworkRuleAction)(nil)).Elem() +} + +type DvsEvent struct { + Event +} + +func init() { + t["DvsEvent"] = reflect.TypeOf((*DvsEvent)(nil)).Elem() +} + +type DvsEventArgument struct { + EntityEventArgument + + Dvs ManagedObjectReference `xml:"dvs"` +} + +func init() { + t["DvsEventArgument"] = reflect.TypeOf((*DvsEventArgument)(nil)).Elem() +} + +type DvsFault struct { + VimFault +} + +func init() { + t["DvsFault"] = reflect.TypeOf((*DvsFault)(nil)).Elem() +} + +type DvsFaultFault BaseDvsFault + +func init() { + t["DvsFaultFault"] = reflect.TypeOf((*DvsFaultFault)(nil)).Elem() +} + +type DvsFilterConfig struct { + InheritablePolicy + + Key string `xml:"key,omitempty"` + AgentName string `xml:"agentName,omitempty"` + SlotNumber string `xml:"slotNumber,omitempty"` + Parameters *DvsFilterParameter `xml:"parameters,omitempty"` + OnFailure string `xml:"onFailure,omitempty"` +} + +func init() { + t["DvsFilterConfig"] = reflect.TypeOf((*DvsFilterConfig)(nil)).Elem() +} + +type DvsFilterConfigSpec struct { + DvsFilterConfig + + Operation string `xml:"operation"` +} + +func init() { + t["DvsFilterConfigSpec"] = reflect.TypeOf((*DvsFilterConfigSpec)(nil)).Elem() +} + +type DvsFilterParameter struct { + DynamicData + + Parameters []string `xml:"parameters,omitempty"` +} + +func init() { + t["DvsFilterParameter"] = reflect.TypeOf((*DvsFilterParameter)(nil)).Elem() +} + +type DvsFilterPolicy struct { + InheritablePolicy + + FilterConfig []BaseDvsFilterConfig `xml:"filterConfig,omitempty,typeattr"` +} + +func init() { + t["DvsFilterPolicy"] = reflect.TypeOf((*DvsFilterPolicy)(nil)).Elem() +} + +type DvsGreEncapNetworkRuleAction struct { + DvsNetworkRuleAction + + EncapsulationIp SingleIp `xml:"encapsulationIp"` +} + +func init() { + t["DvsGreEncapNetworkRuleAction"] = reflect.TypeOf((*DvsGreEncapNetworkRuleAction)(nil)).Elem() +} + +type DvsHealthStatusChangeEvent struct { + HostEvent + + SwitchUuid string `xml:"switchUuid"` + HealthResult BaseHostMemberHealthCheckResult `xml:"healthResult,omitempty,typeattr"` +} + +func init() { + t["DvsHealthStatusChangeEvent"] = reflect.TypeOf((*DvsHealthStatusChangeEvent)(nil)).Elem() +} + +type DvsHostBackInSyncEvent struct { + DvsEvent + + HostBackInSync HostEventArgument `xml:"hostBackInSync"` +} + +func init() { + t["DvsHostBackInSyncEvent"] = reflect.TypeOf((*DvsHostBackInSyncEvent)(nil)).Elem() +} + +type DvsHostInfrastructureTrafficResource struct { + DynamicData + + Key string `xml:"key"` + Description string `xml:"description,omitempty"` + AllocationInfo DvsHostInfrastructureTrafficResourceAllocation `xml:"allocationInfo"` +} + +func init() { + t["DvsHostInfrastructureTrafficResource"] = reflect.TypeOf((*DvsHostInfrastructureTrafficResource)(nil)).Elem() +} + +type DvsHostInfrastructureTrafficResourceAllocation struct { + DynamicData + + Limit int64 `xml:"limit,omitempty"` + Shares *SharesInfo `xml:"shares,omitempty"` + Reservation int64 `xml:"reservation,omitempty"` +} + +func init() { + t["DvsHostInfrastructureTrafficResourceAllocation"] = reflect.TypeOf((*DvsHostInfrastructureTrafficResourceAllocation)(nil)).Elem() +} + +type DvsHostJoinedEvent struct { + DvsEvent + + HostJoined HostEventArgument `xml:"hostJoined"` +} + +func init() { + t["DvsHostJoinedEvent"] = reflect.TypeOf((*DvsHostJoinedEvent)(nil)).Elem() +} + +type DvsHostLeftEvent struct { + DvsEvent + + HostLeft HostEventArgument `xml:"hostLeft"` +} + +func init() { + t["DvsHostLeftEvent"] = reflect.TypeOf((*DvsHostLeftEvent)(nil)).Elem() +} + +type DvsHostStatusUpdated struct { + DvsEvent + + HostMember HostEventArgument `xml:"hostMember"` + OldStatus string `xml:"oldStatus,omitempty"` + NewStatus string `xml:"newStatus,omitempty"` + OldStatusDetail string `xml:"oldStatusDetail,omitempty"` + NewStatusDetail string `xml:"newStatusDetail,omitempty"` +} + +func init() { + t["DvsHostStatusUpdated"] = reflect.TypeOf((*DvsHostStatusUpdated)(nil)).Elem() +} + +type DvsHostVNicProfile struct { + DvsVNicProfile +} + +func init() { + t["DvsHostVNicProfile"] = reflect.TypeOf((*DvsHostVNicProfile)(nil)).Elem() +} + +type DvsHostWentOutOfSyncEvent struct { + DvsEvent + + HostOutOfSync DvsOutOfSyncHostArgument `xml:"hostOutOfSync"` +} + +func init() { + t["DvsHostWentOutOfSyncEvent"] = reflect.TypeOf((*DvsHostWentOutOfSyncEvent)(nil)).Elem() +} + +type DvsImportEvent struct { + DvsEvent + + ImportType string `xml:"importType"` +} + +func init() { + t["DvsImportEvent"] = reflect.TypeOf((*DvsImportEvent)(nil)).Elem() +} + +type DvsIpNetworkRuleQualifier struct { + DvsNetworkRuleQualifier + + SourceAddress BaseIpAddress `xml:"sourceAddress,omitempty,typeattr"` + DestinationAddress BaseIpAddress `xml:"destinationAddress,omitempty,typeattr"` + Protocol *IntExpression `xml:"protocol,omitempty"` + SourceIpPort BaseDvsIpPort `xml:"sourceIpPort,omitempty,typeattr"` + DestinationIpPort BaseDvsIpPort `xml:"destinationIpPort,omitempty,typeattr"` + TcpFlags *IntExpression `xml:"tcpFlags,omitempty"` +} + +func init() { + t["DvsIpNetworkRuleQualifier"] = reflect.TypeOf((*DvsIpNetworkRuleQualifier)(nil)).Elem() +} + +type DvsIpPort struct { + NegatableExpression +} + +func init() { + t["DvsIpPort"] = reflect.TypeOf((*DvsIpPort)(nil)).Elem() +} + +type DvsIpPortRange struct { + DvsIpPort + + StartPortNumber int32 `xml:"startPortNumber"` + EndPortNumber int32 `xml:"endPortNumber"` +} + +func init() { + t["DvsIpPortRange"] = reflect.TypeOf((*DvsIpPortRange)(nil)).Elem() +} + +type DvsLogNetworkRuleAction struct { + DvsNetworkRuleAction +} + +func init() { + t["DvsLogNetworkRuleAction"] = reflect.TypeOf((*DvsLogNetworkRuleAction)(nil)).Elem() +} + +type DvsMacNetworkRuleQualifier struct { + DvsNetworkRuleQualifier + + SourceAddress BaseMacAddress `xml:"sourceAddress,omitempty,typeattr"` + DestinationAddress BaseMacAddress `xml:"destinationAddress,omitempty,typeattr"` + Protocol *IntExpression `xml:"protocol,omitempty"` + VlanId *IntExpression `xml:"vlanId,omitempty"` +} + +func init() { + t["DvsMacNetworkRuleQualifier"] = reflect.TypeOf((*DvsMacNetworkRuleQualifier)(nil)).Elem() +} + +type DvsMacRewriteNetworkRuleAction struct { + DvsNetworkRuleAction + + RewriteMac string `xml:"rewriteMac"` +} + +func init() { + t["DvsMacRewriteNetworkRuleAction"] = reflect.TypeOf((*DvsMacRewriteNetworkRuleAction)(nil)).Elem() +} + +type DvsMergedEvent struct { + DvsEvent + + SourceDvs DvsEventArgument `xml:"sourceDvs"` + DestinationDvs DvsEventArgument `xml:"destinationDvs"` +} + +func init() { + t["DvsMergedEvent"] = reflect.TypeOf((*DvsMergedEvent)(nil)).Elem() +} + +type DvsNetworkRuleAction struct { + DynamicData +} + +func init() { + t["DvsNetworkRuleAction"] = reflect.TypeOf((*DvsNetworkRuleAction)(nil)).Elem() +} + +type DvsNetworkRuleQualifier struct { + DynamicData + + Key string `xml:"key,omitempty"` +} + +func init() { + t["DvsNetworkRuleQualifier"] = reflect.TypeOf((*DvsNetworkRuleQualifier)(nil)).Elem() +} + +type DvsNotAuthorized struct { + DvsFault + + SessionExtensionKey string `xml:"sessionExtensionKey,omitempty"` + DvsExtensionKey string `xml:"dvsExtensionKey,omitempty"` +} + +func init() { + t["DvsNotAuthorized"] = reflect.TypeOf((*DvsNotAuthorized)(nil)).Elem() +} + +type DvsNotAuthorizedFault DvsNotAuthorized + +func init() { + t["DvsNotAuthorizedFault"] = reflect.TypeOf((*DvsNotAuthorizedFault)(nil)).Elem() +} + +type DvsOperationBulkFault struct { + DvsFault + + HostFault []DvsOperationBulkFaultFaultOnHost `xml:"hostFault"` +} + +func init() { + t["DvsOperationBulkFault"] = reflect.TypeOf((*DvsOperationBulkFault)(nil)).Elem() +} + +type DvsOperationBulkFaultFault DvsOperationBulkFault + +func init() { + t["DvsOperationBulkFaultFault"] = reflect.TypeOf((*DvsOperationBulkFaultFault)(nil)).Elem() +} + +type DvsOperationBulkFaultFaultOnHost struct { + DynamicData + + Host ManagedObjectReference `xml:"host"` + Fault LocalizedMethodFault `xml:"fault"` +} + +func init() { + t["DvsOperationBulkFaultFaultOnHost"] = reflect.TypeOf((*DvsOperationBulkFaultFaultOnHost)(nil)).Elem() +} + +type DvsOutOfSyncHostArgument struct { + DynamicData + + OutOfSyncHost HostEventArgument `xml:"outOfSyncHost"` + ConfigParamters []string `xml:"configParamters"` +} + +func init() { + t["DvsOutOfSyncHostArgument"] = reflect.TypeOf((*DvsOutOfSyncHostArgument)(nil)).Elem() +} + +type DvsPortBlockedEvent struct { + DvsEvent + + PortKey string `xml:"portKey"` + StatusDetail string `xml:"statusDetail,omitempty"` + RuntimeInfo *DVPortStatus `xml:"runtimeInfo,omitempty"` +} + +func init() { + t["DvsPortBlockedEvent"] = reflect.TypeOf((*DvsPortBlockedEvent)(nil)).Elem() +} + +type DvsPortConnectedEvent struct { + DvsEvent + + PortKey string `xml:"portKey"` + Connectee *DistributedVirtualSwitchPortConnectee `xml:"connectee,omitempty"` +} + +func init() { + t["DvsPortConnectedEvent"] = reflect.TypeOf((*DvsPortConnectedEvent)(nil)).Elem() +} + +type DvsPortCreatedEvent struct { + DvsEvent + + PortKey []string `xml:"portKey"` +} + +func init() { + t["DvsPortCreatedEvent"] = reflect.TypeOf((*DvsPortCreatedEvent)(nil)).Elem() +} + +type DvsPortDeletedEvent struct { + DvsEvent + + PortKey []string `xml:"portKey"` +} + +func init() { + t["DvsPortDeletedEvent"] = reflect.TypeOf((*DvsPortDeletedEvent)(nil)).Elem() +} + +type DvsPortDisconnectedEvent struct { + DvsEvent + + PortKey string `xml:"portKey"` + Connectee *DistributedVirtualSwitchPortConnectee `xml:"connectee,omitempty"` +} + +func init() { + t["DvsPortDisconnectedEvent"] = reflect.TypeOf((*DvsPortDisconnectedEvent)(nil)).Elem() +} + +type DvsPortEnteredPassthruEvent struct { + DvsEvent + + PortKey string `xml:"portKey"` + RuntimeInfo *DVPortStatus `xml:"runtimeInfo,omitempty"` +} + +func init() { + t["DvsPortEnteredPassthruEvent"] = reflect.TypeOf((*DvsPortEnteredPassthruEvent)(nil)).Elem() +} + +type DvsPortExitedPassthruEvent struct { + DvsEvent + + PortKey string `xml:"portKey"` + RuntimeInfo *DVPortStatus `xml:"runtimeInfo,omitempty"` +} + +func init() { + t["DvsPortExitedPassthruEvent"] = reflect.TypeOf((*DvsPortExitedPassthruEvent)(nil)).Elem() +} + +type DvsPortJoinPortgroupEvent struct { + DvsEvent + + PortKey string `xml:"portKey"` + PortgroupKey string `xml:"portgroupKey"` + PortgroupName string `xml:"portgroupName"` +} + +func init() { + t["DvsPortJoinPortgroupEvent"] = reflect.TypeOf((*DvsPortJoinPortgroupEvent)(nil)).Elem() +} + +type DvsPortLeavePortgroupEvent struct { + DvsEvent + + PortKey string `xml:"portKey"` + PortgroupKey string `xml:"portgroupKey"` + PortgroupName string `xml:"portgroupName"` +} + +func init() { + t["DvsPortLeavePortgroupEvent"] = reflect.TypeOf((*DvsPortLeavePortgroupEvent)(nil)).Elem() +} + +type DvsPortLinkDownEvent struct { + DvsEvent + + PortKey string `xml:"portKey"` + RuntimeInfo *DVPortStatus `xml:"runtimeInfo,omitempty"` +} + +func init() { + t["DvsPortLinkDownEvent"] = reflect.TypeOf((*DvsPortLinkDownEvent)(nil)).Elem() +} + +type DvsPortLinkUpEvent struct { + DvsEvent + + PortKey string `xml:"portKey"` + RuntimeInfo *DVPortStatus `xml:"runtimeInfo,omitempty"` +} + +func init() { + t["DvsPortLinkUpEvent"] = reflect.TypeOf((*DvsPortLinkUpEvent)(nil)).Elem() +} + +type DvsPortReconfiguredEvent struct { + DvsEvent + + PortKey []string `xml:"portKey"` +} + +func init() { + t["DvsPortReconfiguredEvent"] = reflect.TypeOf((*DvsPortReconfiguredEvent)(nil)).Elem() +} + +type DvsPortRuntimeChangeEvent struct { + DvsEvent + + PortKey string `xml:"portKey"` + RuntimeInfo DVPortStatus `xml:"runtimeInfo"` +} + +func init() { + t["DvsPortRuntimeChangeEvent"] = reflect.TypeOf((*DvsPortRuntimeChangeEvent)(nil)).Elem() +} + +type DvsPortUnblockedEvent struct { + DvsEvent + + PortKey string `xml:"portKey"` + RuntimeInfo *DVPortStatus `xml:"runtimeInfo,omitempty"` +} + +func init() { + t["DvsPortUnblockedEvent"] = reflect.TypeOf((*DvsPortUnblockedEvent)(nil)).Elem() +} + +type DvsPortVendorSpecificStateChangeEvent struct { + DvsEvent + + PortKey string `xml:"portKey"` +} + +func init() { + t["DvsPortVendorSpecificStateChangeEvent"] = reflect.TypeOf((*DvsPortVendorSpecificStateChangeEvent)(nil)).Elem() +} + +type DvsProfile struct { + ApplyProfile + + Key string `xml:"key"` + Name string `xml:"name"` + Uplink []PnicUplinkProfile `xml:"uplink,omitempty"` +} + +func init() { + t["DvsProfile"] = reflect.TypeOf((*DvsProfile)(nil)).Elem() +} + +type DvsPuntNetworkRuleAction struct { + DvsNetworkRuleAction +} + +func init() { + t["DvsPuntNetworkRuleAction"] = reflect.TypeOf((*DvsPuntNetworkRuleAction)(nil)).Elem() +} + +type DvsRateLimitNetworkRuleAction struct { + DvsNetworkRuleAction + + PacketsPerSecond int32 `xml:"packetsPerSecond"` +} + +func init() { + t["DvsRateLimitNetworkRuleAction"] = reflect.TypeOf((*DvsRateLimitNetworkRuleAction)(nil)).Elem() +} + +type DvsReconfigureVmVnicNetworkResourcePoolRequestType struct { + This ManagedObjectReference `xml:"_this"` + ConfigSpec []DvsVmVnicResourcePoolConfigSpec `xml:"configSpec"` +} + +func init() { + t["DvsReconfigureVmVnicNetworkResourcePoolRequestType"] = reflect.TypeOf((*DvsReconfigureVmVnicNetworkResourcePoolRequestType)(nil)).Elem() +} + +type DvsReconfigureVmVnicNetworkResourcePool_Task DvsReconfigureVmVnicNetworkResourcePoolRequestType + +func init() { + t["DvsReconfigureVmVnicNetworkResourcePool_Task"] = reflect.TypeOf((*DvsReconfigureVmVnicNetworkResourcePool_Task)(nil)).Elem() +} + +type DvsReconfigureVmVnicNetworkResourcePool_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type DvsReconfiguredEvent struct { + DvsEvent + + ConfigSpec BaseDVSConfigSpec `xml:"configSpec,typeattr"` +} + +func init() { + t["DvsReconfiguredEvent"] = reflect.TypeOf((*DvsReconfiguredEvent)(nil)).Elem() +} + +type DvsRenamedEvent struct { + DvsEvent + + OldName string `xml:"oldName"` + NewName string `xml:"newName"` +} + +func init() { + t["DvsRenamedEvent"] = reflect.TypeOf((*DvsRenamedEvent)(nil)).Elem() +} + +type DvsResourceRuntimeInfo struct { + DynamicData + + Capacity int32 `xml:"capacity,omitempty"` + Usage int32 `xml:"usage,omitempty"` + Available int32 `xml:"available,omitempty"` + AllocatedResource []DvsVnicAllocatedResource `xml:"allocatedResource,omitempty"` + VmVnicNetworkResourcePoolRuntime []DvsVmVnicNetworkResourcePoolRuntimeInfo `xml:"vmVnicNetworkResourcePoolRuntime,omitempty"` +} + +func init() { + t["DvsResourceRuntimeInfo"] = reflect.TypeOf((*DvsResourceRuntimeInfo)(nil)).Elem() +} + +type DvsRestoreEvent struct { + DvsEvent +} + +func init() { + t["DvsRestoreEvent"] = reflect.TypeOf((*DvsRestoreEvent)(nil)).Elem() +} + +type DvsScopeViolated struct { + DvsFault + + Scope []ManagedObjectReference `xml:"scope"` + Entity ManagedObjectReference `xml:"entity"` +} + +func init() { + t["DvsScopeViolated"] = reflect.TypeOf((*DvsScopeViolated)(nil)).Elem() +} + +type DvsScopeViolatedFault DvsScopeViolated + +func init() { + t["DvsScopeViolatedFault"] = reflect.TypeOf((*DvsScopeViolatedFault)(nil)).Elem() +} + +type DvsServiceConsoleVNicProfile struct { + DvsVNicProfile +} + +func init() { + t["DvsServiceConsoleVNicProfile"] = reflect.TypeOf((*DvsServiceConsoleVNicProfile)(nil)).Elem() +} + +type DvsSingleIpPort struct { + DvsIpPort + + PortNumber int32 `xml:"portNumber"` +} + +func init() { + t["DvsSingleIpPort"] = reflect.TypeOf((*DvsSingleIpPort)(nil)).Elem() +} + +type DvsSystemTrafficNetworkRuleQualifier struct { + DvsNetworkRuleQualifier + + TypeOfSystemTraffic *StringExpression `xml:"typeOfSystemTraffic,omitempty"` +} + +func init() { + t["DvsSystemTrafficNetworkRuleQualifier"] = reflect.TypeOf((*DvsSystemTrafficNetworkRuleQualifier)(nil)).Elem() +} + +type DvsTrafficFilterConfig struct { + DvsFilterConfig + + TrafficRuleset *DvsTrafficRuleset `xml:"trafficRuleset,omitempty"` +} + +func init() { + t["DvsTrafficFilterConfig"] = reflect.TypeOf((*DvsTrafficFilterConfig)(nil)).Elem() +} + +type DvsTrafficFilterConfigSpec struct { + DvsTrafficFilterConfig + + Operation string `xml:"operation"` +} + +func init() { + t["DvsTrafficFilterConfigSpec"] = reflect.TypeOf((*DvsTrafficFilterConfigSpec)(nil)).Elem() +} + +type DvsTrafficRule struct { + DynamicData + + Key string `xml:"key,omitempty"` + Description string `xml:"description,omitempty"` + Sequence int32 `xml:"sequence,omitempty"` + Qualifier []BaseDvsNetworkRuleQualifier `xml:"qualifier,omitempty,typeattr"` + Action BaseDvsNetworkRuleAction `xml:"action,omitempty,typeattr"` + Direction string `xml:"direction,omitempty"` +} + +func init() { + t["DvsTrafficRule"] = reflect.TypeOf((*DvsTrafficRule)(nil)).Elem() +} + +type DvsTrafficRuleset struct { + DynamicData + + Key string `xml:"key,omitempty"` + Enabled *bool `xml:"enabled"` + Precedence int32 `xml:"precedence,omitempty"` + Rules []DvsTrafficRule `xml:"rules,omitempty"` +} + +func init() { + t["DvsTrafficRuleset"] = reflect.TypeOf((*DvsTrafficRuleset)(nil)).Elem() +} + +type DvsUpdateTagNetworkRuleAction struct { + DvsNetworkRuleAction + + QosTag int32 `xml:"qosTag,omitempty"` + DscpTag int32 `xml:"dscpTag,omitempty"` +} + +func init() { + t["DvsUpdateTagNetworkRuleAction"] = reflect.TypeOf((*DvsUpdateTagNetworkRuleAction)(nil)).Elem() +} + +type DvsUpgradeAvailableEvent struct { + DvsEvent + + ProductInfo DistributedVirtualSwitchProductSpec `xml:"productInfo"` +} + +func init() { + t["DvsUpgradeAvailableEvent"] = reflect.TypeOf((*DvsUpgradeAvailableEvent)(nil)).Elem() +} + +type DvsUpgradeInProgressEvent struct { + DvsEvent + + ProductInfo DistributedVirtualSwitchProductSpec `xml:"productInfo"` +} + +func init() { + t["DvsUpgradeInProgressEvent"] = reflect.TypeOf((*DvsUpgradeInProgressEvent)(nil)).Elem() +} + +type DvsUpgradeRejectedEvent struct { + DvsEvent + + ProductInfo DistributedVirtualSwitchProductSpec `xml:"productInfo"` +} + +func init() { + t["DvsUpgradeRejectedEvent"] = reflect.TypeOf((*DvsUpgradeRejectedEvent)(nil)).Elem() +} + +type DvsUpgradedEvent struct { + DvsEvent + + ProductInfo DistributedVirtualSwitchProductSpec `xml:"productInfo"` +} + +func init() { + t["DvsUpgradedEvent"] = reflect.TypeOf((*DvsUpgradedEvent)(nil)).Elem() +} + +type DvsVNicProfile struct { + ApplyProfile + + Key string `xml:"key"` + IpConfig IpAddressProfile `xml:"ipConfig"` +} + +func init() { + t["DvsVNicProfile"] = reflect.TypeOf((*DvsVNicProfile)(nil)).Elem() +} + +type DvsVmVnicNetworkResourcePoolRuntimeInfo struct { + DynamicData + + Key string `xml:"key"` + Name string `xml:"name,omitempty"` + Capacity int32 `xml:"capacity,omitempty"` + Usage int32 `xml:"usage,omitempty"` + Available int32 `xml:"available,omitempty"` + Status string `xml:"status"` + AllocatedResource []DvsVnicAllocatedResource `xml:"allocatedResource,omitempty"` +} + +func init() { + t["DvsVmVnicNetworkResourcePoolRuntimeInfo"] = reflect.TypeOf((*DvsVmVnicNetworkResourcePoolRuntimeInfo)(nil)).Elem() +} + +type DvsVmVnicResourceAllocation struct { + DynamicData + + ReservationQuota int64 `xml:"reservationQuota,omitempty"` +} + +func init() { + t["DvsVmVnicResourceAllocation"] = reflect.TypeOf((*DvsVmVnicResourceAllocation)(nil)).Elem() +} + +type DvsVmVnicResourcePoolConfigSpec struct { + DynamicData + + Operation string `xml:"operation"` + Key string `xml:"key,omitempty"` + ConfigVersion string `xml:"configVersion,omitempty"` + AllocationInfo *DvsVmVnicResourceAllocation `xml:"allocationInfo,omitempty"` + Name string `xml:"name,omitempty"` + Description string `xml:"description,omitempty"` +} + +func init() { + t["DvsVmVnicResourcePoolConfigSpec"] = reflect.TypeOf((*DvsVmVnicResourcePoolConfigSpec)(nil)).Elem() +} + +type DvsVnicAllocatedResource struct { + DynamicData + + Vm ManagedObjectReference `xml:"vm"` + VnicKey string `xml:"vnicKey"` + Reservation int64 `xml:"reservation,omitempty"` +} + +func init() { + t["DvsVnicAllocatedResource"] = reflect.TypeOf((*DvsVnicAllocatedResource)(nil)).Elem() +} + +type DynamicArray struct { + Val []AnyType `xml:"val,typeattr"` +} + +func init() { + t["DynamicArray"] = reflect.TypeOf((*DynamicArray)(nil)).Elem() +} + +type DynamicData struct { +} + +func init() { + t["DynamicData"] = reflect.TypeOf((*DynamicData)(nil)).Elem() +} + +type DynamicProperty struct { + Name string `xml:"name"` + Val AnyType `xml:"val,typeattr"` +} + +func init() { + t["DynamicProperty"] = reflect.TypeOf((*DynamicProperty)(nil)).Elem() +} + +type EVCAdmissionFailed struct { + NotSupportedHostInCluster + + Faults []LocalizedMethodFault `xml:"faults,omitempty"` +} + +func init() { + t["EVCAdmissionFailed"] = reflect.TypeOf((*EVCAdmissionFailed)(nil)).Elem() +} + +type EVCAdmissionFailedCPUFeaturesForMode struct { + EVCAdmissionFailed + + CurrentEVCModeKey string `xml:"currentEVCModeKey"` +} + +func init() { + t["EVCAdmissionFailedCPUFeaturesForMode"] = reflect.TypeOf((*EVCAdmissionFailedCPUFeaturesForMode)(nil)).Elem() +} + +type EVCAdmissionFailedCPUFeaturesForModeFault EVCAdmissionFailedCPUFeaturesForMode + +func init() { + t["EVCAdmissionFailedCPUFeaturesForModeFault"] = reflect.TypeOf((*EVCAdmissionFailedCPUFeaturesForModeFault)(nil)).Elem() +} + +type EVCAdmissionFailedCPUModel struct { + EVCAdmissionFailed +} + +func init() { + t["EVCAdmissionFailedCPUModel"] = reflect.TypeOf((*EVCAdmissionFailedCPUModel)(nil)).Elem() +} + +type EVCAdmissionFailedCPUModelFault EVCAdmissionFailedCPUModel + +func init() { + t["EVCAdmissionFailedCPUModelFault"] = reflect.TypeOf((*EVCAdmissionFailedCPUModelFault)(nil)).Elem() +} + +type EVCAdmissionFailedCPUModelForMode struct { + EVCAdmissionFailed + + CurrentEVCModeKey string `xml:"currentEVCModeKey"` +} + +func init() { + t["EVCAdmissionFailedCPUModelForMode"] = reflect.TypeOf((*EVCAdmissionFailedCPUModelForMode)(nil)).Elem() +} + +type EVCAdmissionFailedCPUModelForModeFault EVCAdmissionFailedCPUModelForMode + +func init() { + t["EVCAdmissionFailedCPUModelForModeFault"] = reflect.TypeOf((*EVCAdmissionFailedCPUModelForModeFault)(nil)).Elem() +} + +type EVCAdmissionFailedCPUVendor struct { + EVCAdmissionFailed + + ClusterCPUVendor string `xml:"clusterCPUVendor"` + HostCPUVendor string `xml:"hostCPUVendor"` +} + +func init() { + t["EVCAdmissionFailedCPUVendor"] = reflect.TypeOf((*EVCAdmissionFailedCPUVendor)(nil)).Elem() +} + +type EVCAdmissionFailedCPUVendorFault EVCAdmissionFailedCPUVendor + +func init() { + t["EVCAdmissionFailedCPUVendorFault"] = reflect.TypeOf((*EVCAdmissionFailedCPUVendorFault)(nil)).Elem() +} + +type EVCAdmissionFailedCPUVendorUnknown struct { + EVCAdmissionFailed +} + +func init() { + t["EVCAdmissionFailedCPUVendorUnknown"] = reflect.TypeOf((*EVCAdmissionFailedCPUVendorUnknown)(nil)).Elem() +} + +type EVCAdmissionFailedCPUVendorUnknownFault EVCAdmissionFailedCPUVendorUnknown + +func init() { + t["EVCAdmissionFailedCPUVendorUnknownFault"] = reflect.TypeOf((*EVCAdmissionFailedCPUVendorUnknownFault)(nil)).Elem() +} + +type EVCAdmissionFailedFault BaseEVCAdmissionFailed + +func init() { + t["EVCAdmissionFailedFault"] = reflect.TypeOf((*EVCAdmissionFailedFault)(nil)).Elem() +} + +type EVCAdmissionFailedHostDisconnected struct { + EVCAdmissionFailed +} + +func init() { + t["EVCAdmissionFailedHostDisconnected"] = reflect.TypeOf((*EVCAdmissionFailedHostDisconnected)(nil)).Elem() +} + +type EVCAdmissionFailedHostDisconnectedFault EVCAdmissionFailedHostDisconnected + +func init() { + t["EVCAdmissionFailedHostDisconnectedFault"] = reflect.TypeOf((*EVCAdmissionFailedHostDisconnectedFault)(nil)).Elem() +} + +type EVCAdmissionFailedHostSoftware struct { + EVCAdmissionFailed +} + +func init() { + t["EVCAdmissionFailedHostSoftware"] = reflect.TypeOf((*EVCAdmissionFailedHostSoftware)(nil)).Elem() +} + +type EVCAdmissionFailedHostSoftwareFault EVCAdmissionFailedHostSoftware + +func init() { + t["EVCAdmissionFailedHostSoftwareFault"] = reflect.TypeOf((*EVCAdmissionFailedHostSoftwareFault)(nil)).Elem() +} + +type EVCAdmissionFailedHostSoftwareForMode struct { + EVCAdmissionFailed +} + +func init() { + t["EVCAdmissionFailedHostSoftwareForMode"] = reflect.TypeOf((*EVCAdmissionFailedHostSoftwareForMode)(nil)).Elem() +} + +type EVCAdmissionFailedHostSoftwareForModeFault EVCAdmissionFailedHostSoftwareForMode + +func init() { + t["EVCAdmissionFailedHostSoftwareForModeFault"] = reflect.TypeOf((*EVCAdmissionFailedHostSoftwareForModeFault)(nil)).Elem() +} + +type EVCAdmissionFailedVmActive struct { + EVCAdmissionFailed +} + +func init() { + t["EVCAdmissionFailedVmActive"] = reflect.TypeOf((*EVCAdmissionFailedVmActive)(nil)).Elem() +} + +type EVCAdmissionFailedVmActiveFault EVCAdmissionFailedVmActive + +func init() { + t["EVCAdmissionFailedVmActiveFault"] = reflect.TypeOf((*EVCAdmissionFailedVmActiveFault)(nil)).Elem() +} + +type EVCConfigFault struct { + VimFault + + Faults []LocalizedMethodFault `xml:"faults,omitempty"` +} + +func init() { + t["EVCConfigFault"] = reflect.TypeOf((*EVCConfigFault)(nil)).Elem() +} + +type EVCConfigFaultFault BaseEVCConfigFault + +func init() { + t["EVCConfigFaultFault"] = reflect.TypeOf((*EVCConfigFaultFault)(nil)).Elem() +} + +type EVCMode struct { + ElementDescription + + GuaranteedCPUFeatures []HostCpuIdInfo `xml:"guaranteedCPUFeatures,omitempty"` + FeatureCapability []HostFeatureCapability `xml:"featureCapability,omitempty"` + FeatureMask []HostFeatureMask `xml:"featureMask,omitempty"` + FeatureRequirement []VirtualMachineFeatureRequirement `xml:"featureRequirement,omitempty"` + Vendor string `xml:"vendor"` + Track []string `xml:"track,omitempty"` + VendorTier int32 `xml:"vendorTier"` +} + +func init() { + t["EVCMode"] = reflect.TypeOf((*EVCMode)(nil)).Elem() +} + +type EVCModeIllegalByVendor struct { + EVCConfigFault + + ClusterCPUVendor string `xml:"clusterCPUVendor"` + ModeCPUVendor string `xml:"modeCPUVendor"` +} + +func init() { + t["EVCModeIllegalByVendor"] = reflect.TypeOf((*EVCModeIllegalByVendor)(nil)).Elem() +} + +type EVCModeIllegalByVendorFault EVCModeIllegalByVendor + +func init() { + t["EVCModeIllegalByVendorFault"] = reflect.TypeOf((*EVCModeIllegalByVendorFault)(nil)).Elem() +} + +type EVCModeUnsupportedByHosts struct { + EVCConfigFault + + EvcMode string `xml:"evcMode,omitempty"` + Host []ManagedObjectReference `xml:"host,omitempty"` + HostName []string `xml:"hostName,omitempty"` +} + +func init() { + t["EVCModeUnsupportedByHosts"] = reflect.TypeOf((*EVCModeUnsupportedByHosts)(nil)).Elem() +} + +type EVCModeUnsupportedByHostsFault EVCModeUnsupportedByHosts + +func init() { + t["EVCModeUnsupportedByHostsFault"] = reflect.TypeOf((*EVCModeUnsupportedByHostsFault)(nil)).Elem() +} + +type EVCUnsupportedByHostHardware struct { + EVCConfigFault + + Host []ManagedObjectReference `xml:"host"` + HostName []string `xml:"hostName"` +} + +func init() { + t["EVCUnsupportedByHostHardware"] = reflect.TypeOf((*EVCUnsupportedByHostHardware)(nil)).Elem() +} + +type EVCUnsupportedByHostHardwareFault EVCUnsupportedByHostHardware + +func init() { + t["EVCUnsupportedByHostHardwareFault"] = reflect.TypeOf((*EVCUnsupportedByHostHardwareFault)(nil)).Elem() +} + +type EVCUnsupportedByHostSoftware struct { + EVCConfigFault + + Host []ManagedObjectReference `xml:"host"` + HostName []string `xml:"hostName"` +} + +func init() { + t["EVCUnsupportedByHostSoftware"] = reflect.TypeOf((*EVCUnsupportedByHostSoftware)(nil)).Elem() +} + +type EVCUnsupportedByHostSoftwareFault EVCUnsupportedByHostSoftware + +func init() { + t["EVCUnsupportedByHostSoftwareFault"] = reflect.TypeOf((*EVCUnsupportedByHostSoftwareFault)(nil)).Elem() +} + +type EagerZeroVirtualDiskRequestType struct { + This ManagedObjectReference `xml:"_this"` + Name string `xml:"name"` + Datacenter *ManagedObjectReference `xml:"datacenter,omitempty"` +} + +func init() { + t["EagerZeroVirtualDiskRequestType"] = reflect.TypeOf((*EagerZeroVirtualDiskRequestType)(nil)).Elem() +} + +type EagerZeroVirtualDisk_Task EagerZeroVirtualDiskRequestType + +func init() { + t["EagerZeroVirtualDisk_Task"] = reflect.TypeOf((*EagerZeroVirtualDisk_Task)(nil)).Elem() +} + +type EagerZeroVirtualDisk_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type EightHostLimitViolated struct { + VmConfigFault +} + +func init() { + t["EightHostLimitViolated"] = reflect.TypeOf((*EightHostLimitViolated)(nil)).Elem() +} + +type EightHostLimitViolatedFault EightHostLimitViolated + +func init() { + t["EightHostLimitViolatedFault"] = reflect.TypeOf((*EightHostLimitViolatedFault)(nil)).Elem() +} + +type ElementDescription struct { + Description + + Key string `xml:"key"` +} + +func init() { + t["ElementDescription"] = reflect.TypeOf((*ElementDescription)(nil)).Elem() +} + +type EnableAlarmActions EnableAlarmActionsRequestType + +func init() { + t["EnableAlarmActions"] = reflect.TypeOf((*EnableAlarmActions)(nil)).Elem() +} + +type EnableAlarmActionsRequestType struct { + This ManagedObjectReference `xml:"_this"` + Entity ManagedObjectReference `xml:"entity"` + Enabled bool `xml:"enabled"` +} + +func init() { + t["EnableAlarmActionsRequestType"] = reflect.TypeOf((*EnableAlarmActionsRequestType)(nil)).Elem() +} + +type EnableAlarmActionsResponse struct { +} + +type EnableFeature EnableFeatureRequestType + +func init() { + t["EnableFeature"] = reflect.TypeOf((*EnableFeature)(nil)).Elem() +} + +type EnableFeatureRequestType struct { + This ManagedObjectReference `xml:"_this"` + Host *ManagedObjectReference `xml:"host,omitempty"` + FeatureKey string `xml:"featureKey"` +} + +func init() { + t["EnableFeatureRequestType"] = reflect.TypeOf((*EnableFeatureRequestType)(nil)).Elem() +} + +type EnableFeatureResponse struct { + Returnval bool `xml:"returnval"` +} + +type EnableHyperThreading EnableHyperThreadingRequestType + +func init() { + t["EnableHyperThreading"] = reflect.TypeOf((*EnableHyperThreading)(nil)).Elem() +} + +type EnableHyperThreadingRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["EnableHyperThreadingRequestType"] = reflect.TypeOf((*EnableHyperThreadingRequestType)(nil)).Elem() +} + +type EnableHyperThreadingResponse struct { +} + +type EnableMultipathPath EnableMultipathPathRequestType + +func init() { + t["EnableMultipathPath"] = reflect.TypeOf((*EnableMultipathPath)(nil)).Elem() +} + +type EnableMultipathPathRequestType struct { + This ManagedObjectReference `xml:"_this"` + PathName string `xml:"pathName"` +} + +func init() { + t["EnableMultipathPathRequestType"] = reflect.TypeOf((*EnableMultipathPathRequestType)(nil)).Elem() +} + +type EnableMultipathPathResponse struct { +} + +type EnableNetworkResourceManagement EnableNetworkResourceManagementRequestType + +func init() { + t["EnableNetworkResourceManagement"] = reflect.TypeOf((*EnableNetworkResourceManagement)(nil)).Elem() +} + +type EnableNetworkResourceManagementRequestType struct { + This ManagedObjectReference `xml:"_this"` + Enable bool `xml:"enable"` +} + +func init() { + t["EnableNetworkResourceManagementRequestType"] = reflect.TypeOf((*EnableNetworkResourceManagementRequestType)(nil)).Elem() +} + +type EnableNetworkResourceManagementResponse struct { +} + +type EnableRuleset EnableRulesetRequestType + +func init() { + t["EnableRuleset"] = reflect.TypeOf((*EnableRuleset)(nil)).Elem() +} + +type EnableRulesetRequestType struct { + This ManagedObjectReference `xml:"_this"` + Id string `xml:"id"` +} + +func init() { + t["EnableRulesetRequestType"] = reflect.TypeOf((*EnableRulesetRequestType)(nil)).Elem() +} + +type EnableRulesetResponse struct { +} + +type EnableSecondaryVMRequestType struct { + This ManagedObjectReference `xml:"_this"` + Vm ManagedObjectReference `xml:"vm"` + Host *ManagedObjectReference `xml:"host,omitempty"` +} + +func init() { + t["EnableSecondaryVMRequestType"] = reflect.TypeOf((*EnableSecondaryVMRequestType)(nil)).Elem() +} + +type EnableSecondaryVM_Task EnableSecondaryVMRequestType + +func init() { + t["EnableSecondaryVM_Task"] = reflect.TypeOf((*EnableSecondaryVM_Task)(nil)).Elem() +} + +type EnableSecondaryVM_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type EnableSmartCardAuthentication EnableSmartCardAuthenticationRequestType + +func init() { + t["EnableSmartCardAuthentication"] = reflect.TypeOf((*EnableSmartCardAuthentication)(nil)).Elem() +} + +type EnableSmartCardAuthenticationRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["EnableSmartCardAuthenticationRequestType"] = reflect.TypeOf((*EnableSmartCardAuthenticationRequestType)(nil)).Elem() +} + +type EnableSmartCardAuthenticationResponse struct { +} + +type EnterLockdownMode EnterLockdownModeRequestType + +func init() { + t["EnterLockdownMode"] = reflect.TypeOf((*EnterLockdownMode)(nil)).Elem() +} + +type EnterLockdownModeRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["EnterLockdownModeRequestType"] = reflect.TypeOf((*EnterLockdownModeRequestType)(nil)).Elem() +} + +type EnterLockdownModeResponse struct { +} + +type EnterMaintenanceModeRequestType struct { + This ManagedObjectReference `xml:"_this"` + Timeout int32 `xml:"timeout"` + EvacuatePoweredOffVms *bool `xml:"evacuatePoweredOffVms"` + MaintenanceSpec *HostMaintenanceSpec `xml:"maintenanceSpec,omitempty"` +} + +func init() { + t["EnterMaintenanceModeRequestType"] = reflect.TypeOf((*EnterMaintenanceModeRequestType)(nil)).Elem() +} + +type EnterMaintenanceMode_Task EnterMaintenanceModeRequestType + +func init() { + t["EnterMaintenanceMode_Task"] = reflect.TypeOf((*EnterMaintenanceMode_Task)(nil)).Elem() +} + +type EnterMaintenanceMode_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type EnteredMaintenanceModeEvent struct { + HostEvent +} + +func init() { + t["EnteredMaintenanceModeEvent"] = reflect.TypeOf((*EnteredMaintenanceModeEvent)(nil)).Elem() +} + +type EnteredStandbyModeEvent struct { + HostEvent +} + +func init() { + t["EnteredStandbyModeEvent"] = reflect.TypeOf((*EnteredStandbyModeEvent)(nil)).Elem() +} + +type EnteringMaintenanceModeEvent struct { + HostEvent +} + +func init() { + t["EnteringMaintenanceModeEvent"] = reflect.TypeOf((*EnteringMaintenanceModeEvent)(nil)).Elem() +} + +type EnteringStandbyModeEvent struct { + HostEvent +} + +func init() { + t["EnteringStandbyModeEvent"] = reflect.TypeOf((*EnteringStandbyModeEvent)(nil)).Elem() +} + +type EntityBackup struct { + DynamicData +} + +func init() { + t["EntityBackup"] = reflect.TypeOf((*EntityBackup)(nil)).Elem() +} + +type EntityBackupConfig struct { + DynamicData + + EntityType string `xml:"entityType"` + ConfigBlob []byte `xml:"configBlob"` + Key string `xml:"key,omitempty"` + Name string `xml:"name,omitempty"` + Container *ManagedObjectReference `xml:"container,omitempty"` + ConfigVersion string `xml:"configVersion,omitempty"` +} + +func init() { + t["EntityBackupConfig"] = reflect.TypeOf((*EntityBackupConfig)(nil)).Elem() +} + +type EntityEventArgument struct { + EventArgument + + Name string `xml:"name"` +} + +func init() { + t["EntityEventArgument"] = reflect.TypeOf((*EntityEventArgument)(nil)).Elem() +} + +type EntityPrivilege struct { + DynamicData + + Entity ManagedObjectReference `xml:"entity"` + PrivAvailability []PrivilegeAvailability `xml:"privAvailability"` +} + +func init() { + t["EntityPrivilege"] = reflect.TypeOf((*EntityPrivilege)(nil)).Elem() +} + +type EnumDescription struct { + DynamicData + + Key string `xml:"key"` + Tags []BaseElementDescription `xml:"tags,typeattr"` +} + +func init() { + t["EnumDescription"] = reflect.TypeOf((*EnumDescription)(nil)).Elem() +} + +type EnvironmentBrowserConfigOptionQuerySpec struct { + DynamicData + + Key string `xml:"key,omitempty"` + Host *ManagedObjectReference `xml:"host,omitempty"` + GuestId []string `xml:"guestId,omitempty"` +} + +func init() { + t["EnvironmentBrowserConfigOptionQuerySpec"] = reflect.TypeOf((*EnvironmentBrowserConfigOptionQuerySpec)(nil)).Elem() +} + +type ErrorUpgradeEvent struct { + UpgradeEvent +} + +func init() { + t["ErrorUpgradeEvent"] = reflect.TypeOf((*ErrorUpgradeEvent)(nil)).Elem() +} + +type EstimateDatabaseSize EstimateDatabaseSizeRequestType + +func init() { + t["EstimateDatabaseSize"] = reflect.TypeOf((*EstimateDatabaseSize)(nil)).Elem() +} + +type EstimateDatabaseSizeRequestType struct { + This ManagedObjectReference `xml:"_this"` + DbSizeParam DatabaseSizeParam `xml:"dbSizeParam"` +} + +func init() { + t["EstimateDatabaseSizeRequestType"] = reflect.TypeOf((*EstimateDatabaseSizeRequestType)(nil)).Elem() +} + +type EstimateDatabaseSizeResponse struct { + Returnval DatabaseSizeEstimate `xml:"returnval"` +} + +type EstimateStorageForConsolidateSnapshotsRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["EstimateStorageForConsolidateSnapshotsRequestType"] = reflect.TypeOf((*EstimateStorageForConsolidateSnapshotsRequestType)(nil)).Elem() +} + +type EstimateStorageForConsolidateSnapshots_Task EstimateStorageForConsolidateSnapshotsRequestType + +func init() { + t["EstimateStorageForConsolidateSnapshots_Task"] = reflect.TypeOf((*EstimateStorageForConsolidateSnapshots_Task)(nil)).Elem() +} + +type EstimateStorageForConsolidateSnapshots_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type EsxAgentHostManagerUpdateConfig EsxAgentHostManagerUpdateConfigRequestType + +func init() { + t["EsxAgentHostManagerUpdateConfig"] = reflect.TypeOf((*EsxAgentHostManagerUpdateConfig)(nil)).Elem() +} + +type EsxAgentHostManagerUpdateConfigRequestType struct { + This ManagedObjectReference `xml:"_this"` + ConfigInfo HostEsxAgentHostManagerConfigInfo `xml:"configInfo"` +} + +func init() { + t["EsxAgentHostManagerUpdateConfigRequestType"] = reflect.TypeOf((*EsxAgentHostManagerUpdateConfigRequestType)(nil)).Elem() +} + +type EsxAgentHostManagerUpdateConfigResponse struct { +} + +type EvacuateVsanNodeRequestType struct { + This ManagedObjectReference `xml:"_this"` + MaintenanceSpec HostMaintenanceSpec `xml:"maintenanceSpec"` + Timeout int32 `xml:"timeout"` +} + +func init() { + t["EvacuateVsanNodeRequestType"] = reflect.TypeOf((*EvacuateVsanNodeRequestType)(nil)).Elem() +} + +type EvacuateVsanNode_Task EvacuateVsanNodeRequestType + +func init() { + t["EvacuateVsanNode_Task"] = reflect.TypeOf((*EvacuateVsanNode_Task)(nil)).Elem() +} + +type EvacuateVsanNode_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type EvaluationLicenseSource struct { + LicenseSource + + RemainingHours int64 `xml:"remainingHours,omitempty"` +} + +func init() { + t["EvaluationLicenseSource"] = reflect.TypeOf((*EvaluationLicenseSource)(nil)).Elem() +} + +type EvcManager EvcManagerRequestType + +func init() { + t["EvcManager"] = reflect.TypeOf((*EvcManager)(nil)).Elem() +} + +type EvcManagerRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["EvcManagerRequestType"] = reflect.TypeOf((*EvcManagerRequestType)(nil)).Elem() +} + +type EvcManagerResponse struct { + Returnval *ManagedObjectReference `xml:"returnval,omitempty"` +} + +type Event struct { + DynamicData + + Key int32 `xml:"key"` + ChainId int32 `xml:"chainId"` + CreatedTime time.Time `xml:"createdTime"` + UserName string `xml:"userName"` + Datacenter *DatacenterEventArgument `xml:"datacenter,omitempty"` + ComputeResource *ComputeResourceEventArgument `xml:"computeResource,omitempty"` + Host *HostEventArgument `xml:"host,omitempty"` + Vm *VmEventArgument `xml:"vm,omitempty"` + Ds *DatastoreEventArgument `xml:"ds,omitempty"` + Net *NetworkEventArgument `xml:"net,omitempty"` + Dvs *DvsEventArgument `xml:"dvs,omitempty"` + FullFormattedMessage string `xml:"fullFormattedMessage,omitempty"` + ChangeTag string `xml:"changeTag,omitempty"` +} + +func init() { + t["Event"] = reflect.TypeOf((*Event)(nil)).Elem() +} + +type EventAlarmExpression struct { + AlarmExpression + + Comparisons []EventAlarmExpressionComparison `xml:"comparisons,omitempty"` + EventType string `xml:"eventType"` + EventTypeId string `xml:"eventTypeId,omitempty"` + ObjectType string `xml:"objectType,omitempty"` + Status ManagedEntityStatus `xml:"status,omitempty"` +} + +func init() { + t["EventAlarmExpression"] = reflect.TypeOf((*EventAlarmExpression)(nil)).Elem() +} + +type EventAlarmExpressionComparison struct { + DynamicData + + AttributeName string `xml:"attributeName"` + Operator string `xml:"operator"` + Value string `xml:"value"` +} + +func init() { + t["EventAlarmExpressionComparison"] = reflect.TypeOf((*EventAlarmExpressionComparison)(nil)).Elem() +} + +type EventArgDesc struct { + DynamicData + + Name string `xml:"name"` + Type string `xml:"type"` + Description BaseElementDescription `xml:"description,omitempty,typeattr"` +} + +func init() { + t["EventArgDesc"] = reflect.TypeOf((*EventArgDesc)(nil)).Elem() +} + +type EventArgument struct { + DynamicData +} + +func init() { + t["EventArgument"] = reflect.TypeOf((*EventArgument)(nil)).Elem() +} + +type EventDescription struct { + DynamicData + + Category []BaseElementDescription `xml:"category,typeattr"` + EventInfo []EventDescriptionEventDetail `xml:"eventInfo"` + EnumeratedTypes []EnumDescription `xml:"enumeratedTypes,omitempty"` +} + +func init() { + t["EventDescription"] = reflect.TypeOf((*EventDescription)(nil)).Elem() +} + +type EventDescriptionEventDetail struct { + DynamicData + + Key string `xml:"key"` + Description string `xml:"description,omitempty"` + Category string `xml:"category"` + FormatOnDatacenter string `xml:"formatOnDatacenter"` + FormatOnComputeResource string `xml:"formatOnComputeResource"` + FormatOnHost string `xml:"formatOnHost"` + FormatOnVm string `xml:"formatOnVm"` + FullFormat string `xml:"fullFormat"` + LongDescription string `xml:"longDescription,omitempty"` +} + +func init() { + t["EventDescriptionEventDetail"] = reflect.TypeOf((*EventDescriptionEventDetail)(nil)).Elem() +} + +type EventEx struct { + Event + + EventTypeId string `xml:"eventTypeId"` + Severity string `xml:"severity,omitempty"` + Message string `xml:"message,omitempty"` + Arguments []KeyAnyValue `xml:"arguments,omitempty"` + ObjectId string `xml:"objectId,omitempty"` + ObjectType string `xml:"objectType,omitempty"` + ObjectName string `xml:"objectName,omitempty"` + Fault *LocalizedMethodFault `xml:"fault,omitempty"` +} + +func init() { + t["EventEx"] = reflect.TypeOf((*EventEx)(nil)).Elem() +} + +type EventFilterSpec struct { + DynamicData + + Entity *EventFilterSpecByEntity `xml:"entity,omitempty"` + Time *EventFilterSpecByTime `xml:"time,omitempty"` + UserName *EventFilterSpecByUsername `xml:"userName,omitempty"` + EventChainId int32 `xml:"eventChainId,omitempty"` + Alarm *ManagedObjectReference `xml:"alarm,omitempty"` + ScheduledTask *ManagedObjectReference `xml:"scheduledTask,omitempty"` + DisableFullMessage *bool `xml:"disableFullMessage"` + Category []string `xml:"category,omitempty"` + Type []string `xml:"type,omitempty"` + Tag []string `xml:"tag,omitempty"` + EventTypeId []string `xml:"eventTypeId,omitempty"` +} + +func init() { + t["EventFilterSpec"] = reflect.TypeOf((*EventFilterSpec)(nil)).Elem() +} + +type EventFilterSpecByEntity struct { + DynamicData + + Entity ManagedObjectReference `xml:"entity"` + Recursion EventFilterSpecRecursionOption `xml:"recursion"` +} + +func init() { + t["EventFilterSpecByEntity"] = reflect.TypeOf((*EventFilterSpecByEntity)(nil)).Elem() +} + +type EventFilterSpecByTime struct { + DynamicData + + BeginTime *time.Time `xml:"beginTime"` + EndTime *time.Time `xml:"endTime"` +} + +func init() { + t["EventFilterSpecByTime"] = reflect.TypeOf((*EventFilterSpecByTime)(nil)).Elem() +} + +type EventFilterSpecByUsername struct { + DynamicData + + SystemUser bool `xml:"systemUser"` + UserList []string `xml:"userList,omitempty"` +} + +func init() { + t["EventFilterSpecByUsername"] = reflect.TypeOf((*EventFilterSpecByUsername)(nil)).Elem() +} + +type ExecuteHostProfile ExecuteHostProfileRequestType + +func init() { + t["ExecuteHostProfile"] = reflect.TypeOf((*ExecuteHostProfile)(nil)).Elem() +} + +type ExecuteHostProfileRequestType struct { + This ManagedObjectReference `xml:"_this"` + Host ManagedObjectReference `xml:"host"` + DeferredParam []ProfileDeferredPolicyOptionParameter `xml:"deferredParam,omitempty"` +} + +func init() { + t["ExecuteHostProfileRequestType"] = reflect.TypeOf((*ExecuteHostProfileRequestType)(nil)).Elem() +} + +type ExecuteHostProfileResponse struct { + Returnval ProfileExecuteResult `xml:"returnval"` +} + +type ExecuteSimpleCommand ExecuteSimpleCommandRequestType + +func init() { + t["ExecuteSimpleCommand"] = reflect.TypeOf((*ExecuteSimpleCommand)(nil)).Elem() +} + +type ExecuteSimpleCommandRequestType struct { + This ManagedObjectReference `xml:"_this"` + Arguments []string `xml:"arguments,omitempty"` +} + +func init() { + t["ExecuteSimpleCommandRequestType"] = reflect.TypeOf((*ExecuteSimpleCommandRequestType)(nil)).Elem() +} + +type ExecuteSimpleCommandResponse struct { + Returnval string `xml:"returnval"` +} + +type ExitLockdownMode ExitLockdownModeRequestType + +func init() { + t["ExitLockdownMode"] = reflect.TypeOf((*ExitLockdownMode)(nil)).Elem() +} + +type ExitLockdownModeRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["ExitLockdownModeRequestType"] = reflect.TypeOf((*ExitLockdownModeRequestType)(nil)).Elem() +} + +type ExitLockdownModeResponse struct { +} + +type ExitMaintenanceModeEvent struct { + HostEvent +} + +func init() { + t["ExitMaintenanceModeEvent"] = reflect.TypeOf((*ExitMaintenanceModeEvent)(nil)).Elem() +} + +type ExitMaintenanceModeRequestType struct { + This ManagedObjectReference `xml:"_this"` + Timeout int32 `xml:"timeout"` +} + +func init() { + t["ExitMaintenanceModeRequestType"] = reflect.TypeOf((*ExitMaintenanceModeRequestType)(nil)).Elem() +} + +type ExitMaintenanceMode_Task ExitMaintenanceModeRequestType + +func init() { + t["ExitMaintenanceMode_Task"] = reflect.TypeOf((*ExitMaintenanceMode_Task)(nil)).Elem() +} + +type ExitMaintenanceMode_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type ExitStandbyModeFailedEvent struct { + HostEvent +} + +func init() { + t["ExitStandbyModeFailedEvent"] = reflect.TypeOf((*ExitStandbyModeFailedEvent)(nil)).Elem() +} + +type ExitedStandbyModeEvent struct { + HostEvent +} + +func init() { + t["ExitedStandbyModeEvent"] = reflect.TypeOf((*ExitedStandbyModeEvent)(nil)).Elem() +} + +type ExitingStandbyModeEvent struct { + HostEvent +} + +func init() { + t["ExitingStandbyModeEvent"] = reflect.TypeOf((*ExitingStandbyModeEvent)(nil)).Elem() +} + +type ExpandVmfsDatastore ExpandVmfsDatastoreRequestType + +func init() { + t["ExpandVmfsDatastore"] = reflect.TypeOf((*ExpandVmfsDatastore)(nil)).Elem() +} + +type ExpandVmfsDatastoreRequestType struct { + This ManagedObjectReference `xml:"_this"` + Datastore ManagedObjectReference `xml:"datastore"` + Spec VmfsDatastoreExpandSpec `xml:"spec"` +} + +func init() { + t["ExpandVmfsDatastoreRequestType"] = reflect.TypeOf((*ExpandVmfsDatastoreRequestType)(nil)).Elem() +} + +type ExpandVmfsDatastoreResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type ExpandVmfsExtent ExpandVmfsExtentRequestType + +func init() { + t["ExpandVmfsExtent"] = reflect.TypeOf((*ExpandVmfsExtent)(nil)).Elem() +} + +type ExpandVmfsExtentRequestType struct { + This ManagedObjectReference `xml:"_this"` + VmfsPath string `xml:"vmfsPath"` + Extent HostScsiDiskPartition `xml:"extent"` +} + +func init() { + t["ExpandVmfsExtentRequestType"] = reflect.TypeOf((*ExpandVmfsExtentRequestType)(nil)).Elem() +} + +type ExpandVmfsExtentResponse struct { +} + +type ExpiredAddonLicense struct { + ExpiredFeatureLicense +} + +func init() { + t["ExpiredAddonLicense"] = reflect.TypeOf((*ExpiredAddonLicense)(nil)).Elem() +} + +type ExpiredAddonLicenseFault ExpiredAddonLicense + +func init() { + t["ExpiredAddonLicenseFault"] = reflect.TypeOf((*ExpiredAddonLicenseFault)(nil)).Elem() +} + +type ExpiredEditionLicense struct { + ExpiredFeatureLicense +} + +func init() { + t["ExpiredEditionLicense"] = reflect.TypeOf((*ExpiredEditionLicense)(nil)).Elem() +} + +type ExpiredEditionLicenseFault ExpiredEditionLicense + +func init() { + t["ExpiredEditionLicenseFault"] = reflect.TypeOf((*ExpiredEditionLicenseFault)(nil)).Elem() +} + +type ExpiredFeatureLicense struct { + NotEnoughLicenses + + Feature string `xml:"feature"` + Count int32 `xml:"count"` + ExpirationDate time.Time `xml:"expirationDate"` +} + +func init() { + t["ExpiredFeatureLicense"] = reflect.TypeOf((*ExpiredFeatureLicense)(nil)).Elem() +} + +type ExpiredFeatureLicenseFault BaseExpiredFeatureLicense + +func init() { + t["ExpiredFeatureLicenseFault"] = reflect.TypeOf((*ExpiredFeatureLicenseFault)(nil)).Elem() +} + +type ExportAnswerFileRequestType struct { + This ManagedObjectReference `xml:"_this"` + Host ManagedObjectReference `xml:"host"` +} + +func init() { + t["ExportAnswerFileRequestType"] = reflect.TypeOf((*ExportAnswerFileRequestType)(nil)).Elem() +} + +type ExportAnswerFile_Task ExportAnswerFileRequestType + +func init() { + t["ExportAnswerFile_Task"] = reflect.TypeOf((*ExportAnswerFile_Task)(nil)).Elem() +} + +type ExportAnswerFile_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type ExportProfile ExportProfileRequestType + +func init() { + t["ExportProfile"] = reflect.TypeOf((*ExportProfile)(nil)).Elem() +} + +type ExportProfileRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["ExportProfileRequestType"] = reflect.TypeOf((*ExportProfileRequestType)(nil)).Elem() +} + +type ExportProfileResponse struct { + Returnval string `xml:"returnval"` +} + +type ExportSnapshot ExportSnapshotRequestType + +func init() { + t["ExportSnapshot"] = reflect.TypeOf((*ExportSnapshot)(nil)).Elem() +} + +type ExportSnapshotRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["ExportSnapshotRequestType"] = reflect.TypeOf((*ExportSnapshotRequestType)(nil)).Elem() +} + +type ExportSnapshotResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type ExportVApp ExportVAppRequestType + +func init() { + t["ExportVApp"] = reflect.TypeOf((*ExportVApp)(nil)).Elem() +} + +type ExportVAppRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["ExportVAppRequestType"] = reflect.TypeOf((*ExportVAppRequestType)(nil)).Elem() +} + +type ExportVAppResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type ExportVm ExportVmRequestType + +func init() { + t["ExportVm"] = reflect.TypeOf((*ExportVm)(nil)).Elem() +} + +type ExportVmRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["ExportVmRequestType"] = reflect.TypeOf((*ExportVmRequestType)(nil)).Elem() +} + +type ExportVmResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type ExtExtendedProductInfo struct { + DynamicData + + CompanyUrl string `xml:"companyUrl,omitempty"` + ProductUrl string `xml:"productUrl,omitempty"` + ManagementUrl string `xml:"managementUrl,omitempty"` + Self *ManagedObjectReference `xml:"self,omitempty"` +} + +func init() { + t["ExtExtendedProductInfo"] = reflect.TypeOf((*ExtExtendedProductInfo)(nil)).Elem() +} + +type ExtManagedEntityInfo struct { + DynamicData + + Type string `xml:"type"` + SmallIconUrl string `xml:"smallIconUrl,omitempty"` + IconUrl string `xml:"iconUrl,omitempty"` + Description string `xml:"description,omitempty"` +} + +func init() { + t["ExtManagedEntityInfo"] = reflect.TypeOf((*ExtManagedEntityInfo)(nil)).Elem() +} + +type ExtSolutionManagerInfo struct { + DynamicData + + Tab []ExtSolutionManagerInfoTabInfo `xml:"tab,omitempty"` + SmallIconUrl string `xml:"smallIconUrl,omitempty"` +} + +func init() { + t["ExtSolutionManagerInfo"] = reflect.TypeOf((*ExtSolutionManagerInfo)(nil)).Elem() +} + +type ExtSolutionManagerInfoTabInfo struct { + DynamicData + + Label string `xml:"label"` + Url string `xml:"url"` +} + +func init() { + t["ExtSolutionManagerInfoTabInfo"] = reflect.TypeOf((*ExtSolutionManagerInfoTabInfo)(nil)).Elem() +} + +type ExtendVffs ExtendVffsRequestType + +func init() { + t["ExtendVffs"] = reflect.TypeOf((*ExtendVffs)(nil)).Elem() +} + +type ExtendVffsRequestType struct { + This ManagedObjectReference `xml:"_this"` + VffsPath string `xml:"vffsPath"` + DevicePath string `xml:"devicePath"` + Spec *HostDiskPartitionSpec `xml:"spec,omitempty"` +} + +func init() { + t["ExtendVffsRequestType"] = reflect.TypeOf((*ExtendVffsRequestType)(nil)).Elem() +} + +type ExtendVffsResponse struct { +} + +type ExtendVirtualDiskRequestType struct { + This ManagedObjectReference `xml:"_this"` + Name string `xml:"name"` + Datacenter *ManagedObjectReference `xml:"datacenter,omitempty"` + NewCapacityKb int64 `xml:"newCapacityKb"` + EagerZero *bool `xml:"eagerZero"` +} + +func init() { + t["ExtendVirtualDiskRequestType"] = reflect.TypeOf((*ExtendVirtualDiskRequestType)(nil)).Elem() +} + +type ExtendVirtualDisk_Task ExtendVirtualDiskRequestType + +func init() { + t["ExtendVirtualDisk_Task"] = reflect.TypeOf((*ExtendVirtualDisk_Task)(nil)).Elem() +} + +type ExtendVirtualDisk_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type ExtendVmfsDatastore ExtendVmfsDatastoreRequestType + +func init() { + t["ExtendVmfsDatastore"] = reflect.TypeOf((*ExtendVmfsDatastore)(nil)).Elem() +} + +type ExtendVmfsDatastoreRequestType struct { + This ManagedObjectReference `xml:"_this"` + Datastore ManagedObjectReference `xml:"datastore"` + Spec VmfsDatastoreExtendSpec `xml:"spec"` +} + +func init() { + t["ExtendVmfsDatastoreRequestType"] = reflect.TypeOf((*ExtendVmfsDatastoreRequestType)(nil)).Elem() +} + +type ExtendVmfsDatastoreResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type ExtendedDescription struct { + Description + + MessageCatalogKeyPrefix string `xml:"messageCatalogKeyPrefix"` + MessageArg []KeyAnyValue `xml:"messageArg,omitempty"` +} + +func init() { + t["ExtendedDescription"] = reflect.TypeOf((*ExtendedDescription)(nil)).Elem() +} + +type ExtendedElementDescription struct { + ElementDescription + + MessageCatalogKeyPrefix string `xml:"messageCatalogKeyPrefix"` + MessageArg []KeyAnyValue `xml:"messageArg,omitempty"` +} + +func init() { + t["ExtendedElementDescription"] = reflect.TypeOf((*ExtendedElementDescription)(nil)).Elem() +} + +type ExtendedEvent struct { + GeneralEvent + + EventTypeId string `xml:"eventTypeId"` + ManagedObject ManagedObjectReference `xml:"managedObject"` + Data []ExtendedEventPair `xml:"data,omitempty"` +} + +func init() { + t["ExtendedEvent"] = reflect.TypeOf((*ExtendedEvent)(nil)).Elem() +} + +type ExtendedEventPair struct { + DynamicData + + Key string `xml:"key"` + Value string `xml:"value"` +} + +func init() { + t["ExtendedEventPair"] = reflect.TypeOf((*ExtendedEventPair)(nil)).Elem() +} + +type ExtendedFault struct { + VimFault + + FaultTypeId string `xml:"faultTypeId"` + Data []KeyValue `xml:"data,omitempty"` +} + +func init() { + t["ExtendedFault"] = reflect.TypeOf((*ExtendedFault)(nil)).Elem() +} + +type ExtendedFaultFault ExtendedFault + +func init() { + t["ExtendedFaultFault"] = reflect.TypeOf((*ExtendedFaultFault)(nil)).Elem() +} + +type Extension struct { + DynamicData + + Description BaseDescription `xml:"description,typeattr"` + Key string `xml:"key"` + Company string `xml:"company,omitempty"` + Type string `xml:"type,omitempty"` + Version string `xml:"version"` + SubjectName string `xml:"subjectName,omitempty"` + Server []ExtensionServerInfo `xml:"server,omitempty"` + Client []ExtensionClientInfo `xml:"client,omitempty"` + TaskList []ExtensionTaskTypeInfo `xml:"taskList,omitempty"` + EventList []ExtensionEventTypeInfo `xml:"eventList,omitempty"` + FaultList []ExtensionFaultTypeInfo `xml:"faultList,omitempty"` + PrivilegeList []ExtensionPrivilegeInfo `xml:"privilegeList,omitempty"` + ResourceList []ExtensionResourceInfo `xml:"resourceList,omitempty"` + LastHeartbeatTime time.Time `xml:"lastHeartbeatTime"` + HealthInfo *ExtensionHealthInfo `xml:"healthInfo,omitempty"` + OvfConsumerInfo *ExtensionOvfConsumerInfo `xml:"ovfConsumerInfo,omitempty"` + ExtendedProductInfo *ExtExtendedProductInfo `xml:"extendedProductInfo,omitempty"` + ManagedEntityInfo []ExtManagedEntityInfo `xml:"managedEntityInfo,omitempty"` + ShownInSolutionManager *bool `xml:"shownInSolutionManager"` + SolutionManagerInfo *ExtSolutionManagerInfo `xml:"solutionManagerInfo,omitempty"` +} + +func init() { + t["Extension"] = reflect.TypeOf((*Extension)(nil)).Elem() +} + +type ExtensionClientInfo struct { + DynamicData + + Version string `xml:"version"` + Description BaseDescription `xml:"description,typeattr"` + Company string `xml:"company"` + Type string `xml:"type"` + Url string `xml:"url"` +} + +func init() { + t["ExtensionClientInfo"] = reflect.TypeOf((*ExtensionClientInfo)(nil)).Elem() +} + +type ExtensionEventTypeInfo struct { + DynamicData + + EventID string `xml:"eventID"` + EventTypeSchema string `xml:"eventTypeSchema,omitempty"` +} + +func init() { + t["ExtensionEventTypeInfo"] = reflect.TypeOf((*ExtensionEventTypeInfo)(nil)).Elem() +} + +type ExtensionFaultTypeInfo struct { + DynamicData + + FaultID string `xml:"faultID"` +} + +func init() { + t["ExtensionFaultTypeInfo"] = reflect.TypeOf((*ExtensionFaultTypeInfo)(nil)).Elem() +} + +type ExtensionHealthInfo struct { + DynamicData + + Url string `xml:"url"` +} + +func init() { + t["ExtensionHealthInfo"] = reflect.TypeOf((*ExtensionHealthInfo)(nil)).Elem() +} + +type ExtensionManagerIpAllocationUsage struct { + DynamicData + + ExtensionKey string `xml:"extensionKey"` + NumAddresses int32 `xml:"numAddresses"` +} + +func init() { + t["ExtensionManagerIpAllocationUsage"] = reflect.TypeOf((*ExtensionManagerIpAllocationUsage)(nil)).Elem() +} + +type ExtensionOvfConsumerInfo struct { + DynamicData + + CallbackUrl string `xml:"callbackUrl"` + SectionType []string `xml:"sectionType"` +} + +func init() { + t["ExtensionOvfConsumerInfo"] = reflect.TypeOf((*ExtensionOvfConsumerInfo)(nil)).Elem() +} + +type ExtensionPrivilegeInfo struct { + DynamicData + + PrivID string `xml:"privID"` + PrivGroupName string `xml:"privGroupName"` +} + +func init() { + t["ExtensionPrivilegeInfo"] = reflect.TypeOf((*ExtensionPrivilegeInfo)(nil)).Elem() +} + +type ExtensionResourceInfo struct { + DynamicData + + Locale string `xml:"locale"` + Module string `xml:"module"` + Data []KeyValue `xml:"data"` +} + +func init() { + t["ExtensionResourceInfo"] = reflect.TypeOf((*ExtensionResourceInfo)(nil)).Elem() +} + +type ExtensionServerInfo struct { + DynamicData + + Url string `xml:"url"` + Description BaseDescription `xml:"description,typeattr"` + Company string `xml:"company"` + Type string `xml:"type"` + AdminEmail []string `xml:"adminEmail"` + ServerThumbprint string `xml:"serverThumbprint,omitempty"` +} + +func init() { + t["ExtensionServerInfo"] = reflect.TypeOf((*ExtensionServerInfo)(nil)).Elem() +} + +type ExtensionTaskTypeInfo struct { + DynamicData + + TaskID string `xml:"taskID"` +} + +func init() { + t["ExtensionTaskTypeInfo"] = reflect.TypeOf((*ExtensionTaskTypeInfo)(nil)).Elem() +} + +type ExtractOvfEnvironment ExtractOvfEnvironmentRequestType + +func init() { + t["ExtractOvfEnvironment"] = reflect.TypeOf((*ExtractOvfEnvironment)(nil)).Elem() +} + +type ExtractOvfEnvironmentRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["ExtractOvfEnvironmentRequestType"] = reflect.TypeOf((*ExtractOvfEnvironmentRequestType)(nil)).Elem() +} + +type ExtractOvfEnvironmentResponse struct { + Returnval string `xml:"returnval"` +} + +type FailToEnableSPBM struct { + NotEnoughLicenses + + Cs ManagedObjectReference `xml:"cs"` + CsName string `xml:"csName"` + HostLicenseStates []ComputeResourceHostSPBMLicenseInfo `xml:"hostLicenseStates"` +} + +func init() { + t["FailToEnableSPBM"] = reflect.TypeOf((*FailToEnableSPBM)(nil)).Elem() +} + +type FailToEnableSPBMFault FailToEnableSPBM + +func init() { + t["FailToEnableSPBMFault"] = reflect.TypeOf((*FailToEnableSPBMFault)(nil)).Elem() +} + +type FailToLockFaultToleranceVMs struct { + RuntimeFault + + VmName string `xml:"vmName"` + Vm ManagedObjectReference `xml:"vm"` + AlreadyLockedVm ManagedObjectReference `xml:"alreadyLockedVm"` +} + +func init() { + t["FailToLockFaultToleranceVMs"] = reflect.TypeOf((*FailToLockFaultToleranceVMs)(nil)).Elem() +} + +type FailToLockFaultToleranceVMsFault FailToLockFaultToleranceVMs + +func init() { + t["FailToLockFaultToleranceVMsFault"] = reflect.TypeOf((*FailToLockFaultToleranceVMsFault)(nil)).Elem() +} + +type FailoverLevelRestored struct { + ClusterEvent +} + +func init() { + t["FailoverLevelRestored"] = reflect.TypeOf((*FailoverLevelRestored)(nil)).Elem() +} + +type FaultToleranceAntiAffinityViolated struct { + MigrationFault + + HostName string `xml:"hostName"` + Host ManagedObjectReference `xml:"host"` +} + +func init() { + t["FaultToleranceAntiAffinityViolated"] = reflect.TypeOf((*FaultToleranceAntiAffinityViolated)(nil)).Elem() +} + +type FaultToleranceAntiAffinityViolatedFault FaultToleranceAntiAffinityViolated + +func init() { + t["FaultToleranceAntiAffinityViolatedFault"] = reflect.TypeOf((*FaultToleranceAntiAffinityViolatedFault)(nil)).Elem() +} + +type FaultToleranceCannotEditMem struct { + VmConfigFault + + VmName string `xml:"vmName"` + Vm ManagedObjectReference `xml:"vm"` +} + +func init() { + t["FaultToleranceCannotEditMem"] = reflect.TypeOf((*FaultToleranceCannotEditMem)(nil)).Elem() +} + +type FaultToleranceCannotEditMemFault FaultToleranceCannotEditMem + +func init() { + t["FaultToleranceCannotEditMemFault"] = reflect.TypeOf((*FaultToleranceCannotEditMemFault)(nil)).Elem() +} + +type FaultToleranceConfigInfo struct { + DynamicData + + Role int32 `xml:"role"` + InstanceUuids []string `xml:"instanceUuids"` + ConfigPaths []string `xml:"configPaths"` + Orphaned *bool `xml:"orphaned"` +} + +func init() { + t["FaultToleranceConfigInfo"] = reflect.TypeOf((*FaultToleranceConfigInfo)(nil)).Elem() +} + +type FaultToleranceConfigSpec struct { + DynamicData + + MetaDataPath *FaultToleranceMetaSpec `xml:"metaDataPath,omitempty"` + SecondaryVmSpec *FaultToleranceVMConfigSpec `xml:"secondaryVmSpec,omitempty"` +} + +func init() { + t["FaultToleranceConfigSpec"] = reflect.TypeOf((*FaultToleranceConfigSpec)(nil)).Elem() +} + +type FaultToleranceCpuIncompatible struct { + CpuIncompatible + + Model bool `xml:"model"` + Family bool `xml:"family"` + Stepping bool `xml:"stepping"` +} + +func init() { + t["FaultToleranceCpuIncompatible"] = reflect.TypeOf((*FaultToleranceCpuIncompatible)(nil)).Elem() +} + +type FaultToleranceCpuIncompatibleFault FaultToleranceCpuIncompatible + +func init() { + t["FaultToleranceCpuIncompatibleFault"] = reflect.TypeOf((*FaultToleranceCpuIncompatibleFault)(nil)).Elem() +} + +type FaultToleranceDiskSpec struct { + DynamicData + + Disk BaseVirtualDevice `xml:"disk,typeattr"` + Datastore ManagedObjectReference `xml:"datastore"` +} + +func init() { + t["FaultToleranceDiskSpec"] = reflect.TypeOf((*FaultToleranceDiskSpec)(nil)).Elem() +} + +type FaultToleranceMetaSpec struct { + DynamicData + + MetaDataDatastore ManagedObjectReference `xml:"metaDataDatastore"` +} + +func init() { + t["FaultToleranceMetaSpec"] = reflect.TypeOf((*FaultToleranceMetaSpec)(nil)).Elem() +} + +type FaultToleranceNeedsThickDisk struct { + MigrationFault + + VmName string `xml:"vmName"` +} + +func init() { + t["FaultToleranceNeedsThickDisk"] = reflect.TypeOf((*FaultToleranceNeedsThickDisk)(nil)).Elem() +} + +type FaultToleranceNeedsThickDiskFault FaultToleranceNeedsThickDisk + +func init() { + t["FaultToleranceNeedsThickDiskFault"] = reflect.TypeOf((*FaultToleranceNeedsThickDiskFault)(nil)).Elem() +} + +type FaultToleranceNotLicensed struct { + VmFaultToleranceIssue + + HostName string `xml:"hostName,omitempty"` +} + +func init() { + t["FaultToleranceNotLicensed"] = reflect.TypeOf((*FaultToleranceNotLicensed)(nil)).Elem() +} + +type FaultToleranceNotLicensedFault FaultToleranceNotLicensed + +func init() { + t["FaultToleranceNotLicensedFault"] = reflect.TypeOf((*FaultToleranceNotLicensedFault)(nil)).Elem() +} + +type FaultToleranceNotSameBuild struct { + MigrationFault + + Build string `xml:"build"` +} + +func init() { + t["FaultToleranceNotSameBuild"] = reflect.TypeOf((*FaultToleranceNotSameBuild)(nil)).Elem() +} + +type FaultToleranceNotSameBuildFault FaultToleranceNotSameBuild + +func init() { + t["FaultToleranceNotSameBuildFault"] = reflect.TypeOf((*FaultToleranceNotSameBuildFault)(nil)).Elem() +} + +type FaultTolerancePrimaryConfigInfo struct { + FaultToleranceConfigInfo + + Secondaries []ManagedObjectReference `xml:"secondaries"` +} + +func init() { + t["FaultTolerancePrimaryConfigInfo"] = reflect.TypeOf((*FaultTolerancePrimaryConfigInfo)(nil)).Elem() +} + +type FaultTolerancePrimaryPowerOnNotAttempted struct { + VmFaultToleranceIssue + + SecondaryVm ManagedObjectReference `xml:"secondaryVm"` + PrimaryVm ManagedObjectReference `xml:"primaryVm"` +} + +func init() { + t["FaultTolerancePrimaryPowerOnNotAttempted"] = reflect.TypeOf((*FaultTolerancePrimaryPowerOnNotAttempted)(nil)).Elem() +} + +type FaultTolerancePrimaryPowerOnNotAttemptedFault FaultTolerancePrimaryPowerOnNotAttempted + +func init() { + t["FaultTolerancePrimaryPowerOnNotAttemptedFault"] = reflect.TypeOf((*FaultTolerancePrimaryPowerOnNotAttemptedFault)(nil)).Elem() +} + +type FaultToleranceSecondaryConfigInfo struct { + FaultToleranceConfigInfo + + PrimaryVM ManagedObjectReference `xml:"primaryVM"` +} + +func init() { + t["FaultToleranceSecondaryConfigInfo"] = reflect.TypeOf((*FaultToleranceSecondaryConfigInfo)(nil)).Elem() +} + +type FaultToleranceSecondaryOpResult struct { + DynamicData + + Vm ManagedObjectReference `xml:"vm"` + PowerOnAttempted bool `xml:"powerOnAttempted"` + PowerOnResult *ClusterPowerOnVmResult `xml:"powerOnResult,omitempty"` +} + +func init() { + t["FaultToleranceSecondaryOpResult"] = reflect.TypeOf((*FaultToleranceSecondaryOpResult)(nil)).Elem() +} + +type FaultToleranceVMConfigSpec struct { + DynamicData + + VmConfig *ManagedObjectReference `xml:"vmConfig,omitempty"` + Disks []FaultToleranceDiskSpec `xml:"disks,omitempty"` +} + +func init() { + t["FaultToleranceVMConfigSpec"] = reflect.TypeOf((*FaultToleranceVMConfigSpec)(nil)).Elem() +} + +type FaultToleranceVmNotDasProtected struct { + VimFault + + Vm ManagedObjectReference `xml:"vm"` + VmName string `xml:"vmName"` +} + +func init() { + t["FaultToleranceVmNotDasProtected"] = reflect.TypeOf((*FaultToleranceVmNotDasProtected)(nil)).Elem() +} + +type FaultToleranceVmNotDasProtectedFault FaultToleranceVmNotDasProtected + +func init() { + t["FaultToleranceVmNotDasProtectedFault"] = reflect.TypeOf((*FaultToleranceVmNotDasProtectedFault)(nil)).Elem() +} + +type FcoeConfig struct { + DynamicData + + PriorityClass int32 `xml:"priorityClass"` + SourceMac string `xml:"sourceMac"` + VlanRange []FcoeConfigVlanRange `xml:"vlanRange"` + Capabilities FcoeConfigFcoeCapabilities `xml:"capabilities"` + FcoeActive bool `xml:"fcoeActive"` +} + +func init() { + t["FcoeConfig"] = reflect.TypeOf((*FcoeConfig)(nil)).Elem() +} + +type FcoeConfigFcoeCapabilities struct { + DynamicData + + PriorityClass bool `xml:"priorityClass"` + SourceMacAddress bool `xml:"sourceMacAddress"` + VlanRange bool `xml:"vlanRange"` +} + +func init() { + t["FcoeConfigFcoeCapabilities"] = reflect.TypeOf((*FcoeConfigFcoeCapabilities)(nil)).Elem() +} + +type FcoeConfigFcoeSpecification struct { + DynamicData + + UnderlyingPnic string `xml:"underlyingPnic"` + PriorityClass int32 `xml:"priorityClass,omitempty"` + SourceMac string `xml:"sourceMac,omitempty"` + VlanRange []FcoeConfigVlanRange `xml:"vlanRange,omitempty"` +} + +func init() { + t["FcoeConfigFcoeSpecification"] = reflect.TypeOf((*FcoeConfigFcoeSpecification)(nil)).Elem() +} + +type FcoeConfigVlanRange struct { + DynamicData + + VlanLow int32 `xml:"vlanLow"` + VlanHigh int32 `xml:"vlanHigh"` +} + +func init() { + t["FcoeConfigVlanRange"] = reflect.TypeOf((*FcoeConfigVlanRange)(nil)).Elem() +} + +type FcoeFault struct { + VimFault +} + +func init() { + t["FcoeFault"] = reflect.TypeOf((*FcoeFault)(nil)).Elem() +} + +type FcoeFaultFault BaseFcoeFault + +func init() { + t["FcoeFaultFault"] = reflect.TypeOf((*FcoeFaultFault)(nil)).Elem() +} + +type FcoeFaultPnicHasNoPortSet struct { + FcoeFault + + NicDevice string `xml:"nicDevice"` +} + +func init() { + t["FcoeFaultPnicHasNoPortSet"] = reflect.TypeOf((*FcoeFaultPnicHasNoPortSet)(nil)).Elem() +} + +type FcoeFaultPnicHasNoPortSetFault FcoeFaultPnicHasNoPortSet + +func init() { + t["FcoeFaultPnicHasNoPortSetFault"] = reflect.TypeOf((*FcoeFaultPnicHasNoPortSetFault)(nil)).Elem() +} + +type FeatureRequirementsNotMet struct { + VirtualHardwareCompatibilityIssue + + FeatureRequirement []VirtualMachineFeatureRequirement `xml:"featureRequirement,omitempty"` + Vm *ManagedObjectReference `xml:"vm,omitempty"` + Host *ManagedObjectReference `xml:"host,omitempty"` +} + +func init() { + t["FeatureRequirementsNotMet"] = reflect.TypeOf((*FeatureRequirementsNotMet)(nil)).Elem() +} + +type FeatureRequirementsNotMetFault FeatureRequirementsNotMet + +func init() { + t["FeatureRequirementsNotMetFault"] = reflect.TypeOf((*FeatureRequirementsNotMetFault)(nil)).Elem() +} + +type FetchDVPortKeys FetchDVPortKeysRequestType + +func init() { + t["FetchDVPortKeys"] = reflect.TypeOf((*FetchDVPortKeys)(nil)).Elem() +} + +type FetchDVPortKeysRequestType struct { + This ManagedObjectReference `xml:"_this"` + Criteria *DistributedVirtualSwitchPortCriteria `xml:"criteria,omitempty"` +} + +func init() { + t["FetchDVPortKeysRequestType"] = reflect.TypeOf((*FetchDVPortKeysRequestType)(nil)).Elem() +} + +type FetchDVPortKeysResponse struct { + Returnval []string `xml:"returnval,omitempty"` +} + +type FetchDVPorts FetchDVPortsRequestType + +func init() { + t["FetchDVPorts"] = reflect.TypeOf((*FetchDVPorts)(nil)).Elem() +} + +type FetchDVPortsRequestType struct { + This ManagedObjectReference `xml:"_this"` + Criteria *DistributedVirtualSwitchPortCriteria `xml:"criteria,omitempty"` +} + +func init() { + t["FetchDVPortsRequestType"] = reflect.TypeOf((*FetchDVPortsRequestType)(nil)).Elem() +} + +type FetchDVPortsResponse struct { + Returnval []DistributedVirtualPort `xml:"returnval,omitempty"` +} + +type FileAlreadyExists struct { + FileFault +} + +func init() { + t["FileAlreadyExists"] = reflect.TypeOf((*FileAlreadyExists)(nil)).Elem() +} + +type FileAlreadyExistsFault FileAlreadyExists + +func init() { + t["FileAlreadyExistsFault"] = reflect.TypeOf((*FileAlreadyExistsFault)(nil)).Elem() +} + +type FileBackedPortNotSupported struct { + DeviceNotSupported +} + +func init() { + t["FileBackedPortNotSupported"] = reflect.TypeOf((*FileBackedPortNotSupported)(nil)).Elem() +} + +type FileBackedPortNotSupportedFault FileBackedPortNotSupported + +func init() { + t["FileBackedPortNotSupportedFault"] = reflect.TypeOf((*FileBackedPortNotSupportedFault)(nil)).Elem() +} + +type FileBackedVirtualDiskSpec struct { + VirtualDiskSpec + + CapacityKb int64 `xml:"capacityKb"` + Profile []BaseVirtualMachineProfileSpec `xml:"profile,omitempty,typeattr"` +} + +func init() { + t["FileBackedVirtualDiskSpec"] = reflect.TypeOf((*FileBackedVirtualDiskSpec)(nil)).Elem() +} + +type FileFault struct { + VimFault + + File string `xml:"file"` +} + +func init() { + t["FileFault"] = reflect.TypeOf((*FileFault)(nil)).Elem() +} + +type FileFaultFault BaseFileFault + +func init() { + t["FileFaultFault"] = reflect.TypeOf((*FileFaultFault)(nil)).Elem() +} + +type FileInfo struct { + DynamicData + + Path string `xml:"path"` + FileSize int64 `xml:"fileSize,omitempty"` + Modification *time.Time `xml:"modification"` + Owner string `xml:"owner,omitempty"` +} + +func init() { + t["FileInfo"] = reflect.TypeOf((*FileInfo)(nil)).Elem() +} + +type FileLocked struct { + FileFault +} + +func init() { + t["FileLocked"] = reflect.TypeOf((*FileLocked)(nil)).Elem() +} + +type FileLockedFault FileLocked + +func init() { + t["FileLockedFault"] = reflect.TypeOf((*FileLockedFault)(nil)).Elem() +} + +type FileNameTooLong struct { + FileFault +} + +func init() { + t["FileNameTooLong"] = reflect.TypeOf((*FileNameTooLong)(nil)).Elem() +} + +type FileNameTooLongFault FileNameTooLong + +func init() { + t["FileNameTooLongFault"] = reflect.TypeOf((*FileNameTooLongFault)(nil)).Elem() +} + +type FileNotFound struct { + FileFault +} + +func init() { + t["FileNotFound"] = reflect.TypeOf((*FileNotFound)(nil)).Elem() +} + +type FileNotFoundFault FileNotFound + +func init() { + t["FileNotFoundFault"] = reflect.TypeOf((*FileNotFoundFault)(nil)).Elem() +} + +type FileNotWritable struct { + FileFault +} + +func init() { + t["FileNotWritable"] = reflect.TypeOf((*FileNotWritable)(nil)).Elem() +} + +type FileNotWritableFault FileNotWritable + +func init() { + t["FileNotWritableFault"] = reflect.TypeOf((*FileNotWritableFault)(nil)).Elem() +} + +type FileQuery struct { + DynamicData +} + +func init() { + t["FileQuery"] = reflect.TypeOf((*FileQuery)(nil)).Elem() +} + +type FileQueryFlags struct { + DynamicData + + FileType bool `xml:"fileType"` + FileSize bool `xml:"fileSize"` + Modification bool `xml:"modification"` + FileOwner *bool `xml:"fileOwner"` +} + +func init() { + t["FileQueryFlags"] = reflect.TypeOf((*FileQueryFlags)(nil)).Elem() +} + +type FileTooLarge struct { + FileFault + + Datastore string `xml:"datastore"` + FileSize int64 `xml:"fileSize"` + MaxFileSize int64 `xml:"maxFileSize,omitempty"` +} + +func init() { + t["FileTooLarge"] = reflect.TypeOf((*FileTooLarge)(nil)).Elem() +} + +type FileTooLargeFault FileTooLarge + +func init() { + t["FileTooLargeFault"] = reflect.TypeOf((*FileTooLargeFault)(nil)).Elem() +} + +type FileTransferInformation struct { + DynamicData + + Attributes BaseGuestFileAttributes `xml:"attributes,typeattr"` + Size int64 `xml:"size"` + Url string `xml:"url"` +} + +func init() { + t["FileTransferInformation"] = reflect.TypeOf((*FileTransferInformation)(nil)).Elem() +} + +type FilesystemQuiesceFault struct { + SnapshotFault +} + +func init() { + t["FilesystemQuiesceFault"] = reflect.TypeOf((*FilesystemQuiesceFault)(nil)).Elem() +} + +type FilesystemQuiesceFaultFault FilesystemQuiesceFault + +func init() { + t["FilesystemQuiesceFaultFault"] = reflect.TypeOf((*FilesystemQuiesceFaultFault)(nil)).Elem() +} + +type FilterInUse struct { + ResourceInUse + + Disk []VirtualDiskId `xml:"disk,omitempty"` +} + +func init() { + t["FilterInUse"] = reflect.TypeOf((*FilterInUse)(nil)).Elem() +} + +type FilterInUseFault FilterInUse + +func init() { + t["FilterInUseFault"] = reflect.TypeOf((*FilterInUseFault)(nil)).Elem() +} + +type FindAllByDnsName FindAllByDnsNameRequestType + +func init() { + t["FindAllByDnsName"] = reflect.TypeOf((*FindAllByDnsName)(nil)).Elem() +} + +type FindAllByDnsNameRequestType struct { + This ManagedObjectReference `xml:"_this"` + Datacenter *ManagedObjectReference `xml:"datacenter,omitempty"` + DnsName string `xml:"dnsName"` + VmSearch bool `xml:"vmSearch"` +} + +func init() { + t["FindAllByDnsNameRequestType"] = reflect.TypeOf((*FindAllByDnsNameRequestType)(nil)).Elem() +} + +type FindAllByDnsNameResponse struct { + Returnval []ManagedObjectReference `xml:"returnval"` +} + +type FindAllByIp FindAllByIpRequestType + +func init() { + t["FindAllByIp"] = reflect.TypeOf((*FindAllByIp)(nil)).Elem() +} + +type FindAllByIpRequestType struct { + This ManagedObjectReference `xml:"_this"` + Datacenter *ManagedObjectReference `xml:"datacenter,omitempty"` + Ip string `xml:"ip"` + VmSearch bool `xml:"vmSearch"` +} + +func init() { + t["FindAllByIpRequestType"] = reflect.TypeOf((*FindAllByIpRequestType)(nil)).Elem() +} + +type FindAllByIpResponse struct { + Returnval []ManagedObjectReference `xml:"returnval"` +} + +type FindAllByUuid FindAllByUuidRequestType + +func init() { + t["FindAllByUuid"] = reflect.TypeOf((*FindAllByUuid)(nil)).Elem() +} + +type FindAllByUuidRequestType struct { + This ManagedObjectReference `xml:"_this"` + Datacenter *ManagedObjectReference `xml:"datacenter,omitempty"` + Uuid string `xml:"uuid"` + VmSearch bool `xml:"vmSearch"` + InstanceUuid *bool `xml:"instanceUuid"` +} + +func init() { + t["FindAllByUuidRequestType"] = reflect.TypeOf((*FindAllByUuidRequestType)(nil)).Elem() +} + +type FindAllByUuidResponse struct { + Returnval []ManagedObjectReference `xml:"returnval"` +} + +type FindAssociatedProfile FindAssociatedProfileRequestType + +func init() { + t["FindAssociatedProfile"] = reflect.TypeOf((*FindAssociatedProfile)(nil)).Elem() +} + +type FindAssociatedProfileRequestType struct { + This ManagedObjectReference `xml:"_this"` + Entity ManagedObjectReference `xml:"entity"` +} + +func init() { + t["FindAssociatedProfileRequestType"] = reflect.TypeOf((*FindAssociatedProfileRequestType)(nil)).Elem() +} + +type FindAssociatedProfileResponse struct { + Returnval []ManagedObjectReference `xml:"returnval,omitempty"` +} + +type FindByDatastorePath FindByDatastorePathRequestType + +func init() { + t["FindByDatastorePath"] = reflect.TypeOf((*FindByDatastorePath)(nil)).Elem() +} + +type FindByDatastorePathRequestType struct { + This ManagedObjectReference `xml:"_this"` + Datacenter ManagedObjectReference `xml:"datacenter"` + Path string `xml:"path"` +} + +func init() { + t["FindByDatastorePathRequestType"] = reflect.TypeOf((*FindByDatastorePathRequestType)(nil)).Elem() +} + +type FindByDatastorePathResponse struct { + Returnval *ManagedObjectReference `xml:"returnval,omitempty"` +} + +type FindByDnsName FindByDnsNameRequestType + +func init() { + t["FindByDnsName"] = reflect.TypeOf((*FindByDnsName)(nil)).Elem() +} + +type FindByDnsNameRequestType struct { + This ManagedObjectReference `xml:"_this"` + Datacenter *ManagedObjectReference `xml:"datacenter,omitempty"` + DnsName string `xml:"dnsName"` + VmSearch bool `xml:"vmSearch"` +} + +func init() { + t["FindByDnsNameRequestType"] = reflect.TypeOf((*FindByDnsNameRequestType)(nil)).Elem() +} + +type FindByDnsNameResponse struct { + Returnval *ManagedObjectReference `xml:"returnval,omitempty"` +} + +type FindByInventoryPath FindByInventoryPathRequestType + +func init() { + t["FindByInventoryPath"] = reflect.TypeOf((*FindByInventoryPath)(nil)).Elem() +} + +type FindByInventoryPathRequestType struct { + This ManagedObjectReference `xml:"_this"` + InventoryPath string `xml:"inventoryPath"` +} + +func init() { + t["FindByInventoryPathRequestType"] = reflect.TypeOf((*FindByInventoryPathRequestType)(nil)).Elem() +} + +type FindByInventoryPathResponse struct { + Returnval *ManagedObjectReference `xml:"returnval,omitempty"` +} + +type FindByIp FindByIpRequestType + +func init() { + t["FindByIp"] = reflect.TypeOf((*FindByIp)(nil)).Elem() +} + +type FindByIpRequestType struct { + This ManagedObjectReference `xml:"_this"` + Datacenter *ManagedObjectReference `xml:"datacenter,omitempty"` + Ip string `xml:"ip"` + VmSearch bool `xml:"vmSearch"` +} + +func init() { + t["FindByIpRequestType"] = reflect.TypeOf((*FindByIpRequestType)(nil)).Elem() +} + +type FindByIpResponse struct { + Returnval *ManagedObjectReference `xml:"returnval,omitempty"` +} + +type FindByUuid FindByUuidRequestType + +func init() { + t["FindByUuid"] = reflect.TypeOf((*FindByUuid)(nil)).Elem() +} + +type FindByUuidRequestType struct { + This ManagedObjectReference `xml:"_this"` + Datacenter *ManagedObjectReference `xml:"datacenter,omitempty"` + Uuid string `xml:"uuid"` + VmSearch bool `xml:"vmSearch"` + InstanceUuid *bool `xml:"instanceUuid"` +} + +func init() { + t["FindByUuidRequestType"] = reflect.TypeOf((*FindByUuidRequestType)(nil)).Elem() +} + +type FindByUuidResponse struct { + Returnval *ManagedObjectReference `xml:"returnval,omitempty"` +} + +type FindChild FindChildRequestType + +func init() { + t["FindChild"] = reflect.TypeOf((*FindChild)(nil)).Elem() +} + +type FindChildRequestType struct { + This ManagedObjectReference `xml:"_this"` + Entity ManagedObjectReference `xml:"entity"` + Name string `xml:"name"` +} + +func init() { + t["FindChildRequestType"] = reflect.TypeOf((*FindChildRequestType)(nil)).Elem() +} + +type FindChildResponse struct { + Returnval *ManagedObjectReference `xml:"returnval,omitempty"` +} + +type FindExtension FindExtensionRequestType + +func init() { + t["FindExtension"] = reflect.TypeOf((*FindExtension)(nil)).Elem() +} + +type FindExtensionRequestType struct { + This ManagedObjectReference `xml:"_this"` + ExtensionKey string `xml:"extensionKey"` +} + +func init() { + t["FindExtensionRequestType"] = reflect.TypeOf((*FindExtensionRequestType)(nil)).Elem() +} + +type FindExtensionResponse struct { + Returnval *Extension `xml:"returnval,omitempty"` +} + +type FindRulesForVm FindRulesForVmRequestType + +func init() { + t["FindRulesForVm"] = reflect.TypeOf((*FindRulesForVm)(nil)).Elem() +} + +type FindRulesForVmRequestType struct { + This ManagedObjectReference `xml:"_this"` + Vm ManagedObjectReference `xml:"vm"` +} + +func init() { + t["FindRulesForVmRequestType"] = reflect.TypeOf((*FindRulesForVmRequestType)(nil)).Elem() +} + +type FindRulesForVmResponse struct { + Returnval []BaseClusterRuleInfo `xml:"returnval,omitempty,typeattr"` +} + +type FirewallProfile struct { + ApplyProfile + + Ruleset []FirewallProfileRulesetProfile `xml:"ruleset,omitempty"` +} + +func init() { + t["FirewallProfile"] = reflect.TypeOf((*FirewallProfile)(nil)).Elem() +} + +type FirewallProfileRulesetProfile struct { + ApplyProfile + + Key string `xml:"key"` +} + +func init() { + t["FirewallProfileRulesetProfile"] = reflect.TypeOf((*FirewallProfileRulesetProfile)(nil)).Elem() +} + +type FloatOption struct { + OptionType + + Min float32 `xml:"min"` + Max float32 `xml:"max"` + DefaultValue float32 `xml:"defaultValue"` +} + +func init() { + t["FloatOption"] = reflect.TypeOf((*FloatOption)(nil)).Elem() +} + +type FloppyImageFileInfo struct { + FileInfo +} + +func init() { + t["FloppyImageFileInfo"] = reflect.TypeOf((*FloppyImageFileInfo)(nil)).Elem() +} + +type FloppyImageFileQuery struct { + FileQuery +} + +func init() { + t["FloppyImageFileQuery"] = reflect.TypeOf((*FloppyImageFileQuery)(nil)).Elem() +} + +type FolderEventArgument struct { + EntityEventArgument + + Folder ManagedObjectReference `xml:"folder"` +} + +func init() { + t["FolderEventArgument"] = reflect.TypeOf((*FolderEventArgument)(nil)).Elem() +} + +type FolderFileInfo struct { + FileInfo +} + +func init() { + t["FolderFileInfo"] = reflect.TypeOf((*FolderFileInfo)(nil)).Elem() +} + +type FolderFileQuery struct { + FileQuery +} + +func init() { + t["FolderFileQuery"] = reflect.TypeOf((*FolderFileQuery)(nil)).Elem() +} + +type FormatVffs FormatVffsRequestType + +func init() { + t["FormatVffs"] = reflect.TypeOf((*FormatVffs)(nil)).Elem() +} + +type FormatVffsRequestType struct { + This ManagedObjectReference `xml:"_this"` + CreateSpec HostVffsSpec `xml:"createSpec"` +} + +func init() { + t["FormatVffsRequestType"] = reflect.TypeOf((*FormatVffsRequestType)(nil)).Elem() +} + +type FormatVffsResponse struct { + Returnval HostVffsVolume `xml:"returnval"` +} + +type FormatVmfs FormatVmfsRequestType + +func init() { + t["FormatVmfs"] = reflect.TypeOf((*FormatVmfs)(nil)).Elem() +} + +type FormatVmfsRequestType struct { + This ManagedObjectReference `xml:"_this"` + CreateSpec HostVmfsSpec `xml:"createSpec"` +} + +func init() { + t["FormatVmfsRequestType"] = reflect.TypeOf((*FormatVmfsRequestType)(nil)).Elem() +} + +type FormatVmfsResponse struct { + Returnval HostVmfsVolume `xml:"returnval"` +} + +type FtIssuesOnHost struct { + VmFaultToleranceIssue + + Host ManagedObjectReference `xml:"host"` + HostName string `xml:"hostName"` + Errors []LocalizedMethodFault `xml:"errors,omitempty"` +} + +func init() { + t["FtIssuesOnHost"] = reflect.TypeOf((*FtIssuesOnHost)(nil)).Elem() +} + +type FtIssuesOnHostFault FtIssuesOnHost + +func init() { + t["FtIssuesOnHostFault"] = reflect.TypeOf((*FtIssuesOnHostFault)(nil)).Elem() +} + +type FullStorageVMotionNotSupported struct { + MigrationFeatureNotSupported +} + +func init() { + t["FullStorageVMotionNotSupported"] = reflect.TypeOf((*FullStorageVMotionNotSupported)(nil)).Elem() +} + +type FullStorageVMotionNotSupportedFault FullStorageVMotionNotSupported + +func init() { + t["FullStorageVMotionNotSupportedFault"] = reflect.TypeOf((*FullStorageVMotionNotSupportedFault)(nil)).Elem() +} + +type GatewayConnectFault struct { + HostConnectFault + + GatewayType string `xml:"gatewayType"` + GatewayId string `xml:"gatewayId"` + GatewayInfo string `xml:"gatewayInfo"` + Details *LocalizableMessage `xml:"details,omitempty"` +} + +func init() { + t["GatewayConnectFault"] = reflect.TypeOf((*GatewayConnectFault)(nil)).Elem() +} + +type GatewayConnectFaultFault BaseGatewayConnectFault + +func init() { + t["GatewayConnectFaultFault"] = reflect.TypeOf((*GatewayConnectFaultFault)(nil)).Elem() +} + +type GatewayHostNotReachable struct { + GatewayToHostConnectFault +} + +func init() { + t["GatewayHostNotReachable"] = reflect.TypeOf((*GatewayHostNotReachable)(nil)).Elem() +} + +type GatewayHostNotReachableFault GatewayHostNotReachable + +func init() { + t["GatewayHostNotReachableFault"] = reflect.TypeOf((*GatewayHostNotReachableFault)(nil)).Elem() +} + +type GatewayNotFound struct { + GatewayConnectFault +} + +func init() { + t["GatewayNotFound"] = reflect.TypeOf((*GatewayNotFound)(nil)).Elem() +} + +type GatewayNotFoundFault GatewayNotFound + +func init() { + t["GatewayNotFoundFault"] = reflect.TypeOf((*GatewayNotFoundFault)(nil)).Elem() +} + +type GatewayNotReachable struct { + GatewayConnectFault +} + +func init() { + t["GatewayNotReachable"] = reflect.TypeOf((*GatewayNotReachable)(nil)).Elem() +} + +type GatewayNotReachableFault GatewayNotReachable + +func init() { + t["GatewayNotReachableFault"] = reflect.TypeOf((*GatewayNotReachableFault)(nil)).Elem() +} + +type GatewayOperationRefused struct { + GatewayConnectFault +} + +func init() { + t["GatewayOperationRefused"] = reflect.TypeOf((*GatewayOperationRefused)(nil)).Elem() +} + +type GatewayOperationRefusedFault GatewayOperationRefused + +func init() { + t["GatewayOperationRefusedFault"] = reflect.TypeOf((*GatewayOperationRefusedFault)(nil)).Elem() +} + +type GatewayToHostAuthFault struct { + GatewayToHostConnectFault + + InvalidProperties []string `xml:"invalidProperties"` + MissingProperties []string `xml:"missingProperties"` +} + +func init() { + t["GatewayToHostAuthFault"] = reflect.TypeOf((*GatewayToHostAuthFault)(nil)).Elem() +} + +type GatewayToHostAuthFaultFault GatewayToHostAuthFault + +func init() { + t["GatewayToHostAuthFaultFault"] = reflect.TypeOf((*GatewayToHostAuthFaultFault)(nil)).Elem() +} + +type GatewayToHostConnectFault struct { + GatewayConnectFault + + Hostname string `xml:"hostname"` + Port int32 `xml:"port,omitempty"` +} + +func init() { + t["GatewayToHostConnectFault"] = reflect.TypeOf((*GatewayToHostConnectFault)(nil)).Elem() +} + +type GatewayToHostConnectFaultFault BaseGatewayToHostConnectFault + +func init() { + t["GatewayToHostConnectFaultFault"] = reflect.TypeOf((*GatewayToHostConnectFaultFault)(nil)).Elem() +} + +type GatewayToHostTrustVerifyFault struct { + GatewayToHostConnectFault + + VerificationToken string `xml:"verificationToken"` + PropertiesToVerify []KeyValue `xml:"propertiesToVerify"` +} + +func init() { + t["GatewayToHostTrustVerifyFault"] = reflect.TypeOf((*GatewayToHostTrustVerifyFault)(nil)).Elem() +} + +type GatewayToHostTrustVerifyFaultFault GatewayToHostTrustVerifyFault + +func init() { + t["GatewayToHostTrustVerifyFaultFault"] = reflect.TypeOf((*GatewayToHostTrustVerifyFaultFault)(nil)).Elem() +} + +type GeneralEvent struct { + Event + + Message string `xml:"message"` +} + +func init() { + t["GeneralEvent"] = reflect.TypeOf((*GeneralEvent)(nil)).Elem() +} + +type GeneralHostErrorEvent struct { + GeneralEvent +} + +func init() { + t["GeneralHostErrorEvent"] = reflect.TypeOf((*GeneralHostErrorEvent)(nil)).Elem() +} + +type GeneralHostInfoEvent struct { + GeneralEvent +} + +func init() { + t["GeneralHostInfoEvent"] = reflect.TypeOf((*GeneralHostInfoEvent)(nil)).Elem() +} + +type GeneralHostWarningEvent struct { + GeneralEvent +} + +func init() { + t["GeneralHostWarningEvent"] = reflect.TypeOf((*GeneralHostWarningEvent)(nil)).Elem() +} + +type GeneralUserEvent struct { + GeneralEvent + + Entity *ManagedEntityEventArgument `xml:"entity,omitempty"` +} + +func init() { + t["GeneralUserEvent"] = reflect.TypeOf((*GeneralUserEvent)(nil)).Elem() +} + +type GeneralVmErrorEvent struct { + GeneralEvent +} + +func init() { + t["GeneralVmErrorEvent"] = reflect.TypeOf((*GeneralVmErrorEvent)(nil)).Elem() +} + +type GeneralVmInfoEvent struct { + GeneralEvent +} + +func init() { + t["GeneralVmInfoEvent"] = reflect.TypeOf((*GeneralVmInfoEvent)(nil)).Elem() +} + +type GeneralVmWarningEvent struct { + GeneralEvent +} + +func init() { + t["GeneralVmWarningEvent"] = reflect.TypeOf((*GeneralVmWarningEvent)(nil)).Elem() +} + +type GenerateCertificateSigningRequest GenerateCertificateSigningRequestRequestType + +func init() { + t["GenerateCertificateSigningRequest"] = reflect.TypeOf((*GenerateCertificateSigningRequest)(nil)).Elem() +} + +type GenerateCertificateSigningRequestByDn GenerateCertificateSigningRequestByDnRequestType + +func init() { + t["GenerateCertificateSigningRequestByDn"] = reflect.TypeOf((*GenerateCertificateSigningRequestByDn)(nil)).Elem() +} + +type GenerateCertificateSigningRequestByDnRequestType struct { + This ManagedObjectReference `xml:"_this"` + DistinguishedName string `xml:"distinguishedName"` +} + +func init() { + t["GenerateCertificateSigningRequestByDnRequestType"] = reflect.TypeOf((*GenerateCertificateSigningRequestByDnRequestType)(nil)).Elem() +} + +type GenerateCertificateSigningRequestByDnResponse struct { + Returnval string `xml:"returnval"` +} + +type GenerateCertificateSigningRequestRequestType struct { + This ManagedObjectReference `xml:"_this"` + UseIpAddressAsCommonName bool `xml:"useIpAddressAsCommonName"` +} + +func init() { + t["GenerateCertificateSigningRequestRequestType"] = reflect.TypeOf((*GenerateCertificateSigningRequestRequestType)(nil)).Elem() +} + +type GenerateCertificateSigningRequestResponse struct { + Returnval string `xml:"returnval"` +} + +type GenerateConfigTaskList GenerateConfigTaskListRequestType + +func init() { + t["GenerateConfigTaskList"] = reflect.TypeOf((*GenerateConfigTaskList)(nil)).Elem() +} + +type GenerateConfigTaskListRequestType struct { + This ManagedObjectReference `xml:"_this"` + ConfigSpec HostConfigSpec `xml:"configSpec"` + Host ManagedObjectReference `xml:"host"` +} + +func init() { + t["GenerateConfigTaskListRequestType"] = reflect.TypeOf((*GenerateConfigTaskListRequestType)(nil)).Elem() +} + +type GenerateConfigTaskListResponse struct { + Returnval HostProfileManagerConfigTaskList `xml:"returnval"` +} + +type GenerateHostProfileTaskListRequestType struct { + This ManagedObjectReference `xml:"_this"` + ConfigSpec HostConfigSpec `xml:"configSpec"` + Host ManagedObjectReference `xml:"host"` +} + +func init() { + t["GenerateHostProfileTaskListRequestType"] = reflect.TypeOf((*GenerateHostProfileTaskListRequestType)(nil)).Elem() +} + +type GenerateHostProfileTaskList_Task GenerateHostProfileTaskListRequestType + +func init() { + t["GenerateHostProfileTaskList_Task"] = reflect.TypeOf((*GenerateHostProfileTaskList_Task)(nil)).Elem() +} + +type GenerateHostProfileTaskList_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type GenerateLogBundlesRequestType struct { + This ManagedObjectReference `xml:"_this"` + IncludeDefault bool `xml:"includeDefault"` + Host []ManagedObjectReference `xml:"host,omitempty"` +} + +func init() { + t["GenerateLogBundlesRequestType"] = reflect.TypeOf((*GenerateLogBundlesRequestType)(nil)).Elem() +} + +type GenerateLogBundles_Task GenerateLogBundlesRequestType + +func init() { + t["GenerateLogBundles_Task"] = reflect.TypeOf((*GenerateLogBundles_Task)(nil)).Elem() +} + +type GenerateLogBundles_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type GenericDrsFault struct { + VimFault + + HostFaults []LocalizedMethodFault `xml:"hostFaults,omitempty"` +} + +func init() { + t["GenericDrsFault"] = reflect.TypeOf((*GenericDrsFault)(nil)).Elem() +} + +type GenericDrsFaultFault GenericDrsFault + +func init() { + t["GenericDrsFaultFault"] = reflect.TypeOf((*GenericDrsFaultFault)(nil)).Elem() +} + +type GenericVmConfigFault struct { + VmConfigFault + + Reason string `xml:"reason"` +} + +func init() { + t["GenericVmConfigFault"] = reflect.TypeOf((*GenericVmConfigFault)(nil)).Elem() +} + +type GenericVmConfigFaultFault GenericVmConfigFault + +func init() { + t["GenericVmConfigFaultFault"] = reflect.TypeOf((*GenericVmConfigFaultFault)(nil)).Elem() +} + +type GetAlarm GetAlarmRequestType + +func init() { + t["GetAlarm"] = reflect.TypeOf((*GetAlarm)(nil)).Elem() +} + +type GetAlarmRequestType struct { + This ManagedObjectReference `xml:"_this"` + Entity *ManagedObjectReference `xml:"entity,omitempty"` +} + +func init() { + t["GetAlarmRequestType"] = reflect.TypeOf((*GetAlarmRequestType)(nil)).Elem() +} + +type GetAlarmResponse struct { + Returnval []ManagedObjectReference `xml:"returnval,omitempty"` +} + +type GetAlarmState GetAlarmStateRequestType + +func init() { + t["GetAlarmState"] = reflect.TypeOf((*GetAlarmState)(nil)).Elem() +} + +type GetAlarmStateRequestType struct { + This ManagedObjectReference `xml:"_this"` + Entity ManagedObjectReference `xml:"entity"` +} + +func init() { + t["GetAlarmStateRequestType"] = reflect.TypeOf((*GetAlarmStateRequestType)(nil)).Elem() +} + +type GetAlarmStateResponse struct { + Returnval []AlarmState `xml:"returnval,omitempty"` +} + +type GetCustomizationSpec GetCustomizationSpecRequestType + +func init() { + t["GetCustomizationSpec"] = reflect.TypeOf((*GetCustomizationSpec)(nil)).Elem() +} + +type GetCustomizationSpecRequestType struct { + This ManagedObjectReference `xml:"_this"` + Name string `xml:"name"` +} + +func init() { + t["GetCustomizationSpecRequestType"] = reflect.TypeOf((*GetCustomizationSpecRequestType)(nil)).Elem() +} + +type GetCustomizationSpecResponse struct { + Returnval CustomizationSpecItem `xml:"returnval"` +} + +type GetPublicKey GetPublicKeyRequestType + +func init() { + t["GetPublicKey"] = reflect.TypeOf((*GetPublicKey)(nil)).Elem() +} + +type GetPublicKeyRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["GetPublicKeyRequestType"] = reflect.TypeOf((*GetPublicKeyRequestType)(nil)).Elem() +} + +type GetPublicKeyResponse struct { + Returnval string `xml:"returnval"` +} + +type GetResourceUsage GetResourceUsageRequestType + +func init() { + t["GetResourceUsage"] = reflect.TypeOf((*GetResourceUsage)(nil)).Elem() +} + +type GetResourceUsageRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["GetResourceUsageRequestType"] = reflect.TypeOf((*GetResourceUsageRequestType)(nil)).Elem() +} + +type GetResourceUsageResponse struct { + Returnval ClusterResourceUsageSummary `xml:"returnval"` +} + +type GetVsanObjExtAttrs GetVsanObjExtAttrsRequestType + +func init() { + t["GetVsanObjExtAttrs"] = reflect.TypeOf((*GetVsanObjExtAttrs)(nil)).Elem() +} + +type GetVsanObjExtAttrsRequestType struct { + This ManagedObjectReference `xml:"_this"` + Uuids []string `xml:"uuids"` +} + +func init() { + t["GetVsanObjExtAttrsRequestType"] = reflect.TypeOf((*GetVsanObjExtAttrsRequestType)(nil)).Elem() +} + +type GetVsanObjExtAttrsResponse struct { + Returnval string `xml:"returnval"` +} + +type GhostDvsProxySwitchDetectedEvent struct { + HostEvent + + SwitchUuid []string `xml:"switchUuid"` +} + +func init() { + t["GhostDvsProxySwitchDetectedEvent"] = reflect.TypeOf((*GhostDvsProxySwitchDetectedEvent)(nil)).Elem() +} + +type GhostDvsProxySwitchRemovedEvent struct { + HostEvent + + SwitchUuid []string `xml:"switchUuid"` +} + +func init() { + t["GhostDvsProxySwitchRemovedEvent"] = reflect.TypeOf((*GhostDvsProxySwitchRemovedEvent)(nil)).Elem() +} + +type GlobalMessageChangedEvent struct { + SessionEvent + + Message string `xml:"message"` +} + +func init() { + t["GlobalMessageChangedEvent"] = reflect.TypeOf((*GlobalMessageChangedEvent)(nil)).Elem() +} + +type GroupAlarmAction struct { + AlarmAction + + Action []BaseAlarmAction `xml:"action,typeattr"` +} + +func init() { + t["GroupAlarmAction"] = reflect.TypeOf((*GroupAlarmAction)(nil)).Elem() +} + +type GuestAliases struct { + DynamicData + + Base64Cert string `xml:"base64Cert"` + Aliases []GuestAuthAliasInfo `xml:"aliases"` +} + +func init() { + t["GuestAliases"] = reflect.TypeOf((*GuestAliases)(nil)).Elem() +} + +type GuestAuthAliasInfo struct { + DynamicData + + Subject BaseGuestAuthSubject `xml:"subject,typeattr"` + Comment string `xml:"comment"` +} + +func init() { + t["GuestAuthAliasInfo"] = reflect.TypeOf((*GuestAuthAliasInfo)(nil)).Elem() +} + +type GuestAuthAnySubject struct { + GuestAuthSubject +} + +func init() { + t["GuestAuthAnySubject"] = reflect.TypeOf((*GuestAuthAnySubject)(nil)).Elem() +} + +type GuestAuthNamedSubject struct { + GuestAuthSubject + + Name string `xml:"name"` +} + +func init() { + t["GuestAuthNamedSubject"] = reflect.TypeOf((*GuestAuthNamedSubject)(nil)).Elem() +} + +type GuestAuthSubject struct { + DynamicData +} + +func init() { + t["GuestAuthSubject"] = reflect.TypeOf((*GuestAuthSubject)(nil)).Elem() +} + +type GuestAuthentication struct { + DynamicData + + InteractiveSession bool `xml:"interactiveSession"` +} + +func init() { + t["GuestAuthentication"] = reflect.TypeOf((*GuestAuthentication)(nil)).Elem() +} + +type GuestAuthenticationChallenge struct { + GuestOperationsFault + + ServerChallenge BaseGuestAuthentication `xml:"serverChallenge,typeattr"` + SessionID int64 `xml:"sessionID"` +} + +func init() { + t["GuestAuthenticationChallenge"] = reflect.TypeOf((*GuestAuthenticationChallenge)(nil)).Elem() +} + +type GuestAuthenticationChallengeFault GuestAuthenticationChallenge + +func init() { + t["GuestAuthenticationChallengeFault"] = reflect.TypeOf((*GuestAuthenticationChallengeFault)(nil)).Elem() +} + +type GuestComponentsOutOfDate struct { + GuestOperationsFault +} + +func init() { + t["GuestComponentsOutOfDate"] = reflect.TypeOf((*GuestComponentsOutOfDate)(nil)).Elem() +} + +type GuestComponentsOutOfDateFault GuestComponentsOutOfDate + +func init() { + t["GuestComponentsOutOfDateFault"] = reflect.TypeOf((*GuestComponentsOutOfDateFault)(nil)).Elem() +} + +type GuestDiskInfo struct { + DynamicData + + DiskPath string `xml:"diskPath,omitempty"` + Capacity int64 `xml:"capacity,omitempty"` + FreeSpace int64 `xml:"freeSpace,omitempty"` +} + +func init() { + t["GuestDiskInfo"] = reflect.TypeOf((*GuestDiskInfo)(nil)).Elem() +} + +type GuestFileAttributes struct { + DynamicData + + ModificationTime *time.Time `xml:"modificationTime"` + AccessTime *time.Time `xml:"accessTime"` + SymlinkTarget string `xml:"symlinkTarget,omitempty"` +} + +func init() { + t["GuestFileAttributes"] = reflect.TypeOf((*GuestFileAttributes)(nil)).Elem() +} + +type GuestFileInfo struct { + DynamicData + + Path string `xml:"path"` + Type string `xml:"type"` + Size int64 `xml:"size"` + Attributes BaseGuestFileAttributes `xml:"attributes,typeattr"` +} + +func init() { + t["GuestFileInfo"] = reflect.TypeOf((*GuestFileInfo)(nil)).Elem() +} + +type GuestInfo struct { + DynamicData + + ToolsStatus VirtualMachineToolsStatus `xml:"toolsStatus,omitempty"` + ToolsVersionStatus string `xml:"toolsVersionStatus,omitempty"` + ToolsVersionStatus2 string `xml:"toolsVersionStatus2,omitempty"` + ToolsRunningStatus string `xml:"toolsRunningStatus,omitempty"` + ToolsVersion string `xml:"toolsVersion,omitempty"` + GuestId string `xml:"guestId,omitempty"` + GuestFamily string `xml:"guestFamily,omitempty"` + GuestFullName string `xml:"guestFullName,omitempty"` + HostName string `xml:"hostName,omitempty"` + IpAddress string `xml:"ipAddress,omitempty"` + Net []GuestNicInfo `xml:"net,omitempty"` + IpStack []GuestStackInfo `xml:"ipStack,omitempty"` + Disk []GuestDiskInfo `xml:"disk,omitempty"` + Screen *GuestScreenInfo `xml:"screen,omitempty"` + GuestState string `xml:"guestState"` + AppHeartbeatStatus string `xml:"appHeartbeatStatus,omitempty"` + GuestKernelCrashed *bool `xml:"guestKernelCrashed"` + AppState string `xml:"appState,omitempty"` + GuestOperationsReady *bool `xml:"guestOperationsReady"` + InteractiveGuestOperationsReady *bool `xml:"interactiveGuestOperationsReady"` + GuestStateChangeSupported *bool `xml:"guestStateChangeSupported"` + GenerationInfo []GuestInfoNamespaceGenerationInfo `xml:"generationInfo,omitempty"` +} + +func init() { + t["GuestInfo"] = reflect.TypeOf((*GuestInfo)(nil)).Elem() +} + +type GuestInfoNamespaceGenerationInfo struct { + DynamicData + + Key string `xml:"key"` + GenerationNo int32 `xml:"generationNo"` +} + +func init() { + t["GuestInfoNamespaceGenerationInfo"] = reflect.TypeOf((*GuestInfoNamespaceGenerationInfo)(nil)).Elem() +} + +type GuestListFileInfo struct { + DynamicData + + Files []GuestFileInfo `xml:"files,omitempty"` + Remaining int32 `xml:"remaining"` +} + +func init() { + t["GuestListFileInfo"] = reflect.TypeOf((*GuestListFileInfo)(nil)).Elem() +} + +type GuestMappedAliases struct { + DynamicData + + Base64Cert string `xml:"base64Cert"` + Username string `xml:"username"` + Subjects []BaseGuestAuthSubject `xml:"subjects,typeattr"` +} + +func init() { + t["GuestMappedAliases"] = reflect.TypeOf((*GuestMappedAliases)(nil)).Elem() +} + +type GuestMultipleMappings struct { + GuestOperationsFault +} + +func init() { + t["GuestMultipleMappings"] = reflect.TypeOf((*GuestMultipleMappings)(nil)).Elem() +} + +type GuestMultipleMappingsFault GuestMultipleMappings + +func init() { + t["GuestMultipleMappingsFault"] = reflect.TypeOf((*GuestMultipleMappingsFault)(nil)).Elem() +} + +type GuestNicInfo struct { + DynamicData + + Network string `xml:"network,omitempty"` + IpAddress []string `xml:"ipAddress,omitempty"` + MacAddress string `xml:"macAddress,omitempty"` + Connected bool `xml:"connected"` + DeviceConfigId int32 `xml:"deviceConfigId"` + DnsConfig *NetDnsConfigInfo `xml:"dnsConfig,omitempty"` + IpConfig *NetIpConfigInfo `xml:"ipConfig,omitempty"` + NetBIOSConfig BaseNetBIOSConfigInfo `xml:"netBIOSConfig,omitempty,typeattr"` +} + +func init() { + t["GuestNicInfo"] = reflect.TypeOf((*GuestNicInfo)(nil)).Elem() +} + +type GuestOperationsFault struct { + VimFault +} + +func init() { + t["GuestOperationsFault"] = reflect.TypeOf((*GuestOperationsFault)(nil)).Elem() +} + +type GuestOperationsFaultFault BaseGuestOperationsFault + +func init() { + t["GuestOperationsFaultFault"] = reflect.TypeOf((*GuestOperationsFaultFault)(nil)).Elem() +} + +type GuestOperationsUnavailable struct { + GuestOperationsFault +} + +func init() { + t["GuestOperationsUnavailable"] = reflect.TypeOf((*GuestOperationsUnavailable)(nil)).Elem() +} + +type GuestOperationsUnavailableFault GuestOperationsUnavailable + +func init() { + t["GuestOperationsUnavailableFault"] = reflect.TypeOf((*GuestOperationsUnavailableFault)(nil)).Elem() +} + +type GuestOsDescriptor struct { + DynamicData + + Id string `xml:"id"` + Family string `xml:"family"` + FullName string `xml:"fullName"` + SupportedMaxCPUs int32 `xml:"supportedMaxCPUs"` + NumSupportedPhysicalSockets int32 `xml:"numSupportedPhysicalSockets,omitempty"` + NumSupportedCoresPerSocket int32 `xml:"numSupportedCoresPerSocket,omitempty"` + SupportedMinMemMB int32 `xml:"supportedMinMemMB"` + SupportedMaxMemMB int32 `xml:"supportedMaxMemMB"` + RecommendedMemMB int32 `xml:"recommendedMemMB"` + RecommendedColorDepth int32 `xml:"recommendedColorDepth"` + SupportedDiskControllerList []string `xml:"supportedDiskControllerList"` + RecommendedSCSIController string `xml:"recommendedSCSIController,omitempty"` + RecommendedDiskController string `xml:"recommendedDiskController"` + SupportedNumDisks int32 `xml:"supportedNumDisks"` + RecommendedDiskSizeMB int32 `xml:"recommendedDiskSizeMB"` + RecommendedCdromController string `xml:"recommendedCdromController,omitempty"` + SupportedEthernetCard []string `xml:"supportedEthernetCard"` + RecommendedEthernetCard string `xml:"recommendedEthernetCard,omitempty"` + SupportsSlaveDisk *bool `xml:"supportsSlaveDisk"` + CpuFeatureMask []HostCpuIdInfo `xml:"cpuFeatureMask,omitempty"` + SmcRequired *bool `xml:"smcRequired"` + SupportsWakeOnLan bool `xml:"supportsWakeOnLan"` + SupportsVMI *bool `xml:"supportsVMI"` + SupportsMemoryHotAdd *bool `xml:"supportsMemoryHotAdd"` + SupportsCpuHotAdd *bool `xml:"supportsCpuHotAdd"` + SupportsCpuHotRemove *bool `xml:"supportsCpuHotRemove"` + SupportedFirmware []string `xml:"supportedFirmware,omitempty"` + RecommendedFirmware string `xml:"recommendedFirmware,omitempty"` + SupportedUSBControllerList []string `xml:"supportedUSBControllerList,omitempty"` + RecommendedUSBController string `xml:"recommendedUSBController,omitempty"` + Supports3D *bool `xml:"supports3D"` + Recommended3D *bool `xml:"recommended3D"` + SmcRecommended *bool `xml:"smcRecommended"` + Ich7mRecommended *bool `xml:"ich7mRecommended"` + UsbRecommended *bool `xml:"usbRecommended"` + SupportLevel string `xml:"supportLevel,omitempty"` + SupportedForCreate *bool `xml:"supportedForCreate"` + VRAMSizeInKB *IntOption `xml:"vRAMSizeInKB,omitempty"` + NumSupportedFloppyDevices int32 `xml:"numSupportedFloppyDevices,omitempty"` + WakeOnLanEthernetCard []string `xml:"wakeOnLanEthernetCard,omitempty"` + SupportsPvscsiControllerForBoot *bool `xml:"supportsPvscsiControllerForBoot"` + DiskUuidEnabled *bool `xml:"diskUuidEnabled"` + SupportsHotPlugPCI *bool `xml:"supportsHotPlugPCI"` +} + +func init() { + t["GuestOsDescriptor"] = reflect.TypeOf((*GuestOsDescriptor)(nil)).Elem() +} + +type GuestPermissionDenied struct { + GuestOperationsFault +} + +func init() { + t["GuestPermissionDenied"] = reflect.TypeOf((*GuestPermissionDenied)(nil)).Elem() +} + +type GuestPermissionDeniedFault GuestPermissionDenied + +func init() { + t["GuestPermissionDeniedFault"] = reflect.TypeOf((*GuestPermissionDeniedFault)(nil)).Elem() +} + +type GuestPosixFileAttributes struct { + GuestFileAttributes + + OwnerId int32 `xml:"ownerId,omitempty"` + GroupId int32 `xml:"groupId,omitempty"` + Permissions int64 `xml:"permissions,omitempty"` +} + +func init() { + t["GuestPosixFileAttributes"] = reflect.TypeOf((*GuestPosixFileAttributes)(nil)).Elem() +} + +type GuestProcessInfo struct { + DynamicData + + Name string `xml:"name"` + Pid int64 `xml:"pid"` + Owner string `xml:"owner"` + CmdLine string `xml:"cmdLine"` + StartTime time.Time `xml:"startTime"` + EndTime *time.Time `xml:"endTime"` + ExitCode int32 `xml:"exitCode,omitempty"` +} + +func init() { + t["GuestProcessInfo"] = reflect.TypeOf((*GuestProcessInfo)(nil)).Elem() +} + +type GuestProcessNotFound struct { + GuestOperationsFault + + Pid int64 `xml:"pid"` +} + +func init() { + t["GuestProcessNotFound"] = reflect.TypeOf((*GuestProcessNotFound)(nil)).Elem() +} + +type GuestProcessNotFoundFault GuestProcessNotFound + +func init() { + t["GuestProcessNotFoundFault"] = reflect.TypeOf((*GuestProcessNotFoundFault)(nil)).Elem() +} + +type GuestProgramSpec struct { + DynamicData + + ProgramPath string `xml:"programPath"` + Arguments string `xml:"arguments"` + WorkingDirectory string `xml:"workingDirectory,omitempty"` + EnvVariables []string `xml:"envVariables,omitempty"` +} + +func init() { + t["GuestProgramSpec"] = reflect.TypeOf((*GuestProgramSpec)(nil)).Elem() +} + +type GuestRegKeyNameSpec struct { + DynamicData + + RegistryPath string `xml:"registryPath"` + WowBitness string `xml:"wowBitness"` +} + +func init() { + t["GuestRegKeyNameSpec"] = reflect.TypeOf((*GuestRegKeyNameSpec)(nil)).Elem() +} + +type GuestRegKeyRecordSpec struct { + DynamicData + + Key GuestRegKeySpec `xml:"key"` + Fault *LocalizedMethodFault `xml:"fault,omitempty"` +} + +func init() { + t["GuestRegKeyRecordSpec"] = reflect.TypeOf((*GuestRegKeyRecordSpec)(nil)).Elem() +} + +type GuestRegKeySpec struct { + DynamicData + + KeyName GuestRegKeyNameSpec `xml:"keyName"` + ClassType string `xml:"classType"` + LastWritten time.Time `xml:"lastWritten"` +} + +func init() { + t["GuestRegKeySpec"] = reflect.TypeOf((*GuestRegKeySpec)(nil)).Elem() +} + +type GuestRegValueBinarySpec struct { + GuestRegValueDataSpec + + Value []byte `xml:"value,omitempty"` +} + +func init() { + t["GuestRegValueBinarySpec"] = reflect.TypeOf((*GuestRegValueBinarySpec)(nil)).Elem() +} + +type GuestRegValueDataSpec struct { + DynamicData +} + +func init() { + t["GuestRegValueDataSpec"] = reflect.TypeOf((*GuestRegValueDataSpec)(nil)).Elem() +} + +type GuestRegValueDwordSpec struct { + GuestRegValueDataSpec + + Value int32 `xml:"value"` +} + +func init() { + t["GuestRegValueDwordSpec"] = reflect.TypeOf((*GuestRegValueDwordSpec)(nil)).Elem() +} + +type GuestRegValueExpandStringSpec struct { + GuestRegValueDataSpec + + Value string `xml:"value,omitempty"` +} + +func init() { + t["GuestRegValueExpandStringSpec"] = reflect.TypeOf((*GuestRegValueExpandStringSpec)(nil)).Elem() +} + +type GuestRegValueMultiStringSpec struct { + GuestRegValueDataSpec + + Value []string `xml:"value,omitempty"` +} + +func init() { + t["GuestRegValueMultiStringSpec"] = reflect.TypeOf((*GuestRegValueMultiStringSpec)(nil)).Elem() +} + +type GuestRegValueNameSpec struct { + DynamicData + + KeyName GuestRegKeyNameSpec `xml:"keyName"` + Name string `xml:"name"` +} + +func init() { + t["GuestRegValueNameSpec"] = reflect.TypeOf((*GuestRegValueNameSpec)(nil)).Elem() +} + +type GuestRegValueQwordSpec struct { + GuestRegValueDataSpec + + Value int64 `xml:"value"` +} + +func init() { + t["GuestRegValueQwordSpec"] = reflect.TypeOf((*GuestRegValueQwordSpec)(nil)).Elem() +} + +type GuestRegValueSpec struct { + DynamicData + + Name GuestRegValueNameSpec `xml:"name"` + Data BaseGuestRegValueDataSpec `xml:"data,typeattr"` +} + +func init() { + t["GuestRegValueSpec"] = reflect.TypeOf((*GuestRegValueSpec)(nil)).Elem() +} + +type GuestRegValueStringSpec struct { + GuestRegValueDataSpec + + Value string `xml:"value,omitempty"` +} + +func init() { + t["GuestRegValueStringSpec"] = reflect.TypeOf((*GuestRegValueStringSpec)(nil)).Elem() +} + +type GuestRegistryFault struct { + GuestOperationsFault + + WindowsSystemErrorCode int64 `xml:"windowsSystemErrorCode"` +} + +func init() { + t["GuestRegistryFault"] = reflect.TypeOf((*GuestRegistryFault)(nil)).Elem() +} + +type GuestRegistryFaultFault BaseGuestRegistryFault + +func init() { + t["GuestRegistryFaultFault"] = reflect.TypeOf((*GuestRegistryFaultFault)(nil)).Elem() +} + +type GuestRegistryKeyAlreadyExists struct { + GuestRegistryKeyFault +} + +func init() { + t["GuestRegistryKeyAlreadyExists"] = reflect.TypeOf((*GuestRegistryKeyAlreadyExists)(nil)).Elem() +} + +type GuestRegistryKeyAlreadyExistsFault GuestRegistryKeyAlreadyExists + +func init() { + t["GuestRegistryKeyAlreadyExistsFault"] = reflect.TypeOf((*GuestRegistryKeyAlreadyExistsFault)(nil)).Elem() +} + +type GuestRegistryKeyFault struct { + GuestRegistryFault + + KeyName string `xml:"keyName"` +} + +func init() { + t["GuestRegistryKeyFault"] = reflect.TypeOf((*GuestRegistryKeyFault)(nil)).Elem() +} + +type GuestRegistryKeyFaultFault BaseGuestRegistryKeyFault + +func init() { + t["GuestRegistryKeyFaultFault"] = reflect.TypeOf((*GuestRegistryKeyFaultFault)(nil)).Elem() +} + +type GuestRegistryKeyHasSubkeys struct { + GuestRegistryKeyFault +} + +func init() { + t["GuestRegistryKeyHasSubkeys"] = reflect.TypeOf((*GuestRegistryKeyHasSubkeys)(nil)).Elem() +} + +type GuestRegistryKeyHasSubkeysFault GuestRegistryKeyHasSubkeys + +func init() { + t["GuestRegistryKeyHasSubkeysFault"] = reflect.TypeOf((*GuestRegistryKeyHasSubkeysFault)(nil)).Elem() +} + +type GuestRegistryKeyInvalid struct { + GuestRegistryKeyFault +} + +func init() { + t["GuestRegistryKeyInvalid"] = reflect.TypeOf((*GuestRegistryKeyInvalid)(nil)).Elem() +} + +type GuestRegistryKeyInvalidFault GuestRegistryKeyInvalid + +func init() { + t["GuestRegistryKeyInvalidFault"] = reflect.TypeOf((*GuestRegistryKeyInvalidFault)(nil)).Elem() +} + +type GuestRegistryKeyParentVolatile struct { + GuestRegistryKeyFault +} + +func init() { + t["GuestRegistryKeyParentVolatile"] = reflect.TypeOf((*GuestRegistryKeyParentVolatile)(nil)).Elem() +} + +type GuestRegistryKeyParentVolatileFault GuestRegistryKeyParentVolatile + +func init() { + t["GuestRegistryKeyParentVolatileFault"] = reflect.TypeOf((*GuestRegistryKeyParentVolatileFault)(nil)).Elem() +} + +type GuestRegistryValueFault struct { + GuestRegistryFault + + KeyName string `xml:"keyName"` + ValueName string `xml:"valueName"` +} + +func init() { + t["GuestRegistryValueFault"] = reflect.TypeOf((*GuestRegistryValueFault)(nil)).Elem() +} + +type GuestRegistryValueFaultFault BaseGuestRegistryValueFault + +func init() { + t["GuestRegistryValueFaultFault"] = reflect.TypeOf((*GuestRegistryValueFaultFault)(nil)).Elem() +} + +type GuestRegistryValueNotFound struct { + GuestRegistryValueFault +} + +func init() { + t["GuestRegistryValueNotFound"] = reflect.TypeOf((*GuestRegistryValueNotFound)(nil)).Elem() +} + +type GuestRegistryValueNotFoundFault GuestRegistryValueNotFound + +func init() { + t["GuestRegistryValueNotFoundFault"] = reflect.TypeOf((*GuestRegistryValueNotFoundFault)(nil)).Elem() +} + +type GuestScreenInfo struct { + DynamicData + + Width int32 `xml:"width"` + Height int32 `xml:"height"` +} + +func init() { + t["GuestScreenInfo"] = reflect.TypeOf((*GuestScreenInfo)(nil)).Elem() +} + +type GuestStackInfo struct { + DynamicData + + DnsConfig *NetDnsConfigInfo `xml:"dnsConfig,omitempty"` + IpRouteConfig *NetIpRouteConfigInfo `xml:"ipRouteConfig,omitempty"` + IpStackConfig []KeyValue `xml:"ipStackConfig,omitempty"` + DhcpConfig *NetDhcpConfigInfo `xml:"dhcpConfig,omitempty"` +} + +func init() { + t["GuestStackInfo"] = reflect.TypeOf((*GuestStackInfo)(nil)).Elem() +} + +type GuestWindowsFileAttributes struct { + GuestFileAttributes + + Hidden *bool `xml:"hidden"` + ReadOnly *bool `xml:"readOnly"` + CreateTime *time.Time `xml:"createTime"` +} + +func init() { + t["GuestWindowsFileAttributes"] = reflect.TypeOf((*GuestWindowsFileAttributes)(nil)).Elem() +} + +type GuestWindowsProgramSpec struct { + GuestProgramSpec + + StartMinimized bool `xml:"startMinimized"` +} + +func init() { + t["GuestWindowsProgramSpec"] = reflect.TypeOf((*GuestWindowsProgramSpec)(nil)).Elem() +} + +type HAErrorsAtDest struct { + MigrationFault +} + +func init() { + t["HAErrorsAtDest"] = reflect.TypeOf((*HAErrorsAtDest)(nil)).Elem() +} + +type HAErrorsAtDestFault HAErrorsAtDest + +func init() { + t["HAErrorsAtDestFault"] = reflect.TypeOf((*HAErrorsAtDestFault)(nil)).Elem() +} + +type HasPrivilegeOnEntities HasPrivilegeOnEntitiesRequestType + +func init() { + t["HasPrivilegeOnEntities"] = reflect.TypeOf((*HasPrivilegeOnEntities)(nil)).Elem() +} + +type HasPrivilegeOnEntitiesRequestType struct { + This ManagedObjectReference `xml:"_this"` + Entity []ManagedObjectReference `xml:"entity"` + SessionId string `xml:"sessionId"` + PrivId []string `xml:"privId,omitempty"` +} + +func init() { + t["HasPrivilegeOnEntitiesRequestType"] = reflect.TypeOf((*HasPrivilegeOnEntitiesRequestType)(nil)).Elem() +} + +type HasPrivilegeOnEntitiesResponse struct { + Returnval []EntityPrivilege `xml:"returnval,omitempty"` +} + +type HasPrivilegeOnEntity HasPrivilegeOnEntityRequestType + +func init() { + t["HasPrivilegeOnEntity"] = reflect.TypeOf((*HasPrivilegeOnEntity)(nil)).Elem() +} + +type HasPrivilegeOnEntityRequestType struct { + This ManagedObjectReference `xml:"_this"` + Entity ManagedObjectReference `xml:"entity"` + SessionId string `xml:"sessionId"` + PrivId []string `xml:"privId,omitempty"` +} + +func init() { + t["HasPrivilegeOnEntityRequestType"] = reflect.TypeOf((*HasPrivilegeOnEntityRequestType)(nil)).Elem() +} + +type HasPrivilegeOnEntityResponse struct { + Returnval []bool `xml:"returnval,omitempty"` +} + +type HbrDiskMigrationAction struct { + ClusterAction + + CollectionId string `xml:"collectionId"` + CollectionName string `xml:"collectionName"` + DiskIds []string `xml:"diskIds"` + Source ManagedObjectReference `xml:"source"` + Destination ManagedObjectReference `xml:"destination"` + SizeTransferred int64 `xml:"sizeTransferred"` + SpaceUtilSrcBefore float32 `xml:"spaceUtilSrcBefore,omitempty"` + SpaceUtilDstBefore float32 `xml:"spaceUtilDstBefore,omitempty"` + SpaceUtilSrcAfter float32 `xml:"spaceUtilSrcAfter,omitempty"` + SpaceUtilDstAfter float32 `xml:"spaceUtilDstAfter,omitempty"` + IoLatencySrcBefore float32 `xml:"ioLatencySrcBefore,omitempty"` + IoLatencyDstBefore float32 `xml:"ioLatencyDstBefore,omitempty"` +} + +func init() { + t["HbrDiskMigrationAction"] = reflect.TypeOf((*HbrDiskMigrationAction)(nil)).Elem() +} + +type HbrManagerReplicationVmInfo struct { + DynamicData + + State string `xml:"state"` + ProgressInfo *ReplicationVmProgressInfo `xml:"progressInfo,omitempty"` + ImageId string `xml:"imageId,omitempty"` + LastError *LocalizedMethodFault `xml:"lastError,omitempty"` +} + +func init() { + t["HbrManagerReplicationVmInfo"] = reflect.TypeOf((*HbrManagerReplicationVmInfo)(nil)).Elem() +} + +type HbrManagerVmReplicationCapability struct { + DynamicData + + Vm ManagedObjectReference `xml:"vm"` + SupportedQuiesceMode string `xml:"supportedQuiesceMode"` + CompressionSupported bool `xml:"compressionSupported"` + MaxSupportedSourceDiskCapacity int64 `xml:"maxSupportedSourceDiskCapacity"` + MinRpo int64 `xml:"minRpo,omitempty"` + Fault *LocalizedMethodFault `xml:"fault,omitempty"` +} + +func init() { + t["HbrManagerVmReplicationCapability"] = reflect.TypeOf((*HbrManagerVmReplicationCapability)(nil)).Elem() +} + +type HealthStatusChangedEvent struct { + Event + + ComponentId string `xml:"componentId"` + OldStatus string `xml:"oldStatus"` + NewStatus string `xml:"newStatus"` + ComponentName string `xml:"componentName"` + ServiceId string `xml:"serviceId,omitempty"` +} + +func init() { + t["HealthStatusChangedEvent"] = reflect.TypeOf((*HealthStatusChangedEvent)(nil)).Elem() +} + +type HealthSystemRuntime struct { + DynamicData + + SystemHealthInfo *HostSystemHealthInfo `xml:"systemHealthInfo,omitempty"` + HardwareStatusInfo *HostHardwareStatusInfo `xml:"hardwareStatusInfo,omitempty"` +} + +func init() { + t["HealthSystemRuntime"] = reflect.TypeOf((*HealthSystemRuntime)(nil)).Elem() +} + +type HeterogenousHostsBlockingEVC struct { + EVCConfigFault +} + +func init() { + t["HeterogenousHostsBlockingEVC"] = reflect.TypeOf((*HeterogenousHostsBlockingEVC)(nil)).Elem() +} + +type HeterogenousHostsBlockingEVCFault HeterogenousHostsBlockingEVC + +func init() { + t["HeterogenousHostsBlockingEVCFault"] = reflect.TypeOf((*HeterogenousHostsBlockingEVCFault)(nil)).Elem() +} + +type HostAccessControlEntry struct { + DynamicData + + Principal string `xml:"principal"` + Group bool `xml:"group"` + AccessMode HostAccessMode `xml:"accessMode"` +} + +func init() { + t["HostAccessControlEntry"] = reflect.TypeOf((*HostAccessControlEntry)(nil)).Elem() +} + +type HostAccessRestrictedToManagementServer struct { + NotSupported + + ManagementServer string `xml:"managementServer"` +} + +func init() { + t["HostAccessRestrictedToManagementServer"] = reflect.TypeOf((*HostAccessRestrictedToManagementServer)(nil)).Elem() +} + +type HostAccessRestrictedToManagementServerFault HostAccessRestrictedToManagementServer + +func init() { + t["HostAccessRestrictedToManagementServerFault"] = reflect.TypeOf((*HostAccessRestrictedToManagementServerFault)(nil)).Elem() +} + +type HostAccountSpec struct { + DynamicData + + Id string `xml:"id"` + Password string `xml:"password,omitempty"` + Description string `xml:"description,omitempty"` +} + +func init() { + t["HostAccountSpec"] = reflect.TypeOf((*HostAccountSpec)(nil)).Elem() +} + +type HostActiveDirectory struct { + DynamicData + + ChangeOperation string `xml:"changeOperation"` + Spec *HostActiveDirectorySpec `xml:"spec,omitempty"` +} + +func init() { + t["HostActiveDirectory"] = reflect.TypeOf((*HostActiveDirectory)(nil)).Elem() +} + +type HostActiveDirectoryInfo struct { + HostDirectoryStoreInfo + + JoinedDomain string `xml:"joinedDomain,omitempty"` + TrustedDomain []string `xml:"trustedDomain,omitempty"` + DomainMembershipStatus string `xml:"domainMembershipStatus,omitempty"` + SmartCardAuthenticationEnabled *bool `xml:"smartCardAuthenticationEnabled"` +} + +func init() { + t["HostActiveDirectoryInfo"] = reflect.TypeOf((*HostActiveDirectoryInfo)(nil)).Elem() +} + +type HostActiveDirectorySpec struct { + DynamicData + + DomainName string `xml:"domainName,omitempty"` + UserName string `xml:"userName,omitempty"` + Password string `xml:"password,omitempty"` + CamServer string `xml:"camServer,omitempty"` + Thumbprint string `xml:"thumbprint,omitempty"` + SmartCardAuthenticationEnabled *bool `xml:"smartCardAuthenticationEnabled"` + SmartCardTrustAnchors []string `xml:"smartCardTrustAnchors,omitempty"` +} + +func init() { + t["HostActiveDirectorySpec"] = reflect.TypeOf((*HostActiveDirectorySpec)(nil)).Elem() +} + +type HostAddFailedEvent struct { + HostEvent + + Hostname string `xml:"hostname"` +} + +func init() { + t["HostAddFailedEvent"] = reflect.TypeOf((*HostAddFailedEvent)(nil)).Elem() +} + +type HostAddedEvent struct { + HostEvent +} + +func init() { + t["HostAddedEvent"] = reflect.TypeOf((*HostAddedEvent)(nil)).Elem() +} + +type HostAdminDisableEvent struct { + HostEvent +} + +func init() { + t["HostAdminDisableEvent"] = reflect.TypeOf((*HostAdminDisableEvent)(nil)).Elem() +} + +type HostAdminEnableEvent struct { + HostEvent +} + +func init() { + t["HostAdminEnableEvent"] = reflect.TypeOf((*HostAdminEnableEvent)(nil)).Elem() +} + +type HostApplyProfile struct { + ApplyProfile + + Memory *HostMemoryProfile `xml:"memory,omitempty"` + Storage *StorageProfile `xml:"storage,omitempty"` + Network *NetworkProfile `xml:"network,omitempty"` + Datetime *DateTimeProfile `xml:"datetime,omitempty"` + Firewall *FirewallProfile `xml:"firewall,omitempty"` + Security *SecurityProfile `xml:"security,omitempty"` + Service []ServiceProfile `xml:"service,omitempty"` + Option []OptionProfile `xml:"option,omitempty"` + UserAccount []UserProfile `xml:"userAccount,omitempty"` + UsergroupAccount []UserGroupProfile `xml:"usergroupAccount,omitempty"` + Authentication *AuthenticationProfile `xml:"authentication,omitempty"` +} + +func init() { + t["HostApplyProfile"] = reflect.TypeOf((*HostApplyProfile)(nil)).Elem() +} + +type HostAuthenticationManagerInfo struct { + DynamicData + + AuthConfig []BaseHostAuthenticationStoreInfo `xml:"authConfig,typeattr"` +} + +func init() { + t["HostAuthenticationManagerInfo"] = reflect.TypeOf((*HostAuthenticationManagerInfo)(nil)).Elem() +} + +type HostAuthenticationStoreInfo struct { + DynamicData + + Enabled bool `xml:"enabled"` +} + +func init() { + t["HostAuthenticationStoreInfo"] = reflect.TypeOf((*HostAuthenticationStoreInfo)(nil)).Elem() +} + +type HostAutoStartManagerConfig struct { + DynamicData + + Defaults *AutoStartDefaults `xml:"defaults,omitempty"` + PowerInfo []AutoStartPowerInfo `xml:"powerInfo,omitempty"` +} + +func init() { + t["HostAutoStartManagerConfig"] = reflect.TypeOf((*HostAutoStartManagerConfig)(nil)).Elem() +} + +type HostBIOSInfo struct { + DynamicData + + BiosVersion string `xml:"biosVersion,omitempty"` + ReleaseDate *time.Time `xml:"releaseDate"` +} + +func init() { + t["HostBIOSInfo"] = reflect.TypeOf((*HostBIOSInfo)(nil)).Elem() +} + +type HostBlockAdapterTargetTransport struct { + HostTargetTransport +} + +func init() { + t["HostBlockAdapterTargetTransport"] = reflect.TypeOf((*HostBlockAdapterTargetTransport)(nil)).Elem() +} + +type HostBlockHba struct { + HostHostBusAdapter +} + +func init() { + t["HostBlockHba"] = reflect.TypeOf((*HostBlockHba)(nil)).Elem() +} + +type HostBootDevice struct { + DynamicData + + Key string `xml:"key"` + Description string `xml:"description"` +} + +func init() { + t["HostBootDevice"] = reflect.TypeOf((*HostBootDevice)(nil)).Elem() +} + +type HostBootDeviceInfo struct { + DynamicData + + BootDevices []HostBootDevice `xml:"bootDevices,omitempty"` + CurrentBootDeviceKey string `xml:"currentBootDeviceKey,omitempty"` +} + +func init() { + t["HostBootDeviceInfo"] = reflect.TypeOf((*HostBootDeviceInfo)(nil)).Elem() +} + +type HostCacheConfigurationInfo struct { + DynamicData + + Key ManagedObjectReference `xml:"key"` + SwapSize int64 `xml:"swapSize"` +} + +func init() { + t["HostCacheConfigurationInfo"] = reflect.TypeOf((*HostCacheConfigurationInfo)(nil)).Elem() +} + +type HostCacheConfigurationSpec struct { + DynamicData + + Datastore ManagedObjectReference `xml:"datastore"` + SwapSize int64 `xml:"swapSize"` +} + +func init() { + t["HostCacheConfigurationSpec"] = reflect.TypeOf((*HostCacheConfigurationSpec)(nil)).Elem() +} + +type HostCapability struct { + DynamicData + + RecursiveResourcePoolsSupported bool `xml:"recursiveResourcePoolsSupported"` + CpuMemoryResourceConfigurationSupported bool `xml:"cpuMemoryResourceConfigurationSupported"` + RebootSupported bool `xml:"rebootSupported"` + ShutdownSupported bool `xml:"shutdownSupported"` + VmotionSupported bool `xml:"vmotionSupported"` + StandbySupported bool `xml:"standbySupported"` + IpmiSupported *bool `xml:"ipmiSupported"` + MaxSupportedVMs int32 `xml:"maxSupportedVMs,omitempty"` + MaxRunningVMs int32 `xml:"maxRunningVMs,omitempty"` + MaxSupportedVcpus int32 `xml:"maxSupportedVcpus,omitempty"` + MaxRegisteredVMs int32 `xml:"maxRegisteredVMs,omitempty"` + DatastorePrincipalSupported bool `xml:"datastorePrincipalSupported"` + SanSupported bool `xml:"sanSupported"` + NfsSupported bool `xml:"nfsSupported"` + IscsiSupported bool `xml:"iscsiSupported"` + VlanTaggingSupported bool `xml:"vlanTaggingSupported"` + NicTeamingSupported bool `xml:"nicTeamingSupported"` + HighGuestMemSupported bool `xml:"highGuestMemSupported"` + MaintenanceModeSupported bool `xml:"maintenanceModeSupported"` + SuspendedRelocateSupported bool `xml:"suspendedRelocateSupported"` + RestrictedSnapshotRelocateSupported bool `xml:"restrictedSnapshotRelocateSupported"` + PerVmSwapFiles bool `xml:"perVmSwapFiles"` + LocalSwapDatastoreSupported bool `xml:"localSwapDatastoreSupported"` + UnsharedSwapVMotionSupported bool `xml:"unsharedSwapVMotionSupported"` + BackgroundSnapshotsSupported bool `xml:"backgroundSnapshotsSupported"` + PreAssignedPCIUnitNumbersSupported bool `xml:"preAssignedPCIUnitNumbersSupported"` + ScreenshotSupported bool `xml:"screenshotSupported"` + ScaledScreenshotSupported bool `xml:"scaledScreenshotSupported"` + StorageVMotionSupported *bool `xml:"storageVMotionSupported"` + VmotionWithStorageVMotionSupported *bool `xml:"vmotionWithStorageVMotionSupported"` + VmotionAcrossNetworkSupported *bool `xml:"vmotionAcrossNetworkSupported"` + MaxNumDisksSVMotion int32 `xml:"maxNumDisksSVMotion,omitempty"` + HbrNicSelectionSupported *bool `xml:"hbrNicSelectionSupported"` + VrNfcNicSelectionSupported *bool `xml:"vrNfcNicSelectionSupported"` + RecordReplaySupported *bool `xml:"recordReplaySupported"` + FtSupported *bool `xml:"ftSupported"` + ReplayUnsupportedReason string `xml:"replayUnsupportedReason,omitempty"` + ReplayCompatibilityIssues []string `xml:"replayCompatibilityIssues,omitempty"` + SmpFtSupported *bool `xml:"smpFtSupported"` + FtCompatibilityIssues []string `xml:"ftCompatibilityIssues,omitempty"` + SmpFtCompatibilityIssues []string `xml:"smpFtCompatibilityIssues,omitempty"` + MaxVcpusPerFtVm int32 `xml:"maxVcpusPerFtVm,omitempty"` + LoginBySSLThumbprintSupported *bool `xml:"loginBySSLThumbprintSupported"` + CloneFromSnapshotSupported *bool `xml:"cloneFromSnapshotSupported"` + DeltaDiskBackingsSupported *bool `xml:"deltaDiskBackingsSupported"` + PerVMNetworkTrafficShapingSupported *bool `xml:"perVMNetworkTrafficShapingSupported"` + TpmSupported *bool `xml:"tpmSupported"` + SupportedCpuFeature []HostCpuIdInfo `xml:"supportedCpuFeature,omitempty"` + VirtualExecUsageSupported *bool `xml:"virtualExecUsageSupported"` + StorageIORMSupported *bool `xml:"storageIORMSupported"` + VmDirectPathGen2Supported *bool `xml:"vmDirectPathGen2Supported"` + VmDirectPathGen2UnsupportedReason []string `xml:"vmDirectPathGen2UnsupportedReason,omitempty"` + VmDirectPathGen2UnsupportedReasonExtended string `xml:"vmDirectPathGen2UnsupportedReasonExtended,omitempty"` + SupportedVmfsMajorVersion []int32 `xml:"supportedVmfsMajorVersion,omitempty"` + VStorageCapable *bool `xml:"vStorageCapable"` + SnapshotRelayoutSupported *bool `xml:"snapshotRelayoutSupported"` + FirewallIpRulesSupported *bool `xml:"firewallIpRulesSupported"` + ServicePackageInfoSupported *bool `xml:"servicePackageInfoSupported"` + MaxHostRunningVms int32 `xml:"maxHostRunningVms,omitempty"` + MaxHostSupportedVcpus int32 `xml:"maxHostSupportedVcpus,omitempty"` + VmfsDatastoreMountCapable *bool `xml:"vmfsDatastoreMountCapable"` + EightPlusHostVmfsSharedAccessSupported *bool `xml:"eightPlusHostVmfsSharedAccessSupported"` + NestedHVSupported *bool `xml:"nestedHVSupported"` + VPMCSupported *bool `xml:"vPMCSupported"` + InterVMCommunicationThroughVMCISupported *bool `xml:"interVMCommunicationThroughVMCISupported"` + ScheduledHardwareUpgradeSupported *bool `xml:"scheduledHardwareUpgradeSupported"` + FeatureCapabilitiesSupported *bool `xml:"featureCapabilitiesSupported"` + LatencySensitivitySupported *bool `xml:"latencySensitivitySupported"` + StoragePolicySupported *bool `xml:"storagePolicySupported"` + Accel3dSupported *bool `xml:"accel3dSupported"` + ReliableMemoryAware *bool `xml:"reliableMemoryAware"` + MultipleNetworkStackInstanceSupported *bool `xml:"multipleNetworkStackInstanceSupported"` + MessageBusProxySupported *bool `xml:"messageBusProxySupported"` + VsanSupported *bool `xml:"vsanSupported"` + VFlashSupported *bool `xml:"vFlashSupported"` + HostAccessManagerSupported *bool `xml:"hostAccessManagerSupported"` + ProvisioningNicSelectionSupported *bool `xml:"provisioningNicSelectionSupported"` + Nfs41Supported *bool `xml:"nfs41Supported"` + TurnDiskLocatorLedSupported *bool `xml:"turnDiskLocatorLedSupported"` + VirtualVolumeDatastoreSupported *bool `xml:"virtualVolumeDatastoreSupported"` + MarkAsSsdSupported *bool `xml:"markAsSsdSupported"` + MarkAsLocalSupported *bool `xml:"markAsLocalSupported"` + SmartCardAuthenticationSupported *bool `xml:"smartCardAuthenticationSupported"` +} + +func init() { + t["HostCapability"] = reflect.TypeOf((*HostCapability)(nil)).Elem() +} + +type HostCertificateManagerCertificateInfo struct { + DynamicData + + Issuer string `xml:"issuer,omitempty"` + NotBefore *time.Time `xml:"notBefore"` + NotAfter *time.Time `xml:"notAfter"` + Subject string `xml:"subject,omitempty"` + Status string `xml:"status"` +} + +func init() { + t["HostCertificateManagerCertificateInfo"] = reflect.TypeOf((*HostCertificateManagerCertificateInfo)(nil)).Elem() +} + +type HostCnxFailedAccountFailedEvent struct { + HostEvent +} + +func init() { + t["HostCnxFailedAccountFailedEvent"] = reflect.TypeOf((*HostCnxFailedAccountFailedEvent)(nil)).Elem() +} + +type HostCnxFailedAlreadyManagedEvent struct { + HostEvent + + ServerName string `xml:"serverName"` +} + +func init() { + t["HostCnxFailedAlreadyManagedEvent"] = reflect.TypeOf((*HostCnxFailedAlreadyManagedEvent)(nil)).Elem() +} + +type HostCnxFailedBadCcagentEvent struct { + HostEvent +} + +func init() { + t["HostCnxFailedBadCcagentEvent"] = reflect.TypeOf((*HostCnxFailedBadCcagentEvent)(nil)).Elem() +} + +type HostCnxFailedBadUsernameEvent struct { + HostEvent +} + +func init() { + t["HostCnxFailedBadUsernameEvent"] = reflect.TypeOf((*HostCnxFailedBadUsernameEvent)(nil)).Elem() +} + +type HostCnxFailedBadVersionEvent struct { + HostEvent +} + +func init() { + t["HostCnxFailedBadVersionEvent"] = reflect.TypeOf((*HostCnxFailedBadVersionEvent)(nil)).Elem() +} + +type HostCnxFailedCcagentUpgradeEvent struct { + HostEvent +} + +func init() { + t["HostCnxFailedCcagentUpgradeEvent"] = reflect.TypeOf((*HostCnxFailedCcagentUpgradeEvent)(nil)).Elem() +} + +type HostCnxFailedEvent struct { + HostEvent +} + +func init() { + t["HostCnxFailedEvent"] = reflect.TypeOf((*HostCnxFailedEvent)(nil)).Elem() +} + +type HostCnxFailedNetworkErrorEvent struct { + HostEvent +} + +func init() { + t["HostCnxFailedNetworkErrorEvent"] = reflect.TypeOf((*HostCnxFailedNetworkErrorEvent)(nil)).Elem() +} + +type HostCnxFailedNoAccessEvent struct { + HostEvent +} + +func init() { + t["HostCnxFailedNoAccessEvent"] = reflect.TypeOf((*HostCnxFailedNoAccessEvent)(nil)).Elem() +} + +type HostCnxFailedNoConnectionEvent struct { + HostEvent +} + +func init() { + t["HostCnxFailedNoConnectionEvent"] = reflect.TypeOf((*HostCnxFailedNoConnectionEvent)(nil)).Elem() +} + +type HostCnxFailedNoLicenseEvent struct { + HostEvent +} + +func init() { + t["HostCnxFailedNoLicenseEvent"] = reflect.TypeOf((*HostCnxFailedNoLicenseEvent)(nil)).Elem() +} + +type HostCnxFailedNotFoundEvent struct { + HostEvent +} + +func init() { + t["HostCnxFailedNotFoundEvent"] = reflect.TypeOf((*HostCnxFailedNotFoundEvent)(nil)).Elem() +} + +type HostCnxFailedTimeoutEvent struct { + HostEvent +} + +func init() { + t["HostCnxFailedTimeoutEvent"] = reflect.TypeOf((*HostCnxFailedTimeoutEvent)(nil)).Elem() +} + +type HostCommunication struct { + RuntimeFault +} + +func init() { + t["HostCommunication"] = reflect.TypeOf((*HostCommunication)(nil)).Elem() +} + +type HostCommunicationFault BaseHostCommunication + +func init() { + t["HostCommunicationFault"] = reflect.TypeOf((*HostCommunicationFault)(nil)).Elem() +} + +type HostComplianceCheckedEvent struct { + HostEvent + + Profile ProfileEventArgument `xml:"profile"` +} + +func init() { + t["HostComplianceCheckedEvent"] = reflect.TypeOf((*HostComplianceCheckedEvent)(nil)).Elem() +} + +type HostCompliantEvent struct { + HostEvent +} + +func init() { + t["HostCompliantEvent"] = reflect.TypeOf((*HostCompliantEvent)(nil)).Elem() +} + +type HostConfigAppliedEvent struct { + HostEvent +} + +func init() { + t["HostConfigAppliedEvent"] = reflect.TypeOf((*HostConfigAppliedEvent)(nil)).Elem() +} + +type HostConfigChange struct { + DynamicData +} + +func init() { + t["HostConfigChange"] = reflect.TypeOf((*HostConfigChange)(nil)).Elem() +} + +type HostConfigFailed struct { + HostConfigFault + + Failure []LocalizedMethodFault `xml:"failure"` +} + +func init() { + t["HostConfigFailed"] = reflect.TypeOf((*HostConfigFailed)(nil)).Elem() +} + +type HostConfigFailedFault HostConfigFailed + +func init() { + t["HostConfigFailedFault"] = reflect.TypeOf((*HostConfigFailedFault)(nil)).Elem() +} + +type HostConfigFault struct { + VimFault +} + +func init() { + t["HostConfigFault"] = reflect.TypeOf((*HostConfigFault)(nil)).Elem() +} + +type HostConfigFaultFault BaseHostConfigFault + +func init() { + t["HostConfigFaultFault"] = reflect.TypeOf((*HostConfigFaultFault)(nil)).Elem() +} + +type HostConfigInfo struct { + DynamicData + + Host ManagedObjectReference `xml:"host"` + Product AboutInfo `xml:"product"` + HyperThread *HostHyperThreadScheduleInfo `xml:"hyperThread,omitempty"` + ConsoleReservation *ServiceConsoleReservationInfo `xml:"consoleReservation,omitempty"` + VirtualMachineReservation *VirtualMachineMemoryReservationInfo `xml:"virtualMachineReservation,omitempty"` + StorageDevice *HostStorageDeviceInfo `xml:"storageDevice,omitempty"` + MultipathState *HostMultipathStateInfo `xml:"multipathState,omitempty"` + FileSystemVolume *HostFileSystemVolumeInfo `xml:"fileSystemVolume,omitempty"` + SystemFile []string `xml:"systemFile,omitempty"` + Network *HostNetworkInfo `xml:"network,omitempty"` + Vmotion *HostVMotionInfo `xml:"vmotion,omitempty"` + VirtualNicManagerInfo *HostVirtualNicManagerInfo `xml:"virtualNicManagerInfo,omitempty"` + Capabilities *HostNetCapabilities `xml:"capabilities,omitempty"` + DatastoreCapabilities *HostDatastoreSystemCapabilities `xml:"datastoreCapabilities,omitempty"` + OffloadCapabilities *HostNetOffloadCapabilities `xml:"offloadCapabilities,omitempty"` + Service *HostServiceInfo `xml:"service,omitempty"` + Firewall *HostFirewallInfo `xml:"firewall,omitempty"` + AutoStart *HostAutoStartManagerConfig `xml:"autoStart,omitempty"` + ActiveDiagnosticPartition *HostDiagnosticPartition `xml:"activeDiagnosticPartition,omitempty"` + Option []BaseOptionValue `xml:"option,omitempty,typeattr"` + OptionDef []OptionDef `xml:"optionDef,omitempty"` + DatastorePrincipal string `xml:"datastorePrincipal,omitempty"` + LocalSwapDatastore *ManagedObjectReference `xml:"localSwapDatastore,omitempty"` + SystemSwapConfiguration *HostSystemSwapConfiguration `xml:"systemSwapConfiguration,omitempty"` + SystemResources *HostSystemResourceInfo `xml:"systemResources,omitempty"` + DateTimeInfo *HostDateTimeInfo `xml:"dateTimeInfo,omitempty"` + Flags *HostFlagInfo `xml:"flags,omitempty"` + AdminDisabled *bool `xml:"adminDisabled"` + LockdownMode HostLockdownMode `xml:"lockdownMode,omitempty"` + Ipmi *HostIpmiInfo `xml:"ipmi,omitempty"` + SslThumbprintInfo *HostSslThumbprintInfo `xml:"sslThumbprintInfo,omitempty"` + SslThumbprintData []HostSslThumbprintInfo `xml:"sslThumbprintData,omitempty"` + Certificate []byte `xml:"certificate,omitempty"` + PciPassthruInfo []BaseHostPciPassthruInfo `xml:"pciPassthruInfo,omitempty,typeattr"` + AuthenticationManagerInfo *HostAuthenticationManagerInfo `xml:"authenticationManagerInfo,omitempty"` + FeatureVersion []HostFeatureVersionInfo `xml:"featureVersion,omitempty"` + PowerSystemCapability *PowerSystemCapability `xml:"powerSystemCapability,omitempty"` + PowerSystemInfo *PowerSystemInfo `xml:"powerSystemInfo,omitempty"` + CacheConfigurationInfo []HostCacheConfigurationInfo `xml:"cacheConfigurationInfo,omitempty"` + WakeOnLanCapable *bool `xml:"wakeOnLanCapable"` + FeatureCapability []HostFeatureCapability `xml:"featureCapability,omitempty"` + MaskedFeatureCapability []HostFeatureCapability `xml:"maskedFeatureCapability,omitempty"` + VFlashConfigInfo *HostVFlashManagerVFlashConfigInfo `xml:"vFlashConfigInfo,omitempty"` + VsanHostConfig *VsanHostConfigInfo `xml:"vsanHostConfig,omitempty"` + DomainList []string `xml:"domainList,omitempty"` + ScriptCheckSum []byte `xml:"scriptCheckSum,omitempty"` + HostConfigCheckSum []byte `xml:"hostConfigCheckSum,omitempty"` + GraphicsInfo []HostGraphicsInfo `xml:"graphicsInfo,omitempty"` + SharedPassthruGpuTypes []string `xml:"sharedPassthruGpuTypes,omitempty"` + IoFilterInfo []HostIoFilterInfo `xml:"ioFilterInfo,omitempty"` +} + +func init() { + t["HostConfigInfo"] = reflect.TypeOf((*HostConfigInfo)(nil)).Elem() +} + +type HostConfigManager struct { + DynamicData + + CpuScheduler *ManagedObjectReference `xml:"cpuScheduler,omitempty"` + DatastoreSystem *ManagedObjectReference `xml:"datastoreSystem,omitempty"` + MemoryManager *ManagedObjectReference `xml:"memoryManager,omitempty"` + StorageSystem *ManagedObjectReference `xml:"storageSystem,omitempty"` + NetworkSystem *ManagedObjectReference `xml:"networkSystem,omitempty"` + VmotionSystem *ManagedObjectReference `xml:"vmotionSystem,omitempty"` + VirtualNicManager *ManagedObjectReference `xml:"virtualNicManager,omitempty"` + ServiceSystem *ManagedObjectReference `xml:"serviceSystem,omitempty"` + FirewallSystem *ManagedObjectReference `xml:"firewallSystem,omitempty"` + AdvancedOption *ManagedObjectReference `xml:"advancedOption,omitempty"` + DiagnosticSystem *ManagedObjectReference `xml:"diagnosticSystem,omitempty"` + AutoStartManager *ManagedObjectReference `xml:"autoStartManager,omitempty"` + SnmpSystem *ManagedObjectReference `xml:"snmpSystem,omitempty"` + DateTimeSystem *ManagedObjectReference `xml:"dateTimeSystem,omitempty"` + PatchManager *ManagedObjectReference `xml:"patchManager,omitempty"` + ImageConfigManager *ManagedObjectReference `xml:"imageConfigManager,omitempty"` + BootDeviceSystem *ManagedObjectReference `xml:"bootDeviceSystem,omitempty"` + FirmwareSystem *ManagedObjectReference `xml:"firmwareSystem,omitempty"` + HealthStatusSystem *ManagedObjectReference `xml:"healthStatusSystem,omitempty"` + PciPassthruSystem *ManagedObjectReference `xml:"pciPassthruSystem,omitempty"` + LicenseManager *ManagedObjectReference `xml:"licenseManager,omitempty"` + KernelModuleSystem *ManagedObjectReference `xml:"kernelModuleSystem,omitempty"` + AuthenticationManager *ManagedObjectReference `xml:"authenticationManager,omitempty"` + PowerSystem *ManagedObjectReference `xml:"powerSystem,omitempty"` + CacheConfigurationManager *ManagedObjectReference `xml:"cacheConfigurationManager,omitempty"` + EsxAgentHostManager *ManagedObjectReference `xml:"esxAgentHostManager,omitempty"` + IscsiManager *ManagedObjectReference `xml:"iscsiManager,omitempty"` + VFlashManager *ManagedObjectReference `xml:"vFlashManager,omitempty"` + VsanSystem *ManagedObjectReference `xml:"vsanSystem,omitempty"` + MessageBusProxy *ManagedObjectReference `xml:"messageBusProxy,omitempty"` + UserDirectory *ManagedObjectReference `xml:"userDirectory,omitempty"` + AccountManager *ManagedObjectReference `xml:"accountManager,omitempty"` + HostAccessManager *ManagedObjectReference `xml:"hostAccessManager,omitempty"` + GraphicsManager *ManagedObjectReference `xml:"graphicsManager,omitempty"` + VsanInternalSystem *ManagedObjectReference `xml:"vsanInternalSystem,omitempty"` + CertificateManager *ManagedObjectReference `xml:"certificateManager,omitempty"` +} + +func init() { + t["HostConfigManager"] = reflect.TypeOf((*HostConfigManager)(nil)).Elem() +} + +type HostConfigSpec struct { + DynamicData + + NasDatastore []HostNasVolumeConfig `xml:"nasDatastore,omitempty"` + Network *HostNetworkConfig `xml:"network,omitempty"` + NicTypeSelection []HostVirtualNicManagerNicTypeSelection `xml:"nicTypeSelection,omitempty"` + Service []HostServiceConfig `xml:"service,omitempty"` + Firewall *HostFirewallConfig `xml:"firewall,omitempty"` + Option []BaseOptionValue `xml:"option,omitempty,typeattr"` + DatastorePrincipal string `xml:"datastorePrincipal,omitempty"` + DatastorePrincipalPasswd string `xml:"datastorePrincipalPasswd,omitempty"` + Datetime *HostDateTimeConfig `xml:"datetime,omitempty"` + StorageDevice *HostStorageDeviceInfo `xml:"storageDevice,omitempty"` + License *HostLicenseSpec `xml:"license,omitempty"` + Security *HostSecuritySpec `xml:"security,omitempty"` + UserAccount []BaseHostAccountSpec `xml:"userAccount,omitempty,typeattr"` + UsergroupAccount []BaseHostAccountSpec `xml:"usergroupAccount,omitempty,typeattr"` + Memory *HostMemorySpec `xml:"memory,omitempty"` + ActiveDirectory []HostActiveDirectory `xml:"activeDirectory,omitempty"` + GenericConfig []KeyAnyValue `xml:"genericConfig,omitempty"` +} + +func init() { + t["HostConfigSpec"] = reflect.TypeOf((*HostConfigSpec)(nil)).Elem() +} + +type HostConfigSummary struct { + DynamicData + + Name string `xml:"name"` + Port int32 `xml:"port"` + SslThumbprint string `xml:"sslThumbprint,omitempty"` + Product *AboutInfo `xml:"product,omitempty"` + VmotionEnabled bool `xml:"vmotionEnabled"` + FaultToleranceEnabled *bool `xml:"faultToleranceEnabled"` + FeatureVersion []HostFeatureVersionInfo `xml:"featureVersion,omitempty"` + AgentVmDatastore *ManagedObjectReference `xml:"agentVmDatastore,omitempty"` + AgentVmNetwork *ManagedObjectReference `xml:"agentVmNetwork,omitempty"` +} + +func init() { + t["HostConfigSummary"] = reflect.TypeOf((*HostConfigSummary)(nil)).Elem() +} + +type HostConfigVFlashCache HostConfigVFlashCacheRequestType + +func init() { + t["HostConfigVFlashCache"] = reflect.TypeOf((*HostConfigVFlashCache)(nil)).Elem() +} + +type HostConfigVFlashCacheRequestType struct { + This ManagedObjectReference `xml:"_this"` + Spec HostVFlashManagerVFlashCacheConfigSpec `xml:"spec"` +} + +func init() { + t["HostConfigVFlashCacheRequestType"] = reflect.TypeOf((*HostConfigVFlashCacheRequestType)(nil)).Elem() +} + +type HostConfigVFlashCacheResponse struct { +} + +type HostConfigureVFlashResource HostConfigureVFlashResourceRequestType + +func init() { + t["HostConfigureVFlashResource"] = reflect.TypeOf((*HostConfigureVFlashResource)(nil)).Elem() +} + +type HostConfigureVFlashResourceRequestType struct { + This ManagedObjectReference `xml:"_this"` + Spec HostVFlashManagerVFlashResourceConfigSpec `xml:"spec"` +} + +func init() { + t["HostConfigureVFlashResourceRequestType"] = reflect.TypeOf((*HostConfigureVFlashResourceRequestType)(nil)).Elem() +} + +type HostConfigureVFlashResourceResponse struct { +} + +type HostConnectFault struct { + VimFault +} + +func init() { + t["HostConnectFault"] = reflect.TypeOf((*HostConnectFault)(nil)).Elem() +} + +type HostConnectFaultFault BaseHostConnectFault + +func init() { + t["HostConnectFaultFault"] = reflect.TypeOf((*HostConnectFaultFault)(nil)).Elem() +} + +type HostConnectInfo struct { + DynamicData + + ServerIp string `xml:"serverIp,omitempty"` + InDasCluster *bool `xml:"inDasCluster"` + Host HostListSummary `xml:"host"` + Vm []VirtualMachineSummary `xml:"vm,omitempty"` + VimAccountNameRequired *bool `xml:"vimAccountNameRequired"` + ClusterSupported *bool `xml:"clusterSupported"` + Network []BaseHostConnectInfoNetworkInfo `xml:"network,omitempty,typeattr"` + Datastore []BaseHostDatastoreConnectInfo `xml:"datastore,omitempty,typeattr"` + License *HostLicenseConnectInfo `xml:"license,omitempty"` + Capability *HostCapability `xml:"capability,omitempty"` +} + +func init() { + t["HostConnectInfo"] = reflect.TypeOf((*HostConnectInfo)(nil)).Elem() +} + +type HostConnectInfoNetworkInfo struct { + DynamicData + + Summary BaseNetworkSummary `xml:"summary,typeattr"` +} + +func init() { + t["HostConnectInfoNetworkInfo"] = reflect.TypeOf((*HostConnectInfoNetworkInfo)(nil)).Elem() +} + +type HostConnectSpec struct { + DynamicData + + HostName string `xml:"hostName,omitempty"` + Port int32 `xml:"port,omitempty"` + SslThumbprint string `xml:"sslThumbprint,omitempty"` + UserName string `xml:"userName,omitempty"` + Password string `xml:"password,omitempty"` + VmFolder *ManagedObjectReference `xml:"vmFolder,omitempty"` + Force bool `xml:"force"` + VimAccountName string `xml:"vimAccountName,omitempty"` + VimAccountPassword string `xml:"vimAccountPassword,omitempty"` + ManagementIp string `xml:"managementIp,omitempty"` + LockdownMode HostLockdownMode `xml:"lockdownMode,omitempty"` + HostGateway *HostGatewaySpec `xml:"hostGateway,omitempty"` +} + +func init() { + t["HostConnectSpec"] = reflect.TypeOf((*HostConnectSpec)(nil)).Elem() +} + +type HostConnectedEvent struct { + HostEvent +} + +func init() { + t["HostConnectedEvent"] = reflect.TypeOf((*HostConnectedEvent)(nil)).Elem() +} + +type HostConnectionLostEvent struct { + HostEvent +} + +func init() { + t["HostConnectionLostEvent"] = reflect.TypeOf((*HostConnectionLostEvent)(nil)).Elem() +} + +type HostCpuIdInfo struct { + DynamicData + + Level int32 `xml:"level"` + Vendor string `xml:"vendor,omitempty"` + Eax string `xml:"eax,omitempty"` + Ebx string `xml:"ebx,omitempty"` + Ecx string `xml:"ecx,omitempty"` + Edx string `xml:"edx,omitempty"` +} + +func init() { + t["HostCpuIdInfo"] = reflect.TypeOf((*HostCpuIdInfo)(nil)).Elem() +} + +type HostCpuInfo struct { + DynamicData + + NumCpuPackages int16 `xml:"numCpuPackages"` + NumCpuCores int16 `xml:"numCpuCores"` + NumCpuThreads int16 `xml:"numCpuThreads"` + Hz int64 `xml:"hz"` +} + +func init() { + t["HostCpuInfo"] = reflect.TypeOf((*HostCpuInfo)(nil)).Elem() +} + +type HostCpuPackage struct { + DynamicData + + Index int16 `xml:"index"` + Vendor string `xml:"vendor"` + Hz int64 `xml:"hz"` + BusHz int64 `xml:"busHz"` + Description string `xml:"description"` + ThreadId []int16 `xml:"threadId"` + CpuFeature []HostCpuIdInfo `xml:"cpuFeature,omitempty"` +} + +func init() { + t["HostCpuPackage"] = reflect.TypeOf((*HostCpuPackage)(nil)).Elem() +} + +type HostCpuPowerManagementInfo struct { + DynamicData + + CurrentPolicy string `xml:"currentPolicy,omitempty"` + HardwareSupport string `xml:"hardwareSupport,omitempty"` +} + +func init() { + t["HostCpuPowerManagementInfo"] = reflect.TypeOf((*HostCpuPowerManagementInfo)(nil)).Elem() +} + +type HostDasDisabledEvent struct { + HostEvent +} + +func init() { + t["HostDasDisabledEvent"] = reflect.TypeOf((*HostDasDisabledEvent)(nil)).Elem() +} + +type HostDasDisablingEvent struct { + HostEvent +} + +func init() { + t["HostDasDisablingEvent"] = reflect.TypeOf((*HostDasDisablingEvent)(nil)).Elem() +} + +type HostDasEnabledEvent struct { + HostEvent +} + +func init() { + t["HostDasEnabledEvent"] = reflect.TypeOf((*HostDasEnabledEvent)(nil)).Elem() +} + +type HostDasEnablingEvent struct { + HostEvent +} + +func init() { + t["HostDasEnablingEvent"] = reflect.TypeOf((*HostDasEnablingEvent)(nil)).Elem() +} + +type HostDasErrorEvent struct { + HostEvent + + Message string `xml:"message,omitempty"` + Reason string `xml:"reason,omitempty"` +} + +func init() { + t["HostDasErrorEvent"] = reflect.TypeOf((*HostDasErrorEvent)(nil)).Elem() +} + +type HostDasEvent struct { + HostEvent +} + +func init() { + t["HostDasEvent"] = reflect.TypeOf((*HostDasEvent)(nil)).Elem() +} + +type HostDasOkEvent struct { + HostEvent +} + +func init() { + t["HostDasOkEvent"] = reflect.TypeOf((*HostDasOkEvent)(nil)).Elem() +} + +type HostDatastoreBrowserSearchResults struct { + DynamicData + + Datastore *ManagedObjectReference `xml:"datastore,omitempty"` + FolderPath string `xml:"folderPath,omitempty"` + File []BaseFileInfo `xml:"file,omitempty,typeattr"` +} + +func init() { + t["HostDatastoreBrowserSearchResults"] = reflect.TypeOf((*HostDatastoreBrowserSearchResults)(nil)).Elem() +} + +type HostDatastoreBrowserSearchSpec struct { + DynamicData + + Query []BaseFileQuery `xml:"query,omitempty,typeattr"` + Details *FileQueryFlags `xml:"details,omitempty"` + SearchCaseInsensitive *bool `xml:"searchCaseInsensitive"` + MatchPattern []string `xml:"matchPattern,omitempty"` + SortFoldersFirst *bool `xml:"sortFoldersFirst"` +} + +func init() { + t["HostDatastoreBrowserSearchSpec"] = reflect.TypeOf((*HostDatastoreBrowserSearchSpec)(nil)).Elem() +} + +type HostDatastoreConnectInfo struct { + DynamicData + + Summary DatastoreSummary `xml:"summary"` +} + +func init() { + t["HostDatastoreConnectInfo"] = reflect.TypeOf((*HostDatastoreConnectInfo)(nil)).Elem() +} + +type HostDatastoreExistsConnectInfo struct { + HostDatastoreConnectInfo + + NewDatastoreName string `xml:"newDatastoreName"` +} + +func init() { + t["HostDatastoreExistsConnectInfo"] = reflect.TypeOf((*HostDatastoreExistsConnectInfo)(nil)).Elem() +} + +type HostDatastoreNameConflictConnectInfo struct { + HostDatastoreConnectInfo + + NewDatastoreName string `xml:"newDatastoreName"` +} + +func init() { + t["HostDatastoreNameConflictConnectInfo"] = reflect.TypeOf((*HostDatastoreNameConflictConnectInfo)(nil)).Elem() +} + +type HostDatastoreSystemCapabilities struct { + DynamicData + + NfsMountCreationRequired bool `xml:"nfsMountCreationRequired"` + NfsMountCreationSupported bool `xml:"nfsMountCreationSupported"` + LocalDatastoreSupported bool `xml:"localDatastoreSupported"` + VmfsExtentExpansionSupported *bool `xml:"vmfsExtentExpansionSupported"` +} + +func init() { + t["HostDatastoreSystemCapabilities"] = reflect.TypeOf((*HostDatastoreSystemCapabilities)(nil)).Elem() +} + +type HostDatastoreSystemDatastoreResult struct { + DynamicData + + Key ManagedObjectReference `xml:"key"` + Fault *LocalizedMethodFault `xml:"fault,omitempty"` +} + +func init() { + t["HostDatastoreSystemDatastoreResult"] = reflect.TypeOf((*HostDatastoreSystemDatastoreResult)(nil)).Elem() +} + +type HostDatastoreSystemVvolDatastoreSpec struct { + DynamicData + + Name string `xml:"name"` + ScId string `xml:"scId"` +} + +func init() { + t["HostDatastoreSystemVvolDatastoreSpec"] = reflect.TypeOf((*HostDatastoreSystemVvolDatastoreSpec)(nil)).Elem() +} + +type HostDateTimeConfig struct { + DynamicData + + TimeZone string `xml:"timeZone,omitempty"` + NtpConfig *HostNtpConfig `xml:"ntpConfig,omitempty"` +} + +func init() { + t["HostDateTimeConfig"] = reflect.TypeOf((*HostDateTimeConfig)(nil)).Elem() +} + +type HostDateTimeInfo struct { + DynamicData + + TimeZone HostDateTimeSystemTimeZone `xml:"timeZone"` + NtpConfig *HostNtpConfig `xml:"ntpConfig,omitempty"` +} + +func init() { + t["HostDateTimeInfo"] = reflect.TypeOf((*HostDateTimeInfo)(nil)).Elem() +} + +type HostDateTimeSystemTimeZone struct { + DynamicData + + Key string `xml:"key"` + Name string `xml:"name"` + Description string `xml:"description"` + GmtOffset int32 `xml:"gmtOffset"` +} + +func init() { + t["HostDateTimeSystemTimeZone"] = reflect.TypeOf((*HostDateTimeSystemTimeZone)(nil)).Elem() +} + +type HostDevice struct { + DynamicData + + DeviceName string `xml:"deviceName"` + DeviceType string `xml:"deviceType"` +} + +func init() { + t["HostDevice"] = reflect.TypeOf((*HostDevice)(nil)).Elem() +} + +type HostDhcpService struct { + DynamicData + + Key string `xml:"key"` + Spec HostDhcpServiceSpec `xml:"spec"` +} + +func init() { + t["HostDhcpService"] = reflect.TypeOf((*HostDhcpService)(nil)).Elem() +} + +type HostDhcpServiceConfig struct { + DynamicData + + ChangeOperation string `xml:"changeOperation,omitempty"` + Key string `xml:"key"` + Spec HostDhcpServiceSpec `xml:"spec"` +} + +func init() { + t["HostDhcpServiceConfig"] = reflect.TypeOf((*HostDhcpServiceConfig)(nil)).Elem() +} + +type HostDhcpServiceSpec struct { + DynamicData + + VirtualSwitch string `xml:"virtualSwitch"` + DefaultLeaseDuration int32 `xml:"defaultLeaseDuration"` + LeaseBeginIp string `xml:"leaseBeginIp"` + LeaseEndIp string `xml:"leaseEndIp"` + MaxLeaseDuration int32 `xml:"maxLeaseDuration"` + UnlimitedLease bool `xml:"unlimitedLease"` + IpSubnetAddr string `xml:"ipSubnetAddr"` + IpSubnetMask string `xml:"ipSubnetMask"` +} + +func init() { + t["HostDhcpServiceSpec"] = reflect.TypeOf((*HostDhcpServiceSpec)(nil)).Elem() +} + +type HostDiagnosticPartition struct { + DynamicData + + StorageType string `xml:"storageType"` + DiagnosticType string `xml:"diagnosticType"` + Slots int32 `xml:"slots"` + Id HostScsiDiskPartition `xml:"id"` +} + +func init() { + t["HostDiagnosticPartition"] = reflect.TypeOf((*HostDiagnosticPartition)(nil)).Elem() +} + +type HostDiagnosticPartitionCreateDescription struct { + DynamicData + + Layout HostDiskPartitionLayout `xml:"layout"` + DiskUuid string `xml:"diskUuid"` + Spec HostDiagnosticPartitionCreateSpec `xml:"spec"` +} + +func init() { + t["HostDiagnosticPartitionCreateDescription"] = reflect.TypeOf((*HostDiagnosticPartitionCreateDescription)(nil)).Elem() +} + +type HostDiagnosticPartitionCreateOption struct { + DynamicData + + StorageType string `xml:"storageType"` + DiagnosticType string `xml:"diagnosticType"` + Disk HostScsiDisk `xml:"disk"` +} + +func init() { + t["HostDiagnosticPartitionCreateOption"] = reflect.TypeOf((*HostDiagnosticPartitionCreateOption)(nil)).Elem() +} + +type HostDiagnosticPartitionCreateSpec struct { + DynamicData + + StorageType string `xml:"storageType"` + DiagnosticType string `xml:"diagnosticType"` + Id HostScsiDiskPartition `xml:"id"` + Partition HostDiskPartitionSpec `xml:"partition"` + Active *bool `xml:"active"` +} + +func init() { + t["HostDiagnosticPartitionCreateSpec"] = reflect.TypeOf((*HostDiagnosticPartitionCreateSpec)(nil)).Elem() +} + +type HostDigestInfo struct { + DynamicData + + DigestMethod string `xml:"digestMethod"` + DigestValue []byte `xml:"digestValue"` + ObjectName string `xml:"objectName,omitempty"` +} + +func init() { + t["HostDigestInfo"] = reflect.TypeOf((*HostDigestInfo)(nil)).Elem() +} + +type HostDirectoryStoreInfo struct { + HostAuthenticationStoreInfo +} + +func init() { + t["HostDirectoryStoreInfo"] = reflect.TypeOf((*HostDirectoryStoreInfo)(nil)).Elem() +} + +type HostDisconnectedEvent struct { + HostEvent + + Reason string `xml:"reason,omitempty"` +} + +func init() { + t["HostDisconnectedEvent"] = reflect.TypeOf((*HostDisconnectedEvent)(nil)).Elem() +} + +type HostDiskConfigurationResult struct { + DynamicData + + DevicePath string `xml:"devicePath,omitempty"` + Success *bool `xml:"success"` + Fault *LocalizedMethodFault `xml:"fault,omitempty"` +} + +func init() { + t["HostDiskConfigurationResult"] = reflect.TypeOf((*HostDiskConfigurationResult)(nil)).Elem() +} + +type HostDiskDimensions struct { + DynamicData +} + +func init() { + t["HostDiskDimensions"] = reflect.TypeOf((*HostDiskDimensions)(nil)).Elem() +} + +type HostDiskDimensionsChs struct { + DynamicData + + Cylinder int64 `xml:"cylinder"` + Head int32 `xml:"head"` + Sector int32 `xml:"sector"` +} + +func init() { + t["HostDiskDimensionsChs"] = reflect.TypeOf((*HostDiskDimensionsChs)(nil)).Elem() +} + +type HostDiskDimensionsLba struct { + DynamicData + + BlockSize int32 `xml:"blockSize"` + Block int64 `xml:"block"` +} + +func init() { + t["HostDiskDimensionsLba"] = reflect.TypeOf((*HostDiskDimensionsLba)(nil)).Elem() +} + +type HostDiskMappingInfo struct { + DynamicData + + PhysicalPartition *HostDiskMappingPartitionInfo `xml:"physicalPartition,omitempty"` + Name string `xml:"name"` + Exclusive *bool `xml:"exclusive"` +} + +func init() { + t["HostDiskMappingInfo"] = reflect.TypeOf((*HostDiskMappingInfo)(nil)).Elem() +} + +type HostDiskMappingOption struct { + DynamicData + + PhysicalPartition []HostDiskMappingPartitionOption `xml:"physicalPartition,omitempty"` + Name string `xml:"name"` +} + +func init() { + t["HostDiskMappingOption"] = reflect.TypeOf((*HostDiskMappingOption)(nil)).Elem() +} + +type HostDiskMappingPartitionInfo struct { + DynamicData + + Name string `xml:"name"` + FileSystem string `xml:"fileSystem"` + CapacityInKb int64 `xml:"capacityInKb"` +} + +func init() { + t["HostDiskMappingPartitionInfo"] = reflect.TypeOf((*HostDiskMappingPartitionInfo)(nil)).Elem() +} + +type HostDiskMappingPartitionOption struct { + DynamicData + + Name string `xml:"name"` + FileSystem string `xml:"fileSystem"` + CapacityInKb int64 `xml:"capacityInKb"` +} + +func init() { + t["HostDiskMappingPartitionOption"] = reflect.TypeOf((*HostDiskMappingPartitionOption)(nil)).Elem() +} + +type HostDiskPartitionAttributes struct { + DynamicData + + Partition int32 `xml:"partition"` + StartSector int64 `xml:"startSector"` + EndSector int64 `xml:"endSector"` + Type string `xml:"type"` + Guid string `xml:"guid,omitempty"` + Logical bool `xml:"logical"` + Attributes byte `xml:"attributes"` + PartitionAlignment int64 `xml:"partitionAlignment,omitempty"` +} + +func init() { + t["HostDiskPartitionAttributes"] = reflect.TypeOf((*HostDiskPartitionAttributes)(nil)).Elem() +} + +type HostDiskPartitionBlockRange struct { + DynamicData + + Partition int32 `xml:"partition,omitempty"` + Type string `xml:"type"` + Start HostDiskDimensionsLba `xml:"start"` + End HostDiskDimensionsLba `xml:"end"` +} + +func init() { + t["HostDiskPartitionBlockRange"] = reflect.TypeOf((*HostDiskPartitionBlockRange)(nil)).Elem() +} + +type HostDiskPartitionInfo struct { + DynamicData + + DeviceName string `xml:"deviceName"` + Spec HostDiskPartitionSpec `xml:"spec"` + Layout HostDiskPartitionLayout `xml:"layout"` +} + +func init() { + t["HostDiskPartitionInfo"] = reflect.TypeOf((*HostDiskPartitionInfo)(nil)).Elem() +} + +type HostDiskPartitionLayout struct { + DynamicData + + Total *HostDiskDimensionsLba `xml:"total,omitempty"` + Partition []HostDiskPartitionBlockRange `xml:"partition"` +} + +func init() { + t["HostDiskPartitionLayout"] = reflect.TypeOf((*HostDiskPartitionLayout)(nil)).Elem() +} + +type HostDiskPartitionSpec struct { + DynamicData + + PartitionFormat string `xml:"partitionFormat,omitempty"` + Chs *HostDiskDimensionsChs `xml:"chs,omitempty"` + TotalSectors int64 `xml:"totalSectors,omitempty"` + Partition []HostDiskPartitionAttributes `xml:"partition,omitempty"` +} + +func init() { + t["HostDiskPartitionSpec"] = reflect.TypeOf((*HostDiskPartitionSpec)(nil)).Elem() +} + +type HostDnsConfig struct { + DynamicData + + Dhcp bool `xml:"dhcp"` + VirtualNicDevice string `xml:"virtualNicDevice,omitempty"` + HostName string `xml:"hostName"` + DomainName string `xml:"domainName"` + Address []string `xml:"address,omitempty"` + SearchDomain []string `xml:"searchDomain,omitempty"` +} + +func init() { + t["HostDnsConfig"] = reflect.TypeOf((*HostDnsConfig)(nil)).Elem() +} + +type HostDnsConfigSpec struct { + HostDnsConfig + + VirtualNicConnection *HostVirtualNicConnection `xml:"virtualNicConnection,omitempty"` +} + +func init() { + t["HostDnsConfigSpec"] = reflect.TypeOf((*HostDnsConfigSpec)(nil)).Elem() +} + +type HostEnableAdminFailedEvent struct { + HostEvent + + Permissions []Permission `xml:"permissions"` +} + +func init() { + t["HostEnableAdminFailedEvent"] = reflect.TypeOf((*HostEnableAdminFailedEvent)(nil)).Elem() +} + +type HostEsxAgentHostManagerConfigInfo struct { + DynamicData + + AgentVmDatastore *ManagedObjectReference `xml:"agentVmDatastore,omitempty"` + AgentVmNetwork *ManagedObjectReference `xml:"agentVmNetwork,omitempty"` +} + +func init() { + t["HostEsxAgentHostManagerConfigInfo"] = reflect.TypeOf((*HostEsxAgentHostManagerConfigInfo)(nil)).Elem() +} + +type HostEvent struct { + Event +} + +func init() { + t["HostEvent"] = reflect.TypeOf((*HostEvent)(nil)).Elem() +} + +type HostEventArgument struct { + EntityEventArgument + + Host ManagedObjectReference `xml:"host"` +} + +func init() { + t["HostEventArgument"] = reflect.TypeOf((*HostEventArgument)(nil)).Elem() +} + +type HostExtraNetworksEvent struct { + HostDasEvent + + Ips string `xml:"ips,omitempty"` +} + +func init() { + t["HostExtraNetworksEvent"] = reflect.TypeOf((*HostExtraNetworksEvent)(nil)).Elem() +} + +type HostFaultToleranceManagerComponentHealthInfo struct { + DynamicData + + IsStorageHealthy bool `xml:"isStorageHealthy"` + IsNetworkHealthy bool `xml:"isNetworkHealthy"` +} + +func init() { + t["HostFaultToleranceManagerComponentHealthInfo"] = reflect.TypeOf((*HostFaultToleranceManagerComponentHealthInfo)(nil)).Elem() +} + +type HostFeatureCapability struct { + DynamicData + + Key string `xml:"key"` + FeatureName string `xml:"featureName"` + Value string `xml:"value"` +} + +func init() { + t["HostFeatureCapability"] = reflect.TypeOf((*HostFeatureCapability)(nil)).Elem() +} + +type HostFeatureMask struct { + DynamicData + + Key string `xml:"key"` + FeatureName string `xml:"featureName"` + Value string `xml:"value"` +} + +func init() { + t["HostFeatureMask"] = reflect.TypeOf((*HostFeatureMask)(nil)).Elem() +} + +type HostFeatureVersionInfo struct { + DynamicData + + Key string `xml:"key"` + Value string `xml:"value"` +} + +func init() { + t["HostFeatureVersionInfo"] = reflect.TypeOf((*HostFeatureVersionInfo)(nil)).Elem() +} + +type HostFibreChannelHba struct { + HostHostBusAdapter + + PortWorldWideName int64 `xml:"portWorldWideName"` + NodeWorldWideName int64 `xml:"nodeWorldWideName"` + PortType FibreChannelPortType `xml:"portType"` + Speed int64 `xml:"speed"` +} + +func init() { + t["HostFibreChannelHba"] = reflect.TypeOf((*HostFibreChannelHba)(nil)).Elem() +} + +type HostFibreChannelOverEthernetHba struct { + HostFibreChannelHba + + UnderlyingNic string `xml:"underlyingNic"` + LinkInfo HostFibreChannelOverEthernetHbaLinkInfo `xml:"linkInfo"` + IsSoftwareFcoe bool `xml:"isSoftwareFcoe"` + MarkedForRemoval bool `xml:"markedForRemoval"` +} + +func init() { + t["HostFibreChannelOverEthernetHba"] = reflect.TypeOf((*HostFibreChannelOverEthernetHba)(nil)).Elem() +} + +type HostFibreChannelOverEthernetHbaLinkInfo struct { + DynamicData + + VnportMac string `xml:"vnportMac"` + FcfMac string `xml:"fcfMac"` + VlanId int32 `xml:"vlanId"` +} + +func init() { + t["HostFibreChannelOverEthernetHbaLinkInfo"] = reflect.TypeOf((*HostFibreChannelOverEthernetHbaLinkInfo)(nil)).Elem() +} + +type HostFibreChannelOverEthernetTargetTransport struct { + HostFibreChannelTargetTransport + + VnportMac string `xml:"vnportMac"` + FcfMac string `xml:"fcfMac"` + VlanId int32 `xml:"vlanId"` +} + +func init() { + t["HostFibreChannelOverEthernetTargetTransport"] = reflect.TypeOf((*HostFibreChannelOverEthernetTargetTransport)(nil)).Elem() +} + +type HostFibreChannelTargetTransport struct { + HostTargetTransport + + PortWorldWideName int64 `xml:"portWorldWideName"` + NodeWorldWideName int64 `xml:"nodeWorldWideName"` +} + +func init() { + t["HostFibreChannelTargetTransport"] = reflect.TypeOf((*HostFibreChannelTargetTransport)(nil)).Elem() +} + +type HostFileAccess struct { + DynamicData + + Who string `xml:"who"` + What string `xml:"what"` +} + +func init() { + t["HostFileAccess"] = reflect.TypeOf((*HostFileAccess)(nil)).Elem() +} + +type HostFileSystemMountInfo struct { + DynamicData + + MountInfo HostMountInfo `xml:"mountInfo"` + Volume BaseHostFileSystemVolume `xml:"volume,typeattr"` + VStorageSupport string `xml:"vStorageSupport,omitempty"` +} + +func init() { + t["HostFileSystemMountInfo"] = reflect.TypeOf((*HostFileSystemMountInfo)(nil)).Elem() +} + +type HostFileSystemVolume struct { + DynamicData + + Type string `xml:"type"` + Name string `xml:"name"` + Capacity int64 `xml:"capacity"` +} + +func init() { + t["HostFileSystemVolume"] = reflect.TypeOf((*HostFileSystemVolume)(nil)).Elem() +} + +type HostFileSystemVolumeInfo struct { + DynamicData + + VolumeTypeList []string `xml:"volumeTypeList,omitempty"` + MountInfo []HostFileSystemMountInfo `xml:"mountInfo,omitempty"` +} + +func init() { + t["HostFileSystemVolumeInfo"] = reflect.TypeOf((*HostFileSystemVolumeInfo)(nil)).Elem() +} + +type HostFirewallConfig struct { + DynamicData + + Rule []HostFirewallConfigRuleSetConfig `xml:"rule,omitempty"` + DefaultBlockingPolicy HostFirewallDefaultPolicy `xml:"defaultBlockingPolicy"` +} + +func init() { + t["HostFirewallConfig"] = reflect.TypeOf((*HostFirewallConfig)(nil)).Elem() +} + +type HostFirewallConfigRuleSetConfig struct { + DynamicData + + RulesetId string `xml:"rulesetId"` + Enabled bool `xml:"enabled"` + AllowedHosts *HostFirewallRulesetIpList `xml:"allowedHosts,omitempty"` +} + +func init() { + t["HostFirewallConfigRuleSetConfig"] = reflect.TypeOf((*HostFirewallConfigRuleSetConfig)(nil)).Elem() +} + +type HostFirewallDefaultPolicy struct { + DynamicData + + IncomingBlocked *bool `xml:"incomingBlocked"` + OutgoingBlocked *bool `xml:"outgoingBlocked"` +} + +func init() { + t["HostFirewallDefaultPolicy"] = reflect.TypeOf((*HostFirewallDefaultPolicy)(nil)).Elem() +} + +type HostFirewallInfo struct { + DynamicData + + DefaultPolicy HostFirewallDefaultPolicy `xml:"defaultPolicy"` + Ruleset []HostFirewallRuleset `xml:"ruleset,omitempty"` +} + +func init() { + t["HostFirewallInfo"] = reflect.TypeOf((*HostFirewallInfo)(nil)).Elem() +} + +type HostFirewallRule struct { + DynamicData + + Port int32 `xml:"port"` + EndPort int32 `xml:"endPort,omitempty"` + Direction HostFirewallRuleDirection `xml:"direction"` + PortType HostFirewallRulePortType `xml:"portType,omitempty"` + Protocol string `xml:"protocol"` +} + +func init() { + t["HostFirewallRule"] = reflect.TypeOf((*HostFirewallRule)(nil)).Elem() +} + +type HostFirewallRuleset struct { + DynamicData + + Key string `xml:"key"` + Label string `xml:"label"` + Required bool `xml:"required"` + Rule []HostFirewallRule `xml:"rule"` + Service string `xml:"service,omitempty"` + Enabled bool `xml:"enabled"` + AllowedHosts *HostFirewallRulesetIpList `xml:"allowedHosts,omitempty"` +} + +func init() { + t["HostFirewallRuleset"] = reflect.TypeOf((*HostFirewallRuleset)(nil)).Elem() +} + +type HostFirewallRulesetIpList struct { + DynamicData + + IpAddress []string `xml:"ipAddress,omitempty"` + IpNetwork []HostFirewallRulesetIpNetwork `xml:"ipNetwork,omitempty"` + AllIp bool `xml:"allIp"` +} + +func init() { + t["HostFirewallRulesetIpList"] = reflect.TypeOf((*HostFirewallRulesetIpList)(nil)).Elem() +} + +type HostFirewallRulesetIpNetwork struct { + DynamicData + + Network string `xml:"network"` + PrefixLength int32 `xml:"prefixLength"` +} + +func init() { + t["HostFirewallRulesetIpNetwork"] = reflect.TypeOf((*HostFirewallRulesetIpNetwork)(nil)).Elem() +} + +type HostFirewallRulesetRulesetSpec struct { + DynamicData + + AllowedHosts HostFirewallRulesetIpList `xml:"allowedHosts"` +} + +func init() { + t["HostFirewallRulesetRulesetSpec"] = reflect.TypeOf((*HostFirewallRulesetRulesetSpec)(nil)).Elem() +} + +type HostFlagInfo struct { + DynamicData + + BackgroundSnapshotsEnabled *bool `xml:"backgroundSnapshotsEnabled"` +} + +func init() { + t["HostFlagInfo"] = reflect.TypeOf((*HostFlagInfo)(nil)).Elem() +} + +type HostForceMountedInfo struct { + DynamicData + + Persist bool `xml:"persist"` + Mounted bool `xml:"mounted"` +} + +func init() { + t["HostForceMountedInfo"] = reflect.TypeOf((*HostForceMountedInfo)(nil)).Elem() +} + +type HostGatewaySpec struct { + DynamicData + + GatewayType string `xml:"gatewayType"` + GatewayId string `xml:"gatewayId,omitempty"` + TrustVerificationToken string `xml:"trustVerificationToken,omitempty"` + HostAuthParams []KeyValue `xml:"hostAuthParams,omitempty"` +} + +func init() { + t["HostGatewaySpec"] = reflect.TypeOf((*HostGatewaySpec)(nil)).Elem() +} + +type HostGetShortNameFailedEvent struct { + HostEvent +} + +func init() { + t["HostGetShortNameFailedEvent"] = reflect.TypeOf((*HostGetShortNameFailedEvent)(nil)).Elem() +} + +type HostGetVFlashModuleDefaultConfig HostGetVFlashModuleDefaultConfigRequestType + +func init() { + t["HostGetVFlashModuleDefaultConfig"] = reflect.TypeOf((*HostGetVFlashModuleDefaultConfig)(nil)).Elem() +} + +type HostGetVFlashModuleDefaultConfigRequestType struct { + This ManagedObjectReference `xml:"_this"` + VFlashModule string `xml:"vFlashModule"` +} + +func init() { + t["HostGetVFlashModuleDefaultConfigRequestType"] = reflect.TypeOf((*HostGetVFlashModuleDefaultConfigRequestType)(nil)).Elem() +} + +type HostGetVFlashModuleDefaultConfigResponse struct { + Returnval VirtualDiskVFlashCacheConfigInfo `xml:"returnval"` +} + +type HostGraphicsInfo struct { + DynamicData + + DeviceName string `xml:"deviceName"` + VendorName string `xml:"vendorName"` + PciId string `xml:"pciId"` + GraphicsType string `xml:"graphicsType"` + MemorySizeInKB int64 `xml:"memorySizeInKB"` + Vm []ManagedObjectReference `xml:"vm,omitempty"` +} + +func init() { + t["HostGraphicsInfo"] = reflect.TypeOf((*HostGraphicsInfo)(nil)).Elem() +} + +type HostHardwareElementInfo struct { + DynamicData + + Name string `xml:"name"` + Status BaseElementDescription `xml:"status,typeattr"` +} + +func init() { + t["HostHardwareElementInfo"] = reflect.TypeOf((*HostHardwareElementInfo)(nil)).Elem() +} + +type HostHardwareInfo struct { + DynamicData + + SystemInfo HostSystemInfo `xml:"systemInfo"` + CpuPowerManagementInfo *HostCpuPowerManagementInfo `xml:"cpuPowerManagementInfo,omitempty"` + CpuInfo HostCpuInfo `xml:"cpuInfo"` + CpuPkg []HostCpuPackage `xml:"cpuPkg"` + MemorySize int64 `xml:"memorySize"` + NumaInfo *HostNumaInfo `xml:"numaInfo,omitempty"` + SmcPresent *bool `xml:"smcPresent"` + PciDevice []HostPciDevice `xml:"pciDevice,omitempty"` + CpuFeature []HostCpuIdInfo `xml:"cpuFeature,omitempty"` + BiosInfo *HostBIOSInfo `xml:"biosInfo,omitempty"` + ReliableMemoryInfo *HostReliableMemoryInfo `xml:"reliableMemoryInfo,omitempty"` +} + +func init() { + t["HostHardwareInfo"] = reflect.TypeOf((*HostHardwareInfo)(nil)).Elem() +} + +type HostHardwareStatusInfo struct { + DynamicData + + MemoryStatusInfo []BaseHostHardwareElementInfo `xml:"memoryStatusInfo,omitempty,typeattr"` + CpuStatusInfo []BaseHostHardwareElementInfo `xml:"cpuStatusInfo,omitempty,typeattr"` + StorageStatusInfo []HostStorageElementInfo `xml:"storageStatusInfo,omitempty"` +} + +func init() { + t["HostHardwareStatusInfo"] = reflect.TypeOf((*HostHardwareStatusInfo)(nil)).Elem() +} + +type HostHardwareSummary struct { + DynamicData + + Vendor string `xml:"vendor"` + Model string `xml:"model"` + Uuid string `xml:"uuid"` + OtherIdentifyingInfo []HostSystemIdentificationInfo `xml:"otherIdentifyingInfo,omitempty"` + MemorySize int64 `xml:"memorySize"` + CpuModel string `xml:"cpuModel"` + CpuMhz int32 `xml:"cpuMhz"` + NumCpuPkgs int16 `xml:"numCpuPkgs"` + NumCpuCores int16 `xml:"numCpuCores"` + NumCpuThreads int16 `xml:"numCpuThreads"` + NumNics int32 `xml:"numNics"` + NumHBAs int32 `xml:"numHBAs"` +} + +func init() { + t["HostHardwareSummary"] = reflect.TypeOf((*HostHardwareSummary)(nil)).Elem() +} + +type HostHasComponentFailure struct { + VimFault + + HostName string `xml:"hostName"` + ComponentType string `xml:"componentType"` + ComponentName string `xml:"componentName"` +} + +func init() { + t["HostHasComponentFailure"] = reflect.TypeOf((*HostHasComponentFailure)(nil)).Elem() +} + +type HostHasComponentFailureFault HostHasComponentFailure + +func init() { + t["HostHasComponentFailureFault"] = reflect.TypeOf((*HostHasComponentFailureFault)(nil)).Elem() +} + +type HostHostBusAdapter struct { + DynamicData + + Key string `xml:"key,omitempty"` + Device string `xml:"device"` + Bus int32 `xml:"bus"` + Status string `xml:"status"` + Model string `xml:"model"` + Driver string `xml:"driver,omitempty"` + Pci string `xml:"pci,omitempty"` +} + +func init() { + t["HostHostBusAdapter"] = reflect.TypeOf((*HostHostBusAdapter)(nil)).Elem() +} + +type HostHyperThreadScheduleInfo struct { + DynamicData + + Available bool `xml:"available"` + Active bool `xml:"active"` + Config bool `xml:"config"` +} + +func init() { + t["HostHyperThreadScheduleInfo"] = reflect.TypeOf((*HostHyperThreadScheduleInfo)(nil)).Elem() +} + +type HostImageConfigGetAcceptance HostImageConfigGetAcceptanceRequestType + +func init() { + t["HostImageConfigGetAcceptance"] = reflect.TypeOf((*HostImageConfigGetAcceptance)(nil)).Elem() +} + +type HostImageConfigGetAcceptanceRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["HostImageConfigGetAcceptanceRequestType"] = reflect.TypeOf((*HostImageConfigGetAcceptanceRequestType)(nil)).Elem() +} + +type HostImageConfigGetAcceptanceResponse struct { + Returnval string `xml:"returnval"` +} + +type HostImageConfigGetProfile HostImageConfigGetProfileRequestType + +func init() { + t["HostImageConfigGetProfile"] = reflect.TypeOf((*HostImageConfigGetProfile)(nil)).Elem() +} + +type HostImageConfigGetProfileRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["HostImageConfigGetProfileRequestType"] = reflect.TypeOf((*HostImageConfigGetProfileRequestType)(nil)).Elem() +} + +type HostImageConfigGetProfileResponse struct { + Returnval HostImageProfileSummary `xml:"returnval"` +} + +type HostImageProfileSummary struct { + DynamicData + + Name string `xml:"name"` + Vendor string `xml:"vendor"` +} + +func init() { + t["HostImageProfileSummary"] = reflect.TypeOf((*HostImageProfileSummary)(nil)).Elem() +} + +type HostInAuditModeEvent struct { + HostEvent +} + +func init() { + t["HostInAuditModeEvent"] = reflect.TypeOf((*HostInAuditModeEvent)(nil)).Elem() +} + +type HostInDomain struct { + HostConfigFault +} + +func init() { + t["HostInDomain"] = reflect.TypeOf((*HostInDomain)(nil)).Elem() +} + +type HostInDomainFault HostInDomain + +func init() { + t["HostInDomainFault"] = reflect.TypeOf((*HostInDomainFault)(nil)).Elem() +} + +type HostIncompatibleForFaultTolerance struct { + VmFaultToleranceIssue + + HostName string `xml:"hostName,omitempty"` + Reason string `xml:"reason,omitempty"` +} + +func init() { + t["HostIncompatibleForFaultTolerance"] = reflect.TypeOf((*HostIncompatibleForFaultTolerance)(nil)).Elem() +} + +type HostIncompatibleForFaultToleranceFault HostIncompatibleForFaultTolerance + +func init() { + t["HostIncompatibleForFaultToleranceFault"] = reflect.TypeOf((*HostIncompatibleForFaultToleranceFault)(nil)).Elem() +} + +type HostIncompatibleForRecordReplay struct { + VimFault + + HostName string `xml:"hostName,omitempty"` + Reason string `xml:"reason,omitempty"` +} + +func init() { + t["HostIncompatibleForRecordReplay"] = reflect.TypeOf((*HostIncompatibleForRecordReplay)(nil)).Elem() +} + +type HostIncompatibleForRecordReplayFault HostIncompatibleForRecordReplay + +func init() { + t["HostIncompatibleForRecordReplayFault"] = reflect.TypeOf((*HostIncompatibleForRecordReplayFault)(nil)).Elem() +} + +type HostInternetScsiHba struct { + HostHostBusAdapter + + IsSoftwareBased bool `xml:"isSoftwareBased"` + CanBeDisabled *bool `xml:"canBeDisabled"` + NetworkBindingSupport HostInternetScsiHbaNetworkBindingSupportType `xml:"networkBindingSupport,omitempty"` + DiscoveryCapabilities HostInternetScsiHbaDiscoveryCapabilities `xml:"discoveryCapabilities"` + DiscoveryProperties HostInternetScsiHbaDiscoveryProperties `xml:"discoveryProperties"` + AuthenticationCapabilities HostInternetScsiHbaAuthenticationCapabilities `xml:"authenticationCapabilities"` + AuthenticationProperties HostInternetScsiHbaAuthenticationProperties `xml:"authenticationProperties"` + DigestCapabilities *HostInternetScsiHbaDigestCapabilities `xml:"digestCapabilities,omitempty"` + DigestProperties *HostInternetScsiHbaDigestProperties `xml:"digestProperties,omitempty"` + IpCapabilities HostInternetScsiHbaIPCapabilities `xml:"ipCapabilities"` + IpProperties HostInternetScsiHbaIPProperties `xml:"ipProperties"` + SupportedAdvancedOptions []OptionDef `xml:"supportedAdvancedOptions,omitempty"` + AdvancedOptions []HostInternetScsiHbaParamValue `xml:"advancedOptions,omitempty"` + IScsiName string `xml:"iScsiName"` + IScsiAlias string `xml:"iScsiAlias,omitempty"` + ConfiguredSendTarget []HostInternetScsiHbaSendTarget `xml:"configuredSendTarget,omitempty"` + ConfiguredStaticTarget []HostInternetScsiHbaStaticTarget `xml:"configuredStaticTarget,omitempty"` + MaxSpeedMb int32 `xml:"maxSpeedMb,omitempty"` + CurrentSpeedMb int32 `xml:"currentSpeedMb,omitempty"` +} + +func init() { + t["HostInternetScsiHba"] = reflect.TypeOf((*HostInternetScsiHba)(nil)).Elem() +} + +type HostInternetScsiHbaAuthenticationCapabilities struct { + DynamicData + + ChapAuthSettable bool `xml:"chapAuthSettable"` + Krb5AuthSettable bool `xml:"krb5AuthSettable"` + SrpAuthSettable bool `xml:"srpAuthSettable"` + SpkmAuthSettable bool `xml:"spkmAuthSettable"` + MutualChapSettable *bool `xml:"mutualChapSettable"` + TargetChapSettable *bool `xml:"targetChapSettable"` + TargetMutualChapSettable *bool `xml:"targetMutualChapSettable"` +} + +func init() { + t["HostInternetScsiHbaAuthenticationCapabilities"] = reflect.TypeOf((*HostInternetScsiHbaAuthenticationCapabilities)(nil)).Elem() +} + +type HostInternetScsiHbaAuthenticationProperties struct { + DynamicData + + ChapAuthEnabled bool `xml:"chapAuthEnabled"` + ChapName string `xml:"chapName,omitempty"` + ChapSecret string `xml:"chapSecret,omitempty"` + ChapAuthenticationType string `xml:"chapAuthenticationType,omitempty"` + ChapInherited *bool `xml:"chapInherited"` + MutualChapName string `xml:"mutualChapName,omitempty"` + MutualChapSecret string `xml:"mutualChapSecret,omitempty"` + MutualChapAuthenticationType string `xml:"mutualChapAuthenticationType,omitempty"` + MutualChapInherited *bool `xml:"mutualChapInherited"` +} + +func init() { + t["HostInternetScsiHbaAuthenticationProperties"] = reflect.TypeOf((*HostInternetScsiHbaAuthenticationProperties)(nil)).Elem() +} + +type HostInternetScsiHbaDigestCapabilities struct { + DynamicData + + HeaderDigestSettable *bool `xml:"headerDigestSettable"` + DataDigestSettable *bool `xml:"dataDigestSettable"` + TargetHeaderDigestSettable *bool `xml:"targetHeaderDigestSettable"` + TargetDataDigestSettable *bool `xml:"targetDataDigestSettable"` +} + +func init() { + t["HostInternetScsiHbaDigestCapabilities"] = reflect.TypeOf((*HostInternetScsiHbaDigestCapabilities)(nil)).Elem() +} + +type HostInternetScsiHbaDigestProperties struct { + DynamicData + + HeaderDigestType string `xml:"headerDigestType,omitempty"` + HeaderDigestInherited *bool `xml:"headerDigestInherited"` + DataDigestType string `xml:"dataDigestType,omitempty"` + DataDigestInherited *bool `xml:"dataDigestInherited"` +} + +func init() { + t["HostInternetScsiHbaDigestProperties"] = reflect.TypeOf((*HostInternetScsiHbaDigestProperties)(nil)).Elem() +} + +type HostInternetScsiHbaDiscoveryCapabilities struct { + DynamicData + + ISnsDiscoverySettable bool `xml:"iSnsDiscoverySettable"` + SlpDiscoverySettable bool `xml:"slpDiscoverySettable"` + StaticTargetDiscoverySettable bool `xml:"staticTargetDiscoverySettable"` + SendTargetsDiscoverySettable bool `xml:"sendTargetsDiscoverySettable"` +} + +func init() { + t["HostInternetScsiHbaDiscoveryCapabilities"] = reflect.TypeOf((*HostInternetScsiHbaDiscoveryCapabilities)(nil)).Elem() +} + +type HostInternetScsiHbaDiscoveryProperties struct { + DynamicData + + ISnsDiscoveryEnabled bool `xml:"iSnsDiscoveryEnabled"` + ISnsDiscoveryMethod string `xml:"iSnsDiscoveryMethod,omitempty"` + ISnsHost string `xml:"iSnsHost,omitempty"` + SlpDiscoveryEnabled bool `xml:"slpDiscoveryEnabled"` + SlpDiscoveryMethod string `xml:"slpDiscoveryMethod,omitempty"` + SlpHost string `xml:"slpHost,omitempty"` + StaticTargetDiscoveryEnabled bool `xml:"staticTargetDiscoveryEnabled"` + SendTargetsDiscoveryEnabled bool `xml:"sendTargetsDiscoveryEnabled"` +} + +func init() { + t["HostInternetScsiHbaDiscoveryProperties"] = reflect.TypeOf((*HostInternetScsiHbaDiscoveryProperties)(nil)).Elem() +} + +type HostInternetScsiHbaIPCapabilities struct { + DynamicData + + AddressSettable bool `xml:"addressSettable"` + IpConfigurationMethodSettable bool `xml:"ipConfigurationMethodSettable"` + SubnetMaskSettable bool `xml:"subnetMaskSettable"` + DefaultGatewaySettable bool `xml:"defaultGatewaySettable"` + PrimaryDnsServerAddressSettable bool `xml:"primaryDnsServerAddressSettable"` + AlternateDnsServerAddressSettable bool `xml:"alternateDnsServerAddressSettable"` + Ipv6Supported *bool `xml:"ipv6Supported"` + ArpRedirectSettable *bool `xml:"arpRedirectSettable"` + MtuSettable *bool `xml:"mtuSettable"` + HostNameAsTargetAddress *bool `xml:"hostNameAsTargetAddress"` + NameAliasSettable *bool `xml:"nameAliasSettable"` + Ipv4EnableSettable *bool `xml:"ipv4EnableSettable"` + Ipv6EnableSettable *bool `xml:"ipv6EnableSettable"` + Ipv6PrefixLengthSettable *bool `xml:"ipv6PrefixLengthSettable"` + Ipv6PrefixLength int32 `xml:"ipv6PrefixLength,omitempty"` + Ipv6DhcpConfigurationSettable *bool `xml:"ipv6DhcpConfigurationSettable"` + Ipv6LinkLocalAutoConfigurationSettable *bool `xml:"ipv6LinkLocalAutoConfigurationSettable"` + Ipv6RouterAdvertisementConfigurationSettable *bool `xml:"ipv6RouterAdvertisementConfigurationSettable"` + Ipv6DefaultGatewaySettable *bool `xml:"ipv6DefaultGatewaySettable"` + Ipv6MaxStaticAddressesSupported int32 `xml:"ipv6MaxStaticAddressesSupported,omitempty"` +} + +func init() { + t["HostInternetScsiHbaIPCapabilities"] = reflect.TypeOf((*HostInternetScsiHbaIPCapabilities)(nil)).Elem() +} + +type HostInternetScsiHbaIPProperties struct { + DynamicData + + Mac string `xml:"mac,omitempty"` + Address string `xml:"address,omitempty"` + DhcpConfigurationEnabled bool `xml:"dhcpConfigurationEnabled"` + SubnetMask string `xml:"subnetMask,omitempty"` + DefaultGateway string `xml:"defaultGateway,omitempty"` + PrimaryDnsServerAddress string `xml:"primaryDnsServerAddress,omitempty"` + AlternateDnsServerAddress string `xml:"alternateDnsServerAddress,omitempty"` + Ipv6Address string `xml:"ipv6Address,omitempty"` + Ipv6SubnetMask string `xml:"ipv6SubnetMask,omitempty"` + Ipv6DefaultGateway string `xml:"ipv6DefaultGateway,omitempty"` + ArpRedirectEnabled *bool `xml:"arpRedirectEnabled"` + Mtu int32 `xml:"mtu,omitempty"` + JumboFramesEnabled *bool `xml:"jumboFramesEnabled"` + Ipv4Enabled *bool `xml:"ipv4Enabled"` + Ipv6Enabled *bool `xml:"ipv6Enabled"` + Ipv6properties *HostInternetScsiHbaIPv6Properties `xml:"ipv6properties,omitempty"` +} + +func init() { + t["HostInternetScsiHbaIPProperties"] = reflect.TypeOf((*HostInternetScsiHbaIPProperties)(nil)).Elem() +} + +type HostInternetScsiHbaIPv6Properties struct { + DynamicData + + IscsiIpv6Address []HostInternetScsiHbaIscsiIpv6Address `xml:"iscsiIpv6Address,omitempty"` + Ipv6DhcpConfigurationEnabled *bool `xml:"ipv6DhcpConfigurationEnabled"` + Ipv6LinkLocalAutoConfigurationEnabled *bool `xml:"ipv6LinkLocalAutoConfigurationEnabled"` + Ipv6RouterAdvertisementConfigurationEnabled *bool `xml:"ipv6RouterAdvertisementConfigurationEnabled"` + Ipv6DefaultGateway string `xml:"ipv6DefaultGateway,omitempty"` +} + +func init() { + t["HostInternetScsiHbaIPv6Properties"] = reflect.TypeOf((*HostInternetScsiHbaIPv6Properties)(nil)).Elem() +} + +type HostInternetScsiHbaIscsiIpv6Address struct { + DynamicData + + Address string `xml:"address"` + PrefixLength int32 `xml:"prefixLength"` + Origin string `xml:"origin"` + Operation string `xml:"operation,omitempty"` +} + +func init() { + t["HostInternetScsiHbaIscsiIpv6Address"] = reflect.TypeOf((*HostInternetScsiHbaIscsiIpv6Address)(nil)).Elem() +} + +type HostInternetScsiHbaParamValue struct { + OptionValue + + IsInherited *bool `xml:"isInherited"` +} + +func init() { + t["HostInternetScsiHbaParamValue"] = reflect.TypeOf((*HostInternetScsiHbaParamValue)(nil)).Elem() +} + +type HostInternetScsiHbaSendTarget struct { + DynamicData + + Address string `xml:"address"` + Port int32 `xml:"port,omitempty"` + AuthenticationProperties *HostInternetScsiHbaAuthenticationProperties `xml:"authenticationProperties,omitempty"` + DigestProperties *HostInternetScsiHbaDigestProperties `xml:"digestProperties,omitempty"` + SupportedAdvancedOptions []OptionDef `xml:"supportedAdvancedOptions,omitempty"` + AdvancedOptions []HostInternetScsiHbaParamValue `xml:"advancedOptions,omitempty"` + Parent string `xml:"parent,omitempty"` +} + +func init() { + t["HostInternetScsiHbaSendTarget"] = reflect.TypeOf((*HostInternetScsiHbaSendTarget)(nil)).Elem() +} + +type HostInternetScsiHbaStaticTarget struct { + DynamicData + + Address string `xml:"address"` + Port int32 `xml:"port,omitempty"` + IScsiName string `xml:"iScsiName"` + DiscoveryMethod string `xml:"discoveryMethod,omitempty"` + AuthenticationProperties *HostInternetScsiHbaAuthenticationProperties `xml:"authenticationProperties,omitempty"` + DigestProperties *HostInternetScsiHbaDigestProperties `xml:"digestProperties,omitempty"` + SupportedAdvancedOptions []OptionDef `xml:"supportedAdvancedOptions,omitempty"` + AdvancedOptions []HostInternetScsiHbaParamValue `xml:"advancedOptions,omitempty"` + Parent string `xml:"parent,omitempty"` +} + +func init() { + t["HostInternetScsiHbaStaticTarget"] = reflect.TypeOf((*HostInternetScsiHbaStaticTarget)(nil)).Elem() +} + +type HostInternetScsiHbaTargetSet struct { + DynamicData + + StaticTargets []HostInternetScsiHbaStaticTarget `xml:"staticTargets,omitempty"` + SendTargets []HostInternetScsiHbaSendTarget `xml:"sendTargets,omitempty"` +} + +func init() { + t["HostInternetScsiHbaTargetSet"] = reflect.TypeOf((*HostInternetScsiHbaTargetSet)(nil)).Elem() +} + +type HostInternetScsiTargetTransport struct { + HostTargetTransport + + IScsiName string `xml:"iScsiName"` + IScsiAlias string `xml:"iScsiAlias"` + Address []string `xml:"address,omitempty"` +} + +func init() { + t["HostInternetScsiTargetTransport"] = reflect.TypeOf((*HostInternetScsiTargetTransport)(nil)).Elem() +} + +type HostInventoryFull struct { + NotEnoughLicenses + + Capacity int32 `xml:"capacity"` +} + +func init() { + t["HostInventoryFull"] = reflect.TypeOf((*HostInventoryFull)(nil)).Elem() +} + +type HostInventoryFullEvent struct { + LicenseEvent + + Capacity int32 `xml:"capacity"` +} + +func init() { + t["HostInventoryFullEvent"] = reflect.TypeOf((*HostInventoryFullEvent)(nil)).Elem() +} + +type HostInventoryFullFault HostInventoryFull + +func init() { + t["HostInventoryFullFault"] = reflect.TypeOf((*HostInventoryFullFault)(nil)).Elem() +} + +type HostInventoryUnreadableEvent struct { + Event +} + +func init() { + t["HostInventoryUnreadableEvent"] = reflect.TypeOf((*HostInventoryUnreadableEvent)(nil)).Elem() +} + +type HostIoFilterInfo struct { + IoFilterInfo + + Available bool `xml:"available"` +} + +func init() { + t["HostIoFilterInfo"] = reflect.TypeOf((*HostIoFilterInfo)(nil)).Elem() +} + +type HostIpChangedEvent struct { + HostEvent + + OldIP string `xml:"oldIP"` + NewIP string `xml:"newIP"` +} + +func init() { + t["HostIpChangedEvent"] = reflect.TypeOf((*HostIpChangedEvent)(nil)).Elem() +} + +type HostIpConfig struct { + DynamicData + + Dhcp bool `xml:"dhcp"` + IpAddress string `xml:"ipAddress,omitempty"` + SubnetMask string `xml:"subnetMask,omitempty"` + IpV6Config *HostIpConfigIpV6AddressConfiguration `xml:"ipV6Config,omitempty"` +} + +func init() { + t["HostIpConfig"] = reflect.TypeOf((*HostIpConfig)(nil)).Elem() +} + +type HostIpConfigIpV6Address struct { + DynamicData + + IpAddress string `xml:"ipAddress"` + PrefixLength int32 `xml:"prefixLength"` + Origin string `xml:"origin,omitempty"` + DadState string `xml:"dadState,omitempty"` + Lifetime *time.Time `xml:"lifetime"` + Operation string `xml:"operation,omitempty"` +} + +func init() { + t["HostIpConfigIpV6Address"] = reflect.TypeOf((*HostIpConfigIpV6Address)(nil)).Elem() +} + +type HostIpConfigIpV6AddressConfiguration struct { + DynamicData + + IpV6Address []HostIpConfigIpV6Address `xml:"ipV6Address,omitempty"` + AutoConfigurationEnabled *bool `xml:"autoConfigurationEnabled"` + DhcpV6Enabled *bool `xml:"dhcpV6Enabled"` +} + +func init() { + t["HostIpConfigIpV6AddressConfiguration"] = reflect.TypeOf((*HostIpConfigIpV6AddressConfiguration)(nil)).Elem() +} + +type HostIpInconsistentEvent struct { + HostEvent + + IpAddress string `xml:"ipAddress"` + IpAddress2 string `xml:"ipAddress2"` +} + +func init() { + t["HostIpInconsistentEvent"] = reflect.TypeOf((*HostIpInconsistentEvent)(nil)).Elem() +} + +type HostIpRouteConfig struct { + DynamicData + + DefaultGateway string `xml:"defaultGateway,omitempty"` + GatewayDevice string `xml:"gatewayDevice,omitempty"` + IpV6DefaultGateway string `xml:"ipV6DefaultGateway,omitempty"` + IpV6GatewayDevice string `xml:"ipV6GatewayDevice,omitempty"` +} + +func init() { + t["HostIpRouteConfig"] = reflect.TypeOf((*HostIpRouteConfig)(nil)).Elem() +} + +type HostIpRouteConfigSpec struct { + HostIpRouteConfig + + GatewayDeviceConnection *HostVirtualNicConnection `xml:"gatewayDeviceConnection,omitempty"` + IpV6GatewayDeviceConnection *HostVirtualNicConnection `xml:"ipV6GatewayDeviceConnection,omitempty"` +} + +func init() { + t["HostIpRouteConfigSpec"] = reflect.TypeOf((*HostIpRouteConfigSpec)(nil)).Elem() +} + +type HostIpRouteEntry struct { + DynamicData + + Network string `xml:"network"` + PrefixLength int32 `xml:"prefixLength"` + Gateway string `xml:"gateway"` + DeviceName string `xml:"deviceName,omitempty"` +} + +func init() { + t["HostIpRouteEntry"] = reflect.TypeOf((*HostIpRouteEntry)(nil)).Elem() +} + +type HostIpRouteOp struct { + DynamicData + + ChangeOperation string `xml:"changeOperation"` + Route HostIpRouteEntry `xml:"route"` +} + +func init() { + t["HostIpRouteOp"] = reflect.TypeOf((*HostIpRouteOp)(nil)).Elem() +} + +type HostIpRouteTableConfig struct { + DynamicData + + IpRoute []HostIpRouteOp `xml:"ipRoute,omitempty"` + Ipv6Route []HostIpRouteOp `xml:"ipv6Route,omitempty"` +} + +func init() { + t["HostIpRouteTableConfig"] = reflect.TypeOf((*HostIpRouteTableConfig)(nil)).Elem() +} + +type HostIpRouteTableInfo struct { + DynamicData + + IpRoute []HostIpRouteEntry `xml:"ipRoute,omitempty"` + Ipv6Route []HostIpRouteEntry `xml:"ipv6Route,omitempty"` +} + +func init() { + t["HostIpRouteTableInfo"] = reflect.TypeOf((*HostIpRouteTableInfo)(nil)).Elem() +} + +type HostIpToShortNameFailedEvent struct { + HostEvent +} + +func init() { + t["HostIpToShortNameFailedEvent"] = reflect.TypeOf((*HostIpToShortNameFailedEvent)(nil)).Elem() +} + +type HostIpmiInfo struct { + DynamicData + + BmcIpAddress string `xml:"bmcIpAddress,omitempty"` + BmcMacAddress string `xml:"bmcMacAddress,omitempty"` + Login string `xml:"login,omitempty"` + Password string `xml:"password,omitempty"` +} + +func init() { + t["HostIpmiInfo"] = reflect.TypeOf((*HostIpmiInfo)(nil)).Elem() +} + +type HostIsolationIpPingFailedEvent struct { + HostDasEvent + + IsolationIp string `xml:"isolationIp"` +} + +func init() { + t["HostIsolationIpPingFailedEvent"] = reflect.TypeOf((*HostIsolationIpPingFailedEvent)(nil)).Elem() +} + +type HostLicensableResourceInfo struct { + DynamicData + + Resource []KeyAnyValue `xml:"resource"` +} + +func init() { + t["HostLicensableResourceInfo"] = reflect.TypeOf((*HostLicensableResourceInfo)(nil)).Elem() +} + +type HostLicenseConnectInfo struct { + DynamicData + + License LicenseManagerLicenseInfo `xml:"license"` + Evaluation LicenseManagerEvaluationInfo `xml:"evaluation"` + Resource *HostLicensableResourceInfo `xml:"resource,omitempty"` +} + +func init() { + t["HostLicenseConnectInfo"] = reflect.TypeOf((*HostLicenseConnectInfo)(nil)).Elem() +} + +type HostLicenseExpiredEvent struct { + LicenseEvent +} + +func init() { + t["HostLicenseExpiredEvent"] = reflect.TypeOf((*HostLicenseExpiredEvent)(nil)).Elem() +} + +type HostLicenseSpec struct { + DynamicData + + Source BaseLicenseSource `xml:"source,omitempty,typeattr"` + EditionKey string `xml:"editionKey,omitempty"` + DisabledFeatureKey []string `xml:"disabledFeatureKey,omitempty"` + EnabledFeatureKey []string `xml:"enabledFeatureKey,omitempty"` +} + +func init() { + t["HostLicenseSpec"] = reflect.TypeOf((*HostLicenseSpec)(nil)).Elem() +} + +type HostListSummary struct { + DynamicData + + Host *ManagedObjectReference `xml:"host,omitempty"` + Hardware *HostHardwareSummary `xml:"hardware,omitempty"` + Runtime *HostRuntimeInfo `xml:"runtime,omitempty"` + Config HostConfigSummary `xml:"config"` + QuickStats HostListSummaryQuickStats `xml:"quickStats"` + OverallStatus ManagedEntityStatus `xml:"overallStatus"` + RebootRequired bool `xml:"rebootRequired"` + CustomValue []BaseCustomFieldValue `xml:"customValue,omitempty,typeattr"` + ManagementServerIp string `xml:"managementServerIp,omitempty"` + MaxEVCModeKey string `xml:"maxEVCModeKey,omitempty"` + CurrentEVCModeKey string `xml:"currentEVCModeKey,omitempty"` + Gateway *HostListSummaryGatewaySummary `xml:"gateway,omitempty"` +} + +func init() { + t["HostListSummary"] = reflect.TypeOf((*HostListSummary)(nil)).Elem() +} + +type HostListSummaryGatewaySummary struct { + DynamicData + + GatewayType string `xml:"gatewayType"` + GatewayId string `xml:"gatewayId"` +} + +func init() { + t["HostListSummaryGatewaySummary"] = reflect.TypeOf((*HostListSummaryGatewaySummary)(nil)).Elem() +} + +type HostListSummaryQuickStats struct { + DynamicData + + OverallCpuUsage int32 `xml:"overallCpuUsage,omitempty"` + OverallMemoryUsage int32 `xml:"overallMemoryUsage,omitempty"` + DistributedCpuFairness int32 `xml:"distributedCpuFairness,omitempty"` + DistributedMemoryFairness int32 `xml:"distributedMemoryFairness,omitempty"` + Uptime int32 `xml:"uptime,omitempty"` +} + +func init() { + t["HostListSummaryQuickStats"] = reflect.TypeOf((*HostListSummaryQuickStats)(nil)).Elem() +} + +type HostLocalAuthenticationInfo struct { + HostAuthenticationStoreInfo +} + +func init() { + t["HostLocalAuthenticationInfo"] = reflect.TypeOf((*HostLocalAuthenticationInfo)(nil)).Elem() +} + +type HostLocalFileSystemVolume struct { + HostFileSystemVolume + + Device string `xml:"device"` +} + +func init() { + t["HostLocalFileSystemVolume"] = reflect.TypeOf((*HostLocalFileSystemVolume)(nil)).Elem() +} + +type HostLocalFileSystemVolumeSpec struct { + DynamicData + + Device string `xml:"device"` + LocalPath string `xml:"localPath"` +} + +func init() { + t["HostLocalFileSystemVolumeSpec"] = reflect.TypeOf((*HostLocalFileSystemVolumeSpec)(nil)).Elem() +} + +type HostLocalPortCreatedEvent struct { + DvsEvent + + HostLocalPort DVSHostLocalPortInfo `xml:"hostLocalPort"` +} + +func init() { + t["HostLocalPortCreatedEvent"] = reflect.TypeOf((*HostLocalPortCreatedEvent)(nil)).Elem() +} + +type HostLowLevelProvisioningManagerDiskLayoutSpec struct { + DynamicData + + ControllerType string `xml:"controllerType"` + BusNumber int32 `xml:"busNumber"` + UnitNumber *int32 `xml:"unitNumber"` + SrcFilename string `xml:"srcFilename"` + DstFilename string `xml:"dstFilename"` +} + +func init() { + t["HostLowLevelProvisioningManagerDiskLayoutSpec"] = reflect.TypeOf((*HostLowLevelProvisioningManagerDiskLayoutSpec)(nil)).Elem() +} + +type HostLowLevelProvisioningManagerFileDeleteResult struct { + DynamicData + + FileName string `xml:"fileName"` + Fault LocalizedMethodFault `xml:"fault"` +} + +func init() { + t["HostLowLevelProvisioningManagerFileDeleteResult"] = reflect.TypeOf((*HostLowLevelProvisioningManagerFileDeleteResult)(nil)).Elem() +} + +type HostLowLevelProvisioningManagerFileDeleteSpec struct { + DynamicData + + FileName string `xml:"fileName"` + FileType string `xml:"fileType"` +} + +func init() { + t["HostLowLevelProvisioningManagerFileDeleteSpec"] = reflect.TypeOf((*HostLowLevelProvisioningManagerFileDeleteSpec)(nil)).Elem() +} + +type HostLowLevelProvisioningManagerFileReserveResult struct { + DynamicData + + BaseName string `xml:"baseName"` + ParentDir string `xml:"parentDir"` + ReservedName string `xml:"reservedName"` +} + +func init() { + t["HostLowLevelProvisioningManagerFileReserveResult"] = reflect.TypeOf((*HostLowLevelProvisioningManagerFileReserveResult)(nil)).Elem() +} + +type HostLowLevelProvisioningManagerFileReserveSpec struct { + DynamicData + + BaseName string `xml:"baseName"` + ParentDir string `xml:"parentDir"` + FileType string `xml:"fileType"` + StorageProfile string `xml:"storageProfile"` +} + +func init() { + t["HostLowLevelProvisioningManagerFileReserveSpec"] = reflect.TypeOf((*HostLowLevelProvisioningManagerFileReserveSpec)(nil)).Elem() +} + +type HostLowLevelProvisioningManagerSnapshotLayoutSpec struct { + DynamicData + + Id int32 `xml:"id"` + SrcFilename string `xml:"srcFilename"` + DstFilename string `xml:"dstFilename"` + Disk []HostLowLevelProvisioningManagerDiskLayoutSpec `xml:"disk,omitempty"` +} + +func init() { + t["HostLowLevelProvisioningManagerSnapshotLayoutSpec"] = reflect.TypeOf((*HostLowLevelProvisioningManagerSnapshotLayoutSpec)(nil)).Elem() +} + +type HostLowLevelProvisioningManagerVmMigrationStatus struct { + DynamicData + + MigrationId int64 `xml:"migrationId"` + Type string `xml:"type"` + Source bool `xml:"source"` + ConsideredSuccessful bool `xml:"consideredSuccessful"` +} + +func init() { + t["HostLowLevelProvisioningManagerVmMigrationStatus"] = reflect.TypeOf((*HostLowLevelProvisioningManagerVmMigrationStatus)(nil)).Elem() +} + +type HostLowLevelProvisioningManagerVmRecoveryInfo struct { + DynamicData + + Version string `xml:"version"` + BiosUUID string `xml:"biosUUID"` + InstanceUUID string `xml:"instanceUUID"` + FtInfo BaseFaultToleranceConfigInfo `xml:"ftInfo,omitempty,typeattr"` +} + +func init() { + t["HostLowLevelProvisioningManagerVmRecoveryInfo"] = reflect.TypeOf((*HostLowLevelProvisioningManagerVmRecoveryInfo)(nil)).Elem() +} + +type HostMaintenanceSpec struct { + DynamicData + + VsanMode *VsanHostDecommissionMode `xml:"vsanMode,omitempty"` +} + +func init() { + t["HostMaintenanceSpec"] = reflect.TypeOf((*HostMaintenanceSpec)(nil)).Elem() +} + +type HostMemberHealthCheckResult struct { + DynamicData + + Summary string `xml:"summary,omitempty"` +} + +func init() { + t["HostMemberHealthCheckResult"] = reflect.TypeOf((*HostMemberHealthCheckResult)(nil)).Elem() +} + +type HostMemberRuntimeInfo struct { + DynamicData + + Host ManagedObjectReference `xml:"host"` + Status string `xml:"status,omitempty"` + StatusDetail string `xml:"statusDetail,omitempty"` + HealthCheckResult []BaseHostMemberHealthCheckResult `xml:"healthCheckResult,omitempty,typeattr"` +} + +func init() { + t["HostMemberRuntimeInfo"] = reflect.TypeOf((*HostMemberRuntimeInfo)(nil)).Elem() +} + +type HostMemberUplinkHealthCheckResult struct { + HostMemberHealthCheckResult + + UplinkPortKey string `xml:"uplinkPortKey"` +} + +func init() { + t["HostMemberUplinkHealthCheckResult"] = reflect.TypeOf((*HostMemberUplinkHealthCheckResult)(nil)).Elem() +} + +type HostMemoryProfile struct { + ApplyProfile +} + +func init() { + t["HostMemoryProfile"] = reflect.TypeOf((*HostMemoryProfile)(nil)).Elem() +} + +type HostMemorySpec struct { + DynamicData + + ServiceConsoleReservation int64 `xml:"serviceConsoleReservation,omitempty"` +} + +func init() { + t["HostMemorySpec"] = reflect.TypeOf((*HostMemorySpec)(nil)).Elem() +} + +type HostMissingNetworksEvent struct { + HostDasEvent + + Ips string `xml:"ips,omitempty"` +} + +func init() { + t["HostMissingNetworksEvent"] = reflect.TypeOf((*HostMissingNetworksEvent)(nil)).Elem() +} + +type HostMonitoringStateChangedEvent struct { + ClusterEvent + + State string `xml:"state"` +} + +func init() { + t["HostMonitoringStateChangedEvent"] = reflect.TypeOf((*HostMonitoringStateChangedEvent)(nil)).Elem() +} + +type HostMountInfo struct { + DynamicData + + Path string `xml:"path,omitempty"` + AccessMode string `xml:"accessMode"` + Mounted *bool `xml:"mounted"` + Accessible *bool `xml:"accessible"` + InaccessibleReason string `xml:"inaccessibleReason,omitempty"` +} + +func init() { + t["HostMountInfo"] = reflect.TypeOf((*HostMountInfo)(nil)).Elem() +} + +type HostMultipathInfo struct { + DynamicData + + Lun []HostMultipathInfoLogicalUnit `xml:"lun,omitempty"` +} + +func init() { + t["HostMultipathInfo"] = reflect.TypeOf((*HostMultipathInfo)(nil)).Elem() +} + +type HostMultipathInfoFixedLogicalUnitPolicy struct { + HostMultipathInfoLogicalUnitPolicy + + Prefer string `xml:"prefer"` +} + +func init() { + t["HostMultipathInfoFixedLogicalUnitPolicy"] = reflect.TypeOf((*HostMultipathInfoFixedLogicalUnitPolicy)(nil)).Elem() +} + +type HostMultipathInfoLogicalUnit struct { + DynamicData + + Key string `xml:"key"` + Id string `xml:"id"` + Lun string `xml:"lun"` + Path []HostMultipathInfoPath `xml:"path"` + Policy BaseHostMultipathInfoLogicalUnitPolicy `xml:"policy,typeattr"` + StorageArrayTypePolicy *HostMultipathInfoLogicalUnitStorageArrayTypePolicy `xml:"storageArrayTypePolicy,omitempty"` +} + +func init() { + t["HostMultipathInfoLogicalUnit"] = reflect.TypeOf((*HostMultipathInfoLogicalUnit)(nil)).Elem() +} + +type HostMultipathInfoLogicalUnitPolicy struct { + DynamicData + + Policy string `xml:"policy"` +} + +func init() { + t["HostMultipathInfoLogicalUnitPolicy"] = reflect.TypeOf((*HostMultipathInfoLogicalUnitPolicy)(nil)).Elem() +} + +type HostMultipathInfoLogicalUnitStorageArrayTypePolicy struct { + DynamicData + + Policy string `xml:"policy"` +} + +func init() { + t["HostMultipathInfoLogicalUnitStorageArrayTypePolicy"] = reflect.TypeOf((*HostMultipathInfoLogicalUnitStorageArrayTypePolicy)(nil)).Elem() +} + +type HostMultipathInfoPath struct { + DynamicData + + Key string `xml:"key"` + Name string `xml:"name"` + PathState string `xml:"pathState"` + State string `xml:"state,omitempty"` + IsWorkingPath *bool `xml:"isWorkingPath"` + Adapter string `xml:"adapter"` + Lun string `xml:"lun"` + Transport BaseHostTargetTransport `xml:"transport,omitempty,typeattr"` +} + +func init() { + t["HostMultipathInfoPath"] = reflect.TypeOf((*HostMultipathInfoPath)(nil)).Elem() +} + +type HostMultipathStateInfo struct { + DynamicData + + Path []HostMultipathStateInfoPath `xml:"path,omitempty"` +} + +func init() { + t["HostMultipathStateInfo"] = reflect.TypeOf((*HostMultipathStateInfo)(nil)).Elem() +} + +type HostMultipathStateInfoPath struct { + DynamicData + + Name string `xml:"name"` + PathState string `xml:"pathState"` +} + +func init() { + t["HostMultipathStateInfoPath"] = reflect.TypeOf((*HostMultipathStateInfoPath)(nil)).Elem() +} + +type HostNasVolume struct { + HostFileSystemVolume + + RemoteHost string `xml:"remoteHost"` + RemotePath string `xml:"remotePath"` + UserName string `xml:"userName,omitempty"` + RemoteHostNames []string `xml:"remoteHostNames,omitempty"` + SecurityType string `xml:"securityType,omitempty"` + ProtocolEndpoint *bool `xml:"protocolEndpoint"` +} + +func init() { + t["HostNasVolume"] = reflect.TypeOf((*HostNasVolume)(nil)).Elem() +} + +type HostNasVolumeConfig struct { + DynamicData + + ChangeOperation string `xml:"changeOperation,omitempty"` + Spec *HostNasVolumeSpec `xml:"spec,omitempty"` +} + +func init() { + t["HostNasVolumeConfig"] = reflect.TypeOf((*HostNasVolumeConfig)(nil)).Elem() +} + +type HostNasVolumeSpec struct { + DynamicData + + RemoteHost string `xml:"remoteHost"` + RemotePath string `xml:"remotePath"` + LocalPath string `xml:"localPath"` + AccessMode string `xml:"accessMode"` + Type string `xml:"type,omitempty"` + UserName string `xml:"userName,omitempty"` + Password string `xml:"password,omitempty"` + RemoteHostNames []string `xml:"remoteHostNames,omitempty"` + SecurityType string `xml:"securityType,omitempty"` +} + +func init() { + t["HostNasVolumeSpec"] = reflect.TypeOf((*HostNasVolumeSpec)(nil)).Elem() +} + +type HostNasVolumeUserInfo struct { + DynamicData + + User string `xml:"user"` +} + +func init() { + t["HostNasVolumeUserInfo"] = reflect.TypeOf((*HostNasVolumeUserInfo)(nil)).Elem() +} + +type HostNatService struct { + DynamicData + + Key string `xml:"key"` + Spec HostNatServiceSpec `xml:"spec"` +} + +func init() { + t["HostNatService"] = reflect.TypeOf((*HostNatService)(nil)).Elem() +} + +type HostNatServiceConfig struct { + DynamicData + + ChangeOperation string `xml:"changeOperation,omitempty"` + Key string `xml:"key"` + Spec HostNatServiceSpec `xml:"spec"` +} + +func init() { + t["HostNatServiceConfig"] = reflect.TypeOf((*HostNatServiceConfig)(nil)).Elem() +} + +type HostNatServiceNameServiceSpec struct { + DynamicData + + DnsAutoDetect bool `xml:"dnsAutoDetect"` + DnsPolicy string `xml:"dnsPolicy"` + DnsRetries int32 `xml:"dnsRetries"` + DnsTimeout int32 `xml:"dnsTimeout"` + DnsNameServer []string `xml:"dnsNameServer,omitempty"` + NbdsTimeout int32 `xml:"nbdsTimeout"` + NbnsRetries int32 `xml:"nbnsRetries"` + NbnsTimeout int32 `xml:"nbnsTimeout"` +} + +func init() { + t["HostNatServiceNameServiceSpec"] = reflect.TypeOf((*HostNatServiceNameServiceSpec)(nil)).Elem() +} + +type HostNatServicePortForwardSpec struct { + DynamicData + + Type string `xml:"type"` + Name string `xml:"name"` + HostPort int32 `xml:"hostPort"` + GuestPort int32 `xml:"guestPort"` + GuestIpAddress string `xml:"guestIpAddress"` +} + +func init() { + t["HostNatServicePortForwardSpec"] = reflect.TypeOf((*HostNatServicePortForwardSpec)(nil)).Elem() +} + +type HostNatServiceSpec struct { + DynamicData + + VirtualSwitch string `xml:"virtualSwitch"` + ActiveFtp bool `xml:"activeFtp"` + AllowAnyOui bool `xml:"allowAnyOui"` + ConfigPort bool `xml:"configPort"` + IpGatewayAddress string `xml:"ipGatewayAddress"` + UdpTimeout int32 `xml:"udpTimeout"` + PortForward []HostNatServicePortForwardSpec `xml:"portForward,omitempty"` + NameService *HostNatServiceNameServiceSpec `xml:"nameService,omitempty"` +} + +func init() { + t["HostNatServiceSpec"] = reflect.TypeOf((*HostNatServiceSpec)(nil)).Elem() +} + +type HostNetCapabilities struct { + DynamicData + + CanSetPhysicalNicLinkSpeed bool `xml:"canSetPhysicalNicLinkSpeed"` + SupportsNicTeaming bool `xml:"supportsNicTeaming"` + NicTeamingPolicy []string `xml:"nicTeamingPolicy,omitempty"` + SupportsVlan bool `xml:"supportsVlan"` + UsesServiceConsoleNic bool `xml:"usesServiceConsoleNic"` + SupportsNetworkHints bool `xml:"supportsNetworkHints"` + MaxPortGroupsPerVswitch int32 `xml:"maxPortGroupsPerVswitch,omitempty"` + VswitchConfigSupported bool `xml:"vswitchConfigSupported"` + VnicConfigSupported bool `xml:"vnicConfigSupported"` + IpRouteConfigSupported bool `xml:"ipRouteConfigSupported"` + DnsConfigSupported bool `xml:"dnsConfigSupported"` + DhcpOnVnicSupported bool `xml:"dhcpOnVnicSupported"` + IpV6Supported *bool `xml:"ipV6Supported"` +} + +func init() { + t["HostNetCapabilities"] = reflect.TypeOf((*HostNetCapabilities)(nil)).Elem() +} + +type HostNetOffloadCapabilities struct { + DynamicData + + CsumOffload *bool `xml:"csumOffload"` + TcpSegmentation *bool `xml:"tcpSegmentation"` + ZeroCopyXmit *bool `xml:"zeroCopyXmit"` +} + +func init() { + t["HostNetOffloadCapabilities"] = reflect.TypeOf((*HostNetOffloadCapabilities)(nil)).Elem() +} + +type HostNetStackInstance struct { + DynamicData + + Key string `xml:"key,omitempty"` + Name string `xml:"name,omitempty"` + DnsConfig BaseHostDnsConfig `xml:"dnsConfig,omitempty,typeattr"` + IpRouteConfig BaseHostIpRouteConfig `xml:"ipRouteConfig,omitempty,typeattr"` + RequestedMaxNumberOfConnections int32 `xml:"requestedMaxNumberOfConnections,omitempty"` + CongestionControlAlgorithm string `xml:"congestionControlAlgorithm,omitempty"` + IpV6Enabled *bool `xml:"ipV6Enabled"` + RouteTableConfig *HostIpRouteTableConfig `xml:"routeTableConfig,omitempty"` +} + +func init() { + t["HostNetStackInstance"] = reflect.TypeOf((*HostNetStackInstance)(nil)).Elem() +} + +type HostNetworkConfig struct { + DynamicData + + Vswitch []HostVirtualSwitchConfig `xml:"vswitch,omitempty"` + ProxySwitch []HostProxySwitchConfig `xml:"proxySwitch,omitempty"` + Portgroup []HostPortGroupConfig `xml:"portgroup,omitempty"` + Pnic []PhysicalNicConfig `xml:"pnic,omitempty"` + Vnic []HostVirtualNicConfig `xml:"vnic,omitempty"` + ConsoleVnic []HostVirtualNicConfig `xml:"consoleVnic,omitempty"` + DnsConfig BaseHostDnsConfig `xml:"dnsConfig,omitempty,typeattr"` + IpRouteConfig BaseHostIpRouteConfig `xml:"ipRouteConfig,omitempty,typeattr"` + ConsoleIpRouteConfig BaseHostIpRouteConfig `xml:"consoleIpRouteConfig,omitempty,typeattr"` + RouteTableConfig *HostIpRouteTableConfig `xml:"routeTableConfig,omitempty"` + Dhcp []HostDhcpServiceConfig `xml:"dhcp,omitempty"` + Nat []HostNatServiceConfig `xml:"nat,omitempty"` + IpV6Enabled *bool `xml:"ipV6Enabled"` + NetStackSpec []HostNetworkConfigNetStackSpec `xml:"netStackSpec,omitempty"` +} + +func init() { + t["HostNetworkConfig"] = reflect.TypeOf((*HostNetworkConfig)(nil)).Elem() +} + +type HostNetworkConfigNetStackSpec struct { + DynamicData + + NetStackInstance HostNetStackInstance `xml:"netStackInstance"` + Operation string `xml:"operation,omitempty"` +} + +func init() { + t["HostNetworkConfigNetStackSpec"] = reflect.TypeOf((*HostNetworkConfigNetStackSpec)(nil)).Elem() +} + +type HostNetworkConfigResult struct { + DynamicData + + VnicDevice []string `xml:"vnicDevice,omitempty"` + ConsoleVnicDevice []string `xml:"consoleVnicDevice,omitempty"` +} + +func init() { + t["HostNetworkConfigResult"] = reflect.TypeOf((*HostNetworkConfigResult)(nil)).Elem() +} + +type HostNetworkInfo struct { + DynamicData + + Vswitch []HostVirtualSwitch `xml:"vswitch,omitempty"` + ProxySwitch []HostProxySwitch `xml:"proxySwitch,omitempty"` + Portgroup []HostPortGroup `xml:"portgroup,omitempty"` + Pnic []PhysicalNic `xml:"pnic,omitempty"` + Vnic []HostVirtualNic `xml:"vnic,omitempty"` + ConsoleVnic []HostVirtualNic `xml:"consoleVnic,omitempty"` + DnsConfig BaseHostDnsConfig `xml:"dnsConfig,omitempty,typeattr"` + IpRouteConfig BaseHostIpRouteConfig `xml:"ipRouteConfig,omitempty,typeattr"` + ConsoleIpRouteConfig BaseHostIpRouteConfig `xml:"consoleIpRouteConfig,omitempty,typeattr"` + RouteTableInfo *HostIpRouteTableInfo `xml:"routeTableInfo,omitempty"` + Dhcp []HostDhcpService `xml:"dhcp,omitempty"` + Nat []HostNatService `xml:"nat,omitempty"` + IpV6Enabled *bool `xml:"ipV6Enabled"` + AtBootIpV6Enabled *bool `xml:"atBootIpV6Enabled"` + NetStackInstance []HostNetStackInstance `xml:"netStackInstance,omitempty"` + OpaqueSwitch []HostOpaqueSwitch `xml:"opaqueSwitch,omitempty"` + OpaqueNetwork []HostOpaqueNetworkInfo `xml:"opaqueNetwork,omitempty"` +} + +func init() { + t["HostNetworkInfo"] = reflect.TypeOf((*HostNetworkInfo)(nil)).Elem() +} + +type HostNetworkPolicy struct { + DynamicData + + Security *HostNetworkSecurityPolicy `xml:"security,omitempty"` + NicTeaming *HostNicTeamingPolicy `xml:"nicTeaming,omitempty"` + OffloadPolicy *HostNetOffloadCapabilities `xml:"offloadPolicy,omitempty"` + ShapingPolicy *HostNetworkTrafficShapingPolicy `xml:"shapingPolicy,omitempty"` +} + +func init() { + t["HostNetworkPolicy"] = reflect.TypeOf((*HostNetworkPolicy)(nil)).Elem() +} + +type HostNetworkResourceRuntime struct { + DynamicData + + PnicResourceInfo []HostPnicNetworkResourceInfo `xml:"pnicResourceInfo"` +} + +func init() { + t["HostNetworkResourceRuntime"] = reflect.TypeOf((*HostNetworkResourceRuntime)(nil)).Elem() +} + +type HostNetworkSecurityPolicy struct { + DynamicData + + AllowPromiscuous *bool `xml:"allowPromiscuous"` + MacChanges *bool `xml:"macChanges"` + ForgedTransmits *bool `xml:"forgedTransmits"` +} + +func init() { + t["HostNetworkSecurityPolicy"] = reflect.TypeOf((*HostNetworkSecurityPolicy)(nil)).Elem() +} + +type HostNetworkTrafficShapingPolicy struct { + DynamicData + + Enabled *bool `xml:"enabled"` + AverageBandwidth int64 `xml:"averageBandwidth,omitempty"` + PeakBandwidth int64 `xml:"peakBandwidth,omitempty"` + BurstSize int64 `xml:"burstSize,omitempty"` +} + +func init() { + t["HostNetworkTrafficShapingPolicy"] = reflect.TypeOf((*HostNetworkTrafficShapingPolicy)(nil)).Elem() +} + +type HostNewNetworkConnectInfo struct { + HostConnectInfoNetworkInfo +} + +func init() { + t["HostNewNetworkConnectInfo"] = reflect.TypeOf((*HostNewNetworkConnectInfo)(nil)).Elem() +} + +type HostNicFailureCriteria struct { + DynamicData + + CheckSpeed string `xml:"checkSpeed,omitempty"` + Speed int32 `xml:"speed,omitempty"` + CheckDuplex *bool `xml:"checkDuplex"` + FullDuplex *bool `xml:"fullDuplex"` + CheckErrorPercent *bool `xml:"checkErrorPercent"` + Percentage int32 `xml:"percentage,omitempty"` + CheckBeacon *bool `xml:"checkBeacon"` +} + +func init() { + t["HostNicFailureCriteria"] = reflect.TypeOf((*HostNicFailureCriteria)(nil)).Elem() +} + +type HostNicOrderPolicy struct { + DynamicData + + ActiveNic []string `xml:"activeNic,omitempty"` + StandbyNic []string `xml:"standbyNic,omitempty"` +} + +func init() { + t["HostNicOrderPolicy"] = reflect.TypeOf((*HostNicOrderPolicy)(nil)).Elem() +} + +type HostNicTeamingPolicy struct { + DynamicData + + Policy string `xml:"policy,omitempty"` + ReversePolicy *bool `xml:"reversePolicy"` + NotifySwitches *bool `xml:"notifySwitches"` + RollingOrder *bool `xml:"rollingOrder"` + FailureCriteria *HostNicFailureCriteria `xml:"failureCriteria,omitempty"` + NicOrder *HostNicOrderPolicy `xml:"nicOrder,omitempty"` +} + +func init() { + t["HostNicTeamingPolicy"] = reflect.TypeOf((*HostNicTeamingPolicy)(nil)).Elem() +} + +type HostNoAvailableNetworksEvent struct { + HostDasEvent + + Ips string `xml:"ips,omitempty"` +} + +func init() { + t["HostNoAvailableNetworksEvent"] = reflect.TypeOf((*HostNoAvailableNetworksEvent)(nil)).Elem() +} + +type HostNoHAEnabledPortGroupsEvent struct { + HostDasEvent +} + +func init() { + t["HostNoHAEnabledPortGroupsEvent"] = reflect.TypeOf((*HostNoHAEnabledPortGroupsEvent)(nil)).Elem() +} + +type HostNoRedundantManagementNetworkEvent struct { + HostDasEvent +} + +func init() { + t["HostNoRedundantManagementNetworkEvent"] = reflect.TypeOf((*HostNoRedundantManagementNetworkEvent)(nil)).Elem() +} + +type HostNonCompliantEvent struct { + HostEvent +} + +func init() { + t["HostNonCompliantEvent"] = reflect.TypeOf((*HostNonCompliantEvent)(nil)).Elem() +} + +type HostNotConnected struct { + HostCommunication +} + +func init() { + t["HostNotConnected"] = reflect.TypeOf((*HostNotConnected)(nil)).Elem() +} + +type HostNotConnectedFault HostNotConnected + +func init() { + t["HostNotConnectedFault"] = reflect.TypeOf((*HostNotConnectedFault)(nil)).Elem() +} + +type HostNotInClusterEvent struct { + HostDasEvent +} + +func init() { + t["HostNotInClusterEvent"] = reflect.TypeOf((*HostNotInClusterEvent)(nil)).Elem() +} + +type HostNotReachable struct { + HostCommunication +} + +func init() { + t["HostNotReachable"] = reflect.TypeOf((*HostNotReachable)(nil)).Elem() +} + +type HostNotReachableFault HostNotReachable + +func init() { + t["HostNotReachableFault"] = reflect.TypeOf((*HostNotReachableFault)(nil)).Elem() +} + +type HostNtpConfig struct { + DynamicData + + Server []string `xml:"server,omitempty"` + ConfigFile []string `xml:"configFile,omitempty"` +} + +func init() { + t["HostNtpConfig"] = reflect.TypeOf((*HostNtpConfig)(nil)).Elem() +} + +type HostNumaInfo struct { + DynamicData + + Type string `xml:"type"` + NumNodes int32 `xml:"numNodes"` + NumaNode []HostNumaNode `xml:"numaNode,omitempty"` +} + +func init() { + t["HostNumaInfo"] = reflect.TypeOf((*HostNumaInfo)(nil)).Elem() +} + +type HostNumaNode struct { + DynamicData + + TypeId byte `xml:"typeId"` + CpuID []int16 `xml:"cpuID"` + MemoryRangeBegin int64 `xml:"memoryRangeBegin"` + MemoryRangeLength int64 `xml:"memoryRangeLength"` +} + +func init() { + t["HostNumaNode"] = reflect.TypeOf((*HostNumaNode)(nil)).Elem() +} + +type HostNumericSensorInfo struct { + DynamicData + + Name string `xml:"name"` + HealthState BaseElementDescription `xml:"healthState,omitempty,typeattr"` + CurrentReading int64 `xml:"currentReading"` + UnitModifier int32 `xml:"unitModifier"` + BaseUnits string `xml:"baseUnits"` + RateUnits string `xml:"rateUnits,omitempty"` + SensorType string `xml:"sensorType"` +} + +func init() { + t["HostNumericSensorInfo"] = reflect.TypeOf((*HostNumericSensorInfo)(nil)).Elem() +} + +type HostOpaqueNetworkInfo struct { + DynamicData + + OpaqueNetworkId string `xml:"opaqueNetworkId"` + OpaqueNetworkName string `xml:"opaqueNetworkName"` + OpaqueNetworkType string `xml:"opaqueNetworkType"` + PnicZone []string `xml:"pnicZone,omitempty"` +} + +func init() { + t["HostOpaqueNetworkInfo"] = reflect.TypeOf((*HostOpaqueNetworkInfo)(nil)).Elem() +} + +type HostOpaqueSwitch struct { + DynamicData + + Key string `xml:"key"` + Name string `xml:"name,omitempty"` + Pnic []string `xml:"pnic,omitempty"` + PnicZone []HostOpaqueSwitchPhysicalNicZone `xml:"pnicZone,omitempty"` + Status string `xml:"status,omitempty"` + Vtep []HostVirtualNic `xml:"vtep,omitempty"` +} + +func init() { + t["HostOpaqueSwitch"] = reflect.TypeOf((*HostOpaqueSwitch)(nil)).Elem() +} + +type HostOpaqueSwitchPhysicalNicZone struct { + DynamicData + + Key string `xml:"key"` + PnicDevice []string `xml:"pnicDevice,omitempty"` +} + +func init() { + t["HostOpaqueSwitchPhysicalNicZone"] = reflect.TypeOf((*HostOpaqueSwitchPhysicalNicZone)(nil)).Elem() +} + +type HostOvercommittedEvent struct { + ClusterOvercommittedEvent +} + +func init() { + t["HostOvercommittedEvent"] = reflect.TypeOf((*HostOvercommittedEvent)(nil)).Elem() +} + +type HostParallelScsiHba struct { + HostHostBusAdapter +} + +func init() { + t["HostParallelScsiHba"] = reflect.TypeOf((*HostParallelScsiHba)(nil)).Elem() +} + +type HostParallelScsiTargetTransport struct { + HostTargetTransport +} + +func init() { + t["HostParallelScsiTargetTransport"] = reflect.TypeOf((*HostParallelScsiTargetTransport)(nil)).Elem() +} + +type HostPatchManagerLocator struct { + DynamicData + + Url string `xml:"url"` + Proxy string `xml:"proxy,omitempty"` +} + +func init() { + t["HostPatchManagerLocator"] = reflect.TypeOf((*HostPatchManagerLocator)(nil)).Elem() +} + +type HostPatchManagerPatchManagerOperationSpec struct { + DynamicData + + Proxy string `xml:"proxy,omitempty"` + Port int32 `xml:"port,omitempty"` + UserName string `xml:"userName,omitempty"` + Password string `xml:"password,omitempty"` + CmdOption string `xml:"cmdOption,omitempty"` +} + +func init() { + t["HostPatchManagerPatchManagerOperationSpec"] = reflect.TypeOf((*HostPatchManagerPatchManagerOperationSpec)(nil)).Elem() +} + +type HostPatchManagerResult struct { + DynamicData + + Version string `xml:"version"` + Status []HostPatchManagerStatus `xml:"status,omitempty"` + XmlResult string `xml:"xmlResult,omitempty"` +} + +func init() { + t["HostPatchManagerResult"] = reflect.TypeOf((*HostPatchManagerResult)(nil)).Elem() +} + +type HostPatchManagerStatus struct { + DynamicData + + Id string `xml:"id"` + Applicable bool `xml:"applicable"` + Reason []string `xml:"reason,omitempty"` + Integrity string `xml:"integrity,omitempty"` + Installed bool `xml:"installed"` + InstallState []string `xml:"installState,omitempty"` + PrerequisitePatch []HostPatchManagerStatusPrerequisitePatch `xml:"prerequisitePatch,omitempty"` + RestartRequired bool `xml:"restartRequired"` + ReconnectRequired bool `xml:"reconnectRequired"` + VmOffRequired bool `xml:"vmOffRequired"` + SupersededPatchIds []string `xml:"supersededPatchIds,omitempty"` +} + +func init() { + t["HostPatchManagerStatus"] = reflect.TypeOf((*HostPatchManagerStatus)(nil)).Elem() +} + +type HostPatchManagerStatusPrerequisitePatch struct { + DynamicData + + Id string `xml:"id"` + InstallState []string `xml:"installState,omitempty"` +} + +func init() { + t["HostPatchManagerStatusPrerequisitePatch"] = reflect.TypeOf((*HostPatchManagerStatusPrerequisitePatch)(nil)).Elem() +} + +type HostPathSelectionPolicyOption struct { + DynamicData + + Policy BaseElementDescription `xml:"policy,typeattr"` +} + +func init() { + t["HostPathSelectionPolicyOption"] = reflect.TypeOf((*HostPathSelectionPolicyOption)(nil)).Elem() +} + +type HostPciDevice struct { + DynamicData + + Id string `xml:"id"` + ClassId int16 `xml:"classId"` + Bus byte `xml:"bus"` + Slot byte `xml:"slot"` + Function byte `xml:"function"` + VendorId int16 `xml:"vendorId"` + SubVendorId int16 `xml:"subVendorId"` + VendorName string `xml:"vendorName"` + DeviceId int16 `xml:"deviceId"` + SubDeviceId int16 `xml:"subDeviceId"` + ParentBridge string `xml:"parentBridge,omitempty"` + DeviceName string `xml:"deviceName"` +} + +func init() { + t["HostPciDevice"] = reflect.TypeOf((*HostPciDevice)(nil)).Elem() +} + +type HostPciPassthruConfig struct { + DynamicData + + Id string `xml:"id"` + PassthruEnabled bool `xml:"passthruEnabled"` +} + +func init() { + t["HostPciPassthruConfig"] = reflect.TypeOf((*HostPciPassthruConfig)(nil)).Elem() +} + +type HostPciPassthruInfo struct { + DynamicData + + Id string `xml:"id"` + DependentDevice string `xml:"dependentDevice"` + PassthruEnabled bool `xml:"passthruEnabled"` + PassthruCapable bool `xml:"passthruCapable"` + PassthruActive bool `xml:"passthruActive"` +} + +func init() { + t["HostPciPassthruInfo"] = reflect.TypeOf((*HostPciPassthruInfo)(nil)).Elem() +} + +type HostPlacedVirtualNicIdentifier struct { + DynamicData + + Vm ManagedObjectReference `xml:"vm"` + VnicKey string `xml:"vnicKey"` + Reservation int32 `xml:"reservation,omitempty"` +} + +func init() { + t["HostPlacedVirtualNicIdentifier"] = reflect.TypeOf((*HostPlacedVirtualNicIdentifier)(nil)).Elem() +} + +type HostPlugStoreTopology struct { + DynamicData + + Adapter []HostPlugStoreTopologyAdapter `xml:"adapter,omitempty"` + Path []HostPlugStoreTopologyPath `xml:"path,omitempty"` + Target []HostPlugStoreTopologyTarget `xml:"target,omitempty"` + Device []HostPlugStoreTopologyDevice `xml:"device,omitempty"` + Plugin []HostPlugStoreTopologyPlugin `xml:"plugin,omitempty"` +} + +func init() { + t["HostPlugStoreTopology"] = reflect.TypeOf((*HostPlugStoreTopology)(nil)).Elem() +} + +type HostPlugStoreTopologyAdapter struct { + DynamicData + + Key string `xml:"key"` + Adapter string `xml:"adapter"` + Path []string `xml:"path,omitempty"` +} + +func init() { + t["HostPlugStoreTopologyAdapter"] = reflect.TypeOf((*HostPlugStoreTopologyAdapter)(nil)).Elem() +} + +type HostPlugStoreTopologyDevice struct { + DynamicData + + Key string `xml:"key"` + Lun string `xml:"lun"` + Path []string `xml:"path,omitempty"` +} + +func init() { + t["HostPlugStoreTopologyDevice"] = reflect.TypeOf((*HostPlugStoreTopologyDevice)(nil)).Elem() +} + +type HostPlugStoreTopologyPath struct { + DynamicData + + Key string `xml:"key"` + Name string `xml:"name"` + ChannelNumber int32 `xml:"channelNumber,omitempty"` + TargetNumber int32 `xml:"targetNumber,omitempty"` + LunNumber int32 `xml:"lunNumber,omitempty"` + Adapter string `xml:"adapter,omitempty"` + Target string `xml:"target,omitempty"` + Device string `xml:"device,omitempty"` +} + +func init() { + t["HostPlugStoreTopologyPath"] = reflect.TypeOf((*HostPlugStoreTopologyPath)(nil)).Elem() +} + +type HostPlugStoreTopologyPlugin struct { + DynamicData + + Key string `xml:"key"` + Name string `xml:"name"` + Device []string `xml:"device,omitempty"` + ClaimedPath []string `xml:"claimedPath,omitempty"` +} + +func init() { + t["HostPlugStoreTopologyPlugin"] = reflect.TypeOf((*HostPlugStoreTopologyPlugin)(nil)).Elem() +} + +type HostPlugStoreTopologyTarget struct { + DynamicData + + Key string `xml:"key"` + Transport BaseHostTargetTransport `xml:"transport,omitempty,typeattr"` +} + +func init() { + t["HostPlugStoreTopologyTarget"] = reflect.TypeOf((*HostPlugStoreTopologyTarget)(nil)).Elem() +} + +type HostPnicNetworkResourceInfo struct { + DynamicData + + PnicDevice string `xml:"pnicDevice"` + AvailableBandwidthForVMTraffic int64 `xml:"availableBandwidthForVMTraffic,omitempty"` + UnusedBandwidthForVMTraffic int64 `xml:"unusedBandwidthForVMTraffic,omitempty"` + PlacedVirtualNics []HostPlacedVirtualNicIdentifier `xml:"placedVirtualNics,omitempty"` +} + +func init() { + t["HostPnicNetworkResourceInfo"] = reflect.TypeOf((*HostPnicNetworkResourceInfo)(nil)).Elem() +} + +type HostPortGroup struct { + DynamicData + + Key string `xml:"key,omitempty"` + Port []HostPortGroupPort `xml:"port,omitempty"` + Vswitch string `xml:"vswitch,omitempty"` + ComputedPolicy HostNetworkPolicy `xml:"computedPolicy"` + Spec HostPortGroupSpec `xml:"spec"` +} + +func init() { + t["HostPortGroup"] = reflect.TypeOf((*HostPortGroup)(nil)).Elem() +} + +type HostPortGroupConfig struct { + DynamicData + + ChangeOperation string `xml:"changeOperation,omitempty"` + Spec *HostPortGroupSpec `xml:"spec,omitempty"` +} + +func init() { + t["HostPortGroupConfig"] = reflect.TypeOf((*HostPortGroupConfig)(nil)).Elem() +} + +type HostPortGroupPort struct { + DynamicData + + Key string `xml:"key,omitempty"` + Mac []string `xml:"mac,omitempty"` + Type string `xml:"type"` +} + +func init() { + t["HostPortGroupPort"] = reflect.TypeOf((*HostPortGroupPort)(nil)).Elem() +} + +type HostPortGroupProfile struct { + PortGroupProfile + + IpConfig IpAddressProfile `xml:"ipConfig"` +} + +func init() { + t["HostPortGroupProfile"] = reflect.TypeOf((*HostPortGroupProfile)(nil)).Elem() +} + +type HostPortGroupSpec struct { + DynamicData + + Name string `xml:"name"` + VlanId int32 `xml:"vlanId"` + VswitchName string `xml:"vswitchName"` + Policy HostNetworkPolicy `xml:"policy"` +} + +func init() { + t["HostPortGroupSpec"] = reflect.TypeOf((*HostPortGroupSpec)(nil)).Elem() +} + +type HostPosixAccountSpec struct { + HostAccountSpec + + PosixId int32 `xml:"posixId,omitempty"` + ShellAccess *bool `xml:"shellAccess"` +} + +func init() { + t["HostPosixAccountSpec"] = reflect.TypeOf((*HostPosixAccountSpec)(nil)).Elem() +} + +type HostPowerOpFailed struct { + VimFault +} + +func init() { + t["HostPowerOpFailed"] = reflect.TypeOf((*HostPowerOpFailed)(nil)).Elem() +} + +type HostPowerOpFailedFault BaseHostPowerOpFailed + +func init() { + t["HostPowerOpFailedFault"] = reflect.TypeOf((*HostPowerOpFailedFault)(nil)).Elem() +} + +type HostPowerPolicy struct { + DynamicData + + Key int32 `xml:"key"` + Name string `xml:"name"` + ShortName string `xml:"shortName"` + Description string `xml:"description"` +} + +func init() { + t["HostPowerPolicy"] = reflect.TypeOf((*HostPowerPolicy)(nil)).Elem() +} + +type HostPrimaryAgentNotShortNameEvent struct { + HostDasEvent + + PrimaryAgent string `xml:"primaryAgent"` +} + +func init() { + t["HostPrimaryAgentNotShortNameEvent"] = reflect.TypeOf((*HostPrimaryAgentNotShortNameEvent)(nil)).Elem() +} + +type HostProfileAppliedEvent struct { + HostEvent + + Profile ProfileEventArgument `xml:"profile"` +} + +func init() { + t["HostProfileAppliedEvent"] = reflect.TypeOf((*HostProfileAppliedEvent)(nil)).Elem() +} + +type HostProfileCompleteConfigSpec struct { + HostProfileConfigSpec + + ApplyProfile *HostApplyProfile `xml:"applyProfile,omitempty"` + CustomComplyProfile *ComplianceProfile `xml:"customComplyProfile,omitempty"` + DisabledExpressionListChanged bool `xml:"disabledExpressionListChanged"` + DisabledExpressionList []string `xml:"disabledExpressionList,omitempty"` + ValidatorHost *ManagedObjectReference `xml:"validatorHost,omitempty"` + Validating *bool `xml:"validating"` +} + +func init() { + t["HostProfileCompleteConfigSpec"] = reflect.TypeOf((*HostProfileCompleteConfigSpec)(nil)).Elem() +} + +type HostProfileConfigInfo struct { + ProfileConfigInfo + + ApplyProfile *HostApplyProfile `xml:"applyProfile,omitempty"` + DefaultComplyProfile *ComplianceProfile `xml:"defaultComplyProfile,omitempty"` + DefaultComplyLocator []ComplianceLocator `xml:"defaultComplyLocator,omitempty"` + CustomComplyProfile *ComplianceProfile `xml:"customComplyProfile,omitempty"` + DisabledExpressionList []string `xml:"disabledExpressionList,omitempty"` +} + +func init() { + t["HostProfileConfigInfo"] = reflect.TypeOf((*HostProfileConfigInfo)(nil)).Elem() +} + +type HostProfileConfigSpec struct { + ProfileCreateSpec +} + +func init() { + t["HostProfileConfigSpec"] = reflect.TypeOf((*HostProfileConfigSpec)(nil)).Elem() +} + +type HostProfileHostBasedConfigSpec struct { + HostProfileConfigSpec + + Host ManagedObjectReference `xml:"host"` + UseHostProfileEngine *bool `xml:"useHostProfileEngine"` +} + +func init() { + t["HostProfileHostBasedConfigSpec"] = reflect.TypeOf((*HostProfileHostBasedConfigSpec)(nil)).Elem() +} + +type HostProfileManagerConfigTaskList struct { + DynamicData + + ConfigSpec *HostConfigSpec `xml:"configSpec,omitempty"` + TaskDescription []LocalizableMessage `xml:"taskDescription,omitempty"` + TaskListRequirement []string `xml:"taskListRequirement,omitempty"` +} + +func init() { + t["HostProfileManagerConfigTaskList"] = reflect.TypeOf((*HostProfileManagerConfigTaskList)(nil)).Elem() +} + +type HostProfileSerializedHostProfileSpec struct { + ProfileSerializedCreateSpec + + ValidatorHost *ManagedObjectReference `xml:"validatorHost,omitempty"` + Validating *bool `xml:"validating"` +} + +func init() { + t["HostProfileSerializedHostProfileSpec"] = reflect.TypeOf((*HostProfileSerializedHostProfileSpec)(nil)).Elem() +} + +type HostProtocolEndpoint struct { + DynamicData + + PeType string `xml:"peType"` + Uuid string `xml:"uuid"` + HostKey []ManagedObjectReference `xml:"hostKey,omitempty"` + StorageArray string `xml:"storageArray,omitempty"` + NfsServer string `xml:"nfsServer,omitempty"` + NfsDir string `xml:"nfsDir,omitempty"` + DeviceId string `xml:"deviceId,omitempty"` +} + +func init() { + t["HostProtocolEndpoint"] = reflect.TypeOf((*HostProtocolEndpoint)(nil)).Elem() +} + +type HostProxySwitch struct { + DynamicData + + DvsUuid string `xml:"dvsUuid"` + DvsName string `xml:"dvsName"` + Key string `xml:"key"` + NumPorts int32 `xml:"numPorts"` + ConfigNumPorts int32 `xml:"configNumPorts,omitempty"` + NumPortsAvailable int32 `xml:"numPortsAvailable"` + UplinkPort []KeyValue `xml:"uplinkPort,omitempty"` + Mtu int32 `xml:"mtu,omitempty"` + Pnic []string `xml:"pnic,omitempty"` + Spec HostProxySwitchSpec `xml:"spec"` + HostLag []HostProxySwitchHostLagConfig `xml:"hostLag,omitempty"` + NetworkReservationSupported *bool `xml:"networkReservationSupported"` +} + +func init() { + t["HostProxySwitch"] = reflect.TypeOf((*HostProxySwitch)(nil)).Elem() +} + +type HostProxySwitchConfig struct { + DynamicData + + ChangeOperation string `xml:"changeOperation,omitempty"` + Uuid string `xml:"uuid"` + Spec *HostProxySwitchSpec `xml:"spec,omitempty"` +} + +func init() { + t["HostProxySwitchConfig"] = reflect.TypeOf((*HostProxySwitchConfig)(nil)).Elem() +} + +type HostProxySwitchHostLagConfig struct { + DynamicData + + LagKey string `xml:"lagKey"` + LagName string `xml:"lagName,omitempty"` + UplinkPort []KeyValue `xml:"uplinkPort,omitempty"` +} + +func init() { + t["HostProxySwitchHostLagConfig"] = reflect.TypeOf((*HostProxySwitchHostLagConfig)(nil)).Elem() +} + +type HostProxySwitchSpec struct { + DynamicData + + Backing BaseDistributedVirtualSwitchHostMemberBacking `xml:"backing,omitempty,typeattr"` +} + +func init() { + t["HostProxySwitchSpec"] = reflect.TypeOf((*HostProxySwitchSpec)(nil)).Elem() +} + +type HostReconnectionFailedEvent struct { + HostEvent +} + +func init() { + t["HostReconnectionFailedEvent"] = reflect.TypeOf((*HostReconnectionFailedEvent)(nil)).Elem() +} + +type HostReliableMemoryInfo struct { + DynamicData + + MemorySize int64 `xml:"memorySize"` +} + +func init() { + t["HostReliableMemoryInfo"] = reflect.TypeOf((*HostReliableMemoryInfo)(nil)).Elem() +} + +type HostRemoveVFlashResource HostRemoveVFlashResourceRequestType + +func init() { + t["HostRemoveVFlashResource"] = reflect.TypeOf((*HostRemoveVFlashResource)(nil)).Elem() +} + +type HostRemoveVFlashResourceRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["HostRemoveVFlashResourceRequestType"] = reflect.TypeOf((*HostRemoveVFlashResourceRequestType)(nil)).Elem() +} + +type HostRemoveVFlashResourceResponse struct { +} + +type HostRemovedEvent struct { + HostEvent +} + +func init() { + t["HostRemovedEvent"] = reflect.TypeOf((*HostRemovedEvent)(nil)).Elem() +} + +type HostResignatureRescanResult struct { + DynamicData + + Rescan []HostVmfsRescanResult `xml:"rescan,omitempty"` + Result ManagedObjectReference `xml:"result"` +} + +func init() { + t["HostResignatureRescanResult"] = reflect.TypeOf((*HostResignatureRescanResult)(nil)).Elem() +} + +type HostRuntimeInfo struct { + DynamicData + + ConnectionState HostSystemConnectionState `xml:"connectionState"` + PowerState HostSystemPowerState `xml:"powerState"` + StandbyMode string `xml:"standbyMode,omitempty"` + InMaintenanceMode bool `xml:"inMaintenanceMode"` + BootTime *time.Time `xml:"bootTime"` + HealthSystemRuntime *HealthSystemRuntime `xml:"healthSystemRuntime,omitempty"` + DasHostState *ClusterDasFdmHostState `xml:"dasHostState,omitempty"` + TpmPcrValues []HostTpmDigestInfo `xml:"tpmPcrValues,omitempty"` + VsanRuntimeInfo *VsanHostRuntimeInfo `xml:"vsanRuntimeInfo,omitempty"` + NetworkRuntimeInfo *HostRuntimeInfoNetworkRuntimeInfo `xml:"networkRuntimeInfo,omitempty"` + VFlashResourceRuntimeInfo *HostVFlashManagerVFlashResourceRunTimeInfo `xml:"vFlashResourceRuntimeInfo,omitempty"` + HostMaxVirtualDiskCapacity int64 `xml:"hostMaxVirtualDiskCapacity,omitempty"` +} + +func init() { + t["HostRuntimeInfo"] = reflect.TypeOf((*HostRuntimeInfo)(nil)).Elem() +} + +type HostRuntimeInfoNetStackInstanceRuntimeInfo struct { + DynamicData + + NetStackInstanceKey string `xml:"netStackInstanceKey"` + State string `xml:"state,omitempty"` + VmknicKeys []string `xml:"vmknicKeys,omitempty"` + MaxNumberOfConnections int32 `xml:"maxNumberOfConnections,omitempty"` + CurrentIpV6Enabled *bool `xml:"currentIpV6Enabled"` +} + +func init() { + t["HostRuntimeInfoNetStackInstanceRuntimeInfo"] = reflect.TypeOf((*HostRuntimeInfoNetStackInstanceRuntimeInfo)(nil)).Elem() +} + +type HostRuntimeInfoNetworkRuntimeInfo struct { + DynamicData + + NetStackInstanceRuntimeInfo []HostRuntimeInfoNetStackInstanceRuntimeInfo `xml:"netStackInstanceRuntimeInfo,omitempty"` + NetworkResourceRuntime *HostNetworkResourceRuntime `xml:"networkResourceRuntime,omitempty"` +} + +func init() { + t["HostRuntimeInfoNetworkRuntimeInfo"] = reflect.TypeOf((*HostRuntimeInfoNetworkRuntimeInfo)(nil)).Elem() +} + +type HostScsiDisk struct { + ScsiLun + + Capacity HostDiskDimensionsLba `xml:"capacity"` + DevicePath string `xml:"devicePath"` + Ssd *bool `xml:"ssd"` + LocalDisk *bool `xml:"localDisk"` + PhysicalLocation []string `xml:"physicalLocation,omitempty"` + EmulatedDIXDIFEnabled *bool `xml:"emulatedDIXDIFEnabled"` + VsanDiskInfo *VsanHostVsanDiskInfo `xml:"vsanDiskInfo,omitempty"` +} + +func init() { + t["HostScsiDisk"] = reflect.TypeOf((*HostScsiDisk)(nil)).Elem() +} + +type HostScsiDiskPartition struct { + DynamicData + + DiskName string `xml:"diskName"` + Partition int32 `xml:"partition"` +} + +func init() { + t["HostScsiDiskPartition"] = reflect.TypeOf((*HostScsiDiskPartition)(nil)).Elem() +} + +type HostScsiTopology struct { + DynamicData + + Adapter []HostScsiTopologyInterface `xml:"adapter,omitempty"` +} + +func init() { + t["HostScsiTopology"] = reflect.TypeOf((*HostScsiTopology)(nil)).Elem() +} + +type HostScsiTopologyInterface struct { + DynamicData + + Key string `xml:"key"` + Adapter string `xml:"adapter"` + Target []HostScsiTopologyTarget `xml:"target,omitempty"` +} + +func init() { + t["HostScsiTopologyInterface"] = reflect.TypeOf((*HostScsiTopologyInterface)(nil)).Elem() +} + +type HostScsiTopologyLun struct { + DynamicData + + Key string `xml:"key"` + Lun int32 `xml:"lun"` + ScsiLun string `xml:"scsiLun"` +} + +func init() { + t["HostScsiTopologyLun"] = reflect.TypeOf((*HostScsiTopologyLun)(nil)).Elem() +} + +type HostScsiTopologyTarget struct { + DynamicData + + Key string `xml:"key"` + Target int32 `xml:"target"` + Lun []HostScsiTopologyLun `xml:"lun,omitempty"` + Transport BaseHostTargetTransport `xml:"transport,omitempty,typeattr"` +} + +func init() { + t["HostScsiTopologyTarget"] = reflect.TypeOf((*HostScsiTopologyTarget)(nil)).Elem() +} + +type HostSecuritySpec struct { + DynamicData + + AdminPassword string `xml:"adminPassword,omitempty"` + RemovePermission []Permission `xml:"removePermission,omitempty"` + AddPermission []Permission `xml:"addPermission,omitempty"` +} + +func init() { + t["HostSecuritySpec"] = reflect.TypeOf((*HostSecuritySpec)(nil)).Elem() +} + +type HostService struct { + DynamicData + + Key string `xml:"key"` + Label string `xml:"label"` + Required bool `xml:"required"` + Uninstallable bool `xml:"uninstallable"` + Running bool `xml:"running"` + Ruleset []string `xml:"ruleset,omitempty"` + Policy string `xml:"policy"` + SourcePackage *HostServiceSourcePackage `xml:"sourcePackage,omitempty"` +} + +func init() { + t["HostService"] = reflect.TypeOf((*HostService)(nil)).Elem() +} + +type HostServiceConfig struct { + DynamicData + + ServiceId string `xml:"serviceId"` + StartupPolicy string `xml:"startupPolicy"` +} + +func init() { + t["HostServiceConfig"] = reflect.TypeOf((*HostServiceConfig)(nil)).Elem() +} + +type HostServiceInfo struct { + DynamicData + + Service []HostService `xml:"service,omitempty"` +} + +func init() { + t["HostServiceInfo"] = reflect.TypeOf((*HostServiceInfo)(nil)).Elem() +} + +type HostServiceSourcePackage struct { + DynamicData + + SourcePackageName string `xml:"sourcePackageName"` + Description string `xml:"description"` +} + +func init() { + t["HostServiceSourcePackage"] = reflect.TypeOf((*HostServiceSourcePackage)(nil)).Elem() +} + +type HostServiceTicket struct { + DynamicData + + Host string `xml:"host,omitempty"` + Port int32 `xml:"port,omitempty"` + SslThumbprint string `xml:"sslThumbprint,omitempty"` + Service string `xml:"service"` + ServiceVersion string `xml:"serviceVersion"` + SessionId string `xml:"sessionId"` +} + +func init() { + t["HostServiceTicket"] = reflect.TypeOf((*HostServiceTicket)(nil)).Elem() +} + +type HostShortNameInconsistentEvent struct { + HostDasEvent + + ShortName string `xml:"shortName"` + ShortName2 string `xml:"shortName2"` +} + +func init() { + t["HostShortNameInconsistentEvent"] = reflect.TypeOf((*HostShortNameInconsistentEvent)(nil)).Elem() +} + +type HostShortNameToIpFailedEvent struct { + HostEvent + + ShortName string `xml:"shortName"` +} + +func init() { + t["HostShortNameToIpFailedEvent"] = reflect.TypeOf((*HostShortNameToIpFailedEvent)(nil)).Elem() +} + +type HostShutdownEvent struct { + HostEvent + + Reason string `xml:"reason"` +} + +func init() { + t["HostShutdownEvent"] = reflect.TypeOf((*HostShutdownEvent)(nil)).Elem() +} + +type HostSnmpConfigSpec struct { + DynamicData + + Enabled *bool `xml:"enabled"` + Port int32 `xml:"port,omitempty"` + ReadOnlyCommunities []string `xml:"readOnlyCommunities,omitempty"` + TrapTargets []HostSnmpDestination `xml:"trapTargets,omitempty"` + Option []KeyValue `xml:"option,omitempty"` +} + +func init() { + t["HostSnmpConfigSpec"] = reflect.TypeOf((*HostSnmpConfigSpec)(nil)).Elem() +} + +type HostSnmpDestination struct { + DynamicData + + HostName string `xml:"hostName"` + Port int32 `xml:"port"` + Community string `xml:"community"` +} + +func init() { + t["HostSnmpDestination"] = reflect.TypeOf((*HostSnmpDestination)(nil)).Elem() +} + +type HostSnmpSystemAgentLimits struct { + DynamicData + + MaxReadOnlyCommunities int32 `xml:"maxReadOnlyCommunities"` + MaxTrapDestinations int32 `xml:"maxTrapDestinations"` + MaxCommunityLength int32 `xml:"maxCommunityLength"` + MaxBufferSize int32 `xml:"maxBufferSize"` + Capability HostSnmpAgentCapability `xml:"capability,omitempty"` +} + +func init() { + t["HostSnmpSystemAgentLimits"] = reflect.TypeOf((*HostSnmpSystemAgentLimits)(nil)).Elem() +} + +type HostSriovConfig struct { + HostPciPassthruConfig + + SriovEnabled bool `xml:"sriovEnabled"` + NumVirtualFunction int32 `xml:"numVirtualFunction"` +} + +func init() { + t["HostSriovConfig"] = reflect.TypeOf((*HostSriovConfig)(nil)).Elem() +} + +type HostSriovInfo struct { + HostPciPassthruInfo + + SriovEnabled bool `xml:"sriovEnabled"` + SriovCapable bool `xml:"sriovCapable"` + SriovActive bool `xml:"sriovActive"` + NumVirtualFunctionRequested int32 `xml:"numVirtualFunctionRequested"` + NumVirtualFunction int32 `xml:"numVirtualFunction"` + MaxVirtualFunctionSupported int32 `xml:"maxVirtualFunctionSupported"` +} + +func init() { + t["HostSriovInfo"] = reflect.TypeOf((*HostSriovInfo)(nil)).Elem() +} + +type HostSslThumbprintInfo struct { + DynamicData + + Principal string `xml:"principal"` + OwnerTag string `xml:"ownerTag,omitempty"` + SslThumbprints []string `xml:"sslThumbprints,omitempty"` +} + +func init() { + t["HostSslThumbprintInfo"] = reflect.TypeOf((*HostSslThumbprintInfo)(nil)).Elem() +} + +type HostStatusChangedEvent struct { + ClusterStatusChangedEvent +} + +func init() { + t["HostStatusChangedEvent"] = reflect.TypeOf((*HostStatusChangedEvent)(nil)).Elem() +} + +type HostStorageArrayTypePolicyOption struct { + DynamicData + + Policy BaseElementDescription `xml:"policy,typeattr"` +} + +func init() { + t["HostStorageArrayTypePolicyOption"] = reflect.TypeOf((*HostStorageArrayTypePolicyOption)(nil)).Elem() +} + +type HostStorageDeviceInfo struct { + DynamicData + + HostBusAdapter []BaseHostHostBusAdapter `xml:"hostBusAdapter,omitempty,typeattr"` + ScsiLun []BaseScsiLun `xml:"scsiLun,omitempty,typeattr"` + ScsiTopology *HostScsiTopology `xml:"scsiTopology,omitempty"` + MultipathInfo *HostMultipathInfo `xml:"multipathInfo,omitempty"` + PlugStoreTopology *HostPlugStoreTopology `xml:"plugStoreTopology,omitempty"` + SoftwareInternetScsiEnabled bool `xml:"softwareInternetScsiEnabled"` +} + +func init() { + t["HostStorageDeviceInfo"] = reflect.TypeOf((*HostStorageDeviceInfo)(nil)).Elem() +} + +type HostStorageElementInfo struct { + HostHardwareElementInfo + + OperationalInfo []HostStorageOperationalInfo `xml:"operationalInfo,omitempty"` +} + +func init() { + t["HostStorageElementInfo"] = reflect.TypeOf((*HostStorageElementInfo)(nil)).Elem() +} + +type HostStorageOperationalInfo struct { + DynamicData + + Property string `xml:"property"` + Value string `xml:"value"` +} + +func init() { + t["HostStorageOperationalInfo"] = reflect.TypeOf((*HostStorageOperationalInfo)(nil)).Elem() +} + +type HostStorageSystemDiskLocatorLedResult struct { + DynamicData + + Key string `xml:"key"` + Fault LocalizedMethodFault `xml:"fault"` +} + +func init() { + t["HostStorageSystemDiskLocatorLedResult"] = reflect.TypeOf((*HostStorageSystemDiskLocatorLedResult)(nil)).Elem() +} + +type HostStorageSystemScsiLunResult struct { + DynamicData + + Key string `xml:"key"` + Fault *LocalizedMethodFault `xml:"fault,omitempty"` +} + +func init() { + t["HostStorageSystemScsiLunResult"] = reflect.TypeOf((*HostStorageSystemScsiLunResult)(nil)).Elem() +} + +type HostStorageSystemVmfsVolumeResult struct { + DynamicData + + Key string `xml:"key"` + Fault *LocalizedMethodFault `xml:"fault,omitempty"` +} + +func init() { + t["HostStorageSystemVmfsVolumeResult"] = reflect.TypeOf((*HostStorageSystemVmfsVolumeResult)(nil)).Elem() +} + +type HostSyncFailedEvent struct { + HostEvent + + Reason LocalizedMethodFault `xml:"reason"` +} + +func init() { + t["HostSyncFailedEvent"] = reflect.TypeOf((*HostSyncFailedEvent)(nil)).Elem() +} + +type HostSystemHealthInfo struct { + DynamicData + + NumericSensorInfo []HostNumericSensorInfo `xml:"numericSensorInfo,omitempty"` +} + +func init() { + t["HostSystemHealthInfo"] = reflect.TypeOf((*HostSystemHealthInfo)(nil)).Elem() +} + +type HostSystemIdentificationInfo struct { + DynamicData + + IdentifierValue string `xml:"identifierValue"` + IdentifierType BaseElementDescription `xml:"identifierType,typeattr"` +} + +func init() { + t["HostSystemIdentificationInfo"] = reflect.TypeOf((*HostSystemIdentificationInfo)(nil)).Elem() +} + +type HostSystemInfo struct { + DynamicData + + Vendor string `xml:"vendor"` + Model string `xml:"model"` + Uuid string `xml:"uuid"` + OtherIdentifyingInfo []HostSystemIdentificationInfo `xml:"otherIdentifyingInfo,omitempty"` +} + +func init() { + t["HostSystemInfo"] = reflect.TypeOf((*HostSystemInfo)(nil)).Elem() +} + +type HostSystemReconnectSpec struct { + DynamicData + + SyncState *bool `xml:"syncState"` +} + +func init() { + t["HostSystemReconnectSpec"] = reflect.TypeOf((*HostSystemReconnectSpec)(nil)).Elem() +} + +type HostSystemResourceInfo struct { + DynamicData + + Key string `xml:"key"` + Config *ResourceConfigSpec `xml:"config,omitempty"` + Child []HostSystemResourceInfo `xml:"child,omitempty"` +} + +func init() { + t["HostSystemResourceInfo"] = reflect.TypeOf((*HostSystemResourceInfo)(nil)).Elem() +} + +type HostSystemSwapConfiguration struct { + DynamicData + + Option []BaseHostSystemSwapConfigurationSystemSwapOption `xml:"option,omitempty,typeattr"` +} + +func init() { + t["HostSystemSwapConfiguration"] = reflect.TypeOf((*HostSystemSwapConfiguration)(nil)).Elem() +} + +type HostSystemSwapConfigurationDatastoreOption struct { + HostSystemSwapConfigurationSystemSwapOption + + Datastore string `xml:"datastore"` +} + +func init() { + t["HostSystemSwapConfigurationDatastoreOption"] = reflect.TypeOf((*HostSystemSwapConfigurationDatastoreOption)(nil)).Elem() +} + +type HostSystemSwapConfigurationDisabledOption struct { + HostSystemSwapConfigurationSystemSwapOption +} + +func init() { + t["HostSystemSwapConfigurationDisabledOption"] = reflect.TypeOf((*HostSystemSwapConfigurationDisabledOption)(nil)).Elem() +} + +type HostSystemSwapConfigurationHostCacheOption struct { + HostSystemSwapConfigurationSystemSwapOption +} + +func init() { + t["HostSystemSwapConfigurationHostCacheOption"] = reflect.TypeOf((*HostSystemSwapConfigurationHostCacheOption)(nil)).Elem() +} + +type HostSystemSwapConfigurationHostLocalSwapOption struct { + HostSystemSwapConfigurationSystemSwapOption +} + +func init() { + t["HostSystemSwapConfigurationHostLocalSwapOption"] = reflect.TypeOf((*HostSystemSwapConfigurationHostLocalSwapOption)(nil)).Elem() +} + +type HostSystemSwapConfigurationSystemSwapOption struct { + DynamicData + + Key int32 `xml:"key"` +} + +func init() { + t["HostSystemSwapConfigurationSystemSwapOption"] = reflect.TypeOf((*HostSystemSwapConfigurationSystemSwapOption)(nil)).Elem() +} + +type HostTargetTransport struct { + DynamicData +} + +func init() { + t["HostTargetTransport"] = reflect.TypeOf((*HostTargetTransport)(nil)).Elem() +} + +type HostTpmAttestationReport struct { + DynamicData + + TpmPcrValues []HostTpmDigestInfo `xml:"tpmPcrValues"` + TpmEvents []HostTpmEventLogEntry `xml:"tpmEvents"` + TpmLogReliable bool `xml:"tpmLogReliable"` +} + +func init() { + t["HostTpmAttestationReport"] = reflect.TypeOf((*HostTpmAttestationReport)(nil)).Elem() +} + +type HostTpmBootSecurityOptionEventDetails struct { + HostTpmEventDetails + + BootSecurityOption string `xml:"bootSecurityOption"` +} + +func init() { + t["HostTpmBootSecurityOptionEventDetails"] = reflect.TypeOf((*HostTpmBootSecurityOptionEventDetails)(nil)).Elem() +} + +type HostTpmCommandEventDetails struct { + HostTpmEventDetails + + CommandLine string `xml:"commandLine"` +} + +func init() { + t["HostTpmCommandEventDetails"] = reflect.TypeOf((*HostTpmCommandEventDetails)(nil)).Elem() +} + +type HostTpmDigestInfo struct { + HostDigestInfo + + PcrNumber int32 `xml:"pcrNumber"` +} + +func init() { + t["HostTpmDigestInfo"] = reflect.TypeOf((*HostTpmDigestInfo)(nil)).Elem() +} + +type HostTpmEventDetails struct { + DynamicData + + DataHash []byte `xml:"dataHash"` +} + +func init() { + t["HostTpmEventDetails"] = reflect.TypeOf((*HostTpmEventDetails)(nil)).Elem() +} + +type HostTpmEventLogEntry struct { + DynamicData + + PcrIndex int32 `xml:"pcrIndex"` + EventDetails BaseHostTpmEventDetails `xml:"eventDetails,typeattr"` +} + +func init() { + t["HostTpmEventLogEntry"] = reflect.TypeOf((*HostTpmEventLogEntry)(nil)).Elem() +} + +type HostTpmOptionEventDetails struct { + HostTpmEventDetails + + OptionsFileName string `xml:"optionsFileName"` + BootOptions []byte `xml:"bootOptions,omitempty"` +} + +func init() { + t["HostTpmOptionEventDetails"] = reflect.TypeOf((*HostTpmOptionEventDetails)(nil)).Elem() +} + +type HostTpmSoftwareComponentEventDetails struct { + HostTpmEventDetails + + ComponentName string `xml:"componentName"` + VibName string `xml:"vibName"` + VibVersion string `xml:"vibVersion"` + VibVendor string `xml:"vibVendor"` +} + +func init() { + t["HostTpmSoftwareComponentEventDetails"] = reflect.TypeOf((*HostTpmSoftwareComponentEventDetails)(nil)).Elem() +} + +type HostUnresolvedVmfsExtent struct { + DynamicData + + Device HostScsiDiskPartition `xml:"device"` + DevicePath string `xml:"devicePath"` + VmfsUuid string `xml:"vmfsUuid"` + IsHeadExtent bool `xml:"isHeadExtent"` + Ordinal int32 `xml:"ordinal"` + StartBlock int32 `xml:"startBlock"` + EndBlock int32 `xml:"endBlock"` + Reason string `xml:"reason"` +} + +func init() { + t["HostUnresolvedVmfsExtent"] = reflect.TypeOf((*HostUnresolvedVmfsExtent)(nil)).Elem() +} + +type HostUnresolvedVmfsResignatureSpec struct { + DynamicData + + ExtentDevicePath []string `xml:"extentDevicePath"` +} + +func init() { + t["HostUnresolvedVmfsResignatureSpec"] = reflect.TypeOf((*HostUnresolvedVmfsResignatureSpec)(nil)).Elem() +} + +type HostUnresolvedVmfsResolutionResult struct { + DynamicData + + Spec HostUnresolvedVmfsResolutionSpec `xml:"spec"` + Vmfs *HostVmfsVolume `xml:"vmfs,omitempty"` + Fault *LocalizedMethodFault `xml:"fault,omitempty"` +} + +func init() { + t["HostUnresolvedVmfsResolutionResult"] = reflect.TypeOf((*HostUnresolvedVmfsResolutionResult)(nil)).Elem() +} + +type HostUnresolvedVmfsResolutionSpec struct { + DynamicData + + ExtentDevicePath []string `xml:"extentDevicePath"` + UuidResolution string `xml:"uuidResolution"` +} + +func init() { + t["HostUnresolvedVmfsResolutionSpec"] = reflect.TypeOf((*HostUnresolvedVmfsResolutionSpec)(nil)).Elem() +} + +type HostUnresolvedVmfsVolume struct { + DynamicData + + Extent []HostUnresolvedVmfsExtent `xml:"extent"` + VmfsLabel string `xml:"vmfsLabel"` + VmfsUuid string `xml:"vmfsUuid"` + TotalBlocks int32 `xml:"totalBlocks"` + ResolveStatus HostUnresolvedVmfsVolumeResolveStatus `xml:"resolveStatus"` +} + +func init() { + t["HostUnresolvedVmfsVolume"] = reflect.TypeOf((*HostUnresolvedVmfsVolume)(nil)).Elem() +} + +type HostUnresolvedVmfsVolumeResolveStatus struct { + DynamicData + + Resolvable bool `xml:"resolvable"` + IncompleteExtents *bool `xml:"incompleteExtents"` + MultipleCopies *bool `xml:"multipleCopies"` +} + +func init() { + t["HostUnresolvedVmfsVolumeResolveStatus"] = reflect.TypeOf((*HostUnresolvedVmfsVolumeResolveStatus)(nil)).Elem() +} + +type HostUpgradeFailedEvent struct { + HostEvent +} + +func init() { + t["HostUpgradeFailedEvent"] = reflect.TypeOf((*HostUpgradeFailedEvent)(nil)).Elem() +} + +type HostUserWorldSwapNotEnabledEvent struct { + HostEvent +} + +func init() { + t["HostUserWorldSwapNotEnabledEvent"] = reflect.TypeOf((*HostUserWorldSwapNotEnabledEvent)(nil)).Elem() +} + +type HostVFlashManagerVFlashCacheConfigInfo struct { + DynamicData + + VFlashModuleConfigOption []HostVFlashManagerVFlashCacheConfigInfoVFlashModuleConfigOption `xml:"vFlashModuleConfigOption,omitempty"` + DefaultVFlashModule string `xml:"defaultVFlashModule,omitempty"` + SwapCacheReservationInGB int64 `xml:"swapCacheReservationInGB,omitempty"` +} + +func init() { + t["HostVFlashManagerVFlashCacheConfigInfo"] = reflect.TypeOf((*HostVFlashManagerVFlashCacheConfigInfo)(nil)).Elem() +} + +type HostVFlashManagerVFlashCacheConfigInfoVFlashModuleConfigOption struct { + DynamicData + + VFlashModule string `xml:"vFlashModule"` + VFlashModuleVersion string `xml:"vFlashModuleVersion"` + MinSupportedModuleVersion string `xml:"minSupportedModuleVersion"` + CacheConsistencyType ChoiceOption `xml:"cacheConsistencyType"` + CacheMode ChoiceOption `xml:"cacheMode"` + BlockSizeInKBOption LongOption `xml:"blockSizeInKBOption"` + ReservationInMBOption LongOption `xml:"reservationInMBOption"` + MaxDiskSizeInKB int64 `xml:"maxDiskSizeInKB"` +} + +func init() { + t["HostVFlashManagerVFlashCacheConfigInfoVFlashModuleConfigOption"] = reflect.TypeOf((*HostVFlashManagerVFlashCacheConfigInfoVFlashModuleConfigOption)(nil)).Elem() +} + +type HostVFlashManagerVFlashCacheConfigSpec struct { + DynamicData + + DefaultVFlashModule string `xml:"defaultVFlashModule"` + SwapCacheReservationInGB int64 `xml:"swapCacheReservationInGB"` +} + +func init() { + t["HostVFlashManagerVFlashCacheConfigSpec"] = reflect.TypeOf((*HostVFlashManagerVFlashCacheConfigSpec)(nil)).Elem() +} + +type HostVFlashManagerVFlashConfigInfo struct { + DynamicData + + VFlashResourceConfigInfo *HostVFlashManagerVFlashResourceConfigInfo `xml:"vFlashResourceConfigInfo,omitempty"` + VFlashCacheConfigInfo *HostVFlashManagerVFlashCacheConfigInfo `xml:"vFlashCacheConfigInfo,omitempty"` +} + +func init() { + t["HostVFlashManagerVFlashConfigInfo"] = reflect.TypeOf((*HostVFlashManagerVFlashConfigInfo)(nil)).Elem() +} + +type HostVFlashManagerVFlashResourceConfigInfo struct { + DynamicData + + Vffs *HostVffsVolume `xml:"vffs,omitempty"` + Capacity int64 `xml:"capacity"` +} + +func init() { + t["HostVFlashManagerVFlashResourceConfigInfo"] = reflect.TypeOf((*HostVFlashManagerVFlashResourceConfigInfo)(nil)).Elem() +} + +type HostVFlashManagerVFlashResourceConfigSpec struct { + DynamicData + + VffsUuid string `xml:"vffsUuid"` +} + +func init() { + t["HostVFlashManagerVFlashResourceConfigSpec"] = reflect.TypeOf((*HostVFlashManagerVFlashResourceConfigSpec)(nil)).Elem() +} + +type HostVFlashManagerVFlashResourceRunTimeInfo struct { + DynamicData + + Usage int64 `xml:"usage"` + Capacity int64 `xml:"capacity"` + Accessible bool `xml:"accessible"` + CapacityForVmCache int64 `xml:"capacityForVmCache"` + FreeForVmCache int64 `xml:"freeForVmCache"` +} + +func init() { + t["HostVFlashManagerVFlashResourceRunTimeInfo"] = reflect.TypeOf((*HostVFlashManagerVFlashResourceRunTimeInfo)(nil)).Elem() +} + +type HostVFlashResourceConfigurationResult struct { + DynamicData + + DevicePath []string `xml:"devicePath,omitempty"` + Vffs *HostVffsVolume `xml:"vffs,omitempty"` + DiskConfigurationResult []HostDiskConfigurationResult `xml:"diskConfigurationResult,omitempty"` +} + +func init() { + t["HostVFlashResourceConfigurationResult"] = reflect.TypeOf((*HostVFlashResourceConfigurationResult)(nil)).Elem() +} + +type HostVMotionCompatibility struct { + DynamicData + + Host ManagedObjectReference `xml:"host"` + Compatibility []string `xml:"compatibility,omitempty"` +} + +func init() { + t["HostVMotionCompatibility"] = reflect.TypeOf((*HostVMotionCompatibility)(nil)).Elem() +} + +type HostVMotionConfig struct { + DynamicData + + VmotionNicKey string `xml:"vmotionNicKey,omitempty"` + Enabled bool `xml:"enabled"` +} + +func init() { + t["HostVMotionConfig"] = reflect.TypeOf((*HostVMotionConfig)(nil)).Elem() +} + +type HostVMotionInfo struct { + DynamicData + + NetConfig *HostVMotionNetConfig `xml:"netConfig,omitempty"` + IpConfig *HostIpConfig `xml:"ipConfig,omitempty"` +} + +func init() { + t["HostVMotionInfo"] = reflect.TypeOf((*HostVMotionInfo)(nil)).Elem() +} + +type HostVMotionNetConfig struct { + DynamicData + + CandidateVnic []HostVirtualNic `xml:"candidateVnic,omitempty"` + SelectedVnic string `xml:"selectedVnic,omitempty"` +} + +func init() { + t["HostVMotionNetConfig"] = reflect.TypeOf((*HostVMotionNetConfig)(nil)).Elem() +} + +type HostVfatVolume struct { + HostFileSystemVolume +} + +func init() { + t["HostVfatVolume"] = reflect.TypeOf((*HostVfatVolume)(nil)).Elem() +} + +type HostVffsSpec struct { + DynamicData + + DevicePath string `xml:"devicePath"` + Partition *HostDiskPartitionSpec `xml:"partition,omitempty"` + MajorVersion int32 `xml:"majorVersion"` + VolumeName string `xml:"volumeName"` +} + +func init() { + t["HostVffsSpec"] = reflect.TypeOf((*HostVffsSpec)(nil)).Elem() +} + +type HostVffsVolume struct { + HostFileSystemVolume + + MajorVersion int32 `xml:"majorVersion"` + Version string `xml:"version"` + Uuid string `xml:"uuid"` + Extent []HostScsiDiskPartition `xml:"extent"` +} + +func init() { + t["HostVffsVolume"] = reflect.TypeOf((*HostVffsVolume)(nil)).Elem() +} + +type HostVirtualNic struct { + DynamicData + + Device string `xml:"device"` + Key string `xml:"key"` + Portgroup string `xml:"portgroup"` + Spec HostVirtualNicSpec `xml:"spec"` + Port string `xml:"port,omitempty"` +} + +func init() { + t["HostVirtualNic"] = reflect.TypeOf((*HostVirtualNic)(nil)).Elem() +} + +type HostVirtualNicConfig struct { + DynamicData + + ChangeOperation string `xml:"changeOperation,omitempty"` + Device string `xml:"device,omitempty"` + Portgroup string `xml:"portgroup"` + Spec *HostVirtualNicSpec `xml:"spec,omitempty"` +} + +func init() { + t["HostVirtualNicConfig"] = reflect.TypeOf((*HostVirtualNicConfig)(nil)).Elem() +} + +type HostVirtualNicConnection struct { + DynamicData + + Portgroup string `xml:"portgroup,omitempty"` + DvPort *DistributedVirtualSwitchPortConnection `xml:"dvPort,omitempty"` +} + +func init() { + t["HostVirtualNicConnection"] = reflect.TypeOf((*HostVirtualNicConnection)(nil)).Elem() +} + +type HostVirtualNicManagerInfo struct { + DynamicData + + NetConfig []VirtualNicManagerNetConfig `xml:"netConfig,omitempty"` +} + +func init() { + t["HostVirtualNicManagerInfo"] = reflect.TypeOf((*HostVirtualNicManagerInfo)(nil)).Elem() +} + +type HostVirtualNicManagerNicTypeSelection struct { + DynamicData + + Vnic HostVirtualNicConnection `xml:"vnic"` + NicType []string `xml:"nicType,omitempty"` +} + +func init() { + t["HostVirtualNicManagerNicTypeSelection"] = reflect.TypeOf((*HostVirtualNicManagerNicTypeSelection)(nil)).Elem() +} + +type HostVirtualNicOpaqueNetworkSpec struct { + DynamicData + + OpaqueNetworkId string `xml:"opaqueNetworkId"` + OpaqueNetworkType string `xml:"opaqueNetworkType"` +} + +func init() { + t["HostVirtualNicOpaqueNetworkSpec"] = reflect.TypeOf((*HostVirtualNicOpaqueNetworkSpec)(nil)).Elem() +} + +type HostVirtualNicSpec struct { + DynamicData + + Ip *HostIpConfig `xml:"ip,omitempty"` + Mac string `xml:"mac,omitempty"` + DistributedVirtualPort *DistributedVirtualSwitchPortConnection `xml:"distributedVirtualPort,omitempty"` + Portgroup string `xml:"portgroup,omitempty"` + Mtu int32 `xml:"mtu,omitempty"` + TsoEnabled *bool `xml:"tsoEnabled"` + NetStackInstanceKey string `xml:"netStackInstanceKey,omitempty"` + OpaqueNetwork *HostVirtualNicOpaqueNetworkSpec `xml:"opaqueNetwork,omitempty"` + ExternalId string `xml:"externalId,omitempty"` + PinnedPnic string `xml:"pinnedPnic,omitempty"` +} + +func init() { + t["HostVirtualNicSpec"] = reflect.TypeOf((*HostVirtualNicSpec)(nil)).Elem() +} + +type HostVirtualSwitch struct { + DynamicData + + Name string `xml:"name"` + Key string `xml:"key"` + NumPorts int32 `xml:"numPorts"` + NumPortsAvailable int32 `xml:"numPortsAvailable"` + Mtu int32 `xml:"mtu,omitempty"` + Portgroup []string `xml:"portgroup,omitempty"` + Pnic []string `xml:"pnic,omitempty"` + Spec HostVirtualSwitchSpec `xml:"spec"` +} + +func init() { + t["HostVirtualSwitch"] = reflect.TypeOf((*HostVirtualSwitch)(nil)).Elem() +} + +type HostVirtualSwitchAutoBridge struct { + HostVirtualSwitchBridge + + ExcludedNicDevice []string `xml:"excludedNicDevice,omitempty"` +} + +func init() { + t["HostVirtualSwitchAutoBridge"] = reflect.TypeOf((*HostVirtualSwitchAutoBridge)(nil)).Elem() +} + +type HostVirtualSwitchBeaconConfig struct { + DynamicData + + Interval int32 `xml:"interval"` +} + +func init() { + t["HostVirtualSwitchBeaconConfig"] = reflect.TypeOf((*HostVirtualSwitchBeaconConfig)(nil)).Elem() +} + +type HostVirtualSwitchBondBridge struct { + HostVirtualSwitchBridge + + NicDevice []string `xml:"nicDevice"` + Beacon *HostVirtualSwitchBeaconConfig `xml:"beacon,omitempty"` + LinkDiscoveryProtocolConfig *LinkDiscoveryProtocolConfig `xml:"linkDiscoveryProtocolConfig,omitempty"` +} + +func init() { + t["HostVirtualSwitchBondBridge"] = reflect.TypeOf((*HostVirtualSwitchBondBridge)(nil)).Elem() +} + +type HostVirtualSwitchBridge struct { + DynamicData +} + +func init() { + t["HostVirtualSwitchBridge"] = reflect.TypeOf((*HostVirtualSwitchBridge)(nil)).Elem() +} + +type HostVirtualSwitchConfig struct { + DynamicData + + ChangeOperation string `xml:"changeOperation,omitempty"` + Name string `xml:"name"` + Spec *HostVirtualSwitchSpec `xml:"spec,omitempty"` +} + +func init() { + t["HostVirtualSwitchConfig"] = reflect.TypeOf((*HostVirtualSwitchConfig)(nil)).Elem() +} + +type HostVirtualSwitchSimpleBridge struct { + HostVirtualSwitchBridge + + NicDevice string `xml:"nicDevice"` +} + +func init() { + t["HostVirtualSwitchSimpleBridge"] = reflect.TypeOf((*HostVirtualSwitchSimpleBridge)(nil)).Elem() +} + +type HostVirtualSwitchSpec struct { + DynamicData + + NumPorts int32 `xml:"numPorts"` + Bridge BaseHostVirtualSwitchBridge `xml:"bridge,omitempty,typeattr"` + Policy *HostNetworkPolicy `xml:"policy,omitempty"` + Mtu int32 `xml:"mtu,omitempty"` +} + +func init() { + t["HostVirtualSwitchSpec"] = reflect.TypeOf((*HostVirtualSwitchSpec)(nil)).Elem() +} + +type HostVmciAccessManagerAccessSpec struct { + DynamicData + + Vm ManagedObjectReference `xml:"vm"` + Services []string `xml:"services,omitempty"` + Mode string `xml:"mode"` +} + +func init() { + t["HostVmciAccessManagerAccessSpec"] = reflect.TypeOf((*HostVmciAccessManagerAccessSpec)(nil)).Elem() +} + +type HostVmfsRescanResult struct { + DynamicData + + Host ManagedObjectReference `xml:"host"` + Fault *LocalizedMethodFault `xml:"fault,omitempty"` +} + +func init() { + t["HostVmfsRescanResult"] = reflect.TypeOf((*HostVmfsRescanResult)(nil)).Elem() +} + +type HostVmfsSpec struct { + DynamicData + + Extent HostScsiDiskPartition `xml:"extent"` + BlockSizeMb int32 `xml:"blockSizeMb,omitempty"` + MajorVersion int32 `xml:"majorVersion"` + VolumeName string `xml:"volumeName"` +} + +func init() { + t["HostVmfsSpec"] = reflect.TypeOf((*HostVmfsSpec)(nil)).Elem() +} + +type HostVmfsVolume struct { + HostFileSystemVolume + + BlockSizeMb int32 `xml:"blockSizeMb"` + MaxBlocks int32 `xml:"maxBlocks"` + MajorVersion int32 `xml:"majorVersion"` + Version string `xml:"version"` + Uuid string `xml:"uuid"` + Extent []HostScsiDiskPartition `xml:"extent"` + VmfsUpgradable bool `xml:"vmfsUpgradable"` + ForceMountedInfo *HostForceMountedInfo `xml:"forceMountedInfo,omitempty"` + Ssd *bool `xml:"ssd"` + Local *bool `xml:"local"` +} + +func init() { + t["HostVmfsVolume"] = reflect.TypeOf((*HostVmfsVolume)(nil)).Elem() +} + +type HostVnicConnectedToCustomizedDVPortEvent struct { + HostEvent + + Vnic VnicPortArgument `xml:"vnic"` +} + +func init() { + t["HostVnicConnectedToCustomizedDVPortEvent"] = reflect.TypeOf((*HostVnicConnectedToCustomizedDVPortEvent)(nil)).Elem() +} + +type HostVsanInternalSystemCmmdsQuery struct { + DynamicData + + Type string `xml:"type,omitempty"` + Uuid string `xml:"uuid,omitempty"` + Owner string `xml:"owner,omitempty"` +} + +func init() { + t["HostVsanInternalSystemCmmdsQuery"] = reflect.TypeOf((*HostVsanInternalSystemCmmdsQuery)(nil)).Elem() +} + +type HostVsanInternalSystemDeleteVsanObjectsResult struct { + DynamicData + + Uuid string `xml:"uuid"` + Success bool `xml:"success"` + FailureReason []LocalizableMessage `xml:"failureReason,omitempty"` +} + +func init() { + t["HostVsanInternalSystemDeleteVsanObjectsResult"] = reflect.TypeOf((*HostVsanInternalSystemDeleteVsanObjectsResult)(nil)).Elem() +} + +type HostVsanInternalSystemVsanObjectOperationResult struct { + DynamicData + + Uuid string `xml:"uuid"` + FailureReason []LocalizableMessage `xml:"failureReason,omitempty"` +} + +func init() { + t["HostVsanInternalSystemVsanObjectOperationResult"] = reflect.TypeOf((*HostVsanInternalSystemVsanObjectOperationResult)(nil)).Elem() +} + +type HostVsanInternalSystemVsanPhysicalDiskDiagnosticsResult struct { + DynamicData + + DiskUuid string `xml:"diskUuid"` + Success bool `xml:"success"` + FailureReason string `xml:"failureReason,omitempty"` +} + +func init() { + t["HostVsanInternalSystemVsanPhysicalDiskDiagnosticsResult"] = reflect.TypeOf((*HostVsanInternalSystemVsanPhysicalDiskDiagnosticsResult)(nil)).Elem() +} + +type HostVvolVolume struct { + HostFileSystemVolume + + ScId string `xml:"scId"` + HostPE []VVolHostPE `xml:"hostPE,omitempty"` + VasaProviderInfo []VimVasaProviderInfo `xml:"vasaProviderInfo,omitempty"` + StorageArray []VASAStorageArray `xml:"storageArray,omitempty"` +} + +func init() { + t["HostVvolVolume"] = reflect.TypeOf((*HostVvolVolume)(nil)).Elem() +} + +type HostVvolVolumeSpecification struct { + DynamicData + + MaxSizeInMB int64 `xml:"maxSizeInMB"` + VolumeName string `xml:"volumeName"` + VasaProviderInfo []VimVasaProviderInfo `xml:"vasaProviderInfo,omitempty"` + StorageArray []VASAStorageArray `xml:"storageArray,omitempty"` + Uuid string `xml:"uuid"` +} + +func init() { + t["HostVvolVolumeSpecification"] = reflect.TypeOf((*HostVvolVolumeSpecification)(nil)).Elem() +} + +type HostWwnChangedEvent struct { + HostEvent + + OldNodeWwns []int64 `xml:"oldNodeWwns,omitempty"` + OldPortWwns []int64 `xml:"oldPortWwns,omitempty"` + NewNodeWwns []int64 `xml:"newNodeWwns,omitempty"` + NewPortWwns []int64 `xml:"newPortWwns,omitempty"` +} + +func init() { + t["HostWwnChangedEvent"] = reflect.TypeOf((*HostWwnChangedEvent)(nil)).Elem() +} + +type HostWwnConflictEvent struct { + HostEvent + + ConflictedVms []VmEventArgument `xml:"conflictedVms,omitempty"` + ConflictedHosts []HostEventArgument `xml:"conflictedHosts,omitempty"` + Wwn int64 `xml:"wwn"` +} + +func init() { + t["HostWwnConflictEvent"] = reflect.TypeOf((*HostWwnConflictEvent)(nil)).Elem() +} + +type HotSnapshotMoveNotSupported struct { + SnapshotCopyNotSupported +} + +func init() { + t["HotSnapshotMoveNotSupported"] = reflect.TypeOf((*HotSnapshotMoveNotSupported)(nil)).Elem() +} + +type HotSnapshotMoveNotSupportedFault HotSnapshotMoveNotSupported + +func init() { + t["HotSnapshotMoveNotSupportedFault"] = reflect.TypeOf((*HotSnapshotMoveNotSupportedFault)(nil)).Elem() +} + +type HourlyTaskScheduler struct { + RecurrentTaskScheduler + + Minute int32 `xml:"minute"` +} + +func init() { + t["HourlyTaskScheduler"] = reflect.TypeOf((*HourlyTaskScheduler)(nil)).Elem() +} + +type HttpNfcLeaseAbort HttpNfcLeaseAbortRequestType + +func init() { + t["HttpNfcLeaseAbort"] = reflect.TypeOf((*HttpNfcLeaseAbort)(nil)).Elem() +} + +type HttpNfcLeaseAbortRequestType struct { + This ManagedObjectReference `xml:"_this"` + Fault *LocalizedMethodFault `xml:"fault,omitempty"` +} + +func init() { + t["HttpNfcLeaseAbortRequestType"] = reflect.TypeOf((*HttpNfcLeaseAbortRequestType)(nil)).Elem() +} + +type HttpNfcLeaseAbortResponse struct { +} + +type HttpNfcLeaseComplete HttpNfcLeaseCompleteRequestType + +func init() { + t["HttpNfcLeaseComplete"] = reflect.TypeOf((*HttpNfcLeaseComplete)(nil)).Elem() +} + +type HttpNfcLeaseCompleteRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["HttpNfcLeaseCompleteRequestType"] = reflect.TypeOf((*HttpNfcLeaseCompleteRequestType)(nil)).Elem() +} + +type HttpNfcLeaseCompleteResponse struct { +} + +type HttpNfcLeaseDatastoreLeaseInfo struct { + DynamicData + + DatastoreKey string `xml:"datastoreKey"` + Hosts []HttpNfcLeaseHostInfo `xml:"hosts"` +} + +func init() { + t["HttpNfcLeaseDatastoreLeaseInfo"] = reflect.TypeOf((*HttpNfcLeaseDatastoreLeaseInfo)(nil)).Elem() +} + +type HttpNfcLeaseDeviceUrl struct { + DynamicData + + Key string `xml:"key"` + ImportKey string `xml:"importKey"` + Url string `xml:"url"` + SslThumbprint string `xml:"sslThumbprint"` + Disk *bool `xml:"disk"` + TargetId string `xml:"targetId,omitempty"` + DatastoreKey string `xml:"datastoreKey,omitempty"` + FileSize int64 `xml:"fileSize,omitempty"` +} + +func init() { + t["HttpNfcLeaseDeviceUrl"] = reflect.TypeOf((*HttpNfcLeaseDeviceUrl)(nil)).Elem() +} + +type HttpNfcLeaseGetManifest HttpNfcLeaseGetManifestRequestType + +func init() { + t["HttpNfcLeaseGetManifest"] = reflect.TypeOf((*HttpNfcLeaseGetManifest)(nil)).Elem() +} + +type HttpNfcLeaseGetManifestRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["HttpNfcLeaseGetManifestRequestType"] = reflect.TypeOf((*HttpNfcLeaseGetManifestRequestType)(nil)).Elem() +} + +type HttpNfcLeaseGetManifestResponse struct { + Returnval []HttpNfcLeaseManifestEntry `xml:"returnval,omitempty"` +} + +type HttpNfcLeaseHostInfo struct { + DynamicData + + Url string `xml:"url"` + SslThumbprint string `xml:"sslThumbprint"` +} + +func init() { + t["HttpNfcLeaseHostInfo"] = reflect.TypeOf((*HttpNfcLeaseHostInfo)(nil)).Elem() +} + +type HttpNfcLeaseInfo struct { + DynamicData + + Lease ManagedObjectReference `xml:"lease"` + Entity ManagedObjectReference `xml:"entity"` + DeviceUrl []HttpNfcLeaseDeviceUrl `xml:"deviceUrl,omitempty"` + TotalDiskCapacityInKB int64 `xml:"totalDiskCapacityInKB"` + LeaseTimeout int32 `xml:"leaseTimeout"` + HostMap []HttpNfcLeaseDatastoreLeaseInfo `xml:"hostMap,omitempty"` +} + +func init() { + t["HttpNfcLeaseInfo"] = reflect.TypeOf((*HttpNfcLeaseInfo)(nil)).Elem() +} + +type HttpNfcLeaseManifestEntry struct { + DynamicData + + Key string `xml:"key"` + Sha1 string `xml:"sha1"` + Size int64 `xml:"size"` + Disk bool `xml:"disk"` + Capacity int64 `xml:"capacity,omitempty"` + PopulatedSize int64 `xml:"populatedSize,omitempty"` +} + +func init() { + t["HttpNfcLeaseManifestEntry"] = reflect.TypeOf((*HttpNfcLeaseManifestEntry)(nil)).Elem() +} + +type HttpNfcLeaseProgress HttpNfcLeaseProgressRequestType + +func init() { + t["HttpNfcLeaseProgress"] = reflect.TypeOf((*HttpNfcLeaseProgress)(nil)).Elem() +} + +type HttpNfcLeaseProgressRequestType struct { + This ManagedObjectReference `xml:"_this"` + Percent int32 `xml:"percent"` +} + +func init() { + t["HttpNfcLeaseProgressRequestType"] = reflect.TypeOf((*HttpNfcLeaseProgressRequestType)(nil)).Elem() +} + +type HttpNfcLeaseProgressResponse struct { +} + +type IDEDiskNotSupported struct { + DiskNotSupported +} + +func init() { + t["IDEDiskNotSupported"] = reflect.TypeOf((*IDEDiskNotSupported)(nil)).Elem() +} + +type IDEDiskNotSupportedFault IDEDiskNotSupported + +func init() { + t["IDEDiskNotSupportedFault"] = reflect.TypeOf((*IDEDiskNotSupportedFault)(nil)).Elem() +} + +type IORMNotSupportedHostOnDatastore struct { + VimFault + + Datastore ManagedObjectReference `xml:"datastore"` + DatastoreName string `xml:"datastoreName"` + Host []ManagedObjectReference `xml:"host,omitempty"` +} + +func init() { + t["IORMNotSupportedHostOnDatastore"] = reflect.TypeOf((*IORMNotSupportedHostOnDatastore)(nil)).Elem() +} + +type IORMNotSupportedHostOnDatastoreFault IORMNotSupportedHostOnDatastore + +func init() { + t["IORMNotSupportedHostOnDatastoreFault"] = reflect.TypeOf((*IORMNotSupportedHostOnDatastoreFault)(nil)).Elem() +} + +type IScsiBootFailureEvent struct { + HostEvent +} + +func init() { + t["IScsiBootFailureEvent"] = reflect.TypeOf((*IScsiBootFailureEvent)(nil)).Elem() +} + +type ImpersonateUser ImpersonateUserRequestType + +func init() { + t["ImpersonateUser"] = reflect.TypeOf((*ImpersonateUser)(nil)).Elem() +} + +type ImpersonateUserRequestType struct { + This ManagedObjectReference `xml:"_this"` + UserName string `xml:"userName"` + Locale string `xml:"locale,omitempty"` +} + +func init() { + t["ImpersonateUserRequestType"] = reflect.TypeOf((*ImpersonateUserRequestType)(nil)).Elem() +} + +type ImpersonateUserResponse struct { + Returnval UserSession `xml:"returnval"` +} + +type ImportCertificateForCAMRequestType struct { + This ManagedObjectReference `xml:"_this"` + CertPath string `xml:"certPath"` + CamServer string `xml:"camServer"` +} + +func init() { + t["ImportCertificateForCAMRequestType"] = reflect.TypeOf((*ImportCertificateForCAMRequestType)(nil)).Elem() +} + +type ImportCertificateForCAM_Task ImportCertificateForCAMRequestType + +func init() { + t["ImportCertificateForCAM_Task"] = reflect.TypeOf((*ImportCertificateForCAM_Task)(nil)).Elem() +} + +type ImportCertificateForCAM_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type ImportHostAddFailure struct { + DvsFault + + HostIp []string `xml:"hostIp"` +} + +func init() { + t["ImportHostAddFailure"] = reflect.TypeOf((*ImportHostAddFailure)(nil)).Elem() +} + +type ImportHostAddFailureFault ImportHostAddFailure + +func init() { + t["ImportHostAddFailureFault"] = reflect.TypeOf((*ImportHostAddFailureFault)(nil)).Elem() +} + +type ImportOperationBulkFault struct { + DvsFault + + ImportFaults []ImportOperationBulkFaultFaultOnImport `xml:"importFaults"` +} + +func init() { + t["ImportOperationBulkFault"] = reflect.TypeOf((*ImportOperationBulkFault)(nil)).Elem() +} + +type ImportOperationBulkFaultFault ImportOperationBulkFault + +func init() { + t["ImportOperationBulkFaultFault"] = reflect.TypeOf((*ImportOperationBulkFaultFault)(nil)).Elem() +} + +type ImportOperationBulkFaultFaultOnImport struct { + DynamicData + + EntityType string `xml:"entityType,omitempty"` + Key string `xml:"key,omitempty"` + Fault LocalizedMethodFault `xml:"fault"` +} + +func init() { + t["ImportOperationBulkFaultFaultOnImport"] = reflect.TypeOf((*ImportOperationBulkFaultFaultOnImport)(nil)).Elem() +} + +type ImportSpec struct { + DynamicData + + EntityConfig *VAppEntityConfigInfo `xml:"entityConfig,omitempty"` + InstantiationOst *OvfConsumerOstNode `xml:"instantiationOst,omitempty"` +} + +func init() { + t["ImportSpec"] = reflect.TypeOf((*ImportSpec)(nil)).Elem() +} + +type ImportUnmanagedSnapshot ImportUnmanagedSnapshotRequestType + +func init() { + t["ImportUnmanagedSnapshot"] = reflect.TypeOf((*ImportUnmanagedSnapshot)(nil)).Elem() +} + +type ImportUnmanagedSnapshotRequestType struct { + This ManagedObjectReference `xml:"_this"` + Vdisk string `xml:"vdisk"` + Datacenter *ManagedObjectReference `xml:"datacenter,omitempty"` + VvolId string `xml:"vvolId"` +} + +func init() { + t["ImportUnmanagedSnapshotRequestType"] = reflect.TypeOf((*ImportUnmanagedSnapshotRequestType)(nil)).Elem() +} + +type ImportUnmanagedSnapshotResponse struct { +} + +type ImportVApp ImportVAppRequestType + +func init() { + t["ImportVApp"] = reflect.TypeOf((*ImportVApp)(nil)).Elem() +} + +type ImportVAppRequestType struct { + This ManagedObjectReference `xml:"_this"` + Spec BaseImportSpec `xml:"spec,typeattr"` + Folder *ManagedObjectReference `xml:"folder,omitempty"` + Host *ManagedObjectReference `xml:"host,omitempty"` +} + +func init() { + t["ImportVAppRequestType"] = reflect.TypeOf((*ImportVAppRequestType)(nil)).Elem() +} + +type ImportVAppResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type InUseFeatureManipulationDisallowed struct { + NotEnoughLicenses +} + +func init() { + t["InUseFeatureManipulationDisallowed"] = reflect.TypeOf((*InUseFeatureManipulationDisallowed)(nil)).Elem() +} + +type InUseFeatureManipulationDisallowedFault InUseFeatureManipulationDisallowed + +func init() { + t["InUseFeatureManipulationDisallowedFault"] = reflect.TypeOf((*InUseFeatureManipulationDisallowedFault)(nil)).Elem() +} + +type InaccessibleDatastore struct { + InvalidDatastore + + Detail string `xml:"detail,omitempty"` +} + +func init() { + t["InaccessibleDatastore"] = reflect.TypeOf((*InaccessibleDatastore)(nil)).Elem() +} + +type InaccessibleDatastoreFault BaseInaccessibleDatastore + +func init() { + t["InaccessibleDatastoreFault"] = reflect.TypeOf((*InaccessibleDatastoreFault)(nil)).Elem() +} + +type InaccessibleFTMetadataDatastore struct { + InaccessibleDatastore +} + +func init() { + t["InaccessibleFTMetadataDatastore"] = reflect.TypeOf((*InaccessibleFTMetadataDatastore)(nil)).Elem() +} + +type InaccessibleFTMetadataDatastoreFault InaccessibleFTMetadataDatastore + +func init() { + t["InaccessibleFTMetadataDatastoreFault"] = reflect.TypeOf((*InaccessibleFTMetadataDatastoreFault)(nil)).Elem() +} + +type InaccessibleVFlashSource struct { + VimFault + + HostName string `xml:"hostName"` +} + +func init() { + t["InaccessibleVFlashSource"] = reflect.TypeOf((*InaccessibleVFlashSource)(nil)).Elem() +} + +type InaccessibleVFlashSourceFault InaccessibleVFlashSource + +func init() { + t["InaccessibleVFlashSourceFault"] = reflect.TypeOf((*InaccessibleVFlashSourceFault)(nil)).Elem() +} + +type IncompatibleDefaultDevice struct { + MigrationFault + + Device string `xml:"device"` +} + +func init() { + t["IncompatibleDefaultDevice"] = reflect.TypeOf((*IncompatibleDefaultDevice)(nil)).Elem() +} + +type IncompatibleDefaultDeviceFault IncompatibleDefaultDevice + +func init() { + t["IncompatibleDefaultDeviceFault"] = reflect.TypeOf((*IncompatibleDefaultDeviceFault)(nil)).Elem() +} + +type IncompatibleHostForFtSecondary struct { + VmFaultToleranceIssue + + Host ManagedObjectReference `xml:"host"` + Error []LocalizedMethodFault `xml:"error,omitempty"` +} + +func init() { + t["IncompatibleHostForFtSecondary"] = reflect.TypeOf((*IncompatibleHostForFtSecondary)(nil)).Elem() +} + +type IncompatibleHostForFtSecondaryFault IncompatibleHostForFtSecondary + +func init() { + t["IncompatibleHostForFtSecondaryFault"] = reflect.TypeOf((*IncompatibleHostForFtSecondaryFault)(nil)).Elem() +} + +type IncompatibleHostForVmReplication struct { + ReplicationFault + + VmName string `xml:"vmName"` + HostName string `xml:"hostName"` + Reason string `xml:"reason"` +} + +func init() { + t["IncompatibleHostForVmReplication"] = reflect.TypeOf((*IncompatibleHostForVmReplication)(nil)).Elem() +} + +type IncompatibleHostForVmReplicationFault IncompatibleHostForVmReplication + +func init() { + t["IncompatibleHostForVmReplicationFault"] = reflect.TypeOf((*IncompatibleHostForVmReplicationFault)(nil)).Elem() +} + +type IncompatibleSetting struct { + InvalidArgument + + ConflictingProperty string `xml:"conflictingProperty"` +} + +func init() { + t["IncompatibleSetting"] = reflect.TypeOf((*IncompatibleSetting)(nil)).Elem() +} + +type IncompatibleSettingFault IncompatibleSetting + +func init() { + t["IncompatibleSettingFault"] = reflect.TypeOf((*IncompatibleSettingFault)(nil)).Elem() +} + +type IncorrectFileType struct { + FileFault +} + +func init() { + t["IncorrectFileType"] = reflect.TypeOf((*IncorrectFileType)(nil)).Elem() +} + +type IncorrectFileTypeFault IncorrectFileType + +func init() { + t["IncorrectFileTypeFault"] = reflect.TypeOf((*IncorrectFileTypeFault)(nil)).Elem() +} + +type IncorrectHostInformation struct { + NotEnoughLicenses +} + +func init() { + t["IncorrectHostInformation"] = reflect.TypeOf((*IncorrectHostInformation)(nil)).Elem() +} + +type IncorrectHostInformationEvent struct { + LicenseEvent +} + +func init() { + t["IncorrectHostInformationEvent"] = reflect.TypeOf((*IncorrectHostInformationEvent)(nil)).Elem() +} + +type IncorrectHostInformationFault IncorrectHostInformation + +func init() { + t["IncorrectHostInformationFault"] = reflect.TypeOf((*IncorrectHostInformationFault)(nil)).Elem() +} + +type IndependentDiskVMotionNotSupported struct { + MigrationFeatureNotSupported +} + +func init() { + t["IndependentDiskVMotionNotSupported"] = reflect.TypeOf((*IndependentDiskVMotionNotSupported)(nil)).Elem() +} + +type IndependentDiskVMotionNotSupportedFault IndependentDiskVMotionNotSupported + +func init() { + t["IndependentDiskVMotionNotSupportedFault"] = reflect.TypeOf((*IndependentDiskVMotionNotSupportedFault)(nil)).Elem() +} + +type InflateVirtualDiskRequestType struct { + This ManagedObjectReference `xml:"_this"` + Name string `xml:"name"` + Datacenter *ManagedObjectReference `xml:"datacenter,omitempty"` +} + +func init() { + t["InflateVirtualDiskRequestType"] = reflect.TypeOf((*InflateVirtualDiskRequestType)(nil)).Elem() +} + +type InflateVirtualDisk_Task InflateVirtualDiskRequestType + +func init() { + t["InflateVirtualDisk_Task"] = reflect.TypeOf((*InflateVirtualDisk_Task)(nil)).Elem() +} + +type InflateVirtualDisk_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type InfoUpgradeEvent struct { + UpgradeEvent +} + +func init() { + t["InfoUpgradeEvent"] = reflect.TypeOf((*InfoUpgradeEvent)(nil)).Elem() +} + +type InheritablePolicy struct { + DynamicData + + Inherited bool `xml:"inherited"` +} + +func init() { + t["InheritablePolicy"] = reflect.TypeOf((*InheritablePolicy)(nil)).Elem() +} + +type InitializeDisksRequestType struct { + This ManagedObjectReference `xml:"_this"` + Mapping []VsanHostDiskMapping `xml:"mapping"` +} + +func init() { + t["InitializeDisksRequestType"] = reflect.TypeOf((*InitializeDisksRequestType)(nil)).Elem() +} + +type InitializeDisks_Task InitializeDisksRequestType + +func init() { + t["InitializeDisks_Task"] = reflect.TypeOf((*InitializeDisks_Task)(nil)).Elem() +} + +type InitializeDisks_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type InitiateFileTransferFromGuest InitiateFileTransferFromGuestRequestType + +func init() { + t["InitiateFileTransferFromGuest"] = reflect.TypeOf((*InitiateFileTransferFromGuest)(nil)).Elem() +} + +type InitiateFileTransferFromGuestRequestType struct { + This ManagedObjectReference `xml:"_this"` + Vm ManagedObjectReference `xml:"vm"` + Auth BaseGuestAuthentication `xml:"auth,typeattr"` + GuestFilePath string `xml:"guestFilePath"` +} + +func init() { + t["InitiateFileTransferFromGuestRequestType"] = reflect.TypeOf((*InitiateFileTransferFromGuestRequestType)(nil)).Elem() +} + +type InitiateFileTransferFromGuestResponse struct { + Returnval FileTransferInformation `xml:"returnval"` +} + +type InitiateFileTransferToGuest InitiateFileTransferToGuestRequestType + +func init() { + t["InitiateFileTransferToGuest"] = reflect.TypeOf((*InitiateFileTransferToGuest)(nil)).Elem() +} + +type InitiateFileTransferToGuestRequestType struct { + This ManagedObjectReference `xml:"_this"` + Vm ManagedObjectReference `xml:"vm"` + Auth BaseGuestAuthentication `xml:"auth,typeattr"` + GuestFilePath string `xml:"guestFilePath"` + FileAttributes BaseGuestFileAttributes `xml:"fileAttributes,typeattr"` + FileSize int64 `xml:"fileSize"` + Overwrite bool `xml:"overwrite"` +} + +func init() { + t["InitiateFileTransferToGuestRequestType"] = reflect.TypeOf((*InitiateFileTransferToGuestRequestType)(nil)).Elem() +} + +type InitiateFileTransferToGuestResponse struct { + Returnval string `xml:"returnval"` +} + +type InstallHostPatchRequestType struct { + This ManagedObjectReference `xml:"_this"` + Repository HostPatchManagerLocator `xml:"repository"` + UpdateID string `xml:"updateID"` + Force *bool `xml:"force"` +} + +func init() { + t["InstallHostPatchRequestType"] = reflect.TypeOf((*InstallHostPatchRequestType)(nil)).Elem() +} + +type InstallHostPatchV2RequestType struct { + This ManagedObjectReference `xml:"_this"` + MetaUrls []string `xml:"metaUrls,omitempty"` + BundleUrls []string `xml:"bundleUrls,omitempty"` + VibUrls []string `xml:"vibUrls,omitempty"` + Spec *HostPatchManagerPatchManagerOperationSpec `xml:"spec,omitempty"` +} + +func init() { + t["InstallHostPatchV2RequestType"] = reflect.TypeOf((*InstallHostPatchV2RequestType)(nil)).Elem() +} + +type InstallHostPatchV2_Task InstallHostPatchV2RequestType + +func init() { + t["InstallHostPatchV2_Task"] = reflect.TypeOf((*InstallHostPatchV2_Task)(nil)).Elem() +} + +type InstallHostPatchV2_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type InstallHostPatch_Task InstallHostPatchRequestType + +func init() { + t["InstallHostPatch_Task"] = reflect.TypeOf((*InstallHostPatch_Task)(nil)).Elem() +} + +type InstallHostPatch_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type InstallIoFilterRequestType struct { + This ManagedObjectReference `xml:"_this"` + VibUrl string `xml:"vibUrl"` + CompRes ManagedObjectReference `xml:"compRes"` +} + +func init() { + t["InstallIoFilterRequestType"] = reflect.TypeOf((*InstallIoFilterRequestType)(nil)).Elem() +} + +type InstallIoFilter_Task InstallIoFilterRequestType + +func init() { + t["InstallIoFilter_Task"] = reflect.TypeOf((*InstallIoFilter_Task)(nil)).Elem() +} + +type InstallIoFilter_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type InstallServerCertificate InstallServerCertificateRequestType + +func init() { + t["InstallServerCertificate"] = reflect.TypeOf((*InstallServerCertificate)(nil)).Elem() +} + +type InstallServerCertificateRequestType struct { + This ManagedObjectReference `xml:"_this"` + Cert string `xml:"cert"` +} + +func init() { + t["InstallServerCertificateRequestType"] = reflect.TypeOf((*InstallServerCertificateRequestType)(nil)).Elem() +} + +type InstallServerCertificateResponse struct { +} + +type InstallSmartCardTrustAnchor InstallSmartCardTrustAnchorRequestType + +func init() { + t["InstallSmartCardTrustAnchor"] = reflect.TypeOf((*InstallSmartCardTrustAnchor)(nil)).Elem() +} + +type InstallSmartCardTrustAnchorRequestType struct { + This ManagedObjectReference `xml:"_this"` + Cert string `xml:"cert"` +} + +func init() { + t["InstallSmartCardTrustAnchorRequestType"] = reflect.TypeOf((*InstallSmartCardTrustAnchorRequestType)(nil)).Elem() +} + +type InstallSmartCardTrustAnchorResponse struct { +} + +type InsufficientAgentVmsDeployed struct { + InsufficientResourcesFault + + HostName string `xml:"hostName"` + RequiredNumAgentVms int32 `xml:"requiredNumAgentVms"` + CurrentNumAgentVms int32 `xml:"currentNumAgentVms"` +} + +func init() { + t["InsufficientAgentVmsDeployed"] = reflect.TypeOf((*InsufficientAgentVmsDeployed)(nil)).Elem() +} + +type InsufficientAgentVmsDeployedFault InsufficientAgentVmsDeployed + +func init() { + t["InsufficientAgentVmsDeployedFault"] = reflect.TypeOf((*InsufficientAgentVmsDeployedFault)(nil)).Elem() +} + +type InsufficientCpuResourcesFault struct { + InsufficientResourcesFault + + Unreserved int64 `xml:"unreserved"` + Requested int64 `xml:"requested"` +} + +func init() { + t["InsufficientCpuResourcesFault"] = reflect.TypeOf((*InsufficientCpuResourcesFault)(nil)).Elem() +} + +type InsufficientCpuResourcesFaultFault InsufficientCpuResourcesFault + +func init() { + t["InsufficientCpuResourcesFaultFault"] = reflect.TypeOf((*InsufficientCpuResourcesFaultFault)(nil)).Elem() +} + +type InsufficientDisks struct { + VsanDiskFault +} + +func init() { + t["InsufficientDisks"] = reflect.TypeOf((*InsufficientDisks)(nil)).Elem() +} + +type InsufficientDisksFault InsufficientDisks + +func init() { + t["InsufficientDisksFault"] = reflect.TypeOf((*InsufficientDisksFault)(nil)).Elem() +} + +type InsufficientFailoverResourcesEvent struct { + ClusterEvent +} + +func init() { + t["InsufficientFailoverResourcesEvent"] = reflect.TypeOf((*InsufficientFailoverResourcesEvent)(nil)).Elem() +} + +type InsufficientFailoverResourcesFault struct { + InsufficientResourcesFault +} + +func init() { + t["InsufficientFailoverResourcesFault"] = reflect.TypeOf((*InsufficientFailoverResourcesFault)(nil)).Elem() +} + +type InsufficientFailoverResourcesFaultFault InsufficientFailoverResourcesFault + +func init() { + t["InsufficientFailoverResourcesFaultFault"] = reflect.TypeOf((*InsufficientFailoverResourcesFaultFault)(nil)).Elem() +} + +type InsufficientGraphicsResourcesFault struct { + InsufficientResourcesFault +} + +func init() { + t["InsufficientGraphicsResourcesFault"] = reflect.TypeOf((*InsufficientGraphicsResourcesFault)(nil)).Elem() +} + +type InsufficientGraphicsResourcesFaultFault InsufficientGraphicsResourcesFault + +func init() { + t["InsufficientGraphicsResourcesFaultFault"] = reflect.TypeOf((*InsufficientGraphicsResourcesFaultFault)(nil)).Elem() +} + +type InsufficientHostCapacityFault struct { + InsufficientResourcesFault + + Host *ManagedObjectReference `xml:"host,omitempty"` +} + +func init() { + t["InsufficientHostCapacityFault"] = reflect.TypeOf((*InsufficientHostCapacityFault)(nil)).Elem() +} + +type InsufficientHostCapacityFaultFault BaseInsufficientHostCapacityFault + +func init() { + t["InsufficientHostCapacityFaultFault"] = reflect.TypeOf((*InsufficientHostCapacityFaultFault)(nil)).Elem() +} + +type InsufficientHostCpuCapacityFault struct { + InsufficientHostCapacityFault + + Unreserved int64 `xml:"unreserved"` + Requested int64 `xml:"requested"` +} + +func init() { + t["InsufficientHostCpuCapacityFault"] = reflect.TypeOf((*InsufficientHostCpuCapacityFault)(nil)).Elem() +} + +type InsufficientHostCpuCapacityFaultFault InsufficientHostCpuCapacityFault + +func init() { + t["InsufficientHostCpuCapacityFaultFault"] = reflect.TypeOf((*InsufficientHostCpuCapacityFaultFault)(nil)).Elem() +} + +type InsufficientHostMemoryCapacityFault struct { + InsufficientHostCapacityFault + + Unreserved int64 `xml:"unreserved"` + Requested int64 `xml:"requested"` +} + +func init() { + t["InsufficientHostMemoryCapacityFault"] = reflect.TypeOf((*InsufficientHostMemoryCapacityFault)(nil)).Elem() +} + +type InsufficientHostMemoryCapacityFaultFault InsufficientHostMemoryCapacityFault + +func init() { + t["InsufficientHostMemoryCapacityFaultFault"] = reflect.TypeOf((*InsufficientHostMemoryCapacityFaultFault)(nil)).Elem() +} + +type InsufficientMemoryResourcesFault struct { + InsufficientResourcesFault + + Unreserved int64 `xml:"unreserved"` + Requested int64 `xml:"requested"` +} + +func init() { + t["InsufficientMemoryResourcesFault"] = reflect.TypeOf((*InsufficientMemoryResourcesFault)(nil)).Elem() +} + +type InsufficientMemoryResourcesFaultFault InsufficientMemoryResourcesFault + +func init() { + t["InsufficientMemoryResourcesFaultFault"] = reflect.TypeOf((*InsufficientMemoryResourcesFaultFault)(nil)).Elem() +} + +type InsufficientNetworkCapacity struct { + InsufficientResourcesFault +} + +func init() { + t["InsufficientNetworkCapacity"] = reflect.TypeOf((*InsufficientNetworkCapacity)(nil)).Elem() +} + +type InsufficientNetworkCapacityFault InsufficientNetworkCapacity + +func init() { + t["InsufficientNetworkCapacityFault"] = reflect.TypeOf((*InsufficientNetworkCapacityFault)(nil)).Elem() +} + +type InsufficientNetworkResourcePoolCapacity struct { + InsufficientResourcesFault + + DvsName string `xml:"dvsName"` + DvsUuid string `xml:"dvsUuid"` + ResourcePoolKey string `xml:"resourcePoolKey"` + Available int64 `xml:"available"` + Requested int64 `xml:"requested"` + Device []string `xml:"device"` +} + +func init() { + t["InsufficientNetworkResourcePoolCapacity"] = reflect.TypeOf((*InsufficientNetworkResourcePoolCapacity)(nil)).Elem() +} + +type InsufficientNetworkResourcePoolCapacityFault InsufficientNetworkResourcePoolCapacity + +func init() { + t["InsufficientNetworkResourcePoolCapacityFault"] = reflect.TypeOf((*InsufficientNetworkResourcePoolCapacityFault)(nil)).Elem() +} + +type InsufficientPerCpuCapacity struct { + InsufficientHostCapacityFault +} + +func init() { + t["InsufficientPerCpuCapacity"] = reflect.TypeOf((*InsufficientPerCpuCapacity)(nil)).Elem() +} + +type InsufficientPerCpuCapacityFault InsufficientPerCpuCapacity + +func init() { + t["InsufficientPerCpuCapacityFault"] = reflect.TypeOf((*InsufficientPerCpuCapacityFault)(nil)).Elem() +} + +type InsufficientResourcesFault struct { + VimFault +} + +func init() { + t["InsufficientResourcesFault"] = reflect.TypeOf((*InsufficientResourcesFault)(nil)).Elem() +} + +type InsufficientResourcesFaultFault BaseInsufficientResourcesFault + +func init() { + t["InsufficientResourcesFaultFault"] = reflect.TypeOf((*InsufficientResourcesFaultFault)(nil)).Elem() +} + +type InsufficientStandbyCpuResource struct { + InsufficientStandbyResource + + Available int64 `xml:"available"` + Requested int64 `xml:"requested"` +} + +func init() { + t["InsufficientStandbyCpuResource"] = reflect.TypeOf((*InsufficientStandbyCpuResource)(nil)).Elem() +} + +type InsufficientStandbyCpuResourceFault InsufficientStandbyCpuResource + +func init() { + t["InsufficientStandbyCpuResourceFault"] = reflect.TypeOf((*InsufficientStandbyCpuResourceFault)(nil)).Elem() +} + +type InsufficientStandbyMemoryResource struct { + InsufficientStandbyResource + + Available int64 `xml:"available"` + Requested int64 `xml:"requested"` +} + +func init() { + t["InsufficientStandbyMemoryResource"] = reflect.TypeOf((*InsufficientStandbyMemoryResource)(nil)).Elem() +} + +type InsufficientStandbyMemoryResourceFault InsufficientStandbyMemoryResource + +func init() { + t["InsufficientStandbyMemoryResourceFault"] = reflect.TypeOf((*InsufficientStandbyMemoryResourceFault)(nil)).Elem() +} + +type InsufficientStandbyResource struct { + InsufficientResourcesFault +} + +func init() { + t["InsufficientStandbyResource"] = reflect.TypeOf((*InsufficientStandbyResource)(nil)).Elem() +} + +type InsufficientStandbyResourceFault BaseInsufficientStandbyResource + +func init() { + t["InsufficientStandbyResourceFault"] = reflect.TypeOf((*InsufficientStandbyResourceFault)(nil)).Elem() +} + +type InsufficientStorageIops struct { + VimFault + + UnreservedIops int64 `xml:"unreservedIops"` + RequestedIops int64 `xml:"requestedIops"` + DatastoreName string `xml:"datastoreName"` +} + +func init() { + t["InsufficientStorageIops"] = reflect.TypeOf((*InsufficientStorageIops)(nil)).Elem() +} + +type InsufficientStorageIopsFault InsufficientStorageIops + +func init() { + t["InsufficientStorageIopsFault"] = reflect.TypeOf((*InsufficientStorageIopsFault)(nil)).Elem() +} + +type InsufficientStorageSpace struct { + InsufficientResourcesFault +} + +func init() { + t["InsufficientStorageSpace"] = reflect.TypeOf((*InsufficientStorageSpace)(nil)).Elem() +} + +type InsufficientStorageSpaceFault InsufficientStorageSpace + +func init() { + t["InsufficientStorageSpaceFault"] = reflect.TypeOf((*InsufficientStorageSpaceFault)(nil)).Elem() +} + +type InsufficientVFlashResourcesFault struct { + InsufficientResourcesFault + + FreeSpaceInMB int64 `xml:"freeSpaceInMB,omitempty"` + FreeSpace int64 `xml:"freeSpace"` + RequestedSpaceInMB int64 `xml:"requestedSpaceInMB,omitempty"` + RequestedSpace int64 `xml:"requestedSpace"` +} + +func init() { + t["InsufficientVFlashResourcesFault"] = reflect.TypeOf((*InsufficientVFlashResourcesFault)(nil)).Elem() +} + +type InsufficientVFlashResourcesFaultFault InsufficientVFlashResourcesFault + +func init() { + t["InsufficientVFlashResourcesFaultFault"] = reflect.TypeOf((*InsufficientVFlashResourcesFaultFault)(nil)).Elem() +} + +type IntExpression struct { + NegatableExpression + + Value int32 `xml:"value,omitempty"` +} + +func init() { + t["IntExpression"] = reflect.TypeOf((*IntExpression)(nil)).Elem() +} + +type IntOption struct { + OptionType + + Min int32 `xml:"min"` + Max int32 `xml:"max"` + DefaultValue int32 `xml:"defaultValue"` +} + +func init() { + t["IntOption"] = reflect.TypeOf((*IntOption)(nil)).Elem() +} + +type IntPolicy struct { + InheritablePolicy + + Value int32 `xml:"value,omitempty"` +} + +func init() { + t["IntPolicy"] = reflect.TypeOf((*IntPolicy)(nil)).Elem() +} + +type InvalidAffinitySettingFault struct { + VimFault +} + +func init() { + t["InvalidAffinitySettingFault"] = reflect.TypeOf((*InvalidAffinitySettingFault)(nil)).Elem() +} + +type InvalidAffinitySettingFaultFault InvalidAffinitySettingFault + +func init() { + t["InvalidAffinitySettingFaultFault"] = reflect.TypeOf((*InvalidAffinitySettingFaultFault)(nil)).Elem() +} + +type InvalidArgument struct { + RuntimeFault + + InvalidProperty string `xml:"invalidProperty,omitempty"` +} + +func init() { + t["InvalidArgument"] = reflect.TypeOf((*InvalidArgument)(nil)).Elem() +} + +type InvalidArgumentFault BaseInvalidArgument + +func init() { + t["InvalidArgumentFault"] = reflect.TypeOf((*InvalidArgumentFault)(nil)).Elem() +} + +type InvalidBmcRole struct { + VimFault +} + +func init() { + t["InvalidBmcRole"] = reflect.TypeOf((*InvalidBmcRole)(nil)).Elem() +} + +type InvalidBmcRoleFault InvalidBmcRole + +func init() { + t["InvalidBmcRoleFault"] = reflect.TypeOf((*InvalidBmcRoleFault)(nil)).Elem() +} + +type InvalidBundle struct { + PlatformConfigFault +} + +func init() { + t["InvalidBundle"] = reflect.TypeOf((*InvalidBundle)(nil)).Elem() +} + +type InvalidBundleFault InvalidBundle + +func init() { + t["InvalidBundleFault"] = reflect.TypeOf((*InvalidBundleFault)(nil)).Elem() +} + +type InvalidCAMCertificate struct { + InvalidCAMServer +} + +func init() { + t["InvalidCAMCertificate"] = reflect.TypeOf((*InvalidCAMCertificate)(nil)).Elem() +} + +type InvalidCAMCertificateFault InvalidCAMCertificate + +func init() { + t["InvalidCAMCertificateFault"] = reflect.TypeOf((*InvalidCAMCertificateFault)(nil)).Elem() +} + +type InvalidCAMServer struct { + ActiveDirectoryFault + + CamServer string `xml:"camServer"` +} + +func init() { + t["InvalidCAMServer"] = reflect.TypeOf((*InvalidCAMServer)(nil)).Elem() +} + +type InvalidCAMServerFault BaseInvalidCAMServer + +func init() { + t["InvalidCAMServerFault"] = reflect.TypeOf((*InvalidCAMServerFault)(nil)).Elem() +} + +type InvalidClientCertificate struct { + InvalidLogin +} + +func init() { + t["InvalidClientCertificate"] = reflect.TypeOf((*InvalidClientCertificate)(nil)).Elem() +} + +type InvalidClientCertificateFault InvalidClientCertificate + +func init() { + t["InvalidClientCertificateFault"] = reflect.TypeOf((*InvalidClientCertificateFault)(nil)).Elem() +} + +type InvalidCollectorVersion struct { + MethodFault +} + +func init() { + t["InvalidCollectorVersion"] = reflect.TypeOf((*InvalidCollectorVersion)(nil)).Elem() +} + +type InvalidCollectorVersionFault InvalidCollectorVersion + +func init() { + t["InvalidCollectorVersionFault"] = reflect.TypeOf((*InvalidCollectorVersionFault)(nil)).Elem() +} + +type InvalidController struct { + InvalidDeviceSpec + + ControllerKey int32 `xml:"controllerKey"` +} + +func init() { + t["InvalidController"] = reflect.TypeOf((*InvalidController)(nil)).Elem() +} + +type InvalidControllerFault InvalidController + +func init() { + t["InvalidControllerFault"] = reflect.TypeOf((*InvalidControllerFault)(nil)).Elem() +} + +type InvalidDasConfigArgument struct { + InvalidArgument + + Entry string `xml:"entry,omitempty"` + ClusterName string `xml:"clusterName,omitempty"` +} + +func init() { + t["InvalidDasConfigArgument"] = reflect.TypeOf((*InvalidDasConfigArgument)(nil)).Elem() +} + +type InvalidDasConfigArgumentFault InvalidDasConfigArgument + +func init() { + t["InvalidDasConfigArgumentFault"] = reflect.TypeOf((*InvalidDasConfigArgumentFault)(nil)).Elem() +} + +type InvalidDasRestartPriorityForFtVm struct { + InvalidArgument + + Vm ManagedObjectReference `xml:"vm"` + VmName string `xml:"vmName"` +} + +func init() { + t["InvalidDasRestartPriorityForFtVm"] = reflect.TypeOf((*InvalidDasRestartPriorityForFtVm)(nil)).Elem() +} + +type InvalidDasRestartPriorityForFtVmFault InvalidDasRestartPriorityForFtVm + +func init() { + t["InvalidDasRestartPriorityForFtVmFault"] = reflect.TypeOf((*InvalidDasRestartPriorityForFtVmFault)(nil)).Elem() +} + +type InvalidDatastore struct { + VimFault + + Datastore *ManagedObjectReference `xml:"datastore,omitempty"` + Name string `xml:"name,omitempty"` +} + +func init() { + t["InvalidDatastore"] = reflect.TypeOf((*InvalidDatastore)(nil)).Elem() +} + +type InvalidDatastoreFault BaseInvalidDatastore + +func init() { + t["InvalidDatastoreFault"] = reflect.TypeOf((*InvalidDatastoreFault)(nil)).Elem() +} + +type InvalidDatastorePath struct { + InvalidDatastore + + DatastorePath string `xml:"datastorePath"` +} + +func init() { + t["InvalidDatastorePath"] = reflect.TypeOf((*InvalidDatastorePath)(nil)).Elem() +} + +type InvalidDatastorePathFault InvalidDatastorePath + +func init() { + t["InvalidDatastorePathFault"] = reflect.TypeOf((*InvalidDatastorePathFault)(nil)).Elem() +} + +type InvalidDatastoreState struct { + InvalidState + + DatastoreName string `xml:"datastoreName,omitempty"` +} + +func init() { + t["InvalidDatastoreState"] = reflect.TypeOf((*InvalidDatastoreState)(nil)).Elem() +} + +type InvalidDatastoreStateFault InvalidDatastoreState + +func init() { + t["InvalidDatastoreStateFault"] = reflect.TypeOf((*InvalidDatastoreStateFault)(nil)).Elem() +} + +type InvalidDeviceBacking struct { + InvalidDeviceSpec +} + +func init() { + t["InvalidDeviceBacking"] = reflect.TypeOf((*InvalidDeviceBacking)(nil)).Elem() +} + +type InvalidDeviceBackingFault InvalidDeviceBacking + +func init() { + t["InvalidDeviceBackingFault"] = reflect.TypeOf((*InvalidDeviceBackingFault)(nil)).Elem() +} + +type InvalidDeviceOperation struct { + InvalidDeviceSpec + + BadOp VirtualDeviceConfigSpecOperation `xml:"badOp,omitempty"` + BadFileOp VirtualDeviceConfigSpecFileOperation `xml:"badFileOp,omitempty"` +} + +func init() { + t["InvalidDeviceOperation"] = reflect.TypeOf((*InvalidDeviceOperation)(nil)).Elem() +} + +type InvalidDeviceOperationFault InvalidDeviceOperation + +func init() { + t["InvalidDeviceOperationFault"] = reflect.TypeOf((*InvalidDeviceOperationFault)(nil)).Elem() +} + +type InvalidDeviceSpec struct { + InvalidVmConfig + + DeviceIndex int32 `xml:"deviceIndex"` +} + +func init() { + t["InvalidDeviceSpec"] = reflect.TypeOf((*InvalidDeviceSpec)(nil)).Elem() +} + +type InvalidDeviceSpecFault BaseInvalidDeviceSpec + +func init() { + t["InvalidDeviceSpecFault"] = reflect.TypeOf((*InvalidDeviceSpecFault)(nil)).Elem() +} + +type InvalidDiskFormat struct { + InvalidFormat +} + +func init() { + t["InvalidDiskFormat"] = reflect.TypeOf((*InvalidDiskFormat)(nil)).Elem() +} + +type InvalidDiskFormatFault InvalidDiskFormat + +func init() { + t["InvalidDiskFormatFault"] = reflect.TypeOf((*InvalidDiskFormatFault)(nil)).Elem() +} + +type InvalidDrsBehaviorForFtVm struct { + InvalidArgument + + Vm ManagedObjectReference `xml:"vm"` + VmName string `xml:"vmName"` +} + +func init() { + t["InvalidDrsBehaviorForFtVm"] = reflect.TypeOf((*InvalidDrsBehaviorForFtVm)(nil)).Elem() +} + +type InvalidDrsBehaviorForFtVmFault InvalidDrsBehaviorForFtVm + +func init() { + t["InvalidDrsBehaviorForFtVmFault"] = reflect.TypeOf((*InvalidDrsBehaviorForFtVmFault)(nil)).Elem() +} + +type InvalidEditionEvent struct { + LicenseEvent + + Feature string `xml:"feature"` +} + +func init() { + t["InvalidEditionEvent"] = reflect.TypeOf((*InvalidEditionEvent)(nil)).Elem() +} + +type InvalidEditionLicense struct { + NotEnoughLicenses + + Feature string `xml:"feature"` +} + +func init() { + t["InvalidEditionLicense"] = reflect.TypeOf((*InvalidEditionLicense)(nil)).Elem() +} + +type InvalidEditionLicenseFault InvalidEditionLicense + +func init() { + t["InvalidEditionLicenseFault"] = reflect.TypeOf((*InvalidEditionLicenseFault)(nil)).Elem() +} + +type InvalidEvent struct { + VimFault +} + +func init() { + t["InvalidEvent"] = reflect.TypeOf((*InvalidEvent)(nil)).Elem() +} + +type InvalidEventFault InvalidEvent + +func init() { + t["InvalidEventFault"] = reflect.TypeOf((*InvalidEventFault)(nil)).Elem() +} + +type InvalidFolder struct { + VimFault + + Target ManagedObjectReference `xml:"target"` +} + +func init() { + t["InvalidFolder"] = reflect.TypeOf((*InvalidFolder)(nil)).Elem() +} + +type InvalidFolderFault BaseInvalidFolder + +func init() { + t["InvalidFolderFault"] = reflect.TypeOf((*InvalidFolderFault)(nil)).Elem() +} + +type InvalidFormat struct { + VmConfigFault +} + +func init() { + t["InvalidFormat"] = reflect.TypeOf((*InvalidFormat)(nil)).Elem() +} + +type InvalidFormatFault BaseInvalidFormat + +func init() { + t["InvalidFormatFault"] = reflect.TypeOf((*InvalidFormatFault)(nil)).Elem() +} + +type InvalidGuestLogin struct { + GuestOperationsFault +} + +func init() { + t["InvalidGuestLogin"] = reflect.TypeOf((*InvalidGuestLogin)(nil)).Elem() +} + +type InvalidGuestLoginFault InvalidGuestLogin + +func init() { + t["InvalidGuestLoginFault"] = reflect.TypeOf((*InvalidGuestLoginFault)(nil)).Elem() +} + +type InvalidHostConnectionState struct { + InvalidHostState +} + +func init() { + t["InvalidHostConnectionState"] = reflect.TypeOf((*InvalidHostConnectionState)(nil)).Elem() +} + +type InvalidHostConnectionStateFault InvalidHostConnectionState + +func init() { + t["InvalidHostConnectionStateFault"] = reflect.TypeOf((*InvalidHostConnectionStateFault)(nil)).Elem() +} + +type InvalidHostName struct { + HostConfigFault +} + +func init() { + t["InvalidHostName"] = reflect.TypeOf((*InvalidHostName)(nil)).Elem() +} + +type InvalidHostNameFault InvalidHostName + +func init() { + t["InvalidHostNameFault"] = reflect.TypeOf((*InvalidHostNameFault)(nil)).Elem() +} + +type InvalidHostState struct { + InvalidState + + Host *ManagedObjectReference `xml:"host,omitempty"` +} + +func init() { + t["InvalidHostState"] = reflect.TypeOf((*InvalidHostState)(nil)).Elem() +} + +type InvalidHostStateFault BaseInvalidHostState + +func init() { + t["InvalidHostStateFault"] = reflect.TypeOf((*InvalidHostStateFault)(nil)).Elem() +} + +type InvalidIndexArgument struct { + InvalidArgument + + Key string `xml:"key"` +} + +func init() { + t["InvalidIndexArgument"] = reflect.TypeOf((*InvalidIndexArgument)(nil)).Elem() +} + +type InvalidIndexArgumentFault InvalidIndexArgument + +func init() { + t["InvalidIndexArgumentFault"] = reflect.TypeOf((*InvalidIndexArgumentFault)(nil)).Elem() +} + +type InvalidIpfixConfig struct { + DvsFault + + Property string `xml:"property,omitempty"` +} + +func init() { + t["InvalidIpfixConfig"] = reflect.TypeOf((*InvalidIpfixConfig)(nil)).Elem() +} + +type InvalidIpfixConfigFault InvalidIpfixConfig + +func init() { + t["InvalidIpfixConfigFault"] = reflect.TypeOf((*InvalidIpfixConfigFault)(nil)).Elem() +} + +type InvalidIpmiLoginInfo struct { + VimFault +} + +func init() { + t["InvalidIpmiLoginInfo"] = reflect.TypeOf((*InvalidIpmiLoginInfo)(nil)).Elem() +} + +type InvalidIpmiLoginInfoFault InvalidIpmiLoginInfo + +func init() { + t["InvalidIpmiLoginInfoFault"] = reflect.TypeOf((*InvalidIpmiLoginInfoFault)(nil)).Elem() +} + +type InvalidIpmiMacAddress struct { + VimFault + + UserProvidedMacAddress string `xml:"userProvidedMacAddress"` + ObservedMacAddress string `xml:"observedMacAddress"` +} + +func init() { + t["InvalidIpmiMacAddress"] = reflect.TypeOf((*InvalidIpmiMacAddress)(nil)).Elem() +} + +type InvalidIpmiMacAddressFault InvalidIpmiMacAddress + +func init() { + t["InvalidIpmiMacAddressFault"] = reflect.TypeOf((*InvalidIpmiMacAddressFault)(nil)).Elem() +} + +type InvalidLicense struct { + VimFault + + LicenseContent string `xml:"licenseContent"` +} + +func init() { + t["InvalidLicense"] = reflect.TypeOf((*InvalidLicense)(nil)).Elem() +} + +type InvalidLicenseFault InvalidLicense + +func init() { + t["InvalidLicenseFault"] = reflect.TypeOf((*InvalidLicenseFault)(nil)).Elem() +} + +type InvalidLocale struct { + VimFault +} + +func init() { + t["InvalidLocale"] = reflect.TypeOf((*InvalidLocale)(nil)).Elem() +} + +type InvalidLocaleFault InvalidLocale + +func init() { + t["InvalidLocaleFault"] = reflect.TypeOf((*InvalidLocaleFault)(nil)).Elem() +} + +type InvalidLogin struct { + VimFault +} + +func init() { + t["InvalidLogin"] = reflect.TypeOf((*InvalidLogin)(nil)).Elem() +} + +type InvalidLoginFault BaseInvalidLogin + +func init() { + t["InvalidLoginFault"] = reflect.TypeOf((*InvalidLoginFault)(nil)).Elem() +} + +type InvalidName struct { + VimFault + + Name string `xml:"name"` + Entity *ManagedObjectReference `xml:"entity,omitempty"` +} + +func init() { + t["InvalidName"] = reflect.TypeOf((*InvalidName)(nil)).Elem() +} + +type InvalidNameFault InvalidName + +func init() { + t["InvalidNameFault"] = reflect.TypeOf((*InvalidNameFault)(nil)).Elem() +} + +type InvalidNasCredentials struct { + NasConfigFault + + UserName string `xml:"userName"` +} + +func init() { + t["InvalidNasCredentials"] = reflect.TypeOf((*InvalidNasCredentials)(nil)).Elem() +} + +type InvalidNasCredentialsFault InvalidNasCredentials + +func init() { + t["InvalidNasCredentialsFault"] = reflect.TypeOf((*InvalidNasCredentialsFault)(nil)).Elem() +} + +type InvalidNetworkInType struct { + VAppPropertyFault +} + +func init() { + t["InvalidNetworkInType"] = reflect.TypeOf((*InvalidNetworkInType)(nil)).Elem() +} + +type InvalidNetworkInTypeFault InvalidNetworkInType + +func init() { + t["InvalidNetworkInTypeFault"] = reflect.TypeOf((*InvalidNetworkInTypeFault)(nil)).Elem() +} + +type InvalidNetworkResource struct { + NasConfigFault + + RemoteHost string `xml:"remoteHost"` + RemotePath string `xml:"remotePath"` +} + +func init() { + t["InvalidNetworkResource"] = reflect.TypeOf((*InvalidNetworkResource)(nil)).Elem() +} + +type InvalidNetworkResourceFault InvalidNetworkResource + +func init() { + t["InvalidNetworkResourceFault"] = reflect.TypeOf((*InvalidNetworkResourceFault)(nil)).Elem() +} + +type InvalidOperationOnSecondaryVm struct { + VmFaultToleranceIssue + + InstanceUuid string `xml:"instanceUuid,omitempty"` +} + +func init() { + t["InvalidOperationOnSecondaryVm"] = reflect.TypeOf((*InvalidOperationOnSecondaryVm)(nil)).Elem() +} + +type InvalidOperationOnSecondaryVmFault InvalidOperationOnSecondaryVm + +func init() { + t["InvalidOperationOnSecondaryVmFault"] = reflect.TypeOf((*InvalidOperationOnSecondaryVmFault)(nil)).Elem() +} + +type InvalidPowerState struct { + InvalidState + + RequestedState VirtualMachinePowerState `xml:"requestedState,omitempty"` + ExistingState VirtualMachinePowerState `xml:"existingState"` +} + +func init() { + t["InvalidPowerState"] = reflect.TypeOf((*InvalidPowerState)(nil)).Elem() +} + +type InvalidPowerStateFault InvalidPowerState + +func init() { + t["InvalidPowerStateFault"] = reflect.TypeOf((*InvalidPowerStateFault)(nil)).Elem() +} + +type InvalidPrivilege struct { + VimFault + + Privilege string `xml:"privilege"` +} + +func init() { + t["InvalidPrivilege"] = reflect.TypeOf((*InvalidPrivilege)(nil)).Elem() +} + +type InvalidPrivilegeFault InvalidPrivilege + +func init() { + t["InvalidPrivilegeFault"] = reflect.TypeOf((*InvalidPrivilegeFault)(nil)).Elem() +} + +type InvalidProfileReferenceHost struct { + RuntimeFault + + Reason string `xml:"reason,omitempty"` + Host *ManagedObjectReference `xml:"host,omitempty"` + Profile *ManagedObjectReference `xml:"profile,omitempty"` +} + +func init() { + t["InvalidProfileReferenceHost"] = reflect.TypeOf((*InvalidProfileReferenceHost)(nil)).Elem() +} + +type InvalidProfileReferenceHostFault InvalidProfileReferenceHost + +func init() { + t["InvalidProfileReferenceHostFault"] = reflect.TypeOf((*InvalidProfileReferenceHostFault)(nil)).Elem() +} + +type InvalidProperty struct { + MethodFault + + Name string `xml:"name"` +} + +func init() { + t["InvalidProperty"] = reflect.TypeOf((*InvalidProperty)(nil)).Elem() +} + +type InvalidPropertyFault InvalidProperty + +func init() { + t["InvalidPropertyFault"] = reflect.TypeOf((*InvalidPropertyFault)(nil)).Elem() +} + +type InvalidPropertyType struct { + VAppPropertyFault +} + +func init() { + t["InvalidPropertyType"] = reflect.TypeOf((*InvalidPropertyType)(nil)).Elem() +} + +type InvalidPropertyTypeFault InvalidPropertyType + +func init() { + t["InvalidPropertyTypeFault"] = reflect.TypeOf((*InvalidPropertyTypeFault)(nil)).Elem() +} + +type InvalidPropertyValue struct { + VAppPropertyFault +} + +func init() { + t["InvalidPropertyValue"] = reflect.TypeOf((*InvalidPropertyValue)(nil)).Elem() +} + +type InvalidPropertyValueFault BaseInvalidPropertyValue + +func init() { + t["InvalidPropertyValueFault"] = reflect.TypeOf((*InvalidPropertyValueFault)(nil)).Elem() +} + +type InvalidRequest struct { + RuntimeFault +} + +func init() { + t["InvalidRequest"] = reflect.TypeOf((*InvalidRequest)(nil)).Elem() +} + +type InvalidRequestFault BaseInvalidRequest + +func init() { + t["InvalidRequestFault"] = reflect.TypeOf((*InvalidRequestFault)(nil)).Elem() +} + +type InvalidResourcePoolStructureFault struct { + InsufficientResourcesFault +} + +func init() { + t["InvalidResourcePoolStructureFault"] = reflect.TypeOf((*InvalidResourcePoolStructureFault)(nil)).Elem() +} + +type InvalidResourcePoolStructureFaultFault InvalidResourcePoolStructureFault + +func init() { + t["InvalidResourcePoolStructureFaultFault"] = reflect.TypeOf((*InvalidResourcePoolStructureFaultFault)(nil)).Elem() +} + +type InvalidSnapshotFormat struct { + InvalidFormat +} + +func init() { + t["InvalidSnapshotFormat"] = reflect.TypeOf((*InvalidSnapshotFormat)(nil)).Elem() +} + +type InvalidSnapshotFormatFault InvalidSnapshotFormat + +func init() { + t["InvalidSnapshotFormatFault"] = reflect.TypeOf((*InvalidSnapshotFormatFault)(nil)).Elem() +} + +type InvalidState struct { + VimFault +} + +func init() { + t["InvalidState"] = reflect.TypeOf((*InvalidState)(nil)).Elem() +} + +type InvalidStateFault BaseInvalidState + +func init() { + t["InvalidStateFault"] = reflect.TypeOf((*InvalidStateFault)(nil)).Elem() +} + +type InvalidType struct { + InvalidRequest + + Argument string `xml:"argument,omitempty"` +} + +func init() { + t["InvalidType"] = reflect.TypeOf((*InvalidType)(nil)).Elem() +} + +type InvalidTypeFault InvalidType + +func init() { + t["InvalidTypeFault"] = reflect.TypeOf((*InvalidTypeFault)(nil)).Elem() +} + +type InvalidVmConfig struct { + VmConfigFault + + Property string `xml:"property,omitempty"` +} + +func init() { + t["InvalidVmConfig"] = reflect.TypeOf((*InvalidVmConfig)(nil)).Elem() +} + +type InvalidVmConfigFault BaseInvalidVmConfig + +func init() { + t["InvalidVmConfigFault"] = reflect.TypeOf((*InvalidVmConfigFault)(nil)).Elem() +} + +type InventoryDescription struct { + DynamicData + + NumHosts int32 `xml:"numHosts"` + NumVirtualMachines int32 `xml:"numVirtualMachines"` + NumResourcePools int32 `xml:"numResourcePools,omitempty"` + NumClusters int32 `xml:"numClusters,omitempty"` + NumCpuDev int32 `xml:"numCpuDev,omitempty"` + NumNetDev int32 `xml:"numNetDev,omitempty"` + NumDiskDev int32 `xml:"numDiskDev,omitempty"` + NumvCpuDev int32 `xml:"numvCpuDev,omitempty"` + NumvNetDev int32 `xml:"numvNetDev,omitempty"` + NumvDiskDev int32 `xml:"numvDiskDev,omitempty"` +} + +func init() { + t["InventoryDescription"] = reflect.TypeOf((*InventoryDescription)(nil)).Elem() +} + +type InventoryHasStandardAloneHosts struct { + NotEnoughLicenses + + Hosts []string `xml:"hosts"` +} + +func init() { + t["InventoryHasStandardAloneHosts"] = reflect.TypeOf((*InventoryHasStandardAloneHosts)(nil)).Elem() +} + +type InventoryHasStandardAloneHostsFault InventoryHasStandardAloneHosts + +func init() { + t["InventoryHasStandardAloneHostsFault"] = reflect.TypeOf((*InventoryHasStandardAloneHostsFault)(nil)).Elem() +} + +type IoFilterHostIssue struct { + DynamicData + + Host ManagedObjectReference `xml:"host"` + Issue []LocalizedMethodFault `xml:"issue"` +} + +func init() { + t["IoFilterHostIssue"] = reflect.TypeOf((*IoFilterHostIssue)(nil)).Elem() +} + +type IoFilterInfo struct { + DynamicData + + Id string `xml:"id"` + Name string `xml:"name"` + Vendor string `xml:"vendor"` + Version string `xml:"version"` + Summary string `xml:"summary,omitempty"` + ReleaseDate string `xml:"releaseDate,omitempty"` +} + +func init() { + t["IoFilterInfo"] = reflect.TypeOf((*IoFilterInfo)(nil)).Elem() +} + +type IoFilterQueryIssueResult struct { + DynamicData + + OpType string `xml:"opType"` + HostIssue []IoFilterHostIssue `xml:"hostIssue,omitempty"` +} + +func init() { + t["IoFilterQueryIssueResult"] = reflect.TypeOf((*IoFilterQueryIssueResult)(nil)).Elem() +} + +type IpAddress struct { + NegatableExpression +} + +func init() { + t["IpAddress"] = reflect.TypeOf((*IpAddress)(nil)).Elem() +} + +type IpAddressProfile struct { + ApplyProfile +} + +func init() { + t["IpAddressProfile"] = reflect.TypeOf((*IpAddressProfile)(nil)).Elem() +} + +type IpHostnameGeneratorError struct { + CustomizationFault +} + +func init() { + t["IpHostnameGeneratorError"] = reflect.TypeOf((*IpHostnameGeneratorError)(nil)).Elem() +} + +type IpHostnameGeneratorErrorFault IpHostnameGeneratorError + +func init() { + t["IpHostnameGeneratorErrorFault"] = reflect.TypeOf((*IpHostnameGeneratorErrorFault)(nil)).Elem() +} + +type IpPool struct { + DynamicData + + Id int32 `xml:"id,omitempty"` + Name string `xml:"name,omitempty"` + Ipv4Config *IpPoolIpPoolConfigInfo `xml:"ipv4Config,omitempty"` + Ipv6Config *IpPoolIpPoolConfigInfo `xml:"ipv6Config,omitempty"` + DnsDomain string `xml:"dnsDomain,omitempty"` + DnsSearchPath string `xml:"dnsSearchPath,omitempty"` + HostPrefix string `xml:"hostPrefix,omitempty"` + HttpProxy string `xml:"httpProxy,omitempty"` + NetworkAssociation []IpPoolAssociation `xml:"networkAssociation,omitempty"` + AvailableIpv4Addresses int32 `xml:"availableIpv4Addresses,omitempty"` + AvailableIpv6Addresses int32 `xml:"availableIpv6Addresses,omitempty"` + AllocatedIpv4Addresses int32 `xml:"allocatedIpv4Addresses,omitempty"` + AllocatedIpv6Addresses int32 `xml:"allocatedIpv6Addresses,omitempty"` +} + +func init() { + t["IpPool"] = reflect.TypeOf((*IpPool)(nil)).Elem() +} + +type IpPoolAssociation struct { + DynamicData + + Network *ManagedObjectReference `xml:"network,omitempty"` + NetworkName string `xml:"networkName"` +} + +func init() { + t["IpPoolAssociation"] = reflect.TypeOf((*IpPoolAssociation)(nil)).Elem() +} + +type IpPoolIpPoolConfigInfo struct { + DynamicData + + SubnetAddress string `xml:"subnetAddress,omitempty"` + Netmask string `xml:"netmask,omitempty"` + Gateway string `xml:"gateway,omitempty"` + Range string `xml:"range,omitempty"` + Dns []string `xml:"dns,omitempty"` + DhcpServerAvailable *bool `xml:"dhcpServerAvailable"` + IpPoolEnabled *bool `xml:"ipPoolEnabled"` +} + +func init() { + t["IpPoolIpPoolConfigInfo"] = reflect.TypeOf((*IpPoolIpPoolConfigInfo)(nil)).Elem() +} + +type IpPoolManagerIpAllocation struct { + DynamicData + + IpAddress string `xml:"ipAddress"` + AllocationId string `xml:"allocationId"` +} + +func init() { + t["IpPoolManagerIpAllocation"] = reflect.TypeOf((*IpPoolManagerIpAllocation)(nil)).Elem() +} + +type IpRange struct { + IpAddress + + AddressPrefix string `xml:"addressPrefix"` + PrefixLength int32 `xml:"prefixLength,omitempty"` +} + +func init() { + t["IpRange"] = reflect.TypeOf((*IpRange)(nil)).Elem() +} + +type IpRouteProfile struct { + ApplyProfile + + StaticRoute []StaticRouteProfile `xml:"staticRoute,omitempty"` +} + +func init() { + t["IpRouteProfile"] = reflect.TypeOf((*IpRouteProfile)(nil)).Elem() +} + +type IsSharedGraphicsActive IsSharedGraphicsActiveRequestType + +func init() { + t["IsSharedGraphicsActive"] = reflect.TypeOf((*IsSharedGraphicsActive)(nil)).Elem() +} + +type IsSharedGraphicsActiveRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["IsSharedGraphicsActiveRequestType"] = reflect.TypeOf((*IsSharedGraphicsActiveRequestType)(nil)).Elem() +} + +type IsSharedGraphicsActiveResponse struct { + Returnval bool `xml:"returnval"` +} + +type IscsiDependencyEntity struct { + DynamicData + + PnicDevice string `xml:"pnicDevice"` + VnicDevice string `xml:"vnicDevice"` + VmhbaName string `xml:"vmhbaName"` +} + +func init() { + t["IscsiDependencyEntity"] = reflect.TypeOf((*IscsiDependencyEntity)(nil)).Elem() +} + +type IscsiFault struct { + VimFault +} + +func init() { + t["IscsiFault"] = reflect.TypeOf((*IscsiFault)(nil)).Elem() +} + +type IscsiFaultFault BaseIscsiFault + +func init() { + t["IscsiFaultFault"] = reflect.TypeOf((*IscsiFaultFault)(nil)).Elem() +} + +type IscsiFaultInvalidVnic struct { + IscsiFault + + VnicDevice string `xml:"vnicDevice"` +} + +func init() { + t["IscsiFaultInvalidVnic"] = reflect.TypeOf((*IscsiFaultInvalidVnic)(nil)).Elem() +} + +type IscsiFaultInvalidVnicFault IscsiFaultInvalidVnic + +func init() { + t["IscsiFaultInvalidVnicFault"] = reflect.TypeOf((*IscsiFaultInvalidVnicFault)(nil)).Elem() +} + +type IscsiFaultPnicInUse struct { + IscsiFault + + PnicDevice string `xml:"pnicDevice"` +} + +func init() { + t["IscsiFaultPnicInUse"] = reflect.TypeOf((*IscsiFaultPnicInUse)(nil)).Elem() +} + +type IscsiFaultPnicInUseFault IscsiFaultPnicInUse + +func init() { + t["IscsiFaultPnicInUseFault"] = reflect.TypeOf((*IscsiFaultPnicInUseFault)(nil)).Elem() +} + +type IscsiFaultVnicAlreadyBound struct { + IscsiFault + + VnicDevice string `xml:"vnicDevice"` +} + +func init() { + t["IscsiFaultVnicAlreadyBound"] = reflect.TypeOf((*IscsiFaultVnicAlreadyBound)(nil)).Elem() +} + +type IscsiFaultVnicAlreadyBoundFault IscsiFaultVnicAlreadyBound + +func init() { + t["IscsiFaultVnicAlreadyBoundFault"] = reflect.TypeOf((*IscsiFaultVnicAlreadyBoundFault)(nil)).Elem() +} + +type IscsiFaultVnicHasActivePaths struct { + IscsiFault + + VnicDevice string `xml:"vnicDevice"` +} + +func init() { + t["IscsiFaultVnicHasActivePaths"] = reflect.TypeOf((*IscsiFaultVnicHasActivePaths)(nil)).Elem() +} + +type IscsiFaultVnicHasActivePathsFault IscsiFaultVnicHasActivePaths + +func init() { + t["IscsiFaultVnicHasActivePathsFault"] = reflect.TypeOf((*IscsiFaultVnicHasActivePathsFault)(nil)).Elem() +} + +type IscsiFaultVnicHasMultipleUplinks struct { + IscsiFault + + VnicDevice string `xml:"vnicDevice"` +} + +func init() { + t["IscsiFaultVnicHasMultipleUplinks"] = reflect.TypeOf((*IscsiFaultVnicHasMultipleUplinks)(nil)).Elem() +} + +type IscsiFaultVnicHasMultipleUplinksFault IscsiFaultVnicHasMultipleUplinks + +func init() { + t["IscsiFaultVnicHasMultipleUplinksFault"] = reflect.TypeOf((*IscsiFaultVnicHasMultipleUplinksFault)(nil)).Elem() +} + +type IscsiFaultVnicHasNoUplinks struct { + IscsiFault + + VnicDevice string `xml:"vnicDevice"` +} + +func init() { + t["IscsiFaultVnicHasNoUplinks"] = reflect.TypeOf((*IscsiFaultVnicHasNoUplinks)(nil)).Elem() +} + +type IscsiFaultVnicHasNoUplinksFault IscsiFaultVnicHasNoUplinks + +func init() { + t["IscsiFaultVnicHasNoUplinksFault"] = reflect.TypeOf((*IscsiFaultVnicHasNoUplinksFault)(nil)).Elem() +} + +type IscsiFaultVnicHasWrongUplink struct { + IscsiFault + + VnicDevice string `xml:"vnicDevice"` +} + +func init() { + t["IscsiFaultVnicHasWrongUplink"] = reflect.TypeOf((*IscsiFaultVnicHasWrongUplink)(nil)).Elem() +} + +type IscsiFaultVnicHasWrongUplinkFault IscsiFaultVnicHasWrongUplink + +func init() { + t["IscsiFaultVnicHasWrongUplinkFault"] = reflect.TypeOf((*IscsiFaultVnicHasWrongUplinkFault)(nil)).Elem() +} + +type IscsiFaultVnicInUse struct { + IscsiFault + + VnicDevice string `xml:"vnicDevice"` +} + +func init() { + t["IscsiFaultVnicInUse"] = reflect.TypeOf((*IscsiFaultVnicInUse)(nil)).Elem() +} + +type IscsiFaultVnicInUseFault IscsiFaultVnicInUse + +func init() { + t["IscsiFaultVnicInUseFault"] = reflect.TypeOf((*IscsiFaultVnicInUseFault)(nil)).Elem() +} + +type IscsiFaultVnicIsLastPath struct { + IscsiFault + + VnicDevice string `xml:"vnicDevice"` +} + +func init() { + t["IscsiFaultVnicIsLastPath"] = reflect.TypeOf((*IscsiFaultVnicIsLastPath)(nil)).Elem() +} + +type IscsiFaultVnicIsLastPathFault IscsiFaultVnicIsLastPath + +func init() { + t["IscsiFaultVnicIsLastPathFault"] = reflect.TypeOf((*IscsiFaultVnicIsLastPathFault)(nil)).Elem() +} + +type IscsiFaultVnicNotBound struct { + IscsiFault + + VnicDevice string `xml:"vnicDevice"` +} + +func init() { + t["IscsiFaultVnicNotBound"] = reflect.TypeOf((*IscsiFaultVnicNotBound)(nil)).Elem() +} + +type IscsiFaultVnicNotBoundFault IscsiFaultVnicNotBound + +func init() { + t["IscsiFaultVnicNotBoundFault"] = reflect.TypeOf((*IscsiFaultVnicNotBoundFault)(nil)).Elem() +} + +type IscsiFaultVnicNotFound struct { + IscsiFault + + VnicDevice string `xml:"vnicDevice"` +} + +func init() { + t["IscsiFaultVnicNotFound"] = reflect.TypeOf((*IscsiFaultVnicNotFound)(nil)).Elem() +} + +type IscsiFaultVnicNotFoundFault IscsiFaultVnicNotFound + +func init() { + t["IscsiFaultVnicNotFoundFault"] = reflect.TypeOf((*IscsiFaultVnicNotFoundFault)(nil)).Elem() +} + +type IscsiMigrationDependency struct { + DynamicData + + MigrationAllowed bool `xml:"migrationAllowed"` + DisallowReason *IscsiStatus `xml:"disallowReason,omitempty"` + Dependency []IscsiDependencyEntity `xml:"dependency,omitempty"` +} + +func init() { + t["IscsiMigrationDependency"] = reflect.TypeOf((*IscsiMigrationDependency)(nil)).Elem() +} + +type IscsiPortInfo struct { + DynamicData + + VnicDevice string `xml:"vnicDevice,omitempty"` + Vnic *HostVirtualNic `xml:"vnic,omitempty"` + PnicDevice string `xml:"pnicDevice,omitempty"` + Pnic *PhysicalNic `xml:"pnic,omitempty"` + SwitchName string `xml:"switchName,omitempty"` + SwitchUuid string `xml:"switchUuid,omitempty"` + PortgroupName string `xml:"portgroupName,omitempty"` + PortgroupKey string `xml:"portgroupKey,omitempty"` + PortKey string `xml:"portKey,omitempty"` + ComplianceStatus *IscsiStatus `xml:"complianceStatus,omitempty"` + PathStatus string `xml:"pathStatus,omitempty"` +} + +func init() { + t["IscsiPortInfo"] = reflect.TypeOf((*IscsiPortInfo)(nil)).Elem() +} + +type IscsiStatus struct { + DynamicData + + Reason []LocalizedMethodFault `xml:"reason,omitempty"` +} + +func init() { + t["IscsiStatus"] = reflect.TypeOf((*IscsiStatus)(nil)).Elem() +} + +type IsoImageFileInfo struct { + FileInfo +} + +func init() { + t["IsoImageFileInfo"] = reflect.TypeOf((*IsoImageFileInfo)(nil)).Elem() +} + +type IsoImageFileQuery struct { + FileQuery +} + +func init() { + t["IsoImageFileQuery"] = reflect.TypeOf((*IsoImageFileQuery)(nil)).Elem() +} + +type JoinDomainRequestType struct { + This ManagedObjectReference `xml:"_this"` + DomainName string `xml:"domainName"` + UserName string `xml:"userName"` + Password string `xml:"password"` +} + +func init() { + t["JoinDomainRequestType"] = reflect.TypeOf((*JoinDomainRequestType)(nil)).Elem() +} + +type JoinDomainWithCAMRequestType struct { + This ManagedObjectReference `xml:"_this"` + DomainName string `xml:"domainName"` + CamServer string `xml:"camServer"` +} + +func init() { + t["JoinDomainWithCAMRequestType"] = reflect.TypeOf((*JoinDomainWithCAMRequestType)(nil)).Elem() +} + +type JoinDomainWithCAM_Task JoinDomainWithCAMRequestType + +func init() { + t["JoinDomainWithCAM_Task"] = reflect.TypeOf((*JoinDomainWithCAM_Task)(nil)).Elem() +} + +type JoinDomainWithCAM_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type JoinDomain_Task JoinDomainRequestType + +func init() { + t["JoinDomain_Task"] = reflect.TypeOf((*JoinDomain_Task)(nil)).Elem() +} + +type JoinDomain_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type KernelModuleInfo struct { + DynamicData + + Id int32 `xml:"id"` + Name string `xml:"name"` + Version string `xml:"version"` + Filename string `xml:"filename"` + OptionString string `xml:"optionString"` + Loaded bool `xml:"loaded"` + Enabled bool `xml:"enabled"` + UseCount int32 `xml:"useCount"` + ReadOnlySection KernelModuleSectionInfo `xml:"readOnlySection"` + WritableSection KernelModuleSectionInfo `xml:"writableSection"` + TextSection KernelModuleSectionInfo `xml:"textSection"` + DataSection KernelModuleSectionInfo `xml:"dataSection"` + BssSection KernelModuleSectionInfo `xml:"bssSection"` +} + +func init() { + t["KernelModuleInfo"] = reflect.TypeOf((*KernelModuleInfo)(nil)).Elem() +} + +type KernelModuleSectionInfo struct { + DynamicData + + Address int64 `xml:"address"` + Length int32 `xml:"length,omitempty"` +} + +func init() { + t["KernelModuleSectionInfo"] = reflect.TypeOf((*KernelModuleSectionInfo)(nil)).Elem() +} + +type KeyAnyValue struct { + DynamicData + + Key string `xml:"key"` + Value AnyType `xml:"value,typeattr"` +} + +func init() { + t["KeyAnyValue"] = reflect.TypeOf((*KeyAnyValue)(nil)).Elem() +} + +type KeyValue struct { + DynamicData + + Key string `xml:"key"` + Value string `xml:"value"` +} + +func init() { + t["KeyValue"] = reflect.TypeOf((*KeyValue)(nil)).Elem() +} + +type LargeRDMConversionNotSupported struct { + MigrationFault + + Device string `xml:"device"` +} + +func init() { + t["LargeRDMConversionNotSupported"] = reflect.TypeOf((*LargeRDMConversionNotSupported)(nil)).Elem() +} + +type LargeRDMConversionNotSupportedFault LargeRDMConversionNotSupported + +func init() { + t["LargeRDMConversionNotSupportedFault"] = reflect.TypeOf((*LargeRDMConversionNotSupportedFault)(nil)).Elem() +} + +type LargeRDMNotSupportedOnDatastore struct { + VmConfigFault + + Device string `xml:"device"` + Datastore ManagedObjectReference `xml:"datastore"` + DatastoreName string `xml:"datastoreName"` +} + +func init() { + t["LargeRDMNotSupportedOnDatastore"] = reflect.TypeOf((*LargeRDMNotSupportedOnDatastore)(nil)).Elem() +} + +type LargeRDMNotSupportedOnDatastoreFault LargeRDMNotSupportedOnDatastore + +func init() { + t["LargeRDMNotSupportedOnDatastoreFault"] = reflect.TypeOf((*LargeRDMNotSupportedOnDatastoreFault)(nil)).Elem() +} + +type LatencySensitivity struct { + DynamicData + + Level LatencySensitivitySensitivityLevel `xml:"level"` + Sensitivity int32 `xml:"sensitivity,omitempty"` +} + +func init() { + t["LatencySensitivity"] = reflect.TypeOf((*LatencySensitivity)(nil)).Elem() +} + +type LeaveCurrentDomainRequestType struct { + This ManagedObjectReference `xml:"_this"` + Force bool `xml:"force"` +} + +func init() { + t["LeaveCurrentDomainRequestType"] = reflect.TypeOf((*LeaveCurrentDomainRequestType)(nil)).Elem() +} + +type LeaveCurrentDomain_Task LeaveCurrentDomainRequestType + +func init() { + t["LeaveCurrentDomain_Task"] = reflect.TypeOf((*LeaveCurrentDomain_Task)(nil)).Elem() +} + +type LeaveCurrentDomain_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type LegacyNetworkInterfaceInUse struct { + CannotAccessNetwork +} + +func init() { + t["LegacyNetworkInterfaceInUse"] = reflect.TypeOf((*LegacyNetworkInterfaceInUse)(nil)).Elem() +} + +type LegacyNetworkInterfaceInUseFault LegacyNetworkInterfaceInUse + +func init() { + t["LegacyNetworkInterfaceInUseFault"] = reflect.TypeOf((*LegacyNetworkInterfaceInUseFault)(nil)).Elem() +} + +type LicenseAssignmentFailed struct { + RuntimeFault + + Reason string `xml:"reason,omitempty"` +} + +func init() { + t["LicenseAssignmentFailed"] = reflect.TypeOf((*LicenseAssignmentFailed)(nil)).Elem() +} + +type LicenseAssignmentFailedFault LicenseAssignmentFailed + +func init() { + t["LicenseAssignmentFailedFault"] = reflect.TypeOf((*LicenseAssignmentFailedFault)(nil)).Elem() +} + +type LicenseAssignmentManagerLicenseAssignment struct { + DynamicData + + EntityId string `xml:"entityId"` + Scope string `xml:"scope,omitempty"` + EntityDisplayName string `xml:"entityDisplayName,omitempty"` + AssignedLicense LicenseManagerLicenseInfo `xml:"assignedLicense"` + Properties []KeyAnyValue `xml:"properties,omitempty"` +} + +func init() { + t["LicenseAssignmentManagerLicenseAssignment"] = reflect.TypeOf((*LicenseAssignmentManagerLicenseAssignment)(nil)).Elem() +} + +type LicenseAvailabilityInfo struct { + DynamicData + + Feature LicenseFeatureInfo `xml:"feature"` + Total int32 `xml:"total"` + Available int32 `xml:"available"` +} + +func init() { + t["LicenseAvailabilityInfo"] = reflect.TypeOf((*LicenseAvailabilityInfo)(nil)).Elem() +} + +type LicenseDiagnostics struct { + DynamicData + + SourceLastChanged time.Time `xml:"sourceLastChanged"` + SourceLost string `xml:"sourceLost"` + SourceLatency float32 `xml:"sourceLatency"` + LicenseRequests string `xml:"licenseRequests"` + LicenseRequestFailures string `xml:"licenseRequestFailures"` + LicenseFeatureUnknowns string `xml:"licenseFeatureUnknowns"` + OpState LicenseManagerState `xml:"opState"` + LastStatusUpdate time.Time `xml:"lastStatusUpdate"` + OpFailureMessage string `xml:"opFailureMessage"` +} + +func init() { + t["LicenseDiagnostics"] = reflect.TypeOf((*LicenseDiagnostics)(nil)).Elem() +} + +type LicenseDowngradeDisallowed struct { + NotEnoughLicenses + + Edition string `xml:"edition"` + EntityId string `xml:"entityId"` + Features []KeyAnyValue `xml:"features"` +} + +func init() { + t["LicenseDowngradeDisallowed"] = reflect.TypeOf((*LicenseDowngradeDisallowed)(nil)).Elem() +} + +type LicenseDowngradeDisallowedFault LicenseDowngradeDisallowed + +func init() { + t["LicenseDowngradeDisallowedFault"] = reflect.TypeOf((*LicenseDowngradeDisallowedFault)(nil)).Elem() +} + +type LicenseEntityNotFound struct { + VimFault + + EntityId string `xml:"entityId"` +} + +func init() { + t["LicenseEntityNotFound"] = reflect.TypeOf((*LicenseEntityNotFound)(nil)).Elem() +} + +type LicenseEntityNotFoundFault LicenseEntityNotFound + +func init() { + t["LicenseEntityNotFoundFault"] = reflect.TypeOf((*LicenseEntityNotFoundFault)(nil)).Elem() +} + +type LicenseEvent struct { + Event +} + +func init() { + t["LicenseEvent"] = reflect.TypeOf((*LicenseEvent)(nil)).Elem() +} + +type LicenseExpired struct { + NotEnoughLicenses + + LicenseKey string `xml:"licenseKey"` +} + +func init() { + t["LicenseExpired"] = reflect.TypeOf((*LicenseExpired)(nil)).Elem() +} + +type LicenseExpiredEvent struct { + Event + + Feature LicenseFeatureInfo `xml:"feature"` +} + +func init() { + t["LicenseExpiredEvent"] = reflect.TypeOf((*LicenseExpiredEvent)(nil)).Elem() +} + +type LicenseExpiredFault LicenseExpired + +func init() { + t["LicenseExpiredFault"] = reflect.TypeOf((*LicenseExpiredFault)(nil)).Elem() +} + +type LicenseFeatureInfo struct { + DynamicData + + Key string `xml:"key"` + FeatureName string `xml:"featureName"` + FeatureDescription string `xml:"featureDescription,omitempty"` + State LicenseFeatureInfoState `xml:"state,omitempty"` + CostUnit string `xml:"costUnit"` + SourceRestriction string `xml:"sourceRestriction,omitempty"` + DependentKey []string `xml:"dependentKey,omitempty"` + Edition *bool `xml:"edition"` + ExpiresOn *time.Time `xml:"expiresOn"` +} + +func init() { + t["LicenseFeatureInfo"] = reflect.TypeOf((*LicenseFeatureInfo)(nil)).Elem() +} + +type LicenseKeyEntityMismatch struct { + NotEnoughLicenses +} + +func init() { + t["LicenseKeyEntityMismatch"] = reflect.TypeOf((*LicenseKeyEntityMismatch)(nil)).Elem() +} + +type LicenseKeyEntityMismatchFault LicenseKeyEntityMismatch + +func init() { + t["LicenseKeyEntityMismatchFault"] = reflect.TypeOf((*LicenseKeyEntityMismatchFault)(nil)).Elem() +} + +type LicenseManagerEvaluationInfo struct { + DynamicData + + Properties []KeyAnyValue `xml:"properties"` +} + +func init() { + t["LicenseManagerEvaluationInfo"] = reflect.TypeOf((*LicenseManagerEvaluationInfo)(nil)).Elem() +} + +type LicenseManagerLicenseInfo struct { + DynamicData + + LicenseKey string `xml:"licenseKey"` + EditionKey string `xml:"editionKey"` + Name string `xml:"name"` + Total int32 `xml:"total"` + Used int32 `xml:"used,omitempty"` + CostUnit string `xml:"costUnit"` + Properties []KeyAnyValue `xml:"properties,omitempty"` + Labels []KeyValue `xml:"labels,omitempty"` +} + +func init() { + t["LicenseManagerLicenseInfo"] = reflect.TypeOf((*LicenseManagerLicenseInfo)(nil)).Elem() +} + +type LicenseNonComplianceEvent struct { + LicenseEvent + + Url string `xml:"url"` +} + +func init() { + t["LicenseNonComplianceEvent"] = reflect.TypeOf((*LicenseNonComplianceEvent)(nil)).Elem() +} + +type LicenseReservationInfo struct { + DynamicData + + Key string `xml:"key"` + State LicenseReservationInfoState `xml:"state"` + Required int32 `xml:"required"` +} + +func init() { + t["LicenseReservationInfo"] = reflect.TypeOf((*LicenseReservationInfo)(nil)).Elem() +} + +type LicenseRestricted struct { + NotEnoughLicenses +} + +func init() { + t["LicenseRestricted"] = reflect.TypeOf((*LicenseRestricted)(nil)).Elem() +} + +type LicenseRestrictedEvent struct { + LicenseEvent +} + +func init() { + t["LicenseRestrictedEvent"] = reflect.TypeOf((*LicenseRestrictedEvent)(nil)).Elem() +} + +type LicenseRestrictedFault LicenseRestricted + +func init() { + t["LicenseRestrictedFault"] = reflect.TypeOf((*LicenseRestrictedFault)(nil)).Elem() +} + +type LicenseServerAvailableEvent struct { + LicenseEvent + + LicenseServer string `xml:"licenseServer"` +} + +func init() { + t["LicenseServerAvailableEvent"] = reflect.TypeOf((*LicenseServerAvailableEvent)(nil)).Elem() +} + +type LicenseServerSource struct { + LicenseSource + + LicenseServer string `xml:"licenseServer"` +} + +func init() { + t["LicenseServerSource"] = reflect.TypeOf((*LicenseServerSource)(nil)).Elem() +} + +type LicenseServerUnavailable struct { + VimFault + + LicenseServer string `xml:"licenseServer"` +} + +func init() { + t["LicenseServerUnavailable"] = reflect.TypeOf((*LicenseServerUnavailable)(nil)).Elem() +} + +type LicenseServerUnavailableEvent struct { + LicenseEvent + + LicenseServer string `xml:"licenseServer"` +} + +func init() { + t["LicenseServerUnavailableEvent"] = reflect.TypeOf((*LicenseServerUnavailableEvent)(nil)).Elem() +} + +type LicenseServerUnavailableFault LicenseServerUnavailable + +func init() { + t["LicenseServerUnavailableFault"] = reflect.TypeOf((*LicenseServerUnavailableFault)(nil)).Elem() +} + +type LicenseSource struct { + DynamicData +} + +func init() { + t["LicenseSource"] = reflect.TypeOf((*LicenseSource)(nil)).Elem() +} + +type LicenseSourceUnavailable struct { + NotEnoughLicenses + + LicenseSource BaseLicenseSource `xml:"licenseSource,typeattr"` +} + +func init() { + t["LicenseSourceUnavailable"] = reflect.TypeOf((*LicenseSourceUnavailable)(nil)).Elem() +} + +type LicenseSourceUnavailableFault LicenseSourceUnavailable + +func init() { + t["LicenseSourceUnavailableFault"] = reflect.TypeOf((*LicenseSourceUnavailableFault)(nil)).Elem() +} + +type LicenseUsageInfo struct { + DynamicData + + Source BaseLicenseSource `xml:"source,typeattr"` + SourceAvailable bool `xml:"sourceAvailable"` + ReservationInfo []LicenseReservationInfo `xml:"reservationInfo,omitempty"` + FeatureInfo []LicenseFeatureInfo `xml:"featureInfo,omitempty"` +} + +func init() { + t["LicenseUsageInfo"] = reflect.TypeOf((*LicenseUsageInfo)(nil)).Elem() +} + +type LimitExceeded struct { + VimFault + + Property string `xml:"property,omitempty"` + Limit int32 `xml:"limit,omitempty"` +} + +func init() { + t["LimitExceeded"] = reflect.TypeOf((*LimitExceeded)(nil)).Elem() +} + +type LimitExceededFault LimitExceeded + +func init() { + t["LimitExceededFault"] = reflect.TypeOf((*LimitExceededFault)(nil)).Elem() +} + +type LinkDiscoveryProtocolConfig struct { + DynamicData + + Protocol string `xml:"protocol"` + Operation string `xml:"operation"` +} + +func init() { + t["LinkDiscoveryProtocolConfig"] = reflect.TypeOf((*LinkDiscoveryProtocolConfig)(nil)).Elem() +} + +type LinkLayerDiscoveryProtocolInfo struct { + DynamicData + + ChassisId string `xml:"chassisId"` + PortId string `xml:"portId"` + TimeToLive int32 `xml:"timeToLive"` + Parameter []KeyAnyValue `xml:"parameter,omitempty"` +} + +func init() { + t["LinkLayerDiscoveryProtocolInfo"] = reflect.TypeOf((*LinkLayerDiscoveryProtocolInfo)(nil)).Elem() +} + +type LinkProfile struct { + ApplyProfile +} + +func init() { + t["LinkProfile"] = reflect.TypeOf((*LinkProfile)(nil)).Elem() +} + +type LinuxVolumeNotClean struct { + CustomizationFault +} + +func init() { + t["LinuxVolumeNotClean"] = reflect.TypeOf((*LinuxVolumeNotClean)(nil)).Elem() +} + +type LinuxVolumeNotCleanFault LinuxVolumeNotClean + +func init() { + t["LinuxVolumeNotCleanFault"] = reflect.TypeOf((*LinuxVolumeNotCleanFault)(nil)).Elem() +} + +type ListCACertificateRevocationLists ListCACertificateRevocationListsRequestType + +func init() { + t["ListCACertificateRevocationLists"] = reflect.TypeOf((*ListCACertificateRevocationLists)(nil)).Elem() +} + +type ListCACertificateRevocationListsRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["ListCACertificateRevocationListsRequestType"] = reflect.TypeOf((*ListCACertificateRevocationListsRequestType)(nil)).Elem() +} + +type ListCACertificateRevocationListsResponse struct { + Returnval []string `xml:"returnval,omitempty"` +} + +type ListCACertificates ListCACertificatesRequestType + +func init() { + t["ListCACertificates"] = reflect.TypeOf((*ListCACertificates)(nil)).Elem() +} + +type ListCACertificatesRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["ListCACertificatesRequestType"] = reflect.TypeOf((*ListCACertificatesRequestType)(nil)).Elem() +} + +type ListCACertificatesResponse struct { + Returnval []string `xml:"returnval,omitempty"` +} + +type ListFilesInGuest ListFilesInGuestRequestType + +func init() { + t["ListFilesInGuest"] = reflect.TypeOf((*ListFilesInGuest)(nil)).Elem() +} + +type ListFilesInGuestRequestType struct { + This ManagedObjectReference `xml:"_this"` + Vm ManagedObjectReference `xml:"vm"` + Auth BaseGuestAuthentication `xml:"auth,typeattr"` + FilePath string `xml:"filePath"` + Index int32 `xml:"index,omitempty"` + MaxResults int32 `xml:"maxResults,omitempty"` + MatchPattern string `xml:"matchPattern,omitempty"` +} + +func init() { + t["ListFilesInGuestRequestType"] = reflect.TypeOf((*ListFilesInGuestRequestType)(nil)).Elem() +} + +type ListFilesInGuestResponse struct { + Returnval GuestListFileInfo `xml:"returnval"` +} + +type ListGuestAliases ListGuestAliasesRequestType + +func init() { + t["ListGuestAliases"] = reflect.TypeOf((*ListGuestAliases)(nil)).Elem() +} + +type ListGuestAliasesRequestType struct { + This ManagedObjectReference `xml:"_this"` + Vm ManagedObjectReference `xml:"vm"` + Auth BaseGuestAuthentication `xml:"auth,typeattr"` + Username string `xml:"username"` +} + +func init() { + t["ListGuestAliasesRequestType"] = reflect.TypeOf((*ListGuestAliasesRequestType)(nil)).Elem() +} + +type ListGuestAliasesResponse struct { + Returnval []GuestAliases `xml:"returnval,omitempty"` +} + +type ListGuestMappedAliases ListGuestMappedAliasesRequestType + +func init() { + t["ListGuestMappedAliases"] = reflect.TypeOf((*ListGuestMappedAliases)(nil)).Elem() +} + +type ListGuestMappedAliasesRequestType struct { + This ManagedObjectReference `xml:"_this"` + Vm ManagedObjectReference `xml:"vm"` + Auth BaseGuestAuthentication `xml:"auth,typeattr"` +} + +func init() { + t["ListGuestMappedAliasesRequestType"] = reflect.TypeOf((*ListGuestMappedAliasesRequestType)(nil)).Elem() +} + +type ListGuestMappedAliasesResponse struct { + Returnval []GuestMappedAliases `xml:"returnval,omitempty"` +} + +type ListProcessesInGuest ListProcessesInGuestRequestType + +func init() { + t["ListProcessesInGuest"] = reflect.TypeOf((*ListProcessesInGuest)(nil)).Elem() +} + +type ListProcessesInGuestRequestType struct { + This ManagedObjectReference `xml:"_this"` + Vm ManagedObjectReference `xml:"vm"` + Auth BaseGuestAuthentication `xml:"auth,typeattr"` + Pids []int64 `xml:"pids,omitempty"` +} + +func init() { + t["ListProcessesInGuestRequestType"] = reflect.TypeOf((*ListProcessesInGuestRequestType)(nil)).Elem() +} + +type ListProcessesInGuestResponse struct { + Returnval []GuestProcessInfo `xml:"returnval,omitempty"` +} + +type ListRegistryKeysInGuest ListRegistryKeysInGuestRequestType + +func init() { + t["ListRegistryKeysInGuest"] = reflect.TypeOf((*ListRegistryKeysInGuest)(nil)).Elem() +} + +type ListRegistryKeysInGuestRequestType struct { + This ManagedObjectReference `xml:"_this"` + Vm ManagedObjectReference `xml:"vm"` + Auth BaseGuestAuthentication `xml:"auth,typeattr"` + KeyName GuestRegKeyNameSpec `xml:"keyName"` + Recursive bool `xml:"recursive"` + MatchPattern string `xml:"matchPattern,omitempty"` +} + +func init() { + t["ListRegistryKeysInGuestRequestType"] = reflect.TypeOf((*ListRegistryKeysInGuestRequestType)(nil)).Elem() +} + +type ListRegistryKeysInGuestResponse struct { + Returnval []GuestRegKeyRecordSpec `xml:"returnval,omitempty"` +} + +type ListRegistryValuesInGuest ListRegistryValuesInGuestRequestType + +func init() { + t["ListRegistryValuesInGuest"] = reflect.TypeOf((*ListRegistryValuesInGuest)(nil)).Elem() +} + +type ListRegistryValuesInGuestRequestType struct { + This ManagedObjectReference `xml:"_this"` + Vm ManagedObjectReference `xml:"vm"` + Auth BaseGuestAuthentication `xml:"auth,typeattr"` + KeyName GuestRegKeyNameSpec `xml:"keyName"` + ExpandStrings bool `xml:"expandStrings"` + MatchPattern string `xml:"matchPattern,omitempty"` +} + +func init() { + t["ListRegistryValuesInGuestRequestType"] = reflect.TypeOf((*ListRegistryValuesInGuestRequestType)(nil)).Elem() +} + +type ListRegistryValuesInGuestResponse struct { + Returnval []GuestRegValueSpec `xml:"returnval,omitempty"` +} + +type ListSmartCardTrustAnchors ListSmartCardTrustAnchorsRequestType + +func init() { + t["ListSmartCardTrustAnchors"] = reflect.TypeOf((*ListSmartCardTrustAnchors)(nil)).Elem() +} + +type ListSmartCardTrustAnchorsRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["ListSmartCardTrustAnchorsRequestType"] = reflect.TypeOf((*ListSmartCardTrustAnchorsRequestType)(nil)).Elem() +} + +type ListSmartCardTrustAnchorsResponse struct { + Returnval []string `xml:"returnval,omitempty"` +} + +type LocalDatastoreCreatedEvent struct { + HostEvent + + Datastore DatastoreEventArgument `xml:"datastore"` +} + +func init() { + t["LocalDatastoreCreatedEvent"] = reflect.TypeOf((*LocalDatastoreCreatedEvent)(nil)).Elem() +} + +type LocalDatastoreInfo struct { + DatastoreInfo + + Path string `xml:"path,omitempty"` +} + +func init() { + t["LocalDatastoreInfo"] = reflect.TypeOf((*LocalDatastoreInfo)(nil)).Elem() +} + +type LocalLicenseSource struct { + LicenseSource + + LicenseKeys string `xml:"licenseKeys"` +} + +func init() { + t["LocalLicenseSource"] = reflect.TypeOf((*LocalLicenseSource)(nil)).Elem() +} + +type LocalTSMEnabledEvent struct { + HostEvent +} + +func init() { + t["LocalTSMEnabledEvent"] = reflect.TypeOf((*LocalTSMEnabledEvent)(nil)).Elem() +} + +type LocalizableMessage struct { + DynamicData + + Key string `xml:"key"` + Arg []KeyAnyValue `xml:"arg,omitempty"` + Message string `xml:"message,omitempty"` +} + +func init() { + t["LocalizableMessage"] = reflect.TypeOf((*LocalizableMessage)(nil)).Elem() +} + +type LocalizationManagerMessageCatalog struct { + DynamicData + + ModuleName string `xml:"moduleName"` + CatalogName string `xml:"catalogName"` + Locale string `xml:"locale"` + CatalogUri string `xml:"catalogUri"` + LastModified *time.Time `xml:"lastModified"` + Md5sum string `xml:"md5sum,omitempty"` + Version string `xml:"version,omitempty"` +} + +func init() { + t["LocalizationManagerMessageCatalog"] = reflect.TypeOf((*LocalizationManagerMessageCatalog)(nil)).Elem() +} + +type LocalizedMethodFault struct { + DynamicData + + Fault BaseMethodFault `xml:"fault,typeattr"` + LocalizedMessage string `xml:"localizedMessage,omitempty"` +} + +func init() { + t["LocalizedMethodFault"] = reflect.TypeOf((*LocalizedMethodFault)(nil)).Elem() +} + +type LockerMisconfiguredEvent struct { + Event + + Datastore DatastoreEventArgument `xml:"datastore"` +} + +func init() { + t["LockerMisconfiguredEvent"] = reflect.TypeOf((*LockerMisconfiguredEvent)(nil)).Elem() +} + +type LockerReconfiguredEvent struct { + Event + + OldDatastore *DatastoreEventArgument `xml:"oldDatastore,omitempty"` + NewDatastore *DatastoreEventArgument `xml:"newDatastore,omitempty"` +} + +func init() { + t["LockerReconfiguredEvent"] = reflect.TypeOf((*LockerReconfiguredEvent)(nil)).Elem() +} + +type LogBundlingFailed struct { + VimFault +} + +func init() { + t["LogBundlingFailed"] = reflect.TypeOf((*LogBundlingFailed)(nil)).Elem() +} + +type LogBundlingFailedFault LogBundlingFailed + +func init() { + t["LogBundlingFailedFault"] = reflect.TypeOf((*LogBundlingFailedFault)(nil)).Elem() +} + +type LogUserEvent LogUserEventRequestType + +func init() { + t["LogUserEvent"] = reflect.TypeOf((*LogUserEvent)(nil)).Elem() +} + +type LogUserEventRequestType struct { + This ManagedObjectReference `xml:"_this"` + Entity ManagedObjectReference `xml:"entity"` + Msg string `xml:"msg"` +} + +func init() { + t["LogUserEventRequestType"] = reflect.TypeOf((*LogUserEventRequestType)(nil)).Elem() +} + +type LogUserEventResponse struct { +} + +type Login LoginRequestType + +func init() { + t["Login"] = reflect.TypeOf((*Login)(nil)).Elem() +} + +type LoginBySSPI LoginBySSPIRequestType + +func init() { + t["LoginBySSPI"] = reflect.TypeOf((*LoginBySSPI)(nil)).Elem() +} + +type LoginBySSPIRequestType struct { + This ManagedObjectReference `xml:"_this"` + Base64Token string `xml:"base64Token"` + Locale string `xml:"locale,omitempty"` +} + +func init() { + t["LoginBySSPIRequestType"] = reflect.TypeOf((*LoginBySSPIRequestType)(nil)).Elem() +} + +type LoginBySSPIResponse struct { + Returnval UserSession `xml:"returnval"` +} + +type LoginByToken LoginByTokenRequestType + +func init() { + t["LoginByToken"] = reflect.TypeOf((*LoginByToken)(nil)).Elem() +} + +type LoginByTokenRequestType struct { + This ManagedObjectReference `xml:"_this"` + Locale string `xml:"locale,omitempty"` +} + +func init() { + t["LoginByTokenRequestType"] = reflect.TypeOf((*LoginByTokenRequestType)(nil)).Elem() +} + +type LoginByTokenResponse struct { + Returnval UserSession `xml:"returnval"` +} + +type LoginExtensionByCertificate LoginExtensionByCertificateRequestType + +func init() { + t["LoginExtensionByCertificate"] = reflect.TypeOf((*LoginExtensionByCertificate)(nil)).Elem() +} + +type LoginExtensionByCertificateRequestType struct { + This ManagedObjectReference `xml:"_this"` + ExtensionKey string `xml:"extensionKey"` + Locale string `xml:"locale,omitempty"` +} + +func init() { + t["LoginExtensionByCertificateRequestType"] = reflect.TypeOf((*LoginExtensionByCertificateRequestType)(nil)).Elem() +} + +type LoginExtensionByCertificateResponse struct { + Returnval UserSession `xml:"returnval"` +} + +type LoginExtensionBySubjectName LoginExtensionBySubjectNameRequestType + +func init() { + t["LoginExtensionBySubjectName"] = reflect.TypeOf((*LoginExtensionBySubjectName)(nil)).Elem() +} + +type LoginExtensionBySubjectNameRequestType struct { + This ManagedObjectReference `xml:"_this"` + ExtensionKey string `xml:"extensionKey"` + Locale string `xml:"locale,omitempty"` +} + +func init() { + t["LoginExtensionBySubjectNameRequestType"] = reflect.TypeOf((*LoginExtensionBySubjectNameRequestType)(nil)).Elem() +} + +type LoginExtensionBySubjectNameResponse struct { + Returnval UserSession `xml:"returnval"` +} + +type LoginRequestType struct { + This ManagedObjectReference `xml:"_this"` + UserName string `xml:"userName"` + Password string `xml:"password"` + Locale string `xml:"locale,omitempty"` +} + +func init() { + t["LoginRequestType"] = reflect.TypeOf((*LoginRequestType)(nil)).Elem() +} + +type LoginResponse struct { + Returnval UserSession `xml:"returnval"` +} + +type Logout LogoutRequestType + +func init() { + t["Logout"] = reflect.TypeOf((*Logout)(nil)).Elem() +} + +type LogoutRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["LogoutRequestType"] = reflect.TypeOf((*LogoutRequestType)(nil)).Elem() +} + +type LogoutResponse struct { +} + +type LongOption struct { + OptionType + + Min int64 `xml:"min"` + Max int64 `xml:"max"` + DefaultValue int64 `xml:"defaultValue"` +} + +func init() { + t["LongOption"] = reflect.TypeOf((*LongOption)(nil)).Elem() +} + +type LongPolicy struct { + InheritablePolicy + + Value int64 `xml:"value,omitempty"` +} + +func init() { + t["LongPolicy"] = reflect.TypeOf((*LongPolicy)(nil)).Elem() +} + +type LookupDvPortGroup LookupDvPortGroupRequestType + +func init() { + t["LookupDvPortGroup"] = reflect.TypeOf((*LookupDvPortGroup)(nil)).Elem() +} + +type LookupDvPortGroupRequestType struct { + This ManagedObjectReference `xml:"_this"` + PortgroupKey string `xml:"portgroupKey"` +} + +func init() { + t["LookupDvPortGroupRequestType"] = reflect.TypeOf((*LookupDvPortGroupRequestType)(nil)).Elem() +} + +type LookupDvPortGroupResponse struct { + Returnval *ManagedObjectReference `xml:"returnval,omitempty"` +} + +type LookupVmOverheadMemory LookupVmOverheadMemoryRequestType + +func init() { + t["LookupVmOverheadMemory"] = reflect.TypeOf((*LookupVmOverheadMemory)(nil)).Elem() +} + +type LookupVmOverheadMemoryRequestType struct { + This ManagedObjectReference `xml:"_this"` + Vm ManagedObjectReference `xml:"vm"` + Host ManagedObjectReference `xml:"host"` +} + +func init() { + t["LookupVmOverheadMemoryRequestType"] = reflect.TypeOf((*LookupVmOverheadMemoryRequestType)(nil)).Elem() +} + +type LookupVmOverheadMemoryResponse struct { + Returnval int64 `xml:"returnval"` +} + +type MacAddress struct { + NegatableExpression +} + +func init() { + t["MacAddress"] = reflect.TypeOf((*MacAddress)(nil)).Elem() +} + +type MacRange struct { + MacAddress + + Address string `xml:"address"` + Mask string `xml:"mask"` +} + +func init() { + t["MacRange"] = reflect.TypeOf((*MacRange)(nil)).Elem() +} + +type MaintenanceModeFileMove struct { + MigrationFault +} + +func init() { + t["MaintenanceModeFileMove"] = reflect.TypeOf((*MaintenanceModeFileMove)(nil)).Elem() +} + +type MaintenanceModeFileMoveFault MaintenanceModeFileMove + +func init() { + t["MaintenanceModeFileMoveFault"] = reflect.TypeOf((*MaintenanceModeFileMoveFault)(nil)).Elem() +} + +type MakeDirectory MakeDirectoryRequestType + +func init() { + t["MakeDirectory"] = reflect.TypeOf((*MakeDirectory)(nil)).Elem() +} + +type MakeDirectoryInGuest MakeDirectoryInGuestRequestType + +func init() { + t["MakeDirectoryInGuest"] = reflect.TypeOf((*MakeDirectoryInGuest)(nil)).Elem() +} + +type MakeDirectoryInGuestRequestType struct { + This ManagedObjectReference `xml:"_this"` + Vm ManagedObjectReference `xml:"vm"` + Auth BaseGuestAuthentication `xml:"auth,typeattr"` + DirectoryPath string `xml:"directoryPath"` + CreateParentDirectories bool `xml:"createParentDirectories"` +} + +func init() { + t["MakeDirectoryInGuestRequestType"] = reflect.TypeOf((*MakeDirectoryInGuestRequestType)(nil)).Elem() +} + +type MakeDirectoryInGuestResponse struct { +} + +type MakeDirectoryRequestType struct { + This ManagedObjectReference `xml:"_this"` + Name string `xml:"name"` + Datacenter *ManagedObjectReference `xml:"datacenter,omitempty"` + CreateParentDirectories *bool `xml:"createParentDirectories"` +} + +func init() { + t["MakeDirectoryRequestType"] = reflect.TypeOf((*MakeDirectoryRequestType)(nil)).Elem() +} + +type MakeDirectoryResponse struct { +} + +type MakePrimaryVMRequestType struct { + This ManagedObjectReference `xml:"_this"` + Vm ManagedObjectReference `xml:"vm"` +} + +func init() { + t["MakePrimaryVMRequestType"] = reflect.TypeOf((*MakePrimaryVMRequestType)(nil)).Elem() +} + +type MakePrimaryVM_Task MakePrimaryVMRequestType + +func init() { + t["MakePrimaryVM_Task"] = reflect.TypeOf((*MakePrimaryVM_Task)(nil)).Elem() +} + +type MakePrimaryVM_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type ManagedByInfo struct { + DynamicData + + ExtensionKey string `xml:"extensionKey"` + Type string `xml:"type"` +} + +func init() { + t["ManagedByInfo"] = reflect.TypeOf((*ManagedByInfo)(nil)).Elem() +} + +type ManagedEntityEventArgument struct { + EntityEventArgument + + Entity ManagedObjectReference `xml:"entity"` +} + +func init() { + t["ManagedEntityEventArgument"] = reflect.TypeOf((*ManagedEntityEventArgument)(nil)).Elem() +} + +type ManagedObjectNotFound struct { + RuntimeFault + + Obj ManagedObjectReference `xml:"obj"` +} + +func init() { + t["ManagedObjectNotFound"] = reflect.TypeOf((*ManagedObjectNotFound)(nil)).Elem() +} + +type ManagedObjectNotFoundFault ManagedObjectNotFound + +func init() { + t["ManagedObjectNotFoundFault"] = reflect.TypeOf((*ManagedObjectNotFoundFault)(nil)).Elem() +} + +type ManagedObjectReference struct { + Type string `xml:"type,attr"` + Value string `xml:",chardata"` +} + +func init() { + t["ManagedObjectReference"] = reflect.TypeOf((*ManagedObjectReference)(nil)).Elem() +} + +type MarkAsLocalRequestType struct { + This ManagedObjectReference `xml:"_this"` + ScsiDiskUuid string `xml:"scsiDiskUuid"` +} + +func init() { + t["MarkAsLocalRequestType"] = reflect.TypeOf((*MarkAsLocalRequestType)(nil)).Elem() +} + +type MarkAsLocal_Task MarkAsLocalRequestType + +func init() { + t["MarkAsLocal_Task"] = reflect.TypeOf((*MarkAsLocal_Task)(nil)).Elem() +} + +type MarkAsLocal_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type MarkAsNonLocalRequestType struct { + This ManagedObjectReference `xml:"_this"` + ScsiDiskUuid string `xml:"scsiDiskUuid"` +} + +func init() { + t["MarkAsNonLocalRequestType"] = reflect.TypeOf((*MarkAsNonLocalRequestType)(nil)).Elem() +} + +type MarkAsNonLocal_Task MarkAsNonLocalRequestType + +func init() { + t["MarkAsNonLocal_Task"] = reflect.TypeOf((*MarkAsNonLocal_Task)(nil)).Elem() +} + +type MarkAsNonLocal_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type MarkAsNonSsdRequestType struct { + This ManagedObjectReference `xml:"_this"` + ScsiDiskUuid string `xml:"scsiDiskUuid"` +} + +func init() { + t["MarkAsNonSsdRequestType"] = reflect.TypeOf((*MarkAsNonSsdRequestType)(nil)).Elem() +} + +type MarkAsNonSsd_Task MarkAsNonSsdRequestType + +func init() { + t["MarkAsNonSsd_Task"] = reflect.TypeOf((*MarkAsNonSsd_Task)(nil)).Elem() +} + +type MarkAsNonSsd_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type MarkAsSsdRequestType struct { + This ManagedObjectReference `xml:"_this"` + ScsiDiskUuid string `xml:"scsiDiskUuid"` +} + +func init() { + t["MarkAsSsdRequestType"] = reflect.TypeOf((*MarkAsSsdRequestType)(nil)).Elem() +} + +type MarkAsSsd_Task MarkAsSsdRequestType + +func init() { + t["MarkAsSsd_Task"] = reflect.TypeOf((*MarkAsSsd_Task)(nil)).Elem() +} + +type MarkAsSsd_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type MarkAsTemplate MarkAsTemplateRequestType + +func init() { + t["MarkAsTemplate"] = reflect.TypeOf((*MarkAsTemplate)(nil)).Elem() +} + +type MarkAsTemplateRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["MarkAsTemplateRequestType"] = reflect.TypeOf((*MarkAsTemplateRequestType)(nil)).Elem() +} + +type MarkAsTemplateResponse struct { +} + +type MarkAsVirtualMachine MarkAsVirtualMachineRequestType + +func init() { + t["MarkAsVirtualMachine"] = reflect.TypeOf((*MarkAsVirtualMachine)(nil)).Elem() +} + +type MarkAsVirtualMachineRequestType struct { + This ManagedObjectReference `xml:"_this"` + Pool ManagedObjectReference `xml:"pool"` + Host *ManagedObjectReference `xml:"host,omitempty"` +} + +func init() { + t["MarkAsVirtualMachineRequestType"] = reflect.TypeOf((*MarkAsVirtualMachineRequestType)(nil)).Elem() +} + +type MarkAsVirtualMachineResponse struct { +} + +type MarkForRemoval MarkForRemovalRequestType + +func init() { + t["MarkForRemoval"] = reflect.TypeOf((*MarkForRemoval)(nil)).Elem() +} + +type MarkForRemovalRequestType struct { + This ManagedObjectReference `xml:"_this"` + HbaName string `xml:"hbaName"` + Remove bool `xml:"remove"` +} + +func init() { + t["MarkForRemovalRequestType"] = reflect.TypeOf((*MarkForRemovalRequestType)(nil)).Elem() +} + +type MarkForRemovalResponse struct { +} + +type MemoryFileFormatNotSupportedByDatastore struct { + UnsupportedDatastore + + DatastoreName string `xml:"datastoreName"` + Type string `xml:"type"` +} + +func init() { + t["MemoryFileFormatNotSupportedByDatastore"] = reflect.TypeOf((*MemoryFileFormatNotSupportedByDatastore)(nil)).Elem() +} + +type MemoryFileFormatNotSupportedByDatastoreFault MemoryFileFormatNotSupportedByDatastore + +func init() { + t["MemoryFileFormatNotSupportedByDatastoreFault"] = reflect.TypeOf((*MemoryFileFormatNotSupportedByDatastoreFault)(nil)).Elem() +} + +type MemoryHotPlugNotSupported struct { + VmConfigFault +} + +func init() { + t["MemoryHotPlugNotSupported"] = reflect.TypeOf((*MemoryHotPlugNotSupported)(nil)).Elem() +} + +type MemoryHotPlugNotSupportedFault MemoryHotPlugNotSupported + +func init() { + t["MemoryHotPlugNotSupportedFault"] = reflect.TypeOf((*MemoryHotPlugNotSupportedFault)(nil)).Elem() +} + +type MemorySizeNotRecommended struct { + VirtualHardwareCompatibilityIssue + + MemorySizeMB int32 `xml:"memorySizeMB"` + MinMemorySizeMB int32 `xml:"minMemorySizeMB"` + MaxMemorySizeMB int32 `xml:"maxMemorySizeMB"` +} + +func init() { + t["MemorySizeNotRecommended"] = reflect.TypeOf((*MemorySizeNotRecommended)(nil)).Elem() +} + +type MemorySizeNotRecommendedFault MemorySizeNotRecommended + +func init() { + t["MemorySizeNotRecommendedFault"] = reflect.TypeOf((*MemorySizeNotRecommendedFault)(nil)).Elem() +} + +type MemorySizeNotSupported struct { + VirtualHardwareCompatibilityIssue + + MemorySizeMB int32 `xml:"memorySizeMB"` + MinMemorySizeMB int32 `xml:"minMemorySizeMB"` + MaxMemorySizeMB int32 `xml:"maxMemorySizeMB"` +} + +func init() { + t["MemorySizeNotSupported"] = reflect.TypeOf((*MemorySizeNotSupported)(nil)).Elem() +} + +type MemorySizeNotSupportedByDatastore struct { + VirtualHardwareCompatibilityIssue + + Datastore ManagedObjectReference `xml:"datastore"` + MemorySizeMB int32 `xml:"memorySizeMB"` + MaxMemorySizeMB int32 `xml:"maxMemorySizeMB"` +} + +func init() { + t["MemorySizeNotSupportedByDatastore"] = reflect.TypeOf((*MemorySizeNotSupportedByDatastore)(nil)).Elem() +} + +type MemorySizeNotSupportedByDatastoreFault MemorySizeNotSupportedByDatastore + +func init() { + t["MemorySizeNotSupportedByDatastoreFault"] = reflect.TypeOf((*MemorySizeNotSupportedByDatastoreFault)(nil)).Elem() +} + +type MemorySizeNotSupportedFault MemorySizeNotSupported + +func init() { + t["MemorySizeNotSupportedFault"] = reflect.TypeOf((*MemorySizeNotSupportedFault)(nil)).Elem() +} + +type MemorySnapshotOnIndependentDisk struct { + SnapshotFault +} + +func init() { + t["MemorySnapshotOnIndependentDisk"] = reflect.TypeOf((*MemorySnapshotOnIndependentDisk)(nil)).Elem() +} + +type MemorySnapshotOnIndependentDiskFault MemorySnapshotOnIndependentDisk + +func init() { + t["MemorySnapshotOnIndependentDiskFault"] = reflect.TypeOf((*MemorySnapshotOnIndependentDiskFault)(nil)).Elem() +} + +type MergeDvsRequestType struct { + This ManagedObjectReference `xml:"_this"` + Dvs ManagedObjectReference `xml:"dvs"` +} + +func init() { + t["MergeDvsRequestType"] = reflect.TypeOf((*MergeDvsRequestType)(nil)).Elem() +} + +type MergeDvs_Task MergeDvsRequestType + +func init() { + t["MergeDvs_Task"] = reflect.TypeOf((*MergeDvs_Task)(nil)).Elem() +} + +type MergeDvs_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type MergePermissions MergePermissionsRequestType + +func init() { + t["MergePermissions"] = reflect.TypeOf((*MergePermissions)(nil)).Elem() +} + +type MergePermissionsRequestType struct { + This ManagedObjectReference `xml:"_this"` + SrcRoleId int32 `xml:"srcRoleId"` + DstRoleId int32 `xml:"dstRoleId"` +} + +func init() { + t["MergePermissionsRequestType"] = reflect.TypeOf((*MergePermissionsRequestType)(nil)).Elem() +} + +type MergePermissionsResponse struct { +} + +type MethodAction struct { + Action + + Name string `xml:"name"` + Argument []MethodActionArgument `xml:"argument,omitempty"` +} + +func init() { + t["MethodAction"] = reflect.TypeOf((*MethodAction)(nil)).Elem() +} + +type MethodActionArgument struct { + DynamicData + + Value AnyType `xml:"value,omitempty,typeattr"` +} + +func init() { + t["MethodActionArgument"] = reflect.TypeOf((*MethodActionArgument)(nil)).Elem() +} + +type MethodAlreadyDisabledFault struct { + RuntimeFault + + SourceId string `xml:"sourceId"` +} + +func init() { + t["MethodAlreadyDisabledFault"] = reflect.TypeOf((*MethodAlreadyDisabledFault)(nil)).Elem() +} + +type MethodAlreadyDisabledFaultFault MethodAlreadyDisabledFault + +func init() { + t["MethodAlreadyDisabledFaultFault"] = reflect.TypeOf((*MethodAlreadyDisabledFaultFault)(nil)).Elem() +} + +type MethodDescription struct { + Description + + Key string `xml:"key"` +} + +func init() { + t["MethodDescription"] = reflect.TypeOf((*MethodDescription)(nil)).Elem() +} + +type MethodDisabled struct { + RuntimeFault + + Source string `xml:"source,omitempty"` +} + +func init() { + t["MethodDisabled"] = reflect.TypeOf((*MethodDisabled)(nil)).Elem() +} + +type MethodDisabledFault MethodDisabled + +func init() { + t["MethodDisabledFault"] = reflect.TypeOf((*MethodDisabledFault)(nil)).Elem() +} + +type MethodFault struct { + FaultCause *LocalizedMethodFault `xml:"faultCause,omitempty"` + FaultMessage []LocalizableMessage `xml:"faultMessage,omitempty"` +} + +func init() { + t["MethodFault"] = reflect.TypeOf((*MethodFault)(nil)).Elem() +} + +type MethodFaultFault BaseMethodFault + +func init() { + t["MethodFaultFault"] = reflect.TypeOf((*MethodFaultFault)(nil)).Elem() +} + +type MethodNotFound struct { + InvalidRequest + + Receiver ManagedObjectReference `xml:"receiver"` + Method string `xml:"method"` +} + +func init() { + t["MethodNotFound"] = reflect.TypeOf((*MethodNotFound)(nil)).Elem() +} + +type MethodNotFoundFault MethodNotFound + +func init() { + t["MethodNotFoundFault"] = reflect.TypeOf((*MethodNotFoundFault)(nil)).Elem() +} + +type MetricAlarmExpression struct { + AlarmExpression + + Operator MetricAlarmOperator `xml:"operator"` + Type string `xml:"type"` + Metric PerfMetricId `xml:"metric"` + Yellow int32 `xml:"yellow,omitempty"` + YellowInterval int32 `xml:"yellowInterval,omitempty"` + Red int32 `xml:"red,omitempty"` + RedInterval int32 `xml:"redInterval,omitempty"` +} + +func init() { + t["MetricAlarmExpression"] = reflect.TypeOf((*MetricAlarmExpression)(nil)).Elem() +} + +type MigrateVMRequestType struct { + This ManagedObjectReference `xml:"_this"` + Pool *ManagedObjectReference `xml:"pool,omitempty"` + Host *ManagedObjectReference `xml:"host,omitempty"` + Priority VirtualMachineMovePriority `xml:"priority"` + State VirtualMachinePowerState `xml:"state,omitempty"` +} + +func init() { + t["MigrateVMRequestType"] = reflect.TypeOf((*MigrateVMRequestType)(nil)).Elem() +} + +type MigrateVM_Task MigrateVMRequestType + +func init() { + t["MigrateVM_Task"] = reflect.TypeOf((*MigrateVM_Task)(nil)).Elem() +} + +type MigrateVM_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type MigrationDisabled struct { + MigrationFault +} + +func init() { + t["MigrationDisabled"] = reflect.TypeOf((*MigrationDisabled)(nil)).Elem() +} + +type MigrationDisabledFault MigrationDisabled + +func init() { + t["MigrationDisabledFault"] = reflect.TypeOf((*MigrationDisabledFault)(nil)).Elem() +} + +type MigrationErrorEvent struct { + MigrationEvent +} + +func init() { + t["MigrationErrorEvent"] = reflect.TypeOf((*MigrationErrorEvent)(nil)).Elem() +} + +type MigrationEvent struct { + VmEvent + + Fault LocalizedMethodFault `xml:"fault"` +} + +func init() { + t["MigrationEvent"] = reflect.TypeOf((*MigrationEvent)(nil)).Elem() +} + +type MigrationFault struct { + VimFault +} + +func init() { + t["MigrationFault"] = reflect.TypeOf((*MigrationFault)(nil)).Elem() +} + +type MigrationFaultFault BaseMigrationFault + +func init() { + t["MigrationFaultFault"] = reflect.TypeOf((*MigrationFaultFault)(nil)).Elem() +} + +type MigrationFeatureNotSupported struct { + MigrationFault + + AtSourceHost bool `xml:"atSourceHost"` + FailedHostName string `xml:"failedHostName"` + FailedHost ManagedObjectReference `xml:"failedHost"` +} + +func init() { + t["MigrationFeatureNotSupported"] = reflect.TypeOf((*MigrationFeatureNotSupported)(nil)).Elem() +} + +type MigrationFeatureNotSupportedFault BaseMigrationFeatureNotSupported + +func init() { + t["MigrationFeatureNotSupportedFault"] = reflect.TypeOf((*MigrationFeatureNotSupportedFault)(nil)).Elem() +} + +type MigrationHostErrorEvent struct { + MigrationEvent + + DstHost HostEventArgument `xml:"dstHost"` +} + +func init() { + t["MigrationHostErrorEvent"] = reflect.TypeOf((*MigrationHostErrorEvent)(nil)).Elem() +} + +type MigrationHostWarningEvent struct { + MigrationEvent + + DstHost HostEventArgument `xml:"dstHost"` +} + +func init() { + t["MigrationHostWarningEvent"] = reflect.TypeOf((*MigrationHostWarningEvent)(nil)).Elem() +} + +type MigrationNotReady struct { + MigrationFault + + Reason string `xml:"reason"` +} + +func init() { + t["MigrationNotReady"] = reflect.TypeOf((*MigrationNotReady)(nil)).Elem() +} + +type MigrationNotReadyFault MigrationNotReady + +func init() { + t["MigrationNotReadyFault"] = reflect.TypeOf((*MigrationNotReadyFault)(nil)).Elem() +} + +type MigrationResourceErrorEvent struct { + MigrationEvent + + DstPool ResourcePoolEventArgument `xml:"dstPool"` + DstHost HostEventArgument `xml:"dstHost"` +} + +func init() { + t["MigrationResourceErrorEvent"] = reflect.TypeOf((*MigrationResourceErrorEvent)(nil)).Elem() +} + +type MigrationResourceWarningEvent struct { + MigrationEvent + + DstPool ResourcePoolEventArgument `xml:"dstPool"` + DstHost HostEventArgument `xml:"dstHost"` +} + +func init() { + t["MigrationResourceWarningEvent"] = reflect.TypeOf((*MigrationResourceWarningEvent)(nil)).Elem() +} + +type MigrationWarningEvent struct { + MigrationEvent +} + +func init() { + t["MigrationWarningEvent"] = reflect.TypeOf((*MigrationWarningEvent)(nil)).Elem() +} + +type MismatchedBundle struct { + VimFault + + BundleUuid string `xml:"bundleUuid"` + HostUuid string `xml:"hostUuid"` + BundleBuildNumber int32 `xml:"bundleBuildNumber"` + HostBuildNumber int32 `xml:"hostBuildNumber"` +} + +func init() { + t["MismatchedBundle"] = reflect.TypeOf((*MismatchedBundle)(nil)).Elem() +} + +type MismatchedBundleFault MismatchedBundle + +func init() { + t["MismatchedBundleFault"] = reflect.TypeOf((*MismatchedBundleFault)(nil)).Elem() +} + +type MismatchedNetworkPolicies struct { + MigrationFault + + Device string `xml:"device"` + Backing string `xml:"backing"` + Connected bool `xml:"connected"` +} + +func init() { + t["MismatchedNetworkPolicies"] = reflect.TypeOf((*MismatchedNetworkPolicies)(nil)).Elem() +} + +type MismatchedNetworkPoliciesFault MismatchedNetworkPolicies + +func init() { + t["MismatchedNetworkPoliciesFault"] = reflect.TypeOf((*MismatchedNetworkPoliciesFault)(nil)).Elem() +} + +type MismatchedVMotionNetworkNames struct { + MigrationFault + + SourceNetwork string `xml:"sourceNetwork"` + DestNetwork string `xml:"destNetwork"` +} + +func init() { + t["MismatchedVMotionNetworkNames"] = reflect.TypeOf((*MismatchedVMotionNetworkNames)(nil)).Elem() +} + +type MismatchedVMotionNetworkNamesFault MismatchedVMotionNetworkNames + +func init() { + t["MismatchedVMotionNetworkNamesFault"] = reflect.TypeOf((*MismatchedVMotionNetworkNamesFault)(nil)).Elem() +} + +type MissingBmcSupport struct { + VimFault +} + +func init() { + t["MissingBmcSupport"] = reflect.TypeOf((*MissingBmcSupport)(nil)).Elem() +} + +type MissingBmcSupportFault MissingBmcSupport + +func init() { + t["MissingBmcSupportFault"] = reflect.TypeOf((*MissingBmcSupportFault)(nil)).Elem() +} + +type MissingController struct { + InvalidDeviceSpec +} + +func init() { + t["MissingController"] = reflect.TypeOf((*MissingController)(nil)).Elem() +} + +type MissingControllerFault MissingController + +func init() { + t["MissingControllerFault"] = reflect.TypeOf((*MissingControllerFault)(nil)).Elem() +} + +type MissingIpPool struct { + VAppPropertyFault +} + +func init() { + t["MissingIpPool"] = reflect.TypeOf((*MissingIpPool)(nil)).Elem() +} + +type MissingIpPoolFault MissingIpPool + +func init() { + t["MissingIpPoolFault"] = reflect.TypeOf((*MissingIpPoolFault)(nil)).Elem() +} + +type MissingLinuxCustResources struct { + CustomizationFault +} + +func init() { + t["MissingLinuxCustResources"] = reflect.TypeOf((*MissingLinuxCustResources)(nil)).Elem() +} + +type MissingLinuxCustResourcesFault MissingLinuxCustResources + +func init() { + t["MissingLinuxCustResourcesFault"] = reflect.TypeOf((*MissingLinuxCustResourcesFault)(nil)).Elem() +} + +type MissingNetworkIpConfig struct { + VAppPropertyFault +} + +func init() { + t["MissingNetworkIpConfig"] = reflect.TypeOf((*MissingNetworkIpConfig)(nil)).Elem() +} + +type MissingNetworkIpConfigFault MissingNetworkIpConfig + +func init() { + t["MissingNetworkIpConfigFault"] = reflect.TypeOf((*MissingNetworkIpConfigFault)(nil)).Elem() +} + +type MissingObject struct { + DynamicData + + Obj ManagedObjectReference `xml:"obj"` + Fault LocalizedMethodFault `xml:"fault"` +} + +func init() { + t["MissingObject"] = reflect.TypeOf((*MissingObject)(nil)).Elem() +} + +type MissingPowerOffConfiguration struct { + VAppConfigFault +} + +func init() { + t["MissingPowerOffConfiguration"] = reflect.TypeOf((*MissingPowerOffConfiguration)(nil)).Elem() +} + +type MissingPowerOffConfigurationFault MissingPowerOffConfiguration + +func init() { + t["MissingPowerOffConfigurationFault"] = reflect.TypeOf((*MissingPowerOffConfigurationFault)(nil)).Elem() +} + +type MissingPowerOnConfiguration struct { + VAppConfigFault +} + +func init() { + t["MissingPowerOnConfiguration"] = reflect.TypeOf((*MissingPowerOnConfiguration)(nil)).Elem() +} + +type MissingPowerOnConfigurationFault MissingPowerOnConfiguration + +func init() { + t["MissingPowerOnConfigurationFault"] = reflect.TypeOf((*MissingPowerOnConfigurationFault)(nil)).Elem() +} + +type MissingProperty struct { + DynamicData + + Path string `xml:"path"` + Fault LocalizedMethodFault `xml:"fault"` +} + +func init() { + t["MissingProperty"] = reflect.TypeOf((*MissingProperty)(nil)).Elem() +} + +type MissingWindowsCustResources struct { + CustomizationFault +} + +func init() { + t["MissingWindowsCustResources"] = reflect.TypeOf((*MissingWindowsCustResources)(nil)).Elem() +} + +type MissingWindowsCustResourcesFault MissingWindowsCustResources + +func init() { + t["MissingWindowsCustResourcesFault"] = reflect.TypeOf((*MissingWindowsCustResourcesFault)(nil)).Elem() +} + +type MksConnectionLimitReached struct { + InvalidState + + ConnectionLimit int32 `xml:"connectionLimit"` +} + +func init() { + t["MksConnectionLimitReached"] = reflect.TypeOf((*MksConnectionLimitReached)(nil)).Elem() +} + +type MksConnectionLimitReachedFault MksConnectionLimitReached + +func init() { + t["MksConnectionLimitReachedFault"] = reflect.TypeOf((*MksConnectionLimitReachedFault)(nil)).Elem() +} + +type ModeInfo struct { + DynamicData + + Browse string `xml:"browse,omitempty"` + Read string `xml:"read"` + Modify string `xml:"modify"` + Use string `xml:"use"` + Admin string `xml:"admin,omitempty"` + Full string `xml:"full"` +} + +func init() { + t["ModeInfo"] = reflect.TypeOf((*ModeInfo)(nil)).Elem() +} + +type ModifyListView ModifyListViewRequestType + +func init() { + t["ModifyListView"] = reflect.TypeOf((*ModifyListView)(nil)).Elem() +} + +type ModifyListViewRequestType struct { + This ManagedObjectReference `xml:"_this"` + Add []ManagedObjectReference `xml:"add,omitempty"` + Remove []ManagedObjectReference `xml:"remove,omitempty"` +} + +func init() { + t["ModifyListViewRequestType"] = reflect.TypeOf((*ModifyListViewRequestType)(nil)).Elem() +} + +type ModifyListViewResponse struct { + Returnval []ManagedObjectReference `xml:"returnval,omitempty"` +} + +type MonthlyByDayTaskScheduler struct { + MonthlyTaskScheduler + + Day int32 `xml:"day"` +} + +func init() { + t["MonthlyByDayTaskScheduler"] = reflect.TypeOf((*MonthlyByDayTaskScheduler)(nil)).Elem() +} + +type MonthlyByWeekdayTaskScheduler struct { + MonthlyTaskScheduler + + Offset WeekOfMonth `xml:"offset"` + Weekday DayOfWeek `xml:"weekday"` +} + +func init() { + t["MonthlyByWeekdayTaskScheduler"] = reflect.TypeOf((*MonthlyByWeekdayTaskScheduler)(nil)).Elem() +} + +type MonthlyTaskScheduler struct { + DailyTaskScheduler +} + +func init() { + t["MonthlyTaskScheduler"] = reflect.TypeOf((*MonthlyTaskScheduler)(nil)).Elem() +} + +type MountError struct { + CustomizationFault + + Vm ManagedObjectReference `xml:"vm"` + DiskIndex int32 `xml:"diskIndex"` +} + +func init() { + t["MountError"] = reflect.TypeOf((*MountError)(nil)).Elem() +} + +type MountErrorFault MountError + +func init() { + t["MountErrorFault"] = reflect.TypeOf((*MountErrorFault)(nil)).Elem() +} + +type MountToolsInstaller MountToolsInstallerRequestType + +func init() { + t["MountToolsInstaller"] = reflect.TypeOf((*MountToolsInstaller)(nil)).Elem() +} + +type MountToolsInstallerRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["MountToolsInstallerRequestType"] = reflect.TypeOf((*MountToolsInstallerRequestType)(nil)).Elem() +} + +type MountToolsInstallerResponse struct { +} + +type MountVffsVolume MountVffsVolumeRequestType + +func init() { + t["MountVffsVolume"] = reflect.TypeOf((*MountVffsVolume)(nil)).Elem() +} + +type MountVffsVolumeRequestType struct { + This ManagedObjectReference `xml:"_this"` + VffsUuid string `xml:"vffsUuid"` +} + +func init() { + t["MountVffsVolumeRequestType"] = reflect.TypeOf((*MountVffsVolumeRequestType)(nil)).Elem() +} + +type MountVffsVolumeResponse struct { +} + +type MountVmfsVolume MountVmfsVolumeRequestType + +func init() { + t["MountVmfsVolume"] = reflect.TypeOf((*MountVmfsVolume)(nil)).Elem() +} + +type MountVmfsVolumeExRequestType struct { + This ManagedObjectReference `xml:"_this"` + VmfsUuid []string `xml:"vmfsUuid"` +} + +func init() { + t["MountVmfsVolumeExRequestType"] = reflect.TypeOf((*MountVmfsVolumeExRequestType)(nil)).Elem() +} + +type MountVmfsVolumeEx_Task MountVmfsVolumeExRequestType + +func init() { + t["MountVmfsVolumeEx_Task"] = reflect.TypeOf((*MountVmfsVolumeEx_Task)(nil)).Elem() +} + +type MountVmfsVolumeEx_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type MountVmfsVolumeRequestType struct { + This ManagedObjectReference `xml:"_this"` + VmfsUuid string `xml:"vmfsUuid"` +} + +func init() { + t["MountVmfsVolumeRequestType"] = reflect.TypeOf((*MountVmfsVolumeRequestType)(nil)).Elem() +} + +type MountVmfsVolumeResponse struct { +} + +type MoveDVPortRequestType struct { + This ManagedObjectReference `xml:"_this"` + PortKey []string `xml:"portKey"` + DestinationPortgroupKey string `xml:"destinationPortgroupKey,omitempty"` +} + +func init() { + t["MoveDVPortRequestType"] = reflect.TypeOf((*MoveDVPortRequestType)(nil)).Elem() +} + +type MoveDVPort_Task MoveDVPortRequestType + +func init() { + t["MoveDVPort_Task"] = reflect.TypeOf((*MoveDVPort_Task)(nil)).Elem() +} + +type MoveDVPort_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type MoveDatastoreFileRequestType struct { + This ManagedObjectReference `xml:"_this"` + SourceName string `xml:"sourceName"` + SourceDatacenter *ManagedObjectReference `xml:"sourceDatacenter,omitempty"` + DestinationName string `xml:"destinationName"` + DestinationDatacenter *ManagedObjectReference `xml:"destinationDatacenter,omitempty"` + Force *bool `xml:"force"` +} + +func init() { + t["MoveDatastoreFileRequestType"] = reflect.TypeOf((*MoveDatastoreFileRequestType)(nil)).Elem() +} + +type MoveDatastoreFile_Task MoveDatastoreFileRequestType + +func init() { + t["MoveDatastoreFile_Task"] = reflect.TypeOf((*MoveDatastoreFile_Task)(nil)).Elem() +} + +type MoveDatastoreFile_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type MoveDirectoryInGuest MoveDirectoryInGuestRequestType + +func init() { + t["MoveDirectoryInGuest"] = reflect.TypeOf((*MoveDirectoryInGuest)(nil)).Elem() +} + +type MoveDirectoryInGuestRequestType struct { + This ManagedObjectReference `xml:"_this"` + Vm ManagedObjectReference `xml:"vm"` + Auth BaseGuestAuthentication `xml:"auth,typeattr"` + SrcDirectoryPath string `xml:"srcDirectoryPath"` + DstDirectoryPath string `xml:"dstDirectoryPath"` +} + +func init() { + t["MoveDirectoryInGuestRequestType"] = reflect.TypeOf((*MoveDirectoryInGuestRequestType)(nil)).Elem() +} + +type MoveDirectoryInGuestResponse struct { +} + +type MoveFileInGuest MoveFileInGuestRequestType + +func init() { + t["MoveFileInGuest"] = reflect.TypeOf((*MoveFileInGuest)(nil)).Elem() +} + +type MoveFileInGuestRequestType struct { + This ManagedObjectReference `xml:"_this"` + Vm ManagedObjectReference `xml:"vm"` + Auth BaseGuestAuthentication `xml:"auth,typeattr"` + SrcFilePath string `xml:"srcFilePath"` + DstFilePath string `xml:"dstFilePath"` + Overwrite bool `xml:"overwrite"` +} + +func init() { + t["MoveFileInGuestRequestType"] = reflect.TypeOf((*MoveFileInGuestRequestType)(nil)).Elem() +} + +type MoveFileInGuestResponse struct { +} + +type MoveHostIntoRequestType struct { + This ManagedObjectReference `xml:"_this"` + Host ManagedObjectReference `xml:"host"` + ResourcePool *ManagedObjectReference `xml:"resourcePool,omitempty"` +} + +func init() { + t["MoveHostIntoRequestType"] = reflect.TypeOf((*MoveHostIntoRequestType)(nil)).Elem() +} + +type MoveHostInto_Task MoveHostIntoRequestType + +func init() { + t["MoveHostInto_Task"] = reflect.TypeOf((*MoveHostInto_Task)(nil)).Elem() +} + +type MoveHostInto_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type MoveIntoFolderRequestType struct { + This ManagedObjectReference `xml:"_this"` + List []ManagedObjectReference `xml:"list"` +} + +func init() { + t["MoveIntoFolderRequestType"] = reflect.TypeOf((*MoveIntoFolderRequestType)(nil)).Elem() +} + +type MoveIntoFolder_Task MoveIntoFolderRequestType + +func init() { + t["MoveIntoFolder_Task"] = reflect.TypeOf((*MoveIntoFolder_Task)(nil)).Elem() +} + +type MoveIntoFolder_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type MoveIntoRequestType struct { + This ManagedObjectReference `xml:"_this"` + Host []ManagedObjectReference `xml:"host"` +} + +func init() { + t["MoveIntoRequestType"] = reflect.TypeOf((*MoveIntoRequestType)(nil)).Elem() +} + +type MoveIntoResourcePool MoveIntoResourcePoolRequestType + +func init() { + t["MoveIntoResourcePool"] = reflect.TypeOf((*MoveIntoResourcePool)(nil)).Elem() +} + +type MoveIntoResourcePoolRequestType struct { + This ManagedObjectReference `xml:"_this"` + List []ManagedObjectReference `xml:"list"` +} + +func init() { + t["MoveIntoResourcePoolRequestType"] = reflect.TypeOf((*MoveIntoResourcePoolRequestType)(nil)).Elem() +} + +type MoveIntoResourcePoolResponse struct { +} + +type MoveInto_Task MoveIntoRequestType + +func init() { + t["MoveInto_Task"] = reflect.TypeOf((*MoveInto_Task)(nil)).Elem() +} + +type MoveInto_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type MoveVirtualDiskRequestType struct { + This ManagedObjectReference `xml:"_this"` + SourceName string `xml:"sourceName"` + SourceDatacenter *ManagedObjectReference `xml:"sourceDatacenter,omitempty"` + DestName string `xml:"destName"` + DestDatacenter *ManagedObjectReference `xml:"destDatacenter,omitempty"` + Force *bool `xml:"force"` + Profile []BaseVirtualMachineProfileSpec `xml:"profile,omitempty,typeattr"` +} + +func init() { + t["MoveVirtualDiskRequestType"] = reflect.TypeOf((*MoveVirtualDiskRequestType)(nil)).Elem() +} + +type MoveVirtualDisk_Task MoveVirtualDiskRequestType + +func init() { + t["MoveVirtualDisk_Task"] = reflect.TypeOf((*MoveVirtualDisk_Task)(nil)).Elem() +} + +type MoveVirtualDisk_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type MtuMatchEvent struct { + DvsHealthStatusChangeEvent +} + +func init() { + t["MtuMatchEvent"] = reflect.TypeOf((*MtuMatchEvent)(nil)).Elem() +} + +type MtuMismatchEvent struct { + DvsHealthStatusChangeEvent +} + +func init() { + t["MtuMismatchEvent"] = reflect.TypeOf((*MtuMismatchEvent)(nil)).Elem() +} + +type MultiWriterNotSupported struct { + DeviceNotSupported +} + +func init() { + t["MultiWriterNotSupported"] = reflect.TypeOf((*MultiWriterNotSupported)(nil)).Elem() +} + +type MultiWriterNotSupportedFault MultiWriterNotSupported + +func init() { + t["MultiWriterNotSupportedFault"] = reflect.TypeOf((*MultiWriterNotSupportedFault)(nil)).Elem() +} + +type MultipleCertificatesVerifyFault struct { + HostConnectFault + + ThumbprintData []MultipleCertificatesVerifyFaultThumbprintData `xml:"thumbprintData"` +} + +func init() { + t["MultipleCertificatesVerifyFault"] = reflect.TypeOf((*MultipleCertificatesVerifyFault)(nil)).Elem() +} + +type MultipleCertificatesVerifyFaultFault MultipleCertificatesVerifyFault + +func init() { + t["MultipleCertificatesVerifyFaultFault"] = reflect.TypeOf((*MultipleCertificatesVerifyFaultFault)(nil)).Elem() +} + +type MultipleCertificatesVerifyFaultThumbprintData struct { + DynamicData + + Port int32 `xml:"port"` + Thumbprint string `xml:"thumbprint"` +} + +func init() { + t["MultipleCertificatesVerifyFaultThumbprintData"] = reflect.TypeOf((*MultipleCertificatesVerifyFaultThumbprintData)(nil)).Elem() +} + +type MultipleSnapshotsNotSupported struct { + SnapshotFault +} + +func init() { + t["MultipleSnapshotsNotSupported"] = reflect.TypeOf((*MultipleSnapshotsNotSupported)(nil)).Elem() +} + +type MultipleSnapshotsNotSupportedFault MultipleSnapshotsNotSupported + +func init() { + t["MultipleSnapshotsNotSupportedFault"] = reflect.TypeOf((*MultipleSnapshotsNotSupportedFault)(nil)).Elem() +} + +type NASDatastoreCreatedEvent struct { + HostEvent + + Datastore DatastoreEventArgument `xml:"datastore"` +} + +func init() { + t["NASDatastoreCreatedEvent"] = reflect.TypeOf((*NASDatastoreCreatedEvent)(nil)).Elem() +} + +type NamePasswordAuthentication struct { + GuestAuthentication + + Username string `xml:"username"` + Password string `xml:"password"` +} + +func init() { + t["NamePasswordAuthentication"] = reflect.TypeOf((*NamePasswordAuthentication)(nil)).Elem() +} + +type NamespaceFull struct { + VimFault + + Name string `xml:"name"` + CurrentMaxSize int64 `xml:"currentMaxSize"` + RequiredSize int64 `xml:"requiredSize,omitempty"` +} + +func init() { + t["NamespaceFull"] = reflect.TypeOf((*NamespaceFull)(nil)).Elem() +} + +type NamespaceFullFault NamespaceFull + +func init() { + t["NamespaceFullFault"] = reflect.TypeOf((*NamespaceFullFault)(nil)).Elem() +} + +type NamespaceLimitReached struct { + VimFault + + Limit int32 `xml:"limit,omitempty"` +} + +func init() { + t["NamespaceLimitReached"] = reflect.TypeOf((*NamespaceLimitReached)(nil)).Elem() +} + +type NamespaceLimitReachedFault NamespaceLimitReached + +func init() { + t["NamespaceLimitReachedFault"] = reflect.TypeOf((*NamespaceLimitReachedFault)(nil)).Elem() +} + +type NamespaceWriteProtected struct { + VimFault + + Name string `xml:"name"` +} + +func init() { + t["NamespaceWriteProtected"] = reflect.TypeOf((*NamespaceWriteProtected)(nil)).Elem() +} + +type NamespaceWriteProtectedFault NamespaceWriteProtected + +func init() { + t["NamespaceWriteProtectedFault"] = reflect.TypeOf((*NamespaceWriteProtectedFault)(nil)).Elem() +} + +type NasConfigFault struct { + HostConfigFault + + Name string `xml:"name"` +} + +func init() { + t["NasConfigFault"] = reflect.TypeOf((*NasConfigFault)(nil)).Elem() +} + +type NasConfigFaultFault BaseNasConfigFault + +func init() { + t["NasConfigFaultFault"] = reflect.TypeOf((*NasConfigFaultFault)(nil)).Elem() +} + +type NasConnectionLimitReached struct { + NasConfigFault + + RemoteHost string `xml:"remoteHost"` + RemotePath string `xml:"remotePath"` +} + +func init() { + t["NasConnectionLimitReached"] = reflect.TypeOf((*NasConnectionLimitReached)(nil)).Elem() +} + +type NasConnectionLimitReachedFault NasConnectionLimitReached + +func init() { + t["NasConnectionLimitReachedFault"] = reflect.TypeOf((*NasConnectionLimitReachedFault)(nil)).Elem() +} + +type NasDatastoreInfo struct { + DatastoreInfo + + Nas *HostNasVolume `xml:"nas,omitempty"` +} + +func init() { + t["NasDatastoreInfo"] = reflect.TypeOf((*NasDatastoreInfo)(nil)).Elem() +} + +type NasSessionCredentialConflict struct { + NasConfigFault + + RemoteHost string `xml:"remoteHost"` + RemotePath string `xml:"remotePath"` + UserName string `xml:"userName"` +} + +func init() { + t["NasSessionCredentialConflict"] = reflect.TypeOf((*NasSessionCredentialConflict)(nil)).Elem() +} + +type NasSessionCredentialConflictFault NasSessionCredentialConflict + +func init() { + t["NasSessionCredentialConflictFault"] = reflect.TypeOf((*NasSessionCredentialConflictFault)(nil)).Elem() +} + +type NasStorageProfile struct { + ApplyProfile + + Key string `xml:"key"` +} + +func init() { + t["NasStorageProfile"] = reflect.TypeOf((*NasStorageProfile)(nil)).Elem() +} + +type NasVolumeNotMounted struct { + NasConfigFault + + RemoteHost string `xml:"remoteHost"` + RemotePath string `xml:"remotePath"` +} + +func init() { + t["NasVolumeNotMounted"] = reflect.TypeOf((*NasVolumeNotMounted)(nil)).Elem() +} + +type NasVolumeNotMountedFault NasVolumeNotMounted + +func init() { + t["NasVolumeNotMountedFault"] = reflect.TypeOf((*NasVolumeNotMountedFault)(nil)).Elem() +} + +type NegatableExpression struct { + DynamicData + + Negate *bool `xml:"negate"` +} + +func init() { + t["NegatableExpression"] = reflect.TypeOf((*NegatableExpression)(nil)).Elem() +} + +type NetBIOSConfigInfo struct { + DynamicData + + Mode string `xml:"mode"` +} + +func init() { + t["NetBIOSConfigInfo"] = reflect.TypeOf((*NetBIOSConfigInfo)(nil)).Elem() +} + +type NetDhcpConfigInfo struct { + DynamicData + + Ipv6 *NetDhcpConfigInfoDhcpOptions `xml:"ipv6,omitempty"` + Ipv4 *NetDhcpConfigInfoDhcpOptions `xml:"ipv4,omitempty"` +} + +func init() { + t["NetDhcpConfigInfo"] = reflect.TypeOf((*NetDhcpConfigInfo)(nil)).Elem() +} + +type NetDhcpConfigInfoDhcpOptions struct { + DynamicData + + Enable bool `xml:"enable"` + Config []KeyValue `xml:"config,omitempty"` +} + +func init() { + t["NetDhcpConfigInfoDhcpOptions"] = reflect.TypeOf((*NetDhcpConfigInfoDhcpOptions)(nil)).Elem() +} + +type NetDhcpConfigSpec struct { + DynamicData + + Ipv6 *NetDhcpConfigSpecDhcpOptionsSpec `xml:"ipv6,omitempty"` + Ipv4 *NetDhcpConfigSpecDhcpOptionsSpec `xml:"ipv4,omitempty"` +} + +func init() { + t["NetDhcpConfigSpec"] = reflect.TypeOf((*NetDhcpConfigSpec)(nil)).Elem() +} + +type NetDhcpConfigSpecDhcpOptionsSpec struct { + DynamicData + + Enable *bool `xml:"enable"` + Config []KeyValue `xml:"config"` + Operation string `xml:"operation"` +} + +func init() { + t["NetDhcpConfigSpecDhcpOptionsSpec"] = reflect.TypeOf((*NetDhcpConfigSpecDhcpOptionsSpec)(nil)).Elem() +} + +type NetDnsConfigInfo struct { + DynamicData + + Dhcp bool `xml:"dhcp"` + HostName string `xml:"hostName"` + DomainName string `xml:"domainName"` + IpAddress []string `xml:"ipAddress,omitempty"` + SearchDomain []string `xml:"searchDomain,omitempty"` +} + +func init() { + t["NetDnsConfigInfo"] = reflect.TypeOf((*NetDnsConfigInfo)(nil)).Elem() +} + +type NetDnsConfigSpec struct { + DynamicData + + Dhcp *bool `xml:"dhcp"` + HostName string `xml:"hostName,omitempty"` + DomainName string `xml:"domainName,omitempty"` + IpAddress []string `xml:"ipAddress,omitempty"` + SearchDomain []string `xml:"searchDomain,omitempty"` +} + +func init() { + t["NetDnsConfigSpec"] = reflect.TypeOf((*NetDnsConfigSpec)(nil)).Elem() +} + +type NetIpConfigInfo struct { + DynamicData + + IpAddress []NetIpConfigInfoIpAddress `xml:"ipAddress,omitempty"` + Dhcp *NetDhcpConfigInfo `xml:"dhcp,omitempty"` + AutoConfigurationEnabled *bool `xml:"autoConfigurationEnabled"` +} + +func init() { + t["NetIpConfigInfo"] = reflect.TypeOf((*NetIpConfigInfo)(nil)).Elem() +} + +type NetIpConfigInfoIpAddress struct { + DynamicData + + IpAddress string `xml:"ipAddress"` + PrefixLength int32 `xml:"prefixLength"` + Origin string `xml:"origin,omitempty"` + State string `xml:"state,omitempty"` + Lifetime *time.Time `xml:"lifetime"` +} + +func init() { + t["NetIpConfigInfoIpAddress"] = reflect.TypeOf((*NetIpConfigInfoIpAddress)(nil)).Elem() +} + +type NetIpConfigSpec struct { + DynamicData + + IpAddress []NetIpConfigSpecIpAddressSpec `xml:"ipAddress,omitempty"` + Dhcp *NetDhcpConfigSpec `xml:"dhcp,omitempty"` + AutoConfigurationEnabled *bool `xml:"autoConfigurationEnabled"` +} + +func init() { + t["NetIpConfigSpec"] = reflect.TypeOf((*NetIpConfigSpec)(nil)).Elem() +} + +type NetIpConfigSpecIpAddressSpec struct { + DynamicData + + IpAddress string `xml:"ipAddress"` + PrefixLength int32 `xml:"prefixLength"` + Operation string `xml:"operation"` +} + +func init() { + t["NetIpConfigSpecIpAddressSpec"] = reflect.TypeOf((*NetIpConfigSpecIpAddressSpec)(nil)).Elem() +} + +type NetIpRouteConfigInfo struct { + DynamicData + + IpRoute []NetIpRouteConfigInfoIpRoute `xml:"ipRoute,omitempty"` +} + +func init() { + t["NetIpRouteConfigInfo"] = reflect.TypeOf((*NetIpRouteConfigInfo)(nil)).Elem() +} + +type NetIpRouteConfigInfoGateway struct { + DynamicData + + IpAddress string `xml:"ipAddress,omitempty"` + Device string `xml:"device,omitempty"` +} + +func init() { + t["NetIpRouteConfigInfoGateway"] = reflect.TypeOf((*NetIpRouteConfigInfoGateway)(nil)).Elem() +} + +type NetIpRouteConfigInfoIpRoute struct { + DynamicData + + Network string `xml:"network"` + PrefixLength int32 `xml:"prefixLength"` + Gateway NetIpRouteConfigInfoGateway `xml:"gateway"` +} + +func init() { + t["NetIpRouteConfigInfoIpRoute"] = reflect.TypeOf((*NetIpRouteConfigInfoIpRoute)(nil)).Elem() +} + +type NetIpRouteConfigSpec struct { + DynamicData + + IpRoute []NetIpRouteConfigSpecIpRouteSpec `xml:"ipRoute,omitempty"` +} + +func init() { + t["NetIpRouteConfigSpec"] = reflect.TypeOf((*NetIpRouteConfigSpec)(nil)).Elem() +} + +type NetIpRouteConfigSpecGatewaySpec struct { + DynamicData + + IpAddress string `xml:"ipAddress,omitempty"` + Device string `xml:"device,omitempty"` +} + +func init() { + t["NetIpRouteConfigSpecGatewaySpec"] = reflect.TypeOf((*NetIpRouteConfigSpecGatewaySpec)(nil)).Elem() +} + +type NetIpRouteConfigSpecIpRouteSpec struct { + DynamicData + + Network string `xml:"network"` + PrefixLength int32 `xml:"prefixLength"` + Gateway NetIpRouteConfigSpecGatewaySpec `xml:"gateway"` + Operation string `xml:"operation"` +} + +func init() { + t["NetIpRouteConfigSpecIpRouteSpec"] = reflect.TypeOf((*NetIpRouteConfigSpecIpRouteSpec)(nil)).Elem() +} + +type NetIpStackInfo struct { + DynamicData + + Neighbor []NetIpStackInfoNetToMedia `xml:"neighbor,omitempty"` + DefaultRouter []NetIpStackInfoDefaultRouter `xml:"defaultRouter,omitempty"` +} + +func init() { + t["NetIpStackInfo"] = reflect.TypeOf((*NetIpStackInfo)(nil)).Elem() +} + +type NetIpStackInfoDefaultRouter struct { + DynamicData + + IpAddress string `xml:"ipAddress"` + Device string `xml:"device"` + Lifetime time.Time `xml:"lifetime"` + Preference string `xml:"preference"` +} + +func init() { + t["NetIpStackInfoDefaultRouter"] = reflect.TypeOf((*NetIpStackInfoDefaultRouter)(nil)).Elem() +} + +type NetIpStackInfoNetToMedia struct { + DynamicData + + IpAddress string `xml:"ipAddress"` + PhysicalAddress string `xml:"physicalAddress"` + Device string `xml:"device"` + Type string `xml:"type"` +} + +func init() { + t["NetIpStackInfoNetToMedia"] = reflect.TypeOf((*NetIpStackInfoNetToMedia)(nil)).Elem() +} + +type NetStackInstanceProfile struct { + ApplyProfile + + Key string `xml:"key"` + DnsConfig NetworkProfileDnsConfigProfile `xml:"dnsConfig"` + IpRouteConfig IpRouteProfile `xml:"ipRouteConfig"` +} + +func init() { + t["NetStackInstanceProfile"] = reflect.TypeOf((*NetStackInstanceProfile)(nil)).Elem() +} + +type NetworkCopyFault struct { + FileFault +} + +func init() { + t["NetworkCopyFault"] = reflect.TypeOf((*NetworkCopyFault)(nil)).Elem() +} + +type NetworkCopyFaultFault NetworkCopyFault + +func init() { + t["NetworkCopyFaultFault"] = reflect.TypeOf((*NetworkCopyFaultFault)(nil)).Elem() +} + +type NetworkDisruptedAndConfigRolledBack struct { + VimFault + + Host string `xml:"host"` +} + +func init() { + t["NetworkDisruptedAndConfigRolledBack"] = reflect.TypeOf((*NetworkDisruptedAndConfigRolledBack)(nil)).Elem() +} + +type NetworkDisruptedAndConfigRolledBackFault NetworkDisruptedAndConfigRolledBack + +func init() { + t["NetworkDisruptedAndConfigRolledBackFault"] = reflect.TypeOf((*NetworkDisruptedAndConfigRolledBackFault)(nil)).Elem() +} + +type NetworkEventArgument struct { + EntityEventArgument + + Network ManagedObjectReference `xml:"network"` +} + +func init() { + t["NetworkEventArgument"] = reflect.TypeOf((*NetworkEventArgument)(nil)).Elem() +} + +type NetworkInaccessible struct { + NasConfigFault +} + +func init() { + t["NetworkInaccessible"] = reflect.TypeOf((*NetworkInaccessible)(nil)).Elem() +} + +type NetworkInaccessibleFault NetworkInaccessible + +func init() { + t["NetworkInaccessibleFault"] = reflect.TypeOf((*NetworkInaccessibleFault)(nil)).Elem() +} + +type NetworkPolicyProfile struct { + ApplyProfile +} + +func init() { + t["NetworkPolicyProfile"] = reflect.TypeOf((*NetworkPolicyProfile)(nil)).Elem() +} + +type NetworkProfile struct { + ApplyProfile + + Vswitch []VirtualSwitchProfile `xml:"vswitch,omitempty"` + VmPortGroup []VmPortGroupProfile `xml:"vmPortGroup,omitempty"` + HostPortGroup []HostPortGroupProfile `xml:"hostPortGroup,omitempty"` + ServiceConsolePortGroup []ServiceConsolePortGroupProfile `xml:"serviceConsolePortGroup,omitempty"` + DnsConfig *NetworkProfileDnsConfigProfile `xml:"dnsConfig,omitempty"` + IpRouteConfig *IpRouteProfile `xml:"ipRouteConfig,omitempty"` + ConsoleIpRouteConfig *IpRouteProfile `xml:"consoleIpRouteConfig,omitempty"` + Pnic []PhysicalNicProfile `xml:"pnic,omitempty"` + Dvswitch []DvsProfile `xml:"dvswitch,omitempty"` + DvsServiceConsoleNic []DvsServiceConsoleVNicProfile `xml:"dvsServiceConsoleNic,omitempty"` + DvsHostNic []DvsHostVNicProfile `xml:"dvsHostNic,omitempty"` + NetStackInstance []NetStackInstanceProfile `xml:"netStackInstance,omitempty"` +} + +func init() { + t["NetworkProfile"] = reflect.TypeOf((*NetworkProfile)(nil)).Elem() +} + +type NetworkProfileDnsConfigProfile struct { + ApplyProfile +} + +func init() { + t["NetworkProfileDnsConfigProfile"] = reflect.TypeOf((*NetworkProfileDnsConfigProfile)(nil)).Elem() +} + +type NetworkRollbackEvent struct { + Event + + MethodName string `xml:"methodName"` + TransactionId string `xml:"transactionId"` +} + +func init() { + t["NetworkRollbackEvent"] = reflect.TypeOf((*NetworkRollbackEvent)(nil)).Elem() +} + +type NetworkSummary struct { + DynamicData + + Network *ManagedObjectReference `xml:"network,omitempty"` + Name string `xml:"name"` + Accessible bool `xml:"accessible"` + IpPoolName string `xml:"ipPoolName,omitempty"` + IpPoolId int32 `xml:"ipPoolId,omitempty"` +} + +func init() { + t["NetworkSummary"] = reflect.TypeOf((*NetworkSummary)(nil)).Elem() +} + +type NetworksMayNotBeTheSame struct { + MigrationFault + + Name string `xml:"name,omitempty"` +} + +func init() { + t["NetworksMayNotBeTheSame"] = reflect.TypeOf((*NetworksMayNotBeTheSame)(nil)).Elem() +} + +type NetworksMayNotBeTheSameFault NetworksMayNotBeTheSame + +func init() { + t["NetworksMayNotBeTheSameFault"] = reflect.TypeOf((*NetworksMayNotBeTheSameFault)(nil)).Elem() +} + +type NicSettingMismatch struct { + CustomizationFault + + NumberOfNicsInSpec int32 `xml:"numberOfNicsInSpec"` + NumberOfNicsInVM int32 `xml:"numberOfNicsInVM"` +} + +func init() { + t["NicSettingMismatch"] = reflect.TypeOf((*NicSettingMismatch)(nil)).Elem() +} + +type NicSettingMismatchFault NicSettingMismatch + +func init() { + t["NicSettingMismatchFault"] = reflect.TypeOf((*NicSettingMismatchFault)(nil)).Elem() +} + +type NoAccessUserEvent struct { + SessionEvent + + IpAddress string `xml:"ipAddress"` +} + +func init() { + t["NoAccessUserEvent"] = reflect.TypeOf((*NoAccessUserEvent)(nil)).Elem() +} + +type NoActiveHostInCluster struct { + InvalidState + + ComputeResource ManagedObjectReference `xml:"computeResource"` +} + +func init() { + t["NoActiveHostInCluster"] = reflect.TypeOf((*NoActiveHostInCluster)(nil)).Elem() +} + +type NoActiveHostInClusterFault NoActiveHostInCluster + +func init() { + t["NoActiveHostInClusterFault"] = reflect.TypeOf((*NoActiveHostInClusterFault)(nil)).Elem() +} + +type NoAvailableIp struct { + VAppPropertyFault + + Network ManagedObjectReference `xml:"network"` +} + +func init() { + t["NoAvailableIp"] = reflect.TypeOf((*NoAvailableIp)(nil)).Elem() +} + +type NoAvailableIpFault NoAvailableIp + +func init() { + t["NoAvailableIpFault"] = reflect.TypeOf((*NoAvailableIpFault)(nil)).Elem() +} + +type NoClientCertificate struct { + VimFault +} + +func init() { + t["NoClientCertificate"] = reflect.TypeOf((*NoClientCertificate)(nil)).Elem() +} + +type NoClientCertificateFault NoClientCertificate + +func init() { + t["NoClientCertificateFault"] = reflect.TypeOf((*NoClientCertificateFault)(nil)).Elem() +} + +type NoCompatibleDatastore struct { + VimFault +} + +func init() { + t["NoCompatibleDatastore"] = reflect.TypeOf((*NoCompatibleDatastore)(nil)).Elem() +} + +type NoCompatibleDatastoreFault NoCompatibleDatastore + +func init() { + t["NoCompatibleDatastoreFault"] = reflect.TypeOf((*NoCompatibleDatastoreFault)(nil)).Elem() +} + +type NoCompatibleHardAffinityHost struct { + VmConfigFault + + VmName string `xml:"vmName"` +} + +func init() { + t["NoCompatibleHardAffinityHost"] = reflect.TypeOf((*NoCompatibleHardAffinityHost)(nil)).Elem() +} + +type NoCompatibleHardAffinityHostFault NoCompatibleHardAffinityHost + +func init() { + t["NoCompatibleHardAffinityHostFault"] = reflect.TypeOf((*NoCompatibleHardAffinityHostFault)(nil)).Elem() +} + +type NoCompatibleHost struct { + VimFault + + Host []ManagedObjectReference `xml:"host,omitempty"` + Error []LocalizedMethodFault `xml:"error,omitempty"` +} + +func init() { + t["NoCompatibleHost"] = reflect.TypeOf((*NoCompatibleHost)(nil)).Elem() +} + +type NoCompatibleHostFault BaseNoCompatibleHost + +func init() { + t["NoCompatibleHostFault"] = reflect.TypeOf((*NoCompatibleHostFault)(nil)).Elem() +} + +type NoCompatibleHostWithAccessToDevice struct { + NoCompatibleHost +} + +func init() { + t["NoCompatibleHostWithAccessToDevice"] = reflect.TypeOf((*NoCompatibleHostWithAccessToDevice)(nil)).Elem() +} + +type NoCompatibleHostWithAccessToDeviceFault NoCompatibleHostWithAccessToDevice + +func init() { + t["NoCompatibleHostWithAccessToDeviceFault"] = reflect.TypeOf((*NoCompatibleHostWithAccessToDeviceFault)(nil)).Elem() +} + +type NoCompatibleSoftAffinityHost struct { + VmConfigFault + + VmName string `xml:"vmName"` +} + +func init() { + t["NoCompatibleSoftAffinityHost"] = reflect.TypeOf((*NoCompatibleSoftAffinityHost)(nil)).Elem() +} + +type NoCompatibleSoftAffinityHostFault NoCompatibleSoftAffinityHost + +func init() { + t["NoCompatibleSoftAffinityHostFault"] = reflect.TypeOf((*NoCompatibleSoftAffinityHostFault)(nil)).Elem() +} + +type NoConnectedDatastore struct { + VimFault +} + +func init() { + t["NoConnectedDatastore"] = reflect.TypeOf((*NoConnectedDatastore)(nil)).Elem() +} + +type NoConnectedDatastoreFault NoConnectedDatastore + +func init() { + t["NoConnectedDatastoreFault"] = reflect.TypeOf((*NoConnectedDatastoreFault)(nil)).Elem() +} + +type NoDatastoresConfiguredEvent struct { + HostEvent +} + +func init() { + t["NoDatastoresConfiguredEvent"] = reflect.TypeOf((*NoDatastoresConfiguredEvent)(nil)).Elem() +} + +type NoDiskFound struct { + VimFault +} + +func init() { + t["NoDiskFound"] = reflect.TypeOf((*NoDiskFound)(nil)).Elem() +} + +type NoDiskFoundFault NoDiskFound + +func init() { + t["NoDiskFoundFault"] = reflect.TypeOf((*NoDiskFoundFault)(nil)).Elem() +} + +type NoDiskSpace struct { + FileFault + + Datastore string `xml:"datastore"` +} + +func init() { + t["NoDiskSpace"] = reflect.TypeOf((*NoDiskSpace)(nil)).Elem() +} + +type NoDiskSpaceFault NoDiskSpace + +func init() { + t["NoDiskSpaceFault"] = reflect.TypeOf((*NoDiskSpaceFault)(nil)).Elem() +} + +type NoDisksToCustomize struct { + CustomizationFault +} + +func init() { + t["NoDisksToCustomize"] = reflect.TypeOf((*NoDisksToCustomize)(nil)).Elem() +} + +type NoDisksToCustomizeFault NoDisksToCustomize + +func init() { + t["NoDisksToCustomizeFault"] = reflect.TypeOf((*NoDisksToCustomizeFault)(nil)).Elem() +} + +type NoGateway struct { + HostConfigFault +} + +func init() { + t["NoGateway"] = reflect.TypeOf((*NoGateway)(nil)).Elem() +} + +type NoGatewayFault NoGateway + +func init() { + t["NoGatewayFault"] = reflect.TypeOf((*NoGatewayFault)(nil)).Elem() +} + +type NoGuestHeartbeat struct { + MigrationFault +} + +func init() { + t["NoGuestHeartbeat"] = reflect.TypeOf((*NoGuestHeartbeat)(nil)).Elem() +} + +type NoGuestHeartbeatFault NoGuestHeartbeat + +func init() { + t["NoGuestHeartbeatFault"] = reflect.TypeOf((*NoGuestHeartbeatFault)(nil)).Elem() +} + +type NoHost struct { + HostConnectFault + + Name string `xml:"name,omitempty"` +} + +func init() { + t["NoHost"] = reflect.TypeOf((*NoHost)(nil)).Elem() +} + +type NoHostFault NoHost + +func init() { + t["NoHostFault"] = reflect.TypeOf((*NoHostFault)(nil)).Elem() +} + +type NoHostSuitableForFtSecondary struct { + VmFaultToleranceIssue + + Vm ManagedObjectReference `xml:"vm"` + VmName string `xml:"vmName"` +} + +func init() { + t["NoHostSuitableForFtSecondary"] = reflect.TypeOf((*NoHostSuitableForFtSecondary)(nil)).Elem() +} + +type NoHostSuitableForFtSecondaryFault NoHostSuitableForFtSecondary + +func init() { + t["NoHostSuitableForFtSecondaryFault"] = reflect.TypeOf((*NoHostSuitableForFtSecondaryFault)(nil)).Elem() +} + +type NoLicenseEvent struct { + LicenseEvent + + Feature LicenseFeatureInfo `xml:"feature"` +} + +func init() { + t["NoLicenseEvent"] = reflect.TypeOf((*NoLicenseEvent)(nil)).Elem() +} + +type NoLicenseServerConfigured struct { + NotEnoughLicenses +} + +func init() { + t["NoLicenseServerConfigured"] = reflect.TypeOf((*NoLicenseServerConfigured)(nil)).Elem() +} + +type NoLicenseServerConfiguredFault NoLicenseServerConfigured + +func init() { + t["NoLicenseServerConfiguredFault"] = reflect.TypeOf((*NoLicenseServerConfiguredFault)(nil)).Elem() +} + +type NoMaintenanceModeDrsRecommendationForVM struct { + VmEvent +} + +func init() { + t["NoMaintenanceModeDrsRecommendationForVM"] = reflect.TypeOf((*NoMaintenanceModeDrsRecommendationForVM)(nil)).Elem() +} + +type NoPeerHostFound struct { + HostPowerOpFailed +} + +func init() { + t["NoPeerHostFound"] = reflect.TypeOf((*NoPeerHostFound)(nil)).Elem() +} + +type NoPeerHostFoundFault NoPeerHostFound + +func init() { + t["NoPeerHostFoundFault"] = reflect.TypeOf((*NoPeerHostFoundFault)(nil)).Elem() +} + +type NoPermission struct { + SecurityError + + Object ManagedObjectReference `xml:"object"` + PrivilegeId string `xml:"privilegeId"` +} + +func init() { + t["NoPermission"] = reflect.TypeOf((*NoPermission)(nil)).Elem() +} + +type NoPermissionFault BaseNoPermission + +func init() { + t["NoPermissionFault"] = reflect.TypeOf((*NoPermissionFault)(nil)).Elem() +} + +type NoPermissionOnAD struct { + ActiveDirectoryFault +} + +func init() { + t["NoPermissionOnAD"] = reflect.TypeOf((*NoPermissionOnAD)(nil)).Elem() +} + +type NoPermissionOnADFault NoPermissionOnAD + +func init() { + t["NoPermissionOnADFault"] = reflect.TypeOf((*NoPermissionOnADFault)(nil)).Elem() +} + +type NoPermissionOnHost struct { + HostConnectFault +} + +func init() { + t["NoPermissionOnHost"] = reflect.TypeOf((*NoPermissionOnHost)(nil)).Elem() +} + +type NoPermissionOnHostFault NoPermissionOnHost + +func init() { + t["NoPermissionOnHostFault"] = reflect.TypeOf((*NoPermissionOnHostFault)(nil)).Elem() +} + +type NoPermissionOnNasVolume struct { + NasConfigFault + + UserName string `xml:"userName,omitempty"` +} + +func init() { + t["NoPermissionOnNasVolume"] = reflect.TypeOf((*NoPermissionOnNasVolume)(nil)).Elem() +} + +type NoPermissionOnNasVolumeFault NoPermissionOnNasVolume + +func init() { + t["NoPermissionOnNasVolumeFault"] = reflect.TypeOf((*NoPermissionOnNasVolumeFault)(nil)).Elem() +} + +type NoSubjectName struct { + VimFault +} + +func init() { + t["NoSubjectName"] = reflect.TypeOf((*NoSubjectName)(nil)).Elem() +} + +type NoSubjectNameFault NoSubjectName + +func init() { + t["NoSubjectNameFault"] = reflect.TypeOf((*NoSubjectNameFault)(nil)).Elem() +} + +type NoVcManagedIpConfigured struct { + VAppPropertyFault +} + +func init() { + t["NoVcManagedIpConfigured"] = reflect.TypeOf((*NoVcManagedIpConfigured)(nil)).Elem() +} + +type NoVcManagedIpConfiguredFault NoVcManagedIpConfigured + +func init() { + t["NoVcManagedIpConfiguredFault"] = reflect.TypeOf((*NoVcManagedIpConfiguredFault)(nil)).Elem() +} + +type NoVirtualNic struct { + HostConfigFault +} + +func init() { + t["NoVirtualNic"] = reflect.TypeOf((*NoVirtualNic)(nil)).Elem() +} + +type NoVirtualNicFault NoVirtualNic + +func init() { + t["NoVirtualNicFault"] = reflect.TypeOf((*NoVirtualNicFault)(nil)).Elem() +} + +type NoVmInVApp struct { + VAppConfigFault +} + +func init() { + t["NoVmInVApp"] = reflect.TypeOf((*NoVmInVApp)(nil)).Elem() +} + +type NoVmInVAppFault NoVmInVApp + +func init() { + t["NoVmInVAppFault"] = reflect.TypeOf((*NoVmInVAppFault)(nil)).Elem() +} + +type NonADUserRequired struct { + ActiveDirectoryFault +} + +func init() { + t["NonADUserRequired"] = reflect.TypeOf((*NonADUserRequired)(nil)).Elem() +} + +type NonADUserRequiredFault NonADUserRequired + +func init() { + t["NonADUserRequiredFault"] = reflect.TypeOf((*NonADUserRequiredFault)(nil)).Elem() +} + +type NonHomeRDMVMotionNotSupported struct { + MigrationFeatureNotSupported + + Device string `xml:"device"` +} + +func init() { + t["NonHomeRDMVMotionNotSupported"] = reflect.TypeOf((*NonHomeRDMVMotionNotSupported)(nil)).Elem() +} + +type NonHomeRDMVMotionNotSupportedFault NonHomeRDMVMotionNotSupported + +func init() { + t["NonHomeRDMVMotionNotSupportedFault"] = reflect.TypeOf((*NonHomeRDMVMotionNotSupportedFault)(nil)).Elem() +} + +type NonPersistentDisksNotSupported struct { + DeviceNotSupported +} + +func init() { + t["NonPersistentDisksNotSupported"] = reflect.TypeOf((*NonPersistentDisksNotSupported)(nil)).Elem() +} + +type NonPersistentDisksNotSupportedFault NonPersistentDisksNotSupported + +func init() { + t["NonPersistentDisksNotSupportedFault"] = reflect.TypeOf((*NonPersistentDisksNotSupportedFault)(nil)).Elem() +} + +type NonVIWorkloadDetectedOnDatastoreEvent struct { + DatastoreEvent +} + +func init() { + t["NonVIWorkloadDetectedOnDatastoreEvent"] = reflect.TypeOf((*NonVIWorkloadDetectedOnDatastoreEvent)(nil)).Elem() +} + +type NonVmwareOuiMacNotSupportedHost struct { + NotSupportedHost + + HostName string `xml:"hostName"` +} + +func init() { + t["NonVmwareOuiMacNotSupportedHost"] = reflect.TypeOf((*NonVmwareOuiMacNotSupportedHost)(nil)).Elem() +} + +type NonVmwareOuiMacNotSupportedHostFault NonVmwareOuiMacNotSupportedHost + +func init() { + t["NonVmwareOuiMacNotSupportedHostFault"] = reflect.TypeOf((*NonVmwareOuiMacNotSupportedHostFault)(nil)).Elem() +} + +type NotADirectory struct { + FileFault +} + +func init() { + t["NotADirectory"] = reflect.TypeOf((*NotADirectory)(nil)).Elem() +} + +type NotADirectoryFault NotADirectory + +func init() { + t["NotADirectoryFault"] = reflect.TypeOf((*NotADirectoryFault)(nil)).Elem() +} + +type NotAFile struct { + FileFault +} + +func init() { + t["NotAFile"] = reflect.TypeOf((*NotAFile)(nil)).Elem() +} + +type NotAFileFault NotAFile + +func init() { + t["NotAFileFault"] = reflect.TypeOf((*NotAFileFault)(nil)).Elem() +} + +type NotAuthenticated struct { + NoPermission +} + +func init() { + t["NotAuthenticated"] = reflect.TypeOf((*NotAuthenticated)(nil)).Elem() +} + +type NotAuthenticatedFault NotAuthenticated + +func init() { + t["NotAuthenticatedFault"] = reflect.TypeOf((*NotAuthenticatedFault)(nil)).Elem() +} + +type NotEnoughCpus struct { + VirtualHardwareCompatibilityIssue + + NumCpuDest int32 `xml:"numCpuDest"` + NumCpuVm int32 `xml:"numCpuVm"` +} + +func init() { + t["NotEnoughCpus"] = reflect.TypeOf((*NotEnoughCpus)(nil)).Elem() +} + +type NotEnoughCpusFault BaseNotEnoughCpus + +func init() { + t["NotEnoughCpusFault"] = reflect.TypeOf((*NotEnoughCpusFault)(nil)).Elem() +} + +type NotEnoughLicenses struct { + RuntimeFault +} + +func init() { + t["NotEnoughLicenses"] = reflect.TypeOf((*NotEnoughLicenses)(nil)).Elem() +} + +type NotEnoughLicensesFault BaseNotEnoughLicenses + +func init() { + t["NotEnoughLicensesFault"] = reflect.TypeOf((*NotEnoughLicensesFault)(nil)).Elem() +} + +type NotEnoughLogicalCpus struct { + NotEnoughCpus + + Host *ManagedObjectReference `xml:"host,omitempty"` +} + +func init() { + t["NotEnoughLogicalCpus"] = reflect.TypeOf((*NotEnoughLogicalCpus)(nil)).Elem() +} + +type NotEnoughLogicalCpusFault NotEnoughLogicalCpus + +func init() { + t["NotEnoughLogicalCpusFault"] = reflect.TypeOf((*NotEnoughLogicalCpusFault)(nil)).Elem() +} + +type NotEnoughResourcesToStartVmEvent struct { + VmEvent + + Reason string `xml:"reason,omitempty"` +} + +func init() { + t["NotEnoughResourcesToStartVmEvent"] = reflect.TypeOf((*NotEnoughResourcesToStartVmEvent)(nil)).Elem() +} + +type NotFound struct { + VimFault +} + +func init() { + t["NotFound"] = reflect.TypeOf((*NotFound)(nil)).Elem() +} + +type NotFoundFault NotFound + +func init() { + t["NotFoundFault"] = reflect.TypeOf((*NotFoundFault)(nil)).Elem() +} + +type NotImplemented struct { + RuntimeFault +} + +func init() { + t["NotImplemented"] = reflect.TypeOf((*NotImplemented)(nil)).Elem() +} + +type NotImplementedFault NotImplemented + +func init() { + t["NotImplementedFault"] = reflect.TypeOf((*NotImplementedFault)(nil)).Elem() +} + +type NotSupported struct { + RuntimeFault +} + +func init() { + t["NotSupported"] = reflect.TypeOf((*NotSupported)(nil)).Elem() +} + +type NotSupportedDeviceForFT struct { + VmFaultToleranceIssue + + Host ManagedObjectReference `xml:"host"` + HostName string `xml:"hostName,omitempty"` + Vm ManagedObjectReference `xml:"vm"` + VmName string `xml:"vmName,omitempty"` + DeviceType string `xml:"deviceType"` + DeviceLabel string `xml:"deviceLabel,omitempty"` +} + +func init() { + t["NotSupportedDeviceForFT"] = reflect.TypeOf((*NotSupportedDeviceForFT)(nil)).Elem() +} + +type NotSupportedDeviceForFTFault NotSupportedDeviceForFT + +func init() { + t["NotSupportedDeviceForFTFault"] = reflect.TypeOf((*NotSupportedDeviceForFTFault)(nil)).Elem() +} + +type NotSupportedFault BaseNotSupported + +func init() { + t["NotSupportedFault"] = reflect.TypeOf((*NotSupportedFault)(nil)).Elem() +} + +type NotSupportedHost struct { + HostConnectFault + + ProductName string `xml:"productName,omitempty"` + ProductVersion string `xml:"productVersion,omitempty"` +} + +func init() { + t["NotSupportedHost"] = reflect.TypeOf((*NotSupportedHost)(nil)).Elem() +} + +type NotSupportedHostFault BaseNotSupportedHost + +func init() { + t["NotSupportedHostFault"] = reflect.TypeOf((*NotSupportedHostFault)(nil)).Elem() +} + +type NotSupportedHostForChecksum struct { + VimFault +} + +func init() { + t["NotSupportedHostForChecksum"] = reflect.TypeOf((*NotSupportedHostForChecksum)(nil)).Elem() +} + +type NotSupportedHostForChecksumFault NotSupportedHostForChecksum + +func init() { + t["NotSupportedHostForChecksumFault"] = reflect.TypeOf((*NotSupportedHostForChecksumFault)(nil)).Elem() +} + +type NotSupportedHostForVFlash struct { + NotSupportedHost + + HostName string `xml:"hostName"` +} + +func init() { + t["NotSupportedHostForVFlash"] = reflect.TypeOf((*NotSupportedHostForVFlash)(nil)).Elem() +} + +type NotSupportedHostForVFlashFault NotSupportedHostForVFlash + +func init() { + t["NotSupportedHostForVFlashFault"] = reflect.TypeOf((*NotSupportedHostForVFlashFault)(nil)).Elem() +} + +type NotSupportedHostForVmcp struct { + NotSupportedHost + + HostName string `xml:"hostName"` +} + +func init() { + t["NotSupportedHostForVmcp"] = reflect.TypeOf((*NotSupportedHostForVmcp)(nil)).Elem() +} + +type NotSupportedHostForVmcpFault NotSupportedHostForVmcp + +func init() { + t["NotSupportedHostForVmcpFault"] = reflect.TypeOf((*NotSupportedHostForVmcpFault)(nil)).Elem() +} + +type NotSupportedHostForVmemFile struct { + NotSupportedHost + + HostName string `xml:"hostName"` +} + +func init() { + t["NotSupportedHostForVmemFile"] = reflect.TypeOf((*NotSupportedHostForVmemFile)(nil)).Elem() +} + +type NotSupportedHostForVmemFileFault NotSupportedHostForVmemFile + +func init() { + t["NotSupportedHostForVmemFileFault"] = reflect.TypeOf((*NotSupportedHostForVmemFileFault)(nil)).Elem() +} + +type NotSupportedHostForVsan struct { + NotSupportedHost + + HostName string `xml:"hostName"` +} + +func init() { + t["NotSupportedHostForVsan"] = reflect.TypeOf((*NotSupportedHostForVsan)(nil)).Elem() +} + +type NotSupportedHostForVsanFault NotSupportedHostForVsan + +func init() { + t["NotSupportedHostForVsanFault"] = reflect.TypeOf((*NotSupportedHostForVsanFault)(nil)).Elem() +} + +type NotSupportedHostInCluster struct { + NotSupportedHost +} + +func init() { + t["NotSupportedHostInCluster"] = reflect.TypeOf((*NotSupportedHostInCluster)(nil)).Elem() +} + +type NotSupportedHostInClusterFault BaseNotSupportedHostInCluster + +func init() { + t["NotSupportedHostInClusterFault"] = reflect.TypeOf((*NotSupportedHostInClusterFault)(nil)).Elem() +} + +type NotSupportedHostInDvs struct { + NotSupportedHost + + SwitchProductSpec DistributedVirtualSwitchProductSpec `xml:"switchProductSpec"` +} + +func init() { + t["NotSupportedHostInDvs"] = reflect.TypeOf((*NotSupportedHostInDvs)(nil)).Elem() +} + +type NotSupportedHostInDvsFault NotSupportedHostInDvs + +func init() { + t["NotSupportedHostInDvsFault"] = reflect.TypeOf((*NotSupportedHostInDvsFault)(nil)).Elem() +} + +type NotSupportedHostInHACluster struct { + NotSupportedHost + + HostName string `xml:"hostName"` + Build string `xml:"build"` +} + +func init() { + t["NotSupportedHostInHACluster"] = reflect.TypeOf((*NotSupportedHostInHACluster)(nil)).Elem() +} + +type NotSupportedHostInHAClusterFault NotSupportedHostInHACluster + +func init() { + t["NotSupportedHostInHAClusterFault"] = reflect.TypeOf((*NotSupportedHostInHAClusterFault)(nil)).Elem() +} + +type NotUserConfigurableProperty struct { + VAppPropertyFault +} + +func init() { + t["NotUserConfigurableProperty"] = reflect.TypeOf((*NotUserConfigurableProperty)(nil)).Elem() +} + +type NotUserConfigurablePropertyFault NotUserConfigurableProperty + +func init() { + t["NotUserConfigurablePropertyFault"] = reflect.TypeOf((*NotUserConfigurablePropertyFault)(nil)).Elem() +} + +type NumPortsProfile struct { + ApplyProfile +} + +func init() { + t["NumPortsProfile"] = reflect.TypeOf((*NumPortsProfile)(nil)).Elem() +} + +type NumVirtualCoresPerSocketNotSupported struct { + VirtualHardwareCompatibilityIssue + + MaxSupportedCoresPerSocketDest int32 `xml:"maxSupportedCoresPerSocketDest"` + NumCoresPerSocketVm int32 `xml:"numCoresPerSocketVm"` +} + +func init() { + t["NumVirtualCoresPerSocketNotSupported"] = reflect.TypeOf((*NumVirtualCoresPerSocketNotSupported)(nil)).Elem() +} + +type NumVirtualCoresPerSocketNotSupportedFault NumVirtualCoresPerSocketNotSupported + +func init() { + t["NumVirtualCoresPerSocketNotSupportedFault"] = reflect.TypeOf((*NumVirtualCoresPerSocketNotSupportedFault)(nil)).Elem() +} + +type NumVirtualCpusExceedsLimit struct { + InsufficientResourcesFault + + MaxSupportedVcpus int32 `xml:"maxSupportedVcpus"` +} + +func init() { + t["NumVirtualCpusExceedsLimit"] = reflect.TypeOf((*NumVirtualCpusExceedsLimit)(nil)).Elem() +} + +type NumVirtualCpusExceedsLimitFault NumVirtualCpusExceedsLimit + +func init() { + t["NumVirtualCpusExceedsLimitFault"] = reflect.TypeOf((*NumVirtualCpusExceedsLimitFault)(nil)).Elem() +} + +type NumVirtualCpusIncompatible struct { + VmConfigFault + + Reason string `xml:"reason"` + NumCpu int32 `xml:"numCpu"` +} + +func init() { + t["NumVirtualCpusIncompatible"] = reflect.TypeOf((*NumVirtualCpusIncompatible)(nil)).Elem() +} + +type NumVirtualCpusIncompatibleFault NumVirtualCpusIncompatible + +func init() { + t["NumVirtualCpusIncompatibleFault"] = reflect.TypeOf((*NumVirtualCpusIncompatibleFault)(nil)).Elem() +} + +type NumVirtualCpusNotSupported struct { + VirtualHardwareCompatibilityIssue + + MaxSupportedVcpusDest int32 `xml:"maxSupportedVcpusDest"` + NumCpuVm int32 `xml:"numCpuVm"` +} + +func init() { + t["NumVirtualCpusNotSupported"] = reflect.TypeOf((*NumVirtualCpusNotSupported)(nil)).Elem() +} + +type NumVirtualCpusNotSupportedFault NumVirtualCpusNotSupported + +func init() { + t["NumVirtualCpusNotSupportedFault"] = reflect.TypeOf((*NumVirtualCpusNotSupportedFault)(nil)).Elem() +} + +type NumericRange struct { + DynamicData + + Start int32 `xml:"start"` + End int32 `xml:"end"` +} + +func init() { + t["NumericRange"] = reflect.TypeOf((*NumericRange)(nil)).Elem() +} + +type ObjectContent struct { + DynamicData + + Obj ManagedObjectReference `xml:"obj"` + PropSet []DynamicProperty `xml:"propSet,omitempty"` + MissingSet []MissingProperty `xml:"missingSet,omitempty"` +} + +func init() { + t["ObjectContent"] = reflect.TypeOf((*ObjectContent)(nil)).Elem() +} + +type ObjectSpec struct { + DynamicData + + Obj ManagedObjectReference `xml:"obj"` + Skip *bool `xml:"skip"` + SelectSet []BaseSelectionSpec `xml:"selectSet,omitempty,typeattr"` +} + +func init() { + t["ObjectSpec"] = reflect.TypeOf((*ObjectSpec)(nil)).Elem() +} + +type ObjectUpdate struct { + DynamicData + + Kind ObjectUpdateKind `xml:"kind"` + Obj ManagedObjectReference `xml:"obj"` + ChangeSet []PropertyChange `xml:"changeSet,omitempty"` + MissingSet []MissingProperty `xml:"missingSet,omitempty"` +} + +func init() { + t["ObjectUpdate"] = reflect.TypeOf((*ObjectUpdate)(nil)).Elem() +} + +type OnceTaskScheduler struct { + TaskScheduler + + RunAt *time.Time `xml:"runAt"` +} + +func init() { + t["OnceTaskScheduler"] = reflect.TypeOf((*OnceTaskScheduler)(nil)).Elem() +} + +type OpaqueNetworkSummary struct { + NetworkSummary + + OpaqueNetworkId string `xml:"opaqueNetworkId"` + OpaqueNetworkType string `xml:"opaqueNetworkType"` +} + +func init() { + t["OpaqueNetworkSummary"] = reflect.TypeOf((*OpaqueNetworkSummary)(nil)).Elem() +} + +type OpaqueNetworkTargetInfo struct { + VirtualMachineTargetInfo + + Network OpaqueNetworkSummary `xml:"network"` + NetworkReservationSupported *bool `xml:"networkReservationSupported"` +} + +func init() { + t["OpaqueNetworkTargetInfo"] = reflect.TypeOf((*OpaqueNetworkTargetInfo)(nil)).Elem() +} + +type OpenInventoryViewFolder OpenInventoryViewFolderRequestType + +func init() { + t["OpenInventoryViewFolder"] = reflect.TypeOf((*OpenInventoryViewFolder)(nil)).Elem() +} + +type OpenInventoryViewFolderRequestType struct { + This ManagedObjectReference `xml:"_this"` + Entity []ManagedObjectReference `xml:"entity"` +} + +func init() { + t["OpenInventoryViewFolderRequestType"] = reflect.TypeOf((*OpenInventoryViewFolderRequestType)(nil)).Elem() +} + +type OpenInventoryViewFolderResponse struct { + Returnval []ManagedObjectReference `xml:"returnval,omitempty"` +} + +type OperationDisabledByGuest struct { + GuestOperationsFault +} + +func init() { + t["OperationDisabledByGuest"] = reflect.TypeOf((*OperationDisabledByGuest)(nil)).Elem() +} + +type OperationDisabledByGuestFault OperationDisabledByGuest + +func init() { + t["OperationDisabledByGuestFault"] = reflect.TypeOf((*OperationDisabledByGuestFault)(nil)).Elem() +} + +type OperationDisallowedOnHost struct { + RuntimeFault +} + +func init() { + t["OperationDisallowedOnHost"] = reflect.TypeOf((*OperationDisallowedOnHost)(nil)).Elem() +} + +type OperationDisallowedOnHostFault OperationDisallowedOnHost + +func init() { + t["OperationDisallowedOnHostFault"] = reflect.TypeOf((*OperationDisallowedOnHostFault)(nil)).Elem() +} + +type OperationNotSupportedByGuest struct { + GuestOperationsFault +} + +func init() { + t["OperationNotSupportedByGuest"] = reflect.TypeOf((*OperationNotSupportedByGuest)(nil)).Elem() +} + +type OperationNotSupportedByGuestFault OperationNotSupportedByGuest + +func init() { + t["OperationNotSupportedByGuestFault"] = reflect.TypeOf((*OperationNotSupportedByGuestFault)(nil)).Elem() +} + +type OptionDef struct { + ElementDescription + + OptionType BaseOptionType `xml:"optionType,typeattr"` +} + +func init() { + t["OptionDef"] = reflect.TypeOf((*OptionDef)(nil)).Elem() +} + +type OptionProfile struct { + ApplyProfile + + Key string `xml:"key"` +} + +func init() { + t["OptionProfile"] = reflect.TypeOf((*OptionProfile)(nil)).Elem() +} + +type OptionType struct { + DynamicData + + ValueIsReadonly *bool `xml:"valueIsReadonly"` +} + +func init() { + t["OptionType"] = reflect.TypeOf((*OptionType)(nil)).Elem() +} + +type OptionValue struct { + DynamicData + + Key string `xml:"key"` + Value AnyType `xml:"value,omitempty,typeattr"` +} + +func init() { + t["OptionValue"] = reflect.TypeOf((*OptionValue)(nil)).Elem() +} + +type OrAlarmExpression struct { + AlarmExpression + + Expression []BaseAlarmExpression `xml:"expression,typeattr"` +} + +func init() { + t["OrAlarmExpression"] = reflect.TypeOf((*OrAlarmExpression)(nil)).Elem() +} + +type OutOfBounds struct { + VimFault + + ArgumentName string `xml:"argumentName"` +} + +func init() { + t["OutOfBounds"] = reflect.TypeOf((*OutOfBounds)(nil)).Elem() +} + +type OutOfBoundsFault OutOfBounds + +func init() { + t["OutOfBoundsFault"] = reflect.TypeOf((*OutOfBoundsFault)(nil)).Elem() +} + +type OutOfSyncDvsHost struct { + DvsEvent + + HostOutOfSync []DvsOutOfSyncHostArgument `xml:"hostOutOfSync"` +} + +func init() { + t["OutOfSyncDvsHost"] = reflect.TypeOf((*OutOfSyncDvsHost)(nil)).Elem() +} + +type OverwriteCustomizationSpec OverwriteCustomizationSpecRequestType + +func init() { + t["OverwriteCustomizationSpec"] = reflect.TypeOf((*OverwriteCustomizationSpec)(nil)).Elem() +} + +type OverwriteCustomizationSpecRequestType struct { + This ManagedObjectReference `xml:"_this"` + Item CustomizationSpecItem `xml:"item"` +} + +func init() { + t["OverwriteCustomizationSpecRequestType"] = reflect.TypeOf((*OverwriteCustomizationSpecRequestType)(nil)).Elem() +} + +type OverwriteCustomizationSpecResponse struct { +} + +type OvfAttribute struct { + OvfInvalidPackage + + ElementName string `xml:"elementName"` + AttributeName string `xml:"attributeName"` +} + +func init() { + t["OvfAttribute"] = reflect.TypeOf((*OvfAttribute)(nil)).Elem() +} + +type OvfAttributeFault BaseOvfAttribute + +func init() { + t["OvfAttributeFault"] = reflect.TypeOf((*OvfAttributeFault)(nil)).Elem() +} + +type OvfConnectedDevice struct { + OvfHardwareExport +} + +func init() { + t["OvfConnectedDevice"] = reflect.TypeOf((*OvfConnectedDevice)(nil)).Elem() +} + +type OvfConnectedDeviceFault BaseOvfConnectedDevice + +func init() { + t["OvfConnectedDeviceFault"] = reflect.TypeOf((*OvfConnectedDeviceFault)(nil)).Elem() +} + +type OvfConnectedDeviceFloppy struct { + OvfConnectedDevice + + Filename string `xml:"filename"` +} + +func init() { + t["OvfConnectedDeviceFloppy"] = reflect.TypeOf((*OvfConnectedDeviceFloppy)(nil)).Elem() +} + +type OvfConnectedDeviceFloppyFault OvfConnectedDeviceFloppy + +func init() { + t["OvfConnectedDeviceFloppyFault"] = reflect.TypeOf((*OvfConnectedDeviceFloppyFault)(nil)).Elem() +} + +type OvfConnectedDeviceIso struct { + OvfConnectedDevice + + Filename string `xml:"filename"` +} + +func init() { + t["OvfConnectedDeviceIso"] = reflect.TypeOf((*OvfConnectedDeviceIso)(nil)).Elem() +} + +type OvfConnectedDeviceIsoFault OvfConnectedDeviceIso + +func init() { + t["OvfConnectedDeviceIsoFault"] = reflect.TypeOf((*OvfConnectedDeviceIsoFault)(nil)).Elem() +} + +type OvfConstraint struct { + OvfInvalidPackage + + Name string `xml:"name"` +} + +func init() { + t["OvfConstraint"] = reflect.TypeOf((*OvfConstraint)(nil)).Elem() +} + +type OvfConstraintFault BaseOvfConstraint + +func init() { + t["OvfConstraintFault"] = reflect.TypeOf((*OvfConstraintFault)(nil)).Elem() +} + +type OvfConsumerCallbackFault struct { + OvfFault + + ExtensionKey string `xml:"extensionKey"` + ExtensionName string `xml:"extensionName"` +} + +func init() { + t["OvfConsumerCallbackFault"] = reflect.TypeOf((*OvfConsumerCallbackFault)(nil)).Elem() +} + +type OvfConsumerCallbackFaultFault BaseOvfConsumerCallbackFault + +func init() { + t["OvfConsumerCallbackFaultFault"] = reflect.TypeOf((*OvfConsumerCallbackFaultFault)(nil)).Elem() +} + +type OvfConsumerCommunicationError struct { + OvfConsumerCallbackFault + + Description string `xml:"description"` +} + +func init() { + t["OvfConsumerCommunicationError"] = reflect.TypeOf((*OvfConsumerCommunicationError)(nil)).Elem() +} + +type OvfConsumerCommunicationErrorFault OvfConsumerCommunicationError + +func init() { + t["OvfConsumerCommunicationErrorFault"] = reflect.TypeOf((*OvfConsumerCommunicationErrorFault)(nil)).Elem() +} + +type OvfConsumerFault struct { + OvfConsumerCallbackFault + + ErrorKey string `xml:"errorKey"` + Message string `xml:"message"` + Params []KeyValue `xml:"params,omitempty"` +} + +func init() { + t["OvfConsumerFault"] = reflect.TypeOf((*OvfConsumerFault)(nil)).Elem() +} + +type OvfConsumerFaultFault OvfConsumerFault + +func init() { + t["OvfConsumerFaultFault"] = reflect.TypeOf((*OvfConsumerFaultFault)(nil)).Elem() +} + +type OvfConsumerInvalidSection struct { + OvfConsumerCallbackFault + + LineNumber int32 `xml:"lineNumber"` + Description string `xml:"description"` +} + +func init() { + t["OvfConsumerInvalidSection"] = reflect.TypeOf((*OvfConsumerInvalidSection)(nil)).Elem() +} + +type OvfConsumerInvalidSectionFault OvfConsumerInvalidSection + +func init() { + t["OvfConsumerInvalidSectionFault"] = reflect.TypeOf((*OvfConsumerInvalidSectionFault)(nil)).Elem() +} + +type OvfConsumerOstNode struct { + DynamicData + + Id string `xml:"id"` + Type string `xml:"type"` + Section []OvfConsumerOvfSection `xml:"section,omitempty"` + Child []OvfConsumerOstNode `xml:"child,omitempty"` + Entity *ManagedObjectReference `xml:"entity,omitempty"` +} + +func init() { + t["OvfConsumerOstNode"] = reflect.TypeOf((*OvfConsumerOstNode)(nil)).Elem() +} + +type OvfConsumerOvfSection struct { + DynamicData + + LineNumber int32 `xml:"lineNumber"` + Xml string `xml:"xml"` +} + +func init() { + t["OvfConsumerOvfSection"] = reflect.TypeOf((*OvfConsumerOvfSection)(nil)).Elem() +} + +type OvfConsumerPowerOnFault struct { + InvalidState + + ExtensionKey string `xml:"extensionKey"` + ExtensionName string `xml:"extensionName"` + Description string `xml:"description"` +} + +func init() { + t["OvfConsumerPowerOnFault"] = reflect.TypeOf((*OvfConsumerPowerOnFault)(nil)).Elem() +} + +type OvfConsumerPowerOnFaultFault OvfConsumerPowerOnFault + +func init() { + t["OvfConsumerPowerOnFaultFault"] = reflect.TypeOf((*OvfConsumerPowerOnFaultFault)(nil)).Elem() +} + +type OvfConsumerUndeclaredSection struct { + OvfConsumerCallbackFault + + QualifiedSectionType string `xml:"qualifiedSectionType"` +} + +func init() { + t["OvfConsumerUndeclaredSection"] = reflect.TypeOf((*OvfConsumerUndeclaredSection)(nil)).Elem() +} + +type OvfConsumerUndeclaredSectionFault OvfConsumerUndeclaredSection + +func init() { + t["OvfConsumerUndeclaredSectionFault"] = reflect.TypeOf((*OvfConsumerUndeclaredSectionFault)(nil)).Elem() +} + +type OvfConsumerUndefinedPrefix struct { + OvfConsumerCallbackFault + + Prefix string `xml:"prefix"` +} + +func init() { + t["OvfConsumerUndefinedPrefix"] = reflect.TypeOf((*OvfConsumerUndefinedPrefix)(nil)).Elem() +} + +type OvfConsumerUndefinedPrefixFault OvfConsumerUndefinedPrefix + +func init() { + t["OvfConsumerUndefinedPrefixFault"] = reflect.TypeOf((*OvfConsumerUndefinedPrefixFault)(nil)).Elem() +} + +type OvfConsumerValidationFault struct { + VmConfigFault + + ExtensionKey string `xml:"extensionKey"` + ExtensionName string `xml:"extensionName"` + Message string `xml:"message"` +} + +func init() { + t["OvfConsumerValidationFault"] = reflect.TypeOf((*OvfConsumerValidationFault)(nil)).Elem() +} + +type OvfConsumerValidationFaultFault OvfConsumerValidationFault + +func init() { + t["OvfConsumerValidationFaultFault"] = reflect.TypeOf((*OvfConsumerValidationFaultFault)(nil)).Elem() +} + +type OvfCpuCompatibility struct { + OvfImport + + RegisterName string `xml:"registerName"` + Level int32 `xml:"level"` + RegisterValue string `xml:"registerValue"` + DesiredRegisterValue string `xml:"desiredRegisterValue"` +} + +func init() { + t["OvfCpuCompatibility"] = reflect.TypeOf((*OvfCpuCompatibility)(nil)).Elem() +} + +type OvfCpuCompatibilityCheckNotSupported struct { + OvfImport +} + +func init() { + t["OvfCpuCompatibilityCheckNotSupported"] = reflect.TypeOf((*OvfCpuCompatibilityCheckNotSupported)(nil)).Elem() +} + +type OvfCpuCompatibilityCheckNotSupportedFault OvfCpuCompatibilityCheckNotSupported + +func init() { + t["OvfCpuCompatibilityCheckNotSupportedFault"] = reflect.TypeOf((*OvfCpuCompatibilityCheckNotSupportedFault)(nil)).Elem() +} + +type OvfCpuCompatibilityFault OvfCpuCompatibility + +func init() { + t["OvfCpuCompatibilityFault"] = reflect.TypeOf((*OvfCpuCompatibilityFault)(nil)).Elem() +} + +type OvfCreateDescriptorParams struct { + DynamicData + + OvfFiles []OvfFile `xml:"ovfFiles,omitempty"` + Name string `xml:"name,omitempty"` + Description string `xml:"description,omitempty"` + IncludeImageFiles *bool `xml:"includeImageFiles"` + ExportOption []string `xml:"exportOption,omitempty"` + Snapshot *ManagedObjectReference `xml:"snapshot,omitempty"` +} + +func init() { + t["OvfCreateDescriptorParams"] = reflect.TypeOf((*OvfCreateDescriptorParams)(nil)).Elem() +} + +type OvfCreateDescriptorResult struct { + DynamicData + + OvfDescriptor string `xml:"ovfDescriptor"` + Error []LocalizedMethodFault `xml:"error,omitempty"` + Warning []LocalizedMethodFault `xml:"warning,omitempty"` + IncludeImageFiles *bool `xml:"includeImageFiles"` +} + +func init() { + t["OvfCreateDescriptorResult"] = reflect.TypeOf((*OvfCreateDescriptorResult)(nil)).Elem() +} + +type OvfCreateImportSpecParams struct { + OvfManagerCommonParams + + EntityName string `xml:"entityName"` + HostSystem *ManagedObjectReference `xml:"hostSystem,omitempty"` + NetworkMapping []OvfNetworkMapping `xml:"networkMapping,omitempty"` + IpAllocationPolicy string `xml:"ipAllocationPolicy,omitempty"` + IpProtocol string `xml:"ipProtocol,omitempty"` + PropertyMapping []KeyValue `xml:"propertyMapping,omitempty"` + ResourceMapping []OvfResourceMap `xml:"resourceMapping,omitempty"` + DiskProvisioning string `xml:"diskProvisioning,omitempty"` + InstantiationOst *OvfConsumerOstNode `xml:"instantiationOst,omitempty"` +} + +func init() { + t["OvfCreateImportSpecParams"] = reflect.TypeOf((*OvfCreateImportSpecParams)(nil)).Elem() +} + +type OvfCreateImportSpecResult struct { + DynamicData + + ImportSpec BaseImportSpec `xml:"importSpec,omitempty,typeattr"` + FileItem []OvfFileItem `xml:"fileItem,omitempty"` + Warning []LocalizedMethodFault `xml:"warning,omitempty"` + Error []LocalizedMethodFault `xml:"error,omitempty"` +} + +func init() { + t["OvfCreateImportSpecResult"] = reflect.TypeOf((*OvfCreateImportSpecResult)(nil)).Elem() +} + +type OvfDeploymentOption struct { + DynamicData + + Key string `xml:"key"` + Label string `xml:"label"` + Description string `xml:"description"` +} + +func init() { + t["OvfDeploymentOption"] = reflect.TypeOf((*OvfDeploymentOption)(nil)).Elem() +} + +type OvfDiskMappingNotFound struct { + OvfSystemFault + + DiskName string `xml:"diskName"` + VmName string `xml:"vmName"` +} + +func init() { + t["OvfDiskMappingNotFound"] = reflect.TypeOf((*OvfDiskMappingNotFound)(nil)).Elem() +} + +type OvfDiskMappingNotFoundFault OvfDiskMappingNotFound + +func init() { + t["OvfDiskMappingNotFoundFault"] = reflect.TypeOf((*OvfDiskMappingNotFoundFault)(nil)).Elem() +} + +type OvfDiskOrderConstraint struct { + OvfConstraint +} + +func init() { + t["OvfDiskOrderConstraint"] = reflect.TypeOf((*OvfDiskOrderConstraint)(nil)).Elem() +} + +type OvfDiskOrderConstraintFault OvfDiskOrderConstraint + +func init() { + t["OvfDiskOrderConstraintFault"] = reflect.TypeOf((*OvfDiskOrderConstraintFault)(nil)).Elem() +} + +type OvfDuplicateElement struct { + OvfElement +} + +func init() { + t["OvfDuplicateElement"] = reflect.TypeOf((*OvfDuplicateElement)(nil)).Elem() +} + +type OvfDuplicateElementFault OvfDuplicateElement + +func init() { + t["OvfDuplicateElementFault"] = reflect.TypeOf((*OvfDuplicateElementFault)(nil)).Elem() +} + +type OvfDuplicatedElementBoundary struct { + OvfElement + + Boundary string `xml:"boundary"` +} + +func init() { + t["OvfDuplicatedElementBoundary"] = reflect.TypeOf((*OvfDuplicatedElementBoundary)(nil)).Elem() +} + +type OvfDuplicatedElementBoundaryFault OvfDuplicatedElementBoundary + +func init() { + t["OvfDuplicatedElementBoundaryFault"] = reflect.TypeOf((*OvfDuplicatedElementBoundaryFault)(nil)).Elem() +} + +type OvfDuplicatedPropertyIdExport struct { + OvfExport + + Fqid string `xml:"fqid"` +} + +func init() { + t["OvfDuplicatedPropertyIdExport"] = reflect.TypeOf((*OvfDuplicatedPropertyIdExport)(nil)).Elem() +} + +type OvfDuplicatedPropertyIdExportFault OvfDuplicatedPropertyIdExport + +func init() { + t["OvfDuplicatedPropertyIdExportFault"] = reflect.TypeOf((*OvfDuplicatedPropertyIdExportFault)(nil)).Elem() +} + +type OvfDuplicatedPropertyIdImport struct { + OvfExport +} + +func init() { + t["OvfDuplicatedPropertyIdImport"] = reflect.TypeOf((*OvfDuplicatedPropertyIdImport)(nil)).Elem() +} + +type OvfDuplicatedPropertyIdImportFault OvfDuplicatedPropertyIdImport + +func init() { + t["OvfDuplicatedPropertyIdImportFault"] = reflect.TypeOf((*OvfDuplicatedPropertyIdImportFault)(nil)).Elem() +} + +type OvfElement struct { + OvfInvalidPackage + + Name string `xml:"name"` +} + +func init() { + t["OvfElement"] = reflect.TypeOf((*OvfElement)(nil)).Elem() +} + +type OvfElementFault BaseOvfElement + +func init() { + t["OvfElementFault"] = reflect.TypeOf((*OvfElementFault)(nil)).Elem() +} + +type OvfElementInvalidValue struct { + OvfElement + + Value string `xml:"value"` +} + +func init() { + t["OvfElementInvalidValue"] = reflect.TypeOf((*OvfElementInvalidValue)(nil)).Elem() +} + +type OvfElementInvalidValueFault OvfElementInvalidValue + +func init() { + t["OvfElementInvalidValueFault"] = reflect.TypeOf((*OvfElementInvalidValueFault)(nil)).Elem() +} + +type OvfExport struct { + OvfFault +} + +func init() { + t["OvfExport"] = reflect.TypeOf((*OvfExport)(nil)).Elem() +} + +type OvfExportFailed struct { + OvfExport +} + +func init() { + t["OvfExportFailed"] = reflect.TypeOf((*OvfExportFailed)(nil)).Elem() +} + +type OvfExportFailedFault OvfExportFailed + +func init() { + t["OvfExportFailedFault"] = reflect.TypeOf((*OvfExportFailedFault)(nil)).Elem() +} + +type OvfExportFault BaseOvfExport + +func init() { + t["OvfExportFault"] = reflect.TypeOf((*OvfExportFault)(nil)).Elem() +} + +type OvfFault struct { + VimFault +} + +func init() { + t["OvfFault"] = reflect.TypeOf((*OvfFault)(nil)).Elem() +} + +type OvfFaultFault BaseOvfFault + +func init() { + t["OvfFaultFault"] = reflect.TypeOf((*OvfFaultFault)(nil)).Elem() +} + +type OvfFile struct { + DynamicData + + DeviceId string `xml:"deviceId"` + Path string `xml:"path"` + CompressionMethod string `xml:"compressionMethod,omitempty"` + ChunkSize int64 `xml:"chunkSize,omitempty"` + Size int64 `xml:"size"` + Capacity int64 `xml:"capacity,omitempty"` + PopulatedSize int64 `xml:"populatedSize,omitempty"` +} + +func init() { + t["OvfFile"] = reflect.TypeOf((*OvfFile)(nil)).Elem() +} + +type OvfFileItem struct { + DynamicData + + DeviceId string `xml:"deviceId"` + Path string `xml:"path"` + CompressionMethod string `xml:"compressionMethod,omitempty"` + ChunkSize int64 `xml:"chunkSize,omitempty"` + Size int64 `xml:"size,omitempty"` + CimType int32 `xml:"cimType"` + Create bool `xml:"create"` +} + +func init() { + t["OvfFileItem"] = reflect.TypeOf((*OvfFileItem)(nil)).Elem() +} + +type OvfHardwareCheck struct { + OvfImport +} + +func init() { + t["OvfHardwareCheck"] = reflect.TypeOf((*OvfHardwareCheck)(nil)).Elem() +} + +type OvfHardwareCheckFault OvfHardwareCheck + +func init() { + t["OvfHardwareCheckFault"] = reflect.TypeOf((*OvfHardwareCheckFault)(nil)).Elem() +} + +type OvfHardwareExport struct { + OvfExport + + Device BaseVirtualDevice `xml:"device,omitempty,typeattr"` + VmPath string `xml:"vmPath"` +} + +func init() { + t["OvfHardwareExport"] = reflect.TypeOf((*OvfHardwareExport)(nil)).Elem() +} + +type OvfHardwareExportFault BaseOvfHardwareExport + +func init() { + t["OvfHardwareExportFault"] = reflect.TypeOf((*OvfHardwareExportFault)(nil)).Elem() +} + +type OvfHostResourceConstraint struct { + OvfConstraint + + Value string `xml:"value"` +} + +func init() { + t["OvfHostResourceConstraint"] = reflect.TypeOf((*OvfHostResourceConstraint)(nil)).Elem() +} + +type OvfHostResourceConstraintFault OvfHostResourceConstraint + +func init() { + t["OvfHostResourceConstraintFault"] = reflect.TypeOf((*OvfHostResourceConstraintFault)(nil)).Elem() +} + +type OvfHostValueNotParsed struct { + OvfSystemFault + + Property string `xml:"property"` + Value string `xml:"value"` +} + +func init() { + t["OvfHostValueNotParsed"] = reflect.TypeOf((*OvfHostValueNotParsed)(nil)).Elem() +} + +type OvfHostValueNotParsedFault OvfHostValueNotParsed + +func init() { + t["OvfHostValueNotParsedFault"] = reflect.TypeOf((*OvfHostValueNotParsedFault)(nil)).Elem() +} + +type OvfImport struct { + OvfFault +} + +func init() { + t["OvfImport"] = reflect.TypeOf((*OvfImport)(nil)).Elem() +} + +type OvfImportFailed struct { + OvfImport +} + +func init() { + t["OvfImportFailed"] = reflect.TypeOf((*OvfImportFailed)(nil)).Elem() +} + +type OvfImportFailedFault OvfImportFailed + +func init() { + t["OvfImportFailedFault"] = reflect.TypeOf((*OvfImportFailedFault)(nil)).Elem() +} + +type OvfImportFault BaseOvfImport + +func init() { + t["OvfImportFault"] = reflect.TypeOf((*OvfImportFault)(nil)).Elem() +} + +type OvfInternalError struct { + OvfSystemFault +} + +func init() { + t["OvfInternalError"] = reflect.TypeOf((*OvfInternalError)(nil)).Elem() +} + +type OvfInternalErrorFault OvfInternalError + +func init() { + t["OvfInternalErrorFault"] = reflect.TypeOf((*OvfInternalErrorFault)(nil)).Elem() +} + +type OvfInvalidPackage struct { + OvfFault + + LineNumber int32 `xml:"lineNumber"` +} + +func init() { + t["OvfInvalidPackage"] = reflect.TypeOf((*OvfInvalidPackage)(nil)).Elem() +} + +type OvfInvalidPackageFault BaseOvfInvalidPackage + +func init() { + t["OvfInvalidPackageFault"] = reflect.TypeOf((*OvfInvalidPackageFault)(nil)).Elem() +} + +type OvfInvalidValue struct { + OvfAttribute + + Value string `xml:"value"` +} + +func init() { + t["OvfInvalidValue"] = reflect.TypeOf((*OvfInvalidValue)(nil)).Elem() +} + +type OvfInvalidValueConfiguration struct { + OvfInvalidValue +} + +func init() { + t["OvfInvalidValueConfiguration"] = reflect.TypeOf((*OvfInvalidValueConfiguration)(nil)).Elem() +} + +type OvfInvalidValueConfigurationFault OvfInvalidValueConfiguration + +func init() { + t["OvfInvalidValueConfigurationFault"] = reflect.TypeOf((*OvfInvalidValueConfigurationFault)(nil)).Elem() +} + +type OvfInvalidValueEmpty struct { + OvfInvalidValue +} + +func init() { + t["OvfInvalidValueEmpty"] = reflect.TypeOf((*OvfInvalidValueEmpty)(nil)).Elem() +} + +type OvfInvalidValueEmptyFault OvfInvalidValueEmpty + +func init() { + t["OvfInvalidValueEmptyFault"] = reflect.TypeOf((*OvfInvalidValueEmptyFault)(nil)).Elem() +} + +type OvfInvalidValueFault BaseOvfInvalidValue + +func init() { + t["OvfInvalidValueFault"] = reflect.TypeOf((*OvfInvalidValueFault)(nil)).Elem() +} + +type OvfInvalidValueFormatMalformed struct { + OvfInvalidValue +} + +func init() { + t["OvfInvalidValueFormatMalformed"] = reflect.TypeOf((*OvfInvalidValueFormatMalformed)(nil)).Elem() +} + +type OvfInvalidValueFormatMalformedFault OvfInvalidValueFormatMalformed + +func init() { + t["OvfInvalidValueFormatMalformedFault"] = reflect.TypeOf((*OvfInvalidValueFormatMalformedFault)(nil)).Elem() +} + +type OvfInvalidValueReference struct { + OvfInvalidValue +} + +func init() { + t["OvfInvalidValueReference"] = reflect.TypeOf((*OvfInvalidValueReference)(nil)).Elem() +} + +type OvfInvalidValueReferenceFault OvfInvalidValueReference + +func init() { + t["OvfInvalidValueReferenceFault"] = reflect.TypeOf((*OvfInvalidValueReferenceFault)(nil)).Elem() +} + +type OvfInvalidVmName struct { + OvfUnsupportedPackage + + Name string `xml:"name"` +} + +func init() { + t["OvfInvalidVmName"] = reflect.TypeOf((*OvfInvalidVmName)(nil)).Elem() +} + +type OvfInvalidVmNameFault OvfInvalidVmName + +func init() { + t["OvfInvalidVmNameFault"] = reflect.TypeOf((*OvfInvalidVmNameFault)(nil)).Elem() +} + +type OvfManagerCommonParams struct { + DynamicData + + Locale string `xml:"locale"` + DeploymentOption string `xml:"deploymentOption"` + MsgBundle []KeyValue `xml:"msgBundle,omitempty"` + ImportOption []string `xml:"importOption,omitempty"` +} + +func init() { + t["OvfManagerCommonParams"] = reflect.TypeOf((*OvfManagerCommonParams)(nil)).Elem() +} + +type OvfMappedOsId struct { + OvfImport + + OvfId int32 `xml:"ovfId"` + OvfDescription string `xml:"ovfDescription"` + TargetDescription string `xml:"targetDescription"` +} + +func init() { + t["OvfMappedOsId"] = reflect.TypeOf((*OvfMappedOsId)(nil)).Elem() +} + +type OvfMappedOsIdFault OvfMappedOsId + +func init() { + t["OvfMappedOsIdFault"] = reflect.TypeOf((*OvfMappedOsIdFault)(nil)).Elem() +} + +type OvfMissingAttribute struct { + OvfAttribute +} + +func init() { + t["OvfMissingAttribute"] = reflect.TypeOf((*OvfMissingAttribute)(nil)).Elem() +} + +type OvfMissingAttributeFault OvfMissingAttribute + +func init() { + t["OvfMissingAttributeFault"] = reflect.TypeOf((*OvfMissingAttributeFault)(nil)).Elem() +} + +type OvfMissingElement struct { + OvfElement +} + +func init() { + t["OvfMissingElement"] = reflect.TypeOf((*OvfMissingElement)(nil)).Elem() +} + +type OvfMissingElementFault BaseOvfMissingElement + +func init() { + t["OvfMissingElementFault"] = reflect.TypeOf((*OvfMissingElementFault)(nil)).Elem() +} + +type OvfMissingElementNormalBoundary struct { + OvfMissingElement + + Boundary string `xml:"boundary"` +} + +func init() { + t["OvfMissingElementNormalBoundary"] = reflect.TypeOf((*OvfMissingElementNormalBoundary)(nil)).Elem() +} + +type OvfMissingElementNormalBoundaryFault OvfMissingElementNormalBoundary + +func init() { + t["OvfMissingElementNormalBoundaryFault"] = reflect.TypeOf((*OvfMissingElementNormalBoundaryFault)(nil)).Elem() +} + +type OvfMissingHardware struct { + OvfImport + + Name string `xml:"name"` + ResourceType int32 `xml:"resourceType"` +} + +func init() { + t["OvfMissingHardware"] = reflect.TypeOf((*OvfMissingHardware)(nil)).Elem() +} + +type OvfMissingHardwareFault OvfMissingHardware + +func init() { + t["OvfMissingHardwareFault"] = reflect.TypeOf((*OvfMissingHardwareFault)(nil)).Elem() +} + +type OvfNetworkInfo struct { + DynamicData + + Name string `xml:"name"` + Description string `xml:"description"` +} + +func init() { + t["OvfNetworkInfo"] = reflect.TypeOf((*OvfNetworkInfo)(nil)).Elem() +} + +type OvfNetworkMapping struct { + DynamicData + + Name string `xml:"name"` + Network ManagedObjectReference `xml:"network"` +} + +func init() { + t["OvfNetworkMapping"] = reflect.TypeOf((*OvfNetworkMapping)(nil)).Elem() +} + +type OvfNetworkMappingNotSupported struct { + OvfImport +} + +func init() { + t["OvfNetworkMappingNotSupported"] = reflect.TypeOf((*OvfNetworkMappingNotSupported)(nil)).Elem() +} + +type OvfNetworkMappingNotSupportedFault OvfNetworkMappingNotSupported + +func init() { + t["OvfNetworkMappingNotSupportedFault"] = reflect.TypeOf((*OvfNetworkMappingNotSupportedFault)(nil)).Elem() +} + +type OvfNoHostNic struct { + OvfUnsupportedPackage +} + +func init() { + t["OvfNoHostNic"] = reflect.TypeOf((*OvfNoHostNic)(nil)).Elem() +} + +type OvfNoHostNicFault OvfNoHostNic + +func init() { + t["OvfNoHostNicFault"] = reflect.TypeOf((*OvfNoHostNicFault)(nil)).Elem() +} + +type OvfNoSpaceOnController struct { + OvfUnsupportedElement + + Parent string `xml:"parent"` +} + +func init() { + t["OvfNoSpaceOnController"] = reflect.TypeOf((*OvfNoSpaceOnController)(nil)).Elem() +} + +type OvfNoSpaceOnControllerFault OvfNoSpaceOnController + +func init() { + t["OvfNoSpaceOnControllerFault"] = reflect.TypeOf((*OvfNoSpaceOnControllerFault)(nil)).Elem() +} + +type OvfNoSupportedHardwareFamily struct { + OvfUnsupportedPackage + + Version string `xml:"version"` +} + +func init() { + t["OvfNoSupportedHardwareFamily"] = reflect.TypeOf((*OvfNoSupportedHardwareFamily)(nil)).Elem() +} + +type OvfNoSupportedHardwareFamilyFault OvfNoSupportedHardwareFamily + +func init() { + t["OvfNoSupportedHardwareFamilyFault"] = reflect.TypeOf((*OvfNoSupportedHardwareFamilyFault)(nil)).Elem() +} + +type OvfOptionInfo struct { + DynamicData + + Option string `xml:"option"` + Description LocalizableMessage `xml:"description"` +} + +func init() { + t["OvfOptionInfo"] = reflect.TypeOf((*OvfOptionInfo)(nil)).Elem() +} + +type OvfParseDescriptorParams struct { + OvfManagerCommonParams +} + +func init() { + t["OvfParseDescriptorParams"] = reflect.TypeOf((*OvfParseDescriptorParams)(nil)).Elem() +} + +type OvfParseDescriptorResult struct { + DynamicData + + Eula []string `xml:"eula,omitempty"` + Network []OvfNetworkInfo `xml:"network,omitempty"` + IpAllocationScheme []string `xml:"ipAllocationScheme,omitempty"` + IpProtocols []string `xml:"ipProtocols,omitempty"` + Property []VAppPropertyInfo `xml:"property,omitempty"` + ProductInfo *VAppProductInfo `xml:"productInfo,omitempty"` + Annotation string `xml:"annotation"` + ApproximateDownloadSize int64 `xml:"approximateDownloadSize,omitempty"` + ApproximateFlatDeploymentSize int64 `xml:"approximateFlatDeploymentSize,omitempty"` + ApproximateSparseDeploymentSize int64 `xml:"approximateSparseDeploymentSize,omitempty"` + DefaultEntityName string `xml:"defaultEntityName"` + VirtualApp bool `xml:"virtualApp"` + DeploymentOption []OvfDeploymentOption `xml:"deploymentOption,omitempty"` + DefaultDeploymentOption string `xml:"defaultDeploymentOption"` + EntityName []KeyValue `xml:"entityName,omitempty"` + AnnotatedOst *OvfConsumerOstNode `xml:"annotatedOst,omitempty"` + Error []LocalizedMethodFault `xml:"error,omitempty"` + Warning []LocalizedMethodFault `xml:"warning,omitempty"` +} + +func init() { + t["OvfParseDescriptorResult"] = reflect.TypeOf((*OvfParseDescriptorResult)(nil)).Elem() +} + +type OvfProperty struct { + OvfInvalidPackage + + Type string `xml:"type"` + Value string `xml:"value"` +} + +func init() { + t["OvfProperty"] = reflect.TypeOf((*OvfProperty)(nil)).Elem() +} + +type OvfPropertyExport struct { + OvfExport + + Type string `xml:"type"` + Value string `xml:"value"` +} + +func init() { + t["OvfPropertyExport"] = reflect.TypeOf((*OvfPropertyExport)(nil)).Elem() +} + +type OvfPropertyExportFault OvfPropertyExport + +func init() { + t["OvfPropertyExportFault"] = reflect.TypeOf((*OvfPropertyExportFault)(nil)).Elem() +} + +type OvfPropertyFault BaseOvfProperty + +func init() { + t["OvfPropertyFault"] = reflect.TypeOf((*OvfPropertyFault)(nil)).Elem() +} + +type OvfPropertyNetwork struct { + OvfProperty +} + +func init() { + t["OvfPropertyNetwork"] = reflect.TypeOf((*OvfPropertyNetwork)(nil)).Elem() +} + +type OvfPropertyNetworkExport struct { + OvfExport + + Network string `xml:"network"` +} + +func init() { + t["OvfPropertyNetworkExport"] = reflect.TypeOf((*OvfPropertyNetworkExport)(nil)).Elem() +} + +type OvfPropertyNetworkExportFault OvfPropertyNetworkExport + +func init() { + t["OvfPropertyNetworkExportFault"] = reflect.TypeOf((*OvfPropertyNetworkExportFault)(nil)).Elem() +} + +type OvfPropertyNetworkFault OvfPropertyNetwork + +func init() { + t["OvfPropertyNetworkFault"] = reflect.TypeOf((*OvfPropertyNetworkFault)(nil)).Elem() +} + +type OvfPropertyQualifier struct { + OvfProperty + + Qualifier string `xml:"qualifier"` +} + +func init() { + t["OvfPropertyQualifier"] = reflect.TypeOf((*OvfPropertyQualifier)(nil)).Elem() +} + +type OvfPropertyQualifierDuplicate struct { + OvfProperty + + Qualifier string `xml:"qualifier"` +} + +func init() { + t["OvfPropertyQualifierDuplicate"] = reflect.TypeOf((*OvfPropertyQualifierDuplicate)(nil)).Elem() +} + +type OvfPropertyQualifierDuplicateFault OvfPropertyQualifierDuplicate + +func init() { + t["OvfPropertyQualifierDuplicateFault"] = reflect.TypeOf((*OvfPropertyQualifierDuplicateFault)(nil)).Elem() +} + +type OvfPropertyQualifierFault OvfPropertyQualifier + +func init() { + t["OvfPropertyQualifierFault"] = reflect.TypeOf((*OvfPropertyQualifierFault)(nil)).Elem() +} + +type OvfPropertyQualifierIgnored struct { + OvfProperty + + Qualifier string `xml:"qualifier"` +} + +func init() { + t["OvfPropertyQualifierIgnored"] = reflect.TypeOf((*OvfPropertyQualifierIgnored)(nil)).Elem() +} + +type OvfPropertyQualifierIgnoredFault OvfPropertyQualifierIgnored + +func init() { + t["OvfPropertyQualifierIgnoredFault"] = reflect.TypeOf((*OvfPropertyQualifierIgnoredFault)(nil)).Elem() +} + +type OvfPropertyType struct { + OvfProperty +} + +func init() { + t["OvfPropertyType"] = reflect.TypeOf((*OvfPropertyType)(nil)).Elem() +} + +type OvfPropertyTypeFault OvfPropertyType + +func init() { + t["OvfPropertyTypeFault"] = reflect.TypeOf((*OvfPropertyTypeFault)(nil)).Elem() +} + +type OvfPropertyValue struct { + OvfProperty +} + +func init() { + t["OvfPropertyValue"] = reflect.TypeOf((*OvfPropertyValue)(nil)).Elem() +} + +type OvfPropertyValueFault OvfPropertyValue + +func init() { + t["OvfPropertyValueFault"] = reflect.TypeOf((*OvfPropertyValueFault)(nil)).Elem() +} + +type OvfResourceMap struct { + DynamicData + + Source string `xml:"source"` + Parent *ManagedObjectReference `xml:"parent,omitempty"` + ResourceSpec *ResourceConfigSpec `xml:"resourceSpec,omitempty"` + Datastore *ManagedObjectReference `xml:"datastore,omitempty"` +} + +func init() { + t["OvfResourceMap"] = reflect.TypeOf((*OvfResourceMap)(nil)).Elem() +} + +type OvfSystemFault struct { + OvfFault +} + +func init() { + t["OvfSystemFault"] = reflect.TypeOf((*OvfSystemFault)(nil)).Elem() +} + +type OvfSystemFaultFault BaseOvfSystemFault + +func init() { + t["OvfSystemFaultFault"] = reflect.TypeOf((*OvfSystemFaultFault)(nil)).Elem() +} + +type OvfToXmlUnsupportedElement struct { + OvfSystemFault + + Name string `xml:"name,omitempty"` +} + +func init() { + t["OvfToXmlUnsupportedElement"] = reflect.TypeOf((*OvfToXmlUnsupportedElement)(nil)).Elem() +} + +type OvfToXmlUnsupportedElementFault OvfToXmlUnsupportedElement + +func init() { + t["OvfToXmlUnsupportedElementFault"] = reflect.TypeOf((*OvfToXmlUnsupportedElementFault)(nil)).Elem() +} + +type OvfUnableToExportDisk struct { + OvfHardwareExport + + DiskName string `xml:"diskName"` +} + +func init() { + t["OvfUnableToExportDisk"] = reflect.TypeOf((*OvfUnableToExportDisk)(nil)).Elem() +} + +type OvfUnableToExportDiskFault OvfUnableToExportDisk + +func init() { + t["OvfUnableToExportDiskFault"] = reflect.TypeOf((*OvfUnableToExportDiskFault)(nil)).Elem() +} + +type OvfUnexpectedElement struct { + OvfElement +} + +func init() { + t["OvfUnexpectedElement"] = reflect.TypeOf((*OvfUnexpectedElement)(nil)).Elem() +} + +type OvfUnexpectedElementFault OvfUnexpectedElement + +func init() { + t["OvfUnexpectedElementFault"] = reflect.TypeOf((*OvfUnexpectedElementFault)(nil)).Elem() +} + +type OvfUnknownDevice struct { + OvfSystemFault + + Device BaseVirtualDevice `xml:"device,omitempty,typeattr"` + VmName string `xml:"vmName"` +} + +func init() { + t["OvfUnknownDevice"] = reflect.TypeOf((*OvfUnknownDevice)(nil)).Elem() +} + +type OvfUnknownDeviceBacking struct { + OvfHardwareExport + + Backing BaseVirtualDeviceBackingInfo `xml:"backing,typeattr"` +} + +func init() { + t["OvfUnknownDeviceBacking"] = reflect.TypeOf((*OvfUnknownDeviceBacking)(nil)).Elem() +} + +type OvfUnknownDeviceBackingFault OvfUnknownDeviceBacking + +func init() { + t["OvfUnknownDeviceBackingFault"] = reflect.TypeOf((*OvfUnknownDeviceBackingFault)(nil)).Elem() +} + +type OvfUnknownDeviceFault OvfUnknownDevice + +func init() { + t["OvfUnknownDeviceFault"] = reflect.TypeOf((*OvfUnknownDeviceFault)(nil)).Elem() +} + +type OvfUnknownEntity struct { + OvfSystemFault + + LineNumber int32 `xml:"lineNumber"` +} + +func init() { + t["OvfUnknownEntity"] = reflect.TypeOf((*OvfUnknownEntity)(nil)).Elem() +} + +type OvfUnknownEntityFault OvfUnknownEntity + +func init() { + t["OvfUnknownEntityFault"] = reflect.TypeOf((*OvfUnknownEntityFault)(nil)).Elem() +} + +type OvfUnsupportedAttribute struct { + OvfUnsupportedPackage + + ElementName string `xml:"elementName"` + AttributeName string `xml:"attributeName"` +} + +func init() { + t["OvfUnsupportedAttribute"] = reflect.TypeOf((*OvfUnsupportedAttribute)(nil)).Elem() +} + +type OvfUnsupportedAttributeFault BaseOvfUnsupportedAttribute + +func init() { + t["OvfUnsupportedAttributeFault"] = reflect.TypeOf((*OvfUnsupportedAttributeFault)(nil)).Elem() +} + +type OvfUnsupportedAttributeValue struct { + OvfUnsupportedAttribute + + Value string `xml:"value"` +} + +func init() { + t["OvfUnsupportedAttributeValue"] = reflect.TypeOf((*OvfUnsupportedAttributeValue)(nil)).Elem() +} + +type OvfUnsupportedAttributeValueFault OvfUnsupportedAttributeValue + +func init() { + t["OvfUnsupportedAttributeValueFault"] = reflect.TypeOf((*OvfUnsupportedAttributeValueFault)(nil)).Elem() +} + +type OvfUnsupportedDeviceBackingInfo struct { + OvfSystemFault + + ElementName string `xml:"elementName,omitempty"` + InstanceId string `xml:"instanceId,omitempty"` + DeviceName string `xml:"deviceName"` + BackingName string `xml:"backingName,omitempty"` +} + +func init() { + t["OvfUnsupportedDeviceBackingInfo"] = reflect.TypeOf((*OvfUnsupportedDeviceBackingInfo)(nil)).Elem() +} + +type OvfUnsupportedDeviceBackingInfoFault OvfUnsupportedDeviceBackingInfo + +func init() { + t["OvfUnsupportedDeviceBackingInfoFault"] = reflect.TypeOf((*OvfUnsupportedDeviceBackingInfoFault)(nil)).Elem() +} + +type OvfUnsupportedDeviceBackingOption struct { + OvfSystemFault + + ElementName string `xml:"elementName,omitempty"` + InstanceId string `xml:"instanceId,omitempty"` + DeviceName string `xml:"deviceName"` + BackingName string `xml:"backingName,omitempty"` +} + +func init() { + t["OvfUnsupportedDeviceBackingOption"] = reflect.TypeOf((*OvfUnsupportedDeviceBackingOption)(nil)).Elem() +} + +type OvfUnsupportedDeviceBackingOptionFault OvfUnsupportedDeviceBackingOption + +func init() { + t["OvfUnsupportedDeviceBackingOptionFault"] = reflect.TypeOf((*OvfUnsupportedDeviceBackingOptionFault)(nil)).Elem() +} + +type OvfUnsupportedDeviceExport struct { + OvfHardwareExport +} + +func init() { + t["OvfUnsupportedDeviceExport"] = reflect.TypeOf((*OvfUnsupportedDeviceExport)(nil)).Elem() +} + +type OvfUnsupportedDeviceExportFault OvfUnsupportedDeviceExport + +func init() { + t["OvfUnsupportedDeviceExportFault"] = reflect.TypeOf((*OvfUnsupportedDeviceExportFault)(nil)).Elem() +} + +type OvfUnsupportedDiskProvisioning struct { + OvfImport + + DiskProvisioning string `xml:"diskProvisioning"` + SupportedDiskProvisioning string `xml:"supportedDiskProvisioning"` +} + +func init() { + t["OvfUnsupportedDiskProvisioning"] = reflect.TypeOf((*OvfUnsupportedDiskProvisioning)(nil)).Elem() +} + +type OvfUnsupportedDiskProvisioningFault OvfUnsupportedDiskProvisioning + +func init() { + t["OvfUnsupportedDiskProvisioningFault"] = reflect.TypeOf((*OvfUnsupportedDiskProvisioningFault)(nil)).Elem() +} + +type OvfUnsupportedElement struct { + OvfUnsupportedPackage + + Name string `xml:"name"` +} + +func init() { + t["OvfUnsupportedElement"] = reflect.TypeOf((*OvfUnsupportedElement)(nil)).Elem() +} + +type OvfUnsupportedElementFault BaseOvfUnsupportedElement + +func init() { + t["OvfUnsupportedElementFault"] = reflect.TypeOf((*OvfUnsupportedElementFault)(nil)).Elem() +} + +type OvfUnsupportedElementValue struct { + OvfUnsupportedElement + + Value string `xml:"value"` +} + +func init() { + t["OvfUnsupportedElementValue"] = reflect.TypeOf((*OvfUnsupportedElementValue)(nil)).Elem() +} + +type OvfUnsupportedElementValueFault OvfUnsupportedElementValue + +func init() { + t["OvfUnsupportedElementValueFault"] = reflect.TypeOf((*OvfUnsupportedElementValueFault)(nil)).Elem() +} + +type OvfUnsupportedPackage struct { + OvfFault + + LineNumber int32 `xml:"lineNumber,omitempty"` +} + +func init() { + t["OvfUnsupportedPackage"] = reflect.TypeOf((*OvfUnsupportedPackage)(nil)).Elem() +} + +type OvfUnsupportedPackageFault BaseOvfUnsupportedPackage + +func init() { + t["OvfUnsupportedPackageFault"] = reflect.TypeOf((*OvfUnsupportedPackageFault)(nil)).Elem() +} + +type OvfUnsupportedSection struct { + OvfUnsupportedElement + + Info string `xml:"info"` +} + +func init() { + t["OvfUnsupportedSection"] = reflect.TypeOf((*OvfUnsupportedSection)(nil)).Elem() +} + +type OvfUnsupportedSectionFault OvfUnsupportedSection + +func init() { + t["OvfUnsupportedSectionFault"] = reflect.TypeOf((*OvfUnsupportedSectionFault)(nil)).Elem() +} + +type OvfUnsupportedSubType struct { + OvfUnsupportedPackage + + ElementName string `xml:"elementName"` + InstanceId string `xml:"instanceId"` + DeviceType int32 `xml:"deviceType"` + DeviceSubType string `xml:"deviceSubType"` +} + +func init() { + t["OvfUnsupportedSubType"] = reflect.TypeOf((*OvfUnsupportedSubType)(nil)).Elem() +} + +type OvfUnsupportedSubTypeFault OvfUnsupportedSubType + +func init() { + t["OvfUnsupportedSubTypeFault"] = reflect.TypeOf((*OvfUnsupportedSubTypeFault)(nil)).Elem() +} + +type OvfUnsupportedType struct { + OvfUnsupportedPackage + + Name string `xml:"name"` + InstanceId string `xml:"instanceId"` + DeviceType int32 `xml:"deviceType"` +} + +func init() { + t["OvfUnsupportedType"] = reflect.TypeOf((*OvfUnsupportedType)(nil)).Elem() +} + +type OvfUnsupportedTypeFault OvfUnsupportedType + +func init() { + t["OvfUnsupportedTypeFault"] = reflect.TypeOf((*OvfUnsupportedTypeFault)(nil)).Elem() +} + +type OvfValidateHostParams struct { + OvfManagerCommonParams +} + +func init() { + t["OvfValidateHostParams"] = reflect.TypeOf((*OvfValidateHostParams)(nil)).Elem() +} + +type OvfValidateHostResult struct { + DynamicData + + DownloadSize int64 `xml:"downloadSize,omitempty"` + FlatDeploymentSize int64 `xml:"flatDeploymentSize,omitempty"` + SparseDeploymentSize int64 `xml:"sparseDeploymentSize,omitempty"` + Error []LocalizedMethodFault `xml:"error,omitempty"` + Warning []LocalizedMethodFault `xml:"warning,omitempty"` + SupportedDiskProvisioning []string `xml:"supportedDiskProvisioning,omitempty"` +} + +func init() { + t["OvfValidateHostResult"] = reflect.TypeOf((*OvfValidateHostResult)(nil)).Elem() +} + +type OvfWrongElement struct { + OvfElement +} + +func init() { + t["OvfWrongElement"] = reflect.TypeOf((*OvfWrongElement)(nil)).Elem() +} + +type OvfWrongElementFault OvfWrongElement + +func init() { + t["OvfWrongElementFault"] = reflect.TypeOf((*OvfWrongElementFault)(nil)).Elem() +} + +type OvfWrongNamespace struct { + OvfInvalidPackage + + NamespaceName string `xml:"namespaceName"` +} + +func init() { + t["OvfWrongNamespace"] = reflect.TypeOf((*OvfWrongNamespace)(nil)).Elem() +} + +type OvfWrongNamespaceFault OvfWrongNamespace + +func init() { + t["OvfWrongNamespaceFault"] = reflect.TypeOf((*OvfWrongNamespaceFault)(nil)).Elem() +} + +type OvfXmlFormat struct { + OvfInvalidPackage + + Description string `xml:"description"` +} + +func init() { + t["OvfXmlFormat"] = reflect.TypeOf((*OvfXmlFormat)(nil)).Elem() +} + +type OvfXmlFormatFault OvfXmlFormat + +func init() { + t["OvfXmlFormatFault"] = reflect.TypeOf((*OvfXmlFormatFault)(nil)).Elem() +} + +type ParaVirtualSCSIController struct { + VirtualSCSIController +} + +func init() { + t["ParaVirtualSCSIController"] = reflect.TypeOf((*ParaVirtualSCSIController)(nil)).Elem() +} + +type ParaVirtualSCSIControllerOption struct { + VirtualSCSIControllerOption +} + +func init() { + t["ParaVirtualSCSIControllerOption"] = reflect.TypeOf((*ParaVirtualSCSIControllerOption)(nil)).Elem() +} + +type ParseDescriptor ParseDescriptorRequestType + +func init() { + t["ParseDescriptor"] = reflect.TypeOf((*ParseDescriptor)(nil)).Elem() +} + +type ParseDescriptorRequestType struct { + This ManagedObjectReference `xml:"_this"` + OvfDescriptor string `xml:"ovfDescriptor"` + Pdp OvfParseDescriptorParams `xml:"pdp"` +} + +func init() { + t["ParseDescriptorRequestType"] = reflect.TypeOf((*ParseDescriptorRequestType)(nil)).Elem() +} + +type ParseDescriptorResponse struct { + Returnval OvfParseDescriptorResult `xml:"returnval"` +} + +type PasswordField struct { + DynamicData + + Value string `xml:"value"` +} + +func init() { + t["PasswordField"] = reflect.TypeOf((*PasswordField)(nil)).Elem() +} + +type PatchAlreadyInstalled struct { + PatchNotApplicable +} + +func init() { + t["PatchAlreadyInstalled"] = reflect.TypeOf((*PatchAlreadyInstalled)(nil)).Elem() +} + +type PatchAlreadyInstalledFault PatchAlreadyInstalled + +func init() { + t["PatchAlreadyInstalledFault"] = reflect.TypeOf((*PatchAlreadyInstalledFault)(nil)).Elem() +} + +type PatchBinariesNotFound struct { + VimFault + + PatchID string `xml:"patchID"` + Binary []string `xml:"binary,omitempty"` +} + +func init() { + t["PatchBinariesNotFound"] = reflect.TypeOf((*PatchBinariesNotFound)(nil)).Elem() +} + +type PatchBinariesNotFoundFault PatchBinariesNotFound + +func init() { + t["PatchBinariesNotFoundFault"] = reflect.TypeOf((*PatchBinariesNotFoundFault)(nil)).Elem() +} + +type PatchInstallFailed struct { + PlatformConfigFault + + RolledBack bool `xml:"rolledBack"` +} + +func init() { + t["PatchInstallFailed"] = reflect.TypeOf((*PatchInstallFailed)(nil)).Elem() +} + +type PatchInstallFailedFault PatchInstallFailed + +func init() { + t["PatchInstallFailedFault"] = reflect.TypeOf((*PatchInstallFailedFault)(nil)).Elem() +} + +type PatchIntegrityError struct { + PlatformConfigFault +} + +func init() { + t["PatchIntegrityError"] = reflect.TypeOf((*PatchIntegrityError)(nil)).Elem() +} + +type PatchIntegrityErrorFault PatchIntegrityError + +func init() { + t["PatchIntegrityErrorFault"] = reflect.TypeOf((*PatchIntegrityErrorFault)(nil)).Elem() +} + +type PatchMetadataCorrupted struct { + PatchMetadataInvalid +} + +func init() { + t["PatchMetadataCorrupted"] = reflect.TypeOf((*PatchMetadataCorrupted)(nil)).Elem() +} + +type PatchMetadataCorruptedFault PatchMetadataCorrupted + +func init() { + t["PatchMetadataCorruptedFault"] = reflect.TypeOf((*PatchMetadataCorruptedFault)(nil)).Elem() +} + +type PatchMetadataInvalid struct { + VimFault + + PatchID string `xml:"patchID"` + MetaData []string `xml:"metaData,omitempty"` +} + +func init() { + t["PatchMetadataInvalid"] = reflect.TypeOf((*PatchMetadataInvalid)(nil)).Elem() +} + +type PatchMetadataInvalidFault BasePatchMetadataInvalid + +func init() { + t["PatchMetadataInvalidFault"] = reflect.TypeOf((*PatchMetadataInvalidFault)(nil)).Elem() +} + +type PatchMetadataNotFound struct { + PatchMetadataInvalid +} + +func init() { + t["PatchMetadataNotFound"] = reflect.TypeOf((*PatchMetadataNotFound)(nil)).Elem() +} + +type PatchMetadataNotFoundFault PatchMetadataNotFound + +func init() { + t["PatchMetadataNotFoundFault"] = reflect.TypeOf((*PatchMetadataNotFoundFault)(nil)).Elem() +} + +type PatchMissingDependencies struct { + PatchNotApplicable + + PrerequisitePatch []string `xml:"prerequisitePatch,omitempty"` + PrerequisiteLib []string `xml:"prerequisiteLib,omitempty"` +} + +func init() { + t["PatchMissingDependencies"] = reflect.TypeOf((*PatchMissingDependencies)(nil)).Elem() +} + +type PatchMissingDependenciesFault PatchMissingDependencies + +func init() { + t["PatchMissingDependenciesFault"] = reflect.TypeOf((*PatchMissingDependenciesFault)(nil)).Elem() +} + +type PatchNotApplicable struct { + VimFault + + PatchID string `xml:"patchID"` +} + +func init() { + t["PatchNotApplicable"] = reflect.TypeOf((*PatchNotApplicable)(nil)).Elem() +} + +type PatchNotApplicableFault BasePatchNotApplicable + +func init() { + t["PatchNotApplicableFault"] = reflect.TypeOf((*PatchNotApplicableFault)(nil)).Elem() +} + +type PatchSuperseded struct { + PatchNotApplicable + + Supersede []string `xml:"supersede,omitempty"` +} + +func init() { + t["PatchSuperseded"] = reflect.TypeOf((*PatchSuperseded)(nil)).Elem() +} + +type PatchSupersededFault PatchSuperseded + +func init() { + t["PatchSupersededFault"] = reflect.TypeOf((*PatchSupersededFault)(nil)).Elem() +} + +type PerfCompositeMetric struct { + DynamicData + + Entity BasePerfEntityMetricBase `xml:"entity,omitempty,typeattr"` + ChildEntity []BasePerfEntityMetricBase `xml:"childEntity,omitempty,typeattr"` +} + +func init() { + t["PerfCompositeMetric"] = reflect.TypeOf((*PerfCompositeMetric)(nil)).Elem() +} + +type PerfCounterInfo struct { + DynamicData + + Key int32 `xml:"key"` + NameInfo BaseElementDescription `xml:"nameInfo,typeattr"` + GroupInfo BaseElementDescription `xml:"groupInfo,typeattr"` + UnitInfo BaseElementDescription `xml:"unitInfo,typeattr"` + RollupType PerfSummaryType `xml:"rollupType"` + StatsType PerfStatsType `xml:"statsType"` + Level int32 `xml:"level,omitempty"` + PerDeviceLevel int32 `xml:"perDeviceLevel,omitempty"` + AssociatedCounterId []int32 `xml:"associatedCounterId,omitempty"` +} + +func init() { + t["PerfCounterInfo"] = reflect.TypeOf((*PerfCounterInfo)(nil)).Elem() +} + +type PerfEntityMetric struct { + PerfEntityMetricBase + + SampleInfo []PerfSampleInfo `xml:"sampleInfo,omitempty"` + Value []BasePerfMetricSeries `xml:"value,omitempty,typeattr"` +} + +func init() { + t["PerfEntityMetric"] = reflect.TypeOf((*PerfEntityMetric)(nil)).Elem() +} + +type PerfEntityMetricBase struct { + DynamicData + + Entity ManagedObjectReference `xml:"entity"` +} + +func init() { + t["PerfEntityMetricBase"] = reflect.TypeOf((*PerfEntityMetricBase)(nil)).Elem() +} + +type PerfEntityMetricCSV struct { + PerfEntityMetricBase + + SampleInfoCSV string `xml:"sampleInfoCSV"` + Value []PerfMetricSeriesCSV `xml:"value,omitempty"` +} + +func init() { + t["PerfEntityMetricCSV"] = reflect.TypeOf((*PerfEntityMetricCSV)(nil)).Elem() +} + +type PerfInterval struct { + DynamicData + + Key int32 `xml:"key"` + SamplingPeriod int32 `xml:"samplingPeriod"` + Name string `xml:"name"` + Length int32 `xml:"length"` + Level int32 `xml:"level,omitempty"` + Enabled bool `xml:"enabled"` +} + +func init() { + t["PerfInterval"] = reflect.TypeOf((*PerfInterval)(nil)).Elem() +} + +type PerfMetricId struct { + DynamicData + + CounterId int32 `xml:"counterId"` + Instance string `xml:"instance"` +} + +func init() { + t["PerfMetricId"] = reflect.TypeOf((*PerfMetricId)(nil)).Elem() +} + +type PerfMetricIntSeries struct { + PerfMetricSeries + + Value []int64 `xml:"value,omitempty"` +} + +func init() { + t["PerfMetricIntSeries"] = reflect.TypeOf((*PerfMetricIntSeries)(nil)).Elem() +} + +type PerfMetricSeries struct { + DynamicData + + Id PerfMetricId `xml:"id"` +} + +func init() { + t["PerfMetricSeries"] = reflect.TypeOf((*PerfMetricSeries)(nil)).Elem() +} + +type PerfMetricSeriesCSV struct { + PerfMetricSeries + + Value string `xml:"value,omitempty"` +} + +func init() { + t["PerfMetricSeriesCSV"] = reflect.TypeOf((*PerfMetricSeriesCSV)(nil)).Elem() +} + +type PerfProviderSummary struct { + DynamicData + + Entity ManagedObjectReference `xml:"entity"` + CurrentSupported bool `xml:"currentSupported"` + SummarySupported bool `xml:"summarySupported"` + RefreshRate int32 `xml:"refreshRate,omitempty"` +} + +func init() { + t["PerfProviderSummary"] = reflect.TypeOf((*PerfProviderSummary)(nil)).Elem() +} + +type PerfQuerySpec struct { + DynamicData + + Entity ManagedObjectReference `xml:"entity"` + StartTime *time.Time `xml:"startTime"` + EndTime *time.Time `xml:"endTime"` + MaxSample int32 `xml:"maxSample,omitempty"` + MetricId []PerfMetricId `xml:"metricId,omitempty"` + IntervalId int32 `xml:"intervalId,omitempty"` + Format string `xml:"format,omitempty"` +} + +func init() { + t["PerfQuerySpec"] = reflect.TypeOf((*PerfQuerySpec)(nil)).Elem() +} + +type PerfSampleInfo struct { + DynamicData + + Timestamp time.Time `xml:"timestamp"` + Interval int32 `xml:"interval"` +} + +func init() { + t["PerfSampleInfo"] = reflect.TypeOf((*PerfSampleInfo)(nil)).Elem() +} + +type PerformDvsProductSpecOperationRequestType struct { + This ManagedObjectReference `xml:"_this"` + Operation string `xml:"operation"` + ProductSpec *DistributedVirtualSwitchProductSpec `xml:"productSpec,omitempty"` +} + +func init() { + t["PerformDvsProductSpecOperationRequestType"] = reflect.TypeOf((*PerformDvsProductSpecOperationRequestType)(nil)).Elem() +} + +type PerformDvsProductSpecOperation_Task PerformDvsProductSpecOperationRequestType + +func init() { + t["PerformDvsProductSpecOperation_Task"] = reflect.TypeOf((*PerformDvsProductSpecOperation_Task)(nil)).Elem() +} + +type PerformDvsProductSpecOperation_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type PerformVsanUpgradePreflightCheck PerformVsanUpgradePreflightCheckRequestType + +func init() { + t["PerformVsanUpgradePreflightCheck"] = reflect.TypeOf((*PerformVsanUpgradePreflightCheck)(nil)).Elem() +} + +type PerformVsanUpgradePreflightCheckRequestType struct { + This ManagedObjectReference `xml:"_this"` + Cluster ManagedObjectReference `xml:"cluster"` + DowngradeFormat *bool `xml:"downgradeFormat"` +} + +func init() { + t["PerformVsanUpgradePreflightCheckRequestType"] = reflect.TypeOf((*PerformVsanUpgradePreflightCheckRequestType)(nil)).Elem() +} + +type PerformVsanUpgradePreflightCheckResponse struct { + Returnval VsanUpgradeSystemPreflightCheckResult `xml:"returnval"` +} + +type PerformVsanUpgradeRequestType struct { + This ManagedObjectReference `xml:"_this"` + Cluster ManagedObjectReference `xml:"cluster"` + PerformObjectUpgrade *bool `xml:"performObjectUpgrade"` + DowngradeFormat *bool `xml:"downgradeFormat"` + AllowReducedRedundancy *bool `xml:"allowReducedRedundancy"` + ExcludeHosts []ManagedObjectReference `xml:"excludeHosts,omitempty"` +} + +func init() { + t["PerformVsanUpgradeRequestType"] = reflect.TypeOf((*PerformVsanUpgradeRequestType)(nil)).Elem() +} + +type PerformVsanUpgrade_Task PerformVsanUpgradeRequestType + +func init() { + t["PerformVsanUpgrade_Task"] = reflect.TypeOf((*PerformVsanUpgrade_Task)(nil)).Elem() +} + +type PerformVsanUpgrade_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type PerformanceDescription struct { + DynamicData + + CounterType []BaseElementDescription `xml:"counterType,typeattr"` + StatsType []BaseElementDescription `xml:"statsType,typeattr"` +} + +func init() { + t["PerformanceDescription"] = reflect.TypeOf((*PerformanceDescription)(nil)).Elem() +} + +type PerformanceManagerCounterLevelMapping struct { + DynamicData + + CounterId int32 `xml:"counterId"` + AggregateLevel int32 `xml:"aggregateLevel,omitempty"` + PerDeviceLevel int32 `xml:"perDeviceLevel,omitempty"` +} + +func init() { + t["PerformanceManagerCounterLevelMapping"] = reflect.TypeOf((*PerformanceManagerCounterLevelMapping)(nil)).Elem() +} + +type PerformanceStatisticsDescription struct { + DynamicData + + Intervals []PerfInterval `xml:"intervals,omitempty"` +} + +func init() { + t["PerformanceStatisticsDescription"] = reflect.TypeOf((*PerformanceStatisticsDescription)(nil)).Elem() +} + +type Permission struct { + DynamicData + + Entity *ManagedObjectReference `xml:"entity,omitempty"` + Principal string `xml:"principal"` + Group bool `xml:"group"` + RoleId int32 `xml:"roleId"` + Propagate bool `xml:"propagate"` +} + +func init() { + t["Permission"] = reflect.TypeOf((*Permission)(nil)).Elem() +} + +type PermissionAddedEvent struct { + PermissionEvent + + Role RoleEventArgument `xml:"role"` + Propagate bool `xml:"propagate"` +} + +func init() { + t["PermissionAddedEvent"] = reflect.TypeOf((*PermissionAddedEvent)(nil)).Elem() +} + +type PermissionEvent struct { + AuthorizationEvent + + Entity ManagedEntityEventArgument `xml:"entity"` + Principal string `xml:"principal"` + Group bool `xml:"group"` +} + +func init() { + t["PermissionEvent"] = reflect.TypeOf((*PermissionEvent)(nil)).Elem() +} + +type PermissionProfile struct { + ApplyProfile + + Key string `xml:"key"` +} + +func init() { + t["PermissionProfile"] = reflect.TypeOf((*PermissionProfile)(nil)).Elem() +} + +type PermissionRemovedEvent struct { + PermissionEvent +} + +func init() { + t["PermissionRemovedEvent"] = reflect.TypeOf((*PermissionRemovedEvent)(nil)).Elem() +} + +type PermissionUpdatedEvent struct { + PermissionEvent + + Role RoleEventArgument `xml:"role"` + Propagate bool `xml:"propagate"` +} + +func init() { + t["PermissionUpdatedEvent"] = reflect.TypeOf((*PermissionUpdatedEvent)(nil)).Elem() +} + +type PhysCompatRDMNotSupported struct { + RDMNotSupported +} + +func init() { + t["PhysCompatRDMNotSupported"] = reflect.TypeOf((*PhysCompatRDMNotSupported)(nil)).Elem() +} + +type PhysCompatRDMNotSupportedFault PhysCompatRDMNotSupported + +func init() { + t["PhysCompatRDMNotSupportedFault"] = reflect.TypeOf((*PhysCompatRDMNotSupportedFault)(nil)).Elem() +} + +type PhysicalNic struct { + DynamicData + + Key string `xml:"key,omitempty"` + Device string `xml:"device"` + Pci string `xml:"pci"` + Driver string `xml:"driver,omitempty"` + LinkSpeed *PhysicalNicLinkInfo `xml:"linkSpeed,omitempty"` + ValidLinkSpecification []PhysicalNicLinkInfo `xml:"validLinkSpecification,omitempty"` + Spec PhysicalNicSpec `xml:"spec"` + WakeOnLanSupported bool `xml:"wakeOnLanSupported"` + Mac string `xml:"mac"` + FcoeConfiguration *FcoeConfig `xml:"fcoeConfiguration,omitempty"` + VmDirectPathGen2Supported *bool `xml:"vmDirectPathGen2Supported"` + VmDirectPathGen2SupportedMode string `xml:"vmDirectPathGen2SupportedMode,omitempty"` + ResourcePoolSchedulerAllowed *bool `xml:"resourcePoolSchedulerAllowed"` + ResourcePoolSchedulerDisallowedReason []string `xml:"resourcePoolSchedulerDisallowedReason,omitempty"` + AutoNegotiateSupported *bool `xml:"autoNegotiateSupported"` +} + +func init() { + t["PhysicalNic"] = reflect.TypeOf((*PhysicalNic)(nil)).Elem() +} + +type PhysicalNicCdpDeviceCapability struct { + DynamicData + + Router bool `xml:"router"` + TransparentBridge bool `xml:"transparentBridge"` + SourceRouteBridge bool `xml:"sourceRouteBridge"` + NetworkSwitch bool `xml:"networkSwitch"` + Host bool `xml:"host"` + IgmpEnabled bool `xml:"igmpEnabled"` + Repeater bool `xml:"repeater"` +} + +func init() { + t["PhysicalNicCdpDeviceCapability"] = reflect.TypeOf((*PhysicalNicCdpDeviceCapability)(nil)).Elem() +} + +type PhysicalNicCdpInfo struct { + DynamicData + + CdpVersion int32 `xml:"cdpVersion,omitempty"` + Timeout int32 `xml:"timeout,omitempty"` + Ttl int32 `xml:"ttl,omitempty"` + Samples int32 `xml:"samples,omitempty"` + DevId string `xml:"devId,omitempty"` + Address string `xml:"address,omitempty"` + PortId string `xml:"portId,omitempty"` + DeviceCapability *PhysicalNicCdpDeviceCapability `xml:"deviceCapability,omitempty"` + SoftwareVersion string `xml:"softwareVersion,omitempty"` + HardwarePlatform string `xml:"hardwarePlatform,omitempty"` + IpPrefix string `xml:"ipPrefix,omitempty"` + IpPrefixLen int32 `xml:"ipPrefixLen,omitempty"` + Vlan int32 `xml:"vlan,omitempty"` + FullDuplex *bool `xml:"fullDuplex"` + Mtu int32 `xml:"mtu,omitempty"` + SystemName string `xml:"systemName,omitempty"` + SystemOID string `xml:"systemOID,omitempty"` + MgmtAddr string `xml:"mgmtAddr,omitempty"` + Location string `xml:"location,omitempty"` +} + +func init() { + t["PhysicalNicCdpInfo"] = reflect.TypeOf((*PhysicalNicCdpInfo)(nil)).Elem() +} + +type PhysicalNicConfig struct { + DynamicData + + Device string `xml:"device"` + Spec PhysicalNicSpec `xml:"spec"` +} + +func init() { + t["PhysicalNicConfig"] = reflect.TypeOf((*PhysicalNicConfig)(nil)).Elem() +} + +type PhysicalNicHint struct { + DynamicData + + VlanId int32 `xml:"vlanId,omitempty"` +} + +func init() { + t["PhysicalNicHint"] = reflect.TypeOf((*PhysicalNicHint)(nil)).Elem() +} + +type PhysicalNicHintInfo struct { + DynamicData + + Device string `xml:"device"` + Subnet []PhysicalNicIpHint `xml:"subnet,omitempty"` + Network []PhysicalNicNameHint `xml:"network,omitempty"` + ConnectedSwitchPort *PhysicalNicCdpInfo `xml:"connectedSwitchPort,omitempty"` + LldpInfo *LinkLayerDiscoveryProtocolInfo `xml:"lldpInfo,omitempty"` +} + +func init() { + t["PhysicalNicHintInfo"] = reflect.TypeOf((*PhysicalNicHintInfo)(nil)).Elem() +} + +type PhysicalNicIpHint struct { + PhysicalNicHint + + IpSubnet string `xml:"ipSubnet"` +} + +func init() { + t["PhysicalNicIpHint"] = reflect.TypeOf((*PhysicalNicIpHint)(nil)).Elem() +} + +type PhysicalNicLinkInfo struct { + DynamicData + + SpeedMb int32 `xml:"speedMb"` + Duplex bool `xml:"duplex"` +} + +func init() { + t["PhysicalNicLinkInfo"] = reflect.TypeOf((*PhysicalNicLinkInfo)(nil)).Elem() +} + +type PhysicalNicNameHint struct { + PhysicalNicHint + + Network string `xml:"network"` +} + +func init() { + t["PhysicalNicNameHint"] = reflect.TypeOf((*PhysicalNicNameHint)(nil)).Elem() +} + +type PhysicalNicProfile struct { + ApplyProfile + + Key string `xml:"key"` +} + +func init() { + t["PhysicalNicProfile"] = reflect.TypeOf((*PhysicalNicProfile)(nil)).Elem() +} + +type PhysicalNicSpec struct { + DynamicData + + Ip *HostIpConfig `xml:"ip,omitempty"` + LinkSpeed *PhysicalNicLinkInfo `xml:"linkSpeed,omitempty"` +} + +func init() { + t["PhysicalNicSpec"] = reflect.TypeOf((*PhysicalNicSpec)(nil)).Elem() +} + +type PlaceVm PlaceVmRequestType + +func init() { + t["PlaceVm"] = reflect.TypeOf((*PlaceVm)(nil)).Elem() +} + +type PlaceVmRequestType struct { + This ManagedObjectReference `xml:"_this"` + PlacementSpec PlacementSpec `xml:"placementSpec"` +} + +func init() { + t["PlaceVmRequestType"] = reflect.TypeOf((*PlaceVmRequestType)(nil)).Elem() +} + +type PlaceVmResponse struct { + Returnval PlacementResult `xml:"returnval"` +} + +type PlacementAction struct { + ClusterAction + + Vm *ManagedObjectReference `xml:"vm,omitempty"` + TargetHost *ManagedObjectReference `xml:"targetHost,omitempty"` + RelocateSpec *VirtualMachineRelocateSpec `xml:"relocateSpec,omitempty"` +} + +func init() { + t["PlacementAction"] = reflect.TypeOf((*PlacementAction)(nil)).Elem() +} + +type PlacementAffinityRule struct { + DynamicData + + RuleType string `xml:"ruleType"` + RuleScope string `xml:"ruleScope"` + Vms []ManagedObjectReference `xml:"vms,omitempty"` + Keys []string `xml:"keys,omitempty"` +} + +func init() { + t["PlacementAffinityRule"] = reflect.TypeOf((*PlacementAffinityRule)(nil)).Elem() +} + +type PlacementRankResult struct { + DynamicData + + Key string `xml:"key"` + Candidate ManagedObjectReference `xml:"candidate"` + ReservedSpaceMB int64 `xml:"reservedSpaceMB"` + UsedSpaceMB int64 `xml:"usedSpaceMB"` + TotalSpaceMB int64 `xml:"totalSpaceMB"` + Utilization float64 `xml:"utilization"` + Faults []LocalizedMethodFault `xml:"faults,omitempty"` +} + +func init() { + t["PlacementRankResult"] = reflect.TypeOf((*PlacementRankResult)(nil)).Elem() +} + +type PlacementRankSpec struct { + DynamicData + + Specs []PlacementSpec `xml:"specs"` + Clusters []ManagedObjectReference `xml:"clusters"` + Rules []PlacementAffinityRule `xml:"rules,omitempty"` + PlacementRankByVm []StorageDrsPlacementRankVmSpec `xml:"placementRankByVm,omitempty"` +} + +func init() { + t["PlacementRankSpec"] = reflect.TypeOf((*PlacementRankSpec)(nil)).Elem() +} + +type PlacementResult struct { + DynamicData + + Recommendations []ClusterRecommendation `xml:"recommendations,omitempty"` + DrsFault *ClusterDrsFaults `xml:"drsFault,omitempty"` +} + +func init() { + t["PlacementResult"] = reflect.TypeOf((*PlacementResult)(nil)).Elem() +} + +type PlacementSpec struct { + DynamicData + + Priority VirtualMachineMovePriority `xml:"priority,omitempty"` + Vm *ManagedObjectReference `xml:"vm,omitempty"` + ConfigSpec *VirtualMachineConfigSpec `xml:"configSpec,omitempty"` + RelocateSpec *VirtualMachineRelocateSpec `xml:"relocateSpec,omitempty"` + Hosts []ManagedObjectReference `xml:"hosts,omitempty"` + Datastores []ManagedObjectReference `xml:"datastores,omitempty"` + StoragePods []ManagedObjectReference `xml:"storagePods,omitempty"` + DisallowPrerequisiteMoves *bool `xml:"disallowPrerequisiteMoves"` + Rules []BaseClusterRuleInfo `xml:"rules,omitempty,typeattr"` + Key string `xml:"key,omitempty"` + PlacementType string `xml:"placementType,omitempty"` + CloneSpec *VirtualMachineCloneSpec `xml:"cloneSpec,omitempty"` + CloneName string `xml:"cloneName,omitempty"` +} + +func init() { + t["PlacementSpec"] = reflect.TypeOf((*PlacementSpec)(nil)).Elem() +} + +type PlatformConfigFault struct { + HostConfigFault + + Text string `xml:"text"` +} + +func init() { + t["PlatformConfigFault"] = reflect.TypeOf((*PlatformConfigFault)(nil)).Elem() +} + +type PlatformConfigFaultFault BasePlatformConfigFault + +func init() { + t["PlatformConfigFaultFault"] = reflect.TypeOf((*PlatformConfigFaultFault)(nil)).Elem() +} + +type PnicUplinkProfile struct { + ApplyProfile + + Key string `xml:"key"` +} + +func init() { + t["PnicUplinkProfile"] = reflect.TypeOf((*PnicUplinkProfile)(nil)).Elem() +} + +type PodDiskLocator struct { + DynamicData + + DiskId int32 `xml:"diskId"` + DiskMoveType string `xml:"diskMoveType,omitempty"` + DiskBackingInfo BaseVirtualDeviceBackingInfo `xml:"diskBackingInfo,omitempty,typeattr"` + Profile []BaseVirtualMachineProfileSpec `xml:"profile,omitempty,typeattr"` +} + +func init() { + t["PodDiskLocator"] = reflect.TypeOf((*PodDiskLocator)(nil)).Elem() +} + +type PodStorageDrsEntry struct { + DynamicData + + StorageDrsConfig StorageDrsConfigInfo `xml:"storageDrsConfig"` + Recommendation []ClusterRecommendation `xml:"recommendation,omitempty"` + DrsFault []ClusterDrsFaults `xml:"drsFault,omitempty"` + ActionHistory []ClusterActionHistory `xml:"actionHistory,omitempty"` +} + +func init() { + t["PodStorageDrsEntry"] = reflect.TypeOf((*PodStorageDrsEntry)(nil)).Elem() +} + +type PolicyOption struct { + DynamicData + + Id string `xml:"id"` + Parameter []KeyAnyValue `xml:"parameter,omitempty"` +} + +func init() { + t["PolicyOption"] = reflect.TypeOf((*PolicyOption)(nil)).Elem() +} + +type PortGroupProfile struct { + ApplyProfile + + Key string `xml:"key"` + Name string `xml:"name"` + Vlan VlanProfile `xml:"vlan"` + Vswitch VirtualSwitchSelectionProfile `xml:"vswitch"` + NetworkPolicy NetworkPolicyProfile `xml:"networkPolicy"` +} + +func init() { + t["PortGroupProfile"] = reflect.TypeOf((*PortGroupProfile)(nil)).Elem() +} + +type PosixUserSearchResult struct { + UserSearchResult + + Id int32 `xml:"id"` + ShellAccess *bool `xml:"shellAccess"` +} + +func init() { + t["PosixUserSearchResult"] = reflect.TypeOf((*PosixUserSearchResult)(nil)).Elem() +} + +type PostEvent PostEventRequestType + +func init() { + t["PostEvent"] = reflect.TypeOf((*PostEvent)(nil)).Elem() +} + +type PostEventRequestType struct { + This ManagedObjectReference `xml:"_this"` + EventToPost BaseEvent `xml:"eventToPost,typeattr"` + TaskInfo *TaskInfo `xml:"taskInfo,omitempty"` +} + +func init() { + t["PostEventRequestType"] = reflect.TypeOf((*PostEventRequestType)(nil)).Elem() +} + +type PostEventResponse struct { +} + +type PowerDownHostToStandByRequestType struct { + This ManagedObjectReference `xml:"_this"` + TimeoutSec int32 `xml:"timeoutSec"` + EvacuatePoweredOffVms *bool `xml:"evacuatePoweredOffVms"` +} + +func init() { + t["PowerDownHostToStandByRequestType"] = reflect.TypeOf((*PowerDownHostToStandByRequestType)(nil)).Elem() +} + +type PowerDownHostToStandBy_Task PowerDownHostToStandByRequestType + +func init() { + t["PowerDownHostToStandBy_Task"] = reflect.TypeOf((*PowerDownHostToStandBy_Task)(nil)).Elem() +} + +type PowerDownHostToStandBy_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type PowerOffVAppRequestType struct { + This ManagedObjectReference `xml:"_this"` + Force bool `xml:"force"` +} + +func init() { + t["PowerOffVAppRequestType"] = reflect.TypeOf((*PowerOffVAppRequestType)(nil)).Elem() +} + +type PowerOffVApp_Task PowerOffVAppRequestType + +func init() { + t["PowerOffVApp_Task"] = reflect.TypeOf((*PowerOffVApp_Task)(nil)).Elem() +} + +type PowerOffVApp_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type PowerOffVMRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["PowerOffVMRequestType"] = reflect.TypeOf((*PowerOffVMRequestType)(nil)).Elem() +} + +type PowerOffVM_Task PowerOffVMRequestType + +func init() { + t["PowerOffVM_Task"] = reflect.TypeOf((*PowerOffVM_Task)(nil)).Elem() +} + +type PowerOffVM_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type PowerOnFtSecondaryFailed struct { + VmFaultToleranceIssue + + Vm ManagedObjectReference `xml:"vm"` + VmName string `xml:"vmName"` + HostSelectionBy FtIssuesOnHostHostSelectionType `xml:"hostSelectionBy"` + HostErrors []LocalizedMethodFault `xml:"hostErrors,omitempty"` + RootCause LocalizedMethodFault `xml:"rootCause"` +} + +func init() { + t["PowerOnFtSecondaryFailed"] = reflect.TypeOf((*PowerOnFtSecondaryFailed)(nil)).Elem() +} + +type PowerOnFtSecondaryFailedFault PowerOnFtSecondaryFailed + +func init() { + t["PowerOnFtSecondaryFailedFault"] = reflect.TypeOf((*PowerOnFtSecondaryFailedFault)(nil)).Elem() +} + +type PowerOnFtSecondaryTimedout struct { + Timedout + + Vm ManagedObjectReference `xml:"vm"` + VmName string `xml:"vmName"` + Timeout int32 `xml:"timeout"` +} + +func init() { + t["PowerOnFtSecondaryTimedout"] = reflect.TypeOf((*PowerOnFtSecondaryTimedout)(nil)).Elem() +} + +type PowerOnFtSecondaryTimedoutFault PowerOnFtSecondaryTimedout + +func init() { + t["PowerOnFtSecondaryTimedoutFault"] = reflect.TypeOf((*PowerOnFtSecondaryTimedoutFault)(nil)).Elem() +} + +type PowerOnMultiVMRequestType struct { + This ManagedObjectReference `xml:"_this"` + Vm []ManagedObjectReference `xml:"vm"` + Option []BaseOptionValue `xml:"option,omitempty,typeattr"` +} + +func init() { + t["PowerOnMultiVMRequestType"] = reflect.TypeOf((*PowerOnMultiVMRequestType)(nil)).Elem() +} + +type PowerOnMultiVM_Task PowerOnMultiVMRequestType + +func init() { + t["PowerOnMultiVM_Task"] = reflect.TypeOf((*PowerOnMultiVM_Task)(nil)).Elem() +} + +type PowerOnMultiVM_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type PowerOnVAppRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["PowerOnVAppRequestType"] = reflect.TypeOf((*PowerOnVAppRequestType)(nil)).Elem() +} + +type PowerOnVApp_Task PowerOnVAppRequestType + +func init() { + t["PowerOnVApp_Task"] = reflect.TypeOf((*PowerOnVApp_Task)(nil)).Elem() +} + +type PowerOnVApp_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type PowerOnVMRequestType struct { + This ManagedObjectReference `xml:"_this"` + Host *ManagedObjectReference `xml:"host,omitempty"` +} + +func init() { + t["PowerOnVMRequestType"] = reflect.TypeOf((*PowerOnVMRequestType)(nil)).Elem() +} + +type PowerOnVM_Task PowerOnVMRequestType + +func init() { + t["PowerOnVM_Task"] = reflect.TypeOf((*PowerOnVM_Task)(nil)).Elem() +} + +type PowerOnVM_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type PowerSystemCapability struct { + DynamicData + + AvailablePolicy []HostPowerPolicy `xml:"availablePolicy"` +} + +func init() { + t["PowerSystemCapability"] = reflect.TypeOf((*PowerSystemCapability)(nil)).Elem() +} + +type PowerSystemInfo struct { + DynamicData + + CurrentPolicy HostPowerPolicy `xml:"currentPolicy"` +} + +func init() { + t["PowerSystemInfo"] = reflect.TypeOf((*PowerSystemInfo)(nil)).Elem() +} + +type PowerUpHostFromStandByRequestType struct { + This ManagedObjectReference `xml:"_this"` + TimeoutSec int32 `xml:"timeoutSec"` +} + +func init() { + t["PowerUpHostFromStandByRequestType"] = reflect.TypeOf((*PowerUpHostFromStandByRequestType)(nil)).Elem() +} + +type PowerUpHostFromStandBy_Task PowerUpHostFromStandByRequestType + +func init() { + t["PowerUpHostFromStandBy_Task"] = reflect.TypeOf((*PowerUpHostFromStandBy_Task)(nil)).Elem() +} + +type PowerUpHostFromStandBy_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type PrivilegeAvailability struct { + DynamicData + + PrivId string `xml:"privId"` + IsGranted bool `xml:"isGranted"` +} + +func init() { + t["PrivilegeAvailability"] = reflect.TypeOf((*PrivilegeAvailability)(nil)).Elem() +} + +type PrivilegePolicyDef struct { + DynamicData + + CreatePrivilege string `xml:"createPrivilege"` + ReadPrivilege string `xml:"readPrivilege"` + UpdatePrivilege string `xml:"updatePrivilege"` + DeletePrivilege string `xml:"deletePrivilege"` +} + +func init() { + t["PrivilegePolicyDef"] = reflect.TypeOf((*PrivilegePolicyDef)(nil)).Elem() +} + +type ProductComponentInfo struct { + DynamicData + + Id string `xml:"id"` + Name string `xml:"name"` + Version string `xml:"version"` + Release int32 `xml:"release"` +} + +func init() { + t["ProductComponentInfo"] = reflect.TypeOf((*ProductComponentInfo)(nil)).Elem() +} + +type ProfileApplyProfileElement struct { + ApplyProfile + + Key string `xml:"key"` +} + +func init() { + t["ProfileApplyProfileElement"] = reflect.TypeOf((*ProfileApplyProfileElement)(nil)).Elem() +} + +type ProfileApplyProfileProperty struct { + DynamicData + + PropertyName string `xml:"propertyName"` + Array bool `xml:"array"` + Profile []BaseApplyProfile `xml:"profile,omitempty,typeattr"` +} + +func init() { + t["ProfileApplyProfileProperty"] = reflect.TypeOf((*ProfileApplyProfileProperty)(nil)).Elem() +} + +type ProfileAssociatedEvent struct { + ProfileEvent +} + +func init() { + t["ProfileAssociatedEvent"] = reflect.TypeOf((*ProfileAssociatedEvent)(nil)).Elem() +} + +type ProfileChangedEvent struct { + ProfileEvent +} + +func init() { + t["ProfileChangedEvent"] = reflect.TypeOf((*ProfileChangedEvent)(nil)).Elem() +} + +type ProfileCompositeExpression struct { + ProfileExpression + + Operator string `xml:"operator"` + ExpressionName []string `xml:"expressionName"` +} + +func init() { + t["ProfileCompositeExpression"] = reflect.TypeOf((*ProfileCompositeExpression)(nil)).Elem() +} + +type ProfileCompositePolicyOptionMetadata struct { + ProfilePolicyOptionMetadata + + Option []string `xml:"option"` +} + +func init() { + t["ProfileCompositePolicyOptionMetadata"] = reflect.TypeOf((*ProfileCompositePolicyOptionMetadata)(nil)).Elem() +} + +type ProfileConfigInfo struct { + DynamicData + + Name string `xml:"name"` + Annotation string `xml:"annotation,omitempty"` + Enabled bool `xml:"enabled"` +} + +func init() { + t["ProfileConfigInfo"] = reflect.TypeOf((*ProfileConfigInfo)(nil)).Elem() +} + +type ProfileCreateSpec struct { + DynamicData + + Name string `xml:"name,omitempty"` + Annotation string `xml:"annotation,omitempty"` + Enabled *bool `xml:"enabled"` +} + +func init() { + t["ProfileCreateSpec"] = reflect.TypeOf((*ProfileCreateSpec)(nil)).Elem() +} + +type ProfileCreatedEvent struct { + ProfileEvent +} + +func init() { + t["ProfileCreatedEvent"] = reflect.TypeOf((*ProfileCreatedEvent)(nil)).Elem() +} + +type ProfileDeferredPolicyOptionParameter struct { + DynamicData + + InputPath ProfilePropertyPath `xml:"inputPath"` + Parameter []KeyAnyValue `xml:"parameter,omitempty"` +} + +func init() { + t["ProfileDeferredPolicyOptionParameter"] = reflect.TypeOf((*ProfileDeferredPolicyOptionParameter)(nil)).Elem() +} + +type ProfileDescription struct { + DynamicData + + Section []ProfileDescriptionSection `xml:"section"` +} + +func init() { + t["ProfileDescription"] = reflect.TypeOf((*ProfileDescription)(nil)).Elem() +} + +type ProfileDescriptionSection struct { + DynamicData + + Description ExtendedElementDescription `xml:"description"` + Message []LocalizableMessage `xml:"message,omitempty"` +} + +func init() { + t["ProfileDescriptionSection"] = reflect.TypeOf((*ProfileDescriptionSection)(nil)).Elem() +} + +type ProfileDissociatedEvent struct { + ProfileEvent +} + +func init() { + t["ProfileDissociatedEvent"] = reflect.TypeOf((*ProfileDissociatedEvent)(nil)).Elem() +} + +type ProfileEvent struct { + Event + + Profile ProfileEventArgument `xml:"profile"` +} + +func init() { + t["ProfileEvent"] = reflect.TypeOf((*ProfileEvent)(nil)).Elem() +} + +type ProfileEventArgument struct { + EventArgument + + Profile ManagedObjectReference `xml:"profile"` + Name string `xml:"name"` +} + +func init() { + t["ProfileEventArgument"] = reflect.TypeOf((*ProfileEventArgument)(nil)).Elem() +} + +type ProfileExecuteError struct { + DynamicData + + Path *ProfilePropertyPath `xml:"path,omitempty"` + Message LocalizableMessage `xml:"message"` +} + +func init() { + t["ProfileExecuteError"] = reflect.TypeOf((*ProfileExecuteError)(nil)).Elem() +} + +type ProfileExecuteResult struct { + DynamicData + + Status string `xml:"status"` + ConfigSpec *HostConfigSpec `xml:"configSpec,omitempty"` + InapplicablePath []string `xml:"inapplicablePath,omitempty"` + RequireInput []ProfileDeferredPolicyOptionParameter `xml:"requireInput,omitempty"` + Error []ProfileExecuteError `xml:"error,omitempty"` +} + +func init() { + t["ProfileExecuteResult"] = reflect.TypeOf((*ProfileExecuteResult)(nil)).Elem() +} + +type ProfileExpression struct { + DynamicData + + Id string `xml:"id"` + DisplayName string `xml:"displayName"` + Negated bool `xml:"negated"` +} + +func init() { + t["ProfileExpression"] = reflect.TypeOf((*ProfileExpression)(nil)).Elem() +} + +type ProfileExpressionMetadata struct { + DynamicData + + ExpressionId ExtendedElementDescription `xml:"expressionId"` + Parameter []ProfileParameterMetadata `xml:"parameter,omitempty"` +} + +func init() { + t["ProfileExpressionMetadata"] = reflect.TypeOf((*ProfileExpressionMetadata)(nil)).Elem() +} + +type ProfileMetadata struct { + DynamicData + + Key string `xml:"key"` + ProfileTypeName string `xml:"profileTypeName,omitempty"` + Description *ExtendedDescription `xml:"description,omitempty"` + SortSpec []ProfileMetadataProfileSortSpec `xml:"sortSpec,omitempty"` + ProfileCategory string `xml:"profileCategory,omitempty"` + ProfileComponent string `xml:"profileComponent,omitempty"` +} + +func init() { + t["ProfileMetadata"] = reflect.TypeOf((*ProfileMetadata)(nil)).Elem() +} + +type ProfileMetadataProfileSortSpec struct { + DynamicData + + PolicyId string `xml:"policyId"` + Parameter string `xml:"parameter"` +} + +func init() { + t["ProfileMetadataProfileSortSpec"] = reflect.TypeOf((*ProfileMetadataProfileSortSpec)(nil)).Elem() +} + +type ProfileParameterMetadata struct { + DynamicData + + Id ExtendedElementDescription `xml:"id"` + Type string `xml:"type"` + Optional bool `xml:"optional"` + DefaultValue AnyType `xml:"defaultValue,omitempty,typeattr"` +} + +func init() { + t["ProfileParameterMetadata"] = reflect.TypeOf((*ProfileParameterMetadata)(nil)).Elem() +} + +type ProfilePolicy struct { + DynamicData + + Id string `xml:"id"` + PolicyOption BasePolicyOption `xml:"policyOption,typeattr"` +} + +func init() { + t["ProfilePolicy"] = reflect.TypeOf((*ProfilePolicy)(nil)).Elem() +} + +type ProfilePolicyMetadata struct { + DynamicData + + Id ExtendedElementDescription `xml:"id"` + PossibleOption []BaseProfilePolicyOptionMetadata `xml:"possibleOption,typeattr"` +} + +func init() { + t["ProfilePolicyMetadata"] = reflect.TypeOf((*ProfilePolicyMetadata)(nil)).Elem() +} + +type ProfilePolicyOptionMetadata struct { + DynamicData + + Id ExtendedElementDescription `xml:"id"` + Parameter []ProfileParameterMetadata `xml:"parameter,omitempty"` +} + +func init() { + t["ProfilePolicyOptionMetadata"] = reflect.TypeOf((*ProfilePolicyOptionMetadata)(nil)).Elem() +} + +type ProfileProfileStructure struct { + DynamicData + + ProfileTypeName string `xml:"profileTypeName"` + Child []ProfileProfileStructureProperty `xml:"child,omitempty"` +} + +func init() { + t["ProfileProfileStructure"] = reflect.TypeOf((*ProfileProfileStructure)(nil)).Elem() +} + +type ProfileProfileStructureProperty struct { + DynamicData + + PropertyName string `xml:"propertyName"` + Array bool `xml:"array"` + Element ProfileProfileStructure `xml:"element"` +} + +func init() { + t["ProfileProfileStructureProperty"] = reflect.TypeOf((*ProfileProfileStructureProperty)(nil)).Elem() +} + +type ProfilePropertyPath struct { + DynamicData + + ProfilePath string `xml:"profilePath"` + PolicyId string `xml:"policyId,omitempty"` + ParameterId string `xml:"parameterId,omitempty"` +} + +func init() { + t["ProfilePropertyPath"] = reflect.TypeOf((*ProfilePropertyPath)(nil)).Elem() +} + +type ProfileReferenceHostChangedEvent struct { + ProfileEvent + + ReferenceHost *ManagedObjectReference `xml:"referenceHost,omitempty"` +} + +func init() { + t["ProfileReferenceHostChangedEvent"] = reflect.TypeOf((*ProfileReferenceHostChangedEvent)(nil)).Elem() +} + +type ProfileRemovedEvent struct { + ProfileEvent +} + +func init() { + t["ProfileRemovedEvent"] = reflect.TypeOf((*ProfileRemovedEvent)(nil)).Elem() +} + +type ProfileSerializedCreateSpec struct { + ProfileCreateSpec + + ProfileConfigString string `xml:"profileConfigString"` +} + +func init() { + t["ProfileSerializedCreateSpec"] = reflect.TypeOf((*ProfileSerializedCreateSpec)(nil)).Elem() +} + +type ProfileSimpleExpression struct { + ProfileExpression + + ExpressionType string `xml:"expressionType"` + Parameter []KeyAnyValue `xml:"parameter,omitempty"` +} + +func init() { + t["ProfileSimpleExpression"] = reflect.TypeOf((*ProfileSimpleExpression)(nil)).Elem() +} + +type ProfileUpdateFailed struct { + VimFault + + Failure []ProfileUpdateFailedUpdateFailure `xml:"failure"` +} + +func init() { + t["ProfileUpdateFailed"] = reflect.TypeOf((*ProfileUpdateFailed)(nil)).Elem() +} + +type ProfileUpdateFailedFault ProfileUpdateFailed + +func init() { + t["ProfileUpdateFailedFault"] = reflect.TypeOf((*ProfileUpdateFailedFault)(nil)).Elem() +} + +type ProfileUpdateFailedUpdateFailure struct { + DynamicData + + ProfilePath ProfilePropertyPath `xml:"profilePath"` + ErrMsg LocalizableMessage `xml:"errMsg"` +} + +func init() { + t["ProfileUpdateFailedUpdateFailure"] = reflect.TypeOf((*ProfileUpdateFailedUpdateFailure)(nil)).Elem() +} + +type PromoteDisksRequestType struct { + This ManagedObjectReference `xml:"_this"` + Unlink bool `xml:"unlink"` + Disks []VirtualDisk `xml:"disks,omitempty"` +} + +func init() { + t["PromoteDisksRequestType"] = reflect.TypeOf((*PromoteDisksRequestType)(nil)).Elem() +} + +type PromoteDisks_Task PromoteDisksRequestType + +func init() { + t["PromoteDisks_Task"] = reflect.TypeOf((*PromoteDisks_Task)(nil)).Elem() +} + +type PromoteDisks_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type PropertyChange struct { + DynamicData + + Name string `xml:"name"` + Op PropertyChangeOp `xml:"op"` + Val AnyType `xml:"val,omitempty,typeattr"` +} + +func init() { + t["PropertyChange"] = reflect.TypeOf((*PropertyChange)(nil)).Elem() +} + +type PropertyFilterSpec struct { + DynamicData + + PropSet []PropertySpec `xml:"propSet"` + ObjectSet []ObjectSpec `xml:"objectSet"` + ReportMissingObjectsInResults *bool `xml:"reportMissingObjectsInResults"` +} + +func init() { + t["PropertyFilterSpec"] = reflect.TypeOf((*PropertyFilterSpec)(nil)).Elem() +} + +type PropertyFilterUpdate struct { + DynamicData + + Filter ManagedObjectReference `xml:"filter"` + ObjectSet []ObjectUpdate `xml:"objectSet,omitempty"` + MissingSet []MissingObject `xml:"missingSet,omitempty"` +} + +func init() { + t["PropertyFilterUpdate"] = reflect.TypeOf((*PropertyFilterUpdate)(nil)).Elem() +} + +type PropertySpec struct { + DynamicData + + Type string `xml:"type"` + All *bool `xml:"all"` + PathSet []string `xml:"pathSet,omitempty"` +} + +func init() { + t["PropertySpec"] = reflect.TypeOf((*PropertySpec)(nil)).Elem() +} + +type QueryAnswerFileStatus QueryAnswerFileStatusRequestType + +func init() { + t["QueryAnswerFileStatus"] = reflect.TypeOf((*QueryAnswerFileStatus)(nil)).Elem() +} + +type QueryAnswerFileStatusRequestType struct { + This ManagedObjectReference `xml:"_this"` + Host []ManagedObjectReference `xml:"host"` +} + +func init() { + t["QueryAnswerFileStatusRequestType"] = reflect.TypeOf((*QueryAnswerFileStatusRequestType)(nil)).Elem() +} + +type QueryAnswerFileStatusResponse struct { + Returnval []AnswerFileStatusResult `xml:"returnval,omitempty"` +} + +type QueryAssignedLicenses QueryAssignedLicensesRequestType + +func init() { + t["QueryAssignedLicenses"] = reflect.TypeOf((*QueryAssignedLicenses)(nil)).Elem() +} + +type QueryAssignedLicensesRequestType struct { + This ManagedObjectReference `xml:"_this"` + EntityId string `xml:"entityId,omitempty"` +} + +func init() { + t["QueryAssignedLicensesRequestType"] = reflect.TypeOf((*QueryAssignedLicensesRequestType)(nil)).Elem() +} + +type QueryAssignedLicensesResponse struct { + Returnval []LicenseAssignmentManagerLicenseAssignment `xml:"returnval"` +} + +type QueryAvailableDisksForVmfs QueryAvailableDisksForVmfsRequestType + +func init() { + t["QueryAvailableDisksForVmfs"] = reflect.TypeOf((*QueryAvailableDisksForVmfs)(nil)).Elem() +} + +type QueryAvailableDisksForVmfsRequestType struct { + This ManagedObjectReference `xml:"_this"` + Datastore *ManagedObjectReference `xml:"datastore,omitempty"` +} + +func init() { + t["QueryAvailableDisksForVmfsRequestType"] = reflect.TypeOf((*QueryAvailableDisksForVmfsRequestType)(nil)).Elem() +} + +type QueryAvailableDisksForVmfsResponse struct { + Returnval []HostScsiDisk `xml:"returnval,omitempty"` +} + +type QueryAvailableDvsSpec QueryAvailableDvsSpecRequestType + +func init() { + t["QueryAvailableDvsSpec"] = reflect.TypeOf((*QueryAvailableDvsSpec)(nil)).Elem() +} + +type QueryAvailableDvsSpecRequestType struct { + This ManagedObjectReference `xml:"_this"` + Recommended *bool `xml:"recommended"` +} + +func init() { + t["QueryAvailableDvsSpecRequestType"] = reflect.TypeOf((*QueryAvailableDvsSpecRequestType)(nil)).Elem() +} + +type QueryAvailableDvsSpecResponse struct { + Returnval []DistributedVirtualSwitchProductSpec `xml:"returnval,omitempty"` +} + +type QueryAvailablePartition QueryAvailablePartitionRequestType + +func init() { + t["QueryAvailablePartition"] = reflect.TypeOf((*QueryAvailablePartition)(nil)).Elem() +} + +type QueryAvailablePartitionRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["QueryAvailablePartitionRequestType"] = reflect.TypeOf((*QueryAvailablePartitionRequestType)(nil)).Elem() +} + +type QueryAvailablePartitionResponse struct { + Returnval []HostDiagnosticPartition `xml:"returnval,omitempty"` +} + +type QueryAvailablePerfMetric QueryAvailablePerfMetricRequestType + +func init() { + t["QueryAvailablePerfMetric"] = reflect.TypeOf((*QueryAvailablePerfMetric)(nil)).Elem() +} + +type QueryAvailablePerfMetricRequestType struct { + This ManagedObjectReference `xml:"_this"` + Entity ManagedObjectReference `xml:"entity"` + BeginTime *time.Time `xml:"beginTime"` + EndTime *time.Time `xml:"endTime"` + IntervalId int32 `xml:"intervalId,omitempty"` +} + +func init() { + t["QueryAvailablePerfMetricRequestType"] = reflect.TypeOf((*QueryAvailablePerfMetricRequestType)(nil)).Elem() +} + +type QueryAvailablePerfMetricResponse struct { + Returnval []PerfMetricId `xml:"returnval,omitempty"` +} + +type QueryAvailableSsds QueryAvailableSsdsRequestType + +func init() { + t["QueryAvailableSsds"] = reflect.TypeOf((*QueryAvailableSsds)(nil)).Elem() +} + +type QueryAvailableSsdsRequestType struct { + This ManagedObjectReference `xml:"_this"` + VffsPath string `xml:"vffsPath,omitempty"` +} + +func init() { + t["QueryAvailableSsdsRequestType"] = reflect.TypeOf((*QueryAvailableSsdsRequestType)(nil)).Elem() +} + +type QueryAvailableSsdsResponse struct { + Returnval []HostScsiDisk `xml:"returnval,omitempty"` +} + +type QueryAvailableTimeZones QueryAvailableTimeZonesRequestType + +func init() { + t["QueryAvailableTimeZones"] = reflect.TypeOf((*QueryAvailableTimeZones)(nil)).Elem() +} + +type QueryAvailableTimeZonesRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["QueryAvailableTimeZonesRequestType"] = reflect.TypeOf((*QueryAvailableTimeZonesRequestType)(nil)).Elem() +} + +type QueryAvailableTimeZonesResponse struct { + Returnval []HostDateTimeSystemTimeZone `xml:"returnval,omitempty"` +} + +type QueryBootDevices QueryBootDevicesRequestType + +func init() { + t["QueryBootDevices"] = reflect.TypeOf((*QueryBootDevices)(nil)).Elem() +} + +type QueryBootDevicesRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["QueryBootDevicesRequestType"] = reflect.TypeOf((*QueryBootDevicesRequestType)(nil)).Elem() +} + +type QueryBootDevicesResponse struct { + Returnval *HostBootDeviceInfo `xml:"returnval,omitempty"` +} + +type QueryBoundVnics QueryBoundVnicsRequestType + +func init() { + t["QueryBoundVnics"] = reflect.TypeOf((*QueryBoundVnics)(nil)).Elem() +} + +type QueryBoundVnicsRequestType struct { + This ManagedObjectReference `xml:"_this"` + IScsiHbaName string `xml:"iScsiHbaName"` +} + +func init() { + t["QueryBoundVnicsRequestType"] = reflect.TypeOf((*QueryBoundVnicsRequestType)(nil)).Elem() +} + +type QueryBoundVnicsResponse struct { + Returnval []IscsiPortInfo `xml:"returnval,omitempty"` +} + +type QueryCandidateNics QueryCandidateNicsRequestType + +func init() { + t["QueryCandidateNics"] = reflect.TypeOf((*QueryCandidateNics)(nil)).Elem() +} + +type QueryCandidateNicsRequestType struct { + This ManagedObjectReference `xml:"_this"` + IScsiHbaName string `xml:"iScsiHbaName"` +} + +func init() { + t["QueryCandidateNicsRequestType"] = reflect.TypeOf((*QueryCandidateNicsRequestType)(nil)).Elem() +} + +type QueryCandidateNicsResponse struct { + Returnval []IscsiPortInfo `xml:"returnval,omitempty"` +} + +type QueryChangedDiskAreas QueryChangedDiskAreasRequestType + +func init() { + t["QueryChangedDiskAreas"] = reflect.TypeOf((*QueryChangedDiskAreas)(nil)).Elem() +} + +type QueryChangedDiskAreasRequestType struct { + This ManagedObjectReference `xml:"_this"` + Snapshot *ManagedObjectReference `xml:"snapshot,omitempty"` + DeviceKey int32 `xml:"deviceKey"` + StartOffset int64 `xml:"startOffset"` + ChangeId string `xml:"changeId"` +} + +func init() { + t["QueryChangedDiskAreasRequestType"] = reflect.TypeOf((*QueryChangedDiskAreasRequestType)(nil)).Elem() +} + +type QueryChangedDiskAreasResponse struct { + Returnval DiskChangeInfo `xml:"returnval"` +} + +type QueryCmmds QueryCmmdsRequestType + +func init() { + t["QueryCmmds"] = reflect.TypeOf((*QueryCmmds)(nil)).Elem() +} + +type QueryCmmdsRequestType struct { + This ManagedObjectReference `xml:"_this"` + Queries []HostVsanInternalSystemCmmdsQuery `xml:"queries"` +} + +func init() { + t["QueryCmmdsRequestType"] = reflect.TypeOf((*QueryCmmdsRequestType)(nil)).Elem() +} + +type QueryCmmdsResponse struct { + Returnval string `xml:"returnval"` +} + +type QueryCompatibleHostForExistingDvs QueryCompatibleHostForExistingDvsRequestType + +func init() { + t["QueryCompatibleHostForExistingDvs"] = reflect.TypeOf((*QueryCompatibleHostForExistingDvs)(nil)).Elem() +} + +type QueryCompatibleHostForExistingDvsRequestType struct { + This ManagedObjectReference `xml:"_this"` + Container ManagedObjectReference `xml:"container"` + Recursive bool `xml:"recursive"` + Dvs ManagedObjectReference `xml:"dvs"` +} + +func init() { + t["QueryCompatibleHostForExistingDvsRequestType"] = reflect.TypeOf((*QueryCompatibleHostForExistingDvsRequestType)(nil)).Elem() +} + +type QueryCompatibleHostForExistingDvsResponse struct { + Returnval []ManagedObjectReference `xml:"returnval,omitempty"` +} + +type QueryCompatibleHostForNewDvs QueryCompatibleHostForNewDvsRequestType + +func init() { + t["QueryCompatibleHostForNewDvs"] = reflect.TypeOf((*QueryCompatibleHostForNewDvs)(nil)).Elem() +} + +type QueryCompatibleHostForNewDvsRequestType struct { + This ManagedObjectReference `xml:"_this"` + Container ManagedObjectReference `xml:"container"` + Recursive bool `xml:"recursive"` + SwitchProductSpec *DistributedVirtualSwitchProductSpec `xml:"switchProductSpec,omitempty"` +} + +func init() { + t["QueryCompatibleHostForNewDvsRequestType"] = reflect.TypeOf((*QueryCompatibleHostForNewDvsRequestType)(nil)).Elem() +} + +type QueryCompatibleHostForNewDvsResponse struct { + Returnval []ManagedObjectReference `xml:"returnval,omitempty"` +} + +type QueryComplianceStatus QueryComplianceStatusRequestType + +func init() { + t["QueryComplianceStatus"] = reflect.TypeOf((*QueryComplianceStatus)(nil)).Elem() +} + +type QueryComplianceStatusRequestType struct { + This ManagedObjectReference `xml:"_this"` + Profile []ManagedObjectReference `xml:"profile,omitempty"` + Entity []ManagedObjectReference `xml:"entity,omitempty"` +} + +func init() { + t["QueryComplianceStatusRequestType"] = reflect.TypeOf((*QueryComplianceStatusRequestType)(nil)).Elem() +} + +type QueryComplianceStatusResponse struct { + Returnval []ComplianceResult `xml:"returnval,omitempty"` +} + +type QueryConfigOption QueryConfigOptionRequestType + +func init() { + t["QueryConfigOption"] = reflect.TypeOf((*QueryConfigOption)(nil)).Elem() +} + +type QueryConfigOptionDescriptor QueryConfigOptionDescriptorRequestType + +func init() { + t["QueryConfigOptionDescriptor"] = reflect.TypeOf((*QueryConfigOptionDescriptor)(nil)).Elem() +} + +type QueryConfigOptionDescriptorRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["QueryConfigOptionDescriptorRequestType"] = reflect.TypeOf((*QueryConfigOptionDescriptorRequestType)(nil)).Elem() +} + +type QueryConfigOptionDescriptorResponse struct { + Returnval []VirtualMachineConfigOptionDescriptor `xml:"returnval,omitempty"` +} + +type QueryConfigOptionEx QueryConfigOptionExRequestType + +func init() { + t["QueryConfigOptionEx"] = reflect.TypeOf((*QueryConfigOptionEx)(nil)).Elem() +} + +type QueryConfigOptionExRequestType struct { + This ManagedObjectReference `xml:"_this"` + Spec *EnvironmentBrowserConfigOptionQuerySpec `xml:"spec,omitempty"` +} + +func init() { + t["QueryConfigOptionExRequestType"] = reflect.TypeOf((*QueryConfigOptionExRequestType)(nil)).Elem() +} + +type QueryConfigOptionExResponse struct { + Returnval *VirtualMachineConfigOption `xml:"returnval,omitempty"` +} + +type QueryConfigOptionRequestType struct { + This ManagedObjectReference `xml:"_this"` + Key string `xml:"key,omitempty"` + Host *ManagedObjectReference `xml:"host,omitempty"` +} + +func init() { + t["QueryConfigOptionRequestType"] = reflect.TypeOf((*QueryConfigOptionRequestType)(nil)).Elem() +} + +type QueryConfigOptionResponse struct { + Returnval *VirtualMachineConfigOption `xml:"returnval,omitempty"` +} + +type QueryConfigTarget QueryConfigTargetRequestType + +func init() { + t["QueryConfigTarget"] = reflect.TypeOf((*QueryConfigTarget)(nil)).Elem() +} + +type QueryConfigTargetRequestType struct { + This ManagedObjectReference `xml:"_this"` + Host *ManagedObjectReference `xml:"host,omitempty"` +} + +func init() { + t["QueryConfigTargetRequestType"] = reflect.TypeOf((*QueryConfigTargetRequestType)(nil)).Elem() +} + +type QueryConfigTargetResponse struct { + Returnval *ConfigTarget `xml:"returnval,omitempty"` +} + +type QueryConfiguredModuleOptionString QueryConfiguredModuleOptionStringRequestType + +func init() { + t["QueryConfiguredModuleOptionString"] = reflect.TypeOf((*QueryConfiguredModuleOptionString)(nil)).Elem() +} + +type QueryConfiguredModuleOptionStringRequestType struct { + This ManagedObjectReference `xml:"_this"` + Name string `xml:"name"` +} + +func init() { + t["QueryConfiguredModuleOptionStringRequestType"] = reflect.TypeOf((*QueryConfiguredModuleOptionStringRequestType)(nil)).Elem() +} + +type QueryConfiguredModuleOptionStringResponse struct { + Returnval string `xml:"returnval"` +} + +type QueryConnectionInfo QueryConnectionInfoRequestType + +func init() { + t["QueryConnectionInfo"] = reflect.TypeOf((*QueryConnectionInfo)(nil)).Elem() +} + +type QueryConnectionInfoRequestType struct { + This ManagedObjectReference `xml:"_this"` + Hostname string `xml:"hostname"` + Port int32 `xml:"port"` + Username string `xml:"username"` + Password string `xml:"password"` + SslThumbprint string `xml:"sslThumbprint,omitempty"` +} + +func init() { + t["QueryConnectionInfoRequestType"] = reflect.TypeOf((*QueryConnectionInfoRequestType)(nil)).Elem() +} + +type QueryConnectionInfoResponse struct { + Returnval HostConnectInfo `xml:"returnval"` +} + +type QueryConnectionInfoViaSpec QueryConnectionInfoViaSpecRequestType + +func init() { + t["QueryConnectionInfoViaSpec"] = reflect.TypeOf((*QueryConnectionInfoViaSpec)(nil)).Elem() +} + +type QueryConnectionInfoViaSpecRequestType struct { + This ManagedObjectReference `xml:"_this"` + Spec HostConnectSpec `xml:"spec"` +} + +func init() { + t["QueryConnectionInfoViaSpecRequestType"] = reflect.TypeOf((*QueryConnectionInfoViaSpecRequestType)(nil)).Elem() +} + +type QueryConnectionInfoViaSpecResponse struct { + Returnval HostConnectInfo `xml:"returnval"` +} + +type QueryDatastorePerformanceSummary QueryDatastorePerformanceSummaryRequestType + +func init() { + t["QueryDatastorePerformanceSummary"] = reflect.TypeOf((*QueryDatastorePerformanceSummary)(nil)).Elem() +} + +type QueryDatastorePerformanceSummaryRequestType struct { + This ManagedObjectReference `xml:"_this"` + Datastore ManagedObjectReference `xml:"datastore"` +} + +func init() { + t["QueryDatastorePerformanceSummaryRequestType"] = reflect.TypeOf((*QueryDatastorePerformanceSummaryRequestType)(nil)).Elem() +} + +type QueryDatastorePerformanceSummaryResponse struct { + Returnval []StoragePerformanceSummary `xml:"returnval,omitempty"` +} + +type QueryDateTime QueryDateTimeRequestType + +func init() { + t["QueryDateTime"] = reflect.TypeOf((*QueryDateTime)(nil)).Elem() +} + +type QueryDateTimeRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["QueryDateTimeRequestType"] = reflect.TypeOf((*QueryDateTimeRequestType)(nil)).Elem() +} + +type QueryDateTimeResponse struct { + Returnval time.Time `xml:"returnval"` +} + +type QueryDescriptions QueryDescriptionsRequestType + +func init() { + t["QueryDescriptions"] = reflect.TypeOf((*QueryDescriptions)(nil)).Elem() +} + +type QueryDescriptionsRequestType struct { + This ManagedObjectReference `xml:"_this"` + Host *ManagedObjectReference `xml:"host,omitempty"` +} + +func init() { + t["QueryDescriptionsRequestType"] = reflect.TypeOf((*QueryDescriptionsRequestType)(nil)).Elem() +} + +type QueryDescriptionsResponse struct { + Returnval []DiagnosticManagerLogDescriptor `xml:"returnval,omitempty"` +} + +type QueryDisksForVsan QueryDisksForVsanRequestType + +func init() { + t["QueryDisksForVsan"] = reflect.TypeOf((*QueryDisksForVsan)(nil)).Elem() +} + +type QueryDisksForVsanRequestType struct { + This ManagedObjectReference `xml:"_this"` + CanonicalName []string `xml:"canonicalName,omitempty"` +} + +func init() { + t["QueryDisksForVsanRequestType"] = reflect.TypeOf((*QueryDisksForVsanRequestType)(nil)).Elem() +} + +type QueryDisksForVsanResponse struct { + Returnval []VsanHostDiskResult `xml:"returnval,omitempty"` +} + +type QueryDisksUsingFilter QueryDisksUsingFilterRequestType + +func init() { + t["QueryDisksUsingFilter"] = reflect.TypeOf((*QueryDisksUsingFilter)(nil)).Elem() +} + +type QueryDisksUsingFilterRequestType struct { + This ManagedObjectReference `xml:"_this"` + FilterId string `xml:"filterId"` + CompRes ManagedObjectReference `xml:"compRes"` +} + +func init() { + t["QueryDisksUsingFilterRequestType"] = reflect.TypeOf((*QueryDisksUsingFilterRequestType)(nil)).Elem() +} + +type QueryDisksUsingFilterResponse struct { + Returnval []VirtualDiskId `xml:"returnval"` +} + +type QueryDvsByUuid QueryDvsByUuidRequestType + +func init() { + t["QueryDvsByUuid"] = reflect.TypeOf((*QueryDvsByUuid)(nil)).Elem() +} + +type QueryDvsByUuidRequestType struct { + This ManagedObjectReference `xml:"_this"` + Uuid string `xml:"uuid"` +} + +func init() { + t["QueryDvsByUuidRequestType"] = reflect.TypeOf((*QueryDvsByUuidRequestType)(nil)).Elem() +} + +type QueryDvsByUuidResponse struct { + Returnval *ManagedObjectReference `xml:"returnval,omitempty"` +} + +type QueryDvsCheckCompatibility QueryDvsCheckCompatibilityRequestType + +func init() { + t["QueryDvsCheckCompatibility"] = reflect.TypeOf((*QueryDvsCheckCompatibility)(nil)).Elem() +} + +type QueryDvsCheckCompatibilityRequestType struct { + This ManagedObjectReference `xml:"_this"` + HostContainer DistributedVirtualSwitchManagerHostContainer `xml:"hostContainer"` + DvsProductSpec *DistributedVirtualSwitchManagerDvsProductSpec `xml:"dvsProductSpec,omitempty"` + HostFilterSpec []BaseDistributedVirtualSwitchManagerHostDvsFilterSpec `xml:"hostFilterSpec,omitempty,typeattr"` +} + +func init() { + t["QueryDvsCheckCompatibilityRequestType"] = reflect.TypeOf((*QueryDvsCheckCompatibilityRequestType)(nil)).Elem() +} + +type QueryDvsCheckCompatibilityResponse struct { + Returnval []DistributedVirtualSwitchManagerCompatibilityResult `xml:"returnval,omitempty"` +} + +type QueryDvsCompatibleHostSpec QueryDvsCompatibleHostSpecRequestType + +func init() { + t["QueryDvsCompatibleHostSpec"] = reflect.TypeOf((*QueryDvsCompatibleHostSpec)(nil)).Elem() +} + +type QueryDvsCompatibleHostSpecRequestType struct { + This ManagedObjectReference `xml:"_this"` + SwitchProductSpec *DistributedVirtualSwitchProductSpec `xml:"switchProductSpec,omitempty"` +} + +func init() { + t["QueryDvsCompatibleHostSpecRequestType"] = reflect.TypeOf((*QueryDvsCompatibleHostSpecRequestType)(nil)).Elem() +} + +type QueryDvsCompatibleHostSpecResponse struct { + Returnval []DistributedVirtualSwitchHostProductSpec `xml:"returnval,omitempty"` +} + +type QueryDvsConfigTarget QueryDvsConfigTargetRequestType + +func init() { + t["QueryDvsConfigTarget"] = reflect.TypeOf((*QueryDvsConfigTarget)(nil)).Elem() +} + +type QueryDvsConfigTargetRequestType struct { + This ManagedObjectReference `xml:"_this"` + Host *ManagedObjectReference `xml:"host,omitempty"` + Dvs *ManagedObjectReference `xml:"dvs,omitempty"` +} + +func init() { + t["QueryDvsConfigTargetRequestType"] = reflect.TypeOf((*QueryDvsConfigTargetRequestType)(nil)).Elem() +} + +type QueryDvsConfigTargetResponse struct { + Returnval DVSManagerDvsConfigTarget `xml:"returnval"` +} + +type QueryDvsFeatureCapability QueryDvsFeatureCapabilityRequestType + +func init() { + t["QueryDvsFeatureCapability"] = reflect.TypeOf((*QueryDvsFeatureCapability)(nil)).Elem() +} + +type QueryDvsFeatureCapabilityRequestType struct { + This ManagedObjectReference `xml:"_this"` + SwitchProductSpec *DistributedVirtualSwitchProductSpec `xml:"switchProductSpec,omitempty"` +} + +func init() { + t["QueryDvsFeatureCapabilityRequestType"] = reflect.TypeOf((*QueryDvsFeatureCapabilityRequestType)(nil)).Elem() +} + +type QueryDvsFeatureCapabilityResponse struct { + Returnval BaseDVSFeatureCapability `xml:"returnval,omitempty,typeattr"` +} + +type QueryEvents QueryEventsRequestType + +func init() { + t["QueryEvents"] = reflect.TypeOf((*QueryEvents)(nil)).Elem() +} + +type QueryEventsRequestType struct { + This ManagedObjectReference `xml:"_this"` + Filter EventFilterSpec `xml:"filter"` +} + +func init() { + t["QueryEventsRequestType"] = reflect.TypeOf((*QueryEventsRequestType)(nil)).Elem() +} + +type QueryEventsResponse struct { + Returnval []BaseEvent `xml:"returnval,omitempty,typeattr"` +} + +type QueryExpressionMetadata QueryExpressionMetadataRequestType + +func init() { + t["QueryExpressionMetadata"] = reflect.TypeOf((*QueryExpressionMetadata)(nil)).Elem() +} + +type QueryExpressionMetadataRequestType struct { + This ManagedObjectReference `xml:"_this"` + ExpressionName []string `xml:"expressionName,omitempty"` + Profile *ManagedObjectReference `xml:"profile,omitempty"` +} + +func init() { + t["QueryExpressionMetadataRequestType"] = reflect.TypeOf((*QueryExpressionMetadataRequestType)(nil)).Elem() +} + +type QueryExpressionMetadataResponse struct { + Returnval []ProfileExpressionMetadata `xml:"returnval,omitempty"` +} + +type QueryExtensionIpAllocationUsage QueryExtensionIpAllocationUsageRequestType + +func init() { + t["QueryExtensionIpAllocationUsage"] = reflect.TypeOf((*QueryExtensionIpAllocationUsage)(nil)).Elem() +} + +type QueryExtensionIpAllocationUsageRequestType struct { + This ManagedObjectReference `xml:"_this"` + ExtensionKeys []string `xml:"extensionKeys,omitempty"` +} + +func init() { + t["QueryExtensionIpAllocationUsageRequestType"] = reflect.TypeOf((*QueryExtensionIpAllocationUsageRequestType)(nil)).Elem() +} + +type QueryExtensionIpAllocationUsageResponse struct { + Returnval []ExtensionManagerIpAllocationUsage `xml:"returnval,omitempty"` +} + +type QueryFaultToleranceCompatibility QueryFaultToleranceCompatibilityRequestType + +func init() { + t["QueryFaultToleranceCompatibility"] = reflect.TypeOf((*QueryFaultToleranceCompatibility)(nil)).Elem() +} + +type QueryFaultToleranceCompatibilityEx QueryFaultToleranceCompatibilityExRequestType + +func init() { + t["QueryFaultToleranceCompatibilityEx"] = reflect.TypeOf((*QueryFaultToleranceCompatibilityEx)(nil)).Elem() +} + +type QueryFaultToleranceCompatibilityExRequestType struct { + This ManagedObjectReference `xml:"_this"` + ForLegacyFt *bool `xml:"forLegacyFt"` +} + +func init() { + t["QueryFaultToleranceCompatibilityExRequestType"] = reflect.TypeOf((*QueryFaultToleranceCompatibilityExRequestType)(nil)).Elem() +} + +type QueryFaultToleranceCompatibilityExResponse struct { + Returnval []LocalizedMethodFault `xml:"returnval,omitempty"` +} + +type QueryFaultToleranceCompatibilityRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["QueryFaultToleranceCompatibilityRequestType"] = reflect.TypeOf((*QueryFaultToleranceCompatibilityRequestType)(nil)).Elem() +} + +type QueryFaultToleranceCompatibilityResponse struct { + Returnval []LocalizedMethodFault `xml:"returnval,omitempty"` +} + +type QueryFirmwareConfigUploadURL QueryFirmwareConfigUploadURLRequestType + +func init() { + t["QueryFirmwareConfigUploadURL"] = reflect.TypeOf((*QueryFirmwareConfigUploadURL)(nil)).Elem() +} + +type QueryFirmwareConfigUploadURLRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["QueryFirmwareConfigUploadURLRequestType"] = reflect.TypeOf((*QueryFirmwareConfigUploadURLRequestType)(nil)).Elem() +} + +type QueryFirmwareConfigUploadURLResponse struct { + Returnval string `xml:"returnval"` +} + +type QueryHostConnectionInfo QueryHostConnectionInfoRequestType + +func init() { + t["QueryHostConnectionInfo"] = reflect.TypeOf((*QueryHostConnectionInfo)(nil)).Elem() +} + +type QueryHostConnectionInfoRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["QueryHostConnectionInfoRequestType"] = reflect.TypeOf((*QueryHostConnectionInfoRequestType)(nil)).Elem() +} + +type QueryHostConnectionInfoResponse struct { + Returnval HostConnectInfo `xml:"returnval"` +} + +type QueryHostPatchRequestType struct { + This ManagedObjectReference `xml:"_this"` + Spec *HostPatchManagerPatchManagerOperationSpec `xml:"spec,omitempty"` +} + +func init() { + t["QueryHostPatchRequestType"] = reflect.TypeOf((*QueryHostPatchRequestType)(nil)).Elem() +} + +type QueryHostPatch_Task QueryHostPatchRequestType + +func init() { + t["QueryHostPatch_Task"] = reflect.TypeOf((*QueryHostPatch_Task)(nil)).Elem() +} + +type QueryHostPatch_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type QueryHostProfileMetadata QueryHostProfileMetadataRequestType + +func init() { + t["QueryHostProfileMetadata"] = reflect.TypeOf((*QueryHostProfileMetadata)(nil)).Elem() +} + +type QueryHostProfileMetadataRequestType struct { + This ManagedObjectReference `xml:"_this"` + ProfileName []string `xml:"profileName,omitempty"` + Profile *ManagedObjectReference `xml:"profile,omitempty"` +} + +func init() { + t["QueryHostProfileMetadataRequestType"] = reflect.TypeOf((*QueryHostProfileMetadataRequestType)(nil)).Elem() +} + +type QueryHostProfileMetadataResponse struct { + Returnval []ProfileMetadata `xml:"returnval,omitempty"` +} + +type QueryHostStatus QueryHostStatusRequestType + +func init() { + t["QueryHostStatus"] = reflect.TypeOf((*QueryHostStatus)(nil)).Elem() +} + +type QueryHostStatusRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["QueryHostStatusRequestType"] = reflect.TypeOf((*QueryHostStatusRequestType)(nil)).Elem() +} + +type QueryHostStatusResponse struct { + Returnval VsanHostClusterStatus `xml:"returnval"` +} + +type QueryIORMConfigOption QueryIORMConfigOptionRequestType + +func init() { + t["QueryIORMConfigOption"] = reflect.TypeOf((*QueryIORMConfigOption)(nil)).Elem() +} + +type QueryIORMConfigOptionRequestType struct { + This ManagedObjectReference `xml:"_this"` + Host ManagedObjectReference `xml:"host"` +} + +func init() { + t["QueryIORMConfigOptionRequestType"] = reflect.TypeOf((*QueryIORMConfigOptionRequestType)(nil)).Elem() +} + +type QueryIORMConfigOptionResponse struct { + Returnval StorageIORMConfigOption `xml:"returnval"` +} + +type QueryIPAllocations QueryIPAllocationsRequestType + +func init() { + t["QueryIPAllocations"] = reflect.TypeOf((*QueryIPAllocations)(nil)).Elem() +} + +type QueryIPAllocationsRequestType struct { + This ManagedObjectReference `xml:"_this"` + Dc ManagedObjectReference `xml:"dc"` + PoolId int32 `xml:"poolId"` + ExtensionKey string `xml:"extensionKey"` +} + +func init() { + t["QueryIPAllocationsRequestType"] = reflect.TypeOf((*QueryIPAllocationsRequestType)(nil)).Elem() +} + +type QueryIPAllocationsResponse struct { + Returnval []IpPoolManagerIpAllocation `xml:"returnval"` +} + +type QueryIoFilterInfo QueryIoFilterInfoRequestType + +func init() { + t["QueryIoFilterInfo"] = reflect.TypeOf((*QueryIoFilterInfo)(nil)).Elem() +} + +type QueryIoFilterInfoRequestType struct { + This ManagedObjectReference `xml:"_this"` + CompRes ManagedObjectReference `xml:"compRes"` +} + +func init() { + t["QueryIoFilterInfoRequestType"] = reflect.TypeOf((*QueryIoFilterInfoRequestType)(nil)).Elem() +} + +type QueryIoFilterInfoResponse struct { + Returnval []ClusterIoFilterInfo `xml:"returnval,omitempty"` +} + +type QueryIoFilterIssues QueryIoFilterIssuesRequestType + +func init() { + t["QueryIoFilterIssues"] = reflect.TypeOf((*QueryIoFilterIssues)(nil)).Elem() +} + +type QueryIoFilterIssuesRequestType struct { + This ManagedObjectReference `xml:"_this"` + FilterId string `xml:"filterId"` + CompRes ManagedObjectReference `xml:"compRes"` +} + +func init() { + t["QueryIoFilterIssuesRequestType"] = reflect.TypeOf((*QueryIoFilterIssuesRequestType)(nil)).Elem() +} + +type QueryIoFilterIssuesResponse struct { + Returnval IoFilterQueryIssueResult `xml:"returnval"` +} + +type QueryIpPools QueryIpPoolsRequestType + +func init() { + t["QueryIpPools"] = reflect.TypeOf((*QueryIpPools)(nil)).Elem() +} + +type QueryIpPoolsRequestType struct { + This ManagedObjectReference `xml:"_this"` + Dc ManagedObjectReference `xml:"dc"` +} + +func init() { + t["QueryIpPoolsRequestType"] = reflect.TypeOf((*QueryIpPoolsRequestType)(nil)).Elem() +} + +type QueryIpPoolsResponse struct { + Returnval []IpPool `xml:"returnval,omitempty"` +} + +type QueryLicenseSourceAvailability QueryLicenseSourceAvailabilityRequestType + +func init() { + t["QueryLicenseSourceAvailability"] = reflect.TypeOf((*QueryLicenseSourceAvailability)(nil)).Elem() +} + +type QueryLicenseSourceAvailabilityRequestType struct { + This ManagedObjectReference `xml:"_this"` + Host *ManagedObjectReference `xml:"host,omitempty"` +} + +func init() { + t["QueryLicenseSourceAvailabilityRequestType"] = reflect.TypeOf((*QueryLicenseSourceAvailabilityRequestType)(nil)).Elem() +} + +type QueryLicenseSourceAvailabilityResponse struct { + Returnval []LicenseAvailabilityInfo `xml:"returnval,omitempty"` +} + +type QueryLicenseUsage QueryLicenseUsageRequestType + +func init() { + t["QueryLicenseUsage"] = reflect.TypeOf((*QueryLicenseUsage)(nil)).Elem() +} + +type QueryLicenseUsageRequestType struct { + This ManagedObjectReference `xml:"_this"` + Host *ManagedObjectReference `xml:"host,omitempty"` +} + +func init() { + t["QueryLicenseUsageRequestType"] = reflect.TypeOf((*QueryLicenseUsageRequestType)(nil)).Elem() +} + +type QueryLicenseUsageResponse struct { + Returnval LicenseUsageInfo `xml:"returnval"` +} + +type QueryLockdownExceptions QueryLockdownExceptionsRequestType + +func init() { + t["QueryLockdownExceptions"] = reflect.TypeOf((*QueryLockdownExceptions)(nil)).Elem() +} + +type QueryLockdownExceptionsRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["QueryLockdownExceptionsRequestType"] = reflect.TypeOf((*QueryLockdownExceptionsRequestType)(nil)).Elem() +} + +type QueryLockdownExceptionsResponse struct { + Returnval []string `xml:"returnval,omitempty"` +} + +type QueryManagedBy QueryManagedByRequestType + +func init() { + t["QueryManagedBy"] = reflect.TypeOf((*QueryManagedBy)(nil)).Elem() +} + +type QueryManagedByRequestType struct { + This ManagedObjectReference `xml:"_this"` + ExtensionKey string `xml:"extensionKey"` +} + +func init() { + t["QueryManagedByRequestType"] = reflect.TypeOf((*QueryManagedByRequestType)(nil)).Elem() +} + +type QueryManagedByResponse struct { + Returnval []ManagedObjectReference `xml:"returnval,omitempty"` +} + +type QueryMemoryOverhead QueryMemoryOverheadRequestType + +func init() { + t["QueryMemoryOverhead"] = reflect.TypeOf((*QueryMemoryOverhead)(nil)).Elem() +} + +type QueryMemoryOverheadEx QueryMemoryOverheadExRequestType + +func init() { + t["QueryMemoryOverheadEx"] = reflect.TypeOf((*QueryMemoryOverheadEx)(nil)).Elem() +} + +type QueryMemoryOverheadExRequestType struct { + This ManagedObjectReference `xml:"_this"` + VmConfigInfo VirtualMachineConfigInfo `xml:"vmConfigInfo"` +} + +func init() { + t["QueryMemoryOverheadExRequestType"] = reflect.TypeOf((*QueryMemoryOverheadExRequestType)(nil)).Elem() +} + +type QueryMemoryOverheadExResponse struct { + Returnval int64 `xml:"returnval"` +} + +type QueryMemoryOverheadRequestType struct { + This ManagedObjectReference `xml:"_this"` + MemorySize int64 `xml:"memorySize"` + VideoRamSize int32 `xml:"videoRamSize,omitempty"` + NumVcpus int32 `xml:"numVcpus"` +} + +func init() { + t["QueryMemoryOverheadRequestType"] = reflect.TypeOf((*QueryMemoryOverheadRequestType)(nil)).Elem() +} + +type QueryMemoryOverheadResponse struct { + Returnval int64 `xml:"returnval"` +} + +type QueryMigrationDependencies QueryMigrationDependenciesRequestType + +func init() { + t["QueryMigrationDependencies"] = reflect.TypeOf((*QueryMigrationDependencies)(nil)).Elem() +} + +type QueryMigrationDependenciesRequestType struct { + This ManagedObjectReference `xml:"_this"` + PnicDevice []string `xml:"pnicDevice"` +} + +func init() { + t["QueryMigrationDependenciesRequestType"] = reflect.TypeOf((*QueryMigrationDependenciesRequestType)(nil)).Elem() +} + +type QueryMigrationDependenciesResponse struct { + Returnval IscsiMigrationDependency `xml:"returnval"` +} + +type QueryModules QueryModulesRequestType + +func init() { + t["QueryModules"] = reflect.TypeOf((*QueryModules)(nil)).Elem() +} + +type QueryModulesRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["QueryModulesRequestType"] = reflect.TypeOf((*QueryModulesRequestType)(nil)).Elem() +} + +type QueryModulesResponse struct { + Returnval []KernelModuleInfo `xml:"returnval,omitempty"` +} + +type QueryNFSUser QueryNFSUserRequestType + +func init() { + t["QueryNFSUser"] = reflect.TypeOf((*QueryNFSUser)(nil)).Elem() +} + +type QueryNFSUserRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["QueryNFSUserRequestType"] = reflect.TypeOf((*QueryNFSUserRequestType)(nil)).Elem() +} + +type QueryNFSUserResponse struct { + Returnval *HostNasVolumeUserInfo `xml:"returnval,omitempty"` +} + +type QueryNetConfig QueryNetConfigRequestType + +func init() { + t["QueryNetConfig"] = reflect.TypeOf((*QueryNetConfig)(nil)).Elem() +} + +type QueryNetConfigRequestType struct { + This ManagedObjectReference `xml:"_this"` + NicType string `xml:"nicType"` +} + +func init() { + t["QueryNetConfigRequestType"] = reflect.TypeOf((*QueryNetConfigRequestType)(nil)).Elem() +} + +type QueryNetConfigResponse struct { + Returnval *VirtualNicManagerNetConfig `xml:"returnval,omitempty"` +} + +type QueryNetworkHint QueryNetworkHintRequestType + +func init() { + t["QueryNetworkHint"] = reflect.TypeOf((*QueryNetworkHint)(nil)).Elem() +} + +type QueryNetworkHintRequestType struct { + This ManagedObjectReference `xml:"_this"` + Device []string `xml:"device,omitempty"` +} + +func init() { + t["QueryNetworkHintRequestType"] = reflect.TypeOf((*QueryNetworkHintRequestType)(nil)).Elem() +} + +type QueryNetworkHintResponse struct { + Returnval []PhysicalNicHintInfo `xml:"returnval,omitempty"` +} + +type QueryObjectsOnPhysicalVsanDisk QueryObjectsOnPhysicalVsanDiskRequestType + +func init() { + t["QueryObjectsOnPhysicalVsanDisk"] = reflect.TypeOf((*QueryObjectsOnPhysicalVsanDisk)(nil)).Elem() +} + +type QueryObjectsOnPhysicalVsanDiskRequestType struct { + This ManagedObjectReference `xml:"_this"` + Disks []string `xml:"disks"` +} + +func init() { + t["QueryObjectsOnPhysicalVsanDiskRequestType"] = reflect.TypeOf((*QueryObjectsOnPhysicalVsanDiskRequestType)(nil)).Elem() +} + +type QueryObjectsOnPhysicalVsanDiskResponse struct { + Returnval string `xml:"returnval"` +} + +type QueryOptions QueryOptionsRequestType + +func init() { + t["QueryOptions"] = reflect.TypeOf((*QueryOptions)(nil)).Elem() +} + +type QueryOptionsRequestType struct { + This ManagedObjectReference `xml:"_this"` + Name string `xml:"name,omitempty"` +} + +func init() { + t["QueryOptionsRequestType"] = reflect.TypeOf((*QueryOptionsRequestType)(nil)).Elem() +} + +type QueryOptionsResponse struct { + Returnval []BaseOptionValue `xml:"returnval,omitempty,typeattr"` +} + +type QueryPartitionCreateDesc QueryPartitionCreateDescRequestType + +func init() { + t["QueryPartitionCreateDesc"] = reflect.TypeOf((*QueryPartitionCreateDesc)(nil)).Elem() +} + +type QueryPartitionCreateDescRequestType struct { + This ManagedObjectReference `xml:"_this"` + DiskUuid string `xml:"diskUuid"` + DiagnosticType string `xml:"diagnosticType"` +} + +func init() { + t["QueryPartitionCreateDescRequestType"] = reflect.TypeOf((*QueryPartitionCreateDescRequestType)(nil)).Elem() +} + +type QueryPartitionCreateDescResponse struct { + Returnval HostDiagnosticPartitionCreateDescription `xml:"returnval"` +} + +type QueryPartitionCreateOptions QueryPartitionCreateOptionsRequestType + +func init() { + t["QueryPartitionCreateOptions"] = reflect.TypeOf((*QueryPartitionCreateOptions)(nil)).Elem() +} + +type QueryPartitionCreateOptionsRequestType struct { + This ManagedObjectReference `xml:"_this"` + StorageType string `xml:"storageType"` + DiagnosticType string `xml:"diagnosticType"` +} + +func init() { + t["QueryPartitionCreateOptionsRequestType"] = reflect.TypeOf((*QueryPartitionCreateOptionsRequestType)(nil)).Elem() +} + +type QueryPartitionCreateOptionsResponse struct { + Returnval []HostDiagnosticPartitionCreateOption `xml:"returnval,omitempty"` +} + +type QueryPathSelectionPolicyOptions QueryPathSelectionPolicyOptionsRequestType + +func init() { + t["QueryPathSelectionPolicyOptions"] = reflect.TypeOf((*QueryPathSelectionPolicyOptions)(nil)).Elem() +} + +type QueryPathSelectionPolicyOptionsRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["QueryPathSelectionPolicyOptionsRequestType"] = reflect.TypeOf((*QueryPathSelectionPolicyOptionsRequestType)(nil)).Elem() +} + +type QueryPathSelectionPolicyOptionsResponse struct { + Returnval []HostPathSelectionPolicyOption `xml:"returnval,omitempty"` +} + +type QueryPerf QueryPerfRequestType + +func init() { + t["QueryPerf"] = reflect.TypeOf((*QueryPerf)(nil)).Elem() +} + +type QueryPerfComposite QueryPerfCompositeRequestType + +func init() { + t["QueryPerfComposite"] = reflect.TypeOf((*QueryPerfComposite)(nil)).Elem() +} + +type QueryPerfCompositeRequestType struct { + This ManagedObjectReference `xml:"_this"` + QuerySpec PerfQuerySpec `xml:"querySpec"` +} + +func init() { + t["QueryPerfCompositeRequestType"] = reflect.TypeOf((*QueryPerfCompositeRequestType)(nil)).Elem() +} + +type QueryPerfCompositeResponse struct { + Returnval PerfCompositeMetric `xml:"returnval"` +} + +type QueryPerfCounter QueryPerfCounterRequestType + +func init() { + t["QueryPerfCounter"] = reflect.TypeOf((*QueryPerfCounter)(nil)).Elem() +} + +type QueryPerfCounterByLevel QueryPerfCounterByLevelRequestType + +func init() { + t["QueryPerfCounterByLevel"] = reflect.TypeOf((*QueryPerfCounterByLevel)(nil)).Elem() +} + +type QueryPerfCounterByLevelRequestType struct { + This ManagedObjectReference `xml:"_this"` + Level int32 `xml:"level"` +} + +func init() { + t["QueryPerfCounterByLevelRequestType"] = reflect.TypeOf((*QueryPerfCounterByLevelRequestType)(nil)).Elem() +} + +type QueryPerfCounterByLevelResponse struct { + Returnval []PerfCounterInfo `xml:"returnval"` +} + +type QueryPerfCounterRequestType struct { + This ManagedObjectReference `xml:"_this"` + CounterId []int32 `xml:"counterId"` +} + +func init() { + t["QueryPerfCounterRequestType"] = reflect.TypeOf((*QueryPerfCounterRequestType)(nil)).Elem() +} + +type QueryPerfCounterResponse struct { + Returnval []PerfCounterInfo `xml:"returnval,omitempty"` +} + +type QueryPerfProviderSummary QueryPerfProviderSummaryRequestType + +func init() { + t["QueryPerfProviderSummary"] = reflect.TypeOf((*QueryPerfProviderSummary)(nil)).Elem() +} + +type QueryPerfProviderSummaryRequestType struct { + This ManagedObjectReference `xml:"_this"` + Entity ManagedObjectReference `xml:"entity"` +} + +func init() { + t["QueryPerfProviderSummaryRequestType"] = reflect.TypeOf((*QueryPerfProviderSummaryRequestType)(nil)).Elem() +} + +type QueryPerfProviderSummaryResponse struct { + Returnval PerfProviderSummary `xml:"returnval"` +} + +type QueryPerfRequestType struct { + This ManagedObjectReference `xml:"_this"` + QuerySpec []PerfQuerySpec `xml:"querySpec"` +} + +func init() { + t["QueryPerfRequestType"] = reflect.TypeOf((*QueryPerfRequestType)(nil)).Elem() +} + +type QueryPerfResponse struct { + Returnval []BasePerfEntityMetricBase `xml:"returnval,omitempty,typeattr"` +} + +type QueryPhysicalVsanDisks QueryPhysicalVsanDisksRequestType + +func init() { + t["QueryPhysicalVsanDisks"] = reflect.TypeOf((*QueryPhysicalVsanDisks)(nil)).Elem() +} + +type QueryPhysicalVsanDisksRequestType struct { + This ManagedObjectReference `xml:"_this"` + Props []string `xml:"props,omitempty"` +} + +func init() { + t["QueryPhysicalVsanDisksRequestType"] = reflect.TypeOf((*QueryPhysicalVsanDisksRequestType)(nil)).Elem() +} + +type QueryPhysicalVsanDisksResponse struct { + Returnval string `xml:"returnval"` +} + +type QueryPnicStatus QueryPnicStatusRequestType + +func init() { + t["QueryPnicStatus"] = reflect.TypeOf((*QueryPnicStatus)(nil)).Elem() +} + +type QueryPnicStatusRequestType struct { + This ManagedObjectReference `xml:"_this"` + PnicDevice string `xml:"pnicDevice"` +} + +func init() { + t["QueryPnicStatusRequestType"] = reflect.TypeOf((*QueryPnicStatusRequestType)(nil)).Elem() +} + +type QueryPnicStatusResponse struct { + Returnval IscsiStatus `xml:"returnval"` +} + +type QueryPolicyMetadata QueryPolicyMetadataRequestType + +func init() { + t["QueryPolicyMetadata"] = reflect.TypeOf((*QueryPolicyMetadata)(nil)).Elem() +} + +type QueryPolicyMetadataRequestType struct { + This ManagedObjectReference `xml:"_this"` + PolicyName []string `xml:"policyName,omitempty"` + Profile *ManagedObjectReference `xml:"profile,omitempty"` +} + +func init() { + t["QueryPolicyMetadataRequestType"] = reflect.TypeOf((*QueryPolicyMetadataRequestType)(nil)).Elem() +} + +type QueryPolicyMetadataResponse struct { + Returnval []ProfilePolicyMetadata `xml:"returnval,omitempty"` +} + +type QueryProfileStructure QueryProfileStructureRequestType + +func init() { + t["QueryProfileStructure"] = reflect.TypeOf((*QueryProfileStructure)(nil)).Elem() +} + +type QueryProfileStructureRequestType struct { + This ManagedObjectReference `xml:"_this"` + Profile *ManagedObjectReference `xml:"profile,omitempty"` +} + +func init() { + t["QueryProfileStructureRequestType"] = reflect.TypeOf((*QueryProfileStructureRequestType)(nil)).Elem() +} + +type QueryProfileStructureResponse struct { + Returnval ProfileProfileStructure `xml:"returnval"` +} + +type QueryResourceConfigOption QueryResourceConfigOptionRequestType + +func init() { + t["QueryResourceConfigOption"] = reflect.TypeOf((*QueryResourceConfigOption)(nil)).Elem() +} + +type QueryResourceConfigOptionRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["QueryResourceConfigOptionRequestType"] = reflect.TypeOf((*QueryResourceConfigOptionRequestType)(nil)).Elem() +} + +type QueryResourceConfigOptionResponse struct { + Returnval ResourceConfigOption `xml:"returnval"` +} + +type QueryServiceList QueryServiceListRequestType + +func init() { + t["QueryServiceList"] = reflect.TypeOf((*QueryServiceList)(nil)).Elem() +} + +type QueryServiceListRequestType struct { + This ManagedObjectReference `xml:"_this"` + ServiceName string `xml:"serviceName,omitempty"` + Location []string `xml:"location,omitempty"` +} + +func init() { + t["QueryServiceListRequestType"] = reflect.TypeOf((*QueryServiceListRequestType)(nil)).Elem() +} + +type QueryServiceListResponse struct { + Returnval []ServiceManagerServiceInfo `xml:"returnval,omitempty"` +} + +type QueryStorageArrayTypePolicyOptions QueryStorageArrayTypePolicyOptionsRequestType + +func init() { + t["QueryStorageArrayTypePolicyOptions"] = reflect.TypeOf((*QueryStorageArrayTypePolicyOptions)(nil)).Elem() +} + +type QueryStorageArrayTypePolicyOptionsRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["QueryStorageArrayTypePolicyOptionsRequestType"] = reflect.TypeOf((*QueryStorageArrayTypePolicyOptionsRequestType)(nil)).Elem() +} + +type QueryStorageArrayTypePolicyOptionsResponse struct { + Returnval []HostStorageArrayTypePolicyOption `xml:"returnval,omitempty"` +} + +type QuerySupportedFeatures QuerySupportedFeaturesRequestType + +func init() { + t["QuerySupportedFeatures"] = reflect.TypeOf((*QuerySupportedFeatures)(nil)).Elem() +} + +type QuerySupportedFeaturesRequestType struct { + This ManagedObjectReference `xml:"_this"` + Host *ManagedObjectReference `xml:"host,omitempty"` +} + +func init() { + t["QuerySupportedFeaturesRequestType"] = reflect.TypeOf((*QuerySupportedFeaturesRequestType)(nil)).Elem() +} + +type QuerySupportedFeaturesResponse struct { + Returnval []LicenseFeatureInfo `xml:"returnval,omitempty"` +} + +type QuerySyncingVsanObjects QuerySyncingVsanObjectsRequestType + +func init() { + t["QuerySyncingVsanObjects"] = reflect.TypeOf((*QuerySyncingVsanObjects)(nil)).Elem() +} + +type QuerySyncingVsanObjectsRequestType struct { + This ManagedObjectReference `xml:"_this"` + Uuids []string `xml:"uuids,omitempty"` +} + +func init() { + t["QuerySyncingVsanObjectsRequestType"] = reflect.TypeOf((*QuerySyncingVsanObjectsRequestType)(nil)).Elem() +} + +type QuerySyncingVsanObjectsResponse struct { + Returnval string `xml:"returnval"` +} + +type QuerySystemUsers QuerySystemUsersRequestType + +func init() { + t["QuerySystemUsers"] = reflect.TypeOf((*QuerySystemUsers)(nil)).Elem() +} + +type QuerySystemUsersRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["QuerySystemUsersRequestType"] = reflect.TypeOf((*QuerySystemUsersRequestType)(nil)).Elem() +} + +type QuerySystemUsersResponse struct { + Returnval []string `xml:"returnval,omitempty"` +} + +type QueryTargetCapabilities QueryTargetCapabilitiesRequestType + +func init() { + t["QueryTargetCapabilities"] = reflect.TypeOf((*QueryTargetCapabilities)(nil)).Elem() +} + +type QueryTargetCapabilitiesRequestType struct { + This ManagedObjectReference `xml:"_this"` + Host *ManagedObjectReference `xml:"host,omitempty"` +} + +func init() { + t["QueryTargetCapabilitiesRequestType"] = reflect.TypeOf((*QueryTargetCapabilitiesRequestType)(nil)).Elem() +} + +type QueryTargetCapabilitiesResponse struct { + Returnval *HostCapability `xml:"returnval,omitempty"` +} + +type QueryTpmAttestationReport QueryTpmAttestationReportRequestType + +func init() { + t["QueryTpmAttestationReport"] = reflect.TypeOf((*QueryTpmAttestationReport)(nil)).Elem() +} + +type QueryTpmAttestationReportRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["QueryTpmAttestationReportRequestType"] = reflect.TypeOf((*QueryTpmAttestationReportRequestType)(nil)).Elem() +} + +type QueryTpmAttestationReportResponse struct { + Returnval *HostTpmAttestationReport `xml:"returnval,omitempty"` +} + +type QueryUnownedFiles QueryUnownedFilesRequestType + +func init() { + t["QueryUnownedFiles"] = reflect.TypeOf((*QueryUnownedFiles)(nil)).Elem() +} + +type QueryUnownedFilesRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["QueryUnownedFilesRequestType"] = reflect.TypeOf((*QueryUnownedFilesRequestType)(nil)).Elem() +} + +type QueryUnownedFilesResponse struct { + Returnval []string `xml:"returnval,omitempty"` +} + +type QueryUnresolvedVmfsVolume QueryUnresolvedVmfsVolumeRequestType + +func init() { + t["QueryUnresolvedVmfsVolume"] = reflect.TypeOf((*QueryUnresolvedVmfsVolume)(nil)).Elem() +} + +type QueryUnresolvedVmfsVolumeRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["QueryUnresolvedVmfsVolumeRequestType"] = reflect.TypeOf((*QueryUnresolvedVmfsVolumeRequestType)(nil)).Elem() +} + +type QueryUnresolvedVmfsVolumeResponse struct { + Returnval []HostUnresolvedVmfsVolume `xml:"returnval,omitempty"` +} + +type QueryUnresolvedVmfsVolumes QueryUnresolvedVmfsVolumesRequestType + +func init() { + t["QueryUnresolvedVmfsVolumes"] = reflect.TypeOf((*QueryUnresolvedVmfsVolumes)(nil)).Elem() +} + +type QueryUnresolvedVmfsVolumesRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["QueryUnresolvedVmfsVolumesRequestType"] = reflect.TypeOf((*QueryUnresolvedVmfsVolumesRequestType)(nil)).Elem() +} + +type QueryUnresolvedVmfsVolumesResponse struct { + Returnval []HostUnresolvedVmfsVolume `xml:"returnval,omitempty"` +} + +type QueryUsedVlanIdInDvs QueryUsedVlanIdInDvsRequestType + +func init() { + t["QueryUsedVlanIdInDvs"] = reflect.TypeOf((*QueryUsedVlanIdInDvs)(nil)).Elem() +} + +type QueryUsedVlanIdInDvsRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["QueryUsedVlanIdInDvsRequestType"] = reflect.TypeOf((*QueryUsedVlanIdInDvsRequestType)(nil)).Elem() +} + +type QueryUsedVlanIdInDvsResponse struct { + Returnval []int32 `xml:"returnval,omitempty"` +} + +type QueryVMotionCompatibility QueryVMotionCompatibilityRequestType + +func init() { + t["QueryVMotionCompatibility"] = reflect.TypeOf((*QueryVMotionCompatibility)(nil)).Elem() +} + +type QueryVMotionCompatibilityExRequestType struct { + This ManagedObjectReference `xml:"_this"` + Vm []ManagedObjectReference `xml:"vm"` + Host []ManagedObjectReference `xml:"host"` +} + +func init() { + t["QueryVMotionCompatibilityExRequestType"] = reflect.TypeOf((*QueryVMotionCompatibilityExRequestType)(nil)).Elem() +} + +type QueryVMotionCompatibilityEx_Task QueryVMotionCompatibilityExRequestType + +func init() { + t["QueryVMotionCompatibilityEx_Task"] = reflect.TypeOf((*QueryVMotionCompatibilityEx_Task)(nil)).Elem() +} + +type QueryVMotionCompatibilityEx_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type QueryVMotionCompatibilityRequestType struct { + This ManagedObjectReference `xml:"_this"` + Vm ManagedObjectReference `xml:"vm"` + Host []ManagedObjectReference `xml:"host"` + Compatibility []string `xml:"compatibility,omitempty"` +} + +func init() { + t["QueryVMotionCompatibilityRequestType"] = reflect.TypeOf((*QueryVMotionCompatibilityRequestType)(nil)).Elem() +} + +type QueryVMotionCompatibilityResponse struct { + Returnval []HostVMotionCompatibility `xml:"returnval,omitempty"` +} + +type QueryVirtualDiskFragmentation QueryVirtualDiskFragmentationRequestType + +func init() { + t["QueryVirtualDiskFragmentation"] = reflect.TypeOf((*QueryVirtualDiskFragmentation)(nil)).Elem() +} + +type QueryVirtualDiskFragmentationRequestType struct { + This ManagedObjectReference `xml:"_this"` + Name string `xml:"name"` + Datacenter *ManagedObjectReference `xml:"datacenter,omitempty"` +} + +func init() { + t["QueryVirtualDiskFragmentationRequestType"] = reflect.TypeOf((*QueryVirtualDiskFragmentationRequestType)(nil)).Elem() +} + +type QueryVirtualDiskFragmentationResponse struct { + Returnval int32 `xml:"returnval"` +} + +type QueryVirtualDiskGeometry QueryVirtualDiskGeometryRequestType + +func init() { + t["QueryVirtualDiskGeometry"] = reflect.TypeOf((*QueryVirtualDiskGeometry)(nil)).Elem() +} + +type QueryVirtualDiskGeometryRequestType struct { + This ManagedObjectReference `xml:"_this"` + Name string `xml:"name"` + Datacenter *ManagedObjectReference `xml:"datacenter,omitempty"` +} + +func init() { + t["QueryVirtualDiskGeometryRequestType"] = reflect.TypeOf((*QueryVirtualDiskGeometryRequestType)(nil)).Elem() +} + +type QueryVirtualDiskGeometryResponse struct { + Returnval HostDiskDimensionsChs `xml:"returnval"` +} + +type QueryVirtualDiskUuid QueryVirtualDiskUuidRequestType + +func init() { + t["QueryVirtualDiskUuid"] = reflect.TypeOf((*QueryVirtualDiskUuid)(nil)).Elem() +} + +type QueryVirtualDiskUuidRequestType struct { + This ManagedObjectReference `xml:"_this"` + Name string `xml:"name"` + Datacenter *ManagedObjectReference `xml:"datacenter,omitempty"` +} + +func init() { + t["QueryVirtualDiskUuidRequestType"] = reflect.TypeOf((*QueryVirtualDiskUuidRequestType)(nil)).Elem() +} + +type QueryVirtualDiskUuidResponse struct { + Returnval string `xml:"returnval"` +} + +type QueryVmfsDatastoreCreateOptions QueryVmfsDatastoreCreateOptionsRequestType + +func init() { + t["QueryVmfsDatastoreCreateOptions"] = reflect.TypeOf((*QueryVmfsDatastoreCreateOptions)(nil)).Elem() +} + +type QueryVmfsDatastoreCreateOptionsRequestType struct { + This ManagedObjectReference `xml:"_this"` + DevicePath string `xml:"devicePath"` + VmfsMajorVersion int32 `xml:"vmfsMajorVersion,omitempty"` +} + +func init() { + t["QueryVmfsDatastoreCreateOptionsRequestType"] = reflect.TypeOf((*QueryVmfsDatastoreCreateOptionsRequestType)(nil)).Elem() +} + +type QueryVmfsDatastoreCreateOptionsResponse struct { + Returnval []VmfsDatastoreOption `xml:"returnval,omitempty"` +} + +type QueryVmfsDatastoreExpandOptions QueryVmfsDatastoreExpandOptionsRequestType + +func init() { + t["QueryVmfsDatastoreExpandOptions"] = reflect.TypeOf((*QueryVmfsDatastoreExpandOptions)(nil)).Elem() +} + +type QueryVmfsDatastoreExpandOptionsRequestType struct { + This ManagedObjectReference `xml:"_this"` + Datastore ManagedObjectReference `xml:"datastore"` +} + +func init() { + t["QueryVmfsDatastoreExpandOptionsRequestType"] = reflect.TypeOf((*QueryVmfsDatastoreExpandOptionsRequestType)(nil)).Elem() +} + +type QueryVmfsDatastoreExpandOptionsResponse struct { + Returnval []VmfsDatastoreOption `xml:"returnval,omitempty"` +} + +type QueryVmfsDatastoreExtendOptions QueryVmfsDatastoreExtendOptionsRequestType + +func init() { + t["QueryVmfsDatastoreExtendOptions"] = reflect.TypeOf((*QueryVmfsDatastoreExtendOptions)(nil)).Elem() +} + +type QueryVmfsDatastoreExtendOptionsRequestType struct { + This ManagedObjectReference `xml:"_this"` + Datastore ManagedObjectReference `xml:"datastore"` + DevicePath string `xml:"devicePath"` + SuppressExpandCandidates *bool `xml:"suppressExpandCandidates"` +} + +func init() { + t["QueryVmfsDatastoreExtendOptionsRequestType"] = reflect.TypeOf((*QueryVmfsDatastoreExtendOptionsRequestType)(nil)).Elem() +} + +type QueryVmfsDatastoreExtendOptionsResponse struct { + Returnval []VmfsDatastoreOption `xml:"returnval,omitempty"` +} + +type QueryVnicStatus QueryVnicStatusRequestType + +func init() { + t["QueryVnicStatus"] = reflect.TypeOf((*QueryVnicStatus)(nil)).Elem() +} + +type QueryVnicStatusRequestType struct { + This ManagedObjectReference `xml:"_this"` + VnicDevice string `xml:"vnicDevice"` +} + +func init() { + t["QueryVnicStatusRequestType"] = reflect.TypeOf((*QueryVnicStatusRequestType)(nil)).Elem() +} + +type QueryVnicStatusResponse struct { + Returnval IscsiStatus `xml:"returnval"` +} + +type QueryVsanObjectUuidsByFilter QueryVsanObjectUuidsByFilterRequestType + +func init() { + t["QueryVsanObjectUuidsByFilter"] = reflect.TypeOf((*QueryVsanObjectUuidsByFilter)(nil)).Elem() +} + +type QueryVsanObjectUuidsByFilterRequestType struct { + This ManagedObjectReference `xml:"_this"` + Uuids []string `xml:"uuids,omitempty"` + Limit int32 `xml:"limit,omitempty"` + Version int32 `xml:"version,omitempty"` +} + +func init() { + t["QueryVsanObjectUuidsByFilterRequestType"] = reflect.TypeOf((*QueryVsanObjectUuidsByFilterRequestType)(nil)).Elem() +} + +type QueryVsanObjectUuidsByFilterResponse struct { + Returnval []string `xml:"returnval,omitempty"` +} + +type QueryVsanObjects QueryVsanObjectsRequestType + +func init() { + t["QueryVsanObjects"] = reflect.TypeOf((*QueryVsanObjects)(nil)).Elem() +} + +type QueryVsanObjectsRequestType struct { + This ManagedObjectReference `xml:"_this"` + Uuids []string `xml:"uuids,omitempty"` +} + +func init() { + t["QueryVsanObjectsRequestType"] = reflect.TypeOf((*QueryVsanObjectsRequestType)(nil)).Elem() +} + +type QueryVsanObjectsResponse struct { + Returnval string `xml:"returnval"` +} + +type QueryVsanStatistics QueryVsanStatisticsRequestType + +func init() { + t["QueryVsanStatistics"] = reflect.TypeOf((*QueryVsanStatistics)(nil)).Elem() +} + +type QueryVsanStatisticsRequestType struct { + This ManagedObjectReference `xml:"_this"` + Labels []string `xml:"labels"` +} + +func init() { + t["QueryVsanStatisticsRequestType"] = reflect.TypeOf((*QueryVsanStatisticsRequestType)(nil)).Elem() +} + +type QueryVsanStatisticsResponse struct { + Returnval string `xml:"returnval"` +} + +type QueryVsanUpgradeStatus QueryVsanUpgradeStatusRequestType + +func init() { + t["QueryVsanUpgradeStatus"] = reflect.TypeOf((*QueryVsanUpgradeStatus)(nil)).Elem() +} + +type QueryVsanUpgradeStatusRequestType struct { + This ManagedObjectReference `xml:"_this"` + Cluster ManagedObjectReference `xml:"cluster"` +} + +func init() { + t["QueryVsanUpgradeStatusRequestType"] = reflect.TypeOf((*QueryVsanUpgradeStatusRequestType)(nil)).Elem() +} + +type QueryVsanUpgradeStatusResponse struct { + Returnval VsanUpgradeSystemUpgradeStatus `xml:"returnval"` +} + +type QuestionPending struct { + InvalidState + + Text string `xml:"text"` +} + +func init() { + t["QuestionPending"] = reflect.TypeOf((*QuestionPending)(nil)).Elem() +} + +type QuestionPendingFault QuestionPending + +func init() { + t["QuestionPendingFault"] = reflect.TypeOf((*QuestionPendingFault)(nil)).Elem() +} + +type QuiesceDatastoreIOForHAFailed struct { + ResourceInUse + + Host ManagedObjectReference `xml:"host"` + HostName string `xml:"hostName"` + Ds ManagedObjectReference `xml:"ds"` + DsName string `xml:"dsName"` +} + +func init() { + t["QuiesceDatastoreIOForHAFailed"] = reflect.TypeOf((*QuiesceDatastoreIOForHAFailed)(nil)).Elem() +} + +type QuiesceDatastoreIOForHAFailedFault QuiesceDatastoreIOForHAFailed + +func init() { + t["QuiesceDatastoreIOForHAFailedFault"] = reflect.TypeOf((*QuiesceDatastoreIOForHAFailedFault)(nil)).Elem() +} + +type RDMConversionNotSupported struct { + MigrationFault + + Device string `xml:"device"` +} + +func init() { + t["RDMConversionNotSupported"] = reflect.TypeOf((*RDMConversionNotSupported)(nil)).Elem() +} + +type RDMConversionNotSupportedFault RDMConversionNotSupported + +func init() { + t["RDMConversionNotSupportedFault"] = reflect.TypeOf((*RDMConversionNotSupportedFault)(nil)).Elem() +} + +type RDMNotPreserved struct { + MigrationFault + + Device string `xml:"device"` +} + +func init() { + t["RDMNotPreserved"] = reflect.TypeOf((*RDMNotPreserved)(nil)).Elem() +} + +type RDMNotPreservedFault RDMNotPreserved + +func init() { + t["RDMNotPreservedFault"] = reflect.TypeOf((*RDMNotPreservedFault)(nil)).Elem() +} + +type RDMNotSupported struct { + DeviceNotSupported +} + +func init() { + t["RDMNotSupported"] = reflect.TypeOf((*RDMNotSupported)(nil)).Elem() +} + +type RDMNotSupportedFault BaseRDMNotSupported + +func init() { + t["RDMNotSupportedFault"] = reflect.TypeOf((*RDMNotSupportedFault)(nil)).Elem() +} + +type RDMNotSupportedOnDatastore struct { + VmConfigFault + + Device string `xml:"device"` + Datastore ManagedObjectReference `xml:"datastore"` + DatastoreName string `xml:"datastoreName"` +} + +func init() { + t["RDMNotSupportedOnDatastore"] = reflect.TypeOf((*RDMNotSupportedOnDatastore)(nil)).Elem() +} + +type RDMNotSupportedOnDatastoreFault RDMNotSupportedOnDatastore + +func init() { + t["RDMNotSupportedOnDatastoreFault"] = reflect.TypeOf((*RDMNotSupportedOnDatastoreFault)(nil)).Elem() +} + +type RDMPointsToInaccessibleDisk struct { + CannotAccessVmDisk +} + +func init() { + t["RDMPointsToInaccessibleDisk"] = reflect.TypeOf((*RDMPointsToInaccessibleDisk)(nil)).Elem() +} + +type RDMPointsToInaccessibleDiskFault RDMPointsToInaccessibleDisk + +func init() { + t["RDMPointsToInaccessibleDiskFault"] = reflect.TypeOf((*RDMPointsToInaccessibleDiskFault)(nil)).Elem() +} + +type RawDiskNotSupported struct { + DeviceNotSupported +} + +func init() { + t["RawDiskNotSupported"] = reflect.TypeOf((*RawDiskNotSupported)(nil)).Elem() +} + +type RawDiskNotSupportedFault RawDiskNotSupported + +func init() { + t["RawDiskNotSupportedFault"] = reflect.TypeOf((*RawDiskNotSupportedFault)(nil)).Elem() +} + +type ReadEnvironmentVariableInGuest ReadEnvironmentVariableInGuestRequestType + +func init() { + t["ReadEnvironmentVariableInGuest"] = reflect.TypeOf((*ReadEnvironmentVariableInGuest)(nil)).Elem() +} + +type ReadEnvironmentVariableInGuestRequestType struct { + This ManagedObjectReference `xml:"_this"` + Vm ManagedObjectReference `xml:"vm"` + Auth BaseGuestAuthentication `xml:"auth,typeattr"` + Names []string `xml:"names,omitempty"` +} + +func init() { + t["ReadEnvironmentVariableInGuestRequestType"] = reflect.TypeOf((*ReadEnvironmentVariableInGuestRequestType)(nil)).Elem() +} + +type ReadEnvironmentVariableInGuestResponse struct { + Returnval []string `xml:"returnval,omitempty"` +} + +type ReadHostResourcePoolTreeFailed struct { + HostConnectFault +} + +func init() { + t["ReadHostResourcePoolTreeFailed"] = reflect.TypeOf((*ReadHostResourcePoolTreeFailed)(nil)).Elem() +} + +type ReadHostResourcePoolTreeFailedFault ReadHostResourcePoolTreeFailed + +func init() { + t["ReadHostResourcePoolTreeFailedFault"] = reflect.TypeOf((*ReadHostResourcePoolTreeFailedFault)(nil)).Elem() +} + +type ReadNextEvents ReadNextEventsRequestType + +func init() { + t["ReadNextEvents"] = reflect.TypeOf((*ReadNextEvents)(nil)).Elem() +} + +type ReadNextEventsRequestType struct { + This ManagedObjectReference `xml:"_this"` + MaxCount int32 `xml:"maxCount"` +} + +func init() { + t["ReadNextEventsRequestType"] = reflect.TypeOf((*ReadNextEventsRequestType)(nil)).Elem() +} + +type ReadNextEventsResponse struct { + Returnval []BaseEvent `xml:"returnval,omitempty,typeattr"` +} + +type ReadNextTasks ReadNextTasksRequestType + +func init() { + t["ReadNextTasks"] = reflect.TypeOf((*ReadNextTasks)(nil)).Elem() +} + +type ReadNextTasksRequestType struct { + This ManagedObjectReference `xml:"_this"` + MaxCount int32 `xml:"maxCount"` +} + +func init() { + t["ReadNextTasksRequestType"] = reflect.TypeOf((*ReadNextTasksRequestType)(nil)).Elem() +} + +type ReadNextTasksResponse struct { + Returnval []TaskInfo `xml:"returnval,omitempty"` +} + +type ReadOnlyDisksWithLegacyDestination struct { + MigrationFault + + RoDiskCount int32 `xml:"roDiskCount"` + TimeoutDanger bool `xml:"timeoutDanger"` +} + +func init() { + t["ReadOnlyDisksWithLegacyDestination"] = reflect.TypeOf((*ReadOnlyDisksWithLegacyDestination)(nil)).Elem() +} + +type ReadOnlyDisksWithLegacyDestinationFault ReadOnlyDisksWithLegacyDestination + +func init() { + t["ReadOnlyDisksWithLegacyDestinationFault"] = reflect.TypeOf((*ReadOnlyDisksWithLegacyDestinationFault)(nil)).Elem() +} + +type ReadPreviousEvents ReadPreviousEventsRequestType + +func init() { + t["ReadPreviousEvents"] = reflect.TypeOf((*ReadPreviousEvents)(nil)).Elem() +} + +type ReadPreviousEventsRequestType struct { + This ManagedObjectReference `xml:"_this"` + MaxCount int32 `xml:"maxCount"` +} + +func init() { + t["ReadPreviousEventsRequestType"] = reflect.TypeOf((*ReadPreviousEventsRequestType)(nil)).Elem() +} + +type ReadPreviousEventsResponse struct { + Returnval []BaseEvent `xml:"returnval,omitempty,typeattr"` +} + +type ReadPreviousTasks ReadPreviousTasksRequestType + +func init() { + t["ReadPreviousTasks"] = reflect.TypeOf((*ReadPreviousTasks)(nil)).Elem() +} + +type ReadPreviousTasksRequestType struct { + This ManagedObjectReference `xml:"_this"` + MaxCount int32 `xml:"maxCount"` +} + +func init() { + t["ReadPreviousTasksRequestType"] = reflect.TypeOf((*ReadPreviousTasksRequestType)(nil)).Elem() +} + +type ReadPreviousTasksResponse struct { + Returnval []TaskInfo `xml:"returnval,omitempty"` +} + +type RebootGuest RebootGuestRequestType + +func init() { + t["RebootGuest"] = reflect.TypeOf((*RebootGuest)(nil)).Elem() +} + +type RebootGuestRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["RebootGuestRequestType"] = reflect.TypeOf((*RebootGuestRequestType)(nil)).Elem() +} + +type RebootGuestResponse struct { +} + +type RebootHostRequestType struct { + This ManagedObjectReference `xml:"_this"` + Force bool `xml:"force"` +} + +func init() { + t["RebootHostRequestType"] = reflect.TypeOf((*RebootHostRequestType)(nil)).Elem() +} + +type RebootHost_Task RebootHostRequestType + +func init() { + t["RebootHost_Task"] = reflect.TypeOf((*RebootHost_Task)(nil)).Elem() +} + +type RebootHost_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type RebootRequired struct { + VimFault + + Patch string `xml:"patch,omitempty"` +} + +func init() { + t["RebootRequired"] = reflect.TypeOf((*RebootRequired)(nil)).Elem() +} + +type RebootRequiredFault RebootRequired + +func init() { + t["RebootRequiredFault"] = reflect.TypeOf((*RebootRequiredFault)(nil)).Elem() +} + +type RecommendDatastores RecommendDatastoresRequestType + +func init() { + t["RecommendDatastores"] = reflect.TypeOf((*RecommendDatastores)(nil)).Elem() +} + +type RecommendDatastoresRequestType struct { + This ManagedObjectReference `xml:"_this"` + StorageSpec StoragePlacementSpec `xml:"storageSpec"` +} + +func init() { + t["RecommendDatastoresRequestType"] = reflect.TypeOf((*RecommendDatastoresRequestType)(nil)).Elem() +} + +type RecommendDatastoresResponse struct { + Returnval StoragePlacementResult `xml:"returnval"` +} + +type RecommendHostsForVm RecommendHostsForVmRequestType + +func init() { + t["RecommendHostsForVm"] = reflect.TypeOf((*RecommendHostsForVm)(nil)).Elem() +} + +type RecommendHostsForVmRequestType struct { + This ManagedObjectReference `xml:"_this"` + Vm ManagedObjectReference `xml:"vm"` + Pool *ManagedObjectReference `xml:"pool,omitempty"` +} + +func init() { + t["RecommendHostsForVmRequestType"] = reflect.TypeOf((*RecommendHostsForVmRequestType)(nil)).Elem() +} + +type RecommendHostsForVmResponse struct { + Returnval []ClusterHostRecommendation `xml:"returnval,omitempty"` +} + +type RecommissionVsanNodeRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["RecommissionVsanNodeRequestType"] = reflect.TypeOf((*RecommissionVsanNodeRequestType)(nil)).Elem() +} + +type RecommissionVsanNode_Task RecommissionVsanNodeRequestType + +func init() { + t["RecommissionVsanNode_Task"] = reflect.TypeOf((*RecommissionVsanNode_Task)(nil)).Elem() +} + +type RecommissionVsanNode_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type ReconfigVMRequestType struct { + This ManagedObjectReference `xml:"_this"` + Spec VirtualMachineConfigSpec `xml:"spec"` +} + +func init() { + t["ReconfigVMRequestType"] = reflect.TypeOf((*ReconfigVMRequestType)(nil)).Elem() +} + +type ReconfigVM_Task ReconfigVMRequestType + +func init() { + t["ReconfigVM_Task"] = reflect.TypeOf((*ReconfigVM_Task)(nil)).Elem() +} + +type ReconfigVM_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type ReconfigurationSatisfiable ReconfigurationSatisfiableRequestType + +func init() { + t["ReconfigurationSatisfiable"] = reflect.TypeOf((*ReconfigurationSatisfiable)(nil)).Elem() +} + +type ReconfigurationSatisfiableRequestType struct { + This ManagedObjectReference `xml:"_this"` + Pcbs []VsanPolicyChangeBatch `xml:"pcbs"` + IgnoreSatisfiability *bool `xml:"ignoreSatisfiability"` +} + +func init() { + t["ReconfigurationSatisfiableRequestType"] = reflect.TypeOf((*ReconfigurationSatisfiableRequestType)(nil)).Elem() +} + +type ReconfigurationSatisfiableResponse struct { + Returnval []VsanPolicySatisfiability `xml:"returnval"` +} + +type ReconfigureAlarm ReconfigureAlarmRequestType + +func init() { + t["ReconfigureAlarm"] = reflect.TypeOf((*ReconfigureAlarm)(nil)).Elem() +} + +type ReconfigureAlarmRequestType struct { + This ManagedObjectReference `xml:"_this"` + Spec BaseAlarmSpec `xml:"spec,typeattr"` +} + +func init() { + t["ReconfigureAlarmRequestType"] = reflect.TypeOf((*ReconfigureAlarmRequestType)(nil)).Elem() +} + +type ReconfigureAlarmResponse struct { +} + +type ReconfigureAutostart ReconfigureAutostartRequestType + +func init() { + t["ReconfigureAutostart"] = reflect.TypeOf((*ReconfigureAutostart)(nil)).Elem() +} + +type ReconfigureAutostartRequestType struct { + This ManagedObjectReference `xml:"_this"` + Spec HostAutoStartManagerConfig `xml:"spec"` +} + +func init() { + t["ReconfigureAutostartRequestType"] = reflect.TypeOf((*ReconfigureAutostartRequestType)(nil)).Elem() +} + +type ReconfigureAutostartResponse struct { +} + +type ReconfigureClusterRequestType struct { + This ManagedObjectReference `xml:"_this"` + Spec ClusterConfigSpec `xml:"spec"` + Modify bool `xml:"modify"` +} + +func init() { + t["ReconfigureClusterRequestType"] = reflect.TypeOf((*ReconfigureClusterRequestType)(nil)).Elem() +} + +type ReconfigureCluster_Task ReconfigureClusterRequestType + +func init() { + t["ReconfigureCluster_Task"] = reflect.TypeOf((*ReconfigureCluster_Task)(nil)).Elem() +} + +type ReconfigureCluster_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type ReconfigureComputeResourceRequestType struct { + This ManagedObjectReference `xml:"_this"` + Spec BaseComputeResourceConfigSpec `xml:"spec,typeattr"` + Modify bool `xml:"modify"` +} + +func init() { + t["ReconfigureComputeResourceRequestType"] = reflect.TypeOf((*ReconfigureComputeResourceRequestType)(nil)).Elem() +} + +type ReconfigureComputeResource_Task ReconfigureComputeResourceRequestType + +func init() { + t["ReconfigureComputeResource_Task"] = reflect.TypeOf((*ReconfigureComputeResource_Task)(nil)).Elem() +} + +type ReconfigureComputeResource_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type ReconfigureDVPortRequestType struct { + This ManagedObjectReference `xml:"_this"` + Port []DVPortConfigSpec `xml:"port"` +} + +func init() { + t["ReconfigureDVPortRequestType"] = reflect.TypeOf((*ReconfigureDVPortRequestType)(nil)).Elem() +} + +type ReconfigureDVPort_Task ReconfigureDVPortRequestType + +func init() { + t["ReconfigureDVPort_Task"] = reflect.TypeOf((*ReconfigureDVPort_Task)(nil)).Elem() +} + +type ReconfigureDVPort_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type ReconfigureDVPortgroupRequestType struct { + This ManagedObjectReference `xml:"_this"` + Spec DVPortgroupConfigSpec `xml:"spec"` +} + +func init() { + t["ReconfigureDVPortgroupRequestType"] = reflect.TypeOf((*ReconfigureDVPortgroupRequestType)(nil)).Elem() +} + +type ReconfigureDVPortgroup_Task ReconfigureDVPortgroupRequestType + +func init() { + t["ReconfigureDVPortgroup_Task"] = reflect.TypeOf((*ReconfigureDVPortgroup_Task)(nil)).Elem() +} + +type ReconfigureDVPortgroup_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type ReconfigureDatacenterRequestType struct { + This ManagedObjectReference `xml:"_this"` + Spec DatacenterConfigSpec `xml:"spec"` + Modify bool `xml:"modify"` +} + +func init() { + t["ReconfigureDatacenterRequestType"] = reflect.TypeOf((*ReconfigureDatacenterRequestType)(nil)).Elem() +} + +type ReconfigureDatacenter_Task ReconfigureDatacenterRequestType + +func init() { + t["ReconfigureDatacenter_Task"] = reflect.TypeOf((*ReconfigureDatacenter_Task)(nil)).Elem() +} + +type ReconfigureDatacenter_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type ReconfigureDomObject ReconfigureDomObjectRequestType + +func init() { + t["ReconfigureDomObject"] = reflect.TypeOf((*ReconfigureDomObject)(nil)).Elem() +} + +type ReconfigureDomObjectRequestType struct { + This ManagedObjectReference `xml:"_this"` + Uuid string `xml:"uuid"` + Policy string `xml:"policy"` +} + +func init() { + t["ReconfigureDomObjectRequestType"] = reflect.TypeOf((*ReconfigureDomObjectRequestType)(nil)).Elem() +} + +type ReconfigureDomObjectResponse struct { +} + +type ReconfigureDvsRequestType struct { + This ManagedObjectReference `xml:"_this"` + Spec BaseDVSConfigSpec `xml:"spec,typeattr"` +} + +func init() { + t["ReconfigureDvsRequestType"] = reflect.TypeOf((*ReconfigureDvsRequestType)(nil)).Elem() +} + +type ReconfigureDvs_Task ReconfigureDvsRequestType + +func init() { + t["ReconfigureDvs_Task"] = reflect.TypeOf((*ReconfigureDvs_Task)(nil)).Elem() +} + +type ReconfigureDvs_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type ReconfigureHostForDASRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["ReconfigureHostForDASRequestType"] = reflect.TypeOf((*ReconfigureHostForDASRequestType)(nil)).Elem() +} + +type ReconfigureHostForDAS_Task ReconfigureHostForDASRequestType + +func init() { + t["ReconfigureHostForDAS_Task"] = reflect.TypeOf((*ReconfigureHostForDAS_Task)(nil)).Elem() +} + +type ReconfigureHostForDAS_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type ReconfigureScheduledTask ReconfigureScheduledTaskRequestType + +func init() { + t["ReconfigureScheduledTask"] = reflect.TypeOf((*ReconfigureScheduledTask)(nil)).Elem() +} + +type ReconfigureScheduledTaskRequestType struct { + This ManagedObjectReference `xml:"_this"` + Spec BaseScheduledTaskSpec `xml:"spec,typeattr"` +} + +func init() { + t["ReconfigureScheduledTaskRequestType"] = reflect.TypeOf((*ReconfigureScheduledTaskRequestType)(nil)).Elem() +} + +type ReconfigureScheduledTaskResponse struct { +} + +type ReconfigureServiceConsoleReservation ReconfigureServiceConsoleReservationRequestType + +func init() { + t["ReconfigureServiceConsoleReservation"] = reflect.TypeOf((*ReconfigureServiceConsoleReservation)(nil)).Elem() +} + +type ReconfigureServiceConsoleReservationRequestType struct { + This ManagedObjectReference `xml:"_this"` + CfgBytes int64 `xml:"cfgBytes"` +} + +func init() { + t["ReconfigureServiceConsoleReservationRequestType"] = reflect.TypeOf((*ReconfigureServiceConsoleReservationRequestType)(nil)).Elem() +} + +type ReconfigureServiceConsoleReservationResponse struct { +} + +type ReconfigureSnmpAgent ReconfigureSnmpAgentRequestType + +func init() { + t["ReconfigureSnmpAgent"] = reflect.TypeOf((*ReconfigureSnmpAgent)(nil)).Elem() +} + +type ReconfigureSnmpAgentRequestType struct { + This ManagedObjectReference `xml:"_this"` + Spec HostSnmpConfigSpec `xml:"spec"` +} + +func init() { + t["ReconfigureSnmpAgentRequestType"] = reflect.TypeOf((*ReconfigureSnmpAgentRequestType)(nil)).Elem() +} + +type ReconfigureSnmpAgentResponse struct { +} + +type ReconfigureVirtualMachineReservation ReconfigureVirtualMachineReservationRequestType + +func init() { + t["ReconfigureVirtualMachineReservation"] = reflect.TypeOf((*ReconfigureVirtualMachineReservation)(nil)).Elem() +} + +type ReconfigureVirtualMachineReservationRequestType struct { + This ManagedObjectReference `xml:"_this"` + Spec VirtualMachineMemoryReservationSpec `xml:"spec"` +} + +func init() { + t["ReconfigureVirtualMachineReservationRequestType"] = reflect.TypeOf((*ReconfigureVirtualMachineReservationRequestType)(nil)).Elem() +} + +type ReconfigureVirtualMachineReservationResponse struct { +} + +type ReconnectHostRequestType struct { + This ManagedObjectReference `xml:"_this"` + CnxSpec *HostConnectSpec `xml:"cnxSpec,omitempty"` + ReconnectSpec *HostSystemReconnectSpec `xml:"reconnectSpec,omitempty"` +} + +func init() { + t["ReconnectHostRequestType"] = reflect.TypeOf((*ReconnectHostRequestType)(nil)).Elem() +} + +type ReconnectHost_Task ReconnectHostRequestType + +func init() { + t["ReconnectHost_Task"] = reflect.TypeOf((*ReconnectHost_Task)(nil)).Elem() +} + +type ReconnectHost_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type RecordReplayDisabled struct { + VimFault +} + +func init() { + t["RecordReplayDisabled"] = reflect.TypeOf((*RecordReplayDisabled)(nil)).Elem() +} + +type RecordReplayDisabledFault RecordReplayDisabled + +func init() { + t["RecordReplayDisabledFault"] = reflect.TypeOf((*RecordReplayDisabledFault)(nil)).Elem() +} + +type RecoveryEvent struct { + DvsEvent + + HostName string `xml:"hostName"` + PortKey string `xml:"portKey"` + DvsUuid string `xml:"dvsUuid,omitempty"` + Vnic string `xml:"vnic,omitempty"` +} + +func init() { + t["RecoveryEvent"] = reflect.TypeOf((*RecoveryEvent)(nil)).Elem() +} + +type RectifyDvsHostRequestType struct { + This ManagedObjectReference `xml:"_this"` + Hosts []ManagedObjectReference `xml:"hosts,omitempty"` +} + +func init() { + t["RectifyDvsHostRequestType"] = reflect.TypeOf((*RectifyDvsHostRequestType)(nil)).Elem() +} + +type RectifyDvsHost_Task RectifyDvsHostRequestType + +func init() { + t["RectifyDvsHost_Task"] = reflect.TypeOf((*RectifyDvsHost_Task)(nil)).Elem() +} + +type RectifyDvsHost_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type RectifyDvsOnHostRequestType struct { + This ManagedObjectReference `xml:"_this"` + Hosts []ManagedObjectReference `xml:"hosts"` +} + +func init() { + t["RectifyDvsOnHostRequestType"] = reflect.TypeOf((*RectifyDvsOnHostRequestType)(nil)).Elem() +} + +type RectifyDvsOnHost_Task RectifyDvsOnHostRequestType + +func init() { + t["RectifyDvsOnHost_Task"] = reflect.TypeOf((*RectifyDvsOnHost_Task)(nil)).Elem() +} + +type RectifyDvsOnHost_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type RecurrentTaskScheduler struct { + TaskScheduler + + Interval int32 `xml:"interval"` +} + +func init() { + t["RecurrentTaskScheduler"] = reflect.TypeOf((*RecurrentTaskScheduler)(nil)).Elem() +} + +type Refresh RefreshRequestType + +func init() { + t["Refresh"] = reflect.TypeOf((*Refresh)(nil)).Elem() +} + +type RefreshDVPortState RefreshDVPortStateRequestType + +func init() { + t["RefreshDVPortState"] = reflect.TypeOf((*RefreshDVPortState)(nil)).Elem() +} + +type RefreshDVPortStateRequestType struct { + This ManagedObjectReference `xml:"_this"` + PortKeys []string `xml:"portKeys,omitempty"` +} + +func init() { + t["RefreshDVPortStateRequestType"] = reflect.TypeOf((*RefreshDVPortStateRequestType)(nil)).Elem() +} + +type RefreshDVPortStateResponse struct { +} + +type RefreshDatastore RefreshDatastoreRequestType + +func init() { + t["RefreshDatastore"] = reflect.TypeOf((*RefreshDatastore)(nil)).Elem() +} + +type RefreshDatastoreRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["RefreshDatastoreRequestType"] = reflect.TypeOf((*RefreshDatastoreRequestType)(nil)).Elem() +} + +type RefreshDatastoreResponse struct { +} + +type RefreshDatastoreStorageInfo RefreshDatastoreStorageInfoRequestType + +func init() { + t["RefreshDatastoreStorageInfo"] = reflect.TypeOf((*RefreshDatastoreStorageInfo)(nil)).Elem() +} + +type RefreshDatastoreStorageInfoRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["RefreshDatastoreStorageInfoRequestType"] = reflect.TypeOf((*RefreshDatastoreStorageInfoRequestType)(nil)).Elem() +} + +type RefreshDatastoreStorageInfoResponse struct { +} + +type RefreshDateTimeSystem RefreshDateTimeSystemRequestType + +func init() { + t["RefreshDateTimeSystem"] = reflect.TypeOf((*RefreshDateTimeSystem)(nil)).Elem() +} + +type RefreshDateTimeSystemRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["RefreshDateTimeSystemRequestType"] = reflect.TypeOf((*RefreshDateTimeSystemRequestType)(nil)).Elem() +} + +type RefreshDateTimeSystemResponse struct { +} + +type RefreshFirewall RefreshFirewallRequestType + +func init() { + t["RefreshFirewall"] = reflect.TypeOf((*RefreshFirewall)(nil)).Elem() +} + +type RefreshFirewallRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["RefreshFirewallRequestType"] = reflect.TypeOf((*RefreshFirewallRequestType)(nil)).Elem() +} + +type RefreshFirewallResponse struct { +} + +type RefreshGraphicsManager RefreshGraphicsManagerRequestType + +func init() { + t["RefreshGraphicsManager"] = reflect.TypeOf((*RefreshGraphicsManager)(nil)).Elem() +} + +type RefreshGraphicsManagerRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["RefreshGraphicsManagerRequestType"] = reflect.TypeOf((*RefreshGraphicsManagerRequestType)(nil)).Elem() +} + +type RefreshGraphicsManagerResponse struct { +} + +type RefreshHealthStatusSystem RefreshHealthStatusSystemRequestType + +func init() { + t["RefreshHealthStatusSystem"] = reflect.TypeOf((*RefreshHealthStatusSystem)(nil)).Elem() +} + +type RefreshHealthStatusSystemRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["RefreshHealthStatusSystemRequestType"] = reflect.TypeOf((*RefreshHealthStatusSystemRequestType)(nil)).Elem() +} + +type RefreshHealthStatusSystemResponse struct { +} + +type RefreshNetworkSystem RefreshNetworkSystemRequestType + +func init() { + t["RefreshNetworkSystem"] = reflect.TypeOf((*RefreshNetworkSystem)(nil)).Elem() +} + +type RefreshNetworkSystemRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["RefreshNetworkSystemRequestType"] = reflect.TypeOf((*RefreshNetworkSystemRequestType)(nil)).Elem() +} + +type RefreshNetworkSystemResponse struct { +} + +type RefreshRecommendation RefreshRecommendationRequestType + +func init() { + t["RefreshRecommendation"] = reflect.TypeOf((*RefreshRecommendation)(nil)).Elem() +} + +type RefreshRecommendationRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["RefreshRecommendationRequestType"] = reflect.TypeOf((*RefreshRecommendationRequestType)(nil)).Elem() +} + +type RefreshRecommendationResponse struct { +} + +type RefreshRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["RefreshRequestType"] = reflect.TypeOf((*RefreshRequestType)(nil)).Elem() +} + +type RefreshResponse struct { +} + +type RefreshRuntime RefreshRuntimeRequestType + +func init() { + t["RefreshRuntime"] = reflect.TypeOf((*RefreshRuntime)(nil)).Elem() +} + +type RefreshRuntimeRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["RefreshRuntimeRequestType"] = reflect.TypeOf((*RefreshRuntimeRequestType)(nil)).Elem() +} + +type RefreshRuntimeResponse struct { +} + +type RefreshServices RefreshServicesRequestType + +func init() { + t["RefreshServices"] = reflect.TypeOf((*RefreshServices)(nil)).Elem() +} + +type RefreshServicesRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["RefreshServicesRequestType"] = reflect.TypeOf((*RefreshServicesRequestType)(nil)).Elem() +} + +type RefreshServicesResponse struct { +} + +type RefreshStorageDrsRecommendation RefreshStorageDrsRecommendationRequestType + +func init() { + t["RefreshStorageDrsRecommendation"] = reflect.TypeOf((*RefreshStorageDrsRecommendation)(nil)).Elem() +} + +type RefreshStorageDrsRecommendationRequestType struct { + This ManagedObjectReference `xml:"_this"` + Pod ManagedObjectReference `xml:"pod"` +} + +func init() { + t["RefreshStorageDrsRecommendationRequestType"] = reflect.TypeOf((*RefreshStorageDrsRecommendationRequestType)(nil)).Elem() +} + +type RefreshStorageDrsRecommendationResponse struct { +} + +type RefreshStorageInfo RefreshStorageInfoRequestType + +func init() { + t["RefreshStorageInfo"] = reflect.TypeOf((*RefreshStorageInfo)(nil)).Elem() +} + +type RefreshStorageInfoRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["RefreshStorageInfoRequestType"] = reflect.TypeOf((*RefreshStorageInfoRequestType)(nil)).Elem() +} + +type RefreshStorageInfoResponse struct { +} + +type RefreshStorageSystem RefreshStorageSystemRequestType + +func init() { + t["RefreshStorageSystem"] = reflect.TypeOf((*RefreshStorageSystem)(nil)).Elem() +} + +type RefreshStorageSystemRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["RefreshStorageSystemRequestType"] = reflect.TypeOf((*RefreshStorageSystemRequestType)(nil)).Elem() +} + +type RefreshStorageSystemResponse struct { +} + +type RegisterChildVMRequestType struct { + This ManagedObjectReference `xml:"_this"` + Path string `xml:"path"` + Name string `xml:"name,omitempty"` + Host *ManagedObjectReference `xml:"host,omitempty"` +} + +func init() { + t["RegisterChildVMRequestType"] = reflect.TypeOf((*RegisterChildVMRequestType)(nil)).Elem() +} + +type RegisterChildVM_Task RegisterChildVMRequestType + +func init() { + t["RegisterChildVM_Task"] = reflect.TypeOf((*RegisterChildVM_Task)(nil)).Elem() +} + +type RegisterChildVM_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type RegisterExtension RegisterExtensionRequestType + +func init() { + t["RegisterExtension"] = reflect.TypeOf((*RegisterExtension)(nil)).Elem() +} + +type RegisterExtensionRequestType struct { + This ManagedObjectReference `xml:"_this"` + Extension Extension `xml:"extension"` +} + +func init() { + t["RegisterExtensionRequestType"] = reflect.TypeOf((*RegisterExtensionRequestType)(nil)).Elem() +} + +type RegisterExtensionResponse struct { +} + +type RegisterVMRequestType struct { + This ManagedObjectReference `xml:"_this"` + Path string `xml:"path"` + Name string `xml:"name,omitempty"` + AsTemplate bool `xml:"asTemplate"` + Pool *ManagedObjectReference `xml:"pool,omitempty"` + Host *ManagedObjectReference `xml:"host,omitempty"` +} + +func init() { + t["RegisterVMRequestType"] = reflect.TypeOf((*RegisterVMRequestType)(nil)).Elem() +} + +type RegisterVM_Task RegisterVMRequestType + +func init() { + t["RegisterVM_Task"] = reflect.TypeOf((*RegisterVM_Task)(nil)).Elem() +} + +type RegisterVM_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type ReleaseCredentialsInGuest ReleaseCredentialsInGuestRequestType + +func init() { + t["ReleaseCredentialsInGuest"] = reflect.TypeOf((*ReleaseCredentialsInGuest)(nil)).Elem() +} + +type ReleaseCredentialsInGuestRequestType struct { + This ManagedObjectReference `xml:"_this"` + Vm ManagedObjectReference `xml:"vm"` + Auth BaseGuestAuthentication `xml:"auth,typeattr"` +} + +func init() { + t["ReleaseCredentialsInGuestRequestType"] = reflect.TypeOf((*ReleaseCredentialsInGuestRequestType)(nil)).Elem() +} + +type ReleaseCredentialsInGuestResponse struct { +} + +type ReleaseIpAllocation ReleaseIpAllocationRequestType + +func init() { + t["ReleaseIpAllocation"] = reflect.TypeOf((*ReleaseIpAllocation)(nil)).Elem() +} + +type ReleaseIpAllocationRequestType struct { + This ManagedObjectReference `xml:"_this"` + Dc ManagedObjectReference `xml:"dc"` + PoolId int32 `xml:"poolId"` + AllocationId string `xml:"allocationId"` +} + +func init() { + t["ReleaseIpAllocationRequestType"] = reflect.TypeOf((*ReleaseIpAllocationRequestType)(nil)).Elem() +} + +type ReleaseIpAllocationResponse struct { +} + +type Reload ReloadRequestType + +func init() { + t["Reload"] = reflect.TypeOf((*Reload)(nil)).Elem() +} + +type ReloadRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["ReloadRequestType"] = reflect.TypeOf((*ReloadRequestType)(nil)).Elem() +} + +type ReloadResponse struct { +} + +type RelocateVMRequestType struct { + This ManagedObjectReference `xml:"_this"` + Spec VirtualMachineRelocateSpec `xml:"spec"` + Priority VirtualMachineMovePriority `xml:"priority,omitempty"` +} + +func init() { + t["RelocateVMRequestType"] = reflect.TypeOf((*RelocateVMRequestType)(nil)).Elem() +} + +type RelocateVM_Task RelocateVMRequestType + +func init() { + t["RelocateVM_Task"] = reflect.TypeOf((*RelocateVM_Task)(nil)).Elem() +} + +type RelocateVM_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type RemoteDeviceNotSupported struct { + DeviceNotSupported +} + +func init() { + t["RemoteDeviceNotSupported"] = reflect.TypeOf((*RemoteDeviceNotSupported)(nil)).Elem() +} + +type RemoteDeviceNotSupportedFault RemoteDeviceNotSupported + +func init() { + t["RemoteDeviceNotSupportedFault"] = reflect.TypeOf((*RemoteDeviceNotSupportedFault)(nil)).Elem() +} + +type RemoteTSMEnabledEvent struct { + HostEvent +} + +func init() { + t["RemoteTSMEnabledEvent"] = reflect.TypeOf((*RemoteTSMEnabledEvent)(nil)).Elem() +} + +type RemoveAlarm RemoveAlarmRequestType + +func init() { + t["RemoveAlarm"] = reflect.TypeOf((*RemoveAlarm)(nil)).Elem() +} + +type RemoveAlarmRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["RemoveAlarmRequestType"] = reflect.TypeOf((*RemoveAlarmRequestType)(nil)).Elem() +} + +type RemoveAlarmResponse struct { +} + +type RemoveAllSnapshotsRequestType struct { + This ManagedObjectReference `xml:"_this"` + Consolidate *bool `xml:"consolidate"` +} + +func init() { + t["RemoveAllSnapshotsRequestType"] = reflect.TypeOf((*RemoveAllSnapshotsRequestType)(nil)).Elem() +} + +type RemoveAllSnapshots_Task RemoveAllSnapshotsRequestType + +func init() { + t["RemoveAllSnapshots_Task"] = reflect.TypeOf((*RemoveAllSnapshots_Task)(nil)).Elem() +} + +type RemoveAllSnapshots_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type RemoveAssignedLicense RemoveAssignedLicenseRequestType + +func init() { + t["RemoveAssignedLicense"] = reflect.TypeOf((*RemoveAssignedLicense)(nil)).Elem() +} + +type RemoveAssignedLicenseRequestType struct { + This ManagedObjectReference `xml:"_this"` + EntityId string `xml:"entityId"` +} + +func init() { + t["RemoveAssignedLicenseRequestType"] = reflect.TypeOf((*RemoveAssignedLicenseRequestType)(nil)).Elem() +} + +type RemoveAssignedLicenseResponse struct { +} + +type RemoveAuthorizationRole RemoveAuthorizationRoleRequestType + +func init() { + t["RemoveAuthorizationRole"] = reflect.TypeOf((*RemoveAuthorizationRole)(nil)).Elem() +} + +type RemoveAuthorizationRoleRequestType struct { + This ManagedObjectReference `xml:"_this"` + RoleId int32 `xml:"roleId"` + FailIfUsed bool `xml:"failIfUsed"` +} + +func init() { + t["RemoveAuthorizationRoleRequestType"] = reflect.TypeOf((*RemoveAuthorizationRoleRequestType)(nil)).Elem() +} + +type RemoveAuthorizationRoleResponse struct { +} + +type RemoveCustomFieldDef RemoveCustomFieldDefRequestType + +func init() { + t["RemoveCustomFieldDef"] = reflect.TypeOf((*RemoveCustomFieldDef)(nil)).Elem() +} + +type RemoveCustomFieldDefRequestType struct { + This ManagedObjectReference `xml:"_this"` + Key int32 `xml:"key"` +} + +func init() { + t["RemoveCustomFieldDefRequestType"] = reflect.TypeOf((*RemoveCustomFieldDefRequestType)(nil)).Elem() +} + +type RemoveCustomFieldDefResponse struct { +} + +type RemoveDatastore RemoveDatastoreRequestType + +func init() { + t["RemoveDatastore"] = reflect.TypeOf((*RemoveDatastore)(nil)).Elem() +} + +type RemoveDatastoreExRequestType struct { + This ManagedObjectReference `xml:"_this"` + Datastore []ManagedObjectReference `xml:"datastore"` +} + +func init() { + t["RemoveDatastoreExRequestType"] = reflect.TypeOf((*RemoveDatastoreExRequestType)(nil)).Elem() +} + +type RemoveDatastoreEx_Task RemoveDatastoreExRequestType + +func init() { + t["RemoveDatastoreEx_Task"] = reflect.TypeOf((*RemoveDatastoreEx_Task)(nil)).Elem() +} + +type RemoveDatastoreEx_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type RemoveDatastoreRequestType struct { + This ManagedObjectReference `xml:"_this"` + Datastore ManagedObjectReference `xml:"datastore"` +} + +func init() { + t["RemoveDatastoreRequestType"] = reflect.TypeOf((*RemoveDatastoreRequestType)(nil)).Elem() +} + +type RemoveDatastoreResponse struct { +} + +type RemoveDiskMappingRequestType struct { + This ManagedObjectReference `xml:"_this"` + Mapping []VsanHostDiskMapping `xml:"mapping"` + MaintenanceSpec *HostMaintenanceSpec `xml:"maintenanceSpec,omitempty"` + Timeout int32 `xml:"timeout,omitempty"` +} + +func init() { + t["RemoveDiskMappingRequestType"] = reflect.TypeOf((*RemoveDiskMappingRequestType)(nil)).Elem() +} + +type RemoveDiskMapping_Task RemoveDiskMappingRequestType + +func init() { + t["RemoveDiskMapping_Task"] = reflect.TypeOf((*RemoveDiskMapping_Task)(nil)).Elem() +} + +type RemoveDiskMapping_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type RemoveDiskRequestType struct { + This ManagedObjectReference `xml:"_this"` + Disk []HostScsiDisk `xml:"disk"` + MaintenanceSpec *HostMaintenanceSpec `xml:"maintenanceSpec,omitempty"` + Timeout int32 `xml:"timeout,omitempty"` +} + +func init() { + t["RemoveDiskRequestType"] = reflect.TypeOf((*RemoveDiskRequestType)(nil)).Elem() +} + +type RemoveDisk_Task RemoveDiskRequestType + +func init() { + t["RemoveDisk_Task"] = reflect.TypeOf((*RemoveDisk_Task)(nil)).Elem() +} + +type RemoveDisk_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type RemoveEntityPermission RemoveEntityPermissionRequestType + +func init() { + t["RemoveEntityPermission"] = reflect.TypeOf((*RemoveEntityPermission)(nil)).Elem() +} + +type RemoveEntityPermissionRequestType struct { + This ManagedObjectReference `xml:"_this"` + Entity ManagedObjectReference `xml:"entity"` + User string `xml:"user"` + IsGroup bool `xml:"isGroup"` +} + +func init() { + t["RemoveEntityPermissionRequestType"] = reflect.TypeOf((*RemoveEntityPermissionRequestType)(nil)).Elem() +} + +type RemoveEntityPermissionResponse struct { +} + +type RemoveFailed struct { + VimFault +} + +func init() { + t["RemoveFailed"] = reflect.TypeOf((*RemoveFailed)(nil)).Elem() +} + +type RemoveFailedFault RemoveFailed + +func init() { + t["RemoveFailedFault"] = reflect.TypeOf((*RemoveFailedFault)(nil)).Elem() +} + +type RemoveGroup RemoveGroupRequestType + +func init() { + t["RemoveGroup"] = reflect.TypeOf((*RemoveGroup)(nil)).Elem() +} + +type RemoveGroupRequestType struct { + This ManagedObjectReference `xml:"_this"` + GroupName string `xml:"groupName"` +} + +func init() { + t["RemoveGroupRequestType"] = reflect.TypeOf((*RemoveGroupRequestType)(nil)).Elem() +} + +type RemoveGroupResponse struct { +} + +type RemoveGuestAlias RemoveGuestAliasRequestType + +func init() { + t["RemoveGuestAlias"] = reflect.TypeOf((*RemoveGuestAlias)(nil)).Elem() +} + +type RemoveGuestAliasByCert RemoveGuestAliasByCertRequestType + +func init() { + t["RemoveGuestAliasByCert"] = reflect.TypeOf((*RemoveGuestAliasByCert)(nil)).Elem() +} + +type RemoveGuestAliasByCertRequestType struct { + This ManagedObjectReference `xml:"_this"` + Vm ManagedObjectReference `xml:"vm"` + Auth BaseGuestAuthentication `xml:"auth,typeattr"` + Username string `xml:"username"` + Base64Cert string `xml:"base64Cert"` +} + +func init() { + t["RemoveGuestAliasByCertRequestType"] = reflect.TypeOf((*RemoveGuestAliasByCertRequestType)(nil)).Elem() +} + +type RemoveGuestAliasByCertResponse struct { +} + +type RemoveGuestAliasRequestType struct { + This ManagedObjectReference `xml:"_this"` + Vm ManagedObjectReference `xml:"vm"` + Auth BaseGuestAuthentication `xml:"auth,typeattr"` + Username string `xml:"username"` + Base64Cert string `xml:"base64Cert"` + Subject BaseGuestAuthSubject `xml:"subject,typeattr"` +} + +func init() { + t["RemoveGuestAliasRequestType"] = reflect.TypeOf((*RemoveGuestAliasRequestType)(nil)).Elem() +} + +type RemoveGuestAliasResponse struct { +} + +type RemoveInternetScsiSendTargets RemoveInternetScsiSendTargetsRequestType + +func init() { + t["RemoveInternetScsiSendTargets"] = reflect.TypeOf((*RemoveInternetScsiSendTargets)(nil)).Elem() +} + +type RemoveInternetScsiSendTargetsRequestType struct { + This ManagedObjectReference `xml:"_this"` + IScsiHbaDevice string `xml:"iScsiHbaDevice"` + Targets []HostInternetScsiHbaSendTarget `xml:"targets"` +} + +func init() { + t["RemoveInternetScsiSendTargetsRequestType"] = reflect.TypeOf((*RemoveInternetScsiSendTargetsRequestType)(nil)).Elem() +} + +type RemoveInternetScsiSendTargetsResponse struct { +} + +type RemoveInternetScsiStaticTargets RemoveInternetScsiStaticTargetsRequestType + +func init() { + t["RemoveInternetScsiStaticTargets"] = reflect.TypeOf((*RemoveInternetScsiStaticTargets)(nil)).Elem() +} + +type RemoveInternetScsiStaticTargetsRequestType struct { + This ManagedObjectReference `xml:"_this"` + IScsiHbaDevice string `xml:"iScsiHbaDevice"` + Targets []HostInternetScsiHbaStaticTarget `xml:"targets"` +} + +func init() { + t["RemoveInternetScsiStaticTargetsRequestType"] = reflect.TypeOf((*RemoveInternetScsiStaticTargetsRequestType)(nil)).Elem() +} + +type RemoveInternetScsiStaticTargetsResponse struct { +} + +type RemoveLicense RemoveLicenseRequestType + +func init() { + t["RemoveLicense"] = reflect.TypeOf((*RemoveLicense)(nil)).Elem() +} + +type RemoveLicenseLabel RemoveLicenseLabelRequestType + +func init() { + t["RemoveLicenseLabel"] = reflect.TypeOf((*RemoveLicenseLabel)(nil)).Elem() +} + +type RemoveLicenseLabelRequestType struct { + This ManagedObjectReference `xml:"_this"` + LicenseKey string `xml:"licenseKey"` + LabelKey string `xml:"labelKey"` +} + +func init() { + t["RemoveLicenseLabelRequestType"] = reflect.TypeOf((*RemoveLicenseLabelRequestType)(nil)).Elem() +} + +type RemoveLicenseLabelResponse struct { +} + +type RemoveLicenseRequestType struct { + This ManagedObjectReference `xml:"_this"` + LicenseKey string `xml:"licenseKey"` +} + +func init() { + t["RemoveLicenseRequestType"] = reflect.TypeOf((*RemoveLicenseRequestType)(nil)).Elem() +} + +type RemoveLicenseResponse struct { +} + +type RemoveNetworkResourcePool RemoveNetworkResourcePoolRequestType + +func init() { + t["RemoveNetworkResourcePool"] = reflect.TypeOf((*RemoveNetworkResourcePool)(nil)).Elem() +} + +type RemoveNetworkResourcePoolRequestType struct { + This ManagedObjectReference `xml:"_this"` + Key []string `xml:"key"` +} + +func init() { + t["RemoveNetworkResourcePoolRequestType"] = reflect.TypeOf((*RemoveNetworkResourcePoolRequestType)(nil)).Elem() +} + +type RemoveNetworkResourcePoolResponse struct { +} + +type RemovePerfInterval RemovePerfIntervalRequestType + +func init() { + t["RemovePerfInterval"] = reflect.TypeOf((*RemovePerfInterval)(nil)).Elem() +} + +type RemovePerfIntervalRequestType struct { + This ManagedObjectReference `xml:"_this"` + SamplePeriod int32 `xml:"samplePeriod"` +} + +func init() { + t["RemovePerfIntervalRequestType"] = reflect.TypeOf((*RemovePerfIntervalRequestType)(nil)).Elem() +} + +type RemovePerfIntervalResponse struct { +} + +type RemovePortGroup RemovePortGroupRequestType + +func init() { + t["RemovePortGroup"] = reflect.TypeOf((*RemovePortGroup)(nil)).Elem() +} + +type RemovePortGroupRequestType struct { + This ManagedObjectReference `xml:"_this"` + PgName string `xml:"pgName"` +} + +func init() { + t["RemovePortGroupRequestType"] = reflect.TypeOf((*RemovePortGroupRequestType)(nil)).Elem() +} + +type RemovePortGroupResponse struct { +} + +type RemoveScheduledTask RemoveScheduledTaskRequestType + +func init() { + t["RemoveScheduledTask"] = reflect.TypeOf((*RemoveScheduledTask)(nil)).Elem() +} + +type RemoveScheduledTaskRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["RemoveScheduledTaskRequestType"] = reflect.TypeOf((*RemoveScheduledTaskRequestType)(nil)).Elem() +} + +type RemoveScheduledTaskResponse struct { +} + +type RemoveServiceConsoleVirtualNic RemoveServiceConsoleVirtualNicRequestType + +func init() { + t["RemoveServiceConsoleVirtualNic"] = reflect.TypeOf((*RemoveServiceConsoleVirtualNic)(nil)).Elem() +} + +type RemoveServiceConsoleVirtualNicRequestType struct { + This ManagedObjectReference `xml:"_this"` + Device string `xml:"device"` +} + +func init() { + t["RemoveServiceConsoleVirtualNicRequestType"] = reflect.TypeOf((*RemoveServiceConsoleVirtualNicRequestType)(nil)).Elem() +} + +type RemoveServiceConsoleVirtualNicResponse struct { +} + +type RemoveSmartCardTrustAnchor RemoveSmartCardTrustAnchorRequestType + +func init() { + t["RemoveSmartCardTrustAnchor"] = reflect.TypeOf((*RemoveSmartCardTrustAnchor)(nil)).Elem() +} + +type RemoveSmartCardTrustAnchorByFingerprint RemoveSmartCardTrustAnchorByFingerprintRequestType + +func init() { + t["RemoveSmartCardTrustAnchorByFingerprint"] = reflect.TypeOf((*RemoveSmartCardTrustAnchorByFingerprint)(nil)).Elem() +} + +type RemoveSmartCardTrustAnchorByFingerprintRequestType struct { + This ManagedObjectReference `xml:"_this"` + Fingerprint string `xml:"fingerprint"` + Digest string `xml:"digest"` +} + +func init() { + t["RemoveSmartCardTrustAnchorByFingerprintRequestType"] = reflect.TypeOf((*RemoveSmartCardTrustAnchorByFingerprintRequestType)(nil)).Elem() +} + +type RemoveSmartCardTrustAnchorByFingerprintResponse struct { +} + +type RemoveSmartCardTrustAnchorRequestType struct { + This ManagedObjectReference `xml:"_this"` + Issuer string `xml:"issuer"` + Serial string `xml:"serial"` +} + +func init() { + t["RemoveSmartCardTrustAnchorRequestType"] = reflect.TypeOf((*RemoveSmartCardTrustAnchorRequestType)(nil)).Elem() +} + +type RemoveSmartCardTrustAnchorResponse struct { +} + +type RemoveSnapshotRequestType struct { + This ManagedObjectReference `xml:"_this"` + RemoveChildren bool `xml:"removeChildren"` + Consolidate *bool `xml:"consolidate"` +} + +func init() { + t["RemoveSnapshotRequestType"] = reflect.TypeOf((*RemoveSnapshotRequestType)(nil)).Elem() +} + +type RemoveSnapshot_Task RemoveSnapshotRequestType + +func init() { + t["RemoveSnapshot_Task"] = reflect.TypeOf((*RemoveSnapshot_Task)(nil)).Elem() +} + +type RemoveSnapshot_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type RemoveUser RemoveUserRequestType + +func init() { + t["RemoveUser"] = reflect.TypeOf((*RemoveUser)(nil)).Elem() +} + +type RemoveUserRequestType struct { + This ManagedObjectReference `xml:"_this"` + UserName string `xml:"userName"` +} + +func init() { + t["RemoveUserRequestType"] = reflect.TypeOf((*RemoveUserRequestType)(nil)).Elem() +} + +type RemoveUserResponse struct { +} + +type RemoveVirtualNic RemoveVirtualNicRequestType + +func init() { + t["RemoveVirtualNic"] = reflect.TypeOf((*RemoveVirtualNic)(nil)).Elem() +} + +type RemoveVirtualNicRequestType struct { + This ManagedObjectReference `xml:"_this"` + Device string `xml:"device"` +} + +func init() { + t["RemoveVirtualNicRequestType"] = reflect.TypeOf((*RemoveVirtualNicRequestType)(nil)).Elem() +} + +type RemoveVirtualNicResponse struct { +} + +type RemoveVirtualSwitch RemoveVirtualSwitchRequestType + +func init() { + t["RemoveVirtualSwitch"] = reflect.TypeOf((*RemoveVirtualSwitch)(nil)).Elem() +} + +type RemoveVirtualSwitchRequestType struct { + This ManagedObjectReference `xml:"_this"` + VswitchName string `xml:"vswitchName"` +} + +func init() { + t["RemoveVirtualSwitchRequestType"] = reflect.TypeOf((*RemoveVirtualSwitchRequestType)(nil)).Elem() +} + +type RemoveVirtualSwitchResponse struct { +} + +type RenameCustomFieldDef RenameCustomFieldDefRequestType + +func init() { + t["RenameCustomFieldDef"] = reflect.TypeOf((*RenameCustomFieldDef)(nil)).Elem() +} + +type RenameCustomFieldDefRequestType struct { + This ManagedObjectReference `xml:"_this"` + Key int32 `xml:"key"` + Name string `xml:"name"` +} + +func init() { + t["RenameCustomFieldDefRequestType"] = reflect.TypeOf((*RenameCustomFieldDefRequestType)(nil)).Elem() +} + +type RenameCustomFieldDefResponse struct { +} + +type RenameCustomizationSpec RenameCustomizationSpecRequestType + +func init() { + t["RenameCustomizationSpec"] = reflect.TypeOf((*RenameCustomizationSpec)(nil)).Elem() +} + +type RenameCustomizationSpecRequestType struct { + This ManagedObjectReference `xml:"_this"` + Name string `xml:"name"` + NewName string `xml:"newName"` +} + +func init() { + t["RenameCustomizationSpecRequestType"] = reflect.TypeOf((*RenameCustomizationSpecRequestType)(nil)).Elem() +} + +type RenameCustomizationSpecResponse struct { +} + +type RenameDatastore RenameDatastoreRequestType + +func init() { + t["RenameDatastore"] = reflect.TypeOf((*RenameDatastore)(nil)).Elem() +} + +type RenameDatastoreRequestType struct { + This ManagedObjectReference `xml:"_this"` + NewName string `xml:"newName"` +} + +func init() { + t["RenameDatastoreRequestType"] = reflect.TypeOf((*RenameDatastoreRequestType)(nil)).Elem() +} + +type RenameDatastoreResponse struct { +} + +type RenameRequestType struct { + This ManagedObjectReference `xml:"_this"` + NewName string `xml:"newName"` +} + +func init() { + t["RenameRequestType"] = reflect.TypeOf((*RenameRequestType)(nil)).Elem() +} + +type RenameSnapshot RenameSnapshotRequestType + +func init() { + t["RenameSnapshot"] = reflect.TypeOf((*RenameSnapshot)(nil)).Elem() +} + +type RenameSnapshotRequestType struct { + This ManagedObjectReference `xml:"_this"` + Name string `xml:"name,omitempty"` + Description string `xml:"description,omitempty"` +} + +func init() { + t["RenameSnapshotRequestType"] = reflect.TypeOf((*RenameSnapshotRequestType)(nil)).Elem() +} + +type RenameSnapshotResponse struct { +} + +type Rename_Task RenameRequestType + +func init() { + t["Rename_Task"] = reflect.TypeOf((*Rename_Task)(nil)).Elem() +} + +type Rename_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type ReplaceCACertificatesAndCRLs ReplaceCACertificatesAndCRLsRequestType + +func init() { + t["ReplaceCACertificatesAndCRLs"] = reflect.TypeOf((*ReplaceCACertificatesAndCRLs)(nil)).Elem() +} + +type ReplaceCACertificatesAndCRLsRequestType struct { + This ManagedObjectReference `xml:"_this"` + CaCert []string `xml:"caCert"` + CaCrl []string `xml:"caCrl,omitempty"` +} + +func init() { + t["ReplaceCACertificatesAndCRLsRequestType"] = reflect.TypeOf((*ReplaceCACertificatesAndCRLsRequestType)(nil)).Elem() +} + +type ReplaceCACertificatesAndCRLsResponse struct { +} + +type ReplaceSmartCardTrustAnchors ReplaceSmartCardTrustAnchorsRequestType + +func init() { + t["ReplaceSmartCardTrustAnchors"] = reflect.TypeOf((*ReplaceSmartCardTrustAnchors)(nil)).Elem() +} + +type ReplaceSmartCardTrustAnchorsRequestType struct { + This ManagedObjectReference `xml:"_this"` + Certs []string `xml:"certs,omitempty"` +} + +func init() { + t["ReplaceSmartCardTrustAnchorsRequestType"] = reflect.TypeOf((*ReplaceSmartCardTrustAnchorsRequestType)(nil)).Elem() +} + +type ReplaceSmartCardTrustAnchorsResponse struct { +} + +type ReplicationConfigFault struct { + ReplicationFault +} + +func init() { + t["ReplicationConfigFault"] = reflect.TypeOf((*ReplicationConfigFault)(nil)).Elem() +} + +type ReplicationConfigFaultFault BaseReplicationConfigFault + +func init() { + t["ReplicationConfigFaultFault"] = reflect.TypeOf((*ReplicationConfigFaultFault)(nil)).Elem() +} + +type ReplicationConfigSpec struct { + DynamicData + + Generation int64 `xml:"generation"` + VmReplicationId string `xml:"vmReplicationId"` + Destination string `xml:"destination"` + Port int32 `xml:"port"` + Rpo int64 `xml:"rpo"` + QuiesceGuestEnabled bool `xml:"quiesceGuestEnabled"` + Paused bool `xml:"paused"` + OppUpdatesEnabled bool `xml:"oppUpdatesEnabled"` + NetCompressionEnabled *bool `xml:"netCompressionEnabled"` + Disk []ReplicationInfoDiskSettings `xml:"disk,omitempty"` +} + +func init() { + t["ReplicationConfigSpec"] = reflect.TypeOf((*ReplicationConfigSpec)(nil)).Elem() +} + +type ReplicationDiskConfigFault struct { + ReplicationConfigFault + + Reason string `xml:"reason,omitempty"` + VmRef *ManagedObjectReference `xml:"vmRef,omitempty"` + Key int32 `xml:"key,omitempty"` +} + +func init() { + t["ReplicationDiskConfigFault"] = reflect.TypeOf((*ReplicationDiskConfigFault)(nil)).Elem() +} + +type ReplicationDiskConfigFaultFault ReplicationDiskConfigFault + +func init() { + t["ReplicationDiskConfigFaultFault"] = reflect.TypeOf((*ReplicationDiskConfigFaultFault)(nil)).Elem() +} + +type ReplicationFault struct { + VimFault +} + +func init() { + t["ReplicationFault"] = reflect.TypeOf((*ReplicationFault)(nil)).Elem() +} + +type ReplicationFaultFault BaseReplicationFault + +func init() { + t["ReplicationFaultFault"] = reflect.TypeOf((*ReplicationFaultFault)(nil)).Elem() +} + +type ReplicationIncompatibleWithFT struct { + ReplicationFault +} + +func init() { + t["ReplicationIncompatibleWithFT"] = reflect.TypeOf((*ReplicationIncompatibleWithFT)(nil)).Elem() +} + +type ReplicationIncompatibleWithFTFault ReplicationIncompatibleWithFT + +func init() { + t["ReplicationIncompatibleWithFTFault"] = reflect.TypeOf((*ReplicationIncompatibleWithFTFault)(nil)).Elem() +} + +type ReplicationInfoDiskSettings struct { + DynamicData + + Key int32 `xml:"key"` + DiskReplicationId string `xml:"diskReplicationId"` +} + +func init() { + t["ReplicationInfoDiskSettings"] = reflect.TypeOf((*ReplicationInfoDiskSettings)(nil)).Elem() +} + +type ReplicationInvalidOptions struct { + ReplicationFault + + Options string `xml:"options"` + Entity *ManagedObjectReference `xml:"entity,omitempty"` +} + +func init() { + t["ReplicationInvalidOptions"] = reflect.TypeOf((*ReplicationInvalidOptions)(nil)).Elem() +} + +type ReplicationInvalidOptionsFault ReplicationInvalidOptions + +func init() { + t["ReplicationInvalidOptionsFault"] = reflect.TypeOf((*ReplicationInvalidOptionsFault)(nil)).Elem() +} + +type ReplicationNotSupportedOnHost struct { + ReplicationFault +} + +func init() { + t["ReplicationNotSupportedOnHost"] = reflect.TypeOf((*ReplicationNotSupportedOnHost)(nil)).Elem() +} + +type ReplicationNotSupportedOnHostFault ReplicationNotSupportedOnHost + +func init() { + t["ReplicationNotSupportedOnHostFault"] = reflect.TypeOf((*ReplicationNotSupportedOnHostFault)(nil)).Elem() +} + +type ReplicationVmConfigFault struct { + ReplicationConfigFault + + Reason string `xml:"reason,omitempty"` + VmRef *ManagedObjectReference `xml:"vmRef,omitempty"` +} + +func init() { + t["ReplicationVmConfigFault"] = reflect.TypeOf((*ReplicationVmConfigFault)(nil)).Elem() +} + +type ReplicationVmConfigFaultFault ReplicationVmConfigFault + +func init() { + t["ReplicationVmConfigFaultFault"] = reflect.TypeOf((*ReplicationVmConfigFaultFault)(nil)).Elem() +} + +type ReplicationVmFault struct { + ReplicationFault + + Reason string `xml:"reason,omitempty"` + State string `xml:"state,omitempty"` + InstanceId string `xml:"instanceId,omitempty"` + Vm *ManagedObjectReference `xml:"vm,omitempty"` +} + +func init() { + t["ReplicationVmFault"] = reflect.TypeOf((*ReplicationVmFault)(nil)).Elem() +} + +type ReplicationVmFaultFault BaseReplicationVmFault + +func init() { + t["ReplicationVmFaultFault"] = reflect.TypeOf((*ReplicationVmFaultFault)(nil)).Elem() +} + +type ReplicationVmInProgressFault struct { + ReplicationVmFault + + RequestedActivity string `xml:"requestedActivity"` + InProgressActivity string `xml:"inProgressActivity"` +} + +func init() { + t["ReplicationVmInProgressFault"] = reflect.TypeOf((*ReplicationVmInProgressFault)(nil)).Elem() +} + +type ReplicationVmInProgressFaultFault ReplicationVmInProgressFault + +func init() { + t["ReplicationVmInProgressFaultFault"] = reflect.TypeOf((*ReplicationVmInProgressFaultFault)(nil)).Elem() +} + +type ReplicationVmProgressInfo struct { + DynamicData + + Progress int32 `xml:"progress"` + BytesTransferred int64 `xml:"bytesTransferred"` + BytesToTransfer int64 `xml:"bytesToTransfer"` + ChecksumTotalBytes int64 `xml:"checksumTotalBytes,omitempty"` + ChecksumComparedBytes int64 `xml:"checksumComparedBytes,omitempty"` +} + +func init() { + t["ReplicationVmProgressInfo"] = reflect.TypeOf((*ReplicationVmProgressInfo)(nil)).Elem() +} + +type RequestCanceled struct { + RuntimeFault +} + +func init() { + t["RequestCanceled"] = reflect.TypeOf((*RequestCanceled)(nil)).Elem() +} + +type RequestCanceledFault RequestCanceled + +func init() { + t["RequestCanceledFault"] = reflect.TypeOf((*RequestCanceledFault)(nil)).Elem() +} + +type RescanAllHba RescanAllHbaRequestType + +func init() { + t["RescanAllHba"] = reflect.TypeOf((*RescanAllHba)(nil)).Elem() +} + +type RescanAllHbaRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["RescanAllHbaRequestType"] = reflect.TypeOf((*RescanAllHbaRequestType)(nil)).Elem() +} + +type RescanAllHbaResponse struct { +} + +type RescanHba RescanHbaRequestType + +func init() { + t["RescanHba"] = reflect.TypeOf((*RescanHba)(nil)).Elem() +} + +type RescanHbaRequestType struct { + This ManagedObjectReference `xml:"_this"` + HbaDevice string `xml:"hbaDevice"` +} + +func init() { + t["RescanHbaRequestType"] = reflect.TypeOf((*RescanHbaRequestType)(nil)).Elem() +} + +type RescanHbaResponse struct { +} + +type RescanVffs RescanVffsRequestType + +func init() { + t["RescanVffs"] = reflect.TypeOf((*RescanVffs)(nil)).Elem() +} + +type RescanVffsRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["RescanVffsRequestType"] = reflect.TypeOf((*RescanVffsRequestType)(nil)).Elem() +} + +type RescanVffsResponse struct { +} + +type RescanVmfs RescanVmfsRequestType + +func init() { + t["RescanVmfs"] = reflect.TypeOf((*RescanVmfs)(nil)).Elem() +} + +type RescanVmfsRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["RescanVmfsRequestType"] = reflect.TypeOf((*RescanVmfsRequestType)(nil)).Elem() +} + +type RescanVmfsResponse struct { +} + +type ResetCollector ResetCollectorRequestType + +func init() { + t["ResetCollector"] = reflect.TypeOf((*ResetCollector)(nil)).Elem() +} + +type ResetCollectorRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["ResetCollectorRequestType"] = reflect.TypeOf((*ResetCollectorRequestType)(nil)).Elem() +} + +type ResetCollectorResponse struct { +} + +type ResetCounterLevelMapping ResetCounterLevelMappingRequestType + +func init() { + t["ResetCounterLevelMapping"] = reflect.TypeOf((*ResetCounterLevelMapping)(nil)).Elem() +} + +type ResetCounterLevelMappingRequestType struct { + This ManagedObjectReference `xml:"_this"` + Counters []int32 `xml:"counters"` +} + +func init() { + t["ResetCounterLevelMappingRequestType"] = reflect.TypeOf((*ResetCounterLevelMappingRequestType)(nil)).Elem() +} + +type ResetCounterLevelMappingResponse struct { +} + +type ResetEntityPermissions ResetEntityPermissionsRequestType + +func init() { + t["ResetEntityPermissions"] = reflect.TypeOf((*ResetEntityPermissions)(nil)).Elem() +} + +type ResetEntityPermissionsRequestType struct { + This ManagedObjectReference `xml:"_this"` + Entity ManagedObjectReference `xml:"entity"` + Permission []Permission `xml:"permission,omitempty"` +} + +func init() { + t["ResetEntityPermissionsRequestType"] = reflect.TypeOf((*ResetEntityPermissionsRequestType)(nil)).Elem() +} + +type ResetEntityPermissionsResponse struct { +} + +type ResetFirmwareToFactoryDefaults ResetFirmwareToFactoryDefaultsRequestType + +func init() { + t["ResetFirmwareToFactoryDefaults"] = reflect.TypeOf((*ResetFirmwareToFactoryDefaults)(nil)).Elem() +} + +type ResetFirmwareToFactoryDefaultsRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["ResetFirmwareToFactoryDefaultsRequestType"] = reflect.TypeOf((*ResetFirmwareToFactoryDefaultsRequestType)(nil)).Elem() +} + +type ResetFirmwareToFactoryDefaultsResponse struct { +} + +type ResetGuestInformation ResetGuestInformationRequestType + +func init() { + t["ResetGuestInformation"] = reflect.TypeOf((*ResetGuestInformation)(nil)).Elem() +} + +type ResetGuestInformationRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["ResetGuestInformationRequestType"] = reflect.TypeOf((*ResetGuestInformationRequestType)(nil)).Elem() +} + +type ResetGuestInformationResponse struct { +} + +type ResetListView ResetListViewRequestType + +func init() { + t["ResetListView"] = reflect.TypeOf((*ResetListView)(nil)).Elem() +} + +type ResetListViewFromView ResetListViewFromViewRequestType + +func init() { + t["ResetListViewFromView"] = reflect.TypeOf((*ResetListViewFromView)(nil)).Elem() +} + +type ResetListViewFromViewRequestType struct { + This ManagedObjectReference `xml:"_this"` + View ManagedObjectReference `xml:"view"` +} + +func init() { + t["ResetListViewFromViewRequestType"] = reflect.TypeOf((*ResetListViewFromViewRequestType)(nil)).Elem() +} + +type ResetListViewFromViewResponse struct { +} + +type ResetListViewRequestType struct { + This ManagedObjectReference `xml:"_this"` + Obj []ManagedObjectReference `xml:"obj,omitempty"` +} + +func init() { + t["ResetListViewRequestType"] = reflect.TypeOf((*ResetListViewRequestType)(nil)).Elem() +} + +type ResetListViewResponse struct { + Returnval []ManagedObjectReference `xml:"returnval,omitempty"` +} + +type ResetSystemHealthInfo ResetSystemHealthInfoRequestType + +func init() { + t["ResetSystemHealthInfo"] = reflect.TypeOf((*ResetSystemHealthInfo)(nil)).Elem() +} + +type ResetSystemHealthInfoRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["ResetSystemHealthInfoRequestType"] = reflect.TypeOf((*ResetSystemHealthInfoRequestType)(nil)).Elem() +} + +type ResetSystemHealthInfoResponse struct { +} + +type ResetVMRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["ResetVMRequestType"] = reflect.TypeOf((*ResetVMRequestType)(nil)).Elem() +} + +type ResetVM_Task ResetVMRequestType + +func init() { + t["ResetVM_Task"] = reflect.TypeOf((*ResetVM_Task)(nil)).Elem() +} + +type ResetVM_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type ResignatureUnresolvedVmfsVolumeRequestType struct { + This ManagedObjectReference `xml:"_this"` + ResolutionSpec HostUnresolvedVmfsResignatureSpec `xml:"resolutionSpec"` +} + +func init() { + t["ResignatureUnresolvedVmfsVolumeRequestType"] = reflect.TypeOf((*ResignatureUnresolvedVmfsVolumeRequestType)(nil)).Elem() +} + +type ResignatureUnresolvedVmfsVolume_Task ResignatureUnresolvedVmfsVolumeRequestType + +func init() { + t["ResignatureUnresolvedVmfsVolume_Task"] = reflect.TypeOf((*ResignatureUnresolvedVmfsVolume_Task)(nil)).Elem() +} + +type ResignatureUnresolvedVmfsVolume_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type ResolveInstallationErrorsOnClusterRequestType struct { + This ManagedObjectReference `xml:"_this"` + FilterId string `xml:"filterId"` + Cluster ManagedObjectReference `xml:"cluster"` +} + +func init() { + t["ResolveInstallationErrorsOnClusterRequestType"] = reflect.TypeOf((*ResolveInstallationErrorsOnClusterRequestType)(nil)).Elem() +} + +type ResolveInstallationErrorsOnCluster_Task ResolveInstallationErrorsOnClusterRequestType + +func init() { + t["ResolveInstallationErrorsOnCluster_Task"] = reflect.TypeOf((*ResolveInstallationErrorsOnCluster_Task)(nil)).Elem() +} + +type ResolveInstallationErrorsOnCluster_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type ResolveInstallationErrorsOnHostRequestType struct { + This ManagedObjectReference `xml:"_this"` + FilterId string `xml:"filterId"` + Host ManagedObjectReference `xml:"host"` +} + +func init() { + t["ResolveInstallationErrorsOnHostRequestType"] = reflect.TypeOf((*ResolveInstallationErrorsOnHostRequestType)(nil)).Elem() +} + +type ResolveInstallationErrorsOnHost_Task ResolveInstallationErrorsOnHostRequestType + +func init() { + t["ResolveInstallationErrorsOnHost_Task"] = reflect.TypeOf((*ResolveInstallationErrorsOnHost_Task)(nil)).Elem() +} + +type ResolveInstallationErrorsOnHost_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type ResolveMultipleUnresolvedVmfsVolumes ResolveMultipleUnresolvedVmfsVolumesRequestType + +func init() { + t["ResolveMultipleUnresolvedVmfsVolumes"] = reflect.TypeOf((*ResolveMultipleUnresolvedVmfsVolumes)(nil)).Elem() +} + +type ResolveMultipleUnresolvedVmfsVolumesExRequestType struct { + This ManagedObjectReference `xml:"_this"` + ResolutionSpec []HostUnresolvedVmfsResolutionSpec `xml:"resolutionSpec"` +} + +func init() { + t["ResolveMultipleUnresolvedVmfsVolumesExRequestType"] = reflect.TypeOf((*ResolveMultipleUnresolvedVmfsVolumesExRequestType)(nil)).Elem() +} + +type ResolveMultipleUnresolvedVmfsVolumesEx_Task ResolveMultipleUnresolvedVmfsVolumesExRequestType + +func init() { + t["ResolveMultipleUnresolvedVmfsVolumesEx_Task"] = reflect.TypeOf((*ResolveMultipleUnresolvedVmfsVolumesEx_Task)(nil)).Elem() +} + +type ResolveMultipleUnresolvedVmfsVolumesEx_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type ResolveMultipleUnresolvedVmfsVolumesRequestType struct { + This ManagedObjectReference `xml:"_this"` + ResolutionSpec []HostUnresolvedVmfsResolutionSpec `xml:"resolutionSpec"` +} + +func init() { + t["ResolveMultipleUnresolvedVmfsVolumesRequestType"] = reflect.TypeOf((*ResolveMultipleUnresolvedVmfsVolumesRequestType)(nil)).Elem() +} + +type ResolveMultipleUnresolvedVmfsVolumesResponse struct { + Returnval []HostUnresolvedVmfsResolutionResult `xml:"returnval,omitempty"` +} + +type ResourceAllocationInfo struct { + DynamicData + + Reservation int64 `xml:"reservation,omitempty"` + ExpandableReservation *bool `xml:"expandableReservation"` + Limit int64 `xml:"limit,omitempty"` + Shares *SharesInfo `xml:"shares,omitempty"` + OverheadLimit int64 `xml:"overheadLimit,omitempty"` +} + +func init() { + t["ResourceAllocationInfo"] = reflect.TypeOf((*ResourceAllocationInfo)(nil)).Elem() +} + +type ResourceAllocationOption struct { + DynamicData + + SharesOption SharesOption `xml:"sharesOption"` +} + +func init() { + t["ResourceAllocationOption"] = reflect.TypeOf((*ResourceAllocationOption)(nil)).Elem() +} + +type ResourceConfigOption struct { + DynamicData + + CpuAllocationOption ResourceAllocationOption `xml:"cpuAllocationOption"` + MemoryAllocationOption ResourceAllocationOption `xml:"memoryAllocationOption"` +} + +func init() { + t["ResourceConfigOption"] = reflect.TypeOf((*ResourceConfigOption)(nil)).Elem() +} + +type ResourceConfigSpec struct { + DynamicData + + Entity *ManagedObjectReference `xml:"entity,omitempty"` + ChangeVersion string `xml:"changeVersion,omitempty"` + LastModified *time.Time `xml:"lastModified"` + CpuAllocation BaseResourceAllocationInfo `xml:"cpuAllocation,typeattr"` + MemoryAllocation BaseResourceAllocationInfo `xml:"memoryAllocation,typeattr"` +} + +func init() { + t["ResourceConfigSpec"] = reflect.TypeOf((*ResourceConfigSpec)(nil)).Elem() +} + +type ResourceInUse struct { + VimFault + + Type string `xml:"type,omitempty"` + Name string `xml:"name,omitempty"` +} + +func init() { + t["ResourceInUse"] = reflect.TypeOf((*ResourceInUse)(nil)).Elem() +} + +type ResourceInUseFault BaseResourceInUse + +func init() { + t["ResourceInUseFault"] = reflect.TypeOf((*ResourceInUseFault)(nil)).Elem() +} + +type ResourceNotAvailable struct { + VimFault + + ContainerType string `xml:"containerType,omitempty"` + ContainerName string `xml:"containerName,omitempty"` + Type string `xml:"type,omitempty"` +} + +func init() { + t["ResourceNotAvailable"] = reflect.TypeOf((*ResourceNotAvailable)(nil)).Elem() +} + +type ResourceNotAvailableFault ResourceNotAvailable + +func init() { + t["ResourceNotAvailableFault"] = reflect.TypeOf((*ResourceNotAvailableFault)(nil)).Elem() +} + +type ResourcePoolCreatedEvent struct { + ResourcePoolEvent + + Parent ResourcePoolEventArgument `xml:"parent"` +} + +func init() { + t["ResourcePoolCreatedEvent"] = reflect.TypeOf((*ResourcePoolCreatedEvent)(nil)).Elem() +} + +type ResourcePoolDestroyedEvent struct { + ResourcePoolEvent +} + +func init() { + t["ResourcePoolDestroyedEvent"] = reflect.TypeOf((*ResourcePoolDestroyedEvent)(nil)).Elem() +} + +type ResourcePoolEvent struct { + Event + + ResourcePool ResourcePoolEventArgument `xml:"resourcePool"` +} + +func init() { + t["ResourcePoolEvent"] = reflect.TypeOf((*ResourcePoolEvent)(nil)).Elem() +} + +type ResourcePoolEventArgument struct { + EntityEventArgument + + ResourcePool ManagedObjectReference `xml:"resourcePool"` +} + +func init() { + t["ResourcePoolEventArgument"] = reflect.TypeOf((*ResourcePoolEventArgument)(nil)).Elem() +} + +type ResourcePoolMovedEvent struct { + ResourcePoolEvent + + OldParent ResourcePoolEventArgument `xml:"oldParent"` + NewParent ResourcePoolEventArgument `xml:"newParent"` +} + +func init() { + t["ResourcePoolMovedEvent"] = reflect.TypeOf((*ResourcePoolMovedEvent)(nil)).Elem() +} + +type ResourcePoolQuickStats struct { + DynamicData + + OverallCpuUsage int64 `xml:"overallCpuUsage,omitempty"` + OverallCpuDemand int64 `xml:"overallCpuDemand,omitempty"` + GuestMemoryUsage int64 `xml:"guestMemoryUsage,omitempty"` + HostMemoryUsage int64 `xml:"hostMemoryUsage,omitempty"` + DistributedCpuEntitlement int64 `xml:"distributedCpuEntitlement,omitempty"` + DistributedMemoryEntitlement int64 `xml:"distributedMemoryEntitlement,omitempty"` + StaticCpuEntitlement int32 `xml:"staticCpuEntitlement,omitempty"` + StaticMemoryEntitlement int32 `xml:"staticMemoryEntitlement,omitempty"` + PrivateMemory int64 `xml:"privateMemory,omitempty"` + SharedMemory int64 `xml:"sharedMemory,omitempty"` + SwappedMemory int64 `xml:"swappedMemory,omitempty"` + BalloonedMemory int64 `xml:"balloonedMemory,omitempty"` + OverheadMemory int64 `xml:"overheadMemory,omitempty"` + ConsumedOverheadMemory int64 `xml:"consumedOverheadMemory,omitempty"` + CompressedMemory int64 `xml:"compressedMemory,omitempty"` +} + +func init() { + t["ResourcePoolQuickStats"] = reflect.TypeOf((*ResourcePoolQuickStats)(nil)).Elem() +} + +type ResourcePoolReconfiguredEvent struct { + ResourcePoolEvent +} + +func init() { + t["ResourcePoolReconfiguredEvent"] = reflect.TypeOf((*ResourcePoolReconfiguredEvent)(nil)).Elem() +} + +type ResourcePoolResourceUsage struct { + DynamicData + + ReservationUsed int64 `xml:"reservationUsed"` + ReservationUsedForVm int64 `xml:"reservationUsedForVm"` + UnreservedForPool int64 `xml:"unreservedForPool"` + UnreservedForVm int64 `xml:"unreservedForVm"` + OverallUsage int64 `xml:"overallUsage"` + MaxUsage int64 `xml:"maxUsage"` +} + +func init() { + t["ResourcePoolResourceUsage"] = reflect.TypeOf((*ResourcePoolResourceUsage)(nil)).Elem() +} + +type ResourcePoolRuntimeInfo struct { + DynamicData + + Memory ResourcePoolResourceUsage `xml:"memory"` + Cpu ResourcePoolResourceUsage `xml:"cpu"` + OverallStatus ManagedEntityStatus `xml:"overallStatus"` +} + +func init() { + t["ResourcePoolRuntimeInfo"] = reflect.TypeOf((*ResourcePoolRuntimeInfo)(nil)).Elem() +} + +type ResourcePoolSummary struct { + DynamicData + + Name string `xml:"name"` + Config ResourceConfigSpec `xml:"config"` + Runtime ResourcePoolRuntimeInfo `xml:"runtime"` + QuickStats *ResourcePoolQuickStats `xml:"quickStats,omitempty"` + ConfiguredMemoryMB int32 `xml:"configuredMemoryMB,omitempty"` +} + +func init() { + t["ResourcePoolSummary"] = reflect.TypeOf((*ResourcePoolSummary)(nil)).Elem() +} + +type ResourceViolatedEvent struct { + ResourcePoolEvent +} + +func init() { + t["ResourceViolatedEvent"] = reflect.TypeOf((*ResourceViolatedEvent)(nil)).Elem() +} + +type RestartService RestartServiceRequestType + +func init() { + t["RestartService"] = reflect.TypeOf((*RestartService)(nil)).Elem() +} + +type RestartServiceConsoleVirtualNic RestartServiceConsoleVirtualNicRequestType + +func init() { + t["RestartServiceConsoleVirtualNic"] = reflect.TypeOf((*RestartServiceConsoleVirtualNic)(nil)).Elem() +} + +type RestartServiceConsoleVirtualNicRequestType struct { + This ManagedObjectReference `xml:"_this"` + Device string `xml:"device"` +} + +func init() { + t["RestartServiceConsoleVirtualNicRequestType"] = reflect.TypeOf((*RestartServiceConsoleVirtualNicRequestType)(nil)).Elem() +} + +type RestartServiceConsoleVirtualNicResponse struct { +} + +type RestartServiceRequestType struct { + This ManagedObjectReference `xml:"_this"` + Id string `xml:"id"` +} + +func init() { + t["RestartServiceRequestType"] = reflect.TypeOf((*RestartServiceRequestType)(nil)).Elem() +} + +type RestartServiceResponse struct { +} + +type RestoreFirmwareConfiguration RestoreFirmwareConfigurationRequestType + +func init() { + t["RestoreFirmwareConfiguration"] = reflect.TypeOf((*RestoreFirmwareConfiguration)(nil)).Elem() +} + +type RestoreFirmwareConfigurationRequestType struct { + This ManagedObjectReference `xml:"_this"` + Force bool `xml:"force"` +} + +func init() { + t["RestoreFirmwareConfigurationRequestType"] = reflect.TypeOf((*RestoreFirmwareConfigurationRequestType)(nil)).Elem() +} + +type RestoreFirmwareConfigurationResponse struct { +} + +type RestrictedByAdministrator struct { + RuntimeFault + + Details string `xml:"details"` +} + +func init() { + t["RestrictedByAdministrator"] = reflect.TypeOf((*RestrictedByAdministrator)(nil)).Elem() +} + +type RestrictedByAdministratorFault RestrictedByAdministrator + +func init() { + t["RestrictedByAdministratorFault"] = reflect.TypeOf((*RestrictedByAdministratorFault)(nil)).Elem() +} + +type RestrictedVersion struct { + SecurityError +} + +func init() { + t["RestrictedVersion"] = reflect.TypeOf((*RestrictedVersion)(nil)).Elem() +} + +type RestrictedVersionFault RestrictedVersion + +func init() { + t["RestrictedVersionFault"] = reflect.TypeOf((*RestrictedVersionFault)(nil)).Elem() +} + +type RetrieveAllPermissions RetrieveAllPermissionsRequestType + +func init() { + t["RetrieveAllPermissions"] = reflect.TypeOf((*RetrieveAllPermissions)(nil)).Elem() +} + +type RetrieveAllPermissionsRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["RetrieveAllPermissionsRequestType"] = reflect.TypeOf((*RetrieveAllPermissionsRequestType)(nil)).Elem() +} + +type RetrieveAllPermissionsResponse struct { + Returnval []Permission `xml:"returnval,omitempty"` +} + +type RetrieveAnswerFile RetrieveAnswerFileRequestType + +func init() { + t["RetrieveAnswerFile"] = reflect.TypeOf((*RetrieveAnswerFile)(nil)).Elem() +} + +type RetrieveAnswerFileForProfile RetrieveAnswerFileForProfileRequestType + +func init() { + t["RetrieveAnswerFileForProfile"] = reflect.TypeOf((*RetrieveAnswerFileForProfile)(nil)).Elem() +} + +type RetrieveAnswerFileForProfileRequestType struct { + This ManagedObjectReference `xml:"_this"` + Host ManagedObjectReference `xml:"host"` + ApplyProfile HostApplyProfile `xml:"applyProfile"` +} + +func init() { + t["RetrieveAnswerFileForProfileRequestType"] = reflect.TypeOf((*RetrieveAnswerFileForProfileRequestType)(nil)).Elem() +} + +type RetrieveAnswerFileForProfileResponse struct { + Returnval *AnswerFile `xml:"returnval,omitempty"` +} + +type RetrieveAnswerFileRequestType struct { + This ManagedObjectReference `xml:"_this"` + Host ManagedObjectReference `xml:"host"` +} + +func init() { + t["RetrieveAnswerFileRequestType"] = reflect.TypeOf((*RetrieveAnswerFileRequestType)(nil)).Elem() +} + +type RetrieveAnswerFileResponse struct { + Returnval *AnswerFile `xml:"returnval,omitempty"` +} + +type RetrieveArgumentDescription RetrieveArgumentDescriptionRequestType + +func init() { + t["RetrieveArgumentDescription"] = reflect.TypeOf((*RetrieveArgumentDescription)(nil)).Elem() +} + +type RetrieveArgumentDescriptionRequestType struct { + This ManagedObjectReference `xml:"_this"` + EventTypeId string `xml:"eventTypeId"` +} + +func init() { + t["RetrieveArgumentDescriptionRequestType"] = reflect.TypeOf((*RetrieveArgumentDescriptionRequestType)(nil)).Elem() +} + +type RetrieveArgumentDescriptionResponse struct { + Returnval []EventArgDesc `xml:"returnval,omitempty"` +} + +type RetrieveDasAdvancedRuntimeInfo RetrieveDasAdvancedRuntimeInfoRequestType + +func init() { + t["RetrieveDasAdvancedRuntimeInfo"] = reflect.TypeOf((*RetrieveDasAdvancedRuntimeInfo)(nil)).Elem() +} + +type RetrieveDasAdvancedRuntimeInfoRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["RetrieveDasAdvancedRuntimeInfoRequestType"] = reflect.TypeOf((*RetrieveDasAdvancedRuntimeInfoRequestType)(nil)).Elem() +} + +type RetrieveDasAdvancedRuntimeInfoResponse struct { + Returnval BaseClusterDasAdvancedRuntimeInfo `xml:"returnval,omitempty,typeattr"` +} + +type RetrieveDescription RetrieveDescriptionRequestType + +func init() { + t["RetrieveDescription"] = reflect.TypeOf((*RetrieveDescription)(nil)).Elem() +} + +type RetrieveDescriptionRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["RetrieveDescriptionRequestType"] = reflect.TypeOf((*RetrieveDescriptionRequestType)(nil)).Elem() +} + +type RetrieveDescriptionResponse struct { + Returnval *ProfileDescription `xml:"returnval,omitempty"` +} + +type RetrieveDiskPartitionInfo RetrieveDiskPartitionInfoRequestType + +func init() { + t["RetrieveDiskPartitionInfo"] = reflect.TypeOf((*RetrieveDiskPartitionInfo)(nil)).Elem() +} + +type RetrieveDiskPartitionInfoRequestType struct { + This ManagedObjectReference `xml:"_this"` + DevicePath []string `xml:"devicePath"` +} + +func init() { + t["RetrieveDiskPartitionInfoRequestType"] = reflect.TypeOf((*RetrieveDiskPartitionInfoRequestType)(nil)).Elem() +} + +type RetrieveDiskPartitionInfoResponse struct { + Returnval []HostDiskPartitionInfo `xml:"returnval,omitempty"` +} + +type RetrieveEntityPermissions RetrieveEntityPermissionsRequestType + +func init() { + t["RetrieveEntityPermissions"] = reflect.TypeOf((*RetrieveEntityPermissions)(nil)).Elem() +} + +type RetrieveEntityPermissionsRequestType struct { + This ManagedObjectReference `xml:"_this"` + Entity ManagedObjectReference `xml:"entity"` + Inherited bool `xml:"inherited"` +} + +func init() { + t["RetrieveEntityPermissionsRequestType"] = reflect.TypeOf((*RetrieveEntityPermissionsRequestType)(nil)).Elem() +} + +type RetrieveEntityPermissionsResponse struct { + Returnval []Permission `xml:"returnval,omitempty"` +} + +type RetrieveEntityScheduledTask RetrieveEntityScheduledTaskRequestType + +func init() { + t["RetrieveEntityScheduledTask"] = reflect.TypeOf((*RetrieveEntityScheduledTask)(nil)).Elem() +} + +type RetrieveEntityScheduledTaskRequestType struct { + This ManagedObjectReference `xml:"_this"` + Entity *ManagedObjectReference `xml:"entity,omitempty"` +} + +func init() { + t["RetrieveEntityScheduledTaskRequestType"] = reflect.TypeOf((*RetrieveEntityScheduledTaskRequestType)(nil)).Elem() +} + +type RetrieveEntityScheduledTaskResponse struct { + Returnval []ManagedObjectReference `xml:"returnval,omitempty"` +} + +type RetrieveHardwareUptime RetrieveHardwareUptimeRequestType + +func init() { + t["RetrieveHardwareUptime"] = reflect.TypeOf((*RetrieveHardwareUptime)(nil)).Elem() +} + +type RetrieveHardwareUptimeRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["RetrieveHardwareUptimeRequestType"] = reflect.TypeOf((*RetrieveHardwareUptimeRequestType)(nil)).Elem() +} + +type RetrieveHardwareUptimeResponse struct { + Returnval int64 `xml:"returnval"` +} + +type RetrieveHostAccessControlEntries RetrieveHostAccessControlEntriesRequestType + +func init() { + t["RetrieveHostAccessControlEntries"] = reflect.TypeOf((*RetrieveHostAccessControlEntries)(nil)).Elem() +} + +type RetrieveHostAccessControlEntriesRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["RetrieveHostAccessControlEntriesRequestType"] = reflect.TypeOf((*RetrieveHostAccessControlEntriesRequestType)(nil)).Elem() +} + +type RetrieveHostAccessControlEntriesResponse struct { + Returnval []HostAccessControlEntry `xml:"returnval,omitempty"` +} + +type RetrieveObjectScheduledTask RetrieveObjectScheduledTaskRequestType + +func init() { + t["RetrieveObjectScheduledTask"] = reflect.TypeOf((*RetrieveObjectScheduledTask)(nil)).Elem() +} + +type RetrieveObjectScheduledTaskRequestType struct { + This ManagedObjectReference `xml:"_this"` + Obj *ManagedObjectReference `xml:"obj,omitempty"` +} + +func init() { + t["RetrieveObjectScheduledTaskRequestType"] = reflect.TypeOf((*RetrieveObjectScheduledTaskRequestType)(nil)).Elem() +} + +type RetrieveObjectScheduledTaskResponse struct { + Returnval []ManagedObjectReference `xml:"returnval,omitempty"` +} + +type RetrieveOptions struct { + DynamicData + + MaxObjects int32 `xml:"maxObjects,omitempty"` +} + +func init() { + t["RetrieveOptions"] = reflect.TypeOf((*RetrieveOptions)(nil)).Elem() +} + +type RetrieveProductComponents RetrieveProductComponentsRequestType + +func init() { + t["RetrieveProductComponents"] = reflect.TypeOf((*RetrieveProductComponents)(nil)).Elem() +} + +type RetrieveProductComponentsRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["RetrieveProductComponentsRequestType"] = reflect.TypeOf((*RetrieveProductComponentsRequestType)(nil)).Elem() +} + +type RetrieveProductComponentsResponse struct { + Returnval []ProductComponentInfo `xml:"returnval,omitempty"` +} + +type RetrieveProperties RetrievePropertiesRequestType + +func init() { + t["RetrieveProperties"] = reflect.TypeOf((*RetrieveProperties)(nil)).Elem() +} + +type RetrievePropertiesEx RetrievePropertiesExRequestType + +func init() { + t["RetrievePropertiesEx"] = reflect.TypeOf((*RetrievePropertiesEx)(nil)).Elem() +} + +type RetrievePropertiesExRequestType struct { + This ManagedObjectReference `xml:"_this"` + SpecSet []PropertyFilterSpec `xml:"specSet"` + Options RetrieveOptions `xml:"options"` +} + +func init() { + t["RetrievePropertiesExRequestType"] = reflect.TypeOf((*RetrievePropertiesExRequestType)(nil)).Elem() +} + +type RetrievePropertiesExResponse struct { + Returnval *RetrieveResult `xml:"returnval,omitempty"` +} + +type RetrievePropertiesRequestType struct { + This ManagedObjectReference `xml:"_this"` + SpecSet []PropertyFilterSpec `xml:"specSet"` +} + +func init() { + t["RetrievePropertiesRequestType"] = reflect.TypeOf((*RetrievePropertiesRequestType)(nil)).Elem() +} + +type RetrievePropertiesResponse struct { + Returnval []ObjectContent `xml:"returnval,omitempty"` +} + +type RetrieveResult struct { + DynamicData + + Token string `xml:"token,omitempty"` + Objects []ObjectContent `xml:"objects"` +} + +func init() { + t["RetrieveResult"] = reflect.TypeOf((*RetrieveResult)(nil)).Elem() +} + +type RetrieveRolePermissions RetrieveRolePermissionsRequestType + +func init() { + t["RetrieveRolePermissions"] = reflect.TypeOf((*RetrieveRolePermissions)(nil)).Elem() +} + +type RetrieveRolePermissionsRequestType struct { + This ManagedObjectReference `xml:"_this"` + RoleId int32 `xml:"roleId"` +} + +func init() { + t["RetrieveRolePermissionsRequestType"] = reflect.TypeOf((*RetrieveRolePermissionsRequestType)(nil)).Elem() +} + +type RetrieveRolePermissionsResponse struct { + Returnval []Permission `xml:"returnval,omitempty"` +} + +type RetrieveServiceContent RetrieveServiceContentRequestType + +func init() { + t["RetrieveServiceContent"] = reflect.TypeOf((*RetrieveServiceContent)(nil)).Elem() +} + +type RetrieveServiceContentRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["RetrieveServiceContentRequestType"] = reflect.TypeOf((*RetrieveServiceContentRequestType)(nil)).Elem() +} + +type RetrieveServiceContentResponse struct { + Returnval ServiceContent `xml:"returnval"` +} + +type RetrieveUserGroups RetrieveUserGroupsRequestType + +func init() { + t["RetrieveUserGroups"] = reflect.TypeOf((*RetrieveUserGroups)(nil)).Elem() +} + +type RetrieveUserGroupsRequestType struct { + This ManagedObjectReference `xml:"_this"` + Domain string `xml:"domain,omitempty"` + SearchStr string `xml:"searchStr"` + BelongsToGroup string `xml:"belongsToGroup,omitempty"` + BelongsToUser string `xml:"belongsToUser,omitempty"` + ExactMatch bool `xml:"exactMatch"` + FindUsers bool `xml:"findUsers"` + FindGroups bool `xml:"findGroups"` +} + +func init() { + t["RetrieveUserGroupsRequestType"] = reflect.TypeOf((*RetrieveUserGroupsRequestType)(nil)).Elem() +} + +type RetrieveUserGroupsResponse struct { + Returnval []BaseUserSearchResult `xml:"returnval,omitempty,typeattr"` +} + +type RevertToCurrentSnapshotRequestType struct { + This ManagedObjectReference `xml:"_this"` + Host *ManagedObjectReference `xml:"host,omitempty"` + SuppressPowerOn *bool `xml:"suppressPowerOn"` +} + +func init() { + t["RevertToCurrentSnapshotRequestType"] = reflect.TypeOf((*RevertToCurrentSnapshotRequestType)(nil)).Elem() +} + +type RevertToCurrentSnapshot_Task RevertToCurrentSnapshotRequestType + +func init() { + t["RevertToCurrentSnapshot_Task"] = reflect.TypeOf((*RevertToCurrentSnapshot_Task)(nil)).Elem() +} + +type RevertToCurrentSnapshot_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type RevertToSnapshotRequestType struct { + This ManagedObjectReference `xml:"_this"` + Host *ManagedObjectReference `xml:"host,omitempty"` + SuppressPowerOn *bool `xml:"suppressPowerOn"` +} + +func init() { + t["RevertToSnapshotRequestType"] = reflect.TypeOf((*RevertToSnapshotRequestType)(nil)).Elem() +} + +type RevertToSnapshot_Task RevertToSnapshotRequestType + +func init() { + t["RevertToSnapshot_Task"] = reflect.TypeOf((*RevertToSnapshot_Task)(nil)).Elem() +} + +type RevertToSnapshot_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type RewindCollector RewindCollectorRequestType + +func init() { + t["RewindCollector"] = reflect.TypeOf((*RewindCollector)(nil)).Elem() +} + +type RewindCollectorRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["RewindCollectorRequestType"] = reflect.TypeOf((*RewindCollectorRequestType)(nil)).Elem() +} + +type RewindCollectorResponse struct { +} + +type RoleAddedEvent struct { + RoleEvent + + PrivilegeList []string `xml:"privilegeList,omitempty"` +} + +func init() { + t["RoleAddedEvent"] = reflect.TypeOf((*RoleAddedEvent)(nil)).Elem() +} + +type RoleEvent struct { + AuthorizationEvent + + Role RoleEventArgument `xml:"role"` +} + +func init() { + t["RoleEvent"] = reflect.TypeOf((*RoleEvent)(nil)).Elem() +} + +type RoleEventArgument struct { + EventArgument + + RoleId int32 `xml:"roleId"` + Name string `xml:"name"` +} + +func init() { + t["RoleEventArgument"] = reflect.TypeOf((*RoleEventArgument)(nil)).Elem() +} + +type RoleRemovedEvent struct { + RoleEvent +} + +func init() { + t["RoleRemovedEvent"] = reflect.TypeOf((*RoleRemovedEvent)(nil)).Elem() +} + +type RoleUpdatedEvent struct { + RoleEvent + + PrivilegeList []string `xml:"privilegeList,omitempty"` +} + +func init() { + t["RoleUpdatedEvent"] = reflect.TypeOf((*RoleUpdatedEvent)(nil)).Elem() +} + +type RollbackEvent struct { + DvsEvent + + HostName string `xml:"hostName"` + MethodName string `xml:"methodName,omitempty"` +} + +func init() { + t["RollbackEvent"] = reflect.TypeOf((*RollbackEvent)(nil)).Elem() +} + +type RollbackFailure struct { + DvsFault + + EntityName string `xml:"entityName"` + EntityType string `xml:"entityType"` +} + +func init() { + t["RollbackFailure"] = reflect.TypeOf((*RollbackFailure)(nil)).Elem() +} + +type RollbackFailureFault RollbackFailure + +func init() { + t["RollbackFailureFault"] = reflect.TypeOf((*RollbackFailureFault)(nil)).Elem() +} + +type RuleViolation struct { + VmConfigFault + + Host *ManagedObjectReference `xml:"host,omitempty"` + Rule BaseClusterRuleInfo `xml:"rule,omitempty,typeattr"` +} + +func init() { + t["RuleViolation"] = reflect.TypeOf((*RuleViolation)(nil)).Elem() +} + +type RuleViolationFault RuleViolation + +func init() { + t["RuleViolationFault"] = reflect.TypeOf((*RuleViolationFault)(nil)).Elem() +} + +type RunScheduledTask RunScheduledTaskRequestType + +func init() { + t["RunScheduledTask"] = reflect.TypeOf((*RunScheduledTask)(nil)).Elem() +} + +type RunScheduledTaskRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["RunScheduledTaskRequestType"] = reflect.TypeOf((*RunScheduledTaskRequestType)(nil)).Elem() +} + +type RunScheduledTaskResponse struct { +} + +type RunScriptAction struct { + Action + + Script string `xml:"script"` +} + +func init() { + t["RunScriptAction"] = reflect.TypeOf((*RunScriptAction)(nil)).Elem() +} + +type RunVsanPhysicalDiskDiagnostics RunVsanPhysicalDiskDiagnosticsRequestType + +func init() { + t["RunVsanPhysicalDiskDiagnostics"] = reflect.TypeOf((*RunVsanPhysicalDiskDiagnostics)(nil)).Elem() +} + +type RunVsanPhysicalDiskDiagnosticsRequestType struct { + This ManagedObjectReference `xml:"_this"` + Disks []string `xml:"disks,omitempty"` +} + +func init() { + t["RunVsanPhysicalDiskDiagnosticsRequestType"] = reflect.TypeOf((*RunVsanPhysicalDiskDiagnosticsRequestType)(nil)).Elem() +} + +type RunVsanPhysicalDiskDiagnosticsResponse struct { + Returnval []HostVsanInternalSystemVsanPhysicalDiskDiagnosticsResult `xml:"returnval"` +} + +type RuntimeFault struct { + MethodFault +} + +func init() { + t["RuntimeFault"] = reflect.TypeOf((*RuntimeFault)(nil)).Elem() +} + +type RuntimeFaultFault BaseRuntimeFault + +func init() { + t["RuntimeFaultFault"] = reflect.TypeOf((*RuntimeFaultFault)(nil)).Elem() +} + +type SAMLTokenAuthentication struct { + GuestAuthentication + + Token string `xml:"token"` + Username string `xml:"username,omitempty"` +} + +func init() { + t["SAMLTokenAuthentication"] = reflect.TypeOf((*SAMLTokenAuthentication)(nil)).Elem() +} + +type SSLDisabledFault struct { + HostConnectFault +} + +func init() { + t["SSLDisabledFault"] = reflect.TypeOf((*SSLDisabledFault)(nil)).Elem() +} + +type SSLDisabledFaultFault SSLDisabledFault + +func init() { + t["SSLDisabledFaultFault"] = reflect.TypeOf((*SSLDisabledFaultFault)(nil)).Elem() +} + +type SSLVerifyFault struct { + HostConnectFault + + SelfSigned bool `xml:"selfSigned"` + Thumbprint string `xml:"thumbprint"` +} + +func init() { + t["SSLVerifyFault"] = reflect.TypeOf((*SSLVerifyFault)(nil)).Elem() +} + +type SSLVerifyFaultFault SSLVerifyFault + +func init() { + t["SSLVerifyFaultFault"] = reflect.TypeOf((*SSLVerifyFaultFault)(nil)).Elem() +} + +type SSPIAuthentication struct { + GuestAuthentication + + SspiToken string `xml:"sspiToken"` +} + +func init() { + t["SSPIAuthentication"] = reflect.TypeOf((*SSPIAuthentication)(nil)).Elem() +} + +type SSPIChallenge struct { + VimFault + + Base64Token string `xml:"base64Token"` +} + +func init() { + t["SSPIChallenge"] = reflect.TypeOf((*SSPIChallenge)(nil)).Elem() +} + +type SSPIChallengeFault SSPIChallenge + +func init() { + t["SSPIChallengeFault"] = reflect.TypeOf((*SSPIChallengeFault)(nil)).Elem() +} + +type ScanHostPatchRequestType struct { + This ManagedObjectReference `xml:"_this"` + Repository HostPatchManagerLocator `xml:"repository"` + UpdateID []string `xml:"updateID,omitempty"` +} + +func init() { + t["ScanHostPatchRequestType"] = reflect.TypeOf((*ScanHostPatchRequestType)(nil)).Elem() +} + +type ScanHostPatchV2RequestType struct { + This ManagedObjectReference `xml:"_this"` + MetaUrls []string `xml:"metaUrls,omitempty"` + BundleUrls []string `xml:"bundleUrls,omitempty"` + Spec *HostPatchManagerPatchManagerOperationSpec `xml:"spec,omitempty"` +} + +func init() { + t["ScanHostPatchV2RequestType"] = reflect.TypeOf((*ScanHostPatchV2RequestType)(nil)).Elem() +} + +type ScanHostPatchV2_Task ScanHostPatchV2RequestType + +func init() { + t["ScanHostPatchV2_Task"] = reflect.TypeOf((*ScanHostPatchV2_Task)(nil)).Elem() +} + +type ScanHostPatchV2_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type ScanHostPatch_Task ScanHostPatchRequestType + +func init() { + t["ScanHostPatch_Task"] = reflect.TypeOf((*ScanHostPatch_Task)(nil)).Elem() +} + +type ScanHostPatch_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type ScheduledHardwareUpgradeInfo struct { + DynamicData + + UpgradePolicy string `xml:"upgradePolicy,omitempty"` + VersionKey string `xml:"versionKey,omitempty"` + ScheduledHardwareUpgradeStatus string `xml:"scheduledHardwareUpgradeStatus,omitempty"` + Fault *LocalizedMethodFault `xml:"fault,omitempty"` +} + +func init() { + t["ScheduledHardwareUpgradeInfo"] = reflect.TypeOf((*ScheduledHardwareUpgradeInfo)(nil)).Elem() +} + +type ScheduledTaskCompletedEvent struct { + ScheduledTaskEvent +} + +func init() { + t["ScheduledTaskCompletedEvent"] = reflect.TypeOf((*ScheduledTaskCompletedEvent)(nil)).Elem() +} + +type ScheduledTaskCreatedEvent struct { + ScheduledTaskEvent +} + +func init() { + t["ScheduledTaskCreatedEvent"] = reflect.TypeOf((*ScheduledTaskCreatedEvent)(nil)).Elem() +} + +type ScheduledTaskDescription struct { + DynamicData + + Action []BaseTypeDescription `xml:"action,typeattr"` + SchedulerInfo []ScheduledTaskDetail `xml:"schedulerInfo"` + State []BaseElementDescription `xml:"state,typeattr"` + DayOfWeek []BaseElementDescription `xml:"dayOfWeek,typeattr"` + WeekOfMonth []BaseElementDescription `xml:"weekOfMonth,typeattr"` +} + +func init() { + t["ScheduledTaskDescription"] = reflect.TypeOf((*ScheduledTaskDescription)(nil)).Elem() +} + +type ScheduledTaskDetail struct { + TypeDescription + + Frequency string `xml:"frequency"` +} + +func init() { + t["ScheduledTaskDetail"] = reflect.TypeOf((*ScheduledTaskDetail)(nil)).Elem() +} + +type ScheduledTaskEmailCompletedEvent struct { + ScheduledTaskEvent + + To string `xml:"to"` +} + +func init() { + t["ScheduledTaskEmailCompletedEvent"] = reflect.TypeOf((*ScheduledTaskEmailCompletedEvent)(nil)).Elem() +} + +type ScheduledTaskEmailFailedEvent struct { + ScheduledTaskEvent + + To string `xml:"to"` + Reason LocalizedMethodFault `xml:"reason"` +} + +func init() { + t["ScheduledTaskEmailFailedEvent"] = reflect.TypeOf((*ScheduledTaskEmailFailedEvent)(nil)).Elem() +} + +type ScheduledTaskEvent struct { + Event + + ScheduledTask ScheduledTaskEventArgument `xml:"scheduledTask"` + Entity ManagedEntityEventArgument `xml:"entity"` +} + +func init() { + t["ScheduledTaskEvent"] = reflect.TypeOf((*ScheduledTaskEvent)(nil)).Elem() +} + +type ScheduledTaskEventArgument struct { + EntityEventArgument + + ScheduledTask ManagedObjectReference `xml:"scheduledTask"` +} + +func init() { + t["ScheduledTaskEventArgument"] = reflect.TypeOf((*ScheduledTaskEventArgument)(nil)).Elem() +} + +type ScheduledTaskFailedEvent struct { + ScheduledTaskEvent + + Reason LocalizedMethodFault `xml:"reason"` +} + +func init() { + t["ScheduledTaskFailedEvent"] = reflect.TypeOf((*ScheduledTaskFailedEvent)(nil)).Elem() +} + +type ScheduledTaskInfo struct { + ScheduledTaskSpec + + ScheduledTask ManagedObjectReference `xml:"scheduledTask"` + Entity ManagedObjectReference `xml:"entity"` + LastModifiedTime time.Time `xml:"lastModifiedTime"` + LastModifiedUser string `xml:"lastModifiedUser"` + NextRunTime *time.Time `xml:"nextRunTime"` + PrevRunTime *time.Time `xml:"prevRunTime"` + State TaskInfoState `xml:"state"` + Error *LocalizedMethodFault `xml:"error,omitempty"` + Result AnyType `xml:"result,omitempty,typeattr"` + Progress int32 `xml:"progress,omitempty"` + ActiveTask *ManagedObjectReference `xml:"activeTask,omitempty"` + TaskObject *ManagedObjectReference `xml:"taskObject,omitempty"` +} + +func init() { + t["ScheduledTaskInfo"] = reflect.TypeOf((*ScheduledTaskInfo)(nil)).Elem() +} + +type ScheduledTaskReconfiguredEvent struct { + ScheduledTaskEvent +} + +func init() { + t["ScheduledTaskReconfiguredEvent"] = reflect.TypeOf((*ScheduledTaskReconfiguredEvent)(nil)).Elem() +} + +type ScheduledTaskRemovedEvent struct { + ScheduledTaskEvent +} + +func init() { + t["ScheduledTaskRemovedEvent"] = reflect.TypeOf((*ScheduledTaskRemovedEvent)(nil)).Elem() +} + +type ScheduledTaskSpec struct { + DynamicData + + Name string `xml:"name"` + Description string `xml:"description"` + Enabled bool `xml:"enabled"` + Scheduler BaseTaskScheduler `xml:"scheduler,typeattr"` + Action BaseAction `xml:"action,typeattr"` + Notification string `xml:"notification,omitempty"` +} + +func init() { + t["ScheduledTaskSpec"] = reflect.TypeOf((*ScheduledTaskSpec)(nil)).Elem() +} + +type ScheduledTaskStartedEvent struct { + ScheduledTaskEvent +} + +func init() { + t["ScheduledTaskStartedEvent"] = reflect.TypeOf((*ScheduledTaskStartedEvent)(nil)).Elem() +} + +type ScsiLun struct { + HostDevice + + Key string `xml:"key,omitempty"` + Uuid string `xml:"uuid"` + Descriptor []ScsiLunDescriptor `xml:"descriptor,omitempty"` + CanonicalName string `xml:"canonicalName,omitempty"` + DisplayName string `xml:"displayName,omitempty"` + LunType string `xml:"lunType"` + Vendor string `xml:"vendor,omitempty"` + Model string `xml:"model,omitempty"` + Revision string `xml:"revision,omitempty"` + ScsiLevel int32 `xml:"scsiLevel,omitempty"` + SerialNumber string `xml:"serialNumber,omitempty"` + DurableName *ScsiLunDurableName `xml:"durableName,omitempty"` + AlternateName []ScsiLunDurableName `xml:"alternateName,omitempty"` + StandardInquiry []byte `xml:"standardInquiry,omitempty"` + QueueDepth int32 `xml:"queueDepth,omitempty"` + OperationalState []string `xml:"operationalState"` + Capabilities *ScsiLunCapabilities `xml:"capabilities,omitempty"` + VStorageSupport string `xml:"vStorageSupport,omitempty"` + ProtocolEndpoint *bool `xml:"protocolEndpoint"` +} + +func init() { + t["ScsiLun"] = reflect.TypeOf((*ScsiLun)(nil)).Elem() +} + +type ScsiLunCapabilities struct { + DynamicData + + UpdateDisplayNameSupported bool `xml:"updateDisplayNameSupported"` +} + +func init() { + t["ScsiLunCapabilities"] = reflect.TypeOf((*ScsiLunCapabilities)(nil)).Elem() +} + +type ScsiLunDescriptor struct { + DynamicData + + Quality string `xml:"quality"` + Id string `xml:"id"` +} + +func init() { + t["ScsiLunDescriptor"] = reflect.TypeOf((*ScsiLunDescriptor)(nil)).Elem() +} + +type ScsiLunDurableName struct { + DynamicData + + Namespace string `xml:"namespace"` + NamespaceId byte `xml:"namespaceId"` + Data []byte `xml:"data,omitempty"` +} + +func init() { + t["ScsiLunDurableName"] = reflect.TypeOf((*ScsiLunDurableName)(nil)).Elem() +} + +type SeSparseVirtualDiskSpec struct { + FileBackedVirtualDiskSpec + + GrainSizeKb int32 `xml:"grainSizeKb,omitempty"` +} + +func init() { + t["SeSparseVirtualDiskSpec"] = reflect.TypeOf((*SeSparseVirtualDiskSpec)(nil)).Elem() +} + +type SearchDatastoreRequestType struct { + This ManagedObjectReference `xml:"_this"` + DatastorePath string `xml:"datastorePath"` + SearchSpec *HostDatastoreBrowserSearchSpec `xml:"searchSpec,omitempty"` +} + +func init() { + t["SearchDatastoreRequestType"] = reflect.TypeOf((*SearchDatastoreRequestType)(nil)).Elem() +} + +type SearchDatastoreSubFoldersRequestType struct { + This ManagedObjectReference `xml:"_this"` + DatastorePath string `xml:"datastorePath"` + SearchSpec *HostDatastoreBrowserSearchSpec `xml:"searchSpec,omitempty"` +} + +func init() { + t["SearchDatastoreSubFoldersRequestType"] = reflect.TypeOf((*SearchDatastoreSubFoldersRequestType)(nil)).Elem() +} + +type SearchDatastoreSubFolders_Task SearchDatastoreSubFoldersRequestType + +func init() { + t["SearchDatastoreSubFolders_Task"] = reflect.TypeOf((*SearchDatastoreSubFolders_Task)(nil)).Elem() +} + +type SearchDatastoreSubFolders_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type SearchDatastore_Task SearchDatastoreRequestType + +func init() { + t["SearchDatastore_Task"] = reflect.TypeOf((*SearchDatastore_Task)(nil)).Elem() +} + +type SearchDatastore_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type SecondaryVmAlreadyDisabled struct { + VmFaultToleranceIssue + + InstanceUuid string `xml:"instanceUuid"` +} + +func init() { + t["SecondaryVmAlreadyDisabled"] = reflect.TypeOf((*SecondaryVmAlreadyDisabled)(nil)).Elem() +} + +type SecondaryVmAlreadyDisabledFault SecondaryVmAlreadyDisabled + +func init() { + t["SecondaryVmAlreadyDisabledFault"] = reflect.TypeOf((*SecondaryVmAlreadyDisabledFault)(nil)).Elem() +} + +type SecondaryVmAlreadyEnabled struct { + VmFaultToleranceIssue + + InstanceUuid string `xml:"instanceUuid"` +} + +func init() { + t["SecondaryVmAlreadyEnabled"] = reflect.TypeOf((*SecondaryVmAlreadyEnabled)(nil)).Elem() +} + +type SecondaryVmAlreadyEnabledFault SecondaryVmAlreadyEnabled + +func init() { + t["SecondaryVmAlreadyEnabledFault"] = reflect.TypeOf((*SecondaryVmAlreadyEnabledFault)(nil)).Elem() +} + +type SecondaryVmAlreadyRegistered struct { + VmFaultToleranceIssue + + InstanceUuid string `xml:"instanceUuid,omitempty"` +} + +func init() { + t["SecondaryVmAlreadyRegistered"] = reflect.TypeOf((*SecondaryVmAlreadyRegistered)(nil)).Elem() +} + +type SecondaryVmAlreadyRegisteredFault SecondaryVmAlreadyRegistered + +func init() { + t["SecondaryVmAlreadyRegisteredFault"] = reflect.TypeOf((*SecondaryVmAlreadyRegisteredFault)(nil)).Elem() +} + +type SecondaryVmNotRegistered struct { + VmFaultToleranceIssue + + InstanceUuid string `xml:"instanceUuid,omitempty"` +} + +func init() { + t["SecondaryVmNotRegistered"] = reflect.TypeOf((*SecondaryVmNotRegistered)(nil)).Elem() +} + +type SecondaryVmNotRegisteredFault SecondaryVmNotRegistered + +func init() { + t["SecondaryVmNotRegisteredFault"] = reflect.TypeOf((*SecondaryVmNotRegisteredFault)(nil)).Elem() +} + +type SecurityError struct { + RuntimeFault +} + +func init() { + t["SecurityError"] = reflect.TypeOf((*SecurityError)(nil)).Elem() +} + +type SecurityErrorFault BaseSecurityError + +func init() { + t["SecurityErrorFault"] = reflect.TypeOf((*SecurityErrorFault)(nil)).Elem() +} + +type SecurityProfile struct { + ApplyProfile + + Permission []PermissionProfile `xml:"permission,omitempty"` +} + +func init() { + t["SecurityProfile"] = reflect.TypeOf((*SecurityProfile)(nil)).Elem() +} + +type SelectActivePartition SelectActivePartitionRequestType + +func init() { + t["SelectActivePartition"] = reflect.TypeOf((*SelectActivePartition)(nil)).Elem() +} + +type SelectActivePartitionRequestType struct { + This ManagedObjectReference `xml:"_this"` + Partition *HostScsiDiskPartition `xml:"partition,omitempty"` +} + +func init() { + t["SelectActivePartitionRequestType"] = reflect.TypeOf((*SelectActivePartitionRequestType)(nil)).Elem() +} + +type SelectActivePartitionResponse struct { +} + +type SelectVnic SelectVnicRequestType + +func init() { + t["SelectVnic"] = reflect.TypeOf((*SelectVnic)(nil)).Elem() +} + +type SelectVnicForNicType SelectVnicForNicTypeRequestType + +func init() { + t["SelectVnicForNicType"] = reflect.TypeOf((*SelectVnicForNicType)(nil)).Elem() +} + +type SelectVnicForNicTypeRequestType struct { + This ManagedObjectReference `xml:"_this"` + NicType string `xml:"nicType"` + Device string `xml:"device"` +} + +func init() { + t["SelectVnicForNicTypeRequestType"] = reflect.TypeOf((*SelectVnicForNicTypeRequestType)(nil)).Elem() +} + +type SelectVnicForNicTypeResponse struct { +} + +type SelectVnicRequestType struct { + This ManagedObjectReference `xml:"_this"` + Device string `xml:"device"` +} + +func init() { + t["SelectVnicRequestType"] = reflect.TypeOf((*SelectVnicRequestType)(nil)).Elem() +} + +type SelectVnicResponse struct { +} + +type SelectionSet struct { + DynamicData +} + +func init() { + t["SelectionSet"] = reflect.TypeOf((*SelectionSet)(nil)).Elem() +} + +type SelectionSpec struct { + DynamicData + + Name string `xml:"name,omitempty"` +} + +func init() { + t["SelectionSpec"] = reflect.TypeOf((*SelectionSpec)(nil)).Elem() +} + +type SendEmailAction struct { + Action + + ToList string `xml:"toList"` + CcList string `xml:"ccList"` + Subject string `xml:"subject"` + Body string `xml:"body"` +} + +func init() { + t["SendEmailAction"] = reflect.TypeOf((*SendEmailAction)(nil)).Elem() +} + +type SendNMI SendNMIRequestType + +func init() { + t["SendNMI"] = reflect.TypeOf((*SendNMI)(nil)).Elem() +} + +type SendNMIRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["SendNMIRequestType"] = reflect.TypeOf((*SendNMIRequestType)(nil)).Elem() +} + +type SendNMIResponse struct { +} + +type SendSNMPAction struct { + Action +} + +func init() { + t["SendSNMPAction"] = reflect.TypeOf((*SendSNMPAction)(nil)).Elem() +} + +type SendTestNotification SendTestNotificationRequestType + +func init() { + t["SendTestNotification"] = reflect.TypeOf((*SendTestNotification)(nil)).Elem() +} + +type SendTestNotificationRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["SendTestNotificationRequestType"] = reflect.TypeOf((*SendTestNotificationRequestType)(nil)).Elem() +} + +type SendTestNotificationResponse struct { +} + +type ServerLicenseExpiredEvent struct { + LicenseEvent + + Product string `xml:"product"` +} + +func init() { + t["ServerLicenseExpiredEvent"] = reflect.TypeOf((*ServerLicenseExpiredEvent)(nil)).Elem() +} + +type ServerStartedSessionEvent struct { + SessionEvent +} + +func init() { + t["ServerStartedSessionEvent"] = reflect.TypeOf((*ServerStartedSessionEvent)(nil)).Elem() +} + +type ServiceConsolePortGroupProfile struct { + PortGroupProfile + + IpConfig IpAddressProfile `xml:"ipConfig"` +} + +func init() { + t["ServiceConsolePortGroupProfile"] = reflect.TypeOf((*ServiceConsolePortGroupProfile)(nil)).Elem() +} + +type ServiceConsoleReservationInfo struct { + DynamicData + + ServiceConsoleReservedCfg int64 `xml:"serviceConsoleReservedCfg"` + ServiceConsoleReserved int64 `xml:"serviceConsoleReserved"` + Unreserved int64 `xml:"unreserved"` +} + +func init() { + t["ServiceConsoleReservationInfo"] = reflect.TypeOf((*ServiceConsoleReservationInfo)(nil)).Elem() +} + +type ServiceContent struct { + DynamicData + + RootFolder ManagedObjectReference `xml:"rootFolder"` + PropertyCollector ManagedObjectReference `xml:"propertyCollector"` + ViewManager *ManagedObjectReference `xml:"viewManager,omitempty"` + About AboutInfo `xml:"about"` + Setting *ManagedObjectReference `xml:"setting,omitempty"` + UserDirectory *ManagedObjectReference `xml:"userDirectory,omitempty"` + SessionManager *ManagedObjectReference `xml:"sessionManager,omitempty"` + AuthorizationManager *ManagedObjectReference `xml:"authorizationManager,omitempty"` + ServiceManager *ManagedObjectReference `xml:"serviceManager,omitempty"` + PerfManager *ManagedObjectReference `xml:"perfManager,omitempty"` + ScheduledTaskManager *ManagedObjectReference `xml:"scheduledTaskManager,omitempty"` + AlarmManager *ManagedObjectReference `xml:"alarmManager,omitempty"` + EventManager *ManagedObjectReference `xml:"eventManager,omitempty"` + TaskManager *ManagedObjectReference `xml:"taskManager,omitempty"` + ExtensionManager *ManagedObjectReference `xml:"extensionManager,omitempty"` + CustomizationSpecManager *ManagedObjectReference `xml:"customizationSpecManager,omitempty"` + CustomFieldsManager *ManagedObjectReference `xml:"customFieldsManager,omitempty"` + AccountManager *ManagedObjectReference `xml:"accountManager,omitempty"` + DiagnosticManager *ManagedObjectReference `xml:"diagnosticManager,omitempty"` + LicenseManager *ManagedObjectReference `xml:"licenseManager,omitempty"` + SearchIndex *ManagedObjectReference `xml:"searchIndex,omitempty"` + FileManager *ManagedObjectReference `xml:"fileManager,omitempty"` + DatastoreNamespaceManager *ManagedObjectReference `xml:"datastoreNamespaceManager,omitempty"` + VirtualDiskManager *ManagedObjectReference `xml:"virtualDiskManager,omitempty"` + VirtualizationManager *ManagedObjectReference `xml:"virtualizationManager,omitempty"` + SnmpSystem *ManagedObjectReference `xml:"snmpSystem,omitempty"` + VmProvisioningChecker *ManagedObjectReference `xml:"vmProvisioningChecker,omitempty"` + VmCompatibilityChecker *ManagedObjectReference `xml:"vmCompatibilityChecker,omitempty"` + OvfManager *ManagedObjectReference `xml:"ovfManager,omitempty"` + IpPoolManager *ManagedObjectReference `xml:"ipPoolManager,omitempty"` + DvSwitchManager *ManagedObjectReference `xml:"dvSwitchManager,omitempty"` + HostProfileManager *ManagedObjectReference `xml:"hostProfileManager,omitempty"` + ClusterProfileManager *ManagedObjectReference `xml:"clusterProfileManager,omitempty"` + ComplianceManager *ManagedObjectReference `xml:"complianceManager,omitempty"` + LocalizationManager *ManagedObjectReference `xml:"localizationManager,omitempty"` + StorageResourceManager *ManagedObjectReference `xml:"storageResourceManager,omitempty"` + GuestOperationsManager *ManagedObjectReference `xml:"guestOperationsManager,omitempty"` + OverheadMemoryManager *ManagedObjectReference `xml:"overheadMemoryManager,omitempty"` + CertificateManager *ManagedObjectReference `xml:"certificateManager,omitempty"` + IoFilterManager *ManagedObjectReference `xml:"ioFilterManager,omitempty"` +} + +func init() { + t["ServiceContent"] = reflect.TypeOf((*ServiceContent)(nil)).Elem() +} + +type ServiceLocator struct { + DynamicData + + InstanceUuid string `xml:"instanceUuid"` + Url string `xml:"url"` + Credential BaseServiceLocatorCredential `xml:"credential,typeattr"` + SslThumbprint string `xml:"sslThumbprint,omitempty"` +} + +func init() { + t["ServiceLocator"] = reflect.TypeOf((*ServiceLocator)(nil)).Elem() +} + +type ServiceLocatorCredential struct { + DynamicData +} + +func init() { + t["ServiceLocatorCredential"] = reflect.TypeOf((*ServiceLocatorCredential)(nil)).Elem() +} + +type ServiceLocatorNamePassword struct { + ServiceLocatorCredential + + Username string `xml:"username"` + Password string `xml:"password"` +} + +func init() { + t["ServiceLocatorNamePassword"] = reflect.TypeOf((*ServiceLocatorNamePassword)(nil)).Elem() +} + +type ServiceLocatorSAMLCredential struct { + ServiceLocatorCredential + + Token string `xml:"token,omitempty"` +} + +func init() { + t["ServiceLocatorSAMLCredential"] = reflect.TypeOf((*ServiceLocatorSAMLCredential)(nil)).Elem() +} + +type ServiceManagerServiceInfo struct { + DynamicData + + ServiceName string `xml:"serviceName"` + Location []string `xml:"location,omitempty"` + Service ManagedObjectReference `xml:"service"` + Description string `xml:"description"` +} + +func init() { + t["ServiceManagerServiceInfo"] = reflect.TypeOf((*ServiceManagerServiceInfo)(nil)).Elem() +} + +type ServiceProfile struct { + ApplyProfile + + Key string `xml:"key"` +} + +func init() { + t["ServiceProfile"] = reflect.TypeOf((*ServiceProfile)(nil)).Elem() +} + +type SessionEvent struct { + Event +} + +func init() { + t["SessionEvent"] = reflect.TypeOf((*SessionEvent)(nil)).Elem() +} + +type SessionIsActive SessionIsActiveRequestType + +func init() { + t["SessionIsActive"] = reflect.TypeOf((*SessionIsActive)(nil)).Elem() +} + +type SessionIsActiveRequestType struct { + This ManagedObjectReference `xml:"_this"` + SessionID string `xml:"sessionID"` + UserName string `xml:"userName"` +} + +func init() { + t["SessionIsActiveRequestType"] = reflect.TypeOf((*SessionIsActiveRequestType)(nil)).Elem() +} + +type SessionIsActiveResponse struct { + Returnval bool `xml:"returnval"` +} + +type SessionManagerGenericServiceTicket struct { + DynamicData + + Id string `xml:"id"` + HostName string `xml:"hostName,omitempty"` + SslThumbprint string `xml:"sslThumbprint,omitempty"` +} + +func init() { + t["SessionManagerGenericServiceTicket"] = reflect.TypeOf((*SessionManagerGenericServiceTicket)(nil)).Elem() +} + +type SessionManagerHttpServiceRequestSpec struct { + SessionManagerServiceRequestSpec + + Method string `xml:"method,omitempty"` + Url string `xml:"url"` +} + +func init() { + t["SessionManagerHttpServiceRequestSpec"] = reflect.TypeOf((*SessionManagerHttpServiceRequestSpec)(nil)).Elem() +} + +type SessionManagerLocalTicket struct { + DynamicData + + UserName string `xml:"userName"` + PasswordFilePath string `xml:"passwordFilePath"` +} + +func init() { + t["SessionManagerLocalTicket"] = reflect.TypeOf((*SessionManagerLocalTicket)(nil)).Elem() +} + +type SessionManagerServiceRequestSpec struct { + DynamicData +} + +func init() { + t["SessionManagerServiceRequestSpec"] = reflect.TypeOf((*SessionManagerServiceRequestSpec)(nil)).Elem() +} + +type SessionManagerVmomiServiceRequestSpec struct { + SessionManagerServiceRequestSpec + + Method string `xml:"method"` +} + +func init() { + t["SessionManagerVmomiServiceRequestSpec"] = reflect.TypeOf((*SessionManagerVmomiServiceRequestSpec)(nil)).Elem() +} + +type SessionTerminatedEvent struct { + SessionEvent + + SessionId string `xml:"sessionId"` + TerminatedUsername string `xml:"terminatedUsername"` +} + +func init() { + t["SessionTerminatedEvent"] = reflect.TypeOf((*SessionTerminatedEvent)(nil)).Elem() +} + +type SetCollectorPageSize SetCollectorPageSizeRequestType + +func init() { + t["SetCollectorPageSize"] = reflect.TypeOf((*SetCollectorPageSize)(nil)).Elem() +} + +type SetCollectorPageSizeRequestType struct { + This ManagedObjectReference `xml:"_this"` + MaxCount int32 `xml:"maxCount"` +} + +func init() { + t["SetCollectorPageSizeRequestType"] = reflect.TypeOf((*SetCollectorPageSizeRequestType)(nil)).Elem() +} + +type SetCollectorPageSizeResponse struct { +} + +type SetDisplayTopology SetDisplayTopologyRequestType + +func init() { + t["SetDisplayTopology"] = reflect.TypeOf((*SetDisplayTopology)(nil)).Elem() +} + +type SetDisplayTopologyRequestType struct { + This ManagedObjectReference `xml:"_this"` + Displays []VirtualMachineDisplayTopology `xml:"displays"` +} + +func init() { + t["SetDisplayTopologyRequestType"] = reflect.TypeOf((*SetDisplayTopologyRequestType)(nil)).Elem() +} + +type SetDisplayTopologyResponse struct { +} + +type SetEntityPermissions SetEntityPermissionsRequestType + +func init() { + t["SetEntityPermissions"] = reflect.TypeOf((*SetEntityPermissions)(nil)).Elem() +} + +type SetEntityPermissionsRequestType struct { + This ManagedObjectReference `xml:"_this"` + Entity ManagedObjectReference `xml:"entity"` + Permission []Permission `xml:"permission,omitempty"` +} + +func init() { + t["SetEntityPermissionsRequestType"] = reflect.TypeOf((*SetEntityPermissionsRequestType)(nil)).Elem() +} + +type SetEntityPermissionsResponse struct { +} + +type SetExtensionCertificate SetExtensionCertificateRequestType + +func init() { + t["SetExtensionCertificate"] = reflect.TypeOf((*SetExtensionCertificate)(nil)).Elem() +} + +type SetExtensionCertificateRequestType struct { + This ManagedObjectReference `xml:"_this"` + ExtensionKey string `xml:"extensionKey"` + CertificatePem string `xml:"certificatePem,omitempty"` +} + +func init() { + t["SetExtensionCertificateRequestType"] = reflect.TypeOf((*SetExtensionCertificateRequestType)(nil)).Elem() +} + +type SetExtensionCertificateResponse struct { +} + +type SetField SetFieldRequestType + +func init() { + t["SetField"] = reflect.TypeOf((*SetField)(nil)).Elem() +} + +type SetFieldRequestType struct { + This ManagedObjectReference `xml:"_this"` + Entity ManagedObjectReference `xml:"entity"` + Key int32 `xml:"key"` + Value string `xml:"value"` +} + +func init() { + t["SetFieldRequestType"] = reflect.TypeOf((*SetFieldRequestType)(nil)).Elem() +} + +type SetFieldResponse struct { +} + +type SetLicenseEdition SetLicenseEditionRequestType + +func init() { + t["SetLicenseEdition"] = reflect.TypeOf((*SetLicenseEdition)(nil)).Elem() +} + +type SetLicenseEditionRequestType struct { + This ManagedObjectReference `xml:"_this"` + Host *ManagedObjectReference `xml:"host,omitempty"` + FeatureKey string `xml:"featureKey,omitempty"` +} + +func init() { + t["SetLicenseEditionRequestType"] = reflect.TypeOf((*SetLicenseEditionRequestType)(nil)).Elem() +} + +type SetLicenseEditionResponse struct { +} + +type SetLocale SetLocaleRequestType + +func init() { + t["SetLocale"] = reflect.TypeOf((*SetLocale)(nil)).Elem() +} + +type SetLocaleRequestType struct { + This ManagedObjectReference `xml:"_this"` + Locale string `xml:"locale"` +} + +func init() { + t["SetLocaleRequestType"] = reflect.TypeOf((*SetLocaleRequestType)(nil)).Elem() +} + +type SetLocaleResponse struct { +} + +type SetMultipathLunPolicy SetMultipathLunPolicyRequestType + +func init() { + t["SetMultipathLunPolicy"] = reflect.TypeOf((*SetMultipathLunPolicy)(nil)).Elem() +} + +type SetMultipathLunPolicyRequestType struct { + This ManagedObjectReference `xml:"_this"` + LunId string `xml:"lunId"` + Policy BaseHostMultipathInfoLogicalUnitPolicy `xml:"policy,typeattr"` +} + +func init() { + t["SetMultipathLunPolicyRequestType"] = reflect.TypeOf((*SetMultipathLunPolicyRequestType)(nil)).Elem() +} + +type SetMultipathLunPolicyResponse struct { +} + +type SetNFSUser SetNFSUserRequestType + +func init() { + t["SetNFSUser"] = reflect.TypeOf((*SetNFSUser)(nil)).Elem() +} + +type SetNFSUserRequestType struct { + This ManagedObjectReference `xml:"_this"` + User string `xml:"user"` + Password string `xml:"password"` +} + +func init() { + t["SetNFSUserRequestType"] = reflect.TypeOf((*SetNFSUserRequestType)(nil)).Elem() +} + +type SetNFSUserResponse struct { +} + +type SetPublicKey SetPublicKeyRequestType + +func init() { + t["SetPublicKey"] = reflect.TypeOf((*SetPublicKey)(nil)).Elem() +} + +type SetPublicKeyRequestType struct { + This ManagedObjectReference `xml:"_this"` + ExtensionKey string `xml:"extensionKey"` + PublicKey string `xml:"publicKey"` +} + +func init() { + t["SetPublicKeyRequestType"] = reflect.TypeOf((*SetPublicKeyRequestType)(nil)).Elem() +} + +type SetPublicKeyResponse struct { +} + +type SetRegistryValueInGuest SetRegistryValueInGuestRequestType + +func init() { + t["SetRegistryValueInGuest"] = reflect.TypeOf((*SetRegistryValueInGuest)(nil)).Elem() +} + +type SetRegistryValueInGuestRequestType struct { + This ManagedObjectReference `xml:"_this"` + Vm ManagedObjectReference `xml:"vm"` + Auth BaseGuestAuthentication `xml:"auth,typeattr"` + Value GuestRegValueSpec `xml:"value"` +} + +func init() { + t["SetRegistryValueInGuestRequestType"] = reflect.TypeOf((*SetRegistryValueInGuestRequestType)(nil)).Elem() +} + +type SetRegistryValueInGuestResponse struct { +} + +type SetScreenResolution SetScreenResolutionRequestType + +func init() { + t["SetScreenResolution"] = reflect.TypeOf((*SetScreenResolution)(nil)).Elem() +} + +type SetScreenResolutionRequestType struct { + This ManagedObjectReference `xml:"_this"` + Width int32 `xml:"width"` + Height int32 `xml:"height"` +} + +func init() { + t["SetScreenResolutionRequestType"] = reflect.TypeOf((*SetScreenResolutionRequestType)(nil)).Elem() +} + +type SetScreenResolutionResponse struct { +} + +type SetTaskDescription SetTaskDescriptionRequestType + +func init() { + t["SetTaskDescription"] = reflect.TypeOf((*SetTaskDescription)(nil)).Elem() +} + +type SetTaskDescriptionRequestType struct { + This ManagedObjectReference `xml:"_this"` + Description LocalizableMessage `xml:"description"` +} + +func init() { + t["SetTaskDescriptionRequestType"] = reflect.TypeOf((*SetTaskDescriptionRequestType)(nil)).Elem() +} + +type SetTaskDescriptionResponse struct { +} + +type SetTaskState SetTaskStateRequestType + +func init() { + t["SetTaskState"] = reflect.TypeOf((*SetTaskState)(nil)).Elem() +} + +type SetTaskStateRequestType struct { + This ManagedObjectReference `xml:"_this"` + State TaskInfoState `xml:"state"` + Result AnyType `xml:"result,omitempty,typeattr"` + Fault *LocalizedMethodFault `xml:"fault,omitempty"` +} + +func init() { + t["SetTaskStateRequestType"] = reflect.TypeOf((*SetTaskStateRequestType)(nil)).Elem() +} + +type SetTaskStateResponse struct { +} + +type SetVirtualDiskUuid SetVirtualDiskUuidRequestType + +func init() { + t["SetVirtualDiskUuid"] = reflect.TypeOf((*SetVirtualDiskUuid)(nil)).Elem() +} + +type SetVirtualDiskUuidRequestType struct { + This ManagedObjectReference `xml:"_this"` + Name string `xml:"name"` + Datacenter *ManagedObjectReference `xml:"datacenter,omitempty"` + Uuid string `xml:"uuid"` +} + +func init() { + t["SetVirtualDiskUuidRequestType"] = reflect.TypeOf((*SetVirtualDiskUuidRequestType)(nil)).Elem() +} + +type SetVirtualDiskUuidResponse struct { +} + +type SharedBusControllerNotSupported struct { + DeviceNotSupported +} + +func init() { + t["SharedBusControllerNotSupported"] = reflect.TypeOf((*SharedBusControllerNotSupported)(nil)).Elem() +} + +type SharedBusControllerNotSupportedFault SharedBusControllerNotSupported + +func init() { + t["SharedBusControllerNotSupportedFault"] = reflect.TypeOf((*SharedBusControllerNotSupportedFault)(nil)).Elem() +} + +type SharesInfo struct { + DynamicData + + Shares int32 `xml:"shares"` + Level SharesLevel `xml:"level"` +} + +func init() { + t["SharesInfo"] = reflect.TypeOf((*SharesInfo)(nil)).Elem() +} + +type SharesOption struct { + DynamicData + + SharesOption IntOption `xml:"sharesOption"` + DefaultLevel SharesLevel `xml:"defaultLevel"` +} + +func init() { + t["SharesOption"] = reflect.TypeOf((*SharesOption)(nil)).Elem() +} + +type ShrinkDiskFault struct { + VimFault + + DiskId int32 `xml:"diskId,omitempty"` +} + +func init() { + t["ShrinkDiskFault"] = reflect.TypeOf((*ShrinkDiskFault)(nil)).Elem() +} + +type ShrinkDiskFaultFault ShrinkDiskFault + +func init() { + t["ShrinkDiskFaultFault"] = reflect.TypeOf((*ShrinkDiskFaultFault)(nil)).Elem() +} + +type ShrinkVirtualDiskRequestType struct { + This ManagedObjectReference `xml:"_this"` + Name string `xml:"name"` + Datacenter *ManagedObjectReference `xml:"datacenter,omitempty"` + Copy *bool `xml:"copy"` +} + +func init() { + t["ShrinkVirtualDiskRequestType"] = reflect.TypeOf((*ShrinkVirtualDiskRequestType)(nil)).Elem() +} + +type ShrinkVirtualDisk_Task ShrinkVirtualDiskRequestType + +func init() { + t["ShrinkVirtualDisk_Task"] = reflect.TypeOf((*ShrinkVirtualDisk_Task)(nil)).Elem() +} + +type ShrinkVirtualDisk_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type ShutdownGuest ShutdownGuestRequestType + +func init() { + t["ShutdownGuest"] = reflect.TypeOf((*ShutdownGuest)(nil)).Elem() +} + +type ShutdownGuestRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["ShutdownGuestRequestType"] = reflect.TypeOf((*ShutdownGuestRequestType)(nil)).Elem() +} + +type ShutdownGuestResponse struct { +} + +type ShutdownHostRequestType struct { + This ManagedObjectReference `xml:"_this"` + Force bool `xml:"force"` +} + +func init() { + t["ShutdownHostRequestType"] = reflect.TypeOf((*ShutdownHostRequestType)(nil)).Elem() +} + +type ShutdownHost_Task ShutdownHostRequestType + +func init() { + t["ShutdownHost_Task"] = reflect.TypeOf((*ShutdownHost_Task)(nil)).Elem() +} + +type ShutdownHost_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type SingleIp struct { + IpAddress + + Address string `xml:"address"` +} + +func init() { + t["SingleIp"] = reflect.TypeOf((*SingleIp)(nil)).Elem() +} + +type SingleMac struct { + MacAddress + + Address string `xml:"address"` +} + +func init() { + t["SingleMac"] = reflect.TypeOf((*SingleMac)(nil)).Elem() +} + +type SnapshotCloneNotSupported struct { + SnapshotCopyNotSupported +} + +func init() { + t["SnapshotCloneNotSupported"] = reflect.TypeOf((*SnapshotCloneNotSupported)(nil)).Elem() +} + +type SnapshotCloneNotSupportedFault SnapshotCloneNotSupported + +func init() { + t["SnapshotCloneNotSupportedFault"] = reflect.TypeOf((*SnapshotCloneNotSupportedFault)(nil)).Elem() +} + +type SnapshotCopyNotSupported struct { + MigrationFault +} + +func init() { + t["SnapshotCopyNotSupported"] = reflect.TypeOf((*SnapshotCopyNotSupported)(nil)).Elem() +} + +type SnapshotCopyNotSupportedFault BaseSnapshotCopyNotSupported + +func init() { + t["SnapshotCopyNotSupportedFault"] = reflect.TypeOf((*SnapshotCopyNotSupportedFault)(nil)).Elem() +} + +type SnapshotDisabled struct { + SnapshotFault +} + +func init() { + t["SnapshotDisabled"] = reflect.TypeOf((*SnapshotDisabled)(nil)).Elem() +} + +type SnapshotDisabledFault SnapshotDisabled + +func init() { + t["SnapshotDisabledFault"] = reflect.TypeOf((*SnapshotDisabledFault)(nil)).Elem() +} + +type SnapshotFault struct { + VimFault +} + +func init() { + t["SnapshotFault"] = reflect.TypeOf((*SnapshotFault)(nil)).Elem() +} + +type SnapshotFaultFault BaseSnapshotFault + +func init() { + t["SnapshotFaultFault"] = reflect.TypeOf((*SnapshotFaultFault)(nil)).Elem() +} + +type SnapshotIncompatibleDeviceInVm struct { + SnapshotFault + + Fault LocalizedMethodFault `xml:"fault"` +} + +func init() { + t["SnapshotIncompatibleDeviceInVm"] = reflect.TypeOf((*SnapshotIncompatibleDeviceInVm)(nil)).Elem() +} + +type SnapshotIncompatibleDeviceInVmFault SnapshotIncompatibleDeviceInVm + +func init() { + t["SnapshotIncompatibleDeviceInVmFault"] = reflect.TypeOf((*SnapshotIncompatibleDeviceInVmFault)(nil)).Elem() +} + +type SnapshotLocked struct { + SnapshotFault +} + +func init() { + t["SnapshotLocked"] = reflect.TypeOf((*SnapshotLocked)(nil)).Elem() +} + +type SnapshotLockedFault SnapshotLocked + +func init() { + t["SnapshotLockedFault"] = reflect.TypeOf((*SnapshotLockedFault)(nil)).Elem() +} + +type SnapshotMoveFromNonHomeNotSupported struct { + SnapshotCopyNotSupported +} + +func init() { + t["SnapshotMoveFromNonHomeNotSupported"] = reflect.TypeOf((*SnapshotMoveFromNonHomeNotSupported)(nil)).Elem() +} + +type SnapshotMoveFromNonHomeNotSupportedFault SnapshotMoveFromNonHomeNotSupported + +func init() { + t["SnapshotMoveFromNonHomeNotSupportedFault"] = reflect.TypeOf((*SnapshotMoveFromNonHomeNotSupportedFault)(nil)).Elem() +} + +type SnapshotMoveNotSupported struct { + SnapshotCopyNotSupported +} + +func init() { + t["SnapshotMoveNotSupported"] = reflect.TypeOf((*SnapshotMoveNotSupported)(nil)).Elem() +} + +type SnapshotMoveNotSupportedFault SnapshotMoveNotSupported + +func init() { + t["SnapshotMoveNotSupportedFault"] = reflect.TypeOf((*SnapshotMoveNotSupportedFault)(nil)).Elem() +} + +type SnapshotMoveToNonHomeNotSupported struct { + SnapshotCopyNotSupported +} + +func init() { + t["SnapshotMoveToNonHomeNotSupported"] = reflect.TypeOf((*SnapshotMoveToNonHomeNotSupported)(nil)).Elem() +} + +type SnapshotMoveToNonHomeNotSupportedFault SnapshotMoveToNonHomeNotSupported + +func init() { + t["SnapshotMoveToNonHomeNotSupportedFault"] = reflect.TypeOf((*SnapshotMoveToNonHomeNotSupportedFault)(nil)).Elem() +} + +type SnapshotNoChange struct { + SnapshotFault +} + +func init() { + t["SnapshotNoChange"] = reflect.TypeOf((*SnapshotNoChange)(nil)).Elem() +} + +type SnapshotNoChangeFault SnapshotNoChange + +func init() { + t["SnapshotNoChangeFault"] = reflect.TypeOf((*SnapshotNoChangeFault)(nil)).Elem() +} + +type SnapshotRevertIssue struct { + MigrationFault + + SnapshotName string `xml:"snapshotName,omitempty"` + Event []BaseEvent `xml:"event,omitempty,typeattr"` + Errors bool `xml:"errors"` +} + +func init() { + t["SnapshotRevertIssue"] = reflect.TypeOf((*SnapshotRevertIssue)(nil)).Elem() +} + +type SnapshotRevertIssueFault SnapshotRevertIssue + +func init() { + t["SnapshotRevertIssueFault"] = reflect.TypeOf((*SnapshotRevertIssueFault)(nil)).Elem() +} + +type SoftRuleVioCorrectionDisallowed struct { + VmConfigFault + + VmName string `xml:"vmName"` +} + +func init() { + t["SoftRuleVioCorrectionDisallowed"] = reflect.TypeOf((*SoftRuleVioCorrectionDisallowed)(nil)).Elem() +} + +type SoftRuleVioCorrectionDisallowedFault SoftRuleVioCorrectionDisallowed + +func init() { + t["SoftRuleVioCorrectionDisallowedFault"] = reflect.TypeOf((*SoftRuleVioCorrectionDisallowedFault)(nil)).Elem() +} + +type SoftRuleVioCorrectionImpact struct { + VmConfigFault + + VmName string `xml:"vmName"` +} + +func init() { + t["SoftRuleVioCorrectionImpact"] = reflect.TypeOf((*SoftRuleVioCorrectionImpact)(nil)).Elem() +} + +type SoftRuleVioCorrectionImpactFault SoftRuleVioCorrectionImpact + +func init() { + t["SoftRuleVioCorrectionImpactFault"] = reflect.TypeOf((*SoftRuleVioCorrectionImpactFault)(nil)).Elem() +} + +type SsdDiskNotAvailable struct { + VimFault + + DevicePath string `xml:"devicePath"` +} + +func init() { + t["SsdDiskNotAvailable"] = reflect.TypeOf((*SsdDiskNotAvailable)(nil)).Elem() +} + +type SsdDiskNotAvailableFault SsdDiskNotAvailable + +func init() { + t["SsdDiskNotAvailableFault"] = reflect.TypeOf((*SsdDiskNotAvailableFault)(nil)).Elem() +} + +type StageHostPatchRequestType struct { + This ManagedObjectReference `xml:"_this"` + MetaUrls []string `xml:"metaUrls,omitempty"` + BundleUrls []string `xml:"bundleUrls,omitempty"` + VibUrls []string `xml:"vibUrls,omitempty"` + Spec *HostPatchManagerPatchManagerOperationSpec `xml:"spec,omitempty"` +} + +func init() { + t["StageHostPatchRequestType"] = reflect.TypeOf((*StageHostPatchRequestType)(nil)).Elem() +} + +type StageHostPatch_Task StageHostPatchRequestType + +func init() { + t["StageHostPatch_Task"] = reflect.TypeOf((*StageHostPatch_Task)(nil)).Elem() +} + +type StageHostPatch_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type StampAllRulesWithUuidRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["StampAllRulesWithUuidRequestType"] = reflect.TypeOf((*StampAllRulesWithUuidRequestType)(nil)).Elem() +} + +type StampAllRulesWithUuid_Task StampAllRulesWithUuidRequestType + +func init() { + t["StampAllRulesWithUuid_Task"] = reflect.TypeOf((*StampAllRulesWithUuid_Task)(nil)).Elem() +} + +type StampAllRulesWithUuid_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type StandbyGuest StandbyGuestRequestType + +func init() { + t["StandbyGuest"] = reflect.TypeOf((*StandbyGuest)(nil)).Elem() +} + +type StandbyGuestRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["StandbyGuestRequestType"] = reflect.TypeOf((*StandbyGuestRequestType)(nil)).Elem() +} + +type StandbyGuestResponse struct { +} + +type StartProgramInGuest StartProgramInGuestRequestType + +func init() { + t["StartProgramInGuest"] = reflect.TypeOf((*StartProgramInGuest)(nil)).Elem() +} + +type StartProgramInGuestRequestType struct { + This ManagedObjectReference `xml:"_this"` + Vm ManagedObjectReference `xml:"vm"` + Auth BaseGuestAuthentication `xml:"auth,typeattr"` + Spec BaseGuestProgramSpec `xml:"spec,typeattr"` +} + +func init() { + t["StartProgramInGuestRequestType"] = reflect.TypeOf((*StartProgramInGuestRequestType)(nil)).Elem() +} + +type StartProgramInGuestResponse struct { + Returnval int64 `xml:"returnval"` +} + +type StartRecordingRequestType struct { + This ManagedObjectReference `xml:"_this"` + Name string `xml:"name"` + Description string `xml:"description,omitempty"` +} + +func init() { + t["StartRecordingRequestType"] = reflect.TypeOf((*StartRecordingRequestType)(nil)).Elem() +} + +type StartRecording_Task StartRecordingRequestType + +func init() { + t["StartRecording_Task"] = reflect.TypeOf((*StartRecording_Task)(nil)).Elem() +} + +type StartRecording_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type StartReplayingRequestType struct { + This ManagedObjectReference `xml:"_this"` + ReplaySnapshot ManagedObjectReference `xml:"replaySnapshot"` +} + +func init() { + t["StartReplayingRequestType"] = reflect.TypeOf((*StartReplayingRequestType)(nil)).Elem() +} + +type StartReplaying_Task StartReplayingRequestType + +func init() { + t["StartReplaying_Task"] = reflect.TypeOf((*StartReplaying_Task)(nil)).Elem() +} + +type StartReplaying_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type StartService StartServiceRequestType + +func init() { + t["StartService"] = reflect.TypeOf((*StartService)(nil)).Elem() +} + +type StartServiceRequestType struct { + This ManagedObjectReference `xml:"_this"` + Id string `xml:"id"` +} + +func init() { + t["StartServiceRequestType"] = reflect.TypeOf((*StartServiceRequestType)(nil)).Elem() +} + +type StartServiceResponse struct { +} + +type StateAlarmExpression struct { + AlarmExpression + + Operator StateAlarmOperator `xml:"operator"` + Type string `xml:"type"` + StatePath string `xml:"statePath"` + Yellow string `xml:"yellow,omitempty"` + Red string `xml:"red,omitempty"` +} + +func init() { + t["StateAlarmExpression"] = reflect.TypeOf((*StateAlarmExpression)(nil)).Elem() +} + +type StaticRouteProfile struct { + ApplyProfile + + Key string `xml:"key,omitempty"` +} + +func init() { + t["StaticRouteProfile"] = reflect.TypeOf((*StaticRouteProfile)(nil)).Elem() +} + +type StopRecordingRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["StopRecordingRequestType"] = reflect.TypeOf((*StopRecordingRequestType)(nil)).Elem() +} + +type StopRecording_Task StopRecordingRequestType + +func init() { + t["StopRecording_Task"] = reflect.TypeOf((*StopRecording_Task)(nil)).Elem() +} + +type StopRecording_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type StopReplayingRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["StopReplayingRequestType"] = reflect.TypeOf((*StopReplayingRequestType)(nil)).Elem() +} + +type StopReplaying_Task StopReplayingRequestType + +func init() { + t["StopReplaying_Task"] = reflect.TypeOf((*StopReplaying_Task)(nil)).Elem() +} + +type StopReplaying_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type StopService StopServiceRequestType + +func init() { + t["StopService"] = reflect.TypeOf((*StopService)(nil)).Elem() +} + +type StopServiceRequestType struct { + This ManagedObjectReference `xml:"_this"` + Id string `xml:"id"` +} + +func init() { + t["StopServiceRequestType"] = reflect.TypeOf((*StopServiceRequestType)(nil)).Elem() +} + +type StopServiceResponse struct { +} + +type StorageDrsAutomationConfig struct { + DynamicData + + SpaceLoadBalanceAutomationMode string `xml:"spaceLoadBalanceAutomationMode,omitempty"` + IoLoadBalanceAutomationMode string `xml:"ioLoadBalanceAutomationMode,omitempty"` + RuleEnforcementAutomationMode string `xml:"ruleEnforcementAutomationMode,omitempty"` + PolicyEnforcementAutomationMode string `xml:"policyEnforcementAutomationMode,omitempty"` + VmEvacuationAutomationMode string `xml:"vmEvacuationAutomationMode,omitempty"` +} + +func init() { + t["StorageDrsAutomationConfig"] = reflect.TypeOf((*StorageDrsAutomationConfig)(nil)).Elem() +} + +type StorageDrsCannotMoveDiskInMultiWriterMode struct { + VimFault +} + +func init() { + t["StorageDrsCannotMoveDiskInMultiWriterMode"] = reflect.TypeOf((*StorageDrsCannotMoveDiskInMultiWriterMode)(nil)).Elem() +} + +type StorageDrsCannotMoveDiskInMultiWriterModeFault StorageDrsCannotMoveDiskInMultiWriterMode + +func init() { + t["StorageDrsCannotMoveDiskInMultiWriterModeFault"] = reflect.TypeOf((*StorageDrsCannotMoveDiskInMultiWriterModeFault)(nil)).Elem() +} + +type StorageDrsCannotMoveFTVm struct { + VimFault +} + +func init() { + t["StorageDrsCannotMoveFTVm"] = reflect.TypeOf((*StorageDrsCannotMoveFTVm)(nil)).Elem() +} + +type StorageDrsCannotMoveFTVmFault StorageDrsCannotMoveFTVm + +func init() { + t["StorageDrsCannotMoveFTVmFault"] = reflect.TypeOf((*StorageDrsCannotMoveFTVmFault)(nil)).Elem() +} + +type StorageDrsCannotMoveIndependentDisk struct { + VimFault +} + +func init() { + t["StorageDrsCannotMoveIndependentDisk"] = reflect.TypeOf((*StorageDrsCannotMoveIndependentDisk)(nil)).Elem() +} + +type StorageDrsCannotMoveIndependentDiskFault StorageDrsCannotMoveIndependentDisk + +func init() { + t["StorageDrsCannotMoveIndependentDiskFault"] = reflect.TypeOf((*StorageDrsCannotMoveIndependentDiskFault)(nil)).Elem() +} + +type StorageDrsCannotMoveManuallyPlacedSwapFile struct { + VimFault +} + +func init() { + t["StorageDrsCannotMoveManuallyPlacedSwapFile"] = reflect.TypeOf((*StorageDrsCannotMoveManuallyPlacedSwapFile)(nil)).Elem() +} + +type StorageDrsCannotMoveManuallyPlacedSwapFileFault StorageDrsCannotMoveManuallyPlacedSwapFile + +func init() { + t["StorageDrsCannotMoveManuallyPlacedSwapFileFault"] = reflect.TypeOf((*StorageDrsCannotMoveManuallyPlacedSwapFileFault)(nil)).Elem() +} + +type StorageDrsCannotMoveManuallyPlacedVm struct { + VimFault +} + +func init() { + t["StorageDrsCannotMoveManuallyPlacedVm"] = reflect.TypeOf((*StorageDrsCannotMoveManuallyPlacedVm)(nil)).Elem() +} + +type StorageDrsCannotMoveManuallyPlacedVmFault StorageDrsCannotMoveManuallyPlacedVm + +func init() { + t["StorageDrsCannotMoveManuallyPlacedVmFault"] = reflect.TypeOf((*StorageDrsCannotMoveManuallyPlacedVmFault)(nil)).Elem() +} + +type StorageDrsCannotMoveSharedDisk struct { + VimFault +} + +func init() { + t["StorageDrsCannotMoveSharedDisk"] = reflect.TypeOf((*StorageDrsCannotMoveSharedDisk)(nil)).Elem() +} + +type StorageDrsCannotMoveSharedDiskFault StorageDrsCannotMoveSharedDisk + +func init() { + t["StorageDrsCannotMoveSharedDiskFault"] = reflect.TypeOf((*StorageDrsCannotMoveSharedDiskFault)(nil)).Elem() +} + +type StorageDrsCannotMoveTemplate struct { + VimFault +} + +func init() { + t["StorageDrsCannotMoveTemplate"] = reflect.TypeOf((*StorageDrsCannotMoveTemplate)(nil)).Elem() +} + +type StorageDrsCannotMoveTemplateFault StorageDrsCannotMoveTemplate + +func init() { + t["StorageDrsCannotMoveTemplateFault"] = reflect.TypeOf((*StorageDrsCannotMoveTemplateFault)(nil)).Elem() +} + +type StorageDrsCannotMoveVmInUserFolder struct { + VimFault +} + +func init() { + t["StorageDrsCannotMoveVmInUserFolder"] = reflect.TypeOf((*StorageDrsCannotMoveVmInUserFolder)(nil)).Elem() +} + +type StorageDrsCannotMoveVmInUserFolderFault StorageDrsCannotMoveVmInUserFolder + +func init() { + t["StorageDrsCannotMoveVmInUserFolderFault"] = reflect.TypeOf((*StorageDrsCannotMoveVmInUserFolderFault)(nil)).Elem() +} + +type StorageDrsCannotMoveVmWithMountedCDROM struct { + VimFault +} + +func init() { + t["StorageDrsCannotMoveVmWithMountedCDROM"] = reflect.TypeOf((*StorageDrsCannotMoveVmWithMountedCDROM)(nil)).Elem() +} + +type StorageDrsCannotMoveVmWithMountedCDROMFault StorageDrsCannotMoveVmWithMountedCDROM + +func init() { + t["StorageDrsCannotMoveVmWithMountedCDROMFault"] = reflect.TypeOf((*StorageDrsCannotMoveVmWithMountedCDROMFault)(nil)).Elem() +} + +type StorageDrsCannotMoveVmWithNoFilesInLayout struct { + VimFault +} + +func init() { + t["StorageDrsCannotMoveVmWithNoFilesInLayout"] = reflect.TypeOf((*StorageDrsCannotMoveVmWithNoFilesInLayout)(nil)).Elem() +} + +type StorageDrsCannotMoveVmWithNoFilesInLayoutFault StorageDrsCannotMoveVmWithNoFilesInLayout + +func init() { + t["StorageDrsCannotMoveVmWithNoFilesInLayoutFault"] = reflect.TypeOf((*StorageDrsCannotMoveVmWithNoFilesInLayoutFault)(nil)).Elem() +} + +type StorageDrsConfigInfo struct { + DynamicData + + PodConfig StorageDrsPodConfigInfo `xml:"podConfig"` + VmConfig []StorageDrsVmConfigInfo `xml:"vmConfig,omitempty"` +} + +func init() { + t["StorageDrsConfigInfo"] = reflect.TypeOf((*StorageDrsConfigInfo)(nil)).Elem() +} + +type StorageDrsConfigSpec struct { + DynamicData + + PodConfigSpec *StorageDrsPodConfigSpec `xml:"podConfigSpec,omitempty"` + VmConfigSpec []StorageDrsVmConfigSpec `xml:"vmConfigSpec,omitempty"` +} + +func init() { + t["StorageDrsConfigSpec"] = reflect.TypeOf((*StorageDrsConfigSpec)(nil)).Elem() +} + +type StorageDrsDatacentersCannotShareDatastore struct { + VimFault +} + +func init() { + t["StorageDrsDatacentersCannotShareDatastore"] = reflect.TypeOf((*StorageDrsDatacentersCannotShareDatastore)(nil)).Elem() +} + +type StorageDrsDatacentersCannotShareDatastoreFault StorageDrsDatacentersCannotShareDatastore + +func init() { + t["StorageDrsDatacentersCannotShareDatastoreFault"] = reflect.TypeOf((*StorageDrsDatacentersCannotShareDatastoreFault)(nil)).Elem() +} + +type StorageDrsDisabledOnVm struct { + VimFault +} + +func init() { + t["StorageDrsDisabledOnVm"] = reflect.TypeOf((*StorageDrsDisabledOnVm)(nil)).Elem() +} + +type StorageDrsDisabledOnVmFault StorageDrsDisabledOnVm + +func init() { + t["StorageDrsDisabledOnVmFault"] = reflect.TypeOf((*StorageDrsDisabledOnVmFault)(nil)).Elem() +} + +type StorageDrsHbrDiskNotMovable struct { + VimFault + + NonMovableDiskIds string `xml:"nonMovableDiskIds"` +} + +func init() { + t["StorageDrsHbrDiskNotMovable"] = reflect.TypeOf((*StorageDrsHbrDiskNotMovable)(nil)).Elem() +} + +type StorageDrsHbrDiskNotMovableFault StorageDrsHbrDiskNotMovable + +func init() { + t["StorageDrsHbrDiskNotMovableFault"] = reflect.TypeOf((*StorageDrsHbrDiskNotMovableFault)(nil)).Elem() +} + +type StorageDrsHmsMoveInProgress struct { + VimFault +} + +func init() { + t["StorageDrsHmsMoveInProgress"] = reflect.TypeOf((*StorageDrsHmsMoveInProgress)(nil)).Elem() +} + +type StorageDrsHmsMoveInProgressFault StorageDrsHmsMoveInProgress + +func init() { + t["StorageDrsHmsMoveInProgressFault"] = reflect.TypeOf((*StorageDrsHmsMoveInProgressFault)(nil)).Elem() +} + +type StorageDrsHmsUnreachable struct { + VimFault +} + +func init() { + t["StorageDrsHmsUnreachable"] = reflect.TypeOf((*StorageDrsHmsUnreachable)(nil)).Elem() +} + +type StorageDrsHmsUnreachableFault StorageDrsHmsUnreachable + +func init() { + t["StorageDrsHmsUnreachableFault"] = reflect.TypeOf((*StorageDrsHmsUnreachableFault)(nil)).Elem() +} + +type StorageDrsIoLoadBalanceConfig struct { + DynamicData + + ReservablePercentThreshold int32 `xml:"reservablePercentThreshold,omitempty"` + ReservableIopsThreshold int32 `xml:"reservableIopsThreshold,omitempty"` + ReservableThresholdMode string `xml:"reservableThresholdMode,omitempty"` + IoLatencyThreshold int32 `xml:"ioLatencyThreshold,omitempty"` + IoLoadImbalanceThreshold int32 `xml:"ioLoadImbalanceThreshold,omitempty"` +} + +func init() { + t["StorageDrsIoLoadBalanceConfig"] = reflect.TypeOf((*StorageDrsIoLoadBalanceConfig)(nil)).Elem() +} + +type StorageDrsIolbDisabledInternally struct { + VimFault +} + +func init() { + t["StorageDrsIolbDisabledInternally"] = reflect.TypeOf((*StorageDrsIolbDisabledInternally)(nil)).Elem() +} + +type StorageDrsIolbDisabledInternallyFault StorageDrsIolbDisabledInternally + +func init() { + t["StorageDrsIolbDisabledInternallyFault"] = reflect.TypeOf((*StorageDrsIolbDisabledInternallyFault)(nil)).Elem() +} + +type StorageDrsOptionSpec struct { + ArrayUpdateSpec + + Option BaseOptionValue `xml:"option,omitempty,typeattr"` +} + +func init() { + t["StorageDrsOptionSpec"] = reflect.TypeOf((*StorageDrsOptionSpec)(nil)).Elem() +} + +type StorageDrsPlacementRankVmSpec struct { + DynamicData + + VmPlacementSpec PlacementSpec `xml:"vmPlacementSpec"` + VmClusters []ManagedObjectReference `xml:"vmClusters"` +} + +func init() { + t["StorageDrsPlacementRankVmSpec"] = reflect.TypeOf((*StorageDrsPlacementRankVmSpec)(nil)).Elem() +} + +type StorageDrsPodConfigInfo struct { + DynamicData + + Enabled bool `xml:"enabled"` + IoLoadBalanceEnabled bool `xml:"ioLoadBalanceEnabled"` + DefaultVmBehavior string `xml:"defaultVmBehavior"` + LoadBalanceInterval int32 `xml:"loadBalanceInterval,omitempty"` + DefaultIntraVmAffinity *bool `xml:"defaultIntraVmAffinity"` + SpaceLoadBalanceConfig *StorageDrsSpaceLoadBalanceConfig `xml:"spaceLoadBalanceConfig,omitempty"` + IoLoadBalanceConfig *StorageDrsIoLoadBalanceConfig `xml:"ioLoadBalanceConfig,omitempty"` + AutomationOverrides *StorageDrsAutomationConfig `xml:"automationOverrides,omitempty"` + Rule []BaseClusterRuleInfo `xml:"rule,omitempty,typeattr"` + Option []BaseOptionValue `xml:"option,omitempty,typeattr"` +} + +func init() { + t["StorageDrsPodConfigInfo"] = reflect.TypeOf((*StorageDrsPodConfigInfo)(nil)).Elem() +} + +type StorageDrsPodConfigSpec struct { + DynamicData + + Enabled *bool `xml:"enabled"` + IoLoadBalanceEnabled *bool `xml:"ioLoadBalanceEnabled"` + DefaultVmBehavior string `xml:"defaultVmBehavior,omitempty"` + LoadBalanceInterval int32 `xml:"loadBalanceInterval,omitempty"` + DefaultIntraVmAffinity *bool `xml:"defaultIntraVmAffinity"` + SpaceLoadBalanceConfig *StorageDrsSpaceLoadBalanceConfig `xml:"spaceLoadBalanceConfig,omitempty"` + IoLoadBalanceConfig *StorageDrsIoLoadBalanceConfig `xml:"ioLoadBalanceConfig,omitempty"` + AutomationOverrides *StorageDrsAutomationConfig `xml:"automationOverrides,omitempty"` + Rule []ClusterRuleSpec `xml:"rule,omitempty"` + Option []StorageDrsOptionSpec `xml:"option,omitempty"` +} + +func init() { + t["StorageDrsPodConfigSpec"] = reflect.TypeOf((*StorageDrsPodConfigSpec)(nil)).Elem() +} + +type StorageDrsPodSelectionSpec struct { + DynamicData + + InitialVmConfig []VmPodConfigForPlacement `xml:"initialVmConfig,omitempty"` + StoragePod *ManagedObjectReference `xml:"storagePod,omitempty"` +} + +func init() { + t["StorageDrsPodSelectionSpec"] = reflect.TypeOf((*StorageDrsPodSelectionSpec)(nil)).Elem() +} + +type StorageDrsRelocateDisabled struct { + VimFault +} + +func init() { + t["StorageDrsRelocateDisabled"] = reflect.TypeOf((*StorageDrsRelocateDisabled)(nil)).Elem() +} + +type StorageDrsRelocateDisabledFault StorageDrsRelocateDisabled + +func init() { + t["StorageDrsRelocateDisabledFault"] = reflect.TypeOf((*StorageDrsRelocateDisabledFault)(nil)).Elem() +} + +type StorageDrsSpaceLoadBalanceConfig struct { + DynamicData + + SpaceThresholdMode string `xml:"spaceThresholdMode,omitempty"` + SpaceUtilizationThreshold int32 `xml:"spaceUtilizationThreshold,omitempty"` + FreeSpaceThresholdGB int32 `xml:"freeSpaceThresholdGB,omitempty"` + MinSpaceUtilizationDifference int32 `xml:"minSpaceUtilizationDifference,omitempty"` +} + +func init() { + t["StorageDrsSpaceLoadBalanceConfig"] = reflect.TypeOf((*StorageDrsSpaceLoadBalanceConfig)(nil)).Elem() +} + +type StorageDrsStaleHmsCollection struct { + VimFault +} + +func init() { + t["StorageDrsStaleHmsCollection"] = reflect.TypeOf((*StorageDrsStaleHmsCollection)(nil)).Elem() +} + +type StorageDrsStaleHmsCollectionFault StorageDrsStaleHmsCollection + +func init() { + t["StorageDrsStaleHmsCollectionFault"] = reflect.TypeOf((*StorageDrsStaleHmsCollectionFault)(nil)).Elem() +} + +type StorageDrsUnableToMoveFiles struct { + VimFault +} + +func init() { + t["StorageDrsUnableToMoveFiles"] = reflect.TypeOf((*StorageDrsUnableToMoveFiles)(nil)).Elem() +} + +type StorageDrsUnableToMoveFilesFault StorageDrsUnableToMoveFiles + +func init() { + t["StorageDrsUnableToMoveFilesFault"] = reflect.TypeOf((*StorageDrsUnableToMoveFilesFault)(nil)).Elem() +} + +type StorageDrsVmConfigInfo struct { + DynamicData + + Vm *ManagedObjectReference `xml:"vm,omitempty"` + Enabled *bool `xml:"enabled"` + Behavior string `xml:"behavior,omitempty"` + IntraVmAffinity *bool `xml:"intraVmAffinity"` + IntraVmAntiAffinity *VirtualDiskAntiAffinityRuleSpec `xml:"intraVmAntiAffinity,omitempty"` +} + +func init() { + t["StorageDrsVmConfigInfo"] = reflect.TypeOf((*StorageDrsVmConfigInfo)(nil)).Elem() +} + +type StorageDrsVmConfigSpec struct { + ArrayUpdateSpec + + Info *StorageDrsVmConfigInfo `xml:"info,omitempty"` +} + +func init() { + t["StorageDrsVmConfigSpec"] = reflect.TypeOf((*StorageDrsVmConfigSpec)(nil)).Elem() +} + +type StorageIOAllocationInfo struct { + DynamicData + + Limit int64 `xml:"limit,omitempty"` + Shares *SharesInfo `xml:"shares,omitempty"` + Reservation int32 `xml:"reservation,omitempty"` +} + +func init() { + t["StorageIOAllocationInfo"] = reflect.TypeOf((*StorageIOAllocationInfo)(nil)).Elem() +} + +type StorageIOAllocationOption struct { + DynamicData + + LimitOption LongOption `xml:"limitOption"` + SharesOption SharesOption `xml:"sharesOption"` +} + +func init() { + t["StorageIOAllocationOption"] = reflect.TypeOf((*StorageIOAllocationOption)(nil)).Elem() +} + +type StorageIORMConfigOption struct { + DynamicData + + EnabledOption BoolOption `xml:"enabledOption"` + CongestionThresholdOption IntOption `xml:"congestionThresholdOption"` + StatsCollectionEnabledOption *BoolOption `xml:"statsCollectionEnabledOption,omitempty"` + ReservationEnabledOption *BoolOption `xml:"reservationEnabledOption,omitempty"` +} + +func init() { + t["StorageIORMConfigOption"] = reflect.TypeOf((*StorageIORMConfigOption)(nil)).Elem() +} + +type StorageIORMConfigSpec struct { + DynamicData + + Enabled *bool `xml:"enabled"` + CongestionThresholdMode string `xml:"congestionThresholdMode,omitempty"` + CongestionThreshold int32 `xml:"congestionThreshold,omitempty"` + PercentOfPeakThroughput int32 `xml:"percentOfPeakThroughput,omitempty"` + StatsCollectionEnabled *bool `xml:"statsCollectionEnabled"` + ReservationEnabled *bool `xml:"reservationEnabled"` + StatsAggregationDisabled *bool `xml:"statsAggregationDisabled"` + ReservableIopsThreshold int32 `xml:"reservableIopsThreshold,omitempty"` +} + +func init() { + t["StorageIORMConfigSpec"] = reflect.TypeOf((*StorageIORMConfigSpec)(nil)).Elem() +} + +type StorageIORMInfo struct { + DynamicData + + Enabled bool `xml:"enabled"` + CongestionThresholdMode string `xml:"congestionThresholdMode,omitempty"` + CongestionThreshold int32 `xml:"congestionThreshold"` + PercentOfPeakThroughput int32 `xml:"percentOfPeakThroughput,omitempty"` + StatsCollectionEnabled *bool `xml:"statsCollectionEnabled"` + ReservationEnabled *bool `xml:"reservationEnabled"` + StatsAggregationDisabled *bool `xml:"statsAggregationDisabled"` + ReservableIopsThreshold int32 `xml:"reservableIopsThreshold,omitempty"` +} + +func init() { + t["StorageIORMInfo"] = reflect.TypeOf((*StorageIORMInfo)(nil)).Elem() +} + +type StorageMigrationAction struct { + ClusterAction + + Vm ManagedObjectReference `xml:"vm"` + RelocateSpec VirtualMachineRelocateSpec `xml:"relocateSpec"` + Source ManagedObjectReference `xml:"source"` + Destination ManagedObjectReference `xml:"destination"` + SizeTransferred int64 `xml:"sizeTransferred"` + SpaceUtilSrcBefore float32 `xml:"spaceUtilSrcBefore,omitempty"` + SpaceUtilDstBefore float32 `xml:"spaceUtilDstBefore,omitempty"` + SpaceUtilSrcAfter float32 `xml:"spaceUtilSrcAfter,omitempty"` + SpaceUtilDstAfter float32 `xml:"spaceUtilDstAfter,omitempty"` + IoLatencySrcBefore float32 `xml:"ioLatencySrcBefore,omitempty"` + IoLatencyDstBefore float32 `xml:"ioLatencyDstBefore,omitempty"` +} + +func init() { + t["StorageMigrationAction"] = reflect.TypeOf((*StorageMigrationAction)(nil)).Elem() +} + +type StoragePerformanceSummary struct { + DynamicData + + Interval int32 `xml:"interval"` + Percentile []int32 `xml:"percentile"` + DatastoreReadLatency []float64 `xml:"datastoreReadLatency"` + DatastoreWriteLatency []float64 `xml:"datastoreWriteLatency"` + DatastoreVmLatency []float64 `xml:"datastoreVmLatency"` + DatastoreReadIops []float64 `xml:"datastoreReadIops"` + DatastoreWriteIops []float64 `xml:"datastoreWriteIops"` + SiocActivityDuration int32 `xml:"siocActivityDuration"` +} + +func init() { + t["StoragePerformanceSummary"] = reflect.TypeOf((*StoragePerformanceSummary)(nil)).Elem() +} + +type StoragePlacementAction struct { + ClusterAction + + Vm *ManagedObjectReference `xml:"vm,omitempty"` + RelocateSpec VirtualMachineRelocateSpec `xml:"relocateSpec"` + Destination ManagedObjectReference `xml:"destination"` + SpaceUtilBefore float32 `xml:"spaceUtilBefore,omitempty"` + SpaceDemandBefore float32 `xml:"spaceDemandBefore,omitempty"` + SpaceUtilAfter float32 `xml:"spaceUtilAfter,omitempty"` + SpaceDemandAfter float32 `xml:"spaceDemandAfter,omitempty"` + IoLatencyBefore float32 `xml:"ioLatencyBefore,omitempty"` +} + +func init() { + t["StoragePlacementAction"] = reflect.TypeOf((*StoragePlacementAction)(nil)).Elem() +} + +type StoragePlacementResult struct { + DynamicData + + Recommendations []ClusterRecommendation `xml:"recommendations,omitempty"` + DrsFault *ClusterDrsFaults `xml:"drsFault,omitempty"` + Task *ManagedObjectReference `xml:"task,omitempty"` +} + +func init() { + t["StoragePlacementResult"] = reflect.TypeOf((*StoragePlacementResult)(nil)).Elem() +} + +type StoragePlacementSpec struct { + DynamicData + + Type string `xml:"type"` + Priority VirtualMachineMovePriority `xml:"priority,omitempty"` + Vm *ManagedObjectReference `xml:"vm,omitempty"` + PodSelectionSpec StorageDrsPodSelectionSpec `xml:"podSelectionSpec"` + CloneSpec *VirtualMachineCloneSpec `xml:"cloneSpec,omitempty"` + CloneName string `xml:"cloneName,omitempty"` + ConfigSpec *VirtualMachineConfigSpec `xml:"configSpec,omitempty"` + RelocateSpec *VirtualMachineRelocateSpec `xml:"relocateSpec,omitempty"` + ResourcePool *ManagedObjectReference `xml:"resourcePool,omitempty"` + Host *ManagedObjectReference `xml:"host,omitempty"` + Folder *ManagedObjectReference `xml:"folder,omitempty"` + DisallowPrerequisiteMoves *bool `xml:"disallowPrerequisiteMoves"` + ResourceLeaseDurationSec int32 `xml:"resourceLeaseDurationSec,omitempty"` +} + +func init() { + t["StoragePlacementSpec"] = reflect.TypeOf((*StoragePlacementSpec)(nil)).Elem() +} + +type StoragePodSummary struct { + DynamicData + + Name string `xml:"name"` + Capacity int64 `xml:"capacity"` + FreeSpace int64 `xml:"freeSpace"` +} + +func init() { + t["StoragePodSummary"] = reflect.TypeOf((*StoragePodSummary)(nil)).Elem() +} + +type StorageProfile struct { + ApplyProfile + + NasStorage []NasStorageProfile `xml:"nasStorage,omitempty"` +} + +func init() { + t["StorageProfile"] = reflect.TypeOf((*StorageProfile)(nil)).Elem() +} + +type StorageRequirement struct { + DynamicData + + Datastore ManagedObjectReference `xml:"datastore"` + FreeSpaceRequiredInKb int64 `xml:"freeSpaceRequiredInKb"` +} + +func init() { + t["StorageRequirement"] = reflect.TypeOf((*StorageRequirement)(nil)).Elem() +} + +type StorageResourceManagerStorageProfileStatistics struct { + DynamicData + + ProfileId string `xml:"profileId"` + TotalSpaceMB int64 `xml:"totalSpaceMB"` + UsedSpaceMB int64 `xml:"usedSpaceMB"` +} + +func init() { + t["StorageResourceManagerStorageProfileStatistics"] = reflect.TypeOf((*StorageResourceManagerStorageProfileStatistics)(nil)).Elem() +} + +type StorageVMotionNotSupported struct { + MigrationFeatureNotSupported +} + +func init() { + t["StorageVMotionNotSupported"] = reflect.TypeOf((*StorageVMotionNotSupported)(nil)).Elem() +} + +type StorageVMotionNotSupportedFault StorageVMotionNotSupported + +func init() { + t["StorageVMotionNotSupportedFault"] = reflect.TypeOf((*StorageVMotionNotSupportedFault)(nil)).Elem() +} + +type StorageVmotionIncompatible struct { + VirtualHardwareCompatibilityIssue + + Datastore *ManagedObjectReference `xml:"datastore,omitempty"` +} + +func init() { + t["StorageVmotionIncompatible"] = reflect.TypeOf((*StorageVmotionIncompatible)(nil)).Elem() +} + +type StorageVmotionIncompatibleFault StorageVmotionIncompatible + +func init() { + t["StorageVmotionIncompatibleFault"] = reflect.TypeOf((*StorageVmotionIncompatibleFault)(nil)).Elem() +} + +type StringExpression struct { + NegatableExpression + + Value string `xml:"value,omitempty"` +} + +func init() { + t["StringExpression"] = reflect.TypeOf((*StringExpression)(nil)).Elem() +} + +type StringOption struct { + OptionType + + DefaultValue string `xml:"defaultValue"` + ValidCharacters string `xml:"validCharacters,omitempty"` +} + +func init() { + t["StringOption"] = reflect.TypeOf((*StringOption)(nil)).Elem() +} + +type StringPolicy struct { + InheritablePolicy + + Value string `xml:"value,omitempty"` +} + +func init() { + t["StringPolicy"] = reflect.TypeOf((*StringPolicy)(nil)).Elem() +} + +type SuspendVAppRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["SuspendVAppRequestType"] = reflect.TypeOf((*SuspendVAppRequestType)(nil)).Elem() +} + +type SuspendVApp_Task SuspendVAppRequestType + +func init() { + t["SuspendVApp_Task"] = reflect.TypeOf((*SuspendVApp_Task)(nil)).Elem() +} + +type SuspendVApp_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type SuspendVMRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["SuspendVMRequestType"] = reflect.TypeOf((*SuspendVMRequestType)(nil)).Elem() +} + +type SuspendVM_Task SuspendVMRequestType + +func init() { + t["SuspendVM_Task"] = reflect.TypeOf((*SuspendVM_Task)(nil)).Elem() +} + +type SuspendVM_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type SuspendedRelocateNotSupported struct { + MigrationFault +} + +func init() { + t["SuspendedRelocateNotSupported"] = reflect.TypeOf((*SuspendedRelocateNotSupported)(nil)).Elem() +} + +type SuspendedRelocateNotSupportedFault SuspendedRelocateNotSupported + +func init() { + t["SuspendedRelocateNotSupportedFault"] = reflect.TypeOf((*SuspendedRelocateNotSupportedFault)(nil)).Elem() +} + +type SwapDatastoreNotWritableOnHost struct { + DatastoreNotWritableOnHost +} + +func init() { + t["SwapDatastoreNotWritableOnHost"] = reflect.TypeOf((*SwapDatastoreNotWritableOnHost)(nil)).Elem() +} + +type SwapDatastoreNotWritableOnHostFault SwapDatastoreNotWritableOnHost + +func init() { + t["SwapDatastoreNotWritableOnHostFault"] = reflect.TypeOf((*SwapDatastoreNotWritableOnHostFault)(nil)).Elem() +} + +type SwapDatastoreUnset struct { + VimFault +} + +func init() { + t["SwapDatastoreUnset"] = reflect.TypeOf((*SwapDatastoreUnset)(nil)).Elem() +} + +type SwapDatastoreUnsetFault SwapDatastoreUnset + +func init() { + t["SwapDatastoreUnsetFault"] = reflect.TypeOf((*SwapDatastoreUnsetFault)(nil)).Elem() +} + +type SwapPlacementOverrideNotSupported struct { + InvalidVmConfig +} + +func init() { + t["SwapPlacementOverrideNotSupported"] = reflect.TypeOf((*SwapPlacementOverrideNotSupported)(nil)).Elem() +} + +type SwapPlacementOverrideNotSupportedFault SwapPlacementOverrideNotSupported + +func init() { + t["SwapPlacementOverrideNotSupportedFault"] = reflect.TypeOf((*SwapPlacementOverrideNotSupportedFault)(nil)).Elem() +} + +type SwitchIpUnset struct { + DvsFault +} + +func init() { + t["SwitchIpUnset"] = reflect.TypeOf((*SwitchIpUnset)(nil)).Elem() +} + +type SwitchIpUnsetFault SwitchIpUnset + +func init() { + t["SwitchIpUnsetFault"] = reflect.TypeOf((*SwitchIpUnsetFault)(nil)).Elem() +} + +type SwitchNotInUpgradeMode struct { + DvsFault +} + +func init() { + t["SwitchNotInUpgradeMode"] = reflect.TypeOf((*SwitchNotInUpgradeMode)(nil)).Elem() +} + +type SwitchNotInUpgradeModeFault SwitchNotInUpgradeMode + +func init() { + t["SwitchNotInUpgradeModeFault"] = reflect.TypeOf((*SwitchNotInUpgradeModeFault)(nil)).Elem() +} + +type SystemError struct { + RuntimeFault + + Reason string `xml:"reason"` +} + +func init() { + t["SystemError"] = reflect.TypeOf((*SystemError)(nil)).Elem() +} + +type SystemErrorFault SystemError + +func init() { + t["SystemErrorFault"] = reflect.TypeOf((*SystemErrorFault)(nil)).Elem() +} + +type Tag struct { + DynamicData + + Key string `xml:"key"` +} + +func init() { + t["Tag"] = reflect.TypeOf((*Tag)(nil)).Elem() +} + +type TaskDescription struct { + DynamicData + + MethodInfo []BaseElementDescription `xml:"methodInfo,typeattr"` + State []BaseElementDescription `xml:"state,typeattr"` + Reason []BaseTypeDescription `xml:"reason,typeattr"` +} + +func init() { + t["TaskDescription"] = reflect.TypeOf((*TaskDescription)(nil)).Elem() +} + +type TaskEvent struct { + Event + + Info TaskInfo `xml:"info"` +} + +func init() { + t["TaskEvent"] = reflect.TypeOf((*TaskEvent)(nil)).Elem() +} + +type TaskFilterSpec struct { + DynamicData + + Entity *TaskFilterSpecByEntity `xml:"entity,omitempty"` + Time *TaskFilterSpecByTime `xml:"time,omitempty"` + UserName *TaskFilterSpecByUsername `xml:"userName,omitempty"` + ActivationId []string `xml:"activationId,omitempty"` + State []TaskInfoState `xml:"state,omitempty"` + Alarm *ManagedObjectReference `xml:"alarm,omitempty"` + ScheduledTask *ManagedObjectReference `xml:"scheduledTask,omitempty"` + EventChainId []int32 `xml:"eventChainId,omitempty"` + Tag []string `xml:"tag,omitempty"` + ParentTaskKey []string `xml:"parentTaskKey,omitempty"` + RootTaskKey []string `xml:"rootTaskKey,omitempty"` +} + +func init() { + t["TaskFilterSpec"] = reflect.TypeOf((*TaskFilterSpec)(nil)).Elem() +} + +type TaskFilterSpecByEntity struct { + DynamicData + + Entity ManagedObjectReference `xml:"entity"` + Recursion TaskFilterSpecRecursionOption `xml:"recursion"` +} + +func init() { + t["TaskFilterSpecByEntity"] = reflect.TypeOf((*TaskFilterSpecByEntity)(nil)).Elem() +} + +type TaskFilterSpecByTime struct { + DynamicData + + TimeType TaskFilterSpecTimeOption `xml:"timeType"` + BeginTime *time.Time `xml:"beginTime"` + EndTime *time.Time `xml:"endTime"` +} + +func init() { + t["TaskFilterSpecByTime"] = reflect.TypeOf((*TaskFilterSpecByTime)(nil)).Elem() +} + +type TaskFilterSpecByUsername struct { + DynamicData + + SystemUser bool `xml:"systemUser"` + UserList []string `xml:"userList,omitempty"` +} + +func init() { + t["TaskFilterSpecByUsername"] = reflect.TypeOf((*TaskFilterSpecByUsername)(nil)).Elem() +} + +type TaskInProgress struct { + VimFault + + Task ManagedObjectReference `xml:"task"` +} + +func init() { + t["TaskInProgress"] = reflect.TypeOf((*TaskInProgress)(nil)).Elem() +} + +type TaskInProgressFault BaseTaskInProgress + +func init() { + t["TaskInProgressFault"] = reflect.TypeOf((*TaskInProgressFault)(nil)).Elem() +} + +type TaskInfo struct { + DynamicData + + Key string `xml:"key"` + Task ManagedObjectReference `xml:"task"` + Description *LocalizableMessage `xml:"description,omitempty"` + Name string `xml:"name,omitempty"` + DescriptionId string `xml:"descriptionId"` + Entity *ManagedObjectReference `xml:"entity,omitempty"` + EntityName string `xml:"entityName,omitempty"` + Locked []ManagedObjectReference `xml:"locked,omitempty"` + State TaskInfoState `xml:"state"` + Cancelled bool `xml:"cancelled"` + Cancelable bool `xml:"cancelable"` + Error *LocalizedMethodFault `xml:"error,omitempty"` + Result AnyType `xml:"result,omitempty,typeattr"` + Progress int32 `xml:"progress,omitempty"` + Reason BaseTaskReason `xml:"reason,typeattr"` + QueueTime time.Time `xml:"queueTime"` + StartTime *time.Time `xml:"startTime"` + CompleteTime *time.Time `xml:"completeTime"` + EventChainId int32 `xml:"eventChainId"` + ChangeTag string `xml:"changeTag,omitempty"` + ParentTaskKey string `xml:"parentTaskKey,omitempty"` + RootTaskKey string `xml:"rootTaskKey,omitempty"` + ActivationId string `xml:"activationId,omitempty"` +} + +func init() { + t["TaskInfo"] = reflect.TypeOf((*TaskInfo)(nil)).Elem() +} + +type TaskReason struct { + DynamicData +} + +func init() { + t["TaskReason"] = reflect.TypeOf((*TaskReason)(nil)).Elem() +} + +type TaskReasonAlarm struct { + TaskReason + + AlarmName string `xml:"alarmName"` + Alarm ManagedObjectReference `xml:"alarm"` + EntityName string `xml:"entityName"` + Entity ManagedObjectReference `xml:"entity"` +} + +func init() { + t["TaskReasonAlarm"] = reflect.TypeOf((*TaskReasonAlarm)(nil)).Elem() +} + +type TaskReasonSchedule struct { + TaskReason + + Name string `xml:"name"` + ScheduledTask ManagedObjectReference `xml:"scheduledTask"` +} + +func init() { + t["TaskReasonSchedule"] = reflect.TypeOf((*TaskReasonSchedule)(nil)).Elem() +} + +type TaskReasonSystem struct { + TaskReason +} + +func init() { + t["TaskReasonSystem"] = reflect.TypeOf((*TaskReasonSystem)(nil)).Elem() +} + +type TaskReasonUser struct { + TaskReason + + UserName string `xml:"userName"` +} + +func init() { + t["TaskReasonUser"] = reflect.TypeOf((*TaskReasonUser)(nil)).Elem() +} + +type TaskScheduler struct { + DynamicData + + ActiveTime *time.Time `xml:"activeTime"` + ExpireTime *time.Time `xml:"expireTime"` +} + +func init() { + t["TaskScheduler"] = reflect.TypeOf((*TaskScheduler)(nil)).Elem() +} + +type TaskTimeoutEvent struct { + TaskEvent +} + +func init() { + t["TaskTimeoutEvent"] = reflect.TypeOf((*TaskTimeoutEvent)(nil)).Elem() +} + +type TeamingMatchEvent struct { + DvsHealthStatusChangeEvent +} + +func init() { + t["TeamingMatchEvent"] = reflect.TypeOf((*TeamingMatchEvent)(nil)).Elem() +} + +type TeamingMisMatchEvent struct { + DvsHealthStatusChangeEvent +} + +func init() { + t["TeamingMisMatchEvent"] = reflect.TypeOf((*TeamingMisMatchEvent)(nil)).Elem() +} + +type TemplateBeingUpgradedEvent struct { + TemplateUpgradeEvent +} + +func init() { + t["TemplateBeingUpgradedEvent"] = reflect.TypeOf((*TemplateBeingUpgradedEvent)(nil)).Elem() +} + +type TemplateConfigFileInfo struct { + VmConfigFileInfo +} + +func init() { + t["TemplateConfigFileInfo"] = reflect.TypeOf((*TemplateConfigFileInfo)(nil)).Elem() +} + +type TemplateConfigFileQuery struct { + VmConfigFileQuery +} + +func init() { + t["TemplateConfigFileQuery"] = reflect.TypeOf((*TemplateConfigFileQuery)(nil)).Elem() +} + +type TemplateUpgradeEvent struct { + Event + + LegacyTemplate string `xml:"legacyTemplate"` +} + +func init() { + t["TemplateUpgradeEvent"] = reflect.TypeOf((*TemplateUpgradeEvent)(nil)).Elem() +} + +type TemplateUpgradeFailedEvent struct { + TemplateUpgradeEvent + + Reason LocalizedMethodFault `xml:"reason"` +} + +func init() { + t["TemplateUpgradeFailedEvent"] = reflect.TypeOf((*TemplateUpgradeFailedEvent)(nil)).Elem() +} + +type TemplateUpgradedEvent struct { + TemplateUpgradeEvent +} + +func init() { + t["TemplateUpgradedEvent"] = reflect.TypeOf((*TemplateUpgradedEvent)(nil)).Elem() +} + +type TerminateFaultTolerantVMRequestType struct { + This ManagedObjectReference `xml:"_this"` + Vm *ManagedObjectReference `xml:"vm,omitempty"` +} + +func init() { + t["TerminateFaultTolerantVMRequestType"] = reflect.TypeOf((*TerminateFaultTolerantVMRequestType)(nil)).Elem() +} + +type TerminateFaultTolerantVM_Task TerminateFaultTolerantVMRequestType + +func init() { + t["TerminateFaultTolerantVM_Task"] = reflect.TypeOf((*TerminateFaultTolerantVM_Task)(nil)).Elem() +} + +type TerminateFaultTolerantVM_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type TerminateProcessInGuest TerminateProcessInGuestRequestType + +func init() { + t["TerminateProcessInGuest"] = reflect.TypeOf((*TerminateProcessInGuest)(nil)).Elem() +} + +type TerminateProcessInGuestRequestType struct { + This ManagedObjectReference `xml:"_this"` + Vm ManagedObjectReference `xml:"vm"` + Auth BaseGuestAuthentication `xml:"auth,typeattr"` + Pid int64 `xml:"pid"` +} + +func init() { + t["TerminateProcessInGuestRequestType"] = reflect.TypeOf((*TerminateProcessInGuestRequestType)(nil)).Elem() +} + +type TerminateProcessInGuestResponse struct { +} + +type TerminateSession TerminateSessionRequestType + +func init() { + t["TerminateSession"] = reflect.TypeOf((*TerminateSession)(nil)).Elem() +} + +type TerminateSessionRequestType struct { + This ManagedObjectReference `xml:"_this"` + SessionId []string `xml:"sessionId"` +} + +func init() { + t["TerminateSessionRequestType"] = reflect.TypeOf((*TerminateSessionRequestType)(nil)).Elem() +} + +type TerminateSessionResponse struct { +} + +type TerminateVM TerminateVMRequestType + +func init() { + t["TerminateVM"] = reflect.TypeOf((*TerminateVM)(nil)).Elem() +} + +type TerminateVMRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["TerminateVMRequestType"] = reflect.TypeOf((*TerminateVMRequestType)(nil)).Elem() +} + +type TerminateVMResponse struct { +} + +type ThirdPartyLicenseAssignmentFailed struct { + RuntimeFault + + Host ManagedObjectReference `xml:"host"` + Module string `xml:"module"` + Reason string `xml:"reason,omitempty"` +} + +func init() { + t["ThirdPartyLicenseAssignmentFailed"] = reflect.TypeOf((*ThirdPartyLicenseAssignmentFailed)(nil)).Elem() +} + +type ThirdPartyLicenseAssignmentFailedFault ThirdPartyLicenseAssignmentFailed + +func init() { + t["ThirdPartyLicenseAssignmentFailedFault"] = reflect.TypeOf((*ThirdPartyLicenseAssignmentFailedFault)(nil)).Elem() +} + +type TicketedSessionAuthentication struct { + GuestAuthentication + + Ticket string `xml:"ticket"` +} + +func init() { + t["TicketedSessionAuthentication"] = reflect.TypeOf((*TicketedSessionAuthentication)(nil)).Elem() +} + +type TimedOutHostOperationEvent struct { + HostEvent +} + +func init() { + t["TimedOutHostOperationEvent"] = reflect.TypeOf((*TimedOutHostOperationEvent)(nil)).Elem() +} + +type Timedout struct { + VimFault +} + +func init() { + t["Timedout"] = reflect.TypeOf((*Timedout)(nil)).Elem() +} + +type TimedoutFault BaseTimedout + +func init() { + t["TimedoutFault"] = reflect.TypeOf((*TimedoutFault)(nil)).Elem() +} + +type TooManyConcurrentNativeClones struct { + FileFault +} + +func init() { + t["TooManyConcurrentNativeClones"] = reflect.TypeOf((*TooManyConcurrentNativeClones)(nil)).Elem() +} + +type TooManyConcurrentNativeClonesFault TooManyConcurrentNativeClones + +func init() { + t["TooManyConcurrentNativeClonesFault"] = reflect.TypeOf((*TooManyConcurrentNativeClonesFault)(nil)).Elem() +} + +type TooManyConsecutiveOverrides struct { + VimFault +} + +func init() { + t["TooManyConsecutiveOverrides"] = reflect.TypeOf((*TooManyConsecutiveOverrides)(nil)).Elem() +} + +type TooManyConsecutiveOverridesFault TooManyConsecutiveOverrides + +func init() { + t["TooManyConsecutiveOverridesFault"] = reflect.TypeOf((*TooManyConsecutiveOverridesFault)(nil)).Elem() +} + +type TooManyDevices struct { + InvalidVmConfig +} + +func init() { + t["TooManyDevices"] = reflect.TypeOf((*TooManyDevices)(nil)).Elem() +} + +type TooManyDevicesFault TooManyDevices + +func init() { + t["TooManyDevicesFault"] = reflect.TypeOf((*TooManyDevicesFault)(nil)).Elem() +} + +type TooManyDisksOnLegacyHost struct { + MigrationFault + + DiskCount int32 `xml:"diskCount"` + TimeoutDanger bool `xml:"timeoutDanger"` +} + +func init() { + t["TooManyDisksOnLegacyHost"] = reflect.TypeOf((*TooManyDisksOnLegacyHost)(nil)).Elem() +} + +type TooManyDisksOnLegacyHostFault TooManyDisksOnLegacyHost + +func init() { + t["TooManyDisksOnLegacyHostFault"] = reflect.TypeOf((*TooManyDisksOnLegacyHostFault)(nil)).Elem() +} + +type TooManyGuestLogons struct { + GuestOperationsFault +} + +func init() { + t["TooManyGuestLogons"] = reflect.TypeOf((*TooManyGuestLogons)(nil)).Elem() +} + +type TooManyGuestLogonsFault TooManyGuestLogons + +func init() { + t["TooManyGuestLogonsFault"] = reflect.TypeOf((*TooManyGuestLogonsFault)(nil)).Elem() +} + +type TooManyHosts struct { + HostConnectFault +} + +func init() { + t["TooManyHosts"] = reflect.TypeOf((*TooManyHosts)(nil)).Elem() +} + +type TooManyHostsFault TooManyHosts + +func init() { + t["TooManyHostsFault"] = reflect.TypeOf((*TooManyHostsFault)(nil)).Elem() +} + +type TooManyNativeCloneLevels struct { + FileFault +} + +func init() { + t["TooManyNativeCloneLevels"] = reflect.TypeOf((*TooManyNativeCloneLevels)(nil)).Elem() +} + +type TooManyNativeCloneLevelsFault TooManyNativeCloneLevels + +func init() { + t["TooManyNativeCloneLevelsFault"] = reflect.TypeOf((*TooManyNativeCloneLevelsFault)(nil)).Elem() +} + +type TooManyNativeClonesOnFile struct { + FileFault +} + +func init() { + t["TooManyNativeClonesOnFile"] = reflect.TypeOf((*TooManyNativeClonesOnFile)(nil)).Elem() +} + +type TooManyNativeClonesOnFileFault TooManyNativeClonesOnFile + +func init() { + t["TooManyNativeClonesOnFileFault"] = reflect.TypeOf((*TooManyNativeClonesOnFileFault)(nil)).Elem() +} + +type TooManySnapshotLevels struct { + SnapshotFault +} + +func init() { + t["TooManySnapshotLevels"] = reflect.TypeOf((*TooManySnapshotLevels)(nil)).Elem() +} + +type TooManySnapshotLevelsFault TooManySnapshotLevels + +func init() { + t["TooManySnapshotLevelsFault"] = reflect.TypeOf((*TooManySnapshotLevelsFault)(nil)).Elem() +} + +type ToolsAlreadyUpgraded struct { + VmToolsUpgradeFault +} + +func init() { + t["ToolsAlreadyUpgraded"] = reflect.TypeOf((*ToolsAlreadyUpgraded)(nil)).Elem() +} + +type ToolsAlreadyUpgradedFault ToolsAlreadyUpgraded + +func init() { + t["ToolsAlreadyUpgradedFault"] = reflect.TypeOf((*ToolsAlreadyUpgradedFault)(nil)).Elem() +} + +type ToolsAutoUpgradeNotSupported struct { + VmToolsUpgradeFault +} + +func init() { + t["ToolsAutoUpgradeNotSupported"] = reflect.TypeOf((*ToolsAutoUpgradeNotSupported)(nil)).Elem() +} + +type ToolsAutoUpgradeNotSupportedFault ToolsAutoUpgradeNotSupported + +func init() { + t["ToolsAutoUpgradeNotSupportedFault"] = reflect.TypeOf((*ToolsAutoUpgradeNotSupportedFault)(nil)).Elem() +} + +type ToolsConfigInfo struct { + DynamicData + + ToolsVersion int32 `xml:"toolsVersion,omitempty"` + AfterPowerOn *bool `xml:"afterPowerOn"` + AfterResume *bool `xml:"afterResume"` + BeforeGuestStandby *bool `xml:"beforeGuestStandby"` + BeforeGuestShutdown *bool `xml:"beforeGuestShutdown"` + BeforeGuestReboot *bool `xml:"beforeGuestReboot"` + ToolsUpgradePolicy string `xml:"toolsUpgradePolicy,omitempty"` + PendingCustomization string `xml:"pendingCustomization,omitempty"` + SyncTimeWithHost *bool `xml:"syncTimeWithHost"` + LastInstallInfo *ToolsConfigInfoToolsLastInstallInfo `xml:"lastInstallInfo,omitempty"` +} + +func init() { + t["ToolsConfigInfo"] = reflect.TypeOf((*ToolsConfigInfo)(nil)).Elem() +} + +type ToolsConfigInfoToolsLastInstallInfo struct { + DynamicData + + Counter int32 `xml:"counter"` + Fault *LocalizedMethodFault `xml:"fault,omitempty"` +} + +func init() { + t["ToolsConfigInfoToolsLastInstallInfo"] = reflect.TypeOf((*ToolsConfigInfoToolsLastInstallInfo)(nil)).Elem() +} + +type ToolsImageCopyFailed struct { + VmToolsUpgradeFault +} + +func init() { + t["ToolsImageCopyFailed"] = reflect.TypeOf((*ToolsImageCopyFailed)(nil)).Elem() +} + +type ToolsImageCopyFailedFault ToolsImageCopyFailed + +func init() { + t["ToolsImageCopyFailedFault"] = reflect.TypeOf((*ToolsImageCopyFailedFault)(nil)).Elem() +} + +type ToolsImageNotAvailable struct { + VmToolsUpgradeFault +} + +func init() { + t["ToolsImageNotAvailable"] = reflect.TypeOf((*ToolsImageNotAvailable)(nil)).Elem() +} + +type ToolsImageNotAvailableFault ToolsImageNotAvailable + +func init() { + t["ToolsImageNotAvailableFault"] = reflect.TypeOf((*ToolsImageNotAvailableFault)(nil)).Elem() +} + +type ToolsImageSignatureCheckFailed struct { + VmToolsUpgradeFault +} + +func init() { + t["ToolsImageSignatureCheckFailed"] = reflect.TypeOf((*ToolsImageSignatureCheckFailed)(nil)).Elem() +} + +type ToolsImageSignatureCheckFailedFault ToolsImageSignatureCheckFailed + +func init() { + t["ToolsImageSignatureCheckFailedFault"] = reflect.TypeOf((*ToolsImageSignatureCheckFailedFault)(nil)).Elem() +} + +type ToolsInstallationInProgress struct { + MigrationFault +} + +func init() { + t["ToolsInstallationInProgress"] = reflect.TypeOf((*ToolsInstallationInProgress)(nil)).Elem() +} + +type ToolsInstallationInProgressFault ToolsInstallationInProgress + +func init() { + t["ToolsInstallationInProgressFault"] = reflect.TypeOf((*ToolsInstallationInProgressFault)(nil)).Elem() +} + +type ToolsUnavailable struct { + VimFault +} + +func init() { + t["ToolsUnavailable"] = reflect.TypeOf((*ToolsUnavailable)(nil)).Elem() +} + +type ToolsUnavailableFault ToolsUnavailable + +func init() { + t["ToolsUnavailableFault"] = reflect.TypeOf((*ToolsUnavailableFault)(nil)).Elem() +} + +type ToolsUpgradeCancelled struct { + VmToolsUpgradeFault +} + +func init() { + t["ToolsUpgradeCancelled"] = reflect.TypeOf((*ToolsUpgradeCancelled)(nil)).Elem() +} + +type ToolsUpgradeCancelledFault ToolsUpgradeCancelled + +func init() { + t["ToolsUpgradeCancelledFault"] = reflect.TypeOf((*ToolsUpgradeCancelledFault)(nil)).Elem() +} + +type TraversalSpec struct { + SelectionSpec + + Type string `xml:"type"` + Path string `xml:"path"` + Skip *bool `xml:"skip"` + SelectSet []BaseSelectionSpec `xml:"selectSet,omitempty,typeattr"` +} + +func init() { + t["TraversalSpec"] = reflect.TypeOf((*TraversalSpec)(nil)).Elem() +} + +type TurnDiskLocatorLedOffRequestType struct { + This ManagedObjectReference `xml:"_this"` + ScsiDiskUuids []string `xml:"scsiDiskUuids"` +} + +func init() { + t["TurnDiskLocatorLedOffRequestType"] = reflect.TypeOf((*TurnDiskLocatorLedOffRequestType)(nil)).Elem() +} + +type TurnDiskLocatorLedOff_Task TurnDiskLocatorLedOffRequestType + +func init() { + t["TurnDiskLocatorLedOff_Task"] = reflect.TypeOf((*TurnDiskLocatorLedOff_Task)(nil)).Elem() +} + +type TurnDiskLocatorLedOff_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type TurnDiskLocatorLedOnRequestType struct { + This ManagedObjectReference `xml:"_this"` + ScsiDiskUuids []string `xml:"scsiDiskUuids"` +} + +func init() { + t["TurnDiskLocatorLedOnRequestType"] = reflect.TypeOf((*TurnDiskLocatorLedOnRequestType)(nil)).Elem() +} + +type TurnDiskLocatorLedOn_Task TurnDiskLocatorLedOnRequestType + +func init() { + t["TurnDiskLocatorLedOn_Task"] = reflect.TypeOf((*TurnDiskLocatorLedOn_Task)(nil)).Elem() +} + +type TurnDiskLocatorLedOn_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type TurnOffFaultToleranceForVMRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["TurnOffFaultToleranceForVMRequestType"] = reflect.TypeOf((*TurnOffFaultToleranceForVMRequestType)(nil)).Elem() +} + +type TurnOffFaultToleranceForVM_Task TurnOffFaultToleranceForVMRequestType + +func init() { + t["TurnOffFaultToleranceForVM_Task"] = reflect.TypeOf((*TurnOffFaultToleranceForVM_Task)(nil)).Elem() +} + +type TurnOffFaultToleranceForVM_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type TypeDescription struct { + Description + + Key string `xml:"key"` +} + +func init() { + t["TypeDescription"] = reflect.TypeOf((*TypeDescription)(nil)).Elem() +} + +type UnSupportedDatastoreForVFlash struct { + UnsupportedDatastore + + DatastoreName string `xml:"datastoreName"` + Type string `xml:"type"` +} + +func init() { + t["UnSupportedDatastoreForVFlash"] = reflect.TypeOf((*UnSupportedDatastoreForVFlash)(nil)).Elem() +} + +type UnSupportedDatastoreForVFlashFault UnSupportedDatastoreForVFlash + +func init() { + t["UnSupportedDatastoreForVFlashFault"] = reflect.TypeOf((*UnSupportedDatastoreForVFlashFault)(nil)).Elem() +} + +type UnassignUserFromGroup UnassignUserFromGroupRequestType + +func init() { + t["UnassignUserFromGroup"] = reflect.TypeOf((*UnassignUserFromGroup)(nil)).Elem() +} + +type UnassignUserFromGroupRequestType struct { + This ManagedObjectReference `xml:"_this"` + User string `xml:"user"` + Group string `xml:"group"` +} + +func init() { + t["UnassignUserFromGroupRequestType"] = reflect.TypeOf((*UnassignUserFromGroupRequestType)(nil)).Elem() +} + +type UnassignUserFromGroupResponse struct { +} + +type UnbindVnic UnbindVnicRequestType + +func init() { + t["UnbindVnic"] = reflect.TypeOf((*UnbindVnic)(nil)).Elem() +} + +type UnbindVnicRequestType struct { + This ManagedObjectReference `xml:"_this"` + IScsiHbaName string `xml:"iScsiHbaName"` + VnicDevice string `xml:"vnicDevice"` + Force bool `xml:"force"` +} + +func init() { + t["UnbindVnicRequestType"] = reflect.TypeOf((*UnbindVnicRequestType)(nil)).Elem() +} + +type UnbindVnicResponse struct { +} + +type UncommittedUndoableDisk struct { + MigrationFault +} + +func init() { + t["UncommittedUndoableDisk"] = reflect.TypeOf((*UncommittedUndoableDisk)(nil)).Elem() +} + +type UncommittedUndoableDiskFault UncommittedUndoableDisk + +func init() { + t["UncommittedUndoableDiskFault"] = reflect.TypeOf((*UncommittedUndoableDiskFault)(nil)).Elem() +} + +type UnconfiguredPropertyValue struct { + InvalidPropertyValue +} + +func init() { + t["UnconfiguredPropertyValue"] = reflect.TypeOf((*UnconfiguredPropertyValue)(nil)).Elem() +} + +type UnconfiguredPropertyValueFault UnconfiguredPropertyValue + +func init() { + t["UnconfiguredPropertyValueFault"] = reflect.TypeOf((*UnconfiguredPropertyValueFault)(nil)).Elem() +} + +type UncustomizableGuest struct { + CustomizationFault + + UncustomizableGuestOS string `xml:"uncustomizableGuestOS"` +} + +func init() { + t["UncustomizableGuest"] = reflect.TypeOf((*UncustomizableGuest)(nil)).Elem() +} + +type UncustomizableGuestFault UncustomizableGuest + +func init() { + t["UncustomizableGuestFault"] = reflect.TypeOf((*UncustomizableGuestFault)(nil)).Elem() +} + +type UnexpectedCustomizationFault struct { + CustomizationFault +} + +func init() { + t["UnexpectedCustomizationFault"] = reflect.TypeOf((*UnexpectedCustomizationFault)(nil)).Elem() +} + +type UnexpectedCustomizationFaultFault UnexpectedCustomizationFault + +func init() { + t["UnexpectedCustomizationFaultFault"] = reflect.TypeOf((*UnexpectedCustomizationFaultFault)(nil)).Elem() +} + +type UnexpectedFault struct { + RuntimeFault + + FaultName string `xml:"faultName"` + Fault *LocalizedMethodFault `xml:"fault,omitempty"` +} + +func init() { + t["UnexpectedFault"] = reflect.TypeOf((*UnexpectedFault)(nil)).Elem() +} + +type UnexpectedFaultFault UnexpectedFault + +func init() { + t["UnexpectedFaultFault"] = reflect.TypeOf((*UnexpectedFaultFault)(nil)).Elem() +} + +type UninstallHostPatchRequestType struct { + This ManagedObjectReference `xml:"_this"` + BulletinIds []string `xml:"bulletinIds,omitempty"` + Spec *HostPatchManagerPatchManagerOperationSpec `xml:"spec,omitempty"` +} + +func init() { + t["UninstallHostPatchRequestType"] = reflect.TypeOf((*UninstallHostPatchRequestType)(nil)).Elem() +} + +type UninstallHostPatch_Task UninstallHostPatchRequestType + +func init() { + t["UninstallHostPatch_Task"] = reflect.TypeOf((*UninstallHostPatch_Task)(nil)).Elem() +} + +type UninstallHostPatch_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type UninstallIoFilterRequestType struct { + This ManagedObjectReference `xml:"_this"` + FilterId string `xml:"filterId"` + CompRes ManagedObjectReference `xml:"compRes"` +} + +func init() { + t["UninstallIoFilterRequestType"] = reflect.TypeOf((*UninstallIoFilterRequestType)(nil)).Elem() +} + +type UninstallIoFilter_Task UninstallIoFilterRequestType + +func init() { + t["UninstallIoFilter_Task"] = reflect.TypeOf((*UninstallIoFilter_Task)(nil)).Elem() +} + +type UninstallIoFilter_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type UninstallService UninstallServiceRequestType + +func init() { + t["UninstallService"] = reflect.TypeOf((*UninstallService)(nil)).Elem() +} + +type UninstallServiceRequestType struct { + This ManagedObjectReference `xml:"_this"` + Id string `xml:"id"` +} + +func init() { + t["UninstallServiceRequestType"] = reflect.TypeOf((*UninstallServiceRequestType)(nil)).Elem() +} + +type UninstallServiceResponse struct { +} + +type UnlicensedVirtualMachinesEvent struct { + LicenseEvent + + Unlicensed int32 `xml:"unlicensed"` + Available int32 `xml:"available"` +} + +func init() { + t["UnlicensedVirtualMachinesEvent"] = reflect.TypeOf((*UnlicensedVirtualMachinesEvent)(nil)).Elem() +} + +type UnlicensedVirtualMachinesFoundEvent struct { + LicenseEvent + + Available int32 `xml:"available"` +} + +func init() { + t["UnlicensedVirtualMachinesFoundEvent"] = reflect.TypeOf((*UnlicensedVirtualMachinesFoundEvent)(nil)).Elem() +} + +type UnmapVmfsVolumeExRequestType struct { + This ManagedObjectReference `xml:"_this"` + VmfsUuid []string `xml:"vmfsUuid"` +} + +func init() { + t["UnmapVmfsVolumeExRequestType"] = reflect.TypeOf((*UnmapVmfsVolumeExRequestType)(nil)).Elem() +} + +type UnmapVmfsVolumeEx_Task UnmapVmfsVolumeExRequestType + +func init() { + t["UnmapVmfsVolumeEx_Task"] = reflect.TypeOf((*UnmapVmfsVolumeEx_Task)(nil)).Elem() +} + +type UnmapVmfsVolumeEx_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type UnmountDiskMappingRequestType struct { + This ManagedObjectReference `xml:"_this"` + Mapping []VsanHostDiskMapping `xml:"mapping"` +} + +func init() { + t["UnmountDiskMappingRequestType"] = reflect.TypeOf((*UnmountDiskMappingRequestType)(nil)).Elem() +} + +type UnmountDiskMapping_Task UnmountDiskMappingRequestType + +func init() { + t["UnmountDiskMapping_Task"] = reflect.TypeOf((*UnmountDiskMapping_Task)(nil)).Elem() +} + +type UnmountDiskMapping_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type UnmountForceMountedVmfsVolume UnmountForceMountedVmfsVolumeRequestType + +func init() { + t["UnmountForceMountedVmfsVolume"] = reflect.TypeOf((*UnmountForceMountedVmfsVolume)(nil)).Elem() +} + +type UnmountForceMountedVmfsVolumeRequestType struct { + This ManagedObjectReference `xml:"_this"` + VmfsUuid string `xml:"vmfsUuid"` +} + +func init() { + t["UnmountForceMountedVmfsVolumeRequestType"] = reflect.TypeOf((*UnmountForceMountedVmfsVolumeRequestType)(nil)).Elem() +} + +type UnmountForceMountedVmfsVolumeResponse struct { +} + +type UnmountToolsInstaller UnmountToolsInstallerRequestType + +func init() { + t["UnmountToolsInstaller"] = reflect.TypeOf((*UnmountToolsInstaller)(nil)).Elem() +} + +type UnmountToolsInstallerRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["UnmountToolsInstallerRequestType"] = reflect.TypeOf((*UnmountToolsInstallerRequestType)(nil)).Elem() +} + +type UnmountToolsInstallerResponse struct { +} + +type UnmountVffsVolume UnmountVffsVolumeRequestType + +func init() { + t["UnmountVffsVolume"] = reflect.TypeOf((*UnmountVffsVolume)(nil)).Elem() +} + +type UnmountVffsVolumeRequestType struct { + This ManagedObjectReference `xml:"_this"` + VffsUuid string `xml:"vffsUuid"` +} + +func init() { + t["UnmountVffsVolumeRequestType"] = reflect.TypeOf((*UnmountVffsVolumeRequestType)(nil)).Elem() +} + +type UnmountVffsVolumeResponse struct { +} + +type UnmountVmfsVolume UnmountVmfsVolumeRequestType + +func init() { + t["UnmountVmfsVolume"] = reflect.TypeOf((*UnmountVmfsVolume)(nil)).Elem() +} + +type UnmountVmfsVolumeExRequestType struct { + This ManagedObjectReference `xml:"_this"` + VmfsUuid []string `xml:"vmfsUuid"` +} + +func init() { + t["UnmountVmfsVolumeExRequestType"] = reflect.TypeOf((*UnmountVmfsVolumeExRequestType)(nil)).Elem() +} + +type UnmountVmfsVolumeEx_Task UnmountVmfsVolumeExRequestType + +func init() { + t["UnmountVmfsVolumeEx_Task"] = reflect.TypeOf((*UnmountVmfsVolumeEx_Task)(nil)).Elem() +} + +type UnmountVmfsVolumeEx_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type UnmountVmfsVolumeRequestType struct { + This ManagedObjectReference `xml:"_this"` + VmfsUuid string `xml:"vmfsUuid"` +} + +func init() { + t["UnmountVmfsVolumeRequestType"] = reflect.TypeOf((*UnmountVmfsVolumeRequestType)(nil)).Elem() +} + +type UnmountVmfsVolumeResponse struct { +} + +type UnrecognizedHost struct { + VimFault + + HostName string `xml:"hostName"` +} + +func init() { + t["UnrecognizedHost"] = reflect.TypeOf((*UnrecognizedHost)(nil)).Elem() +} + +type UnrecognizedHostFault UnrecognizedHost + +func init() { + t["UnrecognizedHostFault"] = reflect.TypeOf((*UnrecognizedHostFault)(nil)).Elem() +} + +type UnregisterAndDestroyRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["UnregisterAndDestroyRequestType"] = reflect.TypeOf((*UnregisterAndDestroyRequestType)(nil)).Elem() +} + +type UnregisterAndDestroy_Task UnregisterAndDestroyRequestType + +func init() { + t["UnregisterAndDestroy_Task"] = reflect.TypeOf((*UnregisterAndDestroy_Task)(nil)).Elem() +} + +type UnregisterAndDestroy_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type UnregisterExtension UnregisterExtensionRequestType + +func init() { + t["UnregisterExtension"] = reflect.TypeOf((*UnregisterExtension)(nil)).Elem() +} + +type UnregisterExtensionRequestType struct { + This ManagedObjectReference `xml:"_this"` + ExtensionKey string `xml:"extensionKey"` +} + +func init() { + t["UnregisterExtensionRequestType"] = reflect.TypeOf((*UnregisterExtensionRequestType)(nil)).Elem() +} + +type UnregisterExtensionResponse struct { +} + +type UnregisterVM UnregisterVMRequestType + +func init() { + t["UnregisterVM"] = reflect.TypeOf((*UnregisterVM)(nil)).Elem() +} + +type UnregisterVMRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["UnregisterVMRequestType"] = reflect.TypeOf((*UnregisterVMRequestType)(nil)).Elem() +} + +type UnregisterVMResponse struct { +} + +type UnsharedSwapVMotionNotSupported struct { + MigrationFeatureNotSupported +} + +func init() { + t["UnsharedSwapVMotionNotSupported"] = reflect.TypeOf((*UnsharedSwapVMotionNotSupported)(nil)).Elem() +} + +type UnsharedSwapVMotionNotSupportedFault UnsharedSwapVMotionNotSupported + +func init() { + t["UnsharedSwapVMotionNotSupportedFault"] = reflect.TypeOf((*UnsharedSwapVMotionNotSupportedFault)(nil)).Elem() +} + +type UnsupportedDatastore struct { + VmConfigFault + + Datastore *ManagedObjectReference `xml:"datastore,omitempty"` +} + +func init() { + t["UnsupportedDatastore"] = reflect.TypeOf((*UnsupportedDatastore)(nil)).Elem() +} + +type UnsupportedDatastoreFault BaseUnsupportedDatastore + +func init() { + t["UnsupportedDatastoreFault"] = reflect.TypeOf((*UnsupportedDatastoreFault)(nil)).Elem() +} + +type UnsupportedGuest struct { + InvalidVmConfig + + UnsupportedGuestOS string `xml:"unsupportedGuestOS"` +} + +func init() { + t["UnsupportedGuest"] = reflect.TypeOf((*UnsupportedGuest)(nil)).Elem() +} + +type UnsupportedGuestFault UnsupportedGuest + +func init() { + t["UnsupportedGuestFault"] = reflect.TypeOf((*UnsupportedGuestFault)(nil)).Elem() +} + +type UnsupportedVimApiVersion struct { + VimFault + + Version string `xml:"version,omitempty"` +} + +func init() { + t["UnsupportedVimApiVersion"] = reflect.TypeOf((*UnsupportedVimApiVersion)(nil)).Elem() +} + +type UnsupportedVimApiVersionFault UnsupportedVimApiVersion + +func init() { + t["UnsupportedVimApiVersionFault"] = reflect.TypeOf((*UnsupportedVimApiVersionFault)(nil)).Elem() +} + +type UnsupportedVmxLocation struct { + VmConfigFault +} + +func init() { + t["UnsupportedVmxLocation"] = reflect.TypeOf((*UnsupportedVmxLocation)(nil)).Elem() +} + +type UnsupportedVmxLocationFault UnsupportedVmxLocation + +func init() { + t["UnsupportedVmxLocationFault"] = reflect.TypeOf((*UnsupportedVmxLocationFault)(nil)).Elem() +} + +type UnusedVirtualDiskBlocksNotScrubbed struct { + DeviceBackingNotSupported +} + +func init() { + t["UnusedVirtualDiskBlocksNotScrubbed"] = reflect.TypeOf((*UnusedVirtualDiskBlocksNotScrubbed)(nil)).Elem() +} + +type UnusedVirtualDiskBlocksNotScrubbedFault UnusedVirtualDiskBlocksNotScrubbed + +func init() { + t["UnusedVirtualDiskBlocksNotScrubbedFault"] = reflect.TypeOf((*UnusedVirtualDiskBlocksNotScrubbedFault)(nil)).Elem() +} + +type UpdateAnswerFileRequestType struct { + This ManagedObjectReference `xml:"_this"` + Host ManagedObjectReference `xml:"host"` + ConfigSpec BaseAnswerFileCreateSpec `xml:"configSpec,typeattr"` +} + +func init() { + t["UpdateAnswerFileRequestType"] = reflect.TypeOf((*UpdateAnswerFileRequestType)(nil)).Elem() +} + +type UpdateAnswerFile_Task UpdateAnswerFileRequestType + +func init() { + t["UpdateAnswerFile_Task"] = reflect.TypeOf((*UpdateAnswerFile_Task)(nil)).Elem() +} + +type UpdateAnswerFile_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type UpdateAssignedLicense UpdateAssignedLicenseRequestType + +func init() { + t["UpdateAssignedLicense"] = reflect.TypeOf((*UpdateAssignedLicense)(nil)).Elem() +} + +type UpdateAssignedLicenseRequestType struct { + This ManagedObjectReference `xml:"_this"` + Entity string `xml:"entity"` + LicenseKey string `xml:"licenseKey"` + EntityDisplayName string `xml:"entityDisplayName,omitempty"` +} + +func init() { + t["UpdateAssignedLicenseRequestType"] = reflect.TypeOf((*UpdateAssignedLicenseRequestType)(nil)).Elem() +} + +type UpdateAssignedLicenseResponse struct { + Returnval LicenseManagerLicenseInfo `xml:"returnval"` +} + +type UpdateAuthorizationRole UpdateAuthorizationRoleRequestType + +func init() { + t["UpdateAuthorizationRole"] = reflect.TypeOf((*UpdateAuthorizationRole)(nil)).Elem() +} + +type UpdateAuthorizationRoleRequestType struct { + This ManagedObjectReference `xml:"_this"` + RoleId int32 `xml:"roleId"` + NewName string `xml:"newName"` + PrivIds []string `xml:"privIds,omitempty"` +} + +func init() { + t["UpdateAuthorizationRoleRequestType"] = reflect.TypeOf((*UpdateAuthorizationRoleRequestType)(nil)).Elem() +} + +type UpdateAuthorizationRoleResponse struct { +} + +type UpdateBootDevice UpdateBootDeviceRequestType + +func init() { + t["UpdateBootDevice"] = reflect.TypeOf((*UpdateBootDevice)(nil)).Elem() +} + +type UpdateBootDeviceRequestType struct { + This ManagedObjectReference `xml:"_this"` + Key string `xml:"key"` +} + +func init() { + t["UpdateBootDeviceRequestType"] = reflect.TypeOf((*UpdateBootDeviceRequestType)(nil)).Elem() +} + +type UpdateBootDeviceResponse struct { +} + +type UpdateChildResourceConfiguration UpdateChildResourceConfigurationRequestType + +func init() { + t["UpdateChildResourceConfiguration"] = reflect.TypeOf((*UpdateChildResourceConfiguration)(nil)).Elem() +} + +type UpdateChildResourceConfigurationRequestType struct { + This ManagedObjectReference `xml:"_this"` + Spec []ResourceConfigSpec `xml:"spec"` +} + +func init() { + t["UpdateChildResourceConfigurationRequestType"] = reflect.TypeOf((*UpdateChildResourceConfigurationRequestType)(nil)).Elem() +} + +type UpdateChildResourceConfigurationResponse struct { +} + +type UpdateClusterProfile UpdateClusterProfileRequestType + +func init() { + t["UpdateClusterProfile"] = reflect.TypeOf((*UpdateClusterProfile)(nil)).Elem() +} + +type UpdateClusterProfileRequestType struct { + This ManagedObjectReference `xml:"_this"` + Config BaseClusterProfileConfigSpec `xml:"config,typeattr"` +} + +func init() { + t["UpdateClusterProfileRequestType"] = reflect.TypeOf((*UpdateClusterProfileRequestType)(nil)).Elem() +} + +type UpdateClusterProfileResponse struct { +} + +type UpdateConfig UpdateConfigRequestType + +func init() { + t["UpdateConfig"] = reflect.TypeOf((*UpdateConfig)(nil)).Elem() +} + +type UpdateConfigRequestType struct { + This ManagedObjectReference `xml:"_this"` + Name string `xml:"name,omitempty"` + Config *ResourceConfigSpec `xml:"config,omitempty"` +} + +func init() { + t["UpdateConfigRequestType"] = reflect.TypeOf((*UpdateConfigRequestType)(nil)).Elem() +} + +type UpdateConfigResponse struct { +} + +type UpdateConsoleIpRouteConfig UpdateConsoleIpRouteConfigRequestType + +func init() { + t["UpdateConsoleIpRouteConfig"] = reflect.TypeOf((*UpdateConsoleIpRouteConfig)(nil)).Elem() +} + +type UpdateConsoleIpRouteConfigRequestType struct { + This ManagedObjectReference `xml:"_this"` + Config BaseHostIpRouteConfig `xml:"config,typeattr"` +} + +func init() { + t["UpdateConsoleIpRouteConfigRequestType"] = reflect.TypeOf((*UpdateConsoleIpRouteConfigRequestType)(nil)).Elem() +} + +type UpdateConsoleIpRouteConfigResponse struct { +} + +type UpdateCounterLevelMapping UpdateCounterLevelMappingRequestType + +func init() { + t["UpdateCounterLevelMapping"] = reflect.TypeOf((*UpdateCounterLevelMapping)(nil)).Elem() +} + +type UpdateCounterLevelMappingRequestType struct { + This ManagedObjectReference `xml:"_this"` + CounterLevelMap []PerformanceManagerCounterLevelMapping `xml:"counterLevelMap"` +} + +func init() { + t["UpdateCounterLevelMappingRequestType"] = reflect.TypeOf((*UpdateCounterLevelMappingRequestType)(nil)).Elem() +} + +type UpdateCounterLevelMappingResponse struct { +} + +type UpdateDVSHealthCheckConfigRequestType struct { + This ManagedObjectReference `xml:"_this"` + HealthCheckConfig []BaseDVSHealthCheckConfig `xml:"healthCheckConfig,typeattr"` +} + +func init() { + t["UpdateDVSHealthCheckConfigRequestType"] = reflect.TypeOf((*UpdateDVSHealthCheckConfigRequestType)(nil)).Elem() +} + +type UpdateDVSHealthCheckConfig_Task UpdateDVSHealthCheckConfigRequestType + +func init() { + t["UpdateDVSHealthCheckConfig_Task"] = reflect.TypeOf((*UpdateDVSHealthCheckConfig_Task)(nil)).Elem() +} + +type UpdateDVSHealthCheckConfig_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type UpdateDVSLacpGroupConfigRequestType struct { + This ManagedObjectReference `xml:"_this"` + LacpGroupSpec []VMwareDvsLacpGroupSpec `xml:"lacpGroupSpec"` +} + +func init() { + t["UpdateDVSLacpGroupConfigRequestType"] = reflect.TypeOf((*UpdateDVSLacpGroupConfigRequestType)(nil)).Elem() +} + +type UpdateDVSLacpGroupConfig_Task UpdateDVSLacpGroupConfigRequestType + +func init() { + t["UpdateDVSLacpGroupConfig_Task"] = reflect.TypeOf((*UpdateDVSLacpGroupConfig_Task)(nil)).Elem() +} + +type UpdateDVSLacpGroupConfig_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type UpdateDateTime UpdateDateTimeRequestType + +func init() { + t["UpdateDateTime"] = reflect.TypeOf((*UpdateDateTime)(nil)).Elem() +} + +type UpdateDateTimeConfig UpdateDateTimeConfigRequestType + +func init() { + t["UpdateDateTimeConfig"] = reflect.TypeOf((*UpdateDateTimeConfig)(nil)).Elem() +} + +type UpdateDateTimeConfigRequestType struct { + This ManagedObjectReference `xml:"_this"` + Config HostDateTimeConfig `xml:"config"` +} + +func init() { + t["UpdateDateTimeConfigRequestType"] = reflect.TypeOf((*UpdateDateTimeConfigRequestType)(nil)).Elem() +} + +type UpdateDateTimeConfigResponse struct { +} + +type UpdateDateTimeRequestType struct { + This ManagedObjectReference `xml:"_this"` + DateTime time.Time `xml:"dateTime"` +} + +func init() { + t["UpdateDateTimeRequestType"] = reflect.TypeOf((*UpdateDateTimeRequestType)(nil)).Elem() +} + +type UpdateDateTimeResponse struct { +} + +type UpdateDefaultPolicy UpdateDefaultPolicyRequestType + +func init() { + t["UpdateDefaultPolicy"] = reflect.TypeOf((*UpdateDefaultPolicy)(nil)).Elem() +} + +type UpdateDefaultPolicyRequestType struct { + This ManagedObjectReference `xml:"_this"` + DefaultPolicy HostFirewallDefaultPolicy `xml:"defaultPolicy"` +} + +func init() { + t["UpdateDefaultPolicyRequestType"] = reflect.TypeOf((*UpdateDefaultPolicyRequestType)(nil)).Elem() +} + +type UpdateDefaultPolicyResponse struct { +} + +type UpdateDiskPartitions UpdateDiskPartitionsRequestType + +func init() { + t["UpdateDiskPartitions"] = reflect.TypeOf((*UpdateDiskPartitions)(nil)).Elem() +} + +type UpdateDiskPartitionsRequestType struct { + This ManagedObjectReference `xml:"_this"` + DevicePath string `xml:"devicePath"` + Spec HostDiskPartitionSpec `xml:"spec"` +} + +func init() { + t["UpdateDiskPartitionsRequestType"] = reflect.TypeOf((*UpdateDiskPartitionsRequestType)(nil)).Elem() +} + +type UpdateDiskPartitionsResponse struct { +} + +type UpdateDnsConfig UpdateDnsConfigRequestType + +func init() { + t["UpdateDnsConfig"] = reflect.TypeOf((*UpdateDnsConfig)(nil)).Elem() +} + +type UpdateDnsConfigRequestType struct { + This ManagedObjectReference `xml:"_this"` + Config BaseHostDnsConfig `xml:"config,typeattr"` +} + +func init() { + t["UpdateDnsConfigRequestType"] = reflect.TypeOf((*UpdateDnsConfigRequestType)(nil)).Elem() +} + +type UpdateDnsConfigResponse struct { +} + +type UpdateDvsCapability UpdateDvsCapabilityRequestType + +func init() { + t["UpdateDvsCapability"] = reflect.TypeOf((*UpdateDvsCapability)(nil)).Elem() +} + +type UpdateDvsCapabilityRequestType struct { + This ManagedObjectReference `xml:"_this"` + Capability DVSCapability `xml:"capability"` +} + +func init() { + t["UpdateDvsCapabilityRequestType"] = reflect.TypeOf((*UpdateDvsCapabilityRequestType)(nil)).Elem() +} + +type UpdateDvsCapabilityResponse struct { +} + +type UpdateExtension UpdateExtensionRequestType + +func init() { + t["UpdateExtension"] = reflect.TypeOf((*UpdateExtension)(nil)).Elem() +} + +type UpdateExtensionRequestType struct { + This ManagedObjectReference `xml:"_this"` + Extension Extension `xml:"extension"` +} + +func init() { + t["UpdateExtensionRequestType"] = reflect.TypeOf((*UpdateExtensionRequestType)(nil)).Elem() +} + +type UpdateExtensionResponse struct { +} + +type UpdateFlags UpdateFlagsRequestType + +func init() { + t["UpdateFlags"] = reflect.TypeOf((*UpdateFlags)(nil)).Elem() +} + +type UpdateFlagsRequestType struct { + This ManagedObjectReference `xml:"_this"` + FlagInfo HostFlagInfo `xml:"flagInfo"` +} + +func init() { + t["UpdateFlagsRequestType"] = reflect.TypeOf((*UpdateFlagsRequestType)(nil)).Elem() +} + +type UpdateFlagsResponse struct { +} + +type UpdateHostImageAcceptanceLevel UpdateHostImageAcceptanceLevelRequestType + +func init() { + t["UpdateHostImageAcceptanceLevel"] = reflect.TypeOf((*UpdateHostImageAcceptanceLevel)(nil)).Elem() +} + +type UpdateHostImageAcceptanceLevelRequestType struct { + This ManagedObjectReference `xml:"_this"` + NewAcceptanceLevel string `xml:"newAcceptanceLevel"` +} + +func init() { + t["UpdateHostImageAcceptanceLevelRequestType"] = reflect.TypeOf((*UpdateHostImageAcceptanceLevelRequestType)(nil)).Elem() +} + +type UpdateHostImageAcceptanceLevelResponse struct { +} + +type UpdateHostProfile UpdateHostProfileRequestType + +func init() { + t["UpdateHostProfile"] = reflect.TypeOf((*UpdateHostProfile)(nil)).Elem() +} + +type UpdateHostProfileRequestType struct { + This ManagedObjectReference `xml:"_this"` + Config BaseHostProfileConfigSpec `xml:"config,typeattr"` +} + +func init() { + t["UpdateHostProfileRequestType"] = reflect.TypeOf((*UpdateHostProfileRequestType)(nil)).Elem() +} + +type UpdateHostProfileResponse struct { +} + +type UpdateInternetScsiAdvancedOptions UpdateInternetScsiAdvancedOptionsRequestType + +func init() { + t["UpdateInternetScsiAdvancedOptions"] = reflect.TypeOf((*UpdateInternetScsiAdvancedOptions)(nil)).Elem() +} + +type UpdateInternetScsiAdvancedOptionsRequestType struct { + This ManagedObjectReference `xml:"_this"` + IScsiHbaDevice string `xml:"iScsiHbaDevice"` + TargetSet *HostInternetScsiHbaTargetSet `xml:"targetSet,omitempty"` + Options []HostInternetScsiHbaParamValue `xml:"options"` +} + +func init() { + t["UpdateInternetScsiAdvancedOptionsRequestType"] = reflect.TypeOf((*UpdateInternetScsiAdvancedOptionsRequestType)(nil)).Elem() +} + +type UpdateInternetScsiAdvancedOptionsResponse struct { +} + +type UpdateInternetScsiAlias UpdateInternetScsiAliasRequestType + +func init() { + t["UpdateInternetScsiAlias"] = reflect.TypeOf((*UpdateInternetScsiAlias)(nil)).Elem() +} + +type UpdateInternetScsiAliasRequestType struct { + This ManagedObjectReference `xml:"_this"` + IScsiHbaDevice string `xml:"iScsiHbaDevice"` + IScsiAlias string `xml:"iScsiAlias"` +} + +func init() { + t["UpdateInternetScsiAliasRequestType"] = reflect.TypeOf((*UpdateInternetScsiAliasRequestType)(nil)).Elem() +} + +type UpdateInternetScsiAliasResponse struct { +} + +type UpdateInternetScsiAuthenticationProperties UpdateInternetScsiAuthenticationPropertiesRequestType + +func init() { + t["UpdateInternetScsiAuthenticationProperties"] = reflect.TypeOf((*UpdateInternetScsiAuthenticationProperties)(nil)).Elem() +} + +type UpdateInternetScsiAuthenticationPropertiesRequestType struct { + This ManagedObjectReference `xml:"_this"` + IScsiHbaDevice string `xml:"iScsiHbaDevice"` + AuthenticationProperties HostInternetScsiHbaAuthenticationProperties `xml:"authenticationProperties"` + TargetSet *HostInternetScsiHbaTargetSet `xml:"targetSet,omitempty"` +} + +func init() { + t["UpdateInternetScsiAuthenticationPropertiesRequestType"] = reflect.TypeOf((*UpdateInternetScsiAuthenticationPropertiesRequestType)(nil)).Elem() +} + +type UpdateInternetScsiAuthenticationPropertiesResponse struct { +} + +type UpdateInternetScsiDigestProperties UpdateInternetScsiDigestPropertiesRequestType + +func init() { + t["UpdateInternetScsiDigestProperties"] = reflect.TypeOf((*UpdateInternetScsiDigestProperties)(nil)).Elem() +} + +type UpdateInternetScsiDigestPropertiesRequestType struct { + This ManagedObjectReference `xml:"_this"` + IScsiHbaDevice string `xml:"iScsiHbaDevice"` + TargetSet *HostInternetScsiHbaTargetSet `xml:"targetSet,omitempty"` + DigestProperties HostInternetScsiHbaDigestProperties `xml:"digestProperties"` +} + +func init() { + t["UpdateInternetScsiDigestPropertiesRequestType"] = reflect.TypeOf((*UpdateInternetScsiDigestPropertiesRequestType)(nil)).Elem() +} + +type UpdateInternetScsiDigestPropertiesResponse struct { +} + +type UpdateInternetScsiDiscoveryProperties UpdateInternetScsiDiscoveryPropertiesRequestType + +func init() { + t["UpdateInternetScsiDiscoveryProperties"] = reflect.TypeOf((*UpdateInternetScsiDiscoveryProperties)(nil)).Elem() +} + +type UpdateInternetScsiDiscoveryPropertiesRequestType struct { + This ManagedObjectReference `xml:"_this"` + IScsiHbaDevice string `xml:"iScsiHbaDevice"` + DiscoveryProperties HostInternetScsiHbaDiscoveryProperties `xml:"discoveryProperties"` +} + +func init() { + t["UpdateInternetScsiDiscoveryPropertiesRequestType"] = reflect.TypeOf((*UpdateInternetScsiDiscoveryPropertiesRequestType)(nil)).Elem() +} + +type UpdateInternetScsiDiscoveryPropertiesResponse struct { +} + +type UpdateInternetScsiIPProperties UpdateInternetScsiIPPropertiesRequestType + +func init() { + t["UpdateInternetScsiIPProperties"] = reflect.TypeOf((*UpdateInternetScsiIPProperties)(nil)).Elem() +} + +type UpdateInternetScsiIPPropertiesRequestType struct { + This ManagedObjectReference `xml:"_this"` + IScsiHbaDevice string `xml:"iScsiHbaDevice"` + IpProperties HostInternetScsiHbaIPProperties `xml:"ipProperties"` +} + +func init() { + t["UpdateInternetScsiIPPropertiesRequestType"] = reflect.TypeOf((*UpdateInternetScsiIPPropertiesRequestType)(nil)).Elem() +} + +type UpdateInternetScsiIPPropertiesResponse struct { +} + +type UpdateInternetScsiName UpdateInternetScsiNameRequestType + +func init() { + t["UpdateInternetScsiName"] = reflect.TypeOf((*UpdateInternetScsiName)(nil)).Elem() +} + +type UpdateInternetScsiNameRequestType struct { + This ManagedObjectReference `xml:"_this"` + IScsiHbaDevice string `xml:"iScsiHbaDevice"` + IScsiName string `xml:"iScsiName"` +} + +func init() { + t["UpdateInternetScsiNameRequestType"] = reflect.TypeOf((*UpdateInternetScsiNameRequestType)(nil)).Elem() +} + +type UpdateInternetScsiNameResponse struct { +} + +type UpdateIpConfig UpdateIpConfigRequestType + +func init() { + t["UpdateIpConfig"] = reflect.TypeOf((*UpdateIpConfig)(nil)).Elem() +} + +type UpdateIpConfigRequestType struct { + This ManagedObjectReference `xml:"_this"` + IpConfig HostIpConfig `xml:"ipConfig"` +} + +func init() { + t["UpdateIpConfigRequestType"] = reflect.TypeOf((*UpdateIpConfigRequestType)(nil)).Elem() +} + +type UpdateIpConfigResponse struct { +} + +type UpdateIpPool UpdateIpPoolRequestType + +func init() { + t["UpdateIpPool"] = reflect.TypeOf((*UpdateIpPool)(nil)).Elem() +} + +type UpdateIpPoolRequestType struct { + This ManagedObjectReference `xml:"_this"` + Dc ManagedObjectReference `xml:"dc"` + Pool IpPool `xml:"pool"` +} + +func init() { + t["UpdateIpPoolRequestType"] = reflect.TypeOf((*UpdateIpPoolRequestType)(nil)).Elem() +} + +type UpdateIpPoolResponse struct { +} + +type UpdateIpRouteConfig UpdateIpRouteConfigRequestType + +func init() { + t["UpdateIpRouteConfig"] = reflect.TypeOf((*UpdateIpRouteConfig)(nil)).Elem() +} + +type UpdateIpRouteConfigRequestType struct { + This ManagedObjectReference `xml:"_this"` + Config BaseHostIpRouteConfig `xml:"config,typeattr"` +} + +func init() { + t["UpdateIpRouteConfigRequestType"] = reflect.TypeOf((*UpdateIpRouteConfigRequestType)(nil)).Elem() +} + +type UpdateIpRouteConfigResponse struct { +} + +type UpdateIpRouteTableConfig UpdateIpRouteTableConfigRequestType + +func init() { + t["UpdateIpRouteTableConfig"] = reflect.TypeOf((*UpdateIpRouteTableConfig)(nil)).Elem() +} + +type UpdateIpRouteTableConfigRequestType struct { + This ManagedObjectReference `xml:"_this"` + Config HostIpRouteTableConfig `xml:"config"` +} + +func init() { + t["UpdateIpRouteTableConfigRequestType"] = reflect.TypeOf((*UpdateIpRouteTableConfigRequestType)(nil)).Elem() +} + +type UpdateIpRouteTableConfigResponse struct { +} + +type UpdateIpmi UpdateIpmiRequestType + +func init() { + t["UpdateIpmi"] = reflect.TypeOf((*UpdateIpmi)(nil)).Elem() +} + +type UpdateIpmiRequestType struct { + This ManagedObjectReference `xml:"_this"` + IpmiInfo HostIpmiInfo `xml:"ipmiInfo"` +} + +func init() { + t["UpdateIpmiRequestType"] = reflect.TypeOf((*UpdateIpmiRequestType)(nil)).Elem() +} + +type UpdateIpmiResponse struct { +} + +type UpdateLicense UpdateLicenseRequestType + +func init() { + t["UpdateLicense"] = reflect.TypeOf((*UpdateLicense)(nil)).Elem() +} + +type UpdateLicenseLabel UpdateLicenseLabelRequestType + +func init() { + t["UpdateLicenseLabel"] = reflect.TypeOf((*UpdateLicenseLabel)(nil)).Elem() +} + +type UpdateLicenseLabelRequestType struct { + This ManagedObjectReference `xml:"_this"` + LicenseKey string `xml:"licenseKey"` + LabelKey string `xml:"labelKey"` + LabelValue string `xml:"labelValue"` +} + +func init() { + t["UpdateLicenseLabelRequestType"] = reflect.TypeOf((*UpdateLicenseLabelRequestType)(nil)).Elem() +} + +type UpdateLicenseLabelResponse struct { +} + +type UpdateLicenseRequestType struct { + This ManagedObjectReference `xml:"_this"` + LicenseKey string `xml:"licenseKey"` + Labels []KeyValue `xml:"labels,omitempty"` +} + +func init() { + t["UpdateLicenseRequestType"] = reflect.TypeOf((*UpdateLicenseRequestType)(nil)).Elem() +} + +type UpdateLicenseResponse struct { + Returnval LicenseManagerLicenseInfo `xml:"returnval"` +} + +type UpdateLinkedChildren UpdateLinkedChildrenRequestType + +func init() { + t["UpdateLinkedChildren"] = reflect.TypeOf((*UpdateLinkedChildren)(nil)).Elem() +} + +type UpdateLinkedChildrenRequestType struct { + This ManagedObjectReference `xml:"_this"` + AddChangeSet []VirtualAppLinkInfo `xml:"addChangeSet,omitempty"` + RemoveSet []ManagedObjectReference `xml:"removeSet,omitempty"` +} + +func init() { + t["UpdateLinkedChildrenRequestType"] = reflect.TypeOf((*UpdateLinkedChildrenRequestType)(nil)).Elem() +} + +type UpdateLinkedChildrenResponse struct { +} + +type UpdateLocalSwapDatastore UpdateLocalSwapDatastoreRequestType + +func init() { + t["UpdateLocalSwapDatastore"] = reflect.TypeOf((*UpdateLocalSwapDatastore)(nil)).Elem() +} + +type UpdateLocalSwapDatastoreRequestType struct { + This ManagedObjectReference `xml:"_this"` + Datastore *ManagedObjectReference `xml:"datastore,omitempty"` +} + +func init() { + t["UpdateLocalSwapDatastoreRequestType"] = reflect.TypeOf((*UpdateLocalSwapDatastoreRequestType)(nil)).Elem() +} + +type UpdateLocalSwapDatastoreResponse struct { +} + +type UpdateLockdownExceptions UpdateLockdownExceptionsRequestType + +func init() { + t["UpdateLockdownExceptions"] = reflect.TypeOf((*UpdateLockdownExceptions)(nil)).Elem() +} + +type UpdateLockdownExceptionsRequestType struct { + This ManagedObjectReference `xml:"_this"` + Users []string `xml:"users,omitempty"` +} + +func init() { + t["UpdateLockdownExceptionsRequestType"] = reflect.TypeOf((*UpdateLockdownExceptionsRequestType)(nil)).Elem() +} + +type UpdateLockdownExceptionsResponse struct { +} + +type UpdateModuleOptionString UpdateModuleOptionStringRequestType + +func init() { + t["UpdateModuleOptionString"] = reflect.TypeOf((*UpdateModuleOptionString)(nil)).Elem() +} + +type UpdateModuleOptionStringRequestType struct { + This ManagedObjectReference `xml:"_this"` + Name string `xml:"name"` + Options string `xml:"options"` +} + +func init() { + t["UpdateModuleOptionStringRequestType"] = reflect.TypeOf((*UpdateModuleOptionStringRequestType)(nil)).Elem() +} + +type UpdateModuleOptionStringResponse struct { +} + +type UpdateNetworkConfig UpdateNetworkConfigRequestType + +func init() { + t["UpdateNetworkConfig"] = reflect.TypeOf((*UpdateNetworkConfig)(nil)).Elem() +} + +type UpdateNetworkConfigRequestType struct { + This ManagedObjectReference `xml:"_this"` + Config HostNetworkConfig `xml:"config"` + ChangeMode string `xml:"changeMode"` +} + +func init() { + t["UpdateNetworkConfigRequestType"] = reflect.TypeOf((*UpdateNetworkConfigRequestType)(nil)).Elem() +} + +type UpdateNetworkConfigResponse struct { + Returnval HostNetworkConfigResult `xml:"returnval"` +} + +type UpdateNetworkResourcePool UpdateNetworkResourcePoolRequestType + +func init() { + t["UpdateNetworkResourcePool"] = reflect.TypeOf((*UpdateNetworkResourcePool)(nil)).Elem() +} + +type UpdateNetworkResourcePoolRequestType struct { + This ManagedObjectReference `xml:"_this"` + ConfigSpec []DVSNetworkResourcePoolConfigSpec `xml:"configSpec"` +} + +func init() { + t["UpdateNetworkResourcePoolRequestType"] = reflect.TypeOf((*UpdateNetworkResourcePoolRequestType)(nil)).Elem() +} + +type UpdateNetworkResourcePoolResponse struct { +} + +type UpdateOptions UpdateOptionsRequestType + +func init() { + t["UpdateOptions"] = reflect.TypeOf((*UpdateOptions)(nil)).Elem() +} + +type UpdateOptionsRequestType struct { + This ManagedObjectReference `xml:"_this"` + ChangedValue []BaseOptionValue `xml:"changedValue,typeattr"` +} + +func init() { + t["UpdateOptionsRequestType"] = reflect.TypeOf((*UpdateOptionsRequestType)(nil)).Elem() +} + +type UpdateOptionsResponse struct { +} + +type UpdatePassthruConfig UpdatePassthruConfigRequestType + +func init() { + t["UpdatePassthruConfig"] = reflect.TypeOf((*UpdatePassthruConfig)(nil)).Elem() +} + +type UpdatePassthruConfigRequestType struct { + This ManagedObjectReference `xml:"_this"` + Config []BaseHostPciPassthruConfig `xml:"config,typeattr"` +} + +func init() { + t["UpdatePassthruConfigRequestType"] = reflect.TypeOf((*UpdatePassthruConfigRequestType)(nil)).Elem() +} + +type UpdatePassthruConfigResponse struct { +} + +type UpdatePerfInterval UpdatePerfIntervalRequestType + +func init() { + t["UpdatePerfInterval"] = reflect.TypeOf((*UpdatePerfInterval)(nil)).Elem() +} + +type UpdatePerfIntervalRequestType struct { + This ManagedObjectReference `xml:"_this"` + Interval PerfInterval `xml:"interval"` +} + +func init() { + t["UpdatePerfIntervalRequestType"] = reflect.TypeOf((*UpdatePerfIntervalRequestType)(nil)).Elem() +} + +type UpdatePerfIntervalResponse struct { +} + +type UpdatePhysicalNicLinkSpeed UpdatePhysicalNicLinkSpeedRequestType + +func init() { + t["UpdatePhysicalNicLinkSpeed"] = reflect.TypeOf((*UpdatePhysicalNicLinkSpeed)(nil)).Elem() +} + +type UpdatePhysicalNicLinkSpeedRequestType struct { + This ManagedObjectReference `xml:"_this"` + Device string `xml:"device"` + LinkSpeed *PhysicalNicLinkInfo `xml:"linkSpeed,omitempty"` +} + +func init() { + t["UpdatePhysicalNicLinkSpeedRequestType"] = reflect.TypeOf((*UpdatePhysicalNicLinkSpeedRequestType)(nil)).Elem() +} + +type UpdatePhysicalNicLinkSpeedResponse struct { +} + +type UpdatePortGroup UpdatePortGroupRequestType + +func init() { + t["UpdatePortGroup"] = reflect.TypeOf((*UpdatePortGroup)(nil)).Elem() +} + +type UpdatePortGroupRequestType struct { + This ManagedObjectReference `xml:"_this"` + PgName string `xml:"pgName"` + Portgrp HostPortGroupSpec `xml:"portgrp"` +} + +func init() { + t["UpdatePortGroupRequestType"] = reflect.TypeOf((*UpdatePortGroupRequestType)(nil)).Elem() +} + +type UpdatePortGroupResponse struct { +} + +type UpdateProgress UpdateProgressRequestType + +func init() { + t["UpdateProgress"] = reflect.TypeOf((*UpdateProgress)(nil)).Elem() +} + +type UpdateProgressRequestType struct { + This ManagedObjectReference `xml:"_this"` + PercentDone int32 `xml:"percentDone"` +} + +func init() { + t["UpdateProgressRequestType"] = reflect.TypeOf((*UpdateProgressRequestType)(nil)).Elem() +} + +type UpdateProgressResponse struct { +} + +type UpdateReferenceHost UpdateReferenceHostRequestType + +func init() { + t["UpdateReferenceHost"] = reflect.TypeOf((*UpdateReferenceHost)(nil)).Elem() +} + +type UpdateReferenceHostRequestType struct { + This ManagedObjectReference `xml:"_this"` + Host *ManagedObjectReference `xml:"host,omitempty"` +} + +func init() { + t["UpdateReferenceHostRequestType"] = reflect.TypeOf((*UpdateReferenceHostRequestType)(nil)).Elem() +} + +type UpdateReferenceHostResponse struct { +} + +type UpdateRuleset UpdateRulesetRequestType + +func init() { + t["UpdateRuleset"] = reflect.TypeOf((*UpdateRuleset)(nil)).Elem() +} + +type UpdateRulesetRequestType struct { + This ManagedObjectReference `xml:"_this"` + Id string `xml:"id"` + Spec HostFirewallRulesetRulesetSpec `xml:"spec"` +} + +func init() { + t["UpdateRulesetRequestType"] = reflect.TypeOf((*UpdateRulesetRequestType)(nil)).Elem() +} + +type UpdateRulesetResponse struct { +} + +type UpdateScsiLunDisplayName UpdateScsiLunDisplayNameRequestType + +func init() { + t["UpdateScsiLunDisplayName"] = reflect.TypeOf((*UpdateScsiLunDisplayName)(nil)).Elem() +} + +type UpdateScsiLunDisplayNameRequestType struct { + This ManagedObjectReference `xml:"_this"` + LunUuid string `xml:"lunUuid"` + DisplayName string `xml:"displayName"` +} + +func init() { + t["UpdateScsiLunDisplayNameRequestType"] = reflect.TypeOf((*UpdateScsiLunDisplayNameRequestType)(nil)).Elem() +} + +type UpdateScsiLunDisplayNameResponse struct { +} + +type UpdateServiceConsoleVirtualNic UpdateServiceConsoleVirtualNicRequestType + +func init() { + t["UpdateServiceConsoleVirtualNic"] = reflect.TypeOf((*UpdateServiceConsoleVirtualNic)(nil)).Elem() +} + +type UpdateServiceConsoleVirtualNicRequestType struct { + This ManagedObjectReference `xml:"_this"` + Device string `xml:"device"` + Nic HostVirtualNicSpec `xml:"nic"` +} + +func init() { + t["UpdateServiceConsoleVirtualNicRequestType"] = reflect.TypeOf((*UpdateServiceConsoleVirtualNicRequestType)(nil)).Elem() +} + +type UpdateServiceConsoleVirtualNicResponse struct { +} + +type UpdateServiceMessage UpdateServiceMessageRequestType + +func init() { + t["UpdateServiceMessage"] = reflect.TypeOf((*UpdateServiceMessage)(nil)).Elem() +} + +type UpdateServiceMessageRequestType struct { + This ManagedObjectReference `xml:"_this"` + Message string `xml:"message"` +} + +func init() { + t["UpdateServiceMessageRequestType"] = reflect.TypeOf((*UpdateServiceMessageRequestType)(nil)).Elem() +} + +type UpdateServiceMessageResponse struct { +} + +type UpdateServicePolicy UpdateServicePolicyRequestType + +func init() { + t["UpdateServicePolicy"] = reflect.TypeOf((*UpdateServicePolicy)(nil)).Elem() +} + +type UpdateServicePolicyRequestType struct { + This ManagedObjectReference `xml:"_this"` + Id string `xml:"id"` + Policy string `xml:"policy"` +} + +func init() { + t["UpdateServicePolicyRequestType"] = reflect.TypeOf((*UpdateServicePolicyRequestType)(nil)).Elem() +} + +type UpdateServicePolicyResponse struct { +} + +type UpdateSet struct { + DynamicData + + Version string `xml:"version"` + FilterSet []PropertyFilterUpdate `xml:"filterSet,omitempty"` + Truncated *bool `xml:"truncated"` +} + +func init() { + t["UpdateSet"] = reflect.TypeOf((*UpdateSet)(nil)).Elem() +} + +type UpdateSoftwareInternetScsiEnabled UpdateSoftwareInternetScsiEnabledRequestType + +func init() { + t["UpdateSoftwareInternetScsiEnabled"] = reflect.TypeOf((*UpdateSoftwareInternetScsiEnabled)(nil)).Elem() +} + +type UpdateSoftwareInternetScsiEnabledRequestType struct { + This ManagedObjectReference `xml:"_this"` + Enabled bool `xml:"enabled"` +} + +func init() { + t["UpdateSoftwareInternetScsiEnabledRequestType"] = reflect.TypeOf((*UpdateSoftwareInternetScsiEnabledRequestType)(nil)).Elem() +} + +type UpdateSoftwareInternetScsiEnabledResponse struct { +} + +type UpdateSystemResources UpdateSystemResourcesRequestType + +func init() { + t["UpdateSystemResources"] = reflect.TypeOf((*UpdateSystemResources)(nil)).Elem() +} + +type UpdateSystemResourcesRequestType struct { + This ManagedObjectReference `xml:"_this"` + ResourceInfo HostSystemResourceInfo `xml:"resourceInfo"` +} + +func init() { + t["UpdateSystemResourcesRequestType"] = reflect.TypeOf((*UpdateSystemResourcesRequestType)(nil)).Elem() +} + +type UpdateSystemResourcesResponse struct { +} + +type UpdateSystemSwapConfiguration UpdateSystemSwapConfigurationRequestType + +func init() { + t["UpdateSystemSwapConfiguration"] = reflect.TypeOf((*UpdateSystemSwapConfiguration)(nil)).Elem() +} + +type UpdateSystemSwapConfigurationRequestType struct { + This ManagedObjectReference `xml:"_this"` + SysSwapConfig HostSystemSwapConfiguration `xml:"sysSwapConfig"` +} + +func init() { + t["UpdateSystemSwapConfigurationRequestType"] = reflect.TypeOf((*UpdateSystemSwapConfigurationRequestType)(nil)).Elem() +} + +type UpdateSystemSwapConfigurationResponse struct { +} + +type UpdateSystemUsers UpdateSystemUsersRequestType + +func init() { + t["UpdateSystemUsers"] = reflect.TypeOf((*UpdateSystemUsers)(nil)).Elem() +} + +type UpdateSystemUsersRequestType struct { + This ManagedObjectReference `xml:"_this"` + Users []string `xml:"users,omitempty"` +} + +func init() { + t["UpdateSystemUsersRequestType"] = reflect.TypeOf((*UpdateSystemUsersRequestType)(nil)).Elem() +} + +type UpdateSystemUsersResponse struct { +} + +type UpdateUser UpdateUserRequestType + +func init() { + t["UpdateUser"] = reflect.TypeOf((*UpdateUser)(nil)).Elem() +} + +type UpdateUserRequestType struct { + This ManagedObjectReference `xml:"_this"` + User BaseHostAccountSpec `xml:"user,typeattr"` +} + +func init() { + t["UpdateUserRequestType"] = reflect.TypeOf((*UpdateUserRequestType)(nil)).Elem() +} + +type UpdateUserResponse struct { +} + +type UpdateVAppConfig UpdateVAppConfigRequestType + +func init() { + t["UpdateVAppConfig"] = reflect.TypeOf((*UpdateVAppConfig)(nil)).Elem() +} + +type UpdateVAppConfigRequestType struct { + This ManagedObjectReference `xml:"_this"` + Spec VAppConfigSpec `xml:"spec"` +} + +func init() { + t["UpdateVAppConfigRequestType"] = reflect.TypeOf((*UpdateVAppConfigRequestType)(nil)).Elem() +} + +type UpdateVAppConfigResponse struct { +} + +type UpdateVirtualMachineFilesRequestType struct { + This ManagedObjectReference `xml:"_this"` + MountPathDatastoreMapping []DatastoreMountPathDatastorePair `xml:"mountPathDatastoreMapping"` +} + +func init() { + t["UpdateVirtualMachineFilesRequestType"] = reflect.TypeOf((*UpdateVirtualMachineFilesRequestType)(nil)).Elem() +} + +type UpdateVirtualMachineFilesResult struct { + DynamicData + + FailedVmFile []UpdateVirtualMachineFilesResultFailedVmFileInfo `xml:"failedVmFile,omitempty"` +} + +func init() { + t["UpdateVirtualMachineFilesResult"] = reflect.TypeOf((*UpdateVirtualMachineFilesResult)(nil)).Elem() +} + +type UpdateVirtualMachineFilesResultFailedVmFileInfo struct { + DynamicData + + VmFile string `xml:"vmFile"` + Fault LocalizedMethodFault `xml:"fault"` +} + +func init() { + t["UpdateVirtualMachineFilesResultFailedVmFileInfo"] = reflect.TypeOf((*UpdateVirtualMachineFilesResultFailedVmFileInfo)(nil)).Elem() +} + +type UpdateVirtualMachineFiles_Task UpdateVirtualMachineFilesRequestType + +func init() { + t["UpdateVirtualMachineFiles_Task"] = reflect.TypeOf((*UpdateVirtualMachineFiles_Task)(nil)).Elem() +} + +type UpdateVirtualMachineFiles_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type UpdateVirtualNic UpdateVirtualNicRequestType + +func init() { + t["UpdateVirtualNic"] = reflect.TypeOf((*UpdateVirtualNic)(nil)).Elem() +} + +type UpdateVirtualNicRequestType struct { + This ManagedObjectReference `xml:"_this"` + Device string `xml:"device"` + Nic HostVirtualNicSpec `xml:"nic"` +} + +func init() { + t["UpdateVirtualNicRequestType"] = reflect.TypeOf((*UpdateVirtualNicRequestType)(nil)).Elem() +} + +type UpdateVirtualNicResponse struct { +} + +type UpdateVirtualSwitch UpdateVirtualSwitchRequestType + +func init() { + t["UpdateVirtualSwitch"] = reflect.TypeOf((*UpdateVirtualSwitch)(nil)).Elem() +} + +type UpdateVirtualSwitchRequestType struct { + This ManagedObjectReference `xml:"_this"` + VswitchName string `xml:"vswitchName"` + Spec HostVirtualSwitchSpec `xml:"spec"` +} + +func init() { + t["UpdateVirtualSwitchRequestType"] = reflect.TypeOf((*UpdateVirtualSwitchRequestType)(nil)).Elem() +} + +type UpdateVirtualSwitchResponse struct { +} + +type UpdateVsanRequestType struct { + This ManagedObjectReference `xml:"_this"` + Config VsanHostConfigInfo `xml:"config"` +} + +func init() { + t["UpdateVsanRequestType"] = reflect.TypeOf((*UpdateVsanRequestType)(nil)).Elem() +} + +type UpdateVsan_Task UpdateVsanRequestType + +func init() { + t["UpdateVsan_Task"] = reflect.TypeOf((*UpdateVsan_Task)(nil)).Elem() +} + +type UpdateVsan_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type UpdatedAgentBeingRestartedEvent struct { + HostEvent +} + +func init() { + t["UpdatedAgentBeingRestartedEvent"] = reflect.TypeOf((*UpdatedAgentBeingRestartedEvent)(nil)).Elem() +} + +type UpgradeEvent struct { + Event + + Message string `xml:"message"` +} + +func init() { + t["UpgradeEvent"] = reflect.TypeOf((*UpgradeEvent)(nil)).Elem() +} + +type UpgradeIoFilterRequestType struct { + This ManagedObjectReference `xml:"_this"` + FilterId string `xml:"filterId"` + CompRes ManagedObjectReference `xml:"compRes"` + VibUrl string `xml:"vibUrl"` +} + +func init() { + t["UpgradeIoFilterRequestType"] = reflect.TypeOf((*UpgradeIoFilterRequestType)(nil)).Elem() +} + +type UpgradeIoFilter_Task UpgradeIoFilterRequestType + +func init() { + t["UpgradeIoFilter_Task"] = reflect.TypeOf((*UpgradeIoFilter_Task)(nil)).Elem() +} + +type UpgradeIoFilter_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type UpgradeToolsRequestType struct { + This ManagedObjectReference `xml:"_this"` + InstallerOptions string `xml:"installerOptions,omitempty"` +} + +func init() { + t["UpgradeToolsRequestType"] = reflect.TypeOf((*UpgradeToolsRequestType)(nil)).Elem() +} + +type UpgradeTools_Task UpgradeToolsRequestType + +func init() { + t["UpgradeTools_Task"] = reflect.TypeOf((*UpgradeTools_Task)(nil)).Elem() +} + +type UpgradeTools_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type UpgradeVMRequestType struct { + This ManagedObjectReference `xml:"_this"` + Version string `xml:"version,omitempty"` +} + +func init() { + t["UpgradeVMRequestType"] = reflect.TypeOf((*UpgradeVMRequestType)(nil)).Elem() +} + +type UpgradeVM_Task UpgradeVMRequestType + +func init() { + t["UpgradeVM_Task"] = reflect.TypeOf((*UpgradeVM_Task)(nil)).Elem() +} + +type UpgradeVM_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type UpgradeVmLayout UpgradeVmLayoutRequestType + +func init() { + t["UpgradeVmLayout"] = reflect.TypeOf((*UpgradeVmLayout)(nil)).Elem() +} + +type UpgradeVmLayoutRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["UpgradeVmLayoutRequestType"] = reflect.TypeOf((*UpgradeVmLayoutRequestType)(nil)).Elem() +} + +type UpgradeVmLayoutResponse struct { +} + +type UpgradeVmfs UpgradeVmfsRequestType + +func init() { + t["UpgradeVmfs"] = reflect.TypeOf((*UpgradeVmfs)(nil)).Elem() +} + +type UpgradeVmfsRequestType struct { + This ManagedObjectReference `xml:"_this"` + VmfsPath string `xml:"vmfsPath"` +} + +func init() { + t["UpgradeVmfsRequestType"] = reflect.TypeOf((*UpgradeVmfsRequestType)(nil)).Elem() +} + +type UpgradeVmfsResponse struct { +} + +type UpgradeVsanObjects UpgradeVsanObjectsRequestType + +func init() { + t["UpgradeVsanObjects"] = reflect.TypeOf((*UpgradeVsanObjects)(nil)).Elem() +} + +type UpgradeVsanObjectsRequestType struct { + This ManagedObjectReference `xml:"_this"` + Uuids []string `xml:"uuids"` + NewVersion int32 `xml:"newVersion"` +} + +func init() { + t["UpgradeVsanObjectsRequestType"] = reflect.TypeOf((*UpgradeVsanObjectsRequestType)(nil)).Elem() +} + +type UpgradeVsanObjectsResponse struct { + Returnval []HostVsanInternalSystemVsanObjectOperationResult `xml:"returnval,omitempty"` +} + +type UplinkPortMtuNotSupportEvent struct { + DvsHealthStatusChangeEvent +} + +func init() { + t["UplinkPortMtuNotSupportEvent"] = reflect.TypeOf((*UplinkPortMtuNotSupportEvent)(nil)).Elem() +} + +type UplinkPortMtuSupportEvent struct { + DvsHealthStatusChangeEvent +} + +func init() { + t["UplinkPortMtuSupportEvent"] = reflect.TypeOf((*UplinkPortMtuSupportEvent)(nil)).Elem() +} + +type UplinkPortVlanTrunkedEvent struct { + DvsHealthStatusChangeEvent +} + +func init() { + t["UplinkPortVlanTrunkedEvent"] = reflect.TypeOf((*UplinkPortVlanTrunkedEvent)(nil)).Elem() +} + +type UplinkPortVlanUntrunkedEvent struct { + DvsHealthStatusChangeEvent +} + +func init() { + t["UplinkPortVlanUntrunkedEvent"] = reflect.TypeOf((*UplinkPortVlanUntrunkedEvent)(nil)).Elem() +} + +type UserAssignedToGroup struct { + HostEvent + + UserLogin string `xml:"userLogin"` + Group string `xml:"group"` +} + +func init() { + t["UserAssignedToGroup"] = reflect.TypeOf((*UserAssignedToGroup)(nil)).Elem() +} + +type UserGroupProfile struct { + ApplyProfile + + Key string `xml:"key"` +} + +func init() { + t["UserGroupProfile"] = reflect.TypeOf((*UserGroupProfile)(nil)).Elem() +} + +type UserInputRequiredParameterMetadata struct { + ProfilePolicyOptionMetadata + + UserInputParameter []ProfileParameterMetadata `xml:"userInputParameter,omitempty"` +} + +func init() { + t["UserInputRequiredParameterMetadata"] = reflect.TypeOf((*UserInputRequiredParameterMetadata)(nil)).Elem() +} + +type UserLoginSessionEvent struct { + SessionEvent + + IpAddress string `xml:"ipAddress"` + UserAgent string `xml:"userAgent,omitempty"` + Locale string `xml:"locale"` + SessionId string `xml:"sessionId"` +} + +func init() { + t["UserLoginSessionEvent"] = reflect.TypeOf((*UserLoginSessionEvent)(nil)).Elem() +} + +type UserLogoutSessionEvent struct { + SessionEvent + + IpAddress string `xml:"ipAddress,omitempty"` + UserAgent string `xml:"userAgent,omitempty"` + CallCount int64 `xml:"callCount,omitempty"` + SessionId string `xml:"sessionId,omitempty"` + LoginTime *time.Time `xml:"loginTime"` +} + +func init() { + t["UserLogoutSessionEvent"] = reflect.TypeOf((*UserLogoutSessionEvent)(nil)).Elem() +} + +type UserNotFound struct { + VimFault + + Principal string `xml:"principal"` + Unresolved bool `xml:"unresolved"` +} + +func init() { + t["UserNotFound"] = reflect.TypeOf((*UserNotFound)(nil)).Elem() +} + +type UserNotFoundFault UserNotFound + +func init() { + t["UserNotFoundFault"] = reflect.TypeOf((*UserNotFoundFault)(nil)).Elem() +} + +type UserPasswordChanged struct { + HostEvent + + UserLogin string `xml:"userLogin"` +} + +func init() { + t["UserPasswordChanged"] = reflect.TypeOf((*UserPasswordChanged)(nil)).Elem() +} + +type UserProfile struct { + ApplyProfile + + Key string `xml:"key"` +} + +func init() { + t["UserProfile"] = reflect.TypeOf((*UserProfile)(nil)).Elem() +} + +type UserSearchResult struct { + DynamicData + + Principal string `xml:"principal"` + FullName string `xml:"fullName,omitempty"` + Group bool `xml:"group"` +} + +func init() { + t["UserSearchResult"] = reflect.TypeOf((*UserSearchResult)(nil)).Elem() +} + +type UserSession struct { + DynamicData + + Key string `xml:"key"` + UserName string `xml:"userName"` + FullName string `xml:"fullName"` + LoginTime time.Time `xml:"loginTime"` + LastActiveTime time.Time `xml:"lastActiveTime"` + Locale string `xml:"locale"` + MessageLocale string `xml:"messageLocale"` + ExtensionSession *bool `xml:"extensionSession"` + IpAddress string `xml:"ipAddress,omitempty"` + UserAgent string `xml:"userAgent,omitempty"` + CallCount int64 `xml:"callCount,omitempty"` +} + +func init() { + t["UserSession"] = reflect.TypeOf((*UserSession)(nil)).Elem() +} + +type UserUnassignedFromGroup struct { + HostEvent + + UserLogin string `xml:"userLogin"` + Group string `xml:"group"` +} + +func init() { + t["UserUnassignedFromGroup"] = reflect.TypeOf((*UserUnassignedFromGroup)(nil)).Elem() +} + +type UserUpgradeEvent struct { + UpgradeEvent +} + +func init() { + t["UserUpgradeEvent"] = reflect.TypeOf((*UserUpgradeEvent)(nil)).Elem() +} + +type VASAStorageArray struct { + DynamicData + + Name string `xml:"name"` + Uuid string `xml:"uuid"` + VendorId string `xml:"vendorId"` + ModelId string `xml:"modelId"` +} + +func init() { + t["VASAStorageArray"] = reflect.TypeOf((*VASAStorageArray)(nil)).Elem() +} + +type VAppCloneSpec struct { + DynamicData + + Location ManagedObjectReference `xml:"location"` + Host *ManagedObjectReference `xml:"host,omitempty"` + ResourceSpec *ResourceConfigSpec `xml:"resourceSpec,omitempty"` + VmFolder *ManagedObjectReference `xml:"vmFolder,omitempty"` + NetworkMapping []VAppCloneSpecNetworkMappingPair `xml:"networkMapping,omitempty"` + Property []KeyValue `xml:"property,omitempty"` + ResourceMapping []VAppCloneSpecResourceMap `xml:"resourceMapping,omitempty"` + Provisioning string `xml:"provisioning,omitempty"` +} + +func init() { + t["VAppCloneSpec"] = reflect.TypeOf((*VAppCloneSpec)(nil)).Elem() +} + +type VAppCloneSpecNetworkMappingPair struct { + DynamicData + + Source ManagedObjectReference `xml:"source"` + Destination ManagedObjectReference `xml:"destination"` +} + +func init() { + t["VAppCloneSpecNetworkMappingPair"] = reflect.TypeOf((*VAppCloneSpecNetworkMappingPair)(nil)).Elem() +} + +type VAppCloneSpecResourceMap struct { + DynamicData + + Source ManagedObjectReference `xml:"source"` + Parent *ManagedObjectReference `xml:"parent,omitempty"` + ResourceSpec *ResourceConfigSpec `xml:"resourceSpec,omitempty"` + Location *ManagedObjectReference `xml:"location,omitempty"` +} + +func init() { + t["VAppCloneSpecResourceMap"] = reflect.TypeOf((*VAppCloneSpecResourceMap)(nil)).Elem() +} + +type VAppConfigFault struct { + VimFault +} + +func init() { + t["VAppConfigFault"] = reflect.TypeOf((*VAppConfigFault)(nil)).Elem() +} + +type VAppConfigFaultFault BaseVAppConfigFault + +func init() { + t["VAppConfigFaultFault"] = reflect.TypeOf((*VAppConfigFaultFault)(nil)).Elem() +} + +type VAppConfigInfo struct { + VmConfigInfo + + EntityConfig []VAppEntityConfigInfo `xml:"entityConfig,omitempty"` + Annotation string `xml:"annotation"` + InstanceUuid string `xml:"instanceUuid,omitempty"` + ManagedBy *ManagedByInfo `xml:"managedBy,omitempty"` +} + +func init() { + t["VAppConfigInfo"] = reflect.TypeOf((*VAppConfigInfo)(nil)).Elem() +} + +type VAppConfigSpec struct { + VmConfigSpec + + EntityConfig []VAppEntityConfigInfo `xml:"entityConfig,omitempty"` + Annotation string `xml:"annotation,omitempty"` + InstanceUuid string `xml:"instanceUuid,omitempty"` + ManagedBy *ManagedByInfo `xml:"managedBy,omitempty"` +} + +func init() { + t["VAppConfigSpec"] = reflect.TypeOf((*VAppConfigSpec)(nil)).Elem() +} + +type VAppEntityConfigInfo struct { + DynamicData + + Key *ManagedObjectReference `xml:"key,omitempty"` + Tag string `xml:"tag,omitempty"` + StartOrder int32 `xml:"startOrder,omitempty"` + StartDelay int32 `xml:"startDelay,omitempty"` + WaitingForGuest *bool `xml:"waitingForGuest"` + StartAction string `xml:"startAction,omitempty"` + StopDelay int32 `xml:"stopDelay,omitempty"` + StopAction string `xml:"stopAction,omitempty"` + DestroyWithParent *bool `xml:"destroyWithParent"` +} + +func init() { + t["VAppEntityConfigInfo"] = reflect.TypeOf((*VAppEntityConfigInfo)(nil)).Elem() +} + +type VAppIPAssignmentInfo struct { + DynamicData + + SupportedAllocationScheme []string `xml:"supportedAllocationScheme,omitempty"` + IpAllocationPolicy string `xml:"ipAllocationPolicy,omitempty"` + SupportedIpProtocol []string `xml:"supportedIpProtocol,omitempty"` + IpProtocol string `xml:"ipProtocol,omitempty"` +} + +func init() { + t["VAppIPAssignmentInfo"] = reflect.TypeOf((*VAppIPAssignmentInfo)(nil)).Elem() +} + +type VAppNotRunning struct { + VmConfigFault +} + +func init() { + t["VAppNotRunning"] = reflect.TypeOf((*VAppNotRunning)(nil)).Elem() +} + +type VAppNotRunningFault VAppNotRunning + +func init() { + t["VAppNotRunningFault"] = reflect.TypeOf((*VAppNotRunningFault)(nil)).Elem() +} + +type VAppOperationInProgress struct { + RuntimeFault +} + +func init() { + t["VAppOperationInProgress"] = reflect.TypeOf((*VAppOperationInProgress)(nil)).Elem() +} + +type VAppOperationInProgressFault VAppOperationInProgress + +func init() { + t["VAppOperationInProgressFault"] = reflect.TypeOf((*VAppOperationInProgressFault)(nil)).Elem() +} + +type VAppOvfSectionInfo struct { + DynamicData + + Key int32 `xml:"key,omitempty"` + Namespace string `xml:"namespace,omitempty"` + Type string `xml:"type,omitempty"` + AtEnvelopeLevel *bool `xml:"atEnvelopeLevel"` + Contents string `xml:"contents,omitempty"` +} + +func init() { + t["VAppOvfSectionInfo"] = reflect.TypeOf((*VAppOvfSectionInfo)(nil)).Elem() +} + +type VAppOvfSectionSpec struct { + ArrayUpdateSpec + + Info *VAppOvfSectionInfo `xml:"info,omitempty"` +} + +func init() { + t["VAppOvfSectionSpec"] = reflect.TypeOf((*VAppOvfSectionSpec)(nil)).Elem() +} + +type VAppProductInfo struct { + DynamicData + + Key int32 `xml:"key"` + ClassId string `xml:"classId,omitempty"` + InstanceId string `xml:"instanceId,omitempty"` + Name string `xml:"name,omitempty"` + Vendor string `xml:"vendor,omitempty"` + Version string `xml:"version,omitempty"` + FullVersion string `xml:"fullVersion,omitempty"` + VendorUrl string `xml:"vendorUrl,omitempty"` + ProductUrl string `xml:"productUrl,omitempty"` + AppUrl string `xml:"appUrl,omitempty"` +} + +func init() { + t["VAppProductInfo"] = reflect.TypeOf((*VAppProductInfo)(nil)).Elem() +} + +type VAppProductSpec struct { + ArrayUpdateSpec + + Info *VAppProductInfo `xml:"info,omitempty"` +} + +func init() { + t["VAppProductSpec"] = reflect.TypeOf((*VAppProductSpec)(nil)).Elem() +} + +type VAppPropertyFault struct { + VmConfigFault + + Id string `xml:"id"` + Category string `xml:"category"` + Label string `xml:"label"` + Type string `xml:"type"` + Value string `xml:"value"` +} + +func init() { + t["VAppPropertyFault"] = reflect.TypeOf((*VAppPropertyFault)(nil)).Elem() +} + +type VAppPropertyFaultFault BaseVAppPropertyFault + +func init() { + t["VAppPropertyFaultFault"] = reflect.TypeOf((*VAppPropertyFaultFault)(nil)).Elem() +} + +type VAppPropertyInfo struct { + DynamicData + + Key int32 `xml:"key"` + ClassId string `xml:"classId,omitempty"` + InstanceId string `xml:"instanceId,omitempty"` + Id string `xml:"id,omitempty"` + Category string `xml:"category,omitempty"` + Label string `xml:"label,omitempty"` + Type string `xml:"type,omitempty"` + TypeReference string `xml:"typeReference,omitempty"` + UserConfigurable *bool `xml:"userConfigurable"` + DefaultValue string `xml:"defaultValue,omitempty"` + Value string `xml:"value,omitempty"` + Description string `xml:"description,omitempty"` +} + +func init() { + t["VAppPropertyInfo"] = reflect.TypeOf((*VAppPropertyInfo)(nil)).Elem() +} + +type VAppPropertySpec struct { + ArrayUpdateSpec + + Info *VAppPropertyInfo `xml:"info,omitempty"` +} + +func init() { + t["VAppPropertySpec"] = reflect.TypeOf((*VAppPropertySpec)(nil)).Elem() +} + +type VAppTaskInProgress struct { + TaskInProgress +} + +func init() { + t["VAppTaskInProgress"] = reflect.TypeOf((*VAppTaskInProgress)(nil)).Elem() +} + +type VAppTaskInProgressFault VAppTaskInProgress + +func init() { + t["VAppTaskInProgressFault"] = reflect.TypeOf((*VAppTaskInProgressFault)(nil)).Elem() +} + +type VFlashCacheHotConfigNotSupported struct { + VmConfigFault +} + +func init() { + t["VFlashCacheHotConfigNotSupported"] = reflect.TypeOf((*VFlashCacheHotConfigNotSupported)(nil)).Elem() +} + +type VFlashCacheHotConfigNotSupportedFault VFlashCacheHotConfigNotSupported + +func init() { + t["VFlashCacheHotConfigNotSupportedFault"] = reflect.TypeOf((*VFlashCacheHotConfigNotSupportedFault)(nil)).Elem() +} + +type VFlashModuleNotSupported struct { + VmConfigFault + + VmName string `xml:"vmName"` + ModuleName string `xml:"moduleName"` + Reason string `xml:"reason"` + HostName string `xml:"hostName"` +} + +func init() { + t["VFlashModuleNotSupported"] = reflect.TypeOf((*VFlashModuleNotSupported)(nil)).Elem() +} + +type VFlashModuleNotSupportedFault VFlashModuleNotSupported + +func init() { + t["VFlashModuleNotSupportedFault"] = reflect.TypeOf((*VFlashModuleNotSupportedFault)(nil)).Elem() +} + +type VFlashModuleVersionIncompatible struct { + VimFault + + ModuleName string `xml:"moduleName"` + VmRequestModuleVersion string `xml:"vmRequestModuleVersion"` + HostMinSupportedVerson string `xml:"hostMinSupportedVerson"` + HostModuleVersion string `xml:"hostModuleVersion"` +} + +func init() { + t["VFlashModuleVersionIncompatible"] = reflect.TypeOf((*VFlashModuleVersionIncompatible)(nil)).Elem() +} + +type VFlashModuleVersionIncompatibleFault VFlashModuleVersionIncompatible + +func init() { + t["VFlashModuleVersionIncompatibleFault"] = reflect.TypeOf((*VFlashModuleVersionIncompatibleFault)(nil)).Elem() +} + +type VMFSDatastoreCreatedEvent struct { + HostEvent + + Datastore DatastoreEventArgument `xml:"datastore"` +} + +func init() { + t["VMFSDatastoreCreatedEvent"] = reflect.TypeOf((*VMFSDatastoreCreatedEvent)(nil)).Elem() +} + +type VMFSDatastoreExpandedEvent struct { + HostEvent + + Datastore DatastoreEventArgument `xml:"datastore"` +} + +func init() { + t["VMFSDatastoreExpandedEvent"] = reflect.TypeOf((*VMFSDatastoreExpandedEvent)(nil)).Elem() +} + +type VMFSDatastoreExtendedEvent struct { + HostEvent + + Datastore DatastoreEventArgument `xml:"datastore"` +} + +func init() { + t["VMFSDatastoreExtendedEvent"] = reflect.TypeOf((*VMFSDatastoreExtendedEvent)(nil)).Elem() +} + +type VMINotSupported struct { + DeviceNotSupported +} + +func init() { + t["VMINotSupported"] = reflect.TypeOf((*VMINotSupported)(nil)).Elem() +} + +type VMINotSupportedFault VMINotSupported + +func init() { + t["VMINotSupportedFault"] = reflect.TypeOf((*VMINotSupportedFault)(nil)).Elem() +} + +type VMOnConflictDVPort struct { + CannotAccessNetwork +} + +func init() { + t["VMOnConflictDVPort"] = reflect.TypeOf((*VMOnConflictDVPort)(nil)).Elem() +} + +type VMOnConflictDVPortFault VMOnConflictDVPort + +func init() { + t["VMOnConflictDVPortFault"] = reflect.TypeOf((*VMOnConflictDVPortFault)(nil)).Elem() +} + +type VMOnVirtualIntranet struct { + CannotAccessNetwork +} + +func init() { + t["VMOnVirtualIntranet"] = reflect.TypeOf((*VMOnVirtualIntranet)(nil)).Elem() +} + +type VMOnVirtualIntranetFault VMOnVirtualIntranet + +func init() { + t["VMOnVirtualIntranetFault"] = reflect.TypeOf((*VMOnVirtualIntranetFault)(nil)).Elem() +} + +type VMotionAcrossNetworkNotSupported struct { + MigrationFeatureNotSupported +} + +func init() { + t["VMotionAcrossNetworkNotSupported"] = reflect.TypeOf((*VMotionAcrossNetworkNotSupported)(nil)).Elem() +} + +type VMotionAcrossNetworkNotSupportedFault VMotionAcrossNetworkNotSupported + +func init() { + t["VMotionAcrossNetworkNotSupportedFault"] = reflect.TypeOf((*VMotionAcrossNetworkNotSupportedFault)(nil)).Elem() +} + +type VMotionInterfaceIssue struct { + MigrationFault + + AtSourceHost bool `xml:"atSourceHost"` + FailedHost string `xml:"failedHost"` + FailedHostEntity *ManagedObjectReference `xml:"failedHostEntity,omitempty"` +} + +func init() { + t["VMotionInterfaceIssue"] = reflect.TypeOf((*VMotionInterfaceIssue)(nil)).Elem() +} + +type VMotionInterfaceIssueFault BaseVMotionInterfaceIssue + +func init() { + t["VMotionInterfaceIssueFault"] = reflect.TypeOf((*VMotionInterfaceIssueFault)(nil)).Elem() +} + +type VMotionLicenseExpiredEvent struct { + LicenseEvent +} + +func init() { + t["VMotionLicenseExpiredEvent"] = reflect.TypeOf((*VMotionLicenseExpiredEvent)(nil)).Elem() +} + +type VMotionLinkCapacityLow struct { + VMotionInterfaceIssue + + Network string `xml:"network"` +} + +func init() { + t["VMotionLinkCapacityLow"] = reflect.TypeOf((*VMotionLinkCapacityLow)(nil)).Elem() +} + +type VMotionLinkCapacityLowFault VMotionLinkCapacityLow + +func init() { + t["VMotionLinkCapacityLowFault"] = reflect.TypeOf((*VMotionLinkCapacityLowFault)(nil)).Elem() +} + +type VMotionLinkDown struct { + VMotionInterfaceIssue + + Network string `xml:"network"` +} + +func init() { + t["VMotionLinkDown"] = reflect.TypeOf((*VMotionLinkDown)(nil)).Elem() +} + +type VMotionLinkDownFault VMotionLinkDown + +func init() { + t["VMotionLinkDownFault"] = reflect.TypeOf((*VMotionLinkDownFault)(nil)).Elem() +} + +type VMotionNotConfigured struct { + VMotionInterfaceIssue +} + +func init() { + t["VMotionNotConfigured"] = reflect.TypeOf((*VMotionNotConfigured)(nil)).Elem() +} + +type VMotionNotConfiguredFault VMotionNotConfigured + +func init() { + t["VMotionNotConfiguredFault"] = reflect.TypeOf((*VMotionNotConfiguredFault)(nil)).Elem() +} + +type VMotionNotLicensed struct { + VMotionInterfaceIssue +} + +func init() { + t["VMotionNotLicensed"] = reflect.TypeOf((*VMotionNotLicensed)(nil)).Elem() +} + +type VMotionNotLicensedFault VMotionNotLicensed + +func init() { + t["VMotionNotLicensedFault"] = reflect.TypeOf((*VMotionNotLicensedFault)(nil)).Elem() +} + +type VMotionNotSupported struct { + VMotionInterfaceIssue +} + +func init() { + t["VMotionNotSupported"] = reflect.TypeOf((*VMotionNotSupported)(nil)).Elem() +} + +type VMotionNotSupportedFault VMotionNotSupported + +func init() { + t["VMotionNotSupportedFault"] = reflect.TypeOf((*VMotionNotSupportedFault)(nil)).Elem() +} + +type VMotionProtocolIncompatible struct { + MigrationFault +} + +func init() { + t["VMotionProtocolIncompatible"] = reflect.TypeOf((*VMotionProtocolIncompatible)(nil)).Elem() +} + +type VMotionProtocolIncompatibleFault VMotionProtocolIncompatible + +func init() { + t["VMotionProtocolIncompatibleFault"] = reflect.TypeOf((*VMotionProtocolIncompatibleFault)(nil)).Elem() +} + +type VMwareDVSConfigInfo struct { + DVSConfigInfo + + VspanSession []VMwareVspanSession `xml:"vspanSession,omitempty"` + PvlanConfig []VMwareDVSPvlanMapEntry `xml:"pvlanConfig,omitempty"` + MaxMtu int32 `xml:"maxMtu"` + LinkDiscoveryProtocolConfig *LinkDiscoveryProtocolConfig `xml:"linkDiscoveryProtocolConfig,omitempty"` + IpfixConfig *VMwareIpfixConfig `xml:"ipfixConfig,omitempty"` + LacpGroupConfig []VMwareDvsLacpGroupConfig `xml:"lacpGroupConfig,omitempty"` + LacpApiVersion string `xml:"lacpApiVersion,omitempty"` + MulticastFilteringMode string `xml:"multicastFilteringMode,omitempty"` +} + +func init() { + t["VMwareDVSConfigInfo"] = reflect.TypeOf((*VMwareDVSConfigInfo)(nil)).Elem() +} + +type VMwareDVSConfigSpec struct { + DVSConfigSpec + + PvlanConfigSpec []VMwareDVSPvlanConfigSpec `xml:"pvlanConfigSpec,omitempty"` + VspanConfigSpec []VMwareDVSVspanConfigSpec `xml:"vspanConfigSpec,omitempty"` + MaxMtu int32 `xml:"maxMtu,omitempty"` + LinkDiscoveryProtocolConfig *LinkDiscoveryProtocolConfig `xml:"linkDiscoveryProtocolConfig,omitempty"` + IpfixConfig *VMwareIpfixConfig `xml:"ipfixConfig,omitempty"` + LacpApiVersion string `xml:"lacpApiVersion,omitempty"` + MulticastFilteringMode string `xml:"multicastFilteringMode,omitempty"` +} + +func init() { + t["VMwareDVSConfigSpec"] = reflect.TypeOf((*VMwareDVSConfigSpec)(nil)).Elem() +} + +type VMwareDVSFeatureCapability struct { + DVSFeatureCapability + + VspanSupported *bool `xml:"vspanSupported"` + LldpSupported *bool `xml:"lldpSupported"` + IpfixSupported *bool `xml:"ipfixSupported"` + IpfixCapability *VMwareDvsIpfixCapability `xml:"ipfixCapability,omitempty"` + MulticastSnoopingSupported *bool `xml:"multicastSnoopingSupported"` + VspanCapability *VMwareDVSVspanCapability `xml:"vspanCapability,omitempty"` + LacpCapability *VMwareDvsLacpCapability `xml:"lacpCapability,omitempty"` +} + +func init() { + t["VMwareDVSFeatureCapability"] = reflect.TypeOf((*VMwareDVSFeatureCapability)(nil)).Elem() +} + +type VMwareDVSHealthCheckCapability struct { + DVSHealthCheckCapability + + VlanMtuSupported bool `xml:"vlanMtuSupported"` + TeamingSupported bool `xml:"teamingSupported"` +} + +func init() { + t["VMwareDVSHealthCheckCapability"] = reflect.TypeOf((*VMwareDVSHealthCheckCapability)(nil)).Elem() +} + +type VMwareDVSHealthCheckConfig struct { + DVSHealthCheckConfig +} + +func init() { + t["VMwareDVSHealthCheckConfig"] = reflect.TypeOf((*VMwareDVSHealthCheckConfig)(nil)).Elem() +} + +type VMwareDVSMtuHealthCheckResult struct { + HostMemberUplinkHealthCheckResult + + MtuMismatch bool `xml:"mtuMismatch"` + VlanSupportSwitchMtu []NumericRange `xml:"vlanSupportSwitchMtu,omitempty"` + VlanNotSupportSwitchMtu []NumericRange `xml:"vlanNotSupportSwitchMtu,omitempty"` +} + +func init() { + t["VMwareDVSMtuHealthCheckResult"] = reflect.TypeOf((*VMwareDVSMtuHealthCheckResult)(nil)).Elem() +} + +type VMwareDVSPortSetting struct { + DVPortSetting + + Vlan BaseVmwareDistributedVirtualSwitchVlanSpec `xml:"vlan,omitempty,typeattr"` + QosTag *IntPolicy `xml:"qosTag,omitempty"` + UplinkTeamingPolicy *VmwareUplinkPortTeamingPolicy `xml:"uplinkTeamingPolicy,omitempty"` + SecurityPolicy *DVSSecurityPolicy `xml:"securityPolicy,omitempty"` + IpfixEnabled *BoolPolicy `xml:"ipfixEnabled,omitempty"` + TxUplink *BoolPolicy `xml:"txUplink,omitempty"` + LacpPolicy *VMwareUplinkLacpPolicy `xml:"lacpPolicy,omitempty"` +} + +func init() { + t["VMwareDVSPortSetting"] = reflect.TypeOf((*VMwareDVSPortSetting)(nil)).Elem() +} + +type VMwareDVSPortgroupPolicy struct { + DVPortgroupPolicy + + VlanOverrideAllowed bool `xml:"vlanOverrideAllowed"` + UplinkTeamingOverrideAllowed bool `xml:"uplinkTeamingOverrideAllowed"` + SecurityPolicyOverrideAllowed bool `xml:"securityPolicyOverrideAllowed"` + IpfixOverrideAllowed *bool `xml:"ipfixOverrideAllowed"` +} + +func init() { + t["VMwareDVSPortgroupPolicy"] = reflect.TypeOf((*VMwareDVSPortgroupPolicy)(nil)).Elem() +} + +type VMwareDVSPvlanConfigSpec struct { + DynamicData + + PvlanEntry VMwareDVSPvlanMapEntry `xml:"pvlanEntry"` + Operation string `xml:"operation"` +} + +func init() { + t["VMwareDVSPvlanConfigSpec"] = reflect.TypeOf((*VMwareDVSPvlanConfigSpec)(nil)).Elem() +} + +type VMwareDVSPvlanMapEntry struct { + DynamicData + + PrimaryVlanId int32 `xml:"primaryVlanId"` + SecondaryVlanId int32 `xml:"secondaryVlanId"` + PvlanType string `xml:"pvlanType"` +} + +func init() { + t["VMwareDVSPvlanMapEntry"] = reflect.TypeOf((*VMwareDVSPvlanMapEntry)(nil)).Elem() +} + +type VMwareDVSTeamingHealthCheckConfig struct { + VMwareDVSHealthCheckConfig +} + +func init() { + t["VMwareDVSTeamingHealthCheckConfig"] = reflect.TypeOf((*VMwareDVSTeamingHealthCheckConfig)(nil)).Elem() +} + +type VMwareDVSTeamingHealthCheckResult struct { + HostMemberHealthCheckResult + + TeamingStatus string `xml:"teamingStatus"` +} + +func init() { + t["VMwareDVSTeamingHealthCheckResult"] = reflect.TypeOf((*VMwareDVSTeamingHealthCheckResult)(nil)).Elem() +} + +type VMwareDVSVlanHealthCheckResult struct { + HostMemberUplinkHealthCheckResult + + TrunkedVlan []NumericRange `xml:"trunkedVlan,omitempty"` + UntrunkedVlan []NumericRange `xml:"untrunkedVlan,omitempty"` +} + +func init() { + t["VMwareDVSVlanHealthCheckResult"] = reflect.TypeOf((*VMwareDVSVlanHealthCheckResult)(nil)).Elem() +} + +type VMwareDVSVlanMtuHealthCheckConfig struct { + VMwareDVSHealthCheckConfig +} + +func init() { + t["VMwareDVSVlanMtuHealthCheckConfig"] = reflect.TypeOf((*VMwareDVSVlanMtuHealthCheckConfig)(nil)).Elem() +} + +type VMwareDVSVspanCapability struct { + DynamicData + + MixedDestSupported bool `xml:"mixedDestSupported"` + DvportSupported bool `xml:"dvportSupported"` + RemoteSourceSupported bool `xml:"remoteSourceSupported"` + RemoteDestSupported bool `xml:"remoteDestSupported"` + EncapRemoteSourceSupported bool `xml:"encapRemoteSourceSupported"` +} + +func init() { + t["VMwareDVSVspanCapability"] = reflect.TypeOf((*VMwareDVSVspanCapability)(nil)).Elem() +} + +type VMwareDVSVspanConfigSpec struct { + DynamicData + + VspanSession VMwareVspanSession `xml:"vspanSession"` + Operation string `xml:"operation"` +} + +func init() { + t["VMwareDVSVspanConfigSpec"] = reflect.TypeOf((*VMwareDVSVspanConfigSpec)(nil)).Elem() +} + +type VMwareDvsIpfixCapability struct { + DynamicData + + IpfixSupported *bool `xml:"ipfixSupported"` + Ipv6ForIpfixSupported *bool `xml:"ipv6ForIpfixSupported"` + ObservationDomainIdSupported *bool `xml:"observationDomainIdSupported"` +} + +func init() { + t["VMwareDvsIpfixCapability"] = reflect.TypeOf((*VMwareDvsIpfixCapability)(nil)).Elem() +} + +type VMwareDvsLacpCapability struct { + DynamicData + + LacpSupported *bool `xml:"lacpSupported"` + MultiLacpGroupSupported *bool `xml:"multiLacpGroupSupported"` +} + +func init() { + t["VMwareDvsLacpCapability"] = reflect.TypeOf((*VMwareDvsLacpCapability)(nil)).Elem() +} + +type VMwareDvsLacpGroupConfig struct { + DynamicData + + Key string `xml:"key,omitempty"` + Name string `xml:"name,omitempty"` + Mode string `xml:"mode,omitempty"` + UplinkNum int32 `xml:"uplinkNum,omitempty"` + LoadbalanceAlgorithm string `xml:"loadbalanceAlgorithm,omitempty"` + Vlan *VMwareDvsLagVlanConfig `xml:"vlan,omitempty"` + Ipfix *VMwareDvsLagIpfixConfig `xml:"ipfix,omitempty"` + UplinkName []string `xml:"uplinkName,omitempty"` + UplinkPortKey []string `xml:"uplinkPortKey,omitempty"` +} + +func init() { + t["VMwareDvsLacpGroupConfig"] = reflect.TypeOf((*VMwareDvsLacpGroupConfig)(nil)).Elem() +} + +type VMwareDvsLacpGroupSpec struct { + DynamicData + + LacpGroupConfig VMwareDvsLacpGroupConfig `xml:"lacpGroupConfig"` + Operation string `xml:"operation"` +} + +func init() { + t["VMwareDvsLacpGroupSpec"] = reflect.TypeOf((*VMwareDvsLacpGroupSpec)(nil)).Elem() +} + +type VMwareDvsLagIpfixConfig struct { + DynamicData + + IpfixEnabled *bool `xml:"ipfixEnabled"` +} + +func init() { + t["VMwareDvsLagIpfixConfig"] = reflect.TypeOf((*VMwareDvsLagIpfixConfig)(nil)).Elem() +} + +type VMwareDvsLagVlanConfig struct { + DynamicData + + VlanId []NumericRange `xml:"vlanId,omitempty"` +} + +func init() { + t["VMwareDvsLagVlanConfig"] = reflect.TypeOf((*VMwareDvsLagVlanConfig)(nil)).Elem() +} + +type VMwareIpfixConfig struct { + DynamicData + + CollectorIpAddress string `xml:"collectorIpAddress,omitempty"` + CollectorPort int32 `xml:"collectorPort,omitempty"` + ObservationDomainId int64 `xml:"observationDomainId,omitempty"` + ActiveFlowTimeout int32 `xml:"activeFlowTimeout"` + IdleFlowTimeout int32 `xml:"idleFlowTimeout"` + SamplingRate int32 `xml:"samplingRate"` + InternalFlowsOnly bool `xml:"internalFlowsOnly"` +} + +func init() { + t["VMwareIpfixConfig"] = reflect.TypeOf((*VMwareIpfixConfig)(nil)).Elem() +} + +type VMwareUplinkLacpPolicy struct { + InheritablePolicy + + Enable *BoolPolicy `xml:"enable,omitempty"` + Mode *StringPolicy `xml:"mode,omitempty"` +} + +func init() { + t["VMwareUplinkLacpPolicy"] = reflect.TypeOf((*VMwareUplinkLacpPolicy)(nil)).Elem() +} + +type VMwareUplinkPortOrderPolicy struct { + InheritablePolicy + + ActiveUplinkPort []string `xml:"activeUplinkPort,omitempty"` + StandbyUplinkPort []string `xml:"standbyUplinkPort,omitempty"` +} + +func init() { + t["VMwareUplinkPortOrderPolicy"] = reflect.TypeOf((*VMwareUplinkPortOrderPolicy)(nil)).Elem() +} + +type VMwareVspanPort struct { + DynamicData + + PortKey []string `xml:"portKey,omitempty"` + UplinkPortName []string `xml:"uplinkPortName,omitempty"` + WildcardPortConnecteeType []string `xml:"wildcardPortConnecteeType,omitempty"` + Vlans []int32 `xml:"vlans,omitempty"` + IpAddress []string `xml:"ipAddress,omitempty"` +} + +func init() { + t["VMwareVspanPort"] = reflect.TypeOf((*VMwareVspanPort)(nil)).Elem() +} + +type VMwareVspanSession struct { + DynamicData + + Key string `xml:"key,omitempty"` + Name string `xml:"name,omitempty"` + Description string `xml:"description,omitempty"` + Enabled bool `xml:"enabled"` + SourcePortTransmitted *VMwareVspanPort `xml:"sourcePortTransmitted,omitempty"` + SourcePortReceived *VMwareVspanPort `xml:"sourcePortReceived,omitempty"` + DestinationPort *VMwareVspanPort `xml:"destinationPort,omitempty"` + EncapsulationVlanId int32 `xml:"encapsulationVlanId,omitempty"` + StripOriginalVlan bool `xml:"stripOriginalVlan"` + MirroredPacketLength int32 `xml:"mirroredPacketLength,omitempty"` + NormalTrafficAllowed bool `xml:"normalTrafficAllowed"` + SessionType string `xml:"sessionType,omitempty"` + SamplingRate int32 `xml:"samplingRate,omitempty"` +} + +func init() { + t["VMwareVspanSession"] = reflect.TypeOf((*VMwareVspanSession)(nil)).Elem() +} + +type VRPEditSpec struct { + DynamicData + + VrpId string `xml:"vrpId"` + Description string `xml:"description,omitempty"` + CpuAllocation *VrpResourceAllocationInfo `xml:"cpuAllocation,omitempty"` + MemoryAllocation *VrpResourceAllocationInfo `xml:"memoryAllocation,omitempty"` + AddedHubs []ManagedObjectReference `xml:"addedHubs,omitempty"` + RemovedHubs []ManagedObjectReference `xml:"removedHubs,omitempty"` + ChangeVersion int64 `xml:"changeVersion,omitempty"` +} + +func init() { + t["VRPEditSpec"] = reflect.TypeOf((*VRPEditSpec)(nil)).Elem() +} + +type VVolHostPE struct { + DynamicData + + Key ManagedObjectReference `xml:"key"` + ProtocolEndpoint []HostProtocolEndpoint `xml:"protocolEndpoint"` +} + +func init() { + t["VVolHostPE"] = reflect.TypeOf((*VVolHostPE)(nil)).Elem() +} + +type ValidateCredentialsInGuest ValidateCredentialsInGuestRequestType + +func init() { + t["ValidateCredentialsInGuest"] = reflect.TypeOf((*ValidateCredentialsInGuest)(nil)).Elem() +} + +type ValidateCredentialsInGuestRequestType struct { + This ManagedObjectReference `xml:"_this"` + Vm ManagedObjectReference `xml:"vm"` + Auth BaseGuestAuthentication `xml:"auth,typeattr"` +} + +func init() { + t["ValidateCredentialsInGuestRequestType"] = reflect.TypeOf((*ValidateCredentialsInGuestRequestType)(nil)).Elem() +} + +type ValidateCredentialsInGuestResponse struct { +} + +type ValidateHost ValidateHostRequestType + +func init() { + t["ValidateHost"] = reflect.TypeOf((*ValidateHost)(nil)).Elem() +} + +type ValidateHostRequestType struct { + This ManagedObjectReference `xml:"_this"` + OvfDescriptor string `xml:"ovfDescriptor"` + Host ManagedObjectReference `xml:"host"` + Vhp OvfValidateHostParams `xml:"vhp"` +} + +func init() { + t["ValidateHostRequestType"] = reflect.TypeOf((*ValidateHostRequestType)(nil)).Elem() +} + +type ValidateHostResponse struct { + Returnval OvfValidateHostResult `xml:"returnval"` +} + +type ValidateMigration ValidateMigrationRequestType + +func init() { + t["ValidateMigration"] = reflect.TypeOf((*ValidateMigration)(nil)).Elem() +} + +type ValidateMigrationRequestType struct { + This ManagedObjectReference `xml:"_this"` + Vm []ManagedObjectReference `xml:"vm"` + State VirtualMachinePowerState `xml:"state,omitempty"` + TestType []string `xml:"testType,omitempty"` + Pool *ManagedObjectReference `xml:"pool,omitempty"` + Host *ManagedObjectReference `xml:"host,omitempty"` +} + +func init() { + t["ValidateMigrationRequestType"] = reflect.TypeOf((*ValidateMigrationRequestType)(nil)).Elem() +} + +type ValidateMigrationResponse struct { + Returnval []BaseEvent `xml:"returnval,omitempty,typeattr"` +} + +type VasaProviderContainerSpec struct { + DynamicData + + VasaProviderInfo []VimVasaProviderInfo `xml:"vasaProviderInfo,omitempty"` + ScId string `xml:"scId"` + Deleted bool `xml:"deleted"` +} + +func init() { + t["VasaProviderContainerSpec"] = reflect.TypeOf((*VasaProviderContainerSpec)(nil)).Elem() +} + +type VcAgentUninstallFailedEvent struct { + HostEvent + + Reason string `xml:"reason,omitempty"` +} + +func init() { + t["VcAgentUninstallFailedEvent"] = reflect.TypeOf((*VcAgentUninstallFailedEvent)(nil)).Elem() +} + +type VcAgentUninstalledEvent struct { + HostEvent +} + +func init() { + t["VcAgentUninstalledEvent"] = reflect.TypeOf((*VcAgentUninstalledEvent)(nil)).Elem() +} + +type VcAgentUpgradeFailedEvent struct { + HostEvent + + Reason string `xml:"reason,omitempty"` +} + +func init() { + t["VcAgentUpgradeFailedEvent"] = reflect.TypeOf((*VcAgentUpgradeFailedEvent)(nil)).Elem() +} + +type VcAgentUpgradedEvent struct { + HostEvent +} + +func init() { + t["VcAgentUpgradedEvent"] = reflect.TypeOf((*VcAgentUpgradedEvent)(nil)).Elem() +} + +type VimAccountPasswordChangedEvent struct { + HostEvent +} + +func init() { + t["VimAccountPasswordChangedEvent"] = reflect.TypeOf((*VimAccountPasswordChangedEvent)(nil)).Elem() +} + +type VimFault struct { + MethodFault +} + +func init() { + t["VimFault"] = reflect.TypeOf((*VimFault)(nil)).Elem() +} + +type VimFaultFault BaseVimFault + +func init() { + t["VimFaultFault"] = reflect.TypeOf((*VimFaultFault)(nil)).Elem() +} + +type VimVasaProvider struct { + DynamicData + + Url string `xml:"url"` + Name string `xml:"name,omitempty"` + SelfSignedCertificate string `xml:"selfSignedCertificate,omitempty"` +} + +func init() { + t["VimVasaProvider"] = reflect.TypeOf((*VimVasaProvider)(nil)).Elem() +} + +type VimVasaProviderInfo struct { + DynamicData + + Provider VimVasaProvider `xml:"provider"` + ArrayState []VimVasaProviderStatePerArray `xml:"arrayState,omitempty"` +} + +func init() { + t["VimVasaProviderInfo"] = reflect.TypeOf((*VimVasaProviderInfo)(nil)).Elem() +} + +type VimVasaProviderStatePerArray struct { + DynamicData + + Priority int32 `xml:"priority"` + ArrayId string `xml:"arrayId"` + Active bool `xml:"active"` +} + +func init() { + t["VimVasaProviderStatePerArray"] = reflect.TypeOf((*VimVasaProviderStatePerArray)(nil)).Elem() +} + +type VirtualAHCIController struct { + VirtualSATAController +} + +func init() { + t["VirtualAHCIController"] = reflect.TypeOf((*VirtualAHCIController)(nil)).Elem() +} + +type VirtualAHCIControllerOption struct { + VirtualSATAControllerOption +} + +func init() { + t["VirtualAHCIControllerOption"] = reflect.TypeOf((*VirtualAHCIControllerOption)(nil)).Elem() +} + +type VirtualAppImportSpec struct { + ImportSpec + + Name string `xml:"name"` + VAppConfigSpec VAppConfigSpec `xml:"vAppConfigSpec"` + ResourcePoolSpec ResourceConfigSpec `xml:"resourcePoolSpec"` + Child []BaseImportSpec `xml:"child,omitempty,typeattr"` +} + +func init() { + t["VirtualAppImportSpec"] = reflect.TypeOf((*VirtualAppImportSpec)(nil)).Elem() +} + +type VirtualAppLinkInfo struct { + DynamicData + + Key ManagedObjectReference `xml:"key"` + DestroyWithParent *bool `xml:"destroyWithParent"` +} + +func init() { + t["VirtualAppLinkInfo"] = reflect.TypeOf((*VirtualAppLinkInfo)(nil)).Elem() +} + +type VirtualAppSummary struct { + ResourcePoolSummary + + Product *VAppProductInfo `xml:"product,omitempty"` + VAppState VirtualAppVAppState `xml:"vAppState,omitempty"` + Suspended *bool `xml:"suspended"` + InstallBootRequired *bool `xml:"installBootRequired"` + InstanceUuid string `xml:"instanceUuid,omitempty"` +} + +func init() { + t["VirtualAppSummary"] = reflect.TypeOf((*VirtualAppSummary)(nil)).Elem() +} + +type VirtualBusLogicController struct { + VirtualSCSIController +} + +func init() { + t["VirtualBusLogicController"] = reflect.TypeOf((*VirtualBusLogicController)(nil)).Elem() +} + +type VirtualBusLogicControllerOption struct { + VirtualSCSIControllerOption +} + +func init() { + t["VirtualBusLogicControllerOption"] = reflect.TypeOf((*VirtualBusLogicControllerOption)(nil)).Elem() +} + +type VirtualCdrom struct { + VirtualDevice +} + +func init() { + t["VirtualCdrom"] = reflect.TypeOf((*VirtualCdrom)(nil)).Elem() +} + +type VirtualCdromAtapiBackingInfo struct { + VirtualDeviceDeviceBackingInfo +} + +func init() { + t["VirtualCdromAtapiBackingInfo"] = reflect.TypeOf((*VirtualCdromAtapiBackingInfo)(nil)).Elem() +} + +type VirtualCdromAtapiBackingOption struct { + VirtualDeviceDeviceBackingOption +} + +func init() { + t["VirtualCdromAtapiBackingOption"] = reflect.TypeOf((*VirtualCdromAtapiBackingOption)(nil)).Elem() +} + +type VirtualCdromIsoBackingInfo struct { + VirtualDeviceFileBackingInfo +} + +func init() { + t["VirtualCdromIsoBackingInfo"] = reflect.TypeOf((*VirtualCdromIsoBackingInfo)(nil)).Elem() +} + +type VirtualCdromIsoBackingOption struct { + VirtualDeviceFileBackingOption +} + +func init() { + t["VirtualCdromIsoBackingOption"] = reflect.TypeOf((*VirtualCdromIsoBackingOption)(nil)).Elem() +} + +type VirtualCdromOption struct { + VirtualDeviceOption +} + +func init() { + t["VirtualCdromOption"] = reflect.TypeOf((*VirtualCdromOption)(nil)).Elem() +} + +type VirtualCdromPassthroughBackingInfo struct { + VirtualDeviceDeviceBackingInfo + + Exclusive bool `xml:"exclusive"` +} + +func init() { + t["VirtualCdromPassthroughBackingInfo"] = reflect.TypeOf((*VirtualCdromPassthroughBackingInfo)(nil)).Elem() +} + +type VirtualCdromPassthroughBackingOption struct { + VirtualDeviceDeviceBackingOption + + Exclusive BoolOption `xml:"exclusive"` +} + +func init() { + t["VirtualCdromPassthroughBackingOption"] = reflect.TypeOf((*VirtualCdromPassthroughBackingOption)(nil)).Elem() +} + +type VirtualCdromRemoteAtapiBackingInfo struct { + VirtualDeviceRemoteDeviceBackingInfo +} + +func init() { + t["VirtualCdromRemoteAtapiBackingInfo"] = reflect.TypeOf((*VirtualCdromRemoteAtapiBackingInfo)(nil)).Elem() +} + +type VirtualCdromRemoteAtapiBackingOption struct { + VirtualDeviceDeviceBackingOption +} + +func init() { + t["VirtualCdromRemoteAtapiBackingOption"] = reflect.TypeOf((*VirtualCdromRemoteAtapiBackingOption)(nil)).Elem() +} + +type VirtualCdromRemotePassthroughBackingInfo struct { + VirtualDeviceRemoteDeviceBackingInfo + + Exclusive bool `xml:"exclusive"` +} + +func init() { + t["VirtualCdromRemotePassthroughBackingInfo"] = reflect.TypeOf((*VirtualCdromRemotePassthroughBackingInfo)(nil)).Elem() +} + +type VirtualCdromRemotePassthroughBackingOption struct { + VirtualDeviceRemoteDeviceBackingOption + + Exclusive BoolOption `xml:"exclusive"` +} + +func init() { + t["VirtualCdromRemotePassthroughBackingOption"] = reflect.TypeOf((*VirtualCdromRemotePassthroughBackingOption)(nil)).Elem() +} + +type VirtualController struct { + VirtualDevice + + BusNumber int32 `xml:"busNumber"` + Device []int32 `xml:"device,omitempty"` +} + +func init() { + t["VirtualController"] = reflect.TypeOf((*VirtualController)(nil)).Elem() +} + +type VirtualControllerOption struct { + VirtualDeviceOption + + Devices IntOption `xml:"devices"` + SupportedDevice []string `xml:"supportedDevice,omitempty"` +} + +func init() { + t["VirtualControllerOption"] = reflect.TypeOf((*VirtualControllerOption)(nil)).Elem() +} + +type VirtualDevice struct { + DynamicData + + Key int32 `xml:"key"` + DeviceInfo BaseDescription `xml:"deviceInfo,omitempty,typeattr"` + Backing BaseVirtualDeviceBackingInfo `xml:"backing,omitempty,typeattr"` + Connectable *VirtualDeviceConnectInfo `xml:"connectable,omitempty"` + SlotInfo BaseVirtualDeviceBusSlotInfo `xml:"slotInfo,omitempty,typeattr"` + ControllerKey int32 `xml:"controllerKey,omitempty"` + UnitNumber *int32 `xml:"unitNumber"` +} + +func init() { + t["VirtualDevice"] = reflect.TypeOf((*VirtualDevice)(nil)).Elem() +} + +type VirtualDeviceBackingInfo struct { + DynamicData +} + +func init() { + t["VirtualDeviceBackingInfo"] = reflect.TypeOf((*VirtualDeviceBackingInfo)(nil)).Elem() +} + +type VirtualDeviceBackingOption struct { + DynamicData + + Type string `xml:"type"` +} + +func init() { + t["VirtualDeviceBackingOption"] = reflect.TypeOf((*VirtualDeviceBackingOption)(nil)).Elem() +} + +type VirtualDeviceBusSlotInfo struct { + DynamicData +} + +func init() { + t["VirtualDeviceBusSlotInfo"] = reflect.TypeOf((*VirtualDeviceBusSlotInfo)(nil)).Elem() +} + +type VirtualDeviceBusSlotOption struct { + DynamicData + + Type string `xml:"type"` +} + +func init() { + t["VirtualDeviceBusSlotOption"] = reflect.TypeOf((*VirtualDeviceBusSlotOption)(nil)).Elem() +} + +type VirtualDeviceConfigSpec struct { + DynamicData + + Operation VirtualDeviceConfigSpecOperation `xml:"operation,omitempty"` + FileOperation VirtualDeviceConfigSpecFileOperation `xml:"fileOperation,omitempty"` + Device BaseVirtualDevice `xml:"device,typeattr"` + Profile []BaseVirtualMachineProfileSpec `xml:"profile,omitempty,typeattr"` +} + +func init() { + t["VirtualDeviceConfigSpec"] = reflect.TypeOf((*VirtualDeviceConfigSpec)(nil)).Elem() +} + +type VirtualDeviceConnectInfo struct { + DynamicData + + StartConnected bool `xml:"startConnected"` + AllowGuestControl bool `xml:"allowGuestControl"` + Connected bool `xml:"connected"` + Status string `xml:"status,omitempty"` +} + +func init() { + t["VirtualDeviceConnectInfo"] = reflect.TypeOf((*VirtualDeviceConnectInfo)(nil)).Elem() +} + +type VirtualDeviceConnectOption struct { + DynamicData + + StartConnected BoolOption `xml:"startConnected"` + AllowGuestControl BoolOption `xml:"allowGuestControl"` +} + +func init() { + t["VirtualDeviceConnectOption"] = reflect.TypeOf((*VirtualDeviceConnectOption)(nil)).Elem() +} + +type VirtualDeviceDeviceBackingInfo struct { + VirtualDeviceBackingInfo + + DeviceName string `xml:"deviceName"` + UseAutoDetect *bool `xml:"useAutoDetect"` +} + +func init() { + t["VirtualDeviceDeviceBackingInfo"] = reflect.TypeOf((*VirtualDeviceDeviceBackingInfo)(nil)).Elem() +} + +type VirtualDeviceDeviceBackingOption struct { + VirtualDeviceBackingOption + + AutoDetectAvailable BoolOption `xml:"autoDetectAvailable"` +} + +func init() { + t["VirtualDeviceDeviceBackingOption"] = reflect.TypeOf((*VirtualDeviceDeviceBackingOption)(nil)).Elem() +} + +type VirtualDeviceFileBackingInfo struct { + VirtualDeviceBackingInfo + + FileName string `xml:"fileName"` + Datastore *ManagedObjectReference `xml:"datastore,omitempty"` + BackingObjectId string `xml:"backingObjectId,omitempty"` +} + +func init() { + t["VirtualDeviceFileBackingInfo"] = reflect.TypeOf((*VirtualDeviceFileBackingInfo)(nil)).Elem() +} + +type VirtualDeviceFileBackingOption struct { + VirtualDeviceBackingOption + + FileNameExtensions *ChoiceOption `xml:"fileNameExtensions,omitempty"` +} + +func init() { + t["VirtualDeviceFileBackingOption"] = reflect.TypeOf((*VirtualDeviceFileBackingOption)(nil)).Elem() +} + +type VirtualDeviceOption struct { + DynamicData + + Type string `xml:"type"` + ConnectOption *VirtualDeviceConnectOption `xml:"connectOption,omitempty"` + BusSlotOption *VirtualDeviceBusSlotOption `xml:"busSlotOption,omitempty"` + ControllerType string `xml:"controllerType,omitempty"` + AutoAssignController *BoolOption `xml:"autoAssignController,omitempty"` + BackingOption []BaseVirtualDeviceBackingOption `xml:"backingOption,omitempty,typeattr"` + DefaultBackingOptionIndex int32 `xml:"defaultBackingOptionIndex,omitempty"` + LicensingLimit []string `xml:"licensingLimit,omitempty"` + Deprecated bool `xml:"deprecated"` + PlugAndPlay bool `xml:"plugAndPlay"` + HotRemoveSupported *bool `xml:"hotRemoveSupported"` +} + +func init() { + t["VirtualDeviceOption"] = reflect.TypeOf((*VirtualDeviceOption)(nil)).Elem() +} + +type VirtualDevicePciBusSlotInfo struct { + VirtualDeviceBusSlotInfo + + PciSlotNumber int32 `xml:"pciSlotNumber"` +} + +func init() { + t["VirtualDevicePciBusSlotInfo"] = reflect.TypeOf((*VirtualDevicePciBusSlotInfo)(nil)).Elem() +} + +type VirtualDevicePipeBackingInfo struct { + VirtualDeviceBackingInfo + + PipeName string `xml:"pipeName"` +} + +func init() { + t["VirtualDevicePipeBackingInfo"] = reflect.TypeOf((*VirtualDevicePipeBackingInfo)(nil)).Elem() +} + +type VirtualDevicePipeBackingOption struct { + VirtualDeviceBackingOption +} + +func init() { + t["VirtualDevicePipeBackingOption"] = reflect.TypeOf((*VirtualDevicePipeBackingOption)(nil)).Elem() +} + +type VirtualDeviceRemoteDeviceBackingInfo struct { + VirtualDeviceBackingInfo + + DeviceName string `xml:"deviceName"` + UseAutoDetect *bool `xml:"useAutoDetect"` +} + +func init() { + t["VirtualDeviceRemoteDeviceBackingInfo"] = reflect.TypeOf((*VirtualDeviceRemoteDeviceBackingInfo)(nil)).Elem() +} + +type VirtualDeviceRemoteDeviceBackingOption struct { + VirtualDeviceBackingOption + + AutoDetectAvailable BoolOption `xml:"autoDetectAvailable"` +} + +func init() { + t["VirtualDeviceRemoteDeviceBackingOption"] = reflect.TypeOf((*VirtualDeviceRemoteDeviceBackingOption)(nil)).Elem() +} + +type VirtualDeviceURIBackingInfo struct { + VirtualDeviceBackingInfo + + ServiceURI string `xml:"serviceURI"` + Direction string `xml:"direction"` + ProxyURI string `xml:"proxyURI,omitempty"` +} + +func init() { + t["VirtualDeviceURIBackingInfo"] = reflect.TypeOf((*VirtualDeviceURIBackingInfo)(nil)).Elem() +} + +type VirtualDeviceURIBackingOption struct { + VirtualDeviceBackingOption + + Directions ChoiceOption `xml:"directions"` +} + +func init() { + t["VirtualDeviceURIBackingOption"] = reflect.TypeOf((*VirtualDeviceURIBackingOption)(nil)).Elem() +} + +type VirtualDisk struct { + VirtualDevice + + CapacityInKB int64 `xml:"capacityInKB"` + CapacityInBytes int64 `xml:"capacityInBytes,omitempty"` + Shares *SharesInfo `xml:"shares,omitempty"` + StorageIOAllocation *StorageIOAllocationInfo `xml:"storageIOAllocation,omitempty"` + DiskObjectId string `xml:"diskObjectId,omitempty"` + VFlashCacheConfigInfo *VirtualDiskVFlashCacheConfigInfo `xml:"vFlashCacheConfigInfo,omitempty"` + Iofilter []string `xml:"iofilter,omitempty"` +} + +func init() { + t["VirtualDisk"] = reflect.TypeOf((*VirtualDisk)(nil)).Elem() +} + +type VirtualDiskAntiAffinityRuleSpec struct { + ClusterRuleInfo + + DiskId []int32 `xml:"diskId"` +} + +func init() { + t["VirtualDiskAntiAffinityRuleSpec"] = reflect.TypeOf((*VirtualDiskAntiAffinityRuleSpec)(nil)).Elem() +} + +type VirtualDiskBlocksNotFullyProvisioned struct { + DeviceBackingNotSupported +} + +func init() { + t["VirtualDiskBlocksNotFullyProvisioned"] = reflect.TypeOf((*VirtualDiskBlocksNotFullyProvisioned)(nil)).Elem() +} + +type VirtualDiskBlocksNotFullyProvisionedFault VirtualDiskBlocksNotFullyProvisioned + +func init() { + t["VirtualDiskBlocksNotFullyProvisionedFault"] = reflect.TypeOf((*VirtualDiskBlocksNotFullyProvisionedFault)(nil)).Elem() +} + +type VirtualDiskConfigSpec struct { + VirtualDeviceConfigSpec + + DiskMoveType string `xml:"diskMoveType,omitempty"` + MigrateCache *bool `xml:"migrateCache"` +} + +func init() { + t["VirtualDiskConfigSpec"] = reflect.TypeOf((*VirtualDiskConfigSpec)(nil)).Elem() +} + +type VirtualDiskDeltaDiskFormatsSupported struct { + DynamicData + + DatastoreType string `xml:"datastoreType"` + DeltaDiskFormat ChoiceOption `xml:"deltaDiskFormat"` +} + +func init() { + t["VirtualDiskDeltaDiskFormatsSupported"] = reflect.TypeOf((*VirtualDiskDeltaDiskFormatsSupported)(nil)).Elem() +} + +type VirtualDiskFlatVer1BackingInfo struct { + VirtualDeviceFileBackingInfo + + DiskMode string `xml:"diskMode"` + Split *bool `xml:"split"` + WriteThrough *bool `xml:"writeThrough"` + ContentId string `xml:"contentId,omitempty"` + Parent *VirtualDiskFlatVer1BackingInfo `xml:"parent,omitempty"` +} + +func init() { + t["VirtualDiskFlatVer1BackingInfo"] = reflect.TypeOf((*VirtualDiskFlatVer1BackingInfo)(nil)).Elem() +} + +type VirtualDiskFlatVer1BackingOption struct { + VirtualDeviceFileBackingOption + + DiskMode ChoiceOption `xml:"diskMode"` + Split BoolOption `xml:"split"` + WriteThrough BoolOption `xml:"writeThrough"` + Growable bool `xml:"growable"` +} + +func init() { + t["VirtualDiskFlatVer1BackingOption"] = reflect.TypeOf((*VirtualDiskFlatVer1BackingOption)(nil)).Elem() +} + +type VirtualDiskFlatVer2BackingInfo struct { + VirtualDeviceFileBackingInfo + + DiskMode string `xml:"diskMode"` + Split *bool `xml:"split"` + WriteThrough *bool `xml:"writeThrough"` + ThinProvisioned *bool `xml:"thinProvisioned"` + EagerlyScrub *bool `xml:"eagerlyScrub"` + Uuid string `xml:"uuid,omitempty"` + ContentId string `xml:"contentId,omitempty"` + ChangeId string `xml:"changeId,omitempty"` + Parent *VirtualDiskFlatVer2BackingInfo `xml:"parent,omitempty"` + DeltaDiskFormat string `xml:"deltaDiskFormat,omitempty"` + DigestEnabled *bool `xml:"digestEnabled"` + DeltaGrainSize int32 `xml:"deltaGrainSize,omitempty"` + DeltaDiskFormatVariant string `xml:"deltaDiskFormatVariant,omitempty"` + Sharing string `xml:"sharing,omitempty"` +} + +func init() { + t["VirtualDiskFlatVer2BackingInfo"] = reflect.TypeOf((*VirtualDiskFlatVer2BackingInfo)(nil)).Elem() +} + +type VirtualDiskFlatVer2BackingOption struct { + VirtualDeviceFileBackingOption + + DiskMode ChoiceOption `xml:"diskMode"` + Split BoolOption `xml:"split"` + WriteThrough BoolOption `xml:"writeThrough"` + Growable bool `xml:"growable"` + HotGrowable bool `xml:"hotGrowable"` + Uuid bool `xml:"uuid"` + ThinProvisioned *BoolOption `xml:"thinProvisioned,omitempty"` + EagerlyScrub *BoolOption `xml:"eagerlyScrub,omitempty"` + DeltaDiskFormat *ChoiceOption `xml:"deltaDiskFormat,omitempty"` + DeltaDiskFormatsSupported []VirtualDiskDeltaDiskFormatsSupported `xml:"deltaDiskFormatsSupported,omitempty"` +} + +func init() { + t["VirtualDiskFlatVer2BackingOption"] = reflect.TypeOf((*VirtualDiskFlatVer2BackingOption)(nil)).Elem() +} + +type VirtualDiskId struct { + DynamicData + + Vm ManagedObjectReference `xml:"vm"` + DiskId int32 `xml:"diskId"` +} + +func init() { + t["VirtualDiskId"] = reflect.TypeOf((*VirtualDiskId)(nil)).Elem() +} + +type VirtualDiskModeNotSupported struct { + DeviceNotSupported + + Mode string `xml:"mode"` +} + +func init() { + t["VirtualDiskModeNotSupported"] = reflect.TypeOf((*VirtualDiskModeNotSupported)(nil)).Elem() +} + +type VirtualDiskModeNotSupportedFault VirtualDiskModeNotSupported + +func init() { + t["VirtualDiskModeNotSupportedFault"] = reflect.TypeOf((*VirtualDiskModeNotSupportedFault)(nil)).Elem() +} + +type VirtualDiskOption struct { + VirtualDeviceOption + + CapacityInKB LongOption `xml:"capacityInKB"` + IoAllocationOption *StorageIOAllocationOption `xml:"ioAllocationOption,omitempty"` + VFlashCacheConfigOption *VirtualDiskOptionVFlashCacheConfigOption `xml:"vFlashCacheConfigOption,omitempty"` +} + +func init() { + t["VirtualDiskOption"] = reflect.TypeOf((*VirtualDiskOption)(nil)).Elem() +} + +type VirtualDiskOptionVFlashCacheConfigOption struct { + DynamicData + + CacheConsistencyType ChoiceOption `xml:"cacheConsistencyType"` + CacheMode ChoiceOption `xml:"cacheMode"` + ReservationInMB LongOption `xml:"reservationInMB"` + BlockSizeInKB LongOption `xml:"blockSizeInKB"` +} + +func init() { + t["VirtualDiskOptionVFlashCacheConfigOption"] = reflect.TypeOf((*VirtualDiskOptionVFlashCacheConfigOption)(nil)).Elem() +} + +type VirtualDiskPartitionedRawDiskVer2BackingInfo struct { + VirtualDiskRawDiskVer2BackingInfo + + Partition []int32 `xml:"partition"` +} + +func init() { + t["VirtualDiskPartitionedRawDiskVer2BackingInfo"] = reflect.TypeOf((*VirtualDiskPartitionedRawDiskVer2BackingInfo)(nil)).Elem() +} + +type VirtualDiskPartitionedRawDiskVer2BackingOption struct { + VirtualDiskRawDiskVer2BackingOption +} + +func init() { + t["VirtualDiskPartitionedRawDiskVer2BackingOption"] = reflect.TypeOf((*VirtualDiskPartitionedRawDiskVer2BackingOption)(nil)).Elem() +} + +type VirtualDiskRawDiskMappingVer1BackingInfo struct { + VirtualDeviceFileBackingInfo + + LunUuid string `xml:"lunUuid,omitempty"` + DeviceName string `xml:"deviceName,omitempty"` + CompatibilityMode string `xml:"compatibilityMode,omitempty"` + DiskMode string `xml:"diskMode,omitempty"` + Uuid string `xml:"uuid,omitempty"` + ContentId string `xml:"contentId,omitempty"` + ChangeId string `xml:"changeId,omitempty"` + Parent *VirtualDiskRawDiskMappingVer1BackingInfo `xml:"parent,omitempty"` + Sharing string `xml:"sharing,omitempty"` +} + +func init() { + t["VirtualDiskRawDiskMappingVer1BackingInfo"] = reflect.TypeOf((*VirtualDiskRawDiskMappingVer1BackingInfo)(nil)).Elem() +} + +type VirtualDiskRawDiskMappingVer1BackingOption struct { + VirtualDeviceDeviceBackingOption + + DescriptorFileNameExtensions *ChoiceOption `xml:"descriptorFileNameExtensions,omitempty"` + CompatibilityMode ChoiceOption `xml:"compatibilityMode"` + DiskMode ChoiceOption `xml:"diskMode"` + Uuid bool `xml:"uuid"` +} + +func init() { + t["VirtualDiskRawDiskMappingVer1BackingOption"] = reflect.TypeOf((*VirtualDiskRawDiskMappingVer1BackingOption)(nil)).Elem() +} + +type VirtualDiskRawDiskVer2BackingInfo struct { + VirtualDeviceDeviceBackingInfo + + DescriptorFileName string `xml:"descriptorFileName"` + Uuid string `xml:"uuid,omitempty"` + ChangeId string `xml:"changeId,omitempty"` + Sharing string `xml:"sharing,omitempty"` +} + +func init() { + t["VirtualDiskRawDiskVer2BackingInfo"] = reflect.TypeOf((*VirtualDiskRawDiskVer2BackingInfo)(nil)).Elem() +} + +type VirtualDiskRawDiskVer2BackingOption struct { + VirtualDeviceDeviceBackingOption + + DescriptorFileNameExtensions ChoiceOption `xml:"descriptorFileNameExtensions"` + Uuid bool `xml:"uuid"` +} + +func init() { + t["VirtualDiskRawDiskVer2BackingOption"] = reflect.TypeOf((*VirtualDiskRawDiskVer2BackingOption)(nil)).Elem() +} + +type VirtualDiskSeSparseBackingInfo struct { + VirtualDeviceFileBackingInfo + + DiskMode string `xml:"diskMode"` + WriteThrough *bool `xml:"writeThrough"` + Uuid string `xml:"uuid,omitempty"` + ContentId string `xml:"contentId,omitempty"` + ChangeId string `xml:"changeId,omitempty"` + Parent *VirtualDiskSeSparseBackingInfo `xml:"parent,omitempty"` + DeltaDiskFormat string `xml:"deltaDiskFormat,omitempty"` + DigestEnabled *bool `xml:"digestEnabled"` + GrainSize int32 `xml:"grainSize,omitempty"` +} + +func init() { + t["VirtualDiskSeSparseBackingInfo"] = reflect.TypeOf((*VirtualDiskSeSparseBackingInfo)(nil)).Elem() +} + +type VirtualDiskSeSparseBackingOption struct { + VirtualDeviceFileBackingOption + + DiskMode ChoiceOption `xml:"diskMode"` + WriteThrough BoolOption `xml:"writeThrough"` + Growable bool `xml:"growable"` + HotGrowable bool `xml:"hotGrowable"` + Uuid bool `xml:"uuid"` + DeltaDiskFormatsSupported []VirtualDiskDeltaDiskFormatsSupported `xml:"deltaDiskFormatsSupported"` +} + +func init() { + t["VirtualDiskSeSparseBackingOption"] = reflect.TypeOf((*VirtualDiskSeSparseBackingOption)(nil)).Elem() +} + +type VirtualDiskSparseVer1BackingInfo struct { + VirtualDeviceFileBackingInfo + + DiskMode string `xml:"diskMode"` + Split *bool `xml:"split"` + WriteThrough *bool `xml:"writeThrough"` + SpaceUsedInKB int64 `xml:"spaceUsedInKB,omitempty"` + ContentId string `xml:"contentId,omitempty"` + Parent *VirtualDiskSparseVer1BackingInfo `xml:"parent,omitempty"` +} + +func init() { + t["VirtualDiskSparseVer1BackingInfo"] = reflect.TypeOf((*VirtualDiskSparseVer1BackingInfo)(nil)).Elem() +} + +type VirtualDiskSparseVer1BackingOption struct { + VirtualDeviceFileBackingOption + + DiskModes ChoiceOption `xml:"diskModes"` + Split BoolOption `xml:"split"` + WriteThrough BoolOption `xml:"writeThrough"` + Growable bool `xml:"growable"` +} + +func init() { + t["VirtualDiskSparseVer1BackingOption"] = reflect.TypeOf((*VirtualDiskSparseVer1BackingOption)(nil)).Elem() +} + +type VirtualDiskSparseVer2BackingInfo struct { + VirtualDeviceFileBackingInfo + + DiskMode string `xml:"diskMode"` + Split *bool `xml:"split"` + WriteThrough *bool `xml:"writeThrough"` + SpaceUsedInKB int64 `xml:"spaceUsedInKB,omitempty"` + Uuid string `xml:"uuid,omitempty"` + ContentId string `xml:"contentId,omitempty"` + ChangeId string `xml:"changeId,omitempty"` + Parent *VirtualDiskSparseVer2BackingInfo `xml:"parent,omitempty"` +} + +func init() { + t["VirtualDiskSparseVer2BackingInfo"] = reflect.TypeOf((*VirtualDiskSparseVer2BackingInfo)(nil)).Elem() +} + +type VirtualDiskSparseVer2BackingOption struct { + VirtualDeviceFileBackingOption + + DiskMode ChoiceOption `xml:"diskMode"` + Split BoolOption `xml:"split"` + WriteThrough BoolOption `xml:"writeThrough"` + Growable bool `xml:"growable"` + HotGrowable bool `xml:"hotGrowable"` + Uuid bool `xml:"uuid"` +} + +func init() { + t["VirtualDiskSparseVer2BackingOption"] = reflect.TypeOf((*VirtualDiskSparseVer2BackingOption)(nil)).Elem() +} + +type VirtualDiskSpec struct { + DynamicData + + DiskType string `xml:"diskType"` + AdapterType string `xml:"adapterType"` +} + +func init() { + t["VirtualDiskSpec"] = reflect.TypeOf((*VirtualDiskSpec)(nil)).Elem() +} + +type VirtualDiskVFlashCacheConfigInfo struct { + DynamicData + + VFlashModule string `xml:"vFlashModule,omitempty"` + ReservationInMB int64 `xml:"reservationInMB,omitempty"` + CacheConsistencyType string `xml:"cacheConsistencyType,omitempty"` + CacheMode string `xml:"cacheMode,omitempty"` + BlockSizeInKB int64 `xml:"blockSizeInKB,omitempty"` +} + +func init() { + t["VirtualDiskVFlashCacheConfigInfo"] = reflect.TypeOf((*VirtualDiskVFlashCacheConfigInfo)(nil)).Elem() +} + +type VirtualE1000 struct { + VirtualEthernetCard +} + +func init() { + t["VirtualE1000"] = reflect.TypeOf((*VirtualE1000)(nil)).Elem() +} + +type VirtualE1000Option struct { + VirtualEthernetCardOption +} + +func init() { + t["VirtualE1000Option"] = reflect.TypeOf((*VirtualE1000Option)(nil)).Elem() +} + +type VirtualE1000e struct { + VirtualEthernetCard +} + +func init() { + t["VirtualE1000e"] = reflect.TypeOf((*VirtualE1000e)(nil)).Elem() +} + +type VirtualE1000eOption struct { + VirtualEthernetCardOption +} + +func init() { + t["VirtualE1000eOption"] = reflect.TypeOf((*VirtualE1000eOption)(nil)).Elem() +} + +type VirtualEnsoniq1371 struct { + VirtualSoundCard +} + +func init() { + t["VirtualEnsoniq1371"] = reflect.TypeOf((*VirtualEnsoniq1371)(nil)).Elem() +} + +type VirtualEnsoniq1371Option struct { + VirtualSoundCardOption +} + +func init() { + t["VirtualEnsoniq1371Option"] = reflect.TypeOf((*VirtualEnsoniq1371Option)(nil)).Elem() +} + +type VirtualEthernetCard struct { + VirtualDevice + + AddressType string `xml:"addressType,omitempty"` + MacAddress string `xml:"macAddress,omitempty"` + WakeOnLanEnabled *bool `xml:"wakeOnLanEnabled"` + ResourceAllocation *VirtualEthernetCardResourceAllocation `xml:"resourceAllocation,omitempty"` + ExternalId string `xml:"externalId,omitempty"` + UptCompatibilityEnabled *bool `xml:"uptCompatibilityEnabled"` +} + +func init() { + t["VirtualEthernetCard"] = reflect.TypeOf((*VirtualEthernetCard)(nil)).Elem() +} + +type VirtualEthernetCardDVPortBackingOption struct { + VirtualDeviceBackingOption +} + +func init() { + t["VirtualEthernetCardDVPortBackingOption"] = reflect.TypeOf((*VirtualEthernetCardDVPortBackingOption)(nil)).Elem() +} + +type VirtualEthernetCardDistributedVirtualPortBackingInfo struct { + VirtualDeviceBackingInfo + + Port DistributedVirtualSwitchPortConnection `xml:"port"` +} + +func init() { + t["VirtualEthernetCardDistributedVirtualPortBackingInfo"] = reflect.TypeOf((*VirtualEthernetCardDistributedVirtualPortBackingInfo)(nil)).Elem() +} + +type VirtualEthernetCardLegacyNetworkBackingInfo struct { + VirtualDeviceDeviceBackingInfo +} + +func init() { + t["VirtualEthernetCardLegacyNetworkBackingInfo"] = reflect.TypeOf((*VirtualEthernetCardLegacyNetworkBackingInfo)(nil)).Elem() +} + +type VirtualEthernetCardLegacyNetworkBackingOption struct { + VirtualDeviceDeviceBackingOption +} + +func init() { + t["VirtualEthernetCardLegacyNetworkBackingOption"] = reflect.TypeOf((*VirtualEthernetCardLegacyNetworkBackingOption)(nil)).Elem() +} + +type VirtualEthernetCardNetworkBackingInfo struct { + VirtualDeviceDeviceBackingInfo + + Network *ManagedObjectReference `xml:"network,omitempty"` + InPassthroughMode *bool `xml:"inPassthroughMode"` +} + +func init() { + t["VirtualEthernetCardNetworkBackingInfo"] = reflect.TypeOf((*VirtualEthernetCardNetworkBackingInfo)(nil)).Elem() +} + +type VirtualEthernetCardNetworkBackingOption struct { + VirtualDeviceDeviceBackingOption +} + +func init() { + t["VirtualEthernetCardNetworkBackingOption"] = reflect.TypeOf((*VirtualEthernetCardNetworkBackingOption)(nil)).Elem() +} + +type VirtualEthernetCardNotSupported struct { + DeviceNotSupported +} + +func init() { + t["VirtualEthernetCardNotSupported"] = reflect.TypeOf((*VirtualEthernetCardNotSupported)(nil)).Elem() +} + +type VirtualEthernetCardNotSupportedFault VirtualEthernetCardNotSupported + +func init() { + t["VirtualEthernetCardNotSupportedFault"] = reflect.TypeOf((*VirtualEthernetCardNotSupportedFault)(nil)).Elem() +} + +type VirtualEthernetCardOpaqueNetworkBackingInfo struct { + VirtualDeviceBackingInfo + + OpaqueNetworkId string `xml:"opaqueNetworkId"` + OpaqueNetworkType string `xml:"opaqueNetworkType"` +} + +func init() { + t["VirtualEthernetCardOpaqueNetworkBackingInfo"] = reflect.TypeOf((*VirtualEthernetCardOpaqueNetworkBackingInfo)(nil)).Elem() +} + +type VirtualEthernetCardOpaqueNetworkBackingOption struct { + VirtualDeviceBackingOption +} + +func init() { + t["VirtualEthernetCardOpaqueNetworkBackingOption"] = reflect.TypeOf((*VirtualEthernetCardOpaqueNetworkBackingOption)(nil)).Elem() +} + +type VirtualEthernetCardOption struct { + VirtualDeviceOption + + SupportedOUI ChoiceOption `xml:"supportedOUI"` + MacType ChoiceOption `xml:"macType"` + WakeOnLanEnabled BoolOption `xml:"wakeOnLanEnabled"` + VmDirectPathGen2Supported *bool `xml:"vmDirectPathGen2Supported"` + UptCompatibilityEnabled *BoolOption `xml:"uptCompatibilityEnabled,omitempty"` +} + +func init() { + t["VirtualEthernetCardOption"] = reflect.TypeOf((*VirtualEthernetCardOption)(nil)).Elem() +} + +type VirtualEthernetCardResourceAllocation struct { + DynamicData + + Reservation int64 `xml:"reservation,omitempty"` + Share SharesInfo `xml:"share"` + Limit int64 `xml:"limit,omitempty"` +} + +func init() { + t["VirtualEthernetCardResourceAllocation"] = reflect.TypeOf((*VirtualEthernetCardResourceAllocation)(nil)).Elem() +} + +type VirtualFloppy struct { + VirtualDevice +} + +func init() { + t["VirtualFloppy"] = reflect.TypeOf((*VirtualFloppy)(nil)).Elem() +} + +type VirtualFloppyDeviceBackingInfo struct { + VirtualDeviceDeviceBackingInfo +} + +func init() { + t["VirtualFloppyDeviceBackingInfo"] = reflect.TypeOf((*VirtualFloppyDeviceBackingInfo)(nil)).Elem() +} + +type VirtualFloppyDeviceBackingOption struct { + VirtualDeviceDeviceBackingOption +} + +func init() { + t["VirtualFloppyDeviceBackingOption"] = reflect.TypeOf((*VirtualFloppyDeviceBackingOption)(nil)).Elem() +} + +type VirtualFloppyImageBackingInfo struct { + VirtualDeviceFileBackingInfo +} + +func init() { + t["VirtualFloppyImageBackingInfo"] = reflect.TypeOf((*VirtualFloppyImageBackingInfo)(nil)).Elem() +} + +type VirtualFloppyImageBackingOption struct { + VirtualDeviceFileBackingOption +} + +func init() { + t["VirtualFloppyImageBackingOption"] = reflect.TypeOf((*VirtualFloppyImageBackingOption)(nil)).Elem() +} + +type VirtualFloppyOption struct { + VirtualDeviceOption +} + +func init() { + t["VirtualFloppyOption"] = reflect.TypeOf((*VirtualFloppyOption)(nil)).Elem() +} + +type VirtualFloppyRemoteDeviceBackingInfo struct { + VirtualDeviceRemoteDeviceBackingInfo +} + +func init() { + t["VirtualFloppyRemoteDeviceBackingInfo"] = reflect.TypeOf((*VirtualFloppyRemoteDeviceBackingInfo)(nil)).Elem() +} + +type VirtualFloppyRemoteDeviceBackingOption struct { + VirtualDeviceRemoteDeviceBackingOption +} + +func init() { + t["VirtualFloppyRemoteDeviceBackingOption"] = reflect.TypeOf((*VirtualFloppyRemoteDeviceBackingOption)(nil)).Elem() +} + +type VirtualHardware struct { + DynamicData + + NumCPU int32 `xml:"numCPU"` + NumCoresPerSocket int32 `xml:"numCoresPerSocket,omitempty"` + MemoryMB int32 `xml:"memoryMB"` + VirtualICH7MPresent *bool `xml:"virtualICH7MPresent"` + VirtualSMCPresent *bool `xml:"virtualSMCPresent"` + Device []BaseVirtualDevice `xml:"device,omitempty,typeattr"` +} + +func init() { + t["VirtualHardware"] = reflect.TypeOf((*VirtualHardware)(nil)).Elem() +} + +type VirtualHardwareCompatibilityIssue struct { + VmConfigFault +} + +func init() { + t["VirtualHardwareCompatibilityIssue"] = reflect.TypeOf((*VirtualHardwareCompatibilityIssue)(nil)).Elem() +} + +type VirtualHardwareCompatibilityIssueFault BaseVirtualHardwareCompatibilityIssue + +func init() { + t["VirtualHardwareCompatibilityIssueFault"] = reflect.TypeOf((*VirtualHardwareCompatibilityIssueFault)(nil)).Elem() +} + +type VirtualHardwareOption struct { + DynamicData + + HwVersion int32 `xml:"hwVersion"` + VirtualDeviceOption []BaseVirtualDeviceOption `xml:"virtualDeviceOption,typeattr"` + DeviceListReadonly bool `xml:"deviceListReadonly"` + NumCPU []int32 `xml:"numCPU"` + NumCoresPerSocket *IntOption `xml:"numCoresPerSocket,omitempty"` + NumCpuReadonly bool `xml:"numCpuReadonly"` + MemoryMB LongOption `xml:"memoryMB"` + NumPCIControllers IntOption `xml:"numPCIControllers"` + NumIDEControllers IntOption `xml:"numIDEControllers"` + NumUSBControllers IntOption `xml:"numUSBControllers"` + NumUSBXHCIControllers *IntOption `xml:"numUSBXHCIControllers,omitempty"` + NumSIOControllers IntOption `xml:"numSIOControllers"` + NumPS2Controllers IntOption `xml:"numPS2Controllers"` + LicensingLimit []string `xml:"licensingLimit,omitempty"` + NumSupportedWwnPorts *IntOption `xml:"numSupportedWwnPorts,omitempty"` + NumSupportedWwnNodes *IntOption `xml:"numSupportedWwnNodes,omitempty"` + ResourceConfigOption *ResourceConfigOption `xml:"resourceConfigOption,omitempty"` +} + +func init() { + t["VirtualHardwareOption"] = reflect.TypeOf((*VirtualHardwareOption)(nil)).Elem() +} + +type VirtualHardwareVersionNotSupported struct { + VirtualHardwareCompatibilityIssue + + HostName string `xml:"hostName"` + Host ManagedObjectReference `xml:"host"` +} + +func init() { + t["VirtualHardwareVersionNotSupported"] = reflect.TypeOf((*VirtualHardwareVersionNotSupported)(nil)).Elem() +} + +type VirtualHardwareVersionNotSupportedFault VirtualHardwareVersionNotSupported + +func init() { + t["VirtualHardwareVersionNotSupportedFault"] = reflect.TypeOf((*VirtualHardwareVersionNotSupportedFault)(nil)).Elem() +} + +type VirtualHdAudioCard struct { + VirtualSoundCard +} + +func init() { + t["VirtualHdAudioCard"] = reflect.TypeOf((*VirtualHdAudioCard)(nil)).Elem() +} + +type VirtualHdAudioCardOption struct { + VirtualSoundCardOption +} + +func init() { + t["VirtualHdAudioCardOption"] = reflect.TypeOf((*VirtualHdAudioCardOption)(nil)).Elem() +} + +type VirtualIDEController struct { + VirtualController +} + +func init() { + t["VirtualIDEController"] = reflect.TypeOf((*VirtualIDEController)(nil)).Elem() +} + +type VirtualIDEControllerOption struct { + VirtualControllerOption + + NumIDEDisks IntOption `xml:"numIDEDisks"` + NumIDECdroms IntOption `xml:"numIDECdroms"` +} + +func init() { + t["VirtualIDEControllerOption"] = reflect.TypeOf((*VirtualIDEControllerOption)(nil)).Elem() +} + +type VirtualKeyboard struct { + VirtualDevice +} + +func init() { + t["VirtualKeyboard"] = reflect.TypeOf((*VirtualKeyboard)(nil)).Elem() +} + +type VirtualKeyboardOption struct { + VirtualDeviceOption +} + +func init() { + t["VirtualKeyboardOption"] = reflect.TypeOf((*VirtualKeyboardOption)(nil)).Elem() +} + +type VirtualLsiLogicController struct { + VirtualSCSIController +} + +func init() { + t["VirtualLsiLogicController"] = reflect.TypeOf((*VirtualLsiLogicController)(nil)).Elem() +} + +type VirtualLsiLogicControllerOption struct { + VirtualSCSIControllerOption +} + +func init() { + t["VirtualLsiLogicControllerOption"] = reflect.TypeOf((*VirtualLsiLogicControllerOption)(nil)).Elem() +} + +type VirtualLsiLogicSASController struct { + VirtualSCSIController +} + +func init() { + t["VirtualLsiLogicSASController"] = reflect.TypeOf((*VirtualLsiLogicSASController)(nil)).Elem() +} + +type VirtualLsiLogicSASControllerOption struct { + VirtualSCSIControllerOption +} + +func init() { + t["VirtualLsiLogicSASControllerOption"] = reflect.TypeOf((*VirtualLsiLogicSASControllerOption)(nil)).Elem() +} + +type VirtualMachineAffinityInfo struct { + DynamicData + + AffinitySet []int32 `xml:"affinitySet,omitempty"` +} + +func init() { + t["VirtualMachineAffinityInfo"] = reflect.TypeOf((*VirtualMachineAffinityInfo)(nil)).Elem() +} + +type VirtualMachineBootOptions struct { + DynamicData + + BootDelay int64 `xml:"bootDelay,omitempty"` + EnterBIOSSetup *bool `xml:"enterBIOSSetup"` + BootRetryEnabled *bool `xml:"bootRetryEnabled"` + BootRetryDelay int64 `xml:"bootRetryDelay,omitempty"` + BootOrder []BaseVirtualMachineBootOptionsBootableDevice `xml:"bootOrder,omitempty,typeattr"` + NetworkBootProtocol string `xml:"networkBootProtocol,omitempty"` +} + +func init() { + t["VirtualMachineBootOptions"] = reflect.TypeOf((*VirtualMachineBootOptions)(nil)).Elem() +} + +type VirtualMachineBootOptionsBootableCdromDevice struct { + VirtualMachineBootOptionsBootableDevice +} + +func init() { + t["VirtualMachineBootOptionsBootableCdromDevice"] = reflect.TypeOf((*VirtualMachineBootOptionsBootableCdromDevice)(nil)).Elem() +} + +type VirtualMachineBootOptionsBootableDevice struct { + DynamicData +} + +func init() { + t["VirtualMachineBootOptionsBootableDevice"] = reflect.TypeOf((*VirtualMachineBootOptionsBootableDevice)(nil)).Elem() +} + +type VirtualMachineBootOptionsBootableDiskDevice struct { + VirtualMachineBootOptionsBootableDevice + + DeviceKey int32 `xml:"deviceKey"` +} + +func init() { + t["VirtualMachineBootOptionsBootableDiskDevice"] = reflect.TypeOf((*VirtualMachineBootOptionsBootableDiskDevice)(nil)).Elem() +} + +type VirtualMachineBootOptionsBootableEthernetDevice struct { + VirtualMachineBootOptionsBootableDevice + + DeviceKey int32 `xml:"deviceKey"` +} + +func init() { + t["VirtualMachineBootOptionsBootableEthernetDevice"] = reflect.TypeOf((*VirtualMachineBootOptionsBootableEthernetDevice)(nil)).Elem() +} + +type VirtualMachineBootOptionsBootableFloppyDevice struct { + VirtualMachineBootOptionsBootableDevice +} + +func init() { + t["VirtualMachineBootOptionsBootableFloppyDevice"] = reflect.TypeOf((*VirtualMachineBootOptionsBootableFloppyDevice)(nil)).Elem() +} + +type VirtualMachineCapability struct { + DynamicData + + SnapshotOperationsSupported bool `xml:"snapshotOperationsSupported"` + MultipleSnapshotsSupported bool `xml:"multipleSnapshotsSupported"` + SnapshotConfigSupported bool `xml:"snapshotConfigSupported"` + PoweredOffSnapshotsSupported bool `xml:"poweredOffSnapshotsSupported"` + MemorySnapshotsSupported bool `xml:"memorySnapshotsSupported"` + RevertToSnapshotSupported bool `xml:"revertToSnapshotSupported"` + QuiescedSnapshotsSupported bool `xml:"quiescedSnapshotsSupported"` + DisableSnapshotsSupported bool `xml:"disableSnapshotsSupported"` + LockSnapshotsSupported bool `xml:"lockSnapshotsSupported"` + ConsolePreferencesSupported bool `xml:"consolePreferencesSupported"` + CpuFeatureMaskSupported bool `xml:"cpuFeatureMaskSupported"` + S1AcpiManagementSupported bool `xml:"s1AcpiManagementSupported"` + SettingScreenResolutionSupported bool `xml:"settingScreenResolutionSupported"` + ToolsAutoUpdateSupported bool `xml:"toolsAutoUpdateSupported"` + VmNpivWwnSupported bool `xml:"vmNpivWwnSupported"` + NpivWwnOnNonRdmVmSupported bool `xml:"npivWwnOnNonRdmVmSupported"` + VmNpivWwnDisableSupported *bool `xml:"vmNpivWwnDisableSupported"` + VmNpivWwnUpdateSupported *bool `xml:"vmNpivWwnUpdateSupported"` + SwapPlacementSupported bool `xml:"swapPlacementSupported"` + ToolsSyncTimeSupported bool `xml:"toolsSyncTimeSupported"` + VirtualMmuUsageSupported bool `xml:"virtualMmuUsageSupported"` + DiskSharesSupported bool `xml:"diskSharesSupported"` + BootOptionsSupported bool `xml:"bootOptionsSupported"` + BootRetryOptionsSupported *bool `xml:"bootRetryOptionsSupported"` + SettingVideoRamSizeSupported bool `xml:"settingVideoRamSizeSupported"` + SettingDisplayTopologySupported *bool `xml:"settingDisplayTopologySupported"` + RecordReplaySupported *bool `xml:"recordReplaySupported"` + ChangeTrackingSupported *bool `xml:"changeTrackingSupported"` + MultipleCoresPerSocketSupported *bool `xml:"multipleCoresPerSocketSupported"` + HostBasedReplicationSupported *bool `xml:"hostBasedReplicationSupported"` + GuestAutoLockSupported *bool `xml:"guestAutoLockSupported"` + MemoryReservationLockSupported *bool `xml:"memoryReservationLockSupported"` + FeatureRequirementSupported *bool `xml:"featureRequirementSupported"` + PoweredOnMonitorTypeChangeSupported *bool `xml:"poweredOnMonitorTypeChangeSupported"` + SeSparseDiskSupported *bool `xml:"seSparseDiskSupported"` + NestedHVSupported *bool `xml:"nestedHVSupported"` + VPMCSupported *bool `xml:"vPMCSupported"` +} + +func init() { + t["VirtualMachineCapability"] = reflect.TypeOf((*VirtualMachineCapability)(nil)).Elem() +} + +type VirtualMachineCdromInfo struct { + VirtualMachineTargetInfo +} + +func init() { + t["VirtualMachineCdromInfo"] = reflect.TypeOf((*VirtualMachineCdromInfo)(nil)).Elem() +} + +type VirtualMachineCloneSpec struct { + DynamicData + + Location VirtualMachineRelocateSpec `xml:"location"` + Template bool `xml:"template"` + Config *VirtualMachineConfigSpec `xml:"config,omitempty"` + Customization *CustomizationSpec `xml:"customization,omitempty"` + PowerOn bool `xml:"powerOn"` + Snapshot *ManagedObjectReference `xml:"snapshot,omitempty"` + Memory *bool `xml:"memory"` +} + +func init() { + t["VirtualMachineCloneSpec"] = reflect.TypeOf((*VirtualMachineCloneSpec)(nil)).Elem() +} + +type VirtualMachineConfigInfo struct { + DynamicData + + ChangeVersion string `xml:"changeVersion"` + Modified time.Time `xml:"modified"` + Name string `xml:"name"` + GuestFullName string `xml:"guestFullName"` + Version string `xml:"version"` + Uuid string `xml:"uuid"` + InstanceUuid string `xml:"instanceUuid,omitempty"` + NpivNodeWorldWideName []int64 `xml:"npivNodeWorldWideName,omitempty"` + NpivPortWorldWideName []int64 `xml:"npivPortWorldWideName,omitempty"` + NpivWorldWideNameType string `xml:"npivWorldWideNameType,omitempty"` + NpivDesiredNodeWwns int16 `xml:"npivDesiredNodeWwns,omitempty"` + NpivDesiredPortWwns int16 `xml:"npivDesiredPortWwns,omitempty"` + NpivTemporaryDisabled *bool `xml:"npivTemporaryDisabled"` + NpivOnNonRdmDisks *bool `xml:"npivOnNonRdmDisks"` + LocationId string `xml:"locationId,omitempty"` + Template bool `xml:"template"` + GuestId string `xml:"guestId"` + AlternateGuestName string `xml:"alternateGuestName"` + Annotation string `xml:"annotation,omitempty"` + Files VirtualMachineFileInfo `xml:"files"` + Tools *ToolsConfigInfo `xml:"tools,omitempty"` + Flags VirtualMachineFlagInfo `xml:"flags"` + ConsolePreferences *VirtualMachineConsolePreferences `xml:"consolePreferences,omitempty"` + DefaultPowerOps VirtualMachineDefaultPowerOpInfo `xml:"defaultPowerOps"` + Hardware VirtualHardware `xml:"hardware"` + CpuAllocation BaseResourceAllocationInfo `xml:"cpuAllocation,omitempty,typeattr"` + MemoryAllocation BaseResourceAllocationInfo `xml:"memoryAllocation,omitempty,typeattr"` + LatencySensitivity *LatencySensitivity `xml:"latencySensitivity,omitempty"` + MemoryHotAddEnabled *bool `xml:"memoryHotAddEnabled"` + CpuHotAddEnabled *bool `xml:"cpuHotAddEnabled"` + CpuHotRemoveEnabled *bool `xml:"cpuHotRemoveEnabled"` + HotPlugMemoryLimit int64 `xml:"hotPlugMemoryLimit,omitempty"` + HotPlugMemoryIncrementSize int64 `xml:"hotPlugMemoryIncrementSize,omitempty"` + CpuAffinity *VirtualMachineAffinityInfo `xml:"cpuAffinity,omitempty"` + MemoryAffinity *VirtualMachineAffinityInfo `xml:"memoryAffinity,omitempty"` + NetworkShaper *VirtualMachineNetworkShaperInfo `xml:"networkShaper,omitempty"` + ExtraConfig []BaseOptionValue `xml:"extraConfig,omitempty,typeattr"` + CpuFeatureMask []HostCpuIdInfo `xml:"cpuFeatureMask,omitempty"` + DatastoreUrl []VirtualMachineConfigInfoDatastoreUrlPair `xml:"datastoreUrl,omitempty"` + SwapPlacement string `xml:"swapPlacement,omitempty"` + BootOptions *VirtualMachineBootOptions `xml:"bootOptions,omitempty"` + FtInfo BaseFaultToleranceConfigInfo `xml:"ftInfo,omitempty,typeattr"` + RepConfig *ReplicationConfigSpec `xml:"repConfig,omitempty"` + VAppConfig BaseVmConfigInfo `xml:"vAppConfig,omitempty,typeattr"` + VAssertsEnabled *bool `xml:"vAssertsEnabled"` + ChangeTrackingEnabled *bool `xml:"changeTrackingEnabled"` + Firmware string `xml:"firmware,omitempty"` + MaxMksConnections int32 `xml:"maxMksConnections,omitempty"` + GuestAutoLockEnabled *bool `xml:"guestAutoLockEnabled"` + ManagedBy *ManagedByInfo `xml:"managedBy,omitempty"` + MemoryReservationLockedToMax *bool `xml:"memoryReservationLockedToMax"` + InitialOverhead *VirtualMachineConfigInfoOverheadInfo `xml:"initialOverhead,omitempty"` + NestedHVEnabled *bool `xml:"nestedHVEnabled"` + VPMCEnabled *bool `xml:"vPMCEnabled"` + ScheduledHardwareUpgradeInfo *ScheduledHardwareUpgradeInfo `xml:"scheduledHardwareUpgradeInfo,omitempty"` + ForkConfigInfo *VirtualMachineForkConfigInfo `xml:"forkConfigInfo,omitempty"` + VFlashCacheReservation int64 `xml:"vFlashCacheReservation,omitempty"` + VmxConfigChecksum []byte `xml:"vmxConfigChecksum,omitempty"` + MessageBusTunnelEnabled *bool `xml:"messageBusTunnelEnabled"` + VmStorageObjectId string `xml:"vmStorageObjectId,omitempty"` + SwapStorageObjectId string `xml:"swapStorageObjectId,omitempty"` +} + +func init() { + t["VirtualMachineConfigInfo"] = reflect.TypeOf((*VirtualMachineConfigInfo)(nil)).Elem() +} + +type VirtualMachineConfigInfoDatastoreUrlPair struct { + DynamicData + + Name string `xml:"name"` + Url string `xml:"url"` +} + +func init() { + t["VirtualMachineConfigInfoDatastoreUrlPair"] = reflect.TypeOf((*VirtualMachineConfigInfoDatastoreUrlPair)(nil)).Elem() +} + +type VirtualMachineConfigInfoOverheadInfo struct { + DynamicData + + InitialMemoryReservation int64 `xml:"initialMemoryReservation,omitempty"` + InitialSwapReservation int64 `xml:"initialSwapReservation,omitempty"` +} + +func init() { + t["VirtualMachineConfigInfoOverheadInfo"] = reflect.TypeOf((*VirtualMachineConfigInfoOverheadInfo)(nil)).Elem() +} + +type VirtualMachineConfigOption struct { + DynamicData + + Version string `xml:"version"` + Description string `xml:"description"` + GuestOSDescriptor []GuestOsDescriptor `xml:"guestOSDescriptor"` + GuestOSDefaultIndex int32 `xml:"guestOSDefaultIndex"` + HardwareOptions VirtualHardwareOption `xml:"hardwareOptions"` + Capabilities VirtualMachineCapability `xml:"capabilities"` + Datastore DatastoreOption `xml:"datastore"` + DefaultDevice []BaseVirtualDevice `xml:"defaultDevice,omitempty,typeattr"` + SupportedMonitorType []string `xml:"supportedMonitorType"` + SupportedOvfEnvironmentTransport []string `xml:"supportedOvfEnvironmentTransport,omitempty"` + SupportedOvfInstallTransport []string `xml:"supportedOvfInstallTransport,omitempty"` +} + +func init() { + t["VirtualMachineConfigOption"] = reflect.TypeOf((*VirtualMachineConfigOption)(nil)).Elem() +} + +type VirtualMachineConfigOptionDescriptor struct { + DynamicData + + Key string `xml:"key"` + Description string `xml:"description,omitempty"` + Host []ManagedObjectReference `xml:"host,omitempty"` + CreateSupported *bool `xml:"createSupported"` + DefaultConfigOption *bool `xml:"defaultConfigOption"` + RunSupported *bool `xml:"runSupported"` + UpgradeSupported *bool `xml:"upgradeSupported"` +} + +func init() { + t["VirtualMachineConfigOptionDescriptor"] = reflect.TypeOf((*VirtualMachineConfigOptionDescriptor)(nil)).Elem() +} + +type VirtualMachineConfigSpec struct { + DynamicData + + ChangeVersion string `xml:"changeVersion,omitempty"` + Name string `xml:"name,omitempty"` + Version string `xml:"version,omitempty"` + Uuid string `xml:"uuid,omitempty"` + InstanceUuid string `xml:"instanceUuid,omitempty"` + NpivNodeWorldWideName []int64 `xml:"npivNodeWorldWideName,omitempty"` + NpivPortWorldWideName []int64 `xml:"npivPortWorldWideName,omitempty"` + NpivWorldWideNameType string `xml:"npivWorldWideNameType,omitempty"` + NpivDesiredNodeWwns int16 `xml:"npivDesiredNodeWwns,omitempty"` + NpivDesiredPortWwns int16 `xml:"npivDesiredPortWwns,omitempty"` + NpivTemporaryDisabled *bool `xml:"npivTemporaryDisabled"` + NpivOnNonRdmDisks *bool `xml:"npivOnNonRdmDisks"` + NpivWorldWideNameOp string `xml:"npivWorldWideNameOp,omitempty"` + LocationId string `xml:"locationId,omitempty"` + GuestId string `xml:"guestId,omitempty"` + AlternateGuestName string `xml:"alternateGuestName,omitempty"` + Annotation string `xml:"annotation,omitempty"` + Files *VirtualMachineFileInfo `xml:"files,omitempty"` + Tools *ToolsConfigInfo `xml:"tools,omitempty"` + Flags *VirtualMachineFlagInfo `xml:"flags,omitempty"` + ConsolePreferences *VirtualMachineConsolePreferences `xml:"consolePreferences,omitempty"` + PowerOpInfo *VirtualMachineDefaultPowerOpInfo `xml:"powerOpInfo,omitempty"` + NumCPUs int32 `xml:"numCPUs,omitempty"` + NumCoresPerSocket int32 `xml:"numCoresPerSocket,omitempty"` + MemoryMB int64 `xml:"memoryMB,omitempty"` + MemoryHotAddEnabled *bool `xml:"memoryHotAddEnabled"` + CpuHotAddEnabled *bool `xml:"cpuHotAddEnabled"` + CpuHotRemoveEnabled *bool `xml:"cpuHotRemoveEnabled"` + VirtualICH7MPresent *bool `xml:"virtualICH7MPresent"` + VirtualSMCPresent *bool `xml:"virtualSMCPresent"` + DeviceChange []BaseVirtualDeviceConfigSpec `xml:"deviceChange,omitempty,typeattr"` + CpuAllocation BaseResourceAllocationInfo `xml:"cpuAllocation,omitempty,typeattr"` + MemoryAllocation BaseResourceAllocationInfo `xml:"memoryAllocation,omitempty,typeattr"` + LatencySensitivity *LatencySensitivity `xml:"latencySensitivity,omitempty"` + CpuAffinity *VirtualMachineAffinityInfo `xml:"cpuAffinity,omitempty"` + MemoryAffinity *VirtualMachineAffinityInfo `xml:"memoryAffinity,omitempty"` + NetworkShaper *VirtualMachineNetworkShaperInfo `xml:"networkShaper,omitempty"` + CpuFeatureMask []VirtualMachineCpuIdInfoSpec `xml:"cpuFeatureMask,omitempty"` + ExtraConfig []BaseOptionValue `xml:"extraConfig,omitempty,typeattr"` + SwapPlacement string `xml:"swapPlacement,omitempty"` + BootOptions *VirtualMachineBootOptions `xml:"bootOptions,omitempty"` + VAppConfig BaseVmConfigSpec `xml:"vAppConfig,omitempty,typeattr"` + FtInfo BaseFaultToleranceConfigInfo `xml:"ftInfo,omitempty,typeattr"` + RepConfig *ReplicationConfigSpec `xml:"repConfig,omitempty"` + VAppConfigRemoved *bool `xml:"vAppConfigRemoved"` + VAssertsEnabled *bool `xml:"vAssertsEnabled"` + ChangeTrackingEnabled *bool `xml:"changeTrackingEnabled"` + Firmware string `xml:"firmware,omitempty"` + MaxMksConnections int32 `xml:"maxMksConnections,omitempty"` + GuestAutoLockEnabled *bool `xml:"guestAutoLockEnabled"` + ManagedBy *ManagedByInfo `xml:"managedBy,omitempty"` + MemoryReservationLockedToMax *bool `xml:"memoryReservationLockedToMax"` + NestedHVEnabled *bool `xml:"nestedHVEnabled"` + VPMCEnabled *bool `xml:"vPMCEnabled"` + ScheduledHardwareUpgradeInfo *ScheduledHardwareUpgradeInfo `xml:"scheduledHardwareUpgradeInfo,omitempty"` + VmProfile []BaseVirtualMachineProfileSpec `xml:"vmProfile,omitempty,typeattr"` + MessageBusTunnelEnabled *bool `xml:"messageBusTunnelEnabled"` +} + +func init() { + t["VirtualMachineConfigSpec"] = reflect.TypeOf((*VirtualMachineConfigSpec)(nil)).Elem() +} + +type VirtualMachineConfigSummary struct { + DynamicData + + Name string `xml:"name"` + Template bool `xml:"template"` + VmPathName string `xml:"vmPathName"` + MemorySizeMB int32 `xml:"memorySizeMB,omitempty"` + CpuReservation int32 `xml:"cpuReservation,omitempty"` + MemoryReservation int32 `xml:"memoryReservation,omitempty"` + NumCpu int32 `xml:"numCpu,omitempty"` + NumEthernetCards int32 `xml:"numEthernetCards,omitempty"` + NumVirtualDisks int32 `xml:"numVirtualDisks,omitempty"` + Uuid string `xml:"uuid,omitempty"` + InstanceUuid string `xml:"instanceUuid,omitempty"` + GuestId string `xml:"guestId,omitempty"` + GuestFullName string `xml:"guestFullName,omitempty"` + Annotation string `xml:"annotation,omitempty"` + Product *VAppProductInfo `xml:"product,omitempty"` + InstallBootRequired *bool `xml:"installBootRequired"` + FtInfo BaseFaultToleranceConfigInfo `xml:"ftInfo,omitempty,typeattr"` + ManagedBy *ManagedByInfo `xml:"managedBy,omitempty"` +} + +func init() { + t["VirtualMachineConfigSummary"] = reflect.TypeOf((*VirtualMachineConfigSummary)(nil)).Elem() +} + +type VirtualMachineConsolePreferences struct { + DynamicData + + PowerOnWhenOpened *bool `xml:"powerOnWhenOpened"` + EnterFullScreenOnPowerOn *bool `xml:"enterFullScreenOnPowerOn"` + CloseOnPowerOffOrSuspend *bool `xml:"closeOnPowerOffOrSuspend"` +} + +func init() { + t["VirtualMachineConsolePreferences"] = reflect.TypeOf((*VirtualMachineConsolePreferences)(nil)).Elem() +} + +type VirtualMachineCpuIdInfoSpec struct { + ArrayUpdateSpec + + Info *HostCpuIdInfo `xml:"info,omitempty"` +} + +func init() { + t["VirtualMachineCpuIdInfoSpec"] = reflect.TypeOf((*VirtualMachineCpuIdInfoSpec)(nil)).Elem() +} + +type VirtualMachineCreateChildSpec struct { + DynamicData + + Location *VirtualMachineRelocateSpec `xml:"location,omitempty"` + Persistent bool `xml:"persistent"` + ConfigParams []BaseOptionValue `xml:"configParams,omitempty,typeattr"` +} + +func init() { + t["VirtualMachineCreateChildSpec"] = reflect.TypeOf((*VirtualMachineCreateChildSpec)(nil)).Elem() +} + +type VirtualMachineDatastoreInfo struct { + VirtualMachineTargetInfo + + Datastore DatastoreSummary `xml:"datastore"` + Capability DatastoreCapability `xml:"capability"` + MaxFileSize int64 `xml:"maxFileSize"` + MaxVirtualDiskCapacity int64 `xml:"maxVirtualDiskCapacity,omitempty"` + MaxPhysicalRDMFileSize int64 `xml:"maxPhysicalRDMFileSize,omitempty"` + MaxVirtualRDMFileSize int64 `xml:"maxVirtualRDMFileSize,omitempty"` + Mode string `xml:"mode"` + VStorageSupport string `xml:"vStorageSupport,omitempty"` +} + +func init() { + t["VirtualMachineDatastoreInfo"] = reflect.TypeOf((*VirtualMachineDatastoreInfo)(nil)).Elem() +} + +type VirtualMachineDatastoreVolumeOption struct { + DynamicData + + FileSystemType string `xml:"fileSystemType"` + MajorVersion int32 `xml:"majorVersion,omitempty"` +} + +func init() { + t["VirtualMachineDatastoreVolumeOption"] = reflect.TypeOf((*VirtualMachineDatastoreVolumeOption)(nil)).Elem() +} + +type VirtualMachineDefaultPowerOpInfo struct { + DynamicData + + PowerOffType string `xml:"powerOffType,omitempty"` + SuspendType string `xml:"suspendType,omitempty"` + ResetType string `xml:"resetType,omitempty"` + DefaultPowerOffType string `xml:"defaultPowerOffType,omitempty"` + DefaultSuspendType string `xml:"defaultSuspendType,omitempty"` + DefaultResetType string `xml:"defaultResetType,omitempty"` + StandbyAction string `xml:"standbyAction,omitempty"` +} + +func init() { + t["VirtualMachineDefaultPowerOpInfo"] = reflect.TypeOf((*VirtualMachineDefaultPowerOpInfo)(nil)).Elem() +} + +type VirtualMachineDefaultProfileSpec struct { + VirtualMachineProfileSpec +} + +func init() { + t["VirtualMachineDefaultProfileSpec"] = reflect.TypeOf((*VirtualMachineDefaultProfileSpec)(nil)).Elem() +} + +type VirtualMachineDefinedProfileSpec struct { + VirtualMachineProfileSpec + + ProfileId string `xml:"profileId"` + ProfileData *VirtualMachineProfileRawData `xml:"profileData,omitempty"` +} + +func init() { + t["VirtualMachineDefinedProfileSpec"] = reflect.TypeOf((*VirtualMachineDefinedProfileSpec)(nil)).Elem() +} + +type VirtualMachineDeviceRuntimeInfo struct { + DynamicData + + RuntimeState BaseVirtualMachineDeviceRuntimeInfoDeviceRuntimeState `xml:"runtimeState,typeattr"` + Key int32 `xml:"key"` +} + +func init() { + t["VirtualMachineDeviceRuntimeInfo"] = reflect.TypeOf((*VirtualMachineDeviceRuntimeInfo)(nil)).Elem() +} + +type VirtualMachineDeviceRuntimeInfoDeviceRuntimeState struct { + DynamicData +} + +func init() { + t["VirtualMachineDeviceRuntimeInfoDeviceRuntimeState"] = reflect.TypeOf((*VirtualMachineDeviceRuntimeInfoDeviceRuntimeState)(nil)).Elem() +} + +type VirtualMachineDeviceRuntimeInfoVirtualEthernetCardRuntimeState struct { + VirtualMachineDeviceRuntimeInfoDeviceRuntimeState + + VmDirectPathGen2Active bool `xml:"vmDirectPathGen2Active"` + VmDirectPathGen2InactiveReasonVm []string `xml:"vmDirectPathGen2InactiveReasonVm,omitempty"` + VmDirectPathGen2InactiveReasonOther []string `xml:"vmDirectPathGen2InactiveReasonOther,omitempty"` + VmDirectPathGen2InactiveReasonExtended string `xml:"vmDirectPathGen2InactiveReasonExtended,omitempty"` + ReservationStatus string `xml:"reservationStatus,omitempty"` +} + +func init() { + t["VirtualMachineDeviceRuntimeInfoVirtualEthernetCardRuntimeState"] = reflect.TypeOf((*VirtualMachineDeviceRuntimeInfoVirtualEthernetCardRuntimeState)(nil)).Elem() +} + +type VirtualMachineDiskDeviceInfo struct { + VirtualMachineTargetInfo + + Capacity int64 `xml:"capacity,omitempty"` + Vm []ManagedObjectReference `xml:"vm,omitempty"` +} + +func init() { + t["VirtualMachineDiskDeviceInfo"] = reflect.TypeOf((*VirtualMachineDiskDeviceInfo)(nil)).Elem() +} + +type VirtualMachineDisplayTopology struct { + DynamicData + + X int32 `xml:"x"` + Y int32 `xml:"y"` + Width int32 `xml:"width"` + Height int32 `xml:"height"` +} + +func init() { + t["VirtualMachineDisplayTopology"] = reflect.TypeOf((*VirtualMachineDisplayTopology)(nil)).Elem() +} + +type VirtualMachineEmptyProfileSpec struct { + VirtualMachineProfileSpec +} + +func init() { + t["VirtualMachineEmptyProfileSpec"] = reflect.TypeOf((*VirtualMachineEmptyProfileSpec)(nil)).Elem() +} + +type VirtualMachineFeatureRequirement struct { + DynamicData + + Key string `xml:"key"` + FeatureName string `xml:"featureName"` + Value string `xml:"value"` +} + +func init() { + t["VirtualMachineFeatureRequirement"] = reflect.TypeOf((*VirtualMachineFeatureRequirement)(nil)).Elem() +} + +type VirtualMachineFileInfo struct { + DynamicData + + VmPathName string `xml:"vmPathName,omitempty"` + SnapshotDirectory string `xml:"snapshotDirectory,omitempty"` + SuspendDirectory string `xml:"suspendDirectory,omitempty"` + LogDirectory string `xml:"logDirectory,omitempty"` + FtMetadataDirectory string `xml:"ftMetadataDirectory,omitempty"` +} + +func init() { + t["VirtualMachineFileInfo"] = reflect.TypeOf((*VirtualMachineFileInfo)(nil)).Elem() +} + +type VirtualMachineFileLayout struct { + DynamicData + + ConfigFile []string `xml:"configFile,omitempty"` + LogFile []string `xml:"logFile,omitempty"` + Disk []VirtualMachineFileLayoutDiskLayout `xml:"disk,omitempty"` + Snapshot []VirtualMachineFileLayoutSnapshotLayout `xml:"snapshot,omitempty"` + SwapFile string `xml:"swapFile,omitempty"` +} + +func init() { + t["VirtualMachineFileLayout"] = reflect.TypeOf((*VirtualMachineFileLayout)(nil)).Elem() +} + +type VirtualMachineFileLayoutDiskLayout struct { + DynamicData + + Key int32 `xml:"key"` + DiskFile []string `xml:"diskFile"` +} + +func init() { + t["VirtualMachineFileLayoutDiskLayout"] = reflect.TypeOf((*VirtualMachineFileLayoutDiskLayout)(nil)).Elem() +} + +type VirtualMachineFileLayoutEx struct { + DynamicData + + File []VirtualMachineFileLayoutExFileInfo `xml:"file,omitempty"` + Disk []VirtualMachineFileLayoutExDiskLayout `xml:"disk,omitempty"` + Snapshot []VirtualMachineFileLayoutExSnapshotLayout `xml:"snapshot,omitempty"` + Timestamp time.Time `xml:"timestamp"` +} + +func init() { + t["VirtualMachineFileLayoutEx"] = reflect.TypeOf((*VirtualMachineFileLayoutEx)(nil)).Elem() +} + +type VirtualMachineFileLayoutExDiskLayout struct { + DynamicData + + Key int32 `xml:"key"` + Chain []VirtualMachineFileLayoutExDiskUnit `xml:"chain,omitempty"` +} + +func init() { + t["VirtualMachineFileLayoutExDiskLayout"] = reflect.TypeOf((*VirtualMachineFileLayoutExDiskLayout)(nil)).Elem() +} + +type VirtualMachineFileLayoutExDiskUnit struct { + DynamicData + + FileKey []int32 `xml:"fileKey"` +} + +func init() { + t["VirtualMachineFileLayoutExDiskUnit"] = reflect.TypeOf((*VirtualMachineFileLayoutExDiskUnit)(nil)).Elem() +} + +type VirtualMachineFileLayoutExFileInfo struct { + DynamicData + + Key int32 `xml:"key"` + Name string `xml:"name"` + Type string `xml:"type"` + Size int64 `xml:"size"` + UniqueSize int64 `xml:"uniqueSize,omitempty"` + BackingObjectId string `xml:"backingObjectId,omitempty"` + Accessible *bool `xml:"accessible"` +} + +func init() { + t["VirtualMachineFileLayoutExFileInfo"] = reflect.TypeOf((*VirtualMachineFileLayoutExFileInfo)(nil)).Elem() +} + +type VirtualMachineFileLayoutExSnapshotLayout struct { + DynamicData + + Key ManagedObjectReference `xml:"key"` + DataKey int32 `xml:"dataKey"` + MemoryKey int32 `xml:"memoryKey,omitempty"` + Disk []VirtualMachineFileLayoutExDiskLayout `xml:"disk,omitempty"` +} + +func init() { + t["VirtualMachineFileLayoutExSnapshotLayout"] = reflect.TypeOf((*VirtualMachineFileLayoutExSnapshotLayout)(nil)).Elem() +} + +type VirtualMachineFileLayoutSnapshotLayout struct { + DynamicData + + Key ManagedObjectReference `xml:"key"` + SnapshotFile []string `xml:"snapshotFile"` +} + +func init() { + t["VirtualMachineFileLayoutSnapshotLayout"] = reflect.TypeOf((*VirtualMachineFileLayoutSnapshotLayout)(nil)).Elem() +} + +type VirtualMachineFlagInfo struct { + DynamicData + + DisableAcceleration *bool `xml:"disableAcceleration"` + EnableLogging *bool `xml:"enableLogging"` + UseToe *bool `xml:"useToe"` + RunWithDebugInfo *bool `xml:"runWithDebugInfo"` + MonitorType string `xml:"monitorType,omitempty"` + HtSharing string `xml:"htSharing,omitempty"` + SnapshotDisabled *bool `xml:"snapshotDisabled"` + SnapshotLocked *bool `xml:"snapshotLocked"` + DiskUuidEnabled *bool `xml:"diskUuidEnabled"` + VirtualMmuUsage string `xml:"virtualMmuUsage,omitempty"` + VirtualExecUsage string `xml:"virtualExecUsage,omitempty"` + SnapshotPowerOffBehavior string `xml:"snapshotPowerOffBehavior,omitempty"` + RecordReplayEnabled *bool `xml:"recordReplayEnabled"` + FaultToleranceType string `xml:"faultToleranceType,omitempty"` +} + +func init() { + t["VirtualMachineFlagInfo"] = reflect.TypeOf((*VirtualMachineFlagInfo)(nil)).Elem() +} + +type VirtualMachineFloppyInfo struct { + VirtualMachineTargetInfo +} + +func init() { + t["VirtualMachineFloppyInfo"] = reflect.TypeOf((*VirtualMachineFloppyInfo)(nil)).Elem() +} + +type VirtualMachineForkConfigInfo struct { + DynamicData + + ParentEnabled *bool `xml:"parentEnabled"` + ChildForkGroupId string `xml:"childForkGroupId,omitempty"` + ChildType string `xml:"childType,omitempty"` +} + +func init() { + t["VirtualMachineForkConfigInfo"] = reflect.TypeOf((*VirtualMachineForkConfigInfo)(nil)).Elem() +} + +type VirtualMachineGuestSummary struct { + DynamicData + + GuestId string `xml:"guestId,omitempty"` + GuestFullName string `xml:"guestFullName,omitempty"` + ToolsStatus VirtualMachineToolsStatus `xml:"toolsStatus,omitempty"` + ToolsVersionStatus string `xml:"toolsVersionStatus,omitempty"` + ToolsVersionStatus2 string `xml:"toolsVersionStatus2,omitempty"` + ToolsRunningStatus string `xml:"toolsRunningStatus,omitempty"` + HostName string `xml:"hostName,omitempty"` + IpAddress string `xml:"ipAddress,omitempty"` +} + +func init() { + t["VirtualMachineGuestSummary"] = reflect.TypeOf((*VirtualMachineGuestSummary)(nil)).Elem() +} + +type VirtualMachineIdeDiskDeviceInfo struct { + VirtualMachineDiskDeviceInfo + + PartitionTable []VirtualMachineIdeDiskDevicePartitionInfo `xml:"partitionTable,omitempty"` +} + +func init() { + t["VirtualMachineIdeDiskDeviceInfo"] = reflect.TypeOf((*VirtualMachineIdeDiskDeviceInfo)(nil)).Elem() +} + +type VirtualMachineIdeDiskDevicePartitionInfo struct { + DynamicData + + Id int32 `xml:"id"` + Capacity int32 `xml:"capacity"` +} + +func init() { + t["VirtualMachineIdeDiskDevicePartitionInfo"] = reflect.TypeOf((*VirtualMachineIdeDiskDevicePartitionInfo)(nil)).Elem() +} + +type VirtualMachineImportSpec struct { + ImportSpec + + ConfigSpec VirtualMachineConfigSpec `xml:"configSpec"` + ResPoolEntity *ManagedObjectReference `xml:"resPoolEntity,omitempty"` +} + +func init() { + t["VirtualMachineImportSpec"] = reflect.TypeOf((*VirtualMachineImportSpec)(nil)).Elem() +} + +type VirtualMachineLegacyNetworkSwitchInfo struct { + DynamicData + + Name string `xml:"name"` +} + +func init() { + t["VirtualMachineLegacyNetworkSwitchInfo"] = reflect.TypeOf((*VirtualMachineLegacyNetworkSwitchInfo)(nil)).Elem() +} + +type VirtualMachineMemoryReservationInfo struct { + DynamicData + + VirtualMachineMin int64 `xml:"virtualMachineMin"` + VirtualMachineMax int64 `xml:"virtualMachineMax"` + VirtualMachineReserved int64 `xml:"virtualMachineReserved"` + AllocationPolicy string `xml:"allocationPolicy"` +} + +func init() { + t["VirtualMachineMemoryReservationInfo"] = reflect.TypeOf((*VirtualMachineMemoryReservationInfo)(nil)).Elem() +} + +type VirtualMachineMemoryReservationSpec struct { + DynamicData + + VirtualMachineReserved int64 `xml:"virtualMachineReserved,omitempty"` + AllocationPolicy string `xml:"allocationPolicy,omitempty"` +} + +func init() { + t["VirtualMachineMemoryReservationSpec"] = reflect.TypeOf((*VirtualMachineMemoryReservationSpec)(nil)).Elem() +} + +type VirtualMachineMessage struct { + DynamicData + + Id string `xml:"id"` + Argument []AnyType `xml:"argument,omitempty,typeattr"` + Text string `xml:"text,omitempty"` +} + +func init() { + t["VirtualMachineMessage"] = reflect.TypeOf((*VirtualMachineMessage)(nil)).Elem() +} + +type VirtualMachineMetadataManagerVmMetadata struct { + DynamicData + + VmId string `xml:"vmId"` + Metadata string `xml:"metadata,omitempty"` +} + +func init() { + t["VirtualMachineMetadataManagerVmMetadata"] = reflect.TypeOf((*VirtualMachineMetadataManagerVmMetadata)(nil)).Elem() +} + +type VirtualMachineMetadataManagerVmMetadataInput struct { + DynamicData + + Operation string `xml:"operation"` + VmMetadata VirtualMachineMetadataManagerVmMetadata `xml:"vmMetadata"` +} + +func init() { + t["VirtualMachineMetadataManagerVmMetadataInput"] = reflect.TypeOf((*VirtualMachineMetadataManagerVmMetadataInput)(nil)).Elem() +} + +type VirtualMachineMetadataManagerVmMetadataOwner struct { + DynamicData + + Name string `xml:"name"` +} + +func init() { + t["VirtualMachineMetadataManagerVmMetadataOwner"] = reflect.TypeOf((*VirtualMachineMetadataManagerVmMetadataOwner)(nil)).Elem() +} + +type VirtualMachineMetadataManagerVmMetadataResult struct { + DynamicData + + VmMetadata VirtualMachineMetadataManagerVmMetadata `xml:"vmMetadata"` + Error *LocalizedMethodFault `xml:"error,omitempty"` +} + +func init() { + t["VirtualMachineMetadataManagerVmMetadataResult"] = reflect.TypeOf((*VirtualMachineMetadataManagerVmMetadataResult)(nil)).Elem() +} + +type VirtualMachineMksTicket struct { + DynamicData + + Ticket string `xml:"ticket"` + CfgFile string `xml:"cfgFile"` + Host string `xml:"host,omitempty"` + Port int32 `xml:"port,omitempty"` + SslThumbprint string `xml:"sslThumbprint,omitempty"` +} + +func init() { + t["VirtualMachineMksTicket"] = reflect.TypeOf((*VirtualMachineMksTicket)(nil)).Elem() +} + +type VirtualMachineNetworkInfo struct { + VirtualMachineTargetInfo + + Network BaseNetworkSummary `xml:"network,typeattr"` +} + +func init() { + t["VirtualMachineNetworkInfo"] = reflect.TypeOf((*VirtualMachineNetworkInfo)(nil)).Elem() +} + +type VirtualMachineNetworkShaperInfo struct { + DynamicData + + Enabled *bool `xml:"enabled"` + PeakBps int64 `xml:"peakBps,omitempty"` + AverageBps int64 `xml:"averageBps,omitempty"` + BurstSize int64 `xml:"burstSize,omitempty"` +} + +func init() { + t["VirtualMachineNetworkShaperInfo"] = reflect.TypeOf((*VirtualMachineNetworkShaperInfo)(nil)).Elem() +} + +type VirtualMachineParallelInfo struct { + VirtualMachineTargetInfo +} + +func init() { + t["VirtualMachineParallelInfo"] = reflect.TypeOf((*VirtualMachineParallelInfo)(nil)).Elem() +} + +type VirtualMachinePciPassthroughInfo struct { + VirtualMachineTargetInfo + + PciDevice HostPciDevice `xml:"pciDevice"` + SystemId string `xml:"systemId"` +} + +func init() { + t["VirtualMachinePciPassthroughInfo"] = reflect.TypeOf((*VirtualMachinePciPassthroughInfo)(nil)).Elem() +} + +type VirtualMachinePciSharedGpuPassthroughInfo struct { + VirtualMachineTargetInfo + + Vgpu string `xml:"vgpu"` +} + +func init() { + t["VirtualMachinePciSharedGpuPassthroughInfo"] = reflect.TypeOf((*VirtualMachinePciSharedGpuPassthroughInfo)(nil)).Elem() +} + +type VirtualMachineProfileRawData struct { + DynamicData + + ExtensionKey string `xml:"extensionKey"` + ObjectData string `xml:"objectData,omitempty"` +} + +func init() { + t["VirtualMachineProfileRawData"] = reflect.TypeOf((*VirtualMachineProfileRawData)(nil)).Elem() +} + +type VirtualMachineProfileSpec struct { + DynamicData +} + +func init() { + t["VirtualMachineProfileSpec"] = reflect.TypeOf((*VirtualMachineProfileSpec)(nil)).Elem() +} + +type VirtualMachineQuestionInfo struct { + DynamicData + + Id string `xml:"id"` + Text string `xml:"text"` + Choice ChoiceOption `xml:"choice"` + Message []VirtualMachineMessage `xml:"message,omitempty"` +} + +func init() { + t["VirtualMachineQuestionInfo"] = reflect.TypeOf((*VirtualMachineQuestionInfo)(nil)).Elem() +} + +type VirtualMachineQuickStats struct { + DynamicData + + OverallCpuUsage int32 `xml:"overallCpuUsage,omitempty"` + OverallCpuDemand int32 `xml:"overallCpuDemand,omitempty"` + GuestMemoryUsage int32 `xml:"guestMemoryUsage,omitempty"` + HostMemoryUsage int32 `xml:"hostMemoryUsage,omitempty"` + GuestHeartbeatStatus ManagedEntityStatus `xml:"guestHeartbeatStatus"` + DistributedCpuEntitlement int32 `xml:"distributedCpuEntitlement,omitempty"` + DistributedMemoryEntitlement int32 `xml:"distributedMemoryEntitlement,omitempty"` + StaticCpuEntitlement int32 `xml:"staticCpuEntitlement,omitempty"` + StaticMemoryEntitlement int32 `xml:"staticMemoryEntitlement,omitempty"` + PrivateMemory int32 `xml:"privateMemory,omitempty"` + SharedMemory int32 `xml:"sharedMemory,omitempty"` + SwappedMemory int32 `xml:"swappedMemory,omitempty"` + BalloonedMemory int32 `xml:"balloonedMemory,omitempty"` + ConsumedOverheadMemory int32 `xml:"consumedOverheadMemory,omitempty"` + FtLogBandwidth int32 `xml:"ftLogBandwidth,omitempty"` + FtSecondaryLatency int32 `xml:"ftSecondaryLatency,omitempty"` + FtLatencyStatus ManagedEntityStatus `xml:"ftLatencyStatus,omitempty"` + CompressedMemory int64 `xml:"compressedMemory,omitempty"` + UptimeSeconds int32 `xml:"uptimeSeconds,omitempty"` + SsdSwappedMemory int64 `xml:"ssdSwappedMemory,omitempty"` +} + +func init() { + t["VirtualMachineQuickStats"] = reflect.TypeOf((*VirtualMachineQuickStats)(nil)).Elem() +} + +type VirtualMachineRelocateSpec struct { + DynamicData + + Service *ServiceLocator `xml:"service,omitempty"` + Folder *ManagedObjectReference `xml:"folder,omitempty"` + Datastore *ManagedObjectReference `xml:"datastore,omitempty"` + DiskMoveType string `xml:"diskMoveType,omitempty"` + Pool *ManagedObjectReference `xml:"pool,omitempty"` + Host *ManagedObjectReference `xml:"host,omitempty"` + Disk []VirtualMachineRelocateSpecDiskLocator `xml:"disk,omitempty"` + Transform VirtualMachineRelocateTransformation `xml:"transform,omitempty"` + DeviceChange []BaseVirtualDeviceConfigSpec `xml:"deviceChange,omitempty,typeattr"` + Profile []BaseVirtualMachineProfileSpec `xml:"profile,omitempty,typeattr"` +} + +func init() { + t["VirtualMachineRelocateSpec"] = reflect.TypeOf((*VirtualMachineRelocateSpec)(nil)).Elem() +} + +type VirtualMachineRelocateSpecDiskLocator struct { + DynamicData + + DiskId int32 `xml:"diskId"` + Datastore ManagedObjectReference `xml:"datastore"` + DiskMoveType string `xml:"diskMoveType,omitempty"` + DiskBackingInfo BaseVirtualDeviceBackingInfo `xml:"diskBackingInfo,omitempty,typeattr"` + Profile []BaseVirtualMachineProfileSpec `xml:"profile,omitempty,typeattr"` +} + +func init() { + t["VirtualMachineRelocateSpecDiskLocator"] = reflect.TypeOf((*VirtualMachineRelocateSpecDiskLocator)(nil)).Elem() +} + +type VirtualMachineRuntimeInfo struct { + DynamicData + + Device []VirtualMachineDeviceRuntimeInfo `xml:"device,omitempty"` + Host *ManagedObjectReference `xml:"host,omitempty"` + ConnectionState VirtualMachineConnectionState `xml:"connectionState"` + PowerState VirtualMachinePowerState `xml:"powerState"` + FaultToleranceState VirtualMachineFaultToleranceState `xml:"faultToleranceState,omitempty"` + DasVmProtection *VirtualMachineRuntimeInfoDasProtectionState `xml:"dasVmProtection,omitempty"` + ToolsInstallerMounted bool `xml:"toolsInstallerMounted"` + SuspendTime *time.Time `xml:"suspendTime"` + BootTime *time.Time `xml:"bootTime"` + SuspendInterval int64 `xml:"suspendInterval,omitempty"` + Question *VirtualMachineQuestionInfo `xml:"question,omitempty"` + MemoryOverhead int64 `xml:"memoryOverhead,omitempty"` + MaxCpuUsage int32 `xml:"maxCpuUsage,omitempty"` + MaxMemoryUsage int32 `xml:"maxMemoryUsage,omitempty"` + NumMksConnections int32 `xml:"numMksConnections"` + RecordReplayState VirtualMachineRecordReplayState `xml:"recordReplayState,omitempty"` + CleanPowerOff *bool `xml:"cleanPowerOff"` + NeedSecondaryReason string `xml:"needSecondaryReason,omitempty"` + OnlineStandby *bool `xml:"onlineStandby"` + MinRequiredEVCModeKey string `xml:"minRequiredEVCModeKey,omitempty"` + ConsolidationNeeded *bool `xml:"consolidationNeeded"` + OfflineFeatureRequirement []VirtualMachineFeatureRequirement `xml:"offlineFeatureRequirement,omitempty"` + FeatureRequirement []VirtualMachineFeatureRequirement `xml:"featureRequirement,omitempty"` + FeatureMask []HostFeatureMask `xml:"featureMask,omitempty"` + VFlashCacheAllocation int64 `xml:"vFlashCacheAllocation,omitempty"` + Paused *bool `xml:"paused"` + SnapshotInBackground *bool `xml:"snapshotInBackground"` + QuiescedForkParent *bool `xml:"quiescedForkParent"` +} + +func init() { + t["VirtualMachineRuntimeInfo"] = reflect.TypeOf((*VirtualMachineRuntimeInfo)(nil)).Elem() +} + +type VirtualMachineRuntimeInfoDasProtectionState struct { + DynamicData + + DasProtected bool `xml:"dasProtected"` +} + +func init() { + t["VirtualMachineRuntimeInfoDasProtectionState"] = reflect.TypeOf((*VirtualMachineRuntimeInfoDasProtectionState)(nil)).Elem() +} + +type VirtualMachineScsiDiskDeviceInfo struct { + VirtualMachineDiskDeviceInfo + + Disk *HostScsiDisk `xml:"disk,omitempty"` + TransportHint string `xml:"transportHint,omitempty"` + LunNumber int32 `xml:"lunNumber,omitempty"` +} + +func init() { + t["VirtualMachineScsiDiskDeviceInfo"] = reflect.TypeOf((*VirtualMachineScsiDiskDeviceInfo)(nil)).Elem() +} + +type VirtualMachineScsiPassthroughInfo struct { + VirtualMachineTargetInfo + + ScsiClass string `xml:"scsiClass"` + Vendor string `xml:"vendor"` + PhysicalUnitNumber int32 `xml:"physicalUnitNumber"` +} + +func init() { + t["VirtualMachineScsiPassthroughInfo"] = reflect.TypeOf((*VirtualMachineScsiPassthroughInfo)(nil)).Elem() +} + +type VirtualMachineSerialInfo struct { + VirtualMachineTargetInfo +} + +func init() { + t["VirtualMachineSerialInfo"] = reflect.TypeOf((*VirtualMachineSerialInfo)(nil)).Elem() +} + +type VirtualMachineSnapshotInfo struct { + DynamicData + + CurrentSnapshot *ManagedObjectReference `xml:"currentSnapshot,omitempty"` + RootSnapshotList []VirtualMachineSnapshotTree `xml:"rootSnapshotList"` +} + +func init() { + t["VirtualMachineSnapshotInfo"] = reflect.TypeOf((*VirtualMachineSnapshotInfo)(nil)).Elem() +} + +type VirtualMachineSnapshotTree struct { + DynamicData + + Snapshot ManagedObjectReference `xml:"snapshot"` + Vm ManagedObjectReference `xml:"vm"` + Name string `xml:"name"` + Description string `xml:"description"` + Id int32 `xml:"id,omitempty"` + CreateTime time.Time `xml:"createTime"` + State VirtualMachinePowerState `xml:"state"` + Quiesced bool `xml:"quiesced"` + BackupManifest string `xml:"backupManifest,omitempty"` + ChildSnapshotList []VirtualMachineSnapshotTree `xml:"childSnapshotList,omitempty"` + ReplaySupported *bool `xml:"replaySupported"` +} + +func init() { + t["VirtualMachineSnapshotTree"] = reflect.TypeOf((*VirtualMachineSnapshotTree)(nil)).Elem() +} + +type VirtualMachineSoundInfo struct { + VirtualMachineTargetInfo +} + +func init() { + t["VirtualMachineSoundInfo"] = reflect.TypeOf((*VirtualMachineSoundInfo)(nil)).Elem() +} + +type VirtualMachineSriovInfo struct { + VirtualMachinePciPassthroughInfo + + VirtualFunction bool `xml:"virtualFunction"` + Pnic string `xml:"pnic,omitempty"` +} + +func init() { + t["VirtualMachineSriovInfo"] = reflect.TypeOf((*VirtualMachineSriovInfo)(nil)).Elem() +} + +type VirtualMachineStorageInfo struct { + DynamicData + + PerDatastoreUsage []VirtualMachineUsageOnDatastore `xml:"perDatastoreUsage,omitempty"` + Timestamp time.Time `xml:"timestamp"` +} + +func init() { + t["VirtualMachineStorageInfo"] = reflect.TypeOf((*VirtualMachineStorageInfo)(nil)).Elem() +} + +type VirtualMachineStorageSummary struct { + DynamicData + + Committed int64 `xml:"committed"` + Uncommitted int64 `xml:"uncommitted"` + Unshared int64 `xml:"unshared"` + Timestamp time.Time `xml:"timestamp"` +} + +func init() { + t["VirtualMachineStorageSummary"] = reflect.TypeOf((*VirtualMachineStorageSummary)(nil)).Elem() +} + +type VirtualMachineSummary struct { + DynamicData + + Vm *ManagedObjectReference `xml:"vm,omitempty"` + Runtime VirtualMachineRuntimeInfo `xml:"runtime"` + Guest *VirtualMachineGuestSummary `xml:"guest,omitempty"` + Config VirtualMachineConfigSummary `xml:"config"` + Storage *VirtualMachineStorageSummary `xml:"storage,omitempty"` + QuickStats VirtualMachineQuickStats `xml:"quickStats"` + OverallStatus ManagedEntityStatus `xml:"overallStatus"` + CustomValue []BaseCustomFieldValue `xml:"customValue,omitempty,typeattr"` +} + +func init() { + t["VirtualMachineSummary"] = reflect.TypeOf((*VirtualMachineSummary)(nil)).Elem() +} + +type VirtualMachineTargetInfo struct { + DynamicData + + Name string `xml:"name"` + ConfigurationTag []string `xml:"configurationTag,omitempty"` +} + +func init() { + t["VirtualMachineTargetInfo"] = reflect.TypeOf((*VirtualMachineTargetInfo)(nil)).Elem() +} + +type VirtualMachineTicket struct { + DynamicData + + Ticket string `xml:"ticket"` + CfgFile string `xml:"cfgFile"` + Host string `xml:"host,omitempty"` + Port int32 `xml:"port,omitempty"` + SslThumbprint string `xml:"sslThumbprint,omitempty"` +} + +func init() { + t["VirtualMachineTicket"] = reflect.TypeOf((*VirtualMachineTicket)(nil)).Elem() +} + +type VirtualMachineUsageOnDatastore struct { + DynamicData + + Datastore ManagedObjectReference `xml:"datastore"` + Committed int64 `xml:"committed"` + Uncommitted int64 `xml:"uncommitted"` + Unshared int64 `xml:"unshared"` +} + +func init() { + t["VirtualMachineUsageOnDatastore"] = reflect.TypeOf((*VirtualMachineUsageOnDatastore)(nil)).Elem() +} + +type VirtualMachineUsbInfo struct { + VirtualMachineTargetInfo + + Description string `xml:"description"` + Vendor int32 `xml:"vendor"` + Product int32 `xml:"product"` + PhysicalPath string `xml:"physicalPath"` + Family []string `xml:"family,omitempty"` + Speed []string `xml:"speed,omitempty"` + Summary *VirtualMachineSummary `xml:"summary,omitempty"` +} + +func init() { + t["VirtualMachineUsbInfo"] = reflect.TypeOf((*VirtualMachineUsbInfo)(nil)).Elem() +} + +type VirtualMachineVFlashModuleInfo struct { + VirtualMachineTargetInfo + + VFlashModule HostVFlashManagerVFlashCacheConfigInfoVFlashModuleConfigOption `xml:"vFlashModule"` +} + +func init() { + t["VirtualMachineVFlashModuleInfo"] = reflect.TypeOf((*VirtualMachineVFlashModuleInfo)(nil)).Elem() +} + +type VirtualMachineVMCIDevice struct { + VirtualDevice + + Id int64 `xml:"id,omitempty"` + AllowUnrestrictedCommunication *bool `xml:"allowUnrestrictedCommunication"` + FilterEnable *bool `xml:"filterEnable"` + FilterInfo *VirtualMachineVMCIDeviceFilterInfo `xml:"filterInfo,omitempty"` +} + +func init() { + t["VirtualMachineVMCIDevice"] = reflect.TypeOf((*VirtualMachineVMCIDevice)(nil)).Elem() +} + +type VirtualMachineVMCIDeviceFilterInfo struct { + DynamicData + + Filters []VirtualMachineVMCIDeviceFilterSpec `xml:"filters,omitempty"` +} + +func init() { + t["VirtualMachineVMCIDeviceFilterInfo"] = reflect.TypeOf((*VirtualMachineVMCIDeviceFilterInfo)(nil)).Elem() +} + +type VirtualMachineVMCIDeviceFilterSpec struct { + DynamicData + + Rank int64 `xml:"rank"` + Action string `xml:"action"` + Protocol string `xml:"protocol"` + Direction string `xml:"direction"` + LowerDstPortBoundary int64 `xml:"lowerDstPortBoundary,omitempty"` + UpperDstPortBoundary int64 `xml:"upperDstPortBoundary,omitempty"` +} + +func init() { + t["VirtualMachineVMCIDeviceFilterSpec"] = reflect.TypeOf((*VirtualMachineVMCIDeviceFilterSpec)(nil)).Elem() +} + +type VirtualMachineVMCIDeviceOption struct { + VirtualDeviceOption + + AllowUnrestrictedCommunication BoolOption `xml:"allowUnrestrictedCommunication"` + FilterSpecOption *VirtualMachineVMCIDeviceOptionFilterSpecOption `xml:"filterSpecOption,omitempty"` + FilterSupported *BoolOption `xml:"filterSupported,omitempty"` +} + +func init() { + t["VirtualMachineVMCIDeviceOption"] = reflect.TypeOf((*VirtualMachineVMCIDeviceOption)(nil)).Elem() +} + +type VirtualMachineVMCIDeviceOptionFilterSpecOption struct { + DynamicData + + Action ChoiceOption `xml:"action"` + Protocol ChoiceOption `xml:"protocol"` + Direction ChoiceOption `xml:"direction"` + LowerDstPortBoundary LongOption `xml:"lowerDstPortBoundary"` + UpperDstPortBoundary LongOption `xml:"upperDstPortBoundary"` +} + +func init() { + t["VirtualMachineVMCIDeviceOptionFilterSpecOption"] = reflect.TypeOf((*VirtualMachineVMCIDeviceOptionFilterSpecOption)(nil)).Elem() +} + +type VirtualMachineVMIROM struct { + VirtualDevice +} + +func init() { + t["VirtualMachineVMIROM"] = reflect.TypeOf((*VirtualMachineVMIROM)(nil)).Elem() +} + +type VirtualMachineVideoCard struct { + VirtualDevice + + VideoRamSizeInKB int64 `xml:"videoRamSizeInKB,omitempty"` + NumDisplays int32 `xml:"numDisplays,omitempty"` + UseAutoDetect *bool `xml:"useAutoDetect"` + Enable3DSupport *bool `xml:"enable3DSupport"` + Use3dRenderer string `xml:"use3dRenderer,omitempty"` + GraphicsMemorySizeInKB int64 `xml:"graphicsMemorySizeInKB,omitempty"` +} + +func init() { + t["VirtualMachineVideoCard"] = reflect.TypeOf((*VirtualMachineVideoCard)(nil)).Elem() +} + +type VirtualMachineWipeResult struct { + DynamicData + + DiskId int32 `xml:"diskId"` + ShrinkableDiskSpace int64 `xml:"shrinkableDiskSpace"` +} + +func init() { + t["VirtualMachineWipeResult"] = reflect.TypeOf((*VirtualMachineWipeResult)(nil)).Elem() +} + +type VirtualNicManagerNetConfig struct { + DynamicData + + NicType string `xml:"nicType"` + MultiSelectAllowed bool `xml:"multiSelectAllowed"` + CandidateVnic []HostVirtualNic `xml:"candidateVnic,omitempty"` + SelectedVnic []string `xml:"selectedVnic,omitempty"` +} + +func init() { + t["VirtualNicManagerNetConfig"] = reflect.TypeOf((*VirtualNicManagerNetConfig)(nil)).Elem() +} + +type VirtualPCIController struct { + VirtualController +} + +func init() { + t["VirtualPCIController"] = reflect.TypeOf((*VirtualPCIController)(nil)).Elem() +} + +type VirtualPCIControllerOption struct { + VirtualControllerOption + + NumSCSIControllers IntOption `xml:"numSCSIControllers"` + NumEthernetCards IntOption `xml:"numEthernetCards"` + NumVideoCards IntOption `xml:"numVideoCards"` + NumSoundCards IntOption `xml:"numSoundCards"` + NumVmiRoms IntOption `xml:"numVmiRoms"` + NumVmciDevices *IntOption `xml:"numVmciDevices,omitempty"` + NumPCIPassthroughDevices *IntOption `xml:"numPCIPassthroughDevices,omitempty"` + NumSasSCSIControllers *IntOption `xml:"numSasSCSIControllers,omitempty"` + NumVmxnet3EthernetCards *IntOption `xml:"numVmxnet3EthernetCards,omitempty"` + NumParaVirtualSCSIControllers *IntOption `xml:"numParaVirtualSCSIControllers,omitempty"` + NumSATAControllers *IntOption `xml:"numSATAControllers,omitempty"` +} + +func init() { + t["VirtualPCIControllerOption"] = reflect.TypeOf((*VirtualPCIControllerOption)(nil)).Elem() +} + +type VirtualPCIPassthrough struct { + VirtualDevice +} + +func init() { + t["VirtualPCIPassthrough"] = reflect.TypeOf((*VirtualPCIPassthrough)(nil)).Elem() +} + +type VirtualPCIPassthroughDeviceBackingInfo struct { + VirtualDeviceDeviceBackingInfo + + Id string `xml:"id"` + DeviceId string `xml:"deviceId"` + SystemId string `xml:"systemId"` + VendorId int16 `xml:"vendorId"` +} + +func init() { + t["VirtualPCIPassthroughDeviceBackingInfo"] = reflect.TypeOf((*VirtualPCIPassthroughDeviceBackingInfo)(nil)).Elem() +} + +type VirtualPCIPassthroughDeviceBackingOption struct { + VirtualDeviceDeviceBackingOption +} + +func init() { + t["VirtualPCIPassthroughDeviceBackingOption"] = reflect.TypeOf((*VirtualPCIPassthroughDeviceBackingOption)(nil)).Elem() +} + +type VirtualPCIPassthroughOption struct { + VirtualDeviceOption +} + +func init() { + t["VirtualPCIPassthroughOption"] = reflect.TypeOf((*VirtualPCIPassthroughOption)(nil)).Elem() +} + +type VirtualPCIPassthroughPluginBackingInfo struct { + VirtualDeviceBackingInfo +} + +func init() { + t["VirtualPCIPassthroughPluginBackingInfo"] = reflect.TypeOf((*VirtualPCIPassthroughPluginBackingInfo)(nil)).Elem() +} + +type VirtualPCIPassthroughPluginBackingOption struct { + VirtualDeviceBackingOption +} + +func init() { + t["VirtualPCIPassthroughPluginBackingOption"] = reflect.TypeOf((*VirtualPCIPassthroughPluginBackingOption)(nil)).Elem() +} + +type VirtualPCIPassthroughVmiopBackingInfo struct { + VirtualPCIPassthroughPluginBackingInfo + + Vgpu string `xml:"vgpu,omitempty"` +} + +func init() { + t["VirtualPCIPassthroughVmiopBackingInfo"] = reflect.TypeOf((*VirtualPCIPassthroughVmiopBackingInfo)(nil)).Elem() +} + +type VirtualPCIPassthroughVmiopBackingOption struct { + VirtualPCIPassthroughPluginBackingOption + + Vgpu StringOption `xml:"vgpu"` + MaxInstances int32 `xml:"maxInstances"` +} + +func init() { + t["VirtualPCIPassthroughVmiopBackingOption"] = reflect.TypeOf((*VirtualPCIPassthroughVmiopBackingOption)(nil)).Elem() +} + +type VirtualPCNet32 struct { + VirtualEthernetCard +} + +func init() { + t["VirtualPCNet32"] = reflect.TypeOf((*VirtualPCNet32)(nil)).Elem() +} + +type VirtualPCNet32Option struct { + VirtualEthernetCardOption + + SupportsMorphing bool `xml:"supportsMorphing"` +} + +func init() { + t["VirtualPCNet32Option"] = reflect.TypeOf((*VirtualPCNet32Option)(nil)).Elem() +} + +type VirtualPS2Controller struct { + VirtualController +} + +func init() { + t["VirtualPS2Controller"] = reflect.TypeOf((*VirtualPS2Controller)(nil)).Elem() +} + +type VirtualPS2ControllerOption struct { + VirtualControllerOption + + NumKeyboards IntOption `xml:"numKeyboards"` + NumPointingDevices IntOption `xml:"numPointingDevices"` +} + +func init() { + t["VirtualPS2ControllerOption"] = reflect.TypeOf((*VirtualPS2ControllerOption)(nil)).Elem() +} + +type VirtualParallelPort struct { + VirtualDevice +} + +func init() { + t["VirtualParallelPort"] = reflect.TypeOf((*VirtualParallelPort)(nil)).Elem() +} + +type VirtualParallelPortDeviceBackingInfo struct { + VirtualDeviceDeviceBackingInfo +} + +func init() { + t["VirtualParallelPortDeviceBackingInfo"] = reflect.TypeOf((*VirtualParallelPortDeviceBackingInfo)(nil)).Elem() +} + +type VirtualParallelPortDeviceBackingOption struct { + VirtualDeviceDeviceBackingOption +} + +func init() { + t["VirtualParallelPortDeviceBackingOption"] = reflect.TypeOf((*VirtualParallelPortDeviceBackingOption)(nil)).Elem() +} + +type VirtualParallelPortFileBackingInfo struct { + VirtualDeviceFileBackingInfo +} + +func init() { + t["VirtualParallelPortFileBackingInfo"] = reflect.TypeOf((*VirtualParallelPortFileBackingInfo)(nil)).Elem() +} + +type VirtualParallelPortFileBackingOption struct { + VirtualDeviceFileBackingOption +} + +func init() { + t["VirtualParallelPortFileBackingOption"] = reflect.TypeOf((*VirtualParallelPortFileBackingOption)(nil)).Elem() +} + +type VirtualParallelPortOption struct { + VirtualDeviceOption +} + +func init() { + t["VirtualParallelPortOption"] = reflect.TypeOf((*VirtualParallelPortOption)(nil)).Elem() +} + +type VirtualPointingDevice struct { + VirtualDevice +} + +func init() { + t["VirtualPointingDevice"] = reflect.TypeOf((*VirtualPointingDevice)(nil)).Elem() +} + +type VirtualPointingDeviceBackingOption struct { + VirtualDeviceDeviceBackingOption + + HostPointingDevice ChoiceOption `xml:"hostPointingDevice"` +} + +func init() { + t["VirtualPointingDeviceBackingOption"] = reflect.TypeOf((*VirtualPointingDeviceBackingOption)(nil)).Elem() +} + +type VirtualPointingDeviceDeviceBackingInfo struct { + VirtualDeviceDeviceBackingInfo + + HostPointingDevice string `xml:"hostPointingDevice"` +} + +func init() { + t["VirtualPointingDeviceDeviceBackingInfo"] = reflect.TypeOf((*VirtualPointingDeviceDeviceBackingInfo)(nil)).Elem() +} + +type VirtualPointingDeviceOption struct { + VirtualDeviceOption +} + +func init() { + t["VirtualPointingDeviceOption"] = reflect.TypeOf((*VirtualPointingDeviceOption)(nil)).Elem() +} + +type VirtualResourcePoolSpec struct { + DynamicData + + VrpId string `xml:"vrpId,omitempty"` + VrpName string `xml:"vrpName,omitempty"` + Description string `xml:"description,omitempty"` + CpuAllocation VrpResourceAllocationInfo `xml:"cpuAllocation"` + MemoryAllocation VrpResourceAllocationInfo `xml:"memoryAllocation"` + RpList []ManagedObjectReference `xml:"rpList,omitempty"` + HubList []ManagedObjectReference `xml:"hubList,omitempty"` + RootVRP *bool `xml:"rootVRP"` + StaticVRP *bool `xml:"staticVRP"` + ChangeVersion int64 `xml:"changeVersion,omitempty"` +} + +func init() { + t["VirtualResourcePoolSpec"] = reflect.TypeOf((*VirtualResourcePoolSpec)(nil)).Elem() +} + +type VirtualResourcePoolUsage struct { + DynamicData + + VrpId string `xml:"vrpId"` + CpuReservationMhz int64 `xml:"cpuReservationMhz"` + MemReservationMB int64 `xml:"memReservationMB"` + CpuReservationUsedMhz int64 `xml:"cpuReservationUsedMhz"` + MemReservationUsedMB int64 `xml:"memReservationUsedMB"` +} + +func init() { + t["VirtualResourcePoolUsage"] = reflect.TypeOf((*VirtualResourcePoolUsage)(nil)).Elem() +} + +type VirtualSATAController struct { + VirtualController +} + +func init() { + t["VirtualSATAController"] = reflect.TypeOf((*VirtualSATAController)(nil)).Elem() +} + +type VirtualSATAControllerOption struct { + VirtualControllerOption + + NumSATADisks IntOption `xml:"numSATADisks"` + NumSATACdroms IntOption `xml:"numSATACdroms"` +} + +func init() { + t["VirtualSATAControllerOption"] = reflect.TypeOf((*VirtualSATAControllerOption)(nil)).Elem() +} + +type VirtualSCSIController struct { + VirtualController + + HotAddRemove *bool `xml:"hotAddRemove"` + SharedBus VirtualSCSISharing `xml:"sharedBus"` + ScsiCtlrUnitNumber int32 `xml:"scsiCtlrUnitNumber,omitempty"` +} + +func init() { + t["VirtualSCSIController"] = reflect.TypeOf((*VirtualSCSIController)(nil)).Elem() +} + +type VirtualSCSIControllerOption struct { + VirtualControllerOption + + NumSCSIDisks IntOption `xml:"numSCSIDisks"` + NumSCSICdroms IntOption `xml:"numSCSICdroms"` + NumSCSIPassthrough IntOption `xml:"numSCSIPassthrough"` + Sharing []VirtualSCSISharing `xml:"sharing"` + DefaultSharedIndex int32 `xml:"defaultSharedIndex"` + HotAddRemove BoolOption `xml:"hotAddRemove"` + ScsiCtlrUnitNumber int32 `xml:"scsiCtlrUnitNumber"` +} + +func init() { + t["VirtualSCSIControllerOption"] = reflect.TypeOf((*VirtualSCSIControllerOption)(nil)).Elem() +} + +type VirtualSCSIPassthrough struct { + VirtualDevice +} + +func init() { + t["VirtualSCSIPassthrough"] = reflect.TypeOf((*VirtualSCSIPassthrough)(nil)).Elem() +} + +type VirtualSCSIPassthroughDeviceBackingInfo struct { + VirtualDeviceDeviceBackingInfo +} + +func init() { + t["VirtualSCSIPassthroughDeviceBackingInfo"] = reflect.TypeOf((*VirtualSCSIPassthroughDeviceBackingInfo)(nil)).Elem() +} + +type VirtualSCSIPassthroughDeviceBackingOption struct { + VirtualDeviceDeviceBackingOption +} + +func init() { + t["VirtualSCSIPassthroughDeviceBackingOption"] = reflect.TypeOf((*VirtualSCSIPassthroughDeviceBackingOption)(nil)).Elem() +} + +type VirtualSCSIPassthroughOption struct { + VirtualDeviceOption +} + +func init() { + t["VirtualSCSIPassthroughOption"] = reflect.TypeOf((*VirtualSCSIPassthroughOption)(nil)).Elem() +} + +type VirtualSIOController struct { + VirtualController +} + +func init() { + t["VirtualSIOController"] = reflect.TypeOf((*VirtualSIOController)(nil)).Elem() +} + +type VirtualSIOControllerOption struct { + VirtualControllerOption + + NumFloppyDrives IntOption `xml:"numFloppyDrives"` + NumSerialPorts IntOption `xml:"numSerialPorts"` + NumParallelPorts IntOption `xml:"numParallelPorts"` +} + +func init() { + t["VirtualSIOControllerOption"] = reflect.TypeOf((*VirtualSIOControllerOption)(nil)).Elem() +} + +type VirtualSerialPort struct { + VirtualDevice + + YieldOnPoll bool `xml:"yieldOnPoll"` +} + +func init() { + t["VirtualSerialPort"] = reflect.TypeOf((*VirtualSerialPort)(nil)).Elem() +} + +type VirtualSerialPortDeviceBackingInfo struct { + VirtualDeviceDeviceBackingInfo +} + +func init() { + t["VirtualSerialPortDeviceBackingInfo"] = reflect.TypeOf((*VirtualSerialPortDeviceBackingInfo)(nil)).Elem() +} + +type VirtualSerialPortDeviceBackingOption struct { + VirtualDeviceDeviceBackingOption +} + +func init() { + t["VirtualSerialPortDeviceBackingOption"] = reflect.TypeOf((*VirtualSerialPortDeviceBackingOption)(nil)).Elem() +} + +type VirtualSerialPortFileBackingInfo struct { + VirtualDeviceFileBackingInfo +} + +func init() { + t["VirtualSerialPortFileBackingInfo"] = reflect.TypeOf((*VirtualSerialPortFileBackingInfo)(nil)).Elem() +} + +type VirtualSerialPortFileBackingOption struct { + VirtualDeviceFileBackingOption +} + +func init() { + t["VirtualSerialPortFileBackingOption"] = reflect.TypeOf((*VirtualSerialPortFileBackingOption)(nil)).Elem() +} + +type VirtualSerialPortOption struct { + VirtualDeviceOption + + YieldOnPoll BoolOption `xml:"yieldOnPoll"` +} + +func init() { + t["VirtualSerialPortOption"] = reflect.TypeOf((*VirtualSerialPortOption)(nil)).Elem() +} + +type VirtualSerialPortPipeBackingInfo struct { + VirtualDevicePipeBackingInfo + + Endpoint string `xml:"endpoint"` + NoRxLoss *bool `xml:"noRxLoss"` +} + +func init() { + t["VirtualSerialPortPipeBackingInfo"] = reflect.TypeOf((*VirtualSerialPortPipeBackingInfo)(nil)).Elem() +} + +type VirtualSerialPortPipeBackingOption struct { + VirtualDevicePipeBackingOption + + Endpoint ChoiceOption `xml:"endpoint"` + NoRxLoss BoolOption `xml:"noRxLoss"` +} + +func init() { + t["VirtualSerialPortPipeBackingOption"] = reflect.TypeOf((*VirtualSerialPortPipeBackingOption)(nil)).Elem() +} + +type VirtualSerialPortThinPrintBackingInfo struct { + VirtualDeviceBackingInfo +} + +func init() { + t["VirtualSerialPortThinPrintBackingInfo"] = reflect.TypeOf((*VirtualSerialPortThinPrintBackingInfo)(nil)).Elem() +} + +type VirtualSerialPortThinPrintBackingOption struct { + VirtualDeviceBackingOption +} + +func init() { + t["VirtualSerialPortThinPrintBackingOption"] = reflect.TypeOf((*VirtualSerialPortThinPrintBackingOption)(nil)).Elem() +} + +type VirtualSerialPortURIBackingInfo struct { + VirtualDeviceURIBackingInfo +} + +func init() { + t["VirtualSerialPortURIBackingInfo"] = reflect.TypeOf((*VirtualSerialPortURIBackingInfo)(nil)).Elem() +} + +type VirtualSerialPortURIBackingOption struct { + VirtualDeviceURIBackingOption +} + +func init() { + t["VirtualSerialPortURIBackingOption"] = reflect.TypeOf((*VirtualSerialPortURIBackingOption)(nil)).Elem() +} + +type VirtualSoundBlaster16 struct { + VirtualSoundCard +} + +func init() { + t["VirtualSoundBlaster16"] = reflect.TypeOf((*VirtualSoundBlaster16)(nil)).Elem() +} + +type VirtualSoundBlaster16Option struct { + VirtualSoundCardOption +} + +func init() { + t["VirtualSoundBlaster16Option"] = reflect.TypeOf((*VirtualSoundBlaster16Option)(nil)).Elem() +} + +type VirtualSoundCard struct { + VirtualDevice +} + +func init() { + t["VirtualSoundCard"] = reflect.TypeOf((*VirtualSoundCard)(nil)).Elem() +} + +type VirtualSoundCardDeviceBackingInfo struct { + VirtualDeviceDeviceBackingInfo +} + +func init() { + t["VirtualSoundCardDeviceBackingInfo"] = reflect.TypeOf((*VirtualSoundCardDeviceBackingInfo)(nil)).Elem() +} + +type VirtualSoundCardDeviceBackingOption struct { + VirtualDeviceDeviceBackingOption +} + +func init() { + t["VirtualSoundCardDeviceBackingOption"] = reflect.TypeOf((*VirtualSoundCardDeviceBackingOption)(nil)).Elem() +} + +type VirtualSoundCardOption struct { + VirtualDeviceOption +} + +func init() { + t["VirtualSoundCardOption"] = reflect.TypeOf((*VirtualSoundCardOption)(nil)).Elem() +} + +type VirtualSriovEthernetCard struct { + VirtualEthernetCard + + AllowGuestOSMtuChange *bool `xml:"allowGuestOSMtuChange"` + SriovBacking *VirtualSriovEthernetCardSriovBackingInfo `xml:"sriovBacking,omitempty"` +} + +func init() { + t["VirtualSriovEthernetCard"] = reflect.TypeOf((*VirtualSriovEthernetCard)(nil)).Elem() +} + +type VirtualSriovEthernetCardOption struct { + VirtualEthernetCardOption +} + +func init() { + t["VirtualSriovEthernetCardOption"] = reflect.TypeOf((*VirtualSriovEthernetCardOption)(nil)).Elem() +} + +type VirtualSriovEthernetCardSriovBackingInfo struct { + VirtualDeviceBackingInfo + + PhysicalFunctionBacking *VirtualPCIPassthroughDeviceBackingInfo `xml:"physicalFunctionBacking,omitempty"` + VirtualFunctionBacking *VirtualPCIPassthroughDeviceBackingInfo `xml:"virtualFunctionBacking,omitempty"` + VirtualFunctionIndex int32 `xml:"virtualFunctionIndex,omitempty"` +} + +func init() { + t["VirtualSriovEthernetCardSriovBackingInfo"] = reflect.TypeOf((*VirtualSriovEthernetCardSriovBackingInfo)(nil)).Elem() +} + +type VirtualSriovEthernetCardSriovBackingOption struct { + VirtualDeviceBackingOption +} + +func init() { + t["VirtualSriovEthernetCardSriovBackingOption"] = reflect.TypeOf((*VirtualSriovEthernetCardSriovBackingOption)(nil)).Elem() +} + +type VirtualSwitchProfile struct { + ApplyProfile + + Key string `xml:"key"` + Name string `xml:"name"` + Link LinkProfile `xml:"link"` + NumPorts NumPortsProfile `xml:"numPorts"` + NetworkPolicy NetworkPolicyProfile `xml:"networkPolicy"` +} + +func init() { + t["VirtualSwitchProfile"] = reflect.TypeOf((*VirtualSwitchProfile)(nil)).Elem() +} + +type VirtualSwitchSelectionProfile struct { + ApplyProfile +} + +func init() { + t["VirtualSwitchSelectionProfile"] = reflect.TypeOf((*VirtualSwitchSelectionProfile)(nil)).Elem() +} + +type VirtualUSB struct { + VirtualDevice + + Connected bool `xml:"connected"` + Vendor int32 `xml:"vendor,omitempty"` + Product int32 `xml:"product,omitempty"` + Family []string `xml:"family,omitempty"` + Speed []string `xml:"speed,omitempty"` +} + +func init() { + t["VirtualUSB"] = reflect.TypeOf((*VirtualUSB)(nil)).Elem() +} + +type VirtualUSBController struct { + VirtualController + + AutoConnectDevices *bool `xml:"autoConnectDevices"` + EhciEnabled *bool `xml:"ehciEnabled"` +} + +func init() { + t["VirtualUSBController"] = reflect.TypeOf((*VirtualUSBController)(nil)).Elem() +} + +type VirtualUSBControllerOption struct { + VirtualControllerOption + + AutoConnectDevices BoolOption `xml:"autoConnectDevices"` + EhciSupported BoolOption `xml:"ehciSupported"` + SupportedSpeeds []string `xml:"supportedSpeeds,omitempty"` +} + +func init() { + t["VirtualUSBControllerOption"] = reflect.TypeOf((*VirtualUSBControllerOption)(nil)).Elem() +} + +type VirtualUSBControllerPciBusSlotInfo struct { + VirtualDevicePciBusSlotInfo + + EhciPciSlotNumber int32 `xml:"ehciPciSlotNumber,omitempty"` +} + +func init() { + t["VirtualUSBControllerPciBusSlotInfo"] = reflect.TypeOf((*VirtualUSBControllerPciBusSlotInfo)(nil)).Elem() +} + +type VirtualUSBOption struct { + VirtualDeviceOption +} + +func init() { + t["VirtualUSBOption"] = reflect.TypeOf((*VirtualUSBOption)(nil)).Elem() +} + +type VirtualUSBRemoteClientBackingInfo struct { + VirtualDeviceRemoteDeviceBackingInfo + + Hostname string `xml:"hostname"` +} + +func init() { + t["VirtualUSBRemoteClientBackingInfo"] = reflect.TypeOf((*VirtualUSBRemoteClientBackingInfo)(nil)).Elem() +} + +type VirtualUSBRemoteClientBackingOption struct { + VirtualDeviceRemoteDeviceBackingOption +} + +func init() { + t["VirtualUSBRemoteClientBackingOption"] = reflect.TypeOf((*VirtualUSBRemoteClientBackingOption)(nil)).Elem() +} + +type VirtualUSBRemoteHostBackingInfo struct { + VirtualDeviceDeviceBackingInfo + + Hostname string `xml:"hostname"` +} + +func init() { + t["VirtualUSBRemoteHostBackingInfo"] = reflect.TypeOf((*VirtualUSBRemoteHostBackingInfo)(nil)).Elem() +} + +type VirtualUSBRemoteHostBackingOption struct { + VirtualDeviceDeviceBackingOption +} + +func init() { + t["VirtualUSBRemoteHostBackingOption"] = reflect.TypeOf((*VirtualUSBRemoteHostBackingOption)(nil)).Elem() +} + +type VirtualUSBUSBBackingInfo struct { + VirtualDeviceDeviceBackingInfo +} + +func init() { + t["VirtualUSBUSBBackingInfo"] = reflect.TypeOf((*VirtualUSBUSBBackingInfo)(nil)).Elem() +} + +type VirtualUSBUSBBackingOption struct { + VirtualDeviceDeviceBackingOption +} + +func init() { + t["VirtualUSBUSBBackingOption"] = reflect.TypeOf((*VirtualUSBUSBBackingOption)(nil)).Elem() +} + +type VirtualUSBXHCIController struct { + VirtualController + + AutoConnectDevices *bool `xml:"autoConnectDevices"` +} + +func init() { + t["VirtualUSBXHCIController"] = reflect.TypeOf((*VirtualUSBXHCIController)(nil)).Elem() +} + +type VirtualUSBXHCIControllerOption struct { + VirtualControllerOption + + AutoConnectDevices BoolOption `xml:"autoConnectDevices"` + SupportedSpeeds []string `xml:"supportedSpeeds"` +} + +func init() { + t["VirtualUSBXHCIControllerOption"] = reflect.TypeOf((*VirtualUSBXHCIControllerOption)(nil)).Elem() +} + +type VirtualVMIROMOption struct { + VirtualDeviceOption +} + +func init() { + t["VirtualVMIROMOption"] = reflect.TypeOf((*VirtualVMIROMOption)(nil)).Elem() +} + +type VirtualVideoCardOption struct { + VirtualDeviceOption + + VideoRamSizeInKB *LongOption `xml:"videoRamSizeInKB,omitempty"` + NumDisplays *IntOption `xml:"numDisplays,omitempty"` + UseAutoDetect *BoolOption `xml:"useAutoDetect,omitempty"` + Support3D *BoolOption `xml:"support3D,omitempty"` + Use3dRendererSupported *BoolOption `xml:"use3dRendererSupported,omitempty"` + GraphicsMemorySizeInKB *LongOption `xml:"graphicsMemorySizeInKB,omitempty"` + GraphicsMemorySizeSupported *BoolOption `xml:"graphicsMemorySizeSupported,omitempty"` +} + +func init() { + t["VirtualVideoCardOption"] = reflect.TypeOf((*VirtualVideoCardOption)(nil)).Elem() +} + +type VirtualVmxnet struct { + VirtualEthernetCard +} + +func init() { + t["VirtualVmxnet"] = reflect.TypeOf((*VirtualVmxnet)(nil)).Elem() +} + +type VirtualVmxnet2 struct { + VirtualVmxnet +} + +func init() { + t["VirtualVmxnet2"] = reflect.TypeOf((*VirtualVmxnet2)(nil)).Elem() +} + +type VirtualVmxnet2Option struct { + VirtualVmxnetOption +} + +func init() { + t["VirtualVmxnet2Option"] = reflect.TypeOf((*VirtualVmxnet2Option)(nil)).Elem() +} + +type VirtualVmxnet3 struct { + VirtualVmxnet +} + +func init() { + t["VirtualVmxnet3"] = reflect.TypeOf((*VirtualVmxnet3)(nil)).Elem() +} + +type VirtualVmxnet3Option struct { + VirtualVmxnetOption +} + +func init() { + t["VirtualVmxnet3Option"] = reflect.TypeOf((*VirtualVmxnet3Option)(nil)).Elem() +} + +type VirtualVmxnetOption struct { + VirtualEthernetCardOption +} + +func init() { + t["VirtualVmxnetOption"] = reflect.TypeOf((*VirtualVmxnetOption)(nil)).Elem() +} + +type VlanProfile struct { + ApplyProfile +} + +func init() { + t["VlanProfile"] = reflect.TypeOf((*VlanProfile)(nil)).Elem() +} + +type VmAcquiredMksTicketEvent struct { + VmEvent +} + +func init() { + t["VmAcquiredMksTicketEvent"] = reflect.TypeOf((*VmAcquiredMksTicketEvent)(nil)).Elem() +} + +type VmAcquiredTicketEvent struct { + VmEvent + + TicketType string `xml:"ticketType"` +} + +func init() { + t["VmAcquiredTicketEvent"] = reflect.TypeOf((*VmAcquiredTicketEvent)(nil)).Elem() +} + +type VmAlreadyExistsInDatacenter struct { + InvalidFolder + + Host ManagedObjectReference `xml:"host"` + Hostname string `xml:"hostname"` + Vm []ManagedObjectReference `xml:"vm"` +} + +func init() { + t["VmAlreadyExistsInDatacenter"] = reflect.TypeOf((*VmAlreadyExistsInDatacenter)(nil)).Elem() +} + +type VmAlreadyExistsInDatacenterFault VmAlreadyExistsInDatacenter + +func init() { + t["VmAlreadyExistsInDatacenterFault"] = reflect.TypeOf((*VmAlreadyExistsInDatacenterFault)(nil)).Elem() +} + +type VmAutoRenameEvent struct { + VmEvent + + OldName string `xml:"oldName"` + NewName string `xml:"newName"` +} + +func init() { + t["VmAutoRenameEvent"] = reflect.TypeOf((*VmAutoRenameEvent)(nil)).Elem() +} + +type VmBeingClonedEvent struct { + VmCloneEvent + + DestFolder FolderEventArgument `xml:"destFolder"` + DestName string `xml:"destName"` + DestHost HostEventArgument `xml:"destHost"` +} + +func init() { + t["VmBeingClonedEvent"] = reflect.TypeOf((*VmBeingClonedEvent)(nil)).Elem() +} + +type VmBeingClonedNoFolderEvent struct { + VmCloneEvent + + DestName string `xml:"destName"` + DestHost HostEventArgument `xml:"destHost"` +} + +func init() { + t["VmBeingClonedNoFolderEvent"] = reflect.TypeOf((*VmBeingClonedNoFolderEvent)(nil)).Elem() +} + +type VmBeingCreatedEvent struct { + VmEvent + + ConfigSpec *VirtualMachineConfigSpec `xml:"configSpec,omitempty"` +} + +func init() { + t["VmBeingCreatedEvent"] = reflect.TypeOf((*VmBeingCreatedEvent)(nil)).Elem() +} + +type VmBeingDeployedEvent struct { + VmEvent + + SrcTemplate VmEventArgument `xml:"srcTemplate"` +} + +func init() { + t["VmBeingDeployedEvent"] = reflect.TypeOf((*VmBeingDeployedEvent)(nil)).Elem() +} + +type VmBeingHotMigratedEvent struct { + VmEvent + + DestHost HostEventArgument `xml:"destHost"` + DestDatacenter *DatacenterEventArgument `xml:"destDatacenter,omitempty"` + DestDatastore *DatastoreEventArgument `xml:"destDatastore,omitempty"` +} + +func init() { + t["VmBeingHotMigratedEvent"] = reflect.TypeOf((*VmBeingHotMigratedEvent)(nil)).Elem() +} + +type VmBeingMigratedEvent struct { + VmEvent + + DestHost HostEventArgument `xml:"destHost"` + DestDatacenter *DatacenterEventArgument `xml:"destDatacenter,omitempty"` + DestDatastore *DatastoreEventArgument `xml:"destDatastore,omitempty"` +} + +func init() { + t["VmBeingMigratedEvent"] = reflect.TypeOf((*VmBeingMigratedEvent)(nil)).Elem() +} + +type VmBeingRelocatedEvent struct { + VmRelocateSpecEvent + + DestHost HostEventArgument `xml:"destHost"` + DestDatacenter *DatacenterEventArgument `xml:"destDatacenter,omitempty"` + DestDatastore *DatastoreEventArgument `xml:"destDatastore,omitempty"` +} + +func init() { + t["VmBeingRelocatedEvent"] = reflect.TypeOf((*VmBeingRelocatedEvent)(nil)).Elem() +} + +type VmCloneEvent struct { + VmEvent +} + +func init() { + t["VmCloneEvent"] = reflect.TypeOf((*VmCloneEvent)(nil)).Elem() +} + +type VmCloneFailedEvent struct { + VmCloneEvent + + DestFolder FolderEventArgument `xml:"destFolder"` + DestName string `xml:"destName"` + DestHost HostEventArgument `xml:"destHost"` + Reason LocalizedMethodFault `xml:"reason"` +} + +func init() { + t["VmCloneFailedEvent"] = reflect.TypeOf((*VmCloneFailedEvent)(nil)).Elem() +} + +type VmClonedEvent struct { + VmCloneEvent + + SourceVm VmEventArgument `xml:"sourceVm"` +} + +func init() { + t["VmClonedEvent"] = reflect.TypeOf((*VmClonedEvent)(nil)).Elem() +} + +type VmConfigFault struct { + VimFault +} + +func init() { + t["VmConfigFault"] = reflect.TypeOf((*VmConfigFault)(nil)).Elem() +} + +type VmConfigFaultFault BaseVmConfigFault + +func init() { + t["VmConfigFaultFault"] = reflect.TypeOf((*VmConfigFaultFault)(nil)).Elem() +} + +type VmConfigFileInfo struct { + FileInfo + + ConfigVersion int32 `xml:"configVersion,omitempty"` +} + +func init() { + t["VmConfigFileInfo"] = reflect.TypeOf((*VmConfigFileInfo)(nil)).Elem() +} + +type VmConfigFileQuery struct { + FileQuery + + Filter *VmConfigFileQueryFilter `xml:"filter,omitempty"` + Details *VmConfigFileQueryFlags `xml:"details,omitempty"` +} + +func init() { + t["VmConfigFileQuery"] = reflect.TypeOf((*VmConfigFileQuery)(nil)).Elem() +} + +type VmConfigFileQueryFilter struct { + DynamicData + + MatchConfigVersion []int32 `xml:"matchConfigVersion,omitempty"` +} + +func init() { + t["VmConfigFileQueryFilter"] = reflect.TypeOf((*VmConfigFileQueryFilter)(nil)).Elem() +} + +type VmConfigFileQueryFlags struct { + DynamicData + + ConfigVersion bool `xml:"configVersion"` +} + +func init() { + t["VmConfigFileQueryFlags"] = reflect.TypeOf((*VmConfigFileQueryFlags)(nil)).Elem() +} + +type VmConfigIncompatibleForFaultTolerance struct { + VmConfigFault + + Fault *LocalizedMethodFault `xml:"fault,omitempty"` +} + +func init() { + t["VmConfigIncompatibleForFaultTolerance"] = reflect.TypeOf((*VmConfigIncompatibleForFaultTolerance)(nil)).Elem() +} + +type VmConfigIncompatibleForFaultToleranceFault VmConfigIncompatibleForFaultTolerance + +func init() { + t["VmConfigIncompatibleForFaultToleranceFault"] = reflect.TypeOf((*VmConfigIncompatibleForFaultToleranceFault)(nil)).Elem() +} + +type VmConfigIncompatibleForRecordReplay struct { + VmConfigFault + + Fault *LocalizedMethodFault `xml:"fault,omitempty"` +} + +func init() { + t["VmConfigIncompatibleForRecordReplay"] = reflect.TypeOf((*VmConfigIncompatibleForRecordReplay)(nil)).Elem() +} + +type VmConfigIncompatibleForRecordReplayFault VmConfigIncompatibleForRecordReplay + +func init() { + t["VmConfigIncompatibleForRecordReplayFault"] = reflect.TypeOf((*VmConfigIncompatibleForRecordReplayFault)(nil)).Elem() +} + +type VmConfigInfo struct { + DynamicData + + Product []VAppProductInfo `xml:"product,omitempty"` + Property []VAppPropertyInfo `xml:"property,omitempty"` + IpAssignment VAppIPAssignmentInfo `xml:"ipAssignment"` + Eula []string `xml:"eula,omitempty"` + OvfSection []VAppOvfSectionInfo `xml:"ovfSection,omitempty"` + OvfEnvironmentTransport []string `xml:"ovfEnvironmentTransport,omitempty"` + InstallBootRequired bool `xml:"installBootRequired"` + InstallBootStopDelay int32 `xml:"installBootStopDelay"` +} + +func init() { + t["VmConfigInfo"] = reflect.TypeOf((*VmConfigInfo)(nil)).Elem() +} + +type VmConfigMissingEvent struct { + VmEvent +} + +func init() { + t["VmConfigMissingEvent"] = reflect.TypeOf((*VmConfigMissingEvent)(nil)).Elem() +} + +type VmConfigSpec struct { + DynamicData + + Product []VAppProductSpec `xml:"product,omitempty"` + Property []VAppPropertySpec `xml:"property,omitempty"` + IpAssignment *VAppIPAssignmentInfo `xml:"ipAssignment,omitempty"` + Eula []string `xml:"eula,omitempty"` + OvfSection []VAppOvfSectionSpec `xml:"ovfSection,omitempty"` + OvfEnvironmentTransport []string `xml:"ovfEnvironmentTransport,omitempty"` + InstallBootRequired *bool `xml:"installBootRequired"` + InstallBootStopDelay int32 `xml:"installBootStopDelay,omitempty"` +} + +func init() { + t["VmConfigSpec"] = reflect.TypeOf((*VmConfigSpec)(nil)).Elem() +} + +type VmConnectedEvent struct { + VmEvent +} + +func init() { + t["VmConnectedEvent"] = reflect.TypeOf((*VmConnectedEvent)(nil)).Elem() +} + +type VmCreatedEvent struct { + VmEvent +} + +func init() { + t["VmCreatedEvent"] = reflect.TypeOf((*VmCreatedEvent)(nil)).Elem() +} + +type VmDasBeingResetEvent struct { + VmEvent + + Reason string `xml:"reason,omitempty"` +} + +func init() { + t["VmDasBeingResetEvent"] = reflect.TypeOf((*VmDasBeingResetEvent)(nil)).Elem() +} + +type VmDasBeingResetWithScreenshotEvent struct { + VmDasBeingResetEvent + + ScreenshotFilePath string `xml:"screenshotFilePath"` +} + +func init() { + t["VmDasBeingResetWithScreenshotEvent"] = reflect.TypeOf((*VmDasBeingResetWithScreenshotEvent)(nil)).Elem() +} + +type VmDasResetFailedEvent struct { + VmEvent +} + +func init() { + t["VmDasResetFailedEvent"] = reflect.TypeOf((*VmDasResetFailedEvent)(nil)).Elem() +} + +type VmDasUpdateErrorEvent struct { + VmEvent +} + +func init() { + t["VmDasUpdateErrorEvent"] = reflect.TypeOf((*VmDasUpdateErrorEvent)(nil)).Elem() +} + +type VmDasUpdateOkEvent struct { + VmEvent +} + +func init() { + t["VmDasUpdateOkEvent"] = reflect.TypeOf((*VmDasUpdateOkEvent)(nil)).Elem() +} + +type VmDateRolledBackEvent struct { + VmEvent +} + +func init() { + t["VmDateRolledBackEvent"] = reflect.TypeOf((*VmDateRolledBackEvent)(nil)).Elem() +} + +type VmDeployFailedEvent struct { + VmEvent + + DestDatastore BaseEntityEventArgument `xml:"destDatastore,typeattr"` + Reason LocalizedMethodFault `xml:"reason"` +} + +func init() { + t["VmDeployFailedEvent"] = reflect.TypeOf((*VmDeployFailedEvent)(nil)).Elem() +} + +type VmDeployedEvent struct { + VmEvent + + SrcTemplate VmEventArgument `xml:"srcTemplate"` +} + +func init() { + t["VmDeployedEvent"] = reflect.TypeOf((*VmDeployedEvent)(nil)).Elem() +} + +type VmDisconnectedEvent struct { + VmEvent +} + +func init() { + t["VmDisconnectedEvent"] = reflect.TypeOf((*VmDisconnectedEvent)(nil)).Elem() +} + +type VmDiscoveredEvent struct { + VmEvent +} + +func init() { + t["VmDiscoveredEvent"] = reflect.TypeOf((*VmDiscoveredEvent)(nil)).Elem() +} + +type VmDiskFailedEvent struct { + VmEvent + + Disk string `xml:"disk"` + Reason LocalizedMethodFault `xml:"reason"` +} + +func init() { + t["VmDiskFailedEvent"] = reflect.TypeOf((*VmDiskFailedEvent)(nil)).Elem() +} + +type VmDiskFileInfo struct { + FileInfo + + DiskType string `xml:"diskType,omitempty"` + CapacityKb int64 `xml:"capacityKb,omitempty"` + HardwareVersion int32 `xml:"hardwareVersion,omitempty"` + ControllerType string `xml:"controllerType,omitempty"` + DiskExtents []string `xml:"diskExtents,omitempty"` + Thin *bool `xml:"thin"` +} + +func init() { + t["VmDiskFileInfo"] = reflect.TypeOf((*VmDiskFileInfo)(nil)).Elem() +} + +type VmDiskFileQuery struct { + FileQuery + + Filter *VmDiskFileQueryFilter `xml:"filter,omitempty"` + Details *VmDiskFileQueryFlags `xml:"details,omitempty"` +} + +func init() { + t["VmDiskFileQuery"] = reflect.TypeOf((*VmDiskFileQuery)(nil)).Elem() +} + +type VmDiskFileQueryFilter struct { + DynamicData + + DiskType []string `xml:"diskType,omitempty"` + MatchHardwareVersion []int32 `xml:"matchHardwareVersion,omitempty"` + ControllerType []string `xml:"controllerType,omitempty"` + Thin *bool `xml:"thin"` +} + +func init() { + t["VmDiskFileQueryFilter"] = reflect.TypeOf((*VmDiskFileQueryFilter)(nil)).Elem() +} + +type VmDiskFileQueryFlags struct { + DynamicData + + DiskType bool `xml:"diskType"` + CapacityKb bool `xml:"capacityKb"` + HardwareVersion bool `xml:"hardwareVersion"` + ControllerType *bool `xml:"controllerType"` + DiskExtents *bool `xml:"diskExtents"` + Thin *bool `xml:"thin"` +} + +func init() { + t["VmDiskFileQueryFlags"] = reflect.TypeOf((*VmDiskFileQueryFlags)(nil)).Elem() +} + +type VmEmigratingEvent struct { + VmEvent +} + +func init() { + t["VmEmigratingEvent"] = reflect.TypeOf((*VmEmigratingEvent)(nil)).Elem() +} + +type VmEndRecordingEvent struct { + VmEvent +} + +func init() { + t["VmEndRecordingEvent"] = reflect.TypeOf((*VmEndRecordingEvent)(nil)).Elem() +} + +type VmEndReplayingEvent struct { + VmEvent +} + +func init() { + t["VmEndReplayingEvent"] = reflect.TypeOf((*VmEndReplayingEvent)(nil)).Elem() +} + +type VmEvent struct { + Event + + Template bool `xml:"template"` +} + +func init() { + t["VmEvent"] = reflect.TypeOf((*VmEvent)(nil)).Elem() +} + +type VmEventArgument struct { + EntityEventArgument + + Vm ManagedObjectReference `xml:"vm"` +} + +func init() { + t["VmEventArgument"] = reflect.TypeOf((*VmEventArgument)(nil)).Elem() +} + +type VmFailedMigrateEvent struct { + VmEvent + + DestHost HostEventArgument `xml:"destHost"` + Reason LocalizedMethodFault `xml:"reason"` + DestDatacenter *DatacenterEventArgument `xml:"destDatacenter,omitempty"` + DestDatastore *DatastoreEventArgument `xml:"destDatastore,omitempty"` +} + +func init() { + t["VmFailedMigrateEvent"] = reflect.TypeOf((*VmFailedMigrateEvent)(nil)).Elem() +} + +type VmFailedRelayoutEvent struct { + VmEvent + + Reason LocalizedMethodFault `xml:"reason"` +} + +func init() { + t["VmFailedRelayoutEvent"] = reflect.TypeOf((*VmFailedRelayoutEvent)(nil)).Elem() +} + +type VmFailedRelayoutOnVmfs2DatastoreEvent struct { + VmEvent +} + +func init() { + t["VmFailedRelayoutOnVmfs2DatastoreEvent"] = reflect.TypeOf((*VmFailedRelayoutOnVmfs2DatastoreEvent)(nil)).Elem() +} + +type VmFailedStartingSecondaryEvent struct { + VmEvent + + Reason string `xml:"reason,omitempty"` +} + +func init() { + t["VmFailedStartingSecondaryEvent"] = reflect.TypeOf((*VmFailedStartingSecondaryEvent)(nil)).Elem() +} + +type VmFailedToPowerOffEvent struct { + VmEvent + + Reason LocalizedMethodFault `xml:"reason"` +} + +func init() { + t["VmFailedToPowerOffEvent"] = reflect.TypeOf((*VmFailedToPowerOffEvent)(nil)).Elem() +} + +type VmFailedToPowerOnEvent struct { + VmEvent + + Reason LocalizedMethodFault `xml:"reason"` +} + +func init() { + t["VmFailedToPowerOnEvent"] = reflect.TypeOf((*VmFailedToPowerOnEvent)(nil)).Elem() +} + +type VmFailedToRebootGuestEvent struct { + VmEvent + + Reason LocalizedMethodFault `xml:"reason"` +} + +func init() { + t["VmFailedToRebootGuestEvent"] = reflect.TypeOf((*VmFailedToRebootGuestEvent)(nil)).Elem() +} + +type VmFailedToResetEvent struct { + VmEvent + + Reason LocalizedMethodFault `xml:"reason"` +} + +func init() { + t["VmFailedToResetEvent"] = reflect.TypeOf((*VmFailedToResetEvent)(nil)).Elem() +} + +type VmFailedToShutdownGuestEvent struct { + VmEvent + + Reason LocalizedMethodFault `xml:"reason"` +} + +func init() { + t["VmFailedToShutdownGuestEvent"] = reflect.TypeOf((*VmFailedToShutdownGuestEvent)(nil)).Elem() +} + +type VmFailedToStandbyGuestEvent struct { + VmEvent + + Reason LocalizedMethodFault `xml:"reason"` +} + +func init() { + t["VmFailedToStandbyGuestEvent"] = reflect.TypeOf((*VmFailedToStandbyGuestEvent)(nil)).Elem() +} + +type VmFailedToSuspendEvent struct { + VmEvent + + Reason LocalizedMethodFault `xml:"reason"` +} + +func init() { + t["VmFailedToSuspendEvent"] = reflect.TypeOf((*VmFailedToSuspendEvent)(nil)).Elem() +} + +type VmFailedUpdatingSecondaryConfig struct { + VmEvent +} + +func init() { + t["VmFailedUpdatingSecondaryConfig"] = reflect.TypeOf((*VmFailedUpdatingSecondaryConfig)(nil)).Elem() +} + +type VmFailoverFailed struct { + VmEvent + + Reason *LocalizedMethodFault `xml:"reason,omitempty"` +} + +func init() { + t["VmFailoverFailed"] = reflect.TypeOf((*VmFailoverFailed)(nil)).Elem() +} + +type VmFaultToleranceConfigIssue struct { + VmFaultToleranceIssue + + Reason string `xml:"reason,omitempty"` + EntityName string `xml:"entityName,omitempty"` + Entity *ManagedObjectReference `xml:"entity,omitempty"` +} + +func init() { + t["VmFaultToleranceConfigIssue"] = reflect.TypeOf((*VmFaultToleranceConfigIssue)(nil)).Elem() +} + +type VmFaultToleranceConfigIssueFault VmFaultToleranceConfigIssue + +func init() { + t["VmFaultToleranceConfigIssueFault"] = reflect.TypeOf((*VmFaultToleranceConfigIssueFault)(nil)).Elem() +} + +type VmFaultToleranceConfigIssueWrapper struct { + VmFaultToleranceIssue + + EntityName string `xml:"entityName,omitempty"` + Entity *ManagedObjectReference `xml:"entity,omitempty"` + Error *LocalizedMethodFault `xml:"error,omitempty"` +} + +func init() { + t["VmFaultToleranceConfigIssueWrapper"] = reflect.TypeOf((*VmFaultToleranceConfigIssueWrapper)(nil)).Elem() +} + +type VmFaultToleranceConfigIssueWrapperFault VmFaultToleranceConfigIssueWrapper + +func init() { + t["VmFaultToleranceConfigIssueWrapperFault"] = reflect.TypeOf((*VmFaultToleranceConfigIssueWrapperFault)(nil)).Elem() +} + +type VmFaultToleranceInvalidFileBacking struct { + VmFaultToleranceIssue + + BackingType string `xml:"backingType,omitempty"` + BackingFilename string `xml:"backingFilename,omitempty"` +} + +func init() { + t["VmFaultToleranceInvalidFileBacking"] = reflect.TypeOf((*VmFaultToleranceInvalidFileBacking)(nil)).Elem() +} + +type VmFaultToleranceInvalidFileBackingFault VmFaultToleranceInvalidFileBacking + +func init() { + t["VmFaultToleranceInvalidFileBackingFault"] = reflect.TypeOf((*VmFaultToleranceInvalidFileBackingFault)(nil)).Elem() +} + +type VmFaultToleranceIssue struct { + VimFault +} + +func init() { + t["VmFaultToleranceIssue"] = reflect.TypeOf((*VmFaultToleranceIssue)(nil)).Elem() +} + +type VmFaultToleranceIssueFault BaseVmFaultToleranceIssue + +func init() { + t["VmFaultToleranceIssueFault"] = reflect.TypeOf((*VmFaultToleranceIssueFault)(nil)).Elem() +} + +type VmFaultToleranceOpIssuesList struct { + VmFaultToleranceIssue + + Errors []LocalizedMethodFault `xml:"errors,omitempty"` + Warnings []LocalizedMethodFault `xml:"warnings,omitempty"` +} + +func init() { + t["VmFaultToleranceOpIssuesList"] = reflect.TypeOf((*VmFaultToleranceOpIssuesList)(nil)).Elem() +} + +type VmFaultToleranceOpIssuesListFault VmFaultToleranceOpIssuesList + +func init() { + t["VmFaultToleranceOpIssuesListFault"] = reflect.TypeOf((*VmFaultToleranceOpIssuesListFault)(nil)).Elem() +} + +type VmFaultToleranceStateChangedEvent struct { + VmEvent + + OldState VirtualMachineFaultToleranceState `xml:"oldState"` + NewState VirtualMachineFaultToleranceState `xml:"newState"` +} + +func init() { + t["VmFaultToleranceStateChangedEvent"] = reflect.TypeOf((*VmFaultToleranceStateChangedEvent)(nil)).Elem() +} + +type VmFaultToleranceTooManyFtVcpusOnHost struct { + InsufficientResourcesFault + + HostName string `xml:"hostName,omitempty"` + MaxNumFtVcpus int32 `xml:"maxNumFtVcpus"` +} + +func init() { + t["VmFaultToleranceTooManyFtVcpusOnHost"] = reflect.TypeOf((*VmFaultToleranceTooManyFtVcpusOnHost)(nil)).Elem() +} + +type VmFaultToleranceTooManyFtVcpusOnHostFault VmFaultToleranceTooManyFtVcpusOnHost + +func init() { + t["VmFaultToleranceTooManyFtVcpusOnHostFault"] = reflect.TypeOf((*VmFaultToleranceTooManyFtVcpusOnHostFault)(nil)).Elem() +} + +type VmFaultToleranceTooManyVMsOnHost struct { + InsufficientResourcesFault + + HostName string `xml:"hostName,omitempty"` + MaxNumFtVms int32 `xml:"maxNumFtVms"` +} + +func init() { + t["VmFaultToleranceTooManyVMsOnHost"] = reflect.TypeOf((*VmFaultToleranceTooManyVMsOnHost)(nil)).Elem() +} + +type VmFaultToleranceTooManyVMsOnHostFault VmFaultToleranceTooManyVMsOnHost + +func init() { + t["VmFaultToleranceTooManyVMsOnHostFault"] = reflect.TypeOf((*VmFaultToleranceTooManyVMsOnHostFault)(nil)).Elem() +} + +type VmFaultToleranceTurnedOffEvent struct { + VmEvent +} + +func init() { + t["VmFaultToleranceTurnedOffEvent"] = reflect.TypeOf((*VmFaultToleranceTurnedOffEvent)(nil)).Elem() +} + +type VmFaultToleranceVmTerminatedEvent struct { + VmEvent + + Reason string `xml:"reason,omitempty"` +} + +func init() { + t["VmFaultToleranceVmTerminatedEvent"] = reflect.TypeOf((*VmFaultToleranceVmTerminatedEvent)(nil)).Elem() +} + +type VmGuestOSCrashedEvent struct { + VmEvent +} + +func init() { + t["VmGuestOSCrashedEvent"] = reflect.TypeOf((*VmGuestOSCrashedEvent)(nil)).Elem() +} + +type VmGuestRebootEvent struct { + VmEvent +} + +func init() { + t["VmGuestRebootEvent"] = reflect.TypeOf((*VmGuestRebootEvent)(nil)).Elem() +} + +type VmGuestShutdownEvent struct { + VmEvent +} + +func init() { + t["VmGuestShutdownEvent"] = reflect.TypeOf((*VmGuestShutdownEvent)(nil)).Elem() +} + +type VmGuestStandbyEvent struct { + VmEvent +} + +func init() { + t["VmGuestStandbyEvent"] = reflect.TypeOf((*VmGuestStandbyEvent)(nil)).Elem() +} + +type VmHealthMonitoringStateChangedEvent struct { + ClusterEvent + + State string `xml:"state"` +} + +func init() { + t["VmHealthMonitoringStateChangedEvent"] = reflect.TypeOf((*VmHealthMonitoringStateChangedEvent)(nil)).Elem() +} + +type VmHostAffinityRuleViolation struct { + VmConfigFault + + VmName string `xml:"vmName"` + HostName string `xml:"hostName"` +} + +func init() { + t["VmHostAffinityRuleViolation"] = reflect.TypeOf((*VmHostAffinityRuleViolation)(nil)).Elem() +} + +type VmHostAffinityRuleViolationFault VmHostAffinityRuleViolation + +func init() { + t["VmHostAffinityRuleViolationFault"] = reflect.TypeOf((*VmHostAffinityRuleViolationFault)(nil)).Elem() +} + +type VmInstanceUuidAssignedEvent struct { + VmEvent + + InstanceUuid string `xml:"instanceUuid"` +} + +func init() { + t["VmInstanceUuidAssignedEvent"] = reflect.TypeOf((*VmInstanceUuidAssignedEvent)(nil)).Elem() +} + +type VmInstanceUuidChangedEvent struct { + VmEvent + + OldInstanceUuid string `xml:"oldInstanceUuid"` + NewInstanceUuid string `xml:"newInstanceUuid"` +} + +func init() { + t["VmInstanceUuidChangedEvent"] = reflect.TypeOf((*VmInstanceUuidChangedEvent)(nil)).Elem() +} + +type VmInstanceUuidConflictEvent struct { + VmEvent + + ConflictedVm VmEventArgument `xml:"conflictedVm"` + InstanceUuid string `xml:"instanceUuid"` +} + +func init() { + t["VmInstanceUuidConflictEvent"] = reflect.TypeOf((*VmInstanceUuidConflictEvent)(nil)).Elem() +} + +type VmLimitLicense struct { + NotEnoughLicenses + + Limit int32 `xml:"limit"` +} + +func init() { + t["VmLimitLicense"] = reflect.TypeOf((*VmLimitLicense)(nil)).Elem() +} + +type VmLimitLicenseFault VmLimitLicense + +func init() { + t["VmLimitLicenseFault"] = reflect.TypeOf((*VmLimitLicenseFault)(nil)).Elem() +} + +type VmLogFileInfo struct { + FileInfo +} + +func init() { + t["VmLogFileInfo"] = reflect.TypeOf((*VmLogFileInfo)(nil)).Elem() +} + +type VmLogFileQuery struct { + FileQuery +} + +func init() { + t["VmLogFileQuery"] = reflect.TypeOf((*VmLogFileQuery)(nil)).Elem() +} + +type VmMacAssignedEvent struct { + VmEvent + + Adapter string `xml:"adapter"` + Mac string `xml:"mac"` +} + +func init() { + t["VmMacAssignedEvent"] = reflect.TypeOf((*VmMacAssignedEvent)(nil)).Elem() +} + +type VmMacChangedEvent struct { + VmEvent + + Adapter string `xml:"adapter"` + OldMac string `xml:"oldMac"` + NewMac string `xml:"newMac"` +} + +func init() { + t["VmMacChangedEvent"] = reflect.TypeOf((*VmMacChangedEvent)(nil)).Elem() +} + +type VmMacConflictEvent struct { + VmEvent + + ConflictedVm VmEventArgument `xml:"conflictedVm"` + Mac string `xml:"mac"` +} + +func init() { + t["VmMacConflictEvent"] = reflect.TypeOf((*VmMacConflictEvent)(nil)).Elem() +} + +type VmMaxFTRestartCountReached struct { + VmEvent +} + +func init() { + t["VmMaxFTRestartCountReached"] = reflect.TypeOf((*VmMaxFTRestartCountReached)(nil)).Elem() +} + +type VmMaxRestartCountReached struct { + VmEvent +} + +func init() { + t["VmMaxRestartCountReached"] = reflect.TypeOf((*VmMaxRestartCountReached)(nil)).Elem() +} + +type VmMessageErrorEvent struct { + VmEvent + + Message string `xml:"message"` + MessageInfo []VirtualMachineMessage `xml:"messageInfo,omitempty"` +} + +func init() { + t["VmMessageErrorEvent"] = reflect.TypeOf((*VmMessageErrorEvent)(nil)).Elem() +} + +type VmMessageEvent struct { + VmEvent + + Message string `xml:"message"` + MessageInfo []VirtualMachineMessage `xml:"messageInfo,omitempty"` +} + +func init() { + t["VmMessageEvent"] = reflect.TypeOf((*VmMessageEvent)(nil)).Elem() +} + +type VmMessageWarningEvent struct { + VmEvent + + Message string `xml:"message"` + MessageInfo []VirtualMachineMessage `xml:"messageInfo,omitempty"` +} + +func init() { + t["VmMessageWarningEvent"] = reflect.TypeOf((*VmMessageWarningEvent)(nil)).Elem() +} + +type VmMetadataManagerFault struct { + VimFault +} + +func init() { + t["VmMetadataManagerFault"] = reflect.TypeOf((*VmMetadataManagerFault)(nil)).Elem() +} + +type VmMetadataManagerFaultFault VmMetadataManagerFault + +func init() { + t["VmMetadataManagerFaultFault"] = reflect.TypeOf((*VmMetadataManagerFaultFault)(nil)).Elem() +} + +type VmMigratedEvent struct { + VmEvent + + SourceHost HostEventArgument `xml:"sourceHost"` + SourceDatacenter *DatacenterEventArgument `xml:"sourceDatacenter,omitempty"` + SourceDatastore *DatastoreEventArgument `xml:"sourceDatastore,omitempty"` +} + +func init() { + t["VmMigratedEvent"] = reflect.TypeOf((*VmMigratedEvent)(nil)).Elem() +} + +type VmMonitorIncompatibleForFaultTolerance struct { + VimFault +} + +func init() { + t["VmMonitorIncompatibleForFaultTolerance"] = reflect.TypeOf((*VmMonitorIncompatibleForFaultTolerance)(nil)).Elem() +} + +type VmMonitorIncompatibleForFaultToleranceFault VmMonitorIncompatibleForFaultTolerance + +func init() { + t["VmMonitorIncompatibleForFaultToleranceFault"] = reflect.TypeOf((*VmMonitorIncompatibleForFaultToleranceFault)(nil)).Elem() +} + +type VmNoCompatibleHostForSecondaryEvent struct { + VmEvent +} + +func init() { + t["VmNoCompatibleHostForSecondaryEvent"] = reflect.TypeOf((*VmNoCompatibleHostForSecondaryEvent)(nil)).Elem() +} + +type VmNoNetworkAccessEvent struct { + VmEvent + + DestHost HostEventArgument `xml:"destHost"` +} + +func init() { + t["VmNoNetworkAccessEvent"] = reflect.TypeOf((*VmNoNetworkAccessEvent)(nil)).Elem() +} + +type VmNvramFileInfo struct { + FileInfo +} + +func init() { + t["VmNvramFileInfo"] = reflect.TypeOf((*VmNvramFileInfo)(nil)).Elem() +} + +type VmNvramFileQuery struct { + FileQuery +} + +func init() { + t["VmNvramFileQuery"] = reflect.TypeOf((*VmNvramFileQuery)(nil)).Elem() +} + +type VmOrphanedEvent struct { + VmEvent +} + +func init() { + t["VmOrphanedEvent"] = reflect.TypeOf((*VmOrphanedEvent)(nil)).Elem() +} + +type VmPodConfigForPlacement struct { + DynamicData + + StoragePod ManagedObjectReference `xml:"storagePod"` + Disk []PodDiskLocator `xml:"disk,omitempty"` + VmConfig *StorageDrsVmConfigInfo `xml:"vmConfig,omitempty"` + InterVmRule []BaseClusterRuleInfo `xml:"interVmRule,omitempty,typeattr"` +} + +func init() { + t["VmPodConfigForPlacement"] = reflect.TypeOf((*VmPodConfigForPlacement)(nil)).Elem() +} + +type VmPortGroupProfile struct { + PortGroupProfile +} + +func init() { + t["VmPortGroupProfile"] = reflect.TypeOf((*VmPortGroupProfile)(nil)).Elem() +} + +type VmPowerOffOnIsolationEvent struct { + VmPoweredOffEvent + + IsolatedHost HostEventArgument `xml:"isolatedHost"` +} + +func init() { + t["VmPowerOffOnIsolationEvent"] = reflect.TypeOf((*VmPowerOffOnIsolationEvent)(nil)).Elem() +} + +type VmPowerOnDisabled struct { + InvalidState +} + +func init() { + t["VmPowerOnDisabled"] = reflect.TypeOf((*VmPowerOnDisabled)(nil)).Elem() +} + +type VmPowerOnDisabledFault VmPowerOnDisabled + +func init() { + t["VmPowerOnDisabledFault"] = reflect.TypeOf((*VmPowerOnDisabledFault)(nil)).Elem() +} + +type VmPoweredOffEvent struct { + VmEvent +} + +func init() { + t["VmPoweredOffEvent"] = reflect.TypeOf((*VmPoweredOffEvent)(nil)).Elem() +} + +type VmPoweredOnEvent struct { + VmEvent +} + +func init() { + t["VmPoweredOnEvent"] = reflect.TypeOf((*VmPoweredOnEvent)(nil)).Elem() +} + +type VmPoweringOnWithCustomizedDVPortEvent struct { + VmEvent + + Vnic []VnicPortArgument `xml:"vnic"` +} + +func init() { + t["VmPoweringOnWithCustomizedDVPortEvent"] = reflect.TypeOf((*VmPoweringOnWithCustomizedDVPortEvent)(nil)).Elem() +} + +type VmPrimaryFailoverEvent struct { + VmEvent + + Reason string `xml:"reason,omitempty"` +} + +func init() { + t["VmPrimaryFailoverEvent"] = reflect.TypeOf((*VmPrimaryFailoverEvent)(nil)).Elem() +} + +type VmReconfiguredEvent struct { + VmEvent + + ConfigSpec VirtualMachineConfigSpec `xml:"configSpec"` +} + +func init() { + t["VmReconfiguredEvent"] = reflect.TypeOf((*VmReconfiguredEvent)(nil)).Elem() +} + +type VmRegisteredEvent struct { + VmEvent +} + +func init() { + t["VmRegisteredEvent"] = reflect.TypeOf((*VmRegisteredEvent)(nil)).Elem() +} + +type VmRelayoutSuccessfulEvent struct { + VmEvent +} + +func init() { + t["VmRelayoutSuccessfulEvent"] = reflect.TypeOf((*VmRelayoutSuccessfulEvent)(nil)).Elem() +} + +type VmRelayoutUpToDateEvent struct { + VmEvent +} + +func init() { + t["VmRelayoutUpToDateEvent"] = reflect.TypeOf((*VmRelayoutUpToDateEvent)(nil)).Elem() +} + +type VmReloadFromPathEvent struct { + VmEvent + + ConfigPath string `xml:"configPath"` +} + +func init() { + t["VmReloadFromPathEvent"] = reflect.TypeOf((*VmReloadFromPathEvent)(nil)).Elem() +} + +type VmReloadFromPathFailedEvent struct { + VmEvent + + ConfigPath string `xml:"configPath"` +} + +func init() { + t["VmReloadFromPathFailedEvent"] = reflect.TypeOf((*VmReloadFromPathFailedEvent)(nil)).Elem() +} + +type VmRelocateFailedEvent struct { + VmRelocateSpecEvent + + DestHost HostEventArgument `xml:"destHost"` + Reason LocalizedMethodFault `xml:"reason"` + DestDatacenter *DatacenterEventArgument `xml:"destDatacenter,omitempty"` + DestDatastore *DatastoreEventArgument `xml:"destDatastore,omitempty"` +} + +func init() { + t["VmRelocateFailedEvent"] = reflect.TypeOf((*VmRelocateFailedEvent)(nil)).Elem() +} + +type VmRelocateSpecEvent struct { + VmEvent +} + +func init() { + t["VmRelocateSpecEvent"] = reflect.TypeOf((*VmRelocateSpecEvent)(nil)).Elem() +} + +type VmRelocatedEvent struct { + VmRelocateSpecEvent + + SourceHost HostEventArgument `xml:"sourceHost"` + SourceDatacenter *DatacenterEventArgument `xml:"sourceDatacenter,omitempty"` + SourceDatastore *DatastoreEventArgument `xml:"sourceDatastore,omitempty"` +} + +func init() { + t["VmRelocatedEvent"] = reflect.TypeOf((*VmRelocatedEvent)(nil)).Elem() +} + +type VmRemoteConsoleConnectedEvent struct { + VmEvent +} + +func init() { + t["VmRemoteConsoleConnectedEvent"] = reflect.TypeOf((*VmRemoteConsoleConnectedEvent)(nil)).Elem() +} + +type VmRemoteConsoleDisconnectedEvent struct { + VmEvent +} + +func init() { + t["VmRemoteConsoleDisconnectedEvent"] = reflect.TypeOf((*VmRemoteConsoleDisconnectedEvent)(nil)).Elem() +} + +type VmRemovedEvent struct { + VmEvent +} + +func init() { + t["VmRemovedEvent"] = reflect.TypeOf((*VmRemovedEvent)(nil)).Elem() +} + +type VmRenamedEvent struct { + VmEvent + + OldName string `xml:"oldName"` + NewName string `xml:"newName"` +} + +func init() { + t["VmRenamedEvent"] = reflect.TypeOf((*VmRenamedEvent)(nil)).Elem() +} + +type VmRequirementsExceedCurrentEVCModeEvent struct { + VmEvent +} + +func init() { + t["VmRequirementsExceedCurrentEVCModeEvent"] = reflect.TypeOf((*VmRequirementsExceedCurrentEVCModeEvent)(nil)).Elem() +} + +type VmResettingEvent struct { + VmEvent +} + +func init() { + t["VmResettingEvent"] = reflect.TypeOf((*VmResettingEvent)(nil)).Elem() +} + +type VmResourcePoolMovedEvent struct { + VmEvent + + OldParent ResourcePoolEventArgument `xml:"oldParent"` + NewParent ResourcePoolEventArgument `xml:"newParent"` +} + +func init() { + t["VmResourcePoolMovedEvent"] = reflect.TypeOf((*VmResourcePoolMovedEvent)(nil)).Elem() +} + +type VmResourceReallocatedEvent struct { + VmEvent +} + +func init() { + t["VmResourceReallocatedEvent"] = reflect.TypeOf((*VmResourceReallocatedEvent)(nil)).Elem() +} + +type VmRestartedOnAlternateHostEvent struct { + VmPoweredOnEvent + + SourceHost HostEventArgument `xml:"sourceHost"` +} + +func init() { + t["VmRestartedOnAlternateHostEvent"] = reflect.TypeOf((*VmRestartedOnAlternateHostEvent)(nil)).Elem() +} + +type VmResumingEvent struct { + VmEvent +} + +func init() { + t["VmResumingEvent"] = reflect.TypeOf((*VmResumingEvent)(nil)).Elem() +} + +type VmSecondaryAddedEvent struct { + VmEvent +} + +func init() { + t["VmSecondaryAddedEvent"] = reflect.TypeOf((*VmSecondaryAddedEvent)(nil)).Elem() +} + +type VmSecondaryDisabledBySystemEvent struct { + VmEvent + + Reason *LocalizedMethodFault `xml:"reason,omitempty"` +} + +func init() { + t["VmSecondaryDisabledBySystemEvent"] = reflect.TypeOf((*VmSecondaryDisabledBySystemEvent)(nil)).Elem() +} + +type VmSecondaryDisabledEvent struct { + VmEvent +} + +func init() { + t["VmSecondaryDisabledEvent"] = reflect.TypeOf((*VmSecondaryDisabledEvent)(nil)).Elem() +} + +type VmSecondaryEnabledEvent struct { + VmEvent +} + +func init() { + t["VmSecondaryEnabledEvent"] = reflect.TypeOf((*VmSecondaryEnabledEvent)(nil)).Elem() +} + +type VmSecondaryStartedEvent struct { + VmEvent +} + +func init() { + t["VmSecondaryStartedEvent"] = reflect.TypeOf((*VmSecondaryStartedEvent)(nil)).Elem() +} + +type VmShutdownOnIsolationEvent struct { + VmPoweredOffEvent + + IsolatedHost HostEventArgument `xml:"isolatedHost"` + ShutdownResult string `xml:"shutdownResult,omitempty"` +} + +func init() { + t["VmShutdownOnIsolationEvent"] = reflect.TypeOf((*VmShutdownOnIsolationEvent)(nil)).Elem() +} + +type VmSmpFaultToleranceTooManyVMsOnHost struct { + InsufficientResourcesFault + + HostName string `xml:"hostName,omitempty"` + MaxNumSmpFtVms int32 `xml:"maxNumSmpFtVms"` +} + +func init() { + t["VmSmpFaultToleranceTooManyVMsOnHost"] = reflect.TypeOf((*VmSmpFaultToleranceTooManyVMsOnHost)(nil)).Elem() +} + +type VmSmpFaultToleranceTooManyVMsOnHostFault VmSmpFaultToleranceTooManyVMsOnHost + +func init() { + t["VmSmpFaultToleranceTooManyVMsOnHostFault"] = reflect.TypeOf((*VmSmpFaultToleranceTooManyVMsOnHostFault)(nil)).Elem() +} + +type VmSnapshotFileInfo struct { + FileInfo +} + +func init() { + t["VmSnapshotFileInfo"] = reflect.TypeOf((*VmSnapshotFileInfo)(nil)).Elem() +} + +type VmSnapshotFileQuery struct { + FileQuery +} + +func init() { + t["VmSnapshotFileQuery"] = reflect.TypeOf((*VmSnapshotFileQuery)(nil)).Elem() +} + +type VmStartRecordingEvent struct { + VmEvent +} + +func init() { + t["VmStartRecordingEvent"] = reflect.TypeOf((*VmStartRecordingEvent)(nil)).Elem() +} + +type VmStartReplayingEvent struct { + VmEvent +} + +func init() { + t["VmStartReplayingEvent"] = reflect.TypeOf((*VmStartReplayingEvent)(nil)).Elem() +} + +type VmStartingEvent struct { + VmEvent +} + +func init() { + t["VmStartingEvent"] = reflect.TypeOf((*VmStartingEvent)(nil)).Elem() +} + +type VmStartingSecondaryEvent struct { + VmEvent +} + +func init() { + t["VmStartingSecondaryEvent"] = reflect.TypeOf((*VmStartingSecondaryEvent)(nil)).Elem() +} + +type VmStaticMacConflictEvent struct { + VmEvent + + ConflictedVm VmEventArgument `xml:"conflictedVm"` + Mac string `xml:"mac"` +} + +func init() { + t["VmStaticMacConflictEvent"] = reflect.TypeOf((*VmStaticMacConflictEvent)(nil)).Elem() +} + +type VmStoppingEvent struct { + VmEvent +} + +func init() { + t["VmStoppingEvent"] = reflect.TypeOf((*VmStoppingEvent)(nil)).Elem() +} + +type VmSuspendedEvent struct { + VmEvent +} + +func init() { + t["VmSuspendedEvent"] = reflect.TypeOf((*VmSuspendedEvent)(nil)).Elem() +} + +type VmSuspendingEvent struct { + VmEvent +} + +func init() { + t["VmSuspendingEvent"] = reflect.TypeOf((*VmSuspendingEvent)(nil)).Elem() +} + +type VmTimedoutStartingSecondaryEvent struct { + VmEvent + + Timeout int64 `xml:"timeout,omitempty"` +} + +func init() { + t["VmTimedoutStartingSecondaryEvent"] = reflect.TypeOf((*VmTimedoutStartingSecondaryEvent)(nil)).Elem() +} + +type VmToolsUpgradeFault struct { + VimFault +} + +func init() { + t["VmToolsUpgradeFault"] = reflect.TypeOf((*VmToolsUpgradeFault)(nil)).Elem() +} + +type VmToolsUpgradeFaultFault BaseVmToolsUpgradeFault + +func init() { + t["VmToolsUpgradeFaultFault"] = reflect.TypeOf((*VmToolsUpgradeFaultFault)(nil)).Elem() +} + +type VmUnsupportedStartingEvent struct { + VmStartingEvent + + GuestId string `xml:"guestId"` +} + +func init() { + t["VmUnsupportedStartingEvent"] = reflect.TypeOf((*VmUnsupportedStartingEvent)(nil)).Elem() +} + +type VmUpgradeCompleteEvent struct { + VmEvent + + Version string `xml:"version"` +} + +func init() { + t["VmUpgradeCompleteEvent"] = reflect.TypeOf((*VmUpgradeCompleteEvent)(nil)).Elem() +} + +type VmUpgradeFailedEvent struct { + VmEvent +} + +func init() { + t["VmUpgradeFailedEvent"] = reflect.TypeOf((*VmUpgradeFailedEvent)(nil)).Elem() +} + +type VmUpgradingEvent struct { + VmEvent + + Version string `xml:"version"` +} + +func init() { + t["VmUpgradingEvent"] = reflect.TypeOf((*VmUpgradingEvent)(nil)).Elem() +} + +type VmUuidAssignedEvent struct { + VmEvent + + Uuid string `xml:"uuid"` +} + +func init() { + t["VmUuidAssignedEvent"] = reflect.TypeOf((*VmUuidAssignedEvent)(nil)).Elem() +} + +type VmUuidChangedEvent struct { + VmEvent + + OldUuid string `xml:"oldUuid"` + NewUuid string `xml:"newUuid"` +} + +func init() { + t["VmUuidChangedEvent"] = reflect.TypeOf((*VmUuidChangedEvent)(nil)).Elem() +} + +type VmUuidConflictEvent struct { + VmEvent + + ConflictedVm VmEventArgument `xml:"conflictedVm"` + Uuid string `xml:"uuid"` +} + +func init() { + t["VmUuidConflictEvent"] = reflect.TypeOf((*VmUuidConflictEvent)(nil)).Elem() +} + +type VmValidateMaxDevice struct { + VimFault + + Device string `xml:"device"` + Max int32 `xml:"max"` + Count int32 `xml:"count"` +} + +func init() { + t["VmValidateMaxDevice"] = reflect.TypeOf((*VmValidateMaxDevice)(nil)).Elem() +} + +type VmValidateMaxDeviceFault VmValidateMaxDevice + +func init() { + t["VmValidateMaxDeviceFault"] = reflect.TypeOf((*VmValidateMaxDeviceFault)(nil)).Elem() +} + +type VmVnicPoolReservationViolationClearEvent struct { + DvsEvent + + VmVnicResourcePoolKey string `xml:"vmVnicResourcePoolKey"` + VmVnicResourcePoolName string `xml:"vmVnicResourcePoolName,omitempty"` +} + +func init() { + t["VmVnicPoolReservationViolationClearEvent"] = reflect.TypeOf((*VmVnicPoolReservationViolationClearEvent)(nil)).Elem() +} + +type VmVnicPoolReservationViolationRaiseEvent struct { + DvsEvent + + VmVnicResourcePoolKey string `xml:"vmVnicResourcePoolKey"` + VmVnicResourcePoolName string `xml:"vmVnicResourcePoolName,omitempty"` +} + +func init() { + t["VmVnicPoolReservationViolationRaiseEvent"] = reflect.TypeOf((*VmVnicPoolReservationViolationRaiseEvent)(nil)).Elem() +} + +type VmWwnAssignedEvent struct { + VmEvent + + NodeWwns []int64 `xml:"nodeWwns"` + PortWwns []int64 `xml:"portWwns"` +} + +func init() { + t["VmWwnAssignedEvent"] = reflect.TypeOf((*VmWwnAssignedEvent)(nil)).Elem() +} + +type VmWwnChangedEvent struct { + VmEvent + + OldNodeWwns []int64 `xml:"oldNodeWwns,omitempty"` + OldPortWwns []int64 `xml:"oldPortWwns,omitempty"` + NewNodeWwns []int64 `xml:"newNodeWwns,omitempty"` + NewPortWwns []int64 `xml:"newPortWwns,omitempty"` +} + +func init() { + t["VmWwnChangedEvent"] = reflect.TypeOf((*VmWwnChangedEvent)(nil)).Elem() +} + +type VmWwnConflict struct { + InvalidVmConfig + + Vm *ManagedObjectReference `xml:"vm,omitempty"` + Host *ManagedObjectReference `xml:"host,omitempty"` + Name string `xml:"name,omitempty"` + Wwn int64 `xml:"wwn,omitempty"` +} + +func init() { + t["VmWwnConflict"] = reflect.TypeOf((*VmWwnConflict)(nil)).Elem() +} + +type VmWwnConflictEvent struct { + VmEvent + + ConflictedVms []VmEventArgument `xml:"conflictedVms,omitempty"` + ConflictedHosts []HostEventArgument `xml:"conflictedHosts,omitempty"` + Wwn int64 `xml:"wwn"` +} + +func init() { + t["VmWwnConflictEvent"] = reflect.TypeOf((*VmWwnConflictEvent)(nil)).Elem() +} + +type VmWwnConflictFault VmWwnConflict + +func init() { + t["VmWwnConflictFault"] = reflect.TypeOf((*VmWwnConflictFault)(nil)).Elem() +} + +type VmfsAlreadyMounted struct { + VmfsMountFault +} + +func init() { + t["VmfsAlreadyMounted"] = reflect.TypeOf((*VmfsAlreadyMounted)(nil)).Elem() +} + +type VmfsAlreadyMountedFault VmfsAlreadyMounted + +func init() { + t["VmfsAlreadyMountedFault"] = reflect.TypeOf((*VmfsAlreadyMountedFault)(nil)).Elem() +} + +type VmfsAmbiguousMount struct { + VmfsMountFault +} + +func init() { + t["VmfsAmbiguousMount"] = reflect.TypeOf((*VmfsAmbiguousMount)(nil)).Elem() +} + +type VmfsAmbiguousMountFault VmfsAmbiguousMount + +func init() { + t["VmfsAmbiguousMountFault"] = reflect.TypeOf((*VmfsAmbiguousMountFault)(nil)).Elem() +} + +type VmfsDatastoreAllExtentOption struct { + VmfsDatastoreSingleExtentOption +} + +func init() { + t["VmfsDatastoreAllExtentOption"] = reflect.TypeOf((*VmfsDatastoreAllExtentOption)(nil)).Elem() +} + +type VmfsDatastoreBaseOption struct { + DynamicData + + Layout HostDiskPartitionLayout `xml:"layout"` + PartitionFormatChange *bool `xml:"partitionFormatChange"` +} + +func init() { + t["VmfsDatastoreBaseOption"] = reflect.TypeOf((*VmfsDatastoreBaseOption)(nil)).Elem() +} + +type VmfsDatastoreCreateSpec struct { + VmfsDatastoreSpec + + Partition HostDiskPartitionSpec `xml:"partition"` + Vmfs HostVmfsSpec `xml:"vmfs"` + Extent []HostScsiDiskPartition `xml:"extent,omitempty"` +} + +func init() { + t["VmfsDatastoreCreateSpec"] = reflect.TypeOf((*VmfsDatastoreCreateSpec)(nil)).Elem() +} + +type VmfsDatastoreExpandSpec struct { + VmfsDatastoreSpec + + Partition HostDiskPartitionSpec `xml:"partition"` + Extent HostScsiDiskPartition `xml:"extent"` +} + +func init() { + t["VmfsDatastoreExpandSpec"] = reflect.TypeOf((*VmfsDatastoreExpandSpec)(nil)).Elem() +} + +type VmfsDatastoreExtendSpec struct { + VmfsDatastoreSpec + + Partition HostDiskPartitionSpec `xml:"partition"` + Extent []HostScsiDiskPartition `xml:"extent"` +} + +func init() { + t["VmfsDatastoreExtendSpec"] = reflect.TypeOf((*VmfsDatastoreExtendSpec)(nil)).Elem() +} + +type VmfsDatastoreInfo struct { + DatastoreInfo + + MaxPhysicalRDMFileSize int64 `xml:"maxPhysicalRDMFileSize,omitempty"` + MaxVirtualRDMFileSize int64 `xml:"maxVirtualRDMFileSize,omitempty"` + Vmfs *HostVmfsVolume `xml:"vmfs,omitempty"` +} + +func init() { + t["VmfsDatastoreInfo"] = reflect.TypeOf((*VmfsDatastoreInfo)(nil)).Elem() +} + +type VmfsDatastoreMultipleExtentOption struct { + VmfsDatastoreBaseOption + + VmfsExtent []HostDiskPartitionBlockRange `xml:"vmfsExtent"` +} + +func init() { + t["VmfsDatastoreMultipleExtentOption"] = reflect.TypeOf((*VmfsDatastoreMultipleExtentOption)(nil)).Elem() +} + +type VmfsDatastoreOption struct { + DynamicData + + Info BaseVmfsDatastoreBaseOption `xml:"info,typeattr"` + Spec BaseVmfsDatastoreSpec `xml:"spec,typeattr"` +} + +func init() { + t["VmfsDatastoreOption"] = reflect.TypeOf((*VmfsDatastoreOption)(nil)).Elem() +} + +type VmfsDatastoreSingleExtentOption struct { + VmfsDatastoreBaseOption + + VmfsExtent HostDiskPartitionBlockRange `xml:"vmfsExtent"` +} + +func init() { + t["VmfsDatastoreSingleExtentOption"] = reflect.TypeOf((*VmfsDatastoreSingleExtentOption)(nil)).Elem() +} + +type VmfsDatastoreSpec struct { + DynamicData + + DiskUuid string `xml:"diskUuid"` +} + +func init() { + t["VmfsDatastoreSpec"] = reflect.TypeOf((*VmfsDatastoreSpec)(nil)).Elem() +} + +type VmfsMountFault struct { + HostConfigFault + + Uuid string `xml:"uuid"` +} + +func init() { + t["VmfsMountFault"] = reflect.TypeOf((*VmfsMountFault)(nil)).Elem() +} + +type VmfsMountFaultFault BaseVmfsMountFault + +func init() { + t["VmfsMountFaultFault"] = reflect.TypeOf((*VmfsMountFaultFault)(nil)).Elem() +} + +type VmotionInterfaceNotEnabled struct { + HostPowerOpFailed +} + +func init() { + t["VmotionInterfaceNotEnabled"] = reflect.TypeOf((*VmotionInterfaceNotEnabled)(nil)).Elem() +} + +type VmotionInterfaceNotEnabledFault VmotionInterfaceNotEnabled + +func init() { + t["VmotionInterfaceNotEnabledFault"] = reflect.TypeOf((*VmotionInterfaceNotEnabledFault)(nil)).Elem() +} + +type VmwareDistributedVirtualSwitchPvlanSpec struct { + VmwareDistributedVirtualSwitchVlanSpec + + PvlanId int32 `xml:"pvlanId"` +} + +func init() { + t["VmwareDistributedVirtualSwitchPvlanSpec"] = reflect.TypeOf((*VmwareDistributedVirtualSwitchPvlanSpec)(nil)).Elem() +} + +type VmwareDistributedVirtualSwitchTrunkVlanSpec struct { + VmwareDistributedVirtualSwitchVlanSpec + + VlanId []NumericRange `xml:"vlanId"` +} + +func init() { + t["VmwareDistributedVirtualSwitchTrunkVlanSpec"] = reflect.TypeOf((*VmwareDistributedVirtualSwitchTrunkVlanSpec)(nil)).Elem() +} + +type VmwareDistributedVirtualSwitchVlanIdSpec struct { + VmwareDistributedVirtualSwitchVlanSpec + + VlanId int32 `xml:"vlanId"` +} + +func init() { + t["VmwareDistributedVirtualSwitchVlanIdSpec"] = reflect.TypeOf((*VmwareDistributedVirtualSwitchVlanIdSpec)(nil)).Elem() +} + +type VmwareDistributedVirtualSwitchVlanSpec struct { + InheritablePolicy +} + +func init() { + t["VmwareDistributedVirtualSwitchVlanSpec"] = reflect.TypeOf((*VmwareDistributedVirtualSwitchVlanSpec)(nil)).Elem() +} + +type VmwareUplinkPortTeamingPolicy struct { + InheritablePolicy + + Policy *StringPolicy `xml:"policy,omitempty"` + ReversePolicy *BoolPolicy `xml:"reversePolicy,omitempty"` + NotifySwitches *BoolPolicy `xml:"notifySwitches,omitempty"` + RollingOrder *BoolPolicy `xml:"rollingOrder,omitempty"` + FailureCriteria *DVSFailureCriteria `xml:"failureCriteria,omitempty"` + UplinkPortOrder *VMwareUplinkPortOrderPolicy `xml:"uplinkPortOrder,omitempty"` +} + +func init() { + t["VmwareUplinkPortTeamingPolicy"] = reflect.TypeOf((*VmwareUplinkPortTeamingPolicy)(nil)).Elem() +} + +type VnicPortArgument struct { + DynamicData + + Vnic string `xml:"vnic"` + Port DistributedVirtualSwitchPortConnection `xml:"port"` +} + +func init() { + t["VnicPortArgument"] = reflect.TypeOf((*VnicPortArgument)(nil)).Elem() +} + +type VolumeEditorError struct { + CustomizationFault +} + +func init() { + t["VolumeEditorError"] = reflect.TypeOf((*VolumeEditorError)(nil)).Elem() +} + +type VolumeEditorErrorFault VolumeEditorError + +func init() { + t["VolumeEditorErrorFault"] = reflect.TypeOf((*VolumeEditorErrorFault)(nil)).Elem() +} + +type VramLimitLicense struct { + NotEnoughLicenses + + Limit int32 `xml:"limit"` +} + +func init() { + t["VramLimitLicense"] = reflect.TypeOf((*VramLimitLicense)(nil)).Elem() +} + +type VramLimitLicenseFault VramLimitLicense + +func init() { + t["VramLimitLicenseFault"] = reflect.TypeOf((*VramLimitLicenseFault)(nil)).Elem() +} + +type VrpResourceAllocationInfo struct { + ResourceAllocationInfo + + ReservationLimit int64 `xml:"reservationLimit,omitempty"` +} + +func init() { + t["VrpResourceAllocationInfo"] = reflect.TypeOf((*VrpResourceAllocationInfo)(nil)).Elem() +} + +type VsanClusterConfigInfo struct { + DynamicData + + Enabled *bool `xml:"enabled"` + DefaultConfig *VsanClusterConfigInfoHostDefaultInfo `xml:"defaultConfig,omitempty"` +} + +func init() { + t["VsanClusterConfigInfo"] = reflect.TypeOf((*VsanClusterConfigInfo)(nil)).Elem() +} + +type VsanClusterConfigInfoHostDefaultInfo struct { + DynamicData + + Uuid string `xml:"uuid,omitempty"` + AutoClaimStorage *bool `xml:"autoClaimStorage"` + ChecksumEnabled *bool `xml:"checksumEnabled"` +} + +func init() { + t["VsanClusterConfigInfoHostDefaultInfo"] = reflect.TypeOf((*VsanClusterConfigInfoHostDefaultInfo)(nil)).Elem() +} + +type VsanClusterUuidMismatch struct { + CannotMoveVsanEnabledHost + + HostClusterUuid string `xml:"hostClusterUuid"` + DestinationClusterUuid string `xml:"destinationClusterUuid"` +} + +func init() { + t["VsanClusterUuidMismatch"] = reflect.TypeOf((*VsanClusterUuidMismatch)(nil)).Elem() +} + +type VsanClusterUuidMismatchFault VsanClusterUuidMismatch + +func init() { + t["VsanClusterUuidMismatchFault"] = reflect.TypeOf((*VsanClusterUuidMismatchFault)(nil)).Elem() +} + +type VsanDiskFault struct { + VsanFault + + Device string `xml:"device,omitempty"` +} + +func init() { + t["VsanDiskFault"] = reflect.TypeOf((*VsanDiskFault)(nil)).Elem() +} + +type VsanDiskFaultFault BaseVsanDiskFault + +func init() { + t["VsanDiskFaultFault"] = reflect.TypeOf((*VsanDiskFaultFault)(nil)).Elem() +} + +type VsanFault struct { + VimFault +} + +func init() { + t["VsanFault"] = reflect.TypeOf((*VsanFault)(nil)).Elem() +} + +type VsanFaultFault BaseVsanFault + +func init() { + t["VsanFaultFault"] = reflect.TypeOf((*VsanFaultFault)(nil)).Elem() +} + +type VsanHostClusterStatus struct { + DynamicData + + Uuid string `xml:"uuid,omitempty"` + NodeUuid string `xml:"nodeUuid,omitempty"` + Health string `xml:"health"` + NodeState VsanHostClusterStatusState `xml:"nodeState"` + MemberUuid []string `xml:"memberUuid,omitempty"` +} + +func init() { + t["VsanHostClusterStatus"] = reflect.TypeOf((*VsanHostClusterStatus)(nil)).Elem() +} + +type VsanHostClusterStatusState struct { + DynamicData + + State string `xml:"state"` + Completion *VsanHostClusterStatusStateCompletionEstimate `xml:"completion,omitempty"` +} + +func init() { + t["VsanHostClusterStatusState"] = reflect.TypeOf((*VsanHostClusterStatusState)(nil)).Elem() +} + +type VsanHostClusterStatusStateCompletionEstimate struct { + DynamicData + + CompleteTime *time.Time `xml:"completeTime"` + PercentComplete int32 `xml:"percentComplete,omitempty"` +} + +func init() { + t["VsanHostClusterStatusStateCompletionEstimate"] = reflect.TypeOf((*VsanHostClusterStatusStateCompletionEstimate)(nil)).Elem() +} + +type VsanHostConfigInfo struct { + DynamicData + + Enabled *bool `xml:"enabled"` + HostSystem *ManagedObjectReference `xml:"hostSystem,omitempty"` + ClusterInfo *VsanHostConfigInfoClusterInfo `xml:"clusterInfo,omitempty"` + StorageInfo *VsanHostConfigInfoStorageInfo `xml:"storageInfo,omitempty"` + NetworkInfo *VsanHostConfigInfoNetworkInfo `xml:"networkInfo,omitempty"` + FaultDomainInfo *VsanHostFaultDomainInfo `xml:"faultDomainInfo,omitempty"` +} + +func init() { + t["VsanHostConfigInfo"] = reflect.TypeOf((*VsanHostConfigInfo)(nil)).Elem() +} + +type VsanHostConfigInfoClusterInfo struct { + DynamicData + + Uuid string `xml:"uuid,omitempty"` + NodeUuid string `xml:"nodeUuid,omitempty"` +} + +func init() { + t["VsanHostConfigInfoClusterInfo"] = reflect.TypeOf((*VsanHostConfigInfoClusterInfo)(nil)).Elem() +} + +type VsanHostConfigInfoNetworkInfo struct { + DynamicData + + Port []VsanHostConfigInfoNetworkInfoPortConfig `xml:"port,omitempty"` +} + +func init() { + t["VsanHostConfigInfoNetworkInfo"] = reflect.TypeOf((*VsanHostConfigInfoNetworkInfo)(nil)).Elem() +} + +type VsanHostConfigInfoNetworkInfoPortConfig struct { + DynamicData + + IpConfig *VsanHostIpConfig `xml:"ipConfig,omitempty"` + Device string `xml:"device"` +} + +func init() { + t["VsanHostConfigInfoNetworkInfoPortConfig"] = reflect.TypeOf((*VsanHostConfigInfoNetworkInfoPortConfig)(nil)).Elem() +} + +type VsanHostConfigInfoStorageInfo struct { + DynamicData + + AutoClaimStorage *bool `xml:"autoClaimStorage"` + DiskMapping []VsanHostDiskMapping `xml:"diskMapping,omitempty"` + DiskMapInfo []VsanHostDiskMapInfo `xml:"diskMapInfo,omitempty"` + ChecksumEnabled *bool `xml:"checksumEnabled"` +} + +func init() { + t["VsanHostConfigInfoStorageInfo"] = reflect.TypeOf((*VsanHostConfigInfoStorageInfo)(nil)).Elem() +} + +type VsanHostDecommissionMode struct { + DynamicData + + ObjectAction string `xml:"objectAction"` +} + +func init() { + t["VsanHostDecommissionMode"] = reflect.TypeOf((*VsanHostDecommissionMode)(nil)).Elem() +} + +type VsanHostDiskMapInfo struct { + DynamicData + + Mapping VsanHostDiskMapping `xml:"mapping"` + Mounted bool `xml:"mounted"` +} + +func init() { + t["VsanHostDiskMapInfo"] = reflect.TypeOf((*VsanHostDiskMapInfo)(nil)).Elem() +} + +type VsanHostDiskMapResult struct { + DynamicData + + Mapping VsanHostDiskMapping `xml:"mapping"` + DiskResult []VsanHostDiskResult `xml:"diskResult,omitempty"` + Error *LocalizedMethodFault `xml:"error,omitempty"` +} + +func init() { + t["VsanHostDiskMapResult"] = reflect.TypeOf((*VsanHostDiskMapResult)(nil)).Elem() +} + +type VsanHostDiskMapping struct { + DynamicData + + Ssd HostScsiDisk `xml:"ssd"` + NonSsd []HostScsiDisk `xml:"nonSsd"` +} + +func init() { + t["VsanHostDiskMapping"] = reflect.TypeOf((*VsanHostDiskMapping)(nil)).Elem() +} + +type VsanHostDiskResult struct { + DynamicData + + Disk HostScsiDisk `xml:"disk"` + State string `xml:"state"` + VsanUuid string `xml:"vsanUuid,omitempty"` + Error *LocalizedMethodFault `xml:"error,omitempty"` + Degraded *bool `xml:"degraded"` +} + +func init() { + t["VsanHostDiskResult"] = reflect.TypeOf((*VsanHostDiskResult)(nil)).Elem() +} + +type VsanHostFaultDomainInfo struct { + DynamicData + + Name string `xml:"name"` +} + +func init() { + t["VsanHostFaultDomainInfo"] = reflect.TypeOf((*VsanHostFaultDomainInfo)(nil)).Elem() +} + +type VsanHostIpConfig struct { + DynamicData + + UpstreamIpAddress string `xml:"upstreamIpAddress"` + DownstreamIpAddress string `xml:"downstreamIpAddress"` +} + +func init() { + t["VsanHostIpConfig"] = reflect.TypeOf((*VsanHostIpConfig)(nil)).Elem() +} + +type VsanHostMembershipInfo struct { + DynamicData + + NodeUuid string `xml:"nodeUuid"` + Hostname string `xml:"hostname"` +} + +func init() { + t["VsanHostMembershipInfo"] = reflect.TypeOf((*VsanHostMembershipInfo)(nil)).Elem() +} + +type VsanHostRuntimeInfo struct { + DynamicData + + MembershipList []VsanHostMembershipInfo `xml:"membershipList,omitempty"` + DiskIssues []VsanHostRuntimeInfoDiskIssue `xml:"diskIssues,omitempty"` + AccessGenNo int32 `xml:"accessGenNo,omitempty"` +} + +func init() { + t["VsanHostRuntimeInfo"] = reflect.TypeOf((*VsanHostRuntimeInfo)(nil)).Elem() +} + +type VsanHostRuntimeInfoDiskIssue struct { + DynamicData + + DiskId string `xml:"diskId"` + Issue string `xml:"issue"` +} + +func init() { + t["VsanHostRuntimeInfoDiskIssue"] = reflect.TypeOf((*VsanHostRuntimeInfoDiskIssue)(nil)).Elem() +} + +type VsanHostVsanDiskInfo struct { + DynamicData + + VsanUuid string `xml:"vsanUuid"` + FormatVersion int32 `xml:"formatVersion"` +} + +func init() { + t["VsanHostVsanDiskInfo"] = reflect.TypeOf((*VsanHostVsanDiskInfo)(nil)).Elem() +} + +type VsanIncompatibleDiskMapping struct { + VsanDiskFault +} + +func init() { + t["VsanIncompatibleDiskMapping"] = reflect.TypeOf((*VsanIncompatibleDiskMapping)(nil)).Elem() +} + +type VsanIncompatibleDiskMappingFault VsanIncompatibleDiskMapping + +func init() { + t["VsanIncompatibleDiskMappingFault"] = reflect.TypeOf((*VsanIncompatibleDiskMappingFault)(nil)).Elem() +} + +type VsanNewPolicyBatch struct { + DynamicData + + Size []int64 `xml:"size,omitempty"` + Policy string `xml:"policy,omitempty"` +} + +func init() { + t["VsanNewPolicyBatch"] = reflect.TypeOf((*VsanNewPolicyBatch)(nil)).Elem() +} + +type VsanPolicyChangeBatch struct { + DynamicData + + Uuid []string `xml:"uuid,omitempty"` + Policy string `xml:"policy,omitempty"` +} + +func init() { + t["VsanPolicyChangeBatch"] = reflect.TypeOf((*VsanPolicyChangeBatch)(nil)).Elem() +} + +type VsanPolicyCost struct { + DynamicData + + ChangeDataSize int64 `xml:"changeDataSize,omitempty"` + CurrentDataSize int64 `xml:"currentDataSize,omitempty"` + TempDataSize int64 `xml:"tempDataSize,omitempty"` + CopyDataSize int64 `xml:"copyDataSize,omitempty"` + ChangeFlashReadCacheSize int64 `xml:"changeFlashReadCacheSize,omitempty"` + CurrentFlashReadCacheSize int64 `xml:"currentFlashReadCacheSize,omitempty"` + CurrentDiskSpaceToAddressSpaceRatio float32 `xml:"currentDiskSpaceToAddressSpaceRatio,omitempty"` + DiskSpaceToAddressSpaceRatio float32 `xml:"diskSpaceToAddressSpaceRatio,omitempty"` +} + +func init() { + t["VsanPolicyCost"] = reflect.TypeOf((*VsanPolicyCost)(nil)).Elem() +} + +type VsanPolicySatisfiability struct { + DynamicData + + Uuid string `xml:"uuid,omitempty"` + IsSatisfiable bool `xml:"isSatisfiable"` + Reason *LocalizableMessage `xml:"reason,omitempty"` + Cost *VsanPolicyCost `xml:"cost,omitempty"` +} + +func init() { + t["VsanPolicySatisfiability"] = reflect.TypeOf((*VsanPolicySatisfiability)(nil)).Elem() +} + +type VsanUpgradeSystemAPIBrokenIssue struct { + VsanUpgradeSystemPreflightCheckIssue + + Hosts []ManagedObjectReference `xml:"hosts"` +} + +func init() { + t["VsanUpgradeSystemAPIBrokenIssue"] = reflect.TypeOf((*VsanUpgradeSystemAPIBrokenIssue)(nil)).Elem() +} + +type VsanUpgradeSystemAutoClaimEnabledOnHostsIssue struct { + VsanUpgradeSystemPreflightCheckIssue + + Hosts []ManagedObjectReference `xml:"hosts"` +} + +func init() { + t["VsanUpgradeSystemAutoClaimEnabledOnHostsIssue"] = reflect.TypeOf((*VsanUpgradeSystemAutoClaimEnabledOnHostsIssue)(nil)).Elem() +} + +type VsanUpgradeSystemHostsDisconnectedIssue struct { + VsanUpgradeSystemPreflightCheckIssue + + Hosts []ManagedObjectReference `xml:"hosts"` +} + +func init() { + t["VsanUpgradeSystemHostsDisconnectedIssue"] = reflect.TypeOf((*VsanUpgradeSystemHostsDisconnectedIssue)(nil)).Elem() +} + +type VsanUpgradeSystemMissingHostsInClusterIssue struct { + VsanUpgradeSystemPreflightCheckIssue + + Hosts []ManagedObjectReference `xml:"hosts"` +} + +func init() { + t["VsanUpgradeSystemMissingHostsInClusterIssue"] = reflect.TypeOf((*VsanUpgradeSystemMissingHostsInClusterIssue)(nil)).Elem() +} + +type VsanUpgradeSystemNetworkPartitionInfo struct { + DynamicData + + Hosts []ManagedObjectReference `xml:"hosts"` +} + +func init() { + t["VsanUpgradeSystemNetworkPartitionInfo"] = reflect.TypeOf((*VsanUpgradeSystemNetworkPartitionInfo)(nil)).Elem() +} + +type VsanUpgradeSystemNetworkPartitionIssue struct { + VsanUpgradeSystemPreflightCheckIssue + + Partitions []VsanUpgradeSystemNetworkPartitionInfo `xml:"partitions"` +} + +func init() { + t["VsanUpgradeSystemNetworkPartitionIssue"] = reflect.TypeOf((*VsanUpgradeSystemNetworkPartitionIssue)(nil)).Elem() +} + +type VsanUpgradeSystemNotEnoughFreeCapacityIssue struct { + VsanUpgradeSystemPreflightCheckIssue + + ReducedRedundancyUpgradePossible bool `xml:"reducedRedundancyUpgradePossible"` +} + +func init() { + t["VsanUpgradeSystemNotEnoughFreeCapacityIssue"] = reflect.TypeOf((*VsanUpgradeSystemNotEnoughFreeCapacityIssue)(nil)).Elem() +} + +type VsanUpgradeSystemPreflightCheckIssue struct { + DynamicData + + Msg string `xml:"msg"` +} + +func init() { + t["VsanUpgradeSystemPreflightCheckIssue"] = reflect.TypeOf((*VsanUpgradeSystemPreflightCheckIssue)(nil)).Elem() +} + +type VsanUpgradeSystemPreflightCheckResult struct { + DynamicData + + Issues []BaseVsanUpgradeSystemPreflightCheckIssue `xml:"issues,omitempty,typeattr"` + DiskMappingToRestore *VsanHostDiskMapping `xml:"diskMappingToRestore,omitempty"` +} + +func init() { + t["VsanUpgradeSystemPreflightCheckResult"] = reflect.TypeOf((*VsanUpgradeSystemPreflightCheckResult)(nil)).Elem() +} + +type VsanUpgradeSystemRogueHostsInClusterIssue struct { + VsanUpgradeSystemPreflightCheckIssue + + Uuids []string `xml:"uuids"` +} + +func init() { + t["VsanUpgradeSystemRogueHostsInClusterIssue"] = reflect.TypeOf((*VsanUpgradeSystemRogueHostsInClusterIssue)(nil)).Elem() +} + +type VsanUpgradeSystemUpgradeHistoryDiskGroupOp struct { + VsanUpgradeSystemUpgradeHistoryItem + + Operation string `xml:"operation"` + DiskMapping VsanHostDiskMapping `xml:"diskMapping"` +} + +func init() { + t["VsanUpgradeSystemUpgradeHistoryDiskGroupOp"] = reflect.TypeOf((*VsanUpgradeSystemUpgradeHistoryDiskGroupOp)(nil)).Elem() +} + +type VsanUpgradeSystemUpgradeHistoryItem struct { + DynamicData + + Timestamp time.Time `xml:"timestamp"` + Host *ManagedObjectReference `xml:"host,omitempty"` + Message string `xml:"message"` + Task *ManagedObjectReference `xml:"task,omitempty"` +} + +func init() { + t["VsanUpgradeSystemUpgradeHistoryItem"] = reflect.TypeOf((*VsanUpgradeSystemUpgradeHistoryItem)(nil)).Elem() +} + +type VsanUpgradeSystemUpgradeHistoryPreflightFail struct { + VsanUpgradeSystemUpgradeHistoryItem + + PreflightResult VsanUpgradeSystemPreflightCheckResult `xml:"preflightResult"` +} + +func init() { + t["VsanUpgradeSystemUpgradeHistoryPreflightFail"] = reflect.TypeOf((*VsanUpgradeSystemUpgradeHistoryPreflightFail)(nil)).Elem() +} + +type VsanUpgradeSystemUpgradeStatus struct { + DynamicData + + InProgress bool `xml:"inProgress"` + History []BaseVsanUpgradeSystemUpgradeHistoryItem `xml:"history,omitempty,typeattr"` + Aborted *bool `xml:"aborted"` + Completed *bool `xml:"completed"` + Progress int32 `xml:"progress,omitempty"` +} + +func init() { + t["VsanUpgradeSystemUpgradeStatus"] = reflect.TypeOf((*VsanUpgradeSystemUpgradeStatus)(nil)).Elem() +} + +type VsanUpgradeSystemV2ObjectsPresentDuringDowngradeIssue struct { + VsanUpgradeSystemPreflightCheckIssue + + Uuids []string `xml:"uuids"` +} + +func init() { + t["VsanUpgradeSystemV2ObjectsPresentDuringDowngradeIssue"] = reflect.TypeOf((*VsanUpgradeSystemV2ObjectsPresentDuringDowngradeIssue)(nil)).Elem() +} + +type VsanUpgradeSystemWrongEsxVersionIssue struct { + VsanUpgradeSystemPreflightCheckIssue + + Hosts []ManagedObjectReference `xml:"hosts"` +} + +func init() { + t["VsanUpgradeSystemWrongEsxVersionIssue"] = reflect.TypeOf((*VsanUpgradeSystemWrongEsxVersionIssue)(nil)).Elem() +} + +type VspanDestPortConflict struct { + DvsFault + + VspanSessionKey1 string `xml:"vspanSessionKey1"` + VspanSessionKey2 string `xml:"vspanSessionKey2"` + PortKey string `xml:"portKey"` +} + +func init() { + t["VspanDestPortConflict"] = reflect.TypeOf((*VspanDestPortConflict)(nil)).Elem() +} + +type VspanDestPortConflictFault VspanDestPortConflict + +func init() { + t["VspanDestPortConflictFault"] = reflect.TypeOf((*VspanDestPortConflictFault)(nil)).Elem() +} + +type VspanPortConflict struct { + DvsFault + + VspanSessionKey1 string `xml:"vspanSessionKey1"` + VspanSessionKey2 string `xml:"vspanSessionKey2"` + PortKey string `xml:"portKey"` +} + +func init() { + t["VspanPortConflict"] = reflect.TypeOf((*VspanPortConflict)(nil)).Elem() +} + +type VspanPortConflictFault VspanPortConflict + +func init() { + t["VspanPortConflictFault"] = reflect.TypeOf((*VspanPortConflictFault)(nil)).Elem() +} + +type VspanPortMoveFault struct { + DvsFault + + SrcPortgroupName string `xml:"srcPortgroupName"` + DestPortgroupName string `xml:"destPortgroupName"` + PortKey string `xml:"portKey"` +} + +func init() { + t["VspanPortMoveFault"] = reflect.TypeOf((*VspanPortMoveFault)(nil)).Elem() +} + +type VspanPortMoveFaultFault VspanPortMoveFault + +func init() { + t["VspanPortMoveFaultFault"] = reflect.TypeOf((*VspanPortMoveFaultFault)(nil)).Elem() +} + +type VspanPortPromiscChangeFault struct { + DvsFault + + PortKey string `xml:"portKey"` +} + +func init() { + t["VspanPortPromiscChangeFault"] = reflect.TypeOf((*VspanPortPromiscChangeFault)(nil)).Elem() +} + +type VspanPortPromiscChangeFaultFault VspanPortPromiscChangeFault + +func init() { + t["VspanPortPromiscChangeFaultFault"] = reflect.TypeOf((*VspanPortPromiscChangeFaultFault)(nil)).Elem() +} + +type VspanPortgroupPromiscChangeFault struct { + DvsFault + + PortgroupName string `xml:"portgroupName"` +} + +func init() { + t["VspanPortgroupPromiscChangeFault"] = reflect.TypeOf((*VspanPortgroupPromiscChangeFault)(nil)).Elem() +} + +type VspanPortgroupPromiscChangeFaultFault VspanPortgroupPromiscChangeFault + +func init() { + t["VspanPortgroupPromiscChangeFaultFault"] = reflect.TypeOf((*VspanPortgroupPromiscChangeFaultFault)(nil)).Elem() +} + +type VspanPortgroupTypeChangeFault struct { + DvsFault + + PortgroupName string `xml:"portgroupName"` +} + +func init() { + t["VspanPortgroupTypeChangeFault"] = reflect.TypeOf((*VspanPortgroupTypeChangeFault)(nil)).Elem() +} + +type VspanPortgroupTypeChangeFaultFault VspanPortgroupTypeChangeFault + +func init() { + t["VspanPortgroupTypeChangeFaultFault"] = reflect.TypeOf((*VspanPortgroupTypeChangeFaultFault)(nil)).Elem() +} + +type VspanPromiscuousPortNotSupported struct { + DvsFault + + VspanSessionKey string `xml:"vspanSessionKey"` + PortKey string `xml:"portKey"` +} + +func init() { + t["VspanPromiscuousPortNotSupported"] = reflect.TypeOf((*VspanPromiscuousPortNotSupported)(nil)).Elem() +} + +type VspanPromiscuousPortNotSupportedFault VspanPromiscuousPortNotSupported + +func init() { + t["VspanPromiscuousPortNotSupportedFault"] = reflect.TypeOf((*VspanPromiscuousPortNotSupportedFault)(nil)).Elem() +} + +type VspanSameSessionPortConflict struct { + DvsFault + + VspanSessionKey string `xml:"vspanSessionKey"` + PortKey string `xml:"portKey"` +} + +func init() { + t["VspanSameSessionPortConflict"] = reflect.TypeOf((*VspanSameSessionPortConflict)(nil)).Elem() +} + +type VspanSameSessionPortConflictFault VspanSameSessionPortConflict + +func init() { + t["VspanSameSessionPortConflictFault"] = reflect.TypeOf((*VspanSameSessionPortConflictFault)(nil)).Elem() +} + +type VvolDatastoreInfo struct { + DatastoreInfo + + VvolDS *HostVvolVolume `xml:"vvolDS,omitempty"` +} + +func init() { + t["VvolDatastoreInfo"] = reflect.TypeOf((*VvolDatastoreInfo)(nil)).Elem() +} + +type WaitForUpdates WaitForUpdatesRequestType + +func init() { + t["WaitForUpdates"] = reflect.TypeOf((*WaitForUpdates)(nil)).Elem() +} + +type WaitForUpdatesEx WaitForUpdatesExRequestType + +func init() { + t["WaitForUpdatesEx"] = reflect.TypeOf((*WaitForUpdatesEx)(nil)).Elem() +} + +type WaitForUpdatesExRequestType struct { + This ManagedObjectReference `xml:"_this"` + Version string `xml:"version,omitempty"` + Options *WaitOptions `xml:"options,omitempty"` +} + +func init() { + t["WaitForUpdatesExRequestType"] = reflect.TypeOf((*WaitForUpdatesExRequestType)(nil)).Elem() +} + +type WaitForUpdatesExResponse struct { + Returnval *UpdateSet `xml:"returnval,omitempty"` +} + +type WaitForUpdatesRequestType struct { + This ManagedObjectReference `xml:"_this"` + Version string `xml:"version,omitempty"` +} + +func init() { + t["WaitForUpdatesRequestType"] = reflect.TypeOf((*WaitForUpdatesRequestType)(nil)).Elem() +} + +type WaitForUpdatesResponse struct { + Returnval UpdateSet `xml:"returnval"` +} + +type WaitOptions struct { + DynamicData + + MaxWaitSeconds int32 `xml:"maxWaitSeconds,omitempty"` + MaxObjectUpdates int32 `xml:"maxObjectUpdates,omitempty"` +} + +func init() { + t["WaitOptions"] = reflect.TypeOf((*WaitOptions)(nil)).Elem() +} + +type WakeOnLanNotSupported struct { + VirtualHardwareCompatibilityIssue +} + +func init() { + t["WakeOnLanNotSupported"] = reflect.TypeOf((*WakeOnLanNotSupported)(nil)).Elem() +} + +type WakeOnLanNotSupportedByVmotionNIC struct { + HostPowerOpFailed +} + +func init() { + t["WakeOnLanNotSupportedByVmotionNIC"] = reflect.TypeOf((*WakeOnLanNotSupportedByVmotionNIC)(nil)).Elem() +} + +type WakeOnLanNotSupportedByVmotionNICFault WakeOnLanNotSupportedByVmotionNIC + +func init() { + t["WakeOnLanNotSupportedByVmotionNICFault"] = reflect.TypeOf((*WakeOnLanNotSupportedByVmotionNICFault)(nil)).Elem() +} + +type WakeOnLanNotSupportedFault WakeOnLanNotSupported + +func init() { + t["WakeOnLanNotSupportedFault"] = reflect.TypeOf((*WakeOnLanNotSupportedFault)(nil)).Elem() +} + +type WarningUpgradeEvent struct { + UpgradeEvent +} + +func init() { + t["WarningUpgradeEvent"] = reflect.TypeOf((*WarningUpgradeEvent)(nil)).Elem() +} + +type WeeklyTaskScheduler struct { + DailyTaskScheduler + + Sunday bool `xml:"sunday"` + Monday bool `xml:"monday"` + Tuesday bool `xml:"tuesday"` + Wednesday bool `xml:"wednesday"` + Thursday bool `xml:"thursday"` + Friday bool `xml:"friday"` + Saturday bool `xml:"saturday"` +} + +func init() { + t["WeeklyTaskScheduler"] = reflect.TypeOf((*WeeklyTaskScheduler)(nil)).Elem() +} + +type WillLoseHAProtection struct { + MigrationFault + + Resolution string `xml:"resolution"` +} + +func init() { + t["WillLoseHAProtection"] = reflect.TypeOf((*WillLoseHAProtection)(nil)).Elem() +} + +type WillLoseHAProtectionFault WillLoseHAProtection + +func init() { + t["WillLoseHAProtectionFault"] = reflect.TypeOf((*WillLoseHAProtectionFault)(nil)).Elem() +} + +type WillModifyConfigCpuRequirements struct { + MigrationFault +} + +func init() { + t["WillModifyConfigCpuRequirements"] = reflect.TypeOf((*WillModifyConfigCpuRequirements)(nil)).Elem() +} + +type WillModifyConfigCpuRequirementsFault WillModifyConfigCpuRequirements + +func init() { + t["WillModifyConfigCpuRequirementsFault"] = reflect.TypeOf((*WillModifyConfigCpuRequirementsFault)(nil)).Elem() +} + +type WillResetSnapshotDirectory struct { + MigrationFault +} + +func init() { + t["WillResetSnapshotDirectory"] = reflect.TypeOf((*WillResetSnapshotDirectory)(nil)).Elem() +} + +type WillResetSnapshotDirectoryFault WillResetSnapshotDirectory + +func init() { + t["WillResetSnapshotDirectoryFault"] = reflect.TypeOf((*WillResetSnapshotDirectoryFault)(nil)).Elem() +} + +type WinNetBIOSConfigInfo struct { + NetBIOSConfigInfo + + PrimaryWINS string `xml:"primaryWINS"` + SecondaryWINS string `xml:"secondaryWINS,omitempty"` +} + +func init() { + t["WinNetBIOSConfigInfo"] = reflect.TypeOf((*WinNetBIOSConfigInfo)(nil)).Elem() +} + +type WipeDiskFault struct { + VimFault +} + +func init() { + t["WipeDiskFault"] = reflect.TypeOf((*WipeDiskFault)(nil)).Elem() +} + +type WipeDiskFaultFault WipeDiskFault + +func init() { + t["WipeDiskFaultFault"] = reflect.TypeOf((*WipeDiskFaultFault)(nil)).Elem() +} + +type XmlToCustomizationSpecItem XmlToCustomizationSpecItemRequestType + +func init() { + t["XmlToCustomizationSpecItem"] = reflect.TypeOf((*XmlToCustomizationSpecItem)(nil)).Elem() +} + +type XmlToCustomizationSpecItemRequestType struct { + This ManagedObjectReference `xml:"_this"` + SpecItemXml string `xml:"specItemXml"` +} + +func init() { + t["XmlToCustomizationSpecItemRequestType"] = reflect.TypeOf((*XmlToCustomizationSpecItemRequestType)(nil)).Elem() +} + +type XmlToCustomizationSpecItemResponse struct { + Returnval CustomizationSpecItem `xml:"returnval"` +} + +type ZeroFillVirtualDiskRequestType struct { + This ManagedObjectReference `xml:"_this"` + Name string `xml:"name"` + Datacenter *ManagedObjectReference `xml:"datacenter,omitempty"` +} + +func init() { + t["ZeroFillVirtualDiskRequestType"] = reflect.TypeOf((*ZeroFillVirtualDiskRequestType)(nil)).Elem() +} + +type ZeroFillVirtualDisk_Task ZeroFillVirtualDiskRequestType + +func init() { + t["ZeroFillVirtualDisk_Task"] = reflect.TypeOf((*ZeroFillVirtualDisk_Task)(nil)).Elem() +} + +type ZeroFillVirtualDisk_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/vim25/types/types_test.go juju-core-2.0.2/src/github.com/vmware/govmomi/vim25/types/types_test.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/vim25/types/types_test.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/vim25/types/types_test.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,92 @@ +/* +Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package types + +import ( + "testing" + + "github.com/vmware/govmomi/vim25/xml" +) + +func TestVirtualMachineConfigSpec(t *testing.T) { + spec := VirtualMachineConfigSpec{ + Name: "vm-001", + GuestId: "otherGuest", + Files: &VirtualMachineFileInfo{VmPathName: "[datastore1]"}, + NumCPUs: 1, + MemoryMB: 128, + DeviceChange: []BaseVirtualDeviceConfigSpec{ + &VirtualDeviceConfigSpec{ + Operation: VirtualDeviceConfigSpecOperationAdd, + Device: &VirtualLsiLogicController{VirtualSCSIController{ + SharedBus: VirtualSCSISharingNoSharing, + VirtualController: VirtualController{ + BusNumber: 0, + VirtualDevice: VirtualDevice{ + Key: 1000, + }, + }, + }}, + }, + &VirtualDeviceConfigSpec{ + Operation: VirtualDeviceConfigSpecOperationAdd, + FileOperation: VirtualDeviceConfigSpecFileOperationCreate, + Device: &VirtualDisk{ + VirtualDevice: VirtualDevice{ + Key: 0, + ControllerKey: 1000, + UnitNumber: new(int32), // zero default value + Backing: &VirtualDiskFlatVer2BackingInfo{ + DiskMode: string(VirtualDiskModePersistent), + ThinProvisioned: NewBool(true), + VirtualDeviceFileBackingInfo: VirtualDeviceFileBackingInfo{ + FileName: "[datastore1]", + }, + }, + }, + CapacityInKB: 4000000, + }, + }, + &VirtualDeviceConfigSpec{ + Operation: VirtualDeviceConfigSpecOperationAdd, + Device: &VirtualE1000{VirtualEthernetCard{ + VirtualDevice: VirtualDevice{ + Key: 0, + DeviceInfo: &Description{ + Label: "Network Adapter 1", + Summary: "VM Network", + }, + Backing: &VirtualEthernetCardNetworkBackingInfo{ + VirtualDeviceDeviceBackingInfo: VirtualDeviceDeviceBackingInfo{ + DeviceName: "VM Network", + }, + }, + }, + AddressType: string(VirtualEthernetCardMacTypeGenerated), + }}, + }, + }, + ExtraConfig: []BaseOptionValue{ + &OptionValue{Key: "bios.bootOrder", Value: "ethernet0"}, + }, + } + + _, err := xml.MarshalIndent(spec, "", " ") + if err != nil { + t.Fatal(err) + } +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/vim25/xml/atom_test.go juju-core-2.0.2/src/github.com/vmware/govmomi/vim25/xml/atom_test.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/vim25/xml/atom_test.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/vim25/xml/atom_test.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,56 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package xml + +import "time" + +var atomValue = &Feed{ + XMLName: Name{"http://www.w3.org/2005/Atom", "feed"}, + Title: "Example Feed", + Link: []Link{{Href: "http://example.org/"}}, + Updated: ParseTime("2003-12-13T18:30:02Z"), + Author: Person{Name: "John Doe"}, + Id: "urn:uuid:60a76c80-d399-11d9-b93C-0003939e0af6", + + Entry: []Entry{ + { + Title: "Atom-Powered Robots Run Amok", + Link: []Link{{Href: "http://example.org/2003/12/13/atom03"}}, + Id: "urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a", + Updated: ParseTime("2003-12-13T18:30:02Z"), + Summary: NewText("Some text."), + }, + }, +} + +var atomXml = `` + + `` + + `Example Feed` + + `urn:uuid:60a76c80-d399-11d9-b93C-0003939e0af6` + + `` + + `John Doe` + + `` + + `Atom-Powered Robots Run Amok` + + `urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a` + + `` + + `2003-12-13T18:30:02Z` + + `` + + `Some text.` + + `` + + `` + +func ParseTime(str string) time.Time { + t, err := time.Parse(time.RFC3339, str) + if err != nil { + panic(err) + } + return t +} + +func NewText(text string) Text { + return Text{ + Body: text, + } +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/vim25/xml/example_test.go juju-core-2.0.2/src/github.com/vmware/govmomi/vim25/xml/example_test.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/vim25/xml/example_test.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/vim25/xml/example_test.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,151 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package xml_test + +import ( + "encoding/xml" + "fmt" + "os" +) + +func ExampleMarshalIndent() { + type Address struct { + City, State string + } + type Person struct { + XMLName xml.Name `xml:"person"` + Id int `xml:"id,attr"` + FirstName string `xml:"name>first"` + LastName string `xml:"name>last"` + Age int `xml:"age"` + Height float32 `xml:"height,omitempty"` + Married bool + Address + Comment string `xml:",comment"` + } + + v := &Person{Id: 13, FirstName: "John", LastName: "Doe", Age: 42} + v.Comment = " Need more details. " + v.Address = Address{"Hanga Roa", "Easter Island"} + + output, err := xml.MarshalIndent(v, " ", " ") + if err != nil { + fmt.Printf("error: %v\n", err) + } + + os.Stdout.Write(output) + // Output: + // + // + // John + // Doe + // + // 42 + // false + // Hanga Roa + // Easter Island + // + // +} + +func ExampleEncoder() { + type Address struct { + City, State string + } + type Person struct { + XMLName xml.Name `xml:"person"` + Id int `xml:"id,attr"` + FirstName string `xml:"name>first"` + LastName string `xml:"name>last"` + Age int `xml:"age"` + Height float32 `xml:"height,omitempty"` + Married bool + Address + Comment string `xml:",comment"` + } + + v := &Person{Id: 13, FirstName: "John", LastName: "Doe", Age: 42} + v.Comment = " Need more details. " + v.Address = Address{"Hanga Roa", "Easter Island"} + + enc := xml.NewEncoder(os.Stdout) + enc.Indent(" ", " ") + if err := enc.Encode(v); err != nil { + fmt.Printf("error: %v\n", err) + } + + // Output: + // + // + // John + // Doe + // + // 42 + // false + // Hanga Roa + // Easter Island + // + // +} + +// This example demonstrates unmarshaling an XML excerpt into a value with +// some preset fields. Note that the Phone field isn't modified and that +// the XML element is ignored. Also, the Groups field is assigned +// considering the element path provided in its tag. +func ExampleUnmarshal() { + type Email struct { + Where string `xml:"where,attr"` + Addr string + } + type Address struct { + City, State string + } + type Result struct { + XMLName xml.Name `xml:"Person"` + Name string `xml:"FullName"` + Phone string + Email []Email + Groups []string `xml:"Group>Value"` + Address + } + v := Result{Name: "none", Phone: "none"} + + data := ` + + Grace R. Emlin + Example Inc. + + gre@example.com + + + gre@work.com + + + Friends + Squash + + Hanga Roa + Easter Island + + ` + err := xml.Unmarshal([]byte(data), &v) + if err != nil { + fmt.Printf("error: %v", err) + return + } + fmt.Printf("XMLName: %#v\n", v.XMLName) + fmt.Printf("Name: %q\n", v.Name) + fmt.Printf("Phone: %q\n", v.Phone) + fmt.Printf("Email: %v\n", v.Email) + fmt.Printf("Groups: %v\n", v.Groups) + fmt.Printf("Address: %v\n", v.Address) + // Output: + // XMLName: xml.Name{Space:"", Local:"Person"} + // Name: "Grace R. Emlin" + // Phone: "none" + // Email: [{home gre@example.com} {work gre@work.com}] + // Groups: [Friends Squash] + // Address: {Hanga Roa Easter Island} +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/vim25/xml/extras.go juju-core-2.0.2/src/github.com/vmware/govmomi/vim25/xml/extras.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/vim25/xml/extras.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/vim25/xml/extras.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,93 @@ +/* +Copyright (c) 2014 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package xml + +import ( + "reflect" + "time" +) + +var xmlSchemaInstance = Name{Space: "http://www.w3.org/2001/XMLSchema-instance", Local: "type"} + +var stringToTypeMap = map[string]reflect.Type{ + "xsd:boolean": reflect.TypeOf((*bool)(nil)).Elem(), + "xsd:byte": reflect.TypeOf((*int8)(nil)).Elem(), + "xsd:short": reflect.TypeOf((*int16)(nil)).Elem(), + "xsd:int": reflect.TypeOf((*int32)(nil)).Elem(), + "xsd:long": reflect.TypeOf((*int64)(nil)).Elem(), + "xsd:unsignedByte": reflect.TypeOf((*uint8)(nil)).Elem(), + "xsd:unsignedShort": reflect.TypeOf((*uint16)(nil)).Elem(), + "xsd:unsignedInt": reflect.TypeOf((*uint32)(nil)).Elem(), + "xsd:unsignedLong": reflect.TypeOf((*uint64)(nil)).Elem(), + "xsd:float": reflect.TypeOf((*float32)(nil)).Elem(), + "xsd:double": reflect.TypeOf((*float64)(nil)).Elem(), + "xsd:string": reflect.TypeOf((*string)(nil)).Elem(), + "xsd:dateTime": reflect.TypeOf((*time.Time)(nil)).Elem(), + "xsd:base64Binary": reflect.TypeOf((*[]byte)(nil)).Elem(), +} + +// Return a reflect.Type for the specified type. Nil if unknown. +func stringToType(s string) reflect.Type { + return stringToTypeMap[s] +} + +// Return a string for the specified reflect.Type. Panic if unknown. +func typeToString(typ reflect.Type) string { + switch typ.Kind() { + case reflect.Bool: + return "xsd:boolean" + case reflect.Int8: + return "xsd:byte" + case reflect.Int16: + return "xsd:short" + case reflect.Int32: + return "xsd:int" + case reflect.Int, reflect.Int64: + return "xsd:long" + case reflect.Uint8: + return "xsd:unsignedByte" + case reflect.Uint16: + return "xsd:unsignedShort" + case reflect.Uint32: + return "xsd:unsignedInt" + case reflect.Uint, reflect.Uint64: + return "xsd:unsignedLong" + case reflect.Float32: + return "xsd:float" + case reflect.Float64: + return "xsd:double" + case reflect.String: + return "xsd:string" + case reflect.Struct: + if typ == stringToTypeMap["xsd:dateTime"] { + return "xsd:dateTime" + } + + // Expect any other struct to be handled... + return typ.Name() + case reflect.Slice: + if typ.Elem().Kind() == reflect.Uint8 { + return "xsd:base64Binary" + } + case reflect.Array: + if typ.Elem().Kind() == reflect.Uint8 { + return "xsd:base64Binary" + } + } + + panic("don't know what to do for type: " + typ.String()) +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/vim25/xml/extras_test.go juju-core-2.0.2/src/github.com/vmware/govmomi/vim25/xml/extras_test.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/vim25/xml/extras_test.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/vim25/xml/extras_test.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,222 @@ +/* +Copyright (c) 2014 VMware, Inc. All Rights Reserved. + +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, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package xml + +import ( + "bytes" + "reflect" + "testing" + "time" +) + +type MyType struct { + Value string +} + +var myTypes = map[string]reflect.Type{ + "MyType": reflect.TypeOf(MyType{}), + "ValueType": reflect.TypeOf(ValueType{}), + "PointerType": reflect.TypeOf(PointerType{}), +} + +func MyTypes(name string) (reflect.Type, bool) { + t, ok := myTypes[name] + return t, ok +} + +func TestMarshalWithEmptyInterface(t *testing.T) { + var r1, r2 struct { + XMLName Name `xml:"root"` + Values []interface{} `xml:"value,typeattr"` + } + + var tests = []struct { + Value interface{} + }{ + {Value: bool(true)}, + {Value: int8(-8)}, + {Value: int16(-16)}, + {Value: int32(-32)}, + {Value: int64(-64)}, + {Value: uint8(8)}, + {Value: uint16(16)}, + {Value: uint32(32)}, + {Value: uint64(64)}, + {Value: float32(32.0)}, + {Value: float64(64.0)}, + {Value: string("string")}, + {Value: time.Now()}, + {Value: ParseTime("2009-10-04T01:35:58+00:00")}, + {Value: []byte("bytes")}, + {Value: MyType{Value: "v"}}, + } + + for _, test := range tests { + r1.XMLName.Local = "root" + r1.Values = []interface{}{test.Value} + r2.XMLName = Name{} + r2.Values = nil + + b, err := Marshal(r1) + if err != nil { + t.Fatalf("Marshal: %s", err) + } + + dec := NewDecoder(bytes.NewReader(b)) + dec.TypeFunc = MyTypes + err = dec.Decode(&r2) + if err != nil { + t.Fatalf("Unmarshal: %s", err) + } + + switch r1.Values[0].(type) { + case time.Time: + if !r1.Values[0].(time.Time).Equal(r2.Values[0].(time.Time)) { + t.Errorf("Expected: %#v, actual: %#v", r1, r2) + } + default: + if !reflect.DeepEqual(r1, r2) { + t.Errorf("Expected: %#v, actual: %#v", r1, r2) + } + } + } +} + +type VIntf interface { + V() string +} + +type ValueType struct { + Value string `xml:",chardata"` +} + +type PointerType struct { + Value string `xml:",chardata"` +} + +func (t ValueType) V() string { + return t.Value +} + +func (t *PointerType) V() string { + return t.Value +} + +func TestMarshalWithInterface(t *testing.T) { + var r1, r2 struct { + XMLName Name `xml:"root"` + Values []VIntf `xml:"value,typeattr"` + } + + r1.XMLName.Local = "root" + r1.Values = []VIntf{ + ValueType{"v1"}, + &PointerType{"v2"}, + } + + b, err := Marshal(r1) + if err != nil { + t.Fatalf("Marshal: %s", err) + } + + dec := NewDecoder(bytes.NewReader(b)) + dec.TypeFunc = MyTypes + err = dec.Decode(&r2) + if err != nil { + t.Fatalf("Unmarshal: %s", err) + } + + if !reflect.DeepEqual(r1, r2) { + t.Errorf("expected: %#v, actual: %#v", r1, r2) + } +} + +type test3iface interface { + Value() string +} + +type test3a struct { + V string `xml:",chardata"` +} + +func (t test3a) Value() string { return t.V } + +type test3b struct { + V string `xml:",chardata"` +} + +func (t test3b) Value() string { return t.V } + +func TestUnmarshalInterfaceWithoutTypeAttr(t *testing.T) { + var r struct { + XMLName Name `xml:"root"` + Values []test3iface `xml:"value,typeattr"` + } + + b := ` + + A + B + + ` + + fn := func(name string) (reflect.Type, bool) { + switch name { + case "test3a": + return reflect.TypeOf(test3a{}), true + case "test3iface": + return reflect.TypeOf(test3b{}), true + default: + return nil, false + } + } + + dec := NewDecoder(bytes.NewReader([]byte(b))) + dec.TypeFunc = fn + err := dec.Decode(&r) + if err != nil { + t.Fatalf("Unmarshal: %s", err) + } + + if len(r.Values) != 2 { + t.Errorf("Expected 2 values") + } + + exps := []struct { + Typ reflect.Type + Val string + }{ + { + Typ: reflect.TypeOf(test3a{}), + Val: "A", + }, + { + Typ: reflect.TypeOf(test3b{}), + Val: "B", + }, + } + + for i, e := range exps { + if val := r.Values[i].Value(); val != e.Val { + t.Errorf("Expected: %s, got: %s", e.Val, val) + } + + if typ := reflect.TypeOf(r.Values[i]); typ.Name() != e.Typ.Name() { + t.Errorf("Expected: %s, got: %s", e.Typ.Name(), typ.Name()) + } + } +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/vim25/xml/LICENSE juju-core-2.0.2/src/github.com/vmware/govmomi/vim25/xml/LICENSE --- juju-core-2.0.0/src/github.com/vmware/govmomi/vim25/xml/LICENSE 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/vim25/xml/LICENSE 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,27 @@ +Copyright (c) 2012 The Go Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/vim25/xml/marshal.go juju-core-2.0.2/src/github.com/vmware/govmomi/vim25/xml/marshal.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/vim25/xml/marshal.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/vim25/xml/marshal.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,949 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package xml + +import ( + "bufio" + "bytes" + "encoding" + "fmt" + "io" + "reflect" + "strconv" + "strings" +) + +const ( + // A generic XML header suitable for use with the output of Marshal. + // This is not automatically added to any output of this package, + // it is provided as a convenience. + Header = `` + "\n" +) + +// Marshal returns the XML encoding of v. +// +// Marshal handles an array or slice by marshalling each of the elements. +// Marshal handles a pointer by marshalling the value it points at or, if the +// pointer is nil, by writing nothing. Marshal handles an interface value by +// marshalling the value it contains or, if the interface value is nil, by +// writing nothing. Marshal handles all other data by writing one or more XML +// elements containing the data. +// +// The name for the XML elements is taken from, in order of preference: +// - the tag on the XMLName field, if the data is a struct +// - the value of the XMLName field of type xml.Name +// - the tag of the struct field used to obtain the data +// - the name of the struct field used to obtain the data +// - the name of the marshalled type +// +// The XML element for a struct contains marshalled elements for each of the +// exported fields of the struct, with these exceptions: +// - the XMLName field, described above, is omitted. +// - a field with tag "-" is omitted. +// - a field with tag "name,attr" becomes an attribute with +// the given name in the XML element. +// - a field with tag ",attr" becomes an attribute with the +// field name in the XML element. +// - a field with tag ",chardata" is written as character data, +// not as an XML element. +// - a field with tag ",innerxml" is written verbatim, not subject +// to the usual marshalling procedure. +// - a field with tag ",comment" is written as an XML comment, not +// subject to the usual marshalling procedure. It must not contain +// the "--" string within it. +// - a field with a tag including the "omitempty" option is omitted +// if the field value is empty. The empty values are false, 0, any +// nil pointer or interface value, and any array, slice, map, or +// string of length zero. +// - an anonymous struct field is handled as if the fields of its +// value were part of the outer struct. +// +// If a field uses a tag "a>b>c", then the element c will be nested inside +// parent elements a and b. Fields that appear next to each other that name +// the same parent will be enclosed in one XML element. +// +// See MarshalIndent for an example. +// +// Marshal will return an error if asked to marshal a channel, function, or map. +func Marshal(v interface{}) ([]byte, error) { + var b bytes.Buffer + if err := NewEncoder(&b).Encode(v); err != nil { + return nil, err + } + return b.Bytes(), nil +} + +// Marshaler is the interface implemented by objects that can marshal +// themselves into valid XML elements. +// +// MarshalXML encodes the receiver as zero or more XML elements. +// By convention, arrays or slices are typically encoded as a sequence +// of elements, one per entry. +// Using start as the element tag is not required, but doing so +// will enable Unmarshal to match the XML elements to the correct +// struct field. +// One common implementation strategy is to construct a separate +// value with a layout corresponding to the desired XML and then +// to encode it using e.EncodeElement. +// Another common strategy is to use repeated calls to e.EncodeToken +// to generate the XML output one token at a time. +// The sequence of encoded tokens must make up zero or more valid +// XML elements. +type Marshaler interface { + MarshalXML(e *Encoder, start StartElement) error +} + +// MarshalerAttr is the interface implemented by objects that can marshal +// themselves into valid XML attributes. +// +// MarshalXMLAttr returns an XML attribute with the encoded value of the receiver. +// Using name as the attribute name is not required, but doing so +// will enable Unmarshal to match the attribute to the correct +// struct field. +// If MarshalXMLAttr returns the zero attribute Attr{}, no attribute +// will be generated in the output. +// MarshalXMLAttr is used only for struct fields with the +// "attr" option in the field tag. +type MarshalerAttr interface { + MarshalXMLAttr(name Name) (Attr, error) +} + +// MarshalIndent works like Marshal, but each XML element begins on a new +// indented line that starts with prefix and is followed by one or more +// copies of indent according to the nesting depth. +func MarshalIndent(v interface{}, prefix, indent string) ([]byte, error) { + var b bytes.Buffer + enc := NewEncoder(&b) + enc.Indent(prefix, indent) + if err := enc.Encode(v); err != nil { + return nil, err + } + return b.Bytes(), nil +} + +// An Encoder writes XML data to an output stream. +type Encoder struct { + p printer +} + +// NewEncoder returns a new encoder that writes to w. +func NewEncoder(w io.Writer) *Encoder { + e := &Encoder{printer{Writer: bufio.NewWriter(w)}} + e.p.encoder = e + return e +} + +// Indent sets the encoder to generate XML in which each element +// begins on a new indented line that starts with prefix and is followed by +// one or more copies of indent according to the nesting depth. +func (enc *Encoder) Indent(prefix, indent string) { + enc.p.prefix = prefix + enc.p.indent = indent +} + +// Encode writes the XML encoding of v to the stream. +// +// See the documentation for Marshal for details about the conversion +// of Go values to XML. +// +// Encode calls Flush before returning. +func (enc *Encoder) Encode(v interface{}) error { + err := enc.p.marshalValue(reflect.ValueOf(v), nil, nil) + if err != nil { + return err + } + return enc.p.Flush() +} + +// EncodeElement writes the XML encoding of v to the stream, +// using start as the outermost tag in the encoding. +// +// See the documentation for Marshal for details about the conversion +// of Go values to XML. +// +// EncodeElement calls Flush before returning. +func (enc *Encoder) EncodeElement(v interface{}, start StartElement) error { + err := enc.p.marshalValue(reflect.ValueOf(v), nil, &start) + if err != nil { + return err + } + return enc.p.Flush() +} + +var ( + endComment = []byte("-->") + endProcInst = []byte("?>") + endDirective = []byte(">") +) + +// EncodeToken writes the given XML token to the stream. +// It returns an error if StartElement and EndElement tokens are not properly matched. +// +// EncodeToken does not call Flush, because usually it is part of a larger operation +// such as Encode or EncodeElement (or a custom Marshaler's MarshalXML invoked +// during those), and those will call Flush when finished. +// Callers that create an Encoder and then invoke EncodeToken directly, without +// using Encode or EncodeElement, need to call Flush when finished to ensure +// that the XML is written to the underlying writer. +// +// EncodeToken allows writing a ProcInst with Target set to "xml" only as the first token +// in the stream. +func (enc *Encoder) EncodeToken(t Token) error { + p := &enc.p + switch t := t.(type) { + case StartElement: + if err := p.writeStart(&t); err != nil { + return err + } + case EndElement: + if err := p.writeEnd(t.Name); err != nil { + return err + } + case CharData: + EscapeText(p, t) + case Comment: + if bytes.Contains(t, endComment) { + return fmt.Errorf("xml: EncodeToken of Comment containing --> marker") + } + p.WriteString("") + return p.cachedWriteError() + case ProcInst: + // First token to be encoded which is also a ProcInst with target of xml + // is the xml declaration. The only ProcInst where target of xml is allowed. + if t.Target == "xml" && p.Buffered() != 0 { + return fmt.Errorf("xml: EncodeToken of ProcInst xml target only valid for xml declaration, first token encoded") + } + if !isNameString(t.Target) { + return fmt.Errorf("xml: EncodeToken of ProcInst with invalid Target") + } + if bytes.Contains(t.Inst, endProcInst) { + return fmt.Errorf("xml: EncodeToken of ProcInst containing ?> marker") + } + p.WriteString(" 0 { + p.WriteByte(' ') + p.Write(t.Inst) + } + p.WriteString("?>") + case Directive: + if bytes.Contains(t, endDirective) { + return fmt.Errorf("xml: EncodeToken of Directive containing > marker") + } + p.WriteString("") + } + return p.cachedWriteError() +} + +// Flush flushes any buffered XML to the underlying writer. +// See the EncodeToken documentation for details about when it is necessary. +func (enc *Encoder) Flush() error { + return enc.p.Flush() +} + +type printer struct { + *bufio.Writer + encoder *Encoder + seq int + indent string + prefix string + depth int + indentedIn bool + putNewline bool + attrNS map[string]string // map prefix -> name space + attrPrefix map[string]string // map name space -> prefix + prefixes []string + tags []Name +} + +// createAttrPrefix finds the name space prefix attribute to use for the given name space, +// defining a new prefix if necessary. It returns the prefix. +func (p *printer) createAttrPrefix(url string) string { + if prefix := p.attrPrefix[url]; prefix != "" { + return prefix + } + + // The "http://www.w3.org/XML/1998/namespace" name space is predefined as "xml" + // and must be referred to that way. + // (The "http://www.w3.org/2000/xmlns/" name space is also predefined as "xmlns", + // but users should not be trying to use that one directly - that's our job.) + if url == xmlURL { + return "xml" + } + + // Need to define a new name space. + if p.attrPrefix == nil { + p.attrPrefix = make(map[string]string) + p.attrNS = make(map[string]string) + } + + // Pick a name. We try to use the final element of the path + // but fall back to _. + prefix := strings.TrimRight(url, "/") + if i := strings.LastIndex(prefix, "/"); i >= 0 { + prefix = prefix[i+1:] + } + if prefix == "" || !isName([]byte(prefix)) || strings.Contains(prefix, ":") { + prefix = "_" + } + if strings.HasPrefix(prefix, "xml") { + // xmlanything is reserved. + prefix = "_" + prefix + } + if p.attrNS[prefix] != "" { + // Name is taken. Find a better one. + for p.seq++; ; p.seq++ { + if id := prefix + "_" + strconv.Itoa(p.seq); p.attrNS[id] == "" { + prefix = id + break + } + } + } + + p.attrPrefix[url] = prefix + p.attrNS[prefix] = url + + p.WriteString(`xmlns:`) + p.WriteString(prefix) + p.WriteString(`="`) + EscapeText(p, []byte(url)) + p.WriteString(`" `) + + p.prefixes = append(p.prefixes, prefix) + + return prefix +} + +// deleteAttrPrefix removes an attribute name space prefix. +func (p *printer) deleteAttrPrefix(prefix string) { + delete(p.attrPrefix, p.attrNS[prefix]) + delete(p.attrNS, prefix) +} + +func (p *printer) markPrefix() { + p.prefixes = append(p.prefixes, "") +} + +func (p *printer) popPrefix() { + for len(p.prefixes) > 0 { + prefix := p.prefixes[len(p.prefixes)-1] + p.prefixes = p.prefixes[:len(p.prefixes)-1] + if prefix == "" { + break + } + p.deleteAttrPrefix(prefix) + } +} + +var ( + marshalerType = reflect.TypeOf((*Marshaler)(nil)).Elem() + marshalerAttrType = reflect.TypeOf((*MarshalerAttr)(nil)).Elem() + textMarshalerType = reflect.TypeOf((*encoding.TextMarshaler)(nil)).Elem() +) + +// marshalValue writes one or more XML elements representing val. +// If val was obtained from a struct field, finfo must have its details. +func (p *printer) marshalValue(val reflect.Value, finfo *fieldInfo, startTemplate *StartElement) error { + if startTemplate != nil && startTemplate.Name.Local == "" { + return fmt.Errorf("xml: EncodeElement of StartElement with missing name") + } + + if !val.IsValid() { + return nil + } + if finfo != nil && finfo.flags&fOmitEmpty != 0 && isEmptyValue(val) { + return nil + } + + // Drill into interfaces and pointers. + // This can turn into an infinite loop given a cyclic chain, + // but it matches the Go 1 behavior. + for val.Kind() == reflect.Interface || val.Kind() == reflect.Ptr { + if val.IsNil() { + return nil + } + val = val.Elem() + } + + kind := val.Kind() + typ := val.Type() + + // Check for marshaler. + if val.CanInterface() && typ.Implements(marshalerType) { + return p.marshalInterface(val.Interface().(Marshaler), defaultStart(typ, finfo, startTemplate)) + } + if val.CanAddr() { + pv := val.Addr() + if pv.CanInterface() && pv.Type().Implements(marshalerType) { + return p.marshalInterface(pv.Interface().(Marshaler), defaultStart(pv.Type(), finfo, startTemplate)) + } + } + + // Check for text marshaler. + if val.CanInterface() && typ.Implements(textMarshalerType) { + return p.marshalTextInterface(val.Interface().(encoding.TextMarshaler), defaultStart(typ, finfo, startTemplate)) + } + if val.CanAddr() { + pv := val.Addr() + if pv.CanInterface() && pv.Type().Implements(textMarshalerType) { + return p.marshalTextInterface(pv.Interface().(encoding.TextMarshaler), defaultStart(pv.Type(), finfo, startTemplate)) + } + } + + // Slices and arrays iterate over the elements. They do not have an enclosing tag. + if (kind == reflect.Slice || kind == reflect.Array) && typ.Elem().Kind() != reflect.Uint8 { + for i, n := 0, val.Len(); i < n; i++ { + if err := p.marshalValue(val.Index(i), finfo, startTemplate); err != nil { + return err + } + } + return nil + } + + tinfo, err := getTypeInfo(typ) + if err != nil { + return err + } + + // Create start element. + // Precedence for the XML element name is: + // 0. startTemplate + // 1. XMLName field in underlying struct; + // 2. field name/tag in the struct field; and + // 3. type name + var start StartElement + + if startTemplate != nil { + start.Name = startTemplate.Name + start.Attr = append(start.Attr, startTemplate.Attr...) + } else if tinfo.xmlname != nil { + xmlname := tinfo.xmlname + if xmlname.name != "" { + start.Name.Space, start.Name.Local = xmlname.xmlns, xmlname.name + } else if v, ok := xmlname.value(val).Interface().(Name); ok && v.Local != "" { + start.Name = v + } + } + if start.Name.Local == "" && finfo != nil { + start.Name.Space, start.Name.Local = finfo.xmlns, finfo.name + } + if start.Name.Local == "" { + name := typ.Name() + if name == "" { + return &UnsupportedTypeError{typ} + } + start.Name.Local = name + } + + // Add type attribute if necessary + if finfo != nil && finfo.flags&fTypeAttr != 0 { + start.Attr = append(start.Attr, Attr{xmlSchemaInstance, typeToString(typ)}) + } + + // Attributes + for i := range tinfo.fields { + finfo := &tinfo.fields[i] + if finfo.flags&fAttr == 0 { + continue + } + fv := finfo.value(val) + name := Name{Space: finfo.xmlns, Local: finfo.name} + + if finfo.flags&fOmitEmpty != 0 && isEmptyValue(fv) { + continue + } + + if fv.Kind() == reflect.Interface && fv.IsNil() { + continue + } + + if fv.CanInterface() && fv.Type().Implements(marshalerAttrType) { + attr, err := fv.Interface().(MarshalerAttr).MarshalXMLAttr(name) + if err != nil { + return err + } + if attr.Name.Local != "" { + start.Attr = append(start.Attr, attr) + } + continue + } + + if fv.CanAddr() { + pv := fv.Addr() + if pv.CanInterface() && pv.Type().Implements(marshalerAttrType) { + attr, err := pv.Interface().(MarshalerAttr).MarshalXMLAttr(name) + if err != nil { + return err + } + if attr.Name.Local != "" { + start.Attr = append(start.Attr, attr) + } + continue + } + } + + if fv.CanInterface() && fv.Type().Implements(textMarshalerType) { + text, err := fv.Interface().(encoding.TextMarshaler).MarshalText() + if err != nil { + return err + } + start.Attr = append(start.Attr, Attr{name, string(text)}) + continue + } + + if fv.CanAddr() { + pv := fv.Addr() + if pv.CanInterface() && pv.Type().Implements(textMarshalerType) { + text, err := pv.Interface().(encoding.TextMarshaler).MarshalText() + if err != nil { + return err + } + start.Attr = append(start.Attr, Attr{name, string(text)}) + continue + } + } + + // Dereference or skip nil pointer, interface values. + switch fv.Kind() { + case reflect.Ptr, reflect.Interface: + if fv.IsNil() { + continue + } + fv = fv.Elem() + } + + s, b, err := p.marshalSimple(fv.Type(), fv) + if err != nil { + return err + } + if b != nil { + s = string(b) + } + start.Attr = append(start.Attr, Attr{name, s}) + } + + if err := p.writeStart(&start); err != nil { + return err + } + + if val.Kind() == reflect.Struct { + err = p.marshalStruct(tinfo, val) + } else { + s, b, err1 := p.marshalSimple(typ, val) + if err1 != nil { + err = err1 + } else if b != nil { + EscapeText(p, b) + } else { + p.EscapeString(s) + } + } + if err != nil { + return err + } + + if err := p.writeEnd(start.Name); err != nil { + return err + } + + return p.cachedWriteError() +} + +// defaultStart returns the default start element to use, +// given the reflect type, field info, and start template. +func defaultStart(typ reflect.Type, finfo *fieldInfo, startTemplate *StartElement) StartElement { + var start StartElement + // Precedence for the XML element name is as above, + // except that we do not look inside structs for the first field. + if startTemplate != nil { + start.Name = startTemplate.Name + start.Attr = append(start.Attr, startTemplate.Attr...) + } else if finfo != nil && finfo.name != "" { + start.Name.Local = finfo.name + start.Name.Space = finfo.xmlns + } else if typ.Name() != "" { + start.Name.Local = typ.Name() + } else { + // Must be a pointer to a named type, + // since it has the Marshaler methods. + start.Name.Local = typ.Elem().Name() + } + + // Add type attribute if necessary + if finfo != nil && finfo.flags&fTypeAttr != 0 { + start.Attr = append(start.Attr, Attr{xmlSchemaInstance, typeToString(typ)}) + } + + return start +} + +// marshalInterface marshals a Marshaler interface value. +func (p *printer) marshalInterface(val Marshaler, start StartElement) error { + // Push a marker onto the tag stack so that MarshalXML + // cannot close the XML tags that it did not open. + p.tags = append(p.tags, Name{}) + n := len(p.tags) + + err := val.MarshalXML(p.encoder, start) + if err != nil { + return err + } + + // Make sure MarshalXML closed all its tags. p.tags[n-1] is the mark. + if len(p.tags) > n { + return fmt.Errorf("xml: %s.MarshalXML wrote invalid XML: <%s> not closed", receiverType(val), p.tags[len(p.tags)-1].Local) + } + p.tags = p.tags[:n-1] + return nil +} + +// marshalTextInterface marshals a TextMarshaler interface value. +func (p *printer) marshalTextInterface(val encoding.TextMarshaler, start StartElement) error { + if err := p.writeStart(&start); err != nil { + return err + } + text, err := val.MarshalText() + if err != nil { + return err + } + EscapeText(p, text) + return p.writeEnd(start.Name) +} + +// writeStart writes the given start element. +func (p *printer) writeStart(start *StartElement) error { + if start.Name.Local == "" { + return fmt.Errorf("xml: start tag with no name") + } + + p.tags = append(p.tags, start.Name) + p.markPrefix() + + p.writeIndent(1) + p.WriteByte('<') + p.WriteString(start.Name.Local) + + if start.Name.Space != "" { + p.WriteString(` xmlns="`) + p.EscapeString(start.Name.Space) + p.WriteByte('"') + } + + // Attributes + for _, attr := range start.Attr { + name := attr.Name + if name.Local == "" { + continue + } + p.WriteByte(' ') + if name.Space != "" { + p.WriteString(p.createAttrPrefix(name.Space)) + p.WriteByte(':') + } + p.WriteString(name.Local) + p.WriteString(`="`) + p.EscapeString(attr.Value) + p.WriteByte('"') + } + p.WriteByte('>') + return nil +} + +func (p *printer) writeEnd(name Name) error { + if name.Local == "" { + return fmt.Errorf("xml: end tag with no name") + } + if len(p.tags) == 0 || p.tags[len(p.tags)-1].Local == "" { + return fmt.Errorf("xml: end tag without start tag", name.Local) + } + if top := p.tags[len(p.tags)-1]; top != name { + if top.Local != name.Local { + return fmt.Errorf("xml: end tag does not match start tag <%s>", name.Local, top.Local) + } + return fmt.Errorf("xml: end tag in namespace %s does not match start tag <%s> in namespace %s", name.Local, name.Space, top.Local, top.Space) + } + p.tags = p.tags[:len(p.tags)-1] + + p.writeIndent(-1) + p.WriteByte('<') + p.WriteByte('/') + p.WriteString(name.Local) + p.WriteByte('>') + p.popPrefix() + return nil +} + +func (p *printer) marshalSimple(typ reflect.Type, val reflect.Value) (string, []byte, error) { + switch val.Kind() { + case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: + return strconv.FormatInt(val.Int(), 10), nil, nil + case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: + return strconv.FormatUint(val.Uint(), 10), nil, nil + case reflect.Float32, reflect.Float64: + return strconv.FormatFloat(val.Float(), 'g', -1, val.Type().Bits()), nil, nil + case reflect.String: + return val.String(), nil, nil + case reflect.Bool: + return strconv.FormatBool(val.Bool()), nil, nil + case reflect.Array: + if typ.Elem().Kind() != reflect.Uint8 { + break + } + // [...]byte + var bytes []byte + if val.CanAddr() { + bytes = val.Slice(0, val.Len()).Bytes() + } else { + bytes = make([]byte, val.Len()) + reflect.Copy(reflect.ValueOf(bytes), val) + } + return "", bytes, nil + case reflect.Slice: + if typ.Elem().Kind() != reflect.Uint8 { + break + } + // []byte + return "", val.Bytes(), nil + } + return "", nil, &UnsupportedTypeError{typ} +} + +var ddBytes = []byte("--") + +func (p *printer) marshalStruct(tinfo *typeInfo, val reflect.Value) error { + s := parentStack{p: p} + for i := range tinfo.fields { + finfo := &tinfo.fields[i] + if finfo.flags&fAttr != 0 { + continue + } + vf := finfo.value(val) + + // Dereference or skip nil pointer, interface values. + switch vf.Kind() { + case reflect.Ptr, reflect.Interface: + if !vf.IsNil() { + vf = vf.Elem() + } + } + + switch finfo.flags & fMode { + case fCharData: + if vf.CanInterface() && vf.Type().Implements(textMarshalerType) { + data, err := vf.Interface().(encoding.TextMarshaler).MarshalText() + if err != nil { + return err + } + Escape(p, data) + continue + } + if vf.CanAddr() { + pv := vf.Addr() + if pv.CanInterface() && pv.Type().Implements(textMarshalerType) { + data, err := pv.Interface().(encoding.TextMarshaler).MarshalText() + if err != nil { + return err + } + Escape(p, data) + continue + } + } + var scratch [64]byte + switch vf.Kind() { + case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: + Escape(p, strconv.AppendInt(scratch[:0], vf.Int(), 10)) + case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: + Escape(p, strconv.AppendUint(scratch[:0], vf.Uint(), 10)) + case reflect.Float32, reflect.Float64: + Escape(p, strconv.AppendFloat(scratch[:0], vf.Float(), 'g', -1, vf.Type().Bits())) + case reflect.Bool: + Escape(p, strconv.AppendBool(scratch[:0], vf.Bool())) + case reflect.String: + if err := EscapeText(p, []byte(vf.String())); err != nil { + return err + } + case reflect.Slice: + if elem, ok := vf.Interface().([]byte); ok { + if err := EscapeText(p, elem); err != nil { + return err + } + } + } + continue + + case fComment: + k := vf.Kind() + if !(k == reflect.String || k == reflect.Slice && vf.Type().Elem().Kind() == reflect.Uint8) { + return fmt.Errorf("xml: bad type for comment field of %s", val.Type()) + } + if vf.Len() == 0 { + continue + } + p.writeIndent(0) + p.WriteString("" is invalid grammar. Make it "- -->" + p.WriteByte(' ') + } + p.WriteString("-->") + continue + + case fInnerXml: + iface := vf.Interface() + switch raw := iface.(type) { + case []byte: + p.Write(raw) + continue + case string: + p.WriteString(raw) + continue + } + + case fElement, fElement | fAny: + if err := s.trim(finfo.parents); err != nil { + return err + } + if len(finfo.parents) > len(s.stack) { + if vf.Kind() != reflect.Ptr && vf.Kind() != reflect.Interface || !vf.IsNil() { + if err := s.push(finfo.parents[len(s.stack):]); err != nil { + return err + } + } + } + } + if err := p.marshalValue(vf, finfo, nil); err != nil { + return err + } + } + s.trim(nil) + return p.cachedWriteError() +} + +// return the bufio Writer's cached write error +func (p *printer) cachedWriteError() error { + _, err := p.Write(nil) + return err +} + +func (p *printer) writeIndent(depthDelta int) { + if len(p.prefix) == 0 && len(p.indent) == 0 { + return + } + if depthDelta < 0 { + p.depth-- + if p.indentedIn { + p.indentedIn = false + return + } + p.indentedIn = false + } + if p.putNewline { + p.WriteByte('\n') + } else { + p.putNewline = true + } + if len(p.prefix) > 0 { + p.WriteString(p.prefix) + } + if len(p.indent) > 0 { + for i := 0; i < p.depth; i++ { + p.WriteString(p.indent) + } + } + if depthDelta > 0 { + p.depth++ + p.indentedIn = true + } +} + +type parentStack struct { + p *printer + stack []string +} + +// trim updates the XML context to match the longest common prefix of the stack +// and the given parents. A closing tag will be written for every parent +// popped. Passing a zero slice or nil will close all the elements. +func (s *parentStack) trim(parents []string) error { + split := 0 + for ; split < len(parents) && split < len(s.stack); split++ { + if parents[split] != s.stack[split] { + break + } + } + for i := len(s.stack) - 1; i >= split; i-- { + if err := s.p.writeEnd(Name{Local: s.stack[i]}); err != nil { + return err + } + } + s.stack = parents[:split] + return nil +} + +// push adds parent elements to the stack and writes open tags. +func (s *parentStack) push(parents []string) error { + for i := 0; i < len(parents); i++ { + if err := s.p.writeStart(&StartElement{Name: Name{Local: parents[i]}}); err != nil { + return err + } + } + s.stack = append(s.stack, parents...) + return nil +} + +// A MarshalXMLError is returned when Marshal encounters a type +// that cannot be converted into XML. +type UnsupportedTypeError struct { + Type reflect.Type +} + +func (e *UnsupportedTypeError) Error() string { + return "xml: unsupported type: " + e.Type.String() +} + +func isEmptyValue(v reflect.Value) bool { + switch v.Kind() { + case reflect.Array, reflect.Map, reflect.Slice, reflect.String: + return v.Len() == 0 + case reflect.Bool: + return !v.Bool() + case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: + return v.Int() == 0 + case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: + return v.Uint() == 0 + case reflect.Float32, reflect.Float64: + return v.Float() == 0 + case reflect.Interface, reflect.Ptr: + return v.IsNil() + } + return false +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/vim25/xml/marshal_test.go juju-core-2.0.2/src/github.com/vmware/govmomi/vim25/xml/marshal_test.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/vim25/xml/marshal_test.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/vim25/xml/marshal_test.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,1266 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package xml + +import ( + "bytes" + "errors" + "fmt" + "io" + "reflect" + "strconv" + "strings" + "testing" + "time" +) + +type DriveType int + +const ( + HyperDrive DriveType = iota + ImprobabilityDrive +) + +type Passenger struct { + Name []string `xml:"name"` + Weight float32 `xml:"weight"` +} + +type Ship struct { + XMLName struct{} `xml:"spaceship"` + + Name string `xml:"name,attr"` + Pilot string `xml:"pilot,attr"` + Drive DriveType `xml:"drive"` + Age uint `xml:"age"` + Passenger []*Passenger `xml:"passenger"` + secret string +} + +type NamedType string + +type Port struct { + XMLName struct{} `xml:"port"` + Type string `xml:"type,attr,omitempty"` + Comment string `xml:",comment"` + Number string `xml:",chardata"` +} + +type Domain struct { + XMLName struct{} `xml:"domain"` + Country string `xml:",attr,omitempty"` + Name []byte `xml:",chardata"` + Comment []byte `xml:",comment"` +} + +type Book struct { + XMLName struct{} `xml:"book"` + Title string `xml:",chardata"` +} + +type Event struct { + XMLName struct{} `xml:"event"` + Year int `xml:",chardata"` +} + +type Movie struct { + XMLName struct{} `xml:"movie"` + Length uint `xml:",chardata"` +} + +type Pi struct { + XMLName struct{} `xml:"pi"` + Approximation float32 `xml:",chardata"` +} + +type Universe struct { + XMLName struct{} `xml:"universe"` + Visible float64 `xml:",chardata"` +} + +type Particle struct { + XMLName struct{} `xml:"particle"` + HasMass bool `xml:",chardata"` +} + +type Departure struct { + XMLName struct{} `xml:"departure"` + When time.Time `xml:",chardata"` +} + +type SecretAgent struct { + XMLName struct{} `xml:"agent"` + Handle string `xml:"handle,attr"` + Identity string + Obfuscate string `xml:",innerxml"` +} + +type NestedItems struct { + XMLName struct{} `xml:"result"` + Items []string `xml:">item"` + Item1 []string `xml:"Items>item1"` +} + +type NestedOrder struct { + XMLName struct{} `xml:"result"` + Field1 string `xml:"parent>c"` + Field2 string `xml:"parent>b"` + Field3 string `xml:"parent>a"` +} + +type MixedNested struct { + XMLName struct{} `xml:"result"` + A string `xml:"parent1>a"` + B string `xml:"b"` + C string `xml:"parent1>parent2>c"` + D string `xml:"parent1>d"` +} + +type NilTest struct { + A interface{} `xml:"parent1>parent2>a"` + B interface{} `xml:"parent1>b"` + C interface{} `xml:"parent1>parent2>c"` +} + +type Service struct { + XMLName struct{} `xml:"service"` + Domain *Domain `xml:"host>domain"` + Port *Port `xml:"host>port"` + Extra1 interface{} + Extra2 interface{} `xml:"host>extra2"` +} + +var nilStruct *Ship + +type EmbedA struct { + EmbedC + EmbedB EmbedB + FieldA string +} + +type EmbedB struct { + FieldB string + *EmbedC +} + +type EmbedC struct { + FieldA1 string `xml:"FieldA>A1"` + FieldA2 string `xml:"FieldA>A2"` + FieldB string + FieldC string +} + +type NameCasing struct { + XMLName struct{} `xml:"casing"` + Xy string + XY string + XyA string `xml:"Xy,attr"` + XYA string `xml:"XY,attr"` +} + +type NamePrecedence struct { + XMLName Name `xml:"Parent"` + FromTag XMLNameWithoutTag `xml:"InTag"` + FromNameVal XMLNameWithoutTag + FromNameTag XMLNameWithTag + InFieldName string +} + +type XMLNameWithTag struct { + XMLName Name `xml:"InXMLNameTag"` + Value string `xml:",chardata"` +} + +type XMLNameWithoutTag struct { + XMLName Name + Value string `xml:",chardata"` +} + +type NameInField struct { + Foo Name `xml:"ns foo"` +} + +type AttrTest struct { + Int int `xml:",attr"` + Named int `xml:"int,attr"` + Float float64 `xml:",attr"` + Uint8 uint8 `xml:",attr"` + Bool bool `xml:",attr"` + Str string `xml:",attr"` + Bytes []byte `xml:",attr"` +} + +type OmitAttrTest struct { + Int int `xml:",attr,omitempty"` + Named int `xml:"int,attr,omitempty"` + Float float64 `xml:",attr,omitempty"` + Uint8 uint8 `xml:",attr,omitempty"` + Bool bool `xml:",attr,omitempty"` + Str string `xml:",attr,omitempty"` + Bytes []byte `xml:",attr,omitempty"` +} + +type OmitFieldTest struct { + Int int `xml:",omitempty"` + Named int `xml:"int,omitempty"` + Float float64 `xml:",omitempty"` + Uint8 uint8 `xml:",omitempty"` + Bool bool `xml:",omitempty"` + Str string `xml:",omitempty"` + Bytes []byte `xml:",omitempty"` + Ptr *PresenceTest `xml:",omitempty"` +} + +type AnyTest struct { + XMLName struct{} `xml:"a"` + Nested string `xml:"nested>value"` + AnyField AnyHolder `xml:",any"` +} + +type AnyOmitTest struct { + XMLName struct{} `xml:"a"` + Nested string `xml:"nested>value"` + AnyField *AnyHolder `xml:",any,omitempty"` +} + +type AnySliceTest struct { + XMLName struct{} `xml:"a"` + Nested string `xml:"nested>value"` + AnyField []AnyHolder `xml:",any"` +} + +type AnyHolder struct { + XMLName Name + XML string `xml:",innerxml"` +} + +type RecurseA struct { + A string + B *RecurseB +} + +type RecurseB struct { + A *RecurseA + B string +} + +type PresenceTest struct { + Exists *struct{} +} + +type IgnoreTest struct { + PublicSecret string `xml:"-"` +} + +type MyBytes []byte + +type Data struct { + Bytes []byte + Attr []byte `xml:",attr"` + Custom MyBytes +} + +type Plain struct { + V interface{} +} + +type MyInt int + +type EmbedInt struct { + MyInt +} + +type Strings struct { + X []string `xml:"A>B,omitempty"` +} + +type PointerFieldsTest struct { + XMLName Name `xml:"dummy"` + Name *string `xml:"name,attr"` + Age *uint `xml:"age,attr"` + Empty *string `xml:"empty,attr"` + Contents *string `xml:",chardata"` +} + +type ChardataEmptyTest struct { + XMLName Name `xml:"test"` + Contents *string `xml:",chardata"` +} + +type MyMarshalerTest struct { +} + +var _ Marshaler = (*MyMarshalerTest)(nil) + +func (m *MyMarshalerTest) MarshalXML(e *Encoder, start StartElement) error { + e.EncodeToken(start) + e.EncodeToken(CharData([]byte("hello world"))) + e.EncodeToken(EndElement{start.Name}) + return nil +} + +type MyMarshalerAttrTest struct { +} + +var _ MarshalerAttr = (*MyMarshalerAttrTest)(nil) + +func (m *MyMarshalerAttrTest) MarshalXMLAttr(name Name) (Attr, error) { + return Attr{name, "hello world"}, nil +} + +type MarshalerStruct struct { + Foo MyMarshalerAttrTest `xml:",attr"` +} + +type InnerStruct struct { + XMLName Name `xml:"testns outer"` +} + +type OuterStruct struct { + InnerStruct + IntAttr int `xml:"int,attr"` +} + +type OuterNamedStruct struct { + InnerStruct + XMLName Name `xml:"outerns test"` + IntAttr int `xml:"int,attr"` +} + +type OuterNamedOrderedStruct struct { + XMLName Name `xml:"outerns test"` + InnerStruct + IntAttr int `xml:"int,attr"` +} + +type OuterOuterStruct struct { + OuterStruct +} + +func ifaceptr(x interface{}) interface{} { + return &x +} + +var ( + nameAttr = "Sarah" + ageAttr = uint(12) + contentsAttr = "lorem ipsum" +) + +// Unless explicitly stated as such (or *Plain), all of the +// tests below are two-way tests. When introducing new tests, +// please try to make them two-way as well to ensure that +// marshalling and unmarshalling are as symmetrical as feasible. +var marshalTests = []struct { + Value interface{} + ExpectXML string + MarshalOnly bool + UnmarshalOnly bool +}{ + // Test nil marshals to nothing + {Value: nil, ExpectXML: ``, MarshalOnly: true}, + {Value: nilStruct, ExpectXML: ``, MarshalOnly: true}, + + // Test value types + {Value: &Plain{true}, ExpectXML: `true`}, + {Value: &Plain{false}, ExpectXML: `false`}, + {Value: &Plain{int(42)}, ExpectXML: `42`}, + {Value: &Plain{int8(42)}, ExpectXML: `42`}, + {Value: &Plain{int16(42)}, ExpectXML: `42`}, + {Value: &Plain{int32(42)}, ExpectXML: `42`}, + {Value: &Plain{uint(42)}, ExpectXML: `42`}, + {Value: &Plain{uint8(42)}, ExpectXML: `42`}, + {Value: &Plain{uint16(42)}, ExpectXML: `42`}, + {Value: &Plain{uint32(42)}, ExpectXML: `42`}, + {Value: &Plain{float32(1.25)}, ExpectXML: `1.25`}, + {Value: &Plain{float64(1.25)}, ExpectXML: `1.25`}, + {Value: &Plain{uintptr(0xFFDD)}, ExpectXML: `65501`}, + {Value: &Plain{"gopher"}, ExpectXML: `gopher`}, + {Value: &Plain{[]byte("gopher")}, ExpectXML: `gopher`}, + {Value: &Plain{""}, ExpectXML: `</>`}, + {Value: &Plain{[]byte("")}, ExpectXML: `</>`}, + {Value: &Plain{[3]byte{'<', '/', '>'}}, ExpectXML: `</>`}, + {Value: &Plain{NamedType("potato")}, ExpectXML: `potato`}, + {Value: &Plain{[]int{1, 2, 3}}, ExpectXML: `123`}, + {Value: &Plain{[3]int{1, 2, 3}}, ExpectXML: `123`}, + {Value: ifaceptr(true), MarshalOnly: true, ExpectXML: `true`}, + + // Test time. + { + Value: &Plain{time.Unix(1e9, 123456789).UTC()}, + ExpectXML: `2001-09-09T01:46:40.123456789Z`, + }, + + // A pointer to struct{} may be used to test for an element's presence. + { + Value: &PresenceTest{new(struct{})}, + ExpectXML: ``, + }, + { + Value: &PresenceTest{}, + ExpectXML: ``, + }, + + // A pointer to struct{} may be used to test for an element's presence. + { + Value: &PresenceTest{new(struct{})}, + ExpectXML: ``, + }, + { + Value: &PresenceTest{}, + ExpectXML: ``, + }, + + // A []byte field is only nil if the element was not found. + { + Value: &Data{}, + ExpectXML: ``, + UnmarshalOnly: true, + }, + { + Value: &Data{Bytes: []byte{}, Custom: MyBytes{}, Attr: []byte{}}, + ExpectXML: ``, + UnmarshalOnly: true, + }, + + // Check that []byte works, including named []byte types. + { + Value: &Data{Bytes: []byte("ab"), Custom: MyBytes("cd"), Attr: []byte{'v'}}, + ExpectXML: `abcd`, + }, + + // Test innerxml + { + Value: &SecretAgent{ + Handle: "007", + Identity: "James Bond", + Obfuscate: "", + }, + ExpectXML: `James Bond`, + MarshalOnly: true, + }, + { + Value: &SecretAgent{ + Handle: "007", + Identity: "James Bond", + Obfuscate: "James Bond", + }, + ExpectXML: `James Bond`, + UnmarshalOnly: true, + }, + + // Test structs + {Value: &Port{Type: "ssl", Number: "443"}, ExpectXML: `443`}, + {Value: &Port{Number: "443"}, ExpectXML: `443`}, + {Value: &Port{Type: ""}, ExpectXML: ``}, + {Value: &Port{Number: "443", Comment: "https"}, ExpectXML: `443`}, + {Value: &Port{Number: "443", Comment: "add space-"}, ExpectXML: `443`, MarshalOnly: true}, + {Value: &Domain{Name: []byte("google.com&friends")}, ExpectXML: `google.com&friends`}, + {Value: &Domain{Name: []byte("google.com"), Comment: []byte(" &friends ")}, ExpectXML: `google.com`}, + {Value: &Book{Title: "Pride & Prejudice"}, ExpectXML: `Pride & Prejudice`}, + {Value: &Event{Year: -3114}, ExpectXML: `-3114`}, + {Value: &Movie{Length: 13440}, ExpectXML: `13440`}, + {Value: &Pi{Approximation: 3.14159265}, ExpectXML: `3.1415927`}, + {Value: &Universe{Visible: 9.3e13}, ExpectXML: `9.3e+13`}, + {Value: &Particle{HasMass: true}, ExpectXML: `true`}, + {Value: &Departure{When: ParseTime("2013-01-09T00:15:00-09:00")}, ExpectXML: `2013-01-09T00:15:00-09:00`}, + {Value: atomValue, ExpectXML: atomXml}, + { + Value: &Ship{ + Name: "Heart of Gold", + Pilot: "Computer", + Age: 1, + Drive: ImprobabilityDrive, + Passenger: []*Passenger{ + { + Name: []string{"Zaphod", "Beeblebrox"}, + Weight: 7.25, + }, + { + Name: []string{"Trisha", "McMillen"}, + Weight: 5.5, + }, + { + Name: []string{"Ford", "Prefect"}, + Weight: 7, + }, + { + Name: []string{"Arthur", "Dent"}, + Weight: 6.75, + }, + }, + }, + ExpectXML: `` + + `` + strconv.Itoa(int(ImprobabilityDrive)) + `` + + `1` + + `` + + `Zaphod` + + `Beeblebrox` + + `7.25` + + `` + + `` + + `Trisha` + + `McMillen` + + `5.5` + + `` + + `` + + `Ford` + + `Prefect` + + `7` + + `` + + `` + + `Arthur` + + `Dent` + + `6.75` + + `` + + ``, + }, + + // Test a>b + { + Value: &NestedItems{Items: nil, Item1: nil}, + ExpectXML: `` + + `` + + `` + + ``, + }, + { + Value: &NestedItems{Items: []string{}, Item1: []string{}}, + ExpectXML: `` + + `` + + `` + + ``, + MarshalOnly: true, + }, + { + Value: &NestedItems{Items: nil, Item1: []string{"A"}}, + ExpectXML: `` + + `` + + `A` + + `` + + ``, + }, + { + Value: &NestedItems{Items: []string{"A", "B"}, Item1: nil}, + ExpectXML: `` + + `` + + `A` + + `B` + + `` + + ``, + }, + { + Value: &NestedItems{Items: []string{"A", "B"}, Item1: []string{"C"}}, + ExpectXML: `` + + `` + + `A` + + `B` + + `C` + + `` + + ``, + }, + { + Value: &NestedOrder{Field1: "C", Field2: "B", Field3: "A"}, + ExpectXML: `` + + `` + + `C` + + `B` + + `A` + + `` + + ``, + }, + { + Value: &NilTest{A: "A", B: nil, C: "C"}, + ExpectXML: `` + + `` + + `A` + + `C` + + `` + + ``, + MarshalOnly: true, // Uses interface{} + }, + { + Value: &MixedNested{A: "A", B: "B", C: "C", D: "D"}, + ExpectXML: `` + + `A` + + `B` + + `` + + `C` + + `D` + + `` + + ``, + }, + { + Value: &Service{Port: &Port{Number: "80"}}, + ExpectXML: `80`, + }, + { + Value: &Service{}, + ExpectXML: ``, + }, + { + Value: &Service{Port: &Port{Number: "80"}, Extra1: "A", Extra2: "B"}, + ExpectXML: `` + + `80` + + `A` + + `B` + + ``, + MarshalOnly: true, + }, + { + Value: &Service{Port: &Port{Number: "80"}, Extra2: "example"}, + ExpectXML: `` + + `80` + + `example` + + ``, + MarshalOnly: true, + }, + + // Test struct embedding + { + Value: &EmbedA{ + EmbedC: EmbedC{ + FieldA1: "", // Shadowed by A.A + FieldA2: "", // Shadowed by A.A + FieldB: "A.C.B", + FieldC: "A.C.C", + }, + EmbedB: EmbedB{ + FieldB: "A.B.B", + EmbedC: &EmbedC{ + FieldA1: "A.B.C.A1", + FieldA2: "A.B.C.A2", + FieldB: "", // Shadowed by A.B.B + FieldC: "A.B.C.C", + }, + }, + FieldA: "A.A", + }, + ExpectXML: `` + + `A.C.B` + + `A.C.C` + + `` + + `A.B.B` + + `` + + `A.B.C.A1` + + `A.B.C.A2` + + `` + + `A.B.C.C` + + `` + + `A.A` + + ``, + }, + + // Test that name casing matters + { + Value: &NameCasing{Xy: "mixed", XY: "upper", XyA: "mixedA", XYA: "upperA"}, + ExpectXML: `mixedupper`, + }, + + // Test the order in which the XML element name is chosen + { + Value: &NamePrecedence{ + FromTag: XMLNameWithoutTag{Value: "A"}, + FromNameVal: XMLNameWithoutTag{XMLName: Name{Local: "InXMLName"}, Value: "B"}, + FromNameTag: XMLNameWithTag{Value: "C"}, + InFieldName: "D", + }, + ExpectXML: `` + + `A` + + `B` + + `C` + + `D` + + ``, + MarshalOnly: true, + }, + { + Value: &NamePrecedence{ + XMLName: Name{Local: "Parent"}, + FromTag: XMLNameWithoutTag{XMLName: Name{Local: "InTag"}, Value: "A"}, + FromNameVal: XMLNameWithoutTag{XMLName: Name{Local: "FromNameVal"}, Value: "B"}, + FromNameTag: XMLNameWithTag{XMLName: Name{Local: "InXMLNameTag"}, Value: "C"}, + InFieldName: "D", + }, + ExpectXML: `` + + `A` + + `B` + + `C` + + `D` + + ``, + UnmarshalOnly: true, + }, + + // xml.Name works in a plain field as well. + { + Value: &NameInField{Name{Space: "ns", Local: "foo"}}, + ExpectXML: ``, + }, + { + Value: &NameInField{Name{Space: "ns", Local: "foo"}}, + ExpectXML: ``, + UnmarshalOnly: true, + }, + + // Marshaling zero xml.Name uses the tag or field name. + { + Value: &NameInField{}, + ExpectXML: ``, + MarshalOnly: true, + }, + + // Test attributes + { + Value: &AttrTest{ + Int: 8, + Named: 9, + Float: 23.5, + Uint8: 255, + Bool: true, + Str: "str", + Bytes: []byte("byt"), + }, + ExpectXML: ``, + }, + { + Value: &AttrTest{Bytes: []byte{}}, + ExpectXML: ``, + }, + { + Value: &OmitAttrTest{ + Int: 8, + Named: 9, + Float: 23.5, + Uint8: 255, + Bool: true, + Str: "str", + Bytes: []byte("byt"), + }, + ExpectXML: ``, + }, + { + Value: &OmitAttrTest{}, + ExpectXML: ``, + }, + + // pointer fields + { + Value: &PointerFieldsTest{Name: &nameAttr, Age: &ageAttr, Contents: &contentsAttr}, + ExpectXML: `lorem ipsum`, + MarshalOnly: true, + }, + + // empty chardata pointer field + { + Value: &ChardataEmptyTest{}, + ExpectXML: ``, + MarshalOnly: true, + }, + + // omitempty on fields + { + Value: &OmitFieldTest{ + Int: 8, + Named: 9, + Float: 23.5, + Uint8: 255, + Bool: true, + Str: "str", + Bytes: []byte("byt"), + Ptr: &PresenceTest{}, + }, + ExpectXML: `` + + `8` + + `9` + + `23.5` + + `255` + + `true` + + `str` + + `byt` + + `` + + ``, + }, + { + Value: &OmitFieldTest{}, + ExpectXML: ``, + }, + + // Test ",any" + { + ExpectXML: `knownunknown`, + Value: &AnyTest{ + Nested: "known", + AnyField: AnyHolder{ + XMLName: Name{Local: "other"}, + XML: "unknown", + }, + }, + }, + { + Value: &AnyTest{Nested: "known", + AnyField: AnyHolder{ + XML: "", + XMLName: Name{Local: "AnyField"}, + }, + }, + ExpectXML: `known`, + }, + { + ExpectXML: `b`, + Value: &AnyOmitTest{ + Nested: "b", + }, + }, + { + ExpectXML: `bei`, + Value: &AnySliceTest{ + Nested: "b", + AnyField: []AnyHolder{ + { + XMLName: Name{Local: "c"}, + XML: "e", + }, + { + XMLName: Name{Space: "f", Local: "g"}, + XML: "i", + }, + }, + }, + }, + { + ExpectXML: `b`, + Value: &AnySliceTest{ + Nested: "b", + }, + }, + + // Test recursive types. + { + Value: &RecurseA{ + A: "a1", + B: &RecurseB{ + A: &RecurseA{"a2", nil}, + B: "b1", + }, + }, + ExpectXML: `a1a2b1`, + }, + + // Test ignoring fields via "-" tag + { + ExpectXML: ``, + Value: &IgnoreTest{}, + }, + { + ExpectXML: ``, + Value: &IgnoreTest{PublicSecret: "can't tell"}, + MarshalOnly: true, + }, + { + ExpectXML: `ignore me`, + Value: &IgnoreTest{}, + UnmarshalOnly: true, + }, + + // Test escaping. + { + ExpectXML: `dquote: "; squote: '; ampersand: &; less: <; greater: >;`, + Value: &AnyTest{ + Nested: `dquote: "; squote: '; ampersand: &; less: <; greater: >;`, + AnyField: AnyHolder{XMLName: Name{Local: "empty"}}, + }, + }, + { + ExpectXML: `newline: ; cr: ; tab: ;`, + Value: &AnyTest{ + Nested: "newline: \n; cr: \r; tab: \t;", + AnyField: AnyHolder{XMLName: Name{Local: "AnyField"}}, + }, + }, + { + ExpectXML: "1\r2\r\n3\n\r4\n5", + Value: &AnyTest{ + Nested: "1\n2\n3\n\n4\n5", + }, + UnmarshalOnly: true, + }, + { + ExpectXML: `42`, + Value: &EmbedInt{ + MyInt: 42, + }, + }, + // Test omitempty with parent chain; see golang.org/issue/4168. + { + ExpectXML: ``, + Value: &Strings{}, + }, + // Custom marshalers. + { + ExpectXML: `hello world`, + Value: &MyMarshalerTest{}, + }, + { + ExpectXML: ``, + Value: &MarshalerStruct{}, + }, + { + ExpectXML: ``, + Value: &OuterStruct{IntAttr: 10}, + }, + { + ExpectXML: ``, + Value: &OuterNamedStruct{XMLName: Name{Space: "outerns", Local: "test"}, IntAttr: 10}, + }, + { + ExpectXML: ``, + Value: &OuterNamedOrderedStruct{XMLName: Name{Space: "outerns", Local: "test"}, IntAttr: 10}, + }, + { + ExpectXML: ``, + Value: &OuterOuterStruct{OuterStruct{IntAttr: 10}}, + }, +} + +func TestMarshal(t *testing.T) { + for idx, test := range marshalTests { + if test.UnmarshalOnly { + continue + } + data, err := Marshal(test.Value) + if err != nil { + t.Errorf("#%d: Error: %s", idx, err) + continue + } + if got, want := string(data), test.ExpectXML; got != want { + if strings.Contains(want, "\n") { + t.Errorf("#%d: marshal(%#v):\nHAVE:\n%s\nWANT:\n%s", idx, test.Value, got, want) + } else { + t.Errorf("#%d: marshal(%#v):\nhave %#q\nwant %#q", idx, test.Value, got, want) + } + } + } +} + +type AttrParent struct { + X string `xml:"X>Y,attr"` +} + +type BadAttr struct { + Name []string `xml:"name,attr"` +} + +var marshalErrorTests = []struct { + Value interface{} + Err string + Kind reflect.Kind +}{ + { + Value: make(chan bool), + Err: "xml: unsupported type: chan bool", + Kind: reflect.Chan, + }, + { + Value: map[string]string{ + "question": "What do you get when you multiply six by nine?", + "answer": "42", + }, + Err: "xml: unsupported type: map[string]string", + Kind: reflect.Map, + }, + { + Value: map[*Ship]bool{nil: false}, + Err: "xml: unsupported type: map[*xml.Ship]bool", + Kind: reflect.Map, + }, + { + Value: &Domain{Comment: []byte("f--bar")}, + Err: `xml: comments must not contain "--"`, + }, + // Reject parent chain with attr, never worked; see golang.org/issue/5033. + { + Value: &AttrParent{}, + Err: `xml: X>Y chain not valid with attr flag`, + }, + { + Value: BadAttr{[]string{"X", "Y"}}, + Err: `xml: unsupported type: []string`, + }, +} + +var marshalIndentTests = []struct { + Value interface{} + Prefix string + Indent string + ExpectXML string +}{ + { + Value: &SecretAgent{ + Handle: "007", + Identity: "James Bond", + Obfuscate: "", + }, + Prefix: "", + Indent: "\t", + ExpectXML: fmt.Sprintf("\n\tJames Bond\n"), + }, +} + +func TestMarshalErrors(t *testing.T) { + for idx, test := range marshalErrorTests { + data, err := Marshal(test.Value) + if err == nil { + t.Errorf("#%d: marshal(%#v) = [success] %q, want error %v", idx, test.Value, data, test.Err) + continue + } + if err.Error() != test.Err { + t.Errorf("#%d: marshal(%#v) = [error] %v, want %v", idx, test.Value, err, test.Err) + } + if test.Kind != reflect.Invalid { + if kind := err.(*UnsupportedTypeError).Type.Kind(); kind != test.Kind { + t.Errorf("#%d: marshal(%#v) = [error kind] %s, want %s", idx, test.Value, kind, test.Kind) + } + } + } +} + +// Do invertibility testing on the various structures that we test +func TestUnmarshal(t *testing.T) { + for i, test := range marshalTests { + if test.MarshalOnly { + continue + } + if _, ok := test.Value.(*Plain); ok { + continue + } + + vt := reflect.TypeOf(test.Value) + dest := reflect.New(vt.Elem()).Interface() + err := Unmarshal([]byte(test.ExpectXML), dest) + + switch fix := dest.(type) { + case *Feed: + fix.Author.InnerXML = "" + for i := range fix.Entry { + fix.Entry[i].Author.InnerXML = "" + } + } + + if err != nil { + t.Errorf("#%d: unexpected error: %#v", i, err) + } else if got, want := dest, test.Value; !reflect.DeepEqual(got, want) { + t.Errorf("#%d: unmarshal(%q):\nhave %#v\nwant %#v", i, test.ExpectXML, got, want) + } + } +} + +func TestMarshalIndent(t *testing.T) { + for i, test := range marshalIndentTests { + data, err := MarshalIndent(test.Value, test.Prefix, test.Indent) + if err != nil { + t.Errorf("#%d: Error: %s", i, err) + continue + } + if got, want := string(data), test.ExpectXML; got != want { + t.Errorf("#%d: MarshalIndent:\nGot:%s\nWant:\n%s", i, got, want) + } + } +} + +type limitedBytesWriter struct { + w io.Writer + remain int // until writes fail +} + +func (lw *limitedBytesWriter) Write(p []byte) (n int, err error) { + if lw.remain <= 0 { + println("error") + return 0, errors.New("write limit hit") + } + if len(p) > lw.remain { + p = p[:lw.remain] + n, _ = lw.w.Write(p) + lw.remain = 0 + return n, errors.New("write limit hit") + } + n, err = lw.w.Write(p) + lw.remain -= n + return n, err +} + +func TestMarshalWriteErrors(t *testing.T) { + var buf bytes.Buffer + const writeCap = 1024 + w := &limitedBytesWriter{&buf, writeCap} + enc := NewEncoder(w) + var err error + var i int + const n = 4000 + for i = 1; i <= n; i++ { + err = enc.Encode(&Passenger{ + Name: []string{"Alice", "Bob"}, + Weight: 5, + }) + if err != nil { + break + } + } + if err == nil { + t.Error("expected an error") + } + if i == n { + t.Errorf("expected to fail before the end") + } + if buf.Len() != writeCap { + t.Errorf("buf.Len() = %d; want %d", buf.Len(), writeCap) + } +} + +func TestMarshalWriteIOErrors(t *testing.T) { + enc := NewEncoder(errWriter{}) + + expectErr := "unwritable" + err := enc.Encode(&Passenger{}) + if err == nil || err.Error() != expectErr { + t.Errorf("EscapeTest = [error] %v, want %v", err, expectErr) + } +} + +func TestMarshalFlush(t *testing.T) { + var buf bytes.Buffer + enc := NewEncoder(&buf) + if err := enc.EncodeToken(CharData("hello world")); err != nil { + t.Fatalf("enc.EncodeToken: %v", err) + } + if buf.Len() > 0 { + t.Fatalf("enc.EncodeToken caused actual write: %q", buf.Bytes()) + } + if err := enc.Flush(); err != nil { + t.Fatalf("enc.Flush: %v", err) + } + if buf.String() != "hello world" { + t.Fatalf("after enc.Flush, buf.String() = %q, want %q", buf.String(), "hello world") + } +} + +func BenchmarkMarshal(b *testing.B) { + for i := 0; i < b.N; i++ { + Marshal(atomValue) + } +} + +func BenchmarkUnmarshal(b *testing.B) { + xml := []byte(atomXml) + for i := 0; i < b.N; i++ { + Unmarshal(xml, &Feed{}) + } +} + +// golang.org/issue/6556 +func TestStructPointerMarshal(t *testing.T) { + type A struct { + XMLName string `xml:"a"` + B []interface{} + } + type C struct { + XMLName Name + Value string `xml:"value"` + } + + a := new(A) + a.B = append(a.B, &C{ + XMLName: Name{Local: "c"}, + Value: "x", + }) + + b, err := Marshal(a) + if err != nil { + t.Fatal(err) + } + if x := string(b); x != "x" { + t.Fatal(x) + } + var v A + err = Unmarshal(b, &v) + if err != nil { + t.Fatal(err) + } +} + +var encodeTokenTests = []struct { + tok Token + want string + ok bool +}{ + {StartElement{Name{"space", "local"}, nil}, "", true}, + {StartElement{Name{"space", ""}, nil}, "", false}, + {EndElement{Name{"space", ""}}, "", false}, + {CharData("foo"), "foo", true}, + {Comment("foo"), "", true}, + {Comment("foo-->"), "", false}, + {ProcInst{"Target", []byte("Instruction")}, "", true}, + {ProcInst{"", []byte("Instruction")}, "", false}, + {ProcInst{"Target", []byte("Instruction?>")}, "", false}, + {Directive("foo"), "", true}, + {Directive("foo>"), "", false}, +} + +func TestEncodeToken(t *testing.T) { + for _, tt := range encodeTokenTests { + var buf bytes.Buffer + enc := NewEncoder(&buf) + err := enc.EncodeToken(tt.tok) + switch { + case !tt.ok && err == nil: + t.Errorf("enc.EncodeToken(%#v): expected error; got none", tt.tok) + case tt.ok && err != nil: + t.Fatalf("enc.EncodeToken: %v", err) + case !tt.ok && err != nil: + // expected error, got one + } + if err := enc.Flush(); err != nil { + t.Fatalf("enc.EncodeToken: %v", err) + } + if got := buf.String(); got != tt.want { + t.Errorf("enc.EncodeToken = %s; want: %s", got, tt.want) + } + } +} + +func TestProcInstEncodeToken(t *testing.T) { + var buf bytes.Buffer + enc := NewEncoder(&buf) + + if err := enc.EncodeToken(ProcInst{"xml", []byte("Instruction")}); err != nil { + t.Fatalf("enc.EncodeToken: expected to be able to encode xml target ProcInst as first token, %s", err) + } + + if err := enc.EncodeToken(ProcInst{"Target", []byte("Instruction")}); err != nil { + t.Fatalf("enc.EncodeToken: expected to be able to add non-xml target ProcInst") + } + + if err := enc.EncodeToken(ProcInst{"xml", []byte("Instruction")}); err == nil { + t.Fatalf("enc.EncodeToken: expected to not be allowed to encode xml target ProcInst when not first token") + } +} + +func TestDecodeEncode(t *testing.T) { + var in, out bytes.Buffer + in.WriteString(` + + + +`) + dec := NewDecoder(&in) + enc := NewEncoder(&out) + for tok, err := dec.Token(); err == nil; tok, err = dec.Token() { + err = enc.EncodeToken(tok) + if err != nil { + t.Fatalf("enc.EncodeToken: Unable to encode token (%#v), %v", tok, err) + } + } +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/vim25/xml/read.go juju-core-2.0.2/src/github.com/vmware/govmomi/vim25/xml/read.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/vim25/xml/read.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/vim25/xml/read.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,779 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package xml + +import ( + "bytes" + "encoding" + "errors" + "fmt" + "reflect" + "strconv" + "strings" +) + +// BUG(rsc): Mapping between XML elements and data structures is inherently flawed: +// an XML element is an order-dependent collection of anonymous +// values, while a data structure is an order-independent collection +// of named values. +// See package json for a textual representation more suitable +// to data structures. + +// Unmarshal parses the XML-encoded data and stores the result in +// the value pointed to by v, which must be an arbitrary struct, +// slice, or string. Well-formed data that does not fit into v is +// discarded. +// +// Because Unmarshal uses the reflect package, it can only assign +// to exported (upper case) fields. Unmarshal uses a case-sensitive +// comparison to match XML element names to tag values and struct +// field names. +// +// Unmarshal maps an XML element to a struct using the following rules. +// In the rules, the tag of a field refers to the value associated with the +// key 'xml' in the struct field's tag (see the example above). +// +// * If the struct has a field of type []byte or string with tag +// ",innerxml", Unmarshal accumulates the raw XML nested inside the +// element in that field. The rest of the rules still apply. +// +// * If the struct has a field named XMLName of type xml.Name, +// Unmarshal records the element name in that field. +// +// * If the XMLName field has an associated tag of the form +// "name" or "namespace-URL name", the XML element must have +// the given name (and, optionally, name space) or else Unmarshal +// returns an error. +// +// * If the XML element has an attribute whose name matches a +// struct field name with an associated tag containing ",attr" or +// the explicit name in a struct field tag of the form "name,attr", +// Unmarshal records the attribute value in that field. +// +// * If the XML element contains character data, that data is +// accumulated in the first struct field that has tag ",chardata". +// The struct field may have type []byte or string. +// If there is no such field, the character data is discarded. +// +// * If the XML element contains comments, they are accumulated in +// the first struct field that has tag ",comment". The struct +// field may have type []byte or string. If there is no such +// field, the comments are discarded. +// +// * If the XML element contains a sub-element whose name matches +// the prefix of a tag formatted as "a" or "a>b>c", unmarshal +// will descend into the XML structure looking for elements with the +// given names, and will map the innermost elements to that struct +// field. A tag starting with ">" is equivalent to one starting +// with the field name followed by ">". +// +// * If the XML element contains a sub-element whose name matches +// a struct field's XMLName tag and the struct field has no +// explicit name tag as per the previous rule, unmarshal maps +// the sub-element to that struct field. +// +// * If the XML element contains a sub-element whose name matches a +// field without any mode flags (",attr", ",chardata", etc), Unmarshal +// maps the sub-element to that struct field. +// +// * If the XML element contains a sub-element that hasn't matched any +// of the above rules and the struct has a field with tag ",any", +// unmarshal maps the sub-element to that struct field. +// +// * An anonymous struct field is handled as if the fields of its +// value were part of the outer struct. +// +// * A struct field with tag "-" is never unmarshalled into. +// +// Unmarshal maps an XML element to a string or []byte by saving the +// concatenation of that element's character data in the string or +// []byte. The saved []byte is never nil. +// +// Unmarshal maps an attribute value to a string or []byte by saving +// the value in the string or slice. +// +// Unmarshal maps an XML element to a slice by extending the length of +// the slice and mapping the element to the newly created value. +// +// Unmarshal maps an XML element or attribute value to a bool by +// setting it to the boolean value represented by the string. +// +// Unmarshal maps an XML element or attribute value to an integer or +// floating-point field by setting the field to the result of +// interpreting the string value in decimal. There is no check for +// overflow. +// +// Unmarshal maps an XML element to an xml.Name by recording the +// element name. +// +// Unmarshal maps an XML element to a pointer by setting the pointer +// to a freshly allocated value and then mapping the element to that value. +// +func Unmarshal(data []byte, v interface{}) error { + return NewDecoder(bytes.NewReader(data)).Decode(v) +} + +// Decode works like xml.Unmarshal, except it reads the decoder +// stream to find the start element. +func (d *Decoder) Decode(v interface{}) error { + return d.DecodeElement(v, nil) +} + +// DecodeElement works like xml.Unmarshal except that it takes +// a pointer to the start XML element to decode into v. +// It is useful when a client reads some raw XML tokens itself +// but also wants to defer to Unmarshal for some elements. +func (d *Decoder) DecodeElement(v interface{}, start *StartElement) error { + val := reflect.ValueOf(v) + if val.Kind() != reflect.Ptr { + return errors.New("non-pointer passed to Unmarshal") + } + return d.unmarshal(val.Elem(), start) +} + +// An UnmarshalError represents an error in the unmarshalling process. +type UnmarshalError string + +func (e UnmarshalError) Error() string { return string(e) } + +// Unmarshaler is the interface implemented by objects that can unmarshal +// an XML element description of themselves. +// +// UnmarshalXML decodes a single XML element +// beginning with the given start element. +// If it returns an error, the outer call to Unmarshal stops and +// returns that error. +// UnmarshalXML must consume exactly one XML element. +// One common implementation strategy is to unmarshal into +// a separate value with a layout matching the expected XML +// using d.DecodeElement, and then to copy the data from +// that value into the receiver. +// Another common strategy is to use d.Token to process the +// XML object one token at a time. +// UnmarshalXML may not use d.RawToken. +type Unmarshaler interface { + UnmarshalXML(d *Decoder, start StartElement) error +} + +// UnmarshalerAttr is the interface implemented by objects that can unmarshal +// an XML attribute description of themselves. +// +// UnmarshalXMLAttr decodes a single XML attribute. +// If it returns an error, the outer call to Unmarshal stops and +// returns that error. +// UnmarshalXMLAttr is used only for struct fields with the +// "attr" option in the field tag. +type UnmarshalerAttr interface { + UnmarshalXMLAttr(attr Attr) error +} + +// receiverType returns the receiver type to use in an expression like "%s.MethodName". +func receiverType(val interface{}) string { + t := reflect.TypeOf(val) + if t.Name() != "" { + return t.String() + } + return "(" + t.String() + ")" +} + +// unmarshalInterface unmarshals a single XML element into val. +// start is the opening tag of the element. +func (p *Decoder) unmarshalInterface(val Unmarshaler, start *StartElement) error { + // Record that decoder must stop at end tag corresponding to start. + p.pushEOF() + + p.unmarshalDepth++ + err := val.UnmarshalXML(p, *start) + p.unmarshalDepth-- + if err != nil { + p.popEOF() + return err + } + + if !p.popEOF() { + return fmt.Errorf("xml: %s.UnmarshalXML did not consume entire <%s> element", receiverType(val), start.Name.Local) + } + + return nil +} + +// unmarshalTextInterface unmarshals a single XML element into val. +// The chardata contained in the element (but not its children) +// is passed to the text unmarshaler. +func (p *Decoder) unmarshalTextInterface(val encoding.TextUnmarshaler, start *StartElement) error { + var buf []byte + depth := 1 + for depth > 0 { + t, err := p.Token() + if err != nil { + return err + } + switch t := t.(type) { + case CharData: + if depth == 1 { + buf = append(buf, t...) + } + case StartElement: + depth++ + case EndElement: + depth-- + } + } + return val.UnmarshalText(buf) +} + +// unmarshalAttr unmarshals a single XML attribute into val. +func (p *Decoder) unmarshalAttr(val reflect.Value, attr Attr) error { + if val.Kind() == reflect.Ptr { + if val.IsNil() { + val.Set(reflect.New(val.Type().Elem())) + } + val = val.Elem() + } + + if val.CanInterface() && val.Type().Implements(unmarshalerAttrType) { + // This is an unmarshaler with a non-pointer receiver, + // so it's likely to be incorrect, but we do what we're told. + return val.Interface().(UnmarshalerAttr).UnmarshalXMLAttr(attr) + } + if val.CanAddr() { + pv := val.Addr() + if pv.CanInterface() && pv.Type().Implements(unmarshalerAttrType) { + return pv.Interface().(UnmarshalerAttr).UnmarshalXMLAttr(attr) + } + } + + // Not an UnmarshalerAttr; try encoding.TextUnmarshaler. + if val.CanInterface() && val.Type().Implements(textUnmarshalerType) { + // This is an unmarshaler with a non-pointer receiver, + // so it's likely to be incorrect, but we do what we're told. + return val.Interface().(encoding.TextUnmarshaler).UnmarshalText([]byte(attr.Value)) + } + if val.CanAddr() { + pv := val.Addr() + if pv.CanInterface() && pv.Type().Implements(textUnmarshalerType) { + return pv.Interface().(encoding.TextUnmarshaler).UnmarshalText([]byte(attr.Value)) + } + } + + copyValue(val, []byte(attr.Value)) + return nil +} + +var ( + unmarshalerType = reflect.TypeOf((*Unmarshaler)(nil)).Elem() + unmarshalerAttrType = reflect.TypeOf((*UnmarshalerAttr)(nil)).Elem() + textUnmarshalerType = reflect.TypeOf((*encoding.TextUnmarshaler)(nil)).Elem() +) + +// Find reflect.Type for an element's type attribute. +func (p *Decoder) typeForElement(val reflect.Value, start *StartElement) reflect.Type { + t := "" + for i, a := range start.Attr { + if a.Name == xmlSchemaInstance { + t = a.Value + // HACK: ensure xsi:type is last in the list to avoid using that value for + // a "type" attribute, such as ManagedObjectReference.Type for example. + // Note that xsi:type is already the last attribute in VC/ESX responses. + // This is only an issue with govmomi simulator generated responses. + // Proper fix will require finding a few needles in this xml package haystack. + x := len(start.Attr) - 1 + if i != x { + start.Attr[i] = start.Attr[x] + start.Attr[x] = a + } + break + } + } + + if t == "" { + // No type attribute; fall back to looking up type by interface name. + t = val.Type().Name() + } + + // Maybe the type is a basic xsd:* type. + typ := stringToType(t) + if typ != nil { + return typ + } + + // Maybe the type is a custom type. + if p.TypeFunc != nil { + if typ, ok := p.TypeFunc(t); ok { + return typ + } + } + + return nil +} + +// Unmarshal a single XML element into val. +func (p *Decoder) unmarshal(val reflect.Value, start *StartElement) error { + // Find start element if we need it. + if start == nil { + for { + tok, err := p.Token() + if err != nil { + return err + } + if t, ok := tok.(StartElement); ok { + start = &t + break + } + } + } + + // Try to figure out type for empty interface values. + if val.Kind() == reflect.Interface && val.IsNil() { + typ := p.typeForElement(val, start) + if typ != nil { + pval := reflect.New(typ).Elem() + err := p.unmarshal(pval, start) + if err != nil { + return err + } + + for i := 0; i < 2; i++ { + if typ.Implements(val.Type()) { + val.Set(pval) + return nil + } + + typ = reflect.PtrTo(typ) + pval = pval.Addr() + } + + val.Set(pval) + return nil + } + } + + // Load value from interface, but only if the result will be + // usefully addressable. + if val.Kind() == reflect.Interface && !val.IsNil() { + e := val.Elem() + if e.Kind() == reflect.Ptr && !e.IsNil() { + val = e + } + } + + if val.Kind() == reflect.Ptr { + if val.IsNil() { + val.Set(reflect.New(val.Type().Elem())) + } + val = val.Elem() + } + + if val.CanInterface() && val.Type().Implements(unmarshalerType) { + // This is an unmarshaler with a non-pointer receiver, + // so it's likely to be incorrect, but we do what we're told. + return p.unmarshalInterface(val.Interface().(Unmarshaler), start) + } + + if val.CanAddr() { + pv := val.Addr() + if pv.CanInterface() && pv.Type().Implements(unmarshalerType) { + return p.unmarshalInterface(pv.Interface().(Unmarshaler), start) + } + } + + if val.CanInterface() && val.Type().Implements(textUnmarshalerType) { + return p.unmarshalTextInterface(val.Interface().(encoding.TextUnmarshaler), start) + } + + if val.CanAddr() { + pv := val.Addr() + if pv.CanInterface() && pv.Type().Implements(textUnmarshalerType) { + return p.unmarshalTextInterface(pv.Interface().(encoding.TextUnmarshaler), start) + } + } + + var ( + data []byte + saveData reflect.Value + comment []byte + saveComment reflect.Value + saveXML reflect.Value + saveXMLIndex int + saveXMLData []byte + saveAny reflect.Value + sv reflect.Value + tinfo *typeInfo + err error + ) + + switch v := val; v.Kind() { + default: + return errors.New("unknown type " + v.Type().String()) + + case reflect.Interface: + // TODO: For now, simply ignore the field. In the near + // future we may choose to unmarshal the start + // element on it, if not nil. + return p.Skip() + + case reflect.Slice: + typ := v.Type() + if typ.Elem().Kind() == reflect.Uint8 { + // []byte + saveData = v + break + } + + // Slice of element values. + // Grow slice. + n := v.Len() + if n >= v.Cap() { + ncap := 2 * n + if ncap < 4 { + ncap = 4 + } + new := reflect.MakeSlice(typ, n, ncap) + reflect.Copy(new, v) + v.Set(new) + } + v.SetLen(n + 1) + + // Recur to read element into slice. + if err := p.unmarshal(v.Index(n), start); err != nil { + v.SetLen(n) + return err + } + return nil + + case reflect.Bool, reflect.Float32, reflect.Float64, reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr, reflect.String: + saveData = v + + case reflect.Struct: + typ := v.Type() + if typ == nameType { + v.Set(reflect.ValueOf(start.Name)) + break + } + + sv = v + tinfo, err = getTypeInfo(typ) + if err != nil { + return err + } + + // Validate and assign element name. + if tinfo.xmlname != nil { + finfo := tinfo.xmlname + if finfo.name != "" && finfo.name != start.Name.Local { + return UnmarshalError("expected element type <" + finfo.name + "> but have <" + start.Name.Local + ">") + } + if finfo.xmlns != "" && finfo.xmlns != start.Name.Space { + e := "expected element <" + finfo.name + "> in name space " + finfo.xmlns + " but have " + if start.Name.Space == "" { + e += "no name space" + } else { + e += start.Name.Space + } + return UnmarshalError(e) + } + fv := finfo.value(sv) + if _, ok := fv.Interface().(Name); ok { + fv.Set(reflect.ValueOf(start.Name)) + } + } + + // Assign attributes. + // Also, determine whether we need to save character data or comments. + for i := range tinfo.fields { + finfo := &tinfo.fields[i] + switch finfo.flags & fMode { + case fAttr: + strv := finfo.value(sv) + // Look for attribute. + for _, a := range start.Attr { + if a.Name.Local == finfo.name && (finfo.xmlns == "" || finfo.xmlns == a.Name.Space) { + if err := p.unmarshalAttr(strv, a); err != nil { + return err + } + break + } + } + + case fCharData: + if !saveData.IsValid() { + saveData = finfo.value(sv) + } + + case fComment: + if !saveComment.IsValid() { + saveComment = finfo.value(sv) + } + + case fAny, fAny | fElement: + if !saveAny.IsValid() { + saveAny = finfo.value(sv) + } + + case fInnerXml: + if !saveXML.IsValid() { + saveXML = finfo.value(sv) + if p.saved == nil { + saveXMLIndex = 0 + p.saved = new(bytes.Buffer) + } else { + saveXMLIndex = p.savedOffset() + } + } + } + } + } + + // Find end element. + // Process sub-elements along the way. +Loop: + for { + var savedOffset int + if saveXML.IsValid() { + savedOffset = p.savedOffset() + } + tok, err := p.Token() + if err != nil { + return err + } + switch t := tok.(type) { + case StartElement: + consumed := false + if sv.IsValid() { + consumed, err = p.unmarshalPath(tinfo, sv, nil, &t) + if err != nil { + return err + } + if !consumed && saveAny.IsValid() { + consumed = true + if err := p.unmarshal(saveAny, &t); err != nil { + return err + } + } + } + if !consumed { + if err := p.Skip(); err != nil { + return err + } + } + + case EndElement: + if saveXML.IsValid() { + saveXMLData = p.saved.Bytes()[saveXMLIndex:savedOffset] + if saveXMLIndex == 0 { + p.saved = nil + } + } + break Loop + + case CharData: + if saveData.IsValid() { + data = append(data, t...) + } + + case Comment: + if saveComment.IsValid() { + comment = append(comment, t...) + } + } + } + + if saveData.IsValid() && saveData.CanInterface() && saveData.Type().Implements(textUnmarshalerType) { + if err := saveData.Interface().(encoding.TextUnmarshaler).UnmarshalText(data); err != nil { + return err + } + saveData = reflect.Value{} + } + + if saveData.IsValid() && saveData.CanAddr() { + pv := saveData.Addr() + if pv.CanInterface() && pv.Type().Implements(textUnmarshalerType) { + if err := pv.Interface().(encoding.TextUnmarshaler).UnmarshalText(data); err != nil { + return err + } + saveData = reflect.Value{} + } + } + + if err := copyValue(saveData, data); err != nil { + return err + } + + switch t := saveComment; t.Kind() { + case reflect.String: + t.SetString(string(comment)) + case reflect.Slice: + t.Set(reflect.ValueOf(comment)) + } + + switch t := saveXML; t.Kind() { + case reflect.String: + t.SetString(string(saveXMLData)) + case reflect.Slice: + t.Set(reflect.ValueOf(saveXMLData)) + } + + return nil +} + +func copyValue(dst reflect.Value, src []byte) (err error) { + dst0 := dst + + if dst.Kind() == reflect.Ptr { + if dst.IsNil() { + dst.Set(reflect.New(dst.Type().Elem())) + } + dst = dst.Elem() + } + + // Save accumulated data. + switch dst.Kind() { + case reflect.Invalid: + // Probably a comment. + default: + return errors.New("cannot unmarshal into " + dst0.Type().String()) + case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: + itmp, err := strconv.ParseInt(string(src), 10, dst.Type().Bits()) + if err != nil { + return err + } + dst.SetInt(itmp) + case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: + var utmp uint64 + if len(src) > 0 && src[0] == '-' { + // Negative value for unsigned field. + // Assume it was serialized following two's complement. + itmp, err := strconv.ParseInt(string(src), 10, dst.Type().Bits()) + if err != nil { + return err + } + // Reinterpret value based on type width. + switch dst.Type().Bits() { + case 8: + utmp = uint64(uint8(itmp)) + case 16: + utmp = uint64(uint16(itmp)) + case 32: + utmp = uint64(uint32(itmp)) + case 64: + utmp = uint64(uint64(itmp)) + } + } else { + utmp, err = strconv.ParseUint(string(src), 10, dst.Type().Bits()) + if err != nil { + return err + } + } + dst.SetUint(utmp) + case reflect.Float32, reflect.Float64: + ftmp, err := strconv.ParseFloat(string(src), dst.Type().Bits()) + if err != nil { + return err + } + dst.SetFloat(ftmp) + case reflect.Bool: + value, err := strconv.ParseBool(strings.TrimSpace(string(src))) + if err != nil { + return err + } + dst.SetBool(value) + case reflect.String: + dst.SetString(string(src)) + case reflect.Slice: + if len(src) == 0 { + // non-nil to flag presence + src = []byte{} + } + dst.SetBytes(src) + } + return nil +} + +// unmarshalPath walks down an XML structure looking for wanted +// paths, and calls unmarshal on them. +// The consumed result tells whether XML elements have been consumed +// from the Decoder until start's matching end element, or if it's +// still untouched because start is uninteresting for sv's fields. +func (p *Decoder) unmarshalPath(tinfo *typeInfo, sv reflect.Value, parents []string, start *StartElement) (consumed bool, err error) { + recurse := false +Loop: + for i := range tinfo.fields { + finfo := &tinfo.fields[i] + if finfo.flags&fElement == 0 || len(finfo.parents) < len(parents) || finfo.xmlns != "" && finfo.xmlns != start.Name.Space { + continue + } + for j := range parents { + if parents[j] != finfo.parents[j] { + continue Loop + } + } + if len(finfo.parents) == len(parents) && finfo.name == start.Name.Local { + // It's a perfect match, unmarshal the field. + return true, p.unmarshal(finfo.value(sv), start) + } + if len(finfo.parents) > len(parents) && finfo.parents[len(parents)] == start.Name.Local { + // It's a prefix for the field. Break and recurse + // since it's not ok for one field path to be itself + // the prefix for another field path. + recurse = true + + // We can reuse the same slice as long as we + // don't try to append to it. + parents = finfo.parents[:len(parents)+1] + break + } + } + if !recurse { + // We have no business with this element. + return false, nil + } + // The element is not a perfect match for any field, but one + // or more fields have the path to this element as a parent + // prefix. Recurse and attempt to match these. + for { + var tok Token + tok, err = p.Token() + if err != nil { + return true, err + } + switch t := tok.(type) { + case StartElement: + consumed2, err := p.unmarshalPath(tinfo, sv, parents, &t) + if err != nil { + return true, err + } + if !consumed2 { + if err := p.Skip(); err != nil { + return true, err + } + } + case EndElement: + return true, nil + } + } +} + +// Skip reads tokens until it has consumed the end element +// matching the most recent start element already consumed. +// It recurs if it encounters a start element, so it can be used to +// skip nested structures. +// It returns nil if it finds an end element matching the start +// element; otherwise it returns an error describing the problem. +func (d *Decoder) Skip() error { + for { + tok, err := d.Token() + if err != nil { + return err + } + switch tok.(type) { + case StartElement: + if err := d.Skip(); err != nil { + return err + } + case EndElement: + return nil + } + } +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/vim25/xml/read_test.go juju-core-2.0.2/src/github.com/vmware/govmomi/vim25/xml/read_test.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/vim25/xml/read_test.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/vim25/xml/read_test.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,762 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package xml + +import ( + "io" + "reflect" + "strings" + "testing" + "time" +) + +// Stripped down Atom feed data structures. + +func TestUnmarshalFeed(t *testing.T) { + var f Feed + if err := Unmarshal([]byte(atomFeedString), &f); err != nil { + t.Fatalf("Unmarshal: %s", err) + } + if !reflect.DeepEqual(f, atomFeed) { + t.Fatalf("have %#v\nwant %#v", f, atomFeed) + } +} + +// hget http://codereview.appspot.com/rss/mine/rsc +const atomFeedString = ` + +Code Review - My issueshttp://codereview.appspot.com/rietveld<>rietveld: an attempt at pubsubhubbub +2009-10-04T01:35:58+00:00email-address-removedurn:md5:134d9179c41f806be79b3a5f7877d19a + An attempt at adding pubsubhubbub support to Rietveld. +http://code.google.com/p/pubsubhubbub +http://code.google.com/p/rietveld/issues/detail?id=155 + +The server side of the protocol is trivial: + 1. add a &lt;link rel=&quot;hub&quot; href=&quot;hub-server&quot;&gt; tag to all + feeds that will be pubsubhubbubbed. + 2. every time one of those feeds changes, tell the hub + with a simple POST request. + +I have tested this by adding debug prints to a local hub +server and checking that the server got the right publish +requests. + +I can&#39;t quite get the server to work, but I think the bug +is not in my code. I think that the server expects to be +able to grab the feed and see the feed&#39;s actual URL in +the link rel=&quot;self&quot;, but the default value for that drops +the :port from the URL, and I cannot for the life of me +figure out how to get the Atom generator deep inside +django not to do that, or even where it is doing that, +or even what code is running to generate the Atom feed. +(I thought I knew but I added some assert False statements +and it kept running!) + +Ignoring that particular problem, I would appreciate +feedback on the right way to get the two values at +the top of feeds.py marked NOTE(rsc). + + +rietveld: correct tab handling +2009-10-03T23:02:17+00:00email-address-removedurn:md5:0a2a4f19bb815101f0ba2904aed7c35a + This fixes the buggy tab rendering that can be seen at +http://codereview.appspot.com/116075/diff/1/2 + +The fundamental problem was that the tab code was +not being told what column the text began in, so it +didn&#39;t know where to put the tab stops. Another problem +was that some of the code assumed that string byte +offsets were the same as column offsets, which is only +true if there are no tabs. + +In the process of fixing this, I cleaned up the arguments +to Fold and ExpandTabs and renamed them Break and +_ExpandTabs so that I could be sure that I found all the +call sites. I also wanted to verify that ExpandTabs was +not being used from outside intra_region_diff.py. + + + ` + +type Feed struct { + XMLName Name `xml:"http://www.w3.org/2005/Atom feed"` + Title string `xml:"title"` + Id string `xml:"id"` + Link []Link `xml:"link"` + Updated time.Time `xml:"updated,attr"` + Author Person `xml:"author"` + Entry []Entry `xml:"entry"` +} + +type Entry struct { + Title string `xml:"title"` + Id string `xml:"id"` + Link []Link `xml:"link"` + Updated time.Time `xml:"updated"` + Author Person `xml:"author"` + Summary Text `xml:"summary"` +} + +type Link struct { + Rel string `xml:"rel,attr,omitempty"` + Href string `xml:"href,attr"` +} + +type Person struct { + Name string `xml:"name"` + URI string `xml:"uri"` + Email string `xml:"email"` + InnerXML string `xml:",innerxml"` +} + +type Text struct { + Type string `xml:"type,attr,omitempty"` + Body string `xml:",chardata"` +} + +var atomFeed = Feed{ + XMLName: Name{"http://www.w3.org/2005/Atom", "feed"}, + Title: "Code Review - My issues", + Link: []Link{ + {Rel: "alternate", Href: "http://codereview.appspot.com/"}, + {Rel: "self", Href: "http://codereview.appspot.com/rss/mine/rsc"}, + }, + Id: "http://codereview.appspot.com/", + Updated: ParseTime("2009-10-04T01:35:58+00:00"), + Author: Person{ + Name: "rietveld<>", + InnerXML: "rietveld<>", + }, + Entry: []Entry{ + { + Title: "rietveld: an attempt at pubsubhubbub\n", + Link: []Link{ + {Rel: "alternate", Href: "http://codereview.appspot.com/126085"}, + }, + Updated: ParseTime("2009-10-04T01:35:58+00:00"), + Author: Person{ + Name: "email-address-removed", + InnerXML: "email-address-removed", + }, + Id: "urn:md5:134d9179c41f806be79b3a5f7877d19a", + Summary: Text{ + Type: "html", + Body: ` + An attempt at adding pubsubhubbub support to Rietveld. +http://code.google.com/p/pubsubhubbub +http://code.google.com/p/rietveld/issues/detail?id=155 + +The server side of the protocol is trivial: + 1. add a <link rel="hub" href="hub-server"> tag to all + feeds that will be pubsubhubbubbed. + 2. every time one of those feeds changes, tell the hub + with a simple POST request. + +I have tested this by adding debug prints to a local hub +server and checking that the server got the right publish +requests. + +I can't quite get the server to work, but I think the bug +is not in my code. I think that the server expects to be +able to grab the feed and see the feed's actual URL in +the link rel="self", but the default value for that drops +the :port from the URL, and I cannot for the life of me +figure out how to get the Atom generator deep inside +django not to do that, or even where it is doing that, +or even what code is running to generate the Atom feed. +(I thought I knew but I added some assert False statements +and it kept running!) + +Ignoring that particular problem, I would appreciate +feedback on the right way to get the two values at +the top of feeds.py marked NOTE(rsc). + + +`, + }, + }, + { + Title: "rietveld: correct tab handling\n", + Link: []Link{ + {Rel: "alternate", Href: "http://codereview.appspot.com/124106"}, + }, + Updated: ParseTime("2009-10-03T23:02:17+00:00"), + Author: Person{ + Name: "email-address-removed", + InnerXML: "email-address-removed", + }, + Id: "urn:md5:0a2a4f19bb815101f0ba2904aed7c35a", + Summary: Text{ + Type: "html", + Body: ` + This fixes the buggy tab rendering that can be seen at +http://codereview.appspot.com/116075/diff/1/2 + +The fundamental problem was that the tab code was +not being told what column the text began in, so it +didn't know where to put the tab stops. Another problem +was that some of the code assumed that string byte +offsets were the same as column offsets, which is only +true if there are no tabs. + +In the process of fixing this, I cleaned up the arguments +to Fold and ExpandTabs and renamed them Break and +_ExpandTabs so that I could be sure that I found all the +call sites. I also wanted to verify that ExpandTabs was +not being used from outside intra_region_diff.py. + + +`, + }, + }, + }, +} + +const pathTestString = ` + + 1 + + + A + + + B + + + C + D + + <_> + E + + + 2 + +` + +type PathTestItem struct { + Value string +} + +type PathTestA struct { + Items []PathTestItem `xml:">Item1"` + Before, After string +} + +type PathTestB struct { + Other []PathTestItem `xml:"Items>Item1"` + Before, After string +} + +type PathTestC struct { + Values1 []string `xml:"Items>Item1>Value"` + Values2 []string `xml:"Items>Item2>Value"` + Before, After string +} + +type PathTestSet struct { + Item1 []PathTestItem +} + +type PathTestD struct { + Other PathTestSet `xml:"Items"` + Before, After string +} + +type PathTestE struct { + Underline string `xml:"Items>_>Value"` + Before, After string +} + +var pathTests = []interface{}{ + &PathTestA{Items: []PathTestItem{{"A"}, {"D"}}, Before: "1", After: "2"}, + &PathTestB{Other: []PathTestItem{{"A"}, {"D"}}, Before: "1", After: "2"}, + &PathTestC{Values1: []string{"A", "C", "D"}, Values2: []string{"B"}, Before: "1", After: "2"}, + &PathTestD{Other: PathTestSet{Item1: []PathTestItem{{"A"}, {"D"}}}, Before: "1", After: "2"}, + &PathTestE{Underline: "E", Before: "1", After: "2"}, +} + +func TestUnmarshalPaths(t *testing.T) { + for _, pt := range pathTests { + v := reflect.New(reflect.TypeOf(pt).Elem()).Interface() + if err := Unmarshal([]byte(pathTestString), v); err != nil { + t.Fatalf("Unmarshal: %s", err) + } + if !reflect.DeepEqual(v, pt) { + t.Fatalf("have %#v\nwant %#v", v, pt) + } + } +} + +type BadPathTestA struct { + First string `xml:"items>item1"` + Other string `xml:"items>item2"` + Second string `xml:"items"` +} + +type BadPathTestB struct { + Other string `xml:"items>item2>value"` + First string `xml:"items>item1"` + Second string `xml:"items>item1>value"` +} + +type BadPathTestC struct { + First string + Second string `xml:"First"` +} + +type BadPathTestD struct { + BadPathEmbeddedA + BadPathEmbeddedB +} + +type BadPathEmbeddedA struct { + First string +} + +type BadPathEmbeddedB struct { + Second string `xml:"First"` +} + +var badPathTests = []struct { + v, e interface{} +}{ + {&BadPathTestA{}, &TagPathError{reflect.TypeOf(BadPathTestA{}), "First", "items>item1", "Second", "items"}}, + {&BadPathTestB{}, &TagPathError{reflect.TypeOf(BadPathTestB{}), "First", "items>item1", "Second", "items>item1>value"}}, + {&BadPathTestC{}, &TagPathError{reflect.TypeOf(BadPathTestC{}), "First", "", "Second", "First"}}, + {&BadPathTestD{}, &TagPathError{reflect.TypeOf(BadPathTestD{}), "First", "", "Second", "First"}}, +} + +func TestUnmarshalBadPaths(t *testing.T) { + for _, tt := range badPathTests { + err := Unmarshal([]byte(pathTestString), tt.v) + if !reflect.DeepEqual(err, tt.e) { + t.Fatalf("Unmarshal with %#v didn't fail properly:\nhave %#v,\nwant %#v", tt.v, err, tt.e) + } + } +} + +const OK = "OK" +const withoutNameTypeData = ` + +` + +type TestThree struct { + XMLName Name `xml:"Test3"` + Attr string `xml:",attr"` +} + +func TestUnmarshalWithoutNameType(t *testing.T) { + var x TestThree + if err := Unmarshal([]byte(withoutNameTypeData), &x); err != nil { + t.Fatalf("Unmarshal: %s", err) + } + if x.Attr != OK { + t.Fatalf("have %v\nwant %v", x.Attr, OK) + } +} + +func TestUnmarshalAttr(t *testing.T) { + type ParamVal struct { + Int int `xml:"int,attr"` + } + + type ParamPtr struct { + Int *int `xml:"int,attr"` + } + + type ParamStringPtr struct { + Int *string `xml:"int,attr"` + } + + x := []byte(``) + + p1 := &ParamPtr{} + if err := Unmarshal(x, p1); err != nil { + t.Fatalf("Unmarshal: %s", err) + } + if p1.Int == nil { + t.Fatalf("Unmarshal failed in to *int field") + } else if *p1.Int != 1 { + t.Fatalf("Unmarshal with %s failed:\nhave %#v,\n want %#v", x, p1.Int, 1) + } + + p2 := &ParamVal{} + if err := Unmarshal(x, p2); err != nil { + t.Fatalf("Unmarshal: %s", err) + } + if p2.Int != 1 { + t.Fatalf("Unmarshal with %s failed:\nhave %#v,\n want %#v", x, p2.Int, 1) + } + + p3 := &ParamStringPtr{} + if err := Unmarshal(x, p3); err != nil { + t.Fatalf("Unmarshal: %s", err) + } + if p3.Int == nil { + t.Fatalf("Unmarshal failed in to *string field") + } else if *p3.Int != "1" { + t.Fatalf("Unmarshal with %s failed:\nhave %#v,\n want %#v", x, p3.Int, 1) + } +} + +type Tables struct { + HTable string `xml:"http://www.w3.org/TR/html4/ table"` + FTable string `xml:"http://www.w3schools.com/furniture table"` +} + +var tables = []struct { + xml string + tab Tables + ns string +}{ + { + xml: `` + + `hello
` + + `world
` + + `
`, + tab: Tables{"hello", "world"}, + }, + { + xml: `` + + `world
` + + `hello
` + + `
`, + tab: Tables{"hello", "world"}, + }, + { + xml: `` + + `world` + + `hello` + + ``, + tab: Tables{"hello", "world"}, + }, + { + xml: `` + + `bogus
` + + `
`, + tab: Tables{}, + }, + { + xml: `` + + `only
` + + `
`, + tab: Tables{HTable: "only"}, + ns: "http://www.w3.org/TR/html4/", + }, + { + xml: `` + + `only
` + + `
`, + tab: Tables{FTable: "only"}, + ns: "http://www.w3schools.com/furniture", + }, + { + xml: `` + + `only
` + + `
`, + tab: Tables{}, + ns: "something else entirely", + }, +} + +func TestUnmarshalNS(t *testing.T) { + for i, tt := range tables { + var dst Tables + var err error + if tt.ns != "" { + d := NewDecoder(strings.NewReader(tt.xml)) + d.DefaultSpace = tt.ns + err = d.Decode(&dst) + } else { + err = Unmarshal([]byte(tt.xml), &dst) + } + if err != nil { + t.Errorf("#%d: Unmarshal: %v", i, err) + continue + } + want := tt.tab + if dst != want { + t.Errorf("#%d: dst=%+v, want %+v", i, dst, want) + } + } +} + +func TestMarshalNS(t *testing.T) { + dst := Tables{"hello", "world"} + data, err := Marshal(&dst) + if err != nil { + t.Fatalf("Marshal: %v", err) + } + want := `hello
world
` + str := string(data) + if str != want { + t.Errorf("have: %q\nwant: %q\n", str, want) + } +} + +type TableAttrs struct { + TAttr TAttr +} + +type TAttr struct { + HTable string `xml:"http://www.w3.org/TR/html4/ table,attr"` + FTable string `xml:"http://www.w3schools.com/furniture table,attr"` + Lang string `xml:"http://www.w3.org/XML/1998/namespace lang,attr,omitempty"` + Other1 string `xml:"http://golang.org/xml/ other,attr,omitempty"` + Other2 string `xml:"http://golang.org/xmlfoo/ other,attr,omitempty"` + Other3 string `xml:"http://golang.org/json/ other,attr,omitempty"` + Other4 string `xml:"http://golang.org/2/json/ other,attr,omitempty"` +} + +var tableAttrs = []struct { + xml string + tab TableAttrs + ns string +}{ + { + xml: ``, + tab: TableAttrs{TAttr{HTable: "hello", FTable: "world"}}, + }, + { + xml: ``, + tab: TableAttrs{TAttr{HTable: "hello", FTable: "world"}}, + }, + { + xml: ``, + tab: TableAttrs{TAttr{HTable: "hello", FTable: "world"}}, + }, + { + // Default space does not apply to attribute names. + xml: ``, + tab: TableAttrs{TAttr{HTable: "hello", FTable: ""}}, + }, + { + // Default space does not apply to attribute names. + xml: ``, + tab: TableAttrs{TAttr{HTable: "", FTable: "world"}}, + }, + { + xml: ``, + tab: TableAttrs{}, + }, + { + // Default space does not apply to attribute names. + xml: ``, + tab: TableAttrs{TAttr{HTable: "hello", FTable: ""}}, + ns: "http://www.w3schools.com/furniture", + }, + { + // Default space does not apply to attribute names. + xml: ``, + tab: TableAttrs{TAttr{HTable: "", FTable: "world"}}, + ns: "http://www.w3.org/TR/html4/", + }, + { + xml: ``, + tab: TableAttrs{}, + ns: "something else entirely", + }, +} + +func TestUnmarshalNSAttr(t *testing.T) { + for i, tt := range tableAttrs { + var dst TableAttrs + var err error + if tt.ns != "" { + d := NewDecoder(strings.NewReader(tt.xml)) + d.DefaultSpace = tt.ns + err = d.Decode(&dst) + } else { + err = Unmarshal([]byte(tt.xml), &dst) + } + if err != nil { + t.Errorf("#%d: Unmarshal: %v", i, err) + continue + } + want := tt.tab + if dst != want { + t.Errorf("#%d: dst=%+v, want %+v", i, dst, want) + } + } +} + +func TestMarshalNSAttr(t *testing.T) { + src := TableAttrs{TAttr{"hello", "world", "en_US", "other1", "other2", "other3", "other4"}} + data, err := Marshal(&src) + if err != nil { + t.Fatalf("Marshal: %v", err) + } + want := `` + str := string(data) + if str != want { + t.Errorf("Marshal:\nhave: %#q\nwant: %#q\n", str, want) + } + + var dst TableAttrs + if err := Unmarshal(data, &dst); err != nil { + t.Errorf("Unmarshal: %v", err) + } + + if dst != src { + t.Errorf("Unmarshal = %q, want %q", dst, src) + } +} + +type MyCharData struct { + body string +} + +func (m *MyCharData) UnmarshalXML(d *Decoder, start StartElement) error { + for { + t, err := d.Token() + if err == io.EOF { // found end of element + break + } + if err != nil { + return err + } + if char, ok := t.(CharData); ok { + m.body += string(char) + } + } + return nil +} + +var _ Unmarshaler = (*MyCharData)(nil) + +func (m *MyCharData) UnmarshalXMLAttr(attr Attr) error { + panic("must not call") +} + +type MyAttr struct { + attr string +} + +func (m *MyAttr) UnmarshalXMLAttr(attr Attr) error { + m.attr = attr.Value + return nil +} + +var _ UnmarshalerAttr = (*MyAttr)(nil) + +type MyStruct struct { + Data *MyCharData + Attr *MyAttr `xml:",attr"` + + Data2 MyCharData + Attr2 MyAttr `xml:",attr"` +} + +func TestUnmarshaler(t *testing.T) { + xml := ` + + hello world + howdy world + + ` + + var m MyStruct + if err := Unmarshal([]byte(xml), &m); err != nil { + t.Fatal(err) + } + + if m.Data == nil || m.Attr == nil || m.Data.body != "hello world" || m.Attr.attr != "attr1" || m.Data2.body != "howdy world" || m.Attr2.attr != "attr2" { + t.Errorf("m=%#+v\n", m) + } +} + +type Pea struct { + Cotelydon string +} + +type Pod struct { + Pea interface{} `xml:"Pea"` +} + +// https://code.google.com/p/go/issues/detail?id=6836 +func TestUnmarshalIntoInterface(t *testing.T) { + pod := new(Pod) + pod.Pea = new(Pea) + xml := `Green stuff` + err := Unmarshal([]byte(xml), pod) + if err != nil { + t.Fatalf("failed to unmarshal %q: %v", xml, err) + } + pea, ok := pod.Pea.(*Pea) + if !ok { + t.Fatalf("unmarshalled into wrong type: have %T want *Pea", pod.Pea) + } + have, want := pea.Cotelydon, "Green stuff" + if have != want { + t.Errorf("failed to unmarshal into interface, have %q want %q", have, want) + } +} + +// https://github.com/vmware/govmomi/issues/246 +func TestNegativeValuesUnsignedFields(t *testing.T) { + type T struct { + I string + O interface{} + U8 uint8 `xml:"u8"` + U16 uint16 `xml:"u16"` + U32 uint32 `xml:"u32"` + U64 uint64 `xml:"u64"` + } + + var tests = []T{ + {I: "-128", O: uint8(0x80)}, + {I: "-1", O: uint8(0xff)}, + {I: "-32768", O: uint16(0x8000)}, + {I: "-1", O: uint16(0xffff)}, + {I: "-2147483648", O: uint32(0x80000000)}, + {I: "-1", O: uint32(0xffffffff)}, + {I: "-9223372036854775808", O: uint64(0x8000000000000000)}, + {I: "-1", O: uint64(0xffffffffffffffff)}, + } + + for _, test := range tests { + err := Unmarshal([]byte(test.I), &test) + if err != nil { + t.Errorf("Unmarshal error: %v", err) + continue + } + + var expected = test.O + var actual interface{} + switch reflect.ValueOf(test.O).Type().Kind() { + case reflect.Uint8: + actual = test.U8 + case reflect.Uint16: + actual = test.U16 + case reflect.Uint32: + actual = test.U32 + case reflect.Uint64: + actual = test.U64 + } + + if !reflect.DeepEqual(actual, expected) { + t.Errorf("Actual: %v, expected: %v", actual, expected) + } + } +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/vim25/xml/typeinfo.go juju-core-2.0.2/src/github.com/vmware/govmomi/vim25/xml/typeinfo.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/vim25/xml/typeinfo.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/vim25/xml/typeinfo.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,366 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package xml + +import ( + "fmt" + "reflect" + "strings" + "sync" +) + +// typeInfo holds details for the xml representation of a type. +type typeInfo struct { + xmlname *fieldInfo + fields []fieldInfo +} + +// fieldInfo holds details for the xml representation of a single field. +type fieldInfo struct { + idx []int + name string + xmlns string + flags fieldFlags + parents []string +} + +type fieldFlags int + +const ( + fElement fieldFlags = 1 << iota + fAttr + fCharData + fInnerXml + fComment + fAny + + fOmitEmpty + fTypeAttr + + fMode = fElement | fAttr | fCharData | fInnerXml | fComment | fAny +) + +var tinfoMap = make(map[reflect.Type]*typeInfo) +var tinfoLock sync.RWMutex + +var nameType = reflect.TypeOf(Name{}) + +// getTypeInfo returns the typeInfo structure with details necessary +// for marshalling and unmarshalling typ. +func getTypeInfo(typ reflect.Type) (*typeInfo, error) { + tinfoLock.RLock() + tinfo, ok := tinfoMap[typ] + tinfoLock.RUnlock() + if ok { + return tinfo, nil + } + tinfo = &typeInfo{} + if typ.Kind() == reflect.Struct && typ != nameType { + n := typ.NumField() + for i := 0; i < n; i++ { + f := typ.Field(i) + if f.PkgPath != "" || f.Tag.Get("xml") == "-" { + continue // Private field + } + + // For embedded structs, embed its fields. + if f.Anonymous { + t := f.Type + if t.Kind() == reflect.Ptr { + t = t.Elem() + } + if t.Kind() == reflect.Struct { + inner, err := getTypeInfo(t) + if err != nil { + return nil, err + } + if tinfo.xmlname == nil { + tinfo.xmlname = inner.xmlname + } + for _, finfo := range inner.fields { + finfo.idx = append([]int{i}, finfo.idx...) + if err := addFieldInfo(typ, tinfo, &finfo); err != nil { + return nil, err + } + } + continue + } + } + + finfo, err := structFieldInfo(typ, &f) + if err != nil { + return nil, err + } + + if f.Name == "XMLName" { + tinfo.xmlname = finfo + continue + } + + // Add the field if it doesn't conflict with other fields. + if err := addFieldInfo(typ, tinfo, finfo); err != nil { + return nil, err + } + } + } + tinfoLock.Lock() + tinfoMap[typ] = tinfo + tinfoLock.Unlock() + return tinfo, nil +} + +// structFieldInfo builds and returns a fieldInfo for f. +func structFieldInfo(typ reflect.Type, f *reflect.StructField) (*fieldInfo, error) { + finfo := &fieldInfo{idx: f.Index} + + // Split the tag from the xml namespace if necessary. + tag := f.Tag.Get("xml") + if i := strings.Index(tag, " "); i >= 0 { + finfo.xmlns, tag = tag[:i], tag[i+1:] + } + + // Parse flags. + tokens := strings.Split(tag, ",") + if len(tokens) == 1 { + finfo.flags = fElement + } else { + tag = tokens[0] + for _, flag := range tokens[1:] { + switch flag { + case "attr": + finfo.flags |= fAttr + case "chardata": + finfo.flags |= fCharData + case "innerxml": + finfo.flags |= fInnerXml + case "comment": + finfo.flags |= fComment + case "any": + finfo.flags |= fAny + case "omitempty": + finfo.flags |= fOmitEmpty + case "typeattr": + finfo.flags |= fTypeAttr + } + } + + // Validate the flags used. + valid := true + switch mode := finfo.flags & fMode; mode { + case 0: + finfo.flags |= fElement + case fAttr, fCharData, fInnerXml, fComment, fAny: + if f.Name == "XMLName" || tag != "" && mode != fAttr { + valid = false + } + default: + // This will also catch multiple modes in a single field. + valid = false + } + if finfo.flags&fMode == fAny { + finfo.flags |= fElement + } + if finfo.flags&fOmitEmpty != 0 && finfo.flags&(fElement|fAttr) == 0 { + valid = false + } + if !valid { + return nil, fmt.Errorf("xml: invalid tag in field %s of type %s: %q", + f.Name, typ, f.Tag.Get("xml")) + } + } + + // Use of xmlns without a name is not allowed. + if finfo.xmlns != "" && tag == "" { + return nil, fmt.Errorf("xml: namespace without name in field %s of type %s: %q", + f.Name, typ, f.Tag.Get("xml")) + } + + if f.Name == "XMLName" { + // The XMLName field records the XML element name. Don't + // process it as usual because its name should default to + // empty rather than to the field name. + finfo.name = tag + return finfo, nil + } + + if tag == "" { + // If the name part of the tag is completely empty, get + // default from XMLName of underlying struct if feasible, + // or field name otherwise. + if xmlname := lookupXMLName(f.Type); xmlname != nil { + finfo.xmlns, finfo.name = xmlname.xmlns, xmlname.name + } else { + finfo.name = f.Name + } + return finfo, nil + } + + // Prepare field name and parents. + parents := strings.Split(tag, ">") + if parents[0] == "" { + parents[0] = f.Name + } + if parents[len(parents)-1] == "" { + return nil, fmt.Errorf("xml: trailing '>' in field %s of type %s", f.Name, typ) + } + finfo.name = parents[len(parents)-1] + if len(parents) > 1 { + if (finfo.flags & fElement) == 0 { + return nil, fmt.Errorf("xml: %s chain not valid with %s flag", tag, strings.Join(tokens[1:], ",")) + } + finfo.parents = parents[:len(parents)-1] + } + + // If the field type has an XMLName field, the names must match + // so that the behavior of both marshalling and unmarshalling + // is straightforward and unambiguous. + if finfo.flags&fElement != 0 { + ftyp := f.Type + xmlname := lookupXMLName(ftyp) + if xmlname != nil && xmlname.name != finfo.name { + return nil, fmt.Errorf("xml: name %q in tag of %s.%s conflicts with name %q in %s.XMLName", + finfo.name, typ, f.Name, xmlname.name, ftyp) + } + } + return finfo, nil +} + +// lookupXMLName returns the fieldInfo for typ's XMLName field +// in case it exists and has a valid xml field tag, otherwise +// it returns nil. +func lookupXMLName(typ reflect.Type) (xmlname *fieldInfo) { + for typ.Kind() == reflect.Ptr { + typ = typ.Elem() + } + if typ.Kind() != reflect.Struct { + return nil + } + for i, n := 0, typ.NumField(); i < n; i++ { + f := typ.Field(i) + if f.Name != "XMLName" { + continue + } + finfo, err := structFieldInfo(typ, &f) + if finfo.name != "" && err == nil { + return finfo + } + // Also consider errors as a non-existent field tag + // and let getTypeInfo itself report the error. + break + } + return nil +} + +func min(a, b int) int { + if a <= b { + return a + } + return b +} + +// addFieldInfo adds finfo to tinfo.fields if there are no +// conflicts, or if conflicts arise from previous fields that were +// obtained from deeper embedded structures than finfo. In the latter +// case, the conflicting entries are dropped. +// A conflict occurs when the path (parent + name) to a field is +// itself a prefix of another path, or when two paths match exactly. +// It is okay for field paths to share a common, shorter prefix. +func addFieldInfo(typ reflect.Type, tinfo *typeInfo, newf *fieldInfo) error { + var conflicts []int +Loop: + // First, figure all conflicts. Most working code will have none. + for i := range tinfo.fields { + oldf := &tinfo.fields[i] + if oldf.flags&fMode != newf.flags&fMode { + continue + } + if oldf.xmlns != "" && newf.xmlns != "" && oldf.xmlns != newf.xmlns { + continue + } + minl := min(len(newf.parents), len(oldf.parents)) + for p := 0; p < minl; p++ { + if oldf.parents[p] != newf.parents[p] { + continue Loop + } + } + if len(oldf.parents) > len(newf.parents) { + if oldf.parents[len(newf.parents)] == newf.name { + conflicts = append(conflicts, i) + } + } else if len(oldf.parents) < len(newf.parents) { + if newf.parents[len(oldf.parents)] == oldf.name { + conflicts = append(conflicts, i) + } + } else { + if newf.name == oldf.name { + conflicts = append(conflicts, i) + } + } + } + // Without conflicts, add the new field and return. + if conflicts == nil { + tinfo.fields = append(tinfo.fields, *newf) + return nil + } + + // If any conflict is shallower, ignore the new field. + // This matches the Go field resolution on embedding. + for _, i := range conflicts { + if len(tinfo.fields[i].idx) < len(newf.idx) { + return nil + } + } + + // Otherwise, if any of them is at the same depth level, it's an error. + for _, i := range conflicts { + oldf := &tinfo.fields[i] + if len(oldf.idx) == len(newf.idx) { + f1 := typ.FieldByIndex(oldf.idx) + f2 := typ.FieldByIndex(newf.idx) + return &TagPathError{typ, f1.Name, f1.Tag.Get("xml"), f2.Name, f2.Tag.Get("xml")} + } + } + + // Otherwise, the new field is shallower, and thus takes precedence, + // so drop the conflicting fields from tinfo and append the new one. + for c := len(conflicts) - 1; c >= 0; c-- { + i := conflicts[c] + copy(tinfo.fields[i:], tinfo.fields[i+1:]) + tinfo.fields = tinfo.fields[:len(tinfo.fields)-1] + } + tinfo.fields = append(tinfo.fields, *newf) + return nil +} + +// A TagPathError represents an error in the unmarshalling process +// caused by the use of field tags with conflicting paths. +type TagPathError struct { + Struct reflect.Type + Field1, Tag1 string + Field2, Tag2 string +} + +func (e *TagPathError) Error() string { + return fmt.Sprintf("%s field %q with tag %q conflicts with field %q with tag %q", e.Struct, e.Field1, e.Tag1, e.Field2, e.Tag2) +} + +// value returns v's field value corresponding to finfo. +// It's equivalent to v.FieldByIndex(finfo.idx), but initializes +// and dereferences pointers as necessary. +func (finfo *fieldInfo) value(v reflect.Value) reflect.Value { + for i, x := range finfo.idx { + if i > 0 { + t := v.Type() + if t.Kind() == reflect.Ptr && t.Elem().Kind() == reflect.Struct { + if v.IsNil() { + v.Set(reflect.New(v.Type().Elem())) + } + v = v.Elem() + } + } + v = v.Field(x) + } + return v +} diff -Nru juju-core-2.0.0/src/github.com/vmware/govmomi/vim25/xml/xml.go juju-core-2.0.2/src/github.com/vmware/govmomi/vim25/xml/xml.go --- juju-core-2.0.0/src/github.com/vmware/govmomi/vim25/xml/xml.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/github.com/vmware/govmomi/vim25/xml/xml.go 2016-11-11 00:08:22.000000000 +0000 @@ -0,0 +1,1939 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package xml implements a simple XML 1.0 parser that +// understands XML name spaces. +package xml + +// References: +// Annotated XML spec: http://www.xml.com/axml/testaxml.htm +// XML name spaces: http://www.w3.org/TR/REC-xml-names/ + +// TODO(rsc): +// Test error handling. + +import ( + "bufio" + "bytes" + "errors" + "fmt" + "io" + "reflect" + "strconv" + "strings" + "unicode" + "unicode/utf8" +) + +// A SyntaxError represents a syntax error in the XML input stream. +type SyntaxError struct { + Msg string + Line int +} + +func (e *SyntaxError) Error() string { + return "XML syntax error on line " + strconv.Itoa(e.Line) + ": " + e.Msg +} + +// A Name represents an XML name (Local) annotated +// with a name space identifier (Space). +// In tokens returned by Decoder.Token, the Space identifier +// is given as a canonical URL, not the short prefix used +// in the document being parsed. +type Name struct { + Space, Local string +} + +// An Attr represents an attribute in an XML element (Name=Value). +type Attr struct { + Name Name + Value string +} + +// A Token is an interface holding one of the token types: +// StartElement, EndElement, CharData, Comment, ProcInst, or Directive. +type Token interface{} + +// A StartElement represents an XML start element. +type StartElement struct { + Name Name + Attr []Attr +} + +func (e StartElement) Copy() StartElement { + attrs := make([]Attr, len(e.Attr)) + copy(attrs, e.Attr) + e.Attr = attrs + return e +} + +// End returns the corresponding XML end element. +func (e StartElement) End() EndElement { + return EndElement{e.Name} +} + +// An EndElement represents an XML end element. +type EndElement struct { + Name Name +} + +// A CharData represents XML character data (raw text), +// in which XML escape sequences have been replaced by +// the characters they represent. +type CharData []byte + +func makeCopy(b []byte) []byte { + b1 := make([]byte, len(b)) + copy(b1, b) + return b1 +} + +func (c CharData) Copy() CharData { return CharData(makeCopy(c)) } + +// A Comment represents an XML comment of the form . +// The bytes do not include the comment markers. +type Comment []byte + +func (c Comment) Copy() Comment { return Comment(makeCopy(c)) } + +// A ProcInst represents an XML processing instruction of the form +type ProcInst struct { + Target string + Inst []byte +} + +func (p ProcInst) Copy() ProcInst { + p.Inst = makeCopy(p.Inst) + return p +} + +// A Directive represents an XML directive of the form . +// The bytes do not include the markers. +type Directive []byte + +func (d Directive) Copy() Directive { return Directive(makeCopy(d)) } + +// CopyToken returns a copy of a Token. +func CopyToken(t Token) Token { + switch v := t.(type) { + case CharData: + return v.Copy() + case Comment: + return v.Copy() + case Directive: + return v.Copy() + case ProcInst: + return v.Copy() + case StartElement: + return v.Copy() + } + return t +} + +// A Decoder represents an XML parser reading a particular input stream. +// The parser assumes that its input is encoded in UTF-8. +type Decoder struct { + // Strict defaults to true, enforcing the requirements + // of the XML specification. + // If set to false, the parser allows input containing common + // mistakes: + // * If an element is missing an end tag, the parser invents + // end tags as necessary to keep the return values from Token + // properly balanced. + // * In attribute values and character data, unknown or malformed + // character entities (sequences beginning with &) are left alone. + // + // Setting: + // + // d.Strict = false; + // d.AutoClose = HTMLAutoClose; + // d.Entity = HTMLEntity + // + // creates a parser that can handle typical HTML. + // + // Strict mode does not enforce the requirements of the XML name spaces TR. + // In particular it does not reject name space tags using undefined prefixes. + // Such tags are recorded with the unknown prefix as the name space URL. + Strict bool + + // When Strict == false, AutoClose indicates a set of elements to + // consider closed immediately after they are opened, regardless + // of whether an end element is present. + AutoClose []string + + // Entity can be used to map non-standard entity names to string replacements. + // The parser behaves as if these standard mappings are present in the map, + // regardless of the actual map content: + // + // "lt": "<", + // "gt": ">", + // "amp": "&", + // "apos": "'", + // "quot": `"`, + Entity map[string]string + + // CharsetReader, if non-nil, defines a function to generate + // charset-conversion readers, converting from the provided + // non-UTF-8 charset into UTF-8. If CharsetReader is nil or + // returns an error, parsing stops with an error. One of the + // the CharsetReader's result values must be non-nil. + CharsetReader func(charset string, input io.Reader) (io.Reader, error) + + // DefaultSpace sets the default name space used for unadorned tags, + // as if the entire XML stream were wrapped in an element containing + // the attribute xmlns="DefaultSpace". + DefaultSpace string + + // TypeFunc is used to map type names to actual types. + TypeFunc func(string) (reflect.Type, bool) + + r io.ByteReader + buf bytes.Buffer + saved *bytes.Buffer + stk *stack + free *stack + needClose bool + toClose Name + nextToken Token + nextByte int + ns map[string]string + err error + line int + unmarshalDepth int +} + +// NewDecoder creates a new XML parser reading from r. +// If r does not implement io.ByteReader, NewDecoder will +// do its own buffering. +func NewDecoder(r io.Reader) *Decoder { + d := &Decoder{ + ns: make(map[string]string), + nextByte: -1, + line: 1, + Strict: true, + } + d.switchToReader(r) + return d +} + +// Token returns the next XML token in the input stream. +// At the end of the input stream, Token returns nil, io.EOF. +// +// Slices of bytes in the returned token data refer to the +// parser's internal buffer and remain valid only until the next +// call to Token. To acquire a copy of the bytes, call CopyToken +// or the token's Copy method. +// +// Token expands self-closing elements such as
+// into separate start and end elements returned by successive calls. +// +// Token guarantees that the StartElement and EndElement +// tokens it returns are properly nested and matched: +// if Token encounters an unexpected end element, +// it will return an error. +// +// Token implements XML name spaces as described by +// http://www.w3.org/TR/REC-xml-names/. Each of the +// Name structures contained in the Token has the Space +// set to the URL identifying its name space when known. +// If Token encounters an unrecognized name space prefix, +// it uses the prefix as the Space rather than report an error. +func (d *Decoder) Token() (t Token, err error) { + if d.stk != nil && d.stk.kind == stkEOF { + err = io.EOF + return + } + if d.nextToken != nil { + t = d.nextToken + d.nextToken = nil + } else if t, err = d.rawToken(); err != nil { + return + } + + if !d.Strict { + if t1, ok := d.autoClose(t); ok { + d.nextToken = t + t = t1 + } + } + switch t1 := t.(type) { + case StartElement: + // In XML name spaces, the translations listed in the + // attributes apply to the element name and + // to the other attribute names, so process + // the translations first. + for _, a := range t1.Attr { + if a.Name.Space == "xmlns" { + v, ok := d.ns[a.Name.Local] + d.pushNs(a.Name.Local, v, ok) + d.ns[a.Name.Local] = a.Value + } + if a.Name.Space == "" && a.Name.Local == "xmlns" { + // Default space for untagged names + v, ok := d.ns[""] + d.pushNs("", v, ok) + d.ns[""] = a.Value + } + } + + d.translate(&t1.Name, true) + for i := range t1.Attr { + d.translate(&t1.Attr[i].Name, false) + } + d.pushElement(t1.Name) + t = t1 + + case EndElement: + d.translate(&t1.Name, true) + if !d.popElement(&t1) { + return nil, d.err + } + t = t1 + } + return +} + +const xmlURL = "http://www.w3.org/XML/1998/namespace" + +// Apply name space translation to name n. +// The default name space (for Space=="") +// applies only to element names, not to attribute names. +func (d *Decoder) translate(n *Name, isElementName bool) { + switch { + case n.Space == "xmlns": + return + case n.Space == "" && !isElementName: + return + case n.Space == "xml": + n.Space = xmlURL + case n.Space == "" && n.Local == "xmlns": + return + } + if v, ok := d.ns[n.Space]; ok { + n.Space = v + } else if n.Space == "" { + n.Space = d.DefaultSpace + } +} + +func (d *Decoder) switchToReader(r io.Reader) { + // Get efficient byte at a time reader. + // Assume that if reader has its own + // ReadByte, it's efficient enough. + // Otherwise, use bufio. + if rb, ok := r.(io.ByteReader); ok { + d.r = rb + } else { + d.r = bufio.NewReader(r) + } +} + +// Parsing state - stack holds old name space translations +// and the current set of open elements. The translations to pop when +// ending a given tag are *below* it on the stack, which is +// more work but forced on us by XML. +type stack struct { + next *stack + kind int + name Name + ok bool +} + +const ( + stkStart = iota + stkNs + stkEOF +) + +func (d *Decoder) push(kind int) *stack { + s := d.free + if s != nil { + d.free = s.next + } else { + s = new(stack) + } + s.next = d.stk + s.kind = kind + d.stk = s + return s +} + +func (d *Decoder) pop() *stack { + s := d.stk + if s != nil { + d.stk = s.next + s.next = d.free + d.free = s + } + return s +} + +// Record that after the current element is finished +// (that element is already pushed on the stack) +// Token should return EOF until popEOF is called. +func (d *Decoder) pushEOF() { + // Walk down stack to find Start. + // It might not be the top, because there might be stkNs + // entries above it. + start := d.stk + for start.kind != stkStart { + start = start.next + } + // The stkNs entries below a start are associated with that + // element too; skip over them. + for start.next != nil && start.next.kind == stkNs { + start = start.next + } + s := d.free + if s != nil { + d.free = s.next + } else { + s = new(stack) + } + s.kind = stkEOF + s.next = start.next + start.next = s +} + +// Undo a pushEOF. +// The element must have been finished, so the EOF should be at the top of the stack. +func (d *Decoder) popEOF() bool { + if d.stk == nil || d.stk.kind != stkEOF { + return false + } + d.pop() + return true +} + +// Record that we are starting an element with the given name. +func (d *Decoder) pushElement(name Name) { + s := d.push(stkStart) + s.name = name +} + +// Record that we are changing the value of ns[local]. +// The old value is url, ok. +func (d *Decoder) pushNs(local string, url string, ok bool) { + s := d.push(stkNs) + s.name.Local = local + s.name.Space = url + s.ok = ok +} + +// Creates a SyntaxError with the current line number. +func (d *Decoder) syntaxError(msg string) error { + return &SyntaxError{Msg: msg, Line: d.line} +} + +// Record that we are ending an element with the given name. +// The name must match the record at the top of the stack, +// which must be a pushElement record. +// After popping the element, apply any undo records from +// the stack to restore the name translations that existed +// before we saw this element. +func (d *Decoder) popElement(t *EndElement) bool { + s := d.pop() + name := t.Name + switch { + case s == nil || s.kind != stkStart: + d.err = d.syntaxError("unexpected end element ") + return false + case s.name.Local != name.Local: + if !d.Strict { + d.needClose = true + d.toClose = t.Name + t.Name = s.name + return true + } + d.err = d.syntaxError("element <" + s.name.Local + "> closed by ") + return false + case s.name.Space != name.Space: + d.err = d.syntaxError("element <" + s.name.Local + "> in space " + s.name.Space + + "closed by in space " + name.Space) + return false + } + + // Pop stack until a Start or EOF is on the top, undoing the + // translations that were associated with the element we just closed. + for d.stk != nil && d.stk.kind != stkStart && d.stk.kind != stkEOF { + s := d.pop() + if s.ok { + d.ns[s.name.Local] = s.name.Space + } else { + delete(d.ns, s.name.Local) + } + } + + return true +} + +// If the top element on the stack is autoclosing and +// t is not the end tag, invent the end tag. +func (d *Decoder) autoClose(t Token) (Token, bool) { + if d.stk == nil || d.stk.kind != stkStart { + return nil, false + } + name := strings.ToLower(d.stk.name.Local) + for _, s := range d.AutoClose { + if strings.ToLower(s) == name { + // This one should be auto closed if t doesn't close it. + et, ok := t.(EndElement) + if !ok || et.Name.Local != name { + return EndElement{d.stk.name}, true + } + break + } + } + return nil, false +} + +var errRawToken = errors.New("xml: cannot use RawToken from UnmarshalXML method") + +// RawToken is like Token but does not verify that +// start and end elements match and does not translate +// name space prefixes to their corresponding URLs. +func (d *Decoder) RawToken() (Token, error) { + if d.unmarshalDepth > 0 { + return nil, errRawToken + } + return d.rawToken() +} + +func (d *Decoder) rawToken() (Token, error) { + if d.err != nil { + return nil, d.err + } + if d.needClose { + // The last element we read was self-closing and + // we returned just the StartElement half. + // Return the EndElement half now. + d.needClose = false + return EndElement{d.toClose}, nil + } + + b, ok := d.getc() + if !ok { + return nil, d.err + } + + if b != '<' { + // Text section. + d.ungetc(b) + data := d.text(-1, false) + if data == nil { + return nil, d.err + } + return CharData(data), nil + } + + if b, ok = d.mustgetc(); !ok { + return nil, d.err + } + switch b { + case '/': + // ' { + d.err = d.syntaxError("invalid characters between ") + return nil, d.err + } + return EndElement{name}, nil + + case '?': + // ' { + break + } + b0 = b + } + data := d.buf.Bytes() + data = data[0 : len(data)-2] // chop ?> + + if target == "xml" { + enc := procInstEncoding(string(data)) + if enc != "" && enc != "utf-8" && enc != "UTF-8" { + if d.CharsetReader == nil { + d.err = fmt.Errorf("xml: encoding %q declared but Decoder.CharsetReader is nil", enc) + return nil, d.err + } + newr, err := d.CharsetReader(enc, d.r.(io.Reader)) + if err != nil { + d.err = fmt.Errorf("xml: opening charset %q: %v", enc, err) + return nil, d.err + } + if newr == nil { + panic("CharsetReader returned a nil Reader for charset " + enc) + } + d.switchToReader(newr) + } + } + return ProcInst{target, data}, nil + + case '!': + // ' { + break + } + b0, b1 = b1, b + } + data := d.buf.Bytes() + data = data[0 : len(data)-3] // chop --> + return Comment(data), nil + + case '[': // . + data := d.text(-1, true) + if data == nil { + return nil, d.err + } + return CharData(data), nil + } + + // Probably a directive: , , etc. + // We don't care, but accumulate for caller. Quoted angle + // brackets do not count for nesting. + d.buf.Reset() + d.buf.WriteByte(b) + inquote := uint8(0) + depth := 0 + for { + if b, ok = d.mustgetc(); !ok { + return nil, d.err + } + if inquote == 0 && b == '>' && depth == 0 { + break + } + HandleB: + d.buf.WriteByte(b) + switch { + case b == inquote: + inquote = 0 + + case inquote != 0: + // in quotes, no special action + + case b == '\'' || b == '"': + inquote = b + + case b == '>' && inquote == 0: + depth-- + + case b == '<' && inquote == 0: + // Look for ` + +var testEntity = map[string]string{"何": "What", "is-it": "is it?"} + +var rawTokens = []Token{ + CharData("\n"), + ProcInst{"xml", []byte(`version="1.0" encoding="UTF-8"`)}, + CharData("\n"), + Directive(`DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"`), + CharData("\n"), + StartElement{Name{"", "body"}, []Attr{{Name{"xmlns", "foo"}, "ns1"}, {Name{"", "xmlns"}, "ns2"}, {Name{"xmlns", "tag"}, "ns3"}}}, + CharData("\n "), + StartElement{Name{"", "hello"}, []Attr{{Name{"", "lang"}, "en"}}}, + CharData("World <>'\" 白鵬翔"), + EndElement{Name{"", "hello"}}, + CharData("\n "), + StartElement{Name{"", "query"}, []Attr{}}, + CharData("What is it?"), + EndElement{Name{"", "query"}}, + CharData("\n "), + StartElement{Name{"", "goodbye"}, []Attr{}}, + EndElement{Name{"", "goodbye"}}, + CharData("\n "), + StartElement{Name{"", "outer"}, []Attr{{Name{"foo", "attr"}, "value"}, {Name{"xmlns", "tag"}, "ns4"}}}, + CharData("\n "), + StartElement{Name{"", "inner"}, []Attr{}}, + EndElement{Name{"", "inner"}}, + CharData("\n "), + EndElement{Name{"", "outer"}}, + CharData("\n "), + StartElement{Name{"tag", "name"}, []Attr{}}, + CharData("\n "), + CharData("Some text here."), + CharData("\n "), + EndElement{Name{"tag", "name"}}, + CharData("\n"), + EndElement{Name{"", "body"}}, + Comment(" missing final newline "), +} + +var cookedTokens = []Token{ + CharData("\n"), + ProcInst{"xml", []byte(`version="1.0" encoding="UTF-8"`)}, + CharData("\n"), + Directive(`DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"`), + CharData("\n"), + StartElement{Name{"ns2", "body"}, []Attr{{Name{"xmlns", "foo"}, "ns1"}, {Name{"", "xmlns"}, "ns2"}, {Name{"xmlns", "tag"}, "ns3"}}}, + CharData("\n "), + StartElement{Name{"ns2", "hello"}, []Attr{{Name{"", "lang"}, "en"}}}, + CharData("World <>'\" 白鵬翔"), + EndElement{Name{"ns2", "hello"}}, + CharData("\n "), + StartElement{Name{"ns2", "query"}, []Attr{}}, + CharData("What is it?"), + EndElement{Name{"ns2", "query"}}, + CharData("\n "), + StartElement{Name{"ns2", "goodbye"}, []Attr{}}, + EndElement{Name{"ns2", "goodbye"}}, + CharData("\n "), + StartElement{Name{"ns2", "outer"}, []Attr{{Name{"ns1", "attr"}, "value"}, {Name{"xmlns", "tag"}, "ns4"}}}, + CharData("\n "), + StartElement{Name{"ns2", "inner"}, []Attr{}}, + EndElement{Name{"ns2", "inner"}}, + CharData("\n "), + EndElement{Name{"ns2", "outer"}}, + CharData("\n "), + StartElement{Name{"ns3", "name"}, []Attr{}}, + CharData("\n "), + CharData("Some text here."), + CharData("\n "), + EndElement{Name{"ns3", "name"}}, + CharData("\n"), + EndElement{Name{"ns2", "body"}}, + Comment(" missing final newline "), +} + +const testInputAltEncoding = ` + +VALUE` + +var rawTokensAltEncoding = []Token{ + CharData("\n"), + ProcInst{"xml", []byte(`version="1.0" encoding="x-testing-uppercase"`)}, + CharData("\n"), + StartElement{Name{"", "tag"}, []Attr{}}, + CharData("value"), + EndElement{Name{"", "tag"}}, +} + +var xmlInput = []string{ + // unexpected EOF cases + "<", + "", + "", + "", + // "", // let the Token() caller handle + "", + "", + "", + "", + " c;", + "", + "", + "", + // "", // let the Token() caller handle + "", + "", + "cdata]]>", +} + +func TestRawToken(t *testing.T) { + d := NewDecoder(strings.NewReader(testInput)) + d.Entity = testEntity + testRawToken(t, d, rawTokens) +} + +const nonStrictInput = ` +non&entity +&unknown;entity +{ +&#zzz; +&なまえ3; +<-gt; +&; +&0a; +` + +var nonStringEntity = map[string]string{"": "oops!", "0a": "oops!"} + +var nonStrictTokens = []Token{ + CharData("\n"), + StartElement{Name{"", "tag"}, []Attr{}}, + CharData("non&entity"), + EndElement{Name{"", "tag"}}, + CharData("\n"), + StartElement{Name{"", "tag"}, []Attr{}}, + CharData("&unknown;entity"), + EndElement{Name{"", "tag"}}, + CharData("\n"), + StartElement{Name{"", "tag"}, []Attr{}}, + CharData("{"), + EndElement{Name{"", "tag"}}, + CharData("\n"), + StartElement{Name{"", "tag"}, []Attr{}}, + CharData("&#zzz;"), + EndElement{Name{"", "tag"}}, + CharData("\n"), + StartElement{Name{"", "tag"}, []Attr{}}, + CharData("&なまえ3;"), + EndElement{Name{"", "tag"}}, + CharData("\n"), + StartElement{Name{"", "tag"}, []Attr{}}, + CharData("<-gt;"), + EndElement{Name{"", "tag"}}, + CharData("\n"), + StartElement{Name{"", "tag"}, []Attr{}}, + CharData("&;"), + EndElement{Name{"", "tag"}}, + CharData("\n"), + StartElement{Name{"", "tag"}, []Attr{}}, + CharData("&0a;"), + EndElement{Name{"", "tag"}}, + CharData("\n"), +} + +func TestNonStrictRawToken(t *testing.T) { + d := NewDecoder(strings.NewReader(nonStrictInput)) + d.Strict = false + testRawToken(t, d, nonStrictTokens) +} + +type downCaser struct { + t *testing.T + r io.ByteReader +} + +func (d *downCaser) ReadByte() (c byte, err error) { + c, err = d.r.ReadByte() + if c >= 'A' && c <= 'Z' { + c += 'a' - 'A' + } + return +} + +func (d *downCaser) Read(p []byte) (int, error) { + d.t.Fatalf("unexpected Read call on downCaser reader") + panic("unreachable") +} + +func TestRawTokenAltEncoding(t *testing.T) { + d := NewDecoder(strings.NewReader(testInputAltEncoding)) + d.CharsetReader = func(charset string, input io.Reader) (io.Reader, error) { + if charset != "x-testing-uppercase" { + t.Fatalf("unexpected charset %q", charset) + } + return &downCaser{t, input.(io.ByteReader)}, nil + } + testRawToken(t, d, rawTokensAltEncoding) +} + +func TestRawTokenAltEncodingNoConverter(t *testing.T) { + d := NewDecoder(strings.NewReader(testInputAltEncoding)) + token, err := d.RawToken() + if token == nil { + t.Fatalf("expected a token on first RawToken call") + } + if err != nil { + t.Fatal(err) + } + token, err = d.RawToken() + if token != nil { + t.Errorf("expected a nil token; got %#v", token) + } + if err == nil { + t.Fatalf("expected an error on second RawToken call") + } + const encoding = "x-testing-uppercase" + if !strings.Contains(err.Error(), encoding) { + t.Errorf("expected error to contain %q; got error: %v", + encoding, err) + } +} + +func testRawToken(t *testing.T, d *Decoder, rawTokens []Token) { + for i, want := range rawTokens { + have, err := d.RawToken() + if err != nil { + t.Fatalf("token %d: unexpected error: %s", i, err) + } + if !reflect.DeepEqual(have, want) { + var shave, swant string + if _, ok := have.(CharData); ok { + shave = fmt.Sprintf("CharData(%q)", have) + } else { + shave = fmt.Sprintf("%#v", have) + } + if _, ok := want.(CharData); ok { + swant = fmt.Sprintf("CharData(%q)", want) + } else { + swant = fmt.Sprintf("%#v", want) + } + t.Errorf("token %d = %s, want %s", i, shave, swant) + } + } +} + +// Ensure that directives (specifically !DOCTYPE) include the complete +// text of any nested directives, noting that < and > do not change +// nesting depth if they are in single or double quotes. + +var nestedDirectivesInput = ` +]> +">]> +]> +'>]> +]> +'>]> +]> +` + +var nestedDirectivesTokens = []Token{ + CharData("\n"), + Directive(`DOCTYPE []`), + CharData("\n"), + Directive(`DOCTYPE [">]`), + CharData("\n"), + Directive(`DOCTYPE []`), + CharData("\n"), + Directive(`DOCTYPE ['>]`), + CharData("\n"), + Directive(`DOCTYPE []`), + CharData("\n"), + Directive(`DOCTYPE ['>]`), + CharData("\n"), + Directive(`DOCTYPE []`), + CharData("\n"), +} + +func TestNestedDirectives(t *testing.T) { + d := NewDecoder(strings.NewReader(nestedDirectivesInput)) + + for i, want := range nestedDirectivesTokens { + have, err := d.Token() + if err != nil { + t.Fatalf("token %d: unexpected error: %s", i, err) + } + if !reflect.DeepEqual(have, want) { + t.Errorf("token %d = %#v want %#v", i, have, want) + } + } +} + +func TestToken(t *testing.T) { + d := NewDecoder(strings.NewReader(testInput)) + d.Entity = testEntity + + for i, want := range cookedTokens { + have, err := d.Token() + if err != nil { + t.Fatalf("token %d: unexpected error: %s", i, err) + } + if !reflect.DeepEqual(have, want) { + t.Errorf("token %d = %#v want %#v", i, have, want) + } + } +} + +func TestSyntax(t *testing.T) { + for i := range xmlInput { + d := NewDecoder(strings.NewReader(xmlInput[i])) + var err error + for _, err = d.Token(); err == nil; _, err = d.Token() { + } + if _, ok := err.(*SyntaxError); !ok { + t.Fatalf(`xmlInput "%s": expected SyntaxError not received`, xmlInput[i]) + } + } +} + +type allScalars struct { + True1 bool + True2 bool + False1 bool + False2 bool + Int int + Int8 int8 + Int16 int16 + Int32 int32 + Int64 int64 + Uint int + Uint8 uint8 + Uint16 uint16 + Uint32 uint32 + Uint64 uint64 + Uintptr uintptr + Float32 float32 + Float64 float64 + String string + PtrString *string +} + +var all = allScalars{ + True1: true, + True2: true, + False1: false, + False2: false, + Int: 1, + Int8: -2, + Int16: 3, + Int32: -4, + Int64: 5, + Uint: 6, + Uint8: 7, + Uint16: 8, + Uint32: 9, + Uint64: 10, + Uintptr: 11, + Float32: 13.0, + Float64: 14.0, + String: "15", + PtrString: &sixteen, +} + +var sixteen = "16" + +const testScalarsInput = ` + true + 1 + false + 0 + 1 + -2 + 3 + -4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12.0 + 13.0 + 14.0 + 15 + 16 +` + +func TestAllScalars(t *testing.T) { + var a allScalars + err := Unmarshal([]byte(testScalarsInput), &a) + + if err != nil { + t.Fatal(err) + } + if !reflect.DeepEqual(a, all) { + t.Errorf("have %+v want %+v", a, all) + } +} + +type item struct { + Field_a string +} + +func TestIssue569(t *testing.T) { + data := `abcd` + var i item + err := Unmarshal([]byte(data), &i) + + if err != nil || i.Field_a != "abcd" { + t.Fatal("Expecting abcd") + } +} + +func TestUnquotedAttrs(t *testing.T) { + data := "" + d := NewDecoder(strings.NewReader(data)) + d.Strict = false + token, err := d.Token() + if _, ok := err.(*SyntaxError); ok { + t.Errorf("Unexpected error: %v", err) + } + if token.(StartElement).Name.Local != "tag" { + t.Errorf("Unexpected tag name: %v", token.(StartElement).Name.Local) + } + attr := token.(StartElement).Attr[0] + if attr.Value != "azAZ09:-_" { + t.Errorf("Unexpected attribute value: %v", attr.Value) + } + if attr.Name.Local != "attr" { + t.Errorf("Unexpected attribute name: %v", attr.Name.Local) + } +} + +func TestValuelessAttrs(t *testing.T) { + tests := [][3]string{ + {"

", "p", "nowrap"}, + {"

", "p", "nowrap"}, + {"", "input", "checked"}, + {"", "input", "checked"}, + } + for _, test := range tests { + d := NewDecoder(strings.NewReader(test[0])) + d.Strict = false + token, err := d.Token() + if _, ok := err.(*SyntaxError); ok { + t.Errorf("Unexpected error: %v", err) + } + if token.(StartElement).Name.Local != test[1] { + t.Errorf("Unexpected tag name: %v", token.(StartElement).Name.Local) + } + attr := token.(StartElement).Attr[0] + if attr.Value != test[2] { + t.Errorf("Unexpected attribute value: %v", attr.Value) + } + if attr.Name.Local != test[2] { + t.Errorf("Unexpected attribute name: %v", attr.Name.Local) + } + } +} + +func TestCopyTokenCharData(t *testing.T) { + data := []byte("same data") + var tok1 Token = CharData(data) + tok2 := CopyToken(tok1) + if !reflect.DeepEqual(tok1, tok2) { + t.Error("CopyToken(CharData) != CharData") + } + data[1] = 'o' + if reflect.DeepEqual(tok1, tok2) { + t.Error("CopyToken(CharData) uses same buffer.") + } +} + +func TestCopyTokenStartElement(t *testing.T) { + elt := StartElement{Name{"", "hello"}, []Attr{{Name{"", "lang"}, "en"}}} + var tok1 Token = elt + tok2 := CopyToken(tok1) + if tok1.(StartElement).Attr[0].Value != "en" { + t.Error("CopyToken overwrote Attr[0]") + } + if !reflect.DeepEqual(tok1, tok2) { + t.Error("CopyToken(StartElement) != StartElement") + } + tok1.(StartElement).Attr[0] = Attr{Name{"", "lang"}, "de"} + if reflect.DeepEqual(tok1, tok2) { + t.Error("CopyToken(CharData) uses same buffer.") + } +} + +func TestSyntaxErrorLineNum(t *testing.T) { + testInput := "

Foo

\n\n

Bar\n" + d := NewDecoder(strings.NewReader(testInput)) + var err error + for _, err = d.Token(); err == nil; _, err = d.Token() { + } + synerr, ok := err.(*SyntaxError) + if !ok { + t.Error("Expected SyntaxError.") + } + if synerr.Line != 3 { + t.Error("SyntaxError didn't have correct line number.") + } +} + +func TestTrailingRawToken(t *testing.T) { + input := ` ` + d := NewDecoder(strings.NewReader(input)) + var err error + for _, err = d.RawToken(); err == nil; _, err = d.RawToken() { + } + if err != io.EOF { + t.Fatalf("d.RawToken() = _, %v, want _, io.EOF", err) + } +} + +func TestTrailingToken(t *testing.T) { + input := ` ` + d := NewDecoder(strings.NewReader(input)) + var err error + for _, err = d.Token(); err == nil; _, err = d.Token() { + } + if err != io.EOF { + t.Fatalf("d.Token() = _, %v, want _, io.EOF", err) + } +} + +func TestEntityInsideCDATA(t *testing.T) { + input := `` + d := NewDecoder(strings.NewReader(input)) + var err error + for _, err = d.Token(); err == nil; _, err = d.Token() { + } + if err != io.EOF { + t.Fatalf("d.Token() = _, %v, want _, io.EOF", err) + } +} + +var characterTests = []struct { + in string + err string +}{ + {"\x12", "illegal character code U+0012"}, + {"\x0b", "illegal character code U+000B"}, + {"\xef\xbf\xbe", "illegal character code U+FFFE"}, + {"\r\n\x07", "illegal character code U+0007"}, + {"what's up", "expected attribute name in element"}, + {"&abc\x01;", "invalid character entity &abc (no semicolon)"}, + {"&\x01;", "invalid character entity & (no semicolon)"}, + {"&\xef\xbf\xbe;", "invalid character entity &\uFFFE;"}, + {"&hello;", "invalid character entity &hello;"}, +} + +func TestDisallowedCharacters(t *testing.T) { + + for i, tt := range characterTests { + d := NewDecoder(strings.NewReader(tt.in)) + var err error + + for err == nil { + _, err = d.Token() + } + synerr, ok := err.(*SyntaxError) + if !ok { + t.Fatalf("input %d d.Token() = _, %v, want _, *SyntaxError", i, err) + } + if synerr.Msg != tt.err { + t.Fatalf("input %d synerr.Msg wrong: want %q, got %q", i, tt.err, synerr.Msg) + } + } +} + +type procInstEncodingTest struct { + expect, got string +} + +var procInstTests = []struct { + input, expect string +}{ + {`version="1.0" encoding="utf-8"`, "utf-8"}, + {`version="1.0" encoding='utf-8'`, "utf-8"}, + {`version="1.0" encoding='utf-8' `, "utf-8"}, + {`version="1.0" encoding=utf-8`, ""}, + {`encoding="FOO" `, "FOO"}, +} + +func TestProcInstEncoding(t *testing.T) { + for _, test := range procInstTests { + got := procInstEncoding(test.input) + if got != test.expect { + t.Errorf("procInstEncoding(%q) = %q; want %q", test.input, got, test.expect) + } + } +} + +// Ensure that directives with comments include the complete +// text of any nested directives. + +var directivesWithCommentsInput = ` +]> +]> + --> --> []> +` + +var directivesWithCommentsTokens = []Token{ + CharData("\n"), + Directive(`DOCTYPE []`), + CharData("\n"), + Directive(`DOCTYPE []`), + CharData("\n"), + Directive(`DOCTYPE []`), + CharData("\n"), +} + +func TestDirectivesWithComments(t *testing.T) { + d := NewDecoder(strings.NewReader(directivesWithCommentsInput)) + + for i, want := range directivesWithCommentsTokens { + have, err := d.Token() + if err != nil { + t.Fatalf("token %d: unexpected error: %s", i, err) + } + if !reflect.DeepEqual(have, want) { + t.Errorf("token %d = %#v want %#v", i, have, want) + } + } +} + +// Writer whose Write method always returns an error. +type errWriter struct{} + +func (errWriter) Write(p []byte) (n int, err error) { return 0, fmt.Errorf("unwritable") } + +func TestEscapeTextIOErrors(t *testing.T) { + expectErr := "unwritable" + err := EscapeText(errWriter{}, []byte{'A'}) + + if err == nil || err.Error() != expectErr { + t.Errorf("have %v, want %v", err, expectErr) + } +} + +func TestEscapeTextInvalidChar(t *testing.T) { + input := []byte("A \x00 terminated string.") + expected := "A \uFFFD terminated string." + + buff := new(bytes.Buffer) + if err := EscapeText(buff, input); err != nil { + t.Fatalf("have %v, want nil", err) + } + text := buff.String() + + if text != expected { + t.Errorf("have %v, want %v", text, expected) + } +} + +func TestIssue5880(t *testing.T) { + type T []byte + data, err := Marshal(T{192, 168, 0, 1}) + if err != nil { + t.Errorf("Marshal error: %v", err) + } + if !utf8.Valid(data) { + t.Errorf("Marshal generated invalid UTF-8: %x", data) + } +} diff -Nru juju-core-2.0.0/src/google.golang.org/api/.hgtags juju-core-2.0.2/src/google.golang.org/api/.hgtags --- juju-core-2.0.0/src/google.golang.org/api/.hgtags 2016-10-13 14:32:21.000000000 +0000 +++ juju-core-2.0.2/src/google.golang.org/api/.hgtags 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -b571b553f8c057cb6952ce817dfb09b6e34a8c0b release diff -Nru juju-core-2.0.0/src/gopkg.in/goose.v1/client/apiversion.go juju-core-2.0.2/src/gopkg.in/goose.v1/client/apiversion.go --- juju-core-2.0.0/src/gopkg.in/goose.v1/client/apiversion.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/gopkg.in/goose.v1/client/apiversion.go 2016-11-11 00:08:24.000000000 +0000 @@ -0,0 +1,213 @@ +package client + +import ( + "encoding/json" + "fmt" + "net/http" + "net/url" + "path" + "strconv" + "strings" + + goosehttp "gopkg.in/goose.v1/http" +) + +type apiVersion struct { + major int + minor int +} + +type apiVersionInfo struct { + Version apiVersion `json:"id"` + Links []apiVersionLink `json:"links"` + Status string `json:"status"` +} + +type apiVersionLink struct { + Href string `json:"href"` + Rel string `json:"rel"` +} + +type apiURLVersion struct { + rootURL url.URL + serviceURLSuffix string + versions []apiVersionInfo +} + +// getAPIVersionURL returns a full formed serviceURL based on the API version requested, +// the rootURL and the serviceURLSuffix. If there is no match to the requested API +// version an error is returned. If only the major number is defined for the requested +// version, the first match found is returned. +func getAPIVersionURL(apiURLVersionInfo *apiURLVersion, requested apiVersion) (string, error) { + var match string + for _, v := range apiURLVersionInfo.versions { + if v.Version.major != requested.major { + continue + } + if requested.minor != -1 && v.Version.minor != requested.minor { + continue + } + for _, link := range v.Links { + if link.Rel != "self" { + continue + } + hrefURL, err := url.Parse(link.Href) + if err != nil { + return "", err + } + match = hrefURL.Path + } + if requested.minor != -1 { + break + } + } + if match == "" { + return "", fmt.Errorf("could not find matching URL") + } + versionURL := apiURLVersionInfo.rootURL + versionURL.Path = path.Join(versionURL.Path, match, apiURLVersionInfo.serviceURLSuffix) + return versionURL.String(), nil +} + +func (v *apiVersion) UnmarshalJSON(b []byte) error { + var s string + if err := json.Unmarshal(b, &s); err != nil { + return err + } + parsed, err := parseVersion(s) + if err != nil { + return err + } + *v = parsed + return nil +} + +// parseVersion takes a version string into the major and minor ints for an apiVersion +// structure. The string part of the data is returned by a request to List API versions +// send to an OpenStack service. It is in the format "v.". If apiVersion +// is empty, return {-1, -1}, to differentiate with "v0". +func parseVersion(s string) (apiVersion, error) { + if s == "" { + return apiVersion{-1, -1}, nil + } + s = strings.TrimPrefix(s, "v") + parts := strings.SplitN(s, ".", 2) + if len(parts) == 0 || len(parts) > 2 { + return apiVersion{}, fmt.Errorf("invalid API version %q", s) + } + var minor int = -1 + major, err := strconv.Atoi(parts[0]) + if err != nil { + return apiVersion{}, err + } + if len(parts) == 2 { + var err error + minor, err = strconv.Atoi(parts[1]) + if err != nil { + return apiVersion{}, err + } + } + return apiVersion{major, minor}, nil +} + +func unmarshallVersion(Versions json.RawMessage) ([]apiVersionInfo, error) { + // Some services respond with {"versions":[...]}, and + // some respond with {"versions":{"values":[...]}}. + var object interface{} + var versions []apiVersionInfo + if err := json.Unmarshal(Versions, &object); err != nil { + return versions, err + } + if _, ok := object.(map[string]interface{}); ok { + var valuesObject struct { + Values []apiVersionInfo `json:"values"` + } + if err := json.Unmarshal(Versions, &valuesObject); err != nil { + return versions, err + } + versions = valuesObject.Values + } else { + if err := json.Unmarshal(Versions, &versions); err != nil { + return versions, err + } + } + return versions, nil +} + +// getAPIVersions returns data on the API versions supported by the specified service endpoint. +func (c *authenticatingClient) getAPIVersions(serviceCatalogURL string) (*apiURLVersion, error) { + url, err := url.Parse(serviceCatalogURL) + if err != nil { + return nil, err + } + + // Identify the version in the URL, if there is one, and record + // everything proceeding it. We will need to append this to the + // API version-specific base URL. + var pathParts, origPathParts []string + if url.Path != "/" { + // The rackspace object-store endpoint triggers the version removal here, + // so keep the original parts for object-store and container endpoints. + // e.g. https://storage101.dfw1.clouddrive.com/v1/MossoCloudFS_1019383 + origPathParts = strings.Split(strings.Trim(url.Path, "/"), "/") + pathParts = origPathParts + if _, err := parseVersion(pathParts[0]); err == nil { + pathParts = pathParts[1:] + } + url.Path = "/" + } + + baseURL := url.String() + + // If this is an object-store serviceType, or an object-store container endpoint, + // there is no list version API call to make. Return a apiURLVersion which will + // satisfy a requested api version of "", "v1" or "v1.0" + if c.serviceURLs["object-store"] != "" && strings.Contains(serviceCatalogURL, c.serviceURLs["object-store"]) { + objectStoreLink := apiVersionLink{Href: baseURL, Rel: "self"} + objectStoreApiVersionInfo := []apiVersionInfo{ + { + Version: apiVersion{major: 1, minor: 0}, + Links: []apiVersionLink{objectStoreLink}, + Status: "stable", + }, + { + Version: apiVersion{major: -1, minor: -1}, + Links: []apiVersionLink{objectStoreLink}, + Status: "stable", + }, + } + return &apiURLVersion{*url, strings.Join(origPathParts, "/"), objectStoreApiVersionInfo}, nil + } + + // make sure we haven't already received the version info + c.apiVersionMu.Lock() + defer c.apiVersionMu.Unlock() + if apiInfo, ok := c.apiURLVersions[baseURL]; ok { + return apiInfo, nil + } + + var raw struct { + Versions json.RawMessage `json:"versions"` + } + requestData := &goosehttp.RequestData{ + RespValue: &raw, + ExpectedStatus: []int{ + http.StatusOK, + http.StatusMultipleChoices, + }, + } + if err := c.sendRequest("GET", baseURL, c.Token(), requestData); err != nil { + return nil, err + } + + versions, err := unmarshallVersion(raw.Versions) + if err != nil { + return nil, err + } + + // save this info, so we don't have to get it again + apiURLVersionInfo := &apiURLVersion{*url, strings.Join(pathParts, "/"), versions} + c.apiURLVersions[baseURL] = apiURLVersionInfo + + return apiURLVersionInfo, nil +} diff -Nru juju-core-2.0.0/src/gopkg.in/goose.v1/client/apiversion_test.go juju-core-2.0.2/src/gopkg.in/goose.v1/client/apiversion_test.go --- juju-core-2.0.0/src/gopkg.in/goose.v1/client/apiversion_test.go 1970-01-01 00:00:00.000000000 +0000 +++ juju-core-2.0.2/src/gopkg.in/goose.v1/client/apiversion_test.go 2016-11-11 00:08:24.000000000 +0000 @@ -0,0 +1,205 @@ +package client_test + +import ( + "fmt" + "net/http" + "strconv" + + gc "gopkg.in/check.v1" +) + +type versionHandler struct { + authBody string + port string +} + +type makeServiceURLTest struct { + serviceType string + version string + parts []string + success bool + URL string + err string +} + +func (s *localLiveSuite) makeServiceURLTests() []makeServiceURLTest { + return []makeServiceURLTest{ + { + // As a special case, if no version is specified + // then we use whatever URL is recoded in the + // service catalogue verbatim. + serviceType: "compute", + version: "", + parts: []string{}, + success: true, + URL: "http://localhost:%s", + }, + { + serviceType: "compute", + version: "v2.1", + parts: []string{"foo", "bar/"}, + success: true, + URL: "http://localhost:%s/v2.1/foo/bar/", + }, + { + serviceType: "compute", + version: "v2.0", + parts: []string{}, + success: true, + URL: "http://localhost:%s/v2.0", + }, + { + serviceType: "compute", + version: "v2.0", + parts: []string{"foo", "bar/"}, + success: true, + URL: "http://localhost:%s/v2.0/foo/bar/", + }, + { + serviceType: "compute", + version: "v2", + parts: []string{"foo", "bar/"}, + success: true, + URL: "http://localhost:%s/v2.1/foo/bar/", + }, + { + serviceType: "object-store", + version: "", + parts: []string{"foo", "bar"}, + success: true, + URL: "http://localhost:%s/swift/v1/foo/bar", + }, + { + serviceType: "object-store", + version: "q2.0", + parts: []string{"foo", "bar/"}, + success: false, + err: "strconv.ParseInt: parsing \"q2\": invalid syntax", + }, + { + serviceType: "object-store", + version: "v1.7", + parts: []string{"foo", "bar/"}, + success: false, + err: "could not find matching URL", + }, + { + serviceType: "juju-container-test", + version: "v1", + parts: []string{"foo", "bar/"}, + success: true, + URL: "http://localhost:%s/swift/v1/foo/bar/", + }, + { + serviceType: "juju-container-test", + version: "v0", + parts: []string{"foo", "bar/"}, + success: false, + err: "could not find matching URL", + }, + { + serviceType: "juju-container-test", + version: "", + parts: []string{"foo", "bar/"}, + success: true, + URL: "http://localhost:%s/swift/v1/foo/bar/", + }, + { + serviceType: "compute", + version: "v25.4", + parts: []string{}, + success: false, + err: "could not find matching URL", + }, + { + serviceType: "no-such-service", + version: "", + parts: []string{}, + success: false, + err: "no endpoints known for service type: no-such-service", + }, + } +} + +func (s *localLiveSuite) TestMakeServiceURL(c *gc.C) { + port := "3000" + cl := s.assertAuthenticationSuccess(c, port) + tests := s.makeServiceURLTests() + testCount := len(tests) + for i, t := range tests { + c.Logf("#%d of %d. %s %s %v", i+1, testCount, t.serviceType, t.version, t.parts) + URL, err := cl.MakeServiceURL(t.serviceType, t.version, t.parts) + if t.success { + c.Assert(err, gc.IsNil) + c.Assert(URL, gc.Equals, fmt.Sprintf(t.URL, port)) + // Run twice to ensure the version caching is working + URL, err = cl.MakeServiceURL(t.serviceType, t.version, t.parts) + c.Assert(err, gc.IsNil) + c.Assert(URL, gc.Equals, fmt.Sprintf(t.URL, port)) + } else { + c.Assert(err, gc.ErrorMatches, t.err) + } + } +} + +func (s *localLiveSuite) TestMakeServiceURLAPIVersionDiscoveryDisabled(c *gc.C) { + port := "3000" + cl := s.assertAuthenticationSuccess(c, port) + wasEnabled := cl.SetVersionDiscoveryEnabled(false) + c.Assert(wasEnabled, gc.Equals, true) + + url, err := cl.MakeServiceURL("compute", "v2.1", []string{"foo", "bar/"}) + c.Assert(err, gc.IsNil) + c.Assert(url, gc.Equals, fmt.Sprintf("http://localhost:%s/foo/bar/", port)) +} + +func (s *localLiveSuite) TestMakeServiceURLValues(c *gc.C) { + port := "3003" + cl := s.assertAuthenticationSuccess(c, port) + tests := s.makeServiceURLTests() + testCount := len(tests) + for i, t := range tests { + c.Logf("#%d of %d. %s %s %v", i+1, testCount, t.serviceType, t.version, t.parts) + URL, err := cl.MakeServiceURL(t.serviceType, t.version, t.parts) + if t.success { + c.Assert(err, gc.IsNil) + c.Assert(URL, gc.Equals, fmt.Sprintf(t.URL, port)) + // Run twice to ensure the version caching is working + URL, err = cl.MakeServiceURL(t.serviceType, t.version, t.parts) + c.Assert(err, gc.IsNil) + c.Assert(URL, gc.Equals, fmt.Sprintf(t.URL, port)) + } else { + c.Assert(err, gc.ErrorMatches, t.err) + } + } +} + +const authInformationBody = `{"versions": [` + + `{"status": "stable", "updated": "2015-03-30T00:00:00Z", "media-types": [{"base": "application/json", "type": "application/vnd.openstack.identity-v3+json"}], "id": "v3.4", "links": [{"href": "%s/v3/", "rel": "self"}]},` + + `{"status": "stable", "updated": "2014-04-17T00:00:00Z", "media-types": [{"base": "application/json", "type": "application/vnd.openstack.identity-v2.0+json"}], "id": "v2.0", "links": [{"href": "%s/v2.0/", "rel": "self"}, {"href": "http://docs.openstack.org/", "type": "text/html", "rel": "describedby"}]},` + + `{"status": "stable", "updated": "2015-03-30T00:00:00Z", "media-types": [{"base": "application/json", "type": "application/vnd.openstack.identity-v3+json"}], "id": "v2.1", "links": [{"href": "%s/v2.1/", "rel": "self"}]}` + + `]}` + +const authValuesInformationBody = `{"versions": {"values": [` + + `{"status": "stable", "updated": "2015-03-30T00:00:00Z", "media-types": [{"base": "application/json", "type": "application/vnd.openstack.identity-v3+json"}], "id": "v3.4", "links": [{"href": "%s/v3/", "rel": "self"}]},` + + `{"status": "stable", "updated": "2014-04-17T00:00:00Z", "media-types": [{"base": "application/json", "type": "application/vnd.openstack.identity-v2.0+json"}], "id": "v2.0", "links": [{"href": "%s/v2.0/", "rel": "self"}, {"href": "http://docs.openstack.org/", "type": "text/html", "rel": "describedby"}]},` + + `{"status": "stable", "updated": "2015-03-30T00:00:00Z", "media-types": [{"base": "application/json", "type": "application/vnd.openstack.identity-v3+json"}], "id": "v2.1", "links": [{"href": "%s/v2.1/", "rel": "self"}]}` + + `]}}` + +func (vh *versionHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json") + body := []byte(fmt.Sprintf(vh.authBody, "http://localhost:"+vh.port, "http://localhost:"+vh.port, "http://localhost:"+vh.port)) + // workaround for https://code.google.com/p/go/issues/detail?id=4454 + w.Header().Set("Content-Length", strconv.Itoa(len(body))) + w.WriteHeader(http.StatusMultipleChoices) + w.Write(body) +} + +func startApiVersionMux(vh versionHandler) string { + mux := http.NewServeMux() + + mux.Handle("/", &vh) + + go http.ListenAndServe(":"+vh.port, mux) + return fmt.Sprintf("Listening on localhost:%s...\n", vh.port) +} diff -Nru juju-core-2.0.0/src/gopkg.in/goose.v1/client/client.go juju-core-2.0.2/src/gopkg.in/goose.v1/client/client.go --- juju-core-2.0.0/src/gopkg.in/goose.v1/client/client.go 2016-10-13 14:32:24.000000000 +0000 +++ juju-core-2.0.2/src/gopkg.in/goose.v1/client/client.go 2016-11-11 00:08:24.000000000 +0000 @@ -31,26 +31,55 @@ // Client implementations sends service requests to an OpenStack deployment. type Client interface { - SendRequest(method, svcType, apiCall string, requestData *goosehttp.RequestData) (err error) + SendRequest(method, svcType, svcVersion, apiCall string, requestData *goosehttp.RequestData) (err error) // MakeServiceURL prepares a full URL to a service endpoint, with optional - // URL parts. It uses the first endpoint it can find for the given service type. - MakeServiceURL(serviceType string, parts []string) (string, error) + // URL parts. + MakeServiceURL(serviceType, apiVersion string, parts []string) (string, error) } // AuthenticatingClient sends service requests to an OpenStack deployment after first validating // a user's credentials. type AuthenticatingClient interface { Client + + // SetVersionDiscoveryEnabled enables or disables API version + // discovery. Discovery is enabled by default. If enabled, + // the client will attempt to list all versions available + // for a service and use the best match. Otherwise, any API + // version specified in an SendRequest or MakeServiceURL + // call will be ignored, and the service catalogue endpoint + // URL will be used directly. + SetVersionDiscoveryEnabled(bool) bool + + // SetRequiredServiceTypes sets the service types that the + // openstack must provide. SetRequiredServiceTypes(requiredServiceTypes []string) + + // Authenticate authenticates the client with the OpenStack + // identity service. Authenticate() error + + // IsAuthenticated reports whether the client is + // authenticated. IsAuthenticated() bool + + // Token returns the authentication token. If the client + // is not yet authenticated, this will return an empty + // string. Token() string + + // UserId returns the user ID for authentication. UserId() string + + // TenantId returns the tenant ID for authentication. TenantId() string - EndpointsForRegion(string) identity.ServiceURLs - // IdentityAuthOptions returns a list of valid auth options for the given - // openstack or error if fetching fails. + // EndpointsForRegion returns the service catalog URLs + // for the specified region. + EndpointsForRegion(region string) identity.ServiceURLs + + // IdentityAuthOptions returns a list of valid auth options + // for the given openstack or error if fetching fails. IdentityAuthOptions() (identity.AuthOptions, error) } @@ -78,18 +107,23 @@ authOptions identity.AuthOptions - // Service type to endpoint URLs for each available region - regionServiceURLs map[string]identity.ServiceURLs - - // Service type to endpoint URLs for the authenticated region - serviceURLs identity.ServiceURLs - // The service types which must be available after authentication, // or else services which use this client will not be able to function as expected. requiredServiceTypes []string tokenId string tenantId string userId string + + // Service type to endpoint URLs for each available region + regionServiceURLs map[string]identity.ServiceURLs + + // Service type to endpoint URLs for the authenticated region + serviceURLs identity.ServiceURLs + + // API versions available based on service catalogue URL. + apiVersionMu sync.Mutex + apiVersionDiscoveryEnabled bool + apiURLVersions map[string]*apiURLVersion } func (c *authenticatingClient) EndpointsForRegion(region string) identity.ServiceURLs { @@ -128,6 +162,7 @@ creds: &client_creds, requiredServiceTypes: defaultRequiredServiceTypes, client: client{logger: logger, httpClient: httpClient}, + apiVersionDiscoveryEnabled: true, } client.auth = &client client.authMode = identity.NewAuthenticator(auth_method, httpClient) @@ -151,8 +186,8 @@ return } -func (c *client) SendRequest(method, svcType, apiCall string, requestData *goosehttp.RequestData) error { - url, _ := c.MakeServiceURL(svcType, []string{apiCall}) +func (c *client) SendRequest(method, svcType, apiVersion, apiCall string, requestData *goosehttp.RequestData) error { + url, _ := c.MakeServiceURL(svcType, apiVersion, []string{apiCall}) return c.sendRequest(method, url, "", requestData) } @@ -163,7 +198,7 @@ return base + strings.Join(parts, "/") } -func (c *client) MakeServiceURL(serviceType string, parts []string) (string, error) { +func (c *client) MakeServiceURL(serviceType, apiVersion string, parts []string) (string, error) { return makeURL(c.baseURL, parts), nil } @@ -171,36 +206,77 @@ c.requiredServiceTypes = requiredServiceTypes } -func (c *authenticatingClient) SendRequest(method, svcType, apiCall string, requestData *goosehttp.RequestData) (err error) { - err = c.sendAuthRequest(method, svcType, apiCall, requestData) +func (c *authenticatingClient) SendRequest( + method, svcType, apiVersion, apiCall string, + requestData *goosehttp.RequestData, +) (err error) { + err = c.sendAuthRequest(method, svcType, apiVersion, apiCall, requestData) if gooseerrors.IsUnauthorised(err) { c.setToken("") - err = c.sendAuthRequest(method, svcType, apiCall, requestData) + err = c.sendAuthRequest(method, svcType, apiVersion, apiCall, requestData) } return } -func (c *authenticatingClient) sendAuthRequest(method, svcType, apiCall string, requestData *goosehttp.RequestData) (err error) { +func (c *authenticatingClient) sendAuthRequest( + method, svcType, apiVersion, apiCall string, + requestData *goosehttp.RequestData, +) (err error) { if err = c.Authenticate(); err != nil { return } - url, err := c.MakeServiceURL(svcType, []string{apiCall}) + url, err := c.MakeServiceURL(svcType, apiVersion, []string{apiCall}) if err != nil { return } return c.sendRequest(method, url, c.Token(), requestData) } -func (c *authenticatingClient) MakeServiceURL(serviceType string, parts []string) (string, error) { +// MakeServiceURL uses an endpoint matching the apiVersion for the given service type. +// Given a major version only, the version with the highest minor will be used. +// +// object-store and container service types have no versions. For these services, the +// caller may pass "" for apiVersion, to use the service catalogue URL without any +// version discovery. +func (c *authenticatingClient) MakeServiceURL(serviceType, apiVersion string, parts []string) (string, error) { if !c.IsAuthenticated() { return "", errors.New("cannot get endpoint URL without being authenticated") } - url, ok := c.serviceURLs[serviceType] + serviceURL, ok := c.serviceURLs[serviceType] if !ok { return "", errors.New("no endpoints known for service type: " + serviceType) } - return makeURL(url, parts), nil + if apiVersion == "" || !c.isAPIVersionDiscoveryEnabled() { + return makeURL(serviceURL, parts), nil + } + requestedVersion, err := parseVersion(apiVersion) + if err != nil { + return "", err + } + apiURLVersionInfo, err := c.getAPIVersions(serviceURL) + if err != nil { + return "", err + } + serviceURL, err = getAPIVersionURL(apiURLVersionInfo, requestedVersion) + if err != nil { + return "", err + } + return makeURL(serviceURL, parts), nil +} + +func (c *authenticatingClient) SetVersionDiscoveryEnabled(enabled bool) bool { + c.apiVersionMu.Lock() + defer c.apiVersionMu.Unlock() + old := c.apiVersionDiscoveryEnabled + c.apiVersionDiscoveryEnabled = enabled + return old +} + +func (c *authenticatingClient) isAPIVersionDiscoveryEnabled() bool { + c.apiVersionMu.Lock() + defer c.apiVersionMu.Unlock() + return c.apiVersionDiscoveryEnabled } // Return the relevant service endpoint URLs for this client's region. @@ -420,6 +496,7 @@ if err := c.createServiceURLs(); err != nil { return gooseerrors.Newf(err, "cannot create service URLs") } + c.apiURLVersions = make(map[string]*apiURLVersion) c.tenantId = authDetails.TenantId c.userId = authDetails.UserId // A valid token indicates authorisation has been successful, so it needs to be set last. It must be set diff -Nru juju-core-2.0.0/src/gopkg.in/goose.v1/client/live_test.go juju-core-2.0.2/src/gopkg.in/goose.v1/client/live_test.go --- juju-core-2.0.0/src/gopkg.in/goose.v1/client/live_test.go 2016-10-13 14:32:24.000000000 +0000 +++ juju-core-2.0.2/src/gopkg.in/goose.v1/client/live_test.go 2016-11-11 00:08:24.000000000 +0000 @@ -55,12 +55,19 @@ c.Assert(cl.IsAuthenticated(), gc.Equals, true) // Check service endpoints are discovered - url, err := cl.MakeServiceURL("compute", nil) - c.Check(err, gc.IsNil) - c.Check(url, gc.NotNil) - url, err = cl.MakeServiceURL("object-store", nil) - c.Check(err, gc.IsNil) - c.Check(url, gc.NotNil) + if s.authMode == identity.AuthLegacy { + // AuthLegacy doesn't use the openstack test double, therefore + // MakeServiceURL won't work correctly as the endpoint urls are used, + // but setup as bad addresses for AuthLegacy + c.Log("half of this test will not work with legacy auth") + } else { + url, err := cl.MakeServiceURL("compute", "v2", nil) + c.Check(err, gc.IsNil) + c.Check(url, gc.NotNil) + url, err = cl.MakeServiceURL("object-store", "", nil) + c.Check(err, gc.IsNil) + c.Check(url, gc.NotNil) + } } func (s *LiveTests) TestAuthDiscover(c *gc.C) { diff -Nru juju-core-2.0.0/src/gopkg.in/goose.v1/client/local_test.go juju-core-2.0.2/src/gopkg.in/goose.v1/client/local_test.go --- juju-core-2.0.0/src/gopkg.in/goose.v1/client/local_test.go 2016-10-13 14:32:24.000000000 +0000 +++ juju-core-2.0.2/src/gopkg.in/goose.v1/client/local_test.go 2016-11-11 00:08:24.000000000 +0000 @@ -37,7 +37,8 @@ LiveTests // The following attributes are for using testing doubles. httpsuite.HTTPSuite - service testservices.HttpService + service testservices.HttpService + versionHandlers map[string]*versionHandler } func (s *localLiveSuite) SetUpSuite(c *gc.C) { @@ -50,12 +51,13 @@ Region: "zone1.some region", TenantName: "tenant", } + var logMsg []string switch s.authMode { default: panic("Invalid authentication method") case identity.AuthKeyPair: // The openstack test service sets up keypair authentication. - s.service = openstackservice.New(s.cred, identity.AuthKeyPair) + s.service, logMsg = openstackservice.New(s.cred, identity.AuthKeyPair, s.UseTLS) // Add an additional endpoint so region filtering can be properly tested. serviceDef := identityservice.Service{ V2: identityservice.V2Service{ @@ -68,7 +70,7 @@ s.service.(*openstackservice.Openstack).Identity.AddService(serviceDef) case identity.AuthUserPass: // The openstack test service sets up userpass authentication. - s.service = openstackservice.New(s.cred, identity.AuthUserPass) + s.service, logMsg = openstackservice.New(s.cred, identity.AuthUserPass, s.UseTLS) // Add an additional endpoint so region filtering can be properly tested. serviceDef := identityservice.Service{ V2: identityservice.V2Service{ @@ -81,7 +83,7 @@ s.service.(*openstackservice.Openstack).Identity.AddService(serviceDef) case identity.AuthUserPassV3: // The openstack test service sets up userpass authentication. - s.service = openstackservice.New(s.cred, identity.AuthUserPass) + s.service, logMsg = openstackservice.New(s.cred, identity.AuthUserPass, s.UseTLS) // Add an additional endpoint so region filtering can be properly tested. serviceDef := identityservice.Service{ V3: identityservice.V3Service{ @@ -97,18 +99,28 @@ legacy.SetManagementURL("http://management.test.invalid/url") s.service = legacy } + for _, msg := range logMsg { + c.Logf(msg) + } + if s.authMode != identity.AuthLegacy { + s.service.SetupHTTP(nil) + } + s.versionHandlers = make(map[string]*versionHandler) s.LiveTests.SetUpSuite(c) } func (s *localLiveSuite) TearDownSuite(c *gc.C) { s.LiveTests.TearDownSuite(c) s.HTTPSuite.TearDownSuite(c) + s.service.Stop() } func (s *localLiveSuite) SetUpTest(c *gc.C) { s.HTTPSuite.SetUpTest(c) - s.service.SetupHTTP(s.Mux) s.LiveTests.SetUpTest(c) + if s.authMode == identity.AuthLegacy { + s.service.SetupHTTP(s.Mux) + } } func (s *localLiveSuite) TearDownTest(c *gc.C) { @@ -124,7 +136,7 @@ } creds := &identity.Credentials{ User: "fred", - URL: s.Server.URL, + URL: s.service.(*openstackservice.Openstack).URLs["identity"], Secrets: "secret", Region: "invalid", } @@ -140,11 +152,11 @@ } cl := client.NewClient(s.cred, s.authMode, nil) err := cl.Authenticate() - serviceURL, err := cl.MakeServiceURL("compute", []string{}) + serviceURL, err := cl.MakeServiceURL("compute", "v2", []string{}) c.Assert(err, gc.IsNil) _, err = url.Parse(serviceURL) c.Assert(err, gc.IsNil) - serviceURL, err = cl.MakeServiceURL("object-store", []string{}) + serviceURL, err = cl.MakeServiceURL("object-store", "", []string{}) c.Assert(err, gc.IsNil) _, err = url.Parse(serviceURL) c.Assert(err, gc.IsNil) @@ -155,14 +167,36 @@ nrCallers int // authStart is used as a gate to signal the fake authenticator that it can start. authStart chan struct{} + port string // for startApiVersionMux() } -func newAuthenticator(bufsize int) *fakeAuthenticator { +func newAuthenticator(bufsize int, port string) *fakeAuthenticator { return &fakeAuthenticator{ authStart: make(chan struct{}, bufsize), + port: port, } } +// doNewAuthenticator sets up the HTTP listener on localhost: for testing +// api version functionality within MakeServiceURL if we're using a fakeAuthenticator. +func (s *localLiveSuite) doNewAuthenticator(c *gc.C, bufsize int, port string) *fakeAuthenticator { + newAuth := newAuthenticator(bufsize, port) + newAuth.mu.Lock() + if _, ok := s.versionHandlers[port]; !ok { + var vh versionHandler + if port == "3000" { + vh.authBody = authInformationBody + } else if port == "3003" { + vh.authBody = authValuesInformationBody + } + vh.port = port + c.Logf(startApiVersionMux(vh)) + s.versionHandlers[port] = &vh + } + newAuth.mu.Unlock() + return newAuth +} + func (auth *fakeAuthenticator) Auth(creds *identity.Credentials) (*identity.AuthDetails, error) { auth.mu.Lock() auth.nrCallers++ @@ -183,7 +217,9 @@ } URLs := make(map[string]identity.ServiceURLs) endpoints := make(map[string]string) - endpoints["compute"] = "http://localhost" + endpoints["compute"] = fmt.Sprintf("http://localhost:%s", auth.port) + endpoints["object-store"] = fmt.Sprintf("http://localhost:%s/swift/v1", auth.port) + endpoints["juju-container-test"] = fmt.Sprintf("http://localhost:%s/swift/v1", auth.port) URLs[creds.Region] = endpoints return &identity.AuthDetails{ Token: "token", @@ -196,7 +232,7 @@ func (s *localLiveSuite) TestAuthenticationTimeout(c *gc.C) { cl := client.NewClient(s.cred, s.authMode, nil) defer client.SetAuthenticationTimeout(1 * time.Millisecond)() - auth := newAuthenticator(0) + auth := s.doNewAuthenticator(c, 0, "3003") client.SetAuthenticator(cl, auth) var err error @@ -206,11 +242,11 @@ c.Assert(errors.IsTimeout(err), gc.Equals, true) } -func (s *localLiveSuite) assertAuthenticationSuccess(c *gc.C) client.Client { +func (s *localLiveSuite) assertAuthenticationSuccess(c *gc.C, port string) client.AuthenticatingClient { cl := client.NewClient(s.cred, s.authMode, nil) cl.SetRequiredServiceTypes([]string{"compute"}) - defer client.SetAuthenticationTimeout(1 * time.Millisecond)() - auth := newAuthenticator(1) + defer client.SetAuthenticationTimeout(2 * time.Millisecond)() + auth := s.doNewAuthenticator(c, 1, port) client.SetAuthenticator(cl, auth) // Signal that the authenticator can proceed immediately. @@ -223,24 +259,10 @@ } func (s *localLiveSuite) TestAuthenticationSuccess(c *gc.C) { - cl := s.assertAuthenticationSuccess(c) - URL, err := cl.MakeServiceURL("compute", nil) + cl := s.assertAuthenticationSuccess(c, "3000") + URL, err := cl.MakeServiceURL("compute", "v2.0", nil) c.Assert(err, gc.IsNil) - c.Assert(URL, gc.Equals, "http://localhost") -} - -func (s *localLiveSuite) TestMakeServiceURL(c *gc.C) { - cl := s.assertAuthenticationSuccess(c) - URL, err := cl.MakeServiceURL("compute", []string{"foo"}) - c.Assert(err, gc.IsNil) - c.Assert(URL, gc.Equals, "http://localhost/foo") -} - -func (s *localLiveSuite) TestMakeServiceURLRetainsTrailingSlash(c *gc.C) { - cl := s.assertAuthenticationSuccess(c) - URL, err := cl.MakeServiceURL("compute", []string{"foo", "bar/"}) - c.Assert(err, gc.IsNil) - c.Assert(URL, gc.Equals, "http://localhost/foo/bar/") + c.Assert(URL, gc.Equals, "http://localhost:3000/v2.0") } func checkAuthentication(cl client.AuthenticatingClient) error { @@ -248,11 +270,11 @@ if err != nil { return err } - URL, err := cl.MakeServiceURL("compute", nil) + URL, err := cl.MakeServiceURL("compute", "v3", nil) if err != nil { return err } - if URL != "http://localhost" { + if URL != "http://localhost:3000/v3" { return fmt.Errorf("Unexpected URL: %s", URL) } return nil @@ -264,7 +286,7 @@ } cl := client.NewClient(s.cred, s.authMode, nil) cl.SetRequiredServiceTypes([]string{"compute"}) - auth := newAuthenticator(2) + auth := s.doNewAuthenticator(c, 2, "3000") client.SetAuthenticator(cl, auth) // Signal that the authenticator can proceed immediately. @@ -367,14 +389,17 @@ s.HTTPSuite.SetUpSuite(c) c.Assert(s.Server.URL[:8], gc.Equals, "https://") s.cred = &identity.Credentials{ - URL: s.Server.URL, User: "fred", Secrets: "secret", Region: "zone1.some region", TenantName: "tenant", } // The openstack test service sets up userpass authentication. - s.service = openstackservice.New(s.cred, identity.AuthUserPass) + var logMsg []string + s.service, logMsg = openstackservice.New(s.cred, identity.AuthUserPass, s.UseTLS) + for _, msg := range logMsg { + c.Logf(msg) + } // Add an additional endpoint so region filtering can be properly tested. serviceDef := identityservice.Service{ V2: identityservice.V2Service{ @@ -385,15 +410,16 @@ }, }} s.service.(*openstackservice.Openstack).Identity.AddService(serviceDef) + s.service.SetupHTTP(nil) } func (s *localHTTPSSuite) TearDownSuite(c *gc.C) { s.HTTPSuite.TearDownSuite(c) + s.service.Stop() } func (s *localHTTPSSuite) SetUpTest(c *gc.C) { s.HTTPSuite.SetUpTest(c) - s.service.SetupHTTP(s.Mux) } func (s *localHTTPSSuite) TearDownTest(c *gc.C) { @@ -412,7 +438,7 @@ c.Assert(err, gc.IsNil) // Requests into this client should be https:// URLs - swiftURL, err := cl.MakeServiceURL("object-store", []string{"test_container"}) + swiftURL, err := cl.MakeServiceURL("object-store", "", []string{"test_container"}) c.Assert(err, gc.IsNil) c.Assert(swiftURL[:8], gc.Equals, "https://") // We use swiftClient.CreateContainer to test a Binary request @@ -432,7 +458,7 @@ err := authSwift.CreateContainer("test_container", swift.PublicRead) c.Assert(err, gc.IsNil) - baseURL, err := authClient.MakeServiceURL("object-store", nil) + baseURL, err := authClient.MakeServiceURL("object-store", "", nil) c.Assert(err, gc.IsNil) c.Assert(baseURL[:8], gc.Equals, "https://") return baseURL diff -Nru juju-core-2.0.0/src/gopkg.in/goose.v1/glance/glance.go juju-core-2.0.2/src/gopkg.in/goose.v1/glance/glance.go --- juju-core-2.0.0/src/gopkg.in/goose.v1/glance/glance.go 2016-10-13 14:32:24.000000000 +0000 +++ juju-core-2.0.2/src/gopkg.in/goose.v1/glance/glance.go 2016-11-11 00:08:24.000000000 +0000 @@ -48,7 +48,7 @@ Images []Image } requestData := goosehttp.RequestData{RespValue: &resp, ExpectedStatus: []int{http.StatusOK}} - err := c.client.SendRequest(client.GET, "compute", apiImages, &requestData) + err := c.client.SendRequest(client.GET, "compute", "v2", apiImages, &requestData) if err != nil { return nil, errors.Newf(err, "failed to get list of images") } @@ -86,7 +86,7 @@ Images []ImageDetail } requestData := goosehttp.RequestData{RespValue: &resp} - err := c.client.SendRequest(client.GET, "compute", apiImagesDetail, &requestData) + err := c.client.SendRequest(client.GET, "compute", "v2", apiImagesDetail, &requestData) if err != nil { return nil, errors.Newf(err, "failed to get list of image details") } @@ -100,7 +100,7 @@ } url := fmt.Sprintf("%s/%s", apiImages, imageId) requestData := goosehttp.RequestData{RespValue: &resp} - err := c.client.SendRequest(client.GET, "compute", url, &requestData) + err := c.client.SendRequest(client.GET, "compute", "v2", url, &requestData) if err != nil { return nil, errors.Newf(err, "failed to get details of imageId: %s", imageId) } diff -Nru juju-core-2.0.0/src/gopkg.in/goose.v1/identity/live_test.go juju-core-2.0.2/src/gopkg.in/goose.v1/identity/live_test.go --- juju-core-2.0.0/src/gopkg.in/goose.v1/identity/live_test.go 2016-10-13 14:32:24.000000000 +0000 +++ juju-core-2.0.2/src/gopkg.in/goose.v1/identity/live_test.go 2016-11-11 00:08:24.000000000 +0000 @@ -40,7 +40,7 @@ func (s *LiveTests) TestAuth(c *gc.C) { err := s.client.Authenticate() c.Assert(err, gc.IsNil) - serviceURL, err := s.client.MakeServiceURL("compute", []string{}) + serviceURL, err := s.client.MakeServiceURL("compute", "v2", []string{}) c.Assert(err, gc.IsNil) _, err = url.Parse(serviceURL) c.Assert(err, gc.IsNil) diff -Nru juju-core-2.0.0/src/gopkg.in/goose.v1/identity/local_test.go juju-core-2.0.2/src/gopkg.in/goose.v1/identity/local_test.go --- juju-core-2.0.0/src/gopkg.in/goose.v1/identity/local_test.go 2016-10-13 14:32:24.000000000 +0000 +++ juju-core-2.0.2/src/gopkg.in/goose.v1/identity/local_test.go 2016-11-11 00:08:24.000000000 +0000 @@ -1,8 +1,6 @@ package identity_test import ( - "net/http" - "net/http/httptest" "net/url" "strings" @@ -21,46 +19,38 @@ // nova server that runs within the test process itself. type localLiveSuite struct { LiveTests - // The following attributes are for using testing doubles. - Server *httptest.Server - Mux *http.ServeMux - oldHandler http.Handler + openstack *openstackservice.Openstack } func (s *localLiveSuite) SetUpSuite(c *gc.C) { c.Logf("Using identity and nova service test doubles") - // Set up the HTTP server. - s.Server = httptest.NewServer(nil) - s.oldHandler = s.Server.Config.Handler - s.Mux = http.NewServeMux() - s.Server.Config.Handler = s.Mux - - serverURL := s.Server.URL - if s.authMode == identity.AuthUserPassV3 { - serverURL = serverURL + "/v3" - } // Set up an Openstack service. s.cred = &identity.Credentials{ - URL: serverURL, User: "fred", Secrets: "secret", Region: "zone1.some region", TenantName: "tenant", DomainName: "default", } - openstack := openstackservice.New(s.cred, s.authMode) - openstack.SetupHTTP(s.Mux) + var logMsg []string + s.openstack, logMsg = openstackservice.New(s.cred, s.authMode, false) + for _, msg := range logMsg { + c.Logf(msg) + } + s.openstack.SetupHTTP(nil) + + if s.authMode == identity.AuthUserPassV3 { + s.cred.URL = s.cred.URL + "/v3" + } - openstack.Identity.AddUser("fred", "secret", "tenant") + s.openstack.Identity.AddUser("fred", "secret", "tenant") s.LiveTests.SetUpSuite(c) } func (s *localLiveSuite) TearDownSuite(c *gc.C) { s.LiveTests.TearDownSuite(c) - s.Mux = nil - s.Server.Config.Handler = s.oldHandler - s.Server.Close() + s.openstack.Stop() } func (s *localLiveSuite) SetUpTest(c *gc.C) { @@ -76,7 +66,7 @@ func (s *localLiveSuite) TestProductStreamsEndpoint(c *gc.C) { err := s.client.Authenticate() c.Assert(err, gc.IsNil) - serviceURL, err := s.client.MakeServiceURL("product-streams", nil) + serviceURL, err := s.client.MakeServiceURL("product-streams", "", nil) c.Assert(err, gc.IsNil) _, err = url.Parse(serviceURL) c.Assert(err, gc.IsNil) @@ -86,7 +76,7 @@ func (s *localLiveSuite) TestJujuToolsEndpoint(c *gc.C) { err := s.client.Authenticate() c.Assert(err, gc.IsNil) - serviceURL, err := s.client.MakeServiceURL("juju-tools", nil) + serviceURL, err := s.client.MakeServiceURL("juju-tools", "", nil) c.Assert(err, gc.IsNil) _, err = url.Parse(serviceURL) c.Assert(err, gc.IsNil) diff -Nru juju-core-2.0.0/src/gopkg.in/goose.v1/nova/local_test.go juju-core-2.0.2/src/gopkg.in/goose.v1/nova/local_test.go --- juju-core-2.0.0/src/gopkg.in/goose.v1/nova/local_test.go 2016-10-13 14:32:24.000000000 +0000 +++ juju-core-2.0.2/src/gopkg.in/goose.v1/nova/local_test.go 2016-11-11 00:08:24.000000000 +0000 @@ -58,22 +58,19 @@ c.Logf("Using identity and nova service test doubles %s", idInfo) nova.UseNumericIds(s.useNumericIds) - // Set up the HTTP server. - s.Server = httptest.NewServer(nil) - s.oldHandler = s.Server.Config.Handler - s.Mux = http.NewServeMux() - s.Server.Config.Handler = s.Mux - // Set up an Openstack service. s.cred = &identity.Credentials{ - URL: s.Server.URL, User: "fred", Secrets: "secret", Region: "some region", TenantName: "tenant", } - s.openstack = openstackservice.New(s.cred, identity.AuthUserPass) - s.openstack.SetupHTTP(s.Mux) + var logMsg []string + s.openstack, logMsg = openstackservice.New(s.cred, identity.AuthUserPass, false) + for _, msg := range logMsg { + c.Logf(msg) + } + s.openstack.SetupHTTP(nil) s.testFlavor = "m1.small" s.testImageId = "1" @@ -82,9 +79,7 @@ func (s *localLiveSuite) TearDownSuite(c *gc.C) { s.LiveTests.TearDownSuite(c) - s.Mux = nil - s.Server.Config.Handler = s.oldHandler - s.Server.Close() + s.openstack.Stop() } func (s *localLiveSuite) SetUpTest(c *gc.C) { diff -Nru juju-core-2.0.0/src/gopkg.in/goose.v1/nova/networks.go juju-core-2.0.2/src/gopkg.in/goose.v1/nova/networks.go --- juju-core-2.0.0/src/gopkg.in/goose.v1/nova/networks.go 2016-10-13 14:32:24.000000000 +0000 +++ juju-core-2.0.2/src/gopkg.in/goose.v1/nova/networks.go 2016-11-11 00:08:24.000000000 +0000 @@ -34,7 +34,7 @@ Networks []Network `json:"networks"` } requestData := goosehttp.RequestData{RespValue: &resp} - err := c.client.SendRequest(client.GET, "compute", apiNetworks, &requestData) + err := c.client.SendRequest(client.GET, "compute", "v2", apiNetworks, &requestData) if err != nil { return nil, errors.Newf(err, "failed to get list of networks") } diff -Nru juju-core-2.0.0/src/gopkg.in/goose.v1/nova/nova.go juju-core-2.0.2/src/gopkg.in/goose.v1/nova/nova.go --- juju-core-2.0.0/src/gopkg.in/goose.v1/nova/nova.go 2016-10-13 14:32:24.000000000 +0000 +++ juju-core-2.0.2/src/gopkg.in/goose.v1/nova/nova.go 2016-11-11 00:08:24.000000000 +0000 @@ -134,7 +134,7 @@ Flavors []Entity } requestData := goosehttp.RequestData{RespValue: &resp} - err := c.client.SendRequest(client.GET, "compute", apiFlavors, &requestData) + err := c.client.SendRequest(client.GET, "compute", "v2", apiFlavors, &requestData) if err != nil { return nil, errors.Newf(err, "failed to get list of flavours") } @@ -175,7 +175,7 @@ Flavors []FlavorDetail } requestData := goosehttp.RequestData{RespValue: &resp} - err := c.client.SendRequest(client.GET, "compute", apiFlavorsDetail, &requestData) + err := c.client.SendRequest(client.GET, "compute", "v2", apiFlavorsDetail, &requestData) if err != nil { return nil, errors.Newf(err, "failed to get list of flavour details") } @@ -192,7 +192,7 @@ params = &filter.v } requestData := goosehttp.RequestData{RespValue: &resp, Params: params, ExpectedStatus: []int{http.StatusOK}} - err := c.client.SendRequest(client.GET, "compute", apiServers, &requestData) + err := c.client.SendRequest(client.GET, "compute", "v2", apiServers, &requestData) if err != nil { return nil, errors.Newf(err, "failed to get list of servers") } @@ -263,7 +263,7 @@ params = &filter.v } requestData := goosehttp.RequestData{RespValue: &resp, Params: params} - err := c.client.SendRequest(client.GET, "compute", apiServersDetail, &requestData) + err := c.client.SendRequest(client.GET, "compute", "v2", apiServersDetail, &requestData) if err != nil { return nil, errors.Newf(err, "failed to get list of server details") } @@ -277,7 +277,7 @@ } url := fmt.Sprintf("%s/%s", apiServers, serverId) requestData := goosehttp.RequestData{RespValue: &resp} - err := c.client.SendRequest(client.GET, "compute", url, &requestData) + err := c.client.SendRequest(client.GET, "compute", "v2", url, &requestData) if err != nil { return nil, errors.Newf(err, "failed to get details for serverId: %s", serverId) } @@ -291,7 +291,7 @@ } url := fmt.Sprintf("%s/%s", apiServers, serverId) requestData := goosehttp.RequestData{RespValue: &resp, ExpectedStatus: []int{http.StatusNoContent}} - err := c.client.SendRequest(client.DELETE, "compute", url, &requestData) + err := c.client.SendRequest(client.DELETE, "compute", "v2", url, &requestData) if err != nil { err = errors.Newf(err, "failed to delete server with serverId: %s", serverId) } @@ -335,7 +335,7 @@ Server Entity `json:"server"` } requestData := goosehttp.RequestData{ReqValue: req, RespValue: &resp, ExpectedStatus: []int{http.StatusAccepted}} - err := c.client.SendRequest(client.POST, "compute", apiServers, &requestData) + err := c.client.SendRequest(client.POST, "compute", "v2", apiServers, &requestData) if err != nil { return nil, errors.Newf(err, "failed to run a server with %#v", opts) } @@ -357,7 +357,7 @@ req.Server = serverUpdateNameOpts{Name: name} requestData := goosehttp.RequestData{ReqValue: req, RespValue: &resp, ExpectedStatus: []int{http.StatusOK}} url := fmt.Sprintf("%s/%s", apiServers, serverID) - err := c.client.SendRequest(client.PUT, "compute", url, &requestData) + err := c.client.SendRequest(client.PUT, "compute", "v2", url, &requestData) if err != nil { return nil, errors.Newf(err, "failed to update server name to %q", name) } @@ -397,7 +397,7 @@ Groups []SecurityGroup `json:"security_groups"` } requestData := goosehttp.RequestData{RespValue: &resp} - err := c.client.SendRequest(client.GET, "compute", apiSecurityGroups, &requestData) + err := c.client.SendRequest(client.GET, "compute", "v2", apiSecurityGroups, &requestData) if err != nil { return nil, errors.Newf(err, "failed to list security groups") } @@ -429,7 +429,7 @@ } url := fmt.Sprintf("%s/%s/%s", apiServers, serverId, apiSecurityGroups) requestData := goosehttp.RequestData{RespValue: &resp} - err := c.client.SendRequest(client.GET, "compute", url, &requestData) + err := c.client.SendRequest(client.GET, "compute", "v2", url, &requestData) if err != nil { // Sadly HP Cloud lacks the necessary API and also doesn't provide full SecurityGroup lookup. // The best we can do for now is to use just the Id and Name from the group entities. @@ -466,7 +466,7 @@ SecurityGroup SecurityGroup `json:"security_group"` } requestData := goosehttp.RequestData{ReqValue: req, RespValue: &resp, ExpectedStatus: []int{http.StatusOK}} - err := c.client.SendRequest(client.POST, "compute", apiSecurityGroups, &requestData) + err := c.client.SendRequest(client.POST, "compute", "v2", apiSecurityGroups, &requestData) if err != nil { return nil, errors.Newf(err, "failed to create a security group with name: %s", name) } @@ -477,7 +477,7 @@ func (c *Client) DeleteSecurityGroup(groupId string) error { url := fmt.Sprintf("%s/%s", apiSecurityGroups, groupId) requestData := goosehttp.RequestData{ExpectedStatus: []int{http.StatusAccepted}} - err := c.client.SendRequest(client.DELETE, "compute", url, &requestData) + err := c.client.SendRequest(client.DELETE, "compute", "v2", url, &requestData) if err != nil { err = errors.Newf(err, "failed to delete security group with id: %s", groupId) } @@ -499,7 +499,7 @@ } url := fmt.Sprintf("%s/%s", apiSecurityGroups, groupId) requestData := goosehttp.RequestData{ReqValue: req, RespValue: &resp, ExpectedStatus: []int{http.StatusOK}} - err := c.client.SendRequest(client.PUT, "compute", url, &requestData) + err := c.client.SendRequest(client.PUT, "compute", "v2", url, &requestData) if err != nil { return nil, errors.Newf(err, "failed to update security group with Id %s to name: %s", groupId, name) } @@ -564,7 +564,7 @@ } requestData := goosehttp.RequestData{ReqValue: req, RespValue: &resp} - err := c.client.SendRequest(client.POST, "compute", apiSecurityGroupRules, &requestData) + err := c.client.SendRequest(client.POST, "compute", "v2", apiSecurityGroupRules, &requestData) if err != nil { return nil, errors.Newf(err, "failed to create a rule for the security group with id: %v", ruleInfo.GroupId) } @@ -575,7 +575,7 @@ func (c *Client) DeleteSecurityGroupRule(ruleId string) error { url := fmt.Sprintf("%s/%s", apiSecurityGroupRules, ruleId) requestData := goosehttp.RequestData{ExpectedStatus: []int{http.StatusAccepted}} - err := c.client.SendRequest(client.DELETE, "compute", url, &requestData) + err := c.client.SendRequest(client.DELETE, "compute", "v2", url, &requestData) if err != nil { err = errors.Newf(err, "failed to delete security group rule with id: %s", ruleId) } @@ -593,7 +593,7 @@ url := fmt.Sprintf("%s/%s/action", apiServers, serverId) requestData := goosehttp.RequestData{ReqValue: req, ExpectedStatus: []int{http.StatusAccepted}} - err := c.client.SendRequest(client.POST, "compute", url, &requestData) + err := c.client.SendRequest(client.POST, "compute", "v2", url, &requestData) if err != nil { err = errors.Newf(err, "failed to add security group '%s' to server with id: %s", groupName, serverId) } @@ -611,7 +611,7 @@ url := fmt.Sprintf("%s/%s/action", apiServers, serverId) requestData := goosehttp.RequestData{ReqValue: req, ExpectedStatus: []int{http.StatusAccepted}} - err := c.client.SendRequest(client.POST, "compute", url, &requestData) + err := c.client.SendRequest(client.POST, "compute", "v2", url, &requestData) if err != nil { err = errors.Newf(err, "failed to remove security group '%s' from server with id: %s", groupName, serverId) } @@ -637,7 +637,7 @@ } requestData := goosehttp.RequestData{RespValue: &resp} - err := c.client.SendRequest(client.GET, "compute", apiFloatingIPs, &requestData) + err := c.client.SendRequest(client.GET, "compute", "v2", apiFloatingIPs, &requestData) if err != nil { return nil, errors.Newf(err, "failed to list floating ips") } @@ -652,7 +652,7 @@ url := fmt.Sprintf("%s/%s", apiFloatingIPs, ipId) requestData := goosehttp.RequestData{RespValue: &resp} - err := c.client.SendRequest(client.GET, "compute", url, &requestData) + err := c.client.SendRequest(client.GET, "compute", "v2", url, &requestData) if err != nil { return nil, errors.Newf(err, "failed to get floating ip %s details", ipId) } @@ -666,7 +666,7 @@ } requestData := goosehttp.RequestData{RespValue: &resp} - err := c.client.SendRequest(client.POST, "compute", apiFloatingIPs, &requestData) + err := c.client.SendRequest(client.POST, "compute", "v2", apiFloatingIPs, &requestData) if err != nil { return nil, errors.Newf(err, "failed to allocate a floating ip") } @@ -677,7 +677,7 @@ func (c *Client) DeleteFloatingIP(ipId string) error { url := fmt.Sprintf("%s/%s", apiFloatingIPs, ipId) requestData := goosehttp.RequestData{ExpectedStatus: []int{http.StatusAccepted}} - err := c.client.SendRequest(client.DELETE, "compute", url, &requestData) + err := c.client.SendRequest(client.DELETE, "compute", "v2", url, &requestData) if err != nil { err = errors.Newf(err, "failed to delete floating ip %s details", ipId) } @@ -695,7 +695,7 @@ url := fmt.Sprintf("%s/%s/action", apiServers, serverId) requestData := goosehttp.RequestData{ReqValue: req, ExpectedStatus: []int{http.StatusAccepted}} - err := c.client.SendRequest(client.POST, "compute", url, &requestData) + err := c.client.SendRequest(client.POST, "compute", "v2", url, &requestData) if err != nil { err = errors.Newf(err, "failed to add floating ip %s to server with id: %s", address, serverId) } @@ -713,7 +713,7 @@ url := fmt.Sprintf("%s/%s/action", apiServers, serverId) requestData := goosehttp.RequestData{ReqValue: req, ExpectedStatus: []int{http.StatusAccepted}} - err := c.client.SendRequest(client.POST, "compute", url, &requestData) + err := c.client.SendRequest(client.POST, "compute", "v2", url, &requestData) if err != nil { err = errors.Newf(err, "failed to remove floating ip %s from server with id: %s", address, serverId) } @@ -741,7 +741,7 @@ AvailabilityZoneInfo []AvailabilityZone } requestData := goosehttp.RequestData{RespValue: &resp} - err := c.client.SendRequest(client.GET, "compute", apiAvailabilityZone, &requestData) + err := c.client.SendRequest(client.GET, "compute", "v2", apiAvailabilityZone, &requestData) if errors.IsNotFound(err) { // Availability zones are an extension, so don't // return an error if the API does not exist. @@ -758,10 +758,10 @@ // VolumeAttachment represents both the request and response for // attaching volumes. type VolumeAttachment struct { - Device string `json:"device"` - Id string `json:"id"` - ServerId string `json:"serverId"` - VolumeId string `json:"volumeId"` + Device *string `json:"device,omitempty"` + Id string `json:"id,omitempty"` + ServerId string `json:"serverId,omitempty"` + VolumeId string `json:"volumeId"` } // AttachVolume attaches the given volumeId to the given serverId at @@ -774,17 +774,21 @@ VolumeAttachment VolumeAttachment `json:"volumeAttachment"` } + var devicePtr *string + if device != "" { + devicePtr = &device + } + var resp volumeAttachment requestData := goosehttp.RequestData{ ReqValue: &volumeAttachment{VolumeAttachment{ - ServerId: serverId, VolumeId: volumeId, - Device: device, + Device: devicePtr, }}, RespValue: &resp, } url := fmt.Sprintf("%s/%s/%s", apiServers, serverId, apiVolumeAttachments) - err := c.client.SendRequest(client.POST, "compute", url, &requestData) + err := c.client.SendRequest(client.POST, "compute", "v2", url, &requestData) if errors.IsNotFound(err) { return nil, errors.NewNotImplementedf( err, nil, "the server does not support attaching volumes", @@ -803,7 +807,7 @@ ExpectedStatus: []int{http.StatusAccepted}, } url := fmt.Sprintf("%s/%s/%s/%s", apiServers, serverId, apiVolumeAttachments, attachmentId) - err := c.client.SendRequest(client.DELETE, "compute", url, &requestData) + err := c.client.SendRequest(client.DELETE, "compute", "v2", url, &requestData) if errors.IsNotFound(err) { return errors.NewNotImplementedf( err, nil, "the server does not support deleting attached volumes", @@ -826,7 +830,7 @@ RespValue: &resp, } url := fmt.Sprintf("%s/%s/%s", apiServers, serverId, apiVolumeAttachments) - err := c.client.SendRequest(client.GET, "compute", url, &requestData) + err := c.client.SendRequest(client.GET, "compute", "v2", url, &requestData) if errors.IsNotFound(err) { return nil, errors.NewNotImplementedf( err, nil, "the server does not support listing attached volumes", @@ -848,7 +852,7 @@ requestData := goosehttp.RequestData{ ReqValue: req, ExpectedStatus: []int{http.StatusOK}, } - err := c.client.SendRequest(client.POST, "compute", url, &requestData) + err := c.client.SendRequest(client.POST, "compute", "v2", url, &requestData) if err != nil { err = errors.Newf(err, "failed to set metadata %v on server with id: %s", metadata, serverId) } diff -Nru juju-core-2.0.0/src/gopkg.in/goose.v1/swift/live_test.go juju-core-2.0.2/src/gopkg.in/goose.v1/swift/live_test.go --- juju-core-2.0.0/src/gopkg.in/goose.v1/swift/live_test.go 2016-10-13 14:32:24.000000000 +0000 +++ juju-core-2.0.2/src/gopkg.in/goose.v1/swift/live_test.go 2016-11-11 00:08:24.000000000 +0000 @@ -164,7 +164,7 @@ func (s *LiveTestsPublicContainer) SetUpTest(c *gc.C) { err := s.client.Authenticate() c.Assert(err, gc.IsNil) - baseURL, err := s.client.MakeServiceURL("object-store", nil) + baseURL, err := s.client.MakeServiceURL("object-store", "", nil) c.Assert(err, gc.IsNil) s.publicClient = client.NewPublicClient(baseURL, nil) s.publicSwift = swift.New(s.publicClient) diff -Nru juju-core-2.0.0/src/gopkg.in/goose.v1/swift/local_test.go juju-core-2.0.2/src/gopkg.in/goose.v1/swift/local_test.go --- juju-core-2.0.0/src/gopkg.in/goose.v1/swift/local_test.go 2016-10-13 14:32:24.000000000 +0000 +++ juju-core-2.0.2/src/gopkg.in/goose.v1/swift/local_test.go 2016-11-11 00:08:24.000000000 +0000 @@ -34,8 +34,13 @@ TenantName: "tenant", } s.LiveTestsPublicContainer.cred = s.LiveTests.cred - s.openstack = openstackservice.New(s.LiveTests.cred, - identity.AuthUserPass) + var logMsg []string + s.openstack, logMsg = openstackservice.New(s.LiveTests.cred, + identity.AuthUserPass, false) + for _, msg := range logMsg { + c.Logf(msg) + } + s.openstack.SetupHTTP(nil) s.LiveTests.SetUpSuite(c) s.LiveTestsPublicContainer.SetUpSuite(c) @@ -49,7 +54,6 @@ func (s *localLiveSuite) SetUpTest(c *gc.C) { s.HTTPSuite.SetUpTest(c) - s.openstack.SetupHTTP(s.Mux) s.LiveTests.SetUpTest(c) s.LiveTestsPublicContainer.SetUpTest(c) } diff -Nru juju-core-2.0.0/src/gopkg.in/goose.v1/swift/swift.go juju-core-2.0.2/src/gopkg.in/goose.v1/swift/swift.go --- juju-core-2.0.0/src/gopkg.in/goose.v1/swift/swift.go 2016-10-13 14:32:24.000000000 +0000 +++ juju-core-2.0.2/src/gopkg.in/goose.v1/swift/swift.go 2016-11-11 00:08:24.000000000 +0000 @@ -39,7 +39,7 @@ // [sodre]: Due to a possible bug in ceph-radosgw, we need to split the // creation of the bucket and the changing its ACL. requestData := goosehttp.RequestData{ExpectedStatus: []int{http.StatusAccepted, http.StatusCreated}} - err := c.client.SendRequest(client.PUT, "object-store", containerName, &requestData) + err := c.client.SendRequest(client.PUT, "object-store", "", containerName, &requestData) if err != nil { err = maybeNotFound(err, "failed to create container: %s", containerName) return err @@ -51,7 +51,7 @@ headers.Add("X-Container-Read", string(acl)) requestData = goosehttp.RequestData{ReqHeaders: headers, ExpectedStatus: []int{http.StatusAccepted, http.StatusNoContent}} - err = c.client.SendRequest(client.POST, "object-store", containerName, &requestData) + err = c.client.SendRequest(client.POST, "object-store", "", containerName, &requestData) if err != nil { err = maybeNotFound(err, "failed to update container read acl: %s", containerName) } @@ -61,7 +61,7 @@ // DeleteContainer deletes the specified container. func (c *Client) DeleteContainer(containerName string) error { requestData := goosehttp.RequestData{ExpectedStatus: []int{http.StatusNoContent}} - err := c.client.SendRequest(client.DELETE, "object-store", containerName, &requestData) + err := c.client.SendRequest(client.DELETE, "object-store", "", containerName, &requestData) if err != nil { err = maybeNotFound(err, "failed to delete container: %s", containerName) } @@ -70,7 +70,7 @@ func (c *Client) touchObject(requestData *goosehttp.RequestData, op, containerName, objectName string) error { path := fmt.Sprintf("%s/%s", containerName, objectName) - err := c.client.SendRequest(op, "object-store", path, requestData) + err := c.client.SendRequest(op, "object-store", "", path, requestData) if err != nil { err = maybeNotFound(err, "failed to %s object %s from container %s", op, objectName, containerName) } @@ -150,7 +150,7 @@ } requestData := goosehttp.RequestData{Params: ¶ms, RespValue: &contents} - err = c.client.SendRequest(client.GET, "object-store", containerName, &requestData) + err = c.client.SendRequest(client.GET, "object-store", "", containerName, &requestData) if err != nil { err = errors.Newf(err, "failed to list contents of container: %s", containerName) } @@ -160,7 +160,7 @@ // URL returns a non-signed URL that allows retrieving the object at path. // It only works if the object is publicly readable (see SignedURL). func (c *Client) URL(containerName, file string) (string, error) { - return c.client.MakeServiceURL("object-store", []string{containerName, file}) + return c.client.MakeServiceURL("object-store", "", []string{containerName, file}) } // SignedURL returns a signed URL that allows anyone holding the URL diff -Nru juju-core-2.0.0/src/gopkg.in/goose.v1/test.py juju-core-2.0.2/src/gopkg.in/goose.v1/test.py --- juju-core-2.0.0/src/gopkg.in/goose.v1/test.py 2016-10-13 14:32:24.000000000 +0000 +++ juju-core-2.0.2/src/gopkg.in/goose.v1/test.py 2016-11-11 00:08:24.000000000 +0000 @@ -48,7 +48,7 @@ if b.repository.is_shared(): return pwd = os.getcwd() - expected_dir = 'src/launchpad.net/' + expected_dir = 'src/github.com/' offset = pwd.rfind(expected_dir) if offset == -1: sys.stderr.write('Could not find %r to create a shared repo\n') @@ -88,11 +88,11 @@ # latest juju-core and everything else. The other is where the # goose-under-test resides. So we don't add the goose-under-test to GOPATH, # call "go get", then add it to the GOPATH for the rest of the testing. - cmd = ['go', 'get', '-u', '-x', 'launchpad.net/juju-core/...'] + cmd = ['go', 'get', '-u', '-x', 'github.com/juju/...'] sys.stderr.write('Running: %s\n' % (' '.join(cmd),)) retcode = subprocess.call(cmd) if retcode != 0: - sys.stderr.write('WARN: Failed to update launchpad.net/juju-core\n') + sys.stderr.write('WARN: Failed to update github.com/juju\n') def tarmac_setup(opts): diff -Nru juju-core-2.0.0/src/gopkg.in/goose.v1/testservices/cmd/main.go juju-core-2.0.2/src/gopkg.in/goose.v1/testservices/cmd/main.go --- juju-core-2.0.0/src/gopkg.in/goose.v1/testservices/cmd/main.go 2016-10-13 14:32:24.000000000 +0000 +++ juju-core-2.0.2/src/gopkg.in/goose.v1/testservices/cmd/main.go 2016-11-11 00:08:24.000000000 +0000 @@ -6,7 +6,7 @@ "net/http" "strings" - "launchpad.net/gnuflag" + "github.com/juju/gnuflag" "gopkg.in/goose.v1/testservices/identityservice" ) diff -Nru juju-core-2.0.0/src/gopkg.in/goose.v1/testservices/identityservice/keypair.go juju-core-2.0.2/src/gopkg.in/goose.v1/testservices/identityservice/keypair.go --- juju-core-2.0.0/src/gopkg.in/goose.v1/testservices/identityservice/keypair.go 2016-10-13 14:32:24.000000000 +0000 +++ juju-core-2.0.2/src/gopkg.in/goose.v1/testservices/identityservice/keypair.go 2016-11-11 00:08:24.000000000 +0000 @@ -120,3 +120,7 @@ func (u *KeyPair) SetupHTTP(mux *http.ServeMux) { mux.Handle("/tokens", u) } + +func (u *KeyPair) Stop() { + // noop +} diff -Nru juju-core-2.0.0/src/gopkg.in/goose.v1/testservices/identityservice/legacy.go juju-core-2.0.2/src/gopkg.in/goose.v1/testservices/identityservice/legacy.go --- juju-core-2.0.0/src/gopkg.in/goose.v1/testservices/identityservice/legacy.go 2016-10-13 14:32:24.000000000 +0000 +++ juju-core-2.0.2/src/gopkg.in/goose.v1/testservices/identityservice/legacy.go 2016-11-11 00:08:24.000000000 +0000 @@ -33,6 +33,10 @@ mux.Handle("/", lis) } +func (lis *Legacy) Stop() { + // NOOP for legacy identity service. +} + func (lis *Legacy) ServeHTTP(w http.ResponseWriter, r *http.Request) { username := r.Header.Get("X-Auth-User") userInfo, ok := lis.users[username] diff -Nru juju-core-2.0.0/src/gopkg.in/goose.v1/testservices/identityservice/userpass.go juju-core-2.0.2/src/gopkg.in/goose.v1/testservices/identityservice/userpass.go --- juju-core-2.0.0/src/gopkg.in/goose.v1/testservices/identityservice/userpass.go 2016-10-13 14:32:24.000000000 +0000 +++ juju-core-2.0.2/src/gopkg.in/goose.v1/testservices/identityservice/userpass.go 2016-11-11 00:08:24.000000000 +0000 @@ -254,3 +254,7 @@ func (u *UserPass) SetupHTTP(mux *http.ServeMux) { mux.Handle("/tokens", u) } + +func (u *UserPass) Stop() { + // noop +} diff -Nru juju-core-2.0.0/src/gopkg.in/goose.v1/testservices/identityservice/v3userpass.go juju-core-2.0.2/src/gopkg.in/goose.v1/testservices/identityservice/v3userpass.go --- juju-core-2.0.0/src/gopkg.in/goose.v1/testservices/identityservice/v3userpass.go 2016-10-13 14:32:24.000000000 +0000 +++ juju-core-2.0.2/src/gopkg.in/goose.v1/testservices/identityservice/v3userpass.go 2016-11-11 00:08:24.000000000 +0000 @@ -214,3 +214,7 @@ func (u *V3UserPass) SetupHTTP(mux *http.ServeMux) { mux.Handle("/v3/auth/tokens", u) } + +func (u *V3UserPass) Stop() { + // noop +} diff -Nru juju-core-2.0.0/src/gopkg.in/goose.v1/testservices/novaservice/service.go juju-core-2.0.2/src/gopkg.in/goose.v1/testservices/novaservice/service.go --- juju-core-2.0.0/src/gopkg.in/goose.v1/testservices/novaservice/service.go 2016-10-13 14:32:24.000000000 +0000 +++ juju-core-2.0.2/src/gopkg.in/goose.v1/testservices/novaservice/service.go 2016-11-11 00:08:24.000000000 +0000 @@ -143,6 +143,10 @@ return novaService } +func (n *Nova) Stop() { + // noop +} + // SetAvailabilityZones sets the availability zones for setting // availability zones. // diff -Nru juju-core-2.0.0/src/gopkg.in/goose.v1/testservices/novaservice/service_http.go juju-core-2.0.2/src/gopkg.in/goose.v1/testservices/novaservice/service_http.go --- juju-core-2.0.0/src/gopkg.in/goose.v1/testservices/novaservice/service_http.go 2016-10-13 14:32:24.000000000 +0000 +++ juju-core-2.0.2/src/gopkg.in/goose.v1/testservices/novaservice/service_http.go 2016-11-11 00:08:24.000000000 +0000 @@ -10,6 +10,7 @@ "io/ioutil" "net/http" "path" + "regexp" "strconv" "strings" "time" @@ -32,6 +33,10 @@ nova *Nova } +var ( + regexpVolumeAttachmentDevice = regexp.MustCompile("(^/dev/x{0,1}[a-z]{0,1}d{0,1})([a-z]+)[0-9]*$") +) + // verbatim real Nova responses (as errors). var ( errUnauthorized = &errorResponse{ @@ -167,8 +172,8 @@ } errNoVersion = &errorResponse{ http.StatusOK, - `{"versions": [{"status": "CURRENT", "updated": "2011-01-21` + - `T11:33:21Z", "id": "v2.0", "links": [{"href": "$ENDPOINT$", "rel": "self"}]}]}`, + `{"versions": [` + + `{"id": "v2.0", "links": [{"href": "v2", "rel": "self"}], "status": "SUPPORTED", "updated": "2011-01-21T11:33:21Z"}]}`, "application/json", "no version specified in URL", nil, @@ -1184,8 +1189,46 @@ if err := json.Unmarshal(bodyBytes, &attachment); err != nil { return err } + + if attachment.VolumeAttachment.Device != nil { + if !regexpVolumeAttachmentDevice.MatchString(*attachment.VolumeAttachment.Device) { + message := fmt.Sprintf( + "Invalid input for field/attribute device. Value: '%s' does not match '%s'", + *attachment.VolumeAttachment.Device, regexpVolumeAttachmentDevice, + ) + return &errorResponse{ + http.StatusBadRequest, + fmt.Sprintf(`{"badRequest": {"message": "%s", "code": 400}}`, message), + "application/json; charset=UTF-8", + message, + nil, + nil, + } + } + } + + var additionalProperties []string + if attachment.VolumeAttachment.ServerId != "" { + additionalProperties = append(additionalProperties, "'serverId'") + } + if len(additionalProperties) > 0 { + message := fmt.Sprintf( + "Additional properties are not allowed (%s were unexpected)", + strings.Join(additionalProperties, ", "), + ) + return &errorResponse{ + http.StatusBadRequest, + fmt.Sprintf(`{"badRequest": {"message": "%s", "code": 400}}`, message), + "application/json; charset=UTF-8", + message, + nil, + nil, + } + } + n.nextAttachmentId++ attachment.VolumeAttachment.Id = fmt.Sprintf("%d", n.nextAttachmentId) + attachment.VolumeAttachment.ServerId = serverId serverVols := n.serverIdToAttachedVolumes[serverId] serverVols = append(serverVols, attachment.VolumeAttachment) @@ -1256,3 +1299,7 @@ mux.Handle(path, h) } } + +func (n *Nova) SetupRootHandler(mux *http.ServeMux) { + mux.Handle("/", n.handler((*Nova).handleRoot)) +} diff -Nru juju-core-2.0.0/src/gopkg.in/goose.v1/testservices/novaservice/service_http_test.go juju-core-2.0.2/src/gopkg.in/goose.v1/testservices/novaservice/service_http_test.go --- juju-core-2.0.0/src/gopkg.in/goose.v1/testservices/novaservice/service_http_test.go 2016-10-13 14:32:24.000000000 +0000 +++ juju-core-2.0.2/src/gopkg.in/goose.v1/testservices/novaservice/service_http_test.go 2016-11-11 00:08:24.000000000 +0000 @@ -1289,3 +1289,27 @@ c.Assert(err, gc.IsNil) c.Assert(server.Metadata, gc.DeepEquals, req.Metadata) } + +func (s *NovaHTTPSuite) TestAttachVolumeBlankDeviceName(c *gc.C) { + var req struct { + VolumeAttachment struct { + Device string `json:"device"` + } `json:"volumeAttachment"` + } + resp, err := s.jsonRequest("POST", "/servers/123/os-volume_attachments", req, nil) + c.Assert(err, gc.IsNil) + c.Assert(resp.StatusCode, gc.Equals, http.StatusBadRequest) + + // Passing an empty string in the "device" attribute + // is invalid. It should be omitted instead. + message := "Invalid input for field/attribute device. Value: '' does not match '(^/dev/x{0,1}[a-z]{0,1}d{0,1})([a-z]+)[0-9]*$'" + assertBody(c, resp, &errorResponse{ + http.StatusBadRequest, + fmt.Sprintf(`{"badRequest": {"message": "%s", "code": 400}}`, message), + "application/json; charset=UTF-8", + message, + nil, + nil, + }) + +} diff -Nru juju-core-2.0.0/src/gopkg.in/goose.v1/testservices/openstackservice/openstack.go juju-core-2.0.2/src/gopkg.in/goose.v1/testservices/openstackservice/openstack.go --- juju-core-2.0.0/src/gopkg.in/goose.v1/testservices/openstackservice/openstack.go 2016-10-13 14:32:24.000000000 +0000 +++ juju-core-2.0.2/src/gopkg.in/goose.v1/testservices/openstackservice/openstack.go 2016-11-11 00:08:24.000000000 +0000 @@ -3,6 +3,7 @@ import ( "fmt" "net/http" + "net/http/httptest" "strconv" "strings" @@ -20,10 +21,12 @@ FallbackIdentity identityservice.IdentityService Nova *novaservice.Nova Swift *swiftservice.Swift + muxes map[string]*http.ServeMux + servers map[string]*httptest.Server // base url of openstack endpoints, might be required to // simmulate response contents such as the ones from // identity discovery. - url string + URLs map[string]string } func (openstack *Openstack) AddUser(user, secret, tennant string) *identityservice.UserInfo { @@ -35,34 +38,28 @@ } // New creates an instance of a full Openstack service double. -// An initial user with the specified credentials is registered with the identity service. -func New(cred *identity.Credentials, authMode identity.AuthMode) *Openstack { - var openstack Openstack - if authMode == identity.AuthKeyPair { - openstack = Openstack{ - Identity: identityservice.NewKeyPair(), - } - } else if authMode == identity.AuthUserPassV3 { - openstack = Openstack{ - Identity: identityservice.NewV3UserPass(), - FallbackIdentity: identityservice.NewUserPass(), - } +// An initial user with the specified credentials is registered with the +// identity service. This service double manages the httpServers necessary +// for Nova, Swift and Identity services +func New(cred *identity.Credentials, authMode identity.AuthMode, useTLS bool) (*Openstack, []string) { + openstack, logMsgs := NewNoSwift(cred, authMode, useTLS) + + var server *httptest.Server + if useTLS { + server = httptest.NewTLSServer(nil) } else { - openstack = Openstack{ - Identity: identityservice.NewUserPass(), - FallbackIdentity: identityservice.NewV3UserPass(), - } + server = httptest.NewServer(nil) } - userInfo := openstack.AddUser(cred.User, cred.Secrets, cred.TenantName) - if cred.TenantName == "" { - panic("Openstack service double requires a tenant to be specified.") - } - openstack.Nova = novaservice.New(cred.URL, "v2", userInfo.TenantId, cred.Region, openstack.Identity, openstack.FallbackIdentity) + logMsgs = append(logMsgs, "swift service started: "+server.URL) + openstack.muxes["swift"] = http.NewServeMux() + server.Config.Handler = openstack.muxes["swift"] + openstack.URLs["swift"] = server.URL + openstack.servers["swift"] = server + // Create the swift service using only the region base so we emulate real world deployments. regionParts := strings.Split(cred.Region, ".") baseRegion := regionParts[len(regionParts)-1] - openstack.Swift = swiftservice.New(cred.URL, "v1", userInfo.TenantId, baseRegion, openstack.Identity, openstack.FallbackIdentity) - openstack.url = cred.URL + openstack.Swift = swiftservice.New(openstack.URLs["swift"], "v1", cred.TenantName, baseRegion, openstack.Identity, openstack.FallbackIdentity) // Create container and add image metadata endpoint so that product-streams URLs are included // in the keystone catalog. err := openstack.Swift.AddContainer("imagemetadata") @@ -97,23 +94,96 @@ } openstack.Identity.AddService(identityservice.Service{V2: serviceDef, V3: service3Def}) - return &openstack + return openstack, logMsgs +} + +// NewNoSwift creates an instance of a partial Openstack service double. +// An initial user with the specified credentials is registered with the +// identity service. This service double manages the httpServers necessary +// for Nova and Identity services +func NewNoSwift(cred *identity.Credentials, authMode identity.AuthMode, useTLS bool) (*Openstack, []string) { + var openstack Openstack + if authMode == identity.AuthKeyPair { + openstack = Openstack{ + Identity: identityservice.NewKeyPair(), + } + } else if authMode == identity.AuthUserPassV3 { + openstack = Openstack{ + Identity: identityservice.NewV3UserPass(), + FallbackIdentity: identityservice.NewUserPass(), + } + } else { + openstack = Openstack{ + Identity: identityservice.NewUserPass(), + FallbackIdentity: identityservice.NewV3UserPass(), + } + } + userInfo := openstack.AddUser(cred.User, cred.Secrets, cred.TenantName) + if cred.TenantName == "" { + panic("Openstack service double requires a tenant to be specified.") + } + + if useTLS { + openstack.servers = map[string]*httptest.Server{ + "identity": httptest.NewTLSServer(nil), + "nova": httptest.NewTLSServer(nil), + } + } else { + openstack.servers = map[string]*httptest.Server{ + "identity": httptest.NewServer(nil), + "nova": httptest.NewServer(nil), + } + } + + openstack.muxes = map[string]*http.ServeMux{ + "identity": http.NewServeMux(), + "nova": http.NewServeMux(), + } + + for k, v := range openstack.servers { + v.Config.Handler = openstack.muxes[k] + } + + cred.URL = openstack.servers["identity"].URL + openstack.URLs = make(map[string]string) + var logMsgs []string + for k, v := range openstack.servers { + openstack.URLs[k] = v.URL + logMsgs = append(logMsgs, k+" service started: "+openstack.URLs[k]) + } + + openstack.Nova = novaservice.New(openstack.URLs["nova"], "v2", userInfo.TenantId, cred.Region, openstack.Identity, openstack.FallbackIdentity) + return &openstack, logMsgs } // SetupHTTP attaches all the needed handlers to provide the HTTP API for the Openstack service.. func (openstack *Openstack) SetupHTTP(mux *http.ServeMux) { - openstack.Identity.SetupHTTP(mux) + openstack.Identity.SetupHTTP(openstack.muxes["identity"]) // If there is a FallbackIdentity service also register its urls. if openstack.FallbackIdentity != nil { - openstack.FallbackIdentity.SetupHTTP(mux) + openstack.FallbackIdentity.SetupHTTP(openstack.muxes["identity"]) + } + openstack.Nova.SetupHTTP(openstack.muxes["nova"]) + if openstack.Swift != nil { + openstack.Swift.SetupHTTP(openstack.muxes["swift"]) } - openstack.Nova.SetupHTTP(mux) - openstack.Swift.SetupHTTP(mux) // Handle root calls to be able to return auth information or fallback // to Nova root handler in case its not an auth info request. - mux.Handle("/", openstack) + openstack.muxes["identity"].Handle("/", openstack) + openstack.Nova.SetupRootHandler(openstack.muxes["nova"]) +} +// Stop closes the Openstack service double http Servers and clears the +// related http handling +func (openstack *Openstack) Stop() { + for _, v := range openstack.servers { + v.Config.Handler = nil + v.Close() + } + for k, _ := range openstack.muxes { + openstack.muxes[k] = nil + } } const authInformationBody = `{"versions": {"values": [{"status": "stable", ` + @@ -131,7 +201,7 @@ return } w.Header().Set("Content-Type", "application/json") - body := []byte(fmt.Sprintf(authInformationBody, openstack.url, openstack.url)) + body := []byte(fmt.Sprintf(authInformationBody, openstack.URLs["identity"], openstack.URLs["identity"])) // workaround for https://code.google.com/p/go/issues/detail?id=4454 w.Header().Set("Content-Length", strconv.Itoa(len(body))) w.WriteHeader(http.StatusMultipleChoices) diff -Nru juju-core-2.0.0/src/gopkg.in/goose.v1/testservices/service.go juju-core-2.0.2/src/gopkg.in/goose.v1/testservices/service.go --- juju-core-2.0.0/src/gopkg.in/goose.v1/testservices/service.go 2016-10-13 14:32:24.000000000 +0000 +++ juju-core-2.0.2/src/gopkg.in/goose.v1/testservices/service.go 2016-11-11 00:08:24.000000000 +0000 @@ -10,6 +10,7 @@ // An HttpService provides the HTTP API for a service double. type HttpService interface { SetupHTTP(mux *http.ServeMux) + Stop() } // A ServiceInstance is an Openstack module, one of nova, swift, glance. diff -Nru juju-core-2.0.0/src/gopkg.in/goose.v1/testservices/swiftservice/service.go juju-core-2.0.2/src/gopkg.in/goose.v1/testservices/swiftservice/service.go --- juju-core-2.0.0/src/gopkg.in/goose.v1/testservices/swiftservice/service.go 2016-10-13 14:32:24.000000000 +0000 +++ juju-core-2.0.2/src/gopkg.in/goose.v1/testservices/swiftservice/service.go 2016-11-11 00:08:24.000000000 +0000 @@ -55,8 +55,17 @@ return swift } +func Stop() { + // noop +} + func (s *Swift) endpointURL(path string) string { - ep := s.Scheme + "://" + s.Hostname + s.VersionPath + "/" + s.TenantId + // Note: We're using the Openstack Style endpoints for this testservice + // Openstack object-storage endpoint url: + // http://:/swift/v1 + // Rackspace object-storage endpoint url: + // https:///v1/MossoCloudFS_ + ep := s.Scheme + "://" + s.Hostname + "swift/" + s.VersionPath if path != "" { ep += "/" + strings.TrimLeft(path, "/") } diff -Nru juju-core-2.0.0/src/gopkg.in/goose.v1/testservices/swiftservice/service_http.go juju-core-2.0.2/src/gopkg.in/goose.v1/testservices/swiftservice/service_http.go --- juju-core-2.0.0/src/gopkg.in/goose.v1/testservices/swiftservice/service_http.go 2016-10-13 14:32:24.000000000 +0000 +++ juju-core-2.0.2/src/gopkg.in/goose.v1/testservices/swiftservice/service_http.go 2016-11-11 00:08:24.000000000 +0000 @@ -4,7 +4,6 @@ import ( "encoding/json" - "fmt" "io/ioutil" "net/http" "net/url" @@ -193,14 +192,16 @@ path := strings.TrimRight(r.URL.Path, "/") path = strings.Trim(path, "/") parts := strings.SplitN(path, "/", 4) - parts = parts[2:] - if len(parts) == 1 { - container := parts[0] - s.handleContainers(container, w, r) - } else if len(parts) == 2 { - container := parts[0] - object := parts[1] - s.handleObjects(container, object, w, r) + if len(parts) > 2 { + parts = parts[2:] + if len(parts) == 1 { + container := parts[0] + s.handleContainers(container, w, r) + } else if len(parts) == 2 { + container := parts[0] + object := parts[1] + s.handleObjects(container, object, w, r) + } } else { panic("not implemented request: " + r.URL.Path) } @@ -208,6 +209,9 @@ // setupHTTP attaches all the needed handlers to provide the HTTP API. func (s *Swift) SetupHTTP(mux *http.ServeMux) { - path := fmt.Sprintf("/%s/%s/", s.VersionPath, s.TenantId) - mux.Handle(path, s) + mux.Handle("/", s) +} + +func (s *Swift) Stop() { + // noop } diff -Nru juju-core-2.0.0/src/gopkg.in/goose.v1/testservices/swiftservice/service_test.go juju-core-2.0.2/src/gopkg.in/goose.v1/testservices/swiftservice/service_test.go --- juju-core-2.0.0/src/gopkg.in/goose.v1/testservices/swiftservice/service_test.go 2016-10-13 14:32:24.000000000 +0000 +++ juju-core-2.0.2/src/gopkg.in/goose.v1/testservices/swiftservice/service_test.go 2016-11-11 00:08:24.000000000 +0000 @@ -80,7 +80,7 @@ c.Assert(err, gc.IsNil) url, err := s.service.GetURL("test", "obj") c.Assert(err, gc.IsNil) - c.Assert(url, gc.Equals, fmt.Sprintf("%s/%s/%s/test/obj", hostname, versionPath, tenantId)) + c.Assert(url, gc.Equals, fmt.Sprintf("%s/swift/%s/test/obj", hostname, versionPath)) err = s.service.RemoveContainer("test") c.Assert(err, gc.IsNil) ok = s.service.HasContainer("test") diff -Nru juju-core-2.0.0/src/gopkg.in/goose.v1/tools/secgroup-delete-all/main.go juju-core-2.0.2/src/gopkg.in/goose.v1/tools/secgroup-delete-all/main.go --- juju-core-2.0.0/src/gopkg.in/goose.v1/tools/secgroup-delete-all/main.go 2016-10-13 14:32:24.000000000 +0000 +++ juju-core-2.0.2/src/gopkg.in/goose.v1/tools/secgroup-delete-all/main.go 2016-11-11 00:08:24.000000000 +0000 @@ -5,7 +5,7 @@ "io" "os" - "launchpad.net/gnuflag" + "github.com/juju/gnuflag" "gopkg.in/goose.v1/client" "gopkg.in/goose.v1/identity" diff -Nru juju-core-2.0.0/src/gopkg.in/goose.v1/tools/secgroup-delete-all/main_test.go juju-core-2.0.2/src/gopkg.in/goose.v1/tools/secgroup-delete-all/main_test.go --- juju-core-2.0.0/src/gopkg.in/goose.v1/tools/secgroup-delete-all/main_test.go 2016-10-13 14:32:24.000000000 +0000 +++ juju-core-2.0.2/src/gopkg.in/goose.v1/tools/secgroup-delete-all/main_test.go 2016-11-11 00:08:24.000000000 +0000 @@ -47,7 +47,7 @@ Region: region, TenantName: tenant, } - openstack := openstackservice.New(creds, identity.AuthUserPass) + openstack, _ := openstackservice.New(creds, identity.AuthUserPass, false) openstack.SetupHTTP(s.Mux) return openstack, createNovaClientFromCreds(creds) }