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] <support@github.com>
This commit is contained in:
parent
974c258382
commit
137819b9cd
77 changed files with 7610 additions and 486 deletions
2
go.mod
2
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
|
||||
|
|
|
|||
6
go.sum
6
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=
|
||||
|
|
|
|||
57
vendor/github.com/vmware/govmomi/CONTRIBUTORS
generated
vendored
57
vendor/github.com/vmware/govmomi/CONTRIBUTORS
generated
vendored
|
|
@ -5,14 +5,17 @@
|
|||
|
||||
Abhijeet Kasurde <akasurde@redhat.com>
|
||||
abrarshivani <abrarshivani@users.noreply.github.com>
|
||||
Adam Chalkley <atc0005@users.noreply.github.com>
|
||||
Adam Shannon <adamkshannon@gmail.com>
|
||||
Al Biheiri <abiheiri@apple.com>
|
||||
Alessandro Cortiana <alessandro.cortiana@gmail.com>
|
||||
Alex <puzo2002@gmail.com>
|
||||
Alex Bozhenko <alexbozhenko@fb.com>
|
||||
Alex Ellis (VMware) <alexellis2@gmail.com>
|
||||
Alex <puzo2002@gmail.com>
|
||||
Aligator <8278538+yet-another-aligator@users.noreply.github.com>
|
||||
Alvaro Miranda <kikitux@gmail.com>
|
||||
Amanda H. L. de Andrade <amanda.andrade@serpro.gov.br>
|
||||
amanpaha <amanpahariya@microsoft.com>
|
||||
Amit Bathla <abathla@.vmware.com>
|
||||
amit bezalel <amit.bezalel@hpe.com>
|
||||
Andrew <AndrewDi@users.noreply.github.com>
|
||||
|
|
@ -24,34 +27,43 @@ angystardust <angystardust@users.noreply.github.com>
|
|||
aniketGslab <aniket.shinde@gslab.com>
|
||||
Ankit Vaidya <vaidyaa@vmware.com>
|
||||
Anna Carrigan <anna.carrigan@hpe.com>
|
||||
Ariel Chinn <arielchinn@gmail.com>
|
||||
Arran Walker <arran.walker@zopa.com>
|
||||
Artem Anisimov <aanisimov@inbox.ru>
|
||||
Arunesh Pandey <parunesh@vmware.com>
|
||||
Aryeh Weinreb <aryehweinreb@gmail.com>
|
||||
Augy StClair <augy@google.com>
|
||||
Austin Parker <aparker@apprenda.com>
|
||||
Balu Dontu <bdontu@vmware.com>
|
||||
bastienbc <bastien.barbe.creuly@gmail.com>
|
||||
Ben Corrie <bcorrie@vmware.com>
|
||||
Ben Vickers <bvickers@pivotal.io>
|
||||
Benjamin Davini <davinib@vmware.com>
|
||||
Benjamin Peterson <benjamin@python.org>
|
||||
Bhavya Choudhary <bhavyac@vmware.com>
|
||||
Bob Killen <killen.bob@gmail.com>
|
||||
Brad Fitzpatrick <bradfitz@golang.org>
|
||||
brian57860 <brian57860@users.noreply.github.com>
|
||||
Bruce Downs <bruceadowns@gmail.com>
|
||||
Cédric Blomart <cblomart@gmail.com>
|
||||
Cheng Cheng <chengch@vmware.com>
|
||||
Chethan Venkatesh <chethanv@vmware.com>
|
||||
Chris Marchesi <chrism@vancluevertech.com>
|
||||
Christian Höltje <docwhat@gerf.org>
|
||||
Clint Greenwood <cgreenwood@vmware.com>
|
||||
cpiment <pimentel.carlos@gmail.com>
|
||||
CuiHaozhi <cuihaozhi@chinacloud.com.cn>
|
||||
Daniel Mueller <deso@posteo.net>
|
||||
Cédric Blomart <cblomart@gmail.com>
|
||||
Dan Ilan <danilan@google.com>
|
||||
Dan Norris <protochron@users.noreply.github.com>
|
||||
Daniel Frederick Crisman <daniel@crisman.org>
|
||||
Daniel Mueller <deso@posteo.net>
|
||||
Danny Lockard <danny.lockard@banno.com>
|
||||
Dave Gress <gressd@vmware.com>
|
||||
Dave Smith-Uchida <dsmithuchida@vmware.com>
|
||||
Dave Tucker <dave@dtucker.co.uk>
|
||||
Davide Agnello <dagnello@hp.com>
|
||||
David Gress <gressd@vmware.com>
|
||||
David Stark <dave@davidstark.name>
|
||||
Davide Agnello <dagnello@hp.com>
|
||||
Davinder Kumar <davinderk@vmware.com>
|
||||
demarey <christophe.demarey@inria.fr>
|
||||
dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
|
||||
|
|
@ -59,6 +71,7 @@ Deric Crago <deric.crago@gmail.com>
|
|||
Divyen Patel <divyenp@vmware.com>
|
||||
Dnyanesh Gate <dnyanesh.gate@druva.com>
|
||||
Doug MacEachern <dougm@vmware.com>
|
||||
East <60801291+houfangdong@users.noreply.github.com>
|
||||
Eloy Coto <eloy.coto@gmail.com>
|
||||
Eric Edens <ericedens@google.com>
|
||||
Eric Graham <16710890+Pheric@users.noreply.github.com>
|
||||
|
|
@ -79,28 +92,35 @@ George Hicken <ghicken@vmware.com>
|
|||
Gerrit Renker <Gerrit.Renker@ctl.io>
|
||||
gthombare <gthombare@vmware.com>
|
||||
Hasan Mahmood <mahmoodh@vmware.com>
|
||||
Heiko Reese <hreese@users.noreply.github.com>
|
||||
Henrik Hodne <henrik@travis-ci.com>
|
||||
hkumar <hkumar@vmware.com>
|
||||
hui luo <luoh@vmware.com>
|
||||
Ian Eyberg <ian@deferpanic.com>
|
||||
Isaac Rodman <isaac@eyz.us>
|
||||
Ivan Mikushin <imikushin@vmware.com>
|
||||
Ivan Porto Carrero <icarrero@vmware.com>
|
||||
James King <james.king@emc.com>
|
||||
James Peach <jpeach@vmware.com>
|
||||
Jason Kincl <jkincl@gmail.com>
|
||||
Jeremy Canady <jcanady@jackhenry.com>
|
||||
jeremy-clerc <jeremy@clerc.io>
|
||||
Jiatong Wang <wjiatong@vmware.com>
|
||||
jingyizPensando <jingyiz@pensando.io>
|
||||
João Pereira <joaodrp@gmail.com>
|
||||
Jonas Ausevicius <jonas.ausevicius@virtustream.com>
|
||||
Jorge Sevilla <jorge.sevilla@rstor.io>
|
||||
João Pereira <joaodrp@gmail.com>
|
||||
Justin J. Novack <jnovack@users.noreply.github.com>
|
||||
kayrus <kay.diam@gmail.com>
|
||||
Kevin George <georgek@vmware.com>
|
||||
Knappek <andy.knapp.ak@gmail.com>
|
||||
Leslie Wang <qiwa@pensando.io>
|
||||
leslie-qiwa <leslie.qiwa@gmail.com>
|
||||
Lintong Jiang <lintongj@vmware.com>
|
||||
Liping Xue <lipingx@vmware.com>
|
||||
Louie Jiang <jiangl@vmware.com>
|
||||
Luther Monson <luther.monson@gmail.com>
|
||||
Madanagopal Arunachalam <marunachalam@vmware.com>
|
||||
maplain <fangyuanl@vmware.com>
|
||||
Marc Carmier <mcarmier@gmail.com>
|
||||
Marcus Tan <marcus.tan@rubrik.com>
|
||||
|
|
@ -109,15 +129,21 @@ Marin Atanasov Nikolov <mnikolov@vmware.com>
|
|||
Mario Trangoni <mjtrangoni@gmail.com>
|
||||
Mark Peek <markpeek@vmware.com>
|
||||
Matt Clay <matt@mystile.com>
|
||||
Matthew Cosgrove <matthew.cosgrove@dell.com>
|
||||
Matt Moore <mattmoor@vmware.com>
|
||||
Matt Moriarity <matt@mattmoriarity.com>
|
||||
Matthew Cosgrove <matthew.cosgrove@dell.com>
|
||||
mbhadale <mbhadale@vmware.com>
|
||||
Merlijn Sebrechts <merlijn.sebrechts@gmail.com>
|
||||
Mevan Samaratunga <mevansam@gmail.com>
|
||||
Michael Gasch <mgasch@vmware.com>
|
||||
Michal Jankowski <mjankowski@vmware.com>
|
||||
Mincho Tonev <mtonev@vmware.com>
|
||||
mingwei <mingwei@smartx.com>
|
||||
Nicolas Lamirault <nicolas.lamirault@gmail.com>
|
||||
Nikhil Kathare <nikhil.kathare@netapp.com>
|
||||
Omar Kohl <omarkohl@gmail.com>
|
||||
Parham Alvani <parham.alvani@gmail.com>
|
||||
Parveen Chahal <parkuma@microsoft.com>
|
||||
Pierre Gronlier <pierre.gronlier@corp.ovh.com>
|
||||
Pieter Noordhuis <pnoordhuis@vmware.com>
|
||||
prydin <prydin@vmware.com>
|
||||
|
|
@ -125,11 +151,15 @@ rHermes <teodor_spaeren@riseup.net>
|
|||
Rowan Jacobs <rojacobs@pivotal.io>
|
||||
rsikdar <rsikdar@berkeley.edu>
|
||||
runner.mei <runner.mei@gmail.com>
|
||||
Sandeep Pissay Srinivasa Rao <ssrinivas@vmware.com>
|
||||
S.Çağlar Onur <conur@vmware.com>
|
||||
Saad Malik <saad@spectrocloud.com>
|
||||
Sandeep Pissay Srinivasa Rao <ssrinivas@vmware.com>
|
||||
Scott Holden <scott@nullops.io>
|
||||
Sergey Ignatov <sergey.ignatov@jetbrains.com>
|
||||
serokles <timbo.alexander@gmail.com>
|
||||
shahra <shahra@vmware.com>
|
||||
Shalini Bhaskara <sbhaskara@vmware.com>
|
||||
Shaozhen Ding <dsz0111@gmail.com>
|
||||
Shawn Neal <sneal@sneal.net>
|
||||
shylasrinivas <sshyla@vmware.com>
|
||||
sky-joker <sky.jokerxx@gmail.com>
|
||||
|
|
@ -139,6 +169,7 @@ Steve Purcell <steve@sanityinc.com>
|
|||
SUMIT AGRAWAL <asumit@vmware.com>
|
||||
Takaaki Furukawa <takaaki.frkw@gmail.com>
|
||||
Tamas Eger <tamas.eger@bitrise.io>
|
||||
Tanay Kothari <tkothari@vmware.com>
|
||||
tanishi <tanishi503@gmail.com>
|
||||
Ted Zlatanov <tzz@lifelogs.com>
|
||||
Thad Craft <tcraft@pivotal.io>
|
||||
|
|
@ -154,15 +185,21 @@ Vikram Krishnamurthy <vikramkrishnamu@vmware.com>
|
|||
volanja <volaaanja@gmail.com>
|
||||
Volodymyr Bobyr <pupsua@gmail.com>
|
||||
Waldek Maleska <w.maleska@gmail.com>
|
||||
William Lam <info.virtuallyghetto@gmail.com>
|
||||
William Lam <wlam@vmware.com>
|
||||
Witold Krecicki <wpk@culm.net>
|
||||
xing-yang <xingyang105@gmail.com>
|
||||
yangxi <yangxi@vmware.com>
|
||||
Yang Yang <yangy@vmware.com>
|
||||
yangxi <yangxi@vmware.com>
|
||||
Yann Hodique <yhodique@google.com>
|
||||
Yash Nitin Desai <desaiy@vmware.com>
|
||||
Yassine TIJANI <ytijani@vmware.com>
|
||||
yiyingy <yiyingy@vmware.com>
|
||||
ykakarap <yuva2811@gmail.com>
|
||||
Yogesh Sobale <6104071+ysobale@users.noreply.github.com>
|
||||
Yun Zhou <yunz@vmware.com>
|
||||
Yuya Kusakabe <yuya.kusakabe@gmail.com>
|
||||
Zacharias Taubert <zacharias.taubert@gmail.com>
|
||||
Zach Tucker <ztucker@vmware.com>
|
||||
Zacharias Taubert <zacharias.taubert@gmail.com>
|
||||
Zee Yang <zeey@vmware.com>
|
||||
zyuxin <zyuxin@vmware.com>
|
||||
Кузаков Евгений <kuzakov@satel.org>
|
||||
|
|
|
|||
1
vendor/github.com/vmware/govmomi/cns/.gitignore
generated
vendored
Normal file
1
vendor/github.com/vmware/govmomi/cns/.gitignore
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
.soap/
|
||||
271
vendor/github.com/vmware/govmomi/cns/client.go
generated
vendored
Normal file
271
vendor/github.com/vmware/govmomi/cns/client.go
generated
vendored
Normal file
|
|
@ -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
|
||||
}
|
||||
180
vendor/github.com/vmware/govmomi/cns/cns_util.go
generated
vendored
Normal file
180
vendor/github.com/vmware/govmomi/cns/cns_util.go
generated
vendored
Normal file
|
|
@ -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
|
||||
}
|
||||
328
vendor/github.com/vmware/govmomi/cns/methods/methods.go
generated
vendored
Normal file
328
vendor/github.com/vmware/govmomi/cns/methods/methods.go
generated
vendored
Normal file
|
|
@ -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
|
||||
}
|
||||
94
vendor/github.com/vmware/govmomi/cns/types/enum.go
generated
vendored
Normal file
94
vendor/github.com/vmware/govmomi/cns/types/enum.go
generated
vendored
Normal file
|
|
@ -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())
|
||||
}
|
||||
117
vendor/github.com/vmware/govmomi/cns/types/if.go
generated
vendored
Normal file
117
vendor/github.com/vmware/govmomi/cns/types/if.go
generated
vendored
Normal file
|
|
@ -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())
|
||||
}
|
||||
880
vendor/github.com/vmware/govmomi/cns/types/types.go
generated
vendored
Normal file
880
vendor/github.com/vmware/govmomi/cns/types/types.go
generated
vendored
Normal file
|
|
@ -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())
|
||||
}
|
||||
35
vendor/github.com/vmware/govmomi/find/finder.go
generated
vendored
35
vendor/github.com/vmware/govmomi/find/finder.go
generated
vendored
|
|
@ -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 {
|
||||
|
|
|
|||
55
vendor/github.com/vmware/govmomi/govc/flags/client.go
generated
vendored
55
vendor/github.com/vmware/govmomi/govc/flags/client.go
generated
vendored
|
|
@ -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:
|
||||
|
|
|
|||
4
vendor/github.com/vmware/govmomi/govc/flags/datastore.go
generated
vendored
4
vendor/github.com/vmware/govmomi/govc/flags/datastore.go
generated
vendored
|
|
@ -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
|
||||
|
||||
|
|
|
|||
374
vendor/github.com/vmware/govmomi/govc/flags/debug.go
generated
vendored
374
vendor/github.com/vmware/govmomi/govc/flags/debug.go
generated
vendored
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
4
vendor/github.com/vmware/govmomi/govc/flags/folder.go
generated
vendored
4
vendor/github.com/vmware/govmomi/govc/flags/folder.go
generated
vendored
|
|
@ -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
|
||||
|
|
|
|||
2
vendor/github.com/vmware/govmomi/govc/flags/host_system.go
generated
vendored
2
vendor/github.com/vmware/govmomi/govc/flags/host_system.go
generated
vendored
|
|
@ -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
|
||||
|
|
|
|||
6
vendor/github.com/vmware/govmomi/govc/flags/network.go
generated
vendored
6
vendor/github.com/vmware/govmomi/govc/flags/network.go
generated
vendored
|
|
@ -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
|
||||
|
|
|
|||
39
vendor/github.com/vmware/govmomi/govc/flags/output.go
generated
vendored
39
vendor/github.com/vmware/govmomi/govc/flags/output.go
generated
vendored
|
|
@ -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{} {
|
||||
|
|
|
|||
4
vendor/github.com/vmware/govmomi/govc/flags/resource_pool.go
generated
vendored
4
vendor/github.com/vmware/govmomi/govc/flags/resource_pool.go
generated
vendored
|
|
@ -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
|
||||
|
|
|
|||
11
vendor/github.com/vmware/govmomi/govc/flags/version.go
generated
vendored
11
vendor/github.com/vmware/govmomi/govc/flags/version.go
generated
vendored
|
|
@ -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 {
|
||||
|
|
|
|||
22
vendor/github.com/vmware/govmomi/govc/host/esxcli/command.go
generated
vendored
22
vendor/github.com/vmware/govmomi/govc/host/esxcli/command.go
generated
vendored
|
|
@ -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</%s>", name, arg, name))
|
||||
}
|
||||
return internal.ReflectManagedMethodExecuterSoapArgument{
|
||||
Name: name,
|
||||
Val: fmt.Sprintf("<%s>%s</%s>", name, val, name),
|
||||
Val: strings.Join(vars, ""),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
16
vendor/github.com/vmware/govmomi/govc/importx/ovf.go
generated
vendored
16
vendor/github.com/vmware/govmomi/govc/importx/ovf.go
generated
vendored
|
|
@ -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
|
||||
|
||||
|
|
|
|||
8
vendor/github.com/vmware/govmomi/govc/importx/spec.go
generated
vendored
8
vendor/github.com/vmware/govmomi/govc/importx/spec.go
generated
vendored
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
2
vendor/github.com/vmware/govmomi/govc/vm/clone.go
generated
vendored
2
vendor/github.com/vmware/govmomi/govc/vm/clone.go
generated
vendored
|
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
15
vendor/github.com/vmware/govmomi/govc/vm/console.go
generated
vendored
15
vendor/github.com/vmware/govmomi/govc/vm/console.go
generated
vendored
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
16
vendor/github.com/vmware/govmomi/govc/vm/create.go
generated
vendored
16
vendor/github.com/vmware/govmomi/govc/vm/create.go
generated
vendored
|
|
@ -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)
|
||||
|
|
|
|||
78
vendor/github.com/vmware/govmomi/govc/vm/customize.go
generated
vendored
78
vendor/github.com/vmware/govmomi/govc/vm/customize.go
generated
vendored
|
|
@ -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
|
||||
|
|
|
|||
2
vendor/github.com/vmware/govmomi/govc/vm/guest/download.go
generated
vendored
2
vendor/github.com/vmware/govmomi/govc/vm/guest/download.go
generated
vendored
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
28
vendor/github.com/vmware/govmomi/govc/vm/guest/guest.go
generated
vendored
28
vendor/github.com/vmware/govmomi/govc/vm/guest/guest.go
generated
vendored
|
|
@ -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) {
|
||||
|
|
|
|||
10
vendor/github.com/vmware/govmomi/govc/vm/guest/run.go
generated
vendored
10
vendor/github.com/vmware/govmomi/govc/vm/guest/run.go
generated
vendored
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
2
vendor/github.com/vmware/govmomi/govc/vm/guest/upload.go
generated
vendored
2
vendor/github.com/vmware/govmomi/govc/vm/guest/upload.go
generated
vendored
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
250
vendor/github.com/vmware/govmomi/govc/vm/instantclone.go
generated
vendored
Normal file
250
vendor/github.com/vmware/govmomi/govc/vm/instantclone.go
generated
vendored
Normal file
|
|
@ -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. <key>=<value>")
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
4
vendor/github.com/vmware/govmomi/govc/vm/markasvm.go
generated
vendored
4
vendor/github.com/vmware/govmomi/govc/vm/markasvm.go
generated
vendored
|
|
@ -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 {
|
||||
|
|
|
|||
43
vendor/github.com/vmware/govmomi/guest/toolbox/client.go
generated
vendored
43
vendor/github.com/vmware/govmomi/guest/toolbox/client.go
generated
vendored
|
|
@ -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 {
|
||||
|
|
|
|||
38
vendor/github.com/vmware/govmomi/internal/helpers.go
generated
vendored
Normal file
38
vendor/github.com/vmware/govmomi/internal/helpers.go
generated
vendored
Normal file
|
|
@ -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
|
||||
}
|
||||
4
vendor/github.com/vmware/govmomi/nfc/lease.go
generated
vendored
4
vendor/github.com/vmware/govmomi/nfc/lease.go
generated
vendored
|
|
@ -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)
|
||||
|
|
|
|||
47
vendor/github.com/vmware/govmomi/object/authorization_manager.go
generated
vendored
47
vendor/github.com/vmware/govmomi/object/authorization_manager.go
generated
vendored
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
16
vendor/github.com/vmware/govmomi/object/virtual_app.go
generated
vendored
16
vendor/github.com/vmware/govmomi/object/virtual_app.go
generated
vendored
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
8
vendor/github.com/vmware/govmomi/object/virtual_device_list.go
generated
vendored
8
vendor/github.com/vmware/govmomi/object/virtual_device_list.go
generated
vendored
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
151
vendor/github.com/vmware/govmomi/object/virtual_machine.go
generated
vendored
151
vendor/github.com/vmware/govmomi/object/virtual_machine.go
generated
vendored
|
|
@ -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) {
|
||||
|
|
|
|||
8
vendor/github.com/vmware/govmomi/ovf/envelope.go
generated
vendored
8
vendor/github.com/vmware/govmomi/ovf/envelope.go
generated
vendored
|
|
@ -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 {
|
||||
|
|
|
|||
287
vendor/github.com/vmware/govmomi/pbm/client.go
generated
vendored
Normal file
287
vendor/github.com/vmware/govmomi/pbm/client.go
generated
vendored
Normal file
|
|
@ -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)
|
||||
}
|
||||
664
vendor/github.com/vmware/govmomi/pbm/methods/methods.go
generated
vendored
Normal file
664
vendor/github.com/vmware/govmomi/pbm/methods/methods.go
generated
vendored
Normal file
|
|
@ -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
|
||||
}
|
||||
148
vendor/github.com/vmware/govmomi/pbm/pbm_util.go
generated
vendored
Normal file
148
vendor/github.com/vmware/govmomi/pbm/pbm_util.go
generated
vendored
Normal file
|
|
@ -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
|
||||
}
|
||||
253
vendor/github.com/vmware/govmomi/pbm/types/enum.go
generated
vendored
Normal file
253
vendor/github.com/vmware/govmomi/pbm/types/enum.go
generated
vendored
Normal file
|
|
@ -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())
|
||||
}
|
||||
139
vendor/github.com/vmware/govmomi/pbm/types/if.go
generated
vendored
Normal file
139
vendor/github.com/vmware/govmomi/pbm/types/if.go
generated
vendored
Normal file
|
|
@ -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())
|
||||
}
|
||||
1724
vendor/github.com/vmware/govmomi/pbm/types/types.go
generated
vendored
Normal file
1724
vendor/github.com/vmware/govmomi/pbm/types/types.go
generated
vendored
Normal file
File diff suppressed because it is too large
Load diff
8
vendor/github.com/vmware/govmomi/session/cache/session.go
generated
vendored
8
vendor/github.com/vmware/govmomi/session/cache/session.go
generated
vendored
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
|||
11
vendor/github.com/vmware/govmomi/session/manager.go
generated
vendored
11
vendor/github.com/vmware/govmomi/session/manager.go
generated
vendored
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
1
vendor/github.com/vmware/govmomi/task/error.go
generated
vendored
1
vendor/github.com/vmware/govmomi/task/error.go
generated
vendored
|
|
@ -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.
|
||||
|
|
|
|||
2
vendor/github.com/vmware/govmomi/task/wait.go
generated
vendored
2
vendor/github.com/vmware/govmomi/task/wait.go
generated
vendored
|
|
@ -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
|
||||
|
|
|
|||
14
vendor/github.com/vmware/govmomi/vapi/library/library.go
generated
vendored
14
vendor/github.com/vmware/govmomi/vapi/library/library.go
generated
vendored
|
|
@ -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
|
||||
|
|
|
|||
14
vendor/github.com/vmware/govmomi/vapi/library/library_item.go
generated
vendored
14
vendor/github.com/vmware/govmomi/vapi/library/library_item.go
generated
vendored
|
|
@ -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)
|
||||
|
|
|
|||
23
vendor/github.com/vmware/govmomi/vapi/rest/client.go
generated
vendored
23
vendor/github.com/vmware/govmomi/vapi/rest/client.go
generated
vendored
|
|
@ -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)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
|
|||
9
vendor/github.com/vmware/govmomi/vapi/rest/resource.go
generated
vendored
9
vendor/github.com/vmware/govmomi/vapi/rest/resource.go
generated
vendored
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
|||
4
vendor/github.com/vmware/govmomi/view/container_view.go
generated
vendored
4
vendor/github.com/vmware/govmomi/view/container_view.go
generated
vendored
|
|
@ -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"}
|
||||
}
|
||||
|
|
|
|||
19
vendor/github.com/vmware/govmomi/vim25/debug/debug.go
generated
vendored
19
vendor/github.com/vmware/govmomi/vim25/debug/debug.go
generated
vendored
|
|
@ -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(`<password>(.*)</password>`)
|
||||
|
||||
|
|
@ -55,8 +69,5 @@ func Flush() {
|
|||
}
|
||||
|
||||
func Scrub(in []byte) []byte {
|
||||
out := string(in)
|
||||
out = scrubPassword.ReplaceAllString(out, `<password>********</password>`)
|
||||
|
||||
return []byte(out)
|
||||
return scrubPassword.ReplaceAll(in, []byte(`<password>********</password>`))
|
||||
}
|
||||
|
|
|
|||
9
vendor/github.com/vmware/govmomi/vim25/debug/file.go
generated
vendored
9
vendor/github.com/vmware/govmomi/vim25/debug/file.go
generated
vendored
|
|
@ -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()
|
||||
}
|
||||
|
|
|
|||
6
vendor/github.com/vmware/govmomi/vim25/debug/log.go
generated
vendored
6
vendor/github.com/vmware/govmomi/vim25/debug/log.go
generated
vendored
|
|
@ -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()
|
||||
}
|
||||
|
||||
|
|
|
|||
142
vendor/github.com/vmware/govmomi/vim25/methods/methods.go
generated
vendored
142
vendor/github.com/vmware/govmomi/vim25/methods/methods.go
generated
vendored
|
|
@ -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"`
|
||||
|
|
|
|||
2
vendor/github.com/vmware/govmomi/vim25/mo/mo.go
generated
vendored
2
vendor/github.com/vmware/govmomi/vim25/mo/mo.go
generated
vendored
|
|
@ -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.
|
||||
|
|
|
|||
3
vendor/github.com/vmware/govmomi/vim25/progress/reader.go
generated
vendored
3
vendor/github.com/vmware/govmomi/vim25/progress/reader.go
generated
vendored
|
|
@ -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)
|
||||
}
|
||||
|
||||
|
|
|
|||
72
vendor/github.com/vmware/govmomi/vim25/retry.go
generated
vendored
72
vendor/github.com/vmware/govmomi/vim25/retry.go
generated
vendored
|
|
@ -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
|
||||
|
|
|
|||
43
vendor/github.com/vmware/govmomi/vim25/soap/client.go
generated
vendored
43
vendor/github.com/vmware/govmomi/vim25/soap/client.go
generated
vendored
|
|
@ -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() {
|
||||
|
|
|
|||
21
vendor/github.com/vmware/govmomi/vim25/soap/debug.go
generated
vendored
21
vendor/github.com/vmware/govmomi/vim25/soap/debug.go
generated
vendored
|
|
@ -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)
|
||||
|
|
|
|||
10
vendor/github.com/vmware/govmomi/vim25/soap/error.go
generated
vendored
10
vendor/github.com/vmware/govmomi/vim25/soap/error.go
generated
vendored
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
454
vendor/github.com/vmware/govmomi/vim25/types/enum.go
generated
vendored
454
vendor/github.com/vmware/govmomi/vim25/types/enum.go
generated
vendored
|
|
@ -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() {
|
||||
|
|
|
|||
6
vendor/github.com/vmware/govmomi/vim25/types/helpers.go
generated
vendored
6
vendor/github.com/vmware/govmomi/vim25/types/helpers.go
generated
vendored
|
|
@ -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)
|
||||
}
|
||||
|
|
|
|||
34
vendor/github.com/vmware/govmomi/vim25/types/if.go
generated
vendored
34
vendor/github.com/vmware/govmomi/vim25/types/if.go
generated
vendored
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
590
vendor/github.com/vmware/govmomi/vim25/types/types.go
generated
vendored
590
vendor/github.com/vmware/govmomi/vim25/types/types.go
generated
vendored
File diff suppressed because it is too large
Load diff
18
vendor/github.com/vmware/govmomi/vim25/xml/marshal.go
generated
vendored
18
vendor/github.com/vmware/govmomi/vim25/xml/marshal.go
generated
vendored
|
|
@ -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) {
|
||||
|
|
|
|||
18
vendor/github.com/vmware/govmomi/vim25/xml/read.go
generated
vendored
18
vendor/github.com/vmware/govmomi/vim25/xml/read.go
generated
vendored
|
|
@ -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
|
||||
|
|
|
|||
24
vendor/github.com/vmware/govmomi/vim25/xml/typeinfo.go
generated
vendored
24
vendor/github.com/vmware/govmomi/vim25/xml/typeinfo.go
generated
vendored
|
|
@ -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()
|
||||
|
|
|
|||
9
vendor/github.com/vmware/govmomi/vim25/xml/xml.go
generated
vendored
9
vendor/github.com/vmware/govmomi/vim25/xml/xml.go
generated
vendored
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
|
|||
35
vendor/github.com/vmware/govmomi/vsan/vsanfs/types/enum.go
generated
vendored
Normal file
35
vendor/github.com/vmware/govmomi/vsan/vsanfs/types/enum.go
generated
vendored
Normal file
|
|
@ -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())
|
||||
}
|
||||
33
vendor/github.com/vmware/govmomi/vsan/vsanfs/types/types.go
generated
vendored
Normal file
33
vendor/github.com/vmware/govmomi/vsan/vsanfs/types/types.go
generated
vendored
Normal file
|
|
@ -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())
|
||||
}
|
||||
9
vendor/modules.txt
vendored
9
vendor/modules.txt
vendored
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue