From 137819b9cd91bbc1e3f0b9549ddaa08d0c9619a1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 4 Sep 2021 17:51:27 +0000 Subject: [PATCH] build(deps): bump github.com/vmware/govmomi from 0.23.0 to 0.26.1 Bumps [github.com/vmware/govmomi](https://github.com/vmware/govmomi) from 0.23.0 to 0.26.1. - [Release notes](https://github.com/vmware/govmomi/releases) - [Changelog](https://github.com/vmware/govmomi/blob/master/CHANGELOG.md) - [Commits](https://github.com/vmware/govmomi/compare/v0.23.0...v0.26.1) --- updated-dependencies: - dependency-name: github.com/vmware/govmomi dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 6 +- vendor/github.com/vmware/govmomi/CONTRIBUTORS | 57 +- .../github.com/vmware/govmomi/cns/.gitignore | 1 + .../github.com/vmware/govmomi/cns/client.go | 271 +++ .../github.com/vmware/govmomi/cns/cns_util.go | 180 ++ .../vmware/govmomi/cns/methods/methods.go | 328 ++++ .../vmware/govmomi/cns/types/enum.go | 94 + .../github.com/vmware/govmomi/cns/types/if.go | 117 ++ .../vmware/govmomi/cns/types/types.go | 880 +++++++++ .../github.com/vmware/govmomi/find/finder.go | 35 +- .../vmware/govmomi/govc/flags/client.go | 55 +- .../vmware/govmomi/govc/flags/datastore.go | 4 + .../vmware/govmomi/govc/flags/debug.go | 374 +++- .../vmware/govmomi/govc/flags/folder.go | 4 + .../vmware/govmomi/govc/flags/host_system.go | 2 +- .../vmware/govmomi/govc/flags/network.go | 6 +- .../vmware/govmomi/govc/flags/output.go | 39 +- .../govmomi/govc/flags/resource_pool.go | 4 + .../vmware/govmomi/govc/flags/version.go | 11 +- .../govmomi/govc/host/esxcli/command.go | 22 +- .../vmware/govmomi/govc/importx/ovf.go | 16 + .../vmware/govmomi/govc/importx/spec.go | 8 +- .../vmware/govmomi/govc/vm/clone.go | 2 +- .../vmware/govmomi/govc/vm/console.go | 15 +- .../vmware/govmomi/govc/vm/create.go | 16 +- .../vmware/govmomi/govc/vm/customize.go | 78 +- .../vmware/govmomi/govc/vm/guest/download.go | 2 +- .../vmware/govmomi/govc/vm/guest/guest.go | 28 +- .../vmware/govmomi/govc/vm/guest/run.go | 10 +- .../vmware/govmomi/govc/vm/guest/upload.go | 2 +- .../vmware/govmomi/govc/vm/instantclone.go | 250 +++ .../vmware/govmomi/govc/vm/markasvm.go | 4 +- .../vmware/govmomi/guest/toolbox/client.go | 43 + .../vmware/govmomi/internal/helpers.go | 38 + vendor/github.com/vmware/govmomi/nfc/lease.go | 4 +- .../govmomi/object/authorization_manager.go | 47 + .../vmware/govmomi/object/virtual_app.go | 16 + .../govmomi/object/virtual_device_list.go | 8 +- .../vmware/govmomi/object/virtual_machine.go | 151 +- .../github.com/vmware/govmomi/ovf/envelope.go | 8 + .../github.com/vmware/govmomi/pbm/client.go | 287 +++ .../vmware/govmomi/pbm/methods/methods.go | 664 +++++++ .../github.com/vmware/govmomi/pbm/pbm_util.go | 148 ++ .../vmware/govmomi/pbm/types/enum.go | 253 +++ .../github.com/vmware/govmomi/pbm/types/if.go | 139 ++ .../vmware/govmomi/pbm/types/types.go | 1724 +++++++++++++++++ .../vmware/govmomi/session/cache/session.go | 8 +- .../vmware/govmomi/session/manager.go | 11 + .../github.com/vmware/govmomi/task/error.go | 1 + vendor/github.com/vmware/govmomi/task/wait.go | 2 +- .../vmware/govmomi/vapi/library/library.go | 14 + .../govmomi/vapi/library/library_item.go | 14 + .../vmware/govmomi/vapi/rest/client.go | 23 +- .../vmware/govmomi/vapi/rest/resource.go | 9 +- .../vmware/govmomi/view/container_view.go | 4 +- .../vmware/govmomi/vim25/debug/debug.go | 19 +- .../vmware/govmomi/vim25/debug/file.go | 9 +- .../vmware/govmomi/vim25/debug/log.go | 6 +- .../vmware/govmomi/vim25/methods/methods.go | 142 +- .../github.com/vmware/govmomi/vim25/mo/mo.go | 2 +- .../vmware/govmomi/vim25/progress/reader.go | 3 + .../github.com/vmware/govmomi/vim25/retry.go | 72 +- .../vmware/govmomi/vim25/soap/client.go | 43 +- .../vmware/govmomi/vim25/soap/debug.go | 21 +- .../vmware/govmomi/vim25/soap/error.go | 10 + .../vmware/govmomi/vim25/types/enum.go | 454 +++-- .../vmware/govmomi/vim25/types/helpers.go | 6 + .../vmware/govmomi/vim25/types/if.go | 34 +- .../vmware/govmomi/vim25/types/types.go | 590 +++++- .../vmware/govmomi/vim25/xml/marshal.go | 18 +- .../vmware/govmomi/vim25/xml/read.go | 18 +- .../vmware/govmomi/vim25/xml/typeinfo.go | 24 +- .../vmware/govmomi/vim25/xml/xml.go | 9 +- .../vmware/govmomi/vsan/vsanfs/types/enum.go | 35 + .../vmware/govmomi/vsan/vsanfs/types/types.go | 33 + vendor/modules.txt | 9 +- 77 files changed, 7610 insertions(+), 486 deletions(-) create mode 100644 vendor/github.com/vmware/govmomi/cns/.gitignore create mode 100644 vendor/github.com/vmware/govmomi/cns/client.go create mode 100644 vendor/github.com/vmware/govmomi/cns/cns_util.go create mode 100644 vendor/github.com/vmware/govmomi/cns/methods/methods.go create mode 100644 vendor/github.com/vmware/govmomi/cns/types/enum.go create mode 100644 vendor/github.com/vmware/govmomi/cns/types/if.go create mode 100644 vendor/github.com/vmware/govmomi/cns/types/types.go create mode 100644 vendor/github.com/vmware/govmomi/govc/vm/instantclone.go create mode 100644 vendor/github.com/vmware/govmomi/internal/helpers.go create mode 100644 vendor/github.com/vmware/govmomi/pbm/client.go create mode 100644 vendor/github.com/vmware/govmomi/pbm/methods/methods.go create mode 100644 vendor/github.com/vmware/govmomi/pbm/pbm_util.go create mode 100644 vendor/github.com/vmware/govmomi/pbm/types/enum.go create mode 100644 vendor/github.com/vmware/govmomi/pbm/types/if.go create mode 100644 vendor/github.com/vmware/govmomi/pbm/types/types.go create mode 100644 vendor/github.com/vmware/govmomi/vsan/vsanfs/types/enum.go create mode 100644 vendor/github.com/vmware/govmomi/vsan/vsanfs/types/types.go diff --git a/go.mod b/go.mod index f19bcc01e..8c59ec12e 100644 --- a/go.mod +++ b/go.mod @@ -33,7 +33,7 @@ require ( github.com/prometheus/client_golang v1.10.0 github.com/stretchr/testify v1.7.0 github.com/ubccr/kerby v0.0.0-20170626144437-201a958fc453 - github.com/vmware/govmomi v0.23.0 + github.com/vmware/govmomi v0.26.1 golang.org/x/net v0.0.0-20210614182718-04defd469f4e // indirect golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5 golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1 diff --git a/go.sum b/go.sum index 60035532e..16b0c226b 100644 --- a/go.sum +++ b/go.sum @@ -87,6 +87,7 @@ github.com/PuerkitoBio/urlesc v0.0.0-20160726150825-5bd2802263f2/go.mod h1:uGdko github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g= +github.com/a8m/tree v0.0.0-20210115125333-10a5fd5b637d/go.mod h1:FSdwKX97koS5efgm8WevNf7XS3PqtyFkKDDXrz778cg= github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= @@ -270,7 +271,6 @@ github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hf github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= -github.com/google/uuid v0.0.0-20170306145142-6a5e28554805/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -603,8 +603,8 @@ github.com/valyala/fasttemplate v1.0.1/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPU github.com/valyala/fasttemplate v1.1.0/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8= github.com/valyala/fasttemplate v1.2.1 h1:TVEnxayobAdVkhQfrfes2IzOB6o+z4roRkPF52WA1u4= github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= -github.com/vmware/govmomi v0.23.0 h1:DC97v1FdSr3cPfq3eBKD5C1O4JtYxo+NTcbGTKe2k48= -github.com/vmware/govmomi v0.23.0/go.mod h1:Y+Wq4lst78L85Ge/F8+ORXIWiKYqaro1vhAulACy9Lc= +github.com/vmware/govmomi v0.26.1 h1:awC7cFIT0SOCt3A6rbUCCEtFdt+X1L6Nppm0mkL7zQk= +github.com/vmware/govmomi v0.26.1/go.mod h1:daTuJEcQosNMXYJOeku0qdBJP9SOLLWB3Mqz8THtv6o= github.com/vmware/vmw-guestinfo v0.0.0-20170707015358-25eff159a728/go.mod h1:x9oS4Wk2s2u4tS29nEaDLdzvuHdB19CvSGJjPgkZJNk= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= diff --git a/vendor/github.com/vmware/govmomi/CONTRIBUTORS b/vendor/github.com/vmware/govmomi/CONTRIBUTORS index 4d4819fea..88600a8dd 100644 --- a/vendor/github.com/vmware/govmomi/CONTRIBUTORS +++ b/vendor/github.com/vmware/govmomi/CONTRIBUTORS @@ -5,14 +5,17 @@ Abhijeet Kasurde abrarshivani +Adam Chalkley Adam Shannon Al Biheiri Alessandro Cortiana +Alex Alex Bozhenko Alex Ellis (VMware) -Alex +Aligator <8278538+yet-another-aligator@users.noreply.github.com> Alvaro Miranda Amanda H. L. de Andrade +amanpaha Amit Bathla amit bezalel Andrew @@ -24,34 +27,43 @@ angystardust aniketGslab Ankit Vaidya Anna Carrigan +Ariel Chinn Arran Walker Artem Anisimov +Arunesh Pandey Aryeh Weinreb +Augy StClair Austin Parker Balu Dontu bastienbc Ben Corrie +Ben Vickers Benjamin Davini Benjamin Peterson +Bhavya Choudhary Bob Killen Brad Fitzpatrick +brian57860 Bruce Downs -Cédric Blomart Cheng Cheng Chethan Venkatesh Chris Marchesi Christian Höltje Clint Greenwood +cpiment CuiHaozhi -Daniel Mueller +Cédric Blomart Dan Ilan +Dan Norris +Daniel Frederick Crisman +Daniel Mueller Danny Lockard Dave Gress Dave Smith-Uchida Dave Tucker -Davide Agnello David Gress David Stark +Davide Agnello Davinder Kumar demarey dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> @@ -59,6 +71,7 @@ Deric Crago Divyen Patel Dnyanesh Gate Doug MacEachern +East <60801291+houfangdong@users.noreply.github.com> Eloy Coto Eric Edens Eric Graham <16710890+Pheric@users.noreply.github.com> @@ -79,28 +92,35 @@ George Hicken Gerrit Renker gthombare Hasan Mahmood +Heiko Reese Henrik Hodne hkumar hui luo +Ian Eyberg Isaac Rodman Ivan Mikushin Ivan Porto Carrero James King +James Peach Jason Kincl Jeremy Canady jeremy-clerc Jiatong Wang jingyizPensando -João Pereira Jonas Ausevicius Jorge Sevilla +João Pereira +Justin J. Novack kayrus Kevin George +Knappek +Leslie Wang leslie-qiwa Lintong Jiang Liping Xue Louie Jiang Luther Monson +Madanagopal Arunachalam maplain Marc Carmier Marcus Tan @@ -109,15 +129,21 @@ Marin Atanasov Nikolov Mario Trangoni Mark Peek Matt Clay -Matthew Cosgrove Matt Moore Matt Moriarity +Matthew Cosgrove +mbhadale +Merlijn Sebrechts Mevan Samaratunga +Michael Gasch Michal Jankowski +Mincho Tonev mingwei Nicolas Lamirault +Nikhil Kathare Omar Kohl Parham Alvani +Parveen Chahal Pierre Gronlier Pieter Noordhuis prydin @@ -125,11 +151,15 @@ rHermes Rowan Jacobs rsikdar runner.mei -Sandeep Pissay Srinivasa Rao S.Çağlar Onur +Saad Malik +Sandeep Pissay Srinivasa Rao +Scott Holden Sergey Ignatov serokles +shahra Shalini Bhaskara +Shaozhen Ding Shawn Neal shylasrinivas sky-joker @@ -139,6 +169,7 @@ Steve Purcell SUMIT AGRAWAL Takaaki Furukawa Tamas Eger +Tanay Kothari tanishi Ted Zlatanov Thad Craft @@ -154,15 +185,21 @@ Vikram Krishnamurthy volanja Volodymyr Bobyr Waldek Maleska -William Lam +William Lam Witold Krecicki xing-yang -yangxi Yang Yang +yangxi Yann Hodique +Yash Nitin Desai +Yassine TIJANI +yiyingy ykakarap +Yogesh Sobale <6104071+ysobale@users.noreply.github.com> +Yun Zhou Yuya Kusakabe -Zacharias Taubert Zach Tucker +Zacharias Taubert Zee Yang zyuxin +Кузаков Евгений diff --git a/vendor/github.com/vmware/govmomi/cns/.gitignore b/vendor/github.com/vmware/govmomi/cns/.gitignore new file mode 100644 index 000000000..dc43ac9d6 --- /dev/null +++ b/vendor/github.com/vmware/govmomi/cns/.gitignore @@ -0,0 +1 @@ +.soap/ \ No newline at end of file diff --git a/vendor/github.com/vmware/govmomi/cns/client.go b/vendor/github.com/vmware/govmomi/cns/client.go new file mode 100644 index 000000000..90466b13a --- /dev/null +++ b/vendor/github.com/vmware/govmomi/cns/client.go @@ -0,0 +1,271 @@ +/* +Copyright (c) 2019 VMware, Inc. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package cns + +import ( + "context" + + "github.com/vmware/govmomi/cns/methods" + cnstypes "github.com/vmware/govmomi/cns/types" + "github.com/vmware/govmomi/object" + "github.com/vmware/govmomi/vim25" + "github.com/vmware/govmomi/vim25/soap" + vimtypes "github.com/vmware/govmomi/vim25/types" +) + +// Namespace and Path constants +const ( + Namespace = "vsan" + Path = "/vsanHealth" +) + +const ( + ReleaseVSAN67u3 = "vSAN 6.7U3" + ReleaseVSAN70 = "7.0" + ReleaseVSAN70u1 = "vSAN 7.0U1" +) + +var ( + CnsVolumeManagerInstance = vimtypes.ManagedObjectReference{ + Type: "CnsVolumeManager", + Value: "cns-volume-manager", + } +) + +type Client struct { + *soap.Client + + RoundTripper soap.RoundTripper + + vim25Client *vim25.Client +} + +// NewClient creates a new CNS client +func NewClient(ctx context.Context, c *vim25.Client) (*Client, error) { + sc := c.Client.NewServiceClient(Path, Namespace) + sc.Namespace = c.Namespace + sc.Version = c.Version + return &Client{sc, sc, 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) +} + +// CreateVolume calls the CNS create API. +func (c *Client) CreateVolume(ctx context.Context, createSpecList []cnstypes.CnsVolumeCreateSpec) (*object.Task, error) { + createSpecList = dropUnknownCreateSpecElements(c, createSpecList) + req := cnstypes.CnsCreateVolume{ + This: CnsVolumeManagerInstance, + CreateSpecs: createSpecList, + } + res, err := methods.CnsCreateVolume(ctx, c, &req) + if err != nil { + return nil, err + } + return object.NewTask(c.vim25Client, res.Returnval), nil +} + +// UpdateVolumeMetadata calls the CNS CnsUpdateVolumeMetadata API with UpdateSpecs specified in the argument +func (c *Client) UpdateVolumeMetadata(ctx context.Context, updateSpecList []cnstypes.CnsVolumeMetadataUpdateSpec) (*object.Task, error) { + updateSpecList = dropUnknownVolumeMetadataUpdateSpecElements(c, updateSpecList) + req := cnstypes.CnsUpdateVolumeMetadata{ + This: CnsVolumeManagerInstance, + UpdateSpecs: updateSpecList, + } + res, err := methods.CnsUpdateVolumeMetadata(ctx, c, &req) + if err != nil { + return nil, err + } + return object.NewTask(c.vim25Client, res.Returnval), nil +} + +// DeleteVolume calls the CNS delete API. +func (c *Client) DeleteVolume(ctx context.Context, volumeIDList []cnstypes.CnsVolumeId, deleteDisk bool) (*object.Task, error) { + req := cnstypes.CnsDeleteVolume{ + This: CnsVolumeManagerInstance, + VolumeIds: volumeIDList, + DeleteDisk: deleteDisk, + } + res, err := methods.CnsDeleteVolume(ctx, c, &req) + if err != nil { + return nil, err + } + return object.NewTask(c.vim25Client, res.Returnval), nil +} + +// ExtendVolume calls the CNS Extend API. +func (c *Client) ExtendVolume(ctx context.Context, extendSpecList []cnstypes.CnsVolumeExtendSpec) (*object.Task, error) { + req := cnstypes.CnsExtendVolume{ + This: CnsVolumeManagerInstance, + ExtendSpecs: extendSpecList, + } + res, err := methods.CnsExtendVolume(ctx, c, &req) + if err != nil { + return nil, err + } + return object.NewTask(c.vim25Client, res.Returnval), nil +} + +// AttachVolume calls the CNS Attach API. +func (c *Client) AttachVolume(ctx context.Context, attachSpecList []cnstypes.CnsVolumeAttachDetachSpec) (*object.Task, error) { + req := cnstypes.CnsAttachVolume{ + This: CnsVolumeManagerInstance, + AttachSpecs: attachSpecList, + } + res, err := methods.CnsAttachVolume(ctx, c, &req) + if err != nil { + return nil, err + } + return object.NewTask(c.vim25Client, res.Returnval), nil +} + +// DetachVolume calls the CNS Detach API. +func (c *Client) DetachVolume(ctx context.Context, detachSpecList []cnstypes.CnsVolumeAttachDetachSpec) (*object.Task, error) { + req := cnstypes.CnsDetachVolume{ + This: CnsVolumeManagerInstance, + DetachSpecs: detachSpecList, + } + res, err := methods.CnsDetachVolume(ctx, c, &req) + if err != nil { + return nil, err + } + return object.NewTask(c.vim25Client, res.Returnval), nil +} + +// QueryVolume calls the CNS QueryVolume API. +func (c *Client) QueryVolume(ctx context.Context, queryFilter cnstypes.CnsQueryFilter) (*cnstypes.CnsQueryResult, error) { + req := cnstypes.CnsQueryVolume{ + This: CnsVolumeManagerInstance, + Filter: queryFilter, + } + res, err := methods.CnsQueryVolume(ctx, c, &req) + if err != nil { + return nil, err + } + return &res.Returnval, nil +} + +// QueryVolumeInfo calls the CNS QueryVolumeInfo API and return a task, from which we can extract VolumeInfo +// containing VStorageObject +func (c *Client) QueryVolumeInfo(ctx context.Context, volumeIDList []cnstypes.CnsVolumeId) (*object.Task, error) { + req := cnstypes.CnsQueryVolumeInfo{ + This: CnsVolumeManagerInstance, + VolumeIds: volumeIDList, + } + res, err := methods.CnsQueryVolumeInfo(ctx, c, &req) + if err != nil { + return nil, err + } + return object.NewTask(c.vim25Client, res.Returnval), nil +} + +// QueryAllVolume calls the CNS QueryAllVolume API. +func (c *Client) QueryAllVolume(ctx context.Context, queryFilter cnstypes.CnsQueryFilter, querySelection cnstypes.CnsQuerySelection) (*cnstypes.CnsQueryResult, error) { + req := cnstypes.CnsQueryAllVolume{ + This: CnsVolumeManagerInstance, + Filter: queryFilter, + Selection: querySelection, + } + res, err := methods.CnsQueryAllVolume(ctx, c, &req) + if err != nil { + return nil, err + } + return &res.Returnval, nil +} + +// QueryVolumeAsync calls the CNS QueryAsync API and return a task, from which we can extract CnsQueryResult +func (c *Client) QueryVolumeAsync(ctx context.Context, queryFilter cnstypes.CnsQueryFilter, querySelection cnstypes.CnsQuerySelection) (*object.Task, error) { + req := cnstypes.CnsQueryAsync{ + This: CnsVolumeManagerInstance, + Filter: queryFilter, + Selection: &querySelection, + } + res, err := methods.CnsQueryAsync(ctx, c, &req) + if err != nil { + return nil, err + } + return object.NewTask(c.vim25Client, res.Returnval), nil +} + +// RelocateVolume calls the CNS Relocate API. +func (c *Client) RelocateVolume(ctx context.Context, relocateSpecs ...cnstypes.BaseCnsVolumeRelocateSpec) (*object.Task, error) { + req := cnstypes.CnsRelocateVolume{ + This: CnsVolumeManagerInstance, + RelocateSpecs: relocateSpecs, + } + res, err := methods.CnsRelocateVolume(ctx, c, &req) + if err != nil { + return nil, err + } + return object.NewTask(c.vim25Client, res.Returnval), nil +} + +// ConfigureVolumeACLs calls the CNS Configure ACL API. +func (c *Client) ConfigureVolumeACLs(ctx context.Context, aclConfigSpecs ...cnstypes.CnsVolumeACLConfigureSpec) (*object.Task, error) { + req := cnstypes.CnsConfigureVolumeACLs{ + This: CnsVolumeManagerInstance, + ACLConfigSpecs: aclConfigSpecs, + } + res, err := methods.CnsConfigureVolumeACLs(ctx, c, &req) + if err != nil { + return nil, err + } + return object.NewTask(c.vim25Client, res.Returnval), nil +} + +// CreateSnapshots calls the CNS CreateSnapshots API + +func (c *Client) CreateSnapshots(ctx context.Context, snapshotCreateSpecList []cnstypes.CnsSnapshotCreateSpec) (*object.Task, error) { + req := cnstypes.CnsCreateSnapshots{ + This: CnsVolumeManagerInstance, + SnapshotSpecs: snapshotCreateSpecList, + } + res, err := methods.CnsCreateSnapshots(ctx, c, &req) + if err != nil { + return nil, err + } + + return object.NewTask(c.vim25Client, res.Returnval), nil +} + +// DeleteSnapshots calls the CNS DeleteSnapshots API +func (c *Client) DeleteSnapshots(ctx context.Context, snapshotDeleteSpecList []cnstypes.CnsSnapshotDeleteSpec) (*object.Task, error) { + req := cnstypes.CnsDeleteSnapshots{ + This: CnsVolumeManagerInstance, + SnapshotDeleteSpecs: snapshotDeleteSpecList, + } + res, err := methods.CnsDeleteSnapshots(ctx, c, &req) + if err != nil { + return nil, err + } + return object.NewTask(c.vim25Client, res.Returnval), nil +} + +// QuerySnapshots calls the CNS QuerySnapshots API +func (c *Client) QuerySnapshots(ctx context.Context, snapshotQueryFilter cnstypes.CnsSnapshotQueryFilter) (*object.Task, error) { + req := cnstypes.CnsQuerySnapshots{ + This: CnsVolumeManagerInstance, + SnapshotQueryFilter: snapshotQueryFilter, + } + res, err := methods.CnsQuerySnapshots(ctx, c, &req) + if err != nil { + return nil, err + } + return object.NewTask(c.vim25Client, res.Returnval), nil +} diff --git a/vendor/github.com/vmware/govmomi/cns/cns_util.go b/vendor/github.com/vmware/govmomi/cns/cns_util.go new file mode 100644 index 000000000..d8d8b09df --- /dev/null +++ b/vendor/github.com/vmware/govmomi/cns/cns_util.go @@ -0,0 +1,180 @@ +/* +Copyright (c) 2019 VMware, Inc. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package cns + +import ( + "context" + "errors" + + cnstypes "github.com/vmware/govmomi/cns/types" + "github.com/vmware/govmomi/object" + vim25types "github.com/vmware/govmomi/vim25/types" +) + +// GetTaskInfo gets the task info given a task +func GetTaskInfo(ctx context.Context, task *object.Task) (*vim25types.TaskInfo, error) { + taskInfo, err := task.WaitForResult(ctx, nil) + if err != nil { + return nil, err + } + return taskInfo, nil +} + +// GetQuerySnapshotsTaskResult gets the task result of QuerySnapshots given a task info +func GetQuerySnapshotsTaskResult(ctx context.Context, taskInfo *vim25types.TaskInfo) (*cnstypes.CnsSnapshotQueryResult, error) { + if taskInfo == nil { + return nil, errors.New("TaskInfo is empty") + } + if taskInfo.Result != nil { + snapshotQueryResult := taskInfo.Result.(cnstypes.CnsSnapshotQueryResult) + if &snapshotQueryResult == nil { + return nil, errors.New("Cannot get SnapshotQueryResult") + } + return &snapshotQueryResult, nil + } + return nil, errors.New("TaskInfo result is empty") +} + +// GetTaskResult gets the task result given a task info +func GetTaskResult(ctx context.Context, taskInfo *vim25types.TaskInfo) (cnstypes.BaseCnsVolumeOperationResult, error) { + if taskInfo == nil { + return nil, errors.New("TaskInfo is empty") + } + if taskInfo.Result != nil { + volumeOperationBatchResult := taskInfo.Result.(cnstypes.CnsVolumeOperationBatchResult) + if &volumeOperationBatchResult == nil || + volumeOperationBatchResult.VolumeResults == nil || + len(volumeOperationBatchResult.VolumeResults) == 0 { + return nil, errors.New("Cannot get VolumeOperationResult") + } + return volumeOperationBatchResult.VolumeResults[0], nil + } + return nil, errors.New("TaskInfo result is empty") +} + +// GetTaskResultArray gets the task result array for a specified task info +func GetTaskResultArray(ctx context.Context, taskInfo *vim25types.TaskInfo) ([]cnstypes.BaseCnsVolumeOperationResult, error) { + if taskInfo == nil { + return nil, errors.New("TaskInfo is empty") + } + if taskInfo.Result != nil { + volumeOperationBatchResult := taskInfo.Result.(cnstypes.CnsVolumeOperationBatchResult) + if &volumeOperationBatchResult == nil || + volumeOperationBatchResult.VolumeResults == nil || + len(volumeOperationBatchResult.VolumeResults) == 0 { + return nil, errors.New("Cannot get VolumeOperationResult") + } + return volumeOperationBatchResult.VolumeResults, nil + } + return nil, errors.New("TaskInfo result is empty") +} + +// dropUnknownCreateSpecElements helps drop newly added elements in the CnsVolumeCreateSpec, which are not known to the prior vSphere releases +func dropUnknownCreateSpecElements(c *Client, createSpecList []cnstypes.CnsVolumeCreateSpec) []cnstypes.CnsVolumeCreateSpec { + updatedcreateSpecList := make([]cnstypes.CnsVolumeCreateSpec, 0, len(createSpecList)) + switch c.Version { + case ReleaseVSAN67u3: + // Dropping optional fields not known to vSAN 6.7U3 + for _, createSpec := range createSpecList { + createSpec.Metadata.ContainerCluster.ClusterFlavor = "" + createSpec.Metadata.ContainerCluster.ClusterDistribution = "" + createSpec.Metadata.ContainerClusterArray = nil + var updatedEntityMetadata []cnstypes.BaseCnsEntityMetadata + for _, entityMetadata := range createSpec.Metadata.EntityMetadata { + k8sEntityMetadata := interface{}(entityMetadata).(*cnstypes.CnsKubernetesEntityMetadata) + k8sEntityMetadata.ClusterID = "" + k8sEntityMetadata.ReferredEntity = nil + updatedEntityMetadata = append(updatedEntityMetadata, cnstypes.BaseCnsEntityMetadata(k8sEntityMetadata)) + } + createSpec.Metadata.EntityMetadata = updatedEntityMetadata + _, ok := createSpec.BackingObjectDetails.(*cnstypes.CnsBlockBackingDetails) + if ok { + createSpec.BackingObjectDetails.(*cnstypes.CnsBlockBackingDetails).BackingDiskUrlPath = "" + } + updatedcreateSpecList = append(updatedcreateSpecList, createSpec) + } + createSpecList = updatedcreateSpecList + case ReleaseVSAN70: + // Dropping optional fields not known to vSAN 7.0 + for _, createSpec := range createSpecList { + createSpec.Metadata.ContainerCluster.ClusterDistribution = "" + var updatedContainerClusterArray []cnstypes.CnsContainerCluster + for _, containerCluster := range createSpec.Metadata.ContainerClusterArray { + containerCluster.ClusterDistribution = "" + updatedContainerClusterArray = append(updatedContainerClusterArray, containerCluster) + } + createSpec.Metadata.ContainerClusterArray = updatedContainerClusterArray + _, ok := createSpec.BackingObjectDetails.(*cnstypes.CnsBlockBackingDetails) + if ok { + createSpec.BackingObjectDetails.(*cnstypes.CnsBlockBackingDetails).BackingDiskUrlPath = "" + } + updatedcreateSpecList = append(updatedcreateSpecList, createSpec) + } + createSpecList = updatedcreateSpecList + case ReleaseVSAN70u1: + // Dropping optional fields not known to vSAN 7.0U1 + for _, createSpec := range createSpecList { + createSpec.Metadata.ContainerCluster.ClusterDistribution = "" + var updatedContainerClusterArray []cnstypes.CnsContainerCluster + for _, containerCluster := range createSpec.Metadata.ContainerClusterArray { + containerCluster.ClusterDistribution = "" + updatedContainerClusterArray = append(updatedContainerClusterArray, containerCluster) + } + createSpec.Metadata.ContainerClusterArray = updatedContainerClusterArray + updatedcreateSpecList = append(updatedcreateSpecList, createSpec) + } + createSpecList = updatedcreateSpecList + } + return createSpecList +} + +// dropUnknownVolumeMetadataUpdateSpecElements helps drop newly added elements in the CnsVolumeMetadataUpdateSpec, which are not known to the prior vSphere releases +func dropUnknownVolumeMetadataUpdateSpecElements(c *Client, updateSpecList []cnstypes.CnsVolumeMetadataUpdateSpec) []cnstypes.CnsVolumeMetadataUpdateSpec { + // Dropping optional fields not known to vSAN 6.7U3 + if c.Version == ReleaseVSAN67u3 { + updatedUpdateSpecList := make([]cnstypes.CnsVolumeMetadataUpdateSpec, 0, len(updateSpecList)) + for _, updateSpec := range updateSpecList { + updateSpec.Metadata.ContainerCluster.ClusterFlavor = "" + updateSpec.Metadata.ContainerCluster.ClusterDistribution = "" + var updatedEntityMetadata []cnstypes.BaseCnsEntityMetadata + for _, entityMetadata := range updateSpec.Metadata.EntityMetadata { + k8sEntityMetadata := interface{}(entityMetadata).(*cnstypes.CnsKubernetesEntityMetadata) + k8sEntityMetadata.ClusterID = "" + k8sEntityMetadata.ReferredEntity = nil + updatedEntityMetadata = append(updatedEntityMetadata, cnstypes.BaseCnsEntityMetadata(k8sEntityMetadata)) + } + updateSpec.Metadata.ContainerClusterArray = nil + updateSpec.Metadata.EntityMetadata = updatedEntityMetadata + updatedUpdateSpecList = append(updatedUpdateSpecList, updateSpec) + } + updateSpecList = updatedUpdateSpecList + } else if c.Version == ReleaseVSAN70 || c.Version == ReleaseVSAN70u1 { + updatedUpdateSpecList := make([]cnstypes.CnsVolumeMetadataUpdateSpec, 0, len(updateSpecList)) + for _, updateSpec := range updateSpecList { + updateSpec.Metadata.ContainerCluster.ClusterDistribution = "" + var updatedContainerClusterArray []cnstypes.CnsContainerCluster + for _, containerCluster := range updateSpec.Metadata.ContainerClusterArray { + containerCluster.ClusterDistribution = "" + updatedContainerClusterArray = append(updatedContainerClusterArray, containerCluster) + } + updateSpec.Metadata.ContainerClusterArray = updatedContainerClusterArray + updatedUpdateSpecList = append(updatedUpdateSpecList, updateSpec) + } + updateSpecList = updatedUpdateSpecList + } + return updateSpecList +} diff --git a/vendor/github.com/vmware/govmomi/cns/methods/methods.go b/vendor/github.com/vmware/govmomi/cns/methods/methods.go new file mode 100644 index 000000000..6f0e0d0ae --- /dev/null +++ b/vendor/github.com/vmware/govmomi/cns/methods/methods.go @@ -0,0 +1,328 @@ +/* +Copyright (c) 2019 VMware, Inc. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES 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 ( + "context" + + "github.com/vmware/govmomi/cns/types" + "github.com/vmware/govmomi/vim25/soap" +) + +type CnsCreateVolumeBody struct { + Req *types.CnsCreateVolume `xml:"urn:vsan CnsCreateVolume,omitempty"` + Res *types.CnsCreateVolumeResponse `xml:"urn:vsan CnsCreateVolumeResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *CnsCreateVolumeBody) Fault() *soap.Fault { return b.Fault_ } + +func CnsCreateVolume(ctx context.Context, r soap.RoundTripper, req *types.CnsCreateVolume) (*types.CnsCreateVolumeResponse, error) { + var reqBody, resBody CnsCreateVolumeBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type CnsUpdateVolumeBody struct { + Req *types.CnsUpdateVolumeMetadata `xml:"urn:vsan CnsUpdateVolumeMetadata,omitempty"` + Res *types.CnsUpdateVolumeMetadataResponse `xml:"urn:vsan CnsUpdateVolumeMetadataResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *CnsUpdateVolumeBody) Fault() *soap.Fault { return b.Fault_ } + +func CnsUpdateVolumeMetadata(ctx context.Context, r soap.RoundTripper, req *types.CnsUpdateVolumeMetadata) (*types.CnsUpdateVolumeMetadataResponse, error) { + var reqBody, resBody CnsUpdateVolumeBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type CnsDeleteVolumeBody struct { + Req *types.CnsDeleteVolume `xml:"urn:vsan CnsDeleteVolume,omitempty"` + Res *types.CnsDeleteVolumeResponse `xml:"urn:vsan CnsDeleteVolumeResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *CnsDeleteVolumeBody) Fault() *soap.Fault { return b.Fault_ } + +func CnsDeleteVolume(ctx context.Context, r soap.RoundTripper, req *types.CnsDeleteVolume) (*types.CnsDeleteVolumeResponse, error) { + var reqBody, resBody CnsDeleteVolumeBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type CnsExtendVolumeBody struct { + Req *types.CnsExtendVolume `xml:"urn:vsan CnsExtendVolume,omitempty"` + Res *types.CnsExtendVolumeResponse `xml:"urn:vsan CnsExtendVolumeResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *CnsExtendVolumeBody) Fault() *soap.Fault { return b.Fault_ } + +func CnsExtendVolume(ctx context.Context, r soap.RoundTripper, req *types.CnsExtendVolume) (*types.CnsExtendVolumeResponse, error) { + var reqBody, resBody CnsExtendVolumeBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type CnsAttachVolumeBody struct { + Req *types.CnsAttachVolume `xml:"urn:vsan CnsAttachVolume,omitempty"` + Res *types.CnsAttachVolumeResponse `xml:"urn:vsan CnsAttachVolumeResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *CnsAttachVolumeBody) Fault() *soap.Fault { return b.Fault_ } + +func CnsAttachVolume(ctx context.Context, r soap.RoundTripper, req *types.CnsAttachVolume) (*types.CnsAttachVolumeResponse, error) { + var reqBody, resBody CnsAttachVolumeBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type CnsDetachVolumeBody struct { + Req *types.CnsDetachVolume `xml:"urn:vsan CnsDetachVolume,omitempty"` + Res *types.CnsDetachVolumeResponse `xml:"urn:vsan CnsDetachVolumeResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *CnsDetachVolumeBody) Fault() *soap.Fault { return b.Fault_ } + +func CnsDetachVolume(ctx context.Context, r soap.RoundTripper, req *types.CnsDetachVolume) (*types.CnsDetachVolumeResponse, error) { + var reqBody, resBody CnsDetachVolumeBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type CnsQueryVolumeBody struct { + Req *types.CnsQueryVolume `xml:"urn:vsan CnsQueryVolume,omitempty"` + Res *types.CnsQueryVolumeResponse `xml:"urn:vsan CnsQueryVolumeResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *CnsQueryVolumeBody) Fault() *soap.Fault { return b.Fault_ } + +func CnsQueryVolume(ctx context.Context, r soap.RoundTripper, req *types.CnsQueryVolume) (*types.CnsQueryVolumeResponse, error) { + var reqBody, resBody CnsQueryVolumeBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type CnsQueryVolumeInfoBody struct { + Req *types.CnsQueryVolumeInfo `xml:"urn:vsan CnsQueryVolumeInfo,omitempty"` + Res *types.CnsQueryVolumeInfoResponse `xml:"urn:vsan CnsQueryVolumeInfoResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *CnsQueryVolumeInfoBody) Fault() *soap.Fault { return b.Fault_ } + +func CnsQueryVolumeInfo(ctx context.Context, r soap.RoundTripper, req *types.CnsQueryVolumeInfo) (*types.CnsQueryVolumeInfoResponse, error) { + var reqBody, resBody CnsQueryVolumeInfoBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type CnsQueryAllVolumeBody struct { + Req *types.CnsQueryAllVolume `xml:"urn:vsan CnsQueryAllVolume,omitempty"` + Res *types.CnsQueryAllVolumeResponse `xml:"urn:vsan CnsQueryAllVolumeResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *CnsQueryAllVolumeBody) Fault() *soap.Fault { return b.Fault_ } + +func CnsQueryAllVolume(ctx context.Context, r soap.RoundTripper, req *types.CnsQueryAllVolume) (*types.CnsQueryAllVolumeResponse, error) { + var reqBody, resBody CnsQueryAllVolumeBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type CnsRelocateVolumeBody struct { + Req *types.CnsRelocateVolume `xml:"urn:vsan CnsRelocateVolume,omitempty"` + Res *types.CnsRelocateVolumeResponse `xml:"urn:vsan CnsRelocateVolumeResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *CnsRelocateVolumeBody) Fault() *soap.Fault { return b.Fault_ } + +func CnsRelocateVolume(ctx context.Context, r soap.RoundTripper, req *types.CnsRelocateVolume) (*types.CnsRelocateVolumeResponse, error) { + var reqBody, resBody CnsRelocateVolumeBody + reqBody.Req = req + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type CnsConfigureVolumeACLsBody struct { + Req *types.CnsConfigureVolumeACLs `xml:"urn:vsan CnsConfigureVolumeACLs,omitempty"` + Res *types.CnsConfigureVolumeACLsResponse `xml:"urn:vsan CnsConfigureVolumeACLsResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *CnsConfigureVolumeACLsBody) Fault() *soap.Fault { return b.Fault_ } + +func CnsConfigureVolumeACLs(ctx context.Context, r soap.RoundTripper, req *types.CnsConfigureVolumeACLs) (*types.CnsConfigureVolumeACLsResponse, error) { + var reqBody, resBody CnsConfigureVolumeACLsBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type CnsQueryAsyncBody struct { + Req *types.CnsQueryAsync `xml:"urn:vsan CnsQueryAsync,omitempty"` + Res *types.CnsQueryAsyncResponse `xml:"urn:vsan CnsQueryAsyncResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *CnsQueryAsyncBody) Fault() *soap.Fault { return b.Fault_ } + +func CnsQueryAsync(ctx context.Context, r soap.RoundTripper, req *types.CnsQueryAsync) (*types.CnsQueryAsyncResponse, error) { + var reqBody, resBody CnsQueryAsyncBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +// CNS CreateSnapshots API + +type CnsCreateSnapshotsBody struct { + Req *types.CnsCreateSnapshots `xml:"urn:vsan CnsCreateSnapshots,omitempty"` + Res *types.CnsCreateSnapshotsResponse `xml:"urn:vsan CnsCreateSnapshotsResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *CnsCreateSnapshotsBody) Fault() *soap.Fault { return b.Fault_ } + +func CnsCreateSnapshots(ctx context.Context, r soap.RoundTripper, req *types.CnsCreateSnapshots) (*types.CnsCreateSnapshotsResponse, error) { + var reqBody, resBody CnsCreateSnapshotsBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +// CNS DeleteSnapshot API + +type CnsDeleteSnapshotBody struct { + Req *types.CnsDeleteSnapshots `xml:"urn:vsan CnsDeleteSnapshots,omitempty"` + Res *types.CnsDeleteSnapshotsResponse `xml:"urn:vsan CnsDeleteSnapshotsResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *CnsDeleteSnapshotBody) Fault() *soap.Fault { return b.Fault_ } + +func CnsDeleteSnapshots(ctx context.Context, r soap.RoundTripper, req *types.CnsDeleteSnapshots) (*types.CnsDeleteSnapshotsResponse, error) { + var reqBody, resBody CnsDeleteSnapshotBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +// CNS QuerySnapshots API + +type CnsQuerySnapshotsBody struct { + Req *types.CnsQuerySnapshots `xml:"urn:vsan CnsQuerySnapshots,omitempty"` + Res *types.CnsQuerySnapshotsResponse `xml:"urn:vsan CnsQuerySnapshotsResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *CnsQuerySnapshotsBody) Fault() *soap.Fault { return b.Fault_ } + +func CnsQuerySnapshots(ctx context.Context, r soap.RoundTripper, req *types.CnsQuerySnapshots) (*types.CnsQuerySnapshotsResponse, error) { + var reqBody, resBody CnsQuerySnapshotsBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} diff --git a/vendor/github.com/vmware/govmomi/cns/types/enum.go b/vendor/github.com/vmware/govmomi/cns/types/enum.go new file mode 100644 index 000000000..53f0580b4 --- /dev/null +++ b/vendor/github.com/vmware/govmomi/cns/types/enum.go @@ -0,0 +1,94 @@ +/* +Copyright (c) 2019 VMware, Inc. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES 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" + + "github.com/vmware/govmomi/vim25/types" +) + +type CnsVolumeType string + +const ( + CnsVolumeTypeBlock = CnsVolumeType("BLOCK") + CnsVolumeTypeFile = CnsVolumeType("FILE") +) + +func init() { + types.Add("CnsVolumeType", reflect.TypeOf((*CnsVolumeType)(nil)).Elem()) +} + +type CnsClusterFlavor string + +const ( + CnsClusterFlavorVanilla = CnsClusterFlavor("VANILLA") + CnsClusterFlavorWorkload = CnsClusterFlavor("WORKLOAD") + CnsClusterFlavorGuest = CnsClusterFlavor("GUEST_CLUSTER") + CnsClusterFlavorUnknown = CnsClusterFlavor("ClusterFlavor_Unknown") +) + +func init() { + types.Add("CnsClusterFlavor", reflect.TypeOf((*CnsClusterFlavor)(nil)).Elem()) +} + +type QuerySelectionNameType string + +const ( + QuerySelectionNameTypeVolumeType = QuerySelectionNameType("VOLUME_TYPE") + QuerySelectionNameTypeVolumeName = QuerySelectionNameType("VOLUME_NAME") + QuerySelectionNameTypeBackingObjectDetails = QuerySelectionNameType("BACKING_OBJECT_DETAILS") + QuerySelectionNameTypeComplianceStatus = QuerySelectionNameType("COMPLIANCE_STATUS") + QuerySelectionNameTypeDataStoreAccessibility = QuerySelectionNameType("DATASTORE_ACCESSIBILITY_STATUS") + QuerySelectionNameTypeHealthStatus = QuerySelectionNameType("HEALTH_STATUS") +) + +func init() { + types.Add("QuerySelectionNameType", reflect.TypeOf((*QuerySelectionNameType)(nil)).Elem()) +} + +type CnsClusterType string + +const ( + CnsClusterTypeKubernetes = CnsClusterType("KUBERNETES") +) + +func init() { + types.Add("CnsClusterType", reflect.TypeOf((*CnsClusterType)(nil)).Elem()) +} + +type CnsKubernetesEntityType string + +const ( + CnsKubernetesEntityTypePVC = CnsKubernetesEntityType("PERSISTENT_VOLUME_CLAIM") + CnsKubernetesEntityTypePV = CnsKubernetesEntityType("PERSISTENT_VOLUME") + CnsKubernetesEntityTypePOD = CnsKubernetesEntityType("POD") +) + +type CnsQuerySelectionNameType string + +const ( + CnsQuerySelectionName_VOLUME_NAME = CnsQuerySelectionNameType("VOLUME_NAME") + CnsQuerySelectionName_VOLUME_TYPE = CnsQuerySelectionNameType("VOLUME_TYPE") + CnsQuerySelectionName_BACKING_OBJECT_DETAILS = CnsQuerySelectionNameType("BACKING_OBJECT_DETAILS") + CnsQuerySelectionName_COMPLIANCE_STATUS = CnsQuerySelectionNameType("COMPLIANCE_STATUS") + CnsQuerySelectionName_DATASTORE_ACCESSIBILITY_STATUS = CnsQuerySelectionNameType("DATASTORE_ACCESSIBILITY_STATUS") +) + +func init() { + types.Add("CnsKubernetesEntityType", reflect.TypeOf((*CnsKubernetesEntityType)(nil)).Elem()) +} diff --git a/vendor/github.com/vmware/govmomi/cns/types/if.go b/vendor/github.com/vmware/govmomi/cns/types/if.go new file mode 100644 index 000000000..42a70ec73 --- /dev/null +++ b/vendor/github.com/vmware/govmomi/cns/types/if.go @@ -0,0 +1,117 @@ +/* +Copyright (c) 2019 VMware, Inc. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES 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" + + "github.com/vmware/govmomi/vim25/types" +) + +func (b *CnsFault) GetCnsFault() *CnsFault { + return b +} + +type BaseCnsFault interface { + GetCnsFault() *CnsFault +} + +func init() { + types.Add("BaseCnsFault", reflect.TypeOf((*CnsFault)(nil)).Elem()) +} + +func (b *CnsAlreadyRegisteredFault) GetCnsAlreadyRegisteredFault() *CnsAlreadyRegisteredFault { + return b +} + +type BaseCnsAlreadyRegisteredFault interface { + GetCnsAlreadyRegisteredFault() *CnsAlreadyRegisteredFault +} + +func init() { + types.Add("BaseCnsAlreadyRegisteredFault", reflect.TypeOf((*CnsAlreadyRegisteredFault)(nil)).Elem()) +} + +func (b *CnsBackingObjectDetails) GetCnsBackingObjectDetails() *CnsBackingObjectDetails { return b } + +type BaseCnsBackingObjectDetails interface { + GetCnsBackingObjectDetails() *CnsBackingObjectDetails +} + +func init() { + types.Add("BaseCnsBackingObjectDetails", reflect.TypeOf((*CnsBackingObjectDetails)(nil)).Elem()) +} + +func (b *CnsBaseCreateSpec) GetCnsBaseCreateSpec() *CnsBaseCreateSpec { return b } + +type BaseCnsBaseCreateSpec interface { + GetCnsBaseCreateSpec() *CnsBaseCreateSpec +} + +func init() { + types.Add("BaseCnsBaseCreateSpec", reflect.TypeOf((*CnsBaseCreateSpec)(nil)).Elem()) +} + +type BaseCnsVolumeRelocateSpec interface { + GetCnsVolumeRelocateSpec() CnsVolumeRelocateSpec +} + +func (s CnsVolumeRelocateSpec) GetCnsVolumeRelocateSpec() CnsVolumeRelocateSpec { return s } + +func init() { + types.Add("BaseCnsVolumeRelocateSpec", reflect.TypeOf((*CnsVolumeRelocateSpec)(nil)).Elem()) +} + +func (b *CnsEntityMetadata) GetCnsEntityMetadata() *CnsEntityMetadata { return b } + +type BaseCnsEntityMetadata interface { + GetCnsEntityMetadata() *CnsEntityMetadata +} + +func init() { + types.Add("BaseCnsEntityMetadata", reflect.TypeOf((*CnsEntityMetadata)(nil)).Elem()) +} + +func (b *CnsVolumeInfo) GetCnsVolumeInfo() *CnsVolumeInfo { return b } + +type BaseCnsVolumeInfo interface { + GetCnsVolumeInfo() *CnsVolumeInfo +} + +func init() { + types.Add("BaseCnsVolumeInfo", reflect.TypeOf((*CnsVolumeInfo)(nil)).Elem()) +} + +func (b *CnsVolumeOperationResult) GetCnsVolumeOperationResult() *CnsVolumeOperationResult { return b } + +type BaseCnsVolumeOperationResult interface { + GetCnsVolumeOperationResult() *CnsVolumeOperationResult +} + +func init() { + types.Add("BaseCnsVolumeOperationResult", reflect.TypeOf((*CnsVolumeOperationResult)(nil)).Elem()) +} + +func (b *CnsVolumeSource) GetCnsVolumeSource() *CnsVolumeSource { return b } + +type BaseCnsVolumeSource interface { + GetCnsVolumeSource() *CnsVolumeSource +} + +func init() { + types.Add("BaseCnsVolumeSource", reflect.TypeOf((*CnsVolumeSource)(nil)).Elem()) +} diff --git a/vendor/github.com/vmware/govmomi/cns/types/types.go b/vendor/github.com/vmware/govmomi/cns/types/types.go new file mode 100644 index 000000000..575de000c --- /dev/null +++ b/vendor/github.com/vmware/govmomi/cns/types/types.go @@ -0,0 +1,880 @@ +/* +Copyright (c) 2019 VMware, Inc. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES 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" + + "github.com/vmware/govmomi/vim25/types" + vsanfstypes "github.com/vmware/govmomi/vsan/vsanfs/types" +) + +type CnsCreateVolumeRequestType struct { + This types.ManagedObjectReference `xml:"_this"` + CreateSpecs []CnsVolumeCreateSpec `xml:"createSpecs,omitempty"` +} + +func init() { + types.Add("CnsCreateVolumeRequestType", reflect.TypeOf((*CnsCreateVolumeRequestType)(nil)).Elem()) +} + +type CnsCreateVolume CnsCreateVolumeRequestType + +func init() { + types.Add("CnsCreateVolume", reflect.TypeOf((*CnsCreateVolume)(nil)).Elem()) +} + +type CnsCreateVolumeResponse struct { + Returnval types.ManagedObjectReference `xml:"returnval"` +} + +type CnsEntityMetadata struct { + types.DynamicData + + EntityName string `xml:"entityName"` + Labels []types.KeyValue `xml:"labels,omitempty"` + Delete bool `xml:"delete,omitempty"` + ClusterID string `xml:"clusterId,omitempty"` +} + +func init() { + types.Add("CnsEntityMetadata", reflect.TypeOf((*CnsEntityMetadata)(nil)).Elem()) +} + +type CnsKubernetesEntityReference struct { + EntityType string `xml:"entityType"` + EntityName string `xml:"entityName"` + Namespace string `xml:"namespace,omitempty"` + ClusterID string `xml:"clusterId,omitempty"` +} + +type CnsKubernetesEntityMetadata struct { + CnsEntityMetadata + + EntityType string `xml:"entityType"` + Namespace string `xml:"namespace,omitempty"` + ReferredEntity []CnsKubernetesEntityReference `xml:"referredEntity,omitempty"` +} + +func init() { + types.Add("CnsKubernetesEntityMetadata", reflect.TypeOf((*CnsKubernetesEntityMetadata)(nil)).Elem()) +} + +type CnsVolumeMetadata struct { + types.DynamicData + + ContainerCluster CnsContainerCluster `xml:"containerCluster"` + EntityMetadata []BaseCnsEntityMetadata `xml:"entityMetadata,typeattr,omitempty"` + ContainerClusterArray []CnsContainerCluster `xml:"containerClusterArray,omitempty"` +} + +func init() { + types.Add("CnsVolumeMetadata", reflect.TypeOf((*CnsVolumeMetadata)(nil)).Elem()) +} + +type CnsVolumeCreateSpec struct { + types.DynamicData + Name string `xml:"name"` + VolumeType string `xml:"volumeType"` + Datastores []types.ManagedObjectReference `xml:"datastores,omitempty"` + Metadata CnsVolumeMetadata `xml:"metadata,omitempty"` + BackingObjectDetails BaseCnsBackingObjectDetails `xml:"backingObjectDetails,typeattr"` + Profile []types.BaseVirtualMachineProfileSpec `xml:"profile,omitempty,typeattr"` + CreateSpec BaseCnsBaseCreateSpec `xml:"createSpec,omitempty,typeattr"` + VolumeSource BaseCnsVolumeSource `xml:"volumeSource,omitempty,typeattr"` +} + +func init() { + types.Add("CnsVolumeCreateSpec", reflect.TypeOf((*CnsVolumeCreateSpec)(nil)).Elem()) +} + +type CnsUpdateVolumeMetadataRequestType struct { + This types.ManagedObjectReference `xml:"_this"` + UpdateSpecs []CnsVolumeMetadataUpdateSpec `xml:"updateSpecs,omitempty"` +} + +func init() { + types.Add("CnsUpdateVolumeMetadataRequestType", reflect.TypeOf((*CnsUpdateVolumeMetadataRequestType)(nil)).Elem()) +} + +type CnsUpdateVolumeMetadata CnsUpdateVolumeMetadataRequestType + +func init() { + types.Add("CnsUpdateVolumeMetadata", reflect.TypeOf((*CnsUpdateVolumeMetadata)(nil)).Elem()) +} + +type CnsUpdateVolumeMetadataResponse struct { + Returnval types.ManagedObjectReference `xml:"returnval"` +} + +type CnsVolumeMetadataUpdateSpec struct { + types.DynamicData + + VolumeId CnsVolumeId `xml:"volumeId"` + Metadata CnsVolumeMetadata `xml:"metadata,omitempty"` +} + +func init() { + types.Add("CnsVolumeMetadataUpdateSpec", reflect.TypeOf((*CnsVolumeMetadataUpdateSpec)(nil)).Elem()) +} + +type CnsDeleteVolumeRequestType struct { + This types.ManagedObjectReference `xml:"_this"` + VolumeIds []CnsVolumeId `xml:"volumeIds"` + DeleteDisk bool `xml:"deleteDisk"` +} + +func init() { + types.Add("CnsDeleteVolumeRequestType", reflect.TypeOf((*CnsDeleteVolumeRequestType)(nil)).Elem()) +} + +type CnsDeleteVolume CnsDeleteVolumeRequestType + +func init() { + types.Add("CnsDeleteVolume", reflect.TypeOf((*CnsDeleteVolume)(nil)).Elem()) +} + +type CnsDeleteVolumeResponse struct { + Returnval types.ManagedObjectReference `xml:"returnval"` +} + +type CnsExtendVolumeRequestType struct { + This types.ManagedObjectReference `xml:"_this"` + ExtendSpecs []CnsVolumeExtendSpec `xml:"extendSpecs,omitempty"` +} + +func init() { + types.Add("CnsExtendVolumeRequestType", reflect.TypeOf((*CnsExtendVolumeRequestType)(nil)).Elem()) +} + +type CnsExtendVolume CnsExtendVolumeRequestType + +func init() { + types.Add("CnsExtendVolume", reflect.TypeOf((*CnsExtendVolume)(nil)).Elem()) +} + +type CnsExtendVolumeResponse struct { + Returnval types.ManagedObjectReference `xml:"returnval"` +} + +type CnsVolumeExtendSpec struct { + types.DynamicData + + VolumeId CnsVolumeId `xml:"volumeId"` + CapacityInMb int64 `xml:"capacityInMb"` +} + +func init() { + types.Add("CnsVolumeExtendSpec", reflect.TypeOf((*CnsVolumeExtendSpec)(nil)).Elem()) +} + +type CnsAttachVolumeRequestType struct { + This types.ManagedObjectReference `xml:"_this"` + AttachSpecs []CnsVolumeAttachDetachSpec `xml:"attachSpecs,omitempty"` +} + +func init() { + types.Add("CnsAttachVolumeRequestType", reflect.TypeOf((*CnsAttachVolumeRequestType)(nil)).Elem()) +} + +type CnsAttachVolume CnsAttachVolumeRequestType + +func init() { + types.Add("CnsAttachVolume", reflect.TypeOf((*CnsAttachVolume)(nil)).Elem()) +} + +type CnsAttachVolumeResponse struct { + Returnval types.ManagedObjectReference `xml:"returnval"` +} + +type CnsDetachVolumeRequestType struct { + This types.ManagedObjectReference `xml:"_this"` + DetachSpecs []CnsVolumeAttachDetachSpec `xml:"detachSpecs,omitempty"` +} + +func init() { + types.Add("CnsDetachVolumeRequestType", reflect.TypeOf((*CnsDetachVolumeRequestType)(nil)).Elem()) +} + +type CnsDetachVolume CnsDetachVolumeRequestType + +func init() { + types.Add("CnsDetachVolume", reflect.TypeOf((*CnsDetachVolume)(nil)).Elem()) +} + +type CnsDetachVolumeResponse struct { + Returnval types.ManagedObjectReference `xml:"returnval"` +} + +type CnsVolumeAttachDetachSpec struct { + types.DynamicData + + VolumeId CnsVolumeId `xml:"volumeId"` + Vm types.ManagedObjectReference `xml:"vm"` +} + +func init() { + types.Add("CnsVolumeAttachDetachSpec", reflect.TypeOf((*CnsVolumeAttachDetachSpec)(nil)).Elem()) +} + +type CnsQueryVolume CnsQueryVolumeRequestType + +func init() { + types.Add("CnsQueryVolume", reflect.TypeOf((*CnsQueryVolume)(nil)).Elem()) +} + +type CnsQueryVolumeRequestType struct { + This types.ManagedObjectReference `xml:"_this"` + Filter CnsQueryFilter `xml:"filter"` +} + +func init() { + types.Add("CnsQueryVolumeRequestType", reflect.TypeOf((*CnsQueryVolumeRequestType)(nil)).Elem()) +} + +type CnsQueryVolumeResponse struct { + Returnval CnsQueryResult `xml:"returnval"` +} + +type CnsQueryVolumeInfo CnsQueryVolumeInfoRequestType + +func init() { + types.Add("CnsQueryVolumeInfo", reflect.TypeOf((*CnsQueryVolumeInfo)(nil)).Elem()) +} + +type CnsQueryVolumeInfoRequestType struct { + This types.ManagedObjectReference `xml:"_this"` + VolumeIds []CnsVolumeId `xml:"volumes"` +} + +type CnsQueryVolumeInfoResponse struct { + Returnval types.ManagedObjectReference `xml:"returnval"` +} + +type CnsQueryAllVolume CnsQueryAllVolumeRequestType + +func init() { + types.Add("CnsQueryAllVolume", reflect.TypeOf((*CnsQueryAllVolume)(nil)).Elem()) +} + +type CnsQueryAllVolumeRequestType struct { + This types.ManagedObjectReference `xml:"_this"` + Filter CnsQueryFilter `xml:"filter"` + Selection CnsQuerySelection `xml:"selection"` +} + +func init() { + types.Add("CnsQueryAllVolumeRequestType", reflect.TypeOf((*CnsQueryVolumeRequestType)(nil)).Elem()) +} + +type CnsQueryAllVolumeResponse struct { + Returnval CnsQueryResult `xml:"returnval"` +} + +type CnsContainerCluster struct { + types.DynamicData + + ClusterType string `xml:"clusterType"` + ClusterId string `xml:"clusterId"` + VSphereUser string `xml:"vSphereUser"` + ClusterFlavor string `xml:"clusterFlavor,omitempty"` + ClusterDistribution string `xml:"clusterDistribution,omitempty"` +} + +func init() { + types.Add("CnsContainerCluster", reflect.TypeOf((*CnsContainerCluster)(nil)).Elem()) +} + +type CnsVolume struct { + types.DynamicData + + VolumeId CnsVolumeId `xml:"volumeId"` + DatastoreUrl string `xml:"datastoreUrl,omitempty"` + Name string `xml:"name,omitempty"` + VolumeType string `xml:"volumeType,omitempty"` + StoragePolicyId string `xml:"storagePolicyId,omitempty"` + Metadata CnsVolumeMetadata `xml:"metadata,omitempty"` + BackingObjectDetails BaseCnsBackingObjectDetails `xml:"backingObjectDetails,omitempty"` + ComplianceStatus string `xml:"complianceStatus,omitempty"` + DatastoreAccessibilityStatus string `xml:"datastoreAccessibilityStatus,omitempty"` + HealthStatus string `xml:"healthStatus,omitempty"` +} + +func init() { + types.Add("CnsVolume", reflect.TypeOf((*CnsVolume)(nil)).Elem()) +} + +type CnsVolumeOperationResult struct { + types.DynamicData + + VolumeId CnsVolumeId `xml:"volumeId,omitempty"` + Fault *types.LocalizedMethodFault `xml:"fault,omitempty"` +} + +func init() { + types.Add("CnsVolumeOperationResult", reflect.TypeOf((*CnsVolumeOperationResult)(nil)).Elem()) +} + +type CnsVolumeOperationBatchResult struct { + types.DynamicData + + VolumeResults []BaseCnsVolumeOperationResult `xml:"volumeResults,omitempty,typeattr"` +} + +func init() { + types.Add("CnsVolumeOperationBatchResult", reflect.TypeOf((*CnsVolumeOperationBatchResult)(nil)).Elem()) +} + +type CnsPlacementResult struct { + Datastore types.ManagedObjectReference `xml:"datastore,omitempty"` + PlacementFaults []*types.LocalizedMethodFault `xml:"placementFaults,omitempty"` +} + +func init() { + types.Add("CnsPlacementResult", reflect.TypeOf((*CnsPlacementResult)(nil)).Elem()) +} + +type CnsVolumeCreateResult struct { + CnsVolumeOperationResult + Name string `xml:"name,omitempty"` + PlacementResults []CnsPlacementResult `xml:"placementResults,omitempty"` +} + +func init() { + types.Add("CnsVolumeCreateResult", reflect.TypeOf((*CnsVolumeCreateResult)(nil)).Elem()) +} + +type CnsVolumeAttachResult struct { + CnsVolumeOperationResult + + DiskUUID string `xml:"diskUUID,omitempty"` +} + +func init() { + types.Add("CnsVolumeAttachResult", reflect.TypeOf((*CnsVolumeAttachResult)(nil)).Elem()) +} + +type CnsVolumeId struct { + types.DynamicData + + Id string `xml:"id"` +} + +func init() { + types.Add("CnsVolumeId", reflect.TypeOf((*CnsVolumeId)(nil)).Elem()) +} + +type CnsBackingObjectDetails struct { + types.DynamicData + + CapacityInMb int64 `xml:"capacityInMb,omitempty"` +} + +func init() { + types.Add("CnsBackingObjectDetails", reflect.TypeOf((*CnsBackingObjectDetails)(nil)).Elem()) +} + +type CnsBlockBackingDetails struct { + CnsBackingObjectDetails + + BackingDiskId string `xml:"backingDiskId,omitempty"` + BackingDiskUrlPath string `xml:"backingDiskUrlPath,omitempty"` +} + +func init() { + types.Add("CnsBlockBackingDetails", reflect.TypeOf((*CnsBlockBackingDetails)(nil)).Elem()) +} + +type CnsFileBackingDetails struct { + CnsBackingObjectDetails + + BackingFileId string `xml:"backingFileId,omitempty"` +} + +func init() { + types.Add("CnsFileBackingDetails", reflect.TypeOf((*CnsFileBackingDetails)(nil)).Elem()) +} + +type CnsVsanFileShareBackingDetails struct { + CnsFileBackingDetails + + Name string `xml:"name,omitempty"` + AccessPoints []types.KeyValue `xml:"accessPoints,omitempty"` +} + +func init() { + types.Add("CnsVsanFileShareBackingDetails", reflect.TypeOf((*CnsVsanFileShareBackingDetails)(nil)).Elem()) +} + +type CnsBaseCreateSpec struct { + types.DynamicData +} + +func init() { + types.Add("CnsBaseCreateSpec", reflect.TypeOf((*CnsBaseCreateSpec)(nil)).Elem()) +} + +type CnsFileCreateSpec struct { + CnsBaseCreateSpec +} + +func init() { + types.Add("CnsFileCreateSpec", reflect.TypeOf((*CnsFileCreateSpec)(nil)).Elem()) +} + +type CnsVSANFileCreateSpec struct { + CnsFileCreateSpec + SoftQuotaInMb int64 `xml:"softQuotaInMb,omitempty"` + Permission []vsanfstypes.VsanFileShareNetPermission `xml:"permission,omitempty,typeattr"` +} + +func init() { + types.Add("CnsVSANFileCreateSpec", reflect.TypeOf((*CnsVSANFileCreateSpec)(nil)).Elem()) +} + +type CnsQueryFilter struct { + types.DynamicData + + VolumeIds []CnsVolumeId `xml:"volumeIds,omitempty"` + Names []string `xml:"names,omitempty"` + ContainerClusterIds []string `xml:"containerClusterIds,omitempty"` + StoragePolicyId string `xml:"storagePolicyId,omitempty"` + Datastores []types.ManagedObjectReference `xml:"datastores,omitempty"` + Labels []types.KeyValue `xml:"labels,omitempty"` + ComplianceStatus string `xml:"complianceStatus,omitempty"` + DatastoreAccessibilityStatus string `xml:"datastoreAccessibilityStatus,omitempty"` + Cursor *CnsCursor `xml:"cursor,omitempty"` + healthStatus string `xml:"healthStatus,omitempty"` +} + +func init() { + types.Add("CnsQueryFilter", reflect.TypeOf((*CnsQueryFilter)(nil)).Elem()) +} + +type CnsQuerySelection struct { + types.DynamicData + + Names []string `xml:"names,omitempty"` +} + +type CnsQueryResult struct { + types.DynamicData + + Volumes []CnsVolume `xml:"volumes,omitempty"` + Cursor CnsCursor `xml:"cursor"` +} + +func init() { + types.Add("CnsQueryResult", reflect.TypeOf((*CnsQueryResult)(nil)).Elem()) +} + +type CnsVolumeInfo struct { + types.DynamicData +} + +func init() { + types.Add("CnsVolumeInfo", reflect.TypeOf((*CnsVolumeInfo)(nil)).Elem()) +} + +type CnsBlockVolumeInfo struct { + CnsVolumeInfo + + VStorageObject types.VStorageObject `xml:"vStorageObject"` +} + +func init() { + types.Add("CnsBlockVolumeInfo", reflect.TypeOf((*CnsBlockVolumeInfo)(nil)).Elem()) +} + +type CnsQueryVolumeInfoResult struct { + CnsVolumeOperationResult + + VolumeInfo BaseCnsVolumeInfo `xml:"volumeInfo,typeattr,omitempty"` +} + +func init() { + types.Add("CnsQueryVolumeInfoResult", reflect.TypeOf((*CnsQueryVolumeInfoResult)(nil)).Elem()) +} + +type CnsRelocateVolumeRequestType struct { + This types.ManagedObjectReference `xml:"_this"` + RelocateSpecs []BaseCnsVolumeRelocateSpec `xml:"relocateSpecs,typeattr"` +} + +func init() { + types.Add("CnsRelocateVolumeRequestType", reflect.TypeOf((*CnsRelocateVolumeRequestType)(nil)).Elem()) +} + +type CnsRelocateVolume CnsRelocateVolumeRequestType + +func init() { + types.Add("CnsRelocateVolume", reflect.TypeOf((*CnsRelocateVolume)(nil)).Elem()) +} + +type CnsRelocateVolumeResponse struct { + Returnval types.ManagedObjectReference `xml:"returnval"` +} + +type CnsVolumeRelocateSpec struct { + types.DynamicData + + VolumeId CnsVolumeId `xml:"volumeId"` + Datastore types.ManagedObjectReference `xml:"datastore"` + Profile []types.BaseVirtualMachineProfileSpec `xml:"profile,omitempty,typeattr"` +} + +func init() { + types.Add("CnsVolumeRelocateSpec", reflect.TypeOf((*CnsVolumeRelocateSpec)(nil)).Elem()) +} + +type CnsBlockVolumeRelocateSpec struct { + CnsVolumeRelocateSpec +} + +func NewCnsBlockVolumeRelocateSpec(volumeId string, datastore types.ManagedObjectReference, profile ...types.BaseVirtualMachineProfileSpec) CnsBlockVolumeRelocateSpec { + cnsVolumeID := CnsVolumeId{ + Id: volumeId, + } + volumeSpec := CnsVolumeRelocateSpec{ + VolumeId: cnsVolumeID, + Datastore: datastore, + Profile: profile, + } + blockVolSpec := CnsBlockVolumeRelocateSpec{ + CnsVolumeRelocateSpec: volumeSpec, + } + return blockVolSpec +} + +func init() { + types.Add("CnsBlockVolumeRelocateSpec", reflect.TypeOf((*CnsBlockVolumeRelocateSpec)(nil)).Elem()) +} + +type CnsCursor struct { + types.DynamicData + + Offset int64 `xml:"offset"` + Limit int64 `xml:"limit"` + TotalRecords int64 `xml:"totalRecords,omitempty"` +} + +func init() { + types.Add("CnsCursor", reflect.TypeOf((*CnsCursor)(nil)).Elem()) +} + +type CnsFault struct { + types.BaseMethodFault `xml:"fault,typeattr"` + + Reason string `xml:"reason,omitempty"` +} + +func init() { + types.Add("CnsFault", reflect.TypeOf((*CnsFault)(nil)).Elem()) +} + +type CnsVolumeNotFoundFault struct { + CnsFault + + VolumeId CnsVolumeId `xml:"volumeId"` +} + +func init() { + types.Add("CnsVolumeNotFoundFault", reflect.TypeOf((*CnsVolumeNotFoundFault)(nil)).Elem()) +} + +type CnsAlreadyRegisteredFault struct { + CnsFault `xml:"fault,typeattr"` + + VolumeId CnsVolumeId `xml:"volumeId,omitempty"` +} + +func init() { + types.Add("CnsAlreadyRegisteredFault", reflect.TypeOf((*CnsAlreadyRegisteredFault)(nil)).Elem()) +} + +type CnsSnapshotNotFoundFault struct { + CnsFault + + VolumeId CnsVolumeId `xml:"volumeId,omitempty"` + SnapshotId CnsSnapshotId `xml:"snapshotId"` +} + +func init() { + types.Add("CnsSnapshotNotFoundFault", reflect.TypeOf((*CnsSnapshotNotFoundFault)(nil)).Elem()) +} + +type CnsConfigureVolumeACLs CnsConfigureVolumeACLsRequestType + +func init() { + types.Add("vsan:CnsConfigureVolumeACLs", reflect.TypeOf((*CnsConfigureVolumeACLs)(nil)).Elem()) +} + +type CnsConfigureVolumeACLsRequestType struct { + This types.ManagedObjectReference `xml:"_this"` + ACLConfigSpecs []CnsVolumeACLConfigureSpec `xml:"ACLConfigSpecs"` +} + +func init() { + types.Add("vsan:CnsConfigureVolumeACLsRequestType", reflect.TypeOf((*CnsConfigureVolumeACLsRequestType)(nil)).Elem()) +} + +type CnsConfigureVolumeACLsResponse struct { + Returnval types.ManagedObjectReference `xml:"returnval"` +} + +type CnsVolumeACLConfigureSpec struct { + types.DynamicData + + VolumeId CnsVolumeId `xml:"volumeId"` + AccessControlSpecList []CnsNFSAccessControlSpec `xml:"accessControlSpecList,typeattr"` +} + +type CnsNFSAccessControlSpec struct { + types.DynamicData + Permission []vsanfstypes.VsanFileShareNetPermission `xml:"netPermission,omitempty,typeattr"` + Delete bool `xml:"delete,omitempty"` +} + +func init() { + types.Add("CnsNFSAccessControlSpec", reflect.TypeOf((*CnsNFSAccessControlSpec)(nil)).Elem()) +} + +type CnsQueryAsync CnsQueryAsyncRequestType + +func init() { + types.Add("CnsQueryAsync", reflect.TypeOf((*CnsQueryAsync)(nil)).Elem()) +} + +type CnsQueryAsyncRequestType struct { + This types.ManagedObjectReference `xml:"_this"` + Filter CnsQueryFilter `xml:"filter"` + Selection *CnsQuerySelection `xml:"selection,omitempty"` +} + +func init() { + types.Add("CnsQueryAsyncRequestType", reflect.TypeOf((*CnsQueryAsyncRequestType)(nil)).Elem()) +} + +type CnsQueryAsyncResponse struct { + Returnval types.ManagedObjectReference `xml:"returnval"` +} + +type CnsAsyncQueryResult struct { + CnsVolumeOperationResult + + QueryResult CnsQueryResult `xml:"queryResult,omitempty"` +} + +func init() { + types.Add("CnsAsyncQueryResult", reflect.TypeOf((*CnsAsyncQueryResult)(nil)).Elem()) +} + +// Cns Snapshot Types + +type CnsCreateSnapshotsRequestType struct { + This types.ManagedObjectReference `xml:"_this"` + SnapshotSpecs []CnsSnapshotCreateSpec `xml:"snapshotSpecs,omitempty"` +} + +func init() { + types.Add("CnsCreateSnapshotsRequestType", reflect.TypeOf((*CnsCreateSnapshotsRequestType)(nil)).Elem()) +} + +type CnsCreateSnapshots CnsCreateSnapshotsRequestType + +func init() { + types.Add("CnsCreateSnapshots", reflect.TypeOf((*CnsCreateSnapshots)(nil)).Elem()) +} + +type CnsCreateSnapshotsResponse struct { + Returnval types.ManagedObjectReference `xml:"returnval"` +} + +type CnsSnapshotCreateSpec struct { + types.DynamicData + + VolumeId CnsVolumeId `xml:"volumeId"` + Description string `xml:"description"` +} + +func init() { + types.Add("CnsSnapshotCreateSpec", reflect.TypeOf((*CnsSnapshotCreateSpec)(nil)).Elem()) +} + +type CnsDeleteSnapshotsRequestType struct { + This types.ManagedObjectReference `xml:"_this"` + SnapshotDeleteSpecs []CnsSnapshotDeleteSpec `xml:"snapshotDeleteSpecs,omitempty"` +} + +func init() { + types.Add("CnsDeleteSnapshotsRequestType", reflect.TypeOf((*CnsDeleteSnapshotsRequestType)(nil)).Elem()) +} + +type CnsDeleteSnapshots CnsDeleteSnapshotsRequestType + +func init() { + types.Add("CnsDeleteSnapshots", reflect.TypeOf((*CnsDeleteSnapshots)(nil)).Elem()) +} + +type CnsDeleteSnapshotsResponse struct { + Returnval types.ManagedObjectReference `xml:"returnval"` +} + +type CnsSnapshotId struct { + types.DynamicData + + Id string `xml:"id"` +} + +func init() { + types.Add("CnsSnapshotId", reflect.TypeOf((*CnsSnapshotId)(nil)).Elem()) +} + +type CnsSnapshotDeleteSpec struct { + types.DynamicData + + VolumeId CnsVolumeId `xml:"volumeId"` + SnapshotId CnsSnapshotId `xml:"snapshotId"` +} + +func init() { + types.Add("CnsSnapshotDeleteSpec", reflect.TypeOf((*CnsSnapshotDeleteSpec)(nil)).Elem()) +} + +type CnsSnapshot struct { + types.DynamicData + + SnapshotId CnsSnapshotId `xml:"snapshotId"` + VolumeId CnsVolumeId `xml:"volumeId"` + Description string `xml:"description,omitempty"` + CreateTime time.Time `xml:"createTime"` +} + +func init() { + types.Add("CnsSnapshot", reflect.TypeOf((*CnsSnapshot)(nil)).Elem()) +} + +type CnsSnapshotOperationResult struct { + CnsVolumeOperationResult +} + +func init() { + types.Add("CnsSnapshotOperationResult", reflect.TypeOf((*CnsSnapshotOperationResult)(nil)).Elem()) +} + +type CnsSnapshotCreateResult struct { + CnsSnapshotOperationResult + Snapshot CnsSnapshot `xml:"snapshot,omitempty"` +} + +func init() { + types.Add("CnsSnapshotCreateResult", reflect.TypeOf((*CnsSnapshotCreateResult)(nil)).Elem()) +} + +type CnsSnapshotDeleteResult struct { + CnsSnapshotOperationResult + SnapshotId CnsSnapshotId `xml:"snapshotId,omitempty"` +} + +func init() { + types.Add("CnsSnapshotDeleteResult", reflect.TypeOf((*CnsSnapshotDeleteResult)(nil)).Elem()) +} + +type CnsVolumeSource struct { + types.DynamicData +} + +func init() { + types.Add("CnsVolumeSource", reflect.TypeOf((*CnsVolumeSource)(nil)).Elem()) +} + +type CnsSnapshotVolumeSource struct { + CnsVolumeSource + + VolumeId CnsVolumeId `xml:"volumeId,omitempty"` + SnapshotId CnsSnapshotId `xml:"snapshotId,omitempty"` +} + +func init() { + types.Add("CnsSnapshotVolumeSource", reflect.TypeOf((*CnsSnapshotVolumeSource)(nil)).Elem()) +} + +// CNS QuerySnapshots related types + +type CnsQuerySnapshotsRequestType struct { + This types.ManagedObjectReference `xml:"_this"` + SnapshotQueryFilter CnsSnapshotQueryFilter `xml:"snapshotQueryFilter"` +} + +func init() { + types.Add("CnsQuerySnapshotsRequestType", reflect.TypeOf((*CnsQuerySnapshotsRequestType)(nil)).Elem()) +} + +type CnsQuerySnapshots CnsQuerySnapshotsRequestType + +func init() { + types.Add("CnsQuerySnapshots", reflect.TypeOf((*CnsQuerySnapshots)(nil)).Elem()) +} + +type CnsQuerySnapshotsResponse struct { + Returnval types.ManagedObjectReference `xml:"returnval"` +} + +type CnsSnapshotQueryResult struct { + types.DynamicData + + Entries []CnsSnapshotQueryResultEntry `xml:"entries,omitempty"` + Cursor CnsCursor `xml:"cursor"` +} + +func init() { + types.Add("CnsSnapshotQueryResult", reflect.TypeOf((*CnsSnapshotQueryResult)(nil)).Elem()) +} + +type CnsSnapshotQueryResultEntry struct { + types.DynamicData + + Snapshot CnsSnapshot `xml:"snapshot,omitempty"` + Error *types.LocalizedMethodFault `xml:"error,omitempty"` +} + +func init() { + types.Add("CnsSnapshotQueryResultEntry", reflect.TypeOf((*CnsSnapshotQueryResultEntry)(nil)).Elem()) +} + +type CnsSnapshotQueryFilter struct { + types.DynamicData + + SnapshotQuerySpecs []CnsSnapshotQuerySpec `xml:"snapshotQuerySpecs,omitempty"` + Cursor *CnsCursor `xml:"cursor,omitempty"` +} + +func init() { + types.Add("CnsSnapshotQueryFilter", reflect.TypeOf((*CnsSnapshotQueryFilter)(nil)).Elem()) +} + +type CnsSnapshotQuerySpec struct { + types.DynamicData + + VolumeId CnsVolumeId `xml:"volumeId"` + SnapshotId *CnsSnapshotId `xml:"snapshotId,omitempty"` +} + +func init() { + types.Add("CnsSnapshotQuerySpec", reflect.TypeOf((*CnsSnapshotQuerySpec)(nil)).Elem()) +} diff --git a/vendor/github.com/vmware/govmomi/find/finder.go b/vendor/github.com/vmware/govmomi/find/finder.go index a46c70bf5..cd71d183b 100644 --- a/vendor/github.com/vmware/govmomi/find/finder.go +++ b/vendor/github.com/vmware/govmomi/find/finder.go @@ -1,5 +1,5 @@ /* -Copyright (c) 2014-2017 VMware, Inc. All Rights Reserved. +Copyright (c) 2014-2020 VMware, Inc. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -22,6 +22,7 @@ import ( "path" "strings" + "github.com/vmware/govmomi/internal" "github.com/vmware/govmomi/list" "github.com/vmware/govmomi/object" "github.com/vmware/govmomi/property" @@ -67,6 +68,18 @@ func (f *Finder) SetDatacenter(dc *object.Datacenter) *Finder { return f } +// InventoryPath composes the given object's inventory path. +// There is no vSphere property or method that provides an inventory path directly. +// This method uses the ManagedEntity.Parent field to determine the ancestry tree of the object and +// the ManagedEntity.Name field for each ancestor to compose the path. +func InventoryPath(ctx context.Context, client *vim25.Client, obj types.ManagedObjectReference) (string, error) { + entities, err := mo.Ancestors(ctx, client, client.ServiceContent.PropertyCollector, obj) + if err != nil { + return "", err + } + return internal.InventoryPath(entities), nil +} + // findRoot makes it possible to use "find" mode with a different root path. // Example: ResourcePoolList("/dc1/host/cluster1/...") func (f *Finder) findRoot(ctx context.Context, root *list.Element, parts []string) bool { @@ -103,8 +116,8 @@ func (f *Finder) find(ctx context.Context, arg string, s *spec) ([]list.Element, isPath := strings.Contains(arg, "/") root := list.Element{ - Path: "/", Object: object.NewRootFolder(f.client), + Path: "/", } parts := list.ToParts(arg) @@ -119,19 +132,10 @@ func (f *Finder) find(ctx context.Context, arg string, s *spec) ([]list.Element, return nil, err } - mes, err := mo.Ancestors(ctx, f.client, f.client.ServiceContent.PropertyCollector, pivot.Reference()) + root.Path, err = InventoryPath(ctx, f.client, 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:] } @@ -281,8 +285,7 @@ func (f *Finder) managedObjectList(ctx context.Context, path string, tl bool, in return f.find(ctx, path, s) } -// Element returns an Element for the given ManagedObjectReference -// This method is only useful for looking up the InventoryPath of a ManagedObjectReference. +// Element is deprecated, use InventoryPath() instead. func (f *Finder) Element(ctx context.Context, ref types.ManagedObjectReference) (*list.Element, error) { rl := func(_ context.Context) (object.Reference, error) { return ref, nil @@ -311,7 +314,7 @@ func (f *Finder) Element(ctx context.Context, ref types.ManagedObjectReference) // 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) + path, err := InventoryPath(ctx, f.client, ref) if err != nil { return nil, err } @@ -322,7 +325,7 @@ func (f *Finder) ObjectReference(ctx context.Context, ref types.ManagedObjectRef SetInventoryPath(string) } - r.(common).SetInventoryPath(e.Path) + r.(common).SetInventoryPath(path) if f.dc != nil { if ds, ok := r.(*object.Datastore); ok { diff --git a/vendor/github.com/vmware/govmomi/govc/flags/client.go b/vendor/github.com/vmware/govmomi/govc/flags/client.go index fe8b451c4..d410e6d19 100644 --- a/vendor/github.com/vmware/govmomi/govc/flags/client.go +++ b/vendor/github.com/vmware/govmomi/govc/flags/client.go @@ -30,6 +30,8 @@ import ( "syscall" "time" + "github.com/vmware/govmomi/cns" + "github.com/vmware/govmomi/pbm" "github.com/vmware/govmomi/session" "github.com/vmware/govmomi/session/cache" "github.com/vmware/govmomi/session/keepalive" @@ -275,7 +277,7 @@ func (flag *ClientFlag) ConfigureTLS(sc *soap.Client) error { sc.Namespace = "urn:" + flag.vimNamespace sc.Version = flag.vimVersion - sc.UserAgent = fmt.Sprintf("govc/%s", Version) + sc.UserAgent = fmt.Sprintf("govc/%s", strings.TrimPrefix(BuildVersion, "v")) if err := flag.SetRootCAs(sc); err != nil { return err @@ -345,6 +347,21 @@ func apiVersionValid(c *vim25.Client, minVersionString string) error { return nil } +func (flag *ClientFlag) RoundTripper(c *soap.Client) soap.RoundTripper { + // Retry twice when a temporary I/O error occurs. + // This means a maximum of 3 attempts. + rt := vim25.Retry(c, vim25.RetryTemporaryNetworkError, 3) + + switch { + case flag.dump: + rt = &dump{roundTripper: rt} + case flag.verbose: + rt = &verbose{roundTripper: rt} + } + + return rt +} + func (flag *ClientFlag) Client() (*vim25.Client, error) { if flag.client != nil { return flag.client, nil @@ -369,9 +386,7 @@ func (flag *ClientFlag) Client() (*vim25.Client, error) { } } - // Retry twice when a temporary I/O error occurs. - // This means a maximum of 3 attempts. - c.RoundTripper = vim25.Retry(c.Client, vim25.TemporaryNetworkError(3)) + c.RoundTripper = flag.RoundTripper(c.Client) flag.client = c return flag.client, nil @@ -393,6 +408,38 @@ func (flag *ClientFlag) RestClient() (*rest.Client, error) { return flag.restClient, nil } +func (flag *ClientFlag) PbmClient() (*pbm.Client, error) { + vc, err := flag.Client() + if err != nil { + return nil, err + } + c, err := pbm.NewClient(context.Background(), vc) + if err != nil { + return nil, err + } + + c.RoundTripper = flag.RoundTripper(c.Client) + + return c, nil +} + +func (flag *ClientFlag) CnsClient() (*cns.Client, error) { + vc, err := flag.Client() + if err != nil { + return nil, err + } + _ = vc.UseServiceVersion("vsan") + + c, err := cns.NewClient(context.Background(), vc) + if err != nil { + return nil, err + } + + c.RoundTripper = flag.RoundTripper(c.Client) + + return c, nil +} + func (flag *ClientFlag) KeepAlive(client cache.Client) { switch c := client.(type) { case *vim25.Client: diff --git a/vendor/github.com/vmware/govmomi/govc/flags/datastore.go b/vendor/github.com/vmware/govmomi/govc/flags/datastore.go index bbe7e8c7d..8030a6e00 100644 --- a/vendor/github.com/vmware/govmomi/govc/flags/datastore.go +++ b/vendor/github.com/vmware/govmomi/govc/flags/datastore.go @@ -76,6 +76,10 @@ func (f *DatastoreFlag) Process(ctx context.Context) error { }) } +func (flag *DatastoreFlag) IsSet() bool { + return flag.Name != "" +} + func (f *DatastoreFlag) Args(args []string) []object.DatastorePath { var files []object.DatastorePath diff --git a/vendor/github.com/vmware/govmomi/govc/flags/debug.go b/vendor/github.com/vmware/govmomi/govc/flags/debug.go index 36d8f80bc..809ec1182 100644 --- a/vendor/github.com/vmware/govmomi/govc/flags/debug.go +++ b/vendor/github.com/vmware/govmomi/govc/flags/debug.go @@ -17,21 +17,54 @@ limitations under the License. package flags import ( + "bufio" "context" "flag" "fmt" + "io" "os" + "os/exec" "path/filepath" + "reflect" "strings" + "sync" + "text/tabwriter" "time" + "github.com/kr/pretty" + "github.com/vmware/govmomi/vim25/debug" + "github.com/vmware/govmomi/vim25/soap" + "github.com/vmware/govmomi/vim25/types" ) +type cmdFormat struct { + path string + err error + args []string +} + +func (c *cmdFormat) lookPath(file string, args ...string) { + c.args = args + c.path, c.err = exec.LookPath(file) +} + +func (c *cmdFormat) cmd() (*exec.Cmd, error) { + if c.err != nil { + return nil, c.err + } + return exec.Command(c.path, c.args...), nil +} + type DebugFlag struct { common - enable bool + enable bool + trace bool + verbose bool + dump bool + xml cmdFormat + json cmdFormat } var debugFlagKey = flagKey("debug") @@ -46,6 +79,10 @@ func NewDebugFlag(ctx context.Context) (*DebugFlag, context.Context) { return v, ctx } +func (flag *DebugFlag) Verbose() bool { + return flag.verbose +} + func (flag *DebugFlag) Register(ctx context.Context, f *flag.FlagSet) { flag.RegisterOnce(func() { env := "GOVC_DEBUG" @@ -57,17 +94,115 @@ func (flag *DebugFlag) Register(ctx context.Context, f *flag.FlagSet) { usage := fmt.Sprintf("Store debug logs [%s]", env) f.BoolVar(&flag.enable, "debug", enable, usage) + f.BoolVar(&flag.trace, "trace", false, "Write SOAP/REST traffic to stderr") + f.BoolVar(&flag.verbose, "verbose", false, "Write request/response data to stderr") }) } +type cmdFormatCloser struct { + rc io.Closer + in io.Closer + cmd *exec.Cmd + wg *sync.WaitGroup +} + +func (c *cmdFormatCloser) Close() error { + _ = c.rc.Close() + _ = c.in.Close() + c.wg.Wait() + return c.cmd.Wait() +} + +func (flag *DebugFlag) newFormatReader(rc io.ReadCloser, w io.Writer, ext string) (io.ReadCloser, error) { + var err error + var cmd *exec.Cmd + + switch ext { + case "json": + cmd, err = flag.json.cmd() + if err != nil { + return nil, err + } + case "xml": + cmd, err = flag.xml.cmd() + if err != nil { + return nil, err + } + default: + return nil, fmt.Errorf("unsupported type %s", ext) + } + + cmd.Stderr = os.Stderr + + stdin, err := cmd.StdinPipe() + if err != nil { + return nil, err + } + + stdout, err := cmd.StdoutPipe() + if err != nil { + return nil, err + } + + err = cmd.Start() + if err != nil { + return nil, err + } + + var wg sync.WaitGroup + wg.Add(1) + go func() { + _, _ = io.Copy(w, stdout) + wg.Done() + }() + + return debug.ReadCloser{ + Reader: io.TeeReader(rc, stdin), + Closer: &cmdFormatCloser{rc, stdin, cmd, &wg}, + }, nil +} + +func (flag *DebugFlag) debugTrace(rc io.ReadCloser, w io.Writer, ext string) io.ReadCloser { + fr, err := flag.newFormatReader(rc, w, ext) + if err != nil { + return debug.NewTeeReader(rc, w) + } + return fr +} + func (flag *DebugFlag) Process(ctx context.Context) error { + // Base path for storing debug logs. + r := os.Getenv("GOVC_DEBUG_PATH") + + if flag.trace { + if flag.verbose { + flag.dump = true // output req/res as Go code + return nil + } + r = "-" + flag.enable = true + if os.Getenv("GOVC_DEBUG_FORMAT") != "false" { + debugXML := os.Getenv("GOVC_DEBUG_XML") + if debugXML == "" { + debugXML = "xmlstarlet" + } + flag.xml.lookPath(debugXML, "fo") + + debugJSON := os.Getenv("GOVC_DEBUG_JSON") + if debugJSON == "" { + debugJSON = "jq" + } + flag.json.lookPath(debugJSON, ".") + + soap.Trace = flag.debugTrace + } + } + if !flag.enable { return nil } return flag.ProcessOnce(func() error { - // Base path for storing debug logs. - r := os.Getenv("GOVC_DEBUG_PATH") switch r { case "-": debug.SetProvider(&debug.LogProvider{}) @@ -101,3 +236,236 @@ func (flag *DebugFlag) Process(ctx context.Context) error { return nil }) } + +type dump struct { + roundTripper soap.RoundTripper +} + +func (d *dump) RoundTrip(ctx context.Context, req, res soap.HasFault) error { + vreq := reflect.ValueOf(req).Elem().FieldByName("Req").Elem() + + pretty.Fprintf(os.Stderr, "%# v\n", vreq.Interface()) + + err := d.roundTripper.RoundTrip(ctx, req, res) + if err != nil { + if fault := res.Fault(); fault != nil { + pretty.Fprintf(os.Stderr, "%# v\n", fault) + } + return err + } + + vres := reflect.ValueOf(res).Elem().FieldByName("Res").Elem() + pretty.Fprintf(os.Stderr, "%# v\n", vres.Interface()) + + return nil +} + +type verbose struct { + roundTripper soap.RoundTripper +} + +func (*verbose) mor(ref types.ManagedObjectReference) string { + if strings.HasPrefix(ref.Value, "session") { + ref.Value = "session[...]" + return ref.String() + } + return ref.Value +} + +func (*verbose) str(val reflect.Value) string { + if !val.IsValid() { + return "" + } + + switch val.Kind() { + case reflect.Ptr, reflect.Interface: + if val.IsNil() { + return "nil" + } + } + + p := "" + + switch pval := val.Interface().(type) { + case fmt.Stringer: + p = pval.String() + case string: + if len(pval) > 45 { + pval = pval[:42] + "..." + } + p = fmt.Sprintf("%s", pval) + case []string: + p = fmt.Sprintf("%v", pval) + case []types.ManagedObjectReference: + refs := make([]string, len(pval)) + for i := range pval { + refs[i] = pval[i].Value + } + p = fmt.Sprintf("%v", refs) + default: + return "" + } + + return p +} + +func (v *verbose) value(val types.AnyType) string { + rval := reflect.ValueOf(val) + if rval.Kind() == reflect.Ptr && !rval.IsNil() { + rval = rval.Elem() + } + if rval.Kind() == reflect.Struct { + if strings.HasPrefix(rval.Type().Name(), "ArrayOf") { + rval = rval.Field(0) + val = rval.Interface() + } + } + s := v.str(rval) + if s != "" { + return s + } + return v.prettyPrint(val) +} + +func (v *verbose) propertyValue(obj types.ManagedObjectReference, name string, pval types.AnyType) string { + val := v.value(pval) + if obj.Type != "Task" && !strings.HasPrefix(obj.Value, "session") { + if len(val) > 512 { + val = fmt.Sprintf("`govc object.collect -dump %s %s`", obj, name) + } + } + return fmt.Sprintf("%s\t%s:\t%s", v.mor(obj), name, val) +} + +func (v *verbose) missingSet(o types.ManagedObjectReference, m []types.MissingProperty) []string { + var s []string + for _, p := range m { + s = append(s, fmt.Sprintf("%s\t%s:\t%s", v.mor(o), p.Path, v.prettyPrint(p.Fault.Fault))) + } + return s +} + +func (v *verbose) updateSet(u *types.UpdateSet) []string { + var s []string + for _, f := range u.FilterSet { + for _, o := range f.ObjectSet { + for _, c := range o.ChangeSet { + s = append(s, v.propertyValue(o.Obj, c.Name, c.Val)) + } + s = append(s, v.missingSet(o.Obj, o.MissingSet)...) + } + } + return s +} + +func (v *verbose) objectContent(content []types.ObjectContent) []string { + var s []string + for _, o := range content { + for _, p := range o.PropSet { + s = append(s, v.propertyValue(o.Obj, p.Name, p.Val)) + } + s = append(s, v.missingSet(o.Obj, o.MissingSet)...) + } + return s +} + +func (v *verbose) prettyPrint(val interface{}) string { + p := pretty.Sprintf("%# v\n", val) + var res []string + scanner := bufio.NewScanner(strings.NewReader(p)) + for scanner.Scan() { + line := scanner.Text() + if strings.Contains(line, "nil,") || strings.Contains(line, "(nil),") { + continue // nil pointer field + } + if strings.Contains(line, `"",`) { + continue // empty string field + } + if strings.Contains(line, `{},`) { + continue // empty embedded struct + } + if strings.Contains(line, "[context]") { + continue // noisy base64 encoded backtrace + } + res = append(res, line) + } + return strings.Join(res, "\n") +} + +func (v *verbose) table(vals []string) { + tw := tabwriter.NewWriter(os.Stderr, 2, 0, 1, ' ', 0) + for _, val := range vals { + fmt.Fprintf(tw, "...%s\n", val) + } + tw.Flush() +} + +func (v *verbose) RoundTrip(ctx context.Context, req, res soap.HasFault) error { + vreq := reflect.ValueOf(req).Elem().FieldByName("Req").Elem() + param := []string{""} + switch f := vreq.Field(0).Interface().(type) { + case types.ManagedObjectReference: + param[0] = v.mor(f) + default: + param[0] = fmt.Sprintf("%v", f) + } + + for i := 1; i < vreq.NumField(); i++ { + val := vreq.Field(i) + + if val.Kind() == reflect.Interface { + val = val.Elem() + } + + p := v.str(val) + if p == "" { + switch val.Kind() { + case reflect.Ptr, reflect.Slice, reflect.Struct: + p = val.Type().String() + default: + p = fmt.Sprintf("%v", val.Interface()) + } + } + + param = append(param, p) + } + + fmt.Fprintf(os.Stderr, "%s(%s)...\n", vreq.Type().Name(), strings.Join(param, ", ")) + + err := v.roundTripper.RoundTrip(ctx, req, res) + if err != nil { + if fault := res.Fault(); fault != nil { + fmt.Fprintln(os.Stderr, v.prettyPrint(fault)) + } else { + fmt.Fprintf(os.Stderr, "...%s\n", err) + } + return err + } + + vres := reflect.ValueOf(res).Elem().FieldByName("Res").Elem() + ret := vres.FieldByName("Returnval") + var s interface{} = "void" + + if ret.IsValid() { + switch x := ret.Interface().(type) { + case types.ManagedObjectReference: + s = v.mor(x) + case *types.UpdateSet: + s = v.updateSet(x) + case []types.ObjectContent: + s = v.objectContent(x) + case fmt.Stringer: + s = x.String() + default: + s = v.value(x) + } + } + if vals, ok := s.([]string); ok { + v.table(vals) + } else { + fmt.Fprintf(os.Stderr, "...%s\n", s) + } + fmt.Fprintln(os.Stderr) + + return err +} diff --git a/vendor/github.com/vmware/govmomi/govc/flags/folder.go b/vendor/github.com/vmware/govmomi/govc/flags/folder.go index a84266a8e..da17bfa72 100644 --- a/vendor/github.com/vmware/govmomi/govc/flags/folder.go +++ b/vendor/github.com/vmware/govmomi/govc/flags/folder.go @@ -67,6 +67,10 @@ func (flag *FolderFlag) Process(ctx context.Context) error { }) } +func (flag *FolderFlag) IsSet() bool { + return flag.name != "" +} + func (flag *FolderFlag) Folder() (*object.Folder, error) { if flag.folder != nil { return flag.folder, nil diff --git a/vendor/github.com/vmware/govmomi/govc/flags/host_system.go b/vendor/github.com/vmware/govmomi/govc/flags/host_system.go index 56dba96c5..f8704def1 100644 --- a/vendor/github.com/vmware/govmomi/govc/flags/host_system.go +++ b/vendor/github.com/vmware/govmomi/govc/flags/host_system.go @@ -86,7 +86,7 @@ func (flag *HostSystemFlag) HostSystemIfSpecified() (*object.HostSystem, error) } // Use search flags if specified. - if flag.SearchFlag.IsSet() { + if flag.SearchFlag.IsSet() && flag.SearchFlag.t == SearchHosts { host, err := flag.SearchFlag.HostSystem() if err != nil { return nil, err diff --git a/vendor/github.com/vmware/govmomi/govc/flags/network.go b/vendor/github.com/vmware/govmomi/govc/flags/network.go index 842fd3184..8e4ec1e90 100644 --- a/vendor/github.com/vmware/govmomi/govc/flags/network.go +++ b/vendor/github.com/vmware/govmomi/govc/flags/network.go @@ -121,7 +121,11 @@ func (flag *NetworkFlag) Device() (types.BaseVirtualDevice, error) { return nil, err } - if flag.address != "" { + if flag.address == "-" { + card := device.(types.BaseVirtualEthernetCard).GetVirtualEthernetCard() + card.AddressType = string(types.VirtualEthernetCardMacTypeGenerated) + card.MacAddress = "" + } else if flag.address != "" { card := device.(types.BaseVirtualEthernetCard).GetVirtualEthernetCard() card.AddressType = string(types.VirtualEthernetCardMacTypeManual) card.MacAddress = flag.address diff --git a/vendor/github.com/vmware/govmomi/govc/flags/output.go b/vendor/github.com/vmware/govmomi/govc/flags/output.go index 33feb5005..aaa3d1bbc 100644 --- a/vendor/github.com/vmware/govmomi/govc/flags/output.go +++ b/vendor/github.com/vmware/govmomi/govc/flags/output.go @@ -25,13 +25,16 @@ import ( "io" "os" "reflect" + "strings" "sync" "time" "github.com/kr/pretty" + "github.com/vmware/govmomi/task" "github.com/vmware/govmomi/vim25/progress" "github.com/vmware/govmomi/vim25/soap" + "github.com/vmware/govmomi/vim25/types" "github.com/vmware/govmomi/vim25/xml" ) @@ -195,8 +198,40 @@ type errorOutput struct { } func (e errorOutput) Write(w io.Writer) error { - _, ferr := fmt.Fprintf(w, "%s: %s\n", os.Args[0], e.error) - return ferr + reason := e.error.Error() + var messages []string + var faults []types.LocalizableMessage + + switch err := e.error.(type) { + case task.Error: + faults = err.LocalizedMethodFault.Fault.GetMethodFault().FaultMessage + if err.Description != nil { + reason = fmt.Sprintf("%s (%s)", reason, err.Description.Message) + } + default: + if soap.IsSoapFault(err) { + detail := soap.ToSoapFault(err).Detail.Fault + if f, ok := detail.(types.BaseMethodFault); ok { + faults = f.GetMethodFault().FaultMessage + } + } + } + + for _, m := range faults { + if m.Message != "" && !strings.HasPrefix(m.Message, "[context]") { + messages = append(messages, fmt.Sprintf("%s (%s)", m.Message, m.Key)) + } + } + + messages = append(messages, reason) + + for _, message := range messages { + if _, err := fmt.Fprintf(w, "%s: %s\n", os.Args[0], message); err != nil { + return err + } + } + + return nil } func (e errorOutput) Dump() interface{} { diff --git a/vendor/github.com/vmware/govmomi/govc/flags/resource_pool.go b/vendor/github.com/vmware/govmomi/govc/flags/resource_pool.go index e60b5ee3f..b3d87b719 100644 --- a/vendor/github.com/vmware/govmomi/govc/flags/resource_pool.go +++ b/vendor/github.com/vmware/govmomi/govc/flags/resource_pool.go @@ -68,6 +68,10 @@ func (flag *ResourcePoolFlag) Process(ctx context.Context) error { }) } +func (flag *ResourcePoolFlag) IsSet() bool { + return flag.name != "" +} + func (flag *ResourcePoolFlag) ResourcePool() (*object.ResourcePool, error) { if flag.pool != nil { return flag.pool, nil diff --git a/vendor/github.com/vmware/govmomi/govc/flags/version.go b/vendor/github.com/vmware/govmomi/govc/flags/version.go index e0180d990..72d0772b0 100644 --- a/vendor/github.com/vmware/govmomi/govc/flags/version.go +++ b/vendor/github.com/vmware/govmomi/govc/flags/version.go @@ -21,14 +21,19 @@ import ( "strings" ) -const Version = "0.23.0" - -var GitVersion string +var ( + BuildVersion = "v0.0.0" // govc-test requires an (arbitrary) version set + BuildCommit string + BuildDate string +) type version []int func ParseVersion(s string) (version, error) { + // remove any trailing "v" version identifier + s = strings.TrimPrefix(s, "v") v := make(version, 0) + ds := strings.Split(s, "-") ps := strings.Split(ds[0], ".") for _, p := range ps { diff --git a/vendor/github.com/vmware/govmomi/govc/host/esxcli/command.go b/vendor/github.com/vmware/govmomi/govc/host/esxcli/command.go index 671a23b0f..033d144c1 100644 --- a/vendor/github.com/vmware/govmomi/govc/host/esxcli/command.go +++ b/vendor/github.com/vmware/govmomi/govc/host/esxcli/command.go @@ -21,6 +21,7 @@ import ( "fmt" "strings" + "github.com/vmware/govmomi/govc/flags" "github.com/vmware/govmomi/internal" ) @@ -93,18 +94,18 @@ func (c *Command) Moid() string { // Parse generates a flag.FlagSet based on the given []CommandInfoParam and // returns arguments for use with methods.ExecuteSoap func (c *Command) Parse(params []CommandInfoParam) ([]internal.ReflectManagedMethodExecuterSoapArgument, error) { - flags := flag.NewFlagSet(strings.Join(c.name, " "), flag.ExitOnError) - vals := make([]string, len(params)) + fs := flag.NewFlagSet(strings.Join(c.name, " "), flag.ExitOnError) + vals := make([]flags.StringList, 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) + fs.Var(v, a, p.Help) } } - err := flags.Parse(c.args) + err := fs.Parse(c.args) if err != nil { return nil, err } @@ -112,19 +113,22 @@ func (c *Command) Parse(params []CommandInfoParam) ([]internal.ReflectManagedMet args := []internal.ReflectManagedMethodExecuterSoapArgument{} for i, p := range params { - if vals[i] == "" { - continue + if len(vals[i]) != 0 { + args = append(args, c.Argument(p.Name, vals[i]...)) } - args = append(args, c.Argument(p.Name, vals[i])) } return args, nil } -func (c *Command) Argument(name string, val string) internal.ReflectManagedMethodExecuterSoapArgument { +func (c *Command) Argument(name string, args ...string) internal.ReflectManagedMethodExecuterSoapArgument { + var vars []string + for _, arg := range args { + vars = append(vars, fmt.Sprintf("<%s>%s", name, arg, name)) + } return internal.ReflectManagedMethodExecuterSoapArgument{ Name: name, - Val: fmt.Sprintf("<%s>%s", name, val, name), + Val: strings.Join(vars, ""), } } diff --git a/vendor/github.com/vmware/govmomi/govc/importx/ovf.go b/vendor/github.com/vmware/govmomi/govc/importx/ovf.go index 9672389f6..bdb18ba9c 100644 --- a/vendor/github.com/vmware/govmomi/govc/importx/ovf.go +++ b/vendor/github.com/vmware/govmomi/govc/importx/ovf.go @@ -164,6 +164,21 @@ func (cmd *ovfx) Map(op []Property) (p []types.KeyValue) { return } +func (cmd *ovfx) validateNetwork(e *ovf.Envelope, net Network) { + var names []string + + if e.Network != nil { + for _, n := range e.Network.Networks { + if n.Name == net.Name { + return + } + names = append(names, n.Name) + } + } + + _, _ = cmd.Log(fmt.Sprintf("Warning: invalid NetworkMapping.Name=%q, valid names=%s\n", net.Name, names)) +} + func (cmd *ovfx) NetworkMap(e *ovf.Envelope) ([]types.OvfNetworkMapping, error) { ctx := context.TODO() finder, err := cmd.DatastoreFlag.Finder() @@ -176,6 +191,7 @@ func (cmd *ovfx) NetworkMap(e *ovf.Envelope) ([]types.OvfNetworkMapping, error) if m.Network == "" { continue // Not set, let vSphere choose the default network } + cmd.validateNetwork(e, m) var ref types.ManagedObjectReference diff --git a/vendor/github.com/vmware/govmomi/govc/importx/spec.go b/vendor/github.com/vmware/govmomi/govc/importx/spec.go index 0b174251b..514f338c9 100644 --- a/vendor/github.com/vmware/govmomi/govc/importx/spec.go +++ b/vendor/github.com/vmware/govmomi/govc/importx/spec.go @@ -59,8 +59,6 @@ type spec struct { *ArchiveFlag *flags.ClientFlag *flags.OutputFlag - - verbose bool } func init() { @@ -75,8 +73,6 @@ func (cmd *spec) Register(ctx context.Context, f *flag.FlagSet) { cmd.OutputFlag, ctx = flags.NewOutputFlag(ctx) cmd.OutputFlag.Register(ctx, f) - - f.BoolVar(&cmd.verbose, "verbose", false, "Verbose spec output") } func (cmd *spec) Process(ctx context.Context) error { @@ -176,7 +172,7 @@ func (cmd *spec) Map(e *ovf.Envelope) (res []Property) { } np := Property{KeyValue: types.KeyValue{Key: k, Value: d}} - if cmd.verbose { + if cmd.Verbose() { np.Spec = &p.Property[i] } @@ -243,7 +239,7 @@ func (cmd *spec) Spec(fpath string) (*Options, error) { } } - if cmd.verbose { + if cmd.Verbose() { if deploymentOptions != nil { o.AllDeploymentOptions = deploymentOptions } diff --git a/vendor/github.com/vmware/govmomi/govc/vm/clone.go b/vendor/github.com/vmware/govmomi/govc/vm/clone.go index 6f013f3f6..b8217e79c 100644 --- a/vendor/github.com/vmware/govmomi/govc/vm/clone.go +++ b/vendor/github.com/vmware/govmomi/govc/vm/clone.go @@ -440,7 +440,7 @@ func (cmd *clone) cloneVM(ctx context.Context) (*object.VirtualMachine, error) { _, err := datastore.Stat(ctx, vmxPath) if err == nil { - dsPath := cmd.Datastore.Path(vmxPath) + dsPath := datastore.Path(vmxPath) return nil, fmt.Errorf("file %s already exists", dsPath) } } diff --git a/vendor/github.com/vmware/govmomi/govc/vm/console.go b/vendor/github.com/vmware/govmomi/govc/vm/console.go index 2af60d99c..30fc05a82 100644 --- a/vendor/github.com/vmware/govmomi/govc/vm/console.go +++ b/vendor/github.com/vmware/govmomi/govc/vm/console.go @@ -36,6 +36,7 @@ type console struct { *flags.VirtualMachineFlag h5 bool + wss bool capture string } @@ -48,6 +49,7 @@ func (cmd *console) Register(ctx context.Context, f *flag.FlagSet) { cmd.VirtualMachineFlag.Register(ctx, f) f.BoolVar(&cmd.h5, "h5", false, "Generate HTML5 UI console link") + f.BoolVar(&cmd.wss, "wss", false, "Generate WebSocket console link") f.StringVar(&cmd.capture, "capture", "", "Capture console screen shot to file") } @@ -127,6 +129,17 @@ func (cmd *console) Run(ctx context.Context, f *flag.FlagSet) error { return c.DownloadFile(ctx, cmd.capture, u, ¶m) } + if cmd.wss { + ticket, err := vm.AcquireTicket(ctx, string(types.VirtualMachineTicketTypeWebmks)) + if err != nil { + return err + } + + link := fmt.Sprintf("wss://%s:%d/ticket/%s", ticket.Host, ticket.Port, ticket.Ticket) + fmt.Fprintln(cmd.Out, link) + return nil + } + m := session.NewManager(c) ticket, err := m.AcquireCloneTicket(ctx) if err != nil { @@ -167,7 +180,7 @@ func (cmd *console) Run(ctx context.Context, f *flag.FlagSet) error { link = fmt.Sprintf("vmrc://clone:%s@%s/?moid=%s", ticket, u.Hostname(), vm.Reference().Value) } - fmt.Fprintln(os.Stdout, link) + fmt.Fprintln(cmd.Out, link) return nil } diff --git a/vendor/github.com/vmware/govmomi/govc/vm/create.go b/vendor/github.com/vmware/govmomi/govc/vm/create.go index 6681c9651..d6c0fc524 100644 --- a/vendor/github.com/vmware/govmomi/govc/vm/create.go +++ b/vendor/github.com/vmware/govmomi/govc/vm/create.go @@ -43,6 +43,14 @@ var hardwareVersions = []struct { {"7.0", "vmx-17"}, } +var ( + FirmwareTypes = []string{ + string(types.GuestOsDescriptorFirmwareTypeBios), + string(types.GuestOsDescriptorFirmwareTypeEfi), + } + FirmwareUsage = fmt.Sprintf("Firmware type [%s]", strings.Join(FirmwareTypes, "|")) +) + type create struct { *flags.ClientFlag *flags.ClusterFlag @@ -129,13 +137,7 @@ func (cmd *create) Register(ctx context.Context, f *flag.FlagSet) { f.StringVar(&cmd.controller, "disk.controller", "scsi", "Disk controller type") f.StringVar(&cmd.annotation, "annotation", "", "VM description") - firmwareTypes := []string{ - string(types.GuestOsDescriptorFirmwareTypeBios), - string(types.GuestOsDescriptorFirmwareTypeEfi), - } - - f.StringVar(&cmd.firmware, "firmware", firmwareTypes[0], - fmt.Sprintf("Firmware type [%s]", strings.Join(firmwareTypes, "|"))) + f.StringVar(&cmd.firmware, "firmware", FirmwareTypes[0], FirmwareUsage) var versions []string for i := range hardwareVersions { versions = append(versions, hardwareVersions[i].esx) diff --git a/vendor/github.com/vmware/govmomi/govc/vm/customize.go b/vendor/github.com/vmware/govmomi/govc/vm/customize.go index b6d918e66..356ab6f2a 100644 --- a/vendor/github.com/vmware/govmomi/govc/vm/customize.go +++ b/vendor/github.com/vmware/govmomi/govc/vm/customize.go @@ -39,9 +39,11 @@ type customize struct { host types.CustomizationFixedName mac flags.StringList ip flags.StringList + ip6 flags.StringList gateway flags.StringList netmask flags.StringList dnsserver flags.StringList + dnssuffix flags.StringList kind string } @@ -60,14 +62,18 @@ func (cmd *customize) Register(ctx context.Context, f *flag.FlagSet) { f.StringVar(&cmd.host.Name, "name", "", "Host name") f.Var(&cmd.mac, "mac", "MAC address") cmd.mac = nil - f.Var(&cmd.ip, "ip", "IP address") + f.Var(&cmd.ip, "ip", "IPv4 address") cmd.ip = nil + f.Var(&cmd.ip6, "ip6", "IPv6 addresses with optional netmask (defaults to /64), separated by comma") + cmd.ip6 = nil f.Var(&cmd.gateway, "gateway", "Gateway") cmd.gateway = nil f.Var(&cmd.netmask, "netmask", "Netmask") cmd.netmask = nil - f.Var(&cmd.dnsserver, "dns-server", "DNS server") + f.Var(&cmd.dnsserver, "dns-server", "DNS server list") cmd.dnsserver = nil + f.Var(&cmd.dnssuffix, "dns-suffix", "DNS suffix list") + cmd.dnssuffix = nil f.StringVar(&cmd.kind, "type", "Linux", "Customization type if spec NAME is not specified (Linux|Windows)") } @@ -83,6 +89,8 @@ Optionally specify a customization spec NAME. The '-ip', '-netmask' and '-gateway' flags are for static IP configuration. If the VM has multiple NICs, an '-ip' and '-netmask' must be specified for each. +The '-dns-server' and '-dns-suffix' flags can be specified multiple times. + Windows -tz value requires the Index (hex): https://support.microsoft.com/en-us/help/973627/microsoft-time-zone-index-values Examples: @@ -93,11 +101,58 @@ Examples: govc vm.customize -vm VM -ip 10.0.0.178 -netmask 255.255.255.0 -ip 10.0.0.162 -netmask 255.255.255.0 # Multiple -ip with -mac are applied by vCenter to the NIC with the given MAC address govc vm.customize -vm VM -mac 00:50:56:be:dd:f8 -ip 10.0.0.178 -netmask 255.255.255.0 -mac 00:50:56:be:60:cf -ip 10.0.0.162 -netmask 255.255.255.0 + # Dual stack IPv4/IPv6, single NIC + govc vm.customize -vm VM -ip 10.0.0.1 -netmask 255.255.255.0 -ip6 '2001:db8::1/64' -name my-hostname NAME + # DHCPv6, single NIC + govc vm.customize -vm VM -ip6 dhcp6 NAME + # Static IPv6, three NICs, last one with two addresses + govc vm.customize -vm VM -ip6 2001:db8::1/64 -ip6 2001:db8::2/64 -ip6 2001:db8::3/64,2001:db8::4/64 NAME govc vm.customize -vm VM -auto-login 3 NAME govc vm.customize -vm VM -prefix demo NAME govc vm.customize -vm VM -tz America/New_York NAME` } +// Parse a string of multiple IPv6 addresses with optional netmask; separated by comma +func parseIPv6Argument(argv string) (ipconf []types.BaseCustomizationIpV6Generator, err error) { + for _, substring := range strings.Split(argv, ",") { + // remove leading and trailing white space + substring = strings.TrimSpace(substring) + // handle "dhcp6" and lists of static IPv6 addresses + switch substring { + case "dhcp6": + ipconf = append( + ipconf, + &types.CustomizationDhcpIpV6Generator{}, + ) + default: + // check if subnet mask was specified + switch strings.Count(substring, "/") { + // no mask, set default + case 0: + ipconf = append(ipconf, &types.CustomizationFixedIpV6{ + IpAddress: substring, + SubnetMask: 64, + }) + // a single forward slash was found: parse and use subnet mask + case 1: + parts := strings.Split(substring, "/") + mask, err := strconv.Atoi(parts[1]) + if err != nil { + return nil, fmt.Errorf("unable to convert subnet mask to int: %w", err) + } + ipconf = append(ipconf, &types.CustomizationFixedIpV6{ + IpAddress: parts[0], + SubnetMask: int32(mask), + }) + // too many forward slashes; return error + default: + return nil, fmt.Errorf("unable to parse IPv6 address (too many subnet separators): %s", substring) + } + } + } + return ipconf, nil +} + func (cmd *customize) Run(ctx context.Context, f *flag.FlagSet) error { vm, err := cmd.VirtualMachineFlag.VirtualMachine() if err != nil { @@ -173,6 +228,8 @@ func (cmd *customize) Run(ctx context.Context, f *flag.FlagSet) error { } } + spec.GlobalIPSettings.DnsSuffixList = cmd.dnssuffix + if cmd.prefix.Base != "" { if isWindows { sysprep.UserData.ComputerName = &cmd.prefix @@ -234,6 +291,23 @@ func (cmd *customize) Run(ctx context.Context, f *flag.FlagSet) error { } } + for i, ip6 := range cmd.ip6 { + ipconfig, err := parseIPv6Argument(ip6) + if err != nil { + return err + } + // use the same logic as the ip switch: the first occurrence of the ip6 switch is assigned to the first nic, + // the second to the second nic and so forth. + if spec.NicSettingMap == nil || len(spec.NicSettingMap) < i { + return fmt.Errorf("unable to find a network adapter for IPv6 settings %d (%s)", i, ip6) + } + nic := &spec.NicSettingMap[i] + if nic.Adapter.IpV6Spec == nil { + nic.Adapter.IpV6Spec = new(types.CustomizationIPSettingsIpV6AddressSpec) + } + nic.Adapter.IpV6Spec.Ip = append(nic.Adapter.IpV6Spec.Ip, ipconfig...) + } + task, err := vm.Customize(ctx, *spec) if err != nil { return err diff --git a/vendor/github.com/vmware/govmomi/govc/vm/guest/download.go b/vendor/github.com/vmware/govmomi/govc/vm/guest/download.go index 5aa031a92..c30b4c14b 100644 --- a/vendor/github.com/vmware/govmomi/govc/vm/guest/download.go +++ b/vendor/github.com/vmware/govmomi/govc/vm/guest/download.go @@ -79,7 +79,7 @@ func (cmd *download) Run(ctx context.Context, f *flag.FlagSet) error { return os.ErrExist } - c, err := cmd.Toolbox() + c, err := cmd.Toolbox(ctx) if err != nil { return err } diff --git a/vendor/github.com/vmware/govmomi/govc/vm/guest/guest.go b/vendor/github.com/vmware/govmomi/govc/vm/guest/guest.go index 3ad1e8a5c..7e02c5d71 100644 --- a/vendor/github.com/vmware/govmomi/govc/vm/guest/guest.go +++ b/vendor/github.com/vmware/govmomi/govc/vm/guest/guest.go @@ -26,8 +26,6 @@ import ( "github.com/vmware/govmomi/guest" "github.com/vmware/govmomi/guest/toolbox" "github.com/vmware/govmomi/object" - "github.com/vmware/govmomi/vim25/mo" - "github.com/vmware/govmomi/vim25/types" ) type GuestFlag struct { @@ -70,38 +68,18 @@ func (flag *GuestFlag) Process(ctx context.Context) error { return nil } -func (flag *GuestFlag) Toolbox() (*toolbox.Client, error) { - pm, err := flag.ProcessManager() - if err != nil { - return nil, err - } - - fm, err := flag.FileManager() - if err != nil { - return nil, err - } - +func (flag *GuestFlag) Toolbox(ctx context.Context) (*toolbox.Client, error) { vm, err := flag.VirtualMachine() if err != nil { return nil, err } - family := "" - var props mo.VirtualMachine - err = vm.Properties(context.Background(), vm.Reference(), []string{"guest.guestFamily"}, &props) + c, err := flag.Client() if err != nil { return nil, err } - if props.Guest != nil { - family = props.Guest.GuestFamily - } - return &toolbox.Client{ - ProcessManager: pm, - FileManager: fm, - Authentication: flag.Auth(), - GuestFamily: types.VirtualMachineGuestOsFamily(family), - }, nil + return toolbox.NewClient(ctx, c, vm, flag.Auth()) } func (flag *GuestFlag) FileManager() (*guest.FileManager, error) { diff --git a/vendor/github.com/vmware/govmomi/govc/vm/guest/run.go b/vendor/github.com/vmware/govmomi/govc/vm/guest/run.go index 1b5640133..3562abded 100644 --- a/vendor/github.com/vmware/govmomi/govc/vm/guest/run.go +++ b/vendor/github.com/vmware/govmomi/govc/vm/guest/run.go @@ -58,6 +58,11 @@ The guest.run command starts a program in the VM with i/o redirected, waits for propagates the exit code to the govc process exit code. Note that stdout and stderr are redirected by default, stdin is only redirected when the '-d' flag is specified. +Note that vmware-tools requires program PATH to be absolute. +If PATH is not absolute and vm guest family is Windows, +guest.run changes the command to: 'c:\\Windows\\System32\\cmd.exe /c "PATH [ARG]..."' +Otherwise the command is changed to: '/bin/bash -c "PATH [ARG]..."' + Examples: govc guest.run -vm $name ifconfig govc guest.run -vm $name ifconfig eth0 @@ -65,7 +70,8 @@ Examples: govc guest.run -vm $name -d "hello $USER" cat govc guest.run -vm $name curl -s :invalid: || echo $? # exit code 6 govc guest.run -vm $name -e FOO=bar -e BIZ=baz -C /tmp env - govc guest.run -l root:'mypassword' -vm my_vm_hostname "ntpdate -u pool.ntp.org"` + govc guest.run -vm $name -l root:mypassword ntpdate -u pool.ntp.org + govc guest.run -vm $name powershell C:\\network_refresh.ps1` } func (cmd *run) Run(ctx context.Context, f *flag.FlagSet) error { @@ -74,7 +80,7 @@ func (cmd *run) Run(ctx context.Context, f *flag.FlagSet) error { } name := f.Arg(0) - c, err := cmd.Toolbox() + c, err := cmd.Toolbox(ctx) if err != nil { return err } diff --git a/vendor/github.com/vmware/govmomi/govc/vm/guest/upload.go b/vendor/github.com/vmware/govmomi/govc/vm/guest/upload.go index 693f5cd84..db0490c12 100644 --- a/vendor/github.com/vmware/govmomi/govc/vm/guest/upload.go +++ b/vendor/github.com/vmware/govmomi/govc/vm/guest/upload.go @@ -77,7 +77,7 @@ func (cmd *upload) Run(ctx context.Context, f *flag.FlagSet) error { return flag.ErrHelp } - c, err := cmd.Toolbox() + c, err := cmd.Toolbox(ctx) if err != nil { return err } diff --git a/vendor/github.com/vmware/govmomi/govc/vm/instantclone.go b/vendor/github.com/vmware/govmomi/govc/vm/instantclone.go new file mode 100644 index 000000000..9f020df44 --- /dev/null +++ b/vendor/github.com/vmware/govmomi/govc/vm/instantclone.go @@ -0,0 +1,250 @@ +/* +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 ( + "context" + "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" +) + +type instantclone struct { + *flags.ClientFlag + *flags.DatacenterFlag + *flags.DatastoreFlag + *flags.ResourcePoolFlag + *flags.NetworkFlag + *flags.FolderFlag + *flags.VirtualMachineFlag + + name string + extraConfig extraConfig + + Client *vim25.Client + Datacenter *object.Datacenter + Datastore *object.Datastore + ResourcePool *object.ResourcePool + Folder *object.Folder + VirtualMachine *object.VirtualMachine +} + +func init() { + cli.Register("vm.instantclone", &instantclone{}) +} + +func (cmd *instantclone) 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.ResourcePoolFlag, ctx = flags.NewResourcePoolFlag(ctx) + cmd.ResourcePoolFlag.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.Var(&cmd.extraConfig, "e", "ExtraConfig. =") +} + +func (cmd *instantclone) Usage() string { + return "NAME" +} + +func (cmd *instantclone) Description() string { + return `Instant Clone VM to NAME. + +Examples: + govc vm.instantclone -vm source-vm new-vm + # Configure ExtraConfig variables on a guest VM: + govc vm.instantclone -vm source-vm -e guestinfo.ipaddress=192.168.0.1 -e guestinfo.netmask=255.255.255.0 new-vm + # Read the variable set above inside the guest: + vmware-rpctool "info-get guestinfo.ipaddress" + vmware-rpctool "info-get guestinfo.netmask"` +} + +func (cmd *instantclone) 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.ResourcePoolFlag.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 *instantclone) 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 + } + + cmd.Datastore, err = cmd.DatastoreFlag.Datastore() + if err != nil { + return err + } + + cmd.Folder, err = cmd.FolderFlag.Folder() + if err != nil { + return err + } + + cmd.ResourcePool, err = cmd.ResourcePoolFlag.ResourcePool() + if err != nil { + return err + } + + cmd.VirtualMachine, err = cmd.VirtualMachineFlag.VirtualMachine() + if err != nil { + return err + } + + if cmd.VirtualMachine == nil { + return flag.ErrHelp + } + + _, err = cmd.instantcloneVM(ctx) + if err != nil { + return err + } + + return nil +} + +func (cmd *instantclone) instantcloneVM(ctx context.Context) (*object.VirtualMachine, error) { + relocateSpec := types.VirtualMachineRelocateSpec{} + + if cmd.NetworkFlag.IsSet() { + devices, err := cmd.VirtualMachine.Device(ctx) + if err != nil { + return nil, err + } + + // prepare virtual device config spec for network card + configSpecs := []types.BaseVirtualDeviceConfigSpec{} + + op := types.VirtualDeviceConfigSpecOperationAdd + card, derr := cmd.NetworkFlag.Device() + if derr != nil { + return nil, derr + } + // search for the first network card of the source + for _, device := range devices { + if _, ok := device.(types.BaseVirtualEthernetCard); ok { + op = types.VirtualDeviceConfigSpecOperationEdit + // set new backing info + cmd.NetworkFlag.Change(device, card) + card = device + break + } + } + + configSpecs = append(configSpecs, &types.VirtualDeviceConfigSpec{ + Operation: op, + Device: card, + }) + + relocateSpec.DeviceChange = configSpecs + } + + if cmd.FolderFlag.IsSet() { + folderref := cmd.Folder.Reference() + relocateSpec.Folder = &folderref + } + + if cmd.ResourcePoolFlag.IsSet() { + poolref := cmd.ResourcePool.Reference() + relocateSpec.Pool = &poolref + } + + if cmd.DatastoreFlag.IsSet() { + datastoreref := cmd.Datastore.Reference() + relocateSpec.Datastore = &datastoreref + } + + instantcloneSpec := &types.VirtualMachineInstantCloneSpec{ + Name: cmd.name, + Location: relocateSpec, + } + + if len(cmd.extraConfig) > 0 { + instantcloneSpec.Config = cmd.extraConfig + } + + task, err := cmd.VirtualMachine.InstantClone(ctx, *instantcloneSpec) + if err != nil { + return nil, err + } + + logger := cmd.ProgressLogger(fmt.Sprintf("Instant Cloning %s to %s...", cmd.VirtualMachine.InventoryPath, cmd.name)) + defer logger.Wait() + + info, err := task.WaitForResult(ctx, logger) + if err != nil { + return nil, err + } + + return object.NewVirtualMachine(cmd.Client, info.Result.(types.ManagedObjectReference)), nil +} diff --git a/vendor/github.com/vmware/govmomi/govc/vm/markasvm.go b/vendor/github.com/vmware/govmomi/govc/vm/markasvm.go index 029786305..46fa57b34 100644 --- a/vendor/github.com/vmware/govmomi/govc/vm/markasvm.go +++ b/vendor/github.com/vmware/govmomi/govc/vm/markasvm.go @@ -64,8 +64,8 @@ func (cmd *markasvm) Description() string { return `Mark VM template as a virtual machine. Examples: - govc vm.markasvm $name -host host1 - govc vm.markasvm $name -pool cluster1/Resources` + govc vm.markasvm -host host1 $name + govc vm.markasvm -host host1 $name` } func (cmd *markasvm) Run(ctx context.Context, f *flag.FlagSet) error { diff --git a/vendor/github.com/vmware/govmomi/guest/toolbox/client.go b/vendor/github.com/vmware/govmomi/guest/toolbox/client.go index 88c5818f8..9d492296c 100644 --- a/vendor/github.com/vmware/govmomi/guest/toolbox/client.go +++ b/vendor/github.com/vmware/govmomi/guest/toolbox/client.go @@ -29,6 +29,9 @@ import ( "time" "github.com/vmware/govmomi/guest" + "github.com/vmware/govmomi/property" + "github.com/vmware/govmomi/vim25" + "github.com/vmware/govmomi/vim25/mo" "github.com/vmware/govmomi/vim25/soap" "github.com/vmware/govmomi/vim25/types" ) @@ -41,6 +44,46 @@ type Client struct { GuestFamily types.VirtualMachineGuestOsFamily } +// NewClient initializes a Client's ProcessManager, FileManager and GuestFamily +func NewClient(ctx context.Context, c *vim25.Client, vm mo.Reference, auth types.BaseGuestAuthentication) (*Client, error) { + m := guest.NewOperationsManager(c, vm.Reference()) + + pm, err := m.ProcessManager(ctx) + if err != nil { + return nil, err + } + + fm, err := m.FileManager(ctx) + if err != nil { + return nil, err + } + + family := "" + var props mo.VirtualMachine + pc := property.DefaultCollector(c) + err = pc.RetrieveOne(context.Background(), vm.Reference(), []string{"guest.guestFamily", "guest.toolsInstallType"}, &props) + if err != nil { + return nil, err + } + + if props.Guest != nil { + family = props.Guest.GuestFamily + if family == string(types.VirtualMachineGuestOsFamilyOtherGuestFamily) { + if props.Guest.ToolsInstallType == string(types.VirtualMachineToolsInstallTypeGuestToolsTypeMSI) { + // The case of Windows version not supported by the ESX version + family = string(types.VirtualMachineGuestOsFamilyWindowsGuest) + } + } + } + + return &Client{ + ProcessManager: pm, + FileManager: fm, + Authentication: auth, + GuestFamily: types.VirtualMachineGuestOsFamily(family), + }, nil +} + func (c *Client) rm(ctx context.Context, path string) { err := c.FileManager.DeleteFile(ctx, c.Authentication, path) if err != nil { diff --git a/vendor/github.com/vmware/govmomi/internal/helpers.go b/vendor/github.com/vmware/govmomi/internal/helpers.go new file mode 100644 index 000000000..945f1d474 --- /dev/null +++ b/vendor/github.com/vmware/govmomi/internal/helpers.go @@ -0,0 +1,38 @@ +/* +Copyright (c) 2020 VMware, Inc. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package internal + +import ( + "path" + + "github.com/vmware/govmomi/vim25/mo" +) + +// InventoryPath composed of entities by Name +func InventoryPath(entities []mo.ManagedEntity) string { + val := "/" + + for _, entity := range entities { + // Skip root folder in building inventory path. + if entity.Parent == nil { + continue + } + val = path.Join(val, entity.Name) + } + + return val +} diff --git a/vendor/github.com/vmware/govmomi/nfc/lease.go b/vendor/github.com/vmware/govmomi/nfc/lease.go index d6c90ac52..457568033 100644 --- a/vendor/github.com/vmware/govmomi/nfc/lease.go +++ b/vendor/github.com/vmware/govmomi/nfc/lease.go @@ -18,12 +18,12 @@ package nfc import ( "context" - "errors" "fmt" "io" "path" "github.com/vmware/govmomi/property" + "github.com/vmware/govmomi/task" "github.com/vmware/govmomi/vim25" "github.com/vmware/govmomi/vim25/methods" "github.com/vmware/govmomi/vim25/mo" @@ -194,7 +194,7 @@ func (l *Lease) Wait(ctx context.Context, items []types.OvfFileItem) (*LeaseInfo } if lease.Error != nil { - return nil, errors.New(lease.Error.LocalizedMessage) + return nil, &task.Error{LocalizedMethodFault: lease.Error} } return nil, fmt.Errorf("unexpected nfc lease state: %s", lease.State) diff --git a/vendor/github.com/vmware/govmomi/object/authorization_manager.go b/vendor/github.com/vmware/govmomi/object/authorization_manager.go index b703258fe..5cd6851a8 100644 --- a/vendor/github.com/vmware/govmomi/object/authorization_manager.go +++ b/vendor/github.com/vmware/govmomi/object/authorization_manager.go @@ -172,3 +172,50 @@ func (m AuthorizationManager) UpdateRole(ctx context.Context, id int32, name str _, err := methods.UpdateAuthorizationRole(ctx, m.Client(), &req) return err } + +func (m AuthorizationManager) HasUserPrivilegeOnEntities(ctx context.Context, entities []types.ManagedObjectReference, userName string, privID []string) ([]types.EntityPrivilege, error) { + req := types.HasUserPrivilegeOnEntities{ + This: m.Reference(), + Entities: entities, + UserName: userName, + PrivId: privID, + } + + res, err := methods.HasUserPrivilegeOnEntities(ctx, m.Client(), &req) + if err != nil { + return nil, err + } + + return res.Returnval, nil +} + +func (m AuthorizationManager) HasPrivilegeOnEntity(ctx context.Context, entity types.ManagedObjectReference, sessionID string, privID []string) ([]bool, error) { + req := types.HasPrivilegeOnEntity{ + This: m.Reference(), + Entity: entity, + SessionId: sessionID, + PrivId: privID, + } + + res, err := methods.HasPrivilegeOnEntity(ctx, m.Client(), &req) + if err != nil { + return nil, err + } + + return res.Returnval, nil +} + +func (m AuthorizationManager) FetchUserPrivilegeOnEntities(ctx context.Context, entities []types.ManagedObjectReference, userName string) ([]types.UserPrivilegeResult, error) { + req := types.FetchUserPrivilegeOnEntities{ + This: m.Reference(), + Entities: entities, + UserName: userName, + } + + res, err := methods.FetchUserPrivilegeOnEntities(ctx, m.Client(), &req) + if err != nil { + return nil, err + } + + return res.Returnval, nil +} diff --git a/vendor/github.com/vmware/govmomi/object/virtual_app.go b/vendor/github.com/vmware/govmomi/object/virtual_app.go index 4811178f1..b7311b3e3 100644 --- a/vendor/github.com/vmware/govmomi/object/virtual_app.go +++ b/vendor/github.com/vmware/govmomi/object/virtual_app.go @@ -103,3 +103,19 @@ func (p VirtualApp) Suspend(ctx context.Context) (*Task, error) { return NewTask(p.c, res.Returnval), nil } + +func (p VirtualApp) Clone(ctx context.Context, name string, target types.ManagedObjectReference, spec types.VAppCloneSpec) (*Task, error) { + req := types.CloneVApp_Task{ + This: p.Reference(), + Name: name, + Target: target, + Spec: spec, + } + + res, err := methods.CloneVApp_Task(ctx, p.c, &req) + if err != nil { + return nil, err + } + + return NewTask(p.c, res.Returnval), nil +} diff --git a/vendor/github.com/vmware/govmomi/object/virtual_device_list.go b/vendor/github.com/vmware/govmomi/object/virtual_device_list.go index 58b61f5d5..f25f6f2c1 100644 --- a/vendor/github.com/vmware/govmomi/object/virtual_device_list.go +++ b/vendor/github.com/vmware/govmomi/object/virtual_device_list.go @@ -19,6 +19,7 @@ package object import ( "errors" "fmt" + "math/rand" "path/filepath" "reflect" "regexp" @@ -67,7 +68,7 @@ func EthernetCardTypes() VirtualDeviceList { &types.VirtualSriovEthernetCard{}, }).Select(func(device types.BaseVirtualDevice) bool { c := device.(types.BaseVirtualEthernetCard).GetVirtualEthernetCard() - c.GetVirtualDevice().Key = -1 + c.GetVirtualDevice().Key = int32(rand.Uint32()) * -1 return true }) } @@ -134,6 +135,9 @@ func (l VirtualDeviceList) SelectByBackingInfo(backing types.BaseVirtualDeviceBa b := backing.(*types.VirtualEthernetCardDistributedVirtualPortBackingInfo) return a.Port.SwitchUuid == b.Port.SwitchUuid && a.Port.PortgroupKey == b.Port.PortgroupKey + case *types.VirtualEthernetCardOpaqueNetworkBackingInfo: + b := backing.(*types.VirtualEthernetCardOpaqueNetworkBackingInfo) + return a.OpaqueNetworkId == b.OpaqueNetworkId case *types.VirtualDiskFlatVer2BackingInfo: b := backing.(*types.VirtualDiskFlatVer2BackingInfo) if a.Parent != nil && b.Parent != nil { @@ -433,7 +437,7 @@ func (l VirtualDeviceList) AssignController(device types.BaseVirtualDevice, c ty d.UnitNumber = new(int32) *d.UnitNumber = l.newUnitNumber(c) if d.Key == 0 { - d.Key = -1 + d.Key = int32(rand.Uint32()) * -1 } } diff --git a/vendor/github.com/vmware/govmomi/object/virtual_machine.go b/vendor/github.com/vmware/govmomi/object/virtual_machine.go index 2bcfab60b..bb731800c 100644 --- a/vendor/github.com/vmware/govmomi/object/virtual_machine.go +++ b/vendor/github.com/vmware/govmomi/object/virtual_machine.go @@ -1,5 +1,5 @@ /* -Copyright (c) 2015-2017 VMware, Inc. All Rights Reserved. +Copyright (c) 2015-2021 VMware, Inc. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -22,6 +22,7 @@ import ( "fmt" "net" "path" + "strings" "github.com/vmware/govmomi/nfc" "github.com/vmware/govmomi/property" @@ -40,6 +41,34 @@ type VirtualMachine struct { Common } +// extractDiskLayoutFiles is a helper function used to extract file keys for +// all disk files attached to the virtual machine at the current point of +// running. +func extractDiskLayoutFiles(diskLayoutList []types.VirtualMachineFileLayoutExDiskLayout) []int { + var result []int + + for _, layoutExDisk := range diskLayoutList { + for _, link := range layoutExDisk.Chain { + for i := range link.FileKey { // diskDescriptor, diskExtent pairs + result = append(result, int(link.FileKey[i])) + } + } + } + + return result +} + +// removeKey is a helper function for removing a specific file key from a list +// of keys associated with disks attached to a virtual machine. +func removeKey(l *[]int, key int) { + for i, k := range *l { + if k == key { + *l = append((*l)[:i], (*l)[i+1:]...) + break + } + } +} + func NewVirtualMachine(c *vim25.Client, ref types.ManagedObjectReference) *VirtualMachine { return &VirtualMachine{ Common: NewCommon(c, ref), @@ -181,6 +210,20 @@ func (v VirtualMachine) Clone(ctx context.Context, folder *Folder, name string, return NewTask(v.c, res.Returnval), nil } +func (v VirtualMachine) InstantClone(ctx context.Context, config types.VirtualMachineInstantCloneSpec) (*Task, error) { + req := types.InstantClone_Task{ + This: v.Reference(), + Spec: config, + } + + res, err := methods.InstantClone_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(), @@ -291,7 +334,9 @@ func (v VirtualMachine) WaitForNetIP(ctx context.Context, v4 bool, device ...str devices := VirtualDeviceList(c.Val.(types.ArrayOfVirtualDevice).VirtualDevice) for _, d := range devices { if nic, ok := d.(types.BaseVirtualEthernetCard); ok { - mac := nic.GetVirtualEthernetCard().MacAddress + // Convert to lower so that e.g. 00:50:56:83:3A:5D is treated the + // same as 00:50:56:83:3a:5d + mac := strings.ToLower(nic.GetVirtualEthernetCard().MacAddress) if mac == "" { return false } @@ -327,7 +372,9 @@ func (v VirtualMachine) WaitForNetIP(ctx context.Context, v4 bool, device ...str nics := c.Val.(types.ArrayOfGuestNicInfo).GuestNicInfo for _, nic := range nics { - mac := nic.MacAddress + // Convert to lower so that e.g. 00:50:56:83:3A:5D is treated the + // same as 00:50:56:83:3a:5d + mac := strings.ToLower(nic.MacAddress) if mac == "" || nic.IpConfig == nil { continue } @@ -469,6 +516,41 @@ func (v VirtualMachine) RemoveDevice(ctx context.Context, keepFiles bool, device return v.configureDevice(ctx, types.VirtualDeviceConfigSpecOperationRemove, fop, device...) } +// AttachDisk attaches the given disk to the VirtualMachine +func (v VirtualMachine) AttachDisk(ctx context.Context, id string, datastore *Datastore, controllerKey int32, unitNumber int32) error { + req := types.AttachDisk_Task{ + This: v.Reference(), + DiskId: types.ID{Id: id}, + Datastore: datastore.Reference(), + ControllerKey: controllerKey, + UnitNumber: &unitNumber, + } + + res, err := methods.AttachDisk_Task(ctx, v.c, &req) + if err != nil { + return err + } + + task := NewTask(v.c, res.Returnval) + return task.Wait(ctx) +} + +// DetachDisk detaches the given disk from the VirtualMachine +func (v VirtualMachine) DetachDisk(ctx context.Context, id string) error { + req := types.DetachDisk_Task{ + This: v.Reference(), + DiskId: types.ID{Id: id}, + } + + res, err := methods.DetachDisk_Task(ctx, v.c, &req) + if err != nil { + return err + } + + task := NewTask(v.c, res.Returnval) + return task.Wait(ctx) +} + // BootOptions returns the VirtualMachine's config.bootOptions property. func (v VirtualMachine) BootOptions(ctx context.Context) (*types.VirtualMachineBootOptions, error) { var o mo.VirtualMachine @@ -579,6 +661,63 @@ func (m snapshotMap) add(parent string, tree []types.VirtualMachineSnapshotTree) } } +// SnapshotSize calculates the size of a given snapshot in bytes. If the +// snapshot is current, disk files not associated with any parent snapshot are +// included in size calculations. This allows for measuring and including the +// growth from the last fixed snapshot to the present state. +func SnapshotSize(info types.ManagedObjectReference, parent *types.ManagedObjectReference, vmlayout *types.VirtualMachineFileLayoutEx, isCurrent bool) int { + var fileKeyList []int + var parentFiles []int + var allSnapshotFiles []int + + diskFiles := extractDiskLayoutFiles(vmlayout.Disk) + + for _, layout := range vmlayout.Snapshot { + diskLayout := extractDiskLayoutFiles(layout.Disk) + allSnapshotFiles = append(allSnapshotFiles, diskLayout...) + + if layout.Key.Value == info.Value { + fileKeyList = append(fileKeyList, int(layout.DataKey)) // The .vmsn file + fileKeyList = append(fileKeyList, diskLayout...) // The .vmdk files + } else if parent != nil && layout.Key.Value == parent.Value { + parentFiles = append(parentFiles, diskLayout...) + } + } + + for _, parentFile := range parentFiles { + removeKey(&fileKeyList, parentFile) + } + + for _, file := range allSnapshotFiles { + removeKey(&diskFiles, file) + } + + fileKeyMap := make(map[int]types.VirtualMachineFileLayoutExFileInfo) + for _, file := range vmlayout.File { + fileKeyMap[int(file.Key)] = file + } + + size := 0 + + for _, fileKey := range fileKeyList { + file := fileKeyMap[fileKey] + if parent != nil || + (file.Type != string(types.VirtualMachineFileLayoutExFileTypeDiskDescriptor) && + file.Type != string(types.VirtualMachineFileLayoutExFileTypeDiskExtent)) { + size += int(file.Size) + } + } + + if isCurrent { + for _, diskFile := range diskFiles { + file := fileKeyMap[diskFile] + size += int(file.Size) + } + } + + return size +} + // FindSnapshot supports snapshot lookup by name, where name can be: // 1) snapshot ManagedObjectReference.Value (unique) // 2) snapshot name (may not be unique) @@ -855,8 +994,10 @@ func (v VirtualMachine) UUID(ctx context.Context) string { if err != nil { return "" } - - return o.Config.Uuid + if o.Config != nil { + return o.Config.Uuid + } + return "" } func (v VirtualMachine) QueryChangedDiskAreas(ctx context.Context, baseSnapshot, curSnapshot *types.ManagedObjectReference, disk *types.VirtualDisk, offset int64) (types.DiskChangeInfo, error) { diff --git a/vendor/github.com/vmware/govmomi/ovf/envelope.go b/vendor/github.com/vmware/govmomi/ovf/envelope.go index fa4690d88..274adb9df 100644 --- a/vendor/github.com/vmware/govmomi/ovf/envelope.go +++ b/vendor/github.com/vmware/govmomi/ovf/envelope.go @@ -148,6 +148,12 @@ type EulaSection struct { License string `xml:"License"` } +type Config struct { + Required *bool `xml:"required,attr"` + Key string `xml:"key,attr"` + Value string `xml:"value,attr"` +} + type VirtualHardwareSection struct { Section @@ -157,6 +163,8 @@ type VirtualHardwareSection struct { System *VirtualSystemSettingData `xml:"System"` Item []ResourceAllocationSettingData `xml:"Item"` StorageItem []StorageAllocationSettingData `xml:"StorageItem"` + Config []Config `xml:"Config"` + ExtraConfig []Config `xml:"ExtraConfig"` } type VirtualSystemSettingData struct { diff --git a/vendor/github.com/vmware/govmomi/pbm/client.go b/vendor/github.com/vmware/govmomi/pbm/client.go new file mode 100644 index 000000000..ba2531ec9 --- /dev/null +++ b/vendor/github.com/vmware/govmomi/pbm/client.go @@ -0,0 +1,287 @@ +/* +Copyright (c) 2017 VMware, Inc. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package pbm + +import ( + "context" + "fmt" + + "github.com/vmware/govmomi/pbm/methods" + "github.com/vmware/govmomi/pbm/types" + "github.com/vmware/govmomi/vim25" + "github.com/vmware/govmomi/vim25/soap" + vim "github.com/vmware/govmomi/vim25/types" +) + +const ( + Namespace = "pbm" + Path = "/pbm" +) + +var ( + ServiceInstance = vim.ManagedObjectReference{ + Type: "PbmServiceInstance", + Value: "ServiceInstance", + } +) + +type Client struct { + *soap.Client + + ServiceContent types.PbmServiceInstanceContent + + RoundTripper soap.RoundTripper +} + +func NewClient(ctx context.Context, c *vim25.Client) (*Client, error) { + sc := c.Client.NewServiceClient(Path, Namespace) + + req := types.PbmRetrieveServiceContent{ + This: ServiceInstance, + } + + res, err := methods.PbmRetrieveServiceContent(ctx, sc, &req) + if err != nil { + return nil, err + } + + return &Client{sc, res.Returnval, sc}, 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) +} + +func (c *Client) QueryProfile(ctx context.Context, rtype types.PbmProfileResourceType, category string) ([]types.PbmProfileId, error) { + req := types.PbmQueryProfile{ + This: c.ServiceContent.ProfileManager, + ResourceType: rtype, + ProfileCategory: category, + } + + res, err := methods.PbmQueryProfile(ctx, c, &req) + if err != nil { + return nil, err + } + + return res.Returnval, nil +} + +func (c *Client) RetrieveContent(ctx context.Context, ids []types.PbmProfileId) ([]types.BasePbmProfile, error) { + req := types.PbmRetrieveContent{ + This: c.ServiceContent.ProfileManager, + ProfileIds: ids, + } + + res, err := methods.PbmRetrieveContent(ctx, c, &req) + if err != nil { + return nil, err + } + + return res.Returnval, nil +} + +type PlacementCompatibilityResult []types.PbmPlacementCompatibilityResult + +func (c *Client) CheckRequirements(ctx context.Context, hubs []types.PbmPlacementHub, ref *types.PbmServerObjectRef, preq []types.BasePbmPlacementRequirement) (PlacementCompatibilityResult, error) { + req := types.PbmCheckRequirements{ + This: c.ServiceContent.PlacementSolver, + HubsToSearch: hubs, + PlacementSubjectRef: ref, + PlacementSubjectRequirement: preq, + } + + res, err := methods.PbmCheckRequirements(ctx, c, &req) + if err != nil { + return nil, err + } + + return res.Returnval, nil +} + +func (l PlacementCompatibilityResult) CompatibleDatastores() []types.PbmPlacementHub { + var compatibleDatastores []types.PbmPlacementHub + + for _, res := range l { + if len(res.Error) == 0 { + compatibleDatastores = append(compatibleDatastores, res.Hub) + } + } + return compatibleDatastores +} + +func (l PlacementCompatibilityResult) NonCompatibleDatastores() []types.PbmPlacementHub { + var nonCompatibleDatastores []types.PbmPlacementHub + + for _, res := range l { + if len(res.Error) > 0 { + nonCompatibleDatastores = append(nonCompatibleDatastores, res.Hub) + } + } + return nonCompatibleDatastores +} + +func (c *Client) CreateProfile(ctx context.Context, capabilityProfileCreateSpec types.PbmCapabilityProfileCreateSpec) (*types.PbmProfileId, error) { + req := types.PbmCreate{ + This: c.ServiceContent.ProfileManager, + CreateSpec: capabilityProfileCreateSpec, + } + + res, err := methods.PbmCreate(ctx, c, &req) + if err != nil { + return nil, err + } + + return &res.Returnval, nil +} + +func (c *Client) UpdateProfile(ctx context.Context, id types.PbmProfileId, updateSpec types.PbmCapabilityProfileUpdateSpec) error { + req := types.PbmUpdate{ + This: c.ServiceContent.ProfileManager, + ProfileId: id, + UpdateSpec: updateSpec, + } + + _, err := methods.PbmUpdate(ctx, c, &req) + if err != nil { + return err + } + + return nil +} + +func (c *Client) DeleteProfile(ctx context.Context, ids []types.PbmProfileId) ([]types.PbmProfileOperationOutcome, error) { + req := types.PbmDelete{ + This: c.ServiceContent.ProfileManager, + ProfileId: ids, + } + + res, err := methods.PbmDelete(ctx, c, &req) + if err != nil { + return nil, err + } + + return res.Returnval, nil +} + +func (c *Client) QueryAssociatedEntity(ctx context.Context, id types.PbmProfileId, entityType string) ([]types.PbmServerObjectRef, error) { + req := types.PbmQueryAssociatedEntity{ + This: c.ServiceContent.ProfileManager, + Profile: id, + EntityType: entityType, + } + + res, err := methods.PbmQueryAssociatedEntity(ctx, c, &req) + if err != nil { + return nil, err + } + + return res.Returnval, nil +} + +func (c *Client) QueryAssociatedEntities(ctx context.Context, ids []types.PbmProfileId) ([]types.PbmQueryProfileResult, error) { + req := types.PbmQueryAssociatedEntities{ + This: c.ServiceContent.ProfileManager, + Profiles: ids, + } + + res, err := methods.PbmQueryAssociatedEntities(ctx, c, &req) + if err != nil { + return nil, err + } + + return res.Returnval, nil +} + +func (c *Client) ProfileIDByName(ctx context.Context, profileName string) (string, error) { + resourceType := types.PbmProfileResourceType{ + ResourceType: string(types.PbmProfileResourceTypeEnumSTORAGE), + } + category := types.PbmProfileCategoryEnumREQUIREMENT + ids, err := c.QueryProfile(ctx, resourceType, string(category)) + if err != nil { + return "", err + } + + profiles, err := c.RetrieveContent(ctx, ids) + if err != nil { + return "", err + } + + for i := range profiles { + profile := profiles[i].GetPbmProfile() + if profile.Name == profileName { + return profile.ProfileId.UniqueId, nil + } + } + return "", fmt.Errorf("no pbm profile found with name: %q", profileName) +} + +func (c *Client) FetchCapabilityMetadata(ctx context.Context, rtype *types.PbmProfileResourceType, vendorUuid string) ([]types.PbmCapabilityMetadataPerCategory, error) { + req := types.PbmFetchCapabilityMetadata{ + This: c.ServiceContent.ProfileManager, + ResourceType: rtype, + VendorUuid: vendorUuid, + } + + res, err := methods.PbmFetchCapabilityMetadata(ctx, c, &req) + if err != nil { + return nil, err + } + + return res.Returnval, nil +} + +func (c *Client) FetchComplianceResult(ctx context.Context, entities []types.PbmServerObjectRef) ([]types.PbmComplianceResult, error) { + req := types.PbmFetchComplianceResult{ + This: c.ServiceContent.ComplianceManager, + Entities: entities, + } + + res, err := methods.PbmFetchComplianceResult(ctx, c, &req) + if err != nil { + return nil, err + } + + return res.Returnval, nil +} + +// GetProfileNameByID gets storage profile name by ID +func (c *Client) GetProfileNameByID(ctx context.Context, profileID string) (string, error) { + resourceType := types.PbmProfileResourceType{ + ResourceType: string(types.PbmProfileResourceTypeEnumSTORAGE), + } + category := types.PbmProfileCategoryEnumREQUIREMENT + ids, err := c.QueryProfile(ctx, resourceType, string(category)) + if err != nil { + return "", err + } + + profiles, err := c.RetrieveContent(ctx, ids) + if err != nil { + return "", err + } + + for i := range profiles { + profile := profiles[i].GetPbmProfile() + if profile.ProfileId.UniqueId == profileID { + return profile.Name, nil + } + } + return "", fmt.Errorf("no pbm profile found with id: %q", profileID) +} diff --git a/vendor/github.com/vmware/govmomi/pbm/methods/methods.go b/vendor/github.com/vmware/govmomi/pbm/methods/methods.go new file mode 100644 index 000000000..075c0f746 --- /dev/null +++ b/vendor/github.com/vmware/govmomi/pbm/methods/methods.go @@ -0,0 +1,664 @@ +/* +Copyright (c) 2014-2021 VMware, Inc. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES 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 ( + "context" + + "github.com/vmware/govmomi/pbm/types" + "github.com/vmware/govmomi/vim25/soap" +) + +type PbmAssignDefaultRequirementProfileBody struct { + Req *types.PbmAssignDefaultRequirementProfile `xml:"urn:pbm PbmAssignDefaultRequirementProfile,omitempty"` + Res *types.PbmAssignDefaultRequirementProfileResponse `xml:"urn:pbm PbmAssignDefaultRequirementProfileResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *PbmAssignDefaultRequirementProfileBody) Fault() *soap.Fault { return b.Fault_ } + +func PbmAssignDefaultRequirementProfile(ctx context.Context, r soap.RoundTripper, req *types.PbmAssignDefaultRequirementProfile) (*types.PbmAssignDefaultRequirementProfileResponse, error) { + var reqBody, resBody PbmAssignDefaultRequirementProfileBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type PbmCheckCompatibilityBody struct { + Req *types.PbmCheckCompatibility `xml:"urn:pbm PbmCheckCompatibility,omitempty"` + Res *types.PbmCheckCompatibilityResponse `xml:"urn:pbm PbmCheckCompatibilityResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *PbmCheckCompatibilityBody) Fault() *soap.Fault { return b.Fault_ } + +func PbmCheckCompatibility(ctx context.Context, r soap.RoundTripper, req *types.PbmCheckCompatibility) (*types.PbmCheckCompatibilityResponse, error) { + var reqBody, resBody PbmCheckCompatibilityBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type PbmCheckCompatibilityWithSpecBody struct { + Req *types.PbmCheckCompatibilityWithSpec `xml:"urn:pbm PbmCheckCompatibilityWithSpec,omitempty"` + Res *types.PbmCheckCompatibilityWithSpecResponse `xml:"urn:pbm PbmCheckCompatibilityWithSpecResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *PbmCheckCompatibilityWithSpecBody) Fault() *soap.Fault { return b.Fault_ } + +func PbmCheckCompatibilityWithSpec(ctx context.Context, r soap.RoundTripper, req *types.PbmCheckCompatibilityWithSpec) (*types.PbmCheckCompatibilityWithSpecResponse, error) { + var reqBody, resBody PbmCheckCompatibilityWithSpecBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type PbmCheckComplianceBody struct { + Req *types.PbmCheckCompliance `xml:"urn:pbm PbmCheckCompliance,omitempty"` + Res *types.PbmCheckComplianceResponse `xml:"urn:pbm PbmCheckComplianceResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *PbmCheckComplianceBody) Fault() *soap.Fault { return b.Fault_ } + +func PbmCheckCompliance(ctx context.Context, r soap.RoundTripper, req *types.PbmCheckCompliance) (*types.PbmCheckComplianceResponse, error) { + var reqBody, resBody PbmCheckComplianceBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type PbmCheckRequirementsBody struct { + Req *types.PbmCheckRequirements `xml:"urn:pbm PbmCheckRequirements,omitempty"` + Res *types.PbmCheckRequirementsResponse `xml:"urn:pbm PbmCheckRequirementsResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *PbmCheckRequirementsBody) Fault() *soap.Fault { return b.Fault_ } + +func PbmCheckRequirements(ctx context.Context, r soap.RoundTripper, req *types.PbmCheckRequirements) (*types.PbmCheckRequirementsResponse, error) { + var reqBody, resBody PbmCheckRequirementsBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type PbmCheckRollupComplianceBody struct { + Req *types.PbmCheckRollupCompliance `xml:"urn:pbm PbmCheckRollupCompliance,omitempty"` + Res *types.PbmCheckRollupComplianceResponse `xml:"urn:pbm PbmCheckRollupComplianceResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *PbmCheckRollupComplianceBody) Fault() *soap.Fault { return b.Fault_ } + +func PbmCheckRollupCompliance(ctx context.Context, r soap.RoundTripper, req *types.PbmCheckRollupCompliance) (*types.PbmCheckRollupComplianceResponse, error) { + var reqBody, resBody PbmCheckRollupComplianceBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type PbmCreateBody struct { + Req *types.PbmCreate `xml:"urn:pbm PbmCreate,omitempty"` + Res *types.PbmCreateResponse `xml:"urn:pbm PbmCreateResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *PbmCreateBody) Fault() *soap.Fault { return b.Fault_ } + +func PbmCreate(ctx context.Context, r soap.RoundTripper, req *types.PbmCreate) (*types.PbmCreateResponse, error) { + var reqBody, resBody PbmCreateBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type PbmDeleteBody struct { + Req *types.PbmDelete `xml:"urn:pbm PbmDelete,omitempty"` + Res *types.PbmDeleteResponse `xml:"urn:pbm PbmDeleteResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *PbmDeleteBody) Fault() *soap.Fault { return b.Fault_ } + +func PbmDelete(ctx context.Context, r soap.RoundTripper, req *types.PbmDelete) (*types.PbmDeleteResponse, error) { + var reqBody, resBody PbmDeleteBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type PbmFetchCapabilityMetadataBody struct { + Req *types.PbmFetchCapabilityMetadata `xml:"urn:pbm PbmFetchCapabilityMetadata,omitempty"` + Res *types.PbmFetchCapabilityMetadataResponse `xml:"urn:pbm PbmFetchCapabilityMetadataResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *PbmFetchCapabilityMetadataBody) Fault() *soap.Fault { return b.Fault_ } + +func PbmFetchCapabilityMetadata(ctx context.Context, r soap.RoundTripper, req *types.PbmFetchCapabilityMetadata) (*types.PbmFetchCapabilityMetadataResponse, error) { + var reqBody, resBody PbmFetchCapabilityMetadataBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type PbmFetchCapabilitySchemaBody struct { + Req *types.PbmFetchCapabilitySchema `xml:"urn:pbm PbmFetchCapabilitySchema,omitempty"` + Res *types.PbmFetchCapabilitySchemaResponse `xml:"urn:pbm PbmFetchCapabilitySchemaResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *PbmFetchCapabilitySchemaBody) Fault() *soap.Fault { return b.Fault_ } + +func PbmFetchCapabilitySchema(ctx context.Context, r soap.RoundTripper, req *types.PbmFetchCapabilitySchema) (*types.PbmFetchCapabilitySchemaResponse, error) { + var reqBody, resBody PbmFetchCapabilitySchemaBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type PbmFetchComplianceResultBody struct { + Req *types.PbmFetchComplianceResult `xml:"urn:pbm PbmFetchComplianceResult,omitempty"` + Res *types.PbmFetchComplianceResultResponse `xml:"urn:pbm PbmFetchComplianceResultResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *PbmFetchComplianceResultBody) Fault() *soap.Fault { return b.Fault_ } + +func PbmFetchComplianceResult(ctx context.Context, r soap.RoundTripper, req *types.PbmFetchComplianceResult) (*types.PbmFetchComplianceResultResponse, error) { + var reqBody, resBody PbmFetchComplianceResultBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type PbmFetchResourceTypeBody struct { + Req *types.PbmFetchResourceType `xml:"urn:pbm PbmFetchResourceType,omitempty"` + Res *types.PbmFetchResourceTypeResponse `xml:"urn:pbm PbmFetchResourceTypeResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *PbmFetchResourceTypeBody) Fault() *soap.Fault { return b.Fault_ } + +func PbmFetchResourceType(ctx context.Context, r soap.RoundTripper, req *types.PbmFetchResourceType) (*types.PbmFetchResourceTypeResponse, error) { + var reqBody, resBody PbmFetchResourceTypeBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type PbmFetchRollupComplianceResultBody struct { + Req *types.PbmFetchRollupComplianceResult `xml:"urn:pbm PbmFetchRollupComplianceResult,omitempty"` + Res *types.PbmFetchRollupComplianceResultResponse `xml:"urn:pbm PbmFetchRollupComplianceResultResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *PbmFetchRollupComplianceResultBody) Fault() *soap.Fault { return b.Fault_ } + +func PbmFetchRollupComplianceResult(ctx context.Context, r soap.RoundTripper, req *types.PbmFetchRollupComplianceResult) (*types.PbmFetchRollupComplianceResultResponse, error) { + var reqBody, resBody PbmFetchRollupComplianceResultBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type PbmFetchVendorInfoBody struct { + Req *types.PbmFetchVendorInfo `xml:"urn:pbm PbmFetchVendorInfo,omitempty"` + Res *types.PbmFetchVendorInfoResponse `xml:"urn:pbm PbmFetchVendorInfoResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *PbmFetchVendorInfoBody) Fault() *soap.Fault { return b.Fault_ } + +func PbmFetchVendorInfo(ctx context.Context, r soap.RoundTripper, req *types.PbmFetchVendorInfo) (*types.PbmFetchVendorInfoResponse, error) { + var reqBody, resBody PbmFetchVendorInfoBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type PbmFindApplicableDefaultProfileBody struct { + Req *types.PbmFindApplicableDefaultProfile `xml:"urn:pbm PbmFindApplicableDefaultProfile,omitempty"` + Res *types.PbmFindApplicableDefaultProfileResponse `xml:"urn:pbm PbmFindApplicableDefaultProfileResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *PbmFindApplicableDefaultProfileBody) Fault() *soap.Fault { return b.Fault_ } + +func PbmFindApplicableDefaultProfile(ctx context.Context, r soap.RoundTripper, req *types.PbmFindApplicableDefaultProfile) (*types.PbmFindApplicableDefaultProfileResponse, error) { + var reqBody, resBody PbmFindApplicableDefaultProfileBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type PbmQueryAssociatedEntitiesBody struct { + Req *types.PbmQueryAssociatedEntities `xml:"urn:pbm PbmQueryAssociatedEntities,omitempty"` + Res *types.PbmQueryAssociatedEntitiesResponse `xml:"urn:pbm PbmQueryAssociatedEntitiesResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *PbmQueryAssociatedEntitiesBody) Fault() *soap.Fault { return b.Fault_ } + +func PbmQueryAssociatedEntities(ctx context.Context, r soap.RoundTripper, req *types.PbmQueryAssociatedEntities) (*types.PbmQueryAssociatedEntitiesResponse, error) { + var reqBody, resBody PbmQueryAssociatedEntitiesBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type PbmQueryAssociatedEntityBody struct { + Req *types.PbmQueryAssociatedEntity `xml:"urn:pbm PbmQueryAssociatedEntity,omitempty"` + Res *types.PbmQueryAssociatedEntityResponse `xml:"urn:pbm PbmQueryAssociatedEntityResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *PbmQueryAssociatedEntityBody) Fault() *soap.Fault { return b.Fault_ } + +func PbmQueryAssociatedEntity(ctx context.Context, r soap.RoundTripper, req *types.PbmQueryAssociatedEntity) (*types.PbmQueryAssociatedEntityResponse, error) { + var reqBody, resBody PbmQueryAssociatedEntityBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type PbmQueryAssociatedProfileBody struct { + Req *types.PbmQueryAssociatedProfile `xml:"urn:pbm PbmQueryAssociatedProfile,omitempty"` + Res *types.PbmQueryAssociatedProfileResponse `xml:"urn:pbm PbmQueryAssociatedProfileResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *PbmQueryAssociatedProfileBody) Fault() *soap.Fault { return b.Fault_ } + +func PbmQueryAssociatedProfile(ctx context.Context, r soap.RoundTripper, req *types.PbmQueryAssociatedProfile) (*types.PbmQueryAssociatedProfileResponse, error) { + var reqBody, resBody PbmQueryAssociatedProfileBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type PbmQueryAssociatedProfilesBody struct { + Req *types.PbmQueryAssociatedProfiles `xml:"urn:pbm PbmQueryAssociatedProfiles,omitempty"` + Res *types.PbmQueryAssociatedProfilesResponse `xml:"urn:pbm PbmQueryAssociatedProfilesResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *PbmQueryAssociatedProfilesBody) Fault() *soap.Fault { return b.Fault_ } + +func PbmQueryAssociatedProfiles(ctx context.Context, r soap.RoundTripper, req *types.PbmQueryAssociatedProfiles) (*types.PbmQueryAssociatedProfilesResponse, error) { + var reqBody, resBody PbmQueryAssociatedProfilesBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type PbmQueryByRollupComplianceStatusBody struct { + Req *types.PbmQueryByRollupComplianceStatus `xml:"urn:pbm PbmQueryByRollupComplianceStatus,omitempty"` + Res *types.PbmQueryByRollupComplianceStatusResponse `xml:"urn:pbm PbmQueryByRollupComplianceStatusResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *PbmQueryByRollupComplianceStatusBody) Fault() *soap.Fault { return b.Fault_ } + +func PbmQueryByRollupComplianceStatus(ctx context.Context, r soap.RoundTripper, req *types.PbmQueryByRollupComplianceStatus) (*types.PbmQueryByRollupComplianceStatusResponse, error) { + var reqBody, resBody PbmQueryByRollupComplianceStatusBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type PbmQueryDefaultRequirementProfileBody struct { + Req *types.PbmQueryDefaultRequirementProfile `xml:"urn:pbm PbmQueryDefaultRequirementProfile,omitempty"` + Res *types.PbmQueryDefaultRequirementProfileResponse `xml:"urn:pbm PbmQueryDefaultRequirementProfileResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *PbmQueryDefaultRequirementProfileBody) Fault() *soap.Fault { return b.Fault_ } + +func PbmQueryDefaultRequirementProfile(ctx context.Context, r soap.RoundTripper, req *types.PbmQueryDefaultRequirementProfile) (*types.PbmQueryDefaultRequirementProfileResponse, error) { + var reqBody, resBody PbmQueryDefaultRequirementProfileBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type PbmQueryDefaultRequirementProfilesBody struct { + Req *types.PbmQueryDefaultRequirementProfiles `xml:"urn:pbm PbmQueryDefaultRequirementProfiles,omitempty"` + Res *types.PbmQueryDefaultRequirementProfilesResponse `xml:"urn:pbm PbmQueryDefaultRequirementProfilesResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *PbmQueryDefaultRequirementProfilesBody) Fault() *soap.Fault { return b.Fault_ } + +func PbmQueryDefaultRequirementProfiles(ctx context.Context, r soap.RoundTripper, req *types.PbmQueryDefaultRequirementProfiles) (*types.PbmQueryDefaultRequirementProfilesResponse, error) { + var reqBody, resBody PbmQueryDefaultRequirementProfilesBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type PbmQueryMatchingHubBody struct { + Req *types.PbmQueryMatchingHub `xml:"urn:pbm PbmQueryMatchingHub,omitempty"` + Res *types.PbmQueryMatchingHubResponse `xml:"urn:pbm PbmQueryMatchingHubResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *PbmQueryMatchingHubBody) Fault() *soap.Fault { return b.Fault_ } + +func PbmQueryMatchingHub(ctx context.Context, r soap.RoundTripper, req *types.PbmQueryMatchingHub) (*types.PbmQueryMatchingHubResponse, error) { + var reqBody, resBody PbmQueryMatchingHubBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type PbmQueryMatchingHubWithSpecBody struct { + Req *types.PbmQueryMatchingHubWithSpec `xml:"urn:pbm PbmQueryMatchingHubWithSpec,omitempty"` + Res *types.PbmQueryMatchingHubWithSpecResponse `xml:"urn:pbm PbmQueryMatchingHubWithSpecResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *PbmQueryMatchingHubWithSpecBody) Fault() *soap.Fault { return b.Fault_ } + +func PbmQueryMatchingHubWithSpec(ctx context.Context, r soap.RoundTripper, req *types.PbmQueryMatchingHubWithSpec) (*types.PbmQueryMatchingHubWithSpecResponse, error) { + var reqBody, resBody PbmQueryMatchingHubWithSpecBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type PbmQueryProfileBody struct { + Req *types.PbmQueryProfile `xml:"urn:pbm PbmQueryProfile,omitempty"` + Res *types.PbmQueryProfileResponse `xml:"urn:pbm PbmQueryProfileResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *PbmQueryProfileBody) Fault() *soap.Fault { return b.Fault_ } + +func PbmQueryProfile(ctx context.Context, r soap.RoundTripper, req *types.PbmQueryProfile) (*types.PbmQueryProfileResponse, error) { + var reqBody, resBody PbmQueryProfileBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type PbmQueryReplicationGroupsBody struct { + Req *types.PbmQueryReplicationGroups `xml:"urn:pbm PbmQueryReplicationGroups,omitempty"` + Res *types.PbmQueryReplicationGroupsResponse `xml:"urn:pbm PbmQueryReplicationGroupsResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *PbmQueryReplicationGroupsBody) Fault() *soap.Fault { return b.Fault_ } + +func PbmQueryReplicationGroups(ctx context.Context, r soap.RoundTripper, req *types.PbmQueryReplicationGroups) (*types.PbmQueryReplicationGroupsResponse, error) { + var reqBody, resBody PbmQueryReplicationGroupsBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type PbmQuerySpaceStatsForStorageContainerBody struct { + Req *types.PbmQuerySpaceStatsForStorageContainer `xml:"urn:pbm PbmQuerySpaceStatsForStorageContainer,omitempty"` + Res *types.PbmQuerySpaceStatsForStorageContainerResponse `xml:"urn:pbm PbmQuerySpaceStatsForStorageContainerResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *PbmQuerySpaceStatsForStorageContainerBody) Fault() *soap.Fault { return b.Fault_ } + +func PbmQuerySpaceStatsForStorageContainer(ctx context.Context, r soap.RoundTripper, req *types.PbmQuerySpaceStatsForStorageContainer) (*types.PbmQuerySpaceStatsForStorageContainerResponse, error) { + var reqBody, resBody PbmQuerySpaceStatsForStorageContainerBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type PbmResetDefaultRequirementProfileBody struct { + Req *types.PbmResetDefaultRequirementProfile `xml:"urn:pbm PbmResetDefaultRequirementProfile,omitempty"` + Res *types.PbmResetDefaultRequirementProfileResponse `xml:"urn:pbm PbmResetDefaultRequirementProfileResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *PbmResetDefaultRequirementProfileBody) Fault() *soap.Fault { return b.Fault_ } + +func PbmResetDefaultRequirementProfile(ctx context.Context, r soap.RoundTripper, req *types.PbmResetDefaultRequirementProfile) (*types.PbmResetDefaultRequirementProfileResponse, error) { + var reqBody, resBody PbmResetDefaultRequirementProfileBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type PbmResetVSanDefaultProfileBody struct { + Req *types.PbmResetVSanDefaultProfile `xml:"urn:pbm PbmResetVSanDefaultProfile,omitempty"` + Res *types.PbmResetVSanDefaultProfileResponse `xml:"urn:pbm PbmResetVSanDefaultProfileResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *PbmResetVSanDefaultProfileBody) Fault() *soap.Fault { return b.Fault_ } + +func PbmResetVSanDefaultProfile(ctx context.Context, r soap.RoundTripper, req *types.PbmResetVSanDefaultProfile) (*types.PbmResetVSanDefaultProfileResponse, error) { + var reqBody, resBody PbmResetVSanDefaultProfileBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type PbmRetrieveContentBody struct { + Req *types.PbmRetrieveContent `xml:"urn:pbm PbmRetrieveContent,omitempty"` + Res *types.PbmRetrieveContentResponse `xml:"urn:pbm PbmRetrieveContentResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *PbmRetrieveContentBody) Fault() *soap.Fault { return b.Fault_ } + +func PbmRetrieveContent(ctx context.Context, r soap.RoundTripper, req *types.PbmRetrieveContent) (*types.PbmRetrieveContentResponse, error) { + var reqBody, resBody PbmRetrieveContentBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type PbmRetrieveServiceContentBody struct { + Req *types.PbmRetrieveServiceContent `xml:"urn:pbm PbmRetrieveServiceContent,omitempty"` + Res *types.PbmRetrieveServiceContentResponse `xml:"urn:pbm PbmRetrieveServiceContentResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *PbmRetrieveServiceContentBody) Fault() *soap.Fault { return b.Fault_ } + +func PbmRetrieveServiceContent(ctx context.Context, r soap.RoundTripper, req *types.PbmRetrieveServiceContent) (*types.PbmRetrieveServiceContentResponse, error) { + var reqBody, resBody PbmRetrieveServiceContentBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type PbmUpdateBody struct { + Req *types.PbmUpdate `xml:"urn:pbm PbmUpdate,omitempty"` + Res *types.PbmUpdateResponse `xml:"urn:pbm PbmUpdateResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *PbmUpdateBody) Fault() *soap.Fault { return b.Fault_ } + +func PbmUpdate(ctx context.Context, r soap.RoundTripper, req *types.PbmUpdate) (*types.PbmUpdateResponse, error) { + var reqBody, resBody PbmUpdateBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} diff --git a/vendor/github.com/vmware/govmomi/pbm/pbm_util.go b/vendor/github.com/vmware/govmomi/pbm/pbm_util.go new file mode 100644 index 000000000..d773b8dbb --- /dev/null +++ b/vendor/github.com/vmware/govmomi/pbm/pbm_util.go @@ -0,0 +1,148 @@ +/* +Copyright (c) 2017 VMware, Inc. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package pbm + +import ( + "fmt" + "strconv" + "strings" + + "github.com/vmware/govmomi/pbm/types" +) + +// A struct to capture pbm create spec details. +type CapabilityProfileCreateSpec struct { + Name string + SubProfileName string + Description string + Category string + CapabilityList []Capability +} + +// A struct to capture pbm capability instance details. +type Capability struct { + ID string + Namespace string + PropertyList []Property +} + +// A struct to capture pbm property instance details. +type Property struct { + ID string + Operator string + Value string + DataType string +} + +func CreateCapabilityProfileSpec(pbmCreateSpec CapabilityProfileCreateSpec) (*types.PbmCapabilityProfileCreateSpec, error) { + capabilities, err := createCapabilityInstances(pbmCreateSpec.CapabilityList) + if err != nil { + return nil, err + } + + pbmCapabilityProfileSpec := types.PbmCapabilityProfileCreateSpec{ + Name: pbmCreateSpec.Name, + Description: pbmCreateSpec.Description, + Category: pbmCreateSpec.Category, + ResourceType: types.PbmProfileResourceType{ + ResourceType: string(types.PbmProfileResourceTypeEnumSTORAGE), + }, + Constraints: &types.PbmCapabilitySubProfileConstraints{ + SubProfiles: []types.PbmCapabilitySubProfile{ + types.PbmCapabilitySubProfile{ + Capability: capabilities, + Name: pbmCreateSpec.SubProfileName, + }, + }, + }, + } + return &pbmCapabilityProfileSpec, nil +} + +func createCapabilityInstances(rules []Capability) ([]types.PbmCapabilityInstance, error) { + var capabilityInstances []types.PbmCapabilityInstance + for _, capabilityRule := range rules { + capability := types.PbmCapabilityInstance{ + Id: types.PbmCapabilityMetadataUniqueId{ + Namespace: capabilityRule.Namespace, + Id: capabilityRule.ID, + }, + } + + var propertyInstances []types.PbmCapabilityPropertyInstance + for _, propertyRule := range capabilityRule.PropertyList { + property := types.PbmCapabilityPropertyInstance{ + Id: propertyRule.ID, + } + if propertyRule.Operator != "" { + property.Operator = propertyRule.Operator + } + var err error + switch strings.ToLower(propertyRule.DataType) { + case "int": + // Go int32 is marshalled to xsi:int whereas Go int is marshalled to xsi:long when sending down the wire. + var val int32 + val, err = verifyPropertyValueIsInt(propertyRule.Value, propertyRule.DataType) + property.Value = val + case "bool": + var val bool + val, err = verifyPropertyValueIsBoolean(propertyRule.Value, propertyRule.DataType) + property.Value = val + case "string": + property.Value = propertyRule.Value + case "set": + set := types.PbmCapabilityDiscreteSet{} + for _, val := range strings.Split(propertyRule.Value, ",") { + set.Values = append(set.Values, val) + } + property.Value = set + default: + return nil, fmt.Errorf("invalid value: %q with datatype: %q", propertyRule.Value, propertyRule.Value) + } + if err != nil { + return nil, fmt.Errorf("invalid value: %q with datatype: %q", propertyRule.Value, propertyRule.Value) + } + propertyInstances = append(propertyInstances, property) + } + constraintInstances := []types.PbmCapabilityConstraintInstance{ + types.PbmCapabilityConstraintInstance{ + PropertyInstance: propertyInstances, + }, + } + capability.Constraint = constraintInstances + capabilityInstances = append(capabilityInstances, capability) + } + return capabilityInstances, nil +} + +// Verify if the capability value is of type integer. +func verifyPropertyValueIsInt(propertyValue string, dataType string) (int32, error) { + val, err := strconv.ParseInt(propertyValue, 10, 32) + if err != nil { + return -1, err + } + return int32(val), nil +} + +// Verify if the capability value is of type integer. +func verifyPropertyValueIsBoolean(propertyValue string, dataType string) (bool, error) { + val, err := strconv.ParseBool(propertyValue) + if err != nil { + return false, err + } + return val, nil +} diff --git a/vendor/github.com/vmware/govmomi/pbm/types/enum.go b/vendor/github.com/vmware/govmomi/pbm/types/enum.go new file mode 100644 index 000000000..6d48bf495 --- /dev/null +++ b/vendor/github.com/vmware/govmomi/pbm/types/enum.go @@ -0,0 +1,253 @@ +/* +Copyright (c) 2014-2021 VMware, Inc. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES 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" + + "github.com/vmware/govmomi/vim25/types" +) + +type PbmAssociateAndApplyPolicyStatusPolicyStatus string + +const ( + PbmAssociateAndApplyPolicyStatusPolicyStatusSuccess = PbmAssociateAndApplyPolicyStatusPolicyStatus("success") + PbmAssociateAndApplyPolicyStatusPolicyStatusFailed = PbmAssociateAndApplyPolicyStatusPolicyStatus("failed") + PbmAssociateAndApplyPolicyStatusPolicyStatusInvalid = PbmAssociateAndApplyPolicyStatusPolicyStatus("invalid") +) + +func init() { + types.Add("pbm:PbmAssociateAndApplyPolicyStatusPolicyStatus", reflect.TypeOf((*PbmAssociateAndApplyPolicyStatusPolicyStatus)(nil)).Elem()) +} + +type PbmBuiltinGenericType string + +const ( + PbmBuiltinGenericTypeVMW_RANGE = PbmBuiltinGenericType("VMW_RANGE") + PbmBuiltinGenericTypeVMW_SET = PbmBuiltinGenericType("VMW_SET") +) + +func init() { + types.Add("pbm:PbmBuiltinGenericType", reflect.TypeOf((*PbmBuiltinGenericType)(nil)).Elem()) +} + +type PbmBuiltinType string + +const ( + PbmBuiltinTypeXSD_LONG = PbmBuiltinType("XSD_LONG") + PbmBuiltinTypeXSD_SHORT = PbmBuiltinType("XSD_SHORT") + PbmBuiltinTypeXSD_INTEGER = PbmBuiltinType("XSD_INTEGER") + PbmBuiltinTypeXSD_INT = PbmBuiltinType("XSD_INT") + PbmBuiltinTypeXSD_STRING = PbmBuiltinType("XSD_STRING") + PbmBuiltinTypeXSD_BOOLEAN = PbmBuiltinType("XSD_BOOLEAN") + PbmBuiltinTypeXSD_DOUBLE = PbmBuiltinType("XSD_DOUBLE") + PbmBuiltinTypeXSD_DATETIME = PbmBuiltinType("XSD_DATETIME") + PbmBuiltinTypeVMW_TIMESPAN = PbmBuiltinType("VMW_TIMESPAN") + PbmBuiltinTypeVMW_POLICY = PbmBuiltinType("VMW_POLICY") +) + +func init() { + types.Add("pbm:PbmBuiltinType", reflect.TypeOf((*PbmBuiltinType)(nil)).Elem()) +} + +type PbmCapabilityOperator string + +const ( + PbmCapabilityOperatorNOT = PbmCapabilityOperator("NOT") +) + +func init() { + types.Add("pbm:PbmCapabilityOperator", reflect.TypeOf((*PbmCapabilityOperator)(nil)).Elem()) +} + +type PbmCapabilityTimeUnitType string + +const ( + PbmCapabilityTimeUnitTypeSECONDS = PbmCapabilityTimeUnitType("SECONDS") + PbmCapabilityTimeUnitTypeMINUTES = PbmCapabilityTimeUnitType("MINUTES") + PbmCapabilityTimeUnitTypeHOURS = PbmCapabilityTimeUnitType("HOURS") + PbmCapabilityTimeUnitTypeDAYS = PbmCapabilityTimeUnitType("DAYS") + PbmCapabilityTimeUnitTypeWEEKS = PbmCapabilityTimeUnitType("WEEKS") + PbmCapabilityTimeUnitTypeMONTHS = PbmCapabilityTimeUnitType("MONTHS") + PbmCapabilityTimeUnitTypeYEARS = PbmCapabilityTimeUnitType("YEARS") +) + +func init() { + types.Add("pbm:PbmCapabilityTimeUnitType", reflect.TypeOf((*PbmCapabilityTimeUnitType)(nil)).Elem()) +} + +type PbmComplianceResultComplianceTaskStatus string + +const ( + PbmComplianceResultComplianceTaskStatusInProgress = PbmComplianceResultComplianceTaskStatus("inProgress") + PbmComplianceResultComplianceTaskStatusSuccess = PbmComplianceResultComplianceTaskStatus("success") + PbmComplianceResultComplianceTaskStatusFailed = PbmComplianceResultComplianceTaskStatus("failed") +) + +func init() { + types.Add("pbm:PbmComplianceResultComplianceTaskStatus", reflect.TypeOf((*PbmComplianceResultComplianceTaskStatus)(nil)).Elem()) +} + +type PbmComplianceStatus string + +const ( + PbmComplianceStatusCompliant = PbmComplianceStatus("compliant") + PbmComplianceStatusNonCompliant = PbmComplianceStatus("nonCompliant") + PbmComplianceStatusUnknown = PbmComplianceStatus("unknown") + PbmComplianceStatusNotApplicable = PbmComplianceStatus("notApplicable") + PbmComplianceStatusOutOfDate = PbmComplianceStatus("outOfDate") +) + +func init() { + types.Add("pbm:PbmComplianceStatus", reflect.TypeOf((*PbmComplianceStatus)(nil)).Elem()) +} + +type PbmHealthStatusForEntity string + +const ( + PbmHealthStatusForEntityRed = PbmHealthStatusForEntity("red") + PbmHealthStatusForEntityYellow = PbmHealthStatusForEntity("yellow") + PbmHealthStatusForEntityGreen = PbmHealthStatusForEntity("green") + PbmHealthStatusForEntityUnknown = PbmHealthStatusForEntity("unknown") +) + +func init() { + types.Add("pbm:PbmHealthStatusForEntity", reflect.TypeOf((*PbmHealthStatusForEntity)(nil)).Elem()) +} + +type PbmIofilterInfoFilterType string + +const ( + PbmIofilterInfoFilterTypeINSPECTION = PbmIofilterInfoFilterType("INSPECTION") + PbmIofilterInfoFilterTypeCOMPRESSION = PbmIofilterInfoFilterType("COMPRESSION") + PbmIofilterInfoFilterTypeENCRYPTION = PbmIofilterInfoFilterType("ENCRYPTION") + PbmIofilterInfoFilterTypeREPLICATION = PbmIofilterInfoFilterType("REPLICATION") + PbmIofilterInfoFilterTypeCACHE = PbmIofilterInfoFilterType("CACHE") + PbmIofilterInfoFilterTypeDATAPROVIDER = PbmIofilterInfoFilterType("DATAPROVIDER") + PbmIofilterInfoFilterTypeDATASTOREIOCONTROL = PbmIofilterInfoFilterType("DATASTOREIOCONTROL") +) + +func init() { + types.Add("pbm:PbmIofilterInfoFilterType", reflect.TypeOf((*PbmIofilterInfoFilterType)(nil)).Elem()) +} + +type PbmLineOfServiceInfoLineOfServiceEnum string + +const ( + PbmLineOfServiceInfoLineOfServiceEnumINSPECTION = PbmLineOfServiceInfoLineOfServiceEnum("INSPECTION") + PbmLineOfServiceInfoLineOfServiceEnumCOMPRESSION = PbmLineOfServiceInfoLineOfServiceEnum("COMPRESSION") + PbmLineOfServiceInfoLineOfServiceEnumENCRYPTION = PbmLineOfServiceInfoLineOfServiceEnum("ENCRYPTION") + PbmLineOfServiceInfoLineOfServiceEnumREPLICATION = PbmLineOfServiceInfoLineOfServiceEnum("REPLICATION") + PbmLineOfServiceInfoLineOfServiceEnumCACHING = PbmLineOfServiceInfoLineOfServiceEnum("CACHING") + PbmLineOfServiceInfoLineOfServiceEnumPERSISTENCE = PbmLineOfServiceInfoLineOfServiceEnum("PERSISTENCE") + PbmLineOfServiceInfoLineOfServiceEnumDATA_PROVIDER = PbmLineOfServiceInfoLineOfServiceEnum("DATA_PROVIDER") + PbmLineOfServiceInfoLineOfServiceEnumDATASTORE_IO_CONTROL = PbmLineOfServiceInfoLineOfServiceEnum("DATASTORE_IO_CONTROL") + PbmLineOfServiceInfoLineOfServiceEnumDATA_PROTECTION = PbmLineOfServiceInfoLineOfServiceEnum("DATA_PROTECTION") +) + +func init() { + types.Add("pbm:PbmLineOfServiceInfoLineOfServiceEnum", reflect.TypeOf((*PbmLineOfServiceInfoLineOfServiceEnum)(nil)).Elem()) +} + +type PbmObjectType string + +const ( + PbmObjectTypeVirtualMachine = PbmObjectType("virtualMachine") + PbmObjectTypeVirtualMachineAndDisks = PbmObjectType("virtualMachineAndDisks") + PbmObjectTypeVirtualDiskId = PbmObjectType("virtualDiskId") + PbmObjectTypeVirtualDiskUUID = PbmObjectType("virtualDiskUUID") + PbmObjectTypeDatastore = PbmObjectType("datastore") + PbmObjectTypeFileShareId = PbmObjectType("fileShareId") + PbmObjectTypeUnknown = PbmObjectType("unknown") +) + +func init() { + types.Add("pbm:PbmObjectType", reflect.TypeOf((*PbmObjectType)(nil)).Elem()) +} + +type PbmOperation string + +const ( + PbmOperationCREATE = PbmOperation("CREATE") + PbmOperationREGISTER = PbmOperation("REGISTER") + PbmOperationRECONFIGURE = PbmOperation("RECONFIGURE") + PbmOperationMIGRATE = PbmOperation("MIGRATE") + PbmOperationCLONE = PbmOperation("CLONE") +) + +func init() { + types.Add("pbm:PbmOperation", reflect.TypeOf((*PbmOperation)(nil)).Elem()) +} + +type PbmProfileCategoryEnum string + +const ( + PbmProfileCategoryEnumREQUIREMENT = PbmProfileCategoryEnum("REQUIREMENT") + PbmProfileCategoryEnumRESOURCE = PbmProfileCategoryEnum("RESOURCE") + PbmProfileCategoryEnumDATA_SERVICE_POLICY = PbmProfileCategoryEnum("DATA_SERVICE_POLICY") +) + +func init() { + types.Add("pbm:PbmProfileCategoryEnum", reflect.TypeOf((*PbmProfileCategoryEnum)(nil)).Elem()) +} + +type PbmProfileResourceTypeEnum string + +const ( + PbmProfileResourceTypeEnumSTORAGE = PbmProfileResourceTypeEnum("STORAGE") +) + +func init() { + types.Add("pbm:PbmProfileResourceTypeEnum", reflect.TypeOf((*PbmProfileResourceTypeEnum)(nil)).Elem()) +} + +type PbmSystemCreatedProfileType string + +const ( + PbmSystemCreatedProfileTypeVsanDefaultProfile = PbmSystemCreatedProfileType("VsanDefaultProfile") + PbmSystemCreatedProfileTypeVVolDefaultProfile = PbmSystemCreatedProfileType("VVolDefaultProfile") + PbmSystemCreatedProfileTypePmemDefaultProfile = PbmSystemCreatedProfileType("PmemDefaultProfile") +) + +func init() { + types.Add("pbm:PbmSystemCreatedProfileType", reflect.TypeOf((*PbmSystemCreatedProfileType)(nil)).Elem()) +} + +type PbmVmOperation string + +const ( + PbmVmOperationCREATE = PbmVmOperation("CREATE") + PbmVmOperationRECONFIGURE = PbmVmOperation("RECONFIGURE") + PbmVmOperationMIGRATE = PbmVmOperation("MIGRATE") + PbmVmOperationCLONE = PbmVmOperation("CLONE") +) + +func init() { + types.Add("pbm:PbmVmOperation", reflect.TypeOf((*PbmVmOperation)(nil)).Elem()) +} + +type PbmVvolType string + +const ( + PbmVvolTypeConfig = PbmVvolType("Config") + PbmVvolTypeData = PbmVvolType("Data") + PbmVvolTypeSwap = PbmVvolType("Swap") +) + +func init() { + types.Add("pbm:PbmVvolType", reflect.TypeOf((*PbmVvolType)(nil)).Elem()) +} diff --git a/vendor/github.com/vmware/govmomi/pbm/types/if.go b/vendor/github.com/vmware/govmomi/pbm/types/if.go new file mode 100644 index 000000000..0cc311acb --- /dev/null +++ b/vendor/github.com/vmware/govmomi/pbm/types/if.go @@ -0,0 +1,139 @@ +/* +Copyright (c) 2014-2021 VMware, Inc. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES 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" + + "github.com/vmware/govmomi/vim25/types" +) + +func (b *PbmCapabilityConstraints) GetPbmCapabilityConstraints() *PbmCapabilityConstraints { return b } + +type BasePbmCapabilityConstraints interface { + GetPbmCapabilityConstraints() *PbmCapabilityConstraints +} + +func init() { + types.Add("BasePbmCapabilityConstraints", reflect.TypeOf((*PbmCapabilityConstraints)(nil)).Elem()) +} + +func (b *PbmCapabilityProfile) GetPbmCapabilityProfile() *PbmCapabilityProfile { return b } + +type BasePbmCapabilityProfile interface { + GetPbmCapabilityProfile() *PbmCapabilityProfile +} + +func init() { + types.Add("BasePbmCapabilityProfile", reflect.TypeOf((*PbmCapabilityProfile)(nil)).Elem()) +} + +func (b *PbmCapabilityProfilePropertyMismatchFault) GetPbmCapabilityProfilePropertyMismatchFault() *PbmCapabilityProfilePropertyMismatchFault { + return b +} + +type BasePbmCapabilityProfilePropertyMismatchFault interface { + GetPbmCapabilityProfilePropertyMismatchFault() *PbmCapabilityProfilePropertyMismatchFault +} + +func init() { + types.Add("BasePbmCapabilityProfilePropertyMismatchFault", reflect.TypeOf((*PbmCapabilityProfilePropertyMismatchFault)(nil)).Elem()) +} + +func (b *PbmCapabilityTypeInfo) GetPbmCapabilityTypeInfo() *PbmCapabilityTypeInfo { return b } + +type BasePbmCapabilityTypeInfo interface { + GetPbmCapabilityTypeInfo() *PbmCapabilityTypeInfo +} + +func init() { + types.Add("BasePbmCapabilityTypeInfo", reflect.TypeOf((*PbmCapabilityTypeInfo)(nil)).Elem()) +} + +func (b *PbmCompatibilityCheckFault) GetPbmCompatibilityCheckFault() *PbmCompatibilityCheckFault { + return b +} + +type BasePbmCompatibilityCheckFault interface { + GetPbmCompatibilityCheckFault() *PbmCompatibilityCheckFault +} + +func init() { + types.Add("BasePbmCompatibilityCheckFault", reflect.TypeOf((*PbmCompatibilityCheckFault)(nil)).Elem()) +} + +func (b *PbmFault) GetPbmFault() *PbmFault { return b } + +type BasePbmFault interface { + GetPbmFault() *PbmFault +} + +func init() { + types.Add("BasePbmFault", reflect.TypeOf((*PbmFault)(nil)).Elem()) +} + +func (b *PbmLineOfServiceInfo) GetPbmLineOfServiceInfo() *PbmLineOfServiceInfo { return b } + +type BasePbmLineOfServiceInfo interface { + GetPbmLineOfServiceInfo() *PbmLineOfServiceInfo +} + +func init() { + types.Add("BasePbmLineOfServiceInfo", reflect.TypeOf((*PbmLineOfServiceInfo)(nil)).Elem()) +} + +func (b *PbmPlacementMatchingResources) GetPbmPlacementMatchingResources() *PbmPlacementMatchingResources { + return b +} + +type BasePbmPlacementMatchingResources interface { + GetPbmPlacementMatchingResources() *PbmPlacementMatchingResources +} + +func init() { + types.Add("BasePbmPlacementMatchingResources", reflect.TypeOf((*PbmPlacementMatchingResources)(nil)).Elem()) +} + +func (b *PbmPlacementRequirement) GetPbmPlacementRequirement() *PbmPlacementRequirement { return b } + +type BasePbmPlacementRequirement interface { + GetPbmPlacementRequirement() *PbmPlacementRequirement +} + +func init() { + types.Add("BasePbmPlacementRequirement", reflect.TypeOf((*PbmPlacementRequirement)(nil)).Elem()) +} + +func (b *PbmProfile) GetPbmProfile() *PbmProfile { return b } + +type BasePbmProfile interface { + GetPbmProfile() *PbmProfile +} + +func init() { + types.Add("BasePbmProfile", reflect.TypeOf((*PbmProfile)(nil)).Elem()) +} + +func (b *PbmPropertyMismatchFault) GetPbmPropertyMismatchFault() *PbmPropertyMismatchFault { return b } + +type BasePbmPropertyMismatchFault interface { + GetPbmPropertyMismatchFault() *PbmPropertyMismatchFault +} + +func init() { + types.Add("BasePbmPropertyMismatchFault", reflect.TypeOf((*PbmPropertyMismatchFault)(nil)).Elem()) +} diff --git a/vendor/github.com/vmware/govmomi/pbm/types/types.go b/vendor/github.com/vmware/govmomi/pbm/types/types.go new file mode 100644 index 000000000..819417392 --- /dev/null +++ b/vendor/github.com/vmware/govmomi/pbm/types/types.go @@ -0,0 +1,1724 @@ +/* +Copyright (c) 2014-2021 VMware, Inc. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES 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" + + "github.com/vmware/govmomi/vim25/types" +) + +type ArrayOfPbmCapabilityConstraintInstance struct { + PbmCapabilityConstraintInstance []PbmCapabilityConstraintInstance `xml:"PbmCapabilityConstraintInstance,omitempty"` +} + +func init() { + types.Add("pbm:ArrayOfPbmCapabilityConstraintInstance", reflect.TypeOf((*ArrayOfPbmCapabilityConstraintInstance)(nil)).Elem()) +} + +type ArrayOfPbmCapabilityInstance struct { + PbmCapabilityInstance []PbmCapabilityInstance `xml:"PbmCapabilityInstance,omitempty"` +} + +func init() { + types.Add("pbm:ArrayOfPbmCapabilityInstance", reflect.TypeOf((*ArrayOfPbmCapabilityInstance)(nil)).Elem()) +} + +type ArrayOfPbmCapabilityMetadata struct { + PbmCapabilityMetadata []PbmCapabilityMetadata `xml:"PbmCapabilityMetadata,omitempty"` +} + +func init() { + types.Add("pbm:ArrayOfPbmCapabilityMetadata", reflect.TypeOf((*ArrayOfPbmCapabilityMetadata)(nil)).Elem()) +} + +type ArrayOfPbmCapabilityMetadataPerCategory struct { + PbmCapabilityMetadataPerCategory []PbmCapabilityMetadataPerCategory `xml:"PbmCapabilityMetadataPerCategory,omitempty"` +} + +func init() { + types.Add("pbm:ArrayOfPbmCapabilityMetadataPerCategory", reflect.TypeOf((*ArrayOfPbmCapabilityMetadataPerCategory)(nil)).Elem()) +} + +type ArrayOfPbmCapabilityPropertyInstance struct { + PbmCapabilityPropertyInstance []PbmCapabilityPropertyInstance `xml:"PbmCapabilityPropertyInstance,omitempty"` +} + +func init() { + types.Add("pbm:ArrayOfPbmCapabilityPropertyInstance", reflect.TypeOf((*ArrayOfPbmCapabilityPropertyInstance)(nil)).Elem()) +} + +type ArrayOfPbmCapabilityPropertyMetadata struct { + PbmCapabilityPropertyMetadata []PbmCapabilityPropertyMetadata `xml:"PbmCapabilityPropertyMetadata,omitempty"` +} + +func init() { + types.Add("pbm:ArrayOfPbmCapabilityPropertyMetadata", reflect.TypeOf((*ArrayOfPbmCapabilityPropertyMetadata)(nil)).Elem()) +} + +type ArrayOfPbmCapabilitySchema struct { + PbmCapabilitySchema []PbmCapabilitySchema `xml:"PbmCapabilitySchema,omitempty"` +} + +func init() { + types.Add("pbm:ArrayOfPbmCapabilitySchema", reflect.TypeOf((*ArrayOfPbmCapabilitySchema)(nil)).Elem()) +} + +type ArrayOfPbmCapabilitySubProfile struct { + PbmCapabilitySubProfile []PbmCapabilitySubProfile `xml:"PbmCapabilitySubProfile,omitempty"` +} + +func init() { + types.Add("pbm:ArrayOfPbmCapabilitySubProfile", reflect.TypeOf((*ArrayOfPbmCapabilitySubProfile)(nil)).Elem()) +} + +type ArrayOfPbmCapabilityVendorNamespaceInfo struct { + PbmCapabilityVendorNamespaceInfo []PbmCapabilityVendorNamespaceInfo `xml:"PbmCapabilityVendorNamespaceInfo,omitempty"` +} + +func init() { + types.Add("pbm:ArrayOfPbmCapabilityVendorNamespaceInfo", reflect.TypeOf((*ArrayOfPbmCapabilityVendorNamespaceInfo)(nil)).Elem()) +} + +type ArrayOfPbmCapabilityVendorResourceTypeInfo struct { + PbmCapabilityVendorResourceTypeInfo []PbmCapabilityVendorResourceTypeInfo `xml:"PbmCapabilityVendorResourceTypeInfo,omitempty"` +} + +func init() { + types.Add("pbm:ArrayOfPbmCapabilityVendorResourceTypeInfo", reflect.TypeOf((*ArrayOfPbmCapabilityVendorResourceTypeInfo)(nil)).Elem()) +} + +type ArrayOfPbmCompliancePolicyStatus struct { + PbmCompliancePolicyStatus []PbmCompliancePolicyStatus `xml:"PbmCompliancePolicyStatus,omitempty"` +} + +func init() { + types.Add("pbm:ArrayOfPbmCompliancePolicyStatus", reflect.TypeOf((*ArrayOfPbmCompliancePolicyStatus)(nil)).Elem()) +} + +type ArrayOfPbmComplianceResult struct { + PbmComplianceResult []PbmComplianceResult `xml:"PbmComplianceResult,omitempty"` +} + +func init() { + types.Add("pbm:ArrayOfPbmComplianceResult", reflect.TypeOf((*ArrayOfPbmComplianceResult)(nil)).Elem()) +} + +type ArrayOfPbmDatastoreSpaceStatistics struct { + PbmDatastoreSpaceStatistics []PbmDatastoreSpaceStatistics `xml:"PbmDatastoreSpaceStatistics,omitempty"` +} + +func init() { + types.Add("pbm:ArrayOfPbmDatastoreSpaceStatistics", reflect.TypeOf((*ArrayOfPbmDatastoreSpaceStatistics)(nil)).Elem()) +} + +type ArrayOfPbmDefaultProfileInfo struct { + PbmDefaultProfileInfo []PbmDefaultProfileInfo `xml:"PbmDefaultProfileInfo,omitempty"` +} + +func init() { + types.Add("pbm:ArrayOfPbmDefaultProfileInfo", reflect.TypeOf((*ArrayOfPbmDefaultProfileInfo)(nil)).Elem()) +} + +type ArrayOfPbmPlacementCompatibilityResult struct { + PbmPlacementCompatibilityResult []PbmPlacementCompatibilityResult `xml:"PbmPlacementCompatibilityResult,omitempty"` +} + +func init() { + types.Add("pbm:ArrayOfPbmPlacementCompatibilityResult", reflect.TypeOf((*ArrayOfPbmPlacementCompatibilityResult)(nil)).Elem()) +} + +type ArrayOfPbmPlacementHub struct { + PbmPlacementHub []PbmPlacementHub `xml:"PbmPlacementHub,omitempty"` +} + +func init() { + types.Add("pbm:ArrayOfPbmPlacementHub", reflect.TypeOf((*ArrayOfPbmPlacementHub)(nil)).Elem()) +} + +type ArrayOfPbmPlacementMatchingResources struct { + PbmPlacementMatchingResources []BasePbmPlacementMatchingResources `xml:"PbmPlacementMatchingResources,omitempty,typeattr"` +} + +func init() { + types.Add("pbm:ArrayOfPbmPlacementMatchingResources", reflect.TypeOf((*ArrayOfPbmPlacementMatchingResources)(nil)).Elem()) +} + +type ArrayOfPbmPlacementRequirement struct { + PbmPlacementRequirement []BasePbmPlacementRequirement `xml:"PbmPlacementRequirement,omitempty,typeattr"` +} + +func init() { + types.Add("pbm:ArrayOfPbmPlacementRequirement", reflect.TypeOf((*ArrayOfPbmPlacementRequirement)(nil)).Elem()) +} + +type ArrayOfPbmPlacementResourceUtilization struct { + PbmPlacementResourceUtilization []PbmPlacementResourceUtilization `xml:"PbmPlacementResourceUtilization,omitempty"` +} + +func init() { + types.Add("pbm:ArrayOfPbmPlacementResourceUtilization", reflect.TypeOf((*ArrayOfPbmPlacementResourceUtilization)(nil)).Elem()) +} + +type ArrayOfPbmProfile struct { + PbmProfile []BasePbmProfile `xml:"PbmProfile,omitempty,typeattr"` +} + +func init() { + types.Add("pbm:ArrayOfPbmProfile", reflect.TypeOf((*ArrayOfPbmProfile)(nil)).Elem()) +} + +type ArrayOfPbmProfileId struct { + PbmProfileId []PbmProfileId `xml:"PbmProfileId,omitempty"` +} + +func init() { + types.Add("pbm:ArrayOfPbmProfileId", reflect.TypeOf((*ArrayOfPbmProfileId)(nil)).Elem()) +} + +type ArrayOfPbmProfileOperationOutcome struct { + PbmProfileOperationOutcome []PbmProfileOperationOutcome `xml:"PbmProfileOperationOutcome,omitempty"` +} + +func init() { + types.Add("pbm:ArrayOfPbmProfileOperationOutcome", reflect.TypeOf((*ArrayOfPbmProfileOperationOutcome)(nil)).Elem()) +} + +type ArrayOfPbmProfileResourceType struct { + PbmProfileResourceType []PbmProfileResourceType `xml:"PbmProfileResourceType,omitempty"` +} + +func init() { + types.Add("pbm:ArrayOfPbmProfileResourceType", reflect.TypeOf((*ArrayOfPbmProfileResourceType)(nil)).Elem()) +} + +type ArrayOfPbmProfileType struct { + PbmProfileType []PbmProfileType `xml:"PbmProfileType,omitempty"` +} + +func init() { + types.Add("pbm:ArrayOfPbmProfileType", reflect.TypeOf((*ArrayOfPbmProfileType)(nil)).Elem()) +} + +type ArrayOfPbmQueryProfileResult struct { + PbmQueryProfileResult []PbmQueryProfileResult `xml:"PbmQueryProfileResult,omitempty"` +} + +func init() { + types.Add("pbm:ArrayOfPbmQueryProfileResult", reflect.TypeOf((*ArrayOfPbmQueryProfileResult)(nil)).Elem()) +} + +type ArrayOfPbmQueryReplicationGroupResult struct { + PbmQueryReplicationGroupResult []PbmQueryReplicationGroupResult `xml:"PbmQueryReplicationGroupResult,omitempty"` +} + +func init() { + types.Add("pbm:ArrayOfPbmQueryReplicationGroupResult", reflect.TypeOf((*ArrayOfPbmQueryReplicationGroupResult)(nil)).Elem()) +} + +type ArrayOfPbmRollupComplianceResult struct { + PbmRollupComplianceResult []PbmRollupComplianceResult `xml:"PbmRollupComplianceResult,omitempty"` +} + +func init() { + types.Add("pbm:ArrayOfPbmRollupComplianceResult", reflect.TypeOf((*ArrayOfPbmRollupComplianceResult)(nil)).Elem()) +} + +type ArrayOfPbmServerObjectRef struct { + PbmServerObjectRef []PbmServerObjectRef `xml:"PbmServerObjectRef,omitempty"` +} + +func init() { + types.Add("pbm:ArrayOfPbmServerObjectRef", reflect.TypeOf((*ArrayOfPbmServerObjectRef)(nil)).Elem()) +} + +type PbmAboutInfo struct { + types.DynamicData + + Name string `xml:"name"` + Version string `xml:"version"` + InstanceUuid string `xml:"instanceUuid"` +} + +func init() { + types.Add("pbm:PbmAboutInfo", reflect.TypeOf((*PbmAboutInfo)(nil)).Elem()) +} + +type PbmAlreadyExists struct { + PbmFault + + Name string `xml:"name,omitempty"` +} + +func init() { + types.Add("pbm:PbmAlreadyExists", reflect.TypeOf((*PbmAlreadyExists)(nil)).Elem()) +} + +type PbmAlreadyExistsFault PbmAlreadyExists + +func init() { + types.Add("pbm:PbmAlreadyExistsFault", reflect.TypeOf((*PbmAlreadyExistsFault)(nil)).Elem()) +} + +type PbmAssignDefaultRequirementProfile PbmAssignDefaultRequirementProfileRequestType + +func init() { + types.Add("pbm:PbmAssignDefaultRequirementProfile", reflect.TypeOf((*PbmAssignDefaultRequirementProfile)(nil)).Elem()) +} + +type PbmAssignDefaultRequirementProfileRequestType struct { + This types.ManagedObjectReference `xml:"_this"` + Profile PbmProfileId `xml:"profile"` + Datastores []PbmPlacementHub `xml:"datastores"` +} + +func init() { + types.Add("pbm:PbmAssignDefaultRequirementProfileRequestType", reflect.TypeOf((*PbmAssignDefaultRequirementProfileRequestType)(nil)).Elem()) +} + +type PbmAssignDefaultRequirementProfileResponse struct { +} + +type PbmCapabilityConstraintInstance struct { + types.DynamicData + + PropertyInstance []PbmCapabilityPropertyInstance `xml:"propertyInstance"` +} + +func init() { + types.Add("pbm:PbmCapabilityConstraintInstance", reflect.TypeOf((*PbmCapabilityConstraintInstance)(nil)).Elem()) +} + +type PbmCapabilityConstraints struct { + types.DynamicData +} + +func init() { + types.Add("pbm:PbmCapabilityConstraints", reflect.TypeOf((*PbmCapabilityConstraints)(nil)).Elem()) +} + +type PbmCapabilityDescription struct { + types.DynamicData + + Description PbmExtendedElementDescription `xml:"description"` + Value types.AnyType `xml:"value,typeattr"` +} + +func init() { + types.Add("pbm:PbmCapabilityDescription", reflect.TypeOf((*PbmCapabilityDescription)(nil)).Elem()) +} + +type PbmCapabilityDiscreteSet struct { + types.DynamicData + + Values []types.AnyType `xml:"values,typeattr"` +} + +func init() { + types.Add("pbm:PbmCapabilityDiscreteSet", reflect.TypeOf((*PbmCapabilityDiscreteSet)(nil)).Elem()) +} + +type PbmCapabilityGenericTypeInfo struct { + PbmCapabilityTypeInfo + + GenericTypeName string `xml:"genericTypeName"` +} + +func init() { + types.Add("pbm:PbmCapabilityGenericTypeInfo", reflect.TypeOf((*PbmCapabilityGenericTypeInfo)(nil)).Elem()) +} + +type PbmCapabilityInstance struct { + types.DynamicData + + Id PbmCapabilityMetadataUniqueId `xml:"id"` + Constraint []PbmCapabilityConstraintInstance `xml:"constraint"` +} + +func init() { + types.Add("pbm:PbmCapabilityInstance", reflect.TypeOf((*PbmCapabilityInstance)(nil)).Elem()) +} + +type PbmCapabilityMetadata struct { + types.DynamicData + + Id PbmCapabilityMetadataUniqueId `xml:"id"` + Summary PbmExtendedElementDescription `xml:"summary"` + Mandatory *bool `xml:"mandatory"` + Hint *bool `xml:"hint"` + KeyId string `xml:"keyId,omitempty"` + AllowMultipleConstraints *bool `xml:"allowMultipleConstraints"` + PropertyMetadata []PbmCapabilityPropertyMetadata `xml:"propertyMetadata"` +} + +func init() { + types.Add("pbm:PbmCapabilityMetadata", reflect.TypeOf((*PbmCapabilityMetadata)(nil)).Elem()) +} + +type PbmCapabilityMetadataPerCategory struct { + types.DynamicData + + SubCategory string `xml:"subCategory"` + CapabilityMetadata []PbmCapabilityMetadata `xml:"capabilityMetadata"` +} + +func init() { + types.Add("pbm:PbmCapabilityMetadataPerCategory", reflect.TypeOf((*PbmCapabilityMetadataPerCategory)(nil)).Elem()) +} + +type PbmCapabilityMetadataUniqueId struct { + types.DynamicData + + Namespace string `xml:"namespace"` + Id string `xml:"id"` +} + +func init() { + types.Add("pbm:PbmCapabilityMetadataUniqueId", reflect.TypeOf((*PbmCapabilityMetadataUniqueId)(nil)).Elem()) +} + +type PbmCapabilityNamespaceInfo struct { + types.DynamicData + + Version string `xml:"version"` + Namespace string `xml:"namespace"` + Info *PbmExtendedElementDescription `xml:"info,omitempty"` +} + +func init() { + types.Add("pbm:PbmCapabilityNamespaceInfo", reflect.TypeOf((*PbmCapabilityNamespaceInfo)(nil)).Elem()) +} + +type PbmCapabilityProfile struct { + PbmProfile + + ProfileCategory string `xml:"profileCategory"` + ResourceType PbmProfileResourceType `xml:"resourceType"` + Constraints BasePbmCapabilityConstraints `xml:"constraints,typeattr"` + GenerationId int64 `xml:"generationId,omitempty"` + IsDefault bool `xml:"isDefault"` + SystemCreatedProfileType string `xml:"systemCreatedProfileType,omitempty"` + LineOfService string `xml:"lineOfService,omitempty"` +} + +func init() { + types.Add("pbm:PbmCapabilityProfile", reflect.TypeOf((*PbmCapabilityProfile)(nil)).Elem()) +} + +type PbmCapabilityProfileCreateSpec struct { + types.DynamicData + + Name string `xml:"name"` + Description string `xml:"description,omitempty"` + Category string `xml:"category,omitempty"` + ResourceType PbmProfileResourceType `xml:"resourceType"` + Constraints BasePbmCapabilityConstraints `xml:"constraints,typeattr"` +} + +func init() { + types.Add("pbm:PbmCapabilityProfileCreateSpec", reflect.TypeOf((*PbmCapabilityProfileCreateSpec)(nil)).Elem()) +} + +type PbmCapabilityProfilePropertyMismatchFault struct { + PbmPropertyMismatchFault + + ResourcePropertyInstance PbmCapabilityPropertyInstance `xml:"resourcePropertyInstance"` +} + +func init() { + types.Add("pbm:PbmCapabilityProfilePropertyMismatchFault", reflect.TypeOf((*PbmCapabilityProfilePropertyMismatchFault)(nil)).Elem()) +} + +type PbmCapabilityProfilePropertyMismatchFaultFault BasePbmCapabilityProfilePropertyMismatchFault + +func init() { + types.Add("pbm:PbmCapabilityProfilePropertyMismatchFaultFault", reflect.TypeOf((*PbmCapabilityProfilePropertyMismatchFaultFault)(nil)).Elem()) +} + +type PbmCapabilityProfileUpdateSpec struct { + types.DynamicData + + Name string `xml:"name,omitempty"` + Description string `xml:"description,omitempty"` + Constraints BasePbmCapabilityConstraints `xml:"constraints,omitempty,typeattr"` +} + +func init() { + types.Add("pbm:PbmCapabilityProfileUpdateSpec", reflect.TypeOf((*PbmCapabilityProfileUpdateSpec)(nil)).Elem()) +} + +type PbmCapabilityPropertyInstance struct { + types.DynamicData + + Id string `xml:"id"` + Operator string `xml:"operator,omitempty"` + Value types.AnyType `xml:"value,typeattr"` +} + +func init() { + types.Add("pbm:PbmCapabilityPropertyInstance", reflect.TypeOf((*PbmCapabilityPropertyInstance)(nil)).Elem()) +} + +type PbmCapabilityPropertyMetadata struct { + types.DynamicData + + Id string `xml:"id"` + Summary PbmExtendedElementDescription `xml:"summary"` + Mandatory bool `xml:"mandatory"` + Type BasePbmCapabilityTypeInfo `xml:"type,omitempty,typeattr"` + DefaultValue types.AnyType `xml:"defaultValue,omitempty,typeattr"` + AllowedValue types.AnyType `xml:"allowedValue,omitempty,typeattr"` + RequirementsTypeHint string `xml:"requirementsTypeHint,omitempty"` +} + +func init() { + types.Add("pbm:PbmCapabilityPropertyMetadata", reflect.TypeOf((*PbmCapabilityPropertyMetadata)(nil)).Elem()) +} + +type PbmCapabilityRange struct { + types.DynamicData + + Min types.AnyType `xml:"min,typeattr"` + Max types.AnyType `xml:"max,typeattr"` +} + +func init() { + types.Add("pbm:PbmCapabilityRange", reflect.TypeOf((*PbmCapabilityRange)(nil)).Elem()) +} + +type PbmCapabilitySchema struct { + types.DynamicData + + VendorInfo PbmCapabilitySchemaVendorInfo `xml:"vendorInfo"` + NamespaceInfo PbmCapabilityNamespaceInfo `xml:"namespaceInfo"` + LineOfService BasePbmLineOfServiceInfo `xml:"lineOfService,omitempty,typeattr"` + CapabilityMetadataPerCategory []PbmCapabilityMetadataPerCategory `xml:"capabilityMetadataPerCategory"` +} + +func init() { + types.Add("pbm:PbmCapabilitySchema", reflect.TypeOf((*PbmCapabilitySchema)(nil)).Elem()) +} + +type PbmCapabilitySchemaVendorInfo struct { + types.DynamicData + + VendorUuid string `xml:"vendorUuid"` + Info PbmExtendedElementDescription `xml:"info"` +} + +func init() { + types.Add("pbm:PbmCapabilitySchemaVendorInfo", reflect.TypeOf((*PbmCapabilitySchemaVendorInfo)(nil)).Elem()) +} + +type PbmCapabilitySubProfile struct { + types.DynamicData + + Name string `xml:"name"` + Capability []PbmCapabilityInstance `xml:"capability"` + ForceProvision *bool `xml:"forceProvision"` +} + +func init() { + types.Add("pbm:PbmCapabilitySubProfile", reflect.TypeOf((*PbmCapabilitySubProfile)(nil)).Elem()) +} + +type PbmCapabilitySubProfileConstraints struct { + PbmCapabilityConstraints + + SubProfiles []PbmCapabilitySubProfile `xml:"subProfiles"` +} + +func init() { + types.Add("pbm:PbmCapabilitySubProfileConstraints", reflect.TypeOf((*PbmCapabilitySubProfileConstraints)(nil)).Elem()) +} + +type PbmCapabilityTimeSpan struct { + types.DynamicData + + Value int32 `xml:"value"` + Unit string `xml:"unit"` +} + +func init() { + types.Add("pbm:PbmCapabilityTimeSpan", reflect.TypeOf((*PbmCapabilityTimeSpan)(nil)).Elem()) +} + +type PbmCapabilityTypeInfo struct { + types.DynamicData + + TypeName string `xml:"typeName"` +} + +func init() { + types.Add("pbm:PbmCapabilityTypeInfo", reflect.TypeOf((*PbmCapabilityTypeInfo)(nil)).Elem()) +} + +type PbmCapabilityVendorNamespaceInfo struct { + types.DynamicData + + VendorInfo PbmCapabilitySchemaVendorInfo `xml:"vendorInfo"` + NamespaceInfo PbmCapabilityNamespaceInfo `xml:"namespaceInfo"` +} + +func init() { + types.Add("pbm:PbmCapabilityVendorNamespaceInfo", reflect.TypeOf((*PbmCapabilityVendorNamespaceInfo)(nil)).Elem()) +} + +type PbmCapabilityVendorResourceTypeInfo struct { + types.DynamicData + + ResourceType string `xml:"resourceType"` + VendorNamespaceInfo []PbmCapabilityVendorNamespaceInfo `xml:"vendorNamespaceInfo"` +} + +func init() { + types.Add("pbm:PbmCapabilityVendorResourceTypeInfo", reflect.TypeOf((*PbmCapabilityVendorResourceTypeInfo)(nil)).Elem()) +} + +type PbmCheckCompatibility PbmCheckCompatibilityRequestType + +func init() { + types.Add("pbm:PbmCheckCompatibility", reflect.TypeOf((*PbmCheckCompatibility)(nil)).Elem()) +} + +type PbmCheckCompatibilityRequestType struct { + This types.ManagedObjectReference `xml:"_this"` + HubsToSearch []PbmPlacementHub `xml:"hubsToSearch,omitempty"` + Profile PbmProfileId `xml:"profile"` +} + +func init() { + types.Add("pbm:PbmCheckCompatibilityRequestType", reflect.TypeOf((*PbmCheckCompatibilityRequestType)(nil)).Elem()) +} + +type PbmCheckCompatibilityResponse struct { + Returnval []PbmPlacementCompatibilityResult `xml:"returnval,omitempty"` +} + +type PbmCheckCompatibilityWithSpec PbmCheckCompatibilityWithSpecRequestType + +func init() { + types.Add("pbm:PbmCheckCompatibilityWithSpec", reflect.TypeOf((*PbmCheckCompatibilityWithSpec)(nil)).Elem()) +} + +type PbmCheckCompatibilityWithSpecRequestType struct { + This types.ManagedObjectReference `xml:"_this"` + HubsToSearch []PbmPlacementHub `xml:"hubsToSearch,omitempty"` + ProfileSpec PbmCapabilityProfileCreateSpec `xml:"profileSpec"` +} + +func init() { + types.Add("pbm:PbmCheckCompatibilityWithSpecRequestType", reflect.TypeOf((*PbmCheckCompatibilityWithSpecRequestType)(nil)).Elem()) +} + +type PbmCheckCompatibilityWithSpecResponse struct { + Returnval []PbmPlacementCompatibilityResult `xml:"returnval,omitempty"` +} + +type PbmCheckCompliance PbmCheckComplianceRequestType + +func init() { + types.Add("pbm:PbmCheckCompliance", reflect.TypeOf((*PbmCheckCompliance)(nil)).Elem()) +} + +type PbmCheckComplianceRequestType struct { + This types.ManagedObjectReference `xml:"_this"` + Entities []PbmServerObjectRef `xml:"entities"` + Profile *PbmProfileId `xml:"profile,omitempty"` +} + +func init() { + types.Add("pbm:PbmCheckComplianceRequestType", reflect.TypeOf((*PbmCheckComplianceRequestType)(nil)).Elem()) +} + +type PbmCheckComplianceResponse struct { + Returnval []PbmComplianceResult `xml:"returnval,omitempty"` +} + +type PbmCheckRequirements PbmCheckRequirementsRequestType + +func init() { + types.Add("pbm:PbmCheckRequirements", reflect.TypeOf((*PbmCheckRequirements)(nil)).Elem()) +} + +type PbmCheckRequirementsRequestType struct { + This types.ManagedObjectReference `xml:"_this"` + HubsToSearch []PbmPlacementHub `xml:"hubsToSearch,omitempty"` + PlacementSubjectRef *PbmServerObjectRef `xml:"placementSubjectRef,omitempty"` + PlacementSubjectRequirement []BasePbmPlacementRequirement `xml:"placementSubjectRequirement,omitempty,typeattr"` +} + +func init() { + types.Add("pbm:PbmCheckRequirementsRequestType", reflect.TypeOf((*PbmCheckRequirementsRequestType)(nil)).Elem()) +} + +type PbmCheckRequirementsResponse struct { + Returnval []PbmPlacementCompatibilityResult `xml:"returnval,omitempty"` +} + +type PbmCheckRollupCompliance PbmCheckRollupComplianceRequestType + +func init() { + types.Add("pbm:PbmCheckRollupCompliance", reflect.TypeOf((*PbmCheckRollupCompliance)(nil)).Elem()) +} + +type PbmCheckRollupComplianceRequestType struct { + This types.ManagedObjectReference `xml:"_this"` + Entity []PbmServerObjectRef `xml:"entity"` +} + +func init() { + types.Add("pbm:PbmCheckRollupComplianceRequestType", reflect.TypeOf((*PbmCheckRollupComplianceRequestType)(nil)).Elem()) +} + +type PbmCheckRollupComplianceResponse struct { + Returnval []PbmRollupComplianceResult `xml:"returnval,omitempty"` +} + +type PbmCompatibilityCheckFault struct { + PbmFault + + Hub PbmPlacementHub `xml:"hub"` +} + +func init() { + types.Add("pbm:PbmCompatibilityCheckFault", reflect.TypeOf((*PbmCompatibilityCheckFault)(nil)).Elem()) +} + +type PbmCompatibilityCheckFaultFault BasePbmCompatibilityCheckFault + +func init() { + types.Add("pbm:PbmCompatibilityCheckFaultFault", reflect.TypeOf((*PbmCompatibilityCheckFaultFault)(nil)).Elem()) +} + +type PbmComplianceOperationalStatus struct { + types.DynamicData + + Healthy *bool `xml:"healthy"` + OperationETA *time.Time `xml:"operationETA"` + OperationProgress int64 `xml:"operationProgress,omitempty"` + Transitional *bool `xml:"transitional"` +} + +func init() { + types.Add("pbm:PbmComplianceOperationalStatus", reflect.TypeOf((*PbmComplianceOperationalStatus)(nil)).Elem()) +} + +type PbmCompliancePolicyStatus struct { + types.DynamicData + + ExpectedValue PbmCapabilityInstance `xml:"expectedValue"` + CurrentValue *PbmCapabilityInstance `xml:"currentValue,omitempty"` +} + +func init() { + types.Add("pbm:PbmCompliancePolicyStatus", reflect.TypeOf((*PbmCompliancePolicyStatus)(nil)).Elem()) +} + +type PbmComplianceResult struct { + types.DynamicData + + CheckTime time.Time `xml:"checkTime"` + Entity PbmServerObjectRef `xml:"entity"` + Profile *PbmProfileId `xml:"profile,omitempty"` + ComplianceTaskStatus string `xml:"complianceTaskStatus,omitempty"` + ComplianceStatus string `xml:"complianceStatus"` + Mismatch bool `xml:"mismatch"` + ViolatedPolicies []PbmCompliancePolicyStatus `xml:"violatedPolicies,omitempty"` + ErrorCause []types.LocalizedMethodFault `xml:"errorCause,omitempty"` + OperationalStatus *PbmComplianceOperationalStatus `xml:"operationalStatus,omitempty"` + Info *PbmExtendedElementDescription `xml:"info,omitempty"` +} + +func init() { + types.Add("pbm:PbmComplianceResult", reflect.TypeOf((*PbmComplianceResult)(nil)).Elem()) +} + +type PbmCreate PbmCreateRequestType + +func init() { + types.Add("pbm:PbmCreate", reflect.TypeOf((*PbmCreate)(nil)).Elem()) +} + +type PbmCreateRequestType struct { + This types.ManagedObjectReference `xml:"_this"` + CreateSpec PbmCapabilityProfileCreateSpec `xml:"createSpec"` +} + +func init() { + types.Add("pbm:PbmCreateRequestType", reflect.TypeOf((*PbmCreateRequestType)(nil)).Elem()) +} + +type PbmCreateResponse struct { + Returnval PbmProfileId `xml:"returnval"` +} + +type PbmDataServiceToPoliciesMap struct { + types.DynamicData + + DataServicePolicy PbmProfileId `xml:"dataServicePolicy"` + ParentStoragePolicies []PbmProfileId `xml:"parentStoragePolicies,omitempty"` + Fault *types.LocalizedMethodFault `xml:"fault,omitempty"` +} + +func init() { + types.Add("pbm:PbmDataServiceToPoliciesMap", reflect.TypeOf((*PbmDataServiceToPoliciesMap)(nil)).Elem()) +} + +type PbmDatastoreSpaceStatistics struct { + types.DynamicData + + ProfileId string `xml:"profileId,omitempty"` + PhysicalTotalInMB int64 `xml:"physicalTotalInMB"` + PhysicalFreeInMB int64 `xml:"physicalFreeInMB"` + PhysicalUsedInMB int64 `xml:"physicalUsedInMB"` + LogicalLimitInMB int64 `xml:"logicalLimitInMB,omitempty"` + LogicalFreeInMB int64 `xml:"logicalFreeInMB"` + LogicalUsedInMB int64 `xml:"logicalUsedInMB"` +} + +func init() { + types.Add("pbm:PbmDatastoreSpaceStatistics", reflect.TypeOf((*PbmDatastoreSpaceStatistics)(nil)).Elem()) +} + +type PbmDefaultCapabilityProfile struct { + PbmCapabilityProfile + + VvolType []string `xml:"vvolType"` + ContainerId string `xml:"containerId"` +} + +func init() { + types.Add("pbm:PbmDefaultCapabilityProfile", reflect.TypeOf((*PbmDefaultCapabilityProfile)(nil)).Elem()) +} + +type PbmDefaultProfileAppliesFault struct { + PbmCompatibilityCheckFault +} + +func init() { + types.Add("pbm:PbmDefaultProfileAppliesFault", reflect.TypeOf((*PbmDefaultProfileAppliesFault)(nil)).Elem()) +} + +type PbmDefaultProfileAppliesFaultFault PbmDefaultProfileAppliesFault + +func init() { + types.Add("pbm:PbmDefaultProfileAppliesFaultFault", reflect.TypeOf((*PbmDefaultProfileAppliesFaultFault)(nil)).Elem()) +} + +type PbmDefaultProfileInfo struct { + types.DynamicData + + Datastores []PbmPlacementHub `xml:"datastores"` + DefaultProfile BasePbmProfile `xml:"defaultProfile,omitempty,typeattr"` +} + +func init() { + types.Add("pbm:PbmDefaultProfileInfo", reflect.TypeOf((*PbmDefaultProfileInfo)(nil)).Elem()) +} + +type PbmDelete PbmDeleteRequestType + +func init() { + types.Add("pbm:PbmDelete", reflect.TypeOf((*PbmDelete)(nil)).Elem()) +} + +type PbmDeleteRequestType struct { + This types.ManagedObjectReference `xml:"_this"` + ProfileId []PbmProfileId `xml:"profileId"` +} + +func init() { + types.Add("pbm:PbmDeleteRequestType", reflect.TypeOf((*PbmDeleteRequestType)(nil)).Elem()) +} + +type PbmDeleteResponse struct { + Returnval []PbmProfileOperationOutcome `xml:"returnval,omitempty"` +} + +type PbmDuplicateName struct { + PbmFault + + Name string `xml:"name"` +} + +func init() { + types.Add("pbm:PbmDuplicateName", reflect.TypeOf((*PbmDuplicateName)(nil)).Elem()) +} + +type PbmDuplicateNameFault PbmDuplicateName + +func init() { + types.Add("pbm:PbmDuplicateNameFault", reflect.TypeOf((*PbmDuplicateNameFault)(nil)).Elem()) +} + +type PbmExtendedElementDescription struct { + types.DynamicData + + Label string `xml:"label"` + Summary string `xml:"summary"` + Key string `xml:"key"` + MessageCatalogKeyPrefix string `xml:"messageCatalogKeyPrefix"` + MessageArg []types.KeyAnyValue `xml:"messageArg,omitempty"` +} + +func init() { + types.Add("pbm:PbmExtendedElementDescription", reflect.TypeOf((*PbmExtendedElementDescription)(nil)).Elem()) +} + +type PbmFault struct { + types.MethodFault +} + +func init() { + types.Add("pbm:PbmFault", reflect.TypeOf((*PbmFault)(nil)).Elem()) +} + +type PbmFaultFault BasePbmFault + +func init() { + types.Add("pbm:PbmFaultFault", reflect.TypeOf((*PbmFaultFault)(nil)).Elem()) +} + +type PbmFaultInvalidLogin struct { + PbmFault +} + +func init() { + types.Add("pbm:PbmFaultInvalidLogin", reflect.TypeOf((*PbmFaultInvalidLogin)(nil)).Elem()) +} + +type PbmFaultInvalidLoginFault PbmFaultInvalidLogin + +func init() { + types.Add("pbm:PbmFaultInvalidLoginFault", reflect.TypeOf((*PbmFaultInvalidLoginFault)(nil)).Elem()) +} + +type PbmFaultNotFound struct { + PbmFault +} + +func init() { + types.Add("pbm:PbmFaultNotFound", reflect.TypeOf((*PbmFaultNotFound)(nil)).Elem()) +} + +type PbmFaultNotFoundFault PbmFaultNotFound + +func init() { + types.Add("pbm:PbmFaultNotFoundFault", reflect.TypeOf((*PbmFaultNotFoundFault)(nil)).Elem()) +} + +type PbmFaultProfileStorageFault struct { + PbmFault +} + +func init() { + types.Add("pbm:PbmFaultProfileStorageFault", reflect.TypeOf((*PbmFaultProfileStorageFault)(nil)).Elem()) +} + +type PbmFaultProfileStorageFaultFault PbmFaultProfileStorageFault + +func init() { + types.Add("pbm:PbmFaultProfileStorageFaultFault", reflect.TypeOf((*PbmFaultProfileStorageFaultFault)(nil)).Elem()) +} + +type PbmFetchCapabilityMetadata PbmFetchCapabilityMetadataRequestType + +func init() { + types.Add("pbm:PbmFetchCapabilityMetadata", reflect.TypeOf((*PbmFetchCapabilityMetadata)(nil)).Elem()) +} + +type PbmFetchCapabilityMetadataRequestType struct { + This types.ManagedObjectReference `xml:"_this"` + ResourceType *PbmProfileResourceType `xml:"resourceType,omitempty"` + VendorUuid string `xml:"vendorUuid,omitempty"` +} + +func init() { + types.Add("pbm:PbmFetchCapabilityMetadataRequestType", reflect.TypeOf((*PbmFetchCapabilityMetadataRequestType)(nil)).Elem()) +} + +type PbmFetchCapabilityMetadataResponse struct { + Returnval []PbmCapabilityMetadataPerCategory `xml:"returnval,omitempty"` +} + +type PbmFetchCapabilitySchema PbmFetchCapabilitySchemaRequestType + +func init() { + types.Add("pbm:PbmFetchCapabilitySchema", reflect.TypeOf((*PbmFetchCapabilitySchema)(nil)).Elem()) +} + +type PbmFetchCapabilitySchemaRequestType struct { + This types.ManagedObjectReference `xml:"_this"` + VendorUuid string `xml:"vendorUuid,omitempty"` + LineOfService []string `xml:"lineOfService,omitempty"` +} + +func init() { + types.Add("pbm:PbmFetchCapabilitySchemaRequestType", reflect.TypeOf((*PbmFetchCapabilitySchemaRequestType)(nil)).Elem()) +} + +type PbmFetchCapabilitySchemaResponse struct { + Returnval []PbmCapabilitySchema `xml:"returnval,omitempty"` +} + +type PbmFetchComplianceResult PbmFetchComplianceResultRequestType + +func init() { + types.Add("pbm:PbmFetchComplianceResult", reflect.TypeOf((*PbmFetchComplianceResult)(nil)).Elem()) +} + +type PbmFetchComplianceResultRequestType struct { + This types.ManagedObjectReference `xml:"_this"` + Entities []PbmServerObjectRef `xml:"entities"` + Profile *PbmProfileId `xml:"profile,omitempty"` +} + +func init() { + types.Add("pbm:PbmFetchComplianceResultRequestType", reflect.TypeOf((*PbmFetchComplianceResultRequestType)(nil)).Elem()) +} + +type PbmFetchComplianceResultResponse struct { + Returnval []PbmComplianceResult `xml:"returnval,omitempty"` +} + +type PbmFetchResourceType PbmFetchResourceTypeRequestType + +func init() { + types.Add("pbm:PbmFetchResourceType", reflect.TypeOf((*PbmFetchResourceType)(nil)).Elem()) +} + +type PbmFetchResourceTypeRequestType struct { + This types.ManagedObjectReference `xml:"_this"` +} + +func init() { + types.Add("pbm:PbmFetchResourceTypeRequestType", reflect.TypeOf((*PbmFetchResourceTypeRequestType)(nil)).Elem()) +} + +type PbmFetchResourceTypeResponse struct { + Returnval []PbmProfileResourceType `xml:"returnval,omitempty"` +} + +type PbmFetchRollupComplianceResult PbmFetchRollupComplianceResultRequestType + +func init() { + types.Add("pbm:PbmFetchRollupComplianceResult", reflect.TypeOf((*PbmFetchRollupComplianceResult)(nil)).Elem()) +} + +type PbmFetchRollupComplianceResultRequestType struct { + This types.ManagedObjectReference `xml:"_this"` + Entity []PbmServerObjectRef `xml:"entity"` +} + +func init() { + types.Add("pbm:PbmFetchRollupComplianceResultRequestType", reflect.TypeOf((*PbmFetchRollupComplianceResultRequestType)(nil)).Elem()) +} + +type PbmFetchRollupComplianceResultResponse struct { + Returnval []PbmRollupComplianceResult `xml:"returnval,omitempty"` +} + +type PbmFetchVendorInfo PbmFetchVendorInfoRequestType + +func init() { + types.Add("pbm:PbmFetchVendorInfo", reflect.TypeOf((*PbmFetchVendorInfo)(nil)).Elem()) +} + +type PbmFetchVendorInfoRequestType struct { + This types.ManagedObjectReference `xml:"_this"` + ResourceType *PbmProfileResourceType `xml:"resourceType,omitempty"` +} + +func init() { + types.Add("pbm:PbmFetchVendorInfoRequestType", reflect.TypeOf((*PbmFetchVendorInfoRequestType)(nil)).Elem()) +} + +type PbmFetchVendorInfoResponse struct { + Returnval []PbmCapabilityVendorResourceTypeInfo `xml:"returnval,omitempty"` +} + +type PbmFindApplicableDefaultProfile PbmFindApplicableDefaultProfileRequestType + +func init() { + types.Add("pbm:PbmFindApplicableDefaultProfile", reflect.TypeOf((*PbmFindApplicableDefaultProfile)(nil)).Elem()) +} + +type PbmFindApplicableDefaultProfileRequestType struct { + This types.ManagedObjectReference `xml:"_this"` + Datastores []PbmPlacementHub `xml:"datastores"` +} + +func init() { + types.Add("pbm:PbmFindApplicableDefaultProfileRequestType", reflect.TypeOf((*PbmFindApplicableDefaultProfileRequestType)(nil)).Elem()) +} + +type PbmFindApplicableDefaultProfileResponse struct { + Returnval []BasePbmProfile `xml:"returnval,omitempty,typeattr"` +} + +type PbmIncompatibleVendorSpecificRuleSet struct { + PbmCapabilityProfilePropertyMismatchFault +} + +func init() { + types.Add("pbm:PbmIncompatibleVendorSpecificRuleSet", reflect.TypeOf((*PbmIncompatibleVendorSpecificRuleSet)(nil)).Elem()) +} + +type PbmIncompatibleVendorSpecificRuleSetFault PbmIncompatibleVendorSpecificRuleSet + +func init() { + types.Add("pbm:PbmIncompatibleVendorSpecificRuleSetFault", reflect.TypeOf((*PbmIncompatibleVendorSpecificRuleSetFault)(nil)).Elem()) +} + +type PbmLegacyHubsNotSupported struct { + PbmFault + + Hubs []PbmPlacementHub `xml:"hubs"` +} + +func init() { + types.Add("pbm:PbmLegacyHubsNotSupported", reflect.TypeOf((*PbmLegacyHubsNotSupported)(nil)).Elem()) +} + +type PbmLegacyHubsNotSupportedFault PbmLegacyHubsNotSupported + +func init() { + types.Add("pbm:PbmLegacyHubsNotSupportedFault", reflect.TypeOf((*PbmLegacyHubsNotSupportedFault)(nil)).Elem()) +} + +type PbmLineOfServiceInfo struct { + types.DynamicData + + LineOfService string `xml:"lineOfService"` + Name PbmExtendedElementDescription `xml:"name"` + Description *PbmExtendedElementDescription `xml:"description,omitempty"` +} + +func init() { + types.Add("pbm:PbmLineOfServiceInfo", reflect.TypeOf((*PbmLineOfServiceInfo)(nil)).Elem()) +} + +type PbmNonExistentHubs struct { + PbmFault + + Hubs []PbmPlacementHub `xml:"hubs"` +} + +func init() { + types.Add("pbm:PbmNonExistentHubs", reflect.TypeOf((*PbmNonExistentHubs)(nil)).Elem()) +} + +type PbmNonExistentHubsFault PbmNonExistentHubs + +func init() { + types.Add("pbm:PbmNonExistentHubsFault", reflect.TypeOf((*PbmNonExistentHubsFault)(nil)).Elem()) +} + +type PbmPersistenceBasedDataServiceInfo struct { + PbmLineOfServiceInfo + + CompatiblePersistenceSchemaNamespace []string `xml:"compatiblePersistenceSchemaNamespace,omitempty"` +} + +func init() { + types.Add("pbm:PbmPersistenceBasedDataServiceInfo", reflect.TypeOf((*PbmPersistenceBasedDataServiceInfo)(nil)).Elem()) +} + +type PbmPlacementCapabilityConstraintsRequirement struct { + PbmPlacementRequirement + + Constraints BasePbmCapabilityConstraints `xml:"constraints,typeattr"` +} + +func init() { + types.Add("pbm:PbmPlacementCapabilityConstraintsRequirement", reflect.TypeOf((*PbmPlacementCapabilityConstraintsRequirement)(nil)).Elem()) +} + +type PbmPlacementCapabilityProfileRequirement struct { + PbmPlacementRequirement + + ProfileId PbmProfileId `xml:"profileId"` +} + +func init() { + types.Add("pbm:PbmPlacementCapabilityProfileRequirement", reflect.TypeOf((*PbmPlacementCapabilityProfileRequirement)(nil)).Elem()) +} + +type PbmPlacementCompatibilityResult struct { + types.DynamicData + + Hub PbmPlacementHub `xml:"hub"` + MatchingResources []BasePbmPlacementMatchingResources `xml:"matchingResources,omitempty,typeattr"` + HowMany int64 `xml:"howMany,omitempty"` + Utilization []PbmPlacementResourceUtilization `xml:"utilization,omitempty"` + Warning []types.LocalizedMethodFault `xml:"warning,omitempty"` + Error []types.LocalizedMethodFault `xml:"error,omitempty"` +} + +func init() { + types.Add("pbm:PbmPlacementCompatibilityResult", reflect.TypeOf((*PbmPlacementCompatibilityResult)(nil)).Elem()) +} + +type PbmPlacementHub struct { + types.DynamicData + + HubType string `xml:"hubType"` + HubId string `xml:"hubId"` +} + +func init() { + types.Add("pbm:PbmPlacementHub", reflect.TypeOf((*PbmPlacementHub)(nil)).Elem()) +} + +type PbmPlacementMatchingReplicationResources struct { + PbmPlacementMatchingResources + + ReplicationGroup []types.ReplicationGroupId `xml:"replicationGroup,omitempty"` +} + +func init() { + types.Add("pbm:PbmPlacementMatchingReplicationResources", reflect.TypeOf((*PbmPlacementMatchingReplicationResources)(nil)).Elem()) +} + +type PbmPlacementMatchingResources struct { + types.DynamicData +} + +func init() { + types.Add("pbm:PbmPlacementMatchingResources", reflect.TypeOf((*PbmPlacementMatchingResources)(nil)).Elem()) +} + +type PbmPlacementRequirement struct { + types.DynamicData +} + +func init() { + types.Add("pbm:PbmPlacementRequirement", reflect.TypeOf((*PbmPlacementRequirement)(nil)).Elem()) +} + +type PbmPlacementResourceUtilization struct { + types.DynamicData + + Name PbmExtendedElementDescription `xml:"name"` + Description PbmExtendedElementDescription `xml:"description"` + AvailableBefore int64 `xml:"availableBefore,omitempty"` + AvailableAfter int64 `xml:"availableAfter,omitempty"` + Total int64 `xml:"total,omitempty"` +} + +func init() { + types.Add("pbm:PbmPlacementResourceUtilization", reflect.TypeOf((*PbmPlacementResourceUtilization)(nil)).Elem()) +} + +type PbmProfile struct { + types.DynamicData + + ProfileId PbmProfileId `xml:"profileId"` + Name string `xml:"name"` + Description string `xml:"description,omitempty"` + CreationTime time.Time `xml:"creationTime"` + CreatedBy string `xml:"createdBy"` + LastUpdatedTime time.Time `xml:"lastUpdatedTime"` + LastUpdatedBy string `xml:"lastUpdatedBy"` +} + +func init() { + types.Add("pbm:PbmProfile", reflect.TypeOf((*PbmProfile)(nil)).Elem()) +} + +type PbmProfileId struct { + types.DynamicData + + UniqueId string `xml:"uniqueId"` +} + +func init() { + types.Add("pbm:PbmProfileId", reflect.TypeOf((*PbmProfileId)(nil)).Elem()) +} + +type PbmProfileOperationOutcome struct { + types.DynamicData + + ProfileId PbmProfileId `xml:"profileId"` + Fault *types.LocalizedMethodFault `xml:"fault,omitempty"` +} + +func init() { + types.Add("pbm:PbmProfileOperationOutcome", reflect.TypeOf((*PbmProfileOperationOutcome)(nil)).Elem()) +} + +type PbmProfileResourceType struct { + types.DynamicData + + ResourceType string `xml:"resourceType"` +} + +func init() { + types.Add("pbm:PbmProfileResourceType", reflect.TypeOf((*PbmProfileResourceType)(nil)).Elem()) +} + +type PbmProfileType struct { + types.DynamicData + + UniqueId string `xml:"uniqueId"` +} + +func init() { + types.Add("pbm:PbmProfileType", reflect.TypeOf((*PbmProfileType)(nil)).Elem()) +} + +type PbmPropertyMismatchFault struct { + PbmCompatibilityCheckFault + + CapabilityInstanceId PbmCapabilityMetadataUniqueId `xml:"capabilityInstanceId"` + RequirementPropertyInstance PbmCapabilityPropertyInstance `xml:"requirementPropertyInstance"` +} + +func init() { + types.Add("pbm:PbmPropertyMismatchFault", reflect.TypeOf((*PbmPropertyMismatchFault)(nil)).Elem()) +} + +type PbmPropertyMismatchFaultFault BasePbmPropertyMismatchFault + +func init() { + types.Add("pbm:PbmPropertyMismatchFaultFault", reflect.TypeOf((*PbmPropertyMismatchFaultFault)(nil)).Elem()) +} + +type PbmQueryAssociatedEntities PbmQueryAssociatedEntitiesRequestType + +func init() { + types.Add("pbm:PbmQueryAssociatedEntities", reflect.TypeOf((*PbmQueryAssociatedEntities)(nil)).Elem()) +} + +type PbmQueryAssociatedEntitiesRequestType struct { + This types.ManagedObjectReference `xml:"_this"` + Profiles []PbmProfileId `xml:"profiles,omitempty"` +} + +func init() { + types.Add("pbm:PbmQueryAssociatedEntitiesRequestType", reflect.TypeOf((*PbmQueryAssociatedEntitiesRequestType)(nil)).Elem()) +} + +type PbmQueryAssociatedEntitiesResponse struct { + Returnval []PbmQueryProfileResult `xml:"returnval,omitempty"` +} + +type PbmQueryAssociatedEntity PbmQueryAssociatedEntityRequestType + +func init() { + types.Add("pbm:PbmQueryAssociatedEntity", reflect.TypeOf((*PbmQueryAssociatedEntity)(nil)).Elem()) +} + +type PbmQueryAssociatedEntityRequestType struct { + This types.ManagedObjectReference `xml:"_this"` + Profile PbmProfileId `xml:"profile"` + EntityType string `xml:"entityType,omitempty"` +} + +func init() { + types.Add("pbm:PbmQueryAssociatedEntityRequestType", reflect.TypeOf((*PbmQueryAssociatedEntityRequestType)(nil)).Elem()) +} + +type PbmQueryAssociatedEntityResponse struct { + Returnval []PbmServerObjectRef `xml:"returnval,omitempty"` +} + +type PbmQueryAssociatedProfile PbmQueryAssociatedProfileRequestType + +func init() { + types.Add("pbm:PbmQueryAssociatedProfile", reflect.TypeOf((*PbmQueryAssociatedProfile)(nil)).Elem()) +} + +type PbmQueryAssociatedProfileRequestType struct { + This types.ManagedObjectReference `xml:"_this"` + Entity PbmServerObjectRef `xml:"entity"` +} + +func init() { + types.Add("pbm:PbmQueryAssociatedProfileRequestType", reflect.TypeOf((*PbmQueryAssociatedProfileRequestType)(nil)).Elem()) +} + +type PbmQueryAssociatedProfileResponse struct { + Returnval []PbmProfileId `xml:"returnval,omitempty"` +} + +type PbmQueryAssociatedProfiles PbmQueryAssociatedProfilesRequestType + +func init() { + types.Add("pbm:PbmQueryAssociatedProfiles", reflect.TypeOf((*PbmQueryAssociatedProfiles)(nil)).Elem()) +} + +type PbmQueryAssociatedProfilesRequestType struct { + This types.ManagedObjectReference `xml:"_this"` + Entities []PbmServerObjectRef `xml:"entities"` +} + +func init() { + types.Add("pbm:PbmQueryAssociatedProfilesRequestType", reflect.TypeOf((*PbmQueryAssociatedProfilesRequestType)(nil)).Elem()) +} + +type PbmQueryAssociatedProfilesResponse struct { + Returnval []PbmQueryProfileResult `xml:"returnval,omitempty"` +} + +type PbmQueryByRollupComplianceStatus PbmQueryByRollupComplianceStatusRequestType + +func init() { + types.Add("pbm:PbmQueryByRollupComplianceStatus", reflect.TypeOf((*PbmQueryByRollupComplianceStatus)(nil)).Elem()) +} + +type PbmQueryByRollupComplianceStatusRequestType struct { + This types.ManagedObjectReference `xml:"_this"` + Status string `xml:"status"` +} + +func init() { + types.Add("pbm:PbmQueryByRollupComplianceStatusRequestType", reflect.TypeOf((*PbmQueryByRollupComplianceStatusRequestType)(nil)).Elem()) +} + +type PbmQueryByRollupComplianceStatusResponse struct { + Returnval []PbmServerObjectRef `xml:"returnval,omitempty"` +} + +type PbmQueryDefaultRequirementProfile PbmQueryDefaultRequirementProfileRequestType + +func init() { + types.Add("pbm:PbmQueryDefaultRequirementProfile", reflect.TypeOf((*PbmQueryDefaultRequirementProfile)(nil)).Elem()) +} + +type PbmQueryDefaultRequirementProfileRequestType struct { + This types.ManagedObjectReference `xml:"_this"` + Hub PbmPlacementHub `xml:"hub"` +} + +func init() { + types.Add("pbm:PbmQueryDefaultRequirementProfileRequestType", reflect.TypeOf((*PbmQueryDefaultRequirementProfileRequestType)(nil)).Elem()) +} + +type PbmQueryDefaultRequirementProfileResponse struct { + Returnval *PbmProfileId `xml:"returnval,omitempty"` +} + +type PbmQueryDefaultRequirementProfiles PbmQueryDefaultRequirementProfilesRequestType + +func init() { + types.Add("pbm:PbmQueryDefaultRequirementProfiles", reflect.TypeOf((*PbmQueryDefaultRequirementProfiles)(nil)).Elem()) +} + +type PbmQueryDefaultRequirementProfilesRequestType struct { + This types.ManagedObjectReference `xml:"_this"` + Datastores []PbmPlacementHub `xml:"datastores"` +} + +func init() { + types.Add("pbm:PbmQueryDefaultRequirementProfilesRequestType", reflect.TypeOf((*PbmQueryDefaultRequirementProfilesRequestType)(nil)).Elem()) +} + +type PbmQueryDefaultRequirementProfilesResponse struct { + Returnval []PbmDefaultProfileInfo `xml:"returnval"` +} + +type PbmQueryMatchingHub PbmQueryMatchingHubRequestType + +func init() { + types.Add("pbm:PbmQueryMatchingHub", reflect.TypeOf((*PbmQueryMatchingHub)(nil)).Elem()) +} + +type PbmQueryMatchingHubRequestType struct { + This types.ManagedObjectReference `xml:"_this"` + HubsToSearch []PbmPlacementHub `xml:"hubsToSearch,omitempty"` + Profile PbmProfileId `xml:"profile"` +} + +func init() { + types.Add("pbm:PbmQueryMatchingHubRequestType", reflect.TypeOf((*PbmQueryMatchingHubRequestType)(nil)).Elem()) +} + +type PbmQueryMatchingHubResponse struct { + Returnval []PbmPlacementHub `xml:"returnval,omitempty"` +} + +type PbmQueryMatchingHubWithSpec PbmQueryMatchingHubWithSpecRequestType + +func init() { + types.Add("pbm:PbmQueryMatchingHubWithSpec", reflect.TypeOf((*PbmQueryMatchingHubWithSpec)(nil)).Elem()) +} + +type PbmQueryMatchingHubWithSpecRequestType struct { + This types.ManagedObjectReference `xml:"_this"` + HubsToSearch []PbmPlacementHub `xml:"hubsToSearch,omitempty"` + CreateSpec PbmCapabilityProfileCreateSpec `xml:"createSpec"` +} + +func init() { + types.Add("pbm:PbmQueryMatchingHubWithSpecRequestType", reflect.TypeOf((*PbmQueryMatchingHubWithSpecRequestType)(nil)).Elem()) +} + +type PbmQueryMatchingHubWithSpecResponse struct { + Returnval []PbmPlacementHub `xml:"returnval,omitempty"` +} + +type PbmQueryProfile PbmQueryProfileRequestType + +func init() { + types.Add("pbm:PbmQueryProfile", reflect.TypeOf((*PbmQueryProfile)(nil)).Elem()) +} + +type PbmQueryProfileRequestType struct { + This types.ManagedObjectReference `xml:"_this"` + ResourceType PbmProfileResourceType `xml:"resourceType"` + ProfileCategory string `xml:"profileCategory,omitempty"` +} + +func init() { + types.Add("pbm:PbmQueryProfileRequestType", reflect.TypeOf((*PbmQueryProfileRequestType)(nil)).Elem()) +} + +type PbmQueryProfileResponse struct { + Returnval []PbmProfileId `xml:"returnval,omitempty"` +} + +type PbmQueryProfileResult struct { + types.DynamicData + + Object PbmServerObjectRef `xml:"object"` + ProfileId []PbmProfileId `xml:"profileId,omitempty"` + Fault *types.LocalizedMethodFault `xml:"fault,omitempty"` +} + +func init() { + types.Add("pbm:PbmQueryProfileResult", reflect.TypeOf((*PbmQueryProfileResult)(nil)).Elem()) +} + +type PbmQueryReplicationGroupResult struct { + types.DynamicData + + Object PbmServerObjectRef `xml:"object"` + ReplicationGroupId *types.ReplicationGroupId `xml:"replicationGroupId,omitempty"` + Fault *types.LocalizedMethodFault `xml:"fault,omitempty"` +} + +func init() { + types.Add("pbm:PbmQueryReplicationGroupResult", reflect.TypeOf((*PbmQueryReplicationGroupResult)(nil)).Elem()) +} + +type PbmQueryReplicationGroups PbmQueryReplicationGroupsRequestType + +func init() { + types.Add("pbm:PbmQueryReplicationGroups", reflect.TypeOf((*PbmQueryReplicationGroups)(nil)).Elem()) +} + +type PbmQueryReplicationGroupsRequestType struct { + This types.ManagedObjectReference `xml:"_this"` + Entities []PbmServerObjectRef `xml:"entities,omitempty"` +} + +func init() { + types.Add("pbm:PbmQueryReplicationGroupsRequestType", reflect.TypeOf((*PbmQueryReplicationGroupsRequestType)(nil)).Elem()) +} + +type PbmQueryReplicationGroupsResponse struct { + Returnval []PbmQueryReplicationGroupResult `xml:"returnval,omitempty"` +} + +type PbmQuerySpaceStatsForStorageContainer PbmQuerySpaceStatsForStorageContainerRequestType + +func init() { + types.Add("pbm:PbmQuerySpaceStatsForStorageContainer", reflect.TypeOf((*PbmQuerySpaceStatsForStorageContainer)(nil)).Elem()) +} + +type PbmQuerySpaceStatsForStorageContainerRequestType struct { + This types.ManagedObjectReference `xml:"_this"` + Datastore PbmServerObjectRef `xml:"datastore"` + CapabilityProfileId []PbmProfileId `xml:"capabilityProfileId,omitempty"` +} + +func init() { + types.Add("pbm:PbmQuerySpaceStatsForStorageContainerRequestType", reflect.TypeOf((*PbmQuerySpaceStatsForStorageContainerRequestType)(nil)).Elem()) +} + +type PbmQuerySpaceStatsForStorageContainerResponse struct { + Returnval []PbmDatastoreSpaceStatistics `xml:"returnval,omitempty"` +} + +type PbmResetDefaultRequirementProfile PbmResetDefaultRequirementProfileRequestType + +func init() { + types.Add("pbm:PbmResetDefaultRequirementProfile", reflect.TypeOf((*PbmResetDefaultRequirementProfile)(nil)).Elem()) +} + +type PbmResetDefaultRequirementProfileRequestType struct { + This types.ManagedObjectReference `xml:"_this"` + Profile *PbmProfileId `xml:"profile,omitempty"` +} + +func init() { + types.Add("pbm:PbmResetDefaultRequirementProfileRequestType", reflect.TypeOf((*PbmResetDefaultRequirementProfileRequestType)(nil)).Elem()) +} + +type PbmResetDefaultRequirementProfileResponse struct { +} + +type PbmResetVSanDefaultProfile PbmResetVSanDefaultProfileRequestType + +func init() { + types.Add("pbm:PbmResetVSanDefaultProfile", reflect.TypeOf((*PbmResetVSanDefaultProfile)(nil)).Elem()) +} + +type PbmResetVSanDefaultProfileRequestType struct { + This types.ManagedObjectReference `xml:"_this"` +} + +func init() { + types.Add("pbm:PbmResetVSanDefaultProfileRequestType", reflect.TypeOf((*PbmResetVSanDefaultProfileRequestType)(nil)).Elem()) +} + +type PbmResetVSanDefaultProfileResponse struct { +} + +type PbmResourceInUse struct { + PbmFault + + Type string `xml:"type,omitempty"` + Name string `xml:"name,omitempty"` +} + +func init() { + types.Add("pbm:PbmResourceInUse", reflect.TypeOf((*PbmResourceInUse)(nil)).Elem()) +} + +type PbmResourceInUseFault PbmResourceInUse + +func init() { + types.Add("pbm:PbmResourceInUseFault", reflect.TypeOf((*PbmResourceInUseFault)(nil)).Elem()) +} + +type PbmRetrieveContent PbmRetrieveContentRequestType + +func init() { + types.Add("pbm:PbmRetrieveContent", reflect.TypeOf((*PbmRetrieveContent)(nil)).Elem()) +} + +type PbmRetrieveContentRequestType struct { + This types.ManagedObjectReference `xml:"_this"` + ProfileIds []PbmProfileId `xml:"profileIds"` +} + +func init() { + types.Add("pbm:PbmRetrieveContentRequestType", reflect.TypeOf((*PbmRetrieveContentRequestType)(nil)).Elem()) +} + +type PbmRetrieveContentResponse struct { + Returnval []BasePbmProfile `xml:"returnval,typeattr"` +} + +type PbmRetrieveServiceContent PbmRetrieveServiceContentRequestType + +func init() { + types.Add("pbm:PbmRetrieveServiceContent", reflect.TypeOf((*PbmRetrieveServiceContent)(nil)).Elem()) +} + +type PbmRetrieveServiceContentRequestType struct { + This types.ManagedObjectReference `xml:"_this"` +} + +func init() { + types.Add("pbm:PbmRetrieveServiceContentRequestType", reflect.TypeOf((*PbmRetrieveServiceContentRequestType)(nil)).Elem()) +} + +type PbmRetrieveServiceContentResponse struct { + Returnval PbmServiceInstanceContent `xml:"returnval"` +} + +type PbmRollupComplianceResult struct { + types.DynamicData + + OldestCheckTime time.Time `xml:"oldestCheckTime"` + Entity PbmServerObjectRef `xml:"entity"` + OverallComplianceStatus string `xml:"overallComplianceStatus"` + OverallComplianceTaskStatus string `xml:"overallComplianceTaskStatus,omitempty"` + Result []PbmComplianceResult `xml:"result,omitempty"` + ErrorCause []types.LocalizedMethodFault `xml:"errorCause,omitempty"` + ProfileMismatch bool `xml:"profileMismatch"` +} + +func init() { + types.Add("pbm:PbmRollupComplianceResult", reflect.TypeOf((*PbmRollupComplianceResult)(nil)).Elem()) +} + +type PbmServerObjectRef struct { + types.DynamicData + + ObjectType string `xml:"objectType"` + Key string `xml:"key"` + ServerUuid string `xml:"serverUuid,omitempty"` +} + +func init() { + types.Add("pbm:PbmServerObjectRef", reflect.TypeOf((*PbmServerObjectRef)(nil)).Elem()) +} + +type PbmServiceInstanceContent struct { + types.DynamicData + + AboutInfo PbmAboutInfo `xml:"aboutInfo"` + SessionManager types.ManagedObjectReference `xml:"sessionManager"` + CapabilityMetadataManager types.ManagedObjectReference `xml:"capabilityMetadataManager"` + ProfileManager types.ManagedObjectReference `xml:"profileManager"` + ComplianceManager types.ManagedObjectReference `xml:"complianceManager"` + PlacementSolver types.ManagedObjectReference `xml:"placementSolver"` + ReplicationManager *types.ManagedObjectReference `xml:"replicationManager,omitempty"` +} + +func init() { + types.Add("pbm:PbmServiceInstanceContent", reflect.TypeOf((*PbmServiceInstanceContent)(nil)).Elem()) +} + +type PbmUpdate PbmUpdateRequestType + +func init() { + types.Add("pbm:PbmUpdate", reflect.TypeOf((*PbmUpdate)(nil)).Elem()) +} + +type PbmUpdateRequestType struct { + This types.ManagedObjectReference `xml:"_this"` + ProfileId PbmProfileId `xml:"profileId"` + UpdateSpec PbmCapabilityProfileUpdateSpec `xml:"updateSpec"` +} + +func init() { + types.Add("pbm:PbmUpdateRequestType", reflect.TypeOf((*PbmUpdateRequestType)(nil)).Elem()) +} + +type PbmUpdateResponse struct { +} + +type PbmVaioDataServiceInfo struct { + PbmLineOfServiceInfo +} + +func init() { + types.Add("pbm:PbmVaioDataServiceInfo", reflect.TypeOf((*PbmVaioDataServiceInfo)(nil)).Elem()) +} + +type VersionURI string + +func init() { + types.Add("pbm:versionURI", reflect.TypeOf((*VersionURI)(nil)).Elem()) +} diff --git a/vendor/github.com/vmware/govmomi/session/cache/session.go b/vendor/github.com/vmware/govmomi/session/cache/session.go index b4e4136c2..8d2a76e24 100644 --- a/vendor/github.com/vmware/govmomi/session/cache/session.go +++ b/vendor/github.com/vmware/govmomi/session/cache/session.go @@ -50,12 +50,18 @@ type Client interface { // By default, username/password authentication is used to create new sessions. // The Session.Login{SOAP,REST} fields can be set to use other methods, // such as SAML token authentication (see govc session.login for example). +// +// When Reauth is set to true, Login skips loading file cache and performs username/password +// authentication, which is helpful in the case that the password in URL is different than +// previously cached session. Comparing to `Passthrough`, the file cache will be updated after +// authentication is done. type Session struct { URL *url.URL // URL of a vCenter or ESXi instance DirSOAP string // DirSOAP cache directory. Defaults to "$HOME/.govmomi/sessions" DirREST string // DirREST cache directory. Defaults to "$HOME/.govmomi/rest_sessions" Insecure bool // Insecure param for soap.NewClient (tls.Config.InsecureSkipVerify) Passthrough bool // Passthrough disables caching when set to true + Reauth bool // Reauth skips loading of cached sessions when set to true LoginSOAP func(context.Context, *vim25.Client) error // LoginSOAP defaults to session.Manager.Login() LoginREST func(context.Context, *rest.Client) error // LoginREST defaults to rest.Client.Login() @@ -252,7 +258,7 @@ func restSessionValid(ctx context.Context, client *rest.Client) (bool, error) { // An error is returned if the session ID cannot be validated. // Returns false if Session.Passthrough is true. func (s *Session) Load(ctx context.Context, c Client, config func(*soap.Client) error) (bool, error) { - if s.Passthrough { + if s.Passthrough || s.Reauth { return false, nil } diff --git a/vendor/github.com/vmware/govmomi/session/manager.go b/vendor/github.com/vmware/govmomi/session/manager.go index 24c6a2dbe..8689acd50 100644 --- a/vendor/github.com/vmware/govmomi/session/manager.go +++ b/vendor/github.com/vmware/govmomi/session/manager.go @@ -281,3 +281,14 @@ func (sm *Manager) CloneSession(ctx context.Context, ticket string) error { sm.userSession = &res.Returnval return nil } + +func (sm *Manager) UpdateServiceMessage(ctx context.Context, message string) error { + req := types.UpdateServiceMessage{ + This: sm.Reference(), + Message: message, + } + + _, err := methods.UpdateServiceMessage(ctx, sm.client, &req) + + return err +} diff --git a/vendor/github.com/vmware/govmomi/task/error.go b/vendor/github.com/vmware/govmomi/task/error.go index 5f6b8503f..3fff5aa26 100644 --- a/vendor/github.com/vmware/govmomi/task/error.go +++ b/vendor/github.com/vmware/govmomi/task/error.go @@ -20,6 +20,7 @@ import "github.com/vmware/govmomi/vim25/types" type Error struct { *types.LocalizedMethodFault + Description *types.LocalizableMessage } // Error returns the task's localized fault message. diff --git a/vendor/github.com/vmware/govmomi/task/wait.go b/vendor/github.com/vmware/govmomi/task/wait.go index c1c38a8bd..b78f5110d 100644 --- a/vendor/github.com/vmware/govmomi/task/wait.go +++ b/vendor/github.com/vmware/govmomi/task/wait.go @@ -38,7 +38,7 @@ func (t taskProgress) Detail() string { func (t taskProgress) Error() error { if t.info.Error != nil { - return Error{t.info.Error} + return Error{t.info.Error, t.info.Description} } return nil diff --git a/vendor/github.com/vmware/govmomi/vapi/library/library.go b/vendor/github.com/vmware/govmomi/vapi/library/library.go index 7611af27a..254a1b6dc 100644 --- a/vendor/github.com/vmware/govmomi/vapi/library/library.go +++ b/vendor/github.com/vmware/govmomi/vapi/library/library.go @@ -212,6 +212,20 @@ func (c *Manager) PublishLibrary(ctx context.Context, library *Library, subscrip return c.Do(ctx, url.Request(http.MethodPost, spec), nil) } +// UpdateLibrary can update one or both of the tag Description and Name fields. +func (c *Manager) UpdateLibrary(ctx context.Context, l *Library) error { + spec := struct { + Library `json:"update_spec"` + }{ + Library{ + Name: l.Name, + Description: l.Description, + }, + } + url := c.Resource(internal.LibraryPath).WithID(l.ID) + return c.Do(ctx, url.Request(http.MethodPatch, spec), nil) +} + // DeleteLibrary deletes an existing library. func (c *Manager) DeleteLibrary(ctx context.Context, library *Library) error { path := internal.LocalLibraryPath diff --git a/vendor/github.com/vmware/govmomi/vapi/library/library_item.go b/vendor/github.com/vmware/govmomi/vapi/library/library_item.go index 57914ad6c..c596ec128 100644 --- a/vendor/github.com/vmware/govmomi/vapi/library/library_item.go +++ b/vendor/github.com/vmware/govmomi/vapi/library/library_item.go @@ -120,6 +120,20 @@ func (c *Manager) PublishLibraryItem(ctx context.Context, item *Item, force bool return c.Do(ctx, url.Request(http.MethodPost, body), nil) } +// UpdateLibraryItem can update one or both of the item Description and Name fields. +func (c *Manager) UpdateLibraryItem(ctx context.Context, item *Item) error { + spec := struct { + Item `json:"update_spec"` + }{ + Item{ + Name: item.Name, + Description: item.Description, + }, + } + url := c.Resource(internal.LibraryItemPath).WithID(item.ID) + return c.Do(ctx, url.Request(http.MethodPatch, spec), nil) +} + // DeleteLibraryItem deletes an existing library item. func (c *Manager) DeleteLibraryItem(ctx context.Context, item *Item) error { url := c.Resource(internal.LibraryItemPath).WithID(item.ID) diff --git a/vendor/github.com/vmware/govmomi/vapi/rest/client.go b/vendor/github.com/vmware/govmomi/vapi/rest/client.go index 0cad1fb13..6b69c0947 100644 --- a/vendor/github.com/vmware/govmomi/vapi/rest/client.go +++ b/vendor/github.com/vmware/govmomi/vapi/rest/client.go @@ -25,6 +25,7 @@ import ( "io/ioutil" "net/http" "net/url" + "strings" "sync" "time" @@ -106,10 +107,21 @@ func (c *Client) UnmarshalJSON(b []byte) error { return nil } +// isAPI returns true if path starts with "/api" +// This hack allows helpers to support both endpoints: +// "/rest" - value wrapped responses and structured error responses +// "/api" - raw responses and no structured error responses +func isAPI(path string) bool { + return strings.HasPrefix(path, "/api") +} + // Resource helper for the given path. func (c *Client) Resource(path string) *Resource { r := &Resource{u: c.URL()} - r.u.Path = Path + path + if !isAPI(path) { + path = Path + path + } + r.u.Path = path return r } @@ -153,6 +165,7 @@ func (c *Client) Do(ctx context.Context, req *http.Request, resBody interface{}) return c.Client.Do(ctx, req, func(res *http.Response) error { switch res.StatusCode { case http.StatusOK: + case http.StatusCreated: case http.StatusNoContent: case http.StatusBadRequest: // TODO: structured error types @@ -174,12 +187,18 @@ func (c *Client) Do(ctx context.Context, req *http.Request, resBody interface{}) _, err := io.Copy(b, res.Body) return err default: + d := json.NewDecoder(res.Body) + if isAPI(req.URL.Path) { + // Responses from the /api endpoint are not wrapped + return d.Decode(resBody) + } + // Responses from the /rest endpoint are wrapped in this structure val := struct { Value interface{} `json:"value,omitempty"` }{ resBody, } - return json.NewDecoder(res.Body).Decode(&val) + return d.Decode(&val) } }) } diff --git a/vendor/github.com/vmware/govmomi/vapi/rest/resource.go b/vendor/github.com/vmware/govmomi/vapi/rest/resource.go index 243789632..060a1c84f 100644 --- a/vendor/github.com/vmware/govmomi/vapi/rest/resource.go +++ b/vendor/github.com/vmware/govmomi/vapi/rest/resource.go @@ -48,11 +48,12 @@ func (r *Resource) WithAction(action string) *Resource { return r.WithParam("~action", action) } -// WithParam sets adds a parameter to the URL.RawQuery +// WithParam adds one parameter on the URL.RawQuery func (r *Resource) WithParam(name string, value string) *Resource { - r.u.RawQuery = url.Values{ - name: []string{value}, - }.Encode() + // ParseQuery handles empty case, and we control access to query string so shouldn't encounter an error case + params, _ := url.ParseQuery(r.u.RawQuery) + params[name] = []string{value} + r.u.RawQuery = params.Encode() return r } diff --git a/vendor/github.com/vmware/govmomi/view/container_view.go b/vendor/github.com/vmware/govmomi/view/container_view.go index 37fa34ce7..c420acf9c 100644 --- a/vendor/github.com/vmware/govmomi/view/container_view.go +++ b/vendor/github.com/vmware/govmomi/view/container_view.go @@ -36,7 +36,7 @@ func NewContainerView(c *vim25.Client, ref types.ManagedObjectReference) *Contai } // Retrieve populates dst as property.Collector.Retrieve does, for all entities in the view of types specified by kind. -func (v ContainerView) Retrieve(ctx context.Context, kind []string, ps []string, dst interface{}) error { +func (v ContainerView) Retrieve(ctx context.Context, kind []string, ps []string, dst interface{}, pspec ...types.PropertySpec) error { pc := property.DefaultCollector(v.Client()) ospec := types.ObjectSpec{ @@ -50,8 +50,6 @@ func (v ContainerView) Retrieve(ctx context.Context, kind []string, ps []string, }, } - var pspec []types.PropertySpec - if len(kind) == 0 { kind = []string{"ManagedEntity"} } diff --git a/vendor/github.com/vmware/govmomi/vim25/debug/debug.go b/vendor/github.com/vmware/govmomi/vim25/debug/debug.go index cc87d5453..048062825 100644 --- a/vendor/github.com/vmware/govmomi/vim25/debug/debug.go +++ b/vendor/github.com/vmware/govmomi/vim25/debug/debug.go @@ -29,6 +29,20 @@ type Provider interface { Flush() } +// ReadCloser is a struct that satisfies the io.ReadCloser interface +type ReadCloser struct { + io.Reader + io.Closer +} + +// NewTeeReader wraps io.TeeReader and patches through the Close() function. +func NewTeeReader(rc io.ReadCloser, w io.Writer) io.ReadCloser { + return ReadCloser{ + Reader: io.TeeReader(rc, w), + Closer: rc, + } +} + var currentProvider Provider = nil var scrubPassword = regexp.MustCompile(`(.*)`) @@ -55,8 +69,5 @@ func Flush() { } func Scrub(in []byte) []byte { - out := string(in) - out = scrubPassword.ReplaceAllString(out, `********`) - - return []byte(out) + return scrubPassword.ReplaceAll(in, []byte(`********`)) } diff --git a/vendor/github.com/vmware/govmomi/vim25/debug/file.go b/vendor/github.com/vmware/govmomi/vim25/debug/file.go index f04a00407..4290a2916 100644 --- a/vendor/github.com/vmware/govmomi/vim25/debug/file.go +++ b/vendor/github.com/vmware/govmomi/vim25/debug/file.go @@ -20,13 +20,16 @@ import ( "io" "os" "path" + "sync" ) // 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 + Path string + + mu sync.Mutex files []*os.File } @@ -36,12 +39,16 @@ func (fp *FileProvider) NewFile(p string) io.WriteCloser { panic(err) } + fp.mu.Lock() + defer fp.mu.Unlock() fp.files = append(fp.files, f) return NewFileWriterCloser(f, p) } func (fp *FileProvider) Flush() { + fp.mu.Lock() + defer fp.mu.Unlock() for _, f := range fp.files { f.Close() } diff --git a/vendor/github.com/vmware/govmomi/vim25/debug/log.go b/vendor/github.com/vmware/govmomi/vim25/debug/log.go index 8335acff0..183c606a3 100644 --- a/vendor/github.com/vmware/govmomi/vim25/debug/log.go +++ b/vendor/github.com/vmware/govmomi/vim25/debug/log.go @@ -17,8 +17,9 @@ limitations under the License. package debug import ( + "fmt" "io" - "log" + "os" ) type LogWriterCloser struct { @@ -29,7 +30,7 @@ func NewLogWriterCloser() *LogWriterCloser { } func (lwc *LogWriterCloser) Write(p []byte) (n int, err error) { - log.Print(string(Scrub(p))) + fmt.Fprint(os.Stderr, string(Scrub(p))) return len(p), nil } @@ -41,7 +42,6 @@ type LogProvider struct { } func (s *LogProvider) NewFile(p string) io.WriteCloser { - log.Print(p) return NewLogWriterCloser() } diff --git a/vendor/github.com/vmware/govmomi/vim25/methods/methods.go b/vendor/github.com/vmware/govmomi/vim25/methods/methods.go index 8c209e604..32c7c0911 100644 --- a/vendor/github.com/vmware/govmomi/vim25/methods/methods.go +++ b/vendor/github.com/vmware/govmomi/vim25/methods/methods.go @@ -1,5 +1,5 @@ /* -Copyright (c) 2014-2018 VMware, Inc. All Rights Reserved. +Copyright (c) 2014-2021 VMware, Inc. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -4083,6 +4083,26 @@ func DeleteSnapshot_Task(ctx context.Context, r soap.RoundTripper, req *types.De return resBody.Res, nil } +type DeleteVStorageObjectEx_TaskBody struct { + Req *types.DeleteVStorageObjectEx_Task `xml:"urn:vim25 DeleteVStorageObjectEx_Task,omitempty"` + Res *types.DeleteVStorageObjectEx_TaskResponse `xml:"DeleteVStorageObjectEx_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *DeleteVStorageObjectEx_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func DeleteVStorageObjectEx_Task(ctx context.Context, r soap.RoundTripper, req *types.DeleteVStorageObjectEx_Task) (*types.DeleteVStorageObjectEx_TaskResponse, error) { + var reqBody, resBody DeleteVStorageObjectEx_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + type DeleteVStorageObject_TaskBody struct { Req *types.DeleteVStorageObject_Task `xml:"urn:vim25 DeleteVStorageObject_Task,omitempty"` Res *types.DeleteVStorageObject_TaskResponse `xml:"DeleteVStorageObject_TaskResponse,omitempty"` @@ -4843,6 +4863,26 @@ func DownloadDescriptionTree(ctx context.Context, r soap.RoundTripper, req *type return resBody.Res, nil } +type DropConnectionsBody struct { + Req *types.DropConnections `xml:"urn:vim25 DropConnections,omitempty"` + Res *types.DropConnectionsResponse `xml:"DropConnectionsResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *DropConnectionsBody) Fault() *soap.Fault { return b.Fault_ } + +func DropConnections(ctx context.Context, r soap.RoundTripper, req *types.DropConnections) (*types.DropConnectionsResponse, error) { + var reqBody, resBody DropConnectionsBody + + 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:"DuplicateCustomizationSpecResponse,omitempty"` @@ -6523,6 +6563,26 @@ func HostCreateDisk_Task(ctx context.Context, r soap.RoundTripper, req *types.Ho return resBody.Res, nil } +type HostDeleteVStorageObjectEx_TaskBody struct { + Req *types.HostDeleteVStorageObjectEx_Task `xml:"urn:vim25 HostDeleteVStorageObjectEx_Task,omitempty"` + Res *types.HostDeleteVStorageObjectEx_TaskResponse `xml:"HostDeleteVStorageObjectEx_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *HostDeleteVStorageObjectEx_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func HostDeleteVStorageObjectEx_Task(ctx context.Context, r soap.RoundTripper, req *types.HostDeleteVStorageObjectEx_Task) (*types.HostDeleteVStorageObjectEx_TaskResponse, error) { + var reqBody, resBody HostDeleteVStorageObjectEx_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + type HostDeleteVStorageObject_TaskBody struct { Req *types.HostDeleteVStorageObject_Task `xml:"urn:vim25 HostDeleteVStorageObject_Task,omitempty"` Res *types.HostDeleteVStorageObject_TaskResponse `xml:"HostDeleteVStorageObject_TaskResponse,omitempty"` @@ -6943,6 +7003,26 @@ func HostSpecGetUpdatedHosts(ctx context.Context, r soap.RoundTripper, req *type return resBody.Res, nil } +type HostUpdateVStorageObjectMetadataEx_TaskBody struct { + Req *types.HostUpdateVStorageObjectMetadataEx_Task `xml:"urn:vim25 HostUpdateVStorageObjectMetadataEx_Task,omitempty"` + Res *types.HostUpdateVStorageObjectMetadataEx_TaskResponse `xml:"HostUpdateVStorageObjectMetadataEx_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *HostUpdateVStorageObjectMetadataEx_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func HostUpdateVStorageObjectMetadataEx_Task(ctx context.Context, r soap.RoundTripper, req *types.HostUpdateVStorageObjectMetadataEx_Task) (*types.HostUpdateVStorageObjectMetadataEx_TaskResponse, error) { + var reqBody, resBody HostUpdateVStorageObjectMetadataEx_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + type HostUpdateVStorageObjectMetadata_TaskBody struct { Req *types.HostUpdateVStorageObjectMetadata_Task `xml:"urn:vim25 HostUpdateVStorageObjectMetadata_Task,omitempty"` Res *types.HostUpdateVStorageObjectMetadata_TaskResponse `xml:"HostUpdateVStorageObjectMetadata_TaskResponse,omitempty"` @@ -7123,6 +7203,26 @@ func HttpNfcLeaseGetManifest(ctx context.Context, r soap.RoundTripper, req *type return resBody.Res, nil } +type HttpNfcLeaseProbeUrlsBody struct { + Req *types.HttpNfcLeaseProbeUrls `xml:"urn:vim25 HttpNfcLeaseProbeUrls,omitempty"` + Res *types.HttpNfcLeaseProbeUrlsResponse `xml:"HttpNfcLeaseProbeUrlsResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *HttpNfcLeaseProbeUrlsBody) Fault() *soap.Fault { return b.Fault_ } + +func HttpNfcLeaseProbeUrls(ctx context.Context, r soap.RoundTripper, req *types.HttpNfcLeaseProbeUrls) (*types.HttpNfcLeaseProbeUrlsResponse, error) { + var reqBody, resBody HttpNfcLeaseProbeUrlsBody + + 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:"HttpNfcLeaseProgressResponse,omitempty"` @@ -9523,6 +9623,26 @@ func QueryConnectionInfoViaSpec(ctx context.Context, r soap.RoundTripper, req *t return resBody.Res, nil } +type QueryConnectionsBody struct { + Req *types.QueryConnections `xml:"urn:vim25 QueryConnections,omitempty"` + Res *types.QueryConnectionsResponse `xml:"QueryConnectionsResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *QueryConnectionsBody) Fault() *soap.Fault { return b.Fault_ } + +func QueryConnections(ctx context.Context, r soap.RoundTripper, req *types.QueryConnections) (*types.QueryConnectionsResponse, error) { + var reqBody, resBody QueryConnectionsBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + type QueryCryptoKeyStatusBody struct { Req *types.QueryCryptoKeyStatus `xml:"urn:vim25 QueryCryptoKeyStatus,omitempty"` Res *types.QueryCryptoKeyStatusResponse `xml:"QueryCryptoKeyStatusResponse,omitempty"` @@ -17723,6 +17843,26 @@ func UploadKmipServerCert(ctx context.Context, r soap.RoundTripper, req *types.U return resBody.Res, nil } +type VCenterUpdateVStorageObjectMetadataEx_TaskBody struct { + Req *types.VCenterUpdateVStorageObjectMetadataEx_Task `xml:"urn:vim25 VCenterUpdateVStorageObjectMetadataEx_Task,omitempty"` + Res *types.VCenterUpdateVStorageObjectMetadataEx_TaskResponse `xml:"VCenterUpdateVStorageObjectMetadataEx_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *VCenterUpdateVStorageObjectMetadataEx_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func VCenterUpdateVStorageObjectMetadataEx_Task(ctx context.Context, r soap.RoundTripper, req *types.VCenterUpdateVStorageObjectMetadataEx_Task) (*types.VCenterUpdateVStorageObjectMetadataEx_TaskResponse, error) { + var reqBody, resBody VCenterUpdateVStorageObjectMetadataEx_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + type VStorageObjectCreateSnapshot_TaskBody struct { Req *types.VStorageObjectCreateSnapshot_Task `xml:"urn:vim25 VStorageObjectCreateSnapshot_Task,omitempty"` Res *types.VStorageObjectCreateSnapshot_TaskResponse `xml:"VStorageObjectCreateSnapshot_TaskResponse,omitempty"` diff --git a/vendor/github.com/vmware/govmomi/vim25/mo/mo.go b/vendor/github.com/vmware/govmomi/vim25/mo/mo.go index b557c2652..427d579ee 100644 --- a/vendor/github.com/vmware/govmomi/vim25/mo/mo.go +++ b/vendor/github.com/vmware/govmomi/vim25/mo/mo.go @@ -1,5 +1,5 @@ /* -Copyright (c) 2014-2018 VMware, Inc. All Rights Reserved. +Copyright (c) 2014-2021 VMware, Inc. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/github.com/vmware/govmomi/vim25/progress/reader.go b/vendor/github.com/vmware/govmomi/vim25/progress/reader.go index e37cd13cb..201333ee4 100644 --- a/vendor/github.com/vmware/govmomi/vim25/progress/reader.go +++ b/vendor/github.com/vmware/govmomi/vim25/progress/reader.go @@ -36,6 +36,9 @@ type readerReport struct { } func (r readerReport) Percentage() float32 { + if r.size <= 0 { + return 0 + } return 100.0 * float32(r.pos) / float32(r.size) } diff --git a/vendor/github.com/vmware/govmomi/vim25/retry.go b/vendor/github.com/vmware/govmomi/vim25/retry.go index f10e2cb6c..bf663a101 100644 --- a/vendor/github.com/vmware/govmomi/vim25/retry.go +++ b/vendor/github.com/vmware/govmomi/vim25/retry.go @@ -25,42 +25,50 @@ import ( 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). +// TemporaryNetworkError is deprecated. Use Retry() with RetryTemporaryNetworkError and retryAttempts instead. func TemporaryNetworkError(n int) RetryFunc { - return func(err error) (retry bool, delay time.Duration) { - var ok bool - - t, ok := err.(interface { - // Temporary is implemented by url.Error and net.Error - Temporary() bool - }) - if !ok { - // Never retry if this is not a Temporary error. - return false, 0 + return func(err error) (bool, time.Duration) { + if IsTemporaryNetworkError(err) { + // Don't retry if we're out of tries. + if n--; n <= 0 { + return false, 0 + } + return true, 0 } - - if !t.Temporary() { - return false, 0 - } - - // Don't retry if we're out of tries. - if n--; n <= 0 { - return false, 0 - } - - return true, 0 + return false, 0 } } +// RetryTemporaryNetworkError returns a RetryFunc that returns IsTemporaryNetworkError(err) +func RetryTemporaryNetworkError(err error) (bool, time.Duration) { + return IsTemporaryNetworkError(err), 0 +} + +// IsTemporaryNetworkError returns false unless the error implements +// a Temporary() bool method such as url.Error and net.Error. +// Otherwise, returns the value of the Temporary() method. +func IsTemporaryNetworkError(err error) bool { + t, ok := err.(interface { + // Temporary is implemented by url.Error and net.Error + Temporary() bool + }) + + if !ok { + // Not a Temporary error. + return false + } + + return t.Temporary() +} + 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 + fn RetryFunc + maxRetryAttempts int } // Retry wraps the specified soap.RoundTripper and invokes the @@ -68,10 +76,16 @@ type retry struct { // 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 { +// The soap.RoundTripper will return the original error if retryAttempts is specified and reached. +func Retry(roundTripper soap.RoundTripper, fn RetryFunc, retryAttempts ...int) soap.RoundTripper { r := &retry{ - roundTripper: roundTripper, - fn: fn, + roundTripper: roundTripper, + fn: fn, + maxRetryAttempts: 1, + } + + if len(retryAttempts) == 1 { + r.maxRetryAttempts = retryAttempts[0] } return r @@ -80,7 +94,7 @@ func Retry(roundTripper soap.RoundTripper, fn RetryFunc) soap.RoundTripper { func (r *retry) RoundTrip(ctx context.Context, req, res soap.HasFault) error { var err error - for { + for attempt := 0; attempt < r.maxRetryAttempts; attempt++ { err = r.roundTripper.RoundTrip(ctx, req, res) if err == nil { break diff --git a/vendor/github.com/vmware/govmomi/vim25/soap/client.go b/vendor/github.com/vmware/govmomi/vim25/soap/client.go index 04e26f059..424c20ce6 100644 --- a/vendor/github.com/vmware/govmomi/vim25/soap/client.go +++ b/vendor/github.com/vmware/govmomi/vim25/soap/client.go @@ -74,7 +74,8 @@ type Client struct { Types types.Func UserAgent string - cookie string + cookie string + insecureCookies bool } var schemeMatch = regexp.MustCompile(`^\w+://`) @@ -156,6 +157,10 @@ func NewClient(u *url.URL, insecure bool) *Client { c.u = c.URL() c.u.User = nil + if c.u.Scheme == "http" { + c.insecureCookies = os.Getenv("GOVMOMI_INSECURE_COOKIES") == "true" + } + return &c } @@ -219,15 +224,17 @@ func (c *Client) NewServiceClient(path string, namespace string) *Client { return client } -// SetRootCAs defines the set of root certificate authorities -// that clients use when verifying server certificates. -// By default TLS uses the host's root CA set. +// SetRootCAs defines the set of PEM-encoded file locations of root certificate +// authorities the client uses when verifying server certificates instead of the +// TLS defaults which uses the host's root CA set. Multiple PEM file locations +// can be specified using the OS-specific PathListSeparator. // -// See: http.Client.Transport.TLSClientConfig.RootCAs -func (c *Client) SetRootCAs(file string) error { +// See: http.Client.Transport.TLSClientConfig.RootCAs and +// https://pkg.go.dev/os#PathListSeparator +func (c *Client) SetRootCAs(pemPaths string) error { pool := x509.NewCertPool() - for _, name := range filepath.SplitList(file) { + for _, name := range filepath.SplitList(pemPaths) { pem, err := ioutil.ReadFile(filepath.Clean(name)) if err != nil { return err @@ -476,6 +483,16 @@ func (c *Client) UnmarshalJSON(b []byte) error { type kindContext struct{} +func (c *Client) setInsecureCookies(res *http.Response) { + cookies := res.Cookies() + if len(cookies) != 0 { + for _, cookie := range cookies { + cookie.Secure = false + } + c.Jar.SetCookies(c.u, cookies) + } +} + func (c *Client) Do(ctx context.Context, req *http.Request, f func(*http.Response) error) error { if ctx == nil { ctx = context.Background() @@ -513,12 +530,16 @@ func (c *Client) Do(ctx context.Context, req *http.Request, f func(*http.Respons return err } - defer res.Body.Close() - if d.enabled() { d.debugResponse(res, ext) } + if c.insecureCookies { + c.setInsecureCookies(res) + } + + defer res.Body.Close() + return f(res) } @@ -541,7 +562,7 @@ type statusError struct { } // Temporary returns true for HTTP response codes that can be retried -// See vim25.TemporaryNetworkError +// See vim25.IsTemporaryNetworkError func (e *statusError) Temporary() bool { switch e.res.StatusCode { case http.StatusBadGateway: @@ -809,7 +830,7 @@ func (c *Client) WriteFile(ctx context.Context, file string, src io.Reader, size if s != nil { pr := progress.NewReader(ctx, s, src, size) - src = pr + r = pr // Mark progress reader as done when returning from this function. defer func() { diff --git a/vendor/github.com/vmware/govmomi/vim25/soap/debug.go b/vendor/github.com/vmware/govmomi/vim25/soap/debug.go index 3d4b57704..ab23fd63f 100644 --- a/vendor/github.com/vmware/govmomi/vim25/soap/debug.go +++ b/vendor/github.com/vmware/govmomi/vim25/soap/debug.go @@ -27,18 +27,13 @@ import ( "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, +var ( + // Trace reads an http request or response from rc and writes to w. + // The content type (kind) should be one of "xml" or "json". + Trace = func(rc io.ReadCloser, w io.Writer, kind string) io.ReadCloser { + return debug.NewTeeReader(rc, w) } -} +) // debugRoundTrip contains state and logic needed to debug a single round trip. type debugRoundTrip struct { @@ -92,7 +87,7 @@ func (d *debugRoundTrip) debugRequest(req *http.Request) string { ext := d.ext(req.Header) // Capture body wc = d.newFile("req." + ext) - req.Body = newTeeReader(req.Body, wc) + req.Body = Trace(req.Body, wc, ext) // Delay closing until marked done d.cs = append(d.cs, wc) @@ -113,7 +108,7 @@ func (d *debugRoundTrip) debugResponse(res *http.Response, ext string) { // Capture body wc = d.newFile("res." + ext) - res.Body = newTeeReader(res.Body, wc) + res.Body = Trace(res.Body, wc, ext) // Delay closing until marked done d.cs = append(d.cs, wc) diff --git a/vendor/github.com/vmware/govmomi/vim25/soap/error.go b/vendor/github.com/vmware/govmomi/vim25/soap/error.go index 46111556c..1e1508733 100644 --- a/vendor/github.com/vmware/govmomi/vim25/soap/error.go +++ b/vendor/github.com/vmware/govmomi/vim25/soap/error.go @@ -17,6 +17,7 @@ limitations under the License. package soap import ( + "encoding/json" "fmt" "reflect" @@ -49,6 +50,15 @@ func (s soapFaultError) Error() string { return fmt.Sprintf("%s: %s", s.fault.Code, msg) } +func (s soapFaultError) MarshalJSON() ([]byte, error) { + out := struct { + Fault *Fault + }{ + Fault: s.fault, + } + return json.Marshal(out) +} + type vimFaultError struct { fault types.BaseMethodFault } diff --git a/vendor/github.com/vmware/govmomi/vim25/types/enum.go b/vendor/github.com/vmware/govmomi/vim25/types/enum.go index a356fff4f..9962e24d3 100644 --- a/vendor/github.com/vmware/govmomi/vim25/types/enum.go +++ b/vendor/github.com/vmware/govmomi/vim25/types/enum.go @@ -1,5 +1,5 @@ /* -Copyright (c) 2014-2018 VMware, Inc. All Rights Reserved. +Copyright (c) 2014-2021 VMware, Inc. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -272,6 +272,18 @@ func init() { t["ClusterComputeResourceHCIWorkflowState"] = reflect.TypeOf((*ClusterComputeResourceHCIWorkflowState)(nil)).Elem() } +type ClusterComputeResourceVcsHealthStatus string + +const ( + ClusterComputeResourceVcsHealthStatusHealthy = ClusterComputeResourceVcsHealthStatus("healthy") + ClusterComputeResourceVcsHealthStatusDegraded = ClusterComputeResourceVcsHealthStatus("degraded") + ClusterComputeResourceVcsHealthStatusNonhealthy = ClusterComputeResourceVcsHealthStatus("nonhealthy") +) + +func init() { + t["ClusterComputeResourceVcsHealthStatus"] = reflect.TypeOf((*ClusterComputeResourceVcsHealthStatus)(nil)).Elem() +} + type ClusterCryptoConfigInfoCryptoMode string const ( @@ -537,6 +549,7 @@ type CustomizationFailedReasonCode string const ( CustomizationFailedReasonCodeUserDefinedScriptDisabled = CustomizationFailedReasonCode("userDefinedScriptDisabled") + CustomizationFailedReasonCodeCustomizationDisabled = CustomizationFailedReasonCode("customizationDisabled") ) func init() { @@ -801,6 +814,7 @@ const ( DistributedVirtualSwitchHostInfrastructureTrafficClassHbr = DistributedVirtualSwitchHostInfrastructureTrafficClass("hbr") DistributedVirtualSwitchHostInfrastructureTrafficClassVsan = DistributedVirtualSwitchHostInfrastructureTrafficClass("vsan") DistributedVirtualSwitchHostInfrastructureTrafficClassVdp = DistributedVirtualSwitchHostInfrastructureTrafficClass("vdp") + DistributedVirtualSwitchHostInfrastructureTrafficClassBackupNfc = DistributedVirtualSwitchHostInfrastructureTrafficClass("backupNfc") ) func init() { @@ -1117,6 +1131,20 @@ func init() { t["GuestInfoAppStateType"] = reflect.TypeOf((*GuestInfoAppStateType)(nil)).Elem() } +type GuestInfoCustomizationStatus string + +const ( + GuestInfoCustomizationStatusTOOLSDEPLOYPKG_IDLE = GuestInfoCustomizationStatus("TOOLSDEPLOYPKG_IDLE") + GuestInfoCustomizationStatusTOOLSDEPLOYPKG_PENDING = GuestInfoCustomizationStatus("TOOLSDEPLOYPKG_PENDING") + GuestInfoCustomizationStatusTOOLSDEPLOYPKG_RUNNING = GuestInfoCustomizationStatus("TOOLSDEPLOYPKG_RUNNING") + GuestInfoCustomizationStatusTOOLSDEPLOYPKG_SUCCEEDED = GuestInfoCustomizationStatus("TOOLSDEPLOYPKG_SUCCEEDED") + GuestInfoCustomizationStatusTOOLSDEPLOYPKG_FAILED = GuestInfoCustomizationStatus("TOOLSDEPLOYPKG_FAILED") +) + +func init() { + t["GuestInfoCustomizationStatus"] = reflect.TypeOf((*GuestInfoCustomizationStatus)(nil)).Elem() +} + type GuestOsDescriptorFirmwareType string const ( @@ -1440,6 +1468,7 @@ const ( HostFileSystemVolumeFileSystemTypeVFFS = HostFileSystemVolumeFileSystemType("VFFS") HostFileSystemVolumeFileSystemTypeVVOL = HostFileSystemVolumeFileSystemType("VVOL") HostFileSystemVolumeFileSystemTypePMEM = HostFileSystemVolumeFileSystemType("PMEM") + HostFileSystemVolumeFileSystemTypeVsanD = HostFileSystemVolumeFileSystemType("vsanD") HostFileSystemVolumeFileSystemTypeOTHER = HostFileSystemVolumeFileSystemType("OTHER") ) @@ -2086,6 +2115,18 @@ func init() { t["HostRuntimeInfoNetStackInstanceRuntimeInfoState"] = reflect.TypeOf((*HostRuntimeInfoNetStackInstanceRuntimeInfoState)(nil)).Elem() } +type HostRuntimeInfoStatelessNvdsMigrationState string + +const ( + HostRuntimeInfoStatelessNvdsMigrationStateReady = HostRuntimeInfoStatelessNvdsMigrationState("ready") + HostRuntimeInfoStatelessNvdsMigrationStateNotNeeded = HostRuntimeInfoStatelessNvdsMigrationState("notNeeded") + HostRuntimeInfoStatelessNvdsMigrationStateUnknown = HostRuntimeInfoStatelessNvdsMigrationState("unknown") +) + +func init() { + t["HostRuntimeInfoStatelessNvdsMigrationState"] = reflect.TypeOf((*HostRuntimeInfoStatelessNvdsMigrationState)(nil)).Elem() +} + type HostServicePolicy string const ( @@ -2098,6 +2139,18 @@ func init() { t["HostServicePolicy"] = reflect.TypeOf((*HostServicePolicy)(nil)).Elem() } +type HostSevInfoSevState string + +const ( + HostSevInfoSevStateUninitialized = HostSevInfoSevState("uninitialized") + HostSevInfoSevStateInitialized = HostSevInfoSevState("initialized") + HostSevInfoSevStateWorking = HostSevInfoSevState("working") +) + +func init() { + t["HostSevInfoSevState"] = reflect.TypeOf((*HostSevInfoSevState)(nil)).Elem() +} + type HostSgxInfoFlcModes string const ( @@ -2228,6 +2281,18 @@ func init() { t["HostTpmAttestationInfoAcceptanceStatus"] = reflect.TypeOf((*HostTpmAttestationInfoAcceptanceStatus)(nil)).Elem() } +type HostTrustAuthorityAttestationInfoAttestationStatus string + +const ( + HostTrustAuthorityAttestationInfoAttestationStatusAttested = HostTrustAuthorityAttestationInfoAttestationStatus("attested") + HostTrustAuthorityAttestationInfoAttestationStatusNotAttested = HostTrustAuthorityAttestationInfoAttestationStatus("notAttested") + HostTrustAuthorityAttestationInfoAttestationStatusUnknown = HostTrustAuthorityAttestationInfoAttestationStatus("unknown") +) + +func init() { + t["HostTrustAuthorityAttestationInfoAttestationStatus"] = reflect.TypeOf((*HostTrustAuthorityAttestationInfoAttestationStatus)(nil)).Elem() +} + type HostUnresolvedVmfsExtentUnresolvedReason string const ( @@ -2431,6 +2496,7 @@ const ( KmipClusterInfoKmsManagementTypeUnknown = KmipClusterInfoKmsManagementType("unknown") KmipClusterInfoKmsManagementTypeVCenter = KmipClusterInfoKmsManagementType("vCenter") KmipClusterInfoKmsManagementTypeTrustAuthority = KmipClusterInfoKmsManagementType("trustAuthority") + KmipClusterInfoKmsManagementTypeNativeProvider = KmipClusterInfoKmsManagementType("nativeProvider") ) func init() { @@ -3102,6 +3168,7 @@ const ( RecommendationReasonCodeVmHostAffinityPolicy = RecommendationReasonCode("vmHostAffinityPolicy") RecommendationReasonCodeVmHostAntiAffinityPolicy = RecommendationReasonCode("vmHostAntiAffinityPolicy") RecommendationReasonCodeVmAntiAffinityPolicy = RecommendationReasonCode("vmAntiAffinityPolicy") + RecommendationReasonCodeBalanceVsanUsage = RecommendationReasonCode("balanceVsanUsage") ) func init() { @@ -3318,6 +3385,18 @@ func init() { t["ScsiLunVStorageSupportStatus"] = reflect.TypeOf((*ScsiLunVStorageSupportStatus)(nil)).Elem() } +type SessionManagerGenericServiceTicketTicketType string + +const ( + SessionManagerGenericServiceTicketTicketTypeHttpNfcServiceTicket = SessionManagerGenericServiceTicketTicketType("HttpNfcServiceTicket") + SessionManagerGenericServiceTicketTicketTypeHostServiceTicket = SessionManagerGenericServiceTicketTicketType("HostServiceTicket") + SessionManagerGenericServiceTicketTicketTypeVcServiceTicket = SessionManagerGenericServiceTicketTicketType("VcServiceTicket") +) + +func init() { + t["SessionManagerGenericServiceTicketTicketType"] = reflect.TypeOf((*SessionManagerGenericServiceTicketTicketType)(nil)).Elem() +} + type SessionManagerHttpServiceRequestSpecMethod string const ( @@ -3702,6 +3781,17 @@ func init() { t["VMwareUplinkLacpMode"] = reflect.TypeOf((*VMwareUplinkLacpMode)(nil)).Elem() } +type VMwareUplinkLacpTimeoutMode string + +const ( + VMwareUplinkLacpTimeoutModeFast = VMwareUplinkLacpTimeoutMode("fast") + VMwareUplinkLacpTimeoutModeSlow = VMwareUplinkLacpTimeoutMode("slow") +) + +func init() { + t["VMwareUplinkLacpTimeoutMode"] = reflect.TypeOf((*VMwareUplinkLacpTimeoutMode)(nil)).Elem() +} + type VStorageObjectConsumptionType string const ( @@ -4071,6 +4161,18 @@ func init() { t["VirtualMachineConfigInfoSwapPlacementType"] = reflect.TypeOf((*VirtualMachineConfigInfoSwapPlacementType)(nil)).Elem() } +type VirtualMachineConfigSpecEncryptedFtModes string + +const ( + VirtualMachineConfigSpecEncryptedFtModesFtEncryptionDisabled = VirtualMachineConfigSpecEncryptedFtModes("ftEncryptionDisabled") + VirtualMachineConfigSpecEncryptedFtModesFtEncryptionOpportunistic = VirtualMachineConfigSpecEncryptedFtModes("ftEncryptionOpportunistic") + VirtualMachineConfigSpecEncryptedFtModesFtEncryptionRequired = VirtualMachineConfigSpecEncryptedFtModes("ftEncryptionRequired") +) + +func init() { + t["VirtualMachineConfigSpecEncryptedFtModes"] = reflect.TypeOf((*VirtualMachineConfigSpecEncryptedFtModes)(nil)).Elem() +} + type VirtualMachineConfigSpecEncryptedVMotionModes string const ( @@ -4280,174 +4382,187 @@ func init() { 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") - VirtualMachineGuestOsIdentifierWindows2019srv_64Guest = VirtualMachineGuestOsIdentifier("windows2019srv_64Guest") - VirtualMachineGuestOsIdentifierFreebsdGuest = VirtualMachineGuestOsIdentifier("freebsdGuest") - VirtualMachineGuestOsIdentifierFreebsd64Guest = VirtualMachineGuestOsIdentifier("freebsd64Guest") - VirtualMachineGuestOsIdentifierFreebsd11Guest = VirtualMachineGuestOsIdentifier("freebsd11Guest") - VirtualMachineGuestOsIdentifierFreebsd11_64Guest = VirtualMachineGuestOsIdentifier("freebsd11_64Guest") - VirtualMachineGuestOsIdentifierFreebsd12Guest = VirtualMachineGuestOsIdentifier("freebsd12Guest") - VirtualMachineGuestOsIdentifierFreebsd12_64Guest = VirtualMachineGuestOsIdentifier("freebsd12_64Guest") - 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") - VirtualMachineGuestOsIdentifierRhel8_64Guest = VirtualMachineGuestOsIdentifier("rhel8_64Guest") - VirtualMachineGuestOsIdentifierCentosGuest = VirtualMachineGuestOsIdentifier("centosGuest") - VirtualMachineGuestOsIdentifierCentos64Guest = VirtualMachineGuestOsIdentifier("centos64Guest") - VirtualMachineGuestOsIdentifierCentos6Guest = VirtualMachineGuestOsIdentifier("centos6Guest") - VirtualMachineGuestOsIdentifierCentos6_64Guest = VirtualMachineGuestOsIdentifier("centos6_64Guest") - VirtualMachineGuestOsIdentifierCentos7Guest = VirtualMachineGuestOsIdentifier("centos7Guest") - VirtualMachineGuestOsIdentifierCentos7_64Guest = VirtualMachineGuestOsIdentifier("centos7_64Guest") - VirtualMachineGuestOsIdentifierCentos8_64Guest = VirtualMachineGuestOsIdentifier("centos8_64Guest") - VirtualMachineGuestOsIdentifierOracleLinuxGuest = VirtualMachineGuestOsIdentifier("oracleLinuxGuest") - VirtualMachineGuestOsIdentifierOracleLinux64Guest = VirtualMachineGuestOsIdentifier("oracleLinux64Guest") - VirtualMachineGuestOsIdentifierOracleLinux6Guest = VirtualMachineGuestOsIdentifier("oracleLinux6Guest") - VirtualMachineGuestOsIdentifierOracleLinux6_64Guest = VirtualMachineGuestOsIdentifier("oracleLinux6_64Guest") - VirtualMachineGuestOsIdentifierOracleLinux7Guest = VirtualMachineGuestOsIdentifier("oracleLinux7Guest") - VirtualMachineGuestOsIdentifierOracleLinux7_64Guest = VirtualMachineGuestOsIdentifier("oracleLinux7_64Guest") - VirtualMachineGuestOsIdentifierOracleLinux8_64Guest = VirtualMachineGuestOsIdentifier("oracleLinux8_64Guest") - 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") - VirtualMachineGuestOsIdentifierSles15_64Guest = VirtualMachineGuestOsIdentifier("sles15_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") - VirtualMachineGuestOsIdentifierDebian9Guest = VirtualMachineGuestOsIdentifier("debian9Guest") - VirtualMachineGuestOsIdentifierDebian9_64Guest = VirtualMachineGuestOsIdentifier("debian9_64Guest") - VirtualMachineGuestOsIdentifierDebian10Guest = VirtualMachineGuestOsIdentifier("debian10Guest") - VirtualMachineGuestOsIdentifierDebian10_64Guest = VirtualMachineGuestOsIdentifier("debian10_64Guest") - VirtualMachineGuestOsIdentifierDebian11Guest = VirtualMachineGuestOsIdentifier("debian11Guest") - VirtualMachineGuestOsIdentifierDebian11_64Guest = VirtualMachineGuestOsIdentifier("debian11_64Guest") - VirtualMachineGuestOsIdentifierAsianux3Guest = VirtualMachineGuestOsIdentifier("asianux3Guest") - VirtualMachineGuestOsIdentifierAsianux3_64Guest = VirtualMachineGuestOsIdentifier("asianux3_64Guest") - VirtualMachineGuestOsIdentifierAsianux4Guest = VirtualMachineGuestOsIdentifier("asianux4Guest") - VirtualMachineGuestOsIdentifierAsianux4_64Guest = VirtualMachineGuestOsIdentifier("asianux4_64Guest") - VirtualMachineGuestOsIdentifierAsianux5_64Guest = VirtualMachineGuestOsIdentifier("asianux5_64Guest") - VirtualMachineGuestOsIdentifierAsianux7_64Guest = VirtualMachineGuestOsIdentifier("asianux7_64Guest") - VirtualMachineGuestOsIdentifierAsianux8_64Guest = VirtualMachineGuestOsIdentifier("asianux8_64Guest") - VirtualMachineGuestOsIdentifierOpensuseGuest = VirtualMachineGuestOsIdentifier("opensuseGuest") - VirtualMachineGuestOsIdentifierOpensuse64Guest = VirtualMachineGuestOsIdentifier("opensuse64Guest") - VirtualMachineGuestOsIdentifierFedoraGuest = VirtualMachineGuestOsIdentifier("fedoraGuest") - VirtualMachineGuestOsIdentifierFedora64Guest = VirtualMachineGuestOsIdentifier("fedora64Guest") - VirtualMachineGuestOsIdentifierCoreos64Guest = VirtualMachineGuestOsIdentifier("coreos64Guest") - VirtualMachineGuestOsIdentifierVmwarePhoton64Guest = VirtualMachineGuestOsIdentifier("vmwarePhoton64Guest") - VirtualMachineGuestOsIdentifierOther24xLinuxGuest = VirtualMachineGuestOsIdentifier("other24xLinuxGuest") - VirtualMachineGuestOsIdentifierOther26xLinuxGuest = VirtualMachineGuestOsIdentifier("other26xLinuxGuest") - VirtualMachineGuestOsIdentifierOtherLinuxGuest = VirtualMachineGuestOsIdentifier("otherLinuxGuest") - VirtualMachineGuestOsIdentifierOther3xLinuxGuest = VirtualMachineGuestOsIdentifier("other3xLinuxGuest") - VirtualMachineGuestOsIdentifierOther4xLinuxGuest = VirtualMachineGuestOsIdentifier("other4xLinuxGuest") - VirtualMachineGuestOsIdentifierGenericLinuxGuest = VirtualMachineGuestOsIdentifier("genericLinuxGuest") - VirtualMachineGuestOsIdentifierOther24xLinux64Guest = VirtualMachineGuestOsIdentifier("other24xLinux64Guest") - VirtualMachineGuestOsIdentifierOther26xLinux64Guest = VirtualMachineGuestOsIdentifier("other26xLinux64Guest") - VirtualMachineGuestOsIdentifierOther3xLinux64Guest = VirtualMachineGuestOsIdentifier("other3xLinux64Guest") - VirtualMachineGuestOsIdentifierOther4xLinux64Guest = VirtualMachineGuestOsIdentifier("other4xLinux64Guest") - 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") - VirtualMachineGuestOsIdentifierDarwin15_64Guest = VirtualMachineGuestOsIdentifier("darwin15_64Guest") - VirtualMachineGuestOsIdentifierDarwin16_64Guest = VirtualMachineGuestOsIdentifier("darwin16_64Guest") - VirtualMachineGuestOsIdentifierDarwin17_64Guest = VirtualMachineGuestOsIdentifier("darwin17_64Guest") - VirtualMachineGuestOsIdentifierDarwin18_64Guest = VirtualMachineGuestOsIdentifier("darwin18_64Guest") - VirtualMachineGuestOsIdentifierDarwin19_64Guest = VirtualMachineGuestOsIdentifier("darwin19_64Guest") - VirtualMachineGuestOsIdentifierVmkernelGuest = VirtualMachineGuestOsIdentifier("vmkernelGuest") - VirtualMachineGuestOsIdentifierVmkernel5Guest = VirtualMachineGuestOsIdentifier("vmkernel5Guest") - VirtualMachineGuestOsIdentifierVmkernel6Guest = VirtualMachineGuestOsIdentifier("vmkernel6Guest") - VirtualMachineGuestOsIdentifierVmkernel65Guest = VirtualMachineGuestOsIdentifier("vmkernel65Guest") - VirtualMachineGuestOsIdentifierVmkernel7Guest = VirtualMachineGuestOsIdentifier("vmkernel7Guest") - VirtualMachineGuestOsIdentifierAmazonlinux2_64Guest = VirtualMachineGuestOsIdentifier("amazonlinux2_64Guest") - VirtualMachineGuestOsIdentifierCrxPod1Guest = VirtualMachineGuestOsIdentifier("crxPod1Guest") - VirtualMachineGuestOsIdentifierOtherGuest = VirtualMachineGuestOsIdentifier("otherGuest") - VirtualMachineGuestOsIdentifierOtherGuest64 = VirtualMachineGuestOsIdentifier("otherGuest64") + 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") + VirtualMachineGuestOsIdentifierWindows2019srv_64Guest = VirtualMachineGuestOsIdentifier("windows2019srv_64Guest") + VirtualMachineGuestOsIdentifierWindows2019srvNext_64Guest = VirtualMachineGuestOsIdentifier("windows2019srvNext_64Guest") + VirtualMachineGuestOsIdentifierFreebsdGuest = VirtualMachineGuestOsIdentifier("freebsdGuest") + VirtualMachineGuestOsIdentifierFreebsd64Guest = VirtualMachineGuestOsIdentifier("freebsd64Guest") + VirtualMachineGuestOsIdentifierFreebsd11Guest = VirtualMachineGuestOsIdentifier("freebsd11Guest") + VirtualMachineGuestOsIdentifierFreebsd11_64Guest = VirtualMachineGuestOsIdentifier("freebsd11_64Guest") + VirtualMachineGuestOsIdentifierFreebsd12Guest = VirtualMachineGuestOsIdentifier("freebsd12Guest") + VirtualMachineGuestOsIdentifierFreebsd12_64Guest = VirtualMachineGuestOsIdentifier("freebsd12_64Guest") + VirtualMachineGuestOsIdentifierFreebsd13Guest = VirtualMachineGuestOsIdentifier("freebsd13Guest") + VirtualMachineGuestOsIdentifierFreebsd13_64Guest = VirtualMachineGuestOsIdentifier("freebsd13_64Guest") + 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") + VirtualMachineGuestOsIdentifierRhel8_64Guest = VirtualMachineGuestOsIdentifier("rhel8_64Guest") + VirtualMachineGuestOsIdentifierRhel9_64Guest = VirtualMachineGuestOsIdentifier("rhel9_64Guest") + VirtualMachineGuestOsIdentifierCentosGuest = VirtualMachineGuestOsIdentifier("centosGuest") + VirtualMachineGuestOsIdentifierCentos64Guest = VirtualMachineGuestOsIdentifier("centos64Guest") + VirtualMachineGuestOsIdentifierCentos6Guest = VirtualMachineGuestOsIdentifier("centos6Guest") + VirtualMachineGuestOsIdentifierCentos6_64Guest = VirtualMachineGuestOsIdentifier("centos6_64Guest") + VirtualMachineGuestOsIdentifierCentos7Guest = VirtualMachineGuestOsIdentifier("centos7Guest") + VirtualMachineGuestOsIdentifierCentos7_64Guest = VirtualMachineGuestOsIdentifier("centos7_64Guest") + VirtualMachineGuestOsIdentifierCentos8_64Guest = VirtualMachineGuestOsIdentifier("centos8_64Guest") + VirtualMachineGuestOsIdentifierCentos9_64Guest = VirtualMachineGuestOsIdentifier("centos9_64Guest") + VirtualMachineGuestOsIdentifierOracleLinuxGuest = VirtualMachineGuestOsIdentifier("oracleLinuxGuest") + VirtualMachineGuestOsIdentifierOracleLinux64Guest = VirtualMachineGuestOsIdentifier("oracleLinux64Guest") + VirtualMachineGuestOsIdentifierOracleLinux6Guest = VirtualMachineGuestOsIdentifier("oracleLinux6Guest") + VirtualMachineGuestOsIdentifierOracleLinux6_64Guest = VirtualMachineGuestOsIdentifier("oracleLinux6_64Guest") + VirtualMachineGuestOsIdentifierOracleLinux7Guest = VirtualMachineGuestOsIdentifier("oracleLinux7Guest") + VirtualMachineGuestOsIdentifierOracleLinux7_64Guest = VirtualMachineGuestOsIdentifier("oracleLinux7_64Guest") + VirtualMachineGuestOsIdentifierOracleLinux8_64Guest = VirtualMachineGuestOsIdentifier("oracleLinux8_64Guest") + VirtualMachineGuestOsIdentifierOracleLinux9_64Guest = VirtualMachineGuestOsIdentifier("oracleLinux9_64Guest") + 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") + VirtualMachineGuestOsIdentifierSles15_64Guest = VirtualMachineGuestOsIdentifier("sles15_64Guest") + VirtualMachineGuestOsIdentifierSles16_64Guest = VirtualMachineGuestOsIdentifier("sles16_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") + VirtualMachineGuestOsIdentifierDebian9Guest = VirtualMachineGuestOsIdentifier("debian9Guest") + VirtualMachineGuestOsIdentifierDebian9_64Guest = VirtualMachineGuestOsIdentifier("debian9_64Guest") + VirtualMachineGuestOsIdentifierDebian10Guest = VirtualMachineGuestOsIdentifier("debian10Guest") + VirtualMachineGuestOsIdentifierDebian10_64Guest = VirtualMachineGuestOsIdentifier("debian10_64Guest") + VirtualMachineGuestOsIdentifierDebian11Guest = VirtualMachineGuestOsIdentifier("debian11Guest") + VirtualMachineGuestOsIdentifierDebian11_64Guest = VirtualMachineGuestOsIdentifier("debian11_64Guest") + VirtualMachineGuestOsIdentifierAsianux3Guest = VirtualMachineGuestOsIdentifier("asianux3Guest") + VirtualMachineGuestOsIdentifierAsianux3_64Guest = VirtualMachineGuestOsIdentifier("asianux3_64Guest") + VirtualMachineGuestOsIdentifierAsianux4Guest = VirtualMachineGuestOsIdentifier("asianux4Guest") + VirtualMachineGuestOsIdentifierAsianux4_64Guest = VirtualMachineGuestOsIdentifier("asianux4_64Guest") + VirtualMachineGuestOsIdentifierAsianux5_64Guest = VirtualMachineGuestOsIdentifier("asianux5_64Guest") + VirtualMachineGuestOsIdentifierAsianux7_64Guest = VirtualMachineGuestOsIdentifier("asianux7_64Guest") + VirtualMachineGuestOsIdentifierAsianux8_64Guest = VirtualMachineGuestOsIdentifier("asianux8_64Guest") + VirtualMachineGuestOsIdentifierAsianux9_64Guest = VirtualMachineGuestOsIdentifier("asianux9_64Guest") + VirtualMachineGuestOsIdentifierOpensuseGuest = VirtualMachineGuestOsIdentifier("opensuseGuest") + VirtualMachineGuestOsIdentifierOpensuse64Guest = VirtualMachineGuestOsIdentifier("opensuse64Guest") + VirtualMachineGuestOsIdentifierFedoraGuest = VirtualMachineGuestOsIdentifier("fedoraGuest") + VirtualMachineGuestOsIdentifierFedora64Guest = VirtualMachineGuestOsIdentifier("fedora64Guest") + VirtualMachineGuestOsIdentifierCoreos64Guest = VirtualMachineGuestOsIdentifier("coreos64Guest") + VirtualMachineGuestOsIdentifierVmwarePhoton64Guest = VirtualMachineGuestOsIdentifier("vmwarePhoton64Guest") + VirtualMachineGuestOsIdentifierOther24xLinuxGuest = VirtualMachineGuestOsIdentifier("other24xLinuxGuest") + VirtualMachineGuestOsIdentifierOther26xLinuxGuest = VirtualMachineGuestOsIdentifier("other26xLinuxGuest") + VirtualMachineGuestOsIdentifierOtherLinuxGuest = VirtualMachineGuestOsIdentifier("otherLinuxGuest") + VirtualMachineGuestOsIdentifierOther3xLinuxGuest = VirtualMachineGuestOsIdentifier("other3xLinuxGuest") + VirtualMachineGuestOsIdentifierOther4xLinuxGuest = VirtualMachineGuestOsIdentifier("other4xLinuxGuest") + VirtualMachineGuestOsIdentifierOther5xLinuxGuest = VirtualMachineGuestOsIdentifier("other5xLinuxGuest") + VirtualMachineGuestOsIdentifierGenericLinuxGuest = VirtualMachineGuestOsIdentifier("genericLinuxGuest") + VirtualMachineGuestOsIdentifierOther24xLinux64Guest = VirtualMachineGuestOsIdentifier("other24xLinux64Guest") + VirtualMachineGuestOsIdentifierOther26xLinux64Guest = VirtualMachineGuestOsIdentifier("other26xLinux64Guest") + VirtualMachineGuestOsIdentifierOther3xLinux64Guest = VirtualMachineGuestOsIdentifier("other3xLinux64Guest") + VirtualMachineGuestOsIdentifierOther4xLinux64Guest = VirtualMachineGuestOsIdentifier("other4xLinux64Guest") + VirtualMachineGuestOsIdentifierOther5xLinux64Guest = VirtualMachineGuestOsIdentifier("other5xLinux64Guest") + 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") + VirtualMachineGuestOsIdentifierDarwin15_64Guest = VirtualMachineGuestOsIdentifier("darwin15_64Guest") + VirtualMachineGuestOsIdentifierDarwin16_64Guest = VirtualMachineGuestOsIdentifier("darwin16_64Guest") + VirtualMachineGuestOsIdentifierDarwin17_64Guest = VirtualMachineGuestOsIdentifier("darwin17_64Guest") + VirtualMachineGuestOsIdentifierDarwin18_64Guest = VirtualMachineGuestOsIdentifier("darwin18_64Guest") + VirtualMachineGuestOsIdentifierDarwin19_64Guest = VirtualMachineGuestOsIdentifier("darwin19_64Guest") + VirtualMachineGuestOsIdentifierDarwin20_64Guest = VirtualMachineGuestOsIdentifier("darwin20_64Guest") + VirtualMachineGuestOsIdentifierDarwin21_64Guest = VirtualMachineGuestOsIdentifier("darwin21_64Guest") + VirtualMachineGuestOsIdentifierVmkernelGuest = VirtualMachineGuestOsIdentifier("vmkernelGuest") + VirtualMachineGuestOsIdentifierVmkernel5Guest = VirtualMachineGuestOsIdentifier("vmkernel5Guest") + VirtualMachineGuestOsIdentifierVmkernel6Guest = VirtualMachineGuestOsIdentifier("vmkernel6Guest") + VirtualMachineGuestOsIdentifierVmkernel65Guest = VirtualMachineGuestOsIdentifier("vmkernel65Guest") + VirtualMachineGuestOsIdentifierVmkernel7Guest = VirtualMachineGuestOsIdentifier("vmkernel7Guest") + VirtualMachineGuestOsIdentifierAmazonlinux2_64Guest = VirtualMachineGuestOsIdentifier("amazonlinux2_64Guest") + VirtualMachineGuestOsIdentifierAmazonlinux3_64Guest = VirtualMachineGuestOsIdentifier("amazonlinux3_64Guest") + VirtualMachineGuestOsIdentifierCrxPod1Guest = VirtualMachineGuestOsIdentifier("crxPod1Guest") + VirtualMachineGuestOsIdentifierOtherGuest = VirtualMachineGuestOsIdentifier("otherGuest") + VirtualMachineGuestOsIdentifierOtherGuest64 = VirtualMachineGuestOsIdentifier("otherGuest64") ) func init() { @@ -4957,6 +5072,7 @@ const ( VmFaultToleranceConfigIssueReasonForIssueHasEFIFirmware = VmFaultToleranceConfigIssueReasonForIssue("hasEFIFirmware") VmFaultToleranceConfigIssueReasonForIssueTooManyVCPUs = VmFaultToleranceConfigIssueReasonForIssue("tooManyVCPUs") VmFaultToleranceConfigIssueReasonForIssueTooMuchMemory = VmFaultToleranceConfigIssueReasonForIssue("tooMuchMemory") + VmFaultToleranceConfigIssueReasonForIssueUnsupportedPMemHAFailOver = VmFaultToleranceConfigIssueReasonForIssue("unsupportedPMemHAFailOver") ) func init() { diff --git a/vendor/github.com/vmware/govmomi/vim25/types/helpers.go b/vendor/github.com/vmware/govmomi/vim25/types/helpers.go index 95c49f333..d6efec47e 100644 --- a/vendor/github.com/vmware/govmomi/vim25/types/helpers.go +++ b/vendor/github.com/vmware/govmomi/vim25/types/helpers.go @@ -17,6 +17,7 @@ limitations under the License. package types import ( + "net/url" "reflect" "strings" "time" @@ -63,6 +64,11 @@ func (r *ManagedObjectReference) FromString(o string) bool { return true } +// Encode ManagedObjectReference for use with URL and File paths +func (r ManagedObjectReference) Encode() string { + return strings.Join([]string{r.Type, url.QueryEscape(r.Value)}, "-") +} + func (c *PerfCounterInfo) Name() string { return c.GroupInfo.GetElementDescription().Key + "." + c.NameInfo.GetElementDescription().Key + "." + string(c.RollupType) } diff --git a/vendor/github.com/vmware/govmomi/vim25/types/if.go b/vendor/github.com/vmware/govmomi/vim25/types/if.go index 9b377c96d..de2f09415 100644 --- a/vendor/github.com/vmware/govmomi/vim25/types/if.go +++ b/vendor/github.com/vmware/govmomi/vim25/types/if.go @@ -1,5 +1,5 @@ /* -Copyright (c) 2014-2018 VMware, Inc. All Rights Reserved. +Copyright (c) 2014-2021 VMware, Inc. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -798,7 +798,6 @@ func (b *DvsFilterConfig) GetDvsFilterConfig() *DvsFilterConfig { return b } type BaseDvsFilterConfig interface { GetDvsFilterConfig() *DvsFilterConfig - GetDvsTrafficFilterConfig() *DvsTrafficFilterConfig } func init() { @@ -841,21 +840,12 @@ func (b *DvsNetworkRuleQualifier) GetDvsNetworkRuleQualifier() *DvsNetworkRuleQu type BaseDvsNetworkRuleQualifier interface { GetDvsNetworkRuleQualifier() *DvsNetworkRuleQualifier - GetDvsIpNetworkRuleQualifier() *DvsIpNetworkRuleQualifier } func init() { t["BaseDvsNetworkRuleQualifier"] = reflect.TypeOf((*DvsNetworkRuleQualifier)(nil)).Elem() } -func (b *DvsIpNetworkRuleQualifier) GetDvsIpNetworkRuleQualifier() *DvsIpNetworkRuleQualifier { - return b -} - -type BaseDvsIpNetworkRuleQualifier interface { - GetDvsIpNetworkRuleQualifier() *DvsIpNetworkRuleQualifier -} - func (b *DvsTrafficFilterConfig) GetDvsTrafficFilterConfig() *DvsTrafficFilterConfig { return b } type BaseDvsTrafficFilterConfig interface { @@ -1540,6 +1530,18 @@ func init() { t["BaseHostTargetTransport"] = reflect.TypeOf((*HostTargetTransport)(nil)).Elem() } +func (b *HostTpmBootSecurityOptionEventDetails) GetHostTpmBootSecurityOptionEventDetails() *HostTpmBootSecurityOptionEventDetails { + return b +} + +type BaseHostTpmBootSecurityOptionEventDetails interface { + GetHostTpmBootSecurityOptionEventDetails() *HostTpmBootSecurityOptionEventDetails +} + +func init() { + t["BaseHostTpmBootSecurityOptionEventDetails"] = reflect.TypeOf((*HostTpmBootSecurityOptionEventDetails)(nil)).Elem() +} + func (b *HostTpmEventDetails) GetHostTpmEventDetails() *HostTpmEventDetails { return b } type BaseHostTpmEventDetails interface { @@ -3022,6 +3024,16 @@ func init() { t["BaseVirtualMachineBootOptionsBootableDevice"] = reflect.TypeOf((*VirtualMachineBootOptionsBootableDevice)(nil)).Elem() } +func (b *VirtualMachineConnection) GetVirtualMachineConnection() *VirtualMachineConnection { return b } + +type BaseVirtualMachineConnection interface { + GetVirtualMachineConnection() *VirtualMachineConnection +} + +func init() { + t["BaseVirtualMachineConnection"] = reflect.TypeOf((*VirtualMachineConnection)(nil)).Elem() +} + func (b *VirtualMachineDeviceRuntimeInfoDeviceRuntimeState) GetVirtualMachineDeviceRuntimeInfoDeviceRuntimeState() *VirtualMachineDeviceRuntimeInfoDeviceRuntimeState { return b } diff --git a/vendor/github.com/vmware/govmomi/vim25/types/types.go b/vendor/github.com/vmware/govmomi/vim25/types/types.go index e10cf8219..d4760a05a 100644 --- a/vendor/github.com/vmware/govmomi/vim25/types/types.go +++ b/vendor/github.com/vmware/govmomi/vim25/types/types.go @@ -1,5 +1,5 @@ /* -Copyright (c) 2014-2018 VMware, Inc. All Rights Reserved. +Copyright (c) 2014-2021 VMware, Inc. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -84,6 +84,7 @@ type AboutInfo struct { FullName string `xml:"fullName"` Vendor string `xml:"vendor"` Version string `xml:"version"` + PatchLevel string `xml:"patchLevel,omitempty"` Build string `xml:"build"` LocaleVersion string `xml:"localeVersion,omitempty"` LocaleBuild string `xml:"localeBuild,omitempty"` @@ -1803,6 +1804,14 @@ func init() { t["ArrayOfClusterComputeResourceValidationResultBase"] = reflect.TypeOf((*ArrayOfClusterComputeResourceValidationResultBase)(nil)).Elem() } +type ArrayOfClusterComputeResourceVcsSlots struct { + ClusterComputeResourceVcsSlots []ClusterComputeResourceVcsSlots `xml:"ClusterComputeResourceVcsSlots,omitempty"` +} + +func init() { + t["ArrayOfClusterComputeResourceVcsSlots"] = reflect.TypeOf((*ArrayOfClusterComputeResourceVcsSlots)(nil)).Elem() +} + type ArrayOfClusterDasAamNodeState struct { ClusterDasAamNodeState []ClusterDasAamNodeState `xml:"ClusterDasAamNodeState,omitempty"` } @@ -2235,6 +2244,14 @@ func init() { t["ArrayOfDatastoreVVolContainerFailoverPair"] = reflect.TypeOf((*ArrayOfDatastoreVVolContainerFailoverPair)(nil)).Elem() } +type ArrayOfDesiredSoftwareSpecComponentSpec struct { + DesiredSoftwareSpecComponentSpec []DesiredSoftwareSpecComponentSpec `xml:"DesiredSoftwareSpecComponentSpec,omitempty"` +} + +func init() { + t["ArrayOfDesiredSoftwareSpecComponentSpec"] = reflect.TypeOf((*ArrayOfDesiredSoftwareSpecComponentSpec)(nil)).Elem() +} + type ArrayOfDiagnosticManagerBundleInfo struct { DiagnosticManagerBundleInfo []DiagnosticManagerBundleInfo `xml:"DiagnosticManagerBundleInfo,omitempty"` } @@ -2683,6 +2700,14 @@ func init() { t["ArrayOfFcoeConfigVlanRange"] = reflect.TypeOf((*ArrayOfFcoeConfigVlanRange)(nil)).Elem() } +type ArrayOfFeatureEVCMode struct { + FeatureEVCMode []FeatureEVCMode `xml:"FeatureEVCMode,omitempty"` +} + +func init() { + t["ArrayOfFeatureEVCMode"] = reflect.TypeOf((*ArrayOfFeatureEVCMode)(nil)).Elem() +} + type ArrayOfFileInfo struct { FileInfo []BaseFileInfo `xml:"FileInfo,omitempty,typeattr"` } @@ -3843,6 +3868,14 @@ func init() { t["ArrayOfHostTpmEventLogEntry"] = reflect.TypeOf((*ArrayOfHostTpmEventLogEntry)(nil)).Elem() } +type ArrayOfHostTrustAuthorityAttestationInfo struct { + HostTrustAuthorityAttestationInfo []HostTrustAuthorityAttestationInfo `xml:"HostTrustAuthorityAttestationInfo,omitempty"` +} + +func init() { + t["ArrayOfHostTrustAuthorityAttestationInfo"] = reflect.TypeOf((*ArrayOfHostTrustAuthorityAttestationInfo)(nil)).Elem() +} + type ArrayOfHostUnresolvedVmfsExtent struct { HostUnresolvedVmfsExtent []HostUnresolvedVmfsExtent `xml:"HostUnresolvedVmfsExtent,omitempty"` } @@ -4011,6 +4044,14 @@ func init() { t["ArrayOfHttpNfcLeaseManifestEntry"] = reflect.TypeOf((*ArrayOfHttpNfcLeaseManifestEntry)(nil)).Elem() } +type ArrayOfHttpNfcLeaseProbeResult struct { + HttpNfcLeaseProbeResult []HttpNfcLeaseProbeResult `xml:"HttpNfcLeaseProbeResult,omitempty"` +} + +func init() { + t["ArrayOfHttpNfcLeaseProbeResult"] = reflect.TypeOf((*ArrayOfHttpNfcLeaseProbeResult)(nil)).Elem() +} + type ArrayOfHttpNfcLeaseSourceFile struct { HttpNfcLeaseSourceFile []HttpNfcLeaseSourceFile `xml:"HttpNfcLeaseSourceFile,omitempty"` } @@ -5491,6 +5532,14 @@ func init() { t["ArrayOfVirtualMachineConfigSpec"] = reflect.TypeOf((*ArrayOfVirtualMachineConfigSpec)(nil)).Elem() } +type ArrayOfVirtualMachineConnection struct { + VirtualMachineConnection []BaseVirtualMachineConnection `xml:"VirtualMachineConnection,omitempty,typeattr"` +} + +func init() { + t["ArrayOfVirtualMachineConnection"] = reflect.TypeOf((*ArrayOfVirtualMachineConnection)(nil)).Elem() +} + type ArrayOfVirtualMachineCpuIdInfoSpec struct { VirtualMachineCpuIdInfoSpec []VirtualMachineCpuIdInfoSpec `xml:"VirtualMachineCpuIdInfoSpec,omitempty"` } @@ -6382,6 +6431,8 @@ type BaseConfigInfo struct { NativeSnapshotSupported *bool `xml:"nativeSnapshotSupported"` ChangedBlockTrackingEnabled *bool `xml:"changedBlockTrackingEnabled"` Backing BaseBaseConfigInfoBackingInfo `xml:"backing,typeattr"` + Metadata []KeyValue `xml:"metadata,omitempty"` + Vclock *VslmVClockInfo `xml:"vclock,omitempty"` Iofilter []string `xml:"iofilter,omitempty"` } @@ -7207,17 +7258,20 @@ func init() { 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"` - FtDrsWithoutEvcSupported *bool `xml:"ftDrsWithoutEvcSupported"` - HciWorkflowSupported *bool `xml:"hciWorkflowSupported"` - ComputePolicyVersion int32 `xml:"computePolicyVersion,omitempty"` - ClusterPlacementSupported *bool `xml:"clusterPlacementSupported"` - LifecycleManagementSupported *bool `xml:"lifecycleManagementSupported"` - ScalableSharesSupported *bool `xml:"scalableSharesSupported"` + ProvisioningSupported bool `xml:"provisioningSupported"` + MultiHostSupported bool `xml:"multiHostSupported"` + UserShellAccessSupported bool `xml:"userShellAccessSupported"` + SupportedEVCMode []EVCMode `xml:"supportedEVCMode,omitempty"` + SupportedEVCGraphicsMode []FeatureEVCMode `xml:"supportedEVCGraphicsMode,omitempty"` + NetworkBackupAndRestoreSupported *bool `xml:"networkBackupAndRestoreSupported"` + FtDrsWithoutEvcSupported *bool `xml:"ftDrsWithoutEvcSupported"` + HciWorkflowSupported *bool `xml:"hciWorkflowSupported"` + ComputePolicyVersion int32 `xml:"computePolicyVersion,omitempty"` + ClusterPlacementSupported *bool `xml:"clusterPlacementSupported"` + LifecycleManagementSupported *bool `xml:"lifecycleManagementSupported"` + HostSeedingSupported *bool `xml:"hostSeedingSupported"` + ScalableSharesSupported *bool `xml:"scalableSharesSupported"` + HadcsSupported *bool `xml:"hadcsSupported"` } func init() { @@ -7533,8 +7587,9 @@ type CheckCompliance_TaskResponse struct { } type CheckConfigureEvcModeRequestType struct { - This ManagedObjectReference `xml:"_this"` - EvcModeKey string `xml:"evcModeKey"` + This ManagedObjectReference `xml:"_this"` + EvcModeKey string `xml:"evcModeKey"` + EvcGraphicsModeKey string `xml:"evcGraphicsModeKey,omitempty"` } func init() { @@ -8230,16 +8285,20 @@ func init() { 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"` - DrsScore int32 `xml:"drsScore,omitempty"` - NumVmsPerDrsScoreBucket []int32 `xml:"numVmsPerDrsScoreBucket,omitempty"` - UsageSummary *ClusterUsageSummary `xml:"usageSummary,omitempty"` - CurrentEVCModeKey string `xml:"currentEVCModeKey,omitempty"` - DasData BaseClusterDasData `xml:"dasData,omitempty,typeattr"` + CurrentFailoverLevel int32 `xml:"currentFailoverLevel"` + AdmissionControlInfo BaseClusterDasAdmissionControlInfo `xml:"admissionControlInfo,omitempty,typeattr"` + NumVmotions int32 `xml:"numVmotions"` + TargetBalance int32 `xml:"targetBalance,omitempty"` + CurrentBalance int32 `xml:"currentBalance,omitempty"` + DrsScore int32 `xml:"drsScore,omitempty"` + NumVmsPerDrsScoreBucket []int32 `xml:"numVmsPerDrsScoreBucket,omitempty"` + UsageSummary *ClusterUsageSummary `xml:"usageSummary,omitempty"` + CurrentEVCModeKey string `xml:"currentEVCModeKey,omitempty"` + CurrentEVCGraphicsModeKey string `xml:"currentEVCGraphicsModeKey,omitempty"` + DasData BaseClusterDasData `xml:"dasData,omitempty,typeattr"` + ClusterMaintenanceModeStatus string `xml:"clusterMaintenanceModeStatus,omitempty"` + VcsHealthStatus string `xml:"vcsHealthStatus,omitempty"` + VcsSlots []ClusterComputeResourceVcsSlots `xml:"vcsSlots,omitempty"` } func init() { @@ -8249,8 +8308,9 @@ func init() { type ClusterComputeResourceVCProfile struct { DynamicData - ClusterSpec *ClusterConfigSpecEx `xml:"clusterSpec,omitempty"` - EvcModeKey string `xml:"evcModeKey,omitempty"` + ClusterSpec *ClusterConfigSpecEx `xml:"clusterSpec,omitempty"` + EvcModeKey string `xml:"evcModeKey,omitempty"` + EvcGraphicsModeKey string `xml:"evcGraphicsModeKey,omitempty"` } func init() { @@ -8267,6 +8327,17 @@ func init() { t["ClusterComputeResourceValidationResultBase"] = reflect.TypeOf((*ClusterComputeResourceValidationResultBase)(nil)).Elem() } +type ClusterComputeResourceVcsSlots struct { + DynamicData + + Host ManagedObjectReference `xml:"host"` + TotalSlots int32 `xml:"totalSlots"` +} + +func init() { + t["ClusterComputeResourceVcsSlots"] = reflect.TypeOf((*ClusterComputeResourceVcsSlots)(nil)).Elem() +} + type ClusterConfigInfo struct { DynamicData @@ -8400,6 +8471,7 @@ type ClusterDasAdmissionControlPolicy struct { DynamicData ResourceReductionToToleratePercent *int32 `xml:"resourceReductionToToleratePercent"` + PMemAdmissionControlEnabled *bool `xml:"pMemAdmissionControlEnabled"` } func init() { @@ -8869,6 +8941,7 @@ type ClusterFailoverResourcesAdmissionControlInfo struct { CurrentCpuFailoverResourcesPercent int32 `xml:"currentCpuFailoverResourcesPercent"` CurrentMemoryFailoverResourcesPercent int32 `xml:"currentMemoryFailoverResourcesPercent"` + CurrentPMemFailoverResourcesPercent int32 `xml:"currentPMemFailoverResourcesPercent,omitempty"` } func init() { @@ -8878,10 +8951,12 @@ func init() { type ClusterFailoverResourcesAdmissionControlPolicy struct { ClusterDasAdmissionControlPolicy - CpuFailoverResourcesPercent int32 `xml:"cpuFailoverResourcesPercent"` - MemoryFailoverResourcesPercent int32 `xml:"memoryFailoverResourcesPercent"` - FailoverLevel int32 `xml:"failoverLevel,omitempty"` - AutoComputePercentages *bool `xml:"autoComputePercentages"` + CpuFailoverResourcesPercent int32 `xml:"cpuFailoverResourcesPercent"` + MemoryFailoverResourcesPercent int32 `xml:"memoryFailoverResourcesPercent"` + FailoverLevel int32 `xml:"failoverLevel,omitempty"` + AutoComputePercentages *bool `xml:"autoComputePercentages"` + PMemFailoverResourcesPercent int32 `xml:"pMemFailoverResourcesPercent,omitempty"` + AutoComputePMemFailoverResourcesPercent *bool `xml:"autoComputePMemFailoverResourcesPercent"` } func init() { @@ -9476,6 +9551,7 @@ type ComputeResourceConfigInfo struct { VmSwapPlacement string `xml:"vmSwapPlacement"` SpbmEnabled *bool `xml:"spbmEnabled"` DefaultHardwareVersionKey string `xml:"defaultHardwareVersionKey,omitempty"` + MaximumHardwareVersionKey string `xml:"maximumHardwareVersionKey,omitempty"` } func init() { @@ -9489,6 +9565,7 @@ type ComputeResourceConfigSpec struct { SpbmEnabled *bool `xml:"spbmEnabled"` DefaultHardwareVersionKey string `xml:"defaultHardwareVersionKey,omitempty"` DesiredSoftwareSpec *DesiredSoftwareSpec `xml:"desiredSoftwareSpec,omitempty"` + MaximumHardwareVersionKey string `xml:"maximumHardwareVersionKey,omitempty"` } func init() { @@ -9583,6 +9660,7 @@ type ConfigTarget struct { DynamicPassthrough []VirtualMachineDynamicPassthroughInfo `xml:"dynamicPassthrough,omitempty"` SgxTargetInfo *VirtualMachineSgxTargetInfo `xml:"sgxTargetInfo,omitempty"` PrecisionClockInfo []VirtualMachinePrecisionClockInfo `xml:"precisionClockInfo,omitempty"` + SevSupported *bool `xml:"sevSupported"` } func init() { @@ -9647,8 +9725,9 @@ type ConfigureDatastorePrincipalResponse struct { } type ConfigureEvcModeRequestType struct { - This ManagedObjectReference `xml:"_this"` - EvcModeKey string `xml:"evcModeKey"` + This ManagedObjectReference `xml:"_this"` + EvcModeKey string `xml:"evcModeKey"` + EvcGraphicsModeKey string `xml:"evcGraphicsModeKey,omitempty"` } func init() { @@ -10340,6 +10419,7 @@ type CreateDirectoryRequestType struct { Datastore ManagedObjectReference `xml:"datastore"` DisplayName string `xml:"displayName,omitempty"` Policy string `xml:"policy,omitempty"` + Size int64 `xml:"size,omitempty"` } func init() { @@ -11128,9 +11208,10 @@ func init() { type CryptoKeyResult struct { DynamicData - KeyId CryptoKeyId `xml:"keyId"` - Success bool `xml:"success"` - Reason string `xml:"reason,omitempty"` + KeyId CryptoKeyId `xml:"keyId"` + Success bool `xml:"success"` + Reason string `xml:"reason,omitempty"` + Fault *LocalizedMethodFault `xml:"fault,omitempty"` } func init() { @@ -12898,6 +12979,7 @@ type DatacenterConfigInfo struct { DynamicData DefaultHardwareVersionKey string `xml:"defaultHardwareVersionKey,omitempty"` + MaximumHardwareVersionKey string `xml:"maximumHardwareVersionKey,omitempty"` } func init() { @@ -12908,6 +12990,7 @@ type DatacenterConfigSpec struct { DynamicData DefaultHardwareVersionKey string `xml:"defaultHardwareVersionKey,omitempty"` + MaximumHardwareVersionKey string `xml:"maximumHardwareVersionKey,omitempty"` } func init() { @@ -13618,6 +13701,26 @@ type DeleteSnapshot_TaskResponse struct { Returnval ManagedObjectReference `xml:"returnval"` } +type DeleteVStorageObjectExRequestType struct { + This ManagedObjectReference `xml:"_this"` + Id ID `xml:"id"` + Datastore ManagedObjectReference `xml:"datastore"` +} + +func init() { + t["DeleteVStorageObjectExRequestType"] = reflect.TypeOf((*DeleteVStorageObjectExRequestType)(nil)).Elem() +} + +type DeleteVStorageObjectEx_Task DeleteVStorageObjectExRequestType + +func init() { + t["DeleteVStorageObjectEx_Task"] = reflect.TypeOf((*DeleteVStorageObjectEx_Task)(nil)).Elem() +} + +type DeleteVStorageObjectEx_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + type DeleteVStorageObjectRequestType struct { This ManagedObjectReference `xml:"_this"` Id ID `xml:"id"` @@ -13783,6 +13886,7 @@ type DesiredSoftwareSpec struct { BaseImageSpec DesiredSoftwareSpecBaseImageSpec `xml:"baseImageSpec"` VendorAddOnSpec *DesiredSoftwareSpecVendorAddOnSpec `xml:"vendorAddOnSpec,omitempty"` + Components []DesiredSoftwareSpecComponentSpec `xml:"components,omitempty"` } func init() { @@ -13799,6 +13903,17 @@ func init() { t["DesiredSoftwareSpecBaseImageSpec"] = reflect.TypeOf((*DesiredSoftwareSpecBaseImageSpec)(nil)).Elem() } +type DesiredSoftwareSpecComponentSpec struct { + DynamicData + + Name string `xml:"name"` + Version string `xml:"version,omitempty"` +} + +func init() { + t["DesiredSoftwareSpecComponentSpec"] = reflect.TypeOf((*DesiredSoftwareSpecComponentSpec)(nil)).Elem() +} + type DesiredSoftwareSpecVendorAddOnSpec struct { DynamicData @@ -15207,6 +15322,25 @@ type DownloadDescriptionTreeResponse struct { Returnval []byte `xml:"returnval"` } +type DropConnections DropConnectionsRequestType + +func init() { + t["DropConnections"] = reflect.TypeOf((*DropConnections)(nil)).Elem() +} + +type DropConnectionsRequestType struct { + This ManagedObjectReference `xml:"_this"` + ListOfConnections []BaseVirtualMachineConnection `xml:"listOfConnections,omitempty,typeattr"` +} + +func init() { + t["DropConnectionsRequestType"] = reflect.TypeOf((*DropConnectionsRequestType)(nil)).Elem() +} + +type DropConnectionsResponse struct { + Returnval bool `xml:"returnval"` +} + type DrsDisabledEvent struct { ClusterEvent } @@ -18345,6 +18479,18 @@ func init() { t["FcoeFaultPnicHasNoPortSetFault"] = reflect.TypeOf((*FcoeFaultPnicHasNoPortSetFault)(nil)).Elem() } +type FeatureEVCMode struct { + ElementDescription + + Mask []HostFeatureMask `xml:"mask,omitempty"` + Capability []HostFeatureCapability `xml:"capability,omitempty"` + Requirement []VirtualMachineFeatureRequirement `xml:"requirement,omitempty"` +} + +func init() { + t["FeatureEVCMode"] = reflect.TypeOf((*FeatureEVCMode)(nil)).Elem() +} + type FeatureRequirementsNotMet struct { VirtualHardwareCompatibilityIssue @@ -19845,12 +19991,26 @@ type GuestInfo struct { GuestStateChangeSupported *bool `xml:"guestStateChangeSupported"` GenerationInfo []GuestInfoNamespaceGenerationInfo `xml:"generationInfo,omitempty"` HwVersion string `xml:"hwVersion,omitempty"` + CustomizationInfo *GuestInfoCustomizationInfo `xml:"customizationInfo,omitempty"` } func init() { t["GuestInfo"] = reflect.TypeOf((*GuestInfo)(nil)).Elem() } +type GuestInfoCustomizationInfo struct { + DynamicData + + CustomizationStatus string `xml:"customizationStatus"` + StartTime *time.Time `xml:"startTime"` + EndTime *time.Time `xml:"endTime"` + ErrorMsg string `xml:"errorMsg,omitempty"` +} + +func init() { + t["GuestInfoCustomizationInfo"] = reflect.TypeOf((*GuestInfoCustomizationInfo)(nil)).Elem() +} + type GuestInfoNamespaceGenerationInfo struct { DynamicData @@ -21004,7 +21164,9 @@ type HostCapability struct { Vmfs3EOLSupported *bool `xml:"vmfs3EOLSupported"` FtVmcpSupported *bool `xml:"ftVmcpSupported"` QuickBootSupported *bool `xml:"quickBootSupported"` + EncryptedFtSupported *bool `xml:"encryptedFtSupported"` AssignableHardwareSupported *bool `xml:"assignableHardwareSupported"` + SuspendToMemorySupported *bool `xml:"suspendToMemorySupported"` UseFeatureReqsForOldHWv *bool `xml:"useFeatureReqsForOldHWv"` MarkPerenniallyReservedSupported *bool `xml:"markPerenniallyReservedSupported"` HppPspSupported *bool `xml:"hppPspSupported"` @@ -21013,6 +21175,10 @@ type HostCapability struct { PrecisionTimeProtocolSupported *bool `xml:"precisionTimeProtocolSupported"` RemoteDeviceVMotionSupported *bool `xml:"remoteDeviceVMotionSupported"` MaxSupportedVmMemory int32 `xml:"maxSupportedVmMemory,omitempty"` + AhDeviceHintsSupported *bool `xml:"ahDeviceHintsSupported"` + AssignHwPciConfigSupported *bool `xml:"assignHwPciConfigSupported"` + PMemFailoverSupported *bool `xml:"pMemFailoverSupported"` + HostConfigEncryptionSupported *bool `xml:"hostConfigEncryptionSupported"` } func init() { @@ -21794,6 +21960,26 @@ func init() { t["HostDateTimeSystemTimeZone"] = reflect.TypeOf((*HostDateTimeSystemTimeZone)(nil)).Elem() } +type HostDeleteVStorageObjectExRequestType struct { + This ManagedObjectReference `xml:"_this"` + Id ID `xml:"id"` + Datastore ManagedObjectReference `xml:"datastore"` +} + +func init() { + t["HostDeleteVStorageObjectExRequestType"] = reflect.TypeOf((*HostDeleteVStorageObjectExRequestType)(nil)).Elem() +} + +type HostDeleteVStorageObjectEx_Task HostDeleteVStorageObjectExRequestType + +func init() { + t["HostDeleteVStorageObjectEx_Task"] = reflect.TypeOf((*HostDeleteVStorageObjectEx_Task)(nil)).Elem() +} + +type HostDeleteVStorageObjectEx_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + type HostDeleteVStorageObjectRequestType struct { This ManagedObjectReference `xml:"_this"` Id ID `xml:"id"` @@ -22607,6 +22793,7 @@ type HostHardwareInfo struct { ReliableMemoryInfo *HostReliableMemoryInfo `xml:"reliableMemoryInfo,omitempty"` PersistentMemoryInfo *HostPersistentMemoryInfo `xml:"persistentMemoryInfo,omitempty"` SgxInfo *HostSgxInfo `xml:"sgxInfo,omitempty"` + SevInfo *HostSevInfo `xml:"sevInfo,omitempty"` } func init() { @@ -23335,19 +23522,21 @@ func init() { 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"` - TpmAttestation *HostTpmAttestationInfo `xml:"tpmAttestation,omitempty"` + 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"` + CurrentEVCGraphicsModeKey string `xml:"currentEVCGraphicsModeKey,omitempty"` + Gateway *HostListSummaryGatewaySummary `xml:"gateway,omitempty"` + TpmAttestation *HostTpmAttestationInfo `xml:"tpmAttestation,omitempty"` + TrustAuthorityAttestationInfos []HostTrustAuthorityAttestationInfo `xml:"trustAuthorityAttestationInfos,omitempty"` } func init() { @@ -23885,6 +24074,7 @@ type HostNetCapabilities struct { DnsConfigSupported bool `xml:"dnsConfigSupported"` DhcpOnVnicSupported bool `xml:"dhcpOnVnicSupported"` IpV6Supported *bool `xml:"ipV6Supported"` + BackupNfcNiocSupported *bool `xml:"backupNfcNiocSupported"` } func init() { @@ -23937,6 +24127,7 @@ type HostNetworkConfig struct { Nat []HostNatServiceConfig `xml:"nat,omitempty"` IpV6Enabled *bool `xml:"ipV6Enabled"` NetStackSpec []HostNetworkConfigNetStackSpec `xml:"netStackSpec,omitempty"` + MigrationStatus string `xml:"migrationStatus,omitempty"` } func init() { @@ -23968,25 +24159,27 @@ func init() { type HostNetworkInfo struct { DynamicData - Vswitch []HostVirtualSwitch `xml:"vswitch,omitempty"` - ProxySwitch []HostProxySwitch `xml:"proxySwitch,omitempty"` - Portgroup []HostPortGroup `xml:"portgroup,omitempty"` - Pnic []PhysicalNic `xml:"pnic,omitempty"` - RdmaDevice []HostRdmaDevice `xml:"rdmaDevice,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"` - NsxTransportNodeId string `xml:"nsxTransportNodeId,omitempty"` + Vswitch []HostVirtualSwitch `xml:"vswitch,omitempty"` + ProxySwitch []HostProxySwitch `xml:"proxySwitch,omitempty"` + Portgroup []HostPortGroup `xml:"portgroup,omitempty"` + Pnic []PhysicalNic `xml:"pnic,omitempty"` + RdmaDevice []HostRdmaDevice `xml:"rdmaDevice,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"` + NsxTransportNodeId string `xml:"nsxTransportNodeId,omitempty"` + NvdsToVdsMigrationRequired *bool `xml:"nvdsToVdsMigrationRequired"` + MigrationStatus string `xml:"migrationStatus,omitempty"` } func init() { @@ -24577,6 +24770,7 @@ type HostPciPassthruConfig struct { Id string `xml:"id"` PassthruEnabled bool `xml:"passthruEnabled"` ApplyNow *bool `xml:"applyNow"` + HardwareLabel string `xml:"hardwareLabel,omitempty"` } func init() { @@ -24591,6 +24785,7 @@ type HostPciPassthruInfo struct { PassthruEnabled bool `xml:"passthruEnabled"` PassthruCapable bool `xml:"passthruCapable"` PassthruActive bool `xml:"passthruActive"` + HardwareLabel string `xml:"hardwareLabel,omitempty"` } func init() { @@ -25423,21 +25618,22 @@ type HostRetrieveVStorageObjectStateResponse struct { type HostRuntimeInfo struct { DynamicData - ConnectionState HostSystemConnectionState `xml:"connectionState"` - PowerState HostSystemPowerState `xml:"powerState"` - StandbyMode string `xml:"standbyMode,omitempty"` - InMaintenanceMode bool `xml:"inMaintenanceMode"` - InQuarantineMode *bool `xml:"inQuarantineMode"` - 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"` - CryptoState string `xml:"cryptoState,omitempty"` - CryptoKeyId *CryptoKeyId `xml:"cryptoKeyId,omitempty"` + ConnectionState HostSystemConnectionState `xml:"connectionState"` + PowerState HostSystemPowerState `xml:"powerState"` + StandbyMode string `xml:"standbyMode,omitempty"` + InMaintenanceMode bool `xml:"inMaintenanceMode"` + InQuarantineMode *bool `xml:"inQuarantineMode"` + 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"` + CryptoState string `xml:"cryptoState,omitempty"` + CryptoKeyId *CryptoKeyId `xml:"cryptoKeyId,omitempty"` + StatelessNvdsMigrationReady string `xml:"statelessNvdsMigrationReady,omitempty"` } func init() { @@ -25676,6 +25872,17 @@ func init() { type HostSetVStorageObjectControlFlagsResponse struct { } +type HostSevInfo struct { + DynamicData + + SevState string `xml:"sevState"` + MaxSevEsGuests int64 `xml:"maxSevEsGuests"` +} + +func init() { + t["HostSevInfo"] = reflect.TypeOf((*HostSevInfo)(nil)).Elem() +} + type HostSgxInfo struct { DynamicData @@ -26258,6 +26465,14 @@ func init() { t["HostTpmEventLogEntry"] = reflect.TypeOf((*HostTpmEventLogEntry)(nil)).Elem() } +type HostTpmNvTagEventDetails struct { + HostTpmBootSecurityOptionEventDetails +} + +func init() { + t["HostTpmNvTagEventDetails"] = reflect.TypeOf((*HostTpmNvTagEventDetails)(nil)).Elem() +} + type HostTpmOptionEventDetails struct { HostTpmEventDetails @@ -26282,6 +26497,20 @@ func init() { t["HostTpmSoftwareComponentEventDetails"] = reflect.TypeOf((*HostTpmSoftwareComponentEventDetails)(nil)).Elem() } +type HostTrustAuthorityAttestationInfo struct { + DynamicData + + AttestationStatus string `xml:"attestationStatus"` + ServiceId string `xml:"serviceId,omitempty"` + AttestedAt *time.Time `xml:"attestedAt"` + AttestedUntil *time.Time `xml:"attestedUntil"` + Messages []LocalizableMessage `xml:"messages,omitempty"` +} + +func init() { + t["HostTrustAuthorityAttestationInfo"] = reflect.TypeOf((*HostTrustAuthorityAttestationInfo)(nil)).Elem() +} + type HostUnresolvedVmfsExtent struct { DynamicData @@ -26358,6 +26587,28 @@ func init() { t["HostUnresolvedVmfsVolumeResolveStatus"] = reflect.TypeOf((*HostUnresolvedVmfsVolumeResolveStatus)(nil)).Elem() } +type HostUpdateVStorageObjectMetadataExRequestType struct { + This ManagedObjectReference `xml:"_this"` + Id ID `xml:"id"` + Datastore ManagedObjectReference `xml:"datastore"` + Metadata []KeyValue `xml:"metadata,omitempty"` + DeleteKeys []string `xml:"deleteKeys,omitempty"` +} + +func init() { + t["HostUpdateVStorageObjectMetadataExRequestType"] = reflect.TypeOf((*HostUpdateVStorageObjectMetadataExRequestType)(nil)).Elem() +} + +type HostUpdateVStorageObjectMetadataEx_Task HostUpdateVStorageObjectMetadataExRequestType + +func init() { + t["HostUpdateVStorageObjectMetadataEx_Task"] = reflect.TypeOf((*HostUpdateVStorageObjectMetadataEx_Task)(nil)).Elem() +} + +type HostUpdateVStorageObjectMetadataEx_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + type HostUpdateVStorageObjectMetadataRequestType struct { This ManagedObjectReference `xml:"_this"` Id ID `xml:"id"` @@ -27257,6 +27508,36 @@ func init() { t["HttpNfcLeaseManifestEntry"] = reflect.TypeOf((*HttpNfcLeaseManifestEntry)(nil)).Elem() } +type HttpNfcLeaseProbeResult struct { + DynamicData + + ServerAccessible bool `xml:"serverAccessible"` +} + +func init() { + t["HttpNfcLeaseProbeResult"] = reflect.TypeOf((*HttpNfcLeaseProbeResult)(nil)).Elem() +} + +type HttpNfcLeaseProbeUrls HttpNfcLeaseProbeUrlsRequestType + +func init() { + t["HttpNfcLeaseProbeUrls"] = reflect.TypeOf((*HttpNfcLeaseProbeUrls)(nil)).Elem() +} + +type HttpNfcLeaseProbeUrlsRequestType struct { + This ManagedObjectReference `xml:"_this"` + Files []HttpNfcLeaseSourceFile `xml:"files,omitempty"` + Timeout int32 `xml:"timeout,omitempty"` +} + +func init() { + t["HttpNfcLeaseProbeUrlsRequestType"] = reflect.TypeOf((*HttpNfcLeaseProbeUrlsRequestType)(nil)).Elem() +} + +type HttpNfcLeaseProbeUrlsResponse struct { + Returnval []HttpNfcLeaseProbeResult `xml:"returnval,omitempty"` +} + type HttpNfcLeaseProgress HttpNfcLeaseProgressRequestType func init() { @@ -29700,6 +29981,9 @@ type KmipClusterInfo struct { UseAsDefault bool `xml:"useAsDefault"` ManagementType string `xml:"managementType,omitempty"` UseAsEntityDefault []ManagedObjectReference `xml:"useAsEntityDefault,omitempty"` + HasBackup *bool `xml:"hasBackup"` + TpmRequired *bool `xml:"tpmRequired"` + KeyId string `xml:"keyId,omitempty"` } func init() { @@ -32707,7 +32991,7 @@ type NetworkSummary struct { Name string `xml:"name"` Accessible bool `xml:"accessible"` IpPoolName string `xml:"ipPoolName"` - IpPoolId int32 `xml:"ipPoolId,omitempty"` + IpPoolId *int32 `xml:"ipPoolId"` } func init() { @@ -37789,6 +38073,24 @@ type QueryConnectionInfoViaSpecResponse struct { Returnval HostConnectInfo `xml:"returnval"` } +type QueryConnections QueryConnectionsRequestType + +func init() { + t["QueryConnections"] = reflect.TypeOf((*QueryConnections)(nil)).Elem() +} + +type QueryConnectionsRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["QueryConnectionsRequestType"] = reflect.TypeOf((*QueryConnectionsRequestType)(nil)).Elem() +} + +type QueryConnectionsResponse struct { + Returnval []BaseVirtualMachineConnection `xml:"returnval,omitempty,typeattr"` +} + type QueryCryptoKeyStatus QueryCryptoKeyStatusRequestType func init() { @@ -41144,6 +41446,7 @@ type RemoveInternetScsiSendTargetsRequestType struct { This ManagedObjectReference `xml:"_this"` IScsiHbaDevice string `xml:"iScsiHbaDevice"` Targets []HostInternetScsiHbaSendTarget `xml:"targets"` + Force *bool `xml:"force"` } func init() { @@ -44279,6 +44582,7 @@ type SessionManagerGenericServiceTicket struct { Id string `xml:"id"` HostName string `xml:"hostName,omitempty"` SslThumbprint string `xml:"sslThumbprint,omitempty"` + TicketType string `xml:"ticketType,omitempty"` } func init() { @@ -46727,18 +47031,19 @@ func init() { type ToolsConfigInfo struct { DynamicData - ToolsVersion int32 `xml:"toolsVersion,omitempty"` - ToolsInstallType string `xml:"toolsInstallType,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"` - CustomizationKeyId *CryptoKeyId `xml:"customizationKeyId,omitempty"` - SyncTimeWithHost *bool `xml:"syncTimeWithHost"` - LastInstallInfo *ToolsConfigInfoToolsLastInstallInfo `xml:"lastInstallInfo,omitempty"` + ToolsVersion int32 `xml:"toolsVersion,omitempty"` + ToolsInstallType string `xml:"toolsInstallType,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"` + CustomizationKeyId *CryptoKeyId `xml:"customizationKeyId,omitempty"` + SyncTimeWithHostAllowed *bool `xml:"syncTimeWithHostAllowed"` + SyncTimeWithHost *bool `xml:"syncTimeWithHost"` + LastInstallInfo *ToolsConfigInfoToolsLastInstallInfo `xml:"lastInstallInfo,omitempty"` } func init() { @@ -49652,6 +49957,28 @@ func init() { t["VAppTaskInProgressFault"] = reflect.TypeOf((*VAppTaskInProgressFault)(nil)).Elem() } +type VCenterUpdateVStorageObjectMetadataExRequestType struct { + This ManagedObjectReference `xml:"_this"` + Id ID `xml:"id"` + Datastore ManagedObjectReference `xml:"datastore"` + Metadata []KeyValue `xml:"metadata,omitempty"` + DeleteKeys []string `xml:"deleteKeys,omitempty"` +} + +func init() { + t["VCenterUpdateVStorageObjectMetadataExRequestType"] = reflect.TypeOf((*VCenterUpdateVStorageObjectMetadataExRequestType)(nil)).Elem() +} + +type VCenterUpdateVStorageObjectMetadataEx_Task VCenterUpdateVStorageObjectMetadataExRequestType + +func init() { + t["VCenterUpdateVStorageObjectMetadataEx_Task"] = reflect.TypeOf((*VCenterUpdateVStorageObjectMetadataEx_Task)(nil)).Elem() +} + +type VCenterUpdateVStorageObjectMetadataEx_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + type VFlashCacheHotConfigNotSupported struct { VmConfigFault } @@ -49949,6 +50276,7 @@ type VMwareDVSFeatureCapability struct { VspanCapability *VMwareDVSVspanCapability `xml:"vspanCapability,omitempty"` LacpCapability *VMwareDvsLacpCapability `xml:"lacpCapability,omitempty"` NsxSupported *bool `xml:"nsxSupported"` + MtuCapability *VMwareDvsMtuCapability `xml:"mtuCapability,omitempty"` } func init() { @@ -50122,6 +50450,7 @@ type VMwareDvsLacpCapability struct { LacpSupported *bool `xml:"lacpSupported"` MultiLacpGroupSupported *bool `xml:"multiLacpGroupSupported"` + LacpFastModeSupported *bool `xml:"lacpFastModeSupported"` } func init() { @@ -50140,6 +50469,7 @@ type VMwareDvsLacpGroupConfig struct { Ipfix *VMwareDvsLagIpfixConfig `xml:"ipfix,omitempty"` UplinkName []string `xml:"uplinkName,omitempty"` UplinkPortKey []string `xml:"uplinkPortKey,omitempty"` + TimeoutMode string `xml:"timeoutMode,omitempty"` } func init() { @@ -50177,6 +50507,17 @@ func init() { t["VMwareDvsLagVlanConfig"] = reflect.TypeOf((*VMwareDvsLagVlanConfig)(nil)).Elem() } +type VMwareDvsMtuCapability struct { + DynamicData + + MinMtuSupported int32 `xml:"minMtuSupported"` + MaxMtuSupported int32 `xml:"maxMtuSupported"` +} + +func init() { + t["VMwareDvsMtuCapability"] = reflect.TypeOf((*VMwareDvsMtuCapability)(nil)).Elem() +} + type VMwareIpfixConfig struct { DynamicData @@ -52082,6 +52423,10 @@ type VirtualMachineCapability struct { VirtualMmuUsageIgnored *bool `xml:"virtualMmuUsageIgnored"` VirtualExecUsageIgnored *bool `xml:"virtualExecUsageIgnored"` DiskOnlySnapshotOnSuspendedVMSupported *bool `xml:"diskOnlySnapshotOnSuspendedVMSupported"` + SuspendToMemorySupported *bool `xml:"suspendToMemorySupported"` + ToolsSyncTimeAllowSupported *bool `xml:"toolsSyncTimeAllowSupported"` + SevSupported *bool `xml:"sevSupported"` + PmemFailoverSupported *bool `xml:"pmemFailoverSupported"` } func init() { @@ -52185,7 +52530,10 @@ type VirtualMachineConfigInfo struct { MigrateEncryption string `xml:"migrateEncryption,omitempty"` SgxInfo *VirtualMachineSgxInfo `xml:"sgxInfo,omitempty"` ContentLibItemInfo *VirtualMachineContentLibraryItemInfo `xml:"contentLibItemInfo,omitempty"` + FtEncryptionMode string `xml:"ftEncryptionMode,omitempty"` GuestMonitoringModeInfo *VirtualMachineGuestMonitoringModeInfo `xml:"guestMonitoringModeInfo,omitempty"` + SevEnabled *bool `xml:"sevEnabled"` + PmemFailoverEnabled *bool `xml:"pmemFailoverEnabled"` } func init() { @@ -52316,7 +52664,10 @@ type VirtualMachineConfigSpec struct { Crypto BaseCryptoSpec `xml:"crypto,omitempty,typeattr"` MigrateEncryption string `xml:"migrateEncryption,omitempty"` SgxInfo *VirtualMachineSgxInfo `xml:"sgxInfo,omitempty"` + FtEncryptionMode string `xml:"ftEncryptionMode,omitempty"` GuestMonitoringModeInfo *VirtualMachineGuestMonitoringModeInfo `xml:"guestMonitoringModeInfo,omitempty"` + SevEnabled *bool `xml:"sevEnabled"` + PmemFailoverEnabled *bool `xml:"pmemFailoverEnabled"` } func init() { @@ -52353,6 +52704,18 @@ func init() { t["VirtualMachineConfigSummary"] = reflect.TypeOf((*VirtualMachineConfigSummary)(nil)).Elem() } +type VirtualMachineConnection struct { + DynamicData + + Label string `xml:"label"` + Client string `xml:"client"` + UserName string `xml:"userName"` +} + +func init() { + t["VirtualMachineConnection"] = reflect.TypeOf((*VirtualMachineConnection)(nil)).Elem() +} + type VirtualMachineConsolePreferences struct { DynamicData @@ -52887,6 +53250,14 @@ func init() { t["VirtualMachineMetadataManagerVmMetadataResult"] = reflect.TypeOf((*VirtualMachineMetadataManagerVmMetadataResult)(nil)).Elem() } +type VirtualMachineMksConnection struct { + VirtualMachineConnection +} + +func init() { + t["VirtualMachineMksConnection"] = reflect.TypeOf((*VirtualMachineMksConnection)(nil)).Elem() +} + type VirtualMachineMksTicket struct { DynamicData @@ -53113,6 +53484,7 @@ type VirtualMachineRuntimeInfo struct { Host *ManagedObjectReference `xml:"host,omitempty"` ConnectionState VirtualMachineConnectionState `xml:"connectionState"` PowerState VirtualMachinePowerState `xml:"powerState"` + VmFailoverInProgress *bool `xml:"vmFailoverInProgress"` FaultToleranceState VirtualMachineFaultToleranceState `xml:"faultToleranceState,omitempty"` DasVmProtection *VirtualMachineRuntimeInfoDasProtectionState `xml:"dasVmProtection,omitempty"` ToolsInstallerMounted bool `xml:"toolsInstallerMounted"` @@ -53139,6 +53511,7 @@ type VirtualMachineRuntimeInfo struct { QuiescedForkParent *bool `xml:"quiescedForkParent"` InstantCloneFrozen *bool `xml:"instantCloneFrozen"` CryptoState string `xml:"cryptoState,omitempty"` + SuspendedToMemory *bool `xml:"suspendedToMemory"` } func init() { @@ -53513,7 +53886,8 @@ func init() { type VirtualNVDIMM struct { VirtualDevice - CapacityInMB int64 `xml:"capacityInMB"` + CapacityInMB int64 `xml:"capacityInMB"` + ConfiguredCapacityInMB int64 `xml:"configuredCapacityInMB,omitempty"` } func init() { @@ -53713,7 +54087,8 @@ func init() { type VirtualPCIPassthroughVmiopBackingInfo struct { VirtualPCIPassthroughPluginBackingInfo - Vgpu string `xml:"vgpu,omitempty"` + Vgpu string `xml:"vgpu,omitempty"` + MigrateSupported *bool `xml:"migrateSupported"` } func init() { @@ -56490,6 +56865,17 @@ func init() { t["VsanClusterUuidMismatchFault"] = reflect.TypeOf((*VsanClusterUuidMismatchFault)(nil)).Elem() } +type VsanDatastoreInfo struct { + DatastoreInfo + + MembershipUuid string `xml:"membershipUuid,omitempty"` + AccessGenNo int32 `xml:"accessGenNo,omitempty"` +} + +func init() { + t["VsanDatastoreInfo"] = reflect.TypeOf((*VsanDatastoreInfo)(nil)).Elem() +} + type VsanDiskFault struct { VsanFault @@ -57785,3 +58171,13 @@ type VslmInfrastructureObjectPolicySpec struct { func init() { t["vslmInfrastructureObjectPolicySpec"] = reflect.TypeOf((*VslmInfrastructureObjectPolicySpec)(nil)).Elem() } + +type VslmVClockInfo struct { + DynamicData + + VClockTime int64 `xml:"vClockTime"` +} + +func init() { + t["vslmVClockInfo"] = reflect.TypeOf((*VslmVClockInfo)(nil)).Elem() +} diff --git a/vendor/github.com/vmware/govmomi/vim25/xml/marshal.go b/vendor/github.com/vmware/govmomi/vim25/xml/marshal.go index 92c637177..c0c0a588b 100644 --- a/vendor/github.com/vmware/govmomi/vim25/xml/marshal.go +++ b/vendor/github.com/vmware/govmomi/vim25/xml/marshal.go @@ -479,8 +479,11 @@ func (p *printer) marshalValue(val reflect.Value, finfo *fieldInfo, startTemplat 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 + } else { + fv := xmlname.value(val, dontInitNilPointers) + if v, ok := fv.Interface().(Name); ok && v.Local != "" { + start.Name = v + } } } if start.Name.Local == "" && finfo != nil { @@ -505,7 +508,7 @@ func (p *printer) marshalValue(val reflect.Value, finfo *fieldInfo, startTemplat if finfo.flags&fAttr == 0 { continue } - fv := finfo.value(val) + fv := finfo.value(val, dontInitNilPointers) if finfo.flags&fOmitEmpty != 0 && isEmptyValue(fv) { continue @@ -814,7 +817,12 @@ func (p *printer) marshalStruct(tinfo *typeInfo, val reflect.Value) error { if finfo.flags&fAttr != 0 { continue } - vf := finfo.value(val) + vf := finfo.value(val, dontInitNilPointers) + if !vf.IsValid() { + // The field is behind an anonymous struct field that's + // nil. Skip it. + continue + } switch finfo.flags & fMode { case fCDATA, fCharData: @@ -925,7 +933,7 @@ func (p *printer) marshalStruct(tinfo *typeInfo, val reflect.Value) error { p.WriteString("-->") continue - case fInnerXml: + case fInnerXML: vf = indirect(vf) iface := vf.Interface() switch raw := iface.(type) { diff --git a/vendor/github.com/vmware/govmomi/vim25/xml/read.go b/vendor/github.com/vmware/govmomi/vim25/xml/read.go index 60f71582d..ea61352f6 100644 --- a/vendor/github.com/vmware/govmomi/vim25/xml/read.go +++ b/vendor/github.com/vmware/govmomi/vim25/xml/read.go @@ -491,7 +491,7 @@ func (d *Decoder) unmarshal(val reflect.Value, start *StartElement) error { } return UnmarshalError(e) } - fv := finfo.value(sv) + fv := finfo.value(sv, initNilPointers) if _, ok := fv.Interface().(Name); ok { fv.Set(reflect.ValueOf(start.Name)) } @@ -505,7 +505,7 @@ func (d *Decoder) unmarshal(val reflect.Value, start *StartElement) error { finfo := &tinfo.fields[i] switch finfo.flags & fMode { case fAttr: - strv := finfo.value(sv) + strv := finfo.value(sv, initNilPointers) if a.Name.Local == finfo.name && (finfo.xmlns == "" || finfo.xmlns == a.Name.Space) { needTypeAttr := (finfo.flags & fTypeAttr) != 0 // HACK: avoid using xsi:type value for a "type" attribute, such as ManagedObjectReference.Type for example. @@ -525,7 +525,7 @@ func (d *Decoder) unmarshal(val reflect.Value, start *StartElement) error { } if !handled && any >= 0 { finfo := &tinfo.fields[any] - strv := finfo.value(sv) + strv := finfo.value(sv, initNilPointers) if err := d.unmarshalAttr(strv, a); err != nil { return err } @@ -538,22 +538,22 @@ func (d *Decoder) unmarshal(val reflect.Value, start *StartElement) error { switch finfo.flags & fMode { case fCDATA, fCharData: if !saveData.IsValid() { - saveData = finfo.value(sv) + saveData = finfo.value(sv, initNilPointers) } case fComment: if !saveComment.IsValid() { - saveComment = finfo.value(sv) + saveComment = finfo.value(sv, initNilPointers) } case fAny, fAny | fElement: if !saveAny.IsValid() { - saveAny = finfo.value(sv) + saveAny = finfo.value(sv, initNilPointers) } - case fInnerXml: + case fInnerXML: if !saveXML.IsValid() { - saveXML = finfo.value(sv) + saveXML = finfo.value(sv, initNilPointers) if d.saved == nil { saveXMLIndex = 0 d.saved = new(bytes.Buffer) @@ -769,7 +769,7 @@ Loop: } if len(finfo.parents) == len(parents) && finfo.name == start.Name.Local { // It's a perfect match, unmarshal the field. - return true, d.unmarshal(finfo.value(sv), start) + return true, d.unmarshal(finfo.value(sv, initNilPointers), start) } if len(finfo.parents) > len(parents) && finfo.parents[len(parents)] == start.Name.Local { // It's a prefix for the field. Break and recurse diff --git a/vendor/github.com/vmware/govmomi/vim25/xml/typeinfo.go b/vendor/github.com/vmware/govmomi/vim25/xml/typeinfo.go index 0d240b1e3..5eb0b4e5f 100644 --- a/vendor/github.com/vmware/govmomi/vim25/xml/typeinfo.go +++ b/vendor/github.com/vmware/govmomi/vim25/xml/typeinfo.go @@ -33,14 +33,14 @@ const ( fAttr fCDATA fCharData - fInnerXml + fInnerXML fComment fAny fOmitEmpty fTypeAttr - fMode = fElement | fAttr | fCDATA | fCharData | fInnerXml | fComment | fAny + fMode = fElement | fAttr | fCDATA | fCharData | fInnerXML | fComment | fAny xmlName = "XMLName" ) @@ -135,7 +135,7 @@ func structFieldInfo(typ reflect.Type, f *reflect.StructField) (*fieldInfo, erro case "chardata": finfo.flags |= fCharData case "innerxml": - finfo.flags |= fInnerXml + finfo.flags |= fInnerXML case "comment": finfo.flags |= fComment case "any": @@ -152,7 +152,7 @@ func structFieldInfo(typ reflect.Type, f *reflect.StructField) (*fieldInfo, erro switch mode := finfo.flags & fMode; mode { case 0: finfo.flags |= fElement - case fAttr, fCDATA, fCharData, fInnerXml, fComment, fAny, fAny | fAttr: + case fAttr, fCDATA, fCharData, fInnerXML, fComment, fAny, fAny | fAttr: if f.Name == xmlName || tag != "" && mode != fAttr { valid = false } @@ -347,15 +347,25 @@ 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) } +const ( + initNilPointers = true + dontInitNilPointers = false +) + // 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 { +// It's equivalent to v.FieldByIndex(finfo.idx), but when passed +// initNilPointers, it initializes and dereferences pointers as necessary. +// When passed dontInitNilPointers and a nil pointer is reached, the function +// returns a zero reflect.Value. +func (finfo *fieldInfo) value(v reflect.Value, shouldInitNilPointers bool) 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() { + if !shouldInitNilPointers { + return reflect.Value{} + } v.Set(reflect.New(v.Type().Elem())) } v = v.Elem() diff --git a/vendor/github.com/vmware/govmomi/vim25/xml/xml.go b/vendor/github.com/vmware/govmomi/vim25/xml/xml.go index 50117a00e..28631bdfe 100644 --- a/vendor/github.com/vmware/govmomi/vim25/xml/xml.go +++ b/vendor/github.com/vmware/govmomi/vim25/xml/xml.go @@ -290,7 +290,10 @@ func (d *Decoder) Token() (Token, error) { t = d.nextToken d.nextToken = nil } else if t, err = d.rawToken(); err != nil { - if err == io.EOF && d.stk != nil && d.stk.kind != stkEOF { + switch { + case err == io.EOF && d.t != nil: + err = nil + case err == io.EOF && d.stk != nil && d.stk.kind != stkEOF: err = d.syntaxError("unexpected EOF") } return t, err @@ -961,7 +964,7 @@ func (d *Decoder) ungetc(b byte) { d.offset-- } -var entity = map[string]int{ +var entity = map[string]rune{ "lt": '<', "gt": '>', "amp": '&', @@ -1056,7 +1059,7 @@ Input: d.buf.WriteByte(';') n, err := strconv.ParseUint(s, base, 64) if err == nil && n <= unicode.MaxRune { - text = string(n) + text = string(rune(n)) haveText = true } } diff --git a/vendor/github.com/vmware/govmomi/vsan/vsanfs/types/enum.go b/vendor/github.com/vmware/govmomi/vsan/vsanfs/types/enum.go new file mode 100644 index 000000000..56c412e2b --- /dev/null +++ b/vendor/github.com/vmware/govmomi/vsan/vsanfs/types/enum.go @@ -0,0 +1,35 @@ +/* +Copyright (c) 2019 VMware, Inc. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES 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" + + "github.com/vmware/govmomi/vim25/types" +) + +type VsanFileShareAccessType string + +const ( + VsanFileShareAccessTypeREAD_ONLY = VsanFileShareAccessType("READ_ONLY") + VsanFileShareAccessTypeREAD_WRITE = VsanFileShareAccessType("READ_WRITE") + VsanFileShareAccessTypeNO_ACCESS = VsanFileShareAccessType("NO_ACCESS") +) + +func init() { + types.Add("VsanFileShareAccessType", reflect.TypeOf((*VsanFileShareAccessType)(nil)).Elem()) +} diff --git a/vendor/github.com/vmware/govmomi/vsan/vsanfs/types/types.go b/vendor/github.com/vmware/govmomi/vsan/vsanfs/types/types.go new file mode 100644 index 000000000..8e08ac6f9 --- /dev/null +++ b/vendor/github.com/vmware/govmomi/vsan/vsanfs/types/types.go @@ -0,0 +1,33 @@ +/* +Copyright (c) 2019 VMware, Inc. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES 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" + + "github.com/vmware/govmomi/vim25/types" +) + +type VsanFileShareNetPermission struct { + Ips string `xml:"ips"` + Permissions VsanFileShareAccessType `xml:"permissions,omitempty,typeattr"` + AllowRoot bool `xml:"allowRoot,omitempty"` +} + +func init() { + types.Add("VsanFileShareNetPermission", reflect.TypeOf((*VsanFileShareNetPermission)(nil)).Elem()) +} diff --git a/vendor/modules.txt b/vendor/modules.txt index 890012e51..aadd79176 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -291,8 +291,11 @@ github.com/ubccr/kerby/khttp github.com/valyala/bytebufferpool # github.com/valyala/fasttemplate v1.2.1 github.com/valyala/fasttemplate -# github.com/vmware/govmomi v0.23.0 +# github.com/vmware/govmomi v0.26.1 ## explicit +github.com/vmware/govmomi/cns +github.com/vmware/govmomi/cns/methods +github.com/vmware/govmomi/cns/types github.com/vmware/govmomi/find github.com/vmware/govmomi/govc/cli github.com/vmware/govmomi/govc/datastore @@ -308,6 +311,9 @@ github.com/vmware/govmomi/list github.com/vmware/govmomi/nfc github.com/vmware/govmomi/object github.com/vmware/govmomi/ovf +github.com/vmware/govmomi/pbm +github.com/vmware/govmomi/pbm/methods +github.com/vmware/govmomi/pbm/types github.com/vmware/govmomi/property github.com/vmware/govmomi/session github.com/vmware/govmomi/session/cache @@ -328,6 +334,7 @@ github.com/vmware/govmomi/vim25/soap github.com/vmware/govmomi/vim25/types github.com/vmware/govmomi/vim25/xml github.com/vmware/govmomi/vmdk +github.com/vmware/govmomi/vsan/vsanfs/types # go.opencensus.io v0.22.5 go.opencensus.io go.opencensus.io/internal